Skip to content

Commit ebfcab1

Browse files
committed
Add option for deleting the database for a SearcholecularFormulasLC search
1 parent 541f2e9 commit ebfcab1

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

corems/molecular_id/search/molecularFormulaSearch.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,10 @@ def __init__(self, lcms_obj, sql_db=None, first_hit=False, find_isotopologues=Tr
906906
else:
907907
self.sql_db = sql_db
908908

909+
def delete_db(self):
910+
"""Delete the database."""
911+
self.sql_db.purge()
912+
909913
def search_spectra_against_candidates(self, mass_spectrum_list, ms_peaks_list, candidate_formulas, ion_type, ion_charge):
910914
"""Search a list of mass spectra against a list of candidate formulas with a given ion type and charge.
911915
@@ -977,7 +981,8 @@ def bulk_run_molecular_formula_search(self, mass_spectrum_list, ms_peaks_list, m
977981

978982
# check database for all possible molecular formula combinations based on the setting passed to self.mass_spectrum_obj.molecular_search_settings
979983
classes = MolecularCombinations(self.sql_db).runworker(
980-
self.lcms_obj.parameters.mass_spectrum[mass_spectrum_setting_key].molecular_search
984+
self.lcms_obj.parameters.mass_spectrum[mass_spectrum_setting_key].molecular_search,
985+
print_time=self.lcms_obj.parameters.mass_spectrum[mass_spectrum_setting_key].molecular_search.verbose_processing
981986
)
982987

983988
# split the database load to not blowout the memory

support_code/nmdc/lipidomics/lipidomics_workflow.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,8 @@ def run_lipid_sp_ms1(
390390
add_mass_features(myLCMSobj, scan_translator)
391391
myLCMSobj.remove_unprocessed_data()
392392
#myLCMSobj.parameters.mass_spectrum['ms1'].molecular_search.verbose_processing = False
393-
#if ms1_molecular_search:
394-
# molecular_formula_search(myLCMSobj)
393+
if ms1_molecular_search:
394+
molecular_formula_search(myLCMSobj)
395395
export_results(myLCMSobj, out_path=out_path, final=False)
396396
save_times(myLCMSobj, time_start, out_path)
397397
if return_mzs:
@@ -613,9 +613,9 @@ def run_lipid_workflow(
613613
if __name__ == "__main__":
614614
# Set input variables to run
615615
cores = 1
616-
file_dir = Path("tmp_data/thermo_raw_mini")
617-
out_dir = Path("tmp_data/_test_241216")
618-
params_toml = Path("tmp_data/EMSL_lipidomics_params.toml")
616+
file_dir = Path("/Users/heal742/Library/CloudStorage/OneDrive-PNNL/Documents/_DMS_data/_NMDC/_blanchard_lipidomics")
617+
out_dir = Path("tmp_data/_test_241218")
618+
params_toml = Path("/Users/heal742/LOCAL/05_NMDC/02_MetaMS/data_processing/configurations/emsl_lipidomics_corems_params.toml")
619619
metab_ref_token = Path("tmp_data/thermo_raw_collection/metabref.token")
620620
verbose = True
621621
scan_translator = Path("tmp_data/thermo_raw_collection/scan_translator.toml")

0 commit comments

Comments
 (0)