Skip to content

Commit 973bef7

Browse files
committed
debugging SRFA plots
1 parent 87e4c27 commit 973bef7

5 files changed

Lines changed: 21 additions & 12 deletions

File tree

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ docker-build:
7272

7373
docker-build-local:
7474

75-
docker build -t local-enviroms:$(version) .
76-
75+
docker build --pull --no-cache -t local-enviroms:latest .
7776

7877
docker-run-di:
7978

configuration/di_corems.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,17 @@ implemented_kendrick_rounding_methods = [ "floor", "ceil", "round",]
7777
peak_derivative_threshold = 0.0
7878
peak_min_prominence_percent = 0.1
7979
min_peak_datapoints = 5.0
80-
peak_max_prominence_percent = 0.1
80+
peak_max_prominence_percent = 1
8181
peak_height_max_percent = 10.0
8282
legacy_resolving_power = true
8383
centroid_legacy_polyfit = false
8484

8585
[MolecularFormulaSearch.usedAtoms]
8686
C = [ 1, 100,]
87-
H = [ 1, 200,]
87+
H = [ 4, 200,]
88+
O = [ 0, 22,]
89+
N = [ 0, 1,]
90+
S = [ 0, 1,]
8891

8992
[MolecularFormulaSearch.used_atom_valences]
9093
C = 4

configuration/di_enviroms.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ is_centroid = true
99
corems_toml_path = "configuration/di_corems.toml"
1010
calibrate = true
1111
batch_calibrate = true
12-
calibration_ref_file_path = "./data/reference/SRFA.ref"
12+
calibration_ref_file_path = "./data/reference/Hawkes_neg.ref"
1313
plot_mz_error = true
1414
plot_ms_assigned_unassigned = true
1515
plot_c_dbe = true

db/molformulas.sqlite

9.13 MB
Binary file not shown.

enviroMS/diWorkflow.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from corems.transient.input.brukerSolarix import ReadBrukerSolarix
2323
from corems.encapsulation.output import parameter_to_dict
2424
import matplotlib as mpl
25+
mpl.use("TkAgg")
2526
from matplotlib import pyplot as plt
2627
from matplotlib import gridspec as gridspec
2728
from tqdm import tqdm
@@ -268,11 +269,14 @@ def create_plots(mass_spectrum, workflow_params, dirloc):
268269

269270
# Create QC plots
270271
if workflow_params.plot_qc:
271-
ms_df = mass_spectrum.to_dataframe()
272-
qc_fig, qc_axes = create_qc_figure(mass_spectrum, ms_df, title=mass_spectrum.sample_name, hspace=0.25, wspace=0.35)
273-
qc_fig.savefig(qc_plot_dirloc / "{}_qc.png".format(mass_spectrum.sample_name), dpi=100, bbox_inches='tight')
274-
plt.close(qc_fig)
275-
plt.close('all')
272+
if workflow_params.calibrate:
273+
ms_df = mass_spectrum.to_dataframe()
274+
qc_fig, qc_axes = create_qc_figure(mass_spectrum, ms_df, title=mass_spectrum.sample_name, hspace=0.25, wspace=0.35)
275+
qc_fig.savefig(qc_plot_dirloc / "{}_qc.png".format(mass_spectrum.sample_name), dpi=100, bbox_inches='tight')
276+
plt.close(qc_fig)
277+
plt.close('all')
278+
else:
279+
"QC plots rely on calibrated data, either enable calibration or disable QC plotting"
276280

277281

278282
def create_qc_figure(msobj, msdf, title='QC Plot', figsize=(24, 10), nrows=2, ncols=4, hspace=0.22, wspace=0.22):
@@ -479,7 +483,7 @@ def find_calibration_for_batch(workflow_params):
479483
srfa_path = srfa_path[0]
480484

481485
# Remove the SRFA file you used from the file list so it's not in the output
482-
workflow_params.file_paths.remove(srfa_path)
486+
#workflow_params.file_paths.remove(srfa_path)
483487

484488
# Determine data file type and read in the mass spectrum
485489
mass_spectrum = read_fticr_raw_data(srfa_path, workflow_params)
@@ -508,7 +512,10 @@ def find_calibration_for_batch(workflow_params):
508512
mass_spectrum_by_classes = HeteroatomsClassification(
509513
mass_spectrum, choose_molecular_formula=False
510514
)
511-
mass_spectrum_by_classes.plot_mz_error()
515+
mzplot = mass_spectrum_by_classes.plot_mz_error()
516+
# scatter_plot = mzplot.collections[0]
517+
# scatter_plot.set_sizes([1])
518+
# plt.show()
512519
mz_error = mass_spectrum_by_classes.mz_error_all()
513520

514521
# Get 5th and 95th percentile of error to use as search error max/min

0 commit comments

Comments
 (0)