Skip to content

Commit 7fd4a0c

Browse files
changing output files to have more descriptive names
1 parent 44f6b7c commit 7fd4a0c

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

enviroMS/LC_FTICR_workflow.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ def peak_height_similar(df, tolerance=0.99): # 10% tolerance
311311
return filtered_df
312312

313313
### create plots
314-
def plot_van_krevelen_all_ids(all_msdfs_path, output_dir):
314+
def plot_van_krevelen_all_ids(all_msdfs_path, output_dir, output_name):
315315
"""
316316
Plot a van Krevelen diagram for all IDs in the provided DataFrame or CSV file.
317317
Parameters:
@@ -347,10 +347,10 @@ def plot_van_krevelen_all_ids(all_msdfs_path, output_dir):
347347
ax.set_ylabel('H/C')
348348
ax.set_xlim(0,1.25)
349349
ax.set_ylim(0.25,2.25)
350-
fig.savefig(output_dir+'van_kreelen_AllIDs.png',dpi=300,bbox_inches='tight')
350+
fig.savefig(output_dir + output_name + '_van_kreelen_AllIDs.png',dpi=300,bbox_inches='tight')
351351
plt.show()
352352

353-
def plot_van_krevelen_individual(all_msdfs_path, output_dir):
353+
def plot_van_krevelen_individual(all_msdfs_path, output_dir, output_name):
354354
"""
355355
Plot individual van Krevelen diagrams for each time block in the provided DataFrame or CSV file.
356356
Parameters:
@@ -398,9 +398,9 @@ def plot_van_krevelen_individual(all_msdfs_path, output_dir):
398398

399399
# Show the plot
400400
plt.show()
401-
fig.savefig(output_dir+'TimeBlockIDs.png',dpi=300,bbox_inches='tight')
401+
fig.savefig(output_dir + output_name +'_TimeBlockIDs.png',dpi=300,bbox_inches='tight')
402402

403-
def plot_properties(summary_df_path,output_dir):
403+
def plot_properties(summary_df_path,output_dir,output_name):
404404
"""
405405
Plot trends and distributions of various properties from the summary DataFrame or CSV file.
406406
Parameters:
@@ -443,7 +443,7 @@ def plot_properties(summary_df_path,output_dir):
443443

444444
# Adjust layout
445445
plt.tight_layout()
446-
fig.savefig(output_dir+'property_plots.png',dpi=300,bbox_inches='tight')
446+
fig.savefig(output_dir + output_name + '_property_plots.png',dpi=300,bbox_inches='tight')
447447
plt.show()
448448

449449
################################### RUN LC-FTICR WORKFLOW ###################################
@@ -471,11 +471,11 @@ def run_LC_FTICR_workflow(lc_fticr_workflow_paramaters_toml_file):
471471
all_msdfs_df, all_statdics_df = lc_object.process_with_time_block(tic_df)
472472
summary_df = lc_object.create_summary(all_statdics=all_statdics_df)
473473
if lc_object.do_plot_van_krevelen_all_ids:
474-
plot_van_krevelen_all_ids(all_msdfs_df, lc_object.output_directory)
474+
plot_van_krevelen_all_ids(all_msdfs_df, lc_object.output_directory, lc_object.output_file_name)
475475
if lc_object.do_plot_van_krevelen_individual:
476-
plot_van_krevelen_individual(all_msdfs_df, lc_object.output_directory)
476+
plot_van_krevelen_individual(all_msdfs_df, lc_object.output_directory, lc_object.output_file_name)
477477
if lc_object.do_plot_properties:
478-
plot_properties(summary_df, lc_object.output_directory)
478+
plot_properties(summary_df, lc_object.output_directory, lc_object.output_file_name)
479479
return()
480480

481481
def run_LC_FTICR_workflow_wdl(
@@ -548,10 +548,10 @@ def run_LC_FTICR_workflow_wdl(
548548
all_msdfs_df, all_statdics_df = lc_object.process_with_time_block(tic_df)
549549
summary_df = lc_object.create_summary(all_statdics=all_statdics_df)
550550
if lc_object.do_plot_van_krevelen_all_ids:
551-
plot_van_krevelen_all_ids(all_msdfs_df, lc_object.output_directory)
551+
plot_van_krevelen_all_ids(all_msdfs_df, lc_object.output_directory, lc_object.output_file_name)
552552
if lc_object.do_plot_van_krevelen_individual:
553-
plot_van_krevelen_individual(all_msdfs_df, lc_object.output_directory)
553+
plot_van_krevelen_individual(all_msdfs_df, lc_object.output_directory, lc_object.output_file_name)
554554
if lc_object.do_plot_properties:
555-
plot_properties(summary_df, lc_object.output_directory)
555+
plot_properties(summary_df, lc_object.output_directory, lc_object.output_file_name)
556556
click.echo("LC-FTICR workflow complete")
557557
return()

0 commit comments

Comments
 (0)