diff --git a/NEG_ESI_SRFA_CoreMS_prob_score.csv b/NEG_ESI_SRFA_CoreMS_prob_score.csv new file mode 100644 index 00000000..9de5fc62 --- /dev/null +++ b/NEG_ESI_SRFA_CoreMS_prob_score.csv @@ -0,0 +1,21 @@ +Index,m/z,Calibrated m/z,Calculated m/z,Peak Height,Peak Area,Resolving Power,S/N,Ion Charge,m/z Error (ppm),m/z Error Score,Isotopologue Similarity,Confidence Score,DBE,H/C,O/C,Heteroatom Class,Ion Type,Adduct,Is Isotopologue,Mono Isotopic Index,Molecular Formula,C,H,O,N +0,576.0751562737335,576.0751562737335,576.0756831376291,2019730.8188135864,nan,159720.69595125286,8.604138304064543,-1,-0.9145740933897943,0.8591841639497192,0.0,0.5155104983698315,16.0,0.8,0.64,O16 -R,radical,,0,,C25 H20 O16,25,20,16, +1,585.0773168347159,585.0773168347159,584.069022064519,1746260.2046435073,nan,275209.4679144153,7.43914197658413,-1,1726.3281086760753,0.0,0.0,0.0,35.5,0.3170731707317073,0.12195121951219512,O5,de-protonated,,0,,C41 H13 O5,41,13,5, +2,593.0820452356501,593.0820452356501,592.074107444949,6469034.8640819015,nan,180997.3119366648,27.55836082011744,-1,1702.3845123893364,0.0,0.0,0.0,37.5,0.3023255813953488,0.09302325581395349,O4,de-protonated,,0,,C43 H13 O4,43,13,4, +3,597.0754291924612,597.0754291924612,597.076017490259,2068238.426915153,nan,134839.10894778575,8.810782756393296,-1,-0.9852979864257353,0.8384900332430503,0.0,0.5030940199458301,19.0,0.7037037037037037,0.5555555555555556,N1 O15 -R,radical,,0,,C27 H19 O15 N1,27,19,15,1 +4,605.0809297183079,605.0809297183079,605.081102870689,4934544.835880899,nan,152063.12451789412,21.02136870915638,-1,-0.2861639214521796,0.9852510523460122,0.0,0.5911506314076073,21.0,0.6551724137931034,0.4827586206896552,N1 O14 -R,radical,,0,,C29 H19 O14 N1,29,19,14,1 +5,567.0647395512881,567.0647395512881,,3868906.6064003,nan,162257.55310330895,16.481704995981246,-1,,,,,,,,unassigned,,,,,,,,, +6,567.0663087811229,567.0663087811229,,5463881.346367143,nan,162258.1245318804,23.276364525029468,-1,,,,,,,,unassigned,,,,,,,,, +7,575.0713087215903,575.0713087215903,,9739433.203502472,nan,186665.9786183644,41.49039540593753,-1,,,,,,,,unassigned,,,,,,,,, +8,580.0696581879541,580.0696581879541,,1759661.6215911638,nan,185057.4786056693,7.496232576882939,-1,,,,,,,,unassigned,,,,,,,,, +9,583.0745286807011,583.0745286807011,,3341444.3943076613,nan,157802.2673899728,14.234693770159195,-1,,,,,,,,unassigned,,,,,,,,, +10,583.0764232748777,583.0764232748777,,4624182.129382659,nan,157802.6959610134,19.69921051547032,-1,,,,,,,,unassigned,,,,,,,,, +11,587.0717089529447,587.0717089529447,,9364333.081322271,nan,156728.69594017448,39.89245309647384,-1,,,,,,,,unassigned,,,,,,,,, +12,588.0748249834461,588.0748249834461,,2102297.732396686,nan,273806.7179139468,8.955876831392676,-1,,,,,,,,unassigned,,,,,,,,, +13,595.0748319653359,595.0748319653359,,2248638.4360681637,nan,135292.60896146248,9.57929438890816,-1,,,,,,,,unassigned,,,,,,,,, +14,595.0769607848,595.0769607848,,2614726.533038756,nan,135293.10896192447,11.138845091638458,-1,,,,,,,,unassigned,,,,,,,,, +15,597.0775112334587,597.0775112334587,,2624788.5554853342,nan,154102.55308819498,11.18170973079855,-1,,,,,,,,unassigned,,,,,,,,, +16,601.0851016849045,601.0851016849045,,3264511.328060631,nan,133939.60894898468,13.906955669626551,-1,,,,,,,,unassigned,,,,,,,,, +17,605.0824960183015,605.0824960183015,,5173077.227051935,nan,152063.55308892002,22.03752673601681,-1,,,,,,,,unassigned,,,,,,,,, +18,613.0848231619533,613.0848231619533,,2643269.346562413,nan,116727.207961776,11.26043867869326,-1,,,,,,,,unassigned,,,,,,,,, +19,613.0872526006148,613.0872526006148,,4497043.9691487,nan,350181.62381927815,19.157596601285515,-1,,,,,,,,unassigned,,,,,,,,, diff --git a/NEG_ESI_SRFA_CoreMS_prob_score.json b/NEG_ESI_SRFA_CoreMS_prob_score.json new file mode 100644 index 00000000..bf811c88 --- /dev/null +++ b/NEG_ESI_SRFA_CoreMS_prob_score.json @@ -0,0 +1,201 @@ +{ + "MassSpecAttrs": { + "Aterm": null, + "Bterm": null, + "Cterm": null, + "baseline_noise": 1746260.2046435073, + "baseline_noise_std": 0.0, + "mobility_rt": 0, + "mobility_scan": 0, + "polarity": -1, + "rt": 0, + "tic": 80568004.66102132 + }, + "MassSpecPeak": { + "implemented_kendrick_rounding_methods": [ + "floor", + "ceil", + "round" + ], + "kendrick_base": { + "C": 1, + "H": 2 + }, + "kendrick_rounding_method": "floor", + "legacy_resolving_power": true, + "min_peak_datapoints": 5.0, + "peak_derivative_threshold": 0.0, + "peak_height_max_percent": 10.0, + "peak_max_prominence_percent": 0.1, + "peak_min_prominence_percent": 0.1 + }, + "MassSpectrum": { + "calib_minimize_method": "Powell", + "calib_pol_order": 2, + "calib_sn_threshold": 2.0, + "do_calibration": true, + "max_calib_ppm_error": 1.0, + "max_picking_mz": 1200.0, + "min_calib_ppm_error": -1.0, + "min_picking_mz": 50.0, + "noise_max_mz": 1200.0, + "noise_min_mz": 50.0, + "noise_threshold_absolute_abundance": 1000000.0, + "noise_threshold_log_nsigma": 6, + "noise_threshold_log_nsigma_bins": 500, + "noise_threshold_log_nsigma_corr_factor": 0.463, + "noise_threshold_method": "relative_abundance", + "noise_threshold_methods_implemented": [ + "minima", + "signal_noise", + "relative_abundance", + "absolute_abundance", + "log" + ], + "noise_threshold_min_relative_abundance": 1, + "noise_threshold_min_s2n": 4.0, + "noise_threshold_min_std": 6, + "picking_point_extrapolate": 3 + }, + "MolecularFormulaSearch": { + "adduct_atoms_neg": [ + "Cl", + "Br" + ], + "adduct_atoms_pos": [ + "Na", + "K" + ], + "db_chunk_size": 300, + "db_jobs": 3, + "error_method": "None", + "ion_charge": -1, + "ionization_type": "ESI", + "isAdduct": false, + "isProtonated": true, + "isRadical": false, + "isotopologue_filter_atoms": [ + "Cl", + "Br" + ], + "isotopologue_filter_threshold": 33.0, + "isotopologue_score_weight": 0.4, + "max_abun_error": 100.0, + "max_dbe": 40.0, + "max_hc_filter": 3.0, + "max_oc_filter": 1.2, + "max_ppm_error": 10.0, + "min_abun_error": -100.0, + "min_dbe": 0.0, + "min_hc_filter": 0.3, + "min_oc_filter": 0.0, + "min_op_filter": 2.0, + "min_peaks_per_class": 15, + "min_ppm_error": -10.0, + "mz_error_average": 0.0, + "mz_error_range": 1.5, + "mz_error_score_weight": 0.6, + "output_min_score": 0.1, + "output_score_method": "prob_score", + "score_method": "prob_score", + "score_methods": [ + "S_P_lowest_error", + "N_S_P_lowest_error", + "lowest_error", + "prob_score", + "air_filter_error", + "water_filter_error", + "earth_filter_error" + ], + "url_database": "postgresql+psycopg2://coremsappdb:coremsapppnnl@molformdb:5432/coremsapp", + "use_isotopologue_filter": false, + "use_min_peaks_filter": true, + "use_pah_line_rule": false, + "use_runtime_kendrick_filter": false, + "usedAtoms": { + "C": [ + 1, + 100 + ], + "H": [ + 1, + 200 + ] + }, + "used_atom_valences": { + "13C": 4, + "Ac": 3, + "Ag": 0, + "Al": 3, + "As": 5, + "At": 1, + "Au": 3, + "B": 4, + "Ba": 2, + "Be": 2, + "Bi": 3, + "Br": 1, + "C": 4, + "Ca": 2, + "Cd": 2, + "Cl": 1, + "Co": 1, + "Cr": 1, + "Cs": 1, + "Cu": 2, + "F": 1, + "Fe": 3, + "Fr": 1, + "Ga": 3, + "Ge": 4, + "H": 1, + "Hf": 4, + "Hg": 1, + "I": 1, + "In": 3, + "Ir": 4, + "K": 1, + "La": 3, + "Li": 1, + "Mg": 2, + "Mn": 1, + "Mo": 6, + "N": 3, + "Na": 1, + "Nb": 5, + "Ni": 1, + "O": 2, + "Os": 4, + "P": 3, + "Pb": 4, + "Pd": 4, + "Po": 2, + "Pt": 4, + "Ra": 2, + "Rb": 1, + "Re": 4, + "Rh": 6, + "Ru": 8, + "S": 2, + "Sb": 5, + "Sc": 3, + "Se": 6, + "Si": 4, + "Sn": 4, + "Sr": 2, + "Ta": 5, + "Tc": 7, + "Te": 6, + "Ti": 4, + "Tl": 3, + "V": 5, + "W": 6, + "Y": 3, + "Zn": 2, + "Zr": 4 + } + }, + "analyzer": "Unknown", + "instrument_label": "Unknown", + "sample_name": "ESI_NEG_SRFA_COREMS" +} \ No newline at end of file diff --git a/README.md b/README.md index a48d4cbc..e47d79c8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![CoreMS Logo](https://github.com/EMSL-Computing/CoreMS/blob/v2.0.1/docs/CoreMS.COLOR_small.png?raw=true) +![CoreMS Logo](https://github.com/EMSL-Computing/CoreMS/tree/master/docs/CoreMS.COLOR_small.png?raw=true)
diff --git a/corems/mass_spectrum/factory/MassSpectrumClasses.py b/corems/mass_spectrum/factory/MassSpectrumClasses.py index ca6caa6b..80037efe 100644 --- a/corems/mass_spectrum/factory/MassSpectrumClasses.py +++ b/corems/mass_spectrum/factory/MassSpectrumClasses.py @@ -1376,6 +1376,8 @@ def __init__(self, data_dict, d_params, auto_process=True): self.is_centroid = True self.data_dict = data_dict + self._mz_exp = data_dict[Labels.mz] + self._abundance = data_dict[Labels.abundance] if auto_process: self.process_mass_spec() diff --git a/corems/mass_spectrum/input/massList.py b/corems/mass_spectrum/input/massList.py index 461d88e4..3eca50f7 100644 --- a/corems/mass_spectrum/input/massList.py +++ b/corems/mass_spectrum/input/massList.py @@ -83,6 +83,10 @@ def add_molecular_formula(self, mass_spec_obj, dataframe): ion_type_df = dataframe["Ion Type"] ion_charge_df = dataframe["Ion Charge"] is_isotopologue_df = dataframe['Is Isotopologue'] + if 'Adduct' in dataframe: + adduct_df = dataframe['Adduct'] + else: + adduct_df = None mass_spec_mz_exp_list = mass_spec_obj.mz_exp @@ -102,7 +106,11 @@ def add_molecular_formula(self, mass_spec_obj, dataframe): if sum(counts) > 0: ion_type = str(Labels.ion_type_translate.get(ion_type_df[df_index])) - mfobj = MolecularFormula(formula_list, int(ion_charge_df[df_index]), mspeak_parent=mass_spec_obj[ms_peak_index] , ion_type=ion_type) + if adduct_df is not None: + adduct_atom = str(adduct_df[df_index]) + else: + adduct_atom = None + mfobj = MolecularFormula(formula_list, int(ion_charge_df[df_index]), mspeak_parent=mass_spec_obj[ms_peak_index] , ion_type=ion_type, adduct_atom=adduct_atom) mfobj.is_isotopologue = bool(is_isotopologue_df[df_index]) mass_spec_obj[ms_peak_index].add_molecular_formula(mfobj) diff --git a/corems/mass_spectrum/input/numpyArray.py b/corems/mass_spectrum/input/numpyArray.py index 9ae12b6c..e3b676ca 100644 --- a/corems/mass_spectrum/input/numpyArray.py +++ b/corems/mass_spectrum/input/numpyArray.py @@ -7,19 +7,27 @@ from corems.encapsulation.constant import Labels def ms_from_array_profile(mz, abundance, dataname:str, polarity:int = -1, auto_process:bool = True, data_type:str = Labels.simulated_profile): - """ - Create a MassSpecProfile object from an array of m/z values and abundance values. + """Create a MassSpecProfile object from an array of m/z values and abundance values. - Parameters: - mz (numpy.ndarray): Array of m/z values. - abundance (numpy.ndarray): Array of abundance values. - dataname (str): Name of the data. - polarity (int, optional): Polarity of the data. Defaults to -1. - auto_process (bool, optional): Flag to automatically process the data. Defaults to True. - data_type (str, optional): Type of the data. Defaults to Labels.simulated_profile. + Parameters + ---------- + mz : numpy.ndarray + Array of m/z values. + abundance : numpy.ndarray + Array of abundance values. + dataname : str + Name of the data. + polarity : int, optional + Polarity of the data. The default is -1. + auto_process : bool, optional + Flag to automatically process the data. The default is True. + data_type : str, optional + Type of the data. The default is Labels.simulated_profile. - Returns: - MassSpecProfile: The created MassSpecProfile object. + Returns + ------- + MassSpecProfile + The created MassSpecProfile object. """ data_dict = {Labels.mz: mz, Labels.abundance: abundance} @@ -32,37 +40,50 @@ def ms_from_array_profile(mz, abundance, dataname:str, polarity:int = -1, auto_p return ms def ms_from_array_centroid(mz, abundance, rp:list[float], s2n:list[float], dataname:str, polarity:int=-1, auto_process:bool=True): - """ - Create a MassSpecCentroid object from an array of m/z values, abundance values, resolution power, and signal-to-noise ratio. + """Create a MassSpecCentroid object from an array of m/z values, abundance values, resolution power, and signal-to-noise ratio. - Parameters: - mz (numpy.ndarray): Array of m/z values. - abundance (numpy.ndarray): Array of abundance values. - rp list(float): Resolution power. - s2n list(float): Signal-to-noise ratio. - dataname (str): Name of the data. - polarity (int, optional): Polarity of the data. Defaults to -1. - auto_process (bool, optional): Flag to automatically process the data. Defaults to True. + Parameters + ---------- + mz : numpy.ndarray + Array of m/z values. + abundance : numpy.ndarray + Array of abundance values. + rp : list(float) + List of resolving power values. + s2n : list(float) + List of signal-to-noise ratio values. + dataname : str + Name of the data. + polarity : int, optional + Polarity of the data. The default is -1. + auto_process : bool, optional - Returns: - MassSpecCentroid: The created MassSpecCentroid object. + Returns + ------- + MassSpecCentroid + The created MassSpecCentroid object. """ data_dict = {Labels.mz: mz, Labels.abundance: abundance, Labels.s2n : s2n, Labels.rp: rp} output_parameters = get_output_parameters(polarity, dataname) - - return MassSpecCentroid(data_dict, output_parameters) + output_parameters[Labels.label] = Labels.corems_centroid + + return MassSpecCentroid(data_dict, output_parameters, auto_process) def get_output_parameters(polarity:int, file_location:str): - """ - Get the output parameters for creating a MassSpecProfile or MassSpecCentroid object. + """Generate the output parameters for creating a MassSpecProfile or MassSpecCentroid object. - Parameters: - polarity (int): Polarity of the data. - file_location (str): File location. + Parameters + ---------- + polarity : int + Polarity of the data. + file_location : str + File location. - Returns: - dict: Output parameters. + Returns + ------- + dict + Output parameters. """ d_params = default_parameters(file_location) diff --git a/corems/mass_spectrum/output/export.py b/corems/mass_spectrum/output/export.py index 9f64e513..ee240288 100644 --- a/corems/mass_spectrum/output/export.py +++ b/corems/mass_spectrum/output/export.py @@ -111,6 +111,7 @@ def _init_columns(self): 'O/C', 'Heteroatom Class', 'Ion Type', + 'Adduct', 'Is Isotopologue', 'Mono Isotopic Index', 'Molecular Formula' @@ -160,7 +161,6 @@ def run(self): def get_pandas_df(self): """Returns the mass spectrum data as a pandas DataFrame.""" - columns = self.columns_label + self.get_all_used_atoms_in_order(self.mass_spectrum) dict_data_list = self.get_list_dict_data(self.mass_spectrum) df = DataFrame(dict_data_list, columns=columns) @@ -563,6 +563,9 @@ def add_match_dict_data(index, ms_peak, mformula): 'Is Isotopologue': int(mformula.is_isotopologue), 'Molecular Formula': eval("mformula.string{}".format(encode)) } + + if mformula.adduct_atom: + dict_result['Adduct'] = eval("mformula.adduct_atom{}".format(encode)) if mformula.is_isotopologue: dict_result['Mono Isotopic Index'] = mformula.mspeak_index_mono_isotopic diff --git a/corems/molecular_formula/factory/MolecularFormulaFactory.py b/corems/molecular_formula/factory/MolecularFormulaFactory.py index 52c69584..3866aa17 100644 --- a/corems/molecular_formula/factory/MolecularFormulaFactory.py +++ b/corems/molecular_formula/factory/MolecularFormulaFactory.py @@ -98,9 +98,7 @@ class MolecularFormulaBase(MolecularFormulaCalc): def __init__(self, molecular_formula, ion_charge, ion_type=None, adduct_atom=None, mspeak_parent=None, external_mz=None): - # clear dictionary of atoms with 0 value - if type(molecular_formula) is dict: self._from_dict(molecular_formula, ion_type, adduct_atom) @@ -110,7 +108,6 @@ def __init__(self, molecular_formula, ion_charge, ion_type=None, elif type(molecular_formula) is str: self._from_str(molecular_formula, ion_type, adduct_atom) - self._ion_charge = ion_charge self._external_mz = external_mz self._confidence_score = None @@ -178,8 +175,10 @@ def _from_dict(self, molecular_formula, ion_type, adduct_atom): if ion_type: self._d_molecular_formula[Labels.ion_type] = ion_type + self.adduct_atom = None if adduct_atom: + self.adduct_atom = adduct_atom if adduct_atom in self._d_molecular_formula: self._d_molecular_formula[adduct_atom] += 1 else: self._d_molecular_formula[adduct_atom] = 1 @@ -198,9 +197,12 @@ def _from_list(self, molecular_formula_list, ion_type, adduct_atom): self._d_molecular_formula[Labels.ion_type] = ion_type if adduct_atom: + self.adduct_atom = adduct_atom if adduct_atom in self._d_molecular_formula: self._d_molecular_formula[adduct_atom] += 1 else: self._d_molecular_formula[adduct_atom] = 1 + else: + self.adduct_atom = None def _from_str(self, molecular_formula_str, ion_type, adduct_atom): # string has to be in the format @@ -317,7 +319,11 @@ def ion_type(self, ion_type): def ion_charge(self): return self._ion_charge @property - def atoms(self): return [key for key in self._d_molecular_formula.keys() if key != Labels.ion_type] + def atoms(self): + """Get the atoms in the molecular formula.""" + ion_mol_form_keys = list(self._d_molecular_formula.keys()) + mol_form_keys = ion_mol_form_keys[:ion_mol_form_keys.index(Labels.ion_type)] + return mol_form_keys @property def confidence_score(self): @@ -414,11 +420,14 @@ def atoms_symbol(self, atom): @property def string(self): - + """Returns the molecular formula as a string.""" if self._d_molecular_formula: + # Get keys that are associated with the molecular formula + ion_mol_form_keys = list(self._d_molecular_formula.keys()) + mol_form_keys = ion_mol_form_keys[:ion_mol_form_keys.index(Labels.ion_type)] formula_srt = '' for atom in Atoms.atoms_order: - if atom in self.to_dict().keys(): + if atom in mol_form_keys: formula_srt += atom + str(int(self.to_dict().get(atom))) + ' ' return formula_srt.strip() diff --git a/corems/ms_peak/calc/MSPeakCalc.py b/corems/ms_peak/calc/MSPeakCalc.py index d2a55258..8fb1e2e0 100644 --- a/corems/ms_peak/calc/MSPeakCalc.py +++ b/corems/ms_peak/calc/MSPeakCalc.py @@ -717,9 +717,11 @@ def molecular_formula_earth_filter(self, lowest_error=True): """ candidates = list(filter(lambda mf: mf.get("O") > 0 and mf.get("N") <=3 and mf.get("P") <= 2 and (3 * mf.get("P")) <= mf.get("O"), self.molecular_formulas)) - - if lowest_error: - return min(candidates, key=lambda m: abs(m.mz_error)) + if len(candidates) >0: + if lowest_error: + return min(candidates, key=lambda m: abs(m.mz_error)) + else: + return candidates else: return candidates @@ -752,9 +754,11 @@ def molecular_formula_water_filter(self, lowest_error=True): """ candidates = list(filter(lambda mf: mf.get("O") > 0 and mf.get("N") <=3 and mf.get("S") <=2 and mf.get("P") <= 2, self.molecular_formulas)) - - if lowest_error: - return min(candidates, key=lambda m: abs(m.mz_error)) + if len(candidates) >0: + if lowest_error: + return min(candidates, key=lambda m: abs(m.mz_error)) + else: + return candidates else: return candidates @@ -789,8 +793,11 @@ def molecular_formula_air_filter(self, lowest_error=True): candidates = list(filter(lambda mf: mf.get("O") > 0 and mf.get("N") <=2 and mf.get("S") <=1 and mf.get("P") == 0 and 3* (mf.get("S") + mf.get("N")) <= mf.get("O"), self.molecular_formulas)) - if lowest_error: - return min(candidates, key=lambda m: abs(m.mz_error)) + if len(candidates) >0: + if lowest_error: + return min(candidates, key=lambda m: abs(m.mz_error)) + else: + return candidates else: return candidates diff --git a/docs/corems.html b/docs/corems.html index 0dfc7807..d072e42b 100644 --- a/docs/corems.html +++ b/docs/corems.html @@ -28,7 +28,6 @@

Contents

-
-

CoreMS

CoreMS is a comprehensive mass spectrometry framework for software development and data analysis of small molecules analysis.

@@ -160,14 +158,10 @@

CoreMS

  • dynamic molecular search space database search and generator
  • -
    -

    Current Version

    2.0

    -
    -

    Main Developers/Contact

    -
    - -

    Contributing

    - -

    As an open source project, CoreMS welcomes contributions of all forms. Before contributing, please see our Dev Guide

    - -
    -

    Data formats

    Data input formats

    @@ -472,26 +458,20 @@

    Simple Script Example

    -
    -

    UML Diagrams

    UML (unified modeling language) diagrams for Direct Infusion FT-MS and GC-MS classes can be found here.

    -
    -

    Citing CoreMS

    If you use CoreMS in your work, please use the following citation: -Version 2.0.0 Release on GitHub, archived on Zenodo:

    +Version 2.0 Release on GitHub, archived on Zenodo:

    DOI

    -
    Yuri E. Corilo, William R. Kew, Lee Ann McCue (2021, March 27). EMSL-Computing/CoreMS: CoreMS 2.0.0 (Version v2.0.0), as developed on Github. Zenodo. http://doi.org/10.5281/zenodo.4641552
    +
    Yuri E. Corilo, William R. Kew, Lee Ann McCue (2021, March 27). EMSL-Computing/CoreMS: CoreMS 2.0 (Version v2.0), as developed on Github. Zenodo. http://doi.org/10.5281/zenodo.4641552
     
    -
    -

    This material was prepared as an account of work sponsored by an agency of the United States Government. Neither the United States Government nor the United States Department of Energy, nor Battelle, nor any of their employees, nor any @@ -521,143 +501,470 @@

    Citing CoreMS

    -
      1"""
    -  2.. include:: ../README.md
    -  3"""
    -  4
    -  5__author__ = 'Yuri E. Corilo'
    -  6__version__ = '2.0.0'
    -  7
    -  8import time
    -  9import os
    - 10import sys
    - 11import hashlib
    - 12
    - 13
    - 14def timeit(method):
    - 15    def timed(*args, **kw):
    - 16        ts = time.time()
    - 17        result = method(*args, **kw)
    - 18        te = time.time()
    - 19        if 'log_time' in kw:
    - 20            name = kw.get('log_name', method.__name__.upper())
    - 21            kw['log_time'][name] = int((te - ts) * 1000)
    - 22        else:
    - 23            print("%r  %2.2f ms" % (method.__name__, (te - ts) * 1000))
    - 24        return result
    - 25    return timed
    - 26
    - 27
    - 28class SuppressPrints:
    - 29
    - 30    def __enter__(self):
    - 31        self._original_stdout = sys.stdout
    - 32        sys.stdout = open(os.devnull, 'w')
    +                        
      1__author__ = 'Yuri E. Corilo'
    +  2__version__ = '2.0.4'
    +  3__doc__ = '''
    +  4<div align="left">
    +  5
    +  6<br>
    +  7<br>
    +  8<a href="https://doi.org/10.5281/zenodo.4641552"><img src="https://zenodo.org/badge/DOI/10.5281/zenodo.4641552.svg" alt="CoreMS DOI" style="width:150px;height:25px;"></a>
    +  9<br>
    + 10</div>
    + 11
    + 12***
    + 13# Table of Contents  
    + 14- Introduction
    + 15  - [CoreMS](#CoreMS)  
    + 16  - [Current Version](#current-version)  
    + 17  - [Contact Information](#main-developers/contact )  
    + 18  - [Data Input](#data-input-formats)  
    + 19  - [Data Output](#data-output-formats)  
    + 20  - [Data Structure](#data-structure-types)  
    + 21  - [Features](#available-features)  
    + 22  - [Overview Slides](examples/CoreMS-Overview.pdf)
    + 23  - [Framework Documentation](https://emsl-computing.github.io/CoreMS/)
    + 24- Installation  
    + 25  - [Installation](#corems-installation)  
    + 26  - [Thermo Raw File on Mac and Linux](#thermo-raw-file-access)  
    + 27- Execution:     
    + 28  - [Jupyter Notebook and Docker containers](#docker-stack)  
    + 29  - [Simple Example](#simple-script-example)  
    + 30  - [Python Examples](examples/scripts)
    + 31  - [Jupyter Notebook Examples](examples/notebooks)  
    + 32  
      33
    - 34    def __exit__(self, exc_type, exc_val, exc_tb):
    - 35        sys.stdout.close()
    - 36        sys.stdout = self._original_stdout
    + 34- Sibling Projects:     
    + 35    - [EnviroMS](https://github.com/EMSL-Computing/EnviroMS)  
    + 36    - [MetaMS](https://github.com/EMSL-Computing/MetaMS)  
      37
    - 38def get_filenames(app=None):
    + 38# CoreMS
      39
    - 40    from PySide2.QtCore import Qt, QCoreApplication
    - 41    from PySide2.QtWidgets import QApplication, QFileDialog
    - 42    from pathlib import Path
    + 40**CoreMS** is a comprehensive mass spectrometry framework for software development and data analysis of small molecules analysis.
    + 41
    + 42Data handling and software development for modern mass spectrometry (MS) is an interdisciplinary endeavor requiring skills in computational science and a deep understanding of MS. To enable scientific software development to keep pace with fast improvements in MS technology, we have developed a Python software framework named CoreMS. The goal of the framework is to provide a fundamental, high-level basis for working with all mass spectrometry data types, allowing custom workflows for data signal processing, annotation, and curation. The data structures were designed with an intuitive, mass spectrometric hierarchical structure, thus allowing organized and easy access to the data and calculations. Moreover, CoreMS supports direct access for almost all vendors’ data formats, allowing for the centralization and automation of all data processing workflows from the raw signal to data annotation and curation.
      43
    - 44    app = QApplication(sys.argv)
    - 45    file_dialog = QFileDialog()
    - 46    file_dialog.setWindowFlags(Qt.WindowStaysOnTopHint)
    - 47    file_location, _ = file_dialog.getOpenFileNames()
    - 48
    - 49    if file_location:
    - 50        QCoreApplication.processEvents()
    - 51        return file_location
    - 52
    - 53    else:
    - 54
    - 55        return None
    - 56
    - 57def get_filename(app=None):
    - 58
    - 59    from PySide2.QtCore import Qt, QCoreApplication
    - 60    from PySide2.QtWidgets import QApplication, QFileDialog
    - 61    from pathlib import Path
    - 62
    - 63    app = QApplication(sys.argv)
    - 64    file_dialog = QFileDialog()
    - 65    file_dialog.setWindowFlags(Qt.WindowStaysOnTopHint)
    - 66    file_location, _ = file_dialog.getOpenFileName()
    - 67
    - 68    if file_location:
    - 69        QCoreApplication.processEvents()
    - 70        return Path(file_location)
    - 71
    - 72    else:
    - 73
    - 74        return None
    - 75
    - 76def get_dirname(app=None):
    - 77
    - 78    from PySide2.QtCore import Qt, QCoreApplication
    - 79    from PySide2.QtWidgets import QApplication, QFileDialog 
    - 80    from pathlib import Path
    - 81
    - 82    app = QApplication(sys.argv)
    - 83    file_dialog = QFileDialog()
    - 84    file_dialog.setWindowFlags(Qt.WindowStaysOnTopHint)
    - 85    file_location = file_dialog.getExistingDirectory()
    - 86
    - 87    if file_location:
    - 88        QCoreApplication.processEvents()
    - 89        return Path(file_location)
    + 44CoreMS aims to provide 
    + 45- logical mass spectrometric data structure
    + 46- self-containing data and metadata storage
    + 47- modern molecular formulae assignment algorithms
    + 48- dynamic molecular search space database search and generator
    + 49
    + 50## Current Version
    + 51
    + 52 `2.0`
    + 53
    + 54## Main Developers/Contact 
    + 55- [Yuri. E. Corilo](mailto:corilo@pnnl.gov)  
    + 56- [William Kew](mailto:william.kew@pnnl.gov)
    + 57
    + 58## Data formats
    + 59### Data input formats
    + 60
    + 61- Bruker Solarix (CompassXtract)
    + 62- Bruker Solarix transients, ser and fid (FT magnitude mode only)
    + 63- ThermoFisher (.raw)
    + 64- Spectroswiss signal booster data-acquisition station (.hdf5)
    + 65- MagLab ICR data-acquisition station (FT and magnitude mode) (.dat)
    + 66- ANDI NetCDF for GC-MS (.cdf)
    + 67- Generic mass list in profile and centroid mde (include all delimiters types and Excel formats)
    + 68- CoreMS exported processed mass list files(excel, .csv, .txt, pandas dataframe as .pkl)
    + 69- CoreMS self-containing Hierarchical Data Format (.hdf5)
    + 70- Pandas Dataframe
    + 71- Support for cloud Storage using s3path.S3path(see examples of usage here: [S3 Support](tests/s3_test.py))
    + 72
    + 73### Data output formats
    + 74
    + 75- Pandas data frame (can be saved using pickle, h5, etc)
    + 76- Text Files (.csv, tab separated .txt, etc)
    + 77- Microsoft Excel (xlsx)
    + 78- Automatic JSON for metadata storage and reuse
    + 79- Self-containing Hierarchical Data Format (.hdf5) including raw data and ime-series data-point for processed data-sets with all associated metadata stored as json attributes
    + 80
    + 81### Data structure types
    + 82
    + 83- LC-MS
    + 84- GC-MS
    + 85- Transient
    + 86- Mass Spectra
    + 87- Mass Spectrum
    + 88- Mass Spectral Peak
    + 89- Molecular Formula
      90
    - 91    else:
    - 92
    - 93        return None
    - 94
    - 95def get_dirnames(app=None):
    + 91### In progress data structures
    + 92- IMS-MS
    + 93- LC-IMS-MS 
    + 94- Collections 
    + 95- Molecular Structure
      96
    - 97    from PySide2.QtCore import Qt, QCoreApplication
    - 98    from PySide2.QtWidgets import QApplication, QFileDialog, QTreeView, QListView, QAbstractItemView
    - 99    from pathlib import Path
    -100
    -101    if not app:
    -102        app = QApplication(sys.argv)
    -103    # file_dialog = QFileDialog()
    -104    # file_dialog.setWindowFlags(Qt.WindowStaysOnTopHint)
    -105    # file_location = file_dialog.getOpenFileNames()
    -106
    -107    file_dialog = QFileDialog()
    -108    file_dialog.setFileMode(QFileDialog.DirectoryOnly)
    -109    file_dialog.setOption(QFileDialog.DontUseNativeDialog, True)
    -110    file_view = file_dialog.findChild(QListView, 'listView')
    -111
    -112    # to make it possible to select multiple directories:
    -113    if file_view:
    -114        file_view.setSelectionMode(QAbstractItemView.MultiSelection)
    -115    f_tree_view = file_dialog.findChild(QTreeView)
    -116    if f_tree_view:
    -117        f_tree_view.setSelectionMode(QAbstractItemView.MultiSelection)
    + 97---
    + 98## Available features
    + 99
    +100### FT-MS Signal Processing, Calibration, and Molecular Formula Search and Assignment
    +101
    +102- Apodization, Zerofilling, and Magnitude mode FT
    +103- Manual and automatic noise threshold calculation
    +104- Peak picking using apex quadratic fitting
    +105- Experimental resolving power calculation
    +106- Frequency and m/z domain calibration functions:
    +107- LedFord equation
    +108- Linear equation
    +109- Quadratic equation
    +110- Automatic search most abundant **Ox** homologue series
    +111- Automatic local (SQLite) or external (PostgreSQL) database check, generation, and search
    +112- Automatic molecular formulae assignments algorithm for ESI(-) MS for natural organic matter analysis
    +113- Automatic fine isotopic structure calculation and search for all isotopes
    +114- Flexible Kendrick normalization base
    +115- Kendrick filter using density-based clustering
    +116- Kendrick classification
    +117- Heteroatoms classification and visualization
     118
    -119    if file_dialog.exec():
    -120        paths = file_dialog.selectedFiles()
    -121
    -122        QCoreApplication.processEvents()
    -123        for path in paths:
    -124            yield Path(path)
    -125
    -126def chunks(lst, n):
    -127    """Yield successive n-sized chunks from lst."""
    -128    for i in range(0, len(lst), n):
    -129        yield lst[i:i + n]
    -130
    -131def corems_md5(fname):
    -132
    -133    bytes_io = fname.open('rb').read()
    -134
    -135    md5_returned = hashlib.sha256(bytes_io).hexdigest()
    -136
    -137    return "{}:{}".format("sha256", md5_returned)
    +119### GC-MS Signal Processing, Calibration, and Compound Identification
    +120
    +121- Baseline detection, subtraction, smoothing 
    +122- m/z based Chromatogram Peak Deconvolution,
    +123- Manual and automatic noise threshold calculation
    +124- First and second derivatives peak picking methods
    +125- Peak Area Calculation
    +126- Retention Index Calibration
    +127- Automatic local (SQLite) or external (MongoDB or PostgreSQL) database check, generation, and search
    +128- Automatic molecular match algorithm with all spectral similarity methods 
    +129
    +130### High Resolution Mass Spectrum Simulations
    +131
    +132- Peak shape (Lorentz,  Gaussian, Voigt, and pseudo-Voigt)
    +133- Peak fitting for peak shape definition
    +134- Peak position in function of data points, signal to noise and resolving power (Lorentz and Gaussian)
    +135- Prediction of mass error distribution
    +136- Calculated ICR Resolving Power based on magnetic field (B), and transient time(T)
    +137
    +138---
    +139## Installation 
    +140    
    +141```bash
    +142pip install corems
    +143```
    +144
    +145By default the molecular formula database will be generated using SQLite
    +146
    +147To use Postgresql the easiest way is to build a docker container:
    +148
    +149```bash
    +150docker-compose up -d
    +151```
    +152
    +153-  Change the url_database on MSParameters.molecular_search.url_database to: "postgresql+psycopg2://coremsappdb:coremsapppnnl@localhost:5432/coremsapp"
    +154-  Set the url_database env variable COREMS_DATABASE_URL to: "postgresql+psycopg2://coremsappdb:coremsapppnnl@localhost:5432/coremsapp"
    +155
    +156### Thermo Raw File Access:
    +157
    +158To be able to open thermo file a installation of pythonnet is needed:
    +159- Windows: 
    +160    ```bash
    +161    pip install pythonnet
    +162    ```
    +163
    +164- Mac and Linux:
    +165    ```bash
    +166    brew install mono
    +167    pip install pythonnet   
    +168    ```  
    +169
    +170---
    +171## Docker stack 
    +172
    +173Another option to use CoreMS is to run the docker stack that will start the CoreMS containers
    +174
    +175### Molecular Database and Jupyter Notebook Docker Containers
    +176
    +177A docker container containing:
    +178- A custom python distribution will all dependencies installed
    +179- A Jupyter notebook server with workflow examples
    +180- A PostgreSQL database for the molecular formulae assignment
    +181
    +182If you don't have docker installed, the easiest way is to [install docker for desktop](https://hub.docker.com/?overlay=onboarding)
    +183
    +1841. Start the containers using docker-compose (easiest way): 
    +185
    +186    On docker-compose-jupyter.yml there is a volume mapping for the tests_data directory with the data provided for testing, to change to your data location: 
    +187    
    +188    - locate the volumes on docker-compose-jupyter.yml:
    +189
    +190    ```bash
    +191    volumes:
    +192      - ./tests/tests_data:/home/CoreMS/data
    +193    ```
    +194    - change "./tests/tests_data" to your data directory location
    +195
    +196    ```bash
    +197    volumes:
    +198      - path_to_your_data_directory:/home/corems/data
    +199    ```
    +200    - save the file and then call:
    +201    
    +202    ```bash
    +203    docker-compose -f docker-compose-jupyter.yml up
    +204    ```
    +205
    +2062. Another option is to manually build the containers: 
    +207
    +208    - Build the corems image:
    +209        ```bash
    +210        docker build -t corems:local .
    +211        ```
    +212    - Start the database container:
    +213        ```bash
    +214        docker-compose up -d   
    +215        ```
    +216    - Start the Jupyter Notebook:
    +217        ```bash
    +218        docker run --rm -v ./data:/home/CoreMS/data corems:local
    +219        ```
    +220    
    +221    - Open your browser, copy and past the URL address provided in the terminal: `http://localhost:8888/?token=<token>.`
    +222
    +223    - Open the CoreMS-Tutorial.ipynb
    +224
    +225___
    +226## Simple Script Example
    +227
    +228More examples can be found under the directory examples/scripts, examples/notebooks
    +229
    +230- Basic functionality example
    +231
    +232```python
    +233from corems.transient.input.brukerSolarix import ReadBrukerSolarix
    +234from corems.molecular_id.search.molecularFormulaSearch import SearchMolecularFormulas
    +235from corems.mass_spectrum.output.export import HighResMassSpecExport
    +236from matplotlib import pyplot
    +237
    +238file_path= 'tests/tests_data/ftms/ESI_NEG_SRFA.d'
    +239
    +240# Instatiate the Bruker Solarix reader with the filepath
    +241bruker_reader = ReadBrukerSolarix(file_path)
    +242
    +243# Use the reader to instatiate a transient object
    +244bruker_transient_obj = bruker_reader.get_transient()
    +245
    +246# Calculate the transient duration time
    +247T =  bruker_transient_obj.transient_time
    +248
    +249# Use the transient object to instatitate a mass spectrum object
    +250mass_spectrum_obj = bruker_transient_obj.get_mass_spectrum(plot_result=False, auto_process=True)
    +251
    +252# The following SearchMolecularFormulas function does the following
    +253# - searches monoisotopic molecular formulas for all mass spectral peaks
    +254# - calculates fine isotopic structure based on monoisotopic molecular formulas found and current dynamic range
    +255# - searches molecular formulas of correspondent calculated isotopologues
    +256# - settings are stored at SearchConfig.json and can be changed directly on the file or inside the framework class
    +257
    +258SearchMolecularFormulas(mass_spectrum_obj, first_hit=False).run_worker_mass_spectrum()
    +259
    +260# Iterate over mass spectral peaks objs within the mass_spectrum_obj
    +261for mspeak in mass_spectrum_obj.sort_by_abundance():
    +262
    +263    # If there is at least one molecular formula associated, mspeak returns True
    +264    if  mspeak:
    +265
    +266        # Get the molecular formula with the highest mass accuracy
    +267        molecular_formula = mspeak.molecular_formula_lowest_error
    +268
    +269        # Plot mz and peak height
    +270        pyplot.plot(mspeak.mz_exp, mspeak.abundance, 'o', c='g')
    +271
    +272        # Iterate over all molecular formulas associated with the ms peaks obj
    +273        for molecular_formula in mspeak:
    +274
    +275            # Check if the molecular formula is a isotopologue
    +276            if molecular_formula.is_isotopologue:
    +277
    +278                # Access the molecular formula text representation and print
    +279                print (molecular_formula.string)
    +280
    +281                # Get 13C atoms count
    +282                print (molecular_formula['13C'])
    +283    else:
    +284        # Get mz and peak height
    +285        print(mspeak.mz_exp,mspeak.abundance)
    +286
    +287# Save data
    +288## to a csv file
    +289mass_spectrum_obj.to_csv("filename")
    +290mass_spectrum_obj.to_hdf("filename")
    +291# to pandas Datarame pickle
    +292mass_spectrum_obj.to_pandas("filename")
    +293
    +294# Extract data as a pandas Dataframe
    +295df = mass_spectrum_obj.to_dataframe()
    +296```
    +297## UML Diagrams
    +298
    +299UML (unified modeling language) diagrams for Direct Infusion FT-MS and GC-MS classes can be found [here](docs/uml).
    +300
    +301## Citing CoreMS
    +302
    +303If you use CoreMS in your work, please use the following citation:
    +304Version [2.0 Release on GitHub](https://github.com/EMSL-Computing/CoreMS/releases/tag/v2.0), archived on Zenodo:  
    +305
    +306[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4641552.svg)](https://doi.org/10.5281/zenodo.4641552)
    +307```
    +308Yuri E. Corilo, William R. Kew, Lee Ann McCue (2021, March 27). EMSL-Computing/CoreMS: CoreMS 2.0 (Version v2.0), as developed on Github. Zenodo. http://doi.org/10.5281/zenodo.4641552
    +309```
    +310
    +311
    +312This material was prepared as an account of work sponsored by an agency of the
    +313United States Government.  Neither the United States Government nor the United
    +314States Department of Energy, nor Battelle, nor any of their employees, nor any
    +315jurisdiction or organization that has cooperated in the development of these
    +316materials, makes any warranty, express or implied, or assumes any legal
    +317liability or responsibility for the accuracy, completeness, or usefulness or
    +318any information, apparatus, product, software, or process disclosed, or
    +319represents that its use would not infringe privately owned rights.
    +320
    +321Reference herein to any specific commercial product, process, or service by
    +322trade name, trademark, manufacturer, or otherwise does not necessarily
    +323constitute or imply its endorsement, recommendation, or favoring by the United
    +324States Government or any agency thereof, or Battelle Memorial Institute. The
    +325views and opinions of authors expressed herein do not necessarily state or
    +326reflect those of the United States Government or any agency thereof.
    +327
    +328                 PACIFIC NORTHWEST NATIONAL LABORATORY
    +329                              operated by
    +330                                BATTELLE
    +331                                for the
    +332                   UNITED STATES DEPARTMENT OF ENERGY
    +333                    under Contract DE-AC05-76RL01830
    +334'''
    +335import time
    +336import os
    +337import sys
    +338import hashlib
    +339
    +340
    +341def timeit(method):
    +342    def timed(*args, **kw):
    +343        ts = time.time()
    +344        result = method(*args, **kw)
    +345        te = time.time()
    +346        if 'log_time' in kw:
    +347            name = kw.get('log_name', method.__name__.upper())
    +348            kw['log_time'][name] = int((te - ts) * 1000)
    +349        else:
    +350            print("%r  %2.2f ms" % (method.__name__, (te - ts) * 1000))
    +351        return result
    +352    return timed
    +353
    +354
    +355class SuppressPrints:
    +356
    +357    def __enter__(self):
    +358        self._original_stdout = sys.stdout
    +359        sys.stdout = open(os.devnull, 'w')
    +360
    +361    def __exit__(self, exc_type, exc_val, exc_tb):
    +362        sys.stdout.close()
    +363        sys.stdout = self._original_stdout
    +364
    +365def get_filenames(app=None):
    +366
    +367    from PySide2.QtCore import Qt, QCoreApplication
    +368    from PySide2.QtWidgets import QApplication, QFileDialog
    +369    from pathlib import Path
    +370
    +371    app = QApplication(sys.argv)
    +372    file_dialog = QFileDialog()
    +373    file_dialog.setWindowFlags(Qt.WindowStaysOnTopHint)
    +374    file_location, _ = file_dialog.getOpenFileNames()
    +375
    +376    if file_location:
    +377        QCoreApplication.processEvents()
    +378        return file_location
    +379
    +380    else:
    +381
    +382        return None
    +383
    +384def get_filename(app=None):
    +385
    +386    from PySide2.QtCore import Qt, QCoreApplication
    +387    from PySide2.QtWidgets import QApplication, QFileDialog
    +388    from pathlib import Path
    +389
    +390    app = QApplication(sys.argv)
    +391    file_dialog = QFileDialog()
    +392    file_dialog.setWindowFlags(Qt.WindowStaysOnTopHint)
    +393    file_location, _ = file_dialog.getOpenFileName()
    +394
    +395    if file_location:
    +396        QCoreApplication.processEvents()
    +397        return Path(file_location)
    +398
    +399    else:
    +400
    +401        return None
    +402
    +403def get_dirname(app=None):
    +404
    +405    from PySide2.QtCore import Qt, QCoreApplication
    +406    from PySide2.QtWidgets import QApplication, QFileDialog 
    +407    from pathlib import Path
    +408
    +409    app = QApplication(sys.argv)
    +410    file_dialog = QFileDialog()
    +411    file_dialog.setWindowFlags(Qt.WindowStaysOnTopHint)
    +412    file_location = file_dialog.getExistingDirectory()
    +413
    +414    if file_location:
    +415        QCoreApplication.processEvents()
    +416        return Path(file_location)
    +417
    +418    else:
    +419
    +420        return None
    +421
    +422def get_dirnames(app=None):
    +423
    +424    from PySide2.QtCore import Qt, QCoreApplication
    +425    from PySide2.QtWidgets import QApplication, QFileDialog, QTreeView, QListView, QAbstractItemView
    +426    from pathlib import Path
    +427
    +428    if not app:
    +429        app = QApplication(sys.argv)
    +430    # file_dialog = QFileDialog()
    +431    # file_dialog.setWindowFlags(Qt.WindowStaysOnTopHint)
    +432    # file_location = file_dialog.getOpenFileNames()
    +433
    +434    file_dialog = QFileDialog()
    +435    file_dialog.setFileMode(QFileDialog.DirectoryOnly)
    +436    file_dialog.setOption(QFileDialog.DontUseNativeDialog, True)
    +437    file_view = file_dialog.findChild(QListView, 'listView')
    +438
    +439    # to make it possible to select multiple directories:
    +440    if file_view:
    +441        file_view.setSelectionMode(QAbstractItemView.MultiSelection)
    +442    f_tree_view = file_dialog.findChild(QTreeView)
    +443    if f_tree_view:
    +444        f_tree_view.setSelectionMode(QAbstractItemView.MultiSelection)
    +445
    +446    if file_dialog.exec():
    +447        paths = file_dialog.selectedFiles()
    +448
    +449        QCoreApplication.processEvents()
    +450        for path in paths:
    +451            yield Path(path)
    +452
    +453def chunks(lst, n):
    +454    """Yield successive n-sized chunks from lst."""
    +455    for i in range(0, len(lst), n):
    +456        yield lst[i:i + n]
    +457
    +458def corems_md5(fname):
    +459
    +460    bytes_io = fname.open('rb').read()
    +461
    +462    md5_returned = hashlib.sha256(bytes_io).hexdigest()
    +463
    +464    return "{}:{}".format("sha256", md5_returned)
     
    @@ -673,18 +980,18 @@

    Citing CoreMS

    -
    15def timeit(method):
    -16    def timed(*args, **kw):
    -17        ts = time.time()
    -18        result = method(*args, **kw)
    -19        te = time.time()
    -20        if 'log_time' in kw:
    -21            name = kw.get('log_name', method.__name__.upper())
    -22            kw['log_time'][name] = int((te - ts) * 1000)
    -23        else:
    -24            print("%r  %2.2f ms" % (method.__name__, (te - ts) * 1000))
    -25        return result
    -26    return timed
    +            
    342def timeit(method):
    +343    def timed(*args, **kw):
    +344        ts = time.time()
    +345        result = method(*args, **kw)
    +346        te = time.time()
    +347        if 'log_time' in kw:
    +348            name = kw.get('log_name', method.__name__.upper())
    +349            kw['log_time'][name] = int((te - ts) * 1000)
    +350        else:
    +351            print("%r  %2.2f ms" % (method.__name__, (te - ts) * 1000))
    +352        return result
    +353    return timed
     
    @@ -702,15 +1009,15 @@

    Citing CoreMS

    -
    29class SuppressPrints:
    -30
    -31    def __enter__(self):
    -32        self._original_stdout = sys.stdout
    -33        sys.stdout = open(os.devnull, 'w')
    -34
    -35    def __exit__(self, exc_type, exc_val, exc_tb):
    -36        sys.stdout.close()
    -37        sys.stdout = self._original_stdout
    +            
    356class SuppressPrints:
    +357
    +358    def __enter__(self):
    +359        self._original_stdout = sys.stdout
    +360        sys.stdout = open(os.devnull, 'w')
    +361
    +362    def __exit__(self, exc_type, exc_val, exc_tb):
    +363        sys.stdout.close()
    +364        sys.stdout = self._original_stdout
     
    @@ -728,24 +1035,24 @@

    Citing CoreMS

    -
    39def get_filenames(app=None):
    -40
    -41    from PySide2.QtCore import Qt, QCoreApplication
    -42    from PySide2.QtWidgets import QApplication, QFileDialog
    -43    from pathlib import Path
    -44
    -45    app = QApplication(sys.argv)
    -46    file_dialog = QFileDialog()
    -47    file_dialog.setWindowFlags(Qt.WindowStaysOnTopHint)
    -48    file_location, _ = file_dialog.getOpenFileNames()
    -49
    -50    if file_location:
    -51        QCoreApplication.processEvents()
    -52        return file_location
    -53
    -54    else:
    -55
    -56        return None
    +            
    366def get_filenames(app=None):
    +367
    +368    from PySide2.QtCore import Qt, QCoreApplication
    +369    from PySide2.QtWidgets import QApplication, QFileDialog
    +370    from pathlib import Path
    +371
    +372    app = QApplication(sys.argv)
    +373    file_dialog = QFileDialog()
    +374    file_dialog.setWindowFlags(Qt.WindowStaysOnTopHint)
    +375    file_location, _ = file_dialog.getOpenFileNames()
    +376
    +377    if file_location:
    +378        QCoreApplication.processEvents()
    +379        return file_location
    +380
    +381    else:
    +382
    +383        return None
     
    @@ -763,24 +1070,24 @@

    Citing CoreMS

    -
    58def get_filename(app=None):
    -59
    -60    from PySide2.QtCore import Qt, QCoreApplication
    -61    from PySide2.QtWidgets import QApplication, QFileDialog
    -62    from pathlib import Path
    -63
    -64    app = QApplication(sys.argv)
    -65    file_dialog = QFileDialog()
    -66    file_dialog.setWindowFlags(Qt.WindowStaysOnTopHint)
    -67    file_location, _ = file_dialog.getOpenFileName()
    -68
    -69    if file_location:
    -70        QCoreApplication.processEvents()
    -71        return Path(file_location)
    -72
    -73    else:
    -74
    -75        return None
    +            
    385def get_filename(app=None):
    +386
    +387    from PySide2.QtCore import Qt, QCoreApplication
    +388    from PySide2.QtWidgets import QApplication, QFileDialog
    +389    from pathlib import Path
    +390
    +391    app = QApplication(sys.argv)
    +392    file_dialog = QFileDialog()
    +393    file_dialog.setWindowFlags(Qt.WindowStaysOnTopHint)
    +394    file_location, _ = file_dialog.getOpenFileName()
    +395
    +396    if file_location:
    +397        QCoreApplication.processEvents()
    +398        return Path(file_location)
    +399
    +400    else:
    +401
    +402        return None
     
    @@ -798,24 +1105,24 @@

    Citing CoreMS

    -
    77def get_dirname(app=None):
    -78
    -79    from PySide2.QtCore import Qt, QCoreApplication
    -80    from PySide2.QtWidgets import QApplication, QFileDialog 
    -81    from pathlib import Path
    -82
    -83    app = QApplication(sys.argv)
    -84    file_dialog = QFileDialog()
    -85    file_dialog.setWindowFlags(Qt.WindowStaysOnTopHint)
    -86    file_location = file_dialog.getExistingDirectory()
    -87
    -88    if file_location:
    -89        QCoreApplication.processEvents()
    -90        return Path(file_location)
    -91
    -92    else:
    -93
    -94        return None
    +            
    404def get_dirname(app=None):
    +405
    +406    from PySide2.QtCore import Qt, QCoreApplication
    +407    from PySide2.QtWidgets import QApplication, QFileDialog 
    +408    from pathlib import Path
    +409
    +410    app = QApplication(sys.argv)
    +411    file_dialog = QFileDialog()
    +412    file_dialog.setWindowFlags(Qt.WindowStaysOnTopHint)
    +413    file_location = file_dialog.getExistingDirectory()
    +414
    +415    if file_location:
    +416        QCoreApplication.processEvents()
    +417        return Path(file_location)
    +418
    +419    else:
    +420
    +421        return None
     
    @@ -833,36 +1140,36 @@

    Citing CoreMS

    -
     96def get_dirnames(app=None):
    - 97
    - 98    from PySide2.QtCore import Qt, QCoreApplication
    - 99    from PySide2.QtWidgets import QApplication, QFileDialog, QTreeView, QListView, QAbstractItemView
    -100    from pathlib import Path
    -101
    -102    if not app:
    -103        app = QApplication(sys.argv)
    -104    # file_dialog = QFileDialog()
    -105    # file_dialog.setWindowFlags(Qt.WindowStaysOnTopHint)
    -106    # file_location = file_dialog.getOpenFileNames()
    -107
    -108    file_dialog = QFileDialog()
    -109    file_dialog.setFileMode(QFileDialog.DirectoryOnly)
    -110    file_dialog.setOption(QFileDialog.DontUseNativeDialog, True)
    -111    file_view = file_dialog.findChild(QListView, 'listView')
    -112
    -113    # to make it possible to select multiple directories:
    -114    if file_view:
    -115        file_view.setSelectionMode(QAbstractItemView.MultiSelection)
    -116    f_tree_view = file_dialog.findChild(QTreeView)
    -117    if f_tree_view:
    -118        f_tree_view.setSelectionMode(QAbstractItemView.MultiSelection)
    -119
    -120    if file_dialog.exec():
    -121        paths = file_dialog.selectedFiles()
    -122
    -123        QCoreApplication.processEvents()
    -124        for path in paths:
    -125            yield Path(path)
    +            
    423def get_dirnames(app=None):
    +424
    +425    from PySide2.QtCore import Qt, QCoreApplication
    +426    from PySide2.QtWidgets import QApplication, QFileDialog, QTreeView, QListView, QAbstractItemView
    +427    from pathlib import Path
    +428
    +429    if not app:
    +430        app = QApplication(sys.argv)
    +431    # file_dialog = QFileDialog()
    +432    # file_dialog.setWindowFlags(Qt.WindowStaysOnTopHint)
    +433    # file_location = file_dialog.getOpenFileNames()
    +434
    +435    file_dialog = QFileDialog()
    +436    file_dialog.setFileMode(QFileDialog.DirectoryOnly)
    +437    file_dialog.setOption(QFileDialog.DontUseNativeDialog, True)
    +438    file_view = file_dialog.findChild(QListView, 'listView')
    +439
    +440    # to make it possible to select multiple directories:
    +441    if file_view:
    +442        file_view.setSelectionMode(QAbstractItemView.MultiSelection)
    +443    f_tree_view = file_dialog.findChild(QTreeView)
    +444    if f_tree_view:
    +445        f_tree_view.setSelectionMode(QAbstractItemView.MultiSelection)
    +446
    +447    if file_dialog.exec():
    +448        paths = file_dialog.selectedFiles()
    +449
    +450        QCoreApplication.processEvents()
    +451        for path in paths:
    +452            yield Path(path)
     
    @@ -880,10 +1187,10 @@

    Citing CoreMS

    -
    127def chunks(lst, n):
    -128    """Yield successive n-sized chunks from lst."""
    -129    for i in range(0, len(lst), n):
    -130        yield lst[i:i + n]
    +            
    454def chunks(lst, n):
    +455    """Yield successive n-sized chunks from lst."""
    +456    for i in range(0, len(lst), n):
    +457        yield lst[i:i + n]
     
    @@ -903,13 +1210,13 @@

    Citing CoreMS

    -
    132def corems_md5(fname):
    -133
    -134    bytes_io = fname.open('rb').read()
    -135
    -136    md5_returned = hashlib.sha256(bytes_io).hexdigest()
    -137
    -138    return "{}:{}".format("sha256", md5_returned)
    +            
    459def corems_md5(fname):
    +460
    +461    bytes_io = fname.open('rb').read()
    +462
    +463    md5_returned = hashlib.sha256(bytes_io).hexdigest()
    +464
    +465    return "{}:{}".format("sha256", md5_returned)
     
    diff --git a/docs/corems/encapsulation/constant.html b/docs/corems/encapsulation/constant.html index eba76f1f..12c5174b 100644 --- a/docs/corems/encapsulation/constant.html +++ b/docs/corems/encapsulation/constant.html @@ -150,939 +150,1012 @@

    -
      1class Labels: #pragma: no cover
    -  2    """ Class for Labels used in CoreMS
    -  3    
    -  4    These labels are used to define:
    -  5    * types of columns in plaintext data inputs, 
    -  6    * types of data/mass spectra
    -  7    * types of assignment for ions
    -  8
    -  9    """
    - 10    mz = "m/z"
    - 11    abundance = "Peak Height"
    - 12    rp = "Resolving Power"
    - 13    s2n = "S/N"
    - 14
    - 15    label = 'label'
    - 16    bruker_profile = 'Bruker_Profile'
    - 17    thermo_profile = 'Thermo_Profile'
    - 18    simulated_profile = 'Simulated Profile'
    - 19    booster_profile = 'Booster Profile'
    - 20    bruker_frequency = 'Bruker_Frequency'
    - 21    midas_frequency = 'Midas_Frequency'
    - 22    thermo_centroid = 'Thermo_Centroid'
    - 23    corems_centroid = 'CoreMS_Centroid'
    - 24    gcms_centroid = 'Thermo_Centroid'
    - 25    
    - 26    unassigned = 'unassigned'
    - 27
    - 28    radical_ion = 'RADICAL'
    - 29    protonated_de_ion = 'DE_OR_PROTONATED'
    - 30    protonated = "protonated"
    - 31    de_protonated = "de-protonated"
    - 32    adduct_ion = "ADDUCT"
    - 33    neutral = 'neutral'
    - 34    ion_type = 'IonType'
    - 35
    - 36    ion_type_translate = { 'protonated': 'DE_OR_PROTONATED',
    - 37                          'de-protonated': 'DE_OR_PROTONATED',
    - 38                          'radical': 'RADICAL',
    - 39                          'adduct': 'ADDUCT'}
    - 40    
    - 41class Atoms: #pragma: no cover
    - 42    """ Class for Atoms in CoreMS
    - 43
    - 44    This class includes key properties of atoms (and the electron) and isotopes, including their exact masses, relative abundances, and covalences. 
    - 45    It also associates which isotopes are for the same element, and provides an ordering of elements.
    - 46    
    - 47    References
    - 48    ----------
    - 49
    - 50    1. NIST - Last Accessed 2019-06-12
    - 51    https://www.nist.gov/pml/atomic-weights-and-isotopic-compositions-relative-atomic-masses
    - 52
    - 53    """
    - 54    electron_mass = 0.0005_485_799_090_65 #NIST value
    - 55
    - 56    atomic_masses = {'H': 1.00782503223,
    - 57                     'D': 2.01410177812,
    - 58                     'T': 3.0160492779,
    - 59                     '3He': 3.0160293201,
    - 60                     'He': 4.00260325413,
    - 61                     '6Li': 6.0151228874,
    - 62                     '7Li': 7.0160034366,
    - 63                     '9Be': 9.012183065,
    - 64                     '10B': 10.01293695,
    - 65                     '11B': 11.00930536,
    - 66                     'C': 12.0,
    - 67                     '13C': 13.00335483507,
    - 68                     '14C': 14.0032419884,
    - 69                     'N': 14.00307400443,
    - 70                     '15N': 15.00010889888,
    - 71                     'O': 15.99491461957,
    - 72                     '17O': 16.99913175650,
    - 73                     '18O': 17.99915961286,
    - 74                     'F': 18.99840316273,
    - 75                     '20Ne': 19.9924401762,
    - 76                     '21Ne': 20.993846685,
    - 77                     '22Ne': 21.991385114,
    - 78                     'Na': 22.9897692820,
    - 79                     '24Mg': 23.985041697,
    - 80                     '25Mg': 24.985836976,
    - 81                     '26Mg': 25.982592968,
    - 82                     'Al': 26.98153853,
    - 83                     '28Si': 27.97692653465,
    - 84                     '29Si': 28.97649466490,
    - 85                     '30Si': 29.973770136,
    - 86                     'P': 30.97376199842,
    - 87                     'S': 31.9720711744,
    - 88                     '33S': 32.9714589098,
    - 89                     '34S': 33.967867004,
    - 90                     '36S': 35.96708071,
    - 91                     'Cl': 34.968852682,
    - 92                     '37Cl': 36.965902602,
    - 93                     '36Ar': 35.967545105,
    - 94                     '38Ar': 37.96273211,
    - 95                     '40Ar': 39.9623831237,
    - 96                     'K': 38.9637064864,
    - 97                     '40K': 39.963998166,
    - 98                     '41K': 40.9618252579,
    - 99                     'Ca': 39.962590863,
    -100                     '42Ca': 41.95861783,
    -101                     '43Ca': 42.95876644,
    -102                     '44Ca': 43.95548156,
    -103                     '46Ca': 45.9536890,
    -104                     '48Ca': 47.95252276,
    -105                     '45Sc': 44.95590828,
    -106                     '46Ti': 45.95262772,
    -107                     '47Ti': 46.95175879,
    -108                     '48Ti': 47.94794198,
    -109                     '49Ti': 48.94786568,
    -110                     '50Ti': 49.94478689,
    -111                     '50V': 49.94715601,
    -112                     'V': 50.94395704,
    -113                     '50Cr': 49.94604183,
    -114                     'Cr': 51.94050623,
    -115                     '53Cr': 52.94064815,
    -116                     '54Cr': 53.93887916,
    -117                     'Mn': 54.93804391,
    -118                     '54Fe': 53.93960899,
    -119                     'Fe': 55.93493633,
    -120                     '57Fe': 56.93539284,
    -121                     '58Fe': 57.93327443,
    -122                     'Co': 58.93319429,
    -123                     'Ni': 57.93534241,
    -124                     '60Ni': 59.93078588,
    -125                     '61Ni': 60.93105557,
    -126                     '62Ni': 61.92834537,
    -127                     '64Ni': 63.92796682,
    -128                     'Cu': 62.92959772,
    -129                     '65Cu': 64.92778970,
    -130                     'Zn': 63.92914201,
    -131                     '66Zn': 65.92603381,
    -132                     '67Zn': 66.92712775,
    -133                     '68Zn': 67.92484455,
    -134                     '70Zn': 69.9253192,
    -135                     '69Ga': 68.9255735,
    -136                     '71Ga': 70.92470258,
    -137                     '70Ge': 69.92424875,
    -138                     '72Ge': 71.922075826,
    -139                     '73Ge': 72.923458956,
    -140                     '74Ge': 73.921177761,
    -141                     '76Ge': 75.921402726,
    -142                     'As': 74.92159457,
    -143                     '74Se': 73.922475934,
    -144                     '76Se': 75.919213704,
    -145                     '77Se': 76.919914154,
    -146                     '78Se': 77.91730928,
    -147                     'Se': 79.9165218,
    -148                     '82Se': 81.9166995,
    -149                     'Br': 78.9183376,
    -150                     '81Br': 80.9162897,
    -151                     '78Kr': 77.92036494,
    -152                     '80Kr': 79.91637808,
    -153                     '82Kr': 81.91348273,
    -154                     '83Kr': 82.91412716,
    -155                     '84Kr': 83.9114977282,
    -156                     '86Kr': 85.9106106269,
    -157                     '85Rb': 84.9117897379,
    -158                     '87Rb': 86.9091805310,
    -159                     '84Sr': 83.9134191,
    -160                     '86Sr': 85.9092606,
    -161                     '87Sr': 86.9088775,
    -162                     '88Sr': 87.9056125,
    -163                     '89Y': 88.9058403,
    -164                     '90Zr': 89.9046977,
    -165                     '91Zr': 90.9056396,
    -166                     '92Zr': 91.9050347,
    -167                     '94Zr': 93.9063108,
    -168                     '96Zr': 95.9082714,
    -169                     '93Nb': 92.9063730,
    -170                     '92Mo': 91.90680796,
    -171                     '94Mo': 93.90508490,
    -172                     '95Mo': 94.90583877,
    -173                     '96Mo': 95.90467612,
    -174                     '97Mo': 96.90601812,
    -175                     'Mo': 97.90540482,
    -176                     '100Mo': 99.9074718,
    -177                     '97Tc': 96.9063667,
    -178                     '98Tc': 97.9072124,
    -179                     '99Tc': 98.9062508,
    -180                     '96Ru': 95.90759025,
    -181                     '98Ru': 97.9052868,
    -182                     '99Ru': 98.9059341,
    -183                     '100Ru': 99.9042143,
    -184                     '101Ru': 100.9055769,
    -185                     '102Ru': 101.9043441,
    -186                     '104Ru': 103.9054275,
    -187                     '103Rh': 102.9054980,
    -188                     '102Pd': 101.9056022,
    -189                     '104Pd': 103.9040305,
    -190                     '105Pd': 104.9050796,
    -191                     '106Pd': 105.9034804,
    -192                     '108Pd': 107.9038916,
    -193                     '110Pd': 109.9051722,
    -194                     '107Ag': 106.9050916,
    -195                     '109Ag': 108.9047553,
    -196                     '106Cd': 105.9064599,
    -197                     '108Cd': 107.9041834,
    -198                     '110Cd': 109.90300661,
    -199                     '111Cd': 110.90418287,
    -200                     'Cd': 111.90276287,
    -201                     '113Cd': 112.90440813,
    -202                     '114Cd': 113.90336509,
    -203                     '116Cd': 115.90476315,
    -204                     '113In': 112.90406184,
    -205                     'In': 114.903878776,
    -206                     '112Sn': 111.90482387,
    -207                     '114Sn': 113.9027827,
    -208                     '115Sn': 114.903344699,
    -209                     '116Sn': 115.90174280,
    -210                     '117Sn': 116.90295398,
    -211                     '118Sn': 117.90160657,
    -212                     '119Sn': 118.90331117,
    -213                     '120Sn': 119.90220163,
    -214                     '122Sn': 121.9034438,
    -215                     '124Sn': 123.9052766,
    -216                     '121Sb': 120.9038120,
    -217                     '123Sb': 122.9042132,
    -218                     '120Te': 119.9040593,
    -219                     '122Te': 121.9030435,
    -220                     '123Te': 122.9042698,
    -221                     '124Te': 123.9028171,
    -222                     '125Te': 124.9044299,
    -223                     '126Te': 125.9033109,
    -224                     '128Te': 127.90446128,
    -225                     '130Te': 129.906222748,
    -226                     'I': 126.9044719,
    -227                     '124Xe': 123.9058920,
    -228                     '126Xe': 125.9042983,
    -229                     '128Xe': 127.9035310,
    -230                     '129Xe': 128.9047808611,
    -231                     '130Xe': 129.903509349,
    -232                     '131Xe': 130.90508406,
    -233                     '132Xe': 131.9041550856,
    -234                     '134Xe': 133.90539466,
    -235                     '136Xe': 135.907214484,
    -236                     '133Cs': 132.9054519610,
    -237                     '130Ba': 129.9063207,
    -238                     '132Ba': 131.9050611,
    -239                     '134Ba': 133.90450818,
    -240                     '135Ba': 134.90568838,
    -241                     '136Ba': 135.90457573,
    -242                     '137Ba': 136.90582714,
    -243                     '138Ba': 137.90524700,
    -244                     '138La': 137.9071149,
    -245                     '139La': 138.9063563,
    -246                     '136Ce': 135.90712921,
    -247                     '138Ce': 137.905991,
    -248                     '140Ce': 139.9054431,
    -249                     '142Ce': 141.9092504,
    -250                     '141Pr': 140.9076576,
    -251                     '142Nd': 141.9077290,
    -252                     '143Nd': 142.9098200,
    -253                     '144Nd': 143.9100930,
    -254                     '145Nd': 144.9125793,
    -255                     '146Nd': 145.9131226,
    -256                     '148Nd': 147.9168993,
    -257                     '150Nd': 149.9209022,
    -258                     '145Pm': 144.9127559,
    -259                     '147Pm': 146.9151450,
    -260                     '144Sm': 143.9120065,
    -261                     '147Sm': 146.9149044,
    -262                     '148Sm': 147.9148292,
    -263                     '149Sm': 148.9171921,
    -264                     '150Sm': 149.9172829,
    -265                     '152Sm': 151.9197397,
    -266                     '154Sm': 153.9222169,
    -267                     '151Eu': 150.9198578,
    -268                     '153Eu': 152.9212380,
    -269                     '152Gd': 151.9197995,
    -270                     '154Gd': 153.9208741,
    -271                     '155Gd': 154.9226305,
    -272                     '156Gd': 155.9221312,
    -273                     '157Gd': 156.9239686,
    -274                     '158Gd': 157.9241123,
    -275                     '160Gd': 159.9270624,
    -276                     '159Tb': 158.9253547,
    -277                     '156Dy': 155.9242847,
    -278                     '158Dy': 157.9244159,
    -279                     '160Dy': 159.9252046,
    -280                     '161Dy': 160.9269405,
    -281                     '162Dy': 161.9268056,
    -282                     '163Dy': 162.9287383,
    -283                     '164Dy': 163.9291819,
    -284                     '165Ho': 164.9303288,
    -285                     '162Er': 161.9287884,
    -286                     '164Er': 163.9292088,
    -287                     '166Er': 165.9302995,
    -288                     '167Er': 166.9320546,
    -289                     '168Er': 167.9323767,
    -290                     '170Er': 169.9354702,
    -291                     '169Tm': 168.9342179,
    -292                     '168Yb': 167.9338896,
    -293                     '170Yb': 169.9347664,
    -294                     '171Yb': 170.9363302,
    -295                     '172Yb': 171.9363859,
    -296                     '173Yb': 172.9382151,
    -297                     '174Yb': 173.9388664,
    -298                     '176Yb': 175.9425764,
    -299                     '175Lu': 174.9407752,
    -300                     '176Lu': 175.9426897,
    -301                     '174Hf': 173.9400461,
    -302                     '176Hf': 175.9414076,
    -303                     '177Hf': 176.9432277,
    -304                     '178Hf': 177.9437058,
    -305                     '179Hf': 178.9458232,
    -306                     '180Hf': 179.9465570,
    -307                     '180Ta': 179.9474648,
    -308                     '181Ta': 180.9479958,
    -309                     '180W': 179.9467108,
    -310                     '182W': 181.94820394,
    -311                     '183W': 182.95022275,
    -312                     '184W': 183.95093092,
    -313                     '186W': 185.9543628,
    -314                     '185Re': 184.9529545,
    -315                     '187Re': 186.9557501,
    -316                     '184Os': 183.9524885,
    -317                     '186Os': 185.9538350,
    -318                     '187Os': 186.9557474,
    -319                     '188Os': 187.9558352,
    -320                     '189Os': 188.9581442,
    -321                     '190Os': 189.9584437,
    -322                     '192Os': 191.9614770,
    -323                     '191Ir': 190.9605893,
    -324                     '193Ir': 192.9629216,
    -325                     '190Pt': 189.9599297,
    -326                     '192Pt': 191.9610387,
    -327                     '194Pt': 193.9626809,
    -328                     '195Pt': 194.9647917,
    -329                     '196Pt': 195.96495209,
    -330                     '198Pt': 197.9678949,
    -331                     '197Au': 196.96656879,
    -332                     '196Hg': 195.9658326,
    -333                     '198Hg': 197.96676860,
    -334                     '199Hg': 198.96828064,
    -335                     '200Hg': 199.96832659,
    -336                     '201Hg': 200.97030284,
    -337                     '202Hg': 201.97064340,
    -338                     '204Hg': 203.97349398,
    -339                     '203Tl': 202.9723446,
    -340                     '205Tl': 204.9744278,
    -341                     '204Pb': 203.9730440,
    -342                     '206Pb': 205.9744657,
    -343                     '207Pb': 206.9758973,
    -344                     'Pb': 207.9766525,
    -345                     '209Bi': 208.9803991,
    -346                     '209Po': 208.9824308,
    -347                     '210Po': 209.9828741,
    -348                     '210At': 209.9871479,
    -349                     '211At': 210.9874966,
    -350                     '211Rn': 210.9906011,
    -351                     '220Rn': 220.0113941,
    -352                     '222Rn': 222.0175782,
    -353                     '223Fr': 223.0197360,
    -354                     '223Ra': 223.0185023,
    -355                     '224Ra': 224.0202120,
    -356                     '226Ra': 226.0254103,
    -357                     '228Ra': 228.0310707,
    -358                     '227Ac': 227.0277523,
    -359                     '230Th': 230.0331341,
    -360                     '232Th': 232.0380558,
    -361                     '231Pa': 231.0358842,
    -362                     '233U': 233.0396355,
    -363                     '234U': 234.0409523,
    -364                     '235U': 235.0439301,
    -365                     '236U': 236.0455682,
    -366                     '238U': 238.0507884,
    -367                     '236Np': 236.046570,
    -368                     '237Np': 237.0481736,
    -369                     '238Pu': 238.0495601,
    -370                     '239Pu': 239.0521636,
    -371                     '240Pu': 240.0538138,
    -372                     '241Pu': 241.0568517,
    -373                     '242Pu': 242.0587428,
    -374                     '244Pu': 244.0642053,
    -375                     '241Am': 241.0568293,
    -376                     '243Am': 243.0613813,
    -377                     '243Cm': 243.0613893,
    -378                     '244Cm': 244.0627528,
    -379                     '245Cm': 245.0654915,
    -380                     '246Cm': 246.0672238,
    -381                     '247Cm': 247.0703541,
    -382                     '248Cm': 248.0723499,
    -383                     '247Bk': 247.0703073,
    -384                     '249Bk': 249.0749877,
    -385                     '249Cf': 249.0748539,
    -386                     '250Cf': 250.0764062,
    -387                     '251Cf': 251.0795886,
    -388                     '252Cf': 252.0816272,
    -389                     '252Es': 252.082980,
    -390                     '257Fm': 257.0951061,
    -391                     '258Md': 258.0984315,
    -392                     '260Md': 260.10365, 
    -393                     '259No': 259.10103,
    -394                     '262Lr': 262.10961,
    -395                     '267Rf': 267.12179,
    -396                     '268Db': 268.12567,
    -397                     '271Sg': 271.13393,
    -398                     '272Bh': 272.13826,
    -399                     '270Hs': 270.13429,
    -400                     '276Mt': 276.15159,
    -401                     '281Ds': 281.16451,
    -402                     '280Rg': 280.16514,
    -403                     '285Cn': 285.17712,
    -404                     '284Nh': 284.17873,
    -405                     '289Fl': 289.19042,
    -406                     '288Mc': 288.19274,
    -407                     '293Lv': 293.20449,
    -408                     '292Ts': 292.20746,
    -409                     '294Og': 294.21392}
    -410
    -411    atoms_order = ['C', 'H', 'O', 'Cl', 'Na', 'S', 'N', '13C', '34S', '37Cl','Fe', 'Ca','P',
    -412                        'V', 'I', 'Ac', 'Al', 'Ar', 'As', 'At', 'Au', 'Co', 'Cs', 'D', 'F', 'Fr','18O', '17O',
    -413                        'He', 'Po', 'Ra', 'Rh', 'Rn', 'Be', 'Bi', 'Nb, 54Fe', '57Fe', 'Ni', '60Ni',
    -414                        '61Ni', '62Ni', '10B', '11B', '6Li', '7Li', 'La', 'Mn', '107Ag', '109Ag', '100Mo',
    -415                        '100Ru', '101Ru', '102Pd', '102Ru', '104Pd', '104Ru', '105Pd', 'Cd', '106Cd', '106Pd', '108Cd',
    -416                        '108Pd', '110Cd', '110Pd', '111Cd', '112Cd', '112Sn', '113Cd', '113In', '114Cd', '114Sn',
    -417                        'In', '115In', '115Sn', '116Cd', '116Sn', '117Sn', '118Sn', '119Sn', '120Sn', '120Te', '121Sb',
    -418                        '122Sn', '122Te', '123Sb', '123Te', '124Sn', '124Te', '124Xe', '125Te', '126Te', '126Xe',
    -419                        '128Te', '128Xe', '129Xe', '130Ba', '130Te', '130Xe', '131Xe', '132Ba', '132Xe', '134Ba',
    -420                        '134Xe', '135Ba', '136Ba', '136Xe', '137Ba', '138Ba', '15N', '174Hf', '176Hf', '177Hf', '178Hf',
    -421                        '179Hf', '180Hf', '180W', '182W', '183W', '184Os', '184W', '185Re', '186Os', '186W', '187Os', '187Re',
    -422                        '188Os', '189Os', '190Os', '190Pt', '191Ir', '192Ir', '192Os', '192Pt', '194Pt', '195Pt', '196Hg',
    -423                        '196Pt', '198Hg', '198Pt', '199Hg', '200Hg', '201Hg', '202Hg', '203Tl', '204Hg', '204Pb', '205Tl', '206Pb',
    -424                        '207Pb', '208Pb', 'Pb', '20Ne', '22Ne', '24Mg', '25Mg', '26Mg', '28Si', '29Si', '30Si', 'K', '40Ca', '41K', '44Ca',
    -425                        '46Ti', '47Ti', '48Ti', '49Ti', '50Cr', '50Ti', '50V', '51V', 'Cr', '52Cr', '53Cr', '54Cr', 'Cu', 'Zn', '65Cu', '66Zn',
    -426                        '67Zn', '68Zn', '69Ga', '70Ge', '71Ga', '72Ge', '73Ge', '74Ge', '76Ge', '76Se', '77Se', '78Se', 'Br', '81Br', '80Kr',
    -427                        'Se', '82Kr', '82Se', '83Kr', '84Kr', '85Rb', '86Kr', '86Sr', '87Rb', '87Sr', '88Sr', '90Zr', '91Zr', '92Mo', '92Zr',
    -428                        '94Mo', '94Zr', '95Mo', '96Mo', '96Ru', '96Zr', '97Mo', 'Mo', '98Ru', '99Ru']
    -429
    -430    atoms_covalence = {'C': (4),
    -431                     '13C': (4),
    -432                     'N': (3),
    -433                     'O': (2),
    -434                     'S': (2),
    -435                     'H': (1),
    -436                     'F': (1, 0),
    -437                     'Cl': (1, 0),
    -438                     'Br': (1, 0),
    -439                     'I': (1, 0),
    -440                     'At': (1),
    -441                     'Li': (1, 0),
    -442                     'Na': (1, 0),
    -443                     'K':  (1, 0),
    -444                     'Rb': (1),
    -445                     'Cs': (1),
    -446                     'Fr': (1),
    -447                     'B': (4, 3, 2, 1),
    -448                     'In': (3, 2, 1),
    -449                     'Al': (3, 1, 2),
    -450                     'P': (3, 5, 4, 2, 1),
    -451                     'Ga': (3, 1, 2),
    -452                     'Mg': (2, 1),
    -453                     'Be': (2, 1),
    -454                     'Ca': (2, 1),
    -455                     'Sr': (2, 1),
    -456                     'Ba': (2),
    -457                     'Ra': (2),
    -458                     'V': (5, 4, 3, 2, 1),
    -459                     'Fe': (3, 2, 4, 5, 6),
    -460                     'Si': (4, 3, 2),
    -461                     'Sc': (3, 2, 1),
    -462                     'Ti': (4, 3, 2, 1),
    -463                     'Cr': (1, 2, 3, 4, 5, 6),
    -464                     'Mn': (1, 2, 3, 4, 5, 6, 7),
    -465                     'Co': (1, 2, 3, 4, 5),
    -466                     'Ni': (1, 2, 3, 4),
    -467                     'Cu': (2, 1, 3, 4),
    -468                     'Zn': (2, 1),
    -469                     'Ge': (4, 3, 2, 1),
    -470                     'As': (5, 3, 2, 1),
    -471                     'Se': (6, 4, 2, 1),
    -472                     'Y': (3, 2, 1),
    -473                     'Zr': (4, 3, 2, 1),
    -474                     'Nb': (5, 4, 3, 2, 1),
    -475                     'Mo': (6, 5, 4, 3, 2, 1),
    -476                     'Tc': (7, 6, 5, 4, 3, 2, 1),
    -477                     'Ru': (8, 7, 6, 5, 4, 3, 2, 1),
    -478                     'Rh': (6, 5, 4, 3, 2, 1),
    -479                     'Pd': (4, 2, 1),
    -480                     'Ag': (0, 1, 2, 3, 4),
    -481                     'Cd': (2, 1),
    -482                     'Sn': (4, 2),
    -483                     'Sb': (5, 3),
    -484                     'Te': (6, 5, 4, 2),
    -485                     'La': (3, 2),
    -486                     'Hf': (4, 3, 2),
    -487                     'Ta': (5, 4, 3, 2),
    -488                     'W': (6, 5, 4, 3, 2, 1),
    -489                     'Re': (4, 7, 6, 5, 3, 2, 1),
    -490                     'Os': (4, 8, 7, 6, 5, 3, 2, 1),
    -491                     'Ir': (4, 8, 6, 5, 3, 2, 1),
    -492                     'Pt': (4, 6, 5, 3, 2, 1),
    -493                     'Au': (3, 5, 2, 1),
    -494                     'Hg': (1, 2, 4),
    -495                     'Tl': (3, 1),
    -496                     'Pb': (4, 2),
    -497                     'Bi': (3, 1, 5),
    -498                     'Po': (2, 4, 6),
    -499                     'Ac': (3, 2)
    -500                     }
    -501
    -502    isotopic_abundance = {'H': 0.999885,
    -503                          'D': 0.000115,
    -504                          'T': 0,
    -505                          '3He': 0.00000134,
    -506                          'He': 0.99999866,
    -507                          '6Li': 0.0759,
    -508                          'Li': 0.9241,
    -509                          '9Be': 1.0,
    -510                          '10B': 0.199,
    -511                          '11B': 0.801,
    -512                          'C': 0.9893,
    -513                          '13C': 0.0107,
    -514                          '14C': 0,
    -515                          'N': 0.99636,
    -516                          '15N': 0.00364,
    -517                          'O': 0.99757,
    -518                          '17O': 0.00038,
    -519                          '18O': 0.00205,
    -520                          'F': 1.0,
    -521                          '20Ne': 0.9048,
    -522                          '21Ne': 0.0027,
    -523                          '22Ne': 0.0925,
    -524                          'Na': 1.0,
    -525                          '24Mg': 0.7899,
    -526                          '25Mg': 0.1000,
    -527                          '26Mg': 0.1101,
    -528                          'Al': 1.0,
    -529                          '28Si': 0.92223,
    -530                          '29Si': 0.04685,
    -531                          '30Si': 0.03092,
    -532                          'P': 1.0,
    -533                          'S': 0.9499,
    -534                          '33S': 0.0075,
    -535                          '34S': 0.0425,
    -536                          '36S': 0.0001,
    -537                          'Cl': 0.7576,
    -538                          '37Cl': 0.2424,
    -539                          '36Ar': 0.003336,
    -540                          '38Ar': 0.000629,
    -541                          '40Ar': 0.996035,
    -542                          'K': 0.932581,
    -543                          '40K': 0.000117,
    -544                          '41K': 0.067302,
    -545                          'Ca': 0.96941,
    -546                          '42Ca': 0.00647,
    -547                          '43Ca': 0.00135,
    -548                          '44Ca': 0.02086,
    -549                          '46Ca': 0.00004,
    -550                          '48Ca': 0.001872,
    -551                          '45Sc': 1.0,
    -552                          '46Ti': 0.0825,
    -553                          '47Ti': 0.0744,
    -554                          '48Ti': 0.7372,
    -555                          '49Ti': 0.0541,
    -556                          '50Ti': 0.0518,
    -557                          '50V': 0.00250,
    -558                          'V': 0.9975,
    -559                          '50Cr': 0.04345,
    -560                          'Cr': 0.83789,
    -561                          '53Cr': 0.09501,
    -562                          '54Cr': 0.02365,
    -563                          'Mn': 1.0,
    -564                          '54Fe': 0.05845,
    -565                          'Fe': 0.91754,
    -566                          '57Fe': 0.02119,
    -567                          '58Fe': 0.00282,
    -568                          'Co': 1.0,
    -569                          'Ni': 0.68077,
    -570                          '60Ni': 0.26223,
    -571                          '61Ni': 0.011399,
    -572                          '62Ni': 0.036346,
    -573                          '64Ni': 0.009255,
    -574                          'Cu': 0.6915,
    -575                          '65Cu': 0.3085,
    -576                          'Zn': 0.4917,
    -577                          '66Zn': 0.2773,
    -578                          '67Zn': 0.0404,
    -579                          '68Zn': 0.1845,
    -580                          '70Zn': 0.0061,
    -581                          '69Ga': 0.60108,
    -582                          '71Ga': 0.39892,
    -583                          '70Ge': 0.2057,
    -584                          '72Ge': 0.2745,
    -585                          '73Ge': 0.0775,
    -586                          '74Ge': 0.3650,
    -587                          '76Ge': 0.0773,
    -588                          'As': 1.0,
    -589                          '74Se': 0.0089,
    -590                          '76Se': 0.0937,
    -591                          '77Se': 0.0763,
    -592                          '78Se': 0.2377,
    -593                          'Se': 0.4961,
    -594                          '82Se': 0.0873,
    -595                          'Br': 0.5069,
    -596                          '81Br': 0.4931,
    -597                          '78Kr': 0.00355,
    -598                          '80Kr': 0.02286,
    -599                          '82Kr': 0.11593,
    -600                          '83Kr': 0.11500,
    -601                          '84Kr': 0.56987,
    -602                          '86Kr': 0.17279,
    -603                          '85Rb': 0.7217,
    -604                          '87Rb': 0.2783,
    -605                          '84Sr': 0.0056,
    -606                          '86Sr': 0.0986,
    -607                          '87Sr': 0.0700,
    -608                          '88Sr': 0.8258,
    -609                          '89Y': 1.0,
    -610                          '90Zr': 0.5145,
    -611                          '91Zr': 0.1122,
    -612                          '92Zr': 0.1715,
    -613                          '94Zr': 0.1738,
    -614                          '96Zr': 0.0280,
    -615                          '93Nb': 1.0,
    -616                          '92Mo': 0.1453,
    -617                          '94Mo': 0.0915,
    -618                          '95Mo': 0.1584,
    -619                          '96Mo': 0.1667,
    -620                          '97Mo': 0.0960,
    -621                          'Mo': 0.2439,
    -622                          '100Mo': 0.0982,
    -623                          '97Tc': 0,
    -624                          '98Tc': 0,
    -625                          '99Tc': 0,
    -626                          '96Ru': 0.0554,
    -627                          '98Ru': 0.0187,
    -628                          '99Ru': 0.1276,
    -629                          '100Ru': 0.1260,
    -630                          '101Ru': 0.1706,
    -631                          '102Ru': 0.3155,
    -632                          '104Ru': 0.1862,
    -633                          '103Rh': 1.0,
    -634                          '102Pd': 0.0102,
    -635                          '104Pd': 0.1114,
    -636                          '105Pd': 0.2233,
    -637                          '106Pd': 0.2733,
    -638                          '108Pd': 0.2646,
    -639                          '110Pd': 0.1172,
    -640                          '107Ag': 0.51839,
    -641                          '109Ag': 0.48161,
    -642                          '106Cd': 0.0125,
    -643                          '108Cd': 0.0089,
    -644                          '110Cd': 0.1249,
    -645                          '111Cd': 0.1280,
    -646                          'Cd': 0.2413,
    -647                          '113Cd': 0.1222,
    -648                          '114Cd': 0.2873,
    -649                          '116Cd': 0.0749,
    -650                          '113In': 0.0429,
    -651                          'In': 0.9571,
    -652                          '112Sn': 0.0097,
    -653                          '114Sn': 0.0066,
    -654                          '115Sn': 0.0034,
    -655                          '116Sn': 0.1454,
    -656                          '117Sn': 0.0768,
    -657                          '118Sn': 0.2422,
    -658                          '119Sn': 0.0859,
    -659                          '120Sn': 0.3258,
    -660                          '122Sn': 0.0463,
    -661                          '124Sn': 0.0579,
    -662                          '121Sb': 0.5721,
    -663                          '123Sb': 0.4279,
    -664                          '120Te': 0.0009,
    -665                          '122Te': 0.0255,
    -666                          '123Te': 0.0089,
    -667                          '124Te': 0.0474,
    -668                          '125Te': 0.0707,
    -669                          '126Te': 0.1884,
    -670                          '128Te': 0.3174,
    -671                          '130Te': 0.3408,
    -672                          '127I': 1.0, # TODO Why is this here twice
    -673                          'I': 1.0,
    -674                          '124Xe': 0.000952,
    -675                          '126Xe': 0.000890,
    -676                          '128Xe': 0.019102,
    -677                          '129Xe': 0.264006,
    -678                          '130Xe': 0.040710,
    -679                          '131Xe': 0.212324,
    -680                          '132Xe': 0.269086,
    -681                          '134Xe': 0.104357,
    -682                          '136Xe': 0.088573,
    -683                          '133Cs': 1.0,
    -684                          '130Ba': 0.00106,
    -685                          '132Ba': 0.00101,
    -686                          '134Ba': 0.02417,
    -687                          '135Ba': 0.06592,
    -688                          '136Ba': 0.07854,
    -689                          '137Ba': 0.11232,
    -690                          '138Ba': 0.71698,
    -691                          '138La': 0.0008881,
    -692                          '139La': 0.9991119,
    -693                          '136Ce': 0.00185,
    -694                          '138Ce': 0.00251,
    -695                          '140Ce': 0.88450,
    -696                          '142Ce': 0.11114,
    -697                          '141Pr': 1.0,
    -698                          '142Nd': 0.27152,
    -699                          '143Nd': 0.12174,
    -700                          '144Nd': 0.23798,
    -701                          '145Nd': 0.08293,
    -702                          '146Nd': 0.17189,
    -703                          '148Nd': 0.05756,
    -704                          '150Nd': 0.05638,
    -705                          '145Pm': 0,
    -706                          '147Pm': 0,
    -707                          '144Sm': 0.0307,
    -708                          '147Sm': 0.1499,
    -709                          '148Sm': 0.1124,
    -710                          '149Sm': 0.1382,
    -711                          '150Sm': 0.0738,
    -712                          '152Sm': 0.2675,
    -713                          '154Sm': 0.2275,
    -714                          '151Eu': 0.4781,
    -715                          '153Eu': 0.5219,
    -716                          '152Gd': 0.0020,
    -717                          '154Gd': 0.0218,
    -718                          '155Gd': 0.1480,
    -719                          '156Gd': 0.2047,
    -720                          '157Gd': 0.1565,
    -721                          '158Gd': 0.2484,
    -722                          '160Gd': 0.2186,
    -723                          '159Tb': 1.0,
    -724                          '156Dy': 0.00056,
    -725                          '158Dy': 0.00095,
    -726                          '160Dy': 0.02329,
    -727                          '161Dy': 0.18889,
    -728                          '162Dy': 0.25475,
    -729                          '163Dy': 0.24896,
    -730                          '164Dy': 0.28260,
    -731                          '165Ho': 1.0,
    -732                          '162Er': 0.00139,
    -733                          '164Er': 0.01601,
    -734                          '166Er': 0.33503,
    -735                          '167Er': 0.22869,
    -736                          '168Er': 0.26978,
    -737                          '170Er': 0.14910,
    -738                          '169Tm': 1.0,
    -739                          '168Yb': 0.00123,
    -740                          '170Yb': 0.02982,
    -741                          '171Yb': 0.1409,
    -742                          '172Yb': 0.2168,
    -743                          '173Yb': 0.16103,
    -744                          '174Yb': 0.32026,
    -745                          '176Yb': 0.12996,
    -746                          '175Lu': 0.97401,
    -747                          '176Lu': 0.02599,
    -748                          '174Hf': 0.0016,
    -749                          '176Hf': 0.0526,
    -750                          '177Hf': 0.1860,
    -751                          '178Hf': 0.2728,
    -752                          '179Hf': 0.1362,
    -753                          '180Hf': 0.3508,
    -754                          '180Ta': 0.0001201,
    -755                          '181Ta': 0.9998799,
    -756                          '180W': 0.0012,
    -757                          '182W': 0.2650,
    -758                          '183W': 0.1431,
    -759                          '184W': 0.3064,
    -760                          '186W': 0.2843,
    -761                          '185Re': 0.3740,
    -762                          '187Re': 0.6260,
    -763                          '184Os': 0.0002,
    -764                          '186Os': 0.0159,
    -765                          '187Os': 0.0196,
    -766                          '188Os': 0.1324,
    -767                          '189Os': 0.1615,
    -768                          '190Os': 0.2626,
    -769                          '192Os': 0.4078,
    -770                          '191Ir': 0.373,
    -771                          '193Ir': 0.627,
    -772                          '190Pt': 0.00012,
    -773                          '192Pt': 0.00782,
    -774                          '194Pt': 0.3286,
    -775                          '195Pt': 0.3378,
    -776                          '196Pt': 0.2521,
    -777                          '198Pt': 0.07356,
    -778                          '197Au': 1.0,
    -779                          '196Hg': 0.0015,
    -780                          '198Hg': 0.0997,
    -781                          '199Hg': 0.16872,
    -782                          '200Hg': 0.2310,
    -783                          '201Hg': 0.1318,
    -784                          '202Hg': 0.2986,
    -785                          '204Hg': 0.0687,
    -786                          '203Tl': 0.2952,
    -787                          '205Tl': 0.7048,
    -788                          '204Pb': 0.014,
    -789                          '206Pb': 0.241,
    -790                          '207Pb': 0.221,
    -791                          'Pb': 0.524,
    -792                          '209Bi': 1.0,
    -793                          '209Po': 0,
    -794                          '210Po': 0,
    -795                          '210At': 0,
    -796                          '211At': 0,
    -797                          '211Rn': 0,
    -798                          '220Rn': 0,
    -799                          '222Rn': 0,
    -800                          '223Fr': 0,
    -801                          '223Ra': 0,
    -802                          '224Ra': 0,
    -803                          '226Ra': 0,
    -804                          '228Ra': 0,
    -805                          '227Ac': 0,
    -806                          '230Th': 0,
    -807                          '232Th': 1.0,
    -808                          '231Pa': 1.0,
    -809                          '233U': 0,
    -810                          '234U': 0.000054,
    -811                          '235U': 0.007204,
    -812                          '236U': 0,
    -813                          '238U': 0.992742,
    -814                          '236Np': 0,
    -815                          '237Np': 0,
    -816                          '238Pu': 0,
    -817                          '239Pu': 0,
    -818                          '240Pu': 0,
    -819                          '241Pu': 0,
    -820                          '242Pu': 0,
    -821                          '244Pu': 0,
    -822                          '241Am': 0,
    -823                          '243Am': 0,
    -824                          '243Cm': 0,
    -825                          '244Cm': 0,
    -826                          '245Cm': 0,
    -827                          '246Cm': 0,
    -828                          '247Cm': 0,
    -829                          '248Cm': 0,
    -830                          '247Bk': 0,
    -831                          '249Bk': 0,
    -832                          '249Cf': 0,
    -833                          '250Cf': 0,
    -834                          '251Cf': 0,
    -835                          '252Cf': 0,
    -836                          '252Es': 0,
    -837                          '257Fm': 0,
    -838                          '258Md': 0,
    -839                          '260Md': 0,
    -840                          '259No': 0,
    -841                          '262Lr': 0,
    -842                          '267Rf': 0,
    -843                          '268Db': 0,
    -844                          '271Sg': 0,
    -845                          '272Bh': 0,
    -846                          '270Hs': 0,
    -847                          '276Mt': 0,
    -848                          '281Ds': 0,
    -849                          '280Rg': 0,
    -850                          '285Cn': 0,
    -851                          '284Nh': 0,
    -852                          '289Fl': 0,
    -853                          '288Mc': 0,
    -854                          '293Lv': 0,
    -855                          '292Ts': 0,
    -856                          '294Og': 0}
    -857
    -858    isotopes = {'F': ['Flourine'],
    -859                'Na': ['Sodium'],
    -860                'Al': ['Aluminum'],
    -861                'P': ['Phosphorus'],
    -862                'Sc': ['Scandium'],
    -863                'Co': ['Cobalt'],
    -864                'He': ['Helium'],
    -865                'Ar': ['Argon'],
    -866                'H': ['Hydrogen', ['D']],
    -867                'Cl': ['Chlorine', ['37Cl']],
    -868                'Li': ['Lithium', ['6Li']],
    -869                'Be': ['Beryllium'],
    -870                'B': ['Boron', ['11B']],
    -871                'C': ['Carbon', ['13C']],
    -872                'O': ['Oxygen', ['18O', '17O']],
    -873                'S': ['Sulfur', ['34S']],
    -874                'N': ['Nitrogen', ['15N']],
    -875                'V': ['Vanadium', ['50V']],
    -876                'Ne': ['Neon', ['20Ne', '22Ne']],
    -877                'Mg': ['Magnesium', ['24Mg', '26Mg', '25Mg']],
    -878                'Si': ['Silicon', ['28Si', '29Si', '30Si']],
    -879                'K': ['Potassium', ['40K', '41K']],
    -880                'Ca': ['Calcium', ['43Ca', '44Ca']],
    -881                'Ti': ['Titanium', ['48Ti', '46Ti', '47Ti', '49Ti', '50Ti']],
    -882                'Cr': ['Chromium', ['53Cr', '50Cr', '54Cr']],
    -883                'Fe': ['Iron', ['54Fe', '57Fe', '58Fe']],
    -884                'Mn': ['Manganese'],
    -885                'Ni': ['Nickel', ['60Ni', '62Ni', '61Ni']],
    -886                'Cu': ['Copper', ['65Cu']],
    -887                'Zn': ['Zinc', ['66Zn', '68Zn', '67Zn', '70Zn']],
    -888                'Ga': ['Gallium', ['69Ga', '71Ga']],
    -889                'Ge': ['Germanium', ['74Ge', '72Ge', '70Ge', '73Ge', '76Ge']],
    -890                'As': ['Arsenic'],
    -891                'Se': ['Selenium', ['78Se', '76Se', '82Se', '77Se']],
    -892                'Br': ['Bromine', ['81Br']],
    -893                'Kr': ['Krypton', ['84Kr', '86Kr', '82Kr', '83Kr', '80Kr']],
    -894                'Rb': ['Rubidium', ['85Rb', '87Rb']],
    -895                'Sr': ['Strontium', ['88Sr', '86Sr', '87Sr']],
    -896                'Y': ['Yttrium'],
    -897                'Zr': ['Zironium', ['90Zr', '94Zr', '92Zr', '91Zr', '96Zr']],
    -898                'Nb': ['Niobium'],
    -899                'Mo': ['Molybdenum', ['96Mo', '95Mo', '92Mo', '100Mo', '97Mo', '94Mo']],
    -900                'Tc': ['Technetium'],
    -901                'Ru': ['Ruthenium', ['102Ru', '104Ru', '101Ru', '99Ru', '100Ru', '96Ru', '98Ru']],
    -902                'Rh': ['Rhodium'],
    -903                'Pd': ['Palladium', ['106Pd', '108Pd', '105Pd', '110Pd', '104Pd', '102Pd']],
    -904                'Ag': ['Silver', ['107Ag', '109Ag']],
    -905                'Cd': ['Cadmium', ['114Cd', '111Cd', '110Cd', '113Cd', '116Cd', '106Cd', '108Cd']],
    -906                'In': ['Indium', ['113In']],
    -907                'Sn': ['Tin', ['120Sn', '118Sn', '116Sn', '119Sn', '117Sn', '124Sn', '122Sn', '112Sn']],
    -908                'Sb': ['Antimony', ['121Sb', '123Sb']],
    -909                'Te': ['Tellurium', ['130Te', '128Te', '126Te', '125Te', '124Te', '122Te']],
    -910                'I': ['Iodine'],
    -911                'Xe': ['Xenon', ['132Xe', '129Xe', '131Xe', '134Xe', '136Xe', '130Xe', '128Xe']],
    -912                'Cs': ['Cesium'],
    -913                'Ba': ['Barium', ['138Ba', '137Ba', '136Ba', '135Ba', '134Ba']],
    -914                'La': ['Lanthanum'],
    -915                'Hf': ['Hafnium', ['180Hf', '178Hf', '177Hf', '179Hf', '176Hf']],
    -916                'Ta': ['Tantalum'],
    -917                'W': ['Tungsten', ['184W', '186W', '182W', '183W']],
    -918                'Re': ['Rhenium', ['187Re', '185Re']],
    -919                'Os': ['Osmium', ['192Os', '190Os', '189Os', '188Os', '187Os', '186Os']],
    -920                'Ir': ['Iridium', ['193Ir', '191Ir']],
    -921                'Pt': ['Platinum', ['195Pt', '194Pt', '196Pt', '198Pt', '192Pt']],
    -922                'Au': ['Gold'],
    -923                'Hg': ['Mercury', ['202Hg', '200Hg', '199Hg', '201Hg', '198Hg', '204Hg']],
    -924                'Tl': ['Thallium', ['205Tl', '203Tl']],
    -925                'Pb': ['Lead', ['206Pb', '207Pb', '204Pb']],
    -926                'Bi': ['Bismuth'],
    -927                'Po': ['Polonium'],
    -928                'At': ['Aslatine'],
    -929                'Rn': ['Radon'],
    -930                'Fr': ['Francium'],
    -931                'Ra': ['Radium'],
    -932                'Ac': ['Actinium']
    -933                }
    +                        
       1class Labels: #pragma: no cover
    +   2    """ Class for Labels used in CoreMS
    +   3    
    +   4    These labels are used to define:
    +   5    * types of columns in plaintext data inputs, 
    +   6    * types of data/mass spectra
    +   7    * types of assignment for ions
    +   8
    +   9    """
    +  10    mz = "m/z"
    +  11    abundance = "Peak Height"
    +  12    rp = "Resolving Power"
    +  13    s2n = "S/N"
    +  14
    +  15    label = 'label'
    +  16    bruker_profile = 'Bruker_Profile'
    +  17    thermo_profile = 'Thermo_Profile'
    +  18    simulated_profile = 'Simulated Profile'
    +  19    booster_profile = 'Booster Profile'
    +  20    bruker_frequency = 'Bruker_Frequency'
    +  21    midas_frequency = 'Midas_Frequency'
    +  22    thermo_centroid = 'Thermo_Centroid'
    +  23    corems_centroid = 'CoreMS_Centroid'
    +  24    gcms_centroid = 'Thermo_Centroid'
    +  25    
    +  26    unassigned = 'unassigned'
    +  27
    +  28    radical_ion = 'RADICAL'
    +  29    protonated_de_ion = 'DE_OR_PROTONATED'
    +  30    protonated = "protonated"
    +  31    de_protonated = "de-protonated"
    +  32    adduct_ion = "ADDUCT"
    +  33    neutral = 'neutral'
    +  34    ion_type = 'IonType'
    +  35
    +  36    ion_type_translate = { 'protonated': 'DE_OR_PROTONATED',
    +  37                          'de-protonated': 'DE_OR_PROTONATED',
    +  38                          'radical': 'RADICAL',
    +  39                          'adduct': 'ADDUCT'}
    +  40    
    +  41class Atoms: #pragma: no cover
    +  42    """ Class for Atoms in CoreMS
    +  43
    +  44    This class includes key properties of atoms (and the electron) and isotopes, including their exact masses, relative abundances, and covalences. 
    +  45    It also associates which isotopes are for the same element, and provides an ordering of elements.
    +  46
    +  47    IUPAC definition of monoisotopic mass is based on the most abundant isotopes of each element present.
    +  48    Here, we will use atom symbols with isotope numbers for all isotopes excluding the most abundant one.
    +  49    This list has been corrected up to Iodine. 
    +  50    
    +  51    References
    +  52    ----------
    +  53
    +  54    1. NIST - Last Accessed 2019-06-12
    +  55    https://www.nist.gov/pml/atomic-weights-and-isotopic-compositions-relative-atomic-masses
    +  56
    +  57    """
    +  58    electron_mass = 0.0005_485_799_090_65 #NIST value
    +  59
    +  60    atomic_masses = {'H': 1.00782503223,
    +  61                     'D': 2.01410177812,
    +  62                     'T': 3.0160492779, #consider removing 
    +  63                     '3He': 3.0160293201,
    +  64                     'He': 4.00260325413,
    +  65                     '6Li': 6.0151228874,
    +  66                     'Li': 7.0160034366,
    +  67                     'Be': 9.012183065,
    +  68                     '10B': 10.01293695,
    +  69                     'B': 11.00930536,
    +  70                     'C': 12.0,
    +  71                     '13C': 13.00335483507,
    +  72                     '14C': 14.0032419884,
    +  73                     'N': 14.00307400443,
    +  74                     '15N': 15.00010889888,
    +  75                     'O': 15.99491461957,
    +  76                     '17O': 16.99913175650,
    +  77                     '18O': 17.99915961286,
    +  78                     'F': 18.99840316273,
    +  79                     'Ne': 19.9924401762,
    +  80                     '21Ne': 20.993846685,
    +  81                     '22Ne': 21.991385114,
    +  82                     'Na': 22.9897692820,
    +  83                     'Mg': 23.985041697,
    +  84                     '25Mg': 24.985836976,
    +  85                     '26Mg': 25.982592968,
    +  86                     'Al': 26.98153853,
    +  87                     'Si': 27.97692653465,
    +  88                     '29Si': 28.97649466490,
    +  89                     '30Si': 29.973770136,
    +  90                     'P': 30.97376199842,
    +  91                     'S': 31.9720711744,
    +  92                     '33S': 32.9714589098,
    +  93                     '34S': 33.967867004,
    +  94                     '36S': 35.96708071,
    +  95                     'Cl': 34.968852682,
    +  96                     '37Cl': 36.965902602,
    +  97                     '36Ar': 35.967545105,
    +  98                     '38Ar': 37.96273211,
    +  99                     'Ar': 39.9623831237,
    + 100                     'K': 38.9637064864,
    + 101                     '40K': 39.963998166,
    + 102                     '41K': 40.9618252579,
    + 103                     'Ca': 39.962590863,
    + 104                     '42Ca': 41.95861783,
    + 105                     '43Ca': 42.95876644,
    + 106                     '44Ca': 43.95548156,
    + 107                     '46Ca': 45.9536890,
    + 108                     '48Ca': 47.95252276,
    + 109                     'Sc': 44.95590828,
    + 110                     '46Ti': 45.95262772,
    + 111                     '47Ti': 46.95175879,
    + 112                     'Ti': 47.94794198,
    + 113                     '49Ti': 48.94786568,
    + 114                     '50Ti': 49.94478689,
    + 115                     '50V': 49.94715601,
    + 116                     'V': 50.94395704,
    + 117                     '50Cr': 49.94604183,
    + 118                     'Cr': 51.94050623,
    + 119                     '53Cr': 52.94064815,
    + 120                     '54Cr': 53.93887916,
    + 121                     'Mn': 54.93804391,
    + 122                     '54Fe': 53.93960899,
    + 123                     'Fe': 55.93493633,
    + 124                     '57Fe': 56.93539284,
    + 125                     '58Fe': 57.93327443,
    + 126                     'Co': 58.93319429,
    + 127                     'Ni': 57.93534241,
    + 128                     '60Ni': 59.93078588,
    + 129                     '61Ni': 60.93105557,
    + 130                     '62Ni': 61.92834537,
    + 131                     '64Ni': 63.92796682,
    + 132                     'Cu': 62.92959772,
    + 133                     '65Cu': 64.92778970,
    + 134                     'Zn': 63.92914201,
    + 135                     '66Zn': 65.92603381,
    + 136                     '67Zn': 66.92712775,
    + 137                     '68Zn': 67.92484455,
    + 138                     '70Zn': 69.9253192,
    + 139                     'Ga': 68.9255735,
    + 140                     '71Ga': 70.92470258,
    + 141                     '70Ge': 69.92424875,
    + 142                     '72Ge': 71.922075826,
    + 143                     '73Ge': 72.923458956,
    + 144                     'Ge': 73.921177761,
    + 145                     '76Ge': 75.921402726,
    + 146                     'As': 74.92159457,
    + 147                     '74Se': 73.922475934,
    + 148                     '76Se': 75.919213704,
    + 149                     '77Se': 76.919914154,
    + 150                     '78Se': 77.91730928,
    + 151                     'Se': 79.9165218,
    + 152                     '82Se': 81.9166995,
    + 153                     'Br': 78.9183376,
    + 154                     '81Br': 80.9162897,
    + 155                     '78Kr': 77.92036494,
    + 156                     '80Kr': 79.91637808,
    + 157                     '82Kr': 81.91348273,
    + 158                     '83Kr': 82.91412716,
    + 159                     'Kr': 83.9114977282,
    + 160                     '86Kr': 85.9106106269,
    + 161                     'Rb': 84.9117897379,
    + 162                     '87Rb': 86.9091805310,
    + 163                     '84Sr': 83.9134191,
    + 164                     '86Sr': 85.9092606,
    + 165                     '87Sr': 86.9088775,
    + 166                     'Sr': 87.9056125,
    + 167                     'Y': 88.9058403,
    + 168                     'Zr': 89.9046977,
    + 169                     '91Zr': 90.9056396,
    + 170                     '92Zr': 91.9050347,
    + 171                     '94Zr': 93.9063108,
    + 172                     '96Zr': 95.9082714,
    + 173                     'Nb': 92.9063730,
    + 174                     '92Mo': 91.90680796,
    + 175                     '94Mo': 93.90508490,
    + 176                     '95Mo': 94.90583877,
    + 177                     '96Mo': 95.90467612,
    + 178                     '97Mo': 96.90601812,
    + 179                     'Mo': 97.90540482,
    + 180                     '100Mo': 99.9074718,
    + 181                     #'97Tc': 96.9063667,
    + 182                     #'98Tc': 97.9072124,
    + 183                     'Tc': 98.9062508, #consider removing technetium as it is radioactive
    + 184                     '96Ru': 95.90759025,
    + 185                     '98Ru': 97.9052868,
    + 186                     '99Ru': 98.9059341,
    + 187                     '100Ru': 99.9042143,
    + 188                     '101Ru': 100.9055769,
    + 189                     'Ru': 101.9043441,
    + 190                     '104Ru': 103.9054275,
    + 191                     'Rh': 102.9054980,
    + 192                     '102Pd': 101.9056022,
    + 193                     '104Pd': 103.9040305,
    + 194                     '105Pd': 104.9050796,
    + 195                     'Pd': 105.9034804,
    + 196                     '108Pd': 107.9038916,
    + 197                     '110Pd': 109.9051722,
    + 198                     'Ag': 106.9050916,
    + 199                     '109Ag': 108.9047553,
    + 200                     '106Cd': 105.9064599,
    + 201                     '108Cd': 107.9041834,
    + 202                     '110Cd': 109.90300661,
    + 203                     '111Cd': 110.90418287,
    + 204                     'Cd': 111.90276287,
    + 205                     '113Cd': 112.90440813,
    + 206                     '114Cd': 113.90336509,
    + 207                     '116Cd': 115.90476315,
    + 208                     '113In': 112.90406184,
    + 209                     'In': 114.903878776,
    + 210                     '112Sn': 111.90482387,
    + 211                     '114Sn': 113.9027827,
    + 212                     '115Sn': 114.903344699,
    + 213                     '116Sn': 115.90174280,
    + 214                     '117Sn': 116.90295398,
    + 215                     '118Sn': 117.90160657,
    + 216                     '119Sn': 118.90331117,
    + 217                     'Sn': 119.90220163,
    + 218                     '122Sn': 121.9034438,
    + 219                     '124Sn': 123.9052766,
    + 220                     'Sb': 120.9038120,
    + 221                     '123Sb': 122.9042132,
    + 222                     '120Te': 119.9040593,
    + 223                     '122Te': 121.9030435,
    + 224                     '123Te': 122.9042698,
    + 225                     '124Te': 123.9028171,
    + 226                     '125Te': 124.9044299,
    + 227                     '126Te': 125.9033109,
    + 228                     '128Te': 127.90446128,
    + 229                     'Te': 129.906222748,
    + 230                     'I': 126.9044719,
    + 231                     '124Xe': 123.9058920,
    + 232                     '126Xe': 125.9042983,
    + 233                     '128Xe': 127.9035310,
    + 234                     '129Xe': 128.9047808611,
    + 235                     '130Xe': 129.903509349,
    + 236                     '131Xe': 130.90508406,
    + 237                     'Xe': 131.9041550856,
    + 238                     '134Xe': 133.90539466,
    + 239                     '136Xe': 135.907214484,
    + 240                     'Cs': 132.9054519610,
    + 241                     '130Ba': 129.9063207,
    + 242                     '132Ba': 131.9050611,
    + 243                     '134Ba': 133.90450818,
    + 244                     '135Ba': 134.90568838,
    + 245                     '136Ba': 135.90457573,
    + 246                     '137Ba': 136.90582714,
    + 247                     'Ba': 137.90524700,
    + 248                     '138La': 137.9071149,
    + 249                     'La': 138.9063563,
    + 250                     '136Ce': 135.90712921,
    + 251                     '138Ce': 137.905991,
    + 252                     'Ce': 139.9054431,
    + 253                     '142Ce': 141.9092504,
    + 254                     'Pr': 140.9076576,
    + 255                     'Nd': 141.9077290,
    + 256                     '143Nd': 142.9098200,
    + 257                     '144Nd': 143.9100930,
    + 258                     '145Nd': 144.9125793,
    + 259                     '146Nd': 145.9131226,
    + 260                     '148Nd': 147.9168993,
    + 261                     '150Nd': 149.9209022,
    + 262                     '145Pm': 144.9127559,
    + 263                     '147Pm': 146.9151450,
    + 264                     '144Sm': 143.9120065,
    + 265                     '147Sm': 146.9149044,
    + 266                     '148Sm': 147.9148292,
    + 267                     '149Sm': 148.9171921,
    + 268                     '150Sm': 149.9172829,
    + 269                     'Sm': 151.9197397,
    + 270                     '154Sm': 153.9222169,
    + 271                     '151Eu': 150.9198578,
    + 272                     'Eu': 152.9212380,
    + 273                     '152Gd': 151.9197995,
    + 274                     '154Gd': 153.9208741,
    + 275                     '155Gd': 154.9226305,
    + 276                     '156Gd': 155.9221312,
    + 277                     '157Gd': 156.9239686,
    + 278                     'Gd': 157.9241123,
    + 279                     '160Gd': 159.9270624,
    + 280                     'Tb': 158.9253547,
    + 281                     '156Dy': 155.9242847,
    + 282                     '158Dy': 157.9244159,
    + 283                     '160Dy': 159.9252046,
    + 284                     '161Dy': 160.9269405,
    + 285                     '162Dy': 161.9268056,
    + 286                     '163Dy': 162.9287383,
    + 287                     'Dy': 163.9291819,
    + 288                     'Ho': 164.9303288,
    + 289                     '162Er': 161.9287884,
    + 290                     '164Er': 163.9292088,
    + 291                     'Er': 165.9302995,
    + 292                     '167Er': 166.9320546,
    + 293                     '168Er': 167.9323767,
    + 294                     '170Er': 169.9354702,
    + 295                     'Tm': 168.9342179,
    + 296                     '168Yb': 167.9338896,
    + 297                     '170Yb': 169.9347664,
    + 298                     '171Yb': 170.9363302,
    + 299                     '172Yb': 171.9363859,
    + 300                     '173Yb': 172.9382151,
    + 301                     'Yb': 173.9388664,
    + 302                     '176Yb': 175.9425764,
    + 303                     'Lu': 174.9407752,
    + 304                     '176Lu': 175.9426897,
    + 305                     '174Hf': 173.9400461,
    + 306                     '176Hf': 175.9414076,
    + 307                     '177Hf': 176.9432277,
    + 308                     '178Hf': 177.9437058,
    + 309                     '179Hf': 178.9458232,
    + 310                     'Hf': 179.9465570,
    + 311                     '180Ta': 179.9474648,
    + 312                     'Ta': 180.9479958,
    + 313                     '180W': 179.9467108,
    + 314                     '182W': 181.94820394,
    + 315                     '183W': 182.95022275,
    + 316                     'W': 183.95093092,
    + 317                     '186W': 185.9543628,
    + 318                     '185Re': 184.9529545,
    + 319                     'Re': 186.9557501,
    + 320                     '184Os': 183.9524885,
    + 321                     '186Os': 185.9538350,
    + 322                     '187Os': 186.9557474,
    + 323                     '188Os': 187.9558352,
    + 324                     '189Os': 188.9581442,
    + 325                     '190Os': 189.9584437,
    + 326                     '192Os': 191.9614770,
    + 327                     '191Ir': 190.9605893,
    + 328                     'Ir': 192.9629216,
    + 329                     '190Pt': 189.9599297,
    + 330                     '192Pt': 191.9610387,
    + 331                     '194Pt': 193.9626809,
    + 332                     'Pt': 194.9647917,
    + 333                     '196Pt': 195.96495209,
    + 334                     '198Pt': 197.9678949,
    + 335                     'Au': 196.96656879,
    + 336                     '196Hg': 195.9658326,
    + 337                     '198Hg': 197.96676860,
    + 338                     '199Hg': 198.96828064,
    + 339                     '200Hg': 199.96832659,
    + 340                     '201Hg': 200.97030284,
    + 341                     'Hg': 201.97064340,
    + 342                     '204Hg': 203.97349398,
    + 343                     '203Tl': 202.9723446,
    + 344                     'Tl': 204.9744278,
    + 345                     '204Pb': 203.9730440,
    + 346                     '206Pb': 205.9744657,
    + 347                     '207Pb': 206.9758973,
    + 348                     'Pb': 207.9766525,
    + 349                     'Bi': 208.9803991,
    + 350                     '209Po': 208.9824308,
    + 351                     '210Po': 209.9828741,
    + 352                     '210At': 209.9871479,
    + 353                     '211At': 210.9874966,
    + 354                     '211Rn': 210.9906011,
    + 355                     '220Rn': 220.0113941,
    + 356                     '222Rn': 222.0175782,
    + 357                     '223Fr': 223.0197360,
    + 358                     '223Ra': 223.0185023,
    + 359                     '224Ra': 224.0202120,
    + 360                     '226Ra': 226.0254103,
    + 361                     '228Ra': 228.0310707,
    + 362                     '227Ac': 227.0277523,
    + 363                     '230Th': 230.0331341,
    + 364                     'Th': 232.0380558,
    + 365                     'Pa': 231.0358842,
    + 366                     '233U': 233.0396355,
    + 367                     '234U': 234.0409523,
    + 368                     '235U': 235.0439301,
    + 369                     '236U': 236.0455682,
    + 370                     'U': 238.0507884,
    + 371                     '236Np': 236.046570,
    + 372                     '237Np': 237.0481736,
    + 373                     '238Pu': 238.0495601,
    + 374                     '239Pu': 239.0521636,
    + 375                     '240Pu': 240.0538138,
    + 376                     '241Pu': 241.0568517,
    + 377                     '242Pu': 242.0587428,
    + 378                     '244Pu': 244.0642053,
    + 379                     '241Am': 241.0568293,
    + 380                     '243Am': 243.0613813,
    + 381                     '243Cm': 243.0613893,
    + 382                     '244Cm': 244.0627528,
    + 383                     '245Cm': 245.0654915,
    + 384                     '246Cm': 246.0672238,
    + 385                     '247Cm': 247.0703541,
    + 386                     '248Cm': 248.0723499,
    + 387                     '247Bk': 247.0703073,
    + 388                     '249Bk': 249.0749877,
    + 389                     '249Cf': 249.0748539,
    + 390                     '250Cf': 250.0764062,
    + 391                     '251Cf': 251.0795886,
    + 392                     '252Cf': 252.0816272,
    + 393                     '252Es': 252.082980,
    + 394                     '257Fm': 257.0951061,
    + 395                     '258Md': 258.0984315,
    + 396                     '260Md': 260.10365, 
    + 397                     '259No': 259.10103,
    + 398                     '262Lr': 262.10961,
    + 399                     '267Rf': 267.12179,
    + 400                     '268Db': 268.12567,
    + 401                     '271Sg': 271.13393,
    + 402                     '272Bh': 272.13826,
    + 403                     '270Hs': 270.13429,
    + 404                     '276Mt': 276.15159,
    + 405                     '281Ds': 281.16451,
    + 406                     '280Rg': 280.16514,
    + 407                     '285Cn': 285.17712,
    + 408                     '284Nh': 284.17873,
    + 409                     '289Fl': 289.19042,
    + 410                     '288Mc': 288.19274,
    + 411                     '293Lv': 293.20449,
    + 412                     '292Ts': 292.20746,
    + 413                     '294Og': 294.21392}
    + 414    
    + 415
    + 416    # This list orders atoms, starting with the most abundant isotopes first, ordered as described. 
    + 417    # Less abundant isotopes are ordered by mass at the end of the list.
    + 418    atoms_order = ['C', 'H', 'O', 'N', 'P', 'S', # CHONPS
    + 419                    'F', 'Cl', 'Br', 'I', 'At', #Halogens
    + 420                    'Li','Na','K','Rb','Cs','Fr', #Alkali
    + 421                    'He', 'Ne', 'Ar', 'Kr', 'Xe', 'Rn', #Noble gasses
    + 422                    'Be','B', #Row 2
    + 423                    'Mg', 'Al','Si', #Row 3
    + 424                    'Ca','Sc','Ti','V','Cr','Mn','Fe','Co','Ni','Cu','Zn','Ga','Ge','As','Se', #Row 4
    + 425                    'Sr','Y','Zr','Nb','Mo','Tc','Ru','Rh','Pd','Ag','Cd','In','Sn','Sb','Te', #Row 5
    + 426                    'Ba','La', 'Hf', 'Ta', 'W', 'Re', 'Os', 'Ir', 'Pt', 'Au', 'Hg', 'Tl', 'Pb', 'Bi', 'Po', #Row 6
    + 427                    'Ra', 'Ac', 'Rf', 'Db', 'Sg', 'Bh', 'Hs', 'Mt', 'Ds', 'Rg', 'Cn', 'Nh', 'Fl', 'Mc', 'Lv', 'Ts', 'Og', #Row 7
    + 428                    'Ce','Pr','Nd','Pm','Sm','Eu','Gd','Tb','Dy','Ho','Er','Tm','Yb','Lu', #Lanthanides
    + 429                    'Th','Pa','U','Np','Pu','Am','Cm','Bk','Cf','Es','Fm','Md','No','Lr', #Actinides
    + 430                    # Less abundant isotopes follow
    + 431                    'D','6Li',
    + 432                    '10B', '13C','15N','17O','18O',
    + 433                    '22Ne',  '25Mg', '26Mg',  '29Si', 
    + 434                    '30Si', '33S', '34S','36S', '37Cl',
    + 435                    '40Ca', '41K', '44Ca','46Ti', '47Ti',  '49Ti', 
    + 436                    '50Cr', '50Ti', '50V', '53Cr', '54Cr',  '54Fe', '57Fe', '58Fe',
    + 437                    '60Ni', '61Ni', '62Ni', '65Cu', '66Zn','67Zn', '68Zn',  
    + 438                    '70Ge', '71Ga', '72Ge', '73Ge',  '76Ge', '76Se', '77Se', '78Se',  
    + 439                    '81Br', '80Kr','82Kr', '82Se', '83Kr', '85Rb', '86Kr', '86Sr', '87Rb', '87Sr', '88Sr',  
    + 440                    '91Zr', '92Mo', '92Zr','94Mo', '94Zr', '95Mo', '96Mo', '96Ru', '96Zr', '97Mo',  '98Ru', '99Ru',
    + 441                    '100Mo', '100Ru', '101Ru', '102Pd', '104Pd', '104Ru', '105Pd', '106Cd', '106Pd', '108Cd', '108Pd','109Ag',
    + 442                    '110Cd', '110Pd', '111Cd', '112Cd', '112Sn', '113Cd', '113In', '114Cd', '114Sn','115In', '115Sn', '116Cd', '116Sn', '117Sn', '118Sn', '119Sn', 
    + 443                    '120Sn', '120Te', '121Sb', '122Sn', '122Te', '123Sb', '123Te', '124Sn', '124Te', '124Xe', '125Te', '126Te', '126Xe',
    + 444                    '128Te', '128Xe', '129Xe', '130Ba', '130Te', '130Xe', '131Xe', '132Ba', '132Xe', '134Ba',
    + 445                    '134Xe', '135Ba', '136Ba', '136Xe', '137Ba', '138Ba', 
    + 446                    '174Hf', '176Hf', '177Hf', '178Hf','179Hf', 
    + 447                    '180Hf', '180W', '182W', '183W', '184Os', '184W', '185Re', '186Os', '186W', '187Os', '187Re','188Os', '189Os', 
    + 448                    '190Os', '190Pt', '191Ir', '192Ir', '192Os', '192Pt', '194Pt', '195Pt', '196Hg','196Pt', '198Hg', '198Pt','199Hg', 
    + 449                    '200Hg', '201Hg', '202Hg', '203Tl', '204Hg', '204Pb', '205Tl','206Pb','207Pb', '208Pb'
    + 450                    ]
    + 451
    + 452    atoms_covalence = {'C': (4),
    + 453                     '13C': (4),
    + 454                     'N': (3),
    + 455                     'O': (2),
    + 456                     'S': (2),
    + 457                     'H': (1),
    + 458                     'F': (1, 0),
    + 459                     'Cl': (1, 0),
    + 460                     'Br': (1, 0),
    + 461                     'I': (1, 0),
    + 462                     'At': (1),
    + 463                     'Li': (1, 0),
    + 464                     'Na': (1, 0),
    + 465                     'K':  (1, 0),
    + 466                     'Rb': (1),
    + 467                     'Cs': (1),
    + 468                     'Fr': (1),
    + 469                     'B': (4, 3, 2, 1),
    + 470                     'In': (3, 2, 1),
    + 471                     'Al': (3, 1, 2),
    + 472                     'P': (3, 5, 4, 2, 1),
    + 473                     'Ga': (3, 1, 2),
    + 474                     'Mg': (2, 1),
    + 475                     'Be': (2, 1),
    + 476                     'Ca': (2, 1),
    + 477                     'Sr': (2, 1),
    + 478                     'Ba': (2),
    + 479                     'Ra': (2),
    + 480                     'V': (5, 4, 3, 2, 1),
    + 481                     'Fe': (3, 2, 4, 5, 6),
    + 482                     'Si': (4, 3, 2),
    + 483                     'Sc': (3, 2, 1),
    + 484                     'Ti': (4, 3, 2, 1),
    + 485                     'Cr': (1, 2, 3, 4, 5, 6),
    + 486                     'Mn': (1, 2, 3, 4, 5, 6, 7),
    + 487                     'Co': (1, 2, 3, 4, 5),
    + 488                     'Ni': (1, 2, 3, 4),
    + 489                     'Cu': (2, 1, 3, 4),
    + 490                     'Zn': (2, 1),
    + 491                     'Ge': (4, 3, 2, 1),
    + 492                     'As': (5, 3, 2, 1),
    + 493                     'Se': (6, 4, 2, 1),
    + 494                     'Y': (3, 2, 1),
    + 495                     'Zr': (4, 3, 2, 1),
    + 496                     'Nb': (5, 4, 3, 2, 1),
    + 497                     'Mo': (6, 5, 4, 3, 2, 1),
    + 498                     'Tc': (7, 6, 5, 4, 3, 2, 1),
    + 499                     'Ru': (8, 7, 6, 5, 4, 3, 2, 1),
    + 500                     'Rh': (6, 5, 4, 3, 2, 1),
    + 501                     'Pd': (4, 2, 1),
    + 502                     'Ag': (0, 1, 2, 3, 4),
    + 503                     'Cd': (2, 1),
    + 504                     'Sn': (4, 2),
    + 505                     'Sb': (5, 3),
    + 506                     'Te': (6, 5, 4, 2),
    + 507                     'La': (3, 2),
    + 508                     'Hf': (4, 3, 2),
    + 509                     'Ta': (5, 4, 3, 2),
    + 510                     'W': (6, 5, 4, 3, 2, 1),
    + 511                     'Re': (4, 7, 6, 5, 3, 2, 1),
    + 512                     'Os': (4, 8, 7, 6, 5, 3, 2, 1),
    + 513                     'Ir': (4, 8, 6, 5, 3, 2, 1),
    + 514                     'Pt': (4, 6, 5, 3, 2, 1),
    + 515                     'Au': (3, 5, 2, 1),
    + 516                     'Hg': (1, 2, 4),
    + 517                     'Tl': (3, 1),
    + 518                     'Pb': (4, 2),
    + 519                     'Bi': (3, 1, 5),
    + 520                     'Po': (2, 4, 6),
    + 521                     'Ac': (3, 2)
    + 522                     }
    + 523
    + 524    isotopic_abundance = {'H': 0.999885,
    + 525                          'D': 0.000115,
    + 526                          'T': 0, #Consider removing.
    + 527                          '3He': 0.00000134,
    + 528                          'He': 0.99999866,
    + 529                          '6Li': 0.0759,
    + 530                          'Li': 0.9241,
    + 531                          'Be': 1.0,
    + 532                          '10B': 0.199,
    + 533                          'B': 0.801,
    + 534                          'C': 0.9893,
    + 535                          '13C': 0.0107,
    + 536                          '14C': 0,
    + 537                          'N': 0.99636,
    + 538                          '15N': 0.00364,
    + 539                          'O': 0.99757,
    + 540                          '17O': 0.00038,
    + 541                          '18O': 0.00205,
    + 542                          'F': 1.0,
    + 543                          'Ne': 0.9048,
    + 544                          '21Ne': 0.0027,
    + 545                          '22Ne': 0.0925,
    + 546                          'Na': 1.0,
    + 547                          'Mg': 0.7899,
    + 548                          '25Mg': 0.1000,
    + 549                          '26Mg': 0.1101,
    + 550                          'Al': 1.0,
    + 551                          'Si': 0.92223,
    + 552                          '29Si': 0.04685,
    + 553                          '30Si': 0.03092,
    + 554                          'P': 1.0,
    + 555                          'S': 0.9499,
    + 556                          '33S': 0.0075,
    + 557                          '34S': 0.0425,
    + 558                          '36S': 0.0001,
    + 559                          'Cl': 0.7576,
    + 560                          '37Cl': 0.2424,
    + 561                          '36Ar': 0.003336,
    + 562                          '38Ar': 0.000629,
    + 563                          'Ar': 0.996035,
    + 564                          'K': 0.932581,
    + 565                          '40K': 0.000117,
    + 566                          '41K': 0.067302,
    + 567                          'Ca': 0.96941,
    + 568                          '42Ca': 0.00647,
    + 569                          '43Ca': 0.00135,
    + 570                          '44Ca': 0.02086,
    + 571                          '46Ca': 0.00004,
    + 572                          '48Ca': 0.001872,
    + 573                          'Sc': 1.0,
    + 574                          '46Ti': 0.0825,
    + 575                          '47Ti': 0.0744,
    + 576                          'Ti': 0.7372,
    + 577                          '49Ti': 0.0541,
    + 578                          '50Ti': 0.0518,
    + 579                          '50V': 0.00250,
    + 580                          'V': 0.9975,
    + 581                          '50Cr': 0.04345,
    + 582                          'Cr': 0.83789,
    + 583                          '53Cr': 0.09501,
    + 584                          '54Cr': 0.02365,
    + 585                          'Mn': 1.0,
    + 586                          '54Fe': 0.05845,
    + 587                          'Fe': 0.91754,
    + 588                          '57Fe': 0.02119,
    + 589                          '58Fe': 0.00282,
    + 590                          'Co': 1.0,
    + 591                          'Ni': 0.68077,
    + 592                          '60Ni': 0.26223,
    + 593                          '61Ni': 0.011399,
    + 594                          '62Ni': 0.036346,
    + 595                          '64Ni': 0.009255,
    + 596                          'Cu': 0.6915,
    + 597                          '65Cu': 0.3085,
    + 598                          'Zn': 0.4917,
    + 599                          '66Zn': 0.2773,
    + 600                          '67Zn': 0.0404,
    + 601                          '68Zn': 0.1845,
    + 602                          '70Zn': 0.0061,
    + 603                          'Ga': 0.60108,
    + 604                          '71Ga': 0.39892,
    + 605                          '70Ge': 0.2057,
    + 606                          '72Ge': 0.2745,
    + 607                          '73Ge': 0.0775,
    + 608                          'Ge': 0.3650,
    + 609                          '76Ge': 0.0773,
    + 610                          'As': 1.0,
    + 611                          '74Se': 0.0089,
    + 612                          '76Se': 0.0937,
    + 613                          '77Se': 0.0763,
    + 614                          '78Se': 0.2377,
    + 615                          'Se': 0.4961,
    + 616                          '82Se': 0.0873,
    + 617                          'Br': 0.5069,
    + 618                          '81Br': 0.4931,
    + 619                          '78Kr': 0.00355,
    + 620                          '80Kr': 0.02286,
    + 621                          '82Kr': 0.11593,
    + 622                          '83Kr': 0.11500,
    + 623                          'Kr': 0.56987,
    + 624                          '86Kr': 0.17279,
    + 625                          'Rb': 0.7217,
    + 626                          '87Rb': 0.2783,
    + 627                          '84Sr': 0.0056,
    + 628                          '86Sr': 0.0986,
    + 629                          '87Sr': 0.0700,
    + 630                          'Sr': 0.8258,
    + 631                          'Y': 1.0,
    + 632                          'Zr': 0.5145,
    + 633                          '91Zr': 0.1122,
    + 634                          '92Zr': 0.1715,
    + 635                          '94Zr': 0.1738,
    + 636                          '96Zr': 0.0280,
    + 637                          'Nb': 1.0,
    + 638                          '92Mo': 0.1453,
    + 639                          '94Mo': 0.0915,
    + 640                          '95Mo': 0.1584,
    + 641                          '96Mo': 0.1667,
    + 642                          '97Mo': 0.0960,
    + 643                          'Mo': 0.2439,
    + 644                          '100Mo': 0.0982,
    + 645                          '99Tc': 0, #consider removing
    + 646                          '96Ru': 0.0554,
    + 647                          '98Ru': 0.0187,
    + 648                          '99Ru': 0.1276,
    + 649                          '100Ru': 0.1260,
    + 650                          '101Ru': 0.1706,
    + 651                          'Ru': 0.3155,
    + 652                          '104Ru': 0.1862,
    + 653                          'Rh': 1.0,
    + 654                          '102Pd': 0.0102,
    + 655                          '104Pd': 0.1114,
    + 656                          '105Pd': 0.2233,
    + 657                          'Pd': 0.2733,
    + 658                          '108Pd': 0.2646,
    + 659                          '110Pd': 0.1172,
    + 660                          'Ag': 0.51839,
    + 661                          '109Ag': 0.48161,
    + 662                          '106Cd': 0.0125,
    + 663                          '108Cd': 0.0089,
    + 664                          '110Cd': 0.1249,
    + 665                          '111Cd': 0.1280,
    + 666                          'Cd': 0.2413,
    + 667                          '113Cd': 0.1222,
    + 668                          '114Cd': 0.2873,
    + 669                          '116Cd': 0.0749,
    + 670                          '113In': 0.0429,
    + 671                          'In': 0.9571,
    + 672                          '112Sn': 0.0097,
    + 673                          '114Sn': 0.0066,
    + 674                          '115Sn': 0.0034,
    + 675                          '116Sn': 0.1454,
    + 676                          '117Sn': 0.0768,
    + 677                          '118Sn': 0.2422,
    + 678                          '119Sn': 0.0859,
    + 679                          'Sn': 0.3258,
    + 680                          '122Sn': 0.0463,
    + 681                          '124Sn': 0.0579,
    + 682                          'Sb': 0.5721,
    + 683                          '123Sb': 0.4279,
    + 684                          '120Te': 0.0009,
    + 685                          '122Te': 0.0255,
    + 686                          '123Te': 0.0089,
    + 687                          '124Te': 0.0474,
    + 688                          '125Te': 0.0707,
    + 689                          '126Te': 0.1884,
    + 690                          '128Te': 0.3174,
    + 691                          'Te': 0.3408,
    + 692                          'I': 1.0,
    + 693                          '124Xe': 0.000952,
    + 694                          '126Xe': 0.000890,
    + 695                          '128Xe': 0.019102,
    + 696                          '129Xe': 0.264006,
    + 697                          '130Xe': 0.040710,
    + 698                          '131Xe': 0.212324,
    + 699                          'Xe': 0.269086,
    + 700                          '134Xe': 0.104357,
    + 701                          '136Xe': 0.088573,
    + 702                          'Cs': 1.0,
    + 703                          '130Ba': 0.00106,
    + 704                          '132Ba': 0.00101,
    + 705                          '134Ba': 0.02417,
    + 706                          '135Ba': 0.06592,
    + 707                          '136Ba': 0.07854,
    + 708                          '137Ba': 0.11232,
    + 709                          'Ba': 0.71698,
    + 710                          '138La': 0.0008881,
    + 711                          'La': 0.9991119,
    + 712                          '136Ce': 0.00185,
    + 713                          '138Ce': 0.00251,
    + 714                          'Ce': 0.88450,
    + 715                          '142Ce': 0.11114,
    + 716                          'Pr': 1.0,
    + 717                          'Nd': 0.27152,
    + 718                          '143Nd': 0.12174,
    + 719                          '144Nd': 0.23798,
    + 720                          '145Nd': 0.08293,
    + 721                          '146Nd': 0.17189,
    + 722                          '148Nd': 0.05756,
    + 723                          '150Nd': 0.05638,
    + 724                          '145Pm': 0,
    + 725                          '147Pm': 0,
    + 726                          '144Sm': 0.0307,
    + 727                          '147Sm': 0.1499,
    + 728                          '148Sm': 0.1124,
    + 729                          '149Sm': 0.1382,
    + 730                          '150Sm': 0.0738,
    + 731                          'Sm': 0.2675,
    + 732                          '154Sm': 0.2275,
    + 733                          '151Eu': 0.4781,
    + 734                          'Eu': 0.5219,
    + 735                          '152Gd': 0.0020,
    + 736                          '154Gd': 0.0218,
    + 737                          '155Gd': 0.1480,
    + 738                          '156Gd': 0.2047,
    + 739                          '157Gd': 0.1565,
    + 740                          'Gd': 0.2484,
    + 741                          '160Gd': 0.2186,
    + 742                          'Tb': 1.0,
    + 743                          '156Dy': 0.00056,
    + 744                          '158Dy': 0.00095,
    + 745                          '160Dy': 0.02329,
    + 746                          '161Dy': 0.18889,
    + 747                          '162Dy': 0.25475,
    + 748                          '163Dy': 0.24896,
    + 749                          'Dy': 0.28260,
    + 750                          'Ho': 1.0,
    + 751                          '162Er': 0.00139,
    + 752                          '164Er': 0.01601,
    + 753                          'Er': 0.33503,
    + 754                          '167Er': 0.22869,
    + 755                          '168Er': 0.26978,
    + 756                          '170Er': 0.14910,
    + 757                          'Tm': 1.0,
    + 758                          '168Yb': 0.00123,
    + 759                          '170Yb': 0.02982,
    + 760                          '171Yb': 0.1409,
    + 761                          '172Yb': 0.2168,
    + 762                          '173Yb': 0.16103,
    + 763                          'Yb': 0.32026,
    + 764                          '176Yb': 0.12996,
    + 765                          'Lu': 0.97401,
    + 766                          '176Lu': 0.02599,
    + 767                          '174Hf': 0.0016,
    + 768                          '176Hf': 0.0526,
    + 769                          '177Hf': 0.1860,
    + 770                          '178Hf': 0.2728,
    + 771                          '179Hf': 0.1362,
    + 772                          'Hf': 0.3508,
    + 773                          '180Ta': 0.0001201,
    + 774                          'Ta': 0.9998799,
    + 775                          '180W': 0.0012,
    + 776                          '182W': 0.2650,
    + 777                          '183W': 0.1431,
    + 778                          'W': 0.3064,
    + 779                          '186W': 0.2843,
    + 780                          '185Re': 0.3740,
    + 781                          'Re': 0.6260,
    + 782                          '184Os': 0.0002,
    + 783                          '186Os': 0.0159,
    + 784                          '187Os': 0.0196,
    + 785                          '188Os': 0.1324,
    + 786                          '189Os': 0.1615,
    + 787                          '190Os': 0.2626,
    + 788                          'Os': 0.4078,
    + 789                          '191Ir': 0.373,
    + 790                          'Ir': 0.627,
    + 791                          '190Pt': 0.00012,
    + 792                          '192Pt': 0.00782,
    + 793                          '194Pt': 0.3286,
    + 794                          'Pt': 0.3378,
    + 795                          '196Pt': 0.2521,
    + 796                          '198Pt': 0.07356,
    + 797                          'Au': 1.0,
    + 798                          '196Hg': 0.0015,
    + 799                          '198Hg': 0.0997,
    + 800                          '199Hg': 0.16872,
    + 801                          '200Hg': 0.2310,
    + 802                          '201Hg': 0.1318,
    + 803                          'Hg': 0.2986,
    + 804                          '204Hg': 0.0687,
    + 805                          '203Tl': 0.2952,
    + 806                          'Tl': 0.7048,
    + 807                          '204Pb': 0.014,
    + 808                          '206Pb': 0.241,
    + 809                          '207Pb': 0.221,
    + 810                          'Pb': 0.524,
    + 811                          'Bi': 1.0,
    + 812                          '209Po': 0,
    + 813                          '210Po': 0,
    + 814                          '210At': 0,
    + 815                          '211At': 0,
    + 816                          '211Rn': 0,
    + 817                          '220Rn': 0,
    + 818                          '222Rn': 0,
    + 819                          '223Fr': 0,
    + 820                          '223Ra': 0,
    + 821                          '224Ra': 0,
    + 822                          '226Ra': 0,
    + 823                          '228Ra': 0,
    + 824                          '227Ac': 0,
    + 825                          '230Th': 0,
    + 826                          'Th': 1.0,
    + 827                          'Pa': 1.0,
    + 828                          '233U': 0,
    + 829                          '234U': 0.000054,
    + 830                          '235U': 0.007204,
    + 831                          '236U': 0,
    + 832                          'U': 0.992742,
    + 833                          '236Np': 0,
    + 834                          '237Np': 0,
    + 835                          '238Pu': 0,
    + 836                          '239Pu': 0,
    + 837                          '240Pu': 0,
    + 838                          '241Pu': 0,
    + 839                          '242Pu': 0,
    + 840                          '244Pu': 0,
    + 841                          '241Am': 0,
    + 842                          '243Am': 0,
    + 843                          '243Cm': 0,
    + 844                          '244Cm': 0,
    + 845                          '245Cm': 0,
    + 846                          '246Cm': 0,
    + 847                          '247Cm': 0,
    + 848                          '248Cm': 0,
    + 849                          '247Bk': 0,
    + 850                          '249Bk': 0,
    + 851                          '249Cf': 0,
    + 852                          '250Cf': 0,
    + 853                          '251Cf': 0,
    + 854                          '252Cf': 0,
    + 855                          '252Es': 0,
    + 856                          '257Fm': 0,
    + 857                          '258Md': 0,
    + 858                          '260Md': 0,
    + 859                          '259No': 0,
    + 860                          '262Lr': 0,
    + 861                          '267Rf': 0,
    + 862                          '268Db': 0,
    + 863                          '271Sg': 0,
    + 864                          '272Bh': 0,
    + 865                          '270Hs': 0,
    + 866                          '276Mt': 0,
    + 867                          '281Ds': 0,
    + 868                          '280Rg': 0,
    + 869                          '285Cn': 0,
    + 870                          '284Nh': 0,
    + 871                          '289Fl': 0,
    + 872                          '288Mc': 0,
    + 873                          '293Lv': 0,
    + 874                          '292Ts': 0,
    + 875                          '294Og': 0}
    + 876    
    + 877    # Isotopes here is a dictionary of symbol, including full name, 
    + 878    # and then the isotopes which arent the most abundant one, sorted by abundance.
    + 879    # None indicates no stable isotopes/naturally occuring ones. 
    + 880    # This has been manually checked as far as Iodine only.
    + 881    isotopes = {'H': ['Hydrogen', ['D','T']],
    + 882                'He': ['Helium', ['3He']],
    + 883                'Li': ['Lithium', ['6Li']],
    + 884                'Be': ['Beryllium', [None]],
    + 885                'B': ['Boron', ['10B']],
    + 886                'C': ['Carbon', ['13C']],
    + 887                'N': ['Nitrogen', ['15N']],
    + 888                'O': ['Oxygen', ['18O', '17O']],
    + 889                'F': ['Fluorine', [None]],
    + 890                'Ne': ['Neon', ['22Ne', '21Ne']],
    + 891
    + 892                'Na': ['Sodium', [None]],
    + 893                'Mg': ['Magnesium', ['26Mg', '25Mg']],
    + 894                'Al': ['Aluminum', [None]],
    + 895                'Si': ['Silicon', ['29Si', '30Si']],
    + 896                'P': ['Phosphorus', [None]],
    + 897                'S': ['Sulfur', ['34S','33S','36S']],
    + 898                'Cl': ['Chlorine', ['37Cl']],
    + 899                'Ar': ['Argon', ['36Ar','38Ar']],
    + 900                
    + 901                'K': ['Potassium', ['41K', '40K']],
    + 902                'Ca': ['Calcium', ['44Ca', '48Ca','43Ca','42Ca','46Ca']],
    + 903                'Sc': ['Scandium', [None]],
    + 904                'Ti': ['Titanium', ['46Ti', '47Ti', '49Ti', '50Ti']],
    + 905                'V': ['Vanadium', ['50V']],
    + 906                'Cr': ['Chromium', ['53Cr', '50Cr', '54Cr']],
    + 907                'Mn': ['Manganese', [None]],
    + 908                'Fe': ['Iron', ['54Fe', '57Fe', '58Fe']],
    + 909                'Co': ['Cobalt', [None]],
    + 910                'Ni': ['Nickel', ['60Ni', '62Ni', '61Ni','64Ni']],
    + 911                'Cu': ['Copper', ['65Cu']],
    + 912                'Zn': ['Zinc', ['66Zn', '68Zn', '67Zn', '70Zn']],
    + 913                'Ga': ['Gallium', ['71Ga']],
    + 914                'Ge': ['Germanium', ['72Ge', '70Ge', '73Ge', '76Ge']],
    + 915                'As': ['Arsenic', [None]],
    + 916                'Se': ['Selenium', ['78Se', '76Se', '82Se', '77Se','74Se']],
    + 917                'Br': ['Bromine', ['81Br']],
    + 918                'Kr': ['Krypton', ['86Kr', '82Kr', '83Kr', '80Kr']],
    + 919
    + 920                'Rb': ['Rubidium', ['87Rb']],
    + 921                'Sr': ['Strontium', ['86Sr', '87Sr','84Sr']],
    + 922                'Y': ['Yttrium', [None]],
    + 923                'Zr': ['Zirconium', ['94Zr', '92Zr', '91Zr', '96Zr']],
    + 924                'Nb': ['Niobium', [None]],
    + 925                'Mo': ['Molybdenum', ['96Mo', '95Mo', '92Mo', '100Mo', '97Mo', '94Mo']],
    + 926                'Tc': ['Technetium', [None]], #consider removing
    + 927                'Ru': ['Ruthenium', ['104Ru', '101Ru', '99Ru', '100Ru', '96Ru', '98Ru']],
    + 928                'Rh': ['Rhodium', [None]],
    + 929                'Pd': ['Palladium', ['108Pd', '105Pd', '110Pd', '104Pd', '102Pd']],
    + 930                'Ag': ['Silver', ['109Ag']],
    + 931                'Cd': ['Cadmium', ['114Cd', '111Cd', '110Cd', '113Cd', '116Cd', '106Cd', '108Cd']],
    + 932                'In': ['Indium', ['113In']],
    + 933                'Sn': ['Tin', ['118Sn', '116Sn', '119Sn', '117Sn', '124Sn', '122Sn', '112Sn','114Sn', '115Sn']],
    + 934                'Sb': ['Antimony', ['123Sb']],
    + 935                'Te': ['Tellurium', ['128Te', '126Te', '125Te', '124Te', '122Te','123Te','120Te']],
    + 936                'I': ['Iodine', [None]],
    + 937                'Xe': ['Xenon', ['129Xe','131Xe', '134Xe', '136Xe', '130Xe', '128Xe']],
    + 938
    + 939                'Cs': ['Cesium', [None]],
    + 940                'Ba': ['Barium', ['137Ba', '136Ba', '135Ba', '134Ba']],
    + 941                'La': ['Lanthanum',['138La']],
    + 942                'Hf': ['Hafnium', ['178Hf', '177Hf', '179Hf', '176Hf']],
    + 943                'Ta': ['Tantalum', ['180Ta']],
    + 944                'W': ['Tungsten', ['186W', '182W', '183W']],
    + 945                'Re': ['Rhenium', ['185Re']],
    + 946                'Os': ['Osmium', ['190Os', '189Os', '188Os', '187Os', '186Os']],
    + 947                'Ir': ['Iridium', ['191Ir']],
    + 948                'Pt': ['Platinum', ['194Pt', '196Pt', '198Pt', '192Pt']],
    + 949                'Au': ['Gold', [None]],
    + 950                'Hg': ['Mercury', ['200Hg', '199Hg', '201Hg', '198Hg', '204Hg']],
    + 951                'Tl': ['Thallium', ['203Tl']],
    + 952                'Pb': ['Lead', ['206Pb', '207Pb', '204Pb']],
    + 953                'Bi': ['Bismuth', [None]],
    + 954                'Po': ['Polonium', [None]],
    + 955                'At': ['Astatine', [None]],
    + 956                'Rn': ['Radon', [None]],
    + 957
    + 958                'Fr': ['Francium', [None]],
    + 959                'Ra': ['Radium', [None]],
    + 960                'Ac': ['Actinium', [None]],
    + 961                'Rf': ['Rutherfordium', [None]],
    + 962                'Db': ['Dubnium', [None]],
    + 963                'Sg': ['Seaborgium', [None]],
    + 964                'Bh': ['Bohrium', [None]],
    + 965                'Hs': ['Hassium', [None]],
    + 966                'Mt': ['Meitnerium', [None]],
    + 967                'Ds': ['Darmstadtium', [None]],
    + 968                'Rg': ['Roentgenium', [None]],
    + 969                'Cn': ['Copernicium', [None]],
    + 970                'Nh': ['Nihonium', [None]],
    + 971                'Fl': ['Flerovium', [None]],
    + 972                'Mc': ['Moscovium', [None]],
    + 973                'Lv': ['Livermorium', [None]],
    + 974                'Ts': ['Tennessine', [None]],
    + 975                'Og': ['Oganesson', [None]],
    + 976
    + 977                'Ce': ['Cerium', ['142Ce','138Ce''136Ce']],
    + 978                'Pr': ['Praseodymium', [None]],
    + 979                'Nd': ['Neodymium', [None]],
    + 980                'Pm': ['Promethium', [None]],
    + 981                'Sm': ['Samarium', [None]],
    + 982                'Eu': ['Europium', [None]],
    + 983                'Gd': ['Gadolinium', [None]],
    + 984                'Tb': ['Terbium', [None]],
    + 985                'Dy': ['Dysprosium', [None]],
    + 986                'Ho': ['Holmium', [None]],
    + 987                'Er': ['Erbium', [None]],
    + 988                'Tm': ['Thulium', [None]],
    + 989                'Yb': ['Ytterbium', [None]],
    + 990                'Lu': ['Lutetium', ['176Lu']],
    + 991
    + 992                'Th': ['Thorium', [None]],
    + 993                'Pa': ['Protactinium', [None]],
    + 994                'U': ['Uranium', ['235U','234U']],
    + 995                'Np': ['Neptunium', [None]],
    + 996                'Pu': ['Plutonium', [None]],
    + 997                'Am': ['Americium', [None]],
    + 998                'Cm': ['Curium', [None]],
    + 999                'Bk': ['Berkelium', [None]],
    +1000                'Cf': ['Californium', [None]],
    +1001                'Es': ['Einsteinium', [None]],
    +1002                'Fm': ['Fermium', [None]],
    +1003                'Md': ['Mendelevium', [None]],
    +1004                'No': ['Nobelium', [None]],
    +1005                'Lr': ['Lawrencium', [None]]
    +1006                }
     
    @@ -1441,899 +1514,972 @@

    -
     42class Atoms: #pragma: no cover
    - 43    """ Class for Atoms in CoreMS
    - 44
    - 45    This class includes key properties of atoms (and the electron) and isotopes, including their exact masses, relative abundances, and covalences. 
    - 46    It also associates which isotopes are for the same element, and provides an ordering of elements.
    - 47    
    - 48    References
    - 49    ----------
    - 50
    - 51    1. NIST - Last Accessed 2019-06-12
    - 52    https://www.nist.gov/pml/atomic-weights-and-isotopic-compositions-relative-atomic-masses
    - 53
    - 54    """
    - 55    electron_mass = 0.0005_485_799_090_65 #NIST value
    - 56
    - 57    atomic_masses = {'H': 1.00782503223,
    - 58                     'D': 2.01410177812,
    - 59                     'T': 3.0160492779,
    - 60                     '3He': 3.0160293201,
    - 61                     'He': 4.00260325413,
    - 62                     '6Li': 6.0151228874,
    - 63                     '7Li': 7.0160034366,
    - 64                     '9Be': 9.012183065,
    - 65                     '10B': 10.01293695,
    - 66                     '11B': 11.00930536,
    - 67                     'C': 12.0,
    - 68                     '13C': 13.00335483507,
    - 69                     '14C': 14.0032419884,
    - 70                     'N': 14.00307400443,
    - 71                     '15N': 15.00010889888,
    - 72                     'O': 15.99491461957,
    - 73                     '17O': 16.99913175650,
    - 74                     '18O': 17.99915961286,
    - 75                     'F': 18.99840316273,
    - 76                     '20Ne': 19.9924401762,
    - 77                     '21Ne': 20.993846685,
    - 78                     '22Ne': 21.991385114,
    - 79                     'Na': 22.9897692820,
    - 80                     '24Mg': 23.985041697,
    - 81                     '25Mg': 24.985836976,
    - 82                     '26Mg': 25.982592968,
    - 83                     'Al': 26.98153853,
    - 84                     '28Si': 27.97692653465,
    - 85                     '29Si': 28.97649466490,
    - 86                     '30Si': 29.973770136,
    - 87                     'P': 30.97376199842,
    - 88                     'S': 31.9720711744,
    - 89                     '33S': 32.9714589098,
    - 90                     '34S': 33.967867004,
    - 91                     '36S': 35.96708071,
    - 92                     'Cl': 34.968852682,
    - 93                     '37Cl': 36.965902602,
    - 94                     '36Ar': 35.967545105,
    - 95                     '38Ar': 37.96273211,
    - 96                     '40Ar': 39.9623831237,
    - 97                     'K': 38.9637064864,
    - 98                     '40K': 39.963998166,
    - 99                     '41K': 40.9618252579,
    -100                     'Ca': 39.962590863,
    -101                     '42Ca': 41.95861783,
    -102                     '43Ca': 42.95876644,
    -103                     '44Ca': 43.95548156,
    -104                     '46Ca': 45.9536890,
    -105                     '48Ca': 47.95252276,
    -106                     '45Sc': 44.95590828,
    -107                     '46Ti': 45.95262772,
    -108                     '47Ti': 46.95175879,
    -109                     '48Ti': 47.94794198,
    -110                     '49Ti': 48.94786568,
    -111                     '50Ti': 49.94478689,
    -112                     '50V': 49.94715601,
    -113                     'V': 50.94395704,
    -114                     '50Cr': 49.94604183,
    -115                     'Cr': 51.94050623,
    -116                     '53Cr': 52.94064815,
    -117                     '54Cr': 53.93887916,
    -118                     'Mn': 54.93804391,
    -119                     '54Fe': 53.93960899,
    -120                     'Fe': 55.93493633,
    -121                     '57Fe': 56.93539284,
    -122                     '58Fe': 57.93327443,
    -123                     'Co': 58.93319429,
    -124                     'Ni': 57.93534241,
    -125                     '60Ni': 59.93078588,
    -126                     '61Ni': 60.93105557,
    -127                     '62Ni': 61.92834537,
    -128                     '64Ni': 63.92796682,
    -129                     'Cu': 62.92959772,
    -130                     '65Cu': 64.92778970,
    -131                     'Zn': 63.92914201,
    -132                     '66Zn': 65.92603381,
    -133                     '67Zn': 66.92712775,
    -134                     '68Zn': 67.92484455,
    -135                     '70Zn': 69.9253192,
    -136                     '69Ga': 68.9255735,
    -137                     '71Ga': 70.92470258,
    -138                     '70Ge': 69.92424875,
    -139                     '72Ge': 71.922075826,
    -140                     '73Ge': 72.923458956,
    -141                     '74Ge': 73.921177761,
    -142                     '76Ge': 75.921402726,
    -143                     'As': 74.92159457,
    -144                     '74Se': 73.922475934,
    -145                     '76Se': 75.919213704,
    -146                     '77Se': 76.919914154,
    -147                     '78Se': 77.91730928,
    -148                     'Se': 79.9165218,
    -149                     '82Se': 81.9166995,
    -150                     'Br': 78.9183376,
    -151                     '81Br': 80.9162897,
    -152                     '78Kr': 77.92036494,
    -153                     '80Kr': 79.91637808,
    -154                     '82Kr': 81.91348273,
    -155                     '83Kr': 82.91412716,
    -156                     '84Kr': 83.9114977282,
    -157                     '86Kr': 85.9106106269,
    -158                     '85Rb': 84.9117897379,
    -159                     '87Rb': 86.9091805310,
    -160                     '84Sr': 83.9134191,
    -161                     '86Sr': 85.9092606,
    -162                     '87Sr': 86.9088775,
    -163                     '88Sr': 87.9056125,
    -164                     '89Y': 88.9058403,
    -165                     '90Zr': 89.9046977,
    -166                     '91Zr': 90.9056396,
    -167                     '92Zr': 91.9050347,
    -168                     '94Zr': 93.9063108,
    -169                     '96Zr': 95.9082714,
    -170                     '93Nb': 92.9063730,
    -171                     '92Mo': 91.90680796,
    -172                     '94Mo': 93.90508490,
    -173                     '95Mo': 94.90583877,
    -174                     '96Mo': 95.90467612,
    -175                     '97Mo': 96.90601812,
    -176                     'Mo': 97.90540482,
    -177                     '100Mo': 99.9074718,
    -178                     '97Tc': 96.9063667,
    -179                     '98Tc': 97.9072124,
    -180                     '99Tc': 98.9062508,
    -181                     '96Ru': 95.90759025,
    -182                     '98Ru': 97.9052868,
    -183                     '99Ru': 98.9059341,
    -184                     '100Ru': 99.9042143,
    -185                     '101Ru': 100.9055769,
    -186                     '102Ru': 101.9043441,
    -187                     '104Ru': 103.9054275,
    -188                     '103Rh': 102.9054980,
    -189                     '102Pd': 101.9056022,
    -190                     '104Pd': 103.9040305,
    -191                     '105Pd': 104.9050796,
    -192                     '106Pd': 105.9034804,
    -193                     '108Pd': 107.9038916,
    -194                     '110Pd': 109.9051722,
    -195                     '107Ag': 106.9050916,
    -196                     '109Ag': 108.9047553,
    -197                     '106Cd': 105.9064599,
    -198                     '108Cd': 107.9041834,
    -199                     '110Cd': 109.90300661,
    -200                     '111Cd': 110.90418287,
    -201                     'Cd': 111.90276287,
    -202                     '113Cd': 112.90440813,
    -203                     '114Cd': 113.90336509,
    -204                     '116Cd': 115.90476315,
    -205                     '113In': 112.90406184,
    -206                     'In': 114.903878776,
    -207                     '112Sn': 111.90482387,
    -208                     '114Sn': 113.9027827,
    -209                     '115Sn': 114.903344699,
    -210                     '116Sn': 115.90174280,
    -211                     '117Sn': 116.90295398,
    -212                     '118Sn': 117.90160657,
    -213                     '119Sn': 118.90331117,
    -214                     '120Sn': 119.90220163,
    -215                     '122Sn': 121.9034438,
    -216                     '124Sn': 123.9052766,
    -217                     '121Sb': 120.9038120,
    -218                     '123Sb': 122.9042132,
    -219                     '120Te': 119.9040593,
    -220                     '122Te': 121.9030435,
    -221                     '123Te': 122.9042698,
    -222                     '124Te': 123.9028171,
    -223                     '125Te': 124.9044299,
    -224                     '126Te': 125.9033109,
    -225                     '128Te': 127.90446128,
    -226                     '130Te': 129.906222748,
    -227                     'I': 126.9044719,
    -228                     '124Xe': 123.9058920,
    -229                     '126Xe': 125.9042983,
    -230                     '128Xe': 127.9035310,
    -231                     '129Xe': 128.9047808611,
    -232                     '130Xe': 129.903509349,
    -233                     '131Xe': 130.90508406,
    -234                     '132Xe': 131.9041550856,
    -235                     '134Xe': 133.90539466,
    -236                     '136Xe': 135.907214484,
    -237                     '133Cs': 132.9054519610,
    -238                     '130Ba': 129.9063207,
    -239                     '132Ba': 131.9050611,
    -240                     '134Ba': 133.90450818,
    -241                     '135Ba': 134.90568838,
    -242                     '136Ba': 135.90457573,
    -243                     '137Ba': 136.90582714,
    -244                     '138Ba': 137.90524700,
    -245                     '138La': 137.9071149,
    -246                     '139La': 138.9063563,
    -247                     '136Ce': 135.90712921,
    -248                     '138Ce': 137.905991,
    -249                     '140Ce': 139.9054431,
    -250                     '142Ce': 141.9092504,
    -251                     '141Pr': 140.9076576,
    -252                     '142Nd': 141.9077290,
    -253                     '143Nd': 142.9098200,
    -254                     '144Nd': 143.9100930,
    -255                     '145Nd': 144.9125793,
    -256                     '146Nd': 145.9131226,
    -257                     '148Nd': 147.9168993,
    -258                     '150Nd': 149.9209022,
    -259                     '145Pm': 144.9127559,
    -260                     '147Pm': 146.9151450,
    -261                     '144Sm': 143.9120065,
    -262                     '147Sm': 146.9149044,
    -263                     '148Sm': 147.9148292,
    -264                     '149Sm': 148.9171921,
    -265                     '150Sm': 149.9172829,
    -266                     '152Sm': 151.9197397,
    -267                     '154Sm': 153.9222169,
    -268                     '151Eu': 150.9198578,
    -269                     '153Eu': 152.9212380,
    -270                     '152Gd': 151.9197995,
    -271                     '154Gd': 153.9208741,
    -272                     '155Gd': 154.9226305,
    -273                     '156Gd': 155.9221312,
    -274                     '157Gd': 156.9239686,
    -275                     '158Gd': 157.9241123,
    -276                     '160Gd': 159.9270624,
    -277                     '159Tb': 158.9253547,
    -278                     '156Dy': 155.9242847,
    -279                     '158Dy': 157.9244159,
    -280                     '160Dy': 159.9252046,
    -281                     '161Dy': 160.9269405,
    -282                     '162Dy': 161.9268056,
    -283                     '163Dy': 162.9287383,
    -284                     '164Dy': 163.9291819,
    -285                     '165Ho': 164.9303288,
    -286                     '162Er': 161.9287884,
    -287                     '164Er': 163.9292088,
    -288                     '166Er': 165.9302995,
    -289                     '167Er': 166.9320546,
    -290                     '168Er': 167.9323767,
    -291                     '170Er': 169.9354702,
    -292                     '169Tm': 168.9342179,
    -293                     '168Yb': 167.9338896,
    -294                     '170Yb': 169.9347664,
    -295                     '171Yb': 170.9363302,
    -296                     '172Yb': 171.9363859,
    -297                     '173Yb': 172.9382151,
    -298                     '174Yb': 173.9388664,
    -299                     '176Yb': 175.9425764,
    -300                     '175Lu': 174.9407752,
    -301                     '176Lu': 175.9426897,
    -302                     '174Hf': 173.9400461,
    -303                     '176Hf': 175.9414076,
    -304                     '177Hf': 176.9432277,
    -305                     '178Hf': 177.9437058,
    -306                     '179Hf': 178.9458232,
    -307                     '180Hf': 179.9465570,
    -308                     '180Ta': 179.9474648,
    -309                     '181Ta': 180.9479958,
    -310                     '180W': 179.9467108,
    -311                     '182W': 181.94820394,
    -312                     '183W': 182.95022275,
    -313                     '184W': 183.95093092,
    -314                     '186W': 185.9543628,
    -315                     '185Re': 184.9529545,
    -316                     '187Re': 186.9557501,
    -317                     '184Os': 183.9524885,
    -318                     '186Os': 185.9538350,
    -319                     '187Os': 186.9557474,
    -320                     '188Os': 187.9558352,
    -321                     '189Os': 188.9581442,
    -322                     '190Os': 189.9584437,
    -323                     '192Os': 191.9614770,
    -324                     '191Ir': 190.9605893,
    -325                     '193Ir': 192.9629216,
    -326                     '190Pt': 189.9599297,
    -327                     '192Pt': 191.9610387,
    -328                     '194Pt': 193.9626809,
    -329                     '195Pt': 194.9647917,
    -330                     '196Pt': 195.96495209,
    -331                     '198Pt': 197.9678949,
    -332                     '197Au': 196.96656879,
    -333                     '196Hg': 195.9658326,
    -334                     '198Hg': 197.96676860,
    -335                     '199Hg': 198.96828064,
    -336                     '200Hg': 199.96832659,
    -337                     '201Hg': 200.97030284,
    -338                     '202Hg': 201.97064340,
    -339                     '204Hg': 203.97349398,
    -340                     '203Tl': 202.9723446,
    -341                     '205Tl': 204.9744278,
    -342                     '204Pb': 203.9730440,
    -343                     '206Pb': 205.9744657,
    -344                     '207Pb': 206.9758973,
    -345                     'Pb': 207.9766525,
    -346                     '209Bi': 208.9803991,
    -347                     '209Po': 208.9824308,
    -348                     '210Po': 209.9828741,
    -349                     '210At': 209.9871479,
    -350                     '211At': 210.9874966,
    -351                     '211Rn': 210.9906011,
    -352                     '220Rn': 220.0113941,
    -353                     '222Rn': 222.0175782,
    -354                     '223Fr': 223.0197360,
    -355                     '223Ra': 223.0185023,
    -356                     '224Ra': 224.0202120,
    -357                     '226Ra': 226.0254103,
    -358                     '228Ra': 228.0310707,
    -359                     '227Ac': 227.0277523,
    -360                     '230Th': 230.0331341,
    -361                     '232Th': 232.0380558,
    -362                     '231Pa': 231.0358842,
    -363                     '233U': 233.0396355,
    -364                     '234U': 234.0409523,
    -365                     '235U': 235.0439301,
    -366                     '236U': 236.0455682,
    -367                     '238U': 238.0507884,
    -368                     '236Np': 236.046570,
    -369                     '237Np': 237.0481736,
    -370                     '238Pu': 238.0495601,
    -371                     '239Pu': 239.0521636,
    -372                     '240Pu': 240.0538138,
    -373                     '241Pu': 241.0568517,
    -374                     '242Pu': 242.0587428,
    -375                     '244Pu': 244.0642053,
    -376                     '241Am': 241.0568293,
    -377                     '243Am': 243.0613813,
    -378                     '243Cm': 243.0613893,
    -379                     '244Cm': 244.0627528,
    -380                     '245Cm': 245.0654915,
    -381                     '246Cm': 246.0672238,
    -382                     '247Cm': 247.0703541,
    -383                     '248Cm': 248.0723499,
    -384                     '247Bk': 247.0703073,
    -385                     '249Bk': 249.0749877,
    -386                     '249Cf': 249.0748539,
    -387                     '250Cf': 250.0764062,
    -388                     '251Cf': 251.0795886,
    -389                     '252Cf': 252.0816272,
    -390                     '252Es': 252.082980,
    -391                     '257Fm': 257.0951061,
    -392                     '258Md': 258.0984315,
    -393                     '260Md': 260.10365, 
    -394                     '259No': 259.10103,
    -395                     '262Lr': 262.10961,
    -396                     '267Rf': 267.12179,
    -397                     '268Db': 268.12567,
    -398                     '271Sg': 271.13393,
    -399                     '272Bh': 272.13826,
    -400                     '270Hs': 270.13429,
    -401                     '276Mt': 276.15159,
    -402                     '281Ds': 281.16451,
    -403                     '280Rg': 280.16514,
    -404                     '285Cn': 285.17712,
    -405                     '284Nh': 284.17873,
    -406                     '289Fl': 289.19042,
    -407                     '288Mc': 288.19274,
    -408                     '293Lv': 293.20449,
    -409                     '292Ts': 292.20746,
    -410                     '294Og': 294.21392}
    -411
    -412    atoms_order = ['C', 'H', 'O', 'Cl', 'Na', 'S', 'N', '13C', '34S', '37Cl','Fe', 'Ca','P',
    -413                        'V', 'I', 'Ac', 'Al', 'Ar', 'As', 'At', 'Au', 'Co', 'Cs', 'D', 'F', 'Fr','18O', '17O',
    -414                        'He', 'Po', 'Ra', 'Rh', 'Rn', 'Be', 'Bi', 'Nb, 54Fe', '57Fe', 'Ni', '60Ni',
    -415                        '61Ni', '62Ni', '10B', '11B', '6Li', '7Li', 'La', 'Mn', '107Ag', '109Ag', '100Mo',
    -416                        '100Ru', '101Ru', '102Pd', '102Ru', '104Pd', '104Ru', '105Pd', 'Cd', '106Cd', '106Pd', '108Cd',
    -417                        '108Pd', '110Cd', '110Pd', '111Cd', '112Cd', '112Sn', '113Cd', '113In', '114Cd', '114Sn',
    -418                        'In', '115In', '115Sn', '116Cd', '116Sn', '117Sn', '118Sn', '119Sn', '120Sn', '120Te', '121Sb',
    -419                        '122Sn', '122Te', '123Sb', '123Te', '124Sn', '124Te', '124Xe', '125Te', '126Te', '126Xe',
    -420                        '128Te', '128Xe', '129Xe', '130Ba', '130Te', '130Xe', '131Xe', '132Ba', '132Xe', '134Ba',
    -421                        '134Xe', '135Ba', '136Ba', '136Xe', '137Ba', '138Ba', '15N', '174Hf', '176Hf', '177Hf', '178Hf',
    -422                        '179Hf', '180Hf', '180W', '182W', '183W', '184Os', '184W', '185Re', '186Os', '186W', '187Os', '187Re',
    -423                        '188Os', '189Os', '190Os', '190Pt', '191Ir', '192Ir', '192Os', '192Pt', '194Pt', '195Pt', '196Hg',
    -424                        '196Pt', '198Hg', '198Pt', '199Hg', '200Hg', '201Hg', '202Hg', '203Tl', '204Hg', '204Pb', '205Tl', '206Pb',
    -425                        '207Pb', '208Pb', 'Pb', '20Ne', '22Ne', '24Mg', '25Mg', '26Mg', '28Si', '29Si', '30Si', 'K', '40Ca', '41K', '44Ca',
    -426                        '46Ti', '47Ti', '48Ti', '49Ti', '50Cr', '50Ti', '50V', '51V', 'Cr', '52Cr', '53Cr', '54Cr', 'Cu', 'Zn', '65Cu', '66Zn',
    -427                        '67Zn', '68Zn', '69Ga', '70Ge', '71Ga', '72Ge', '73Ge', '74Ge', '76Ge', '76Se', '77Se', '78Se', 'Br', '81Br', '80Kr',
    -428                        'Se', '82Kr', '82Se', '83Kr', '84Kr', '85Rb', '86Kr', '86Sr', '87Rb', '87Sr', '88Sr', '90Zr', '91Zr', '92Mo', '92Zr',
    -429                        '94Mo', '94Zr', '95Mo', '96Mo', '96Ru', '96Zr', '97Mo', 'Mo', '98Ru', '99Ru']
    -430
    -431    atoms_covalence = {'C': (4),
    -432                     '13C': (4),
    -433                     'N': (3),
    -434                     'O': (2),
    -435                     'S': (2),
    -436                     'H': (1),
    -437                     'F': (1, 0),
    -438                     'Cl': (1, 0),
    -439                     'Br': (1, 0),
    -440                     'I': (1, 0),
    -441                     'At': (1),
    -442                     'Li': (1, 0),
    -443                     'Na': (1, 0),
    -444                     'K':  (1, 0),
    -445                     'Rb': (1),
    -446                     'Cs': (1),
    -447                     'Fr': (1),
    -448                     'B': (4, 3, 2, 1),
    -449                     'In': (3, 2, 1),
    -450                     'Al': (3, 1, 2),
    -451                     'P': (3, 5, 4, 2, 1),
    -452                     'Ga': (3, 1, 2),
    -453                     'Mg': (2, 1),
    -454                     'Be': (2, 1),
    -455                     'Ca': (2, 1),
    -456                     'Sr': (2, 1),
    -457                     'Ba': (2),
    -458                     'Ra': (2),
    -459                     'V': (5, 4, 3, 2, 1),
    -460                     'Fe': (3, 2, 4, 5, 6),
    -461                     'Si': (4, 3, 2),
    -462                     'Sc': (3, 2, 1),
    -463                     'Ti': (4, 3, 2, 1),
    -464                     'Cr': (1, 2, 3, 4, 5, 6),
    -465                     'Mn': (1, 2, 3, 4, 5, 6, 7),
    -466                     'Co': (1, 2, 3, 4, 5),
    -467                     'Ni': (1, 2, 3, 4),
    -468                     'Cu': (2, 1, 3, 4),
    -469                     'Zn': (2, 1),
    -470                     'Ge': (4, 3, 2, 1),
    -471                     'As': (5, 3, 2, 1),
    -472                     'Se': (6, 4, 2, 1),
    -473                     'Y': (3, 2, 1),
    -474                     'Zr': (4, 3, 2, 1),
    -475                     'Nb': (5, 4, 3, 2, 1),
    -476                     'Mo': (6, 5, 4, 3, 2, 1),
    -477                     'Tc': (7, 6, 5, 4, 3, 2, 1),
    -478                     'Ru': (8, 7, 6, 5, 4, 3, 2, 1),
    -479                     'Rh': (6, 5, 4, 3, 2, 1),
    -480                     'Pd': (4, 2, 1),
    -481                     'Ag': (0, 1, 2, 3, 4),
    -482                     'Cd': (2, 1),
    -483                     'Sn': (4, 2),
    -484                     'Sb': (5, 3),
    -485                     'Te': (6, 5, 4, 2),
    -486                     'La': (3, 2),
    -487                     'Hf': (4, 3, 2),
    -488                     'Ta': (5, 4, 3, 2),
    -489                     'W': (6, 5, 4, 3, 2, 1),
    -490                     'Re': (4, 7, 6, 5, 3, 2, 1),
    -491                     'Os': (4, 8, 7, 6, 5, 3, 2, 1),
    -492                     'Ir': (4, 8, 6, 5, 3, 2, 1),
    -493                     'Pt': (4, 6, 5, 3, 2, 1),
    -494                     'Au': (3, 5, 2, 1),
    -495                     'Hg': (1, 2, 4),
    -496                     'Tl': (3, 1),
    -497                     'Pb': (4, 2),
    -498                     'Bi': (3, 1, 5),
    -499                     'Po': (2, 4, 6),
    -500                     'Ac': (3, 2)
    -501                     }
    -502
    -503    isotopic_abundance = {'H': 0.999885,
    -504                          'D': 0.000115,
    -505                          'T': 0,
    -506                          '3He': 0.00000134,
    -507                          'He': 0.99999866,
    -508                          '6Li': 0.0759,
    -509                          'Li': 0.9241,
    -510                          '9Be': 1.0,
    -511                          '10B': 0.199,
    -512                          '11B': 0.801,
    -513                          'C': 0.9893,
    -514                          '13C': 0.0107,
    -515                          '14C': 0,
    -516                          'N': 0.99636,
    -517                          '15N': 0.00364,
    -518                          'O': 0.99757,
    -519                          '17O': 0.00038,
    -520                          '18O': 0.00205,
    -521                          'F': 1.0,
    -522                          '20Ne': 0.9048,
    -523                          '21Ne': 0.0027,
    -524                          '22Ne': 0.0925,
    -525                          'Na': 1.0,
    -526                          '24Mg': 0.7899,
    -527                          '25Mg': 0.1000,
    -528                          '26Mg': 0.1101,
    -529                          'Al': 1.0,
    -530                          '28Si': 0.92223,
    -531                          '29Si': 0.04685,
    -532                          '30Si': 0.03092,
    -533                          'P': 1.0,
    -534                          'S': 0.9499,
    -535                          '33S': 0.0075,
    -536                          '34S': 0.0425,
    -537                          '36S': 0.0001,
    -538                          'Cl': 0.7576,
    -539                          '37Cl': 0.2424,
    -540                          '36Ar': 0.003336,
    -541                          '38Ar': 0.000629,
    -542                          '40Ar': 0.996035,
    -543                          'K': 0.932581,
    -544                          '40K': 0.000117,
    -545                          '41K': 0.067302,
    -546                          'Ca': 0.96941,
    -547                          '42Ca': 0.00647,
    -548                          '43Ca': 0.00135,
    -549                          '44Ca': 0.02086,
    -550                          '46Ca': 0.00004,
    -551                          '48Ca': 0.001872,
    -552                          '45Sc': 1.0,
    -553                          '46Ti': 0.0825,
    -554                          '47Ti': 0.0744,
    -555                          '48Ti': 0.7372,
    -556                          '49Ti': 0.0541,
    -557                          '50Ti': 0.0518,
    -558                          '50V': 0.00250,
    -559                          'V': 0.9975,
    -560                          '50Cr': 0.04345,
    -561                          'Cr': 0.83789,
    -562                          '53Cr': 0.09501,
    -563                          '54Cr': 0.02365,
    -564                          'Mn': 1.0,
    -565                          '54Fe': 0.05845,
    -566                          'Fe': 0.91754,
    -567                          '57Fe': 0.02119,
    -568                          '58Fe': 0.00282,
    -569                          'Co': 1.0,
    -570                          'Ni': 0.68077,
    -571                          '60Ni': 0.26223,
    -572                          '61Ni': 0.011399,
    -573                          '62Ni': 0.036346,
    -574                          '64Ni': 0.009255,
    -575                          'Cu': 0.6915,
    -576                          '65Cu': 0.3085,
    -577                          'Zn': 0.4917,
    -578                          '66Zn': 0.2773,
    -579                          '67Zn': 0.0404,
    -580                          '68Zn': 0.1845,
    -581                          '70Zn': 0.0061,
    -582                          '69Ga': 0.60108,
    -583                          '71Ga': 0.39892,
    -584                          '70Ge': 0.2057,
    -585                          '72Ge': 0.2745,
    -586                          '73Ge': 0.0775,
    -587                          '74Ge': 0.3650,
    -588                          '76Ge': 0.0773,
    -589                          'As': 1.0,
    -590                          '74Se': 0.0089,
    -591                          '76Se': 0.0937,
    -592                          '77Se': 0.0763,
    -593                          '78Se': 0.2377,
    -594                          'Se': 0.4961,
    -595                          '82Se': 0.0873,
    -596                          'Br': 0.5069,
    -597                          '81Br': 0.4931,
    -598                          '78Kr': 0.00355,
    -599                          '80Kr': 0.02286,
    -600                          '82Kr': 0.11593,
    -601                          '83Kr': 0.11500,
    -602                          '84Kr': 0.56987,
    -603                          '86Kr': 0.17279,
    -604                          '85Rb': 0.7217,
    -605                          '87Rb': 0.2783,
    -606                          '84Sr': 0.0056,
    -607                          '86Sr': 0.0986,
    -608                          '87Sr': 0.0700,
    -609                          '88Sr': 0.8258,
    -610                          '89Y': 1.0,
    -611                          '90Zr': 0.5145,
    -612                          '91Zr': 0.1122,
    -613                          '92Zr': 0.1715,
    -614                          '94Zr': 0.1738,
    -615                          '96Zr': 0.0280,
    -616                          '93Nb': 1.0,
    -617                          '92Mo': 0.1453,
    -618                          '94Mo': 0.0915,
    -619                          '95Mo': 0.1584,
    -620                          '96Mo': 0.1667,
    -621                          '97Mo': 0.0960,
    -622                          'Mo': 0.2439,
    -623                          '100Mo': 0.0982,
    -624                          '97Tc': 0,
    -625                          '98Tc': 0,
    -626                          '99Tc': 0,
    -627                          '96Ru': 0.0554,
    -628                          '98Ru': 0.0187,
    -629                          '99Ru': 0.1276,
    -630                          '100Ru': 0.1260,
    -631                          '101Ru': 0.1706,
    -632                          '102Ru': 0.3155,
    -633                          '104Ru': 0.1862,
    -634                          '103Rh': 1.0,
    -635                          '102Pd': 0.0102,
    -636                          '104Pd': 0.1114,
    -637                          '105Pd': 0.2233,
    -638                          '106Pd': 0.2733,
    -639                          '108Pd': 0.2646,
    -640                          '110Pd': 0.1172,
    -641                          '107Ag': 0.51839,
    -642                          '109Ag': 0.48161,
    -643                          '106Cd': 0.0125,
    -644                          '108Cd': 0.0089,
    -645                          '110Cd': 0.1249,
    -646                          '111Cd': 0.1280,
    -647                          'Cd': 0.2413,
    -648                          '113Cd': 0.1222,
    -649                          '114Cd': 0.2873,
    -650                          '116Cd': 0.0749,
    -651                          '113In': 0.0429,
    -652                          'In': 0.9571,
    -653                          '112Sn': 0.0097,
    -654                          '114Sn': 0.0066,
    -655                          '115Sn': 0.0034,
    -656                          '116Sn': 0.1454,
    -657                          '117Sn': 0.0768,
    -658                          '118Sn': 0.2422,
    -659                          '119Sn': 0.0859,
    -660                          '120Sn': 0.3258,
    -661                          '122Sn': 0.0463,
    -662                          '124Sn': 0.0579,
    -663                          '121Sb': 0.5721,
    -664                          '123Sb': 0.4279,
    -665                          '120Te': 0.0009,
    -666                          '122Te': 0.0255,
    -667                          '123Te': 0.0089,
    -668                          '124Te': 0.0474,
    -669                          '125Te': 0.0707,
    -670                          '126Te': 0.1884,
    -671                          '128Te': 0.3174,
    -672                          '130Te': 0.3408,
    -673                          '127I': 1.0, # TODO Why is this here twice
    -674                          'I': 1.0,
    -675                          '124Xe': 0.000952,
    -676                          '126Xe': 0.000890,
    -677                          '128Xe': 0.019102,
    -678                          '129Xe': 0.264006,
    -679                          '130Xe': 0.040710,
    -680                          '131Xe': 0.212324,
    -681                          '132Xe': 0.269086,
    -682                          '134Xe': 0.104357,
    -683                          '136Xe': 0.088573,
    -684                          '133Cs': 1.0,
    -685                          '130Ba': 0.00106,
    -686                          '132Ba': 0.00101,
    -687                          '134Ba': 0.02417,
    -688                          '135Ba': 0.06592,
    -689                          '136Ba': 0.07854,
    -690                          '137Ba': 0.11232,
    -691                          '138Ba': 0.71698,
    -692                          '138La': 0.0008881,
    -693                          '139La': 0.9991119,
    -694                          '136Ce': 0.00185,
    -695                          '138Ce': 0.00251,
    -696                          '140Ce': 0.88450,
    -697                          '142Ce': 0.11114,
    -698                          '141Pr': 1.0,
    -699                          '142Nd': 0.27152,
    -700                          '143Nd': 0.12174,
    -701                          '144Nd': 0.23798,
    -702                          '145Nd': 0.08293,
    -703                          '146Nd': 0.17189,
    -704                          '148Nd': 0.05756,
    -705                          '150Nd': 0.05638,
    -706                          '145Pm': 0,
    -707                          '147Pm': 0,
    -708                          '144Sm': 0.0307,
    -709                          '147Sm': 0.1499,
    -710                          '148Sm': 0.1124,
    -711                          '149Sm': 0.1382,
    -712                          '150Sm': 0.0738,
    -713                          '152Sm': 0.2675,
    -714                          '154Sm': 0.2275,
    -715                          '151Eu': 0.4781,
    -716                          '153Eu': 0.5219,
    -717                          '152Gd': 0.0020,
    -718                          '154Gd': 0.0218,
    -719                          '155Gd': 0.1480,
    -720                          '156Gd': 0.2047,
    -721                          '157Gd': 0.1565,
    -722                          '158Gd': 0.2484,
    -723                          '160Gd': 0.2186,
    -724                          '159Tb': 1.0,
    -725                          '156Dy': 0.00056,
    -726                          '158Dy': 0.00095,
    -727                          '160Dy': 0.02329,
    -728                          '161Dy': 0.18889,
    -729                          '162Dy': 0.25475,
    -730                          '163Dy': 0.24896,
    -731                          '164Dy': 0.28260,
    -732                          '165Ho': 1.0,
    -733                          '162Er': 0.00139,
    -734                          '164Er': 0.01601,
    -735                          '166Er': 0.33503,
    -736                          '167Er': 0.22869,
    -737                          '168Er': 0.26978,
    -738                          '170Er': 0.14910,
    -739                          '169Tm': 1.0,
    -740                          '168Yb': 0.00123,
    -741                          '170Yb': 0.02982,
    -742                          '171Yb': 0.1409,
    -743                          '172Yb': 0.2168,
    -744                          '173Yb': 0.16103,
    -745                          '174Yb': 0.32026,
    -746                          '176Yb': 0.12996,
    -747                          '175Lu': 0.97401,
    -748                          '176Lu': 0.02599,
    -749                          '174Hf': 0.0016,
    -750                          '176Hf': 0.0526,
    -751                          '177Hf': 0.1860,
    -752                          '178Hf': 0.2728,
    -753                          '179Hf': 0.1362,
    -754                          '180Hf': 0.3508,
    -755                          '180Ta': 0.0001201,
    -756                          '181Ta': 0.9998799,
    -757                          '180W': 0.0012,
    -758                          '182W': 0.2650,
    -759                          '183W': 0.1431,
    -760                          '184W': 0.3064,
    -761                          '186W': 0.2843,
    -762                          '185Re': 0.3740,
    -763                          '187Re': 0.6260,
    -764                          '184Os': 0.0002,
    -765                          '186Os': 0.0159,
    -766                          '187Os': 0.0196,
    -767                          '188Os': 0.1324,
    -768                          '189Os': 0.1615,
    -769                          '190Os': 0.2626,
    -770                          '192Os': 0.4078,
    -771                          '191Ir': 0.373,
    -772                          '193Ir': 0.627,
    -773                          '190Pt': 0.00012,
    -774                          '192Pt': 0.00782,
    -775                          '194Pt': 0.3286,
    -776                          '195Pt': 0.3378,
    -777                          '196Pt': 0.2521,
    -778                          '198Pt': 0.07356,
    -779                          '197Au': 1.0,
    -780                          '196Hg': 0.0015,
    -781                          '198Hg': 0.0997,
    -782                          '199Hg': 0.16872,
    -783                          '200Hg': 0.2310,
    -784                          '201Hg': 0.1318,
    -785                          '202Hg': 0.2986,
    -786                          '204Hg': 0.0687,
    -787                          '203Tl': 0.2952,
    -788                          '205Tl': 0.7048,
    -789                          '204Pb': 0.014,
    -790                          '206Pb': 0.241,
    -791                          '207Pb': 0.221,
    -792                          'Pb': 0.524,
    -793                          '209Bi': 1.0,
    -794                          '209Po': 0,
    -795                          '210Po': 0,
    -796                          '210At': 0,
    -797                          '211At': 0,
    -798                          '211Rn': 0,
    -799                          '220Rn': 0,
    -800                          '222Rn': 0,
    -801                          '223Fr': 0,
    -802                          '223Ra': 0,
    -803                          '224Ra': 0,
    -804                          '226Ra': 0,
    -805                          '228Ra': 0,
    -806                          '227Ac': 0,
    -807                          '230Th': 0,
    -808                          '232Th': 1.0,
    -809                          '231Pa': 1.0,
    -810                          '233U': 0,
    -811                          '234U': 0.000054,
    -812                          '235U': 0.007204,
    -813                          '236U': 0,
    -814                          '238U': 0.992742,
    -815                          '236Np': 0,
    -816                          '237Np': 0,
    -817                          '238Pu': 0,
    -818                          '239Pu': 0,
    -819                          '240Pu': 0,
    -820                          '241Pu': 0,
    -821                          '242Pu': 0,
    -822                          '244Pu': 0,
    -823                          '241Am': 0,
    -824                          '243Am': 0,
    -825                          '243Cm': 0,
    -826                          '244Cm': 0,
    -827                          '245Cm': 0,
    -828                          '246Cm': 0,
    -829                          '247Cm': 0,
    -830                          '248Cm': 0,
    -831                          '247Bk': 0,
    -832                          '249Bk': 0,
    -833                          '249Cf': 0,
    -834                          '250Cf': 0,
    -835                          '251Cf': 0,
    -836                          '252Cf': 0,
    -837                          '252Es': 0,
    -838                          '257Fm': 0,
    -839                          '258Md': 0,
    -840                          '260Md': 0,
    -841                          '259No': 0,
    -842                          '262Lr': 0,
    -843                          '267Rf': 0,
    -844                          '268Db': 0,
    -845                          '271Sg': 0,
    -846                          '272Bh': 0,
    -847                          '270Hs': 0,
    -848                          '276Mt': 0,
    -849                          '281Ds': 0,
    -850                          '280Rg': 0,
    -851                          '285Cn': 0,
    -852                          '284Nh': 0,
    -853                          '289Fl': 0,
    -854                          '288Mc': 0,
    -855                          '293Lv': 0,
    -856                          '292Ts': 0,
    -857                          '294Og': 0}
    -858
    -859    isotopes = {'F': ['Flourine'],
    -860                'Na': ['Sodium'],
    -861                'Al': ['Aluminum'],
    -862                'P': ['Phosphorus'],
    -863                'Sc': ['Scandium'],
    -864                'Co': ['Cobalt'],
    -865                'He': ['Helium'],
    -866                'Ar': ['Argon'],
    -867                'H': ['Hydrogen', ['D']],
    -868                'Cl': ['Chlorine', ['37Cl']],
    -869                'Li': ['Lithium', ['6Li']],
    -870                'Be': ['Beryllium'],
    -871                'B': ['Boron', ['11B']],
    -872                'C': ['Carbon', ['13C']],
    -873                'O': ['Oxygen', ['18O', '17O']],
    -874                'S': ['Sulfur', ['34S']],
    -875                'N': ['Nitrogen', ['15N']],
    -876                'V': ['Vanadium', ['50V']],
    -877                'Ne': ['Neon', ['20Ne', '22Ne']],
    -878                'Mg': ['Magnesium', ['24Mg', '26Mg', '25Mg']],
    -879                'Si': ['Silicon', ['28Si', '29Si', '30Si']],
    -880                'K': ['Potassium', ['40K', '41K']],
    -881                'Ca': ['Calcium', ['43Ca', '44Ca']],
    -882                'Ti': ['Titanium', ['48Ti', '46Ti', '47Ti', '49Ti', '50Ti']],
    -883                'Cr': ['Chromium', ['53Cr', '50Cr', '54Cr']],
    -884                'Fe': ['Iron', ['54Fe', '57Fe', '58Fe']],
    -885                'Mn': ['Manganese'],
    -886                'Ni': ['Nickel', ['60Ni', '62Ni', '61Ni']],
    -887                'Cu': ['Copper', ['65Cu']],
    -888                'Zn': ['Zinc', ['66Zn', '68Zn', '67Zn', '70Zn']],
    -889                'Ga': ['Gallium', ['69Ga', '71Ga']],
    -890                'Ge': ['Germanium', ['74Ge', '72Ge', '70Ge', '73Ge', '76Ge']],
    -891                'As': ['Arsenic'],
    -892                'Se': ['Selenium', ['78Se', '76Se', '82Se', '77Se']],
    -893                'Br': ['Bromine', ['81Br']],
    -894                'Kr': ['Krypton', ['84Kr', '86Kr', '82Kr', '83Kr', '80Kr']],
    -895                'Rb': ['Rubidium', ['85Rb', '87Rb']],
    -896                'Sr': ['Strontium', ['88Sr', '86Sr', '87Sr']],
    -897                'Y': ['Yttrium'],
    -898                'Zr': ['Zironium', ['90Zr', '94Zr', '92Zr', '91Zr', '96Zr']],
    -899                'Nb': ['Niobium'],
    -900                'Mo': ['Molybdenum', ['96Mo', '95Mo', '92Mo', '100Mo', '97Mo', '94Mo']],
    -901                'Tc': ['Technetium'],
    -902                'Ru': ['Ruthenium', ['102Ru', '104Ru', '101Ru', '99Ru', '100Ru', '96Ru', '98Ru']],
    -903                'Rh': ['Rhodium'],
    -904                'Pd': ['Palladium', ['106Pd', '108Pd', '105Pd', '110Pd', '104Pd', '102Pd']],
    -905                'Ag': ['Silver', ['107Ag', '109Ag']],
    -906                'Cd': ['Cadmium', ['114Cd', '111Cd', '110Cd', '113Cd', '116Cd', '106Cd', '108Cd']],
    -907                'In': ['Indium', ['113In']],
    -908                'Sn': ['Tin', ['120Sn', '118Sn', '116Sn', '119Sn', '117Sn', '124Sn', '122Sn', '112Sn']],
    -909                'Sb': ['Antimony', ['121Sb', '123Sb']],
    -910                'Te': ['Tellurium', ['130Te', '128Te', '126Te', '125Te', '124Te', '122Te']],
    -911                'I': ['Iodine'],
    -912                'Xe': ['Xenon', ['132Xe', '129Xe', '131Xe', '134Xe', '136Xe', '130Xe', '128Xe']],
    -913                'Cs': ['Cesium'],
    -914                'Ba': ['Barium', ['138Ba', '137Ba', '136Ba', '135Ba', '134Ba']],
    -915                'La': ['Lanthanum'],
    -916                'Hf': ['Hafnium', ['180Hf', '178Hf', '177Hf', '179Hf', '176Hf']],
    -917                'Ta': ['Tantalum'],
    -918                'W': ['Tungsten', ['184W', '186W', '182W', '183W']],
    -919                'Re': ['Rhenium', ['187Re', '185Re']],
    -920                'Os': ['Osmium', ['192Os', '190Os', '189Os', '188Os', '187Os', '186Os']],
    -921                'Ir': ['Iridium', ['193Ir', '191Ir']],
    -922                'Pt': ['Platinum', ['195Pt', '194Pt', '196Pt', '198Pt', '192Pt']],
    -923                'Au': ['Gold'],
    -924                'Hg': ['Mercury', ['202Hg', '200Hg', '199Hg', '201Hg', '198Hg', '204Hg']],
    -925                'Tl': ['Thallium', ['205Tl', '203Tl']],
    -926                'Pb': ['Lead', ['206Pb', '207Pb', '204Pb']],
    -927                'Bi': ['Bismuth'],
    -928                'Po': ['Polonium'],
    -929                'At': ['Aslatine'],
    -930                'Rn': ['Radon'],
    -931                'Fr': ['Francium'],
    -932                'Ra': ['Radium'],
    -933                'Ac': ['Actinium']
    -934                }
    +            
      42class Atoms: #pragma: no cover
    +  43    """ Class for Atoms in CoreMS
    +  44
    +  45    This class includes key properties of atoms (and the electron) and isotopes, including their exact masses, relative abundances, and covalences. 
    +  46    It also associates which isotopes are for the same element, and provides an ordering of elements.
    +  47
    +  48    IUPAC definition of monoisotopic mass is based on the most abundant isotopes of each element present.
    +  49    Here, we will use atom symbols with isotope numbers for all isotopes excluding the most abundant one.
    +  50    This list has been corrected up to Iodine. 
    +  51    
    +  52    References
    +  53    ----------
    +  54
    +  55    1. NIST - Last Accessed 2019-06-12
    +  56    https://www.nist.gov/pml/atomic-weights-and-isotopic-compositions-relative-atomic-masses
    +  57
    +  58    """
    +  59    electron_mass = 0.0005_485_799_090_65 #NIST value
    +  60
    +  61    atomic_masses = {'H': 1.00782503223,
    +  62                     'D': 2.01410177812,
    +  63                     'T': 3.0160492779, #consider removing 
    +  64                     '3He': 3.0160293201,
    +  65                     'He': 4.00260325413,
    +  66                     '6Li': 6.0151228874,
    +  67                     'Li': 7.0160034366,
    +  68                     'Be': 9.012183065,
    +  69                     '10B': 10.01293695,
    +  70                     'B': 11.00930536,
    +  71                     'C': 12.0,
    +  72                     '13C': 13.00335483507,
    +  73                     '14C': 14.0032419884,
    +  74                     'N': 14.00307400443,
    +  75                     '15N': 15.00010889888,
    +  76                     'O': 15.99491461957,
    +  77                     '17O': 16.99913175650,
    +  78                     '18O': 17.99915961286,
    +  79                     'F': 18.99840316273,
    +  80                     'Ne': 19.9924401762,
    +  81                     '21Ne': 20.993846685,
    +  82                     '22Ne': 21.991385114,
    +  83                     'Na': 22.9897692820,
    +  84                     'Mg': 23.985041697,
    +  85                     '25Mg': 24.985836976,
    +  86                     '26Mg': 25.982592968,
    +  87                     'Al': 26.98153853,
    +  88                     'Si': 27.97692653465,
    +  89                     '29Si': 28.97649466490,
    +  90                     '30Si': 29.973770136,
    +  91                     'P': 30.97376199842,
    +  92                     'S': 31.9720711744,
    +  93                     '33S': 32.9714589098,
    +  94                     '34S': 33.967867004,
    +  95                     '36S': 35.96708071,
    +  96                     'Cl': 34.968852682,
    +  97                     '37Cl': 36.965902602,
    +  98                     '36Ar': 35.967545105,
    +  99                     '38Ar': 37.96273211,
    + 100                     'Ar': 39.9623831237,
    + 101                     'K': 38.9637064864,
    + 102                     '40K': 39.963998166,
    + 103                     '41K': 40.9618252579,
    + 104                     'Ca': 39.962590863,
    + 105                     '42Ca': 41.95861783,
    + 106                     '43Ca': 42.95876644,
    + 107                     '44Ca': 43.95548156,
    + 108                     '46Ca': 45.9536890,
    + 109                     '48Ca': 47.95252276,
    + 110                     'Sc': 44.95590828,
    + 111                     '46Ti': 45.95262772,
    + 112                     '47Ti': 46.95175879,
    + 113                     'Ti': 47.94794198,
    + 114                     '49Ti': 48.94786568,
    + 115                     '50Ti': 49.94478689,
    + 116                     '50V': 49.94715601,
    + 117                     'V': 50.94395704,
    + 118                     '50Cr': 49.94604183,
    + 119                     'Cr': 51.94050623,
    + 120                     '53Cr': 52.94064815,
    + 121                     '54Cr': 53.93887916,
    + 122                     'Mn': 54.93804391,
    + 123                     '54Fe': 53.93960899,
    + 124                     'Fe': 55.93493633,
    + 125                     '57Fe': 56.93539284,
    + 126                     '58Fe': 57.93327443,
    + 127                     'Co': 58.93319429,
    + 128                     'Ni': 57.93534241,
    + 129                     '60Ni': 59.93078588,
    + 130                     '61Ni': 60.93105557,
    + 131                     '62Ni': 61.92834537,
    + 132                     '64Ni': 63.92796682,
    + 133                     'Cu': 62.92959772,
    + 134                     '65Cu': 64.92778970,
    + 135                     'Zn': 63.92914201,
    + 136                     '66Zn': 65.92603381,
    + 137                     '67Zn': 66.92712775,
    + 138                     '68Zn': 67.92484455,
    + 139                     '70Zn': 69.9253192,
    + 140                     'Ga': 68.9255735,
    + 141                     '71Ga': 70.92470258,
    + 142                     '70Ge': 69.92424875,
    + 143                     '72Ge': 71.922075826,
    + 144                     '73Ge': 72.923458956,
    + 145                     'Ge': 73.921177761,
    + 146                     '76Ge': 75.921402726,
    + 147                     'As': 74.92159457,
    + 148                     '74Se': 73.922475934,
    + 149                     '76Se': 75.919213704,
    + 150                     '77Se': 76.919914154,
    + 151                     '78Se': 77.91730928,
    + 152                     'Se': 79.9165218,
    + 153                     '82Se': 81.9166995,
    + 154                     'Br': 78.9183376,
    + 155                     '81Br': 80.9162897,
    + 156                     '78Kr': 77.92036494,
    + 157                     '80Kr': 79.91637808,
    + 158                     '82Kr': 81.91348273,
    + 159                     '83Kr': 82.91412716,
    + 160                     'Kr': 83.9114977282,
    + 161                     '86Kr': 85.9106106269,
    + 162                     'Rb': 84.9117897379,
    + 163                     '87Rb': 86.9091805310,
    + 164                     '84Sr': 83.9134191,
    + 165                     '86Sr': 85.9092606,
    + 166                     '87Sr': 86.9088775,
    + 167                     'Sr': 87.9056125,
    + 168                     'Y': 88.9058403,
    + 169                     'Zr': 89.9046977,
    + 170                     '91Zr': 90.9056396,
    + 171                     '92Zr': 91.9050347,
    + 172                     '94Zr': 93.9063108,
    + 173                     '96Zr': 95.9082714,
    + 174                     'Nb': 92.9063730,
    + 175                     '92Mo': 91.90680796,
    + 176                     '94Mo': 93.90508490,
    + 177                     '95Mo': 94.90583877,
    + 178                     '96Mo': 95.90467612,
    + 179                     '97Mo': 96.90601812,
    + 180                     'Mo': 97.90540482,
    + 181                     '100Mo': 99.9074718,
    + 182                     #'97Tc': 96.9063667,
    + 183                     #'98Tc': 97.9072124,
    + 184                     'Tc': 98.9062508, #consider removing technetium as it is radioactive
    + 185                     '96Ru': 95.90759025,
    + 186                     '98Ru': 97.9052868,
    + 187                     '99Ru': 98.9059341,
    + 188                     '100Ru': 99.9042143,
    + 189                     '101Ru': 100.9055769,
    + 190                     'Ru': 101.9043441,
    + 191                     '104Ru': 103.9054275,
    + 192                     'Rh': 102.9054980,
    + 193                     '102Pd': 101.9056022,
    + 194                     '104Pd': 103.9040305,
    + 195                     '105Pd': 104.9050796,
    + 196                     'Pd': 105.9034804,
    + 197                     '108Pd': 107.9038916,
    + 198                     '110Pd': 109.9051722,
    + 199                     'Ag': 106.9050916,
    + 200                     '109Ag': 108.9047553,
    + 201                     '106Cd': 105.9064599,
    + 202                     '108Cd': 107.9041834,
    + 203                     '110Cd': 109.90300661,
    + 204                     '111Cd': 110.90418287,
    + 205                     'Cd': 111.90276287,
    + 206                     '113Cd': 112.90440813,
    + 207                     '114Cd': 113.90336509,
    + 208                     '116Cd': 115.90476315,
    + 209                     '113In': 112.90406184,
    + 210                     'In': 114.903878776,
    + 211                     '112Sn': 111.90482387,
    + 212                     '114Sn': 113.9027827,
    + 213                     '115Sn': 114.903344699,
    + 214                     '116Sn': 115.90174280,
    + 215                     '117Sn': 116.90295398,
    + 216                     '118Sn': 117.90160657,
    + 217                     '119Sn': 118.90331117,
    + 218                     'Sn': 119.90220163,
    + 219                     '122Sn': 121.9034438,
    + 220                     '124Sn': 123.9052766,
    + 221                     'Sb': 120.9038120,
    + 222                     '123Sb': 122.9042132,
    + 223                     '120Te': 119.9040593,
    + 224                     '122Te': 121.9030435,
    + 225                     '123Te': 122.9042698,
    + 226                     '124Te': 123.9028171,
    + 227                     '125Te': 124.9044299,
    + 228                     '126Te': 125.9033109,
    + 229                     '128Te': 127.90446128,
    + 230                     'Te': 129.906222748,
    + 231                     'I': 126.9044719,
    + 232                     '124Xe': 123.9058920,
    + 233                     '126Xe': 125.9042983,
    + 234                     '128Xe': 127.9035310,
    + 235                     '129Xe': 128.9047808611,
    + 236                     '130Xe': 129.903509349,
    + 237                     '131Xe': 130.90508406,
    + 238                     'Xe': 131.9041550856,
    + 239                     '134Xe': 133.90539466,
    + 240                     '136Xe': 135.907214484,
    + 241                     'Cs': 132.9054519610,
    + 242                     '130Ba': 129.9063207,
    + 243                     '132Ba': 131.9050611,
    + 244                     '134Ba': 133.90450818,
    + 245                     '135Ba': 134.90568838,
    + 246                     '136Ba': 135.90457573,
    + 247                     '137Ba': 136.90582714,
    + 248                     'Ba': 137.90524700,
    + 249                     '138La': 137.9071149,
    + 250                     'La': 138.9063563,
    + 251                     '136Ce': 135.90712921,
    + 252                     '138Ce': 137.905991,
    + 253                     'Ce': 139.9054431,
    + 254                     '142Ce': 141.9092504,
    + 255                     'Pr': 140.9076576,
    + 256                     'Nd': 141.9077290,
    + 257                     '143Nd': 142.9098200,
    + 258                     '144Nd': 143.9100930,
    + 259                     '145Nd': 144.9125793,
    + 260                     '146Nd': 145.9131226,
    + 261                     '148Nd': 147.9168993,
    + 262                     '150Nd': 149.9209022,
    + 263                     '145Pm': 144.9127559,
    + 264                     '147Pm': 146.9151450,
    + 265                     '144Sm': 143.9120065,
    + 266                     '147Sm': 146.9149044,
    + 267                     '148Sm': 147.9148292,
    + 268                     '149Sm': 148.9171921,
    + 269                     '150Sm': 149.9172829,
    + 270                     'Sm': 151.9197397,
    + 271                     '154Sm': 153.9222169,
    + 272                     '151Eu': 150.9198578,
    + 273                     'Eu': 152.9212380,
    + 274                     '152Gd': 151.9197995,
    + 275                     '154Gd': 153.9208741,
    + 276                     '155Gd': 154.9226305,
    + 277                     '156Gd': 155.9221312,
    + 278                     '157Gd': 156.9239686,
    + 279                     'Gd': 157.9241123,
    + 280                     '160Gd': 159.9270624,
    + 281                     'Tb': 158.9253547,
    + 282                     '156Dy': 155.9242847,
    + 283                     '158Dy': 157.9244159,
    + 284                     '160Dy': 159.9252046,
    + 285                     '161Dy': 160.9269405,
    + 286                     '162Dy': 161.9268056,
    + 287                     '163Dy': 162.9287383,
    + 288                     'Dy': 163.9291819,
    + 289                     'Ho': 164.9303288,
    + 290                     '162Er': 161.9287884,
    + 291                     '164Er': 163.9292088,
    + 292                     'Er': 165.9302995,
    + 293                     '167Er': 166.9320546,
    + 294                     '168Er': 167.9323767,
    + 295                     '170Er': 169.9354702,
    + 296                     'Tm': 168.9342179,
    + 297                     '168Yb': 167.9338896,
    + 298                     '170Yb': 169.9347664,
    + 299                     '171Yb': 170.9363302,
    + 300                     '172Yb': 171.9363859,
    + 301                     '173Yb': 172.9382151,
    + 302                     'Yb': 173.9388664,
    + 303                     '176Yb': 175.9425764,
    + 304                     'Lu': 174.9407752,
    + 305                     '176Lu': 175.9426897,
    + 306                     '174Hf': 173.9400461,
    + 307                     '176Hf': 175.9414076,
    + 308                     '177Hf': 176.9432277,
    + 309                     '178Hf': 177.9437058,
    + 310                     '179Hf': 178.9458232,
    + 311                     'Hf': 179.9465570,
    + 312                     '180Ta': 179.9474648,
    + 313                     'Ta': 180.9479958,
    + 314                     '180W': 179.9467108,
    + 315                     '182W': 181.94820394,
    + 316                     '183W': 182.95022275,
    + 317                     'W': 183.95093092,
    + 318                     '186W': 185.9543628,
    + 319                     '185Re': 184.9529545,
    + 320                     'Re': 186.9557501,
    + 321                     '184Os': 183.9524885,
    + 322                     '186Os': 185.9538350,
    + 323                     '187Os': 186.9557474,
    + 324                     '188Os': 187.9558352,
    + 325                     '189Os': 188.9581442,
    + 326                     '190Os': 189.9584437,
    + 327                     '192Os': 191.9614770,
    + 328                     '191Ir': 190.9605893,
    + 329                     'Ir': 192.9629216,
    + 330                     '190Pt': 189.9599297,
    + 331                     '192Pt': 191.9610387,
    + 332                     '194Pt': 193.9626809,
    + 333                     'Pt': 194.9647917,
    + 334                     '196Pt': 195.96495209,
    + 335                     '198Pt': 197.9678949,
    + 336                     'Au': 196.96656879,
    + 337                     '196Hg': 195.9658326,
    + 338                     '198Hg': 197.96676860,
    + 339                     '199Hg': 198.96828064,
    + 340                     '200Hg': 199.96832659,
    + 341                     '201Hg': 200.97030284,
    + 342                     'Hg': 201.97064340,
    + 343                     '204Hg': 203.97349398,
    + 344                     '203Tl': 202.9723446,
    + 345                     'Tl': 204.9744278,
    + 346                     '204Pb': 203.9730440,
    + 347                     '206Pb': 205.9744657,
    + 348                     '207Pb': 206.9758973,
    + 349                     'Pb': 207.9766525,
    + 350                     'Bi': 208.9803991,
    + 351                     '209Po': 208.9824308,
    + 352                     '210Po': 209.9828741,
    + 353                     '210At': 209.9871479,
    + 354                     '211At': 210.9874966,
    + 355                     '211Rn': 210.9906011,
    + 356                     '220Rn': 220.0113941,
    + 357                     '222Rn': 222.0175782,
    + 358                     '223Fr': 223.0197360,
    + 359                     '223Ra': 223.0185023,
    + 360                     '224Ra': 224.0202120,
    + 361                     '226Ra': 226.0254103,
    + 362                     '228Ra': 228.0310707,
    + 363                     '227Ac': 227.0277523,
    + 364                     '230Th': 230.0331341,
    + 365                     'Th': 232.0380558,
    + 366                     'Pa': 231.0358842,
    + 367                     '233U': 233.0396355,
    + 368                     '234U': 234.0409523,
    + 369                     '235U': 235.0439301,
    + 370                     '236U': 236.0455682,
    + 371                     'U': 238.0507884,
    + 372                     '236Np': 236.046570,
    + 373                     '237Np': 237.0481736,
    + 374                     '238Pu': 238.0495601,
    + 375                     '239Pu': 239.0521636,
    + 376                     '240Pu': 240.0538138,
    + 377                     '241Pu': 241.0568517,
    + 378                     '242Pu': 242.0587428,
    + 379                     '244Pu': 244.0642053,
    + 380                     '241Am': 241.0568293,
    + 381                     '243Am': 243.0613813,
    + 382                     '243Cm': 243.0613893,
    + 383                     '244Cm': 244.0627528,
    + 384                     '245Cm': 245.0654915,
    + 385                     '246Cm': 246.0672238,
    + 386                     '247Cm': 247.0703541,
    + 387                     '248Cm': 248.0723499,
    + 388                     '247Bk': 247.0703073,
    + 389                     '249Bk': 249.0749877,
    + 390                     '249Cf': 249.0748539,
    + 391                     '250Cf': 250.0764062,
    + 392                     '251Cf': 251.0795886,
    + 393                     '252Cf': 252.0816272,
    + 394                     '252Es': 252.082980,
    + 395                     '257Fm': 257.0951061,
    + 396                     '258Md': 258.0984315,
    + 397                     '260Md': 260.10365, 
    + 398                     '259No': 259.10103,
    + 399                     '262Lr': 262.10961,
    + 400                     '267Rf': 267.12179,
    + 401                     '268Db': 268.12567,
    + 402                     '271Sg': 271.13393,
    + 403                     '272Bh': 272.13826,
    + 404                     '270Hs': 270.13429,
    + 405                     '276Mt': 276.15159,
    + 406                     '281Ds': 281.16451,
    + 407                     '280Rg': 280.16514,
    + 408                     '285Cn': 285.17712,
    + 409                     '284Nh': 284.17873,
    + 410                     '289Fl': 289.19042,
    + 411                     '288Mc': 288.19274,
    + 412                     '293Lv': 293.20449,
    + 413                     '292Ts': 292.20746,
    + 414                     '294Og': 294.21392}
    + 415    
    + 416
    + 417    # This list orders atoms, starting with the most abundant isotopes first, ordered as described. 
    + 418    # Less abundant isotopes are ordered by mass at the end of the list.
    + 419    atoms_order = ['C', 'H', 'O', 'N', 'P', 'S', # CHONPS
    + 420                    'F', 'Cl', 'Br', 'I', 'At', #Halogens
    + 421                    'Li','Na','K','Rb','Cs','Fr', #Alkali
    + 422                    'He', 'Ne', 'Ar', 'Kr', 'Xe', 'Rn', #Noble gasses
    + 423                    'Be','B', #Row 2
    + 424                    'Mg', 'Al','Si', #Row 3
    + 425                    'Ca','Sc','Ti','V','Cr','Mn','Fe','Co','Ni','Cu','Zn','Ga','Ge','As','Se', #Row 4
    + 426                    'Sr','Y','Zr','Nb','Mo','Tc','Ru','Rh','Pd','Ag','Cd','In','Sn','Sb','Te', #Row 5
    + 427                    'Ba','La', 'Hf', 'Ta', 'W', 'Re', 'Os', 'Ir', 'Pt', 'Au', 'Hg', 'Tl', 'Pb', 'Bi', 'Po', #Row 6
    + 428                    'Ra', 'Ac', 'Rf', 'Db', 'Sg', 'Bh', 'Hs', 'Mt', 'Ds', 'Rg', 'Cn', 'Nh', 'Fl', 'Mc', 'Lv', 'Ts', 'Og', #Row 7
    + 429                    'Ce','Pr','Nd','Pm','Sm','Eu','Gd','Tb','Dy','Ho','Er','Tm','Yb','Lu', #Lanthanides
    + 430                    'Th','Pa','U','Np','Pu','Am','Cm','Bk','Cf','Es','Fm','Md','No','Lr', #Actinides
    + 431                    # Less abundant isotopes follow
    + 432                    'D','6Li',
    + 433                    '10B', '13C','15N','17O','18O',
    + 434                    '22Ne',  '25Mg', '26Mg',  '29Si', 
    + 435                    '30Si', '33S', '34S','36S', '37Cl',
    + 436                    '40Ca', '41K', '44Ca','46Ti', '47Ti',  '49Ti', 
    + 437                    '50Cr', '50Ti', '50V', '53Cr', '54Cr',  '54Fe', '57Fe', '58Fe',
    + 438                    '60Ni', '61Ni', '62Ni', '65Cu', '66Zn','67Zn', '68Zn',  
    + 439                    '70Ge', '71Ga', '72Ge', '73Ge',  '76Ge', '76Se', '77Se', '78Se',  
    + 440                    '81Br', '80Kr','82Kr', '82Se', '83Kr', '85Rb', '86Kr', '86Sr', '87Rb', '87Sr', '88Sr',  
    + 441                    '91Zr', '92Mo', '92Zr','94Mo', '94Zr', '95Mo', '96Mo', '96Ru', '96Zr', '97Mo',  '98Ru', '99Ru',
    + 442                    '100Mo', '100Ru', '101Ru', '102Pd', '104Pd', '104Ru', '105Pd', '106Cd', '106Pd', '108Cd', '108Pd','109Ag',
    + 443                    '110Cd', '110Pd', '111Cd', '112Cd', '112Sn', '113Cd', '113In', '114Cd', '114Sn','115In', '115Sn', '116Cd', '116Sn', '117Sn', '118Sn', '119Sn', 
    + 444                    '120Sn', '120Te', '121Sb', '122Sn', '122Te', '123Sb', '123Te', '124Sn', '124Te', '124Xe', '125Te', '126Te', '126Xe',
    + 445                    '128Te', '128Xe', '129Xe', '130Ba', '130Te', '130Xe', '131Xe', '132Ba', '132Xe', '134Ba',
    + 446                    '134Xe', '135Ba', '136Ba', '136Xe', '137Ba', '138Ba', 
    + 447                    '174Hf', '176Hf', '177Hf', '178Hf','179Hf', 
    + 448                    '180Hf', '180W', '182W', '183W', '184Os', '184W', '185Re', '186Os', '186W', '187Os', '187Re','188Os', '189Os', 
    + 449                    '190Os', '190Pt', '191Ir', '192Ir', '192Os', '192Pt', '194Pt', '195Pt', '196Hg','196Pt', '198Hg', '198Pt','199Hg', 
    + 450                    '200Hg', '201Hg', '202Hg', '203Tl', '204Hg', '204Pb', '205Tl','206Pb','207Pb', '208Pb'
    + 451                    ]
    + 452
    + 453    atoms_covalence = {'C': (4),
    + 454                     '13C': (4),
    + 455                     'N': (3),
    + 456                     'O': (2),
    + 457                     'S': (2),
    + 458                     'H': (1),
    + 459                     'F': (1, 0),
    + 460                     'Cl': (1, 0),
    + 461                     'Br': (1, 0),
    + 462                     'I': (1, 0),
    + 463                     'At': (1),
    + 464                     'Li': (1, 0),
    + 465                     'Na': (1, 0),
    + 466                     'K':  (1, 0),
    + 467                     'Rb': (1),
    + 468                     'Cs': (1),
    + 469                     'Fr': (1),
    + 470                     'B': (4, 3, 2, 1),
    + 471                     'In': (3, 2, 1),
    + 472                     'Al': (3, 1, 2),
    + 473                     'P': (3, 5, 4, 2, 1),
    + 474                     'Ga': (3, 1, 2),
    + 475                     'Mg': (2, 1),
    + 476                     'Be': (2, 1),
    + 477                     'Ca': (2, 1),
    + 478                     'Sr': (2, 1),
    + 479                     'Ba': (2),
    + 480                     'Ra': (2),
    + 481                     'V': (5, 4, 3, 2, 1),
    + 482                     'Fe': (3, 2, 4, 5, 6),
    + 483                     'Si': (4, 3, 2),
    + 484                     'Sc': (3, 2, 1),
    + 485                     'Ti': (4, 3, 2, 1),
    + 486                     'Cr': (1, 2, 3, 4, 5, 6),
    + 487                     'Mn': (1, 2, 3, 4, 5, 6, 7),
    + 488                     'Co': (1, 2, 3, 4, 5),
    + 489                     'Ni': (1, 2, 3, 4),
    + 490                     'Cu': (2, 1, 3, 4),
    + 491                     'Zn': (2, 1),
    + 492                     'Ge': (4, 3, 2, 1),
    + 493                     'As': (5, 3, 2, 1),
    + 494                     'Se': (6, 4, 2, 1),
    + 495                     'Y': (3, 2, 1),
    + 496                     'Zr': (4, 3, 2, 1),
    + 497                     'Nb': (5, 4, 3, 2, 1),
    + 498                     'Mo': (6, 5, 4, 3, 2, 1),
    + 499                     'Tc': (7, 6, 5, 4, 3, 2, 1),
    + 500                     'Ru': (8, 7, 6, 5, 4, 3, 2, 1),
    + 501                     'Rh': (6, 5, 4, 3, 2, 1),
    + 502                     'Pd': (4, 2, 1),
    + 503                     'Ag': (0, 1, 2, 3, 4),
    + 504                     'Cd': (2, 1),
    + 505                     'Sn': (4, 2),
    + 506                     'Sb': (5, 3),
    + 507                     'Te': (6, 5, 4, 2),
    + 508                     'La': (3, 2),
    + 509                     'Hf': (4, 3, 2),
    + 510                     'Ta': (5, 4, 3, 2),
    + 511                     'W': (6, 5, 4, 3, 2, 1),
    + 512                     'Re': (4, 7, 6, 5, 3, 2, 1),
    + 513                     'Os': (4, 8, 7, 6, 5, 3, 2, 1),
    + 514                     'Ir': (4, 8, 6, 5, 3, 2, 1),
    + 515                     'Pt': (4, 6, 5, 3, 2, 1),
    + 516                     'Au': (3, 5, 2, 1),
    + 517                     'Hg': (1, 2, 4),
    + 518                     'Tl': (3, 1),
    + 519                     'Pb': (4, 2),
    + 520                     'Bi': (3, 1, 5),
    + 521                     'Po': (2, 4, 6),
    + 522                     'Ac': (3, 2)
    + 523                     }
    + 524
    + 525    isotopic_abundance = {'H': 0.999885,
    + 526                          'D': 0.000115,
    + 527                          'T': 0, #Consider removing.
    + 528                          '3He': 0.00000134,
    + 529                          'He': 0.99999866,
    + 530                          '6Li': 0.0759,
    + 531                          'Li': 0.9241,
    + 532                          'Be': 1.0,
    + 533                          '10B': 0.199,
    + 534                          'B': 0.801,
    + 535                          'C': 0.9893,
    + 536                          '13C': 0.0107,
    + 537                          '14C': 0,
    + 538                          'N': 0.99636,
    + 539                          '15N': 0.00364,
    + 540                          'O': 0.99757,
    + 541                          '17O': 0.00038,
    + 542                          '18O': 0.00205,
    + 543                          'F': 1.0,
    + 544                          'Ne': 0.9048,
    + 545                          '21Ne': 0.0027,
    + 546                          '22Ne': 0.0925,
    + 547                          'Na': 1.0,
    + 548                          'Mg': 0.7899,
    + 549                          '25Mg': 0.1000,
    + 550                          '26Mg': 0.1101,
    + 551                          'Al': 1.0,
    + 552                          'Si': 0.92223,
    + 553                          '29Si': 0.04685,
    + 554                          '30Si': 0.03092,
    + 555                          'P': 1.0,
    + 556                          'S': 0.9499,
    + 557                          '33S': 0.0075,
    + 558                          '34S': 0.0425,
    + 559                          '36S': 0.0001,
    + 560                          'Cl': 0.7576,
    + 561                          '37Cl': 0.2424,
    + 562                          '36Ar': 0.003336,
    + 563                          '38Ar': 0.000629,
    + 564                          'Ar': 0.996035,
    + 565                          'K': 0.932581,
    + 566                          '40K': 0.000117,
    + 567                          '41K': 0.067302,
    + 568                          'Ca': 0.96941,
    + 569                          '42Ca': 0.00647,
    + 570                          '43Ca': 0.00135,
    + 571                          '44Ca': 0.02086,
    + 572                          '46Ca': 0.00004,
    + 573                          '48Ca': 0.001872,
    + 574                          'Sc': 1.0,
    + 575                          '46Ti': 0.0825,
    + 576                          '47Ti': 0.0744,
    + 577                          'Ti': 0.7372,
    + 578                          '49Ti': 0.0541,
    + 579                          '50Ti': 0.0518,
    + 580                          '50V': 0.00250,
    + 581                          'V': 0.9975,
    + 582                          '50Cr': 0.04345,
    + 583                          'Cr': 0.83789,
    + 584                          '53Cr': 0.09501,
    + 585                          '54Cr': 0.02365,
    + 586                          'Mn': 1.0,
    + 587                          '54Fe': 0.05845,
    + 588                          'Fe': 0.91754,
    + 589                          '57Fe': 0.02119,
    + 590                          '58Fe': 0.00282,
    + 591                          'Co': 1.0,
    + 592                          'Ni': 0.68077,
    + 593                          '60Ni': 0.26223,
    + 594                          '61Ni': 0.011399,
    + 595                          '62Ni': 0.036346,
    + 596                          '64Ni': 0.009255,
    + 597                          'Cu': 0.6915,
    + 598                          '65Cu': 0.3085,
    + 599                          'Zn': 0.4917,
    + 600                          '66Zn': 0.2773,
    + 601                          '67Zn': 0.0404,
    + 602                          '68Zn': 0.1845,
    + 603                          '70Zn': 0.0061,
    + 604                          'Ga': 0.60108,
    + 605                          '71Ga': 0.39892,
    + 606                          '70Ge': 0.2057,
    + 607                          '72Ge': 0.2745,
    + 608                          '73Ge': 0.0775,
    + 609                          'Ge': 0.3650,
    + 610                          '76Ge': 0.0773,
    + 611                          'As': 1.0,
    + 612                          '74Se': 0.0089,
    + 613                          '76Se': 0.0937,
    + 614                          '77Se': 0.0763,
    + 615                          '78Se': 0.2377,
    + 616                          'Se': 0.4961,
    + 617                          '82Se': 0.0873,
    + 618                          'Br': 0.5069,
    + 619                          '81Br': 0.4931,
    + 620                          '78Kr': 0.00355,
    + 621                          '80Kr': 0.02286,
    + 622                          '82Kr': 0.11593,
    + 623                          '83Kr': 0.11500,
    + 624                          'Kr': 0.56987,
    + 625                          '86Kr': 0.17279,
    + 626                          'Rb': 0.7217,
    + 627                          '87Rb': 0.2783,
    + 628                          '84Sr': 0.0056,
    + 629                          '86Sr': 0.0986,
    + 630                          '87Sr': 0.0700,
    + 631                          'Sr': 0.8258,
    + 632                          'Y': 1.0,
    + 633                          'Zr': 0.5145,
    + 634                          '91Zr': 0.1122,
    + 635                          '92Zr': 0.1715,
    + 636                          '94Zr': 0.1738,
    + 637                          '96Zr': 0.0280,
    + 638                          'Nb': 1.0,
    + 639                          '92Mo': 0.1453,
    + 640                          '94Mo': 0.0915,
    + 641                          '95Mo': 0.1584,
    + 642                          '96Mo': 0.1667,
    + 643                          '97Mo': 0.0960,
    + 644                          'Mo': 0.2439,
    + 645                          '100Mo': 0.0982,
    + 646                          '99Tc': 0, #consider removing
    + 647                          '96Ru': 0.0554,
    + 648                          '98Ru': 0.0187,
    + 649                          '99Ru': 0.1276,
    + 650                          '100Ru': 0.1260,
    + 651                          '101Ru': 0.1706,
    + 652                          'Ru': 0.3155,
    + 653                          '104Ru': 0.1862,
    + 654                          'Rh': 1.0,
    + 655                          '102Pd': 0.0102,
    + 656                          '104Pd': 0.1114,
    + 657                          '105Pd': 0.2233,
    + 658                          'Pd': 0.2733,
    + 659                          '108Pd': 0.2646,
    + 660                          '110Pd': 0.1172,
    + 661                          'Ag': 0.51839,
    + 662                          '109Ag': 0.48161,
    + 663                          '106Cd': 0.0125,
    + 664                          '108Cd': 0.0089,
    + 665                          '110Cd': 0.1249,
    + 666                          '111Cd': 0.1280,
    + 667                          'Cd': 0.2413,
    + 668                          '113Cd': 0.1222,
    + 669                          '114Cd': 0.2873,
    + 670                          '116Cd': 0.0749,
    + 671                          '113In': 0.0429,
    + 672                          'In': 0.9571,
    + 673                          '112Sn': 0.0097,
    + 674                          '114Sn': 0.0066,
    + 675                          '115Sn': 0.0034,
    + 676                          '116Sn': 0.1454,
    + 677                          '117Sn': 0.0768,
    + 678                          '118Sn': 0.2422,
    + 679                          '119Sn': 0.0859,
    + 680                          'Sn': 0.3258,
    + 681                          '122Sn': 0.0463,
    + 682                          '124Sn': 0.0579,
    + 683                          'Sb': 0.5721,
    + 684                          '123Sb': 0.4279,
    + 685                          '120Te': 0.0009,
    + 686                          '122Te': 0.0255,
    + 687                          '123Te': 0.0089,
    + 688                          '124Te': 0.0474,
    + 689                          '125Te': 0.0707,
    + 690                          '126Te': 0.1884,
    + 691                          '128Te': 0.3174,
    + 692                          'Te': 0.3408,
    + 693                          'I': 1.0,
    + 694                          '124Xe': 0.000952,
    + 695                          '126Xe': 0.000890,
    + 696                          '128Xe': 0.019102,
    + 697                          '129Xe': 0.264006,
    + 698                          '130Xe': 0.040710,
    + 699                          '131Xe': 0.212324,
    + 700                          'Xe': 0.269086,
    + 701                          '134Xe': 0.104357,
    + 702                          '136Xe': 0.088573,
    + 703                          'Cs': 1.0,
    + 704                          '130Ba': 0.00106,
    + 705                          '132Ba': 0.00101,
    + 706                          '134Ba': 0.02417,
    + 707                          '135Ba': 0.06592,
    + 708                          '136Ba': 0.07854,
    + 709                          '137Ba': 0.11232,
    + 710                          'Ba': 0.71698,
    + 711                          '138La': 0.0008881,
    + 712                          'La': 0.9991119,
    + 713                          '136Ce': 0.00185,
    + 714                          '138Ce': 0.00251,
    + 715                          'Ce': 0.88450,
    + 716                          '142Ce': 0.11114,
    + 717                          'Pr': 1.0,
    + 718                          'Nd': 0.27152,
    + 719                          '143Nd': 0.12174,
    + 720                          '144Nd': 0.23798,
    + 721                          '145Nd': 0.08293,
    + 722                          '146Nd': 0.17189,
    + 723                          '148Nd': 0.05756,
    + 724                          '150Nd': 0.05638,
    + 725                          '145Pm': 0,
    + 726                          '147Pm': 0,
    + 727                          '144Sm': 0.0307,
    + 728                          '147Sm': 0.1499,
    + 729                          '148Sm': 0.1124,
    + 730                          '149Sm': 0.1382,
    + 731                          '150Sm': 0.0738,
    + 732                          'Sm': 0.2675,
    + 733                          '154Sm': 0.2275,
    + 734                          '151Eu': 0.4781,
    + 735                          'Eu': 0.5219,
    + 736                          '152Gd': 0.0020,
    + 737                          '154Gd': 0.0218,
    + 738                          '155Gd': 0.1480,
    + 739                          '156Gd': 0.2047,
    + 740                          '157Gd': 0.1565,
    + 741                          'Gd': 0.2484,
    + 742                          '160Gd': 0.2186,
    + 743                          'Tb': 1.0,
    + 744                          '156Dy': 0.00056,
    + 745                          '158Dy': 0.00095,
    + 746                          '160Dy': 0.02329,
    + 747                          '161Dy': 0.18889,
    + 748                          '162Dy': 0.25475,
    + 749                          '163Dy': 0.24896,
    + 750                          'Dy': 0.28260,
    + 751                          'Ho': 1.0,
    + 752                          '162Er': 0.00139,
    + 753                          '164Er': 0.01601,
    + 754                          'Er': 0.33503,
    + 755                          '167Er': 0.22869,
    + 756                          '168Er': 0.26978,
    + 757                          '170Er': 0.14910,
    + 758                          'Tm': 1.0,
    + 759                          '168Yb': 0.00123,
    + 760                          '170Yb': 0.02982,
    + 761                          '171Yb': 0.1409,
    + 762                          '172Yb': 0.2168,
    + 763                          '173Yb': 0.16103,
    + 764                          'Yb': 0.32026,
    + 765                          '176Yb': 0.12996,
    + 766                          'Lu': 0.97401,
    + 767                          '176Lu': 0.02599,
    + 768                          '174Hf': 0.0016,
    + 769                          '176Hf': 0.0526,
    + 770                          '177Hf': 0.1860,
    + 771                          '178Hf': 0.2728,
    + 772                          '179Hf': 0.1362,
    + 773                          'Hf': 0.3508,
    + 774                          '180Ta': 0.0001201,
    + 775                          'Ta': 0.9998799,
    + 776                          '180W': 0.0012,
    + 777                          '182W': 0.2650,
    + 778                          '183W': 0.1431,
    + 779                          'W': 0.3064,
    + 780                          '186W': 0.2843,
    + 781                          '185Re': 0.3740,
    + 782                          'Re': 0.6260,
    + 783                          '184Os': 0.0002,
    + 784                          '186Os': 0.0159,
    + 785                          '187Os': 0.0196,
    + 786                          '188Os': 0.1324,
    + 787                          '189Os': 0.1615,
    + 788                          '190Os': 0.2626,
    + 789                          'Os': 0.4078,
    + 790                          '191Ir': 0.373,
    + 791                          'Ir': 0.627,
    + 792                          '190Pt': 0.00012,
    + 793                          '192Pt': 0.00782,
    + 794                          '194Pt': 0.3286,
    + 795                          'Pt': 0.3378,
    + 796                          '196Pt': 0.2521,
    + 797                          '198Pt': 0.07356,
    + 798                          'Au': 1.0,
    + 799                          '196Hg': 0.0015,
    + 800                          '198Hg': 0.0997,
    + 801                          '199Hg': 0.16872,
    + 802                          '200Hg': 0.2310,
    + 803                          '201Hg': 0.1318,
    + 804                          'Hg': 0.2986,
    + 805                          '204Hg': 0.0687,
    + 806                          '203Tl': 0.2952,
    + 807                          'Tl': 0.7048,
    + 808                          '204Pb': 0.014,
    + 809                          '206Pb': 0.241,
    + 810                          '207Pb': 0.221,
    + 811                          'Pb': 0.524,
    + 812                          'Bi': 1.0,
    + 813                          '209Po': 0,
    + 814                          '210Po': 0,
    + 815                          '210At': 0,
    + 816                          '211At': 0,
    + 817                          '211Rn': 0,
    + 818                          '220Rn': 0,
    + 819                          '222Rn': 0,
    + 820                          '223Fr': 0,
    + 821                          '223Ra': 0,
    + 822                          '224Ra': 0,
    + 823                          '226Ra': 0,
    + 824                          '228Ra': 0,
    + 825                          '227Ac': 0,
    + 826                          '230Th': 0,
    + 827                          'Th': 1.0,
    + 828                          'Pa': 1.0,
    + 829                          '233U': 0,
    + 830                          '234U': 0.000054,
    + 831                          '235U': 0.007204,
    + 832                          '236U': 0,
    + 833                          'U': 0.992742,
    + 834                          '236Np': 0,
    + 835                          '237Np': 0,
    + 836                          '238Pu': 0,
    + 837                          '239Pu': 0,
    + 838                          '240Pu': 0,
    + 839                          '241Pu': 0,
    + 840                          '242Pu': 0,
    + 841                          '244Pu': 0,
    + 842                          '241Am': 0,
    + 843                          '243Am': 0,
    + 844                          '243Cm': 0,
    + 845                          '244Cm': 0,
    + 846                          '245Cm': 0,
    + 847                          '246Cm': 0,
    + 848                          '247Cm': 0,
    + 849                          '248Cm': 0,
    + 850                          '247Bk': 0,
    + 851                          '249Bk': 0,
    + 852                          '249Cf': 0,
    + 853                          '250Cf': 0,
    + 854                          '251Cf': 0,
    + 855                          '252Cf': 0,
    + 856                          '252Es': 0,
    + 857                          '257Fm': 0,
    + 858                          '258Md': 0,
    + 859                          '260Md': 0,
    + 860                          '259No': 0,
    + 861                          '262Lr': 0,
    + 862                          '267Rf': 0,
    + 863                          '268Db': 0,
    + 864                          '271Sg': 0,
    + 865                          '272Bh': 0,
    + 866                          '270Hs': 0,
    + 867                          '276Mt': 0,
    + 868                          '281Ds': 0,
    + 869                          '280Rg': 0,
    + 870                          '285Cn': 0,
    + 871                          '284Nh': 0,
    + 872                          '289Fl': 0,
    + 873                          '288Mc': 0,
    + 874                          '293Lv': 0,
    + 875                          '292Ts': 0,
    + 876                          '294Og': 0}
    + 877    
    + 878    # Isotopes here is a dictionary of symbol, including full name, 
    + 879    # and then the isotopes which arent the most abundant one, sorted by abundance.
    + 880    # None indicates no stable isotopes/naturally occuring ones. 
    + 881    # This has been manually checked as far as Iodine only.
    + 882    isotopes = {'H': ['Hydrogen', ['D','T']],
    + 883                'He': ['Helium', ['3He']],
    + 884                'Li': ['Lithium', ['6Li']],
    + 885                'Be': ['Beryllium', [None]],
    + 886                'B': ['Boron', ['10B']],
    + 887                'C': ['Carbon', ['13C']],
    + 888                'N': ['Nitrogen', ['15N']],
    + 889                'O': ['Oxygen', ['18O', '17O']],
    + 890                'F': ['Fluorine', [None]],
    + 891                'Ne': ['Neon', ['22Ne', '21Ne']],
    + 892
    + 893                'Na': ['Sodium', [None]],
    + 894                'Mg': ['Magnesium', ['26Mg', '25Mg']],
    + 895                'Al': ['Aluminum', [None]],
    + 896                'Si': ['Silicon', ['29Si', '30Si']],
    + 897                'P': ['Phosphorus', [None]],
    + 898                'S': ['Sulfur', ['34S','33S','36S']],
    + 899                'Cl': ['Chlorine', ['37Cl']],
    + 900                'Ar': ['Argon', ['36Ar','38Ar']],
    + 901                
    + 902                'K': ['Potassium', ['41K', '40K']],
    + 903                'Ca': ['Calcium', ['44Ca', '48Ca','43Ca','42Ca','46Ca']],
    + 904                'Sc': ['Scandium', [None]],
    + 905                'Ti': ['Titanium', ['46Ti', '47Ti', '49Ti', '50Ti']],
    + 906                'V': ['Vanadium', ['50V']],
    + 907                'Cr': ['Chromium', ['53Cr', '50Cr', '54Cr']],
    + 908                'Mn': ['Manganese', [None]],
    + 909                'Fe': ['Iron', ['54Fe', '57Fe', '58Fe']],
    + 910                'Co': ['Cobalt', [None]],
    + 911                'Ni': ['Nickel', ['60Ni', '62Ni', '61Ni','64Ni']],
    + 912                'Cu': ['Copper', ['65Cu']],
    + 913                'Zn': ['Zinc', ['66Zn', '68Zn', '67Zn', '70Zn']],
    + 914                'Ga': ['Gallium', ['71Ga']],
    + 915                'Ge': ['Germanium', ['72Ge', '70Ge', '73Ge', '76Ge']],
    + 916                'As': ['Arsenic', [None]],
    + 917                'Se': ['Selenium', ['78Se', '76Se', '82Se', '77Se','74Se']],
    + 918                'Br': ['Bromine', ['81Br']],
    + 919                'Kr': ['Krypton', ['86Kr', '82Kr', '83Kr', '80Kr']],
    + 920
    + 921                'Rb': ['Rubidium', ['87Rb']],
    + 922                'Sr': ['Strontium', ['86Sr', '87Sr','84Sr']],
    + 923                'Y': ['Yttrium', [None]],
    + 924                'Zr': ['Zirconium', ['94Zr', '92Zr', '91Zr', '96Zr']],
    + 925                'Nb': ['Niobium', [None]],
    + 926                'Mo': ['Molybdenum', ['96Mo', '95Mo', '92Mo', '100Mo', '97Mo', '94Mo']],
    + 927                'Tc': ['Technetium', [None]], #consider removing
    + 928                'Ru': ['Ruthenium', ['104Ru', '101Ru', '99Ru', '100Ru', '96Ru', '98Ru']],
    + 929                'Rh': ['Rhodium', [None]],
    + 930                'Pd': ['Palladium', ['108Pd', '105Pd', '110Pd', '104Pd', '102Pd']],
    + 931                'Ag': ['Silver', ['109Ag']],
    + 932                'Cd': ['Cadmium', ['114Cd', '111Cd', '110Cd', '113Cd', '116Cd', '106Cd', '108Cd']],
    + 933                'In': ['Indium', ['113In']],
    + 934                'Sn': ['Tin', ['118Sn', '116Sn', '119Sn', '117Sn', '124Sn', '122Sn', '112Sn','114Sn', '115Sn']],
    + 935                'Sb': ['Antimony', ['123Sb']],
    + 936                'Te': ['Tellurium', ['128Te', '126Te', '125Te', '124Te', '122Te','123Te','120Te']],
    + 937                'I': ['Iodine', [None]],
    + 938                'Xe': ['Xenon', ['129Xe','131Xe', '134Xe', '136Xe', '130Xe', '128Xe']],
    + 939
    + 940                'Cs': ['Cesium', [None]],
    + 941                'Ba': ['Barium', ['137Ba', '136Ba', '135Ba', '134Ba']],
    + 942                'La': ['Lanthanum',['138La']],
    + 943                'Hf': ['Hafnium', ['178Hf', '177Hf', '179Hf', '176Hf']],
    + 944                'Ta': ['Tantalum', ['180Ta']],
    + 945                'W': ['Tungsten', ['186W', '182W', '183W']],
    + 946                'Re': ['Rhenium', ['185Re']],
    + 947                'Os': ['Osmium', ['190Os', '189Os', '188Os', '187Os', '186Os']],
    + 948                'Ir': ['Iridium', ['191Ir']],
    + 949                'Pt': ['Platinum', ['194Pt', '196Pt', '198Pt', '192Pt']],
    + 950                'Au': ['Gold', [None]],
    + 951                'Hg': ['Mercury', ['200Hg', '199Hg', '201Hg', '198Hg', '204Hg']],
    + 952                'Tl': ['Thallium', ['203Tl']],
    + 953                'Pb': ['Lead', ['206Pb', '207Pb', '204Pb']],
    + 954                'Bi': ['Bismuth', [None]],
    + 955                'Po': ['Polonium', [None]],
    + 956                'At': ['Astatine', [None]],
    + 957                'Rn': ['Radon', [None]],
    + 958
    + 959                'Fr': ['Francium', [None]],
    + 960                'Ra': ['Radium', [None]],
    + 961                'Ac': ['Actinium', [None]],
    + 962                'Rf': ['Rutherfordium', [None]],
    + 963                'Db': ['Dubnium', [None]],
    + 964                'Sg': ['Seaborgium', [None]],
    + 965                'Bh': ['Bohrium', [None]],
    + 966                'Hs': ['Hassium', [None]],
    + 967                'Mt': ['Meitnerium', [None]],
    + 968                'Ds': ['Darmstadtium', [None]],
    + 969                'Rg': ['Roentgenium', [None]],
    + 970                'Cn': ['Copernicium', [None]],
    + 971                'Nh': ['Nihonium', [None]],
    + 972                'Fl': ['Flerovium', [None]],
    + 973                'Mc': ['Moscovium', [None]],
    + 974                'Lv': ['Livermorium', [None]],
    + 975                'Ts': ['Tennessine', [None]],
    + 976                'Og': ['Oganesson', [None]],
    + 977
    + 978                'Ce': ['Cerium', ['142Ce','138Ce''136Ce']],
    + 979                'Pr': ['Praseodymium', [None]],
    + 980                'Nd': ['Neodymium', [None]],
    + 981                'Pm': ['Promethium', [None]],
    + 982                'Sm': ['Samarium', [None]],
    + 983                'Eu': ['Europium', [None]],
    + 984                'Gd': ['Gadolinium', [None]],
    + 985                'Tb': ['Terbium', [None]],
    + 986                'Dy': ['Dysprosium', [None]],
    + 987                'Ho': ['Holmium', [None]],
    + 988                'Er': ['Erbium', [None]],
    + 989                'Tm': ['Thulium', [None]],
    + 990                'Yb': ['Ytterbium', [None]],
    + 991                'Lu': ['Lutetium', ['176Lu']],
    + 992
    + 993                'Th': ['Thorium', [None]],
    + 994                'Pa': ['Protactinium', [None]],
    + 995                'U': ['Uranium', ['235U','234U']],
    + 996                'Np': ['Neptunium', [None]],
    + 997                'Pu': ['Plutonium', [None]],
    + 998                'Am': ['Americium', [None]],
    + 999                'Cm': ['Curium', [None]],
    +1000                'Bk': ['Berkelium', [None]],
    +1001                'Cf': ['Californium', [None]],
    +1002                'Es': ['Einsteinium', [None]],
    +1003                'Fm': ['Fermium', [None]],
    +1004                'Md': ['Mendelevium', [None]],
    +1005                'No': ['Nobelium', [None]],
    +1006                'Lr': ['Lawrencium', [None]]
    +1007                }
     
    @@ -2342,6 +2488,10 @@

    This class includes key properties of atoms (and the electron) and isotopes, including their exact masses, relative abundances, and covalences. It also associates which isotopes are for the same element, and provides an ordering of elements.

    +

    IUPAC definition of monoisotopic mass is based on the most abundant isotopes of each element present. +Here, we will use atom symbols with isotope numbers for all isotopes excluding the most abundant one. +This list has been corrected up to Iodine.

    +

    References
      @@ -2367,7 +2517,7 @@
      References
      atomic_masses = - {'H': 1.00782503223, 'D': 2.01410177812, 'T': 3.0160492779, '3He': 3.0160293201, 'He': 4.00260325413, '6Li': 6.0151228874, '7Li': 7.0160034366, '9Be': 9.012183065, '10B': 10.01293695, '11B': 11.00930536, 'C': 12.0, '13C': 13.00335483507, '14C': 14.0032419884, 'N': 14.00307400443, '15N': 15.00010889888, 'O': 15.99491461957, '17O': 16.9991317565, '18O': 17.99915961286, 'F': 18.99840316273, '20Ne': 19.9924401762, '21Ne': 20.993846685, '22Ne': 21.991385114, 'Na': 22.989769282, '24Mg': 23.985041697, '25Mg': 24.985836976, '26Mg': 25.982592968, 'Al': 26.98153853, '28Si': 27.97692653465, '29Si': 28.9764946649, '30Si': 29.973770136, 'P': 30.97376199842, 'S': 31.9720711744, '33S': 32.9714589098, '34S': 33.967867004, '36S': 35.96708071, 'Cl': 34.968852682, '37Cl': 36.965902602, '36Ar': 35.967545105, '38Ar': 37.96273211, '40Ar': 39.9623831237, 'K': 38.9637064864, '40K': 39.963998166, '41K': 40.9618252579, 'Ca': 39.962590863, '42Ca': 41.95861783, '43Ca': 42.95876644, '44Ca': 43.95548156, '46Ca': 45.953689, '48Ca': 47.95252276, '45Sc': 44.95590828, '46Ti': 45.95262772, '47Ti': 46.95175879, '48Ti': 47.94794198, '49Ti': 48.94786568, '50Ti': 49.94478689, '50V': 49.94715601, 'V': 50.94395704, '50Cr': 49.94604183, 'Cr': 51.94050623, '53Cr': 52.94064815, '54Cr': 53.93887916, 'Mn': 54.93804391, '54Fe': 53.93960899, 'Fe': 55.93493633, '57Fe': 56.93539284, '58Fe': 57.93327443, 'Co': 58.93319429, 'Ni': 57.93534241, '60Ni': 59.93078588, '61Ni': 60.93105557, '62Ni': 61.92834537, '64Ni': 63.92796682, 'Cu': 62.92959772, '65Cu': 64.9277897, 'Zn': 63.92914201, '66Zn': 65.92603381, '67Zn': 66.92712775, '68Zn': 67.92484455, '70Zn': 69.9253192, '69Ga': 68.9255735, '71Ga': 70.92470258, '70Ge': 69.92424875, '72Ge': 71.922075826, '73Ge': 72.923458956, '74Ge': 73.921177761, '76Ge': 75.921402726, 'As': 74.92159457, '74Se': 73.922475934, '76Se': 75.919213704, '77Se': 76.919914154, '78Se': 77.91730928, 'Se': 79.9165218, '82Se': 81.9166995, 'Br': 78.9183376, '81Br': 80.9162897, '78Kr': 77.92036494, '80Kr': 79.91637808, '82Kr': 81.91348273, '83Kr': 82.91412716, '84Kr': 83.9114977282, '86Kr': 85.9106106269, '85Rb': 84.9117897379, '87Rb': 86.909180531, '84Sr': 83.9134191, '86Sr': 85.9092606, '87Sr': 86.9088775, '88Sr': 87.9056125, '89Y': 88.9058403, '90Zr': 89.9046977, '91Zr': 90.9056396, '92Zr': 91.9050347, '94Zr': 93.9063108, '96Zr': 95.9082714, '93Nb': 92.906373, '92Mo': 91.90680796, '94Mo': 93.9050849, '95Mo': 94.90583877, '96Mo': 95.90467612, '97Mo': 96.90601812, 'Mo': 97.90540482, '100Mo': 99.9074718, '97Tc': 96.9063667, '98Tc': 97.9072124, '99Tc': 98.9062508, '96Ru': 95.90759025, '98Ru': 97.9052868, '99Ru': 98.9059341, '100Ru': 99.9042143, '101Ru': 100.9055769, '102Ru': 101.9043441, '104Ru': 103.9054275, '103Rh': 102.905498, '102Pd': 101.9056022, '104Pd': 103.9040305, '105Pd': 104.9050796, '106Pd': 105.9034804, '108Pd': 107.9038916, '110Pd': 109.9051722, '107Ag': 106.9050916, '109Ag': 108.9047553, '106Cd': 105.9064599, '108Cd': 107.9041834, '110Cd': 109.90300661, '111Cd': 110.90418287, 'Cd': 111.90276287, '113Cd': 112.90440813, '114Cd': 113.90336509, '116Cd': 115.90476315, '113In': 112.90406184, 'In': 114.903878776, '112Sn': 111.90482387, '114Sn': 113.9027827, '115Sn': 114.903344699, '116Sn': 115.9017428, '117Sn': 116.90295398, '118Sn': 117.90160657, '119Sn': 118.90331117, '120Sn': 119.90220163, '122Sn': 121.9034438, '124Sn': 123.9052766, '121Sb': 120.903812, '123Sb': 122.9042132, '120Te': 119.9040593, '122Te': 121.9030435, '123Te': 122.9042698, '124Te': 123.9028171, '125Te': 124.9044299, '126Te': 125.9033109, '128Te': 127.90446128, '130Te': 129.906222748, 'I': 126.9044719, '124Xe': 123.905892, '126Xe': 125.9042983, '128Xe': 127.903531, '129Xe': 128.9047808611, '130Xe': 129.903509349, '131Xe': 130.90508406, '132Xe': 131.9041550856, '134Xe': 133.90539466, '136Xe': 135.907214484, '133Cs': 132.905451961, '130Ba': 129.9063207, '132Ba': 131.9050611, '134Ba': 133.90450818, '135Ba': 134.90568838, '136Ba': 135.90457573, '137Ba': 136.90582714, '138Ba': 137.905247, '138La': 137.9071149, '139La': 138.9063563, '136Ce': 135.90712921, '138Ce': 137.905991, '140Ce': 139.9054431, '142Ce': 141.9092504, '141Pr': 140.9076576, '142Nd': 141.907729, '143Nd': 142.90982, '144Nd': 143.910093, '145Nd': 144.9125793, '146Nd': 145.9131226, '148Nd': 147.9168993, '150Nd': 149.9209022, '145Pm': 144.9127559, '147Pm': 146.915145, '144Sm': 143.9120065, '147Sm': 146.9149044, '148Sm': 147.9148292, '149Sm': 148.9171921, '150Sm': 149.9172829, '152Sm': 151.9197397, '154Sm': 153.9222169, '151Eu': 150.9198578, '153Eu': 152.921238, '152Gd': 151.9197995, '154Gd': 153.9208741, '155Gd': 154.9226305, '156Gd': 155.9221312, '157Gd': 156.9239686, '158Gd': 157.9241123, '160Gd': 159.9270624, '159Tb': 158.9253547, '156Dy': 155.9242847, '158Dy': 157.9244159, '160Dy': 159.9252046, '161Dy': 160.9269405, '162Dy': 161.9268056, '163Dy': 162.9287383, '164Dy': 163.9291819, '165Ho': 164.9303288, '162Er': 161.9287884, '164Er': 163.9292088, '166Er': 165.9302995, '167Er': 166.9320546, '168Er': 167.9323767, '170Er': 169.9354702, '169Tm': 168.9342179, '168Yb': 167.9338896, '170Yb': 169.9347664, '171Yb': 170.9363302, '172Yb': 171.9363859, '173Yb': 172.9382151, '174Yb': 173.9388664, '176Yb': 175.9425764, '175Lu': 174.9407752, '176Lu': 175.9426897, '174Hf': 173.9400461, '176Hf': 175.9414076, '177Hf': 176.9432277, '178Hf': 177.9437058, '179Hf': 178.9458232, '180Hf': 179.946557, '180Ta': 179.9474648, '181Ta': 180.9479958, '180W': 179.9467108, '182W': 181.94820394, '183W': 182.95022275, '184W': 183.95093092, '186W': 185.9543628, '185Re': 184.9529545, '187Re': 186.9557501, '184Os': 183.9524885, '186Os': 185.953835, '187Os': 186.9557474, '188Os': 187.9558352, '189Os': 188.9581442, '190Os': 189.9584437, '192Os': 191.961477, '191Ir': 190.9605893, '193Ir': 192.9629216, '190Pt': 189.9599297, '192Pt': 191.9610387, '194Pt': 193.9626809, '195Pt': 194.9647917, '196Pt': 195.96495209, '198Pt': 197.9678949, '197Au': 196.96656879, '196Hg': 195.9658326, '198Hg': 197.9667686, '199Hg': 198.96828064, '200Hg': 199.96832659, '201Hg': 200.97030284, '202Hg': 201.9706434, '204Hg': 203.97349398, '203Tl': 202.9723446, '205Tl': 204.9744278, '204Pb': 203.973044, '206Pb': 205.9744657, '207Pb': 206.9758973, 'Pb': 207.9766525, '209Bi': 208.9803991, '209Po': 208.9824308, '210Po': 209.9828741, '210At': 209.9871479, '211At': 210.9874966, '211Rn': 210.9906011, '220Rn': 220.0113941, '222Rn': 222.0175782, '223Fr': 223.019736, '223Ra': 223.0185023, '224Ra': 224.020212, '226Ra': 226.0254103, '228Ra': 228.0310707, '227Ac': 227.0277523, '230Th': 230.0331341, '232Th': 232.0380558, '231Pa': 231.0358842, '233U': 233.0396355, '234U': 234.0409523, '235U': 235.0439301, '236U': 236.0455682, '238U': 238.0507884, '236Np': 236.04657, '237Np': 237.0481736, '238Pu': 238.0495601, '239Pu': 239.0521636, '240Pu': 240.0538138, '241Pu': 241.0568517, '242Pu': 242.0587428, '244Pu': 244.0642053, '241Am': 241.0568293, '243Am': 243.0613813, '243Cm': 243.0613893, '244Cm': 244.0627528, '245Cm': 245.0654915, '246Cm': 246.0672238, '247Cm': 247.0703541, '248Cm': 248.0723499, '247Bk': 247.0703073, '249Bk': 249.0749877, '249Cf': 249.0748539, '250Cf': 250.0764062, '251Cf': 251.0795886, '252Cf': 252.0816272, '252Es': 252.08298, '257Fm': 257.0951061, '258Md': 258.0984315, '260Md': 260.10365, '259No': 259.10103, '262Lr': 262.10961, '267Rf': 267.12179, '268Db': 268.12567, '271Sg': 271.13393, '272Bh': 272.13826, '270Hs': 270.13429, '276Mt': 276.15159, '281Ds': 281.16451, '280Rg': 280.16514, '285Cn': 285.17712, '284Nh': 284.17873, '289Fl': 289.19042, '288Mc': 288.19274, '293Lv': 293.20449, '292Ts': 292.20746, '294Og': 294.21392} + {'H': 1.00782503223, 'D': 2.01410177812, 'T': 3.0160492779, '3He': 3.0160293201, 'He': 4.00260325413, '6Li': 6.0151228874, 'Li': 7.0160034366, 'Be': 9.012183065, '10B': 10.01293695, 'B': 11.00930536, 'C': 12.0, '13C': 13.00335483507, '14C': 14.0032419884, 'N': 14.00307400443, '15N': 15.00010889888, 'O': 15.99491461957, '17O': 16.9991317565, '18O': 17.99915961286, 'F': 18.99840316273, 'Ne': 19.9924401762, '21Ne': 20.993846685, '22Ne': 21.991385114, 'Na': 22.989769282, 'Mg': 23.985041697, '25Mg': 24.985836976, '26Mg': 25.982592968, 'Al': 26.98153853, 'Si': 27.97692653465, '29Si': 28.9764946649, '30Si': 29.973770136, 'P': 30.97376199842, 'S': 31.9720711744, '33S': 32.9714589098, '34S': 33.967867004, '36S': 35.96708071, 'Cl': 34.968852682, '37Cl': 36.965902602, '36Ar': 35.967545105, '38Ar': 37.96273211, 'Ar': 39.9623831237, 'K': 38.9637064864, '40K': 39.963998166, '41K': 40.9618252579, 'Ca': 39.962590863, '42Ca': 41.95861783, '43Ca': 42.95876644, '44Ca': 43.95548156, '46Ca': 45.953689, '48Ca': 47.95252276, 'Sc': 44.95590828, '46Ti': 45.95262772, '47Ti': 46.95175879, 'Ti': 47.94794198, '49Ti': 48.94786568, '50Ti': 49.94478689, '50V': 49.94715601, 'V': 50.94395704, '50Cr': 49.94604183, 'Cr': 51.94050623, '53Cr': 52.94064815, '54Cr': 53.93887916, 'Mn': 54.93804391, '54Fe': 53.93960899, 'Fe': 55.93493633, '57Fe': 56.93539284, '58Fe': 57.93327443, 'Co': 58.93319429, 'Ni': 57.93534241, '60Ni': 59.93078588, '61Ni': 60.93105557, '62Ni': 61.92834537, '64Ni': 63.92796682, 'Cu': 62.92959772, '65Cu': 64.9277897, 'Zn': 63.92914201, '66Zn': 65.92603381, '67Zn': 66.92712775, '68Zn': 67.92484455, '70Zn': 69.9253192, 'Ga': 68.9255735, '71Ga': 70.92470258, '70Ge': 69.92424875, '72Ge': 71.922075826, '73Ge': 72.923458956, 'Ge': 73.921177761, '76Ge': 75.921402726, 'As': 74.92159457, '74Se': 73.922475934, '76Se': 75.919213704, '77Se': 76.919914154, '78Se': 77.91730928, 'Se': 79.9165218, '82Se': 81.9166995, 'Br': 78.9183376, '81Br': 80.9162897, '78Kr': 77.92036494, '80Kr': 79.91637808, '82Kr': 81.91348273, '83Kr': 82.91412716, 'Kr': 83.9114977282, '86Kr': 85.9106106269, 'Rb': 84.9117897379, '87Rb': 86.909180531, '84Sr': 83.9134191, '86Sr': 85.9092606, '87Sr': 86.9088775, 'Sr': 87.9056125, 'Y': 88.9058403, 'Zr': 89.9046977, '91Zr': 90.9056396, '92Zr': 91.9050347, '94Zr': 93.9063108, '96Zr': 95.9082714, 'Nb': 92.906373, '92Mo': 91.90680796, '94Mo': 93.9050849, '95Mo': 94.90583877, '96Mo': 95.90467612, '97Mo': 96.90601812, 'Mo': 97.90540482, '100Mo': 99.9074718, 'Tc': 98.9062508, '96Ru': 95.90759025, '98Ru': 97.9052868, '99Ru': 98.9059341, '100Ru': 99.9042143, '101Ru': 100.9055769, 'Ru': 101.9043441, '104Ru': 103.9054275, 'Rh': 102.905498, '102Pd': 101.9056022, '104Pd': 103.9040305, '105Pd': 104.9050796, 'Pd': 105.9034804, '108Pd': 107.9038916, '110Pd': 109.9051722, 'Ag': 106.9050916, '109Ag': 108.9047553, '106Cd': 105.9064599, '108Cd': 107.9041834, '110Cd': 109.90300661, '111Cd': 110.90418287, 'Cd': 111.90276287, '113Cd': 112.90440813, '114Cd': 113.90336509, '116Cd': 115.90476315, '113In': 112.90406184, 'In': 114.903878776, '112Sn': 111.90482387, '114Sn': 113.9027827, '115Sn': 114.903344699, '116Sn': 115.9017428, '117Sn': 116.90295398, '118Sn': 117.90160657, '119Sn': 118.90331117, 'Sn': 119.90220163, '122Sn': 121.9034438, '124Sn': 123.9052766, 'Sb': 120.903812, '123Sb': 122.9042132, '120Te': 119.9040593, '122Te': 121.9030435, '123Te': 122.9042698, '124Te': 123.9028171, '125Te': 124.9044299, '126Te': 125.9033109, '128Te': 127.90446128, 'Te': 129.906222748, 'I': 126.9044719, '124Xe': 123.905892, '126Xe': 125.9042983, '128Xe': 127.903531, '129Xe': 128.9047808611, '130Xe': 129.903509349, '131Xe': 130.90508406, 'Xe': 131.9041550856, '134Xe': 133.90539466, '136Xe': 135.907214484, 'Cs': 132.905451961, '130Ba': 129.9063207, '132Ba': 131.9050611, '134Ba': 133.90450818, '135Ba': 134.90568838, '136Ba': 135.90457573, '137Ba': 136.90582714, 'Ba': 137.905247, '138La': 137.9071149, 'La': 138.9063563, '136Ce': 135.90712921, '138Ce': 137.905991, 'Ce': 139.9054431, '142Ce': 141.9092504, 'Pr': 140.9076576, 'Nd': 141.907729, '143Nd': 142.90982, '144Nd': 143.910093, '145Nd': 144.9125793, '146Nd': 145.9131226, '148Nd': 147.9168993, '150Nd': 149.9209022, '145Pm': 144.9127559, '147Pm': 146.915145, '144Sm': 143.9120065, '147Sm': 146.9149044, '148Sm': 147.9148292, '149Sm': 148.9171921, '150Sm': 149.9172829, 'Sm': 151.9197397, '154Sm': 153.9222169, '151Eu': 150.9198578, 'Eu': 152.921238, '152Gd': 151.9197995, '154Gd': 153.9208741, '155Gd': 154.9226305, '156Gd': 155.9221312, '157Gd': 156.9239686, 'Gd': 157.9241123, '160Gd': 159.9270624, 'Tb': 158.9253547, '156Dy': 155.9242847, '158Dy': 157.9244159, '160Dy': 159.9252046, '161Dy': 160.9269405, '162Dy': 161.9268056, '163Dy': 162.9287383, 'Dy': 163.9291819, 'Ho': 164.9303288, '162Er': 161.9287884, '164Er': 163.9292088, 'Er': 165.9302995, '167Er': 166.9320546, '168Er': 167.9323767, '170Er': 169.9354702, 'Tm': 168.9342179, '168Yb': 167.9338896, '170Yb': 169.9347664, '171Yb': 170.9363302, '172Yb': 171.9363859, '173Yb': 172.9382151, 'Yb': 173.9388664, '176Yb': 175.9425764, 'Lu': 174.9407752, '176Lu': 175.9426897, '174Hf': 173.9400461, '176Hf': 175.9414076, '177Hf': 176.9432277, '178Hf': 177.9437058, '179Hf': 178.9458232, 'Hf': 179.946557, '180Ta': 179.9474648, 'Ta': 180.9479958, '180W': 179.9467108, '182W': 181.94820394, '183W': 182.95022275, 'W': 183.95093092, '186W': 185.9543628, '185Re': 184.9529545, 'Re': 186.9557501, '184Os': 183.9524885, '186Os': 185.953835, '187Os': 186.9557474, '188Os': 187.9558352, '189Os': 188.9581442, '190Os': 189.9584437, '192Os': 191.961477, '191Ir': 190.9605893, 'Ir': 192.9629216, '190Pt': 189.9599297, '192Pt': 191.9610387, '194Pt': 193.9626809, 'Pt': 194.9647917, '196Pt': 195.96495209, '198Pt': 197.9678949, 'Au': 196.96656879, '196Hg': 195.9658326, '198Hg': 197.9667686, '199Hg': 198.96828064, '200Hg': 199.96832659, '201Hg': 200.97030284, 'Hg': 201.9706434, '204Hg': 203.97349398, '203Tl': 202.9723446, 'Tl': 204.9744278, '204Pb': 203.973044, '206Pb': 205.9744657, '207Pb': 206.9758973, 'Pb': 207.9766525, 'Bi': 208.9803991, '209Po': 208.9824308, '210Po': 209.9828741, '210At': 209.9871479, '211At': 210.9874966, '211Rn': 210.9906011, '220Rn': 220.0113941, '222Rn': 222.0175782, '223Fr': 223.019736, '223Ra': 223.0185023, '224Ra': 224.020212, '226Ra': 226.0254103, '228Ra': 228.0310707, '227Ac': 227.0277523, '230Th': 230.0331341, 'Th': 232.0380558, 'Pa': 231.0358842, '233U': 233.0396355, '234U': 234.0409523, '235U': 235.0439301, '236U': 236.0455682, 'U': 238.0507884, '236Np': 236.04657, '237Np': 237.0481736, '238Pu': 238.0495601, '239Pu': 239.0521636, '240Pu': 240.0538138, '241Pu': 241.0568517, '242Pu': 242.0587428, '244Pu': 244.0642053, '241Am': 241.0568293, '243Am': 243.0613813, '243Cm': 243.0613893, '244Cm': 244.0627528, '245Cm': 245.0654915, '246Cm': 246.0672238, '247Cm': 247.0703541, '248Cm': 248.0723499, '247Bk': 247.0703073, '249Bk': 249.0749877, '249Cf': 249.0748539, '250Cf': 250.0764062, '251Cf': 251.0795886, '252Cf': 252.0816272, '252Es': 252.08298, '257Fm': 257.0951061, '258Md': 258.0984315, '260Md': 260.10365, '259No': 259.10103, '262Lr': 262.10961, '267Rf': 267.12179, '268Db': 268.12567, '271Sg': 271.13393, '272Bh': 272.13826, '270Hs': 270.13429, '276Mt': 276.15159, '281Ds': 281.16451, '280Rg': 280.16514, '285Cn': 285.17712, '284Nh': 284.17873, '289Fl': 289.19042, '288Mc': 288.19274, '293Lv': 293.20449, '292Ts': 292.20746, '294Og': 294.21392}
      @@ -2380,7 +2530,7 @@
      References
      atoms_order = - ['C', 'H', 'O', 'Cl', 'Na', 'S', 'N', '13C', '34S', '37Cl', 'Fe', 'Ca', 'P', 'V', 'I', 'Ac', 'Al', 'Ar', 'As', 'At', 'Au', 'Co', 'Cs', 'D', 'F', 'Fr', '18O', '17O', 'He', 'Po', 'Ra', 'Rh', 'Rn', 'Be', 'Bi', 'Nb, 54Fe', '57Fe', 'Ni', '60Ni', '61Ni', '62Ni', '10B', '11B', '6Li', '7Li', 'La', 'Mn', '107Ag', '109Ag', '100Mo', '100Ru', '101Ru', '102Pd', '102Ru', '104Pd', '104Ru', '105Pd', 'Cd', '106Cd', '106Pd', '108Cd', '108Pd', '110Cd', '110Pd', '111Cd', '112Cd', '112Sn', '113Cd', '113In', '114Cd', '114Sn', 'In', '115In', '115Sn', '116Cd', '116Sn', '117Sn', '118Sn', '119Sn', '120Sn', '120Te', '121Sb', '122Sn', '122Te', '123Sb', '123Te', '124Sn', '124Te', '124Xe', '125Te', '126Te', '126Xe', '128Te', '128Xe', '129Xe', '130Ba', '130Te', '130Xe', '131Xe', '132Ba', '132Xe', '134Ba', '134Xe', '135Ba', '136Ba', '136Xe', '137Ba', '138Ba', '15N', '174Hf', '176Hf', '177Hf', '178Hf', '179Hf', '180Hf', '180W', '182W', '183W', '184Os', '184W', '185Re', '186Os', '186W', '187Os', '187Re', '188Os', '189Os', '190Os', '190Pt', '191Ir', '192Ir', '192Os', '192Pt', '194Pt', '195Pt', '196Hg', '196Pt', '198Hg', '198Pt', '199Hg', '200Hg', '201Hg', '202Hg', '203Tl', '204Hg', '204Pb', '205Tl', '206Pb', '207Pb', '208Pb', 'Pb', '20Ne', '22Ne', '24Mg', '25Mg', '26Mg', '28Si', '29Si', '30Si', 'K', '40Ca', '41K', '44Ca', '46Ti', '47Ti', '48Ti', '49Ti', '50Cr', '50Ti', '50V', '51V', 'Cr', '52Cr', '53Cr', '54Cr', 'Cu', 'Zn', '65Cu', '66Zn', '67Zn', '68Zn', '69Ga', '70Ge', '71Ga', '72Ge', '73Ge', '74Ge', '76Ge', '76Se', '77Se', '78Se', 'Br', '81Br', '80Kr', 'Se', '82Kr', '82Se', '83Kr', '84Kr', '85Rb', '86Kr', '86Sr', '87Rb', '87Sr', '88Sr', '90Zr', '91Zr', '92Mo', '92Zr', '94Mo', '94Zr', '95Mo', '96Mo', '96Ru', '96Zr', '97Mo', 'Mo', '98Ru', '99Ru'] + ['C', 'H', 'O', 'N', 'P', 'S', 'F', 'Cl', 'Br', 'I', 'At', 'Li', 'Na', 'K', 'Rb', 'Cs', 'Fr', 'He', 'Ne', 'Ar', 'Kr', 'Xe', 'Rn', 'Be', 'B', 'Mg', 'Al', 'Si', 'Ca', 'Sc', 'Ti', 'V', 'Cr', 'Mn', 'Fe', 'Co', 'Ni', 'Cu', 'Zn', 'Ga', 'Ge', 'As', 'Se', 'Sr', 'Y', 'Zr', 'Nb', 'Mo', 'Tc', 'Ru', 'Rh', 'Pd', 'Ag', 'Cd', 'In', 'Sn', 'Sb', 'Te', 'Ba', 'La', 'Hf', 'Ta', 'W', 'Re', 'Os', 'Ir', 'Pt', 'Au', 'Hg', 'Tl', 'Pb', 'Bi', 'Po', 'Ra', 'Ac', 'Rf', 'Db', 'Sg', 'Bh', 'Hs', 'Mt', 'Ds', 'Rg', 'Cn', 'Nh', 'Fl', 'Mc', 'Lv', 'Ts', 'Og', 'Ce', 'Pr', 'Nd', 'Pm', 'Sm', 'Eu', 'Gd', 'Tb', 'Dy', 'Ho', 'Er', 'Tm', 'Yb', 'Lu', 'Th', 'Pa', 'U', 'Np', 'Pu', 'Am', 'Cm', 'Bk', 'Cf', 'Es', 'Fm', 'Md', 'No', 'Lr', 'D', '6Li', '10B', '13C', '15N', '17O', '18O', '22Ne', '25Mg', '26Mg', '29Si', '30Si', '33S', '34S', '36S', '37Cl', '40Ca', '41K', '44Ca', '46Ti', '47Ti', '49Ti', '50Cr', '50Ti', '50V', '53Cr', '54Cr', '54Fe', '57Fe', '58Fe', '60Ni', '61Ni', '62Ni', '65Cu', '66Zn', '67Zn', '68Zn', '70Ge', '71Ga', '72Ge', '73Ge', '76Ge', '76Se', '77Se', '78Se', '81Br', '80Kr', '82Kr', '82Se', '83Kr', '85Rb', '86Kr', '86Sr', '87Rb', '87Sr', '88Sr', '91Zr', '92Mo', '92Zr', '94Mo', '94Zr', '95Mo', '96Mo', '96Ru', '96Zr', '97Mo', '98Ru', '99Ru', '100Mo', '100Ru', '101Ru', '102Pd', '104Pd', '104Ru', '105Pd', '106Cd', '106Pd', '108Cd', '108Pd', '109Ag', '110Cd', '110Pd', '111Cd', '112Cd', '112Sn', '113Cd', '113In', '114Cd', '114Sn', '115In', '115Sn', '116Cd', '116Sn', '117Sn', '118Sn', '119Sn', '120Sn', '120Te', '121Sb', '122Sn', '122Te', '123Sb', '123Te', '124Sn', '124Te', '124Xe', '125Te', '126Te', '126Xe', '128Te', '128Xe', '129Xe', '130Ba', '130Te', '130Xe', '131Xe', '132Ba', '132Xe', '134Ba', '134Xe', '135Ba', '136Ba', '136Xe', '137Ba', '138Ba', '174Hf', '176Hf', '177Hf', '178Hf', '179Hf', '180Hf', '180W', '182W', '183W', '184Os', '184W', '185Re', '186Os', '186W', '187Os', '187Re', '188Os', '189Os', '190Os', '190Pt', '191Ir', '192Ir', '192Os', '192Pt', '194Pt', '195Pt', '196Hg', '196Pt', '198Hg', '198Pt', '199Hg', '200Hg', '201Hg', '202Hg', '203Tl', '204Hg', '204Pb', '205Tl', '206Pb', '207Pb', '208Pb']
      @@ -2406,7 +2556,7 @@
      References
      isotopic_abundance = - {'H': 0.999885, 'D': 0.000115, 'T': 0, '3He': 1.34e-06, 'He': 0.99999866, '6Li': 0.0759, 'Li': 0.9241, '9Be': 1.0, '10B': 0.199, '11B': 0.801, 'C': 0.9893, '13C': 0.0107, '14C': 0, 'N': 0.99636, '15N': 0.00364, 'O': 0.99757, '17O': 0.00038, '18O': 0.00205, 'F': 1.0, '20Ne': 0.9048, '21Ne': 0.0027, '22Ne': 0.0925, 'Na': 1.0, '24Mg': 0.7899, '25Mg': 0.1, '26Mg': 0.1101, 'Al': 1.0, '28Si': 0.92223, '29Si': 0.04685, '30Si': 0.03092, 'P': 1.0, 'S': 0.9499, '33S': 0.0075, '34S': 0.0425, '36S': 0.0001, 'Cl': 0.7576, '37Cl': 0.2424, '36Ar': 0.003336, '38Ar': 0.000629, '40Ar': 0.996035, 'K': 0.932581, '40K': 0.000117, '41K': 0.067302, 'Ca': 0.96941, '42Ca': 0.00647, '43Ca': 0.00135, '44Ca': 0.02086, '46Ca': 4e-05, '48Ca': 0.001872, '45Sc': 1.0, '46Ti': 0.0825, '47Ti': 0.0744, '48Ti': 0.7372, '49Ti': 0.0541, '50Ti': 0.0518, '50V': 0.0025, 'V': 0.9975, '50Cr': 0.04345, 'Cr': 0.83789, '53Cr': 0.09501, '54Cr': 0.02365, 'Mn': 1.0, '54Fe': 0.05845, 'Fe': 0.91754, '57Fe': 0.02119, '58Fe': 0.00282, 'Co': 1.0, 'Ni': 0.68077, '60Ni': 0.26223, '61Ni': 0.011399, '62Ni': 0.036346, '64Ni': 0.009255, 'Cu': 0.6915, '65Cu': 0.3085, 'Zn': 0.4917, '66Zn': 0.2773, '67Zn': 0.0404, '68Zn': 0.1845, '70Zn': 0.0061, '69Ga': 0.60108, '71Ga': 0.39892, '70Ge': 0.2057, '72Ge': 0.2745, '73Ge': 0.0775, '74Ge': 0.365, '76Ge': 0.0773, 'As': 1.0, '74Se': 0.0089, '76Se': 0.0937, '77Se': 0.0763, '78Se': 0.2377, 'Se': 0.4961, '82Se': 0.0873, 'Br': 0.5069, '81Br': 0.4931, '78Kr': 0.00355, '80Kr': 0.02286, '82Kr': 0.11593, '83Kr': 0.115, '84Kr': 0.56987, '86Kr': 0.17279, '85Rb': 0.7217, '87Rb': 0.2783, '84Sr': 0.0056, '86Sr': 0.0986, '87Sr': 0.07, '88Sr': 0.8258, '89Y': 1.0, '90Zr': 0.5145, '91Zr': 0.1122, '92Zr': 0.1715, '94Zr': 0.1738, '96Zr': 0.028, '93Nb': 1.0, '92Mo': 0.1453, '94Mo': 0.0915, '95Mo': 0.1584, '96Mo': 0.1667, '97Mo': 0.096, 'Mo': 0.2439, '100Mo': 0.0982, '97Tc': 0, '98Tc': 0, '99Tc': 0, '96Ru': 0.0554, '98Ru': 0.0187, '99Ru': 0.1276, '100Ru': 0.126, '101Ru': 0.1706, '102Ru': 0.3155, '104Ru': 0.1862, '103Rh': 1.0, '102Pd': 0.0102, '104Pd': 0.1114, '105Pd': 0.2233, '106Pd': 0.2733, '108Pd': 0.2646, '110Pd': 0.1172, '107Ag': 0.51839, '109Ag': 0.48161, '106Cd': 0.0125, '108Cd': 0.0089, '110Cd': 0.1249, '111Cd': 0.128, 'Cd': 0.2413, '113Cd': 0.1222, '114Cd': 0.2873, '116Cd': 0.0749, '113In': 0.0429, 'In': 0.9571, '112Sn': 0.0097, '114Sn': 0.0066, '115Sn': 0.0034, '116Sn': 0.1454, '117Sn': 0.0768, '118Sn': 0.2422, '119Sn': 0.0859, '120Sn': 0.3258, '122Sn': 0.0463, '124Sn': 0.0579, '121Sb': 0.5721, '123Sb': 0.4279, '120Te': 0.0009, '122Te': 0.0255, '123Te': 0.0089, '124Te': 0.0474, '125Te': 0.0707, '126Te': 0.1884, '128Te': 0.3174, '130Te': 0.3408, '127I': 1.0, 'I': 1.0, '124Xe': 0.000952, '126Xe': 0.00089, '128Xe': 0.019102, '129Xe': 0.264006, '130Xe': 0.04071, '131Xe': 0.212324, '132Xe': 0.269086, '134Xe': 0.104357, '136Xe': 0.088573, '133Cs': 1.0, '130Ba': 0.00106, '132Ba': 0.00101, '134Ba': 0.02417, '135Ba': 0.06592, '136Ba': 0.07854, '137Ba': 0.11232, '138Ba': 0.71698, '138La': 0.0008881, '139La': 0.9991119, '136Ce': 0.00185, '138Ce': 0.00251, '140Ce': 0.8845, '142Ce': 0.11114, '141Pr': 1.0, '142Nd': 0.27152, '143Nd': 0.12174, '144Nd': 0.23798, '145Nd': 0.08293, '146Nd': 0.17189, '148Nd': 0.05756, '150Nd': 0.05638, '145Pm': 0, '147Pm': 0, '144Sm': 0.0307, '147Sm': 0.1499, '148Sm': 0.1124, '149Sm': 0.1382, '150Sm': 0.0738, '152Sm': 0.2675, '154Sm': 0.2275, '151Eu': 0.4781, '153Eu': 0.5219, '152Gd': 0.002, '154Gd': 0.0218, '155Gd': 0.148, '156Gd': 0.2047, '157Gd': 0.1565, '158Gd': 0.2484, '160Gd': 0.2186, '159Tb': 1.0, '156Dy': 0.00056, '158Dy': 0.00095, '160Dy': 0.02329, '161Dy': 0.18889, '162Dy': 0.25475, '163Dy': 0.24896, '164Dy': 0.2826, '165Ho': 1.0, '162Er': 0.00139, '164Er': 0.01601, '166Er': 0.33503, '167Er': 0.22869, '168Er': 0.26978, '170Er': 0.1491, '169Tm': 1.0, '168Yb': 0.00123, '170Yb': 0.02982, '171Yb': 0.1409, '172Yb': 0.2168, '173Yb': 0.16103, '174Yb': 0.32026, '176Yb': 0.12996, '175Lu': 0.97401, '176Lu': 0.02599, '174Hf': 0.0016, '176Hf': 0.0526, '177Hf': 0.186, '178Hf': 0.2728, '179Hf': 0.1362, '180Hf': 0.3508, '180Ta': 0.0001201, '181Ta': 0.9998799, '180W': 0.0012, '182W': 0.265, '183W': 0.1431, '184W': 0.3064, '186W': 0.2843, '185Re': 0.374, '187Re': 0.626, '184Os': 0.0002, '186Os': 0.0159, '187Os': 0.0196, '188Os': 0.1324, '189Os': 0.1615, '190Os': 0.2626, '192Os': 0.4078, '191Ir': 0.373, '193Ir': 0.627, '190Pt': 0.00012, '192Pt': 0.00782, '194Pt': 0.3286, '195Pt': 0.3378, '196Pt': 0.2521, '198Pt': 0.07356, '197Au': 1.0, '196Hg': 0.0015, '198Hg': 0.0997, '199Hg': 0.16872, '200Hg': 0.231, '201Hg': 0.1318, '202Hg': 0.2986, '204Hg': 0.0687, '203Tl': 0.2952, '205Tl': 0.7048, '204Pb': 0.014, '206Pb': 0.241, '207Pb': 0.221, 'Pb': 0.524, '209Bi': 1.0, '209Po': 0, '210Po': 0, '210At': 0, '211At': 0, '211Rn': 0, '220Rn': 0, '222Rn': 0, '223Fr': 0, '223Ra': 0, '224Ra': 0, '226Ra': 0, '228Ra': 0, '227Ac': 0, '230Th': 0, '232Th': 1.0, '231Pa': 1.0, '233U': 0, '234U': 5.4e-05, '235U': 0.007204, '236U': 0, '238U': 0.992742, '236Np': 0, '237Np': 0, '238Pu': 0, '239Pu': 0, '240Pu': 0, '241Pu': 0, '242Pu': 0, '244Pu': 0, '241Am': 0, '243Am': 0, '243Cm': 0, '244Cm': 0, '245Cm': 0, '246Cm': 0, '247Cm': 0, '248Cm': 0, '247Bk': 0, '249Bk': 0, '249Cf': 0, '250Cf': 0, '251Cf': 0, '252Cf': 0, '252Es': 0, '257Fm': 0, '258Md': 0, '260Md': 0, '259No': 0, '262Lr': 0, '267Rf': 0, '268Db': 0, '271Sg': 0, '272Bh': 0, '270Hs': 0, '276Mt': 0, '281Ds': 0, '280Rg': 0, '285Cn': 0, '284Nh': 0, '289Fl': 0, '288Mc': 0, '293Lv': 0, '292Ts': 0, '294Og': 0} + {'H': 0.999885, 'D': 0.000115, 'T': 0, '3He': 1.34e-06, 'He': 0.99999866, '6Li': 0.0759, 'Li': 0.9241, 'Be': 1.0, '10B': 0.199, 'B': 0.801, 'C': 0.9893, '13C': 0.0107, '14C': 0, 'N': 0.99636, '15N': 0.00364, 'O': 0.99757, '17O': 0.00038, '18O': 0.00205, 'F': 1.0, 'Ne': 0.9048, '21Ne': 0.0027, '22Ne': 0.0925, 'Na': 1.0, 'Mg': 0.7899, '25Mg': 0.1, '26Mg': 0.1101, 'Al': 1.0, 'Si': 0.92223, '29Si': 0.04685, '30Si': 0.03092, 'P': 1.0, 'S': 0.9499, '33S': 0.0075, '34S': 0.0425, '36S': 0.0001, 'Cl': 0.7576, '37Cl': 0.2424, '36Ar': 0.003336, '38Ar': 0.000629, 'Ar': 0.996035, 'K': 0.932581, '40K': 0.000117, '41K': 0.067302, 'Ca': 0.96941, '42Ca': 0.00647, '43Ca': 0.00135, '44Ca': 0.02086, '46Ca': 4e-05, '48Ca': 0.001872, 'Sc': 1.0, '46Ti': 0.0825, '47Ti': 0.0744, 'Ti': 0.7372, '49Ti': 0.0541, '50Ti': 0.0518, '50V': 0.0025, 'V': 0.9975, '50Cr': 0.04345, 'Cr': 0.83789, '53Cr': 0.09501, '54Cr': 0.02365, 'Mn': 1.0, '54Fe': 0.05845, 'Fe': 0.91754, '57Fe': 0.02119, '58Fe': 0.00282, 'Co': 1.0, 'Ni': 0.68077, '60Ni': 0.26223, '61Ni': 0.011399, '62Ni': 0.036346, '64Ni': 0.009255, 'Cu': 0.6915, '65Cu': 0.3085, 'Zn': 0.4917, '66Zn': 0.2773, '67Zn': 0.0404, '68Zn': 0.1845, '70Zn': 0.0061, 'Ga': 0.60108, '71Ga': 0.39892, '70Ge': 0.2057, '72Ge': 0.2745, '73Ge': 0.0775, 'Ge': 0.365, '76Ge': 0.0773, 'As': 1.0, '74Se': 0.0089, '76Se': 0.0937, '77Se': 0.0763, '78Se': 0.2377, 'Se': 0.4961, '82Se': 0.0873, 'Br': 0.5069, '81Br': 0.4931, '78Kr': 0.00355, '80Kr': 0.02286, '82Kr': 0.11593, '83Kr': 0.115, 'Kr': 0.56987, '86Kr': 0.17279, 'Rb': 0.7217, '87Rb': 0.2783, '84Sr': 0.0056, '86Sr': 0.0986, '87Sr': 0.07, 'Sr': 0.8258, 'Y': 1.0, 'Zr': 0.5145, '91Zr': 0.1122, '92Zr': 0.1715, '94Zr': 0.1738, '96Zr': 0.028, 'Nb': 1.0, '92Mo': 0.1453, '94Mo': 0.0915, '95Mo': 0.1584, '96Mo': 0.1667, '97Mo': 0.096, 'Mo': 0.2439, '100Mo': 0.0982, '99Tc': 0, '96Ru': 0.0554, '98Ru': 0.0187, '99Ru': 0.1276, '100Ru': 0.126, '101Ru': 0.1706, 'Ru': 0.3155, '104Ru': 0.1862, 'Rh': 1.0, '102Pd': 0.0102, '104Pd': 0.1114, '105Pd': 0.2233, 'Pd': 0.2733, '108Pd': 0.2646, '110Pd': 0.1172, 'Ag': 0.51839, '109Ag': 0.48161, '106Cd': 0.0125, '108Cd': 0.0089, '110Cd': 0.1249, '111Cd': 0.128, 'Cd': 0.2413, '113Cd': 0.1222, '114Cd': 0.2873, '116Cd': 0.0749, '113In': 0.0429, 'In': 0.9571, '112Sn': 0.0097, '114Sn': 0.0066, '115Sn': 0.0034, '116Sn': 0.1454, '117Sn': 0.0768, '118Sn': 0.2422, '119Sn': 0.0859, 'Sn': 0.3258, '122Sn': 0.0463, '124Sn': 0.0579, 'Sb': 0.5721, '123Sb': 0.4279, '120Te': 0.0009, '122Te': 0.0255, '123Te': 0.0089, '124Te': 0.0474, '125Te': 0.0707, '126Te': 0.1884, '128Te': 0.3174, 'Te': 0.3408, 'I': 1.0, '124Xe': 0.000952, '126Xe': 0.00089, '128Xe': 0.019102, '129Xe': 0.264006, '130Xe': 0.04071, '131Xe': 0.212324, 'Xe': 0.269086, '134Xe': 0.104357, '136Xe': 0.088573, 'Cs': 1.0, '130Ba': 0.00106, '132Ba': 0.00101, '134Ba': 0.02417, '135Ba': 0.06592, '136Ba': 0.07854, '137Ba': 0.11232, 'Ba': 0.71698, '138La': 0.0008881, 'La': 0.9991119, '136Ce': 0.00185, '138Ce': 0.00251, 'Ce': 0.8845, '142Ce': 0.11114, 'Pr': 1.0, 'Nd': 0.27152, '143Nd': 0.12174, '144Nd': 0.23798, '145Nd': 0.08293, '146Nd': 0.17189, '148Nd': 0.05756, '150Nd': 0.05638, '145Pm': 0, '147Pm': 0, '144Sm': 0.0307, '147Sm': 0.1499, '148Sm': 0.1124, '149Sm': 0.1382, '150Sm': 0.0738, 'Sm': 0.2675, '154Sm': 0.2275, '151Eu': 0.4781, 'Eu': 0.5219, '152Gd': 0.002, '154Gd': 0.0218, '155Gd': 0.148, '156Gd': 0.2047, '157Gd': 0.1565, 'Gd': 0.2484, '160Gd': 0.2186, 'Tb': 1.0, '156Dy': 0.00056, '158Dy': 0.00095, '160Dy': 0.02329, '161Dy': 0.18889, '162Dy': 0.25475, '163Dy': 0.24896, 'Dy': 0.2826, 'Ho': 1.0, '162Er': 0.00139, '164Er': 0.01601, 'Er': 0.33503, '167Er': 0.22869, '168Er': 0.26978, '170Er': 0.1491, 'Tm': 1.0, '168Yb': 0.00123, '170Yb': 0.02982, '171Yb': 0.1409, '172Yb': 0.2168, '173Yb': 0.16103, 'Yb': 0.32026, '176Yb': 0.12996, 'Lu': 0.97401, '176Lu': 0.02599, '174Hf': 0.0016, '176Hf': 0.0526, '177Hf': 0.186, '178Hf': 0.2728, '179Hf': 0.1362, 'Hf': 0.3508, '180Ta': 0.0001201, 'Ta': 0.9998799, '180W': 0.0012, '182W': 0.265, '183W': 0.1431, 'W': 0.3064, '186W': 0.2843, '185Re': 0.374, 'Re': 0.626, '184Os': 0.0002, '186Os': 0.0159, '187Os': 0.0196, '188Os': 0.1324, '189Os': 0.1615, '190Os': 0.2626, 'Os': 0.4078, '191Ir': 0.373, 'Ir': 0.627, '190Pt': 0.00012, '192Pt': 0.00782, '194Pt': 0.3286, 'Pt': 0.3378, '196Pt': 0.2521, '198Pt': 0.07356, 'Au': 1.0, '196Hg': 0.0015, '198Hg': 0.0997, '199Hg': 0.16872, '200Hg': 0.231, '201Hg': 0.1318, 'Hg': 0.2986, '204Hg': 0.0687, '203Tl': 0.2952, 'Tl': 0.7048, '204Pb': 0.014, '206Pb': 0.241, '207Pb': 0.221, 'Pb': 0.524, 'Bi': 1.0, '209Po': 0, '210Po': 0, '210At': 0, '211At': 0, '211Rn': 0, '220Rn': 0, '222Rn': 0, '223Fr': 0, '223Ra': 0, '224Ra': 0, '226Ra': 0, '228Ra': 0, '227Ac': 0, '230Th': 0, 'Th': 1.0, 'Pa': 1.0, '233U': 0, '234U': 5.4e-05, '235U': 0.007204, '236U': 0, 'U': 0.992742, '236Np': 0, '237Np': 0, '238Pu': 0, '239Pu': 0, '240Pu': 0, '241Pu': 0, '242Pu': 0, '244Pu': 0, '241Am': 0, '243Am': 0, '243Cm': 0, '244Cm': 0, '245Cm': 0, '246Cm': 0, '247Cm': 0, '248Cm': 0, '247Bk': 0, '249Bk': 0, '249Cf': 0, '250Cf': 0, '251Cf': 0, '252Cf': 0, '252Es': 0, '257Fm': 0, '258Md': 0, '260Md': 0, '259No': 0, '262Lr': 0, '267Rf': 0, '268Db': 0, '271Sg': 0, '272Bh': 0, '270Hs': 0, '276Mt': 0, '281Ds': 0, '280Rg': 0, '285Cn': 0, '284Nh': 0, '289Fl': 0, '288Mc': 0, '293Lv': 0, '292Ts': 0, '294Og': 0}
      @@ -2419,7 +2569,7 @@
      References
      isotopes = - {'F': ['Flourine'], 'Na': ['Sodium'], 'Al': ['Aluminum'], 'P': ['Phosphorus'], 'Sc': ['Scandium'], 'Co': ['Cobalt'], 'He': ['Helium'], 'Ar': ['Argon'], 'H': ['Hydrogen', ['D']], 'Cl': ['Chlorine', ['37Cl']], 'Li': ['Lithium', ['6Li']], 'Be': ['Beryllium'], 'B': ['Boron', ['11B']], 'C': ['Carbon', ['13C']], 'O': ['Oxygen', ['18O', '17O']], 'S': ['Sulfur', ['34S']], 'N': ['Nitrogen', ['15N']], 'V': ['Vanadium', ['50V']], 'Ne': ['Neon', ['20Ne', '22Ne']], 'Mg': ['Magnesium', ['24Mg', '26Mg', '25Mg']], 'Si': ['Silicon', ['28Si', '29Si', '30Si']], 'K': ['Potassium', ['40K', '41K']], 'Ca': ['Calcium', ['43Ca', '44Ca']], 'Ti': ['Titanium', ['48Ti', '46Ti', '47Ti', '49Ti', '50Ti']], 'Cr': ['Chromium', ['53Cr', '50Cr', '54Cr']], 'Fe': ['Iron', ['54Fe', '57Fe', '58Fe']], 'Mn': ['Manganese'], 'Ni': ['Nickel', ['60Ni', '62Ni', '61Ni']], 'Cu': ['Copper', ['65Cu']], 'Zn': ['Zinc', ['66Zn', '68Zn', '67Zn', '70Zn']], 'Ga': ['Gallium', ['69Ga', '71Ga']], 'Ge': ['Germanium', ['74Ge', '72Ge', '70Ge', '73Ge', '76Ge']], 'As': ['Arsenic'], 'Se': ['Selenium', ['78Se', '76Se', '82Se', '77Se']], 'Br': ['Bromine', ['81Br']], 'Kr': ['Krypton', ['84Kr', '86Kr', '82Kr', '83Kr', '80Kr']], 'Rb': ['Rubidium', ['85Rb', '87Rb']], 'Sr': ['Strontium', ['88Sr', '86Sr', '87Sr']], 'Y': ['Yttrium'], 'Zr': ['Zironium', ['90Zr', '94Zr', '92Zr', '91Zr', '96Zr']], 'Nb': ['Niobium'], 'Mo': ['Molybdenum', ['96Mo', '95Mo', '92Mo', '100Mo', '97Mo', '94Mo']], 'Tc': ['Technetium'], 'Ru': ['Ruthenium', ['102Ru', '104Ru', '101Ru', '99Ru', '100Ru', '96Ru', '98Ru']], 'Rh': ['Rhodium'], 'Pd': ['Palladium', ['106Pd', '108Pd', '105Pd', '110Pd', '104Pd', '102Pd']], 'Ag': ['Silver', ['107Ag', '109Ag']], 'Cd': ['Cadmium', ['114Cd', '111Cd', '110Cd', '113Cd', '116Cd', '106Cd', '108Cd']], 'In': ['Indium', ['113In']], 'Sn': ['Tin', ['120Sn', '118Sn', '116Sn', '119Sn', '117Sn', '124Sn', '122Sn', '112Sn']], 'Sb': ['Antimony', ['121Sb', '123Sb']], 'Te': ['Tellurium', ['130Te', '128Te', '126Te', '125Te', '124Te', '122Te']], 'I': ['Iodine'], 'Xe': ['Xenon', ['132Xe', '129Xe', '131Xe', '134Xe', '136Xe', '130Xe', '128Xe']], 'Cs': ['Cesium'], 'Ba': ['Barium', ['138Ba', '137Ba', '136Ba', '135Ba', '134Ba']], 'La': ['Lanthanum'], 'Hf': ['Hafnium', ['180Hf', '178Hf', '177Hf', '179Hf', '176Hf']], 'Ta': ['Tantalum'], 'W': ['Tungsten', ['184W', '186W', '182W', '183W']], 'Re': ['Rhenium', ['187Re', '185Re']], 'Os': ['Osmium', ['192Os', '190Os', '189Os', '188Os', '187Os', '186Os']], 'Ir': ['Iridium', ['193Ir', '191Ir']], 'Pt': ['Platinum', ['195Pt', '194Pt', '196Pt', '198Pt', '192Pt']], 'Au': ['Gold'], 'Hg': ['Mercury', ['202Hg', '200Hg', '199Hg', '201Hg', '198Hg', '204Hg']], 'Tl': ['Thallium', ['205Tl', '203Tl']], 'Pb': ['Lead', ['206Pb', '207Pb', '204Pb']], 'Bi': ['Bismuth'], 'Po': ['Polonium'], 'At': ['Aslatine'], 'Rn': ['Radon'], 'Fr': ['Francium'], 'Ra': ['Radium'], 'Ac': ['Actinium']} + {'H': ['Hydrogen', ['D', 'T']], 'He': ['Helium', ['3He']], 'Li': ['Lithium', ['6Li']], 'Be': ['Beryllium', [None]], 'B': ['Boron', ['10B']], 'C': ['Carbon', ['13C']], 'N': ['Nitrogen', ['15N']], 'O': ['Oxygen', ['18O', '17O']], 'F': ['Fluorine', [None]], 'Ne': ['Neon', ['22Ne', '21Ne']], 'Na': ['Sodium', [None]], 'Mg': ['Magnesium', ['26Mg', '25Mg']], 'Al': ['Aluminum', [None]], 'Si': ['Silicon', ['29Si', '30Si']], 'P': ['Phosphorus', [None]], 'S': ['Sulfur', ['34S', '33S', '36S']], 'Cl': ['Chlorine', ['37Cl']], 'Ar': ['Argon', ['36Ar', '38Ar']], 'K': ['Potassium', ['41K', '40K']], 'Ca': ['Calcium', ['44Ca', '48Ca', '43Ca', '42Ca', '46Ca']], 'Sc': ['Scandium', [None]], 'Ti': ['Titanium', ['46Ti', '47Ti', '49Ti', '50Ti']], 'V': ['Vanadium', ['50V']], 'Cr': ['Chromium', ['53Cr', '50Cr', '54Cr']], 'Mn': ['Manganese', [None]], 'Fe': ['Iron', ['54Fe', '57Fe', '58Fe']], 'Co': ['Cobalt', [None]], 'Ni': ['Nickel', ['60Ni', '62Ni', '61Ni', '64Ni']], 'Cu': ['Copper', ['65Cu']], 'Zn': ['Zinc', ['66Zn', '68Zn', '67Zn', '70Zn']], 'Ga': ['Gallium', ['71Ga']], 'Ge': ['Germanium', ['72Ge', '70Ge', '73Ge', '76Ge']], 'As': ['Arsenic', [None]], 'Se': ['Selenium', ['78Se', '76Se', '82Se', '77Se', '74Se']], 'Br': ['Bromine', ['81Br']], 'Kr': ['Krypton', ['86Kr', '82Kr', '83Kr', '80Kr']], 'Rb': ['Rubidium', ['87Rb']], 'Sr': ['Strontium', ['86Sr', '87Sr', '84Sr']], 'Y': ['Yttrium', [None]], 'Zr': ['Zirconium', ['94Zr', '92Zr', '91Zr', '96Zr']], 'Nb': ['Niobium', [None]], 'Mo': ['Molybdenum', ['96Mo', '95Mo', '92Mo', '100Mo', '97Mo', '94Mo']], 'Tc': ['Technetium', [None]], 'Ru': ['Ruthenium', ['104Ru', '101Ru', '99Ru', '100Ru', '96Ru', '98Ru']], 'Rh': ['Rhodium', [None]], 'Pd': ['Palladium', ['108Pd', '105Pd', '110Pd', '104Pd', '102Pd']], 'Ag': ['Silver', ['109Ag']], 'Cd': ['Cadmium', ['114Cd', '111Cd', '110Cd', '113Cd', '116Cd', '106Cd', '108Cd']], 'In': ['Indium', ['113In']], 'Sn': ['Tin', ['118Sn', '116Sn', '119Sn', '117Sn', '124Sn', '122Sn', '112Sn', '114Sn', '115Sn']], 'Sb': ['Antimony', ['123Sb']], 'Te': ['Tellurium', ['128Te', '126Te', '125Te', '124Te', '122Te', '123Te', '120Te']], 'I': ['Iodine', [None]], 'Xe': ['Xenon', ['129Xe', '131Xe', '134Xe', '136Xe', '130Xe', '128Xe']], 'Cs': ['Cesium', [None]], 'Ba': ['Barium', ['137Ba', '136Ba', '135Ba', '134Ba']], 'La': ['Lanthanum', ['138La']], 'Hf': ['Hafnium', ['178Hf', '177Hf', '179Hf', '176Hf']], 'Ta': ['Tantalum', ['180Ta']], 'W': ['Tungsten', ['186W', '182W', '183W']], 'Re': ['Rhenium', ['185Re']], 'Os': ['Osmium', ['190Os', '189Os', '188Os', '187Os', '186Os']], 'Ir': ['Iridium', ['191Ir']], 'Pt': ['Platinum', ['194Pt', '196Pt', '198Pt', '192Pt']], 'Au': ['Gold', [None]], 'Hg': ['Mercury', ['200Hg', '199Hg', '201Hg', '198Hg', '204Hg']], 'Tl': ['Thallium', ['203Tl']], 'Pb': ['Lead', ['206Pb', '207Pb', '204Pb']], 'Bi': ['Bismuth', [None]], 'Po': ['Polonium', [None]], 'At': ['Astatine', [None]], 'Rn': ['Radon', [None]], 'Fr': ['Francium', [None]], 'Ra': ['Radium', [None]], 'Ac': ['Actinium', [None]], 'Rf': ['Rutherfordium', [None]], 'Db': ['Dubnium', [None]], 'Sg': ['Seaborgium', [None]], 'Bh': ['Bohrium', [None]], 'Hs': ['Hassium', [None]], 'Mt': ['Meitnerium', [None]], 'Ds': ['Darmstadtium', [None]], 'Rg': ['Roentgenium', [None]], 'Cn': ['Copernicium', [None]], 'Nh': ['Nihonium', [None]], 'Fl': ['Flerovium', [None]], 'Mc': ['Moscovium', [None]], 'Lv': ['Livermorium', [None]], 'Ts': ['Tennessine', [None]], 'Og': ['Oganesson', [None]], 'Ce': ['Cerium', ['142Ce', '138Ce136Ce']], 'Pr': ['Praseodymium', [None]], 'Nd': ['Neodymium', [None]], 'Pm': ['Promethium', [None]], 'Sm': ['Samarium', [None]], 'Eu': ['Europium', [None]], 'Gd': ['Gadolinium', [None]], 'Tb': ['Terbium', [None]], 'Dy': ['Dysprosium', [None]], 'Ho': ['Holmium', [None]], 'Er': ['Erbium', [None]], 'Tm': ['Thulium', [None]], 'Yb': ['Ytterbium', [None]], 'Lu': ['Lutetium', ['176Lu']], 'Th': ['Thorium', [None]], 'Pa': ['Protactinium', [None]], 'U': ['Uranium', ['235U', '234U']], 'Np': ['Neptunium', [None]], 'Pu': ['Plutonium', [None]], 'Am': ['Americium', [None]], 'Cm': ['Curium', [None]], 'Bk': ['Berkelium', [None]], 'Cf': ['Californium', [None]], 'Es': ['Einsteinium', [None]], 'Fm': ['Fermium', [None]], 'Md': ['Mendelevium', [None]], 'No': ['Nobelium', [None]], 'Lr': ['Lawrencium', [None]]}
      diff --git a/docs/corems/encapsulation/factory/parameters.html b/docs/corems/encapsulation/factory/parameters.html index 3de3a5aa..6186bf2d 100644 --- a/docs/corems/encapsulation/factory/parameters.html +++ b/docs/corems/encapsulation/factory/parameters.html @@ -304,7 +304,7 @@
      Attributes
      molecular_search = - MolecularFormulaSearchSettings(use_isotopologue_filter=False, isotopologue_filter_threshold=33.0, isotopologue_filter_atoms=('Cl', 'Br'), use_runtime_kendrick_filter=False, use_min_peaks_filter=True, min_peaks_per_class=15, url_database='postgresql+psycopg2://coremsappdb:coremsapppnnl@molformdb:5432/coremsapp', db_jobs=3, db_chunk_size=300, ion_charge=-1, min_hc_filter=0.3, max_hc_filter=3.0, min_oc_filter=0.0, max_oc_filter=1.2, min_op_filter=2.0, use_pah_line_rule=False, min_dbe=0.0, max_dbe=40.0, mz_error_score_weight=0.6, isotopologue_score_weight=0.4, adduct_atoms_neg=('Cl', 'Br'), adduct_atoms_pos=('Na', 'K'), score_methods=('S_P_lowest_error', 'N_S_P_lowest_error', 'lowest_error', 'prob_score', 'air_filter_error', 'water_filter_error', 'earth_filter_error'), score_method='prob_score', output_min_score=0.1, output_score_method='All Candidates', isRadical=False, isProtonated=True, isAdduct=False, usedAtoms={'C': (1, 100), 'H': (1, 200)}, ionization_type='ESI', min_ppm_error=-10.0, max_ppm_error=10.0, min_abun_error=-100.0, max_abun_error=100.0, mz_error_range=1.5, error_method='None', mz_error_average=0.0, used_atom_valences={'C': 4, '13C': 4, 'N': 3, 'O': 2, 'S': 2, 'H': 1, 'F': (1, 0), 'Cl': (1, 0), 'Br': (1, 0), 'I': (1, 0), 'At': 1, 'Li': (1, 0), 'Na': (1, 0), 'K': (1, 0), 'Rb': 1, 'Cs': 1, 'Fr': 1, 'B': (4, 3, 2, 1), 'In': (3, 2, 1), 'Al': (3, 1, 2), 'P': (3, 5, 4, 2, 1), 'Ga': (3, 1, 2), 'Mg': (2, 1), 'Be': (2, 1), 'Ca': (2, 1), 'Sr': (2, 1), 'Ba': 2, 'Ra': 2, 'V': (5, 4, 3, 2, 1), 'Fe': (3, 2, 4, 5, 6), 'Si': (4, 3, 2), 'Sc': (3, 2, 1), 'Ti': (4, 3, 2, 1), 'Cr': (1, 2, 3, 4, 5, 6), 'Mn': (1, 2, 3, 4, 5, 6, 7), 'Co': (1, 2, 3, 4, 5), 'Ni': (1, 2, 3, 4), 'Cu': (2, 1, 3, 4), 'Zn': (2, 1), 'Ge': (4, 3, 2, 1), 'As': (5, 3, 2, 1), 'Se': (6, 4, 2, 1), 'Y': (3, 2, 1), 'Zr': (4, 3, 2, 1), 'Nb': (5, 4, 3, 2, 1), 'Mo': (6, 5, 4, 3, 2, 1), 'Tc': (7, 6, 5, 4, 3, 2, 1), 'Ru': (8, 7, 6, 5, 4, 3, 2, 1), 'Rh': (6, 5, 4, 3, 2, 1), 'Pd': (4, 2, 1), 'Ag': (0, 1, 2, 3, 4), 'Cd': (2, 1), 'Sn': (4, 2), 'Sb': (5, 3), 'Te': (6, 5, 4, 2), 'La': (3, 2), 'Hf': (4, 3, 2), 'Ta': (5, 4, 3, 2), 'W': (6, 5, 4, 3, 2, 1), 'Re': (4, 7, 6, 5, 3, 2, 1), 'Os': (4, 8, 7, 6, 5, 3, 2, 1), 'Ir': (4, 8, 6, 5, 3, 2, 1), 'Pt': (4, 6, 5, 3, 2, 1), 'Au': (3, 5, 2, 1), 'Hg': (1, 2, 4), 'Tl': (3, 1), 'Pb': (4, 2), 'Bi': (3, 1, 5), 'Po': (2, 4, 6), 'Ac': (3, 2)}) + MolecularFormulaSearchSettings(use_isotopologue_filter=False, isotopologue_filter_threshold=33.0, isotopologue_filter_atoms=('Cl', 'Br'), use_runtime_kendrick_filter=False, use_min_peaks_filter=True, min_peaks_per_class=15, url_database='postgresql+psycopg2://coremsappdb:coremsapppnnl@molformdb:5432/coremsapp', db_jobs=3, db_chunk_size=300, ion_charge=-1, min_hc_filter=0.3, max_hc_filter=3.0, min_oc_filter=0.0, max_oc_filter=1.2, min_op_filter=2.0, use_pah_line_rule=False, min_dbe=0.0, max_dbe=40.0, mz_error_score_weight=0.6, isotopologue_score_weight=0.4, adduct_atoms_neg=('Cl', 'Br'), adduct_atoms_pos=('Na', 'K'), score_methods=('S_P_lowest_error', 'N_S_P_lowest_error', 'lowest_error', 'prob_score', 'air_filter_error', 'water_filter_error', 'earth_filter_error'), score_method='prob_score', output_min_score=0.1, output_score_method='All Candidates', isRadical=False, isProtonated=True, isAdduct=False, usedAtoms={'C': (1, 100), 'H': (1, 200)}, ionization_type='ESI', min_ppm_error=-10.0, max_ppm_error=10.0, min_abun_error=-100.0, max_abun_error=100.0, mz_error_range=1.5, error_method='None', mz_error_average=0.0, used_atom_valences={'C': 4, '13C': 4, 'N': 3, 'O': 2, 'S': 2, 'H': 1, 'F': 1, 'Cl': 1, 'Br': 1, 'I': 1, 'At': 1, 'Li': 1, 'Na': 1, 'K': 1, 'Rb': 1, 'Cs': 1, 'Fr': 1, 'B': 4, 'In': 3, 'Al': 3, 'P': 3, 'Ga': 3, 'Mg': 2, 'Be': 2, 'Ca': 2, 'Sr': 2, 'Ba': 2, 'Ra': 2, 'V': 5, 'Fe': 3, 'Si': 4, 'Sc': 3, 'Ti': 4, 'Cr': 1, 'Mn': 1, 'Co': 1, 'Ni': 1, 'Cu': 2, 'Zn': 2, 'Ge': 4, 'As': 5, 'Se': 6, 'Y': 3, 'Zr': 4, 'Nb': 5, 'Mo': 6, 'Tc': 7, 'Ru': 8, 'Rh': 6, 'Pd': 4, 'Ag': 0, 'Cd': 2, 'Sn': 4, 'Sb': 5, 'Te': 6, 'La': 3, 'Hf': 4, 'Ta': 5, 'W': 6, 'Re': 4, 'Os': 4, 'Ir': 4, 'Pt': 4, 'Au': 3, 'Hg': 1, 'Tl': 3, 'Pb': 4, 'Bi': 3, 'Po': 2, 'Ac': 3})
      @@ -542,7 +542,7 @@
      Attributes
      ms1_molecular_search = - MolecularFormulaSearchSettings(use_isotopologue_filter=False, isotopologue_filter_threshold=33.0, isotopologue_filter_atoms=('Cl', 'Br'), use_runtime_kendrick_filter=False, use_min_peaks_filter=True, min_peaks_per_class=15, url_database='postgresql+psycopg2://coremsappdb:coremsapppnnl@molformdb:5432/coremsapp', db_jobs=3, db_chunk_size=300, ion_charge=-1, min_hc_filter=0.3, max_hc_filter=3.0, min_oc_filter=0.0, max_oc_filter=1.2, min_op_filter=2.0, use_pah_line_rule=False, min_dbe=0.0, max_dbe=40.0, mz_error_score_weight=0.6, isotopologue_score_weight=0.4, adduct_atoms_neg=('Cl', 'Br'), adduct_atoms_pos=('Na', 'K'), score_methods=('S_P_lowest_error', 'N_S_P_lowest_error', 'lowest_error', 'prob_score', 'air_filter_error', 'water_filter_error', 'earth_filter_error'), score_method='prob_score', output_min_score=0.1, output_score_method='All Candidates', isRadical=False, isProtonated=True, isAdduct=False, usedAtoms={'C': (1, 100), 'H': (1, 200)}, ionization_type='ESI', min_ppm_error=-10.0, max_ppm_error=10.0, min_abun_error=-100.0, max_abun_error=100.0, mz_error_range=1.5, error_method='None', mz_error_average=0.0, used_atom_valences={'C': 4, '13C': 4, 'N': 3, 'O': 2, 'S': 2, 'H': 1, 'F': (1, 0), 'Cl': (1, 0), 'Br': (1, 0), 'I': (1, 0), 'At': 1, 'Li': (1, 0), 'Na': (1, 0), 'K': (1, 0), 'Rb': 1, 'Cs': 1, 'Fr': 1, 'B': (4, 3, 2, 1), 'In': (3, 2, 1), 'Al': (3, 1, 2), 'P': (3, 5, 4, 2, 1), 'Ga': (3, 1, 2), 'Mg': (2, 1), 'Be': (2, 1), 'Ca': (2, 1), 'Sr': (2, 1), 'Ba': 2, 'Ra': 2, 'V': (5, 4, 3, 2, 1), 'Fe': (3, 2, 4, 5, 6), 'Si': (4, 3, 2), 'Sc': (3, 2, 1), 'Ti': (4, 3, 2, 1), 'Cr': (1, 2, 3, 4, 5, 6), 'Mn': (1, 2, 3, 4, 5, 6, 7), 'Co': (1, 2, 3, 4, 5), 'Ni': (1, 2, 3, 4), 'Cu': (2, 1, 3, 4), 'Zn': (2, 1), 'Ge': (4, 3, 2, 1), 'As': (5, 3, 2, 1), 'Se': (6, 4, 2, 1), 'Y': (3, 2, 1), 'Zr': (4, 3, 2, 1), 'Nb': (5, 4, 3, 2, 1), 'Mo': (6, 5, 4, 3, 2, 1), 'Tc': (7, 6, 5, 4, 3, 2, 1), 'Ru': (8, 7, 6, 5, 4, 3, 2, 1), 'Rh': (6, 5, 4, 3, 2, 1), 'Pd': (4, 2, 1), 'Ag': (0, 1, 2, 3, 4), 'Cd': (2, 1), 'Sn': (4, 2), 'Sb': (5, 3), 'Te': (6, 5, 4, 2), 'La': (3, 2), 'Hf': (4, 3, 2), 'Ta': (5, 4, 3, 2), 'W': (6, 5, 4, 3, 2, 1), 'Re': (4, 7, 6, 5, 3, 2, 1), 'Os': (4, 8, 7, 6, 5, 3, 2, 1), 'Ir': (4, 8, 6, 5, 3, 2, 1), 'Pt': (4, 6, 5, 3, 2, 1), 'Au': (3, 5, 2, 1), 'Hg': (1, 2, 4), 'Tl': (3, 1), 'Pb': (4, 2), 'Bi': (3, 1, 5), 'Po': (2, 4, 6), 'Ac': (3, 2)}) + MolecularFormulaSearchSettings(use_isotopologue_filter=False, isotopologue_filter_threshold=33.0, isotopologue_filter_atoms=('Cl', 'Br'), use_runtime_kendrick_filter=False, use_min_peaks_filter=True, min_peaks_per_class=15, url_database='postgresql+psycopg2://coremsappdb:coremsapppnnl@molformdb:5432/coremsapp', db_jobs=3, db_chunk_size=300, ion_charge=-1, min_hc_filter=0.3, max_hc_filter=3.0, min_oc_filter=0.0, max_oc_filter=1.2, min_op_filter=2.0, use_pah_line_rule=False, min_dbe=0.0, max_dbe=40.0, mz_error_score_weight=0.6, isotopologue_score_weight=0.4, adduct_atoms_neg=('Cl', 'Br'), adduct_atoms_pos=('Na', 'K'), score_methods=('S_P_lowest_error', 'N_S_P_lowest_error', 'lowest_error', 'prob_score', 'air_filter_error', 'water_filter_error', 'earth_filter_error'), score_method='prob_score', output_min_score=0.1, output_score_method='All Candidates', isRadical=False, isProtonated=True, isAdduct=False, usedAtoms={'C': (1, 100), 'H': (1, 200)}, ionization_type='ESI', min_ppm_error=-10.0, max_ppm_error=10.0, min_abun_error=-100.0, max_abun_error=100.0, mz_error_range=1.5, error_method='None', mz_error_average=0.0, used_atom_valences={'C': 4, '13C': 4, 'N': 3, 'O': 2, 'S': 2, 'H': 1, 'F': 1, 'Cl': 1, 'Br': 1, 'I': 1, 'At': 1, 'Li': 1, 'Na': 1, 'K': 1, 'Rb': 1, 'Cs': 1, 'Fr': 1, 'B': 4, 'In': 3, 'Al': 3, 'P': 3, 'Ga': 3, 'Mg': 2, 'Be': 2, 'Ca': 2, 'Sr': 2, 'Ba': 2, 'Ra': 2, 'V': 5, 'Fe': 3, 'Si': 4, 'Sc': 3, 'Ti': 4, 'Cr': 1, 'Mn': 1, 'Co': 1, 'Ni': 1, 'Cu': 2, 'Zn': 2, 'Ge': 4, 'As': 5, 'Se': 6, 'Y': 3, 'Zr': 4, 'Nb': 5, 'Mo': 6, 'Tc': 7, 'Ru': 8, 'Rh': 6, 'Pd': 4, 'Ag': 0, 'Cd': 2, 'Sn': 4, 'Sb': 5, 'Te': 6, 'La': 3, 'Hf': 4, 'Ta': 5, 'W': 6, 'Re': 4, 'Os': 4, 'Ir': 4, 'Pt': 4, 'Au': 3, 'Hg': 1, 'Tl': 3, 'Pb': 4, 'Bi': 3, 'Po': 2, 'Ac': 3})
      @@ -555,7 +555,7 @@
      Attributes
      ms2_molecular_search = - MolecularFormulaSearchSettings(use_isotopologue_filter=False, isotopologue_filter_threshold=33.0, isotopologue_filter_atoms=('Cl', 'Br'), use_runtime_kendrick_filter=False, use_min_peaks_filter=True, min_peaks_per_class=15, url_database='postgresql+psycopg2://coremsappdb:coremsapppnnl@molformdb:5432/coremsapp', db_jobs=3, db_chunk_size=300, ion_charge=-1, min_hc_filter=0.3, max_hc_filter=3.0, min_oc_filter=0.0, max_oc_filter=1.2, min_op_filter=2.0, use_pah_line_rule=False, min_dbe=0.0, max_dbe=40.0, mz_error_score_weight=0.6, isotopologue_score_weight=0.4, adduct_atoms_neg=('Cl', 'Br'), adduct_atoms_pos=('Na', 'K'), score_methods=('S_P_lowest_error', 'N_S_P_lowest_error', 'lowest_error', 'prob_score', 'air_filter_error', 'water_filter_error', 'earth_filter_error'), score_method='prob_score', output_min_score=0.1, output_score_method='All Candidates', isRadical=False, isProtonated=True, isAdduct=False, usedAtoms={'C': (1, 100), 'H': (1, 200)}, ionization_type='ESI', min_ppm_error=-10.0, max_ppm_error=10.0, min_abun_error=-100.0, max_abun_error=100.0, mz_error_range=1.5, error_method='None', mz_error_average=0.0, used_atom_valences={'C': 4, '13C': 4, 'N': 3, 'O': 2, 'S': 2, 'H': 1, 'F': (1, 0), 'Cl': (1, 0), 'Br': (1, 0), 'I': (1, 0), 'At': 1, 'Li': (1, 0), 'Na': (1, 0), 'K': (1, 0), 'Rb': 1, 'Cs': 1, 'Fr': 1, 'B': (4, 3, 2, 1), 'In': (3, 2, 1), 'Al': (3, 1, 2), 'P': (3, 5, 4, 2, 1), 'Ga': (3, 1, 2), 'Mg': (2, 1), 'Be': (2, 1), 'Ca': (2, 1), 'Sr': (2, 1), 'Ba': 2, 'Ra': 2, 'V': (5, 4, 3, 2, 1), 'Fe': (3, 2, 4, 5, 6), 'Si': (4, 3, 2), 'Sc': (3, 2, 1), 'Ti': (4, 3, 2, 1), 'Cr': (1, 2, 3, 4, 5, 6), 'Mn': (1, 2, 3, 4, 5, 6, 7), 'Co': (1, 2, 3, 4, 5), 'Ni': (1, 2, 3, 4), 'Cu': (2, 1, 3, 4), 'Zn': (2, 1), 'Ge': (4, 3, 2, 1), 'As': (5, 3, 2, 1), 'Se': (6, 4, 2, 1), 'Y': (3, 2, 1), 'Zr': (4, 3, 2, 1), 'Nb': (5, 4, 3, 2, 1), 'Mo': (6, 5, 4, 3, 2, 1), 'Tc': (7, 6, 5, 4, 3, 2, 1), 'Ru': (8, 7, 6, 5, 4, 3, 2, 1), 'Rh': (6, 5, 4, 3, 2, 1), 'Pd': (4, 2, 1), 'Ag': (0, 1, 2, 3, 4), 'Cd': (2, 1), 'Sn': (4, 2), 'Sb': (5, 3), 'Te': (6, 5, 4, 2), 'La': (3, 2), 'Hf': (4, 3, 2), 'Ta': (5, 4, 3, 2), 'W': (6, 5, 4, 3, 2, 1), 'Re': (4, 7, 6, 5, 3, 2, 1), 'Os': (4, 8, 7, 6, 5, 3, 2, 1), 'Ir': (4, 8, 6, 5, 3, 2, 1), 'Pt': (4, 6, 5, 3, 2, 1), 'Au': (3, 5, 2, 1), 'Hg': (1, 2, 4), 'Tl': (3, 1), 'Pb': (4, 2), 'Bi': (3, 1, 5), 'Po': (2, 4, 6), 'Ac': (3, 2)}) + MolecularFormulaSearchSettings(use_isotopologue_filter=False, isotopologue_filter_threshold=33.0, isotopologue_filter_atoms=('Cl', 'Br'), use_runtime_kendrick_filter=False, use_min_peaks_filter=True, min_peaks_per_class=15, url_database='postgresql+psycopg2://coremsappdb:coremsapppnnl@molformdb:5432/coremsapp', db_jobs=3, db_chunk_size=300, ion_charge=-1, min_hc_filter=0.3, max_hc_filter=3.0, min_oc_filter=0.0, max_oc_filter=1.2, min_op_filter=2.0, use_pah_line_rule=False, min_dbe=0.0, max_dbe=40.0, mz_error_score_weight=0.6, isotopologue_score_weight=0.4, adduct_atoms_neg=('Cl', 'Br'), adduct_atoms_pos=('Na', 'K'), score_methods=('S_P_lowest_error', 'N_S_P_lowest_error', 'lowest_error', 'prob_score', 'air_filter_error', 'water_filter_error', 'earth_filter_error'), score_method='prob_score', output_min_score=0.1, output_score_method='All Candidates', isRadical=False, isProtonated=True, isAdduct=False, usedAtoms={'C': (1, 100), 'H': (1, 200)}, ionization_type='ESI', min_ppm_error=-10.0, max_ppm_error=10.0, min_abun_error=-100.0, max_abun_error=100.0, mz_error_range=1.5, error_method='None', mz_error_average=0.0, used_atom_valences={'C': 4, '13C': 4, 'N': 3, 'O': 2, 'S': 2, 'H': 1, 'F': 1, 'Cl': 1, 'Br': 1, 'I': 1, 'At': 1, 'Li': 1, 'Na': 1, 'K': 1, 'Rb': 1, 'Cs': 1, 'Fr': 1, 'B': 4, 'In': 3, 'Al': 3, 'P': 3, 'Ga': 3, 'Mg': 2, 'Be': 2, 'Ca': 2, 'Sr': 2, 'Ba': 2, 'Ra': 2, 'V': 5, 'Fe': 3, 'Si': 4, 'Sc': 3, 'Ti': 4, 'Cr': 1, 'Mn': 1, 'Co': 1, 'Ni': 1, 'Cu': 2, 'Zn': 2, 'Ge': 4, 'As': 5, 'Se': 6, 'Y': 3, 'Zr': 4, 'Nb': 5, 'Mo': 6, 'Tc': 7, 'Ru': 8, 'Rh': 6, 'Pd': 4, 'Ag': 0, 'Cd': 2, 'Sn': 4, 'Sb': 5, 'Te': 6, 'La': 3, 'Hf': 4, 'Ta': 5, 'W': 6, 'Re': 4, 'Os': 4, 'Ir': 4, 'Pt': 4, 'Au': 3, 'Hg': 1, 'Tl': 3, 'Pb': 4, 'Bi': 3, 'Po': 2, 'Ac': 3})
      diff --git a/docs/corems/encapsulation/factory/processingSetting.html b/docs/corems/encapsulation/factory/processingSetting.html index b27ab236..e0b73951 100644 --- a/docs/corems/encapsulation/factory/processingSetting.html +++ b/docs/corems/encapsulation/factory/processingSetting.html @@ -1364,9 +1364,19 @@

      813 814 # add cummon values 815 current_used_atoms = self.used_atom_valences.keys() -816 for atom in Atoms.atoms_covalence.keys(): -817 if atom not in current_used_atoms: -818 self.used_atom_valences[atom] = Atoms.atoms_covalence.get(atom) +816 +817 for atom in Atoms.atoms_covalence.keys(): +818 +819 if atom not in current_used_atoms: +820 +821 covalence = Atoms.atoms_covalence.get(atom) +822 +823 if isinstance(covalence , int): +824 self.used_atom_valences[atom] = covalence +825 +826 else: +827 #will get the first number of all possible covalances, which should be the most commum +828 self.used_atom_valences[atom] = covalence[0]

    @@ -3904,9 +3914,19 @@

    Attributes
    814 815 # add cummon values 816 current_used_atoms = self.used_atom_valences.keys() -817 for atom in Atoms.atoms_covalence.keys(): -818 if atom not in current_used_atoms: -819 self.used_atom_valences[atom] = Atoms.atoms_covalence.get(atom) +817 +818 for atom in Atoms.atoms_covalence.keys(): +819 +820 if atom not in current_used_atoms: +821 +822 covalence = Atoms.atoms_covalence.get(atom) +823 +824 if isinstance(covalence , int): +825 self.used_atom_valences[atom] = covalence +826 +827 else: +828 #will get the first number of all possible covalances, which should be the most commum +829 self.used_atom_valences[atom] = covalence[0]
    diff --git a/docs/corems/mass_spectrum/factory/MassSpectrumClasses.html b/docs/corems/mass_spectrum/factory/MassSpectrumClasses.html index 0574cf54..6b3da244 100644 --- a/docs/corems/mass_spectrum/factory/MassSpectrumClasses.html +++ b/docs/corems/mass_spectrum/factory/MassSpectrumClasses.html @@ -1767,225 +1767,227 @@

    1375 1376 self.is_centroid = True 1377 self.data_dict = data_dict -1378 -1379 if auto_process: -1380 self.process_mass_spec() -1381 -1382 -1383 def __simulate_profile__data__(self, exp_mz_centroid, magnitude_centroid): -1384 """Simulate profile data based on Gaussian or Lorentzian peak shape -1385 -1386 Notes -1387 ----- -1388 Needs theoretical resolving power calculation and define peak shape. -1389 This is a quick fix to trick a line plot be able to plot as sticks for plotting and inspection purposes only. -1390 -1391 Parameters -1392 ---------- -1393 exp_mz_centroid : list(float) -1394 list of m/z values -1395 magnitude_centroid : list(float) -1396 list of abundance values -1397 -1398 -1399 Returns -1400 ------- -1401 x : list(float) -1402 list of m/z values -1403 y : list(float) -1404 list of abundance values -1405 """ -1406 -1407 x, y = [], [] -1408 for i in range(len(exp_mz_centroid)): -1409 x.append(exp_mz_centroid[i] - 0.0000001) -1410 x.append(exp_mz_centroid[i]) -1411 x.append(exp_mz_centroid[i] + 0.0000001) -1412 y.append(0) -1413 y.append(magnitude_centroid[i]) +1378 self._mz_exp = data_dict[Labels.mz] +1379 self._abundance = data_dict[Labels.abundance] +1380 +1381 if auto_process: +1382 self.process_mass_spec() +1383 +1384 +1385 def __simulate_profile__data__(self, exp_mz_centroid, magnitude_centroid): +1386 """Simulate profile data based on Gaussian or Lorentzian peak shape +1387 +1388 Notes +1389 ----- +1390 Needs theoretical resolving power calculation and define peak shape. +1391 This is a quick fix to trick a line plot be able to plot as sticks for plotting and inspection purposes only. +1392 +1393 Parameters +1394 ---------- +1395 exp_mz_centroid : list(float) +1396 list of m/z values +1397 magnitude_centroid : list(float) +1398 list of abundance values +1399 +1400 +1401 Returns +1402 ------- +1403 x : list(float) +1404 list of m/z values +1405 y : list(float) +1406 list of abundance values +1407 """ +1408 +1409 x, y = [], [] +1410 for i in range(len(exp_mz_centroid)): +1411 x.append(exp_mz_centroid[i] - 0.0000001) +1412 x.append(exp_mz_centroid[i]) +1413 x.append(exp_mz_centroid[i] + 0.0000001) 1414 y.append(0) -1415 return x, y -1416 -1417 @property -1418 def mz_exp_profile(self): -1419 """Return the m/z profile of the mass spectrum.""" -1420 mz_list = [] -1421 for mz in self.mz_exp: -1422 mz_list.append(mz - 0.0000001) -1423 mz_list.append(mz) -1424 mz_list.append(mz + 0.0000001) -1425 return mz_list -1426 -1427 @mz_exp_profile.setter -1428 def mz_exp_profile(self, _mz_exp ): self._mz_exp = _mz_exp -1429 -1430 @property -1431 def abundance_profile(self): -1432 """Return the abundance profile of the mass spectrum.""" -1433 ab_list = [] -1434 for ab in self.abundance: -1435 ab_list.append(0) -1436 ab_list.append(ab) +1415 y.append(magnitude_centroid[i]) +1416 y.append(0) +1417 return x, y +1418 +1419 @property +1420 def mz_exp_profile(self): +1421 """Return the m/z profile of the mass spectrum.""" +1422 mz_list = [] +1423 for mz in self.mz_exp: +1424 mz_list.append(mz - 0.0000001) +1425 mz_list.append(mz) +1426 mz_list.append(mz + 0.0000001) +1427 return mz_list +1428 +1429 @mz_exp_profile.setter +1430 def mz_exp_profile(self, _mz_exp ): self._mz_exp = _mz_exp +1431 +1432 @property +1433 def abundance_profile(self): +1434 """Return the abundance profile of the mass spectrum.""" +1435 ab_list = [] +1436 for ab in self.abundance: 1437 ab_list.append(0) -1438 return ab_list -1439 -1440 @abundance_profile.setter -1441 def abundance_profile(self, abundance ): self._abundance = abundance -1442 -1443 @property -1444 def tic(self): -1445 """Return the total ion current of the mass spectrum.""" -1446 return sum(self.abundance) -1447 -1448 def process_mass_spec(self): -1449 """Process the mass spectrum. -1450 -1451 """ -1452 import tqdm -1453 # overwrite process_mass_spec -1454 # mspeak objs are usually added inside the PeaKPicking class -1455 # for profile and freq based data -1456 -1457 data_dict = self.data_dict -1458 s2n = True -1459 ion_charge = self.polarity -1460 #l_exp_mz_centroid = data_dict.get(Labels.mz) -1461 #l_intes_centr = data_dict.get(Labels.abundance) -1462 #l_peak_resolving_power = data_dict.get(Labels.rp) -1463 l_s2n = list(data_dict.get(Labels.s2n)) -1464 -1465 if not l_s2n: s2n = False +1438 ab_list.append(ab) +1439 ab_list.append(0) +1440 return ab_list +1441 +1442 @abundance_profile.setter +1443 def abundance_profile(self, abundance ): self._abundance = abundance +1444 +1445 @property +1446 def tic(self): +1447 """Return the total ion current of the mass spectrum.""" +1448 return sum(self.abundance) +1449 +1450 def process_mass_spec(self): +1451 """Process the mass spectrum. +1452 +1453 """ +1454 import tqdm +1455 # overwrite process_mass_spec +1456 # mspeak objs are usually added inside the PeaKPicking class +1457 # for profile and freq based data +1458 +1459 data_dict = self.data_dict +1460 s2n = True +1461 ion_charge = self.polarity +1462 #l_exp_mz_centroid = data_dict.get(Labels.mz) +1463 #l_intes_centr = data_dict.get(Labels.abundance) +1464 #l_peak_resolving_power = data_dict.get(Labels.rp) +1465 l_s2n = list(data_dict.get(Labels.s2n)) 1466 -1467 print("Loading mass spectrum object") +1467 if not l_s2n: s2n = False 1468 -1469 abun = array(data_dict.get(Labels.abundance)).astype(float) +1469 print("Loading mass spectrum object") 1470 -1471 abundance_threshold, factor = self.get_threshold(abun) +1471 abun = array(data_dict.get(Labels.abundance)).astype(float) 1472 -1473 for index, mz in enumerate(data_dict.get(Labels.mz)): -1474 -1475 # centroid peak does not have start and end peak index pos -1476 massspec_indexes = (index, index, index) -1477 -1478 if s2n: -1479 -1480 if abun[index]/factor >= abundance_threshold: -1481 -1482 self.add_mspeak( -1483 ion_charge, -1484 mz, -1485 abun[index], -1486 float(data_dict.get(Labels.rp)[index]), -1487 float(l_s2n[index]), -1488 massspec_indexes, -1489 ms_parent=self -1490 ) -1491 -1492 else: +1473 abundance_threshold, factor = self.get_threshold(abun) +1474 +1475 for index, mz in enumerate(data_dict.get(Labels.mz)): +1476 +1477 # centroid peak does not have start and end peak index pos +1478 massspec_indexes = (index, index, index) +1479 +1480 if s2n: +1481 +1482 if abun[index]/factor >= abundance_threshold: +1483 +1484 self.add_mspeak( +1485 ion_charge, +1486 mz, +1487 abun[index], +1488 float(data_dict.get(Labels.rp)[index]), +1489 float(l_s2n[index]), +1490 massspec_indexes, +1491 ms_parent=self +1492 ) 1493 -1494 if data_dict.get(Labels.abundance)[index]/factor >= abundance_threshold: +1494 else: 1495 -1496 self.add_mspeak( -1497 ion_charge, -1498 mz, -1499 abun[index], -1500 float(data_dict.get(Labels.rp)[index]), -1501 -999, -1502 massspec_indexes, -1503 ms_parent=self -1504 ) -1505 -1506 self.mspeaks = self._mspeaks -1507 self._dynamic_range = self.max_abundance / self.min_abundance -1508 self._set_nominal_masses_start_final_indexes() -1509 -1510 if self.label != Labels.thermo_centroid: -1511 -1512 if self.settings.noise_threshold_method == 'log': -1513 -1514 raise Exception("log noise Not tested for centroid data") -1515 #self._baseline_noise, self._baseline_noise_std = self.run_log_noise_threshold_calc() -1516 -1517 else: -1518 self._baseline_noise, self._baseline_noise_std = self.run_noise_threshold_calc() -1519 -1520 del self.data_dict -1521 -1522class MassSpecCentroidLowRes(MassSpecCentroid): -1523 """A mass spectrum class when the entry point is on low resolution centroid format -1524 -1525 Notes -1526 ----- -1527 Does not store MSPeak Objs, will iterate over mz, abundance pairs instead -1528 -1529 Parameters -1530 ---------- -1531 data_dict : dict {string: numpy array float64 ) -1532 contains keys [m/z, Abundance, Resolving Power, S/N] -1533 d_params : dict{'str': float, int or str} -1534 contains the instrument settings and processing settings -1535 -1536 Attributes -1537 ---------- -1538 _processed_tic : float -1539 store processed total ion current -1540 _abundance : ndarray -1541 The abundance values of the mass spectrum. -1542 _mz_exp : ndarray -1543 The m/z values of the mass spectrum. -1544 """ -1545 -1546 def __init__(self, data_dict, d_params): +1496 if data_dict.get(Labels.abundance)[index]/factor >= abundance_threshold: +1497 +1498 self.add_mspeak( +1499 ion_charge, +1500 mz, +1501 abun[index], +1502 float(data_dict.get(Labels.rp)[index]), +1503 -999, +1504 massspec_indexes, +1505 ms_parent=self +1506 ) +1507 +1508 self.mspeaks = self._mspeaks +1509 self._dynamic_range = self.max_abundance / self.min_abundance +1510 self._set_nominal_masses_start_final_indexes() +1511 +1512 if self.label != Labels.thermo_centroid: +1513 +1514 if self.settings.noise_threshold_method == 'log': +1515 +1516 raise Exception("log noise Not tested for centroid data") +1517 #self._baseline_noise, self._baseline_noise_std = self.run_log_noise_threshold_calc() +1518 +1519 else: +1520 self._baseline_noise, self._baseline_noise_std = self.run_noise_threshold_calc() +1521 +1522 del self.data_dict +1523 +1524class MassSpecCentroidLowRes(MassSpecCentroid): +1525 """A mass spectrum class when the entry point is on low resolution centroid format +1526 +1527 Notes +1528 ----- +1529 Does not store MSPeak Objs, will iterate over mz, abundance pairs instead +1530 +1531 Parameters +1532 ---------- +1533 data_dict : dict {string: numpy array float64 ) +1534 contains keys [m/z, Abundance, Resolving Power, S/N] +1535 d_params : dict{'str': float, int or str} +1536 contains the instrument settings and processing settings +1537 +1538 Attributes +1539 ---------- +1540 _processed_tic : float +1541 store processed total ion current +1542 _abundance : ndarray +1543 The abundance values of the mass spectrum. +1544 _mz_exp : ndarray +1545 The m/z values of the mass spectrum. +1546 """ 1547 -1548 self._set_parameters_objects(d_params) -1549 self._mz_exp = array(data_dict.get(Labels.mz)) -1550 self._abundance = array(data_dict.get(Labels.abundance)) -1551 self._processed_tic = None -1552 -1553 def __len__(self): -1554 -1555 return len(self.mz_exp) +1548 def __init__(self, data_dict, d_params): +1549 +1550 self._set_parameters_objects(d_params) +1551 self._mz_exp = array(data_dict.get(Labels.mz)) +1552 self._abundance = array(data_dict.get(Labels.abundance)) +1553 self._processed_tic = None +1554 +1555 def __len__(self): 1556 -1557 def __getitem__(self, position): +1557 return len(self.mz_exp) 1558 -1559 return (self.mz_exp[position], self.abundance[position]) -1560 -1561 @property -1562 def mz_exp(self): -1563 """Return the m/z values of the mass spectrum.""" -1564 return self._mz_exp -1565 -1566 @property -1567 def abundance(self): -1568 """Return the abundance values of the mass spectrum.""" -1569 return self._abundance -1570 -1571 @property -1572 def processed_tic(self): -1573 """Return the processed total ion current of the mass spectrum.""" -1574 return sum(self._processed_tic) -1575 -1576 @property -1577 def tic(self): -1578 """Return the total ion current of the mass spectrum.""" -1579 if self._processed_tic: -1580 return self._processed_tic -1581 else: -1582 return sum(self.abundance) -1583 -1584 @property -1585 def mz_abun_tuples(self): -1586 """Return the m/z and abundance values of the mass spectrum as a list of tuples.""" -1587 r = lambda x: ( int(round(x[0],0), int(round(x[1],0))) ) -1588 -1589 return [r(i) for i in self] -1590 -1591 @property -1592 def mz_abun_dict(self): -1593 """Return the m/z and abundance values of the mass spectrum as a dictionary.""" -1594 r = lambda x: int(round(x,0)) -1595 -1596 return { r(i[0]):r(i[1]) for i in self} +1559 def __getitem__(self, position): +1560 +1561 return (self.mz_exp[position], self.abundance[position]) +1562 +1563 @property +1564 def mz_exp(self): +1565 """Return the m/z values of the mass spectrum.""" +1566 return self._mz_exp +1567 +1568 @property +1569 def abundance(self): +1570 """Return the abundance values of the mass spectrum.""" +1571 return self._abundance +1572 +1573 @property +1574 def processed_tic(self): +1575 """Return the processed total ion current of the mass spectrum.""" +1576 return sum(self._processed_tic) +1577 +1578 @property +1579 def tic(self): +1580 """Return the total ion current of the mass spectrum.""" +1581 if self._processed_tic: +1582 return self._processed_tic +1583 else: +1584 return sum(self.abundance) +1585 +1586 @property +1587 def mz_abun_tuples(self): +1588 """Return the m/z and abundance values of the mass spectrum as a list of tuples.""" +1589 r = lambda x: ( int(round(x[0],0), int(round(x[1],0))) ) +1590 +1591 return [r(i) for i in self] +1592 +1593 @property +1594 def mz_abun_dict(self): +1595 """Return the m/z and abundance values of the mass spectrum as a dictionary.""" +1596 r = lambda x: int(round(x,0)) +1597 +1598 return { r(i[0]):r(i[1]) for i in self}

    @@ -6334,149 +6336,151 @@
    Inherited Members
    1376 1377 self.is_centroid = True 1378 self.data_dict = data_dict -1379 -1380 if auto_process: -1381 self.process_mass_spec() -1382 -1383 -1384 def __simulate_profile__data__(self, exp_mz_centroid, magnitude_centroid): -1385 """Simulate profile data based on Gaussian or Lorentzian peak shape -1386 -1387 Notes -1388 ----- -1389 Needs theoretical resolving power calculation and define peak shape. -1390 This is a quick fix to trick a line plot be able to plot as sticks for plotting and inspection purposes only. -1391 -1392 Parameters -1393 ---------- -1394 exp_mz_centroid : list(float) -1395 list of m/z values -1396 magnitude_centroid : list(float) -1397 list of abundance values -1398 -1399 -1400 Returns -1401 ------- -1402 x : list(float) -1403 list of m/z values -1404 y : list(float) -1405 list of abundance values -1406 """ -1407 -1408 x, y = [], [] -1409 for i in range(len(exp_mz_centroid)): -1410 x.append(exp_mz_centroid[i] - 0.0000001) -1411 x.append(exp_mz_centroid[i]) -1412 x.append(exp_mz_centroid[i] + 0.0000001) -1413 y.append(0) -1414 y.append(magnitude_centroid[i]) +1379 self._mz_exp = data_dict[Labels.mz] +1380 self._abundance = data_dict[Labels.abundance] +1381 +1382 if auto_process: +1383 self.process_mass_spec() +1384 +1385 +1386 def __simulate_profile__data__(self, exp_mz_centroid, magnitude_centroid): +1387 """Simulate profile data based on Gaussian or Lorentzian peak shape +1388 +1389 Notes +1390 ----- +1391 Needs theoretical resolving power calculation and define peak shape. +1392 This is a quick fix to trick a line plot be able to plot as sticks for plotting and inspection purposes only. +1393 +1394 Parameters +1395 ---------- +1396 exp_mz_centroid : list(float) +1397 list of m/z values +1398 magnitude_centroid : list(float) +1399 list of abundance values +1400 +1401 +1402 Returns +1403 ------- +1404 x : list(float) +1405 list of m/z values +1406 y : list(float) +1407 list of abundance values +1408 """ +1409 +1410 x, y = [], [] +1411 for i in range(len(exp_mz_centroid)): +1412 x.append(exp_mz_centroid[i] - 0.0000001) +1413 x.append(exp_mz_centroid[i]) +1414 x.append(exp_mz_centroid[i] + 0.0000001) 1415 y.append(0) -1416 return x, y -1417 -1418 @property -1419 def mz_exp_profile(self): -1420 """Return the m/z profile of the mass spectrum.""" -1421 mz_list = [] -1422 for mz in self.mz_exp: -1423 mz_list.append(mz - 0.0000001) -1424 mz_list.append(mz) -1425 mz_list.append(mz + 0.0000001) -1426 return mz_list -1427 -1428 @mz_exp_profile.setter -1429 def mz_exp_profile(self, _mz_exp ): self._mz_exp = _mz_exp -1430 -1431 @property -1432 def abundance_profile(self): -1433 """Return the abundance profile of the mass spectrum.""" -1434 ab_list = [] -1435 for ab in self.abundance: -1436 ab_list.append(0) -1437 ab_list.append(ab) +1416 y.append(magnitude_centroid[i]) +1417 y.append(0) +1418 return x, y +1419 +1420 @property +1421 def mz_exp_profile(self): +1422 """Return the m/z profile of the mass spectrum.""" +1423 mz_list = [] +1424 for mz in self.mz_exp: +1425 mz_list.append(mz - 0.0000001) +1426 mz_list.append(mz) +1427 mz_list.append(mz + 0.0000001) +1428 return mz_list +1429 +1430 @mz_exp_profile.setter +1431 def mz_exp_profile(self, _mz_exp ): self._mz_exp = _mz_exp +1432 +1433 @property +1434 def abundance_profile(self): +1435 """Return the abundance profile of the mass spectrum.""" +1436 ab_list = [] +1437 for ab in self.abundance: 1438 ab_list.append(0) -1439 return ab_list -1440 -1441 @abundance_profile.setter -1442 def abundance_profile(self, abundance ): self._abundance = abundance -1443 -1444 @property -1445 def tic(self): -1446 """Return the total ion current of the mass spectrum.""" -1447 return sum(self.abundance) -1448 -1449 def process_mass_spec(self): -1450 """Process the mass spectrum. -1451 -1452 """ -1453 import tqdm -1454 # overwrite process_mass_spec -1455 # mspeak objs are usually added inside the PeaKPicking class -1456 # for profile and freq based data -1457 -1458 data_dict = self.data_dict -1459 s2n = True -1460 ion_charge = self.polarity -1461 #l_exp_mz_centroid = data_dict.get(Labels.mz) -1462 #l_intes_centr = data_dict.get(Labels.abundance) -1463 #l_peak_resolving_power = data_dict.get(Labels.rp) -1464 l_s2n = list(data_dict.get(Labels.s2n)) -1465 -1466 if not l_s2n: s2n = False +1439 ab_list.append(ab) +1440 ab_list.append(0) +1441 return ab_list +1442 +1443 @abundance_profile.setter +1444 def abundance_profile(self, abundance ): self._abundance = abundance +1445 +1446 @property +1447 def tic(self): +1448 """Return the total ion current of the mass spectrum.""" +1449 return sum(self.abundance) +1450 +1451 def process_mass_spec(self): +1452 """Process the mass spectrum. +1453 +1454 """ +1455 import tqdm +1456 # overwrite process_mass_spec +1457 # mspeak objs are usually added inside the PeaKPicking class +1458 # for profile and freq based data +1459 +1460 data_dict = self.data_dict +1461 s2n = True +1462 ion_charge = self.polarity +1463 #l_exp_mz_centroid = data_dict.get(Labels.mz) +1464 #l_intes_centr = data_dict.get(Labels.abundance) +1465 #l_peak_resolving_power = data_dict.get(Labels.rp) +1466 l_s2n = list(data_dict.get(Labels.s2n)) 1467 -1468 print("Loading mass spectrum object") +1468 if not l_s2n: s2n = False 1469 -1470 abun = array(data_dict.get(Labels.abundance)).astype(float) +1470 print("Loading mass spectrum object") 1471 -1472 abundance_threshold, factor = self.get_threshold(abun) +1472 abun = array(data_dict.get(Labels.abundance)).astype(float) 1473 -1474 for index, mz in enumerate(data_dict.get(Labels.mz)): -1475 -1476 # centroid peak does not have start and end peak index pos -1477 massspec_indexes = (index, index, index) -1478 -1479 if s2n: -1480 -1481 if abun[index]/factor >= abundance_threshold: -1482 -1483 self.add_mspeak( -1484 ion_charge, -1485 mz, -1486 abun[index], -1487 float(data_dict.get(Labels.rp)[index]), -1488 float(l_s2n[index]), -1489 massspec_indexes, -1490 ms_parent=self -1491 ) -1492 -1493 else: +1474 abundance_threshold, factor = self.get_threshold(abun) +1475 +1476 for index, mz in enumerate(data_dict.get(Labels.mz)): +1477 +1478 # centroid peak does not have start and end peak index pos +1479 massspec_indexes = (index, index, index) +1480 +1481 if s2n: +1482 +1483 if abun[index]/factor >= abundance_threshold: +1484 +1485 self.add_mspeak( +1486 ion_charge, +1487 mz, +1488 abun[index], +1489 float(data_dict.get(Labels.rp)[index]), +1490 float(l_s2n[index]), +1491 massspec_indexes, +1492 ms_parent=self +1493 ) 1494 -1495 if data_dict.get(Labels.abundance)[index]/factor >= abundance_threshold: +1495 else: 1496 -1497 self.add_mspeak( -1498 ion_charge, -1499 mz, -1500 abun[index], -1501 float(data_dict.get(Labels.rp)[index]), -1502 -999, -1503 massspec_indexes, -1504 ms_parent=self -1505 ) -1506 -1507 self.mspeaks = self._mspeaks -1508 self._dynamic_range = self.max_abundance / self.min_abundance -1509 self._set_nominal_masses_start_final_indexes() -1510 -1511 if self.label != Labels.thermo_centroid: -1512 -1513 if self.settings.noise_threshold_method == 'log': -1514 -1515 raise Exception("log noise Not tested for centroid data") -1516 #self._baseline_noise, self._baseline_noise_std = self.run_log_noise_threshold_calc() -1517 -1518 else: -1519 self._baseline_noise, self._baseline_noise_std = self.run_noise_threshold_calc() -1520 -1521 del self.data_dict +1497 if data_dict.get(Labels.abundance)[index]/factor >= abundance_threshold: +1498 +1499 self.add_mspeak( +1500 ion_charge, +1501 mz, +1502 abun[index], +1503 float(data_dict.get(Labels.rp)[index]), +1504 -999, +1505 massspec_indexes, +1506 ms_parent=self +1507 ) +1508 +1509 self.mspeaks = self._mspeaks +1510 self._dynamic_range = self.max_abundance / self.min_abundance +1511 self._set_nominal_masses_start_final_indexes() +1512 +1513 if self.label != Labels.thermo_centroid: +1514 +1515 if self.settings.noise_threshold_method == 'log': +1516 +1517 raise Exception("log noise Not tested for centroid data") +1518 #self._baseline_noise, self._baseline_noise_std = self.run_log_noise_threshold_calc() +1519 +1520 else: +1521 self._baseline_noise, self._baseline_noise_std = self.run_noise_threshold_calc() +1522 +1523 del self.data_dict @@ -6555,9 +6559,11 @@
    Methods
    1376 1377 self.is_centroid = True 1378 self.data_dict = data_dict -1379 -1380 if auto_process: -1381 self.process_mass_spec() +1379 self._mz_exp = data_dict[Labels.mz] +1380 self._abundance = data_dict[Labels.abundance] +1381 +1382 if auto_process: +1383 self.process_mass_spec() @@ -6636,79 +6642,79 @@
    Methods
    -
    1449    def process_mass_spec(self):
    -1450        """Process the mass spectrum.
    -1451       
    -1452        """
    -1453        import tqdm
    -1454        # overwrite process_mass_spec 
    -1455        # mspeak objs are usually added inside the PeaKPicking class 
    -1456        # for profile and freq based data
    -1457        
    -1458        data_dict = self.data_dict
    -1459        s2n = True
    -1460        ion_charge = self.polarity
    -1461        #l_exp_mz_centroid = data_dict.get(Labels.mz)
    -1462        #l_intes_centr = data_dict.get(Labels.abundance)
    -1463        #l_peak_resolving_power = data_dict.get(Labels.rp)
    -1464        l_s2n = list(data_dict.get(Labels.s2n))
    -1465        
    -1466        if not l_s2n: s2n = False
    +            
    1451    def process_mass_spec(self):
    +1452        """Process the mass spectrum.
    +1453       
    +1454        """
    +1455        import tqdm
    +1456        # overwrite process_mass_spec 
    +1457        # mspeak objs are usually added inside the PeaKPicking class 
    +1458        # for profile and freq based data
    +1459        
    +1460        data_dict = self.data_dict
    +1461        s2n = True
    +1462        ion_charge = self.polarity
    +1463        #l_exp_mz_centroid = data_dict.get(Labels.mz)
    +1464        #l_intes_centr = data_dict.get(Labels.abundance)
    +1465        #l_peak_resolving_power = data_dict.get(Labels.rp)
    +1466        l_s2n = list(data_dict.get(Labels.s2n))
     1467        
    -1468        print("Loading mass spectrum object")
    +1468        if not l_s2n: s2n = False
     1469        
    -1470        abun = array(data_dict.get(Labels.abundance)).astype(float)
    +1470        print("Loading mass spectrum object")
     1471        
    -1472        abundance_threshold, factor = self.get_threshold(abun)
    +1472        abun = array(data_dict.get(Labels.abundance)).astype(float)
     1473        
    -1474        for index, mz in enumerate(data_dict.get(Labels.mz)):
    -1475            
    -1476            # centroid peak does not have start and end peak index pos
    -1477            massspec_indexes = (index, index, index)
    -1478            
    -1479            if s2n:
    -1480                
    -1481                if abun[index]/factor >= abundance_threshold:
    -1482
    -1483                    self.add_mspeak(
    -1484                        ion_charge,
    -1485                        mz,
    -1486                        abun[index],
    -1487                        float(data_dict.get(Labels.rp)[index]),
    -1488                        float(l_s2n[index]),
    -1489                        massspec_indexes,
    -1490                        ms_parent=self
    -1491                    )
    -1492
    -1493            else:
    +1474        abundance_threshold, factor = self.get_threshold(abun)
    +1475        
    +1476        for index, mz in enumerate(data_dict.get(Labels.mz)):
    +1477            
    +1478            # centroid peak does not have start and end peak index pos
    +1479            massspec_indexes = (index, index, index)
    +1480            
    +1481            if s2n:
    +1482                
    +1483                if abun[index]/factor >= abundance_threshold:
    +1484
    +1485                    self.add_mspeak(
    +1486                        ion_charge,
    +1487                        mz,
    +1488                        abun[index],
    +1489                        float(data_dict.get(Labels.rp)[index]),
    +1490                        float(l_s2n[index]),
    +1491                        massspec_indexes,
    +1492                        ms_parent=self
    +1493                    )
     1494
    -1495                if data_dict.get(Labels.abundance)[index]/factor >= abundance_threshold:
    +1495            else:
     1496
    -1497                    self.add_mspeak(
    -1498                        ion_charge,
    -1499                        mz,
    -1500                        abun[index],
    -1501                        float(data_dict.get(Labels.rp)[index]),
    -1502                        -999,
    -1503                        massspec_indexes,
    -1504                        ms_parent=self
    -1505                    )
    -1506
    -1507        self.mspeaks = self._mspeaks
    -1508        self._dynamic_range = self.max_abundance / self.min_abundance
    -1509        self._set_nominal_masses_start_final_indexes()
    -1510        
    -1511        if self.label != Labels.thermo_centroid:
    -1512            
    -1513            if self.settings.noise_threshold_method == 'log':
    -1514                
    -1515                raise  Exception("log noise Not tested for centroid data")
    -1516                #self._baseline_noise, self._baseline_noise_std = self.run_log_noise_threshold_calc()
    -1517            
    -1518            else:
    -1519                self._baseline_noise, self._baseline_noise_std = self.run_noise_threshold_calc()
    -1520        
    -1521        del self.data_dict
    +1497                if data_dict.get(Labels.abundance)[index]/factor >= abundance_threshold:
    +1498
    +1499                    self.add_mspeak(
    +1500                        ion_charge,
    +1501                        mz,
    +1502                        abun[index],
    +1503                        float(data_dict.get(Labels.rp)[index]),
    +1504                        -999,
    +1505                        massspec_indexes,
    +1506                        ms_parent=self
    +1507                    )
    +1508
    +1509        self.mspeaks = self._mspeaks
    +1510        self._dynamic_range = self.max_abundance / self.min_abundance
    +1511        self._set_nominal_masses_start_final_indexes()
    +1512        
    +1513        if self.label != Labels.thermo_centroid:
    +1514            
    +1515            if self.settings.noise_threshold_method == 'log':
    +1516                
    +1517                raise  Exception("log noise Not tested for centroid data")
    +1518                #self._baseline_noise, self._baseline_noise_std = self.run_log_noise_threshold_calc()
    +1519            
    +1520            else:
    +1521                self._baseline_noise, self._baseline_noise_std = self.run_noise_threshold_calc()
    +1522        
    +1523        del self.data_dict
     
    @@ -6852,81 +6858,81 @@
    Inherited Members
    -
    1523class MassSpecCentroidLowRes(MassSpecCentroid):
    -1524    """A mass spectrum class when the entry point is on low resolution centroid format
    -1525
    -1526    Notes
    -1527    -----
    -1528    Does not store MSPeak Objs, will iterate over mz, abundance pairs instead
    -1529    
    -1530    Parameters
    -1531    ----------
    -1532    data_dict : dict {string: numpy array float64 )
    -1533        contains keys [m/z, Abundance, Resolving Power, S/N]
    -1534    d_params : dict{'str': float, int or str}
    -1535        contains the instrument settings and processing settings
    -1536
    -1537    Attributes
    -1538    ----------
    -1539    _processed_tic : float
    -1540        store processed total ion current
    -1541    _abundance : ndarray
    -1542        The abundance values of the mass spectrum.
    -1543    _mz_exp : ndarray
    -1544        The m/z values of the mass spectrum.
    -1545    """
    -1546    
    -1547    def __init__(self, data_dict, d_params):
    +            
    1525class MassSpecCentroidLowRes(MassSpecCentroid):
    +1526    """A mass spectrum class when the entry point is on low resolution centroid format
    +1527
    +1528    Notes
    +1529    -----
    +1530    Does not store MSPeak Objs, will iterate over mz, abundance pairs instead
    +1531    
    +1532    Parameters
    +1533    ----------
    +1534    data_dict : dict {string: numpy array float64 )
    +1535        contains keys [m/z, Abundance, Resolving Power, S/N]
    +1536    d_params : dict{'str': float, int or str}
    +1537        contains the instrument settings and processing settings
    +1538
    +1539    Attributes
    +1540    ----------
    +1541    _processed_tic : float
    +1542        store processed total ion current
    +1543    _abundance : ndarray
    +1544        The abundance values of the mass spectrum.
    +1545    _mz_exp : ndarray
    +1546        The m/z values of the mass spectrum.
    +1547    """
     1548    
    -1549        self._set_parameters_objects(d_params)
    -1550        self._mz_exp = array(data_dict.get(Labels.mz))
    -1551        self._abundance = array(data_dict.get(Labels.abundance))
    -1552        self._processed_tic = None
    -1553    
    -1554    def __len__(self):
    -1555        
    -1556        return len(self.mz_exp)
    +1549    def __init__(self, data_dict, d_params):
    +1550    
    +1551        self._set_parameters_objects(d_params)
    +1552        self._mz_exp = array(data_dict.get(Labels.mz))
    +1553        self._abundance = array(data_dict.get(Labels.abundance))
    +1554        self._processed_tic = None
    +1555    
    +1556    def __len__(self):
     1557        
    -1558    def __getitem__(self, position):
    +1558        return len(self.mz_exp)
     1559        
    -1560        return (self.mz_exp[position], self.abundance[position])
    -1561
    -1562    @property
    -1563    def mz_exp(self):
    -1564        """Return the m/z values of the mass spectrum."""
    -1565        return self._mz_exp 
    -1566
    -1567    @property
    -1568    def abundance(self):
    -1569        """Return the abundance values of the mass spectrum."""
    -1570        return self._abundance
    -1571
    -1572    @property
    -1573    def processed_tic(self):
    -1574        """Return the processed total ion current of the mass spectrum."""
    -1575        return sum(self._processed_tic)
    -1576    
    -1577    @property
    -1578    def tic(self):
    -1579        """Return the total ion current of the mass spectrum."""
    -1580        if self._processed_tic:
    -1581            return self._processed_tic
    -1582        else:
    -1583            return sum(self.abundance)
    -1584    
    -1585    @property
    -1586    def mz_abun_tuples(self):
    -1587        """Return the m/z and abundance values of the mass spectrum as a list of tuples."""
    -1588        r = lambda x: ( int(round(x[0],0), int(round(x[1],0))) )
    -1589
    -1590        return [r(i) for i in self]
    -1591    
    -1592    @property
    -1593    def mz_abun_dict(self):
    -1594        """Return the m/z and abundance values of the mass spectrum as a dictionary."""
    -1595        r = lambda x: int(round(x,0))
    -1596            
    -1597        return { r(i[0]):r(i[1]) for i in self}
    +1560    def __getitem__(self, position):
    +1561        
    +1562        return (self.mz_exp[position], self.abundance[position])
    +1563
    +1564    @property
    +1565    def mz_exp(self):
    +1566        """Return the m/z values of the mass spectrum."""
    +1567        return self._mz_exp 
    +1568
    +1569    @property
    +1570    def abundance(self):
    +1571        """Return the abundance values of the mass spectrum."""
    +1572        return self._abundance
    +1573
    +1574    @property
    +1575    def processed_tic(self):
    +1576        """Return the processed total ion current of the mass spectrum."""
    +1577        return sum(self._processed_tic)
    +1578    
    +1579    @property
    +1580    def tic(self):
    +1581        """Return the total ion current of the mass spectrum."""
    +1582        if self._processed_tic:
    +1583            return self._processed_tic
    +1584        else:
    +1585            return sum(self.abundance)
    +1586    
    +1587    @property
    +1588    def mz_abun_tuples(self):
    +1589        """Return the m/z and abundance values of the mass spectrum as a list of tuples."""
    +1590        r = lambda x: ( int(round(x[0],0), int(round(x[1],0))) )
    +1591
    +1592        return [r(i) for i in self]
    +1593    
    +1594    @property
    +1595    def mz_abun_dict(self):
    +1596        """Return the m/z and abundance values of the mass spectrum as a dictionary."""
    +1597        r = lambda x: int(round(x,0))
    +1598            
    +1599        return { r(i[0]):r(i[1]) for i in self}
     
    @@ -6968,12 +6974,12 @@
    Attributes
    -
    1547    def __init__(self, data_dict, d_params):
    -1548    
    -1549        self._set_parameters_objects(d_params)
    -1550        self._mz_exp = array(data_dict.get(Labels.mz))
    -1551        self._abundance = array(data_dict.get(Labels.abundance))
    -1552        self._processed_tic = None
    +            
    1549    def __init__(self, data_dict, d_params):
    +1550    
    +1551        self._set_parameters_objects(d_params)
    +1552        self._mz_exp = array(data_dict.get(Labels.mz))
    +1553        self._abundance = array(data_dict.get(Labels.abundance))
    +1554        self._processed_tic = None
     
    diff --git a/docs/corems/mass_spectrum/input/massList.html b/docs/corems/mass_spectrum/input/massList.html index 0af940c4..29cb1a9e 100644 --- a/docs/corems/mass_spectrum/input/massList.html +++ b/docs/corems/mass_spectrum/input/massList.html @@ -166,166 +166,174 @@

    83 ion_type_df = dataframe["Ion Type"] 84 ion_charge_df = dataframe["Ion Charge"] 85 is_isotopologue_df = dataframe['Is Isotopologue'] - 86 - 87 mass_spec_mz_exp_list = mass_spec_obj.mz_exp - 88 - 89 for df_index, mz_exp in enumerate(mz_exp_df): + 86 if 'Adduct' in dataframe: + 87 adduct_df = dataframe['Adduct'] + 88 else: + 89 adduct_df = None 90 - 91 counts = 0 + 91 mass_spec_mz_exp_list = mass_spec_obj.mz_exp 92 - 93 ms_peak_index = list(mass_spec_mz_exp_list).index(float(mz_exp)) + 93 for df_index, mz_exp in enumerate(mz_exp_df): 94 - 95 if 'Is Isotopologue' in dataframe: + 95 counts = 0 96 - 97 atoms = list(formula_df.columns.astype(str)) - 98 counts = list(formula_df.iloc[df_index].astype(int)) - 99 -100 formula_list = [sub[item] for item in range(len(atoms)) -101 for sub in [atoms, counts]] -102 if sum(counts) > 0: + 97 ms_peak_index = list(mass_spec_mz_exp_list).index(float(mz_exp)) + 98 + 99 if 'Is Isotopologue' in dataframe: +100 +101 atoms = list(formula_df.columns.astype(str)) +102 counts = list(formula_df.iloc[df_index].astype(int)) 103 -104 ion_type = str(Labels.ion_type_translate.get(ion_type_df[df_index])) -105 mfobj = MolecularFormula(formula_list, int(ion_charge_df[df_index]), mspeak_parent=mass_spec_obj[ms_peak_index] , ion_type=ion_type) -106 mfobj.is_isotopologue = bool(is_isotopologue_df[df_index]) -107 mass_spec_obj[ms_peak_index].add_molecular_formula(mfobj) -108 -109 -110class ReadMassList(MassListBaseClass): -111 """ -112 The ReadMassList object reads unprocessed mass list data types -113 and returns the mass spectrum object. -114 -115 Parameters -116 ---------- -117 MassListBaseClass : class -118 The base class for reading mass list data types. -119 -120 Methods -121 ------- -122 * get_mass_spectrum(polarity, scan=0, auto_process=True, loadSettings=True). Reads mass list data types and returns the mass spectrum object. -123 -124 """ -125 -126 def get_mass_spectrum(self, polarity:int, scan:int=0, auto_process:bool=True, loadSettings:bool=True): -127 """ -128 Reads mass list data types and returns the mass spectrum object. -129 -130 Parameters -131 ---------- -132 polarity : int -133 The polarity of the mass spectrum (+1 or -1). -134 scan : int, optional -135 The scan number of the mass spectrum (default is 0). -136 auto_process : bool, optional -137 Flag indicating whether to automatically process the mass spectrum (default is True). -138 loadSettings : bool, optional -139 Flag indicating whether to load settings for the mass spectrum (default is True). -140 -141 Returns -142 ------- -143 mass_spec : MassSpecCentroid or MassSpecProfile -144 The mass spectrum object. -145 -146 """ -147 -148 # delimiter = " " or " " or "," or "\t" etc -149 -150 if self.isCentroid: -151 -152 dataframe = self.get_dataframe() +104 formula_list = [sub[item] for item in range(len(atoms)) +105 for sub in [atoms, counts]] +106 if sum(counts) > 0: +107 +108 ion_type = str(Labels.ion_type_translate.get(ion_type_df[df_index])) +109 if adduct_df is not None: +110 adduct_atom = str(adduct_df[df_index]) +111 else: +112 adduct_atom = None +113 mfobj = MolecularFormula(formula_list, int(ion_charge_df[df_index]), mspeak_parent=mass_spec_obj[ms_peak_index] , ion_type=ion_type, adduct_atom=adduct_atom) +114 mfobj.is_isotopologue = bool(is_isotopologue_df[df_index]) +115 mass_spec_obj[ms_peak_index].add_molecular_formula(mfobj) +116 +117 +118class ReadMassList(MassListBaseClass): +119 """ +120 The ReadMassList object reads unprocessed mass list data types +121 and returns the mass spectrum object. +122 +123 Parameters +124 ---------- +125 MassListBaseClass : class +126 The base class for reading mass list data types. +127 +128 Methods +129 ------- +130 * get_mass_spectrum(polarity, scan=0, auto_process=True, loadSettings=True). Reads mass list data types and returns the mass spectrum object. +131 +132 """ +133 +134 def get_mass_spectrum(self, polarity:int, scan:int=0, auto_process:bool=True, loadSettings:bool=True): +135 """ +136 Reads mass list data types and returns the mass spectrum object. +137 +138 Parameters +139 ---------- +140 polarity : int +141 The polarity of the mass spectrum (+1 or -1). +142 scan : int, optional +143 The scan number of the mass spectrum (default is 0). +144 auto_process : bool, optional +145 Flag indicating whether to automatically process the mass spectrum (default is True). +146 loadSettings : bool, optional +147 Flag indicating whether to load settings for the mass spectrum (default is True). +148 +149 Returns +150 ------- +151 mass_spec : MassSpecCentroid or MassSpecProfile +152 The mass spectrum object. 153 -154 self.check_columns(dataframe.columns) +154 """ 155 -156 self.clean_data_frame(dataframe) +156 # delimiter = " " or " " or "," or "\t" etc 157 -158 dataframe.rename(columns=self.parameters.header_translate, inplace=True) +158 if self.isCentroid: 159 -160 output_parameters = self.get_output_parameters(polarity) +160 dataframe = self.get_dataframe() 161 -162 mass_spec = MassSpecCentroid(dataframe.to_dict(orient='list'), output_parameters) +162 self.check_columns(dataframe.columns) 163 -164 if loadSettings: -165 self.load_settings(mass_spec, output_parameters) -166 -167 return mass_spec -168 -169 else: -170 -171 dataframe = self.get_dataframe() -172 -173 self.check_columns(dataframe.columns) +164 self.clean_data_frame(dataframe) +165 +166 dataframe.rename(columns=self.parameters.header_translate, inplace=True) +167 +168 output_parameters = self.get_output_parameters(polarity) +169 +170 mass_spec = MassSpecCentroid(dataframe.to_dict(orient='list'), output_parameters) +171 +172 if loadSettings: +173 self.load_settings(mass_spec, output_parameters) 174 -175 output_parameters = self.get_output_parameters(polarity) +175 return mass_spec 176 -177 self.clean_data_frame(dataframe) +177 else: 178 -179 dataframe.rename(columns=self.parameters.header_translate, inplace=True) +179 dataframe = self.get_dataframe() 180 -181 mass_spec = MassSpecProfile(dataframe.to_dict(orient='list'), output_parameters, auto_process=auto_process) +181 self.check_columns(dataframe.columns) 182 -183 if loadSettings: -184 self.load_settings(mass_spec, output_parameters) -185 -186 return mass_spec -187 +183 output_parameters = self.get_output_parameters(polarity) +184 +185 self.clean_data_frame(dataframe) +186 +187 dataframe.rename(columns=self.parameters.header_translate, inplace=True) 188 -189class ReadBrukerXMLList(MassListBaseClass): -190 """ -191 The ReadBrukerXMLList object reads Bruker XML objects -192 and returns the mass spectrum object. -193 See MassListBaseClass for details -194 -195 Parameters -196 ---------- -197 MassListBaseClass : class -198 The base class for reading mass list data types and returning the mass spectrum object. -199 -200 Methods -201 ------- -202 * get_mass_spectrum(polarity: bool = None, scan: int = 0, auto_process: bool = True, loadSettings: bool = True). Reads mass list data types and returns the mass spectrum object. -203 -204 """ -205 -206 def get_mass_spectrum(self, polarity: bool = None, scan: int = 0, auto_process: bool = True, loadSettings: bool = True): -207 """ -208 Reads mass list data types and returns the mass spectrum object. -209 -210 Parameters -211 ---------- -212 polarity : bool, optional -213 The polarity of the mass spectrum. Can be +1 or -1. If not provided, it will be determined from the XML file. -214 scan : int, optional -215 The scan number of the mass spectrum. Default is 0. -216 auto_process : bool, optional -217 Whether to automatically process the mass spectrum. Default is True. -218 loadSettings : bool, optional -219 Whether to load the settings for the mass spectrum. Default is True. -220 -221 Returns -222 ------- -223 mass_spec : MassSpecCentroid -224 The mass spectrum object representing the centroided mass spectrum. -225 """ -226 # delimiter = " " or " " or "," or "\t" etc -227 -228 if polarity == None: -229 polarity = self.get_xml_polarity() -230 dataframe = self.get_dataframe() -231 -232 self.check_columns(dataframe.columns) -233 -234 self.clean_data_frame(dataframe) +189 mass_spec = MassSpecProfile(dataframe.to_dict(orient='list'), output_parameters, auto_process=auto_process) +190 +191 if loadSettings: +192 self.load_settings(mass_spec, output_parameters) +193 +194 return mass_spec +195 +196 +197class ReadBrukerXMLList(MassListBaseClass): +198 """ +199 The ReadBrukerXMLList object reads Bruker XML objects +200 and returns the mass spectrum object. +201 See MassListBaseClass for details +202 +203 Parameters +204 ---------- +205 MassListBaseClass : class +206 The base class for reading mass list data types and returning the mass spectrum object. +207 +208 Methods +209 ------- +210 * get_mass_spectrum(polarity: bool = None, scan: int = 0, auto_process: bool = True, loadSettings: bool = True). Reads mass list data types and returns the mass spectrum object. +211 +212 """ +213 +214 def get_mass_spectrum(self, polarity: bool = None, scan: int = 0, auto_process: bool = True, loadSettings: bool = True): +215 """ +216 Reads mass list data types and returns the mass spectrum object. +217 +218 Parameters +219 ---------- +220 polarity : bool, optional +221 The polarity of the mass spectrum. Can be +1 or -1. If not provided, it will be determined from the XML file. +222 scan : int, optional +223 The scan number of the mass spectrum. Default is 0. +224 auto_process : bool, optional +225 Whether to automatically process the mass spectrum. Default is True. +226 loadSettings : bool, optional +227 Whether to load the settings for the mass spectrum. Default is True. +228 +229 Returns +230 ------- +231 mass_spec : MassSpecCentroid +232 The mass spectrum object representing the centroided mass spectrum. +233 """ +234 # delimiter = " " or " " or "," or "\t" etc 235 -236 dataframe.rename(columns=self.parameters.header_translate, inplace=True) -237 -238 output_parameters = self.get_output_parameters(polarity) +236 if polarity == None: +237 polarity = self.get_xml_polarity() +238 dataframe = self.get_dataframe() 239 -240 mass_spec = MassSpecCentroid(dataframe.to_dict(orient='list'), output_parameters) +240 self.check_columns(dataframe.columns) 241 -242 if loadSettings: -243 self.load_settings(mass_spec, output_parameters) -244 -245 return mass_spec +242 self.clean_data_frame(dataframe) +243 +244 dataframe.rename(columns=self.parameters.header_translate, inplace=True) +245 +246 output_parameters = self.get_output_parameters(polarity) +247 +248 mass_spec = MassSpecCentroid(dataframe.to_dict(orient='list'), output_parameters) +249 +250 if loadSettings: +251 self.load_settings(mass_spec, output_parameters) +252 +253 return mass_spec

    @@ -417,28 +425,36 @@

    84 ion_type_df = dataframe["Ion Type"] 85 ion_charge_df = dataframe["Ion Charge"] 86 is_isotopologue_df = dataframe['Is Isotopologue'] - 87 - 88 mass_spec_mz_exp_list = mass_spec_obj.mz_exp - 89 - 90 for df_index, mz_exp in enumerate(mz_exp_df): + 87 if 'Adduct' in dataframe: + 88 adduct_df = dataframe['Adduct'] + 89 else: + 90 adduct_df = None 91 - 92 counts = 0 + 92 mass_spec_mz_exp_list = mass_spec_obj.mz_exp 93 - 94 ms_peak_index = list(mass_spec_mz_exp_list).index(float(mz_exp)) + 94 for df_index, mz_exp in enumerate(mz_exp_df): 95 - 96 if 'Is Isotopologue' in dataframe: + 96 counts = 0 97 - 98 atoms = list(formula_df.columns.astype(str)) - 99 counts = list(formula_df.iloc[df_index].astype(int)) -100 -101 formula_list = [sub[item] for item in range(len(atoms)) -102 for sub in [atoms, counts]] -103 if sum(counts) > 0: + 98 ms_peak_index = list(mass_spec_mz_exp_list).index(float(mz_exp)) + 99 +100 if 'Is Isotopologue' in dataframe: +101 +102 atoms = list(formula_df.columns.astype(str)) +103 counts = list(formula_df.iloc[df_index].astype(int)) 104 -105 ion_type = str(Labels.ion_type_translate.get(ion_type_df[df_index])) -106 mfobj = MolecularFormula(formula_list, int(ion_charge_df[df_index]), mspeak_parent=mass_spec_obj[ms_peak_index] , ion_type=ion_type) -107 mfobj.is_isotopologue = bool(is_isotopologue_df[df_index]) -108 mass_spec_obj[ms_peak_index].add_molecular_formula(mfobj) +105 formula_list = [sub[item] for item in range(len(atoms)) +106 for sub in [atoms, counts]] +107 if sum(counts) > 0: +108 +109 ion_type = str(Labels.ion_type_translate.get(ion_type_df[df_index])) +110 if adduct_df is not None: +111 adduct_atom = str(adduct_df[df_index]) +112 else: +113 adduct_atom = None +114 mfobj = MolecularFormula(formula_list, int(ion_charge_df[df_index]), mspeak_parent=mass_spec_obj[ms_peak_index] , ion_type=ion_type, adduct_atom=adduct_atom) +115 mfobj.is_isotopologue = bool(is_isotopologue_df[df_index]) +116 mass_spec_obj[ms_peak_index].add_molecular_formula(mfobj) @@ -564,28 +580,36 @@

    Raises
    84 ion_type_df = dataframe["Ion Type"] 85 ion_charge_df = dataframe["Ion Charge"] 86 is_isotopologue_df = dataframe['Is Isotopologue'] - 87 - 88 mass_spec_mz_exp_list = mass_spec_obj.mz_exp - 89 - 90 for df_index, mz_exp in enumerate(mz_exp_df): + 87 if 'Adduct' in dataframe: + 88 adduct_df = dataframe['Adduct'] + 89 else: + 90 adduct_df = None 91 - 92 counts = 0 + 92 mass_spec_mz_exp_list = mass_spec_obj.mz_exp 93 - 94 ms_peak_index = list(mass_spec_mz_exp_list).index(float(mz_exp)) + 94 for df_index, mz_exp in enumerate(mz_exp_df): 95 - 96 if 'Is Isotopologue' in dataframe: + 96 counts = 0 97 - 98 atoms = list(formula_df.columns.astype(str)) - 99 counts = list(formula_df.iloc[df_index].astype(int)) -100 -101 formula_list = [sub[item] for item in range(len(atoms)) -102 for sub in [atoms, counts]] -103 if sum(counts) > 0: + 98 ms_peak_index = list(mass_spec_mz_exp_list).index(float(mz_exp)) + 99 +100 if 'Is Isotopologue' in dataframe: +101 +102 atoms = list(formula_df.columns.astype(str)) +103 counts = list(formula_df.iloc[df_index].astype(int)) 104 -105 ion_type = str(Labels.ion_type_translate.get(ion_type_df[df_index])) -106 mfobj = MolecularFormula(formula_list, int(ion_charge_df[df_index]), mspeak_parent=mass_spec_obj[ms_peak_index] , ion_type=ion_type) -107 mfobj.is_isotopologue = bool(is_isotopologue_df[df_index]) -108 mass_spec_obj[ms_peak_index].add_molecular_formula(mfobj) +105 formula_list = [sub[item] for item in range(len(atoms)) +106 for sub in [atoms, counts]] +107 if sum(counts) > 0: +108 +109 ion_type = str(Labels.ion_type_translate.get(ion_type_df[df_index])) +110 if adduct_df is not None: +111 adduct_atom = str(adduct_df[df_index]) +112 else: +113 adduct_atom = None +114 mfobj = MolecularFormula(formula_list, int(ion_charge_df[df_index]), mspeak_parent=mass_spec_obj[ms_peak_index] , ion_type=ion_type, adduct_atom=adduct_atom) +115 mfobj.is_isotopologue = bool(is_isotopologue_df[df_index]) +116 mass_spec_obj[ms_peak_index].add_molecular_formula(mfobj) @@ -646,83 +670,83 @@
    Inherited Members
    -
    111class ReadMassList(MassListBaseClass):
    -112    """
    -113    The ReadMassList object reads unprocessed mass list data types
    -114    and returns the mass spectrum object.
    -115
    -116    Parameters
    -117    ----------
    -118    MassListBaseClass : class
    -119        The base class for reading mass list data types.
    -120
    -121    Methods
    -122    -------
    -123    * get_mass_spectrum(polarity, scan=0, auto_process=True, loadSettings=True). Reads mass list data types and returns the mass spectrum object.
    -124
    -125    """
    -126
    -127    def get_mass_spectrum(self, polarity:int, scan:int=0, auto_process:bool=True, loadSettings:bool=True):
    -128        """
    -129        Reads mass list data types and returns the mass spectrum object.
    -130
    -131        Parameters
    -132        ----------
    -133        polarity : int
    -134            The polarity of the mass spectrum (+1 or -1).
    -135        scan : int, optional
    -136            The scan number of the mass spectrum (default is 0).
    -137        auto_process : bool, optional
    -138            Flag indicating whether to automatically process the mass spectrum (default is True).
    -139        loadSettings : bool, optional
    -140            Flag indicating whether to load settings for the mass spectrum (default is True).
    -141
    -142        Returns
    -143        -------
    -144        mass_spec : MassSpecCentroid or MassSpecProfile
    -145            The mass spectrum object.
    -146
    -147        """
    -148
    -149        # delimiter = "  " or " " or  "," or "\t" etc
    -150
    -151        if self.isCentroid:
    -152
    -153            dataframe = self.get_dataframe()
    +            
    119class ReadMassList(MassListBaseClass):
    +120    """
    +121    The ReadMassList object reads unprocessed mass list data types
    +122    and returns the mass spectrum object.
    +123
    +124    Parameters
    +125    ----------
    +126    MassListBaseClass : class
    +127        The base class for reading mass list data types.
    +128
    +129    Methods
    +130    -------
    +131    * get_mass_spectrum(polarity, scan=0, auto_process=True, loadSettings=True). Reads mass list data types and returns the mass spectrum object.
    +132
    +133    """
    +134
    +135    def get_mass_spectrum(self, polarity:int, scan:int=0, auto_process:bool=True, loadSettings:bool=True):
    +136        """
    +137        Reads mass list data types and returns the mass spectrum object.
    +138
    +139        Parameters
    +140        ----------
    +141        polarity : int
    +142            The polarity of the mass spectrum (+1 or -1).
    +143        scan : int, optional
    +144            The scan number of the mass spectrum (default is 0).
    +145        auto_process : bool, optional
    +146            Flag indicating whether to automatically process the mass spectrum (default is True).
    +147        loadSettings : bool, optional
    +148            Flag indicating whether to load settings for the mass spectrum (default is True).
    +149
    +150        Returns
    +151        -------
    +152        mass_spec : MassSpecCentroid or MassSpecProfile
    +153            The mass spectrum object.
     154
    -155            self.check_columns(dataframe.columns)
    +155        """
     156
    -157            self.clean_data_frame(dataframe)
    +157        # delimiter = "  " or " " or  "," or "\t" etc
     158
    -159            dataframe.rename(columns=self.parameters.header_translate, inplace=True)
    +159        if self.isCentroid:
     160
    -161            output_parameters = self.get_output_parameters(polarity)
    +161            dataframe = self.get_dataframe()
     162
    -163            mass_spec = MassSpecCentroid(dataframe.to_dict(orient='list'), output_parameters)
    +163            self.check_columns(dataframe.columns)
     164
    -165            if loadSettings:
    -166                self.load_settings(mass_spec, output_parameters)
    -167
    -168            return mass_spec
    -169
    -170        else:
    -171
    -172            dataframe = self.get_dataframe()
    -173
    -174            self.check_columns(dataframe.columns)
    +165            self.clean_data_frame(dataframe)
    +166
    +167            dataframe.rename(columns=self.parameters.header_translate, inplace=True)
    +168
    +169            output_parameters = self.get_output_parameters(polarity)
    +170
    +171            mass_spec = MassSpecCentroid(dataframe.to_dict(orient='list'), output_parameters)
    +172
    +173            if loadSettings:
    +174                self.load_settings(mass_spec, output_parameters)
     175
    -176            output_parameters = self.get_output_parameters(polarity)
    +176            return mass_spec
     177
    -178            self.clean_data_frame(dataframe)
    +178        else:
     179
    -180            dataframe.rename(columns=self.parameters.header_translate, inplace=True)
    +180            dataframe = self.get_dataframe()
     181
    -182            mass_spec = MassSpecProfile(dataframe.to_dict(orient='list'), output_parameters, auto_process=auto_process)
    +182            self.check_columns(dataframe.columns)
     183
    -184            if loadSettings:
    -185                self.load_settings(mass_spec, output_parameters)
    -186
    -187            return mass_spec
    +184            output_parameters = self.get_output_parameters(polarity)
    +185
    +186            self.clean_data_frame(dataframe)
    +187
    +188            dataframe.rename(columns=self.parameters.header_translate, inplace=True)
    +189
    +190            mass_spec = MassSpecProfile(dataframe.to_dict(orient='list'), output_parameters, auto_process=auto_process)
    +191
    +192            if loadSettings:
    +193                self.load_settings(mass_spec, output_parameters)
    +194
    +195            return mass_spec
     
    @@ -755,67 +779,67 @@
    Methods
    -
    127    def get_mass_spectrum(self, polarity:int, scan:int=0, auto_process:bool=True, loadSettings:bool=True):
    -128        """
    -129        Reads mass list data types and returns the mass spectrum object.
    -130
    -131        Parameters
    -132        ----------
    -133        polarity : int
    -134            The polarity of the mass spectrum (+1 or -1).
    -135        scan : int, optional
    -136            The scan number of the mass spectrum (default is 0).
    -137        auto_process : bool, optional
    -138            Flag indicating whether to automatically process the mass spectrum (default is True).
    -139        loadSettings : bool, optional
    -140            Flag indicating whether to load settings for the mass spectrum (default is True).
    -141
    -142        Returns
    -143        -------
    -144        mass_spec : MassSpecCentroid or MassSpecProfile
    -145            The mass spectrum object.
    -146
    -147        """
    -148
    -149        # delimiter = "  " or " " or  "," or "\t" etc
    -150
    -151        if self.isCentroid:
    -152
    -153            dataframe = self.get_dataframe()
    +            
    135    def get_mass_spectrum(self, polarity:int, scan:int=0, auto_process:bool=True, loadSettings:bool=True):
    +136        """
    +137        Reads mass list data types and returns the mass spectrum object.
    +138
    +139        Parameters
    +140        ----------
    +141        polarity : int
    +142            The polarity of the mass spectrum (+1 or -1).
    +143        scan : int, optional
    +144            The scan number of the mass spectrum (default is 0).
    +145        auto_process : bool, optional
    +146            Flag indicating whether to automatically process the mass spectrum (default is True).
    +147        loadSettings : bool, optional
    +148            Flag indicating whether to load settings for the mass spectrum (default is True).
    +149
    +150        Returns
    +151        -------
    +152        mass_spec : MassSpecCentroid or MassSpecProfile
    +153            The mass spectrum object.
     154
    -155            self.check_columns(dataframe.columns)
    +155        """
     156
    -157            self.clean_data_frame(dataframe)
    +157        # delimiter = "  " or " " or  "," or "\t" etc
     158
    -159            dataframe.rename(columns=self.parameters.header_translate, inplace=True)
    +159        if self.isCentroid:
     160
    -161            output_parameters = self.get_output_parameters(polarity)
    +161            dataframe = self.get_dataframe()
     162
    -163            mass_spec = MassSpecCentroid(dataframe.to_dict(orient='list'), output_parameters)
    +163            self.check_columns(dataframe.columns)
     164
    -165            if loadSettings:
    -166                self.load_settings(mass_spec, output_parameters)
    -167
    -168            return mass_spec
    -169
    -170        else:
    -171
    -172            dataframe = self.get_dataframe()
    -173
    -174            self.check_columns(dataframe.columns)
    +165            self.clean_data_frame(dataframe)
    +166
    +167            dataframe.rename(columns=self.parameters.header_translate, inplace=True)
    +168
    +169            output_parameters = self.get_output_parameters(polarity)
    +170
    +171            mass_spec = MassSpecCentroid(dataframe.to_dict(orient='list'), output_parameters)
    +172
    +173            if loadSettings:
    +174                self.load_settings(mass_spec, output_parameters)
     175
    -176            output_parameters = self.get_output_parameters(polarity)
    +176            return mass_spec
     177
    -178            self.clean_data_frame(dataframe)
    +178        else:
     179
    -180            dataframe.rename(columns=self.parameters.header_translate, inplace=True)
    +180            dataframe = self.get_dataframe()
     181
    -182            mass_spec = MassSpecProfile(dataframe.to_dict(orient='list'), output_parameters, auto_process=auto_process)
    +182            self.check_columns(dataframe.columns)
     183
    -184            if loadSettings:
    -185                self.load_settings(mass_spec, output_parameters)
    -186
    -187            return mass_spec
    +184            output_parameters = self.get_output_parameters(polarity)
    +185
    +186            self.clean_data_frame(dataframe)
    +187
    +188            dataframe.rename(columns=self.parameters.header_translate, inplace=True)
    +189
    +190            mass_spec = MassSpecProfile(dataframe.to_dict(orient='list'), output_parameters, auto_process=auto_process)
    +191
    +192            if loadSettings:
    +193                self.load_settings(mass_spec, output_parameters)
    +194
    +195            return mass_spec
     
    @@ -887,63 +911,63 @@
    Inherited Members
    -
    190class ReadBrukerXMLList(MassListBaseClass):
    -191    """
    -192    The ReadBrukerXMLList object reads Bruker XML objects
    -193    and returns the mass spectrum object.
    -194    See MassListBaseClass for details
    -195
    -196    Parameters
    -197    ----------
    -198    MassListBaseClass : class
    -199        The base class for reading mass list data types and returning the mass spectrum object.
    -200
    -201    Methods
    -202    -------
    -203    * get_mass_spectrum(polarity: bool = None, scan: int = 0, auto_process: bool = True, loadSettings: bool = True). Reads mass list data types and returns the mass spectrum object.
    -204
    -205    """
    -206
    -207    def get_mass_spectrum(self, polarity: bool = None, scan: int = 0, auto_process: bool = True, loadSettings: bool = True):
    -208        """
    -209        Reads mass list data types and returns the mass spectrum object.
    -210
    -211        Parameters
    -212        ----------
    -213        polarity : bool, optional
    -214            The polarity of the mass spectrum. Can be +1 or -1. If not provided, it will be determined from the XML file.
    -215        scan : int, optional
    -216            The scan number of the mass spectrum. Default is 0.
    -217        auto_process : bool, optional
    -218            Whether to automatically process the mass spectrum. Default is True.
    -219        loadSettings : bool, optional
    -220            Whether to load the settings for the mass spectrum. Default is True.
    -221
    -222        Returns
    -223        -------
    -224        mass_spec : MassSpecCentroid
    -225            The mass spectrum object representing the centroided mass spectrum.
    -226        """
    -227        # delimiter = "  " or " " or  "," or "\t" etc
    -228
    -229        if polarity == None:
    -230            polarity = self.get_xml_polarity()
    -231        dataframe = self.get_dataframe()
    -232
    -233        self.check_columns(dataframe.columns)
    -234
    -235        self.clean_data_frame(dataframe)
    +            
    198class ReadBrukerXMLList(MassListBaseClass):
    +199    """
    +200    The ReadBrukerXMLList object reads Bruker XML objects
    +201    and returns the mass spectrum object.
    +202    See MassListBaseClass for details
    +203
    +204    Parameters
    +205    ----------
    +206    MassListBaseClass : class
    +207        The base class for reading mass list data types and returning the mass spectrum object.
    +208
    +209    Methods
    +210    -------
    +211    * get_mass_spectrum(polarity: bool = None, scan: int = 0, auto_process: bool = True, loadSettings: bool = True). Reads mass list data types and returns the mass spectrum object.
    +212
    +213    """
    +214
    +215    def get_mass_spectrum(self, polarity: bool = None, scan: int = 0, auto_process: bool = True, loadSettings: bool = True):
    +216        """
    +217        Reads mass list data types and returns the mass spectrum object.
    +218
    +219        Parameters
    +220        ----------
    +221        polarity : bool, optional
    +222            The polarity of the mass spectrum. Can be +1 or -1. If not provided, it will be determined from the XML file.
    +223        scan : int, optional
    +224            The scan number of the mass spectrum. Default is 0.
    +225        auto_process : bool, optional
    +226            Whether to automatically process the mass spectrum. Default is True.
    +227        loadSettings : bool, optional
    +228            Whether to load the settings for the mass spectrum. Default is True.
    +229
    +230        Returns
    +231        -------
    +232        mass_spec : MassSpecCentroid
    +233            The mass spectrum object representing the centroided mass spectrum.
    +234        """
    +235        # delimiter = "  " or " " or  "," or "\t" etc
     236
    -237        dataframe.rename(columns=self.parameters.header_translate, inplace=True)
    -238
    -239        output_parameters = self.get_output_parameters(polarity)
    +237        if polarity == None:
    +238            polarity = self.get_xml_polarity()
    +239        dataframe = self.get_dataframe()
     240
    -241        mass_spec = MassSpecCentroid(dataframe.to_dict(orient='list'), output_parameters)
    +241        self.check_columns(dataframe.columns)
     242
    -243        if loadSettings:
    -244            self.load_settings(mass_spec, output_parameters)
    -245
    -246        return mass_spec
    +243        self.clean_data_frame(dataframe)
    +244
    +245        dataframe.rename(columns=self.parameters.header_translate, inplace=True)
    +246
    +247        output_parameters = self.get_output_parameters(polarity)
    +248
    +249        mass_spec = MassSpecCentroid(dataframe.to_dict(orient='list'), output_parameters)
    +250
    +251        if loadSettings:
    +252            self.load_settings(mass_spec, output_parameters)
    +253
    +254        return mass_spec
     
    @@ -977,46 +1001,46 @@
    Methods
    -
    207    def get_mass_spectrum(self, polarity: bool = None, scan: int = 0, auto_process: bool = True, loadSettings: bool = True):
    -208        """
    -209        Reads mass list data types and returns the mass spectrum object.
    -210
    -211        Parameters
    -212        ----------
    -213        polarity : bool, optional
    -214            The polarity of the mass spectrum. Can be +1 or -1. If not provided, it will be determined from the XML file.
    -215        scan : int, optional
    -216            The scan number of the mass spectrum. Default is 0.
    -217        auto_process : bool, optional
    -218            Whether to automatically process the mass spectrum. Default is True.
    -219        loadSettings : bool, optional
    -220            Whether to load the settings for the mass spectrum. Default is True.
    -221
    -222        Returns
    -223        -------
    -224        mass_spec : MassSpecCentroid
    -225            The mass spectrum object representing the centroided mass spectrum.
    -226        """
    -227        # delimiter = "  " or " " or  "," or "\t" etc
    -228
    -229        if polarity == None:
    -230            polarity = self.get_xml_polarity()
    -231        dataframe = self.get_dataframe()
    -232
    -233        self.check_columns(dataframe.columns)
    -234
    -235        self.clean_data_frame(dataframe)
    +            
    215    def get_mass_spectrum(self, polarity: bool = None, scan: int = 0, auto_process: bool = True, loadSettings: bool = True):
    +216        """
    +217        Reads mass list data types and returns the mass spectrum object.
    +218
    +219        Parameters
    +220        ----------
    +221        polarity : bool, optional
    +222            The polarity of the mass spectrum. Can be +1 or -1. If not provided, it will be determined from the XML file.
    +223        scan : int, optional
    +224            The scan number of the mass spectrum. Default is 0.
    +225        auto_process : bool, optional
    +226            Whether to automatically process the mass spectrum. Default is True.
    +227        loadSettings : bool, optional
    +228            Whether to load the settings for the mass spectrum. Default is True.
    +229
    +230        Returns
    +231        -------
    +232        mass_spec : MassSpecCentroid
    +233            The mass spectrum object representing the centroided mass spectrum.
    +234        """
    +235        # delimiter = "  " or " " or  "," or "\t" etc
     236
    -237        dataframe.rename(columns=self.parameters.header_translate, inplace=True)
    -238
    -239        output_parameters = self.get_output_parameters(polarity)
    +237        if polarity == None:
    +238            polarity = self.get_xml_polarity()
    +239        dataframe = self.get_dataframe()
     240
    -241        mass_spec = MassSpecCentroid(dataframe.to_dict(orient='list'), output_parameters)
    +241        self.check_columns(dataframe.columns)
     242
    -243        if loadSettings:
    -244            self.load_settings(mass_spec, output_parameters)
    -245
    -246        return mass_spec
    +243        self.clean_data_frame(dataframe)
    +244
    +245        dataframe.rename(columns=self.parameters.header_translate, inplace=True)
    +246
    +247        output_parameters = self.get_output_parameters(polarity)
    +248
    +249        mass_spec = MassSpecCentroid(dataframe.to_dict(orient='list'), output_parameters)
    +250
    +251        if loadSettings:
    +252            self.load_settings(mass_spec, output_parameters)
    +253
    +254        return mass_spec
     
    diff --git a/docs/corems/mass_spectrum/input/numpyArray.html b/docs/corems/mass_spectrum/input/numpyArray.html index a358f50f..af8ebf3b 100644 --- a/docs/corems/mass_spectrum/input/numpyArray.html +++ b/docs/corems/mass_spectrum/input/numpyArray.html @@ -60,92 +60,113 @@

    -
     1__author__ = "Yuri E. Corilo"
    - 2__date__ = "Oct 23, 2019"
    - 3
    - 4from corems.mass_spectrum.factory.MassSpectrumClasses import MassSpecProfile, MassSpecCentroid
    - 5from corems.encapsulation.factory.parameters import default_parameters
    - 6from corems.encapsulation.constant import Labels
    - 7
    - 8def ms_from_array_profile(mz, abundance, dataname:str, polarity:int = -1, auto_process:bool = True, data_type:str = Labels.simulated_profile):
    - 9    """
    -10    Create a MassSpecProfile object from an array of m/z values and abundance values.
    -11
    -12    Parameters:
    -13        mz (numpy.ndarray): Array of m/z values.
    -14        abundance (numpy.ndarray): Array of abundance values.
    -15        dataname (str): Name of the data.
    -16        polarity (int, optional): Polarity of the data. Defaults to -1.
    -17        auto_process (bool, optional): Flag to automatically process the data. Defaults to True.
    -18        data_type (str, optional): Type of the data. Defaults to Labels.simulated_profile.
    -19
    -20    Returns:
    -21        MassSpecProfile: The created MassSpecProfile object.
    -22    """
    -23    data_dict = {Labels.mz: mz, Labels.abundance: abundance}
    -24    
    -25    output_parameters = get_output_parameters(polarity, dataname)
    -26    
    -27    output_parameters[Labels.label] = data_type
    -28
    -29    ms = MassSpecProfile(data_dict, output_parameters, auto_process=auto_process)
    -30    
    -31    return ms
    -32
    -33def ms_from_array_centroid(mz, abundance, rp:list[float], s2n:list[float], dataname:str, polarity:int=-1, auto_process:bool=True):
    -34    """
    -35    Create a MassSpecCentroid object from an array of m/z values, abundance values, resolution power, and signal-to-noise ratio.
    -36
    -37    Parameters:
    -38        mz (numpy.ndarray): Array of m/z values.
    -39        abundance (numpy.ndarray): Array of abundance values.
    -40        rp list(float): Resolution power.
    -41        s2n list(float): Signal-to-noise ratio.
    -42        dataname (str): Name of the data.
    -43        polarity (int, optional): Polarity of the data. Defaults to -1.
    -44        auto_process (bool, optional): Flag to automatically process the data. Defaults to True.
    -45
    -46    Returns:
    -47        MassSpecCentroid: The created MassSpecCentroid object.
    -48    """
    -49    data_dict = {Labels.mz: mz, Labels.abundance: abundance, Labels.s2n : s2n, Labels.rp: rp}
    -50    
    -51    output_parameters = get_output_parameters(polarity, dataname)
    -52        
    -53    return MassSpecCentroid(data_dict, output_parameters)
    -54    
    -55def get_output_parameters(polarity:int, file_location:str):
    -56    """
    -57    Get the output parameters for creating a MassSpecProfile or MassSpecCentroid object.
    -58
    -59    Parameters:
    -60        polarity (int): Polarity of the data.
    -61        file_location (str): File location.
    -62
    -63    Returns:
    -64        dict: Output parameters.
    -65    """
    -66    d_params = default_parameters(file_location)
    -67    
    -68    d_params['analyzer'] = 'Generic Simulated'
    -69
    -70    d_params['instrument_label'] = 'Generic Simulated'
    -71
    -72    d_params["polarity"] = polarity
    -73    
    -74    d_params["filename_path"] = file_location
    -75    
    -76    d_params["mobility_scan"] = 0
    -77    
    -78    d_params["mobility_rt"] = 0
    -79    
    -80    d_params["scan_number"] = 0
    -81    
    -82    d_params["rt"] = 0
    -83
    -84    d_params[Labels.label] = Labels.simulated_profile
    -85    
    -86    return d_params
    +                        
      1__author__ = "Yuri E. Corilo"
    +  2__date__ = "Oct 23, 2019"
    +  3
    +  4from corems.mass_spectrum.factory.MassSpectrumClasses import MassSpecProfile, MassSpecCentroid
    +  5from corems.encapsulation.factory.parameters import default_parameters
    +  6from corems.encapsulation.constant import Labels
    +  7
    +  8def ms_from_array_profile(mz, abundance, dataname:str, polarity:int = -1, auto_process:bool = True, data_type:str = Labels.simulated_profile):
    +  9    """Create a MassSpecProfile object from an array of m/z values and abundance values.
    + 10
    + 11    Parameters
    + 12    ----------
    + 13    mz : numpy.ndarray
    + 14        Array of m/z values.
    + 15    abundance : numpy.ndarray
    + 16        Array of abundance values.
    + 17    dataname : str
    + 18        Name of the data.
    + 19    polarity : int, optional
    + 20        Polarity of the data. The default is -1.
    + 21    auto_process : bool, optional
    + 22        Flag to automatically process the data. The default is True.
    + 23    data_type : str, optional
    + 24        Type of the data. The default is Labels.simulated_profile.
    + 25
    + 26    Returns
    + 27    -------
    + 28    MassSpecProfile
    + 29        The created MassSpecProfile object.
    + 30    """
    + 31    data_dict = {Labels.mz: mz, Labels.abundance: abundance}
    + 32    
    + 33    output_parameters = get_output_parameters(polarity, dataname)
    + 34    
    + 35    output_parameters[Labels.label] = data_type
    + 36
    + 37    ms = MassSpecProfile(data_dict, output_parameters, auto_process=auto_process)
    + 38    
    + 39    return ms
    + 40
    + 41def ms_from_array_centroid(mz, abundance, rp:list[float], s2n:list[float], dataname:str, polarity:int=-1, auto_process:bool=True):
    + 42    """Create a MassSpecCentroid object from an array of m/z values, abundance values, resolution power, and signal-to-noise ratio.
    + 43
    + 44    Parameters
    + 45    ----------
    + 46    mz : numpy.ndarray
    + 47        Array of m/z values.
    + 48    abundance : numpy.ndarray
    + 49        Array of abundance values.
    + 50    rp : list(float)
    + 51        List of resolving power values.
    + 52    s2n : list(float)
    + 53        List of signal-to-noise ratio values.
    + 54    dataname : str
    + 55        Name of the data.
    + 56    polarity : int, optional
    + 57        Polarity of the data. The default is -1.
    + 58    auto_process : bool, optional
    + 59
    + 60    Returns
    + 61    -------
    + 62    MassSpecCentroid
    + 63        The created MassSpecCentroid object.
    + 64    """
    + 65    data_dict = {Labels.mz: mz, Labels.abundance: abundance, Labels.s2n : s2n, Labels.rp: rp}
    + 66    
    + 67    output_parameters = get_output_parameters(polarity, dataname)
    + 68    output_parameters[Labels.label] = Labels.corems_centroid
    + 69    
    + 70    return MassSpecCentroid(data_dict, output_parameters, auto_process)
    + 71    
    + 72def get_output_parameters(polarity:int, file_location:str):
    + 73    """Generate the output parameters for creating a MassSpecProfile or MassSpecCentroid object.
    + 74
    + 75    Parameters
    + 76    ----------
    + 77    polarity : int
    + 78        Polarity of the data.
    + 79    file_location : str
    + 80        File location.
    + 81
    + 82    Returns
    + 83    -------
    + 84    dict
    + 85        Output parameters.
    + 86    """
    + 87    d_params = default_parameters(file_location)
    + 88    
    + 89    d_params['analyzer'] = 'Generic Simulated'
    + 90
    + 91    d_params['instrument_label'] = 'Generic Simulated'
    + 92
    + 93    d_params["polarity"] = polarity
    + 94    
    + 95    d_params["filename_path"] = file_location
    + 96    
    + 97    d_params["mobility_scan"] = 0
    + 98    
    + 99    d_params["mobility_rt"] = 0
    +100    
    +101    d_params["scan_number"] = 0
    +102    
    +103    d_params["rt"] = 0
    +104
    +105    d_params[Labels.label] = Labels.simulated_profile
    +106    
    +107    return d_params
     
    @@ -162,44 +183,64 @@

    10def ms_from_array_profile(mz, abundance, dataname:str, polarity:int = -1, auto_process:bool = True, data_type:str = Labels.simulated_profile):
    -11    """
    -12    Create a MassSpecProfile object from an array of m/z values and abundance values.
    -13
    -14    Parameters:
    -15        mz (numpy.ndarray): Array of m/z values.
    -16        abundance (numpy.ndarray): Array of abundance values.
    -17        dataname (str): Name of the data.
    -18        polarity (int, optional): Polarity of the data. Defaults to -1.
    -19        auto_process (bool, optional): Flag to automatically process the data. Defaults to True.
    -20        data_type (str, optional): Type of the data. Defaults to Labels.simulated_profile.
    -21
    -22    Returns:
    -23        MassSpecProfile: The created MassSpecProfile object.
    -24    """
    -25    data_dict = {Labels.mz: mz, Labels.abundance: abundance}
    -26    
    -27    output_parameters = get_output_parameters(polarity, dataname)
    -28    
    -29    output_parameters[Labels.label] = data_type
    -30
    -31    ms = MassSpecProfile(data_dict, output_parameters, auto_process=auto_process)
    -32    
    -33    return ms
    +11    """Create a MassSpecProfile object from an array of m/z values and abundance values.
    +12
    +13    Parameters
    +14    ----------
    +15    mz : numpy.ndarray
    +16        Array of m/z values.
    +17    abundance : numpy.ndarray
    +18        Array of abundance values.
    +19    dataname : str
    +20        Name of the data.
    +21    polarity : int, optional
    +22        Polarity of the data. The default is -1.
    +23    auto_process : bool, optional
    +24        Flag to automatically process the data. The default is True.
    +25    data_type : str, optional
    +26        Type of the data. The default is Labels.simulated_profile.
    +27
    +28    Returns
    +29    -------
    +30    MassSpecProfile
    +31        The created MassSpecProfile object.
    +32    """
    +33    data_dict = {Labels.mz: mz, Labels.abundance: abundance}
    +34    
    +35    output_parameters = get_output_parameters(polarity, dataname)
    +36    
    +37    output_parameters[Labels.label] = data_type
    +38
    +39    ms = MassSpecProfile(data_dict, output_parameters, auto_process=auto_process)
    +40    
    +41    return ms
     

    Create a MassSpecProfile object from an array of m/z values and abundance values.

    -

    Parameters: - mz (numpy.ndarray): Array of m/z values. - abundance (numpy.ndarray): Array of abundance values. - dataname (str): Name of the data. - polarity (int, optional): Polarity of the data. Defaults to -1. - auto_process (bool, optional): Flag to automatically process the data. Defaults to True. - data_type (str, optional): Type of the data. Defaults to Labels.simulated_profile.

    - -

    Returns: - MassSpecProfile: The created MassSpecProfile object.

    +
    Parameters
    + +
      +
    • mz (numpy.ndarray): +Array of m/z values.
    • +
    • abundance (numpy.ndarray): +Array of abundance values.
    • +
    • dataname (str): +Name of the data.
    • +
    • polarity (int, optional): +Polarity of the data. The default is -1.
    • +
    • auto_process (bool, optional): +Flag to automatically process the data. The default is True.
    • +
    • data_type (str, optional): +Type of the data. The default is Labels.simulated_profile.
    • +
    + +
    Returns
    + +
      +
    • MassSpecProfile: The created MassSpecProfile object.
    • +
    @@ -215,43 +256,64 @@

    -
    35def ms_from_array_centroid(mz, abundance, rp:list[float], s2n:list[float], dataname:str, polarity:int=-1, auto_process:bool=True):
    -36    """
    -37    Create a MassSpecCentroid object from an array of m/z values, abundance values, resolution power, and signal-to-noise ratio.
    -38
    -39    Parameters:
    -40        mz (numpy.ndarray): Array of m/z values.
    -41        abundance (numpy.ndarray): Array of abundance values.
    -42        rp list(float): Resolution power.
    -43        s2n list(float): Signal-to-noise ratio.
    -44        dataname (str): Name of the data.
    -45        polarity (int, optional): Polarity of the data. Defaults to -1.
    -46        auto_process (bool, optional): Flag to automatically process the data. Defaults to True.
    -47
    -48    Returns:
    -49        MassSpecCentroid: The created MassSpecCentroid object.
    -50    """
    -51    data_dict = {Labels.mz: mz, Labels.abundance: abundance, Labels.s2n : s2n, Labels.rp: rp}
    -52    
    -53    output_parameters = get_output_parameters(polarity, dataname)
    -54        
    -55    return MassSpecCentroid(data_dict, output_parameters)
    +            
    43def ms_from_array_centroid(mz, abundance, rp:list[float], s2n:list[float], dataname:str, polarity:int=-1, auto_process:bool=True):
    +44    """Create a MassSpecCentroid object from an array of m/z values, abundance values, resolution power, and signal-to-noise ratio.
    +45
    +46    Parameters
    +47    ----------
    +48    mz : numpy.ndarray
    +49        Array of m/z values.
    +50    abundance : numpy.ndarray
    +51        Array of abundance values.
    +52    rp : list(float)
    +53        List of resolving power values.
    +54    s2n : list(float)
    +55        List of signal-to-noise ratio values.
    +56    dataname : str
    +57        Name of the data.
    +58    polarity : int, optional
    +59        Polarity of the data. The default is -1.
    +60    auto_process : bool, optional
    +61
    +62    Returns
    +63    -------
    +64    MassSpecCentroid
    +65        The created MassSpecCentroid object.
    +66    """
    +67    data_dict = {Labels.mz: mz, Labels.abundance: abundance, Labels.s2n : s2n, Labels.rp: rp}
    +68    
    +69    output_parameters = get_output_parameters(polarity, dataname)
    +70    output_parameters[Labels.label] = Labels.corems_centroid
    +71    
    +72    return MassSpecCentroid(data_dict, output_parameters, auto_process)
     

    Create a MassSpecCentroid object from an array of m/z values, abundance values, resolution power, and signal-to-noise ratio.

    -

    Parameters: - mz (numpy.ndarray): Array of m/z values. - abundance (numpy.ndarray): Array of abundance values. - rp list(float): Resolution power. - s2n list(float): Signal-to-noise ratio. - dataname (str): Name of the data. - polarity (int, optional): Polarity of the data. Defaults to -1. - auto_process (bool, optional): Flag to automatically process the data. Defaults to True.

    - -

    Returns: - MassSpecCentroid: The created MassSpecCentroid object.

    +
    Parameters
    + +
      +
    • mz (numpy.ndarray): +Array of m/z values.
    • +
    • abundance (numpy.ndarray): +Array of abundance values.
    • +
    • rp (list(float)): +List of resolving power values.
    • +
    • s2n (list(float)): +List of signal-to-noise ratio values.
    • +
    • dataname (str): +Name of the data.
    • +
    • polarity (int, optional): +Polarity of the data. The default is -1.
    • +
    • auto_process (bool, optional):
    • +
    + +
    Returns
    + +
      +
    • MassSpecCentroid: The created MassSpecCentroid object.
    • +
    @@ -267,49 +329,61 @@

    -
    57def get_output_parameters(polarity:int, file_location:str):
    -58    """
    -59    Get the output parameters for creating a MassSpecProfile or MassSpecCentroid object.
    -60
    -61    Parameters:
    -62        polarity (int): Polarity of the data.
    -63        file_location (str): File location.
    -64
    -65    Returns:
    -66        dict: Output parameters.
    -67    """
    -68    d_params = default_parameters(file_location)
    -69    
    -70    d_params['analyzer'] = 'Generic Simulated'
    -71
    -72    d_params['instrument_label'] = 'Generic Simulated'
    -73
    -74    d_params["polarity"] = polarity
    -75    
    -76    d_params["filename_path"] = file_location
    -77    
    -78    d_params["mobility_scan"] = 0
    -79    
    -80    d_params["mobility_rt"] = 0
    -81    
    -82    d_params["scan_number"] = 0
    -83    
    -84    d_params["rt"] = 0
    -85
    -86    d_params[Labels.label] = Labels.simulated_profile
    -87    
    -88    return d_params
    +            
     74def get_output_parameters(polarity:int, file_location:str):
    + 75    """Generate the output parameters for creating a MassSpecProfile or MassSpecCentroid object.
    + 76
    + 77    Parameters
    + 78    ----------
    + 79    polarity : int
    + 80        Polarity of the data.
    + 81    file_location : str
    + 82        File location.
    + 83
    + 84    Returns
    + 85    -------
    + 86    dict
    + 87        Output parameters.
    + 88    """
    + 89    d_params = default_parameters(file_location)
    + 90    
    + 91    d_params['analyzer'] = 'Generic Simulated'
    + 92
    + 93    d_params['instrument_label'] = 'Generic Simulated'
    + 94
    + 95    d_params["polarity"] = polarity
    + 96    
    + 97    d_params["filename_path"] = file_location
    + 98    
    + 99    d_params["mobility_scan"] = 0
    +100    
    +101    d_params["mobility_rt"] = 0
    +102    
    +103    d_params["scan_number"] = 0
    +104    
    +105    d_params["rt"] = 0
    +106
    +107    d_params[Labels.label] = Labels.simulated_profile
    +108    
    +109    return d_params
     
    -

    Get the output parameters for creating a MassSpecProfile or MassSpecCentroid object.

    +

    Generate the output parameters for creating a MassSpecProfile or MassSpecCentroid object.

    + +
    Parameters
    + +
      +
    • polarity (int): +Polarity of the data.
    • +
    • file_location (str): +File location.
    • +
    -

    Parameters: - polarity (int): Polarity of the data. - file_location (str): File location.

    +
    Returns
    -

    Returns: - dict: Output parameters.

    +
      +
    • dict: Output parameters.
    • +
    diff --git a/docs/corems/mass_spectrum/output/export.html b/docs/corems/mass_spectrum/output/export.html index 1f02777f..e24f4dfd 100644 --- a/docs/corems/mass_spectrum/output/export.html +++ b/docs/corems/mass_spectrum/output/export.html @@ -230,56 +230,56 @@

    111 'O/C', 112 'Heteroatom Class', 113 'Ion Type', -114 'Is Isotopologue', -115 'Mono Isotopic Index', -116 'Molecular Formula' -117 ] -118 -119 @property -120 def output_type(self): -121 """Returns the output type of the mass spectrum.""" -122 return self._output_type -123 -124 @output_type.setter -125 def output_type(self, output_type): -126 output_types = ['excel', 'csv', 'pandas', 'hdf5'] -127 if output_type in output_types: -128 self._output_type = output_type -129 else: -130 raise TypeError( -131 'Supported types are "excel", "csv" or "pandas", %s entered' % output_type) -132 -133 def save(self): -134 """Save the mass spectrum data to the output file. -135 -136 Raises -137 ------ -138 ValueError -139 If the output type is not supported. -140 """ -141 -142 if self.output_type == 'excel': -143 self.to_excel() -144 elif self.output_type == 'csv': -145 self.to_csv() -146 elif self.output_type == 'pandas': -147 self.to_pandas() -148 elif self.output_type == 'hdf5': -149 self.to_hdf() -150 else: -151 raise ValueError( -152 "Unkown output type: %s; it can be 'excel', 'csv' or 'pandas'" % self.output_type) -153 -154 def run(self): -155 """ Run the export process. -156 -157 This method is called when the thread starts. -158 It calls the save method to perform the export.""" -159 self.save() -160 -161 def get_pandas_df(self): -162 """Returns the mass spectrum data as a pandas DataFrame.""" -163 +114 'Adduct', +115 'Is Isotopologue', +116 'Mono Isotopic Index', +117 'Molecular Formula' +118 ] +119 +120 @property +121 def output_type(self): +122 """Returns the output type of the mass spectrum.""" +123 return self._output_type +124 +125 @output_type.setter +126 def output_type(self, output_type): +127 output_types = ['excel', 'csv', 'pandas', 'hdf5'] +128 if output_type in output_types: +129 self._output_type = output_type +130 else: +131 raise TypeError( +132 'Supported types are "excel", "csv" or "pandas", %s entered' % output_type) +133 +134 def save(self): +135 """Save the mass spectrum data to the output file. +136 +137 Raises +138 ------ +139 ValueError +140 If the output type is not supported. +141 """ +142 +143 if self.output_type == 'excel': +144 self.to_excel() +145 elif self.output_type == 'csv': +146 self.to_csv() +147 elif self.output_type == 'pandas': +148 self.to_pandas() +149 elif self.output_type == 'hdf5': +150 self.to_hdf() +151 else: +152 raise ValueError( +153 "Unkown output type: %s; it can be 'excel', 'csv' or 'pandas'" % self.output_type) +154 +155 def run(self): +156 """ Run the export process. +157 +158 This method is called when the thread starts. +159 It calls the save method to perform the export.""" +160 self.save() +161 +162 def get_pandas_df(self): +163 """Returns the mass spectrum data as a pandas DataFrame.""" 164 columns = self.columns_label + self.get_all_used_atoms_in_order(self.mass_spectrum) 165 dict_data_list = self.get_list_dict_data(self.mass_spectrum) 166 df = DataFrame(dict_data_list, columns=columns) @@ -682,107 +682,110 @@

    563 'Is Isotopologue': int(mformula.is_isotopologue), 564 'Molecular Formula': eval("mformula.string{}".format(encode)) 565 } -566 -567 if mformula.is_isotopologue: -568 dict_result['Mono Isotopic Index'] = mformula.mspeak_index_mono_isotopic +566 +567 if mformula.adduct_atom: +568 dict_result['Adduct'] = eval("mformula.adduct_atom{}".format(encode)) 569 -570 for atom in self.atoms_order_list: -571 if atom in formula_dict.keys(): -572 dict_result[atom] = formula_dict.get(atom) -573 -574 dict_data_list.append(dict_result) -575 -576 score_methods = mass_spectrum.molecular_search_settings.score_methods -577 selected_score_method = mass_spectrum.molecular_search_settings.output_score_method +570 if mformula.is_isotopologue: +571 dict_result['Mono Isotopic Index'] = mformula.mspeak_index_mono_isotopic +572 +573 for atom in self.atoms_order_list: +574 if atom in formula_dict.keys(): +575 dict_result[atom] = formula_dict.get(atom) +576 +577 dict_data_list.append(dict_result) 578 -579 if selected_score_method in score_methods: -580 -581 # temp set score method as the one chosen in the output -582 current_method = mass_spectrum.molecular_search_settings.score_method -583 mass_spectrum.molecular_search_settings.score_method = selected_score_method -584 -585 for index, ms_peak in enumerate(mass_spectrum): -586 -587 # print(ms_peak.mz_exp) -588 -589 if ms_peak: -590 -591 m_formula = ms_peak.best_molecular_formula_candidate -592 -593 if m_formula: -594 -595 if not m_formula.is_isotopologue: -596 -597 add_match_dict_data(index, ms_peak, m_formula) -598 -599 for iso_mspeak_index, iso_mf_formula in m_formula.mspeak_mf_isotopologues_indexes: -600 iso_ms_peak = mass_spectrum[iso_mspeak_index] -601 add_match_dict_data(iso_mspeak_index, iso_ms_peak, iso_mf_formula) -602 else: -603 -604 if include_no_match and no_match_inline: -605 add_no_match_dict_data(index, ms_peak) +579 score_methods = mass_spectrum.molecular_search_settings.score_methods +580 selected_score_method = mass_spectrum.molecular_search_settings.output_score_method +581 +582 if selected_score_method in score_methods: +583 +584 # temp set score method as the one chosen in the output +585 current_method = mass_spectrum.molecular_search_settings.score_method +586 mass_spectrum.molecular_search_settings.score_method = selected_score_method +587 +588 for index, ms_peak in enumerate(mass_spectrum): +589 +590 # print(ms_peak.mz_exp) +591 +592 if ms_peak: +593 +594 m_formula = ms_peak.best_molecular_formula_candidate +595 +596 if m_formula: +597 +598 if not m_formula.is_isotopologue: +599 +600 add_match_dict_data(index, ms_peak, m_formula) +601 +602 for iso_mspeak_index, iso_mf_formula in m_formula.mspeak_mf_isotopologues_indexes: +603 iso_ms_peak = mass_spectrum[iso_mspeak_index] +604 add_match_dict_data(iso_mspeak_index, iso_ms_peak, iso_mf_formula) +605 else: 606 -607 if include_no_match and not no_match_inline: -608 -609 for index, ms_peak in enumerate(mass_spectrum): -610 if not ms_peak: -611 add_no_match_dict_data(index, ms_peak) -612 # reset score method as the one chosen in the output -613 mass_spectrum.molecular_search_settings.score_method = current_method -614 -615 else: -616 -617 for index, ms_peak in enumerate(mass_spectrum): -618 -619 # check if there is a molecular formula candidate for the msPeak -620 -621 if ms_peak: -622 # m_formula = ms_peak.molecular_formula_lowest_error -623 for m_formula in ms_peak: -624 -625 if mass_spectrum.molecular_search_settings.output_min_score > 0: -626 -627 if m_formula.confidence_score >= mass_spectrum.molecular_search_settings.output_min_score: -628 -629 if m_formula.is_isotopologue: # isotopologues inline -630 if include_isotopologues and isotopologue_inline: -631 add_match_dict_data(index, ms_peak, m_formula) -632 else: -633 add_match_dict_data(index, ms_peak, m_formula) # add monoisotopic peak -634 -635 # cutoff because of low score -636 else: -637 add_no_match_dict_data(index, ms_peak) -638 -639 else: -640 if m_formula.is_isotopologue: # isotopologues inline -641 if include_isotopologues and isotopologue_inline: -642 add_match_dict_data(index, ms_peak, m_formula) -643 else: -644 add_match_dict_data(index, ms_peak, m_formula) # add monoisotopic peak -645 else: -646 # include not_match -647 if include_no_match and no_match_inline: -648 add_no_match_dict_data(index, ms_peak) -649 -650 if include_isotopologues and not isotopologue_inline: -651 for index, ms_peak in enumerate(mass_spectrum): -652 for m_formula in ms_peak: -653 if m_formula.is_isotopologue: -654 if m_formula.confidence_score >= mass_spectrum.molecular_search_settings.output_min_score: -655 add_match_dict_data(index, ms_peak, m_formula) -656 -657 if include_no_match and not no_match_inline: -658 for index, ms_peak in enumerate(mass_spectrum): -659 if not ms_peak: -660 add_no_match_dict_data(index, ms_peak) -661 -662 # remove duplicated add_match data possibly introduced on the output_score_filter step -663 res = [] -664 [res.append(x) for x in dict_data_list if x not in res] -665 -666 return res +607 if include_no_match and no_match_inline: +608 add_no_match_dict_data(index, ms_peak) +609 +610 if include_no_match and not no_match_inline: +611 +612 for index, ms_peak in enumerate(mass_spectrum): +613 if not ms_peak: +614 add_no_match_dict_data(index, ms_peak) +615 # reset score method as the one chosen in the output +616 mass_spectrum.molecular_search_settings.score_method = current_method +617 +618 else: +619 +620 for index, ms_peak in enumerate(mass_spectrum): +621 +622 # check if there is a molecular formula candidate for the msPeak +623 +624 if ms_peak: +625 # m_formula = ms_peak.molecular_formula_lowest_error +626 for m_formula in ms_peak: +627 +628 if mass_spectrum.molecular_search_settings.output_min_score > 0: +629 +630 if m_formula.confidence_score >= mass_spectrum.molecular_search_settings.output_min_score: +631 +632 if m_formula.is_isotopologue: # isotopologues inline +633 if include_isotopologues and isotopologue_inline: +634 add_match_dict_data(index, ms_peak, m_formula) +635 else: +636 add_match_dict_data(index, ms_peak, m_formula) # add monoisotopic peak +637 +638 # cutoff because of low score +639 else: +640 add_no_match_dict_data(index, ms_peak) +641 +642 else: +643 if m_formula.is_isotopologue: # isotopologues inline +644 if include_isotopologues and isotopologue_inline: +645 add_match_dict_data(index, ms_peak, m_formula) +646 else: +647 add_match_dict_data(index, ms_peak, m_formula) # add monoisotopic peak +648 else: +649 # include not_match +650 if include_no_match and no_match_inline: +651 add_no_match_dict_data(index, ms_peak) +652 +653 if include_isotopologues and not isotopologue_inline: +654 for index, ms_peak in enumerate(mass_spectrum): +655 for m_formula in ms_peak: +656 if m_formula.is_isotopologue: +657 if m_formula.confidence_score >= mass_spectrum.molecular_search_settings.output_min_score: +658 add_match_dict_data(index, ms_peak, m_formula) +659 +660 if include_no_match and not no_match_inline: +661 for index, ms_peak in enumerate(mass_spectrum): +662 if not ms_peak: +663 add_no_match_dict_data(index, ms_peak) +664 +665 # remove duplicated add_match data possibly introduced on the output_score_filter step +666 res = [] +667 [res.append(x) for x in dict_data_list if x not in res] +668 +669 return res

    @@ -895,56 +898,56 @@

    112 'O/C', 113 'Heteroatom Class', 114 'Ion Type', -115 'Is Isotopologue', -116 'Mono Isotopic Index', -117 'Molecular Formula' -118 ] -119 -120 @property -121 def output_type(self): -122 """Returns the output type of the mass spectrum.""" -123 return self._output_type -124 -125 @output_type.setter -126 def output_type(self, output_type): -127 output_types = ['excel', 'csv', 'pandas', 'hdf5'] -128 if output_type in output_types: -129 self._output_type = output_type -130 else: -131 raise TypeError( -132 'Supported types are "excel", "csv" or "pandas", %s entered' % output_type) -133 -134 def save(self): -135 """Save the mass spectrum data to the output file. -136 -137 Raises -138 ------ -139 ValueError -140 If the output type is not supported. -141 """ -142 -143 if self.output_type == 'excel': -144 self.to_excel() -145 elif self.output_type == 'csv': -146 self.to_csv() -147 elif self.output_type == 'pandas': -148 self.to_pandas() -149 elif self.output_type == 'hdf5': -150 self.to_hdf() -151 else: -152 raise ValueError( -153 "Unkown output type: %s; it can be 'excel', 'csv' or 'pandas'" % self.output_type) -154 -155 def run(self): -156 """ Run the export process. -157 -158 This method is called when the thread starts. -159 It calls the save method to perform the export.""" -160 self.save() -161 -162 def get_pandas_df(self): -163 """Returns the mass spectrum data as a pandas DataFrame.""" -164 +115 'Adduct', +116 'Is Isotopologue', +117 'Mono Isotopic Index', +118 'Molecular Formula' +119 ] +120 +121 @property +122 def output_type(self): +123 """Returns the output type of the mass spectrum.""" +124 return self._output_type +125 +126 @output_type.setter +127 def output_type(self, output_type): +128 output_types = ['excel', 'csv', 'pandas', 'hdf5'] +129 if output_type in output_types: +130 self._output_type = output_type +131 else: +132 raise TypeError( +133 'Supported types are "excel", "csv" or "pandas", %s entered' % output_type) +134 +135 def save(self): +136 """Save the mass spectrum data to the output file. +137 +138 Raises +139 ------ +140 ValueError +141 If the output type is not supported. +142 """ +143 +144 if self.output_type == 'excel': +145 self.to_excel() +146 elif self.output_type == 'csv': +147 self.to_csv() +148 elif self.output_type == 'pandas': +149 self.to_pandas() +150 elif self.output_type == 'hdf5': +151 self.to_hdf() +152 else: +153 raise ValueError( +154 "Unkown output type: %s; it can be 'excel', 'csv' or 'pandas'" % self.output_type) +155 +156 def run(self): +157 """ Run the export process. +158 +159 This method is called when the thread starts. +160 It calls the save method to perform the export.""" +161 self.save() +162 +163 def get_pandas_df(self): +164 """Returns the mass spectrum data as a pandas DataFrame.""" 165 columns = self.columns_label + self.get_all_used_atoms_in_order(self.mass_spectrum) 166 dict_data_list = self.get_list_dict_data(self.mass_spectrum) 167 df = DataFrame(dict_data_list, columns=columns) @@ -1347,107 +1350,110 @@

    564 'Is Isotopologue': int(mformula.is_isotopologue), 565 'Molecular Formula': eval("mformula.string{}".format(encode)) 566 } -567 -568 if mformula.is_isotopologue: -569 dict_result['Mono Isotopic Index'] = mformula.mspeak_index_mono_isotopic +567 +568 if mformula.adduct_atom: +569 dict_result['Adduct'] = eval("mformula.adduct_atom{}".format(encode)) 570 -571 for atom in self.atoms_order_list: -572 if atom in formula_dict.keys(): -573 dict_result[atom] = formula_dict.get(atom) -574 -575 dict_data_list.append(dict_result) -576 -577 score_methods = mass_spectrum.molecular_search_settings.score_methods -578 selected_score_method = mass_spectrum.molecular_search_settings.output_score_method +571 if mformula.is_isotopologue: +572 dict_result['Mono Isotopic Index'] = mformula.mspeak_index_mono_isotopic +573 +574 for atom in self.atoms_order_list: +575 if atom in formula_dict.keys(): +576 dict_result[atom] = formula_dict.get(atom) +577 +578 dict_data_list.append(dict_result) 579 -580 if selected_score_method in score_methods: -581 -582 # temp set score method as the one chosen in the output -583 current_method = mass_spectrum.molecular_search_settings.score_method -584 mass_spectrum.molecular_search_settings.score_method = selected_score_method -585 -586 for index, ms_peak in enumerate(mass_spectrum): -587 -588 # print(ms_peak.mz_exp) -589 -590 if ms_peak: -591 -592 m_formula = ms_peak.best_molecular_formula_candidate -593 -594 if m_formula: -595 -596 if not m_formula.is_isotopologue: -597 -598 add_match_dict_data(index, ms_peak, m_formula) -599 -600 for iso_mspeak_index, iso_mf_formula in m_formula.mspeak_mf_isotopologues_indexes: -601 iso_ms_peak = mass_spectrum[iso_mspeak_index] -602 add_match_dict_data(iso_mspeak_index, iso_ms_peak, iso_mf_formula) -603 else: -604 -605 if include_no_match and no_match_inline: -606 add_no_match_dict_data(index, ms_peak) +580 score_methods = mass_spectrum.molecular_search_settings.score_methods +581 selected_score_method = mass_spectrum.molecular_search_settings.output_score_method +582 +583 if selected_score_method in score_methods: +584 +585 # temp set score method as the one chosen in the output +586 current_method = mass_spectrum.molecular_search_settings.score_method +587 mass_spectrum.molecular_search_settings.score_method = selected_score_method +588 +589 for index, ms_peak in enumerate(mass_spectrum): +590 +591 # print(ms_peak.mz_exp) +592 +593 if ms_peak: +594 +595 m_formula = ms_peak.best_molecular_formula_candidate +596 +597 if m_formula: +598 +599 if not m_formula.is_isotopologue: +600 +601 add_match_dict_data(index, ms_peak, m_formula) +602 +603 for iso_mspeak_index, iso_mf_formula in m_formula.mspeak_mf_isotopologues_indexes: +604 iso_ms_peak = mass_spectrum[iso_mspeak_index] +605 add_match_dict_data(iso_mspeak_index, iso_ms_peak, iso_mf_formula) +606 else: 607 -608 if include_no_match and not no_match_inline: -609 -610 for index, ms_peak in enumerate(mass_spectrum): -611 if not ms_peak: -612 add_no_match_dict_data(index, ms_peak) -613 # reset score method as the one chosen in the output -614 mass_spectrum.molecular_search_settings.score_method = current_method -615 -616 else: -617 -618 for index, ms_peak in enumerate(mass_spectrum): -619 -620 # check if there is a molecular formula candidate for the msPeak -621 -622 if ms_peak: -623 # m_formula = ms_peak.molecular_formula_lowest_error -624 for m_formula in ms_peak: -625 -626 if mass_spectrum.molecular_search_settings.output_min_score > 0: -627 -628 if m_formula.confidence_score >= mass_spectrum.molecular_search_settings.output_min_score: -629 -630 if m_formula.is_isotopologue: # isotopologues inline -631 if include_isotopologues and isotopologue_inline: -632 add_match_dict_data(index, ms_peak, m_formula) -633 else: -634 add_match_dict_data(index, ms_peak, m_formula) # add monoisotopic peak -635 -636 # cutoff because of low score -637 else: -638 add_no_match_dict_data(index, ms_peak) -639 -640 else: -641 if m_formula.is_isotopologue: # isotopologues inline -642 if include_isotopologues and isotopologue_inline: -643 add_match_dict_data(index, ms_peak, m_formula) -644 else: -645 add_match_dict_data(index, ms_peak, m_formula) # add monoisotopic peak -646 else: -647 # include not_match -648 if include_no_match and no_match_inline: -649 add_no_match_dict_data(index, ms_peak) -650 -651 if include_isotopologues and not isotopologue_inline: -652 for index, ms_peak in enumerate(mass_spectrum): -653 for m_formula in ms_peak: -654 if m_formula.is_isotopologue: -655 if m_formula.confidence_score >= mass_spectrum.molecular_search_settings.output_min_score: -656 add_match_dict_data(index, ms_peak, m_formula) -657 -658 if include_no_match and not no_match_inline: -659 for index, ms_peak in enumerate(mass_spectrum): -660 if not ms_peak: -661 add_no_match_dict_data(index, ms_peak) -662 -663 # remove duplicated add_match data possibly introduced on the output_score_filter step -664 res = [] -665 [res.append(x) for x in dict_data_list if x not in res] -666 -667 return res +608 if include_no_match and no_match_inline: +609 add_no_match_dict_data(index, ms_peak) +610 +611 if include_no_match and not no_match_inline: +612 +613 for index, ms_peak in enumerate(mass_spectrum): +614 if not ms_peak: +615 add_no_match_dict_data(index, ms_peak) +616 # reset score method as the one chosen in the output +617 mass_spectrum.molecular_search_settings.score_method = current_method +618 +619 else: +620 +621 for index, ms_peak in enumerate(mass_spectrum): +622 +623 # check if there is a molecular formula candidate for the msPeak +624 +625 if ms_peak: +626 # m_formula = ms_peak.molecular_formula_lowest_error +627 for m_formula in ms_peak: +628 +629 if mass_spectrum.molecular_search_settings.output_min_score > 0: +630 +631 if m_formula.confidence_score >= mass_spectrum.molecular_search_settings.output_min_score: +632 +633 if m_formula.is_isotopologue: # isotopologues inline +634 if include_isotopologues and isotopologue_inline: +635 add_match_dict_data(index, ms_peak, m_formula) +636 else: +637 add_match_dict_data(index, ms_peak, m_formula) # add monoisotopic peak +638 +639 # cutoff because of low score +640 else: +641 add_no_match_dict_data(index, ms_peak) +642 +643 else: +644 if m_formula.is_isotopologue: # isotopologues inline +645 if include_isotopologues and isotopologue_inline: +646 add_match_dict_data(index, ms_peak, m_formula) +647 else: +648 add_match_dict_data(index, ms_peak, m_formula) # add monoisotopic peak +649 else: +650 # include not_match +651 if include_no_match and no_match_inline: +652 add_no_match_dict_data(index, ms_peak) +653 +654 if include_isotopologues and not isotopologue_inline: +655 for index, ms_peak in enumerate(mass_spectrum): +656 for m_formula in ms_peak: +657 if m_formula.is_isotopologue: +658 if m_formula.confidence_score >= mass_spectrum.molecular_search_settings.output_min_score: +659 add_match_dict_data(index, ms_peak, m_formula) +660 +661 if include_no_match and not no_match_inline: +662 for index, ms_peak in enumerate(mass_spectrum): +663 if not ms_peak: +664 add_no_match_dict_data(index, ms_peak) +665 +666 # remove duplicated add_match data possibly introduced on the output_score_filter step +667 res = [] +668 [res.append(x) for x in dict_data_list if x not in res] +669 +670 return res @@ -1624,26 +1630,26 @@

    Methods
    -
    134    def save(self):
    -135        """Save the mass spectrum data to the output file.
    -136        
    -137        Raises
    -138        ------
    -139        ValueError
    -140            If the output type is not supported.
    -141        """
    -142
    -143        if self.output_type == 'excel':
    -144            self.to_excel()
    -145        elif self.output_type == 'csv':
    -146            self.to_csv()
    -147        elif self.output_type == 'pandas':
    -148            self.to_pandas()
    -149        elif self.output_type == 'hdf5':
    -150            self.to_hdf()
    -151        else:
    -152            raise ValueError(
    -153                "Unkown output type: %s; it can be 'excel', 'csv' or 'pandas'" % self.output_type)
    +            
    135    def save(self):
    +136        """Save the mass spectrum data to the output file.
    +137        
    +138        Raises
    +139        ------
    +140        ValueError
    +141            If the output type is not supported.
    +142        """
    +143
    +144        if self.output_type == 'excel':
    +145            self.to_excel()
    +146        elif self.output_type == 'csv':
    +147            self.to_csv()
    +148        elif self.output_type == 'pandas':
    +149            self.to_pandas()
    +150        elif self.output_type == 'hdf5':
    +151            self.to_hdf()
    +152        else:
    +153            raise ValueError(
    +154                "Unkown output type: %s; it can be 'excel', 'csv' or 'pandas'" % self.output_type)
     
    @@ -1669,12 +1675,12 @@
    Raises
    -
    155    def run(self):
    -156        """ Run the export process.
    -157        
    -158        This method is called when the thread starts.
    -159        It calls the save method to perform the export."""
    -160        self.save()
    +            
    156    def run(self):
    +157        """ Run the export process.
    +158        
    +159        This method is called when the thread starts.
    +160        It calls the save method to perform the export."""
    +161        self.save()
     
    @@ -1697,9 +1703,8 @@
    Raises
    -
    162    def get_pandas_df(self):
    -163        """Returns the mass spectrum data as a pandas DataFrame."""
    -164
    +            
    163    def get_pandas_df(self):
    +164        """Returns the mass spectrum data as a pandas DataFrame."""
     165        columns = self.columns_label + self.get_all_used_atoms_in_order(self.mass_spectrum)
     166        dict_data_list = self.get_list_dict_data(self.mass_spectrum)
     167        df = DataFrame(dict_data_list, columns=columns)
    @@ -2401,107 +2406,110 @@ 
    Returns
    564 'Is Isotopologue': int(mformula.is_isotopologue), 565 'Molecular Formula': eval("mformula.string{}".format(encode)) 566 } -567 -568 if mformula.is_isotopologue: -569 dict_result['Mono Isotopic Index'] = mformula.mspeak_index_mono_isotopic +567 +568 if mformula.adduct_atom: +569 dict_result['Adduct'] = eval("mformula.adduct_atom{}".format(encode)) 570 -571 for atom in self.atoms_order_list: -572 if atom in formula_dict.keys(): -573 dict_result[atom] = formula_dict.get(atom) -574 -575 dict_data_list.append(dict_result) -576 -577 score_methods = mass_spectrum.molecular_search_settings.score_methods -578 selected_score_method = mass_spectrum.molecular_search_settings.output_score_method +571 if mformula.is_isotopologue: +572 dict_result['Mono Isotopic Index'] = mformula.mspeak_index_mono_isotopic +573 +574 for atom in self.atoms_order_list: +575 if atom in formula_dict.keys(): +576 dict_result[atom] = formula_dict.get(atom) +577 +578 dict_data_list.append(dict_result) 579 -580 if selected_score_method in score_methods: -581 -582 # temp set score method as the one chosen in the output -583 current_method = mass_spectrum.molecular_search_settings.score_method -584 mass_spectrum.molecular_search_settings.score_method = selected_score_method -585 -586 for index, ms_peak in enumerate(mass_spectrum): -587 -588 # print(ms_peak.mz_exp) -589 -590 if ms_peak: -591 -592 m_formula = ms_peak.best_molecular_formula_candidate -593 -594 if m_formula: -595 -596 if not m_formula.is_isotopologue: -597 -598 add_match_dict_data(index, ms_peak, m_formula) -599 -600 for iso_mspeak_index, iso_mf_formula in m_formula.mspeak_mf_isotopologues_indexes: -601 iso_ms_peak = mass_spectrum[iso_mspeak_index] -602 add_match_dict_data(iso_mspeak_index, iso_ms_peak, iso_mf_formula) -603 else: -604 -605 if include_no_match and no_match_inline: -606 add_no_match_dict_data(index, ms_peak) +580 score_methods = mass_spectrum.molecular_search_settings.score_methods +581 selected_score_method = mass_spectrum.molecular_search_settings.output_score_method +582 +583 if selected_score_method in score_methods: +584 +585 # temp set score method as the one chosen in the output +586 current_method = mass_spectrum.molecular_search_settings.score_method +587 mass_spectrum.molecular_search_settings.score_method = selected_score_method +588 +589 for index, ms_peak in enumerate(mass_spectrum): +590 +591 # print(ms_peak.mz_exp) +592 +593 if ms_peak: +594 +595 m_formula = ms_peak.best_molecular_formula_candidate +596 +597 if m_formula: +598 +599 if not m_formula.is_isotopologue: +600 +601 add_match_dict_data(index, ms_peak, m_formula) +602 +603 for iso_mspeak_index, iso_mf_formula in m_formula.mspeak_mf_isotopologues_indexes: +604 iso_ms_peak = mass_spectrum[iso_mspeak_index] +605 add_match_dict_data(iso_mspeak_index, iso_ms_peak, iso_mf_formula) +606 else: 607 -608 if include_no_match and not no_match_inline: -609 -610 for index, ms_peak in enumerate(mass_spectrum): -611 if not ms_peak: -612 add_no_match_dict_data(index, ms_peak) -613 # reset score method as the one chosen in the output -614 mass_spectrum.molecular_search_settings.score_method = current_method -615 -616 else: -617 -618 for index, ms_peak in enumerate(mass_spectrum): -619 -620 # check if there is a molecular formula candidate for the msPeak -621 -622 if ms_peak: -623 # m_formula = ms_peak.molecular_formula_lowest_error -624 for m_formula in ms_peak: -625 -626 if mass_spectrum.molecular_search_settings.output_min_score > 0: -627 -628 if m_formula.confidence_score >= mass_spectrum.molecular_search_settings.output_min_score: -629 -630 if m_formula.is_isotopologue: # isotopologues inline -631 if include_isotopologues and isotopologue_inline: -632 add_match_dict_data(index, ms_peak, m_formula) -633 else: -634 add_match_dict_data(index, ms_peak, m_formula) # add monoisotopic peak -635 -636 # cutoff because of low score -637 else: -638 add_no_match_dict_data(index, ms_peak) -639 -640 else: -641 if m_formula.is_isotopologue: # isotopologues inline -642 if include_isotopologues and isotopologue_inline: -643 add_match_dict_data(index, ms_peak, m_formula) -644 else: -645 add_match_dict_data(index, ms_peak, m_formula) # add monoisotopic peak -646 else: -647 # include not_match -648 if include_no_match and no_match_inline: -649 add_no_match_dict_data(index, ms_peak) -650 -651 if include_isotopologues and not isotopologue_inline: -652 for index, ms_peak in enumerate(mass_spectrum): -653 for m_formula in ms_peak: -654 if m_formula.is_isotopologue: -655 if m_formula.confidence_score >= mass_spectrum.molecular_search_settings.output_min_score: -656 add_match_dict_data(index, ms_peak, m_formula) -657 -658 if include_no_match and not no_match_inline: -659 for index, ms_peak in enumerate(mass_spectrum): -660 if not ms_peak: -661 add_no_match_dict_data(index, ms_peak) -662 -663 # remove duplicated add_match data possibly introduced on the output_score_filter step -664 res = [] -665 [res.append(x) for x in dict_data_list if x not in res] -666 -667 return res +608 if include_no_match and no_match_inline: +609 add_no_match_dict_data(index, ms_peak) +610 +611 if include_no_match and not no_match_inline: +612 +613 for index, ms_peak in enumerate(mass_spectrum): +614 if not ms_peak: +615 add_no_match_dict_data(index, ms_peak) +616 # reset score method as the one chosen in the output +617 mass_spectrum.molecular_search_settings.score_method = current_method +618 +619 else: +620 +621 for index, ms_peak in enumerate(mass_spectrum): +622 +623 # check if there is a molecular formula candidate for the msPeak +624 +625 if ms_peak: +626 # m_formula = ms_peak.molecular_formula_lowest_error +627 for m_formula in ms_peak: +628 +629 if mass_spectrum.molecular_search_settings.output_min_score > 0: +630 +631 if m_formula.confidence_score >= mass_spectrum.molecular_search_settings.output_min_score: +632 +633 if m_formula.is_isotopologue: # isotopologues inline +634 if include_isotopologues and isotopologue_inline: +635 add_match_dict_data(index, ms_peak, m_formula) +636 else: +637 add_match_dict_data(index, ms_peak, m_formula) # add monoisotopic peak +638 +639 # cutoff because of low score +640 else: +641 add_no_match_dict_data(index, ms_peak) +642 +643 else: +644 if m_formula.is_isotopologue: # isotopologues inline +645 if include_isotopologues and isotopologue_inline: +646 add_match_dict_data(index, ms_peak, m_formula) +647 else: +648 add_match_dict_data(index, ms_peak, m_formula) # add monoisotopic peak +649 else: +650 # include not_match +651 if include_no_match and no_match_inline: +652 add_no_match_dict_data(index, ms_peak) +653 +654 if include_isotopologues and not isotopologue_inline: +655 for index, ms_peak in enumerate(mass_spectrum): +656 for m_formula in ms_peak: +657 if m_formula.is_isotopologue: +658 if m_formula.confidence_score >= mass_spectrum.molecular_search_settings.output_min_score: +659 add_match_dict_data(index, ms_peak, m_formula) +660 +661 if include_no_match and not no_match_inline: +662 for index, ms_peak in enumerate(mass_spectrum): +663 if not ms_peak: +664 add_no_match_dict_data(index, ms_peak) +665 +666 # remove duplicated add_match data possibly introduced on the output_score_filter step +667 res = [] +668 [res.append(x) for x in dict_data_list if x not in res] +669 +670 return res
    diff --git a/docs/corems/molecular_formula/calc/MolecularFormulaCalc.html b/docs/corems/molecular_formula/calc/MolecularFormulaCalc.html index 99949a65..e870449a 100644 --- a/docs/corems/molecular_formula/calc/MolecularFormulaCalc.html +++ b/docs/corems/molecular_formula/calc/MolecularFormulaCalc.html @@ -606,168 +606,166 @@

    538 539 dbe = 1 + (0.5 * individual_dbe) 540 -541 -542 -543 if self.ion_type == Labels.adduct_ion: -544 dbe = dbe + 0.5 -545 -546 return dbe -547 -548 def _calc_kmd(self, dict_base): -549 """Calculate the Kendrick mass defect (KMD) of the molecular formula, based on the monoisotopic mass and the Kendrick mass. -550 -551 Parameters -552 ---------- -553 dict_base : dict -554 The dictionary of the base formula, e.g. {'C':1, 'H':2} -555 -556 Returns -557 ------- -558 tuple -559 The tuple of the KMD, Kendrick mass, and nominal Kendrick mass. -560 """ -561 mass = 0 -562 for atom in dict_base.keys(): -563 mass = mass + Atoms.atomic_masses.get(atom) * dict_base.get(atom) +541 if self.ion_type == Labels.adduct_ion: +542 dbe = dbe + 0.5 +543 +544 return dbe +545 +546 def _calc_kmd(self, dict_base): +547 """Calculate the Kendrick mass defect (KMD) of the molecular formula, based on the monoisotopic mass and the Kendrick mass. +548 +549 Parameters +550 ---------- +551 dict_base : dict +552 The dictionary of the base formula, e.g. {'C':1, 'H':2} +553 +554 Returns +555 ------- +556 tuple +557 The tuple of the KMD, Kendrick mass, and nominal Kendrick mass. +558 """ +559 mass = 0 +560 for atom in dict_base.keys(): +561 mass = mass + Atoms.atomic_masses.get(atom) * dict_base.get(atom) +562 +563 kendrick_mass = (int(mass)/mass)* self.mz_calc 564 -565 kendrick_mass = (int(mass)/mass)* self.mz_calc -566 -567 nominal_km =int(kendrick_mass) -568 -569 kmd = (nominal_km - kendrick_mass) * 100 -570 -571 #kmd = (nominal_km - km) * 1 -572 kmd = round(kmd,0) -573 -574 return kmd, kendrick_mass, nominal_km -575 -576 def _cal_isotopologues(self, formula_dict, min_abundance, current_abundance, ms_dynamic_range): -577 """Calculate the isotopologues for a given molecular formula. -578 -579 Parameters -580 ---------- -581 formula_dict : dict -582 The dictionary of the molecular formula. Example: {'C':10, 'H', 20, 'O', 2} -583 min_abundance : float -584 The minimum abundance. -585 current_abundance : float -586 The current monoisotopic abundance. -587 ms_dynamic_range : float -588 The dynamic range. -589 -590 -591 Notes -592 ----- -593 This is the primary function to look for isotopologues based on a monoisotopic molecular formula. -594 It needs to be expanded to include the calculation of resolving power and plot the results. -595 Use this function at runtime during the molecular identification algorithm only when a positive ID is observed to the monoisotopic ion. -596 Use this function to simulate mass spectrum (needs resolving power calculation to be fully operational). -597 It might break when adding non-conventional atoms (not yet tested). -598 This function employs the IsoSpecPy library https://github.com/MatteoLacki/IsoSpec. -599 -600 -601 """ -602 -603 #last update on 05-26-2020, Yuri E. Corilo -604 -605 # updated it to reflect min possible mass peak abundance -606 cut_off_to_IsoSpeccPy = 1-(1/ms_dynamic_range) -607 -608 #print("cut_off_to_IsoSpeccPy", cut_off_to_IsoSpeccPy, current_abundance, min_abundance, ms_dynamic_range) -609 #print(cut_off_to_IsoSpeccPy) -610 atoms_labels = (atom for atom in formula_dict.keys() if atom != Labels.ion_type and atom != 'H') -611 -612 atoms_count = [] -613 masses_list_tuples = [] -614 props_list_tuples = [] -615 all_atoms_list = [] -616 -617 for atom_label in atoms_labels: -618 -619 if not len(Atoms.isotopes.get(atom_label))>1: -620 'This atom_label has no heavy isotope' -621 atoms_count.append(formula_dict.get(atom_label)) -622 mass = Atoms.atomic_masses.get(atom_label) -623 prop = Atoms.isotopic_abundance.get(atom_label) -624 masses_list_tuples.append([mass]) -625 props_list_tuples.append([prop]) -626 all_atoms_list.append(atom_label) +565 nominal_km =int(kendrick_mass) +566 +567 kmd = (nominal_km - kendrick_mass) * 100 +568 +569 #kmd = (nominal_km - km) * 1 +570 kmd = round(kmd,0) +571 +572 return kmd, kendrick_mass, nominal_km +573 +574 def _cal_isotopologues(self, formula_dict, min_abundance, current_abundance, ms_dynamic_range): +575 """Calculate the isotopologues for a given molecular formula. +576 +577 Parameters +578 ---------- +579 formula_dict : dict +580 The dictionary of the molecular formula. Example: {'C':10, 'H', 20, 'O', 2} +581 min_abundance : float +582 The minimum abundance. +583 current_abundance : float +584 The current monoisotopic abundance. +585 ms_dynamic_range : float +586 The dynamic range. +587 +588 +589 Notes +590 ----- +591 This is the primary function to look for isotopologues based on a monoisotopic molecular formula. +592 It needs to be expanded to include the calculation of resolving power and plot the results. +593 Use this function at runtime during the molecular identification algorithm only when a positive ID is observed to the monoisotopic ion. +594 Use this function to simulate mass spectrum (needs resolving power calculation to be fully operational). +595 It might break when adding non-conventional atoms (not yet tested). +596 This function employs the IsoSpecPy library https://github.com/MatteoLacki/IsoSpec. +597 +598 +599 """ +600 +601 #last update on 05-26-2020, Yuri E. Corilo +602 +603 # updated it to reflect min possible mass peak abundance +604 cut_off_to_IsoSpeccPy = 1-(1/ms_dynamic_range) +605 +606 #print("cut_off_to_IsoSpeccPy", cut_off_to_IsoSpeccPy, current_abundance, min_abundance, ms_dynamic_range) +607 #print(cut_off_to_IsoSpeccPy) +608 atoms_labels = (atom for atom in formula_dict.keys() if atom != Labels.ion_type and atom != 'H') +609 +610 atoms_count = [] +611 masses_list_tuples = [] +612 props_list_tuples = [] +613 all_atoms_list = [] +614 +615 for atom_label in atoms_labels: +616 +617 if Atoms.isotopes.get(atom_label)[1][0] is None: +618 'This atom_label has no heavy isotope' +619 atoms_count.append(formula_dict.get(atom_label)) +620 mass = Atoms.atomic_masses.get(atom_label) +621 prop = Atoms.isotopic_abundance.get(atom_label) +622 masses_list_tuples.append([mass]) +623 props_list_tuples.append([prop]) +624 all_atoms_list.append(atom_label) +625 +626 else: 627 -628 else: -629 -630 isotopes_label_list = Atoms.isotopes.get(atom_label)[1] -631 -632 if len(isotopes_label_list) > 1: -633 'This atom_label has two or more heavy isotope' -634 isotopos_labels = [i for i in isotopes_label_list] -635 else: -636 'This atom_label only has one heavy isotope' -637 isotopos_labels = [isotopes_label_list[0]] -638 -639 #all_atoms_list.extend(isotopos_labels) -640 isotopos_labels = [atom_label] + isotopos_labels +628 isotopes_label_list = Atoms.isotopes.get(atom_label)[1] +629 +630 if len(isotopes_label_list) > 1: +631 'This atom_label has two or more heavy isotope' +632 isotopos_labels = [i for i in isotopes_label_list] +633 else: +634 'This atom_label only has one heavy isotope' +635 isotopos_labels = [isotopes_label_list[0]] +636 +637 #all_atoms_list.extend(isotopos_labels) +638 isotopos_labels = [atom_label] + isotopos_labels +639 +640 all_atoms_list.extend(isotopos_labels) 641 -642 all_atoms_list.extend(isotopos_labels) -643 -644 masses = [Atoms.atomic_masses.get(atom_label) for atom_label in isotopos_labels] -645 props = [Atoms.isotopic_abundance.get(atom_label) for atom_label in isotopos_labels] -646 -647 atoms_count.append(formula_dict.get(atom_label)) -648 masses_list_tuples.append(masses) -649 props_list_tuples.append(props) +642 masses = [Atoms.atomic_masses.get(atom_label) for atom_label in isotopos_labels] +643 props = [Atoms.isotopic_abundance.get(atom_label) for atom_label in isotopos_labels] +644 +645 atoms_count.append(formula_dict.get(atom_label)) +646 masses_list_tuples.append(masses) +647 props_list_tuples.append(props) +648 +649 iso = IsoSpecPy.IsoSpec(atoms_count,masses_list_tuples,props_list_tuples, cut_off_to_IsoSpeccPy) 650 -651 iso = IsoSpecPy.IsoSpec(atoms_count,masses_list_tuples,props_list_tuples, cut_off_to_IsoSpeccPy) -652 -653 conf = iso.getConfs() -654 masses = conf[0] -655 probs = exp(conf[1]) -656 molecular_formulas = conf[2] -657 #print('conf', conf) -658 #print('probs', conf[1]) +651 conf = iso.getConfs() +652 masses = conf[0] +653 probs = exp(conf[1]) +654 molecular_formulas = conf[2] +655 #print('conf', conf) +656 #print('probs', conf[1]) +657 +658 new_formulas = [] 659 -660 new_formulas = [] -661 -662 for isotopologue_index in range(len(iso)): -663 #skip_mono_isotopic -664 -665 formula_list = molecular_formulas[isotopologue_index] -666 new_formula_dict = dict(zip(all_atoms_list, formula_list)) -667 new_formula_dict[Labels.ion_type] = formula_dict.get(Labels.ion_type) -668 if formula_dict.get('H'): -669 new_formula_dict['H'] = formula_dict.get('H') -670 -671 new_formulas.append({x:y for x,y in new_formula_dict.items() if y!=0}) -672 -673 # formula_dict in new_formulas check if monoisotopic is being returned -674 if new_formulas:# and formula_dict in new_formulas: -675 -676 #print(conf) -677 #print(new_formulas) -678 #print(atoms_count) -679 #print(all_atoms_list) -680 #print(masses_list_tuples) -681 #print(props_list_tuples) -682 # find where monoisotopic is -683 index_mono = new_formulas.index(formula_dict) -684 # calculate ratio iso/mono -685 probs = list(probs/probs[index_mono]) -686 -687 # delete the monoisotopic -688 del probs[index_mono] -689 del new_formulas[index_mono] -690 -691 #print('probs_exp', probs) -692 for formulas, prob in zip(new_formulas, probs): -693 -694 theor_abundance = current_abundance* prob -695 if theor_abundance > min_abundance: -696 #print(prob, theor_abundance, current_abundance) -697 yield (formulas, prob) -698 #return zip(new_formulas, probs ) -699 -700 #else: -701 # return [] -702 +660 for isotopologue_index in range(len(iso)): +661 #skip_mono_isotopic +662 +663 formula_list = molecular_formulas[isotopologue_index] +664 new_formula_dict = dict(zip(all_atoms_list, formula_list)) +665 new_formula_dict[Labels.ion_type] = formula_dict.get(Labels.ion_type) +666 if formula_dict.get('H'): +667 new_formula_dict['H'] = formula_dict.get('H') +668 +669 new_formulas.append({x:y for x,y in new_formula_dict.items() if y!=0}) +670 +671 # formula_dict in new_formulas check if monoisotopic is being returned +672 if new_formulas:# and formula_dict in new_formulas: +673 +674 #print(conf) +675 #print(new_formulas) +676 #print(atoms_count) +677 #print(all_atoms_list) +678 #print(masses_list_tuples) +679 #print(props_list_tuples) +680 # find where monoisotopic is +681 index_mono = new_formulas.index(formula_dict) +682 # calculate ratio iso/mono +683 probs = list(probs/probs[index_mono]) +684 +685 # delete the monoisotopic +686 del probs[index_mono] +687 del new_formulas[index_mono] +688 +689 #print('probs_exp', probs) +690 for formulas, prob in zip(new_formulas, probs): +691 +692 theor_abundance = current_abundance* prob +693 if theor_abundance > min_abundance: +694 #print(prob, theor_abundance, current_abundance) +695 yield (formulas, prob) +696 #return zip(new_formulas, probs ) +697 +698 #else: +699 # return [] +700

    @@ -1310,167 +1308,165 @@

    539 540 dbe = 1 + (0.5 * individual_dbe) 541 -542 -543 -544 if self.ion_type == Labels.adduct_ion: -545 dbe = dbe + 0.5 -546 -547 return dbe -548 -549 def _calc_kmd(self, dict_base): -550 """Calculate the Kendrick mass defect (KMD) of the molecular formula, based on the monoisotopic mass and the Kendrick mass. -551 -552 Parameters -553 ---------- -554 dict_base : dict -555 The dictionary of the base formula, e.g. {'C':1, 'H':2} -556 -557 Returns -558 ------- -559 tuple -560 The tuple of the KMD, Kendrick mass, and nominal Kendrick mass. -561 """ -562 mass = 0 -563 for atom in dict_base.keys(): -564 mass = mass + Atoms.atomic_masses.get(atom) * dict_base.get(atom) +542 if self.ion_type == Labels.adduct_ion: +543 dbe = dbe + 0.5 +544 +545 return dbe +546 +547 def _calc_kmd(self, dict_base): +548 """Calculate the Kendrick mass defect (KMD) of the molecular formula, based on the monoisotopic mass and the Kendrick mass. +549 +550 Parameters +551 ---------- +552 dict_base : dict +553 The dictionary of the base formula, e.g. {'C':1, 'H':2} +554 +555 Returns +556 ------- +557 tuple +558 The tuple of the KMD, Kendrick mass, and nominal Kendrick mass. +559 """ +560 mass = 0 +561 for atom in dict_base.keys(): +562 mass = mass + Atoms.atomic_masses.get(atom) * dict_base.get(atom) +563 +564 kendrick_mass = (int(mass)/mass)* self.mz_calc 565 -566 kendrick_mass = (int(mass)/mass)* self.mz_calc -567 -568 nominal_km =int(kendrick_mass) -569 -570 kmd = (nominal_km - kendrick_mass) * 100 -571 -572 #kmd = (nominal_km - km) * 1 -573 kmd = round(kmd,0) -574 -575 return kmd, kendrick_mass, nominal_km -576 -577 def _cal_isotopologues(self, formula_dict, min_abundance, current_abundance, ms_dynamic_range): -578 """Calculate the isotopologues for a given molecular formula. -579 -580 Parameters -581 ---------- -582 formula_dict : dict -583 The dictionary of the molecular formula. Example: {'C':10, 'H', 20, 'O', 2} -584 min_abundance : float -585 The minimum abundance. -586 current_abundance : float -587 The current monoisotopic abundance. -588 ms_dynamic_range : float -589 The dynamic range. -590 -591 -592 Notes -593 ----- -594 This is the primary function to look for isotopologues based on a monoisotopic molecular formula. -595 It needs to be expanded to include the calculation of resolving power and plot the results. -596 Use this function at runtime during the molecular identification algorithm only when a positive ID is observed to the monoisotopic ion. -597 Use this function to simulate mass spectrum (needs resolving power calculation to be fully operational). -598 It might break when adding non-conventional atoms (not yet tested). -599 This function employs the IsoSpecPy library https://github.com/MatteoLacki/IsoSpec. -600 -601 -602 """ -603 -604 #last update on 05-26-2020, Yuri E. Corilo -605 -606 # updated it to reflect min possible mass peak abundance -607 cut_off_to_IsoSpeccPy = 1-(1/ms_dynamic_range) -608 -609 #print("cut_off_to_IsoSpeccPy", cut_off_to_IsoSpeccPy, current_abundance, min_abundance, ms_dynamic_range) -610 #print(cut_off_to_IsoSpeccPy) -611 atoms_labels = (atom for atom in formula_dict.keys() if atom != Labels.ion_type and atom != 'H') -612 -613 atoms_count = [] -614 masses_list_tuples = [] -615 props_list_tuples = [] -616 all_atoms_list = [] -617 -618 for atom_label in atoms_labels: -619 -620 if not len(Atoms.isotopes.get(atom_label))>1: -621 'This atom_label has no heavy isotope' -622 atoms_count.append(formula_dict.get(atom_label)) -623 mass = Atoms.atomic_masses.get(atom_label) -624 prop = Atoms.isotopic_abundance.get(atom_label) -625 masses_list_tuples.append([mass]) -626 props_list_tuples.append([prop]) -627 all_atoms_list.append(atom_label) +566 nominal_km =int(kendrick_mass) +567 +568 kmd = (nominal_km - kendrick_mass) * 100 +569 +570 #kmd = (nominal_km - km) * 1 +571 kmd = round(kmd,0) +572 +573 return kmd, kendrick_mass, nominal_km +574 +575 def _cal_isotopologues(self, formula_dict, min_abundance, current_abundance, ms_dynamic_range): +576 """Calculate the isotopologues for a given molecular formula. +577 +578 Parameters +579 ---------- +580 formula_dict : dict +581 The dictionary of the molecular formula. Example: {'C':10, 'H', 20, 'O', 2} +582 min_abundance : float +583 The minimum abundance. +584 current_abundance : float +585 The current monoisotopic abundance. +586 ms_dynamic_range : float +587 The dynamic range. +588 +589 +590 Notes +591 ----- +592 This is the primary function to look for isotopologues based on a monoisotopic molecular formula. +593 It needs to be expanded to include the calculation of resolving power and plot the results. +594 Use this function at runtime during the molecular identification algorithm only when a positive ID is observed to the monoisotopic ion. +595 Use this function to simulate mass spectrum (needs resolving power calculation to be fully operational). +596 It might break when adding non-conventional atoms (not yet tested). +597 This function employs the IsoSpecPy library https://github.com/MatteoLacki/IsoSpec. +598 +599 +600 """ +601 +602 #last update on 05-26-2020, Yuri E. Corilo +603 +604 # updated it to reflect min possible mass peak abundance +605 cut_off_to_IsoSpeccPy = 1-(1/ms_dynamic_range) +606 +607 #print("cut_off_to_IsoSpeccPy", cut_off_to_IsoSpeccPy, current_abundance, min_abundance, ms_dynamic_range) +608 #print(cut_off_to_IsoSpeccPy) +609 atoms_labels = (atom for atom in formula_dict.keys() if atom != Labels.ion_type and atom != 'H') +610 +611 atoms_count = [] +612 masses_list_tuples = [] +613 props_list_tuples = [] +614 all_atoms_list = [] +615 +616 for atom_label in atoms_labels: +617 +618 if Atoms.isotopes.get(atom_label)[1][0] is None: +619 'This atom_label has no heavy isotope' +620 atoms_count.append(formula_dict.get(atom_label)) +621 mass = Atoms.atomic_masses.get(atom_label) +622 prop = Atoms.isotopic_abundance.get(atom_label) +623 masses_list_tuples.append([mass]) +624 props_list_tuples.append([prop]) +625 all_atoms_list.append(atom_label) +626 +627 else: 628 -629 else: -630 -631 isotopes_label_list = Atoms.isotopes.get(atom_label)[1] -632 -633 if len(isotopes_label_list) > 1: -634 'This atom_label has two or more heavy isotope' -635 isotopos_labels = [i for i in isotopes_label_list] -636 else: -637 'This atom_label only has one heavy isotope' -638 isotopos_labels = [isotopes_label_list[0]] -639 -640 #all_atoms_list.extend(isotopos_labels) -641 isotopos_labels = [atom_label] + isotopos_labels +629 isotopes_label_list = Atoms.isotopes.get(atom_label)[1] +630 +631 if len(isotopes_label_list) > 1: +632 'This atom_label has two or more heavy isotope' +633 isotopos_labels = [i for i in isotopes_label_list] +634 else: +635 'This atom_label only has one heavy isotope' +636 isotopos_labels = [isotopes_label_list[0]] +637 +638 #all_atoms_list.extend(isotopos_labels) +639 isotopos_labels = [atom_label] + isotopos_labels +640 +641 all_atoms_list.extend(isotopos_labels) 642 -643 all_atoms_list.extend(isotopos_labels) -644 -645 masses = [Atoms.atomic_masses.get(atom_label) for atom_label in isotopos_labels] -646 props = [Atoms.isotopic_abundance.get(atom_label) for atom_label in isotopos_labels] -647 -648 atoms_count.append(formula_dict.get(atom_label)) -649 masses_list_tuples.append(masses) -650 props_list_tuples.append(props) +643 masses = [Atoms.atomic_masses.get(atom_label) for atom_label in isotopos_labels] +644 props = [Atoms.isotopic_abundance.get(atom_label) for atom_label in isotopos_labels] +645 +646 atoms_count.append(formula_dict.get(atom_label)) +647 masses_list_tuples.append(masses) +648 props_list_tuples.append(props) +649 +650 iso = IsoSpecPy.IsoSpec(atoms_count,masses_list_tuples,props_list_tuples, cut_off_to_IsoSpeccPy) 651 -652 iso = IsoSpecPy.IsoSpec(atoms_count,masses_list_tuples,props_list_tuples, cut_off_to_IsoSpeccPy) -653 -654 conf = iso.getConfs() -655 masses = conf[0] -656 probs = exp(conf[1]) -657 molecular_formulas = conf[2] -658 #print('conf', conf) -659 #print('probs', conf[1]) +652 conf = iso.getConfs() +653 masses = conf[0] +654 probs = exp(conf[1]) +655 molecular_formulas = conf[2] +656 #print('conf', conf) +657 #print('probs', conf[1]) +658 +659 new_formulas = [] 660 -661 new_formulas = [] -662 -663 for isotopologue_index in range(len(iso)): -664 #skip_mono_isotopic -665 -666 formula_list = molecular_formulas[isotopologue_index] -667 new_formula_dict = dict(zip(all_atoms_list, formula_list)) -668 new_formula_dict[Labels.ion_type] = formula_dict.get(Labels.ion_type) -669 if formula_dict.get('H'): -670 new_formula_dict['H'] = formula_dict.get('H') -671 -672 new_formulas.append({x:y for x,y in new_formula_dict.items() if y!=0}) -673 -674 # formula_dict in new_formulas check if monoisotopic is being returned -675 if new_formulas:# and formula_dict in new_formulas: -676 -677 #print(conf) -678 #print(new_formulas) -679 #print(atoms_count) -680 #print(all_atoms_list) -681 #print(masses_list_tuples) -682 #print(props_list_tuples) -683 # find where monoisotopic is -684 index_mono = new_formulas.index(formula_dict) -685 # calculate ratio iso/mono -686 probs = list(probs/probs[index_mono]) -687 -688 # delete the monoisotopic -689 del probs[index_mono] -690 del new_formulas[index_mono] -691 -692 #print('probs_exp', probs) -693 for formulas, prob in zip(new_formulas, probs): -694 -695 theor_abundance = current_abundance* prob -696 if theor_abundance > min_abundance: -697 #print(prob, theor_abundance, current_abundance) -698 yield (formulas, prob) -699 #return zip(new_formulas, probs ) -700 -701 #else: -702 # return [] +661 for isotopologue_index in range(len(iso)): +662 #skip_mono_isotopic +663 +664 formula_list = molecular_formulas[isotopologue_index] +665 new_formula_dict = dict(zip(all_atoms_list, formula_list)) +666 new_formula_dict[Labels.ion_type] = formula_dict.get(Labels.ion_type) +667 if formula_dict.get('H'): +668 new_formula_dict['H'] = formula_dict.get('H') +669 +670 new_formulas.append({x:y for x,y in new_formula_dict.items() if y!=0}) +671 +672 # formula_dict in new_formulas check if monoisotopic is being returned +673 if new_formulas:# and formula_dict in new_formulas: +674 +675 #print(conf) +676 #print(new_formulas) +677 #print(atoms_count) +678 #print(all_atoms_list) +679 #print(masses_list_tuples) +680 #print(props_list_tuples) +681 # find where monoisotopic is +682 index_mono = new_formulas.index(formula_dict) +683 # calculate ratio iso/mono +684 probs = list(probs/probs[index_mono]) +685 +686 # delete the monoisotopic +687 del probs[index_mono] +688 del new_formulas[index_mono] +689 +690 #print('probs_exp', probs) +691 for formulas, prob in zip(new_formulas, probs): +692 +693 theor_abundance = current_abundance* prob +694 if theor_abundance > min_abundance: +695 #print(prob, theor_abundance, current_abundance) +696 yield (formulas, prob) +697 #return zip(new_formulas, probs ) +698 +699 #else: +700 # return [] diff --git a/docs/corems/molecular_formula/factory/MolecularFormulaFactory.html b/docs/corems/molecular_formula/factory/MolecularFormulaFactory.html index 6c2e52c2..5bd2b036 100644 --- a/docs/corems/molecular_formula/factory/MolecularFormulaFactory.html +++ b/docs/corems/molecular_formula/factory/MolecularFormulaFactory.html @@ -325,592 +325,601 @@

    98 99 def __init__(self, molecular_formula, ion_charge, ion_type=None, 100 adduct_atom=None, mspeak_parent=None, external_mz=None): -101 -102 # clear dictionary of atoms with 0 value -103 -104 if type(molecular_formula) is dict: -105 self._from_dict(molecular_formula, ion_type, adduct_atom) -106 -107 elif type(molecular_formula) is list: -108 self._from_list(molecular_formula, ion_type, adduct_atom) -109 -110 elif type(molecular_formula) is str: -111 self._from_str(molecular_formula, ion_type, adduct_atom) -112 -113 -114 self._ion_charge = ion_charge -115 self._external_mz = external_mz -116 self._confidence_score = None -117 self._isotopologue_similarity = None -118 self._mz_error_score = None -119 self._mass_error_average_score = None -120 -121 self.is_isotopologue = False -122 -123 # parent mass spectrum peak obj instance -124 self._mspeak_parent = mspeak_parent -125 -126 self.expected_isotopologues = [] -127 self.mspeak_mf_isotopologues_indexes = [] -128 -129 if self._mspeak_parent: -130 kendrick_dict_base = self._mspeak_parent._ms_parent.mspeaks_settings.kendrick_base -131 else: -132 kendrick_dict_base = {'C':1, 'H':2} -133 self._kmd, self._kendrick_mass, self._nominal_km = self._calc_kmd( -134 kendrick_dict_base) -135 -136 def __repr__(self): -137 -138 return "MolecularFormula({0},{1},ion type = {2}".format(self._d_molecular_formula, self.ion_charge, self.ion_type) -139 -140 def __str__(self): -141 -142 return "MolecularFormula {0}, ion_charge:{1}, ion type:{2}, m/z:{3} ".format(self.string, self.ion_charge, self.ion_type, self.mz_calc) -143 -144 def __len__(self): +101 # clear dictionary of atoms with 0 value +102 if type(molecular_formula) is dict: +103 self._from_dict(molecular_formula, ion_type, adduct_atom) +104 +105 elif type(molecular_formula) is list: +106 self._from_list(molecular_formula, ion_type, adduct_atom) +107 +108 elif type(molecular_formula) is str: +109 self._from_str(molecular_formula, ion_type, adduct_atom) +110 +111 self._ion_charge = ion_charge +112 self._external_mz = external_mz +113 self._confidence_score = None +114 self._isotopologue_similarity = None +115 self._mz_error_score = None +116 self._mass_error_average_score = None +117 +118 self.is_isotopologue = False +119 +120 # parent mass spectrum peak obj instance +121 self._mspeak_parent = mspeak_parent +122 +123 self.expected_isotopologues = [] +124 self.mspeak_mf_isotopologues_indexes = [] +125 +126 if self._mspeak_parent: +127 kendrick_dict_base = self._mspeak_parent._ms_parent.mspeaks_settings.kendrick_base +128 else: +129 kendrick_dict_base = {'C':1, 'H':2} +130 self._kmd, self._kendrick_mass, self._nominal_km = self._calc_kmd( +131 kendrick_dict_base) +132 +133 def __repr__(self): +134 +135 return "MolecularFormula({0},{1},ion type = {2}".format(self._d_molecular_formula, self.ion_charge, self.ion_type) +136 +137 def __str__(self): +138 +139 return "MolecularFormula {0}, ion_charge:{1}, ion type:{2}, m/z:{3} ".format(self.string, self.ion_charge, self.ion_type, self.mz_calc) +140 +141 def __len__(self): +142 +143 # crash if keys are not ordered +144 return len(self._d_molecular_formula.keys()) 145 -146 # crash if keys are not ordered -147 return len(self._d_molecular_formula.keys()) -148 -149 def __getitem__(self, atom): -150 -151 #atom = list(self._d_molecular_formula.keys())[position] -152 if atom in self._d_molecular_formula.keys(): -153 return self._d_molecular_formula[atom] -154 else: -155 return 0 -156 def get(self, atom): -157 """Get the atom quantity of a specific atom. -158 -159 Parameters -160 ---------- -161 atom : str -162 The atom symbol. -163 -164 Returns -165 ------- -166 int -167 The atom quantity. -168 """ -169 #atom = list(self._d_molecular_formula.keys())[position] -170 if atom in self._d_molecular_formula.keys(): -171 return self._d_molecular_formula[atom] -172 else: -173 return 0 -174 -175 def _from_dict(self, molecular_formula, ion_type, adduct_atom): -176 -177 self._d_molecular_formula = {key:val for key, val in molecular_formula.items() if val != 0} -178 -179 if ion_type: -180 self._d_molecular_formula[Labels.ion_type] = ion_type -181 -182 if adduct_atom: -183 if adduct_atom in self._d_molecular_formula: -184 self._d_molecular_formula[adduct_atom] += 1 -185 else: self._d_molecular_formula[adduct_atom] = 1 -186 -187 def _from_list(self, molecular_formula_list, ion_type, adduct_atom): -188 # list has to be in the format -189 #['C', 10, 'H', 21, '13C', 1, 'Cl', 1, etc] -190 self._d_molecular_formula = {} -191 for each in range(0, len(molecular_formula_list),2): -192 -193 atoms_label = molecular_formula_list[each] -194 atoms_count = int(molecular_formula_list[each+1]) -195 -196 if atoms_count > 0: -197 self._d_molecular_formula[atoms_label] = int(atoms_count) -198 -199 self._d_molecular_formula[Labels.ion_type] = ion_type -200 if adduct_atom: +146 def __getitem__(self, atom): +147 +148 #atom = list(self._d_molecular_formula.keys())[position] +149 if atom in self._d_molecular_formula.keys(): +150 return self._d_molecular_formula[atom] +151 else: +152 return 0 +153 def get(self, atom): +154 """Get the atom quantity of a specific atom. +155 +156 Parameters +157 ---------- +158 atom : str +159 The atom symbol. +160 +161 Returns +162 ------- +163 int +164 The atom quantity. +165 """ +166 #atom = list(self._d_molecular_formula.keys())[position] +167 if atom in self._d_molecular_formula.keys(): +168 return self._d_molecular_formula[atom] +169 else: +170 return 0 +171 +172 def _from_dict(self, molecular_formula, ion_type, adduct_atom): +173 +174 self._d_molecular_formula = {key:val for key, val in molecular_formula.items() if val != 0} +175 +176 if ion_type: +177 self._d_molecular_formula[Labels.ion_type] = ion_type +178 self.adduct_atom = None +179 +180 if adduct_atom: +181 self.adduct_atom = adduct_atom +182 if adduct_atom in self._d_molecular_formula: +183 self._d_molecular_formula[adduct_atom] += 1 +184 else: self._d_molecular_formula[adduct_atom] = 1 +185 +186 def _from_list(self, molecular_formula_list, ion_type, adduct_atom): +187 # list has to be in the format +188 #['C', 10, 'H', 21, '13C', 1, 'Cl', 1, etc] +189 self._d_molecular_formula = {} +190 for each in range(0, len(molecular_formula_list),2): +191 +192 atoms_label = molecular_formula_list[each] +193 atoms_count = int(molecular_formula_list[each+1]) +194 +195 if atoms_count > 0: +196 self._d_molecular_formula[atoms_label] = int(atoms_count) +197 +198 self._d_molecular_formula[Labels.ion_type] = ion_type +199 if adduct_atom: +200 self.adduct_atom = adduct_atom 201 if adduct_atom in self._d_molecular_formula: 202 self._d_molecular_formula[adduct_atom] += 1 203 else: self._d_molecular_formula[adduct_atom] = 1 -204 -205 def _from_str(self, molecular_formula_str, ion_type, adduct_atom): -206 # string has to be in the format -207 #'C10 H21 13C1 Cl1 37Cl1 etc' -208 molecular_formula_list = molecular_formula_str.split(' ') -209 final_formula = [] -210 for i in molecular_formula_list: -211 atoms_count = self.split(Atoms.atoms_order, i) -212 final_formula.extend(atoms_count) -213 print(final_formula) -214 self._from_list(final_formula, ion_type, adduct_atom) -215 -216 def split(self, delimiters, string, maxsplit=0): #pragma: no cover -217 """Splits the molecular formula string. -218 -219 Parameters -220 ---------- -221 delimiters : list -222 The list of delimiters. -223 string : str -224 The molecular formula string. -225 maxsplit : int, optional -226 The maximum number of splits. Defaults to 0. -227 -228 Returns -229 ------- -230 list -231 The molecular formula list. -232 -233 Notes -234 ----- -235 Does not work when formula has atoms with same characters in a row that below to different atoms, i.e. C10H21NNa. -236 """ -237 regexPattern = '|'.join(map(re.escape, delimiters)) #pragma: no cover -238 isotopes = re.findall(regexPattern, string) #pragma: no cover -239 counts = re.split(regexPattern, string, maxsplit) #pragma: no cover -240 -241 return [isotopes[0], int(counts[1])] -242 -243 @property -244 def isotopologue_count_percentile(self, ): -245 if not len(self.expected_isotopologues) == 0: -246 return (len(self.mspeak_mf_isotopologues_indexes)/len(self.expected_isotopologues))*100 -247 else: -248 return 100 -249 -250 @property -251 def O_C(self): -252 -253 if 'O' in self._d_molecular_formula.keys(): -254 return self._d_molecular_formula.get("O")/self._d_molecular_formula.get("C") -255 else: -256 return 0 -257 -258 @property -259 def H_C(self): return self._d_molecular_formula.get("H")/self._d_molecular_formula.get("C") -260 -261 @property -262 def dbe(self): return self._calc_dbe() -263 -264 @property -265 def mz_nominal_calc(self): return int(self._calc_mz()) -266 -267 @property -268 def mz_error(self): return self._calc_assignment_mass_error() -269 -270 @property -271 def mz_calc(self): return self._calc_mz() -272 -273 @property -274 def protonated_mz(self): return self._protonated_mz(self.ion_charge) -275 -276 @property -277 def radical_mz(self): return self._radical_mz(self.ion_charge) -278 -279 @property -280 def neutral_mass(self): return self._neutral_mass() -281 -282 def adduct_mz(self, adduct_atom): -283 """Get m/z of an adducted ion version of the molecular formula. -284 -285 Parameters -286 ---------- -287 adduct_atom : str -288 The adduct atom. -289 -290 Returns -291 ------- -292 float -293 The m/z value of the adducted ion version of the molecular formula. -294 """ -295 return self._adduct_mz(adduct_atom, self.ion_charge) -296 -297 @property -298 def ion_type(self): -299 -300 ion_type = self._d_molecular_formula.get(Labels.ion_type) -301 if ion_type == Labels.protonated_de_ion: -302 if self.ion_charge > 0: -303 return Labels.protonated -304 else: -305 return Labels.de_protonated -306 else: -307 return ion_type -308 -309 @ion_type.setter -310 def ion_type(self, ion_type): -311 if ion_type in [Labels.protonated_de_ion, Labels.adduct_ion, Labels.radical_ion]: -312 self._d_molecular_formula[Labels.ion_type] = ion_type -313 else: -314 raise TypeError("Ion type can only be: 'DE_OR_PROTONATED', 'RADICAL' or 'ADDUCT', not %s"%ion_type) -315 -316 @property -317 def ion_charge(self): return self._ion_charge -318 -319 @property -320 def atoms(self): return [key for key in self._d_molecular_formula.keys() if key != Labels.ion_type] -321 -322 @property -323 def confidence_score(self): -324 -325 if not self._confidence_score: -326 -327 self._confidence_score = self._calc_confidence_score() -328 -329 return self._confidence_score -330 -331 @property -332 def isotopologue_similarity(self): -333 -334 if not self._isotopologue_similarity: -335 -336 self._isotopologue_similarity = self._calc_isotopologue_confidence() -337 -338 return self._isotopologue_similarity -339 -340 @property -341 def average_mz_error_score(self): -342 -343 # includes the isotopologues -344 -345 if not self._mass_error_average_score: -346 -347 self._mass_error_average_score = self._calc_average_mz_score() +204 else: +205 self.adduct_atom = None +206 +207 def _from_str(self, molecular_formula_str, ion_type, adduct_atom): +208 # string has to be in the format +209 #'C10 H21 13C1 Cl1 37Cl1 etc' +210 molecular_formula_list = molecular_formula_str.split(' ') +211 final_formula = [] +212 for i in molecular_formula_list: +213 atoms_count = self.split(Atoms.atoms_order, i) +214 final_formula.extend(atoms_count) +215 print(final_formula) +216 self._from_list(final_formula, ion_type, adduct_atom) +217 +218 def split(self, delimiters, string, maxsplit=0): #pragma: no cover +219 """Splits the molecular formula string. +220 +221 Parameters +222 ---------- +223 delimiters : list +224 The list of delimiters. +225 string : str +226 The molecular formula string. +227 maxsplit : int, optional +228 The maximum number of splits. Defaults to 0. +229 +230 Returns +231 ------- +232 list +233 The molecular formula list. +234 +235 Notes +236 ----- +237 Does not work when formula has atoms with same characters in a row that below to different atoms, i.e. C10H21NNa. +238 """ +239 regexPattern = '|'.join(map(re.escape, delimiters)) #pragma: no cover +240 isotopes = re.findall(regexPattern, string) #pragma: no cover +241 counts = re.split(regexPattern, string, maxsplit) #pragma: no cover +242 +243 return [isotopes[0], int(counts[1])] +244 +245 @property +246 def isotopologue_count_percentile(self, ): +247 if not len(self.expected_isotopologues) == 0: +248 return (len(self.mspeak_mf_isotopologues_indexes)/len(self.expected_isotopologues))*100 +249 else: +250 return 100 +251 +252 @property +253 def O_C(self): +254 +255 if 'O' in self._d_molecular_formula.keys(): +256 return self._d_molecular_formula.get("O")/self._d_molecular_formula.get("C") +257 else: +258 return 0 +259 +260 @property +261 def H_C(self): return self._d_molecular_formula.get("H")/self._d_molecular_formula.get("C") +262 +263 @property +264 def dbe(self): return self._calc_dbe() +265 +266 @property +267 def mz_nominal_calc(self): return int(self._calc_mz()) +268 +269 @property +270 def mz_error(self): return self._calc_assignment_mass_error() +271 +272 @property +273 def mz_calc(self): return self._calc_mz() +274 +275 @property +276 def protonated_mz(self): return self._protonated_mz(self.ion_charge) +277 +278 @property +279 def radical_mz(self): return self._radical_mz(self.ion_charge) +280 +281 @property +282 def neutral_mass(self): return self._neutral_mass() +283 +284 def adduct_mz(self, adduct_atom): +285 """Get m/z of an adducted ion version of the molecular formula. +286 +287 Parameters +288 ---------- +289 adduct_atom : str +290 The adduct atom. +291 +292 Returns +293 ------- +294 float +295 The m/z value of the adducted ion version of the molecular formula. +296 """ +297 return self._adduct_mz(adduct_atom, self.ion_charge) +298 +299 @property +300 def ion_type(self): +301 +302 ion_type = self._d_molecular_formula.get(Labels.ion_type) +303 if ion_type == Labels.protonated_de_ion: +304 if self.ion_charge > 0: +305 return Labels.protonated +306 else: +307 return Labels.de_protonated +308 else: +309 return ion_type +310 +311 @ion_type.setter +312 def ion_type(self, ion_type): +313 if ion_type in [Labels.protonated_de_ion, Labels.adduct_ion, Labels.radical_ion]: +314 self._d_molecular_formula[Labels.ion_type] = ion_type +315 else: +316 raise TypeError("Ion type can only be: 'DE_OR_PROTONATED', 'RADICAL' or 'ADDUCT', not %s"%ion_type) +317 +318 @property +319 def ion_charge(self): return self._ion_charge +320 +321 @property +322 def atoms(self): +323 """Get the atoms in the molecular formula.""" +324 ion_mol_form_keys = list(self._d_molecular_formula.keys()) +325 mol_form_keys = ion_mol_form_keys[:ion_mol_form_keys.index(Labels.ion_type)] +326 return mol_form_keys +327 +328 @property +329 def confidence_score(self): +330 +331 if not self._confidence_score: +332 +333 self._confidence_score = self._calc_confidence_score() +334 +335 return self._confidence_score +336 +337 @property +338 def isotopologue_similarity(self): +339 +340 if not self._isotopologue_similarity: +341 +342 self._isotopologue_similarity = self._calc_isotopologue_confidence() +343 +344 return self._isotopologue_similarity +345 +346 @property +347 def average_mz_error_score(self): 348 -349 return self._mass_error_average_score -350 -351 @property -352 def mz_error_score(self): -353 if not self._mz_error_score: -354 -355 self._mz_error_score = self._calc_mz_confidence() -356 -357 return self._mz_error_score -358 -359 @property -360 def kmd(self): return self._kmd -361 -362 @property -363 def kendrick_mass(self): return self._kendrick_mass -364 +349 # includes the isotopologues +350 +351 if not self._mass_error_average_score: +352 +353 self._mass_error_average_score = self._calc_average_mz_score() +354 +355 return self._mass_error_average_score +356 +357 @property +358 def mz_error_score(self): +359 if not self._mz_error_score: +360 +361 self._mz_error_score = self._calc_mz_confidence() +362 +363 return self._mz_error_score +364 365 @property -366 def knm(self): return self._nominal_km +366 def kmd(self): return self._kmd 367 -368 def change_kendrick_base(self, kendrick_dict_base): -369 """Change the Kendrick base. +368 @property +369 def kendrick_mass(self): return self._kendrick_mass 370 -371 Parameters -372 ---------- -373 kendrick_dict_base : dict -374 The Kendrick base dictionary. Ex: {"C": 1, "H": 2} -375 """ -376 self._kmd, self._kendrick_mass, self._nominal_km = self._calc_kmd(kendrick_dict_base) -377 -378 def isotopologues(self, min_abundance, current_mono_abundance, dynamic_range): -379 """Calculate the isotopologues for a given molecular formula. -380 -381 Parameters -382 ---------- -383 min_abundance : float -384 The minimum abundance. -385 current_mono_abundance : float -386 The current monoisotopic abundance. -387 dynamic_range : float -388 The dynamic range. -389 -390 Yields -391 ------ -392 MolecularFormulaIsotopologue -393 The molecular formula isotopologue. -394 -395 Notes -396 ----- -397 This calculation ignores the hydrogen isotopes. -398 """ -399 -400 for mf in self._cal_isotopologues(self._d_molecular_formula, min_abundance, current_mono_abundance, dynamic_range ): -401 -402 yield MolecularFormulaIsotopologue(*mf, current_mono_abundance, self.ion_charge) -403 -404 def atoms_qnt(self,atom): -405 """Get the atom quantity of a specific atom in the molecular formula.""" -406 if atom in self._d_molecular_formula: -407 return self._d_molecular_formula.get(atom) -408 else: -409 raise Warning('Could not find %s in this Molecular Formula object'%str(atom)) -410 -411 def atoms_symbol(self, atom): -412 """Get the atom symbol without the mass number.""" -413 return ''.join([i for i in atom if not i.isdigit()]) -414 -415 @property -416 def string(self): -417 -418 if self._d_molecular_formula: -419 formula_srt = '' -420 for atom in Atoms.atoms_order: -421 if atom in self.to_dict().keys(): -422 formula_srt += atom + str(int(self.to_dict().get(atom))) + ' ' -423 return formula_srt.strip() -424 -425 else: -426 raise Exception("Molecular formula identification not performed yet") -427 -428 @property -429 def string_formated(self): -430 -431 SUB = str.maketrans("0123456789", "₀₁₂₃₄₅₆₇₈₉") -432 SUP = str.maketrans("0123456789", "⁰¹²³⁴⁵⁶⁷⁸⁹") +371 @property +372 def knm(self): return self._nominal_km +373 +374 def change_kendrick_base(self, kendrick_dict_base): +375 """Change the Kendrick base. +376 +377 Parameters +378 ---------- +379 kendrick_dict_base : dict +380 The Kendrick base dictionary. Ex: {"C": 1, "H": 2} +381 """ +382 self._kmd, self._kendrick_mass, self._nominal_km = self._calc_kmd(kendrick_dict_base) +383 +384 def isotopologues(self, min_abundance, current_mono_abundance, dynamic_range): +385 """Calculate the isotopologues for a given molecular formula. +386 +387 Parameters +388 ---------- +389 min_abundance : float +390 The minimum abundance. +391 current_mono_abundance : float +392 The current monoisotopic abundance. +393 dynamic_range : float +394 The dynamic range. +395 +396 Yields +397 ------ +398 MolecularFormulaIsotopologue +399 The molecular formula isotopologue. +400 +401 Notes +402 ----- +403 This calculation ignores the hydrogen isotopes. +404 """ +405 +406 for mf in self._cal_isotopologues(self._d_molecular_formula, min_abundance, current_mono_abundance, dynamic_range ): +407 +408 yield MolecularFormulaIsotopologue(*mf, current_mono_abundance, self.ion_charge) +409 +410 def atoms_qnt(self,atom): +411 """Get the atom quantity of a specific atom in the molecular formula.""" +412 if atom in self._d_molecular_formula: +413 return self._d_molecular_formula.get(atom) +414 else: +415 raise Warning('Could not find %s in this Molecular Formula object'%str(atom)) +416 +417 def atoms_symbol(self, atom): +418 """Get the atom symbol without the mass number.""" +419 return ''.join([i for i in atom if not i.isdigit()]) +420 +421 @property +422 def string(self): +423 """Returns the molecular formula as a string.""" +424 if self._d_molecular_formula: +425 # Get keys that are associated with the molecular formula +426 ion_mol_form_keys = list(self._d_molecular_formula.keys()) +427 mol_form_keys = ion_mol_form_keys[:ion_mol_form_keys.index(Labels.ion_type)] +428 formula_srt = '' +429 for atom in Atoms.atoms_order: +430 if atom in mol_form_keys: +431 formula_srt += atom + str(int(self.to_dict().get(atom))) + ' ' +432 return formula_srt.strip() 433 -434 if self._d_molecular_formula: -435 formula_srt = '' -436 for atom in Atoms.atoms_order: -437 if atom in self.to_dict().keys(): -438 formula_srt += atom.translate(SUP) + str(int(self.to_dict().get(atom))).translate(SUB) -439 return formula_srt -440 -441 else: -442 raise Exception("Molecular formula identification not performed yet") -443 -444 def to_dict(self): -445 """Returns the molecular formula as a dictionary. -446 -447 Returns -448 ------- -449 dict -450 The molecular formula as a dictionary. -451 """ -452 return self._d_molecular_formula -453 -454 def to_list(self): -455 """Returns the molecular formula as a list. -456 -457 Returns -458 ------- -459 list -460 The molecular formula as a list. -461 -462 Raises -463 ------ -464 Exception -465 If the molecular formula identification was not performed yet. -466 """ -467 #TODO ensure self._d_molecular_formula is a orderedDict -468 -469 if self._d_molecular_formula: -470 formula_list = [] -471 -472 for atom, atom_number in self._d_molecular_formula.items(): -473 -474 if atom != Labels.ion_type: -475 -476 formula_list.append(atom) -477 formula_list.append(atom_number) -478 -479 return formula_list -480 else: -481 raise Exception("Molecular formula identification not performed yet") +434 else: +435 raise Exception("Molecular formula identification not performed yet") +436 +437 @property +438 def string_formated(self): +439 +440 SUB = str.maketrans("0123456789", "₀₁₂₃₄₅₆₇₈₉") +441 SUP = str.maketrans("0123456789", "⁰¹²³⁴⁵⁶⁷⁸⁹") +442 +443 if self._d_molecular_formula: +444 formula_srt = '' +445 for atom in Atoms.atoms_order: +446 if atom in self.to_dict().keys(): +447 formula_srt += atom.translate(SUP) + str(int(self.to_dict().get(atom))).translate(SUB) +448 return formula_srt +449 +450 else: +451 raise Exception("Molecular formula identification not performed yet") +452 +453 def to_dict(self): +454 """Returns the molecular formula as a dictionary. +455 +456 Returns +457 ------- +458 dict +459 The molecular formula as a dictionary. +460 """ +461 return self._d_molecular_formula +462 +463 def to_list(self): +464 """Returns the molecular formula as a list. +465 +466 Returns +467 ------- +468 list +469 The molecular formula as a list. +470 +471 Raises +472 ------ +473 Exception +474 If the molecular formula identification was not performed yet. +475 """ +476 #TODO ensure self._d_molecular_formula is a orderedDict +477 +478 if self._d_molecular_formula: +479 formula_list = [] +480 +481 for atom, atom_number in self._d_molecular_formula.items(): 482 -483 @property -484 def class_label(self): -485 -486 if self._d_molecular_formula: -487 -488 formulalist = self.to_list() -489 classstring = '' -490 -491 for each in range(0, len(formulalist),2): -492 -493 if formulalist[each] != 'C' and formulalist[each] != 'H' and formulalist[each] != 'HC': -494 -495 classstring = classstring + str(formulalist[each]) + str(formulalist[each+1]) + ' ' +483 if atom != Labels.ion_type: +484 +485 formula_list.append(atom) +486 formula_list.append(atom_number) +487 +488 return formula_list +489 else: +490 raise Exception("Molecular formula identification not performed yet") +491 +492 @property +493 def class_label(self): +494 +495 if self._d_molecular_formula: 496 -497 if classstring == '': classstring = 'HC' -498 -499 classstring = classstring.strip() -500 -501 if self._d_molecular_formula.get(Labels.ion_type) == Labels.radical_ion: -502 -503 return classstring + ' -R' -504 -505 #elif self._d_molecular_formula.get(Labels.ion_type) == Labels.adduct_ion: -506 -507 # return classstring + ' -A' -508 -509 else: return classstring -510 -511 #'dict, tuple or string' -512 -513 else: -514 -515 raise Exception("Molecular formula identification not performed yet") -516 -517 @property -518 def class_dict(self): -519 -520 if self._d_molecular_formula: -521 -522 class_dict = {} +497 formulalist = self.to_list() +498 classstring = '' +499 +500 for each in range(0, len(formulalist),2): +501 +502 if formulalist[each] != 'C' and formulalist[each] != 'H' and formulalist[each] != 'HC': +503 +504 classstring = classstring + str(formulalist[each]) + str(formulalist[each+1]) + ' ' +505 +506 if classstring == '': classstring = 'HC' +507 +508 classstring = classstring.strip() +509 +510 if self._d_molecular_formula.get(Labels.ion_type) == Labels.radical_ion: +511 +512 return classstring + ' -R' +513 +514 #elif self._d_molecular_formula.get(Labels.ion_type) == Labels.adduct_ion: +515 +516 # return classstring + ' -A' +517 +518 else: return classstring +519 +520 #'dict, tuple or string' +521 +522 else: 523 -524 for atom, qnt in self._d_molecular_formula.items(): +524 raise Exception("Molecular formula identification not performed yet") 525 -526 if atom != Labels.ion_type and atom !='C' and atom !='H': -527 -528 class_dict[atom] = qnt -529 -530 return class_dict -531 -532 raise Exception("Molecular formula identification not performed yet") -533 -534 -535class MolecularFormulaIsotopologue(MolecularFormulaBase): -536 """Class for representing a molecular formula isotopologue. -537 -538 Parameters -539 ---------- -540 _d_molecular_formula : dict -541 The molecular formula as a dictionary. -542 prob_ratio : float -543 The probability ratio. -544 mono_abundance : float -545 The monoisotopic abundance. -546 ion_charge : int -547 The ion charge. -548 mspeak_parent : object, optional -549 The parent mass spectrum peak object instance. Defaults to None. -550 -551 Attributes -552 ---------- -553 prob_ratio : float -554 The probability ratio. -555 abundance_calc : float -556 The calculated abundance. -557 area_error : float -558 The area error. -559 abundance_error : float -560 The abundance error. -561 is_isotopologue : bool -562 The isotopologue flag. Defaults to True. -563 mspeak_index_mono_isotopic : int -564 The index of the monoisotopic peak in the mass spectrum peak list. Defaults to None. -565 mono_isotopic_formula_index : int -566 The index of the monoisotopic formula in the molecular formula list. Defaults to None. -567 """ -568 def __init__(self, _d_molecular_formula, prob_ratio, mono_abundance, ion_charge, mspeak_parent=None): -569 -570 super().__init__(_d_molecular_formula, ion_charge) -571 #prob_ratio is relative to the monoisotopic peak p_isotopologue/p_mono_isotopic -572 -573 self.prob_ratio = prob_ratio -574 -575 self.abundance_calc = mono_abundance * prob_ratio -576 -577 self.is_isotopologue = True +526 @property +527 def class_dict(self): +528 +529 if self._d_molecular_formula: +530 +531 class_dict = {} +532 +533 for atom, qnt in self._d_molecular_formula.items(): +534 +535 if atom != Labels.ion_type and atom !='C' and atom !='H': +536 +537 class_dict[atom] = qnt +538 +539 return class_dict +540 +541 raise Exception("Molecular formula identification not performed yet") +542 +543 +544class MolecularFormulaIsotopologue(MolecularFormulaBase): +545 """Class for representing a molecular formula isotopologue. +546 +547 Parameters +548 ---------- +549 _d_molecular_formula : dict +550 The molecular formula as a dictionary. +551 prob_ratio : float +552 The probability ratio. +553 mono_abundance : float +554 The monoisotopic abundance. +555 ion_charge : int +556 The ion charge. +557 mspeak_parent : object, optional +558 The parent mass spectrum peak object instance. Defaults to None. +559 +560 Attributes +561 ---------- +562 prob_ratio : float +563 The probability ratio. +564 abundance_calc : float +565 The calculated abundance. +566 area_error : float +567 The area error. +568 abundance_error : float +569 The abundance error. +570 is_isotopologue : bool +571 The isotopologue flag. Defaults to True. +572 mspeak_index_mono_isotopic : int +573 The index of the monoisotopic peak in the mass spectrum peak list. Defaults to None. +574 mono_isotopic_formula_index : int +575 The index of the monoisotopic formula in the molecular formula list. Defaults to None. +576 """ +577 def __init__(self, _d_molecular_formula, prob_ratio, mono_abundance, ion_charge, mspeak_parent=None): 578 -579 self.mspeak_index_mono_isotopic = None -580 -581 self.mono_isotopic_formula_index = None -582 # parent mass spectrum peak obj instance -583 self._mspeak_parent = mspeak_parent -584 -585 -586 @property -587 def area_error(self): -588 return self._calc_area_error() +579 super().__init__(_d_molecular_formula, ion_charge) +580 #prob_ratio is relative to the monoisotopic peak p_isotopologue/p_mono_isotopic +581 +582 self.prob_ratio = prob_ratio +583 +584 self.abundance_calc = mono_abundance * prob_ratio +585 +586 self.is_isotopologue = True +587 +588 self.mspeak_index_mono_isotopic = None 589 -590 @property -591 def abundance_error(self): -592 return self._calc_abundance_error() +590 self.mono_isotopic_formula_index = None +591 # parent mass spectrum peak obj instance +592 self._mspeak_parent = mspeak_parent 593 -594class LCMSLibRefMolecularFormula(MolecularFormulaBase): -595 """Class for representing a molecular formula associated with a molecule in a LCMS library reference. -596 -597 Parameters -598 ---------- -599 molecular_formula : dict, list, str -600 The molecular formula. -601 ion_charge : int -602 The ion charge. -603 ion_type : str, optional -604 The ion type. Defaults to None. -605 adduct_atom : str, optional -606 The adduct atom. Defaults to None. -607 mspeak_parent : object, optional -608 The parent mass spectrum peak object instance. Defaults to None. -609 name : str, optional -610 The name of the reference molecule. Defaults to None. -611 kegg_id : str, optional -612 The KEGG ID of the reference molecule. Defaults to None. -613 cas : str, optional -614 The CAS number of the reference molecule. Defaults to None. -615 -616 """ -617 -618 def __init__(self, molecular_formula, ion_charge, ion_type=None, -619 adduct_atom=None, mspeak_parent=None, name=None, kegg_id=None, cas=None) -> None: -620 -621 super().__init__(molecular_formula, ion_charge, ion_type=ion_type, -622 adduct_atom=adduct_atom, mspeak_parent=mspeak_parent) -623 -624 self._name = name -625 self._kegg_id = kegg_id -626 self._cas = cas -627 -628 @property -629 def name(self): -630 return self._name -631 -632 @name.setter -633 def name(self, name): -634 if isinstance(name, str): -635 self._name = name -636 else: -637 raise TypeError('name: {} should be type string') -638 -639 @property -640 def kegg_id(self): -641 return self._kegg_id -642 -643 @kegg_id.setter -644 def kegg_id(self, kegg_id): -645 self._kegg_id = kegg_id -646 #if isinstance(kegg_id, str): -647 # self._kegg_id = kegg_id -648 #else: -649 # print(kegg_id) -650 # raise TypeError('name: {} should be type string') -651 -652 @property -653 def cas(self): -654 return self._cas -655 -656 @cas.setter -657 def cas(self, cas): -658 self._cas = cas -659 #if isinstance(cas, str): -660 # self._cas = cas -661 #else: -662 # raise TypeError('name: {} should be type string') -663 -664class MolecularFormula(MolecularFormulaBase): -665 """General class for representing a molecular formula. -666 -667 Parameters -668 ---------- -669 molecular_formula : dict, list, str -670 The molecular formula. -671 ion_charge : int -672 The ion charge. -673 ion_type : str, optional -674 The ion type. Defaults to None. -675 adduct_atom : str, optional -676 The adduct atom. Defaults to None. -677 mspeak_parent : object, optional -678 The parent mass spectrum peak object instance. Defaults to None. -679 external_mz : float, optional -680 The external m/z value. Defaults to False. -681 """ -682 -683 def __init__(self, molecular_formula, ion_charge, ion_type=None, -684 adduct_atom=None, mspeak_parent=None, external_mz=False): -685 super().__init__(molecular_formula, ion_charge, ion_type=ion_type, -686 adduct_atom=adduct_atom, mspeak_parent=mspeak_parent, external_mz=external_mz) +594 +595 @property +596 def area_error(self): +597 return self._calc_area_error() +598 +599 @property +600 def abundance_error(self): +601 return self._calc_abundance_error() +602 +603class LCMSLibRefMolecularFormula(MolecularFormulaBase): +604 """Class for representing a molecular formula associated with a molecule in a LCMS library reference. +605 +606 Parameters +607 ---------- +608 molecular_formula : dict, list, str +609 The molecular formula. +610 ion_charge : int +611 The ion charge. +612 ion_type : str, optional +613 The ion type. Defaults to None. +614 adduct_atom : str, optional +615 The adduct atom. Defaults to None. +616 mspeak_parent : object, optional +617 The parent mass spectrum peak object instance. Defaults to None. +618 name : str, optional +619 The name of the reference molecule. Defaults to None. +620 kegg_id : str, optional +621 The KEGG ID of the reference molecule. Defaults to None. +622 cas : str, optional +623 The CAS number of the reference molecule. Defaults to None. +624 +625 """ +626 +627 def __init__(self, molecular_formula, ion_charge, ion_type=None, +628 adduct_atom=None, mspeak_parent=None, name=None, kegg_id=None, cas=None) -> None: +629 +630 super().__init__(molecular_formula, ion_charge, ion_type=ion_type, +631 adduct_atom=adduct_atom, mspeak_parent=mspeak_parent) +632 +633 self._name = name +634 self._kegg_id = kegg_id +635 self._cas = cas +636 +637 @property +638 def name(self): +639 return self._name +640 +641 @name.setter +642 def name(self, name): +643 if isinstance(name, str): +644 self._name = name +645 else: +646 raise TypeError('name: {} should be type string') +647 +648 @property +649 def kegg_id(self): +650 return self._kegg_id +651 +652 @kegg_id.setter +653 def kegg_id(self, kegg_id): +654 self._kegg_id = kegg_id +655 #if isinstance(kegg_id, str): +656 # self._kegg_id = kegg_id +657 #else: +658 # print(kegg_id) +659 # raise TypeError('name: {} should be type string') +660 +661 @property +662 def cas(self): +663 return self._cas +664 +665 @cas.setter +666 def cas(self, cas): +667 self._cas = cas +668 #if isinstance(cas, str): +669 # self._cas = cas +670 #else: +671 # raise TypeError('name: {} should be type string') +672 +673class MolecularFormula(MolecularFormulaBase): +674 """General class for representing a molecular formula. +675 +676 Parameters +677 ---------- +678 molecular_formula : dict, list, str +679 The molecular formula. +680 ion_charge : int +681 The ion charge. +682 ion_type : str, optional +683 The ion type. Defaults to None. +684 adduct_atom : str, optional +685 The adduct atom. Defaults to None. +686 mspeak_parent : object, optional +687 The parent mass spectrum peak object instance. Defaults to None. +688 external_mz : float, optional +689 The external m/z value. Defaults to False. +690 """ +691 +692 def __init__(self, molecular_formula, ion_charge, ion_type=None, +693 adduct_atom=None, mspeak_parent=None, external_mz=False): +694 super().__init__(molecular_formula, ion_charge, ion_type=ion_type, +695 adduct_atom=adduct_atom, mspeak_parent=mspeak_parent, external_mz=external_mz) @@ -1018,438 +1027,447 @@

    99 100 def __init__(self, molecular_formula, ion_charge, ion_type=None, 101 adduct_atom=None, mspeak_parent=None, external_mz=None): -102 -103 # clear dictionary of atoms with 0 value -104 -105 if type(molecular_formula) is dict: -106 self._from_dict(molecular_formula, ion_type, adduct_atom) -107 -108 elif type(molecular_formula) is list: -109 self._from_list(molecular_formula, ion_type, adduct_atom) -110 -111 elif type(molecular_formula) is str: -112 self._from_str(molecular_formula, ion_type, adduct_atom) -113 -114 -115 self._ion_charge = ion_charge -116 self._external_mz = external_mz -117 self._confidence_score = None -118 self._isotopologue_similarity = None -119 self._mz_error_score = None -120 self._mass_error_average_score = None -121 -122 self.is_isotopologue = False -123 -124 # parent mass spectrum peak obj instance -125 self._mspeak_parent = mspeak_parent -126 -127 self.expected_isotopologues = [] -128 self.mspeak_mf_isotopologues_indexes = [] -129 -130 if self._mspeak_parent: -131 kendrick_dict_base = self._mspeak_parent._ms_parent.mspeaks_settings.kendrick_base -132 else: -133 kendrick_dict_base = {'C':1, 'H':2} -134 self._kmd, self._kendrick_mass, self._nominal_km = self._calc_kmd( -135 kendrick_dict_base) -136 -137 def __repr__(self): -138 -139 return "MolecularFormula({0},{1},ion type = {2}".format(self._d_molecular_formula, self.ion_charge, self.ion_type) -140 -141 def __str__(self): -142 -143 return "MolecularFormula {0}, ion_charge:{1}, ion type:{2}, m/z:{3} ".format(self.string, self.ion_charge, self.ion_type, self.mz_calc) -144 -145 def __len__(self): +102 # clear dictionary of atoms with 0 value +103 if type(molecular_formula) is dict: +104 self._from_dict(molecular_formula, ion_type, adduct_atom) +105 +106 elif type(molecular_formula) is list: +107 self._from_list(molecular_formula, ion_type, adduct_atom) +108 +109 elif type(molecular_formula) is str: +110 self._from_str(molecular_formula, ion_type, adduct_atom) +111 +112 self._ion_charge = ion_charge +113 self._external_mz = external_mz +114 self._confidence_score = None +115 self._isotopologue_similarity = None +116 self._mz_error_score = None +117 self._mass_error_average_score = None +118 +119 self.is_isotopologue = False +120 +121 # parent mass spectrum peak obj instance +122 self._mspeak_parent = mspeak_parent +123 +124 self.expected_isotopologues = [] +125 self.mspeak_mf_isotopologues_indexes = [] +126 +127 if self._mspeak_parent: +128 kendrick_dict_base = self._mspeak_parent._ms_parent.mspeaks_settings.kendrick_base +129 else: +130 kendrick_dict_base = {'C':1, 'H':2} +131 self._kmd, self._kendrick_mass, self._nominal_km = self._calc_kmd( +132 kendrick_dict_base) +133 +134 def __repr__(self): +135 +136 return "MolecularFormula({0},{1},ion type = {2}".format(self._d_molecular_formula, self.ion_charge, self.ion_type) +137 +138 def __str__(self): +139 +140 return "MolecularFormula {0}, ion_charge:{1}, ion type:{2}, m/z:{3} ".format(self.string, self.ion_charge, self.ion_type, self.mz_calc) +141 +142 def __len__(self): +143 +144 # crash if keys are not ordered +145 return len(self._d_molecular_formula.keys()) 146 -147 # crash if keys are not ordered -148 return len(self._d_molecular_formula.keys()) -149 -150 def __getitem__(self, atom): -151 -152 #atom = list(self._d_molecular_formula.keys())[position] -153 if atom in self._d_molecular_formula.keys(): -154 return self._d_molecular_formula[atom] -155 else: -156 return 0 -157 def get(self, atom): -158 """Get the atom quantity of a specific atom. -159 -160 Parameters -161 ---------- -162 atom : str -163 The atom symbol. -164 -165 Returns -166 ------- -167 int -168 The atom quantity. -169 """ -170 #atom = list(self._d_molecular_formula.keys())[position] -171 if atom in self._d_molecular_formula.keys(): -172 return self._d_molecular_formula[atom] -173 else: -174 return 0 -175 -176 def _from_dict(self, molecular_formula, ion_type, adduct_atom): -177 -178 self._d_molecular_formula = {key:val for key, val in molecular_formula.items() if val != 0} -179 -180 if ion_type: -181 self._d_molecular_formula[Labels.ion_type] = ion_type -182 -183 if adduct_atom: -184 if adduct_atom in self._d_molecular_formula: -185 self._d_molecular_formula[adduct_atom] += 1 -186 else: self._d_molecular_formula[adduct_atom] = 1 -187 -188 def _from_list(self, molecular_formula_list, ion_type, adduct_atom): -189 # list has to be in the format -190 #['C', 10, 'H', 21, '13C', 1, 'Cl', 1, etc] -191 self._d_molecular_formula = {} -192 for each in range(0, len(molecular_formula_list),2): -193 -194 atoms_label = molecular_formula_list[each] -195 atoms_count = int(molecular_formula_list[each+1]) -196 -197 if atoms_count > 0: -198 self._d_molecular_formula[atoms_label] = int(atoms_count) -199 -200 self._d_molecular_formula[Labels.ion_type] = ion_type -201 if adduct_atom: +147 def __getitem__(self, atom): +148 +149 #atom = list(self._d_molecular_formula.keys())[position] +150 if atom in self._d_molecular_formula.keys(): +151 return self._d_molecular_formula[atom] +152 else: +153 return 0 +154 def get(self, atom): +155 """Get the atom quantity of a specific atom. +156 +157 Parameters +158 ---------- +159 atom : str +160 The atom symbol. +161 +162 Returns +163 ------- +164 int +165 The atom quantity. +166 """ +167 #atom = list(self._d_molecular_formula.keys())[position] +168 if atom in self._d_molecular_formula.keys(): +169 return self._d_molecular_formula[atom] +170 else: +171 return 0 +172 +173 def _from_dict(self, molecular_formula, ion_type, adduct_atom): +174 +175 self._d_molecular_formula = {key:val for key, val in molecular_formula.items() if val != 0} +176 +177 if ion_type: +178 self._d_molecular_formula[Labels.ion_type] = ion_type +179 self.adduct_atom = None +180 +181 if adduct_atom: +182 self.adduct_atom = adduct_atom +183 if adduct_atom in self._d_molecular_formula: +184 self._d_molecular_formula[adduct_atom] += 1 +185 else: self._d_molecular_formula[adduct_atom] = 1 +186 +187 def _from_list(self, molecular_formula_list, ion_type, adduct_atom): +188 # list has to be in the format +189 #['C', 10, 'H', 21, '13C', 1, 'Cl', 1, etc] +190 self._d_molecular_formula = {} +191 for each in range(0, len(molecular_formula_list),2): +192 +193 atoms_label = molecular_formula_list[each] +194 atoms_count = int(molecular_formula_list[each+1]) +195 +196 if atoms_count > 0: +197 self._d_molecular_formula[atoms_label] = int(atoms_count) +198 +199 self._d_molecular_formula[Labels.ion_type] = ion_type +200 if adduct_atom: +201 self.adduct_atom = adduct_atom 202 if adduct_atom in self._d_molecular_formula: 203 self._d_molecular_formula[adduct_atom] += 1 204 else: self._d_molecular_formula[adduct_atom] = 1 -205 -206 def _from_str(self, molecular_formula_str, ion_type, adduct_atom): -207 # string has to be in the format -208 #'C10 H21 13C1 Cl1 37Cl1 etc' -209 molecular_formula_list = molecular_formula_str.split(' ') -210 final_formula = [] -211 for i in molecular_formula_list: -212 atoms_count = self.split(Atoms.atoms_order, i) -213 final_formula.extend(atoms_count) -214 print(final_formula) -215 self._from_list(final_formula, ion_type, adduct_atom) -216 -217 def split(self, delimiters, string, maxsplit=0): #pragma: no cover -218 """Splits the molecular formula string. -219 -220 Parameters -221 ---------- -222 delimiters : list -223 The list of delimiters. -224 string : str -225 The molecular formula string. -226 maxsplit : int, optional -227 The maximum number of splits. Defaults to 0. -228 -229 Returns -230 ------- -231 list -232 The molecular formula list. -233 -234 Notes -235 ----- -236 Does not work when formula has atoms with same characters in a row that below to different atoms, i.e. C10H21NNa. -237 """ -238 regexPattern = '|'.join(map(re.escape, delimiters)) #pragma: no cover -239 isotopes = re.findall(regexPattern, string) #pragma: no cover -240 counts = re.split(regexPattern, string, maxsplit) #pragma: no cover -241 -242 return [isotopes[0], int(counts[1])] -243 -244 @property -245 def isotopologue_count_percentile(self, ): -246 if not len(self.expected_isotopologues) == 0: -247 return (len(self.mspeak_mf_isotopologues_indexes)/len(self.expected_isotopologues))*100 -248 else: -249 return 100 -250 -251 @property -252 def O_C(self): -253 -254 if 'O' in self._d_molecular_formula.keys(): -255 return self._d_molecular_formula.get("O")/self._d_molecular_formula.get("C") -256 else: -257 return 0 -258 -259 @property -260 def H_C(self): return self._d_molecular_formula.get("H")/self._d_molecular_formula.get("C") -261 -262 @property -263 def dbe(self): return self._calc_dbe() -264 -265 @property -266 def mz_nominal_calc(self): return int(self._calc_mz()) -267 -268 @property -269 def mz_error(self): return self._calc_assignment_mass_error() -270 -271 @property -272 def mz_calc(self): return self._calc_mz() -273 -274 @property -275 def protonated_mz(self): return self._protonated_mz(self.ion_charge) -276 -277 @property -278 def radical_mz(self): return self._radical_mz(self.ion_charge) -279 -280 @property -281 def neutral_mass(self): return self._neutral_mass() -282 -283 def adduct_mz(self, adduct_atom): -284 """Get m/z of an adducted ion version of the molecular formula. -285 -286 Parameters -287 ---------- -288 adduct_atom : str -289 The adduct atom. -290 -291 Returns -292 ------- -293 float -294 The m/z value of the adducted ion version of the molecular formula. -295 """ -296 return self._adduct_mz(adduct_atom, self.ion_charge) -297 -298 @property -299 def ion_type(self): -300 -301 ion_type = self._d_molecular_formula.get(Labels.ion_type) -302 if ion_type == Labels.protonated_de_ion: -303 if self.ion_charge > 0: -304 return Labels.protonated -305 else: -306 return Labels.de_protonated -307 else: -308 return ion_type -309 -310 @ion_type.setter -311 def ion_type(self, ion_type): -312 if ion_type in [Labels.protonated_de_ion, Labels.adduct_ion, Labels.radical_ion]: -313 self._d_molecular_formula[Labels.ion_type] = ion_type -314 else: -315 raise TypeError("Ion type can only be: 'DE_OR_PROTONATED', 'RADICAL' or 'ADDUCT', not %s"%ion_type) -316 -317 @property -318 def ion_charge(self): return self._ion_charge -319 -320 @property -321 def atoms(self): return [key for key in self._d_molecular_formula.keys() if key != Labels.ion_type] -322 -323 @property -324 def confidence_score(self): -325 -326 if not self._confidence_score: -327 -328 self._confidence_score = self._calc_confidence_score() -329 -330 return self._confidence_score -331 -332 @property -333 def isotopologue_similarity(self): -334 -335 if not self._isotopologue_similarity: -336 -337 self._isotopologue_similarity = self._calc_isotopologue_confidence() -338 -339 return self._isotopologue_similarity -340 -341 @property -342 def average_mz_error_score(self): -343 -344 # includes the isotopologues -345 -346 if not self._mass_error_average_score: -347 -348 self._mass_error_average_score = self._calc_average_mz_score() +205 else: +206 self.adduct_atom = None +207 +208 def _from_str(self, molecular_formula_str, ion_type, adduct_atom): +209 # string has to be in the format +210 #'C10 H21 13C1 Cl1 37Cl1 etc' +211 molecular_formula_list = molecular_formula_str.split(' ') +212 final_formula = [] +213 for i in molecular_formula_list: +214 atoms_count = self.split(Atoms.atoms_order, i) +215 final_formula.extend(atoms_count) +216 print(final_formula) +217 self._from_list(final_formula, ion_type, adduct_atom) +218 +219 def split(self, delimiters, string, maxsplit=0): #pragma: no cover +220 """Splits the molecular formula string. +221 +222 Parameters +223 ---------- +224 delimiters : list +225 The list of delimiters. +226 string : str +227 The molecular formula string. +228 maxsplit : int, optional +229 The maximum number of splits. Defaults to 0. +230 +231 Returns +232 ------- +233 list +234 The molecular formula list. +235 +236 Notes +237 ----- +238 Does not work when formula has atoms with same characters in a row that below to different atoms, i.e. C10H21NNa. +239 """ +240 regexPattern = '|'.join(map(re.escape, delimiters)) #pragma: no cover +241 isotopes = re.findall(regexPattern, string) #pragma: no cover +242 counts = re.split(regexPattern, string, maxsplit) #pragma: no cover +243 +244 return [isotopes[0], int(counts[1])] +245 +246 @property +247 def isotopologue_count_percentile(self, ): +248 if not len(self.expected_isotopologues) == 0: +249 return (len(self.mspeak_mf_isotopologues_indexes)/len(self.expected_isotopologues))*100 +250 else: +251 return 100 +252 +253 @property +254 def O_C(self): +255 +256 if 'O' in self._d_molecular_formula.keys(): +257 return self._d_molecular_formula.get("O")/self._d_molecular_formula.get("C") +258 else: +259 return 0 +260 +261 @property +262 def H_C(self): return self._d_molecular_formula.get("H")/self._d_molecular_formula.get("C") +263 +264 @property +265 def dbe(self): return self._calc_dbe() +266 +267 @property +268 def mz_nominal_calc(self): return int(self._calc_mz()) +269 +270 @property +271 def mz_error(self): return self._calc_assignment_mass_error() +272 +273 @property +274 def mz_calc(self): return self._calc_mz() +275 +276 @property +277 def protonated_mz(self): return self._protonated_mz(self.ion_charge) +278 +279 @property +280 def radical_mz(self): return self._radical_mz(self.ion_charge) +281 +282 @property +283 def neutral_mass(self): return self._neutral_mass() +284 +285 def adduct_mz(self, adduct_atom): +286 """Get m/z of an adducted ion version of the molecular formula. +287 +288 Parameters +289 ---------- +290 adduct_atom : str +291 The adduct atom. +292 +293 Returns +294 ------- +295 float +296 The m/z value of the adducted ion version of the molecular formula. +297 """ +298 return self._adduct_mz(adduct_atom, self.ion_charge) +299 +300 @property +301 def ion_type(self): +302 +303 ion_type = self._d_molecular_formula.get(Labels.ion_type) +304 if ion_type == Labels.protonated_de_ion: +305 if self.ion_charge > 0: +306 return Labels.protonated +307 else: +308 return Labels.de_protonated +309 else: +310 return ion_type +311 +312 @ion_type.setter +313 def ion_type(self, ion_type): +314 if ion_type in [Labels.protonated_de_ion, Labels.adduct_ion, Labels.radical_ion]: +315 self._d_molecular_formula[Labels.ion_type] = ion_type +316 else: +317 raise TypeError("Ion type can only be: 'DE_OR_PROTONATED', 'RADICAL' or 'ADDUCT', not %s"%ion_type) +318 +319 @property +320 def ion_charge(self): return self._ion_charge +321 +322 @property +323 def atoms(self): +324 """Get the atoms in the molecular formula.""" +325 ion_mol_form_keys = list(self._d_molecular_formula.keys()) +326 mol_form_keys = ion_mol_form_keys[:ion_mol_form_keys.index(Labels.ion_type)] +327 return mol_form_keys +328 +329 @property +330 def confidence_score(self): +331 +332 if not self._confidence_score: +333 +334 self._confidence_score = self._calc_confidence_score() +335 +336 return self._confidence_score +337 +338 @property +339 def isotopologue_similarity(self): +340 +341 if not self._isotopologue_similarity: +342 +343 self._isotopologue_similarity = self._calc_isotopologue_confidence() +344 +345 return self._isotopologue_similarity +346 +347 @property +348 def average_mz_error_score(self): 349 -350 return self._mass_error_average_score -351 -352 @property -353 def mz_error_score(self): -354 if not self._mz_error_score: -355 -356 self._mz_error_score = self._calc_mz_confidence() -357 -358 return self._mz_error_score -359 -360 @property -361 def kmd(self): return self._kmd -362 -363 @property -364 def kendrick_mass(self): return self._kendrick_mass -365 +350 # includes the isotopologues +351 +352 if not self._mass_error_average_score: +353 +354 self._mass_error_average_score = self._calc_average_mz_score() +355 +356 return self._mass_error_average_score +357 +358 @property +359 def mz_error_score(self): +360 if not self._mz_error_score: +361 +362 self._mz_error_score = self._calc_mz_confidence() +363 +364 return self._mz_error_score +365 366 @property -367 def knm(self): return self._nominal_km +367 def kmd(self): return self._kmd 368 -369 def change_kendrick_base(self, kendrick_dict_base): -370 """Change the Kendrick base. +369 @property +370 def kendrick_mass(self): return self._kendrick_mass 371 -372 Parameters -373 ---------- -374 kendrick_dict_base : dict -375 The Kendrick base dictionary. Ex: {"C": 1, "H": 2} -376 """ -377 self._kmd, self._kendrick_mass, self._nominal_km = self._calc_kmd(kendrick_dict_base) -378 -379 def isotopologues(self, min_abundance, current_mono_abundance, dynamic_range): -380 """Calculate the isotopologues for a given molecular formula. -381 -382 Parameters -383 ---------- -384 min_abundance : float -385 The minimum abundance. -386 current_mono_abundance : float -387 The current monoisotopic abundance. -388 dynamic_range : float -389 The dynamic range. -390 -391 Yields -392 ------ -393 MolecularFormulaIsotopologue -394 The molecular formula isotopologue. -395 -396 Notes -397 ----- -398 This calculation ignores the hydrogen isotopes. -399 """ -400 -401 for mf in self._cal_isotopologues(self._d_molecular_formula, min_abundance, current_mono_abundance, dynamic_range ): -402 -403 yield MolecularFormulaIsotopologue(*mf, current_mono_abundance, self.ion_charge) -404 -405 def atoms_qnt(self,atom): -406 """Get the atom quantity of a specific atom in the molecular formula.""" -407 if atom in self._d_molecular_formula: -408 return self._d_molecular_formula.get(atom) -409 else: -410 raise Warning('Could not find %s in this Molecular Formula object'%str(atom)) -411 -412 def atoms_symbol(self, atom): -413 """Get the atom symbol without the mass number.""" -414 return ''.join([i for i in atom if not i.isdigit()]) -415 -416 @property -417 def string(self): -418 -419 if self._d_molecular_formula: -420 formula_srt = '' -421 for atom in Atoms.atoms_order: -422 if atom in self.to_dict().keys(): -423 formula_srt += atom + str(int(self.to_dict().get(atom))) + ' ' -424 return formula_srt.strip() -425 -426 else: -427 raise Exception("Molecular formula identification not performed yet") -428 -429 @property -430 def string_formated(self): -431 -432 SUB = str.maketrans("0123456789", "₀₁₂₃₄₅₆₇₈₉") -433 SUP = str.maketrans("0123456789", "⁰¹²³⁴⁵⁶⁷⁸⁹") +372 @property +373 def knm(self): return self._nominal_km +374 +375 def change_kendrick_base(self, kendrick_dict_base): +376 """Change the Kendrick base. +377 +378 Parameters +379 ---------- +380 kendrick_dict_base : dict +381 The Kendrick base dictionary. Ex: {"C": 1, "H": 2} +382 """ +383 self._kmd, self._kendrick_mass, self._nominal_km = self._calc_kmd(kendrick_dict_base) +384 +385 def isotopologues(self, min_abundance, current_mono_abundance, dynamic_range): +386 """Calculate the isotopologues for a given molecular formula. +387 +388 Parameters +389 ---------- +390 min_abundance : float +391 The minimum abundance. +392 current_mono_abundance : float +393 The current monoisotopic abundance. +394 dynamic_range : float +395 The dynamic range. +396 +397 Yields +398 ------ +399 MolecularFormulaIsotopologue +400 The molecular formula isotopologue. +401 +402 Notes +403 ----- +404 This calculation ignores the hydrogen isotopes. +405 """ +406 +407 for mf in self._cal_isotopologues(self._d_molecular_formula, min_abundance, current_mono_abundance, dynamic_range ): +408 +409 yield MolecularFormulaIsotopologue(*mf, current_mono_abundance, self.ion_charge) +410 +411 def atoms_qnt(self,atom): +412 """Get the atom quantity of a specific atom in the molecular formula.""" +413 if atom in self._d_molecular_formula: +414 return self._d_molecular_formula.get(atom) +415 else: +416 raise Warning('Could not find %s in this Molecular Formula object'%str(atom)) +417 +418 def atoms_symbol(self, atom): +419 """Get the atom symbol without the mass number.""" +420 return ''.join([i for i in atom if not i.isdigit()]) +421 +422 @property +423 def string(self): +424 """Returns the molecular formula as a string.""" +425 if self._d_molecular_formula: +426 # Get keys that are associated with the molecular formula +427 ion_mol_form_keys = list(self._d_molecular_formula.keys()) +428 mol_form_keys = ion_mol_form_keys[:ion_mol_form_keys.index(Labels.ion_type)] +429 formula_srt = '' +430 for atom in Atoms.atoms_order: +431 if atom in mol_form_keys: +432 formula_srt += atom + str(int(self.to_dict().get(atom))) + ' ' +433 return formula_srt.strip() 434 -435 if self._d_molecular_formula: -436 formula_srt = '' -437 for atom in Atoms.atoms_order: -438 if atom in self.to_dict().keys(): -439 formula_srt += atom.translate(SUP) + str(int(self.to_dict().get(atom))).translate(SUB) -440 return formula_srt -441 -442 else: -443 raise Exception("Molecular formula identification not performed yet") -444 -445 def to_dict(self): -446 """Returns the molecular formula as a dictionary. -447 -448 Returns -449 ------- -450 dict -451 The molecular formula as a dictionary. -452 """ -453 return self._d_molecular_formula -454 -455 def to_list(self): -456 """Returns the molecular formula as a list. -457 -458 Returns -459 ------- -460 list -461 The molecular formula as a list. -462 -463 Raises -464 ------ -465 Exception -466 If the molecular formula identification was not performed yet. -467 """ -468 #TODO ensure self._d_molecular_formula is a orderedDict -469 -470 if self._d_molecular_formula: -471 formula_list = [] -472 -473 for atom, atom_number in self._d_molecular_formula.items(): -474 -475 if atom != Labels.ion_type: -476 -477 formula_list.append(atom) -478 formula_list.append(atom_number) -479 -480 return formula_list -481 else: -482 raise Exception("Molecular formula identification not performed yet") +435 else: +436 raise Exception("Molecular formula identification not performed yet") +437 +438 @property +439 def string_formated(self): +440 +441 SUB = str.maketrans("0123456789", "₀₁₂₃₄₅₆₇₈₉") +442 SUP = str.maketrans("0123456789", "⁰¹²³⁴⁵⁶⁷⁸⁹") +443 +444 if self._d_molecular_formula: +445 formula_srt = '' +446 for atom in Atoms.atoms_order: +447 if atom in self.to_dict().keys(): +448 formula_srt += atom.translate(SUP) + str(int(self.to_dict().get(atom))).translate(SUB) +449 return formula_srt +450 +451 else: +452 raise Exception("Molecular formula identification not performed yet") +453 +454 def to_dict(self): +455 """Returns the molecular formula as a dictionary. +456 +457 Returns +458 ------- +459 dict +460 The molecular formula as a dictionary. +461 """ +462 return self._d_molecular_formula +463 +464 def to_list(self): +465 """Returns the molecular formula as a list. +466 +467 Returns +468 ------- +469 list +470 The molecular formula as a list. +471 +472 Raises +473 ------ +474 Exception +475 If the molecular formula identification was not performed yet. +476 """ +477 #TODO ensure self._d_molecular_formula is a orderedDict +478 +479 if self._d_molecular_formula: +480 formula_list = [] +481 +482 for atom, atom_number in self._d_molecular_formula.items(): 483 -484 @property -485 def class_label(self): -486 -487 if self._d_molecular_formula: -488 -489 formulalist = self.to_list() -490 classstring = '' -491 -492 for each in range(0, len(formulalist),2): -493 -494 if formulalist[each] != 'C' and formulalist[each] != 'H' and formulalist[each] != 'HC': -495 -496 classstring = classstring + str(formulalist[each]) + str(formulalist[each+1]) + ' ' +484 if atom != Labels.ion_type: +485 +486 formula_list.append(atom) +487 formula_list.append(atom_number) +488 +489 return formula_list +490 else: +491 raise Exception("Molecular formula identification not performed yet") +492 +493 @property +494 def class_label(self): +495 +496 if self._d_molecular_formula: 497 -498 if classstring == '': classstring = 'HC' -499 -500 classstring = classstring.strip() -501 -502 if self._d_molecular_formula.get(Labels.ion_type) == Labels.radical_ion: -503 -504 return classstring + ' -R' -505 -506 #elif self._d_molecular_formula.get(Labels.ion_type) == Labels.adduct_ion: -507 -508 # return classstring + ' -A' -509 -510 else: return classstring -511 -512 #'dict, tuple or string' -513 -514 else: -515 -516 raise Exception("Molecular formula identification not performed yet") -517 -518 @property -519 def class_dict(self): -520 -521 if self._d_molecular_formula: -522 -523 class_dict = {} +498 formulalist = self.to_list() +499 classstring = '' +500 +501 for each in range(0, len(formulalist),2): +502 +503 if formulalist[each] != 'C' and formulalist[each] != 'H' and formulalist[each] != 'HC': +504 +505 classstring = classstring + str(formulalist[each]) + str(formulalist[each+1]) + ' ' +506 +507 if classstring == '': classstring = 'HC' +508 +509 classstring = classstring.strip() +510 +511 if self._d_molecular_formula.get(Labels.ion_type) == Labels.radical_ion: +512 +513 return classstring + ' -R' +514 +515 #elif self._d_molecular_formula.get(Labels.ion_type) == Labels.adduct_ion: +516 +517 # return classstring + ' -A' +518 +519 else: return classstring +520 +521 #'dict, tuple or string' +522 +523 else: 524 -525 for atom, qnt in self._d_molecular_formula.items(): +525 raise Exception("Molecular formula identification not performed yet") 526 -527 if atom != Labels.ion_type and atom !='C' and atom !='H': -528 -529 class_dict[atom] = qnt -530 -531 return class_dict -532 -533 raise Exception("Molecular formula identification not performed yet") +527 @property +528 def class_dict(self): +529 +530 if self._d_molecular_formula: +531 +532 class_dict = {} +533 +534 for atom, qnt in self._d_molecular_formula.items(): +535 +536 if atom != Labels.ion_type and atom !='C' and atom !='H': +537 +538 class_dict[atom] = qnt +539 +540 return class_dict +541 +542 raise Exception("Molecular formula identification not performed yet") @@ -1562,40 +1580,37 @@

    Methods
    100    def __init__(self, molecular_formula, ion_charge, ion_type=None, 
     101                adduct_atom=None, mspeak_parent=None, external_mz=None):
    -102        
    -103        # clear dictionary of atoms with 0 value
    -104        
    -105        if  type(molecular_formula) is dict:
    -106                self._from_dict(molecular_formula, ion_type, adduct_atom)   
    -107        
    -108        elif type(molecular_formula) is list:
    -109                self._from_list(molecular_formula, ion_type, adduct_atom)   
    -110        
    -111        elif type(molecular_formula) is str:
    -112                self._from_str(molecular_formula, ion_type, adduct_atom)   
    -113
    -114        
    -115        self._ion_charge = ion_charge
    -116        self._external_mz = external_mz
    -117        self._confidence_score = None        
    -118        self._isotopologue_similarity = None
    -119        self._mz_error_score = None
    -120        self._mass_error_average_score = None
    -121
    -122        self.is_isotopologue = False
    -123        
    -124        # parent mass spectrum peak obj instance
    -125        self._mspeak_parent = mspeak_parent
    -126
    -127        self.expected_isotopologues = []
    -128        self.mspeak_mf_isotopologues_indexes = []
    -129        
    -130        if self._mspeak_parent:
    -131            kendrick_dict_base = self._mspeak_parent._ms_parent.mspeaks_settings.kendrick_base
    -132        else:
    -133            kendrick_dict_base = {'C':1, 'H':2}
    -134        self._kmd, self._kendrick_mass, self._nominal_km = self._calc_kmd(
    -135            kendrick_dict_base)  
    +102        # clear dictionary of atoms with 0 value
    +103        if  type(molecular_formula) is dict:
    +104                self._from_dict(molecular_formula, ion_type, adduct_atom)   
    +105        
    +106        elif type(molecular_formula) is list:
    +107                self._from_list(molecular_formula, ion_type, adduct_atom)   
    +108        
    +109        elif type(molecular_formula) is str:
    +110                self._from_str(molecular_formula, ion_type, adduct_atom)   
    +111
    +112        self._ion_charge = ion_charge
    +113        self._external_mz = external_mz
    +114        self._confidence_score = None        
    +115        self._isotopologue_similarity = None
    +116        self._mz_error_score = None
    +117        self._mass_error_average_score = None
    +118
    +119        self.is_isotopologue = False
    +120        
    +121        # parent mass spectrum peak obj instance
    +122        self._mspeak_parent = mspeak_parent
    +123
    +124        self.expected_isotopologues = []
    +125        self.mspeak_mf_isotopologues_indexes = []
    +126        
    +127        if self._mspeak_parent:
    +128            kendrick_dict_base = self._mspeak_parent._ms_parent.mspeaks_settings.kendrick_base
    +129        else:
    +130            kendrick_dict_base = {'C':1, 'H':2}
    +131        self._kmd, self._kendrick_mass, self._nominal_km = self._calc_kmd(
    +132            kendrick_dict_base)  
     
    @@ -1646,24 +1661,24 @@
    Methods
    -
    157    def get(self, atom):
    -158        """Get the atom quantity of a specific atom.
    -159        
    -160        Parameters
    -161        ----------
    -162        atom : str
    -163            The atom symbol.
    -164            
    -165        Returns
    -166        -------
    -167        int
    -168            The atom quantity.
    -169        """
    -170        #atom = list(self._d_molecular_formula.keys())[position]
    -171        if atom in self._d_molecular_formula.keys():
    -172            return self._d_molecular_formula[atom]
    -173        else:
    -174            return 0
    +            
    154    def get(self, atom):
    +155        """Get the atom quantity of a specific atom.
    +156        
    +157        Parameters
    +158        ----------
    +159        atom : str
    +160            The atom symbol.
    +161            
    +162        Returns
    +163        -------
    +164        int
    +165            The atom quantity.
    +166        """
    +167        #atom = list(self._d_molecular_formula.keys())[position]
    +168        if atom in self._d_molecular_formula.keys():
    +169            return self._d_molecular_formula[atom]
    +170        else:
    +171            return 0
     
    @@ -1696,32 +1711,32 @@
    Returns
    -
    217    def split(self, delimiters, string, maxsplit=0): #pragma: no cover
    -218        """Splits the molecular formula string.
    -219        
    -220        Parameters
    -221        ----------
    -222        delimiters : list
    -223            The list of delimiters.
    -224        string : str
    -225            The molecular formula string.
    -226        maxsplit : int, optional
    -227            The maximum number of splits. Defaults to 0.
    -228
    -229        Returns
    -230        -------
    -231        list
    -232            The molecular formula list.
    -233
    -234        Notes
    -235        -----
    -236        Does not work when formula has atoms with same characters in a row that below to different atoms, i.e. C10H21NNa.
    -237        """
    -238        regexPattern = '|'.join(map(re.escape, delimiters)) #pragma: no cover
    -239        isotopes = re.findall(regexPattern, string) #pragma: no cover
    -240        counts = re.split(regexPattern, string, maxsplit)  #pragma: no cover
    -241       
    -242        return [isotopes[0], int(counts[1])]
    +            
    219    def split(self, delimiters, string, maxsplit=0): #pragma: no cover
    +220        """Splits the molecular formula string.
    +221        
    +222        Parameters
    +223        ----------
    +224        delimiters : list
    +225            The list of delimiters.
    +226        string : str
    +227            The molecular formula string.
    +228        maxsplit : int, optional
    +229            The maximum number of splits. Defaults to 0.
    +230
    +231        Returns
    +232        -------
    +233        list
    +234            The molecular formula list.
    +235
    +236        Notes
    +237        -----
    +238        Does not work when formula has atoms with same characters in a row that below to different atoms, i.e. C10H21NNa.
    +239        """
    +240        regexPattern = '|'.join(map(re.escape, delimiters)) #pragma: no cover
    +241        isotopes = re.findall(regexPattern, string) #pragma: no cover
    +242        counts = re.split(regexPattern, string, maxsplit)  #pragma: no cover
    +243       
    +244        return [isotopes[0], int(counts[1])]
     
    @@ -1872,20 +1887,20 @@
    Notes
    -
    283    def adduct_mz(self, adduct_atom): 
    -284        """Get m/z of an adducted ion version of the molecular formula.
    -285        
    -286        Parameters
    -287        ----------
    -288        adduct_atom : str
    -289            The adduct atom.
    -290            
    -291        Returns
    -292        -------
    -293        float
    -294            The m/z value of the adducted ion version of the molecular formula.
    -295        """
    -296        return self._adduct_mz(adduct_atom, self.ion_charge)
    +            
    285    def adduct_mz(self, adduct_atom): 
    +286        """Get m/z of an adducted ion version of the molecular formula.
    +287        
    +288        Parameters
    +289        ----------
    +290        adduct_atom : str
    +291            The adduct atom.
    +292            
    +293        Returns
    +294        -------
    +295        float
    +296            The m/z value of the adducted ion version of the molecular formula.
    +297        """
    +298        return self._adduct_mz(adduct_atom, self.ion_charge)
     
    @@ -1937,7 +1952,9 @@
    Returns
    - +

    Get the atoms in the molecular formula.

    +
    +
    @@ -2028,15 +2045,15 @@
    Returns
    -
    369    def change_kendrick_base(self, kendrick_dict_base):
    -370        """Change the Kendrick base.
    -371
    -372        Parameters
    -373        ----------
    -374        kendrick_dict_base : dict
    -375            The Kendrick base dictionary. Ex: {"C": 1, "H": 2}
    -376        """ 
    -377        self._kmd, self._kendrick_mass, self._nominal_km = self._calc_kmd(kendrick_dict_base)
    +            
    375    def change_kendrick_base(self, kendrick_dict_base):
    +376        """Change the Kendrick base.
    +377
    +378        Parameters
    +379        ----------
    +380        kendrick_dict_base : dict
    +381            The Kendrick base dictionary. Ex: {"C": 1, "H": 2}
    +382        """ 
    +383        self._kmd, self._kendrick_mass, self._nominal_km = self._calc_kmd(kendrick_dict_base)
     
    @@ -2063,31 +2080,31 @@
    Parameters
    -
    379    def isotopologues(self, min_abundance, current_mono_abundance, dynamic_range): 
    -380        """Calculate the isotopologues for a given molecular formula.
    -381
    -382        Parameters
    -383        ----------
    -384        min_abundance : float
    -385            The minimum abundance.
    -386        current_mono_abundance : float
    -387            The current monoisotopic abundance.
    -388        dynamic_range : float
    -389            The dynamic range.
    -390
    -391        Yields
    -392        ------
    -393        MolecularFormulaIsotopologue
    -394            The molecular formula isotopologue.
    -395
    -396        Notes
    -397        -----
    -398        This calculation ignores the hydrogen isotopes.
    -399        """
    -400        
    -401        for mf in self._cal_isotopologues(self._d_molecular_formula, min_abundance, current_mono_abundance, dynamic_range ):
    -402             
    -403            yield MolecularFormulaIsotopologue(*mf, current_mono_abundance, self.ion_charge)
    +            
    385    def isotopologues(self, min_abundance, current_mono_abundance, dynamic_range): 
    +386        """Calculate the isotopologues for a given molecular formula.
    +387
    +388        Parameters
    +389        ----------
    +390        min_abundance : float
    +391            The minimum abundance.
    +392        current_mono_abundance : float
    +393            The current monoisotopic abundance.
    +394        dynamic_range : float
    +395            The dynamic range.
    +396
    +397        Yields
    +398        ------
    +399        MolecularFormulaIsotopologue
    +400            The molecular formula isotopologue.
    +401
    +402        Notes
    +403        -----
    +404        This calculation ignores the hydrogen isotopes.
    +405        """
    +406        
    +407        for mf in self._cal_isotopologues(self._d_molecular_formula, min_abundance, current_mono_abundance, dynamic_range ):
    +408             
    +409            yield MolecularFormulaIsotopologue(*mf, current_mono_abundance, self.ion_charge)
     
    @@ -2128,12 +2145,12 @@
    Notes
    -
    405    def atoms_qnt(self,atom): 
    -406        """Get the atom quantity of a specific atom in the molecular formula."""
    -407        if atom in self._d_molecular_formula:
    -408            return self._d_molecular_formula.get(atom)
    -409        else:
    -410            raise Warning('Could not find %s in this Molecular Formula object'%str(atom))
    +            
    411    def atoms_qnt(self,atom): 
    +412        """Get the atom quantity of a specific atom in the molecular formula."""
    +413        if atom in self._d_molecular_formula:
    +414            return self._d_molecular_formula.get(atom)
    +415        else:
    +416            raise Warning('Could not find %s in this Molecular Formula object'%str(atom))
     
    @@ -2153,9 +2170,9 @@
    Notes
    -
    412    def atoms_symbol(self, atom): 
    -413        """Get the atom symbol without the mass number."""
    -414        return ''.join([i for i in atom if not i.isdigit()])
    +            
    418    def atoms_symbol(self, atom): 
    +419        """Get the atom symbol without the mass number."""
    +420        return ''.join([i for i in atom if not i.isdigit()])
     
    @@ -2172,7 +2189,9 @@
    Notes
    - +

    Returns the molecular formula as a string.

    +
    +
    @@ -2197,15 +2216,15 @@
    Notes
    -
    445    def to_dict(self):
    -446        """Returns the molecular formula as a dictionary.
    -447        
    -448        Returns
    -449        -------
    -450        dict
    -451            The molecular formula as a dictionary.
    -452        """
    -453        return self._d_molecular_formula
    +            
    454    def to_dict(self):
    +455        """Returns the molecular formula as a dictionary.
    +456        
    +457        Returns
    +458        -------
    +459        dict
    +460            The molecular formula as a dictionary.
    +461        """
    +462        return self._d_molecular_formula
     
    @@ -2231,34 +2250,34 @@
    Returns
    -
    455    def to_list(self):
    -456        """Returns the molecular formula as a list.
    -457        
    -458        Returns
    -459        -------
    -460        list
    -461            The molecular formula as a list.
    -462            
    -463        Raises
    -464        ------
    -465        Exception
    -466            If the molecular formula identification was not performed yet.
    -467        """
    -468        #TODO ensure self._d_molecular_formula is a orderedDict
    -469        
    -470        if self._d_molecular_formula:
    -471            formula_list = []    
    -472            
    -473            for atom, atom_number in self._d_molecular_formula.items():
    -474    
    -475                if atom != Labels.ion_type:
    -476                    
    -477                    formula_list.append(atom)
    -478                    formula_list.append(atom_number)
    -479    
    -480            return formula_list
    -481        else:
    -482            raise Exception("Molecular formula identification not performed yet")
    +            
    464    def to_list(self):
    +465        """Returns the molecular formula as a list.
    +466        
    +467        Returns
    +468        -------
    +469        list
    +470            The molecular formula as a list.
    +471            
    +472        Raises
    +473        ------
    +474        Exception
    +475            If the molecular formula identification was not performed yet.
    +476        """
    +477        #TODO ensure self._d_molecular_formula is a orderedDict
    +478        
    +479        if self._d_molecular_formula:
    +480            formula_list = []    
    +481            
    +482            for atom, atom_number in self._d_molecular_formula.items():
    +483    
    +484                if atom != Labels.ion_type:
    +485                    
    +486                    formula_list.append(atom)
    +487                    formula_list.append(atom_number)
    +488    
    +489            return formula_list
    +490        else:
    +491            raise Exception("Molecular formula identification not performed yet")
     
    @@ -2324,64 +2343,64 @@
    Inherited Members
    -
    536class MolecularFormulaIsotopologue(MolecularFormulaBase):
    -537    """Class for representing a molecular formula isotopologue.
    -538    
    -539    Parameters
    -540    ----------
    -541    _d_molecular_formula : dict
    -542        The molecular formula as a dictionary.
    -543    prob_ratio : float
    -544        The probability ratio.
    -545    mono_abundance : float
    -546        The monoisotopic abundance.
    -547    ion_charge : int
    -548        The ion charge.
    -549    mspeak_parent : object, optional
    -550        The parent mass spectrum peak object instance. Defaults to None.
    -551    
    -552    Attributes
    -553    ----------
    -554    prob_ratio : float
    -555        The probability ratio.
    -556    abundance_calc : float
    -557        The calculated abundance.
    -558    area_error : float
    -559        The area error.
    -560    abundance_error : float
    -561        The abundance error.
    -562    is_isotopologue : bool
    -563        The isotopologue flag. Defaults to True.
    -564    mspeak_index_mono_isotopic : int
    -565        The index of the monoisotopic peak in the mass spectrum peak list. Defaults to None.
    -566    mono_isotopic_formula_index : int
    -567        The index of the monoisotopic formula in the molecular formula list. Defaults to None.
    -568    """
    -569    def __init__(self, _d_molecular_formula, prob_ratio, mono_abundance, ion_charge, mspeak_parent=None):
    -570        
    -571        super().__init__(_d_molecular_formula,  ion_charge)
    -572        #prob_ratio is relative to the monoisotopic peak p_isotopologue/p_mono_isotopic
    -573        
    -574        self.prob_ratio = prob_ratio
    -575        
    -576        self.abundance_calc = mono_abundance * prob_ratio
    -577
    -578        self.is_isotopologue = True
    +            
    545class MolecularFormulaIsotopologue(MolecularFormulaBase):
    +546    """Class for representing a molecular formula isotopologue.
    +547    
    +548    Parameters
    +549    ----------
    +550    _d_molecular_formula : dict
    +551        The molecular formula as a dictionary.
    +552    prob_ratio : float
    +553        The probability ratio.
    +554    mono_abundance : float
    +555        The monoisotopic abundance.
    +556    ion_charge : int
    +557        The ion charge.
    +558    mspeak_parent : object, optional
    +559        The parent mass spectrum peak object instance. Defaults to None.
    +560    
    +561    Attributes
    +562    ----------
    +563    prob_ratio : float
    +564        The probability ratio.
    +565    abundance_calc : float
    +566        The calculated abundance.
    +567    area_error : float
    +568        The area error.
    +569    abundance_error : float
    +570        The abundance error.
    +571    is_isotopologue : bool
    +572        The isotopologue flag. Defaults to True.
    +573    mspeak_index_mono_isotopic : int
    +574        The index of the monoisotopic peak in the mass spectrum peak list. Defaults to None.
    +575    mono_isotopic_formula_index : int
    +576        The index of the monoisotopic formula in the molecular formula list. Defaults to None.
    +577    """
    +578    def __init__(self, _d_molecular_formula, prob_ratio, mono_abundance, ion_charge, mspeak_parent=None):
     579        
    -580        self.mspeak_index_mono_isotopic = None
    -581
    -582        self.mono_isotopic_formula_index = None
    -583        # parent mass spectrum peak obj instance
    -584        self._mspeak_parent = mspeak_parent
    -585
    -586    
    -587    @property
    -588    def area_error(self):
    -589        return self._calc_area_error()
    +580        super().__init__(_d_molecular_formula,  ion_charge)
    +581        #prob_ratio is relative to the monoisotopic peak p_isotopologue/p_mono_isotopic
    +582        
    +583        self.prob_ratio = prob_ratio
    +584        
    +585        self.abundance_calc = mono_abundance * prob_ratio
    +586
    +587        self.is_isotopologue = True
    +588        
    +589        self.mspeak_index_mono_isotopic = None
     590
    -591    @property
    -592    def abundance_error(self):
    -593        return self._calc_abundance_error()
    +591        self.mono_isotopic_formula_index = None
    +592        # parent mass spectrum peak obj instance
    +593        self._mspeak_parent = mspeak_parent
    +594
    +595    
    +596    @property
    +597    def area_error(self):
    +598        return self._calc_area_error()
    +599
    +600    @property
    +601    def abundance_error(self):
    +602        return self._calc_abundance_error()
     
    @@ -2433,22 +2452,22 @@
    Attributes
    -
    569    def __init__(self, _d_molecular_formula, prob_ratio, mono_abundance, ion_charge, mspeak_parent=None):
    -570        
    -571        super().__init__(_d_molecular_formula,  ion_charge)
    -572        #prob_ratio is relative to the monoisotopic peak p_isotopologue/p_mono_isotopic
    -573        
    -574        self.prob_ratio = prob_ratio
    -575        
    -576        self.abundance_calc = mono_abundance * prob_ratio
    -577
    -578        self.is_isotopologue = True
    +            
    578    def __init__(self, _d_molecular_formula, prob_ratio, mono_abundance, ion_charge, mspeak_parent=None):
     579        
    -580        self.mspeak_index_mono_isotopic = None
    -581
    -582        self.mono_isotopic_formula_index = None
    -583        # parent mass spectrum peak obj instance
    -584        self._mspeak_parent = mspeak_parent
    +580        super().__init__(_d_molecular_formula,  ion_charge)
    +581        #prob_ratio is relative to the monoisotopic peak p_isotopologue/p_mono_isotopic
    +582        
    +583        self.prob_ratio = prob_ratio
    +584        
    +585        self.abundance_calc = mono_abundance * prob_ratio
    +586
    +587        self.is_isotopologue = True
    +588        
    +589        self.mspeak_index_mono_isotopic = None
    +590
    +591        self.mono_isotopic_formula_index = None
    +592        # parent mass spectrum peak obj instance
    +593        self._mspeak_parent = mspeak_parent
     
    @@ -2593,75 +2612,75 @@
    Inherited Members
    -
    595class LCMSLibRefMolecularFormula(MolecularFormulaBase):
    -596    """Class for representing a molecular formula associated with a molecule in a LCMS library reference.
    -597
    -598    Parameters
    -599    ----------
    -600    molecular_formula : dict, list, str
    -601        The molecular formula.
    -602    ion_charge : int
    -603        The ion charge.
    -604    ion_type : str, optional
    -605        The ion type. Defaults to None.
    -606    adduct_atom : str, optional
    -607        The adduct atom. Defaults to None.
    -608    mspeak_parent : object, optional
    -609        The parent mass spectrum peak object instance. Defaults to None.
    -610    name : str, optional
    -611        The name of the reference molecule. Defaults to None.
    -612    kegg_id : str, optional
    -613        The KEGG ID of the reference molecule. Defaults to None.
    -614    cas : str, optional
    -615        The CAS number of the reference molecule. Defaults to None.
    -616
    -617    """
    -618    
    -619    def __init__(self, molecular_formula, ion_charge, ion_type=None, 
    -620                    adduct_atom=None, mspeak_parent=None, name=None, kegg_id=None, cas=None) -> None:
    -621        
    -622        super().__init__(molecular_formula, ion_charge, ion_type=ion_type, 
    -623                    adduct_atom=adduct_atom, mspeak_parent=mspeak_parent)
    -624
    -625        self._name = name
    -626        self._kegg_id = kegg_id
    -627        self._cas = cas    
    -628    
    -629    @property
    -630    def name(self):
    -631        return self._name
    -632
    -633    @name.setter
    -634    def name(self, name):
    -635        if isinstance(name, str):
    -636            self._name = name
    -637        else:
    -638            raise TypeError('name: {} should be type string')    
    -639
    -640    @property
    -641    def kegg_id(self):
    -642        return self._kegg_id
    -643    
    -644    @kegg_id.setter
    -645    def kegg_id(self, kegg_id):
    -646        self._kegg_id = kegg_id
    -647        #if isinstance(kegg_id, str):
    -648        #    self._kegg_id = kegg_id
    -649        #else:
    -650        #    print(kegg_id)
    -651        #    raise TypeError('name: {} should be type string') 
    -652
    -653    @property
    -654    def cas(self):
    -655        return self._cas    
    -656    
    -657    @cas.setter
    -658    def cas(self, cas):
    -659        self._cas = cas
    -660        #if isinstance(cas, str):
    -661        #    self._cas = cas
    -662        #else:
    -663        #    raise TypeError('name: {} should be type string') 
    +            
    604class LCMSLibRefMolecularFormula(MolecularFormulaBase):
    +605    """Class for representing a molecular formula associated with a molecule in a LCMS library reference.
    +606
    +607    Parameters
    +608    ----------
    +609    molecular_formula : dict, list, str
    +610        The molecular formula.
    +611    ion_charge : int
    +612        The ion charge.
    +613    ion_type : str, optional
    +614        The ion type. Defaults to None.
    +615    adduct_atom : str, optional
    +616        The adduct atom. Defaults to None.
    +617    mspeak_parent : object, optional
    +618        The parent mass spectrum peak object instance. Defaults to None.
    +619    name : str, optional
    +620        The name of the reference molecule. Defaults to None.
    +621    kegg_id : str, optional
    +622        The KEGG ID of the reference molecule. Defaults to None.
    +623    cas : str, optional
    +624        The CAS number of the reference molecule. Defaults to None.
    +625
    +626    """
    +627    
    +628    def __init__(self, molecular_formula, ion_charge, ion_type=None, 
    +629                    adduct_atom=None, mspeak_parent=None, name=None, kegg_id=None, cas=None) -> None:
    +630        
    +631        super().__init__(molecular_formula, ion_charge, ion_type=ion_type, 
    +632                    adduct_atom=adduct_atom, mspeak_parent=mspeak_parent)
    +633
    +634        self._name = name
    +635        self._kegg_id = kegg_id
    +636        self._cas = cas    
    +637    
    +638    @property
    +639    def name(self):
    +640        return self._name
    +641
    +642    @name.setter
    +643    def name(self, name):
    +644        if isinstance(name, str):
    +645            self._name = name
    +646        else:
    +647            raise TypeError('name: {} should be type string')    
    +648
    +649    @property
    +650    def kegg_id(self):
    +651        return self._kegg_id
    +652    
    +653    @kegg_id.setter
    +654    def kegg_id(self, kegg_id):
    +655        self._kegg_id = kegg_id
    +656        #if isinstance(kegg_id, str):
    +657        #    self._kegg_id = kegg_id
    +658        #else:
    +659        #    print(kegg_id)
    +660        #    raise TypeError('name: {} should be type string') 
    +661
    +662    @property
    +663    def cas(self):
    +664        return self._cas    
    +665    
    +666    @cas.setter
    +667    def cas(self, cas):
    +668        self._cas = cas
    +669        #if isinstance(cas, str):
    +670        #    self._cas = cas
    +671        #else:
    +672        #    raise TypeError('name: {} should be type string') 
     
    @@ -2700,15 +2719,15 @@
    Parameters
    -
    619    def __init__(self, molecular_formula, ion_charge, ion_type=None, 
    -620                    adduct_atom=None, mspeak_parent=None, name=None, kegg_id=None, cas=None) -> None:
    -621        
    -622        super().__init__(molecular_formula, ion_charge, ion_type=ion_type, 
    -623                    adduct_atom=adduct_atom, mspeak_parent=mspeak_parent)
    -624
    -625        self._name = name
    -626        self._kegg_id = kegg_id
    -627        self._cas = cas    
    +            
    628    def __init__(self, molecular_formula, ion_charge, ion_type=None, 
    +629                    adduct_atom=None, mspeak_parent=None, name=None, kegg_id=None, cas=None) -> None:
    +630        
    +631        super().__init__(molecular_formula, ion_charge, ion_type=ion_type, 
    +632                    adduct_atom=adduct_atom, mspeak_parent=mspeak_parent)
    +633
    +634        self._name = name
    +635        self._kegg_id = kegg_id
    +636        self._cas = cas    
     
    @@ -2810,29 +2829,29 @@
    Inherited Members
    -
    665class MolecularFormula(MolecularFormulaBase):
    -666    """General class for representing a molecular formula.
    -667
    -668    Parameters
    -669    ----------
    -670    molecular_formula : dict, list, str
    -671        The molecular formula.
    -672    ion_charge : int
    -673        The ion charge.
    -674    ion_type : str, optional
    -675        The ion type. Defaults to None.
    -676    adduct_atom : str, optional
    -677        The adduct atom. Defaults to None.
    -678    mspeak_parent : object, optional
    -679        The parent mass spectrum peak object instance. Defaults to None.
    -680    external_mz : float, optional
    -681        The external m/z value. Defaults to False.
    -682    """
    -683
    -684    def __init__(self, molecular_formula, ion_charge, ion_type=None, 
    -685                adduct_atom=None, mspeak_parent=None, external_mz=False):
    -686        super().__init__(molecular_formula, ion_charge, ion_type=ion_type, 
    -687                adduct_atom=adduct_atom, mspeak_parent=mspeak_parent, external_mz=external_mz)
    +            
    674class MolecularFormula(MolecularFormulaBase):
    +675    """General class for representing a molecular formula.
    +676
    +677    Parameters
    +678    ----------
    +679    molecular_formula : dict, list, str
    +680        The molecular formula.
    +681    ion_charge : int
    +682        The ion charge.
    +683    ion_type : str, optional
    +684        The ion type. Defaults to None.
    +685    adduct_atom : str, optional
    +686        The adduct atom. Defaults to None.
    +687    mspeak_parent : object, optional
    +688        The parent mass spectrum peak object instance. Defaults to None.
    +689    external_mz : float, optional
    +690        The external m/z value. Defaults to False.
    +691    """
    +692
    +693    def __init__(self, molecular_formula, ion_charge, ion_type=None, 
    +694                adduct_atom=None, mspeak_parent=None, external_mz=False):
    +695        super().__init__(molecular_formula, ion_charge, ion_type=ion_type, 
    +696                adduct_atom=adduct_atom, mspeak_parent=mspeak_parent, external_mz=external_mz)
     
    @@ -2867,10 +2886,10 @@
    Parameters
    -
    684    def __init__(self, molecular_formula, ion_charge, ion_type=None, 
    -685                adduct_atom=None, mspeak_parent=None, external_mz=False):
    -686        super().__init__(molecular_formula, ion_charge, ion_type=ion_type, 
    -687                adduct_atom=adduct_atom, mspeak_parent=mspeak_parent, external_mz=external_mz)
    +            
    693    def __init__(self, molecular_formula, ion_charge, ion_type=None, 
    +694                adduct_atom=None, mspeak_parent=None, external_mz=False):
    +695        super().__init__(molecular_formula, ion_charge, ion_type=ion_type, 
    +696                adduct_atom=adduct_atom, mspeak_parent=mspeak_parent, external_mz=external_mz)
     
    diff --git a/docs/corems/molecular_id/factory/MolecularLookupTable.html b/docs/corems/molecular_id/factory/MolecularLookupTable.html index 236273a9..04c9deeb 100644 --- a/docs/corems/molecular_id/factory/MolecularLookupTable.html +++ b/docs/corems/molecular_id/factory/MolecularLookupTable.html @@ -84,6 +84,12 @@

    API Documentation

  • get_h_odd_or_even
  • +
  • + get_total_heteroatoms +
  • +
  • + get_total_hetero_valence +
  • get_total_halogen_atoms
  • @@ -238,686 +244,773 @@

    125 Gets the hydrogen odd or even. 126 * get_total_halogen_atoms(class_dict) 127 Gets the total number of halogen atoms. -128 -129 """ -130 -131 def __init__(self, sql_db = None): -132 -133 if not sql_db: -134 -135 self.sql_db = MolForm_SQL() -136 else: -137 -138 self.sql_db = sql_db -139 -140 def cProfile_worker(self, args): -141 """ cProfile worker for the get_mol_formulas function""" -142 cProfile.runctx('self.get_mol_formulas(*args)', globals(), locals(), 'mf_database_cprofile.prof') -143 -144 def check_database_get_class_list(self, molecular_search_settings): -145 """ check if the database has all the classes, if not create the missing classes -146 -147 Parameters -148 ---------- -149 molecular_search_settings : object -150 An object containing user-defined settings. -151 -152 Returns -153 ------- -154 list -155 list of tuples with the class name and the class dictionary -156 """ -157 all_class_to_create = [] -158 -159 classes_dict = self.get_classes_in_order(molecular_search_settings) -160 -161 class_str_set = set(classes_dict.keys()) -162 -163 existing_classes_objs = self.sql_db.session.query(HeteroAtoms).distinct().all() -164 -165 existing_classes_str = set([classe.name for classe in existing_classes_objs]) -166 -167 self.len_existing_classes = len(existing_classes_str) -168 -169 class_to_create = class_str_set - existing_classes_str -170 -171 class_count= len(existing_classes_objs) -172 -173 data_classes = list() -174 for index, class_str in enumerate(class_to_create): -175 -176 class_dict = classes_dict.get(class_str) -177 halogen_count = self.get_total_halogen_atoms(class_dict) -178 data_classes.append({"name":class_str, "id":class_count+ index + 1, "halogensCount": halogen_count}) -179 -180 #data_classes = [{"name":class_str, "id":class_count+ index + 1} for index, class_str in enumerate(class_to_create)] -181 -182 if data_classes: -183 -184 list_insert_chunks = chunks(data_classes, self.sql_db.chunks_count) -185 for insert_chunk in list_insert_chunks: -186 insert_query = HeteroAtoms.__table__.insert().values(insert_chunk) -187 self.sql_db.session.execute(insert_query) -188 -189 for index, class_str in enumerate(class_to_create): -190 -191 class_tuple = (class_str, classes_dict.get(class_str), class_count+ index + 1) -192 -193 all_class_to_create.append(class_tuple) -194 -195 return [(c_s, c_d) for c_s, c_d in classes_dict.items()], all_class_to_create, existing_classes_objs -196 -197 def get_carbonsHydrogens(self, settings, odd_even): -198 """ Retrieve carbon and hydrogen atoms from the molecular lookup table based on user-defined settings. -199 -200 Parameters -201 ---------- -202 settings : object -203 An object containing user-defined settings. -204 odd_even : str -205 A string indicating whether to retrieve even or odd hydrogen atoms. -206 -207 Returns -208 ------- -209 list -210 A list of CarbonHydrogen objects that satisfy the specified conditions. -211 """ -212 operator = '==' if odd_even == 'even' else '!=' -213 usedAtoms = settings.usedAtoms -214 user_min_c, user_max_c = usedAtoms.get('C') -215 user_min_h, user_max_h = usedAtoms.get('H') -216 -217 return eval("self.sql_db.session.query(CarbonHydrogen).filter(" -218 "CarbonHydrogen.C >= user_min_c," -219 "CarbonHydrogen.H >= user_min_h," -220 "CarbonHydrogen.C <= user_max_c," -221 "CarbonHydrogen.H <= user_max_h," -222 "CarbonHydrogen.H % 2" + operator+ "0).all()") -223 -224 def add_carbonsHydrogens(self, settings, existing_classes_objs): -225 """ Add carbon and hydrogen atoms to the molecular lookup table based on user-defined settings. -226 -227 Parameters -228 ---------- -229 settings : object -230 An object containing user-defined settings. -231 existing_classes_objs : list -232 A list of HeteroAtoms objects. -233 """ -234 usedAtoms = settings.usedAtoms -235 -236 user_min_c, user_max_c = usedAtoms.get('C') -237 user_min_h, user_max_h = usedAtoms.get('H') -238 -239 query_obj = self.sql_db.session.query(func.max(CarbonHydrogen.C).label("max_c"), -240 func.min(CarbonHydrogen.C).label("min_c"), -241 func.max(CarbonHydrogen.H).label("max_h"), -242 func.min(CarbonHydrogen.H).label("min_h"), -243 ) -244 +128 * get_total_hetero_valence(class_dict) +129 Gets the total valence of heteroatoms other than N, F, Cl, and Br +130 """ +131 +132 def __init__(self, sql_db = None): +133 +134 if not sql_db: +135 +136 self.sql_db = MolForm_SQL() +137 else: +138 +139 self.sql_db = sql_db +140 +141 def cProfile_worker(self, args): +142 """ cProfile worker for the get_mol_formulas function""" +143 cProfile.runctx('self.get_mol_formulas(*args)', globals(), locals(), 'mf_database_cprofile.prof') +144 +145 def check_database_get_class_list(self, molecular_search_settings): +146 """ check if the database has all the classes, if not create the missing classes +147 +148 Parameters +149 ---------- +150 molecular_search_settings : object +151 An object containing user-defined settings. +152 +153 Returns +154 ------- +155 list +156 list of tuples with the class name and the class dictionary +157 """ +158 all_class_to_create = [] +159 +160 classes_dict = self.get_classes_in_order(molecular_search_settings) +161 +162 class_str_set = set(classes_dict.keys()) +163 +164 existing_classes_objs = self.sql_db.session.query(HeteroAtoms).distinct().all() +165 +166 existing_classes_str = set([classe.name for classe in existing_classes_objs]) +167 +168 self.len_existing_classes = len(existing_classes_str) +169 +170 class_to_create = class_str_set - existing_classes_str +171 +172 class_count= len(existing_classes_objs) +173 +174 data_classes = list() +175 for index, class_str in enumerate(class_to_create): +176 +177 class_dict = classes_dict.get(class_str) +178 halogen_count = self.get_total_halogen_atoms(class_dict) +179 data_classes.append({"name":class_str, "id":class_count+ index + 1, "halogensCount": halogen_count}) +180 +181 #data_classes = [{"name":class_str, "id":class_count+ index + 1} for index, class_str in enumerate(class_to_create)] +182 +183 if data_classes: +184 +185 list_insert_chunks = chunks(data_classes, self.sql_db.chunks_count) +186 for insert_chunk in list_insert_chunks: +187 insert_query = HeteroAtoms.__table__.insert().values(insert_chunk) +188 self.sql_db.session.execute(insert_query) +189 +190 for index, class_str in enumerate(class_to_create): +191 +192 class_tuple = (class_str, classes_dict.get(class_str), class_count+ index + 1) +193 +194 all_class_to_create.append(class_tuple) +195 +196 return [(c_s, c_d) for c_s, c_d in classes_dict.items()], all_class_to_create, existing_classes_objs +197 +198 def get_carbonsHydrogens(self, settings, odd_even): +199 """ Retrieve carbon and hydrogen atoms from the molecular lookup table based on user-defined settings. +200 +201 Parameters +202 ---------- +203 settings : object +204 An object containing user-defined settings. +205 odd_even : str +206 A string indicating whether to retrieve even or odd hydrogen atoms. +207 +208 Returns +209 ------- +210 list +211 A list of CarbonHydrogen objects that satisfy the specified conditions. +212 """ +213 operator = '==' if odd_even == 'even' else '!=' +214 usedAtoms = settings.usedAtoms +215 user_min_c, user_max_c = usedAtoms.get('C') +216 user_min_h, user_max_h = usedAtoms.get('H') +217 +218 return eval("self.sql_db.session.query(CarbonHydrogen).filter(" +219 "CarbonHydrogen.C >= user_min_c," +220 "CarbonHydrogen.H >= user_min_h," +221 "CarbonHydrogen.C <= user_max_c," +222 "CarbonHydrogen.H <= user_max_h," +223 "CarbonHydrogen.H % 2" + operator+ "0).all()") +224 +225 def add_carbonsHydrogens(self, settings, existing_classes_objs): +226 """ Add carbon and hydrogen atoms to the molecular lookup table based on user-defined settings. +227 +228 Parameters +229 ---------- +230 settings : object +231 An object containing user-defined settings. +232 existing_classes_objs : list +233 A list of HeteroAtoms objects. +234 """ +235 usedAtoms = settings.usedAtoms +236 +237 user_min_c, user_max_c = usedAtoms.get('C') +238 user_min_h, user_max_h = usedAtoms.get('H') +239 +240 query_obj = self.sql_db.session.query(func.max(CarbonHydrogen.C).label("max_c"), +241 func.min(CarbonHydrogen.C).label("min_c"), +242 func.max(CarbonHydrogen.H).label("max_h"), +243 func.min(CarbonHydrogen.H).label("min_h"), +244 ) 245 -246 database = query_obj.first() -247 if database.max_c == user_max_c and database.min_c == user_min_c and database.max_h == user_max_h and database.min_h == user_min_h: -248 #all data is already available at the database -249 pass -250 -251 else: -252 -253 current_count = self.sql_db.session.query(CarbonHydrogen.C).count() -254 -255 databaseCarbonHydrogen = self.sql_db.session.query(CarbonHydrogen).all() -256 -257 userCarbon = set(range(user_min_c, user_max_c + 1)) -258 userHydrogen = set(range(user_min_h, user_max_h + 1)) -259 -260 carbon_hydrogen_objs_database = {} -261 for obj in databaseCarbonHydrogen: -262 -263 str_data = "C:{},H:{}".format(obj.C, obj.H) -264 carbon_hydrogen_objs_database[str_data] = str_data -265 -266 carbon_hydrogen_objs_to_create = {'even': {}, 'odd': {}} -267 -268 list_ch_obj_to_add = list() -269 i = 0 -270 for comb in itertools.product(userCarbon, userHydrogen): -271 -272 C = comb[0] -273 H = comb[1] -274 data = {"C":C, -275 "H":H, -276 } -277 -278 data_insert = {"C":C, -279 "H":H, -280 } -281 -282 str_data = "C:{},H:{}".format(C,H) -283 -284 if not str_data in carbon_hydrogen_objs_database.keys(): -285 -286 label = 'even' if comb[1]%2 == 0 else 'odd' -287 data["mass"] = (C * Atoms.atomic_masses.get('C')) + (H * Atoms.atomic_masses.get('H')) -288 data["dbe"] = C - (H/2) + 1 -289 data["id"] = i + current_count + 1 -290 data_insert["id"] = i + current_count + 1 -291 i = i + 1 -292 carbon_hydrogen_objs_to_create[label][str_data] = data -293 -294 list_ch_obj_to_add.append(data_insert) -295 -296 if list_ch_obj_to_add: -297 # insert carbon hydrogen objs -298 list_insert_chunks = chunks(list_ch_obj_to_add, self.sql_db.chunks_count) -299 for insert_chunk in list_insert_chunks: -300 insert_query = CarbonHydrogen.__table__.insert().values(insert_chunk) -301 self.sql_db.session.execute(insert_query) -302 self.sql_db.session.commit() -303 -304 -305 list_molecular_form= list() -306 for classe_obj in existing_classes_objs: -307 -308 classe_dict = classe_obj.to_dict() -309 classe_mass = self.calc_mz(classe_dict) -310 classe_dbe = self.calc_dbe_class(classe_dict) -311 -312 odd_even_label = self.get_h_odd_or_even(classe_dict) -313 -314 ch_datalist = carbon_hydrogen_objs_to_create.get(odd_even_label).values() -315 -316 for ch_dict in ch_datalist: -317 mass = ch_dict.get('mass') + classe_mass -318 dbe = ch_dict.get('dbe') + classe_dbe -319 -320 if settings.min_mz <= mass <= settings.max_mz: -321 -322 if settings.min_dbe <= dbe <= settings.max_dbe: -323 -324 list_molecular_form.append( {"heteroAtoms_id":classe_obj.id, -325 "carbonHydrogen_id":ch_dict.get('id'), -326 "mass":mass, "DBE":dbe}) -327 -328 list_insert_chunks = chunks(list_molecular_form, self.sql_db.chunks_count) -329 for insert_chunk in list_insert_chunks: -330 insert_query = MolecularFormulaLink.__table__.insert().values(insert_chunk) -331 self.sql_db.session.execute(insert_query) -332 self.sql_db.session.commit() -333 -334 -335 @timeit -336 def runworker(self, molecular_search_settings): -337 """ Run the molecular formula lookup table worker. -338 -339 Parameters -340 ---------- -341 molecular_search_settings : object -342 An object containing user-defined settings. -343 -344 Returns -345 ------- -346 list -347 A list of tuples with the class name and the class dictionary. -348 -349 -350 """ -351 -352 classes_list, class_to_create, existing_classes_objs = self.check_database_get_class_list(molecular_search_settings) -353 -354 settings = MolecularLookupDictSettings() -355 settings.usedAtoms = deepcopy(molecular_search_settings.usedAtoms) -356 settings.url_database = molecular_search_settings.url_database -357 settings.db_jobs = molecular_search_settings.db_jobs -358 -359 self.add_carbonsHydrogens(settings, existing_classes_objs) -360 -361 if class_to_create: -362 -363 settings = MolecularLookupDictSettings() -364 settings.usedAtoms = deepcopy(molecular_search_settings.usedAtoms) -365 settings.url_database = molecular_search_settings.url_database -366 settings.db_jobs = molecular_search_settings.db_jobs -367 -368 self.sql_db.session.commit() -369 odd_ch_obj = self.get_carbonsHydrogens(settings,'odd') -370 self.odd_ch_id = [obj.id for obj in odd_ch_obj] -371 self.odd_ch_dict = [{'C':obj.C, 'H':obj.H} for obj in odd_ch_obj] -372 self.odd_ch_mass = [obj.mass for obj in odd_ch_obj] -373 self.odd_ch_dbe = [obj.dbe for obj in odd_ch_obj] -374 -375 even_ch_obj = self.get_carbonsHydrogens(settings, 'even') -376 self.even_ch_id = [obj.id for obj in even_ch_obj] -377 self.even_ch_dict = [{'C':obj.C, 'H':obj.H} for obj in even_ch_obj] -378 self.even_ch_mass = [obj.mass for obj in even_ch_obj] -379 self.even_ch_dbe = [obj.dbe for obj in even_ch_obj] -380 -381 all_results= list() -382 for class_tuple in tqdm(class_to_create): -383 -384 results = self.populate_combinations(class_tuple, settings) -385 all_results.extend(results) -386 if settings.db_jobs == 1: -387 #if len(all_results) >= self.sql_db.chunks_count: -388 list_insert_chunks = list(chunks(results, self.sql_db.chunks_count)) -389 for chunk in list_insert_chunks: -390 insert_query = MolecularFormulaLink.__table__.insert().values(chunk) -391 self.sql_db.session.execute(insert_query) -392 #all_results = list() -393 self.sql_db.session.commit() -394 # each chunk takes ~600Mb of memory, so if using 8 processes the total free memory needs to be 5GB -395 if settings.db_jobs > 1: -396 list_insert_chunks = list(chunks(all_results, self.sql_db.chunks_count)) -397 print( "Started database insert using {} iterations for a total of {} rows".format(len(list_insert_chunks), len(all_results))) -398 worker_args = [(chunk, settings.url_database) for chunk in list_insert_chunks] -399 p = multiprocessing.Pool(settings.db_jobs) -400 for class_list in tqdm(p.imap_unordered(insert_database_worker, worker_args)): -401 pass -402 p.close() -403 p.join() -404 -405 return classes_list -406 -407 def get_classes_in_order(self, molecular_search_settings): -408 """ Get the classes in order -409 -410 Parameters -411 ---------- -412 molecular_search_settings : object -413 An object containing user-defined settings. -414 -415 Returns -416 ------- -417 dict -418 A dictionary of classes in order. -419 structure is ('HC', {'HC': 1}) -420 """ -421 -422 usedAtoms = deepcopy(molecular_search_settings.usedAtoms) -423 -424 usedAtoms.pop("C") -425 usedAtoms.pop("H") -426 -427 min_n, max_n = usedAtoms.get('N') if usedAtoms.get('N') else (0,0) -428 min_o, max_o = usedAtoms.get('O') if usedAtoms.get('O') else (0,0) -429 min_s, max_s = usedAtoms.get('S') if usedAtoms.get('S') else (0,0) -430 min_p, max_p = usedAtoms.get('P') if usedAtoms.get('P') else (0,0) -431 -432 possible_n = [n for n in range(min_n, max_n + 1)] -433 possible_o = [o for o in range(min_o, max_o + 1)] -434 possible_s = [s for s in range(min_s, max_s + 1)] -435 possible_p = [p for p in range(min_p, max_p + 1)] -436 -437 atoms_in_order = ['N', 'O', 'S', 'P'] -438 -439 classe_in_order = {} -440 -441 all_atoms_tuples = itertools.product(possible_n, possible_o, -442 possible_s, possible_p) -443 -444 for atom in atoms_in_order: -445 usedAtoms.pop(atom, None) -446 -447 for selected_atom, min_max_tuple in usedAtoms.items(): -448 -449 min_x = min_max_tuple[0] -450 max_x = min_max_tuple[1] -451 -452 -453 possible_x = [x for x in range(min_x, max_x + 1)] -454 -455 all_atoms_tuples = itertools.product(all_atoms_tuples, possible_x) -456 all_atoms_tuples = [all_atoms_combined[0] + (all_atoms_combined[1],) for all_atoms_combined in -457 all_atoms_tuples] -458 atoms_in_order.append(selected_atom) -459 -460 for all_atoms_tuple in all_atoms_tuples: -461 -462 classe_str = '' -463 classe_dict = {} -464 -465 for each_atoms_index, atom_number in enumerate(all_atoms_tuple): -466 -467 if atom_number != 0: -468 classe_dict[atoms_in_order[each_atoms_index]] = atom_number -469 -470 if not classe_dict: -471 classe_in_order['HC'] = {"HC": ""} -472 continue -473 -474 classe_str =json.dumps(classe_dict) -475 -476 if len(classe_str) > 0: -477 -478 classe_in_order[classe_str] = classe_dict -479 -480 classe_in_order_dict = self.sort_classes(atoms_in_order, classe_in_order) -481 -482 return classe_in_order_dict -483 -484 @staticmethod -485 def sort_classes( atoms_in_order, combination_dict) -> Dict[str, Dict[str, int]]: -486 """ Sort the classes in order -487 -488 Parameters -489 ---------- -490 atoms_in_order : list -491 A list of atoms in order. -492 combination_dict : dict -493 A dictionary of classes. -494 -495 Returns -496 ------- -497 dict -498 A dictionary of classes in order. -499 """ -500 #ensures atoms are always in the order defined at atoms_in_order list -501 join_dict_classes = dict() -502 atoms_in_order = ['N','S','P','O'] + atoms_in_order[4:] + ['HC'] -503 -504 sort_method = lambda atoms_keys: [atoms_in_order.index(atoms_keys)] -505 for class_str, class_dict in combination_dict.items(): -506 -507 sorted_dict_keys = sorted(class_dict, key = sort_method) -508 class_dict = { atom: class_dict[atom] for atom in sorted_dict_keys} -509 class_str = json.dumps(class_dict) -510 # using json for the new database, class -511 # class_str = ' '.join([atom + str(class_dict[atom]) for atom in sorted_dict_keys]) -512 join_dict_classes[class_str] = class_dict -513 -514 return join_dict_classes -515 -516 @staticmethod -517 def get_fixed_initial_number_of_hydrogen( min_h, odd_even): -518 """ Get the fixed initial number of hydrogen atoms -519 -520 Parameters -521 ---------- -522 min_h : int -523 The minimum number of hydrogen atoms. -524 odd_even : str -525 A string indicating whether to retrieve even or odd hydrogen atoms. -526 """ -527 remaining_h = min_h % 2 -528 -529 if odd_even == 'even': -530 -531 if remaining_h == 0: return remaining_h -532 -533 else: return remaining_h + 1 -534 -535 else: -536 -537 if remaining_h == 0: return remaining_h + 1 -538 -539 else: return remaining_h -540 -541 def calc_mz(self, datadict, class_mass=0): -542 """ Calculate the mass-to-charge ratio (m/z) of a molecular formula. -543 -544 Parameters -545 ---------- -546 datadict : dict -547 A dictionary of classes. -548 class_mass : int -549 The mass of the class. -550 -551 Returns -552 ------- -553 float -554 The mass-to-charge ratio (m/z) of a molecular formula. -555 """ -556 mass = class_mass -557 -558 for atom in datadict.keys(): -559 -560 if atom != 'HC': -561 -562 mass = mass + Atoms.atomic_masses[atom] * datadict.get(atom) -563 -564 return mass -565 -566 def calc_dbe_class(self, datadict): -567 """ Calculate the double bond equivalent (DBE) of a molecular formula. -568 -569 Parameters -570 ---------- -571 datadict : dict -572 A dictionary of classes. -573 -574 Returns -575 ------- -576 float -577 The double bond equivalent (DBE) of a molecular formula. -578 """ -579 init_dbe = 0 -580 for atom in datadict.keys(): -581 -582 if atom == 'HC': -583 continue -584 -585 n_atom = int(datadict.get(atom)) -586 -587 clean_atom = ''.join([i for i in atom if not i.isdigit()]) -588 -589 valencia = MSParameters.molecular_search.used_atom_valences.get(clean_atom) -590 -591 if type(valencia) is tuple: -592 valencia = valencia[0] -593 if valencia > 0: -594 #print atom, valencia, n_atom, init_dbe -595 init_dbe = init_dbe + (n_atom * (valencia - 2)) -596 else: -597 continue -598 -599 return (0.5 * init_dbe) -600 -601 def populate_combinations(self, classe_tuple, settings): -602 """ Populate the combinations -603 -604 Parameters -605 ---------- -606 classe_tuple : tuple -607 A tuple containing the class name, the class dictionary, and the class ID. -608 settings : object -609 An object containing user-defined settings. -610 -611 Returns -612 ------- -613 list -614 A list of molecular formula data dictionaries. -615 """ -616 ion_charge = 0 -617 -618 class_dict = classe_tuple[1] -619 odd_or_even = self.get_h_odd_or_even(class_dict) -620 -621 return self.get_mol_formulas(odd_or_even, classe_tuple, settings) -622 -623 def get_or_add(self, SomeClass, kw): -624 """ Get or add a class -625 -626 Parameters -627 ---------- -628 SomeClass : object -629 A class object. -630 kw : dict -631 A dictionary of classes. -632 -633 Returns -634 ------- -635 object -636 A class object. -637 """ -638 obj = self.sql_db.session.query(SomeClass).filter_by(**kw).first() -639 if not obj: -640 obj = SomeClass(**kw) -641 return obj -642 +246 +247 database = query_obj.first() +248 if database.max_c == user_max_c and database.min_c == user_min_c and database.max_h == user_max_h and database.min_h == user_min_h: +249 #all data is already available at the database +250 pass +251 +252 else: +253 +254 current_count = self.sql_db.session.query(CarbonHydrogen.C).count() +255 +256 databaseCarbonHydrogen = self.sql_db.session.query(CarbonHydrogen).all() +257 +258 userCarbon = set(range(user_min_c, user_max_c + 1)) +259 userHydrogen = set(range(user_min_h, user_max_h + 1)) +260 +261 carbon_hydrogen_objs_database = {} +262 for obj in databaseCarbonHydrogen: +263 +264 str_data = "C:{},H:{}".format(obj.C, obj.H) +265 carbon_hydrogen_objs_database[str_data] = str_data +266 +267 carbon_hydrogen_objs_to_create = {'even': {}, 'odd': {}} +268 +269 list_ch_obj_to_add = list() +270 i = 0 +271 for comb in itertools.product(userCarbon, userHydrogen): +272 +273 C = comb[0] +274 H = comb[1] +275 data = {"C":C, +276 "H":H, +277 } +278 +279 data_insert = {"C":C, +280 "H":H, +281 } +282 +283 str_data = "C:{},H:{}".format(C,H) +284 +285 if not str_data in carbon_hydrogen_objs_database.keys(): +286 +287 label = 'even' if comb[1]%2 == 0 else 'odd' +288 data["mass"] = (C * Atoms.atomic_masses.get('C')) + (H * Atoms.atomic_masses.get('H')) +289 data["dbe"] = C - (H/2) + 1 +290 data["id"] = i + current_count + 1 +291 data_insert["id"] = i + current_count + 1 +292 i = i + 1 +293 carbon_hydrogen_objs_to_create[label][str_data] = data +294 +295 list_ch_obj_to_add.append(data_insert) +296 +297 if list_ch_obj_to_add: +298 # insert carbon hydrogen objs +299 list_insert_chunks = chunks(list_ch_obj_to_add, self.sql_db.chunks_count) +300 for insert_chunk in list_insert_chunks: +301 insert_query = CarbonHydrogen.__table__.insert().values(insert_chunk) +302 self.sql_db.session.execute(insert_query) +303 self.sql_db.session.commit() +304 +305 +306 list_molecular_form= list() +307 for classe_obj in existing_classes_objs: +308 +309 classe_dict = classe_obj.to_dict() +310 classe_mass = self.calc_mz(classe_dict) +311 classe_dbe = self.calc_dbe_class(classe_dict) +312 +313 odd_even_label = self.get_h_odd_or_even(classe_dict) +314 +315 ch_datalist = carbon_hydrogen_objs_to_create.get(odd_even_label).values() +316 +317 for ch_dict in ch_datalist: +318 mass = ch_dict.get('mass') + classe_mass +319 dbe = ch_dict.get('dbe') + classe_dbe +320 +321 if settings.min_mz <= mass <= settings.max_mz: +322 +323 if settings.min_dbe <= dbe <= settings.max_dbe: +324 +325 list_molecular_form.append( {"heteroAtoms_id":classe_obj.id, +326 "carbonHydrogen_id":ch_dict.get('id'), +327 "mass":mass, "DBE":dbe}) +328 +329 list_insert_chunks = chunks(list_molecular_form, self.sql_db.chunks_count) +330 for insert_chunk in list_insert_chunks: +331 insert_query = MolecularFormulaLink.__table__.insert().values(insert_chunk) +332 self.sql_db.session.execute(insert_query) +333 self.sql_db.session.commit() +334 +335 +336 @timeit +337 def runworker(self, molecular_search_settings): +338 """ Run the molecular formula lookup table worker. +339 +340 Parameters +341 ---------- +342 molecular_search_settings : object +343 An object containing user-defined settings. +344 +345 Returns +346 ------- +347 list +348 A list of tuples with the class name and the class dictionary. +349 +350 +351 """ +352 +353 classes_list, class_to_create, existing_classes_objs = self.check_database_get_class_list(molecular_search_settings) +354 +355 settings = MolecularLookupDictSettings() +356 settings.usedAtoms = deepcopy(molecular_search_settings.usedAtoms) +357 settings.url_database = molecular_search_settings.url_database +358 settings.db_jobs = molecular_search_settings.db_jobs +359 +360 self.add_carbonsHydrogens(settings, existing_classes_objs) +361 +362 if class_to_create: +363 +364 settings = MolecularLookupDictSettings() +365 settings.usedAtoms = deepcopy(molecular_search_settings.usedAtoms) +366 settings.url_database = molecular_search_settings.url_database +367 settings.db_jobs = molecular_search_settings.db_jobs +368 +369 self.sql_db.session.commit() +370 odd_ch_obj = self.get_carbonsHydrogens(settings,'odd') +371 self.odd_ch_id = [obj.id for obj in odd_ch_obj] +372 self.odd_ch_dict = [{'C':obj.C, 'H':obj.H} for obj in odd_ch_obj] +373 self.odd_ch_mass = [obj.mass for obj in odd_ch_obj] +374 self.odd_ch_dbe = [obj.dbe for obj in odd_ch_obj] +375 +376 even_ch_obj = self.get_carbonsHydrogens(settings, 'even') +377 self.even_ch_id = [obj.id for obj in even_ch_obj] +378 self.even_ch_dict = [{'C':obj.C, 'H':obj.H} for obj in even_ch_obj] +379 self.even_ch_mass = [obj.mass for obj in even_ch_obj] +380 self.even_ch_dbe = [obj.dbe for obj in even_ch_obj] +381 +382 all_results= list() +383 for class_tuple in tqdm(class_to_create): +384 +385 results = self.populate_combinations(class_tuple, settings) +386 all_results.extend(results) +387 if settings.db_jobs == 1: +388 #if len(all_results) >= self.sql_db.chunks_count: +389 list_insert_chunks = list(chunks(results, self.sql_db.chunks_count)) +390 for chunk in list_insert_chunks: +391 insert_query = MolecularFormulaLink.__table__.insert().values(chunk) +392 self.sql_db.session.execute(insert_query) +393 #all_results = list() +394 self.sql_db.session.commit() +395 # each chunk takes ~600Mb of memory, so if using 8 processes the total free memory needs to be 5GB +396 if settings.db_jobs > 1: +397 list_insert_chunks = list(chunks(all_results, self.sql_db.chunks_count)) +398 print( "Started database insert using {} iterations for a total of {} rows".format(len(list_insert_chunks), len(all_results))) +399 worker_args = [(chunk, settings.url_database) for chunk in list_insert_chunks] +400 p = multiprocessing.Pool(settings.db_jobs) +401 for class_list in tqdm(p.imap_unordered(insert_database_worker, worker_args)): +402 pass +403 p.close() +404 p.join() +405 +406 return classes_list +407 +408 def get_classes_in_order(self, molecular_search_settings): +409 """ Get the classes in order +410 +411 Parameters +412 ---------- +413 molecular_search_settings : object +414 An object containing user-defined settings. +415 +416 Returns +417 ------- +418 dict +419 A dictionary of classes in order. +420 structure is ('HC', {'HC': 1}) +421 """ +422 +423 usedAtoms = deepcopy(molecular_search_settings.usedAtoms) +424 +425 usedAtoms.pop("C") +426 usedAtoms.pop("H") +427 +428 min_n, max_n = usedAtoms.get('N') if usedAtoms.get('N') else (0,0) +429 min_o, max_o = usedAtoms.get('O') if usedAtoms.get('O') else (0,0) +430 min_s, max_s = usedAtoms.get('S') if usedAtoms.get('S') else (0,0) +431 min_p, max_p = usedAtoms.get('P') if usedAtoms.get('P') else (0,0) +432 +433 possible_n = [n for n in range(min_n, max_n + 1)] +434 possible_o = [o for o in range(min_o, max_o + 1)] +435 possible_s = [s for s in range(min_s, max_s + 1)] +436 possible_p = [p for p in range(min_p, max_p + 1)] +437 +438 atoms_in_order = ['N', 'O', 'S', 'P'] +439 +440 classe_in_order = {} +441 +442 all_atoms_tuples = itertools.product(possible_n, possible_o, +443 possible_s, possible_p) +444 +445 for atom in atoms_in_order: +446 usedAtoms.pop(atom, None) +447 +448 for selected_atom, min_max_tuple in usedAtoms.items(): +449 +450 min_x = min_max_tuple[0] +451 max_x = min_max_tuple[1] +452 +453 +454 possible_x = [x for x in range(min_x, max_x + 1)] +455 +456 all_atoms_tuples = itertools.product(all_atoms_tuples, possible_x) +457 all_atoms_tuples = [all_atoms_combined[0] + (all_atoms_combined[1],) for all_atoms_combined in +458 all_atoms_tuples] +459 atoms_in_order.append(selected_atom) +460 +461 for all_atoms_tuple in all_atoms_tuples: +462 +463 classe_str = '' +464 classe_dict = {} +465 +466 for each_atoms_index, atom_number in enumerate(all_atoms_tuple): +467 +468 if atom_number != 0: +469 classe_dict[atoms_in_order[each_atoms_index]] = atom_number +470 +471 if not classe_dict: +472 classe_in_order['HC'] = {"HC": ""} +473 continue +474 +475 classe_str =json.dumps(classe_dict) +476 +477 if len(classe_str) > 0: +478 +479 classe_in_order[classe_str] = classe_dict +480 +481 classe_in_order_dict = self.sort_classes(atoms_in_order, classe_in_order) +482 +483 return classe_in_order_dict +484 +485 @staticmethod +486 def sort_classes( atoms_in_order, combination_dict) -> Dict[str, Dict[str, int]]: +487 """ Sort the classes in order +488 +489 Parameters +490 ---------- +491 atoms_in_order : list +492 A list of atoms in order. +493 combination_dict : dict +494 A dictionary of classes. +495 +496 Returns +497 ------- +498 dict +499 A dictionary of classes in order. +500 """ +501 #ensures atoms are always in the order defined at atoms_in_order list +502 join_dict_classes = dict() +503 atoms_in_order = ['N','S','P','O'] + atoms_in_order[4:] + ['HC'] +504 +505 sort_method = lambda atoms_keys: [atoms_in_order.index(atoms_keys)] +506 for class_str, class_dict in combination_dict.items(): +507 +508 sorted_dict_keys = sorted(class_dict, key = sort_method) +509 class_dict = { atom: class_dict[atom] for atom in sorted_dict_keys} +510 class_str = json.dumps(class_dict) +511 # using json for the new database, class +512 # class_str = ' '.join([atom + str(class_dict[atom]) for atom in sorted_dict_keys]) +513 join_dict_classes[class_str] = class_dict +514 +515 return join_dict_classes +516 +517 @staticmethod +518 def get_fixed_initial_number_of_hydrogen( min_h, odd_even): +519 """ Get the fixed initial number of hydrogen atoms +520 +521 Parameters +522 ---------- +523 min_h : int +524 The minimum number of hydrogen atoms. +525 odd_even : str +526 A string indicating whether to retrieve even or odd hydrogen atoms. +527 """ +528 remaining_h = min_h % 2 +529 +530 if odd_even == 'even': +531 +532 if remaining_h == 0: return remaining_h +533 +534 else: return remaining_h + 1 +535 +536 else: +537 +538 if remaining_h == 0: return remaining_h + 1 +539 +540 else: return remaining_h +541 +542 def calc_mz(self, datadict, class_mass=0): +543 """ Calculate the mass-to-charge ratio (m/z) of a molecular formula. +544 +545 Parameters +546 ---------- +547 datadict : dict +548 A dictionary of classes. +549 class_mass : int +550 The mass of the class. +551 +552 Returns +553 ------- +554 float +555 The mass-to-charge ratio (m/z) of a molecular formula. +556 """ +557 mass = class_mass +558 +559 for atom in datadict.keys(): +560 +561 if atom != 'HC': +562 +563 mass = mass + Atoms.atomic_masses[atom] * datadict.get(atom) +564 +565 return mass +566 +567 def calc_dbe_class(self, datadict): +568 """ Calculate the double bond equivalent (DBE) of a molecular formula. +569 +570 Parameters +571 ---------- +572 datadict : dict +573 A dictionary of classes. +574 +575 Returns +576 ------- +577 float +578 The double bond equivalent (DBE) of a molecular formula. +579 """ +580 init_dbe = 0 +581 for atom in datadict.keys(): +582 +583 if atom == 'HC': +584 continue +585 +586 n_atom = int(datadict.get(atom)) +587 +588 clean_atom = ''.join([i for i in atom if not i.isdigit()]) +589 +590 valencia = MSParameters.molecular_search.used_atom_valences.get(clean_atom) +591 +592 if type(valencia) is tuple: +593 valencia = valencia[0] +594 if valencia > 0: +595 #print atom, valencia, n_atom, init_dbe +596 init_dbe = init_dbe + (n_atom * (valencia - 2)) +597 else: +598 continue +599 +600 return (0.5 * init_dbe) +601 +602 def populate_combinations(self, classe_tuple, settings): +603 """ Populate the combinations +604 +605 Parameters +606 ---------- +607 classe_tuple : tuple +608 A tuple containing the class name, the class dictionary, and the class ID. +609 settings : object +610 An object containing user-defined settings. +611 +612 Returns +613 ------- +614 list +615 A list of molecular formula data dictionaries. +616 """ +617 ion_charge = 0 +618 +619 class_dict = classe_tuple[1] +620 odd_or_even = self.get_h_odd_or_even(class_dict) +621 +622 return self.get_mol_formulas(odd_or_even, classe_tuple, settings) +623 +624 def get_or_add(self, SomeClass, kw): +625 """ Get or add a class +626 +627 Parameters +628 ---------- +629 SomeClass : object +630 A class object. +631 kw : dict +632 A dictionary of classes. +633 +634 Returns +635 ------- +636 object +637 A class object. +638 """ +639 obj = self.sql_db.session.query(SomeClass).filter_by(**kw).first() +640 if not obj: +641 obj = SomeClass(**kw) +642 return obj 643 -644 def get_mol_formulas(self, odd_even_tag, classe_tuple, settings): -645 """ Get the molecular formulas -646 -647 Parameters -648 ---------- -649 odd_even_tag : str -650 A string indicating whether to retrieve even or odd hydrogen atoms. -651 classe_tuple : tuple -652 -653 settings : object -654 An object containing user-defined settings. -655 -656 Returns -657 ------- -658 list -659 A list of molecular formula data dictionaries. -660 -661 """ -662 class_str = classe_tuple[0] -663 class_dict = classe_tuple[1] -664 classe_id = classe_tuple[2] -665 -666 results = list() -667 -668 if 'HC' in class_dict: -669 del class_dict['HC'] -670 -671 class_dbe = self.calc_dbe_class(class_dict) -672 class_mass = self.calc_mz(class_dict) -673 -674 carbonHydrogen_mass = self.odd_ch_mass if odd_even_tag == 'odd' else self.even_ch_mass -675 carbonHydrogen_dbe = self.odd_ch_dbe if odd_even_tag == 'odd' else self.even_ch_dbe -676 carbonHydrogen_id = self.odd_ch_id if odd_even_tag == 'odd' else self.even_ch_id -677 -678 for index, carbonHydrogen_obj in enumerate(carbonHydrogen_id): -679 -680 mass = carbonHydrogen_mass[index] + class_mass -681 dbe = carbonHydrogen_dbe[index] + class_dbe -682 -683 if settings.min_mz <= mass <= settings.max_mz: -684 -685 if settings.min_dbe <= dbe <= settings.max_dbe: -686 -687 molecularFormula= {"heteroAtoms_id":classe_id, -688 "carbonHydrogen_id":carbonHydrogen_id[index], -689 "mass":mass, "DBE":dbe} -690 -691 results.append(molecularFormula) -692 -693 return results -694 +644 +645 def get_mol_formulas(self, odd_even_tag, classe_tuple, settings): +646 """ Get the molecular formulas +647 +648 Parameters +649 ---------- +650 odd_even_tag : str +651 A string indicating whether to retrieve even or odd hydrogen atoms. +652 classe_tuple : tuple +653 +654 settings : object +655 An object containing user-defined settings. +656 +657 Returns +658 ------- +659 list +660 A list of molecular formula data dictionaries. +661 +662 """ +663 class_str = classe_tuple[0] +664 class_dict = classe_tuple[1] +665 classe_id = classe_tuple[2] +666 +667 results = list() +668 +669 if 'HC' in class_dict: +670 del class_dict['HC'] +671 +672 class_dbe = self.calc_dbe_class(class_dict) +673 class_mass = self.calc_mz(class_dict) +674 +675 carbonHydrogen_mass = self.odd_ch_mass if odd_even_tag == 'odd' else self.even_ch_mass +676 carbonHydrogen_dbe = self.odd_ch_dbe if odd_even_tag == 'odd' else self.even_ch_dbe +677 carbonHydrogen_id = self.odd_ch_id if odd_even_tag == 'odd' else self.even_ch_id +678 +679 for index, carbonHydrogen_obj in enumerate(carbonHydrogen_id): +680 +681 mass = carbonHydrogen_mass[index] + class_mass +682 dbe = carbonHydrogen_dbe[index] + class_dbe +683 +684 if settings.min_mz <= mass <= settings.max_mz: +685 +686 if settings.min_dbe <= dbe <= settings.max_dbe: +687 +688 molecularFormula= {"heteroAtoms_id":classe_id, +689 "carbonHydrogen_id":carbonHydrogen_id[index], +690 "mass":mass, "DBE":dbe} +691 +692 results.append(molecularFormula) +693 +694 return results 695 -696 def get_h_odd_or_even(self, class_dict): -697 """ Get the hydrogen odd or even -698 -699 Parameters -700 ---------- -701 class_dict : dict -702 A dictionary of classes. -703 -704 Returns -705 ------- -706 str -707 A string indicating whether to retrieve even or odd hydrogen atoms. -708 """ -709 -710 HAS_NITROGEN = 'N' in class_dict.keys() -711 HAS_PHOSPHORUS = 'P' in class_dict.keys() +696 +697 def get_h_odd_or_even(self, class_dict): +698 """ Get the hydrogen odd or even +699 +700 Parameters +701 ---------- +702 class_dict : dict +703 A dictionary of classes. +704 +705 Returns +706 ------- +707 str +708 A string indicating whether to retrieve even or odd hydrogen atoms. +709 """ +710 +711 HAS_NITROGEN = 'N' in class_dict.keys() 712 713 number_of_halogen = self.get_total_halogen_atoms(class_dict) -714 -715 if number_of_halogen > 0: -716 -717 TEM_HALOGEN = True -718 -719 else: -720 -721 TEM_HALOGEN = False -722 -723 if TEM_HALOGEN: -724 -725 remaining_halogen = number_of_halogen % 2 -726 -727 else: -728 -729 remaining_halogen = 0 -730 -731 if HAS_NITROGEN and HAS_PHOSPHORUS: +714 number_of_hetero = self.get_total_heteroatoms(class_dict) +715 +716 if number_of_halogen > 0: +717 +718 HAS_HALOGEN = True +719 +720 else: +721 +722 HAS_HALOGEN = False +723 +724 if HAS_HALOGEN: +725 +726 remaining_halogen = number_of_halogen % 2 +727 +728 else: +729 +730 remaining_halogen = 0 +731 732 -733 number_of_n = class_dict.get('N') + class_dict.get('P') -734 remaining_n = number_of_n % 2 -735 -736 elif HAS_NITROGEN and not HAS_PHOSPHORUS: -737 -738 number_of_n = class_dict.get('N') -739 remaining_n = number_of_n % 2 +733 if number_of_hetero > 0: +734 +735 HAS_OTHER_HETERO = True +736 +737 total_hetero_valence = self.get_total_hetero_valence(class_dict) +738 +739 else: 740 -741 elif HAS_PHOSPHORUS and not HAS_NITROGEN: +741 HAS_OTHER_HETERO = False 742 -743 number_of_n = class_dict.get('P') -744 remaining_n = number_of_n % 2 -745 -746 else: -747 -748 remaining_n = -1 -749 -750 if remaining_n > 0.0: -751 if HAS_NITROGEN or HAS_PHOSPHORUS: +743 total_hetero_valence = 0 +744 +745 if HAS_OTHER_HETERO: +746 +747 remaining_hetero_valence = total_hetero_valence % 2 +748 +749 else: +750 +751 remaining_hetero_valence = 0 752 -753 if TEM_HALOGEN: -754 if remaining_halogen == 0: -755 return 'odd' -756 else: -757 return 'even' -758 else: -759 return 'odd' +753 +754 if HAS_NITROGEN and not HAS_OTHER_HETERO: +755 +756 number_of_n = class_dict.get('N') +757 remaining_n = number_of_n % 2 +758 +759 elif HAS_NITROGEN and HAS_OTHER_HETERO: 760 -761 elif remaining_n == 0.0: -762 -763 if HAS_NITROGEN or HAS_PHOSPHORUS: -764 -765 if TEM_HALOGEN: -766 if remaining_halogen == 0: -767 return 'even' -768 else: -769 return 'odd' -770 else: -771 return 'even' -772 -773 else: -774 -775 if TEM_HALOGEN: -776 if remaining_halogen == 0: -777 return 'even' -778 else: -779 return 'odd' -780 else: -781 return 'even' -782 -783 @staticmethod -784 def get_total_halogen_atoms(class_dict): -785 """ Get the total number of halogen atoms -786 -787 Parameters -788 ---------- -789 class_dict : dict -790 A dictionary of classes. -791 -792 Returns -793 ------- -794 int -795 The total number of halogen atoms. -796 """ -797 atoms = ['F', 'Cl', 'Br', 'I'] -798 -799 total_number = 0 -800 -801 for atom in atoms: -802 -803 if atom in class_dict.keys(): -804 -805 total_number = total_number + class_dict.get(atom) -806 -807 return total_number +761 number_of_n = class_dict.get('N') +762 remaining_n = (number_of_n + remaining_hetero_valence )% 2 +763 +764 elif HAS_OTHER_HETERO and not HAS_NITROGEN: +765 +766 remaining_n = remaining_hetero_valence +767 +768 else: +769 +770 remaining_n = -1 +771 +772 if remaining_n > 0.0: +773 +774 if HAS_NITROGEN or HAS_OTHER_HETERO: +775 +776 if HAS_HALOGEN: +777 if remaining_halogen == 0: +778 return 'odd' +779 else: +780 return 'even' +781 +782 else: +783 return 'odd' +784 +785 elif remaining_n == 0.0: +786 +787 if HAS_NITROGEN or HAS_OTHER_HETERO: +788 +789 if HAS_HALOGEN: +790 if remaining_halogen == 0: +791 return 'even' +792 else: +793 return 'odd' +794 +795 else: +796 return 'even' +797 +798 else: +799 +800 if HAS_HALOGEN: +801 if remaining_halogen == 0: +802 return 'even' +803 else: +804 return 'odd' +805 +806 else: +807 return 'even' +808 +809 +810 +811 @staticmethod +812 def get_total_heteroatoms(class_dict): +813 """ Get the total number of heteroatoms other than N, F, Cl, Br +814 +815 Parameters +816 ---------- +817 class_dict : dict +818 A dictionary of classes. +819 +820 Returns +821 ------- +822 int +823 The total number of heteroatoms. +824 """ +825 +826 total_number = 0 +827 +828 for atom in class_dict.keys(): +829 +830 if atom not in ['HC','C','H','O','N', 'F', 'Cl', 'Br']: +831 total_number = total_number + class_dict.get(atom) +832 +833 return total_number +834 +835 @staticmethod +836 def get_total_hetero_valence(class_dict): +837 """ Get the total valence of heteroatoms other than N, F, Cl, Br +838 +839 Parameters +840 ---------- +841 class_dict : dict +842 A dictionary of classes. +843 +844 Returns +845 ------- +846 int +847 The total heteroatom valence. +848 """ +849 total_valence = 0 +850 +851 for atom in class_dict.keys(): +852 +853 if atom not in ['HC','C','H','O','N', 'F', 'Cl', 'Br']: +854 +855 clean_atom = ''.join([i for i in atom if not i.isdigit()]) +856 +857 atom_valence = MSParameters.molecular_search.used_atom_valences.get(clean_atom) +858 +859 if type(atom_valence) is tuple: +860 atom_valence = atom_valence[0] +861 +862 n_atom =int(class_dict.get(atom)) +863 +864 n_atom_valence = atom_valence * n_atom +865 +866 total_valence = total_valence + n_atom_valence +867 +868 return total_valence +869 +870 @staticmethod +871 def get_total_halogen_atoms(class_dict): +872 """ Get the total number of halogen atoms +873 +874 Parameters +875 ---------- +876 class_dict : dict +877 A dictionary of classes. +878 +879 Returns +880 ------- +881 int +882 The total number of halogen atoms. +883 """ +884 atoms = ['F', 'Cl', 'Br'] +885 +886 total_number = 0 +887 +888 for atom in atoms: +889 +890 if atom in class_dict.keys(): +891 +892 total_number = total_number + class_dict.get(atom) +893 +894 return total_number

    @@ -1069,686 +1162,773 @@

    126 Gets the hydrogen odd or even. 127 * get_total_halogen_atoms(class_dict) 128 Gets the total number of halogen atoms. -129 -130 """ -131 -132 def __init__(self, sql_db = None): -133 -134 if not sql_db: -135 -136 self.sql_db = MolForm_SQL() -137 else: -138 -139 self.sql_db = sql_db -140 -141 def cProfile_worker(self, args): -142 """ cProfile worker for the get_mol_formulas function""" -143 cProfile.runctx('self.get_mol_formulas(*args)', globals(), locals(), 'mf_database_cprofile.prof') -144 -145 def check_database_get_class_list(self, molecular_search_settings): -146 """ check if the database has all the classes, if not create the missing classes -147 -148 Parameters -149 ---------- -150 molecular_search_settings : object -151 An object containing user-defined settings. -152 -153 Returns -154 ------- -155 list -156 list of tuples with the class name and the class dictionary -157 """ -158 all_class_to_create = [] -159 -160 classes_dict = self.get_classes_in_order(molecular_search_settings) -161 -162 class_str_set = set(classes_dict.keys()) -163 -164 existing_classes_objs = self.sql_db.session.query(HeteroAtoms).distinct().all() -165 -166 existing_classes_str = set([classe.name for classe in existing_classes_objs]) -167 -168 self.len_existing_classes = len(existing_classes_str) -169 -170 class_to_create = class_str_set - existing_classes_str -171 -172 class_count= len(existing_classes_objs) -173 -174 data_classes = list() -175 for index, class_str in enumerate(class_to_create): -176 -177 class_dict = classes_dict.get(class_str) -178 halogen_count = self.get_total_halogen_atoms(class_dict) -179 data_classes.append({"name":class_str, "id":class_count+ index + 1, "halogensCount": halogen_count}) -180 -181 #data_classes = [{"name":class_str, "id":class_count+ index + 1} for index, class_str in enumerate(class_to_create)] -182 -183 if data_classes: -184 -185 list_insert_chunks = chunks(data_classes, self.sql_db.chunks_count) -186 for insert_chunk in list_insert_chunks: -187 insert_query = HeteroAtoms.__table__.insert().values(insert_chunk) -188 self.sql_db.session.execute(insert_query) -189 -190 for index, class_str in enumerate(class_to_create): -191 -192 class_tuple = (class_str, classes_dict.get(class_str), class_count+ index + 1) -193 -194 all_class_to_create.append(class_tuple) -195 -196 return [(c_s, c_d) for c_s, c_d in classes_dict.items()], all_class_to_create, existing_classes_objs -197 -198 def get_carbonsHydrogens(self, settings, odd_even): -199 """ Retrieve carbon and hydrogen atoms from the molecular lookup table based on user-defined settings. -200 -201 Parameters -202 ---------- -203 settings : object -204 An object containing user-defined settings. -205 odd_even : str -206 A string indicating whether to retrieve even or odd hydrogen atoms. -207 -208 Returns -209 ------- -210 list -211 A list of CarbonHydrogen objects that satisfy the specified conditions. -212 """ -213 operator = '==' if odd_even == 'even' else '!=' -214 usedAtoms = settings.usedAtoms -215 user_min_c, user_max_c = usedAtoms.get('C') -216 user_min_h, user_max_h = usedAtoms.get('H') -217 -218 return eval("self.sql_db.session.query(CarbonHydrogen).filter(" -219 "CarbonHydrogen.C >= user_min_c," -220 "CarbonHydrogen.H >= user_min_h," -221 "CarbonHydrogen.C <= user_max_c," -222 "CarbonHydrogen.H <= user_max_h," -223 "CarbonHydrogen.H % 2" + operator+ "0).all()") -224 -225 def add_carbonsHydrogens(self, settings, existing_classes_objs): -226 """ Add carbon and hydrogen atoms to the molecular lookup table based on user-defined settings. -227 -228 Parameters -229 ---------- -230 settings : object -231 An object containing user-defined settings. -232 existing_classes_objs : list -233 A list of HeteroAtoms objects. -234 """ -235 usedAtoms = settings.usedAtoms -236 -237 user_min_c, user_max_c = usedAtoms.get('C') -238 user_min_h, user_max_h = usedAtoms.get('H') -239 -240 query_obj = self.sql_db.session.query(func.max(CarbonHydrogen.C).label("max_c"), -241 func.min(CarbonHydrogen.C).label("min_c"), -242 func.max(CarbonHydrogen.H).label("max_h"), -243 func.min(CarbonHydrogen.H).label("min_h"), -244 ) -245 +129 * get_total_hetero_valence(class_dict) +130 Gets the total valence of heteroatoms other than N, F, Cl, and Br +131 """ +132 +133 def __init__(self, sql_db = None): +134 +135 if not sql_db: +136 +137 self.sql_db = MolForm_SQL() +138 else: +139 +140 self.sql_db = sql_db +141 +142 def cProfile_worker(self, args): +143 """ cProfile worker for the get_mol_formulas function""" +144 cProfile.runctx('self.get_mol_formulas(*args)', globals(), locals(), 'mf_database_cprofile.prof') +145 +146 def check_database_get_class_list(self, molecular_search_settings): +147 """ check if the database has all the classes, if not create the missing classes +148 +149 Parameters +150 ---------- +151 molecular_search_settings : object +152 An object containing user-defined settings. +153 +154 Returns +155 ------- +156 list +157 list of tuples with the class name and the class dictionary +158 """ +159 all_class_to_create = [] +160 +161 classes_dict = self.get_classes_in_order(molecular_search_settings) +162 +163 class_str_set = set(classes_dict.keys()) +164 +165 existing_classes_objs = self.sql_db.session.query(HeteroAtoms).distinct().all() +166 +167 existing_classes_str = set([classe.name for classe in existing_classes_objs]) +168 +169 self.len_existing_classes = len(existing_classes_str) +170 +171 class_to_create = class_str_set - existing_classes_str +172 +173 class_count= len(existing_classes_objs) +174 +175 data_classes = list() +176 for index, class_str in enumerate(class_to_create): +177 +178 class_dict = classes_dict.get(class_str) +179 halogen_count = self.get_total_halogen_atoms(class_dict) +180 data_classes.append({"name":class_str, "id":class_count+ index + 1, "halogensCount": halogen_count}) +181 +182 #data_classes = [{"name":class_str, "id":class_count+ index + 1} for index, class_str in enumerate(class_to_create)] +183 +184 if data_classes: +185 +186 list_insert_chunks = chunks(data_classes, self.sql_db.chunks_count) +187 for insert_chunk in list_insert_chunks: +188 insert_query = HeteroAtoms.__table__.insert().values(insert_chunk) +189 self.sql_db.session.execute(insert_query) +190 +191 for index, class_str in enumerate(class_to_create): +192 +193 class_tuple = (class_str, classes_dict.get(class_str), class_count+ index + 1) +194 +195 all_class_to_create.append(class_tuple) +196 +197 return [(c_s, c_d) for c_s, c_d in classes_dict.items()], all_class_to_create, existing_classes_objs +198 +199 def get_carbonsHydrogens(self, settings, odd_even): +200 """ Retrieve carbon and hydrogen atoms from the molecular lookup table based on user-defined settings. +201 +202 Parameters +203 ---------- +204 settings : object +205 An object containing user-defined settings. +206 odd_even : str +207 A string indicating whether to retrieve even or odd hydrogen atoms. +208 +209 Returns +210 ------- +211 list +212 A list of CarbonHydrogen objects that satisfy the specified conditions. +213 """ +214 operator = '==' if odd_even == 'even' else '!=' +215 usedAtoms = settings.usedAtoms +216 user_min_c, user_max_c = usedAtoms.get('C') +217 user_min_h, user_max_h = usedAtoms.get('H') +218 +219 return eval("self.sql_db.session.query(CarbonHydrogen).filter(" +220 "CarbonHydrogen.C >= user_min_c," +221 "CarbonHydrogen.H >= user_min_h," +222 "CarbonHydrogen.C <= user_max_c," +223 "CarbonHydrogen.H <= user_max_h," +224 "CarbonHydrogen.H % 2" + operator+ "0).all()") +225 +226 def add_carbonsHydrogens(self, settings, existing_classes_objs): +227 """ Add carbon and hydrogen atoms to the molecular lookup table based on user-defined settings. +228 +229 Parameters +230 ---------- +231 settings : object +232 An object containing user-defined settings. +233 existing_classes_objs : list +234 A list of HeteroAtoms objects. +235 """ +236 usedAtoms = settings.usedAtoms +237 +238 user_min_c, user_max_c = usedAtoms.get('C') +239 user_min_h, user_max_h = usedAtoms.get('H') +240 +241 query_obj = self.sql_db.session.query(func.max(CarbonHydrogen.C).label("max_c"), +242 func.min(CarbonHydrogen.C).label("min_c"), +243 func.max(CarbonHydrogen.H).label("max_h"), +244 func.min(CarbonHydrogen.H).label("min_h"), +245 ) 246 -247 database = query_obj.first() -248 if database.max_c == user_max_c and database.min_c == user_min_c and database.max_h == user_max_h and database.min_h == user_min_h: -249 #all data is already available at the database -250 pass -251 -252 else: -253 -254 current_count = self.sql_db.session.query(CarbonHydrogen.C).count() -255 -256 databaseCarbonHydrogen = self.sql_db.session.query(CarbonHydrogen).all() -257 -258 userCarbon = set(range(user_min_c, user_max_c + 1)) -259 userHydrogen = set(range(user_min_h, user_max_h + 1)) -260 -261 carbon_hydrogen_objs_database = {} -262 for obj in databaseCarbonHydrogen: -263 -264 str_data = "C:{},H:{}".format(obj.C, obj.H) -265 carbon_hydrogen_objs_database[str_data] = str_data -266 -267 carbon_hydrogen_objs_to_create = {'even': {}, 'odd': {}} -268 -269 list_ch_obj_to_add = list() -270 i = 0 -271 for comb in itertools.product(userCarbon, userHydrogen): -272 -273 C = comb[0] -274 H = comb[1] -275 data = {"C":C, -276 "H":H, -277 } -278 -279 data_insert = {"C":C, -280 "H":H, -281 } -282 -283 str_data = "C:{},H:{}".format(C,H) -284 -285 if not str_data in carbon_hydrogen_objs_database.keys(): -286 -287 label = 'even' if comb[1]%2 == 0 else 'odd' -288 data["mass"] = (C * Atoms.atomic_masses.get('C')) + (H * Atoms.atomic_masses.get('H')) -289 data["dbe"] = C - (H/2) + 1 -290 data["id"] = i + current_count + 1 -291 data_insert["id"] = i + current_count + 1 -292 i = i + 1 -293 carbon_hydrogen_objs_to_create[label][str_data] = data -294 -295 list_ch_obj_to_add.append(data_insert) -296 -297 if list_ch_obj_to_add: -298 # insert carbon hydrogen objs -299 list_insert_chunks = chunks(list_ch_obj_to_add, self.sql_db.chunks_count) -300 for insert_chunk in list_insert_chunks: -301 insert_query = CarbonHydrogen.__table__.insert().values(insert_chunk) -302 self.sql_db.session.execute(insert_query) -303 self.sql_db.session.commit() -304 -305 -306 list_molecular_form= list() -307 for classe_obj in existing_classes_objs: -308 -309 classe_dict = classe_obj.to_dict() -310 classe_mass = self.calc_mz(classe_dict) -311 classe_dbe = self.calc_dbe_class(classe_dict) -312 -313 odd_even_label = self.get_h_odd_or_even(classe_dict) -314 -315 ch_datalist = carbon_hydrogen_objs_to_create.get(odd_even_label).values() -316 -317 for ch_dict in ch_datalist: -318 mass = ch_dict.get('mass') + classe_mass -319 dbe = ch_dict.get('dbe') + classe_dbe -320 -321 if settings.min_mz <= mass <= settings.max_mz: -322 -323 if settings.min_dbe <= dbe <= settings.max_dbe: -324 -325 list_molecular_form.append( {"heteroAtoms_id":classe_obj.id, -326 "carbonHydrogen_id":ch_dict.get('id'), -327 "mass":mass, "DBE":dbe}) -328 -329 list_insert_chunks = chunks(list_molecular_form, self.sql_db.chunks_count) -330 for insert_chunk in list_insert_chunks: -331 insert_query = MolecularFormulaLink.__table__.insert().values(insert_chunk) -332 self.sql_db.session.execute(insert_query) -333 self.sql_db.session.commit() -334 -335 -336 @timeit -337 def runworker(self, molecular_search_settings): -338 """ Run the molecular formula lookup table worker. -339 -340 Parameters -341 ---------- -342 molecular_search_settings : object -343 An object containing user-defined settings. -344 -345 Returns -346 ------- -347 list -348 A list of tuples with the class name and the class dictionary. -349 -350 -351 """ -352 -353 classes_list, class_to_create, existing_classes_objs = self.check_database_get_class_list(molecular_search_settings) -354 -355 settings = MolecularLookupDictSettings() -356 settings.usedAtoms = deepcopy(molecular_search_settings.usedAtoms) -357 settings.url_database = molecular_search_settings.url_database -358 settings.db_jobs = molecular_search_settings.db_jobs -359 -360 self.add_carbonsHydrogens(settings, existing_classes_objs) -361 -362 if class_to_create: -363 -364 settings = MolecularLookupDictSettings() -365 settings.usedAtoms = deepcopy(molecular_search_settings.usedAtoms) -366 settings.url_database = molecular_search_settings.url_database -367 settings.db_jobs = molecular_search_settings.db_jobs -368 -369 self.sql_db.session.commit() -370 odd_ch_obj = self.get_carbonsHydrogens(settings,'odd') -371 self.odd_ch_id = [obj.id for obj in odd_ch_obj] -372 self.odd_ch_dict = [{'C':obj.C, 'H':obj.H} for obj in odd_ch_obj] -373 self.odd_ch_mass = [obj.mass for obj in odd_ch_obj] -374 self.odd_ch_dbe = [obj.dbe for obj in odd_ch_obj] -375 -376 even_ch_obj = self.get_carbonsHydrogens(settings, 'even') -377 self.even_ch_id = [obj.id for obj in even_ch_obj] -378 self.even_ch_dict = [{'C':obj.C, 'H':obj.H} for obj in even_ch_obj] -379 self.even_ch_mass = [obj.mass for obj in even_ch_obj] -380 self.even_ch_dbe = [obj.dbe for obj in even_ch_obj] -381 -382 all_results= list() -383 for class_tuple in tqdm(class_to_create): -384 -385 results = self.populate_combinations(class_tuple, settings) -386 all_results.extend(results) -387 if settings.db_jobs == 1: -388 #if len(all_results) >= self.sql_db.chunks_count: -389 list_insert_chunks = list(chunks(results, self.sql_db.chunks_count)) -390 for chunk in list_insert_chunks: -391 insert_query = MolecularFormulaLink.__table__.insert().values(chunk) -392 self.sql_db.session.execute(insert_query) -393 #all_results = list() -394 self.sql_db.session.commit() -395 # each chunk takes ~600Mb of memory, so if using 8 processes the total free memory needs to be 5GB -396 if settings.db_jobs > 1: -397 list_insert_chunks = list(chunks(all_results, self.sql_db.chunks_count)) -398 print( "Started database insert using {} iterations for a total of {} rows".format(len(list_insert_chunks), len(all_results))) -399 worker_args = [(chunk, settings.url_database) for chunk in list_insert_chunks] -400 p = multiprocessing.Pool(settings.db_jobs) -401 for class_list in tqdm(p.imap_unordered(insert_database_worker, worker_args)): -402 pass -403 p.close() -404 p.join() -405 -406 return classes_list -407 -408 def get_classes_in_order(self, molecular_search_settings): -409 """ Get the classes in order -410 -411 Parameters -412 ---------- -413 molecular_search_settings : object -414 An object containing user-defined settings. -415 -416 Returns -417 ------- -418 dict -419 A dictionary of classes in order. -420 structure is ('HC', {'HC': 1}) -421 """ -422 -423 usedAtoms = deepcopy(molecular_search_settings.usedAtoms) -424 -425 usedAtoms.pop("C") -426 usedAtoms.pop("H") -427 -428 min_n, max_n = usedAtoms.get('N') if usedAtoms.get('N') else (0,0) -429 min_o, max_o = usedAtoms.get('O') if usedAtoms.get('O') else (0,0) -430 min_s, max_s = usedAtoms.get('S') if usedAtoms.get('S') else (0,0) -431 min_p, max_p = usedAtoms.get('P') if usedAtoms.get('P') else (0,0) -432 -433 possible_n = [n for n in range(min_n, max_n + 1)] -434 possible_o = [o for o in range(min_o, max_o + 1)] -435 possible_s = [s for s in range(min_s, max_s + 1)] -436 possible_p = [p for p in range(min_p, max_p + 1)] -437 -438 atoms_in_order = ['N', 'O', 'S', 'P'] -439 -440 classe_in_order = {} -441 -442 all_atoms_tuples = itertools.product(possible_n, possible_o, -443 possible_s, possible_p) -444 -445 for atom in atoms_in_order: -446 usedAtoms.pop(atom, None) -447 -448 for selected_atom, min_max_tuple in usedAtoms.items(): -449 -450 min_x = min_max_tuple[0] -451 max_x = min_max_tuple[1] -452 -453 -454 possible_x = [x for x in range(min_x, max_x + 1)] -455 -456 all_atoms_tuples = itertools.product(all_atoms_tuples, possible_x) -457 all_atoms_tuples = [all_atoms_combined[0] + (all_atoms_combined[1],) for all_atoms_combined in -458 all_atoms_tuples] -459 atoms_in_order.append(selected_atom) -460 -461 for all_atoms_tuple in all_atoms_tuples: -462 -463 classe_str = '' -464 classe_dict = {} -465 -466 for each_atoms_index, atom_number in enumerate(all_atoms_tuple): -467 -468 if atom_number != 0: -469 classe_dict[atoms_in_order[each_atoms_index]] = atom_number -470 -471 if not classe_dict: -472 classe_in_order['HC'] = {"HC": ""} -473 continue -474 -475 classe_str =json.dumps(classe_dict) -476 -477 if len(classe_str) > 0: -478 -479 classe_in_order[classe_str] = classe_dict -480 -481 classe_in_order_dict = self.sort_classes(atoms_in_order, classe_in_order) -482 -483 return classe_in_order_dict -484 -485 @staticmethod -486 def sort_classes( atoms_in_order, combination_dict) -> Dict[str, Dict[str, int]]: -487 """ Sort the classes in order -488 -489 Parameters -490 ---------- -491 atoms_in_order : list -492 A list of atoms in order. -493 combination_dict : dict -494 A dictionary of classes. -495 -496 Returns -497 ------- -498 dict -499 A dictionary of classes in order. -500 """ -501 #ensures atoms are always in the order defined at atoms_in_order list -502 join_dict_classes = dict() -503 atoms_in_order = ['N','S','P','O'] + atoms_in_order[4:] + ['HC'] -504 -505 sort_method = lambda atoms_keys: [atoms_in_order.index(atoms_keys)] -506 for class_str, class_dict in combination_dict.items(): -507 -508 sorted_dict_keys = sorted(class_dict, key = sort_method) -509 class_dict = { atom: class_dict[atom] for atom in sorted_dict_keys} -510 class_str = json.dumps(class_dict) -511 # using json for the new database, class -512 # class_str = ' '.join([atom + str(class_dict[atom]) for atom in sorted_dict_keys]) -513 join_dict_classes[class_str] = class_dict -514 -515 return join_dict_classes -516 -517 @staticmethod -518 def get_fixed_initial_number_of_hydrogen( min_h, odd_even): -519 """ Get the fixed initial number of hydrogen atoms -520 -521 Parameters -522 ---------- -523 min_h : int -524 The minimum number of hydrogen atoms. -525 odd_even : str -526 A string indicating whether to retrieve even or odd hydrogen atoms. -527 """ -528 remaining_h = min_h % 2 -529 -530 if odd_even == 'even': -531 -532 if remaining_h == 0: return remaining_h -533 -534 else: return remaining_h + 1 -535 -536 else: -537 -538 if remaining_h == 0: return remaining_h + 1 -539 -540 else: return remaining_h -541 -542 def calc_mz(self, datadict, class_mass=0): -543 """ Calculate the mass-to-charge ratio (m/z) of a molecular formula. -544 -545 Parameters -546 ---------- -547 datadict : dict -548 A dictionary of classes. -549 class_mass : int -550 The mass of the class. -551 -552 Returns -553 ------- -554 float -555 The mass-to-charge ratio (m/z) of a molecular formula. -556 """ -557 mass = class_mass -558 -559 for atom in datadict.keys(): -560 -561 if atom != 'HC': -562 -563 mass = mass + Atoms.atomic_masses[atom] * datadict.get(atom) -564 -565 return mass -566 -567 def calc_dbe_class(self, datadict): -568 """ Calculate the double bond equivalent (DBE) of a molecular formula. -569 -570 Parameters -571 ---------- -572 datadict : dict -573 A dictionary of classes. -574 -575 Returns -576 ------- -577 float -578 The double bond equivalent (DBE) of a molecular formula. -579 """ -580 init_dbe = 0 -581 for atom in datadict.keys(): -582 -583 if atom == 'HC': -584 continue -585 -586 n_atom = int(datadict.get(atom)) -587 -588 clean_atom = ''.join([i for i in atom if not i.isdigit()]) -589 -590 valencia = MSParameters.molecular_search.used_atom_valences.get(clean_atom) -591 -592 if type(valencia) is tuple: -593 valencia = valencia[0] -594 if valencia > 0: -595 #print atom, valencia, n_atom, init_dbe -596 init_dbe = init_dbe + (n_atom * (valencia - 2)) -597 else: -598 continue -599 -600 return (0.5 * init_dbe) -601 -602 def populate_combinations(self, classe_tuple, settings): -603 """ Populate the combinations -604 -605 Parameters -606 ---------- -607 classe_tuple : tuple -608 A tuple containing the class name, the class dictionary, and the class ID. -609 settings : object -610 An object containing user-defined settings. -611 -612 Returns -613 ------- -614 list -615 A list of molecular formula data dictionaries. -616 """ -617 ion_charge = 0 -618 -619 class_dict = classe_tuple[1] -620 odd_or_even = self.get_h_odd_or_even(class_dict) -621 -622 return self.get_mol_formulas(odd_or_even, classe_tuple, settings) -623 -624 def get_or_add(self, SomeClass, kw): -625 """ Get or add a class -626 -627 Parameters -628 ---------- -629 SomeClass : object -630 A class object. -631 kw : dict -632 A dictionary of classes. -633 -634 Returns -635 ------- -636 object -637 A class object. -638 """ -639 obj = self.sql_db.session.query(SomeClass).filter_by(**kw).first() -640 if not obj: -641 obj = SomeClass(**kw) -642 return obj -643 +247 +248 database = query_obj.first() +249 if database.max_c == user_max_c and database.min_c == user_min_c and database.max_h == user_max_h and database.min_h == user_min_h: +250 #all data is already available at the database +251 pass +252 +253 else: +254 +255 current_count = self.sql_db.session.query(CarbonHydrogen.C).count() +256 +257 databaseCarbonHydrogen = self.sql_db.session.query(CarbonHydrogen).all() +258 +259 userCarbon = set(range(user_min_c, user_max_c + 1)) +260 userHydrogen = set(range(user_min_h, user_max_h + 1)) +261 +262 carbon_hydrogen_objs_database = {} +263 for obj in databaseCarbonHydrogen: +264 +265 str_data = "C:{},H:{}".format(obj.C, obj.H) +266 carbon_hydrogen_objs_database[str_data] = str_data +267 +268 carbon_hydrogen_objs_to_create = {'even': {}, 'odd': {}} +269 +270 list_ch_obj_to_add = list() +271 i = 0 +272 for comb in itertools.product(userCarbon, userHydrogen): +273 +274 C = comb[0] +275 H = comb[1] +276 data = {"C":C, +277 "H":H, +278 } +279 +280 data_insert = {"C":C, +281 "H":H, +282 } +283 +284 str_data = "C:{},H:{}".format(C,H) +285 +286 if not str_data in carbon_hydrogen_objs_database.keys(): +287 +288 label = 'even' if comb[1]%2 == 0 else 'odd' +289 data["mass"] = (C * Atoms.atomic_masses.get('C')) + (H * Atoms.atomic_masses.get('H')) +290 data["dbe"] = C - (H/2) + 1 +291 data["id"] = i + current_count + 1 +292 data_insert["id"] = i + current_count + 1 +293 i = i + 1 +294 carbon_hydrogen_objs_to_create[label][str_data] = data +295 +296 list_ch_obj_to_add.append(data_insert) +297 +298 if list_ch_obj_to_add: +299 # insert carbon hydrogen objs +300 list_insert_chunks = chunks(list_ch_obj_to_add, self.sql_db.chunks_count) +301 for insert_chunk in list_insert_chunks: +302 insert_query = CarbonHydrogen.__table__.insert().values(insert_chunk) +303 self.sql_db.session.execute(insert_query) +304 self.sql_db.session.commit() +305 +306 +307 list_molecular_form= list() +308 for classe_obj in existing_classes_objs: +309 +310 classe_dict = classe_obj.to_dict() +311 classe_mass = self.calc_mz(classe_dict) +312 classe_dbe = self.calc_dbe_class(classe_dict) +313 +314 odd_even_label = self.get_h_odd_or_even(classe_dict) +315 +316 ch_datalist = carbon_hydrogen_objs_to_create.get(odd_even_label).values() +317 +318 for ch_dict in ch_datalist: +319 mass = ch_dict.get('mass') + classe_mass +320 dbe = ch_dict.get('dbe') + classe_dbe +321 +322 if settings.min_mz <= mass <= settings.max_mz: +323 +324 if settings.min_dbe <= dbe <= settings.max_dbe: +325 +326 list_molecular_form.append( {"heteroAtoms_id":classe_obj.id, +327 "carbonHydrogen_id":ch_dict.get('id'), +328 "mass":mass, "DBE":dbe}) +329 +330 list_insert_chunks = chunks(list_molecular_form, self.sql_db.chunks_count) +331 for insert_chunk in list_insert_chunks: +332 insert_query = MolecularFormulaLink.__table__.insert().values(insert_chunk) +333 self.sql_db.session.execute(insert_query) +334 self.sql_db.session.commit() +335 +336 +337 @timeit +338 def runworker(self, molecular_search_settings): +339 """ Run the molecular formula lookup table worker. +340 +341 Parameters +342 ---------- +343 molecular_search_settings : object +344 An object containing user-defined settings. +345 +346 Returns +347 ------- +348 list +349 A list of tuples with the class name and the class dictionary. +350 +351 +352 """ +353 +354 classes_list, class_to_create, existing_classes_objs = self.check_database_get_class_list(molecular_search_settings) +355 +356 settings = MolecularLookupDictSettings() +357 settings.usedAtoms = deepcopy(molecular_search_settings.usedAtoms) +358 settings.url_database = molecular_search_settings.url_database +359 settings.db_jobs = molecular_search_settings.db_jobs +360 +361 self.add_carbonsHydrogens(settings, existing_classes_objs) +362 +363 if class_to_create: +364 +365 settings = MolecularLookupDictSettings() +366 settings.usedAtoms = deepcopy(molecular_search_settings.usedAtoms) +367 settings.url_database = molecular_search_settings.url_database +368 settings.db_jobs = molecular_search_settings.db_jobs +369 +370 self.sql_db.session.commit() +371 odd_ch_obj = self.get_carbonsHydrogens(settings,'odd') +372 self.odd_ch_id = [obj.id for obj in odd_ch_obj] +373 self.odd_ch_dict = [{'C':obj.C, 'H':obj.H} for obj in odd_ch_obj] +374 self.odd_ch_mass = [obj.mass for obj in odd_ch_obj] +375 self.odd_ch_dbe = [obj.dbe for obj in odd_ch_obj] +376 +377 even_ch_obj = self.get_carbonsHydrogens(settings, 'even') +378 self.even_ch_id = [obj.id for obj in even_ch_obj] +379 self.even_ch_dict = [{'C':obj.C, 'H':obj.H} for obj in even_ch_obj] +380 self.even_ch_mass = [obj.mass for obj in even_ch_obj] +381 self.even_ch_dbe = [obj.dbe for obj in even_ch_obj] +382 +383 all_results= list() +384 for class_tuple in tqdm(class_to_create): +385 +386 results = self.populate_combinations(class_tuple, settings) +387 all_results.extend(results) +388 if settings.db_jobs == 1: +389 #if len(all_results) >= self.sql_db.chunks_count: +390 list_insert_chunks = list(chunks(results, self.sql_db.chunks_count)) +391 for chunk in list_insert_chunks: +392 insert_query = MolecularFormulaLink.__table__.insert().values(chunk) +393 self.sql_db.session.execute(insert_query) +394 #all_results = list() +395 self.sql_db.session.commit() +396 # each chunk takes ~600Mb of memory, so if using 8 processes the total free memory needs to be 5GB +397 if settings.db_jobs > 1: +398 list_insert_chunks = list(chunks(all_results, self.sql_db.chunks_count)) +399 print( "Started database insert using {} iterations for a total of {} rows".format(len(list_insert_chunks), len(all_results))) +400 worker_args = [(chunk, settings.url_database) for chunk in list_insert_chunks] +401 p = multiprocessing.Pool(settings.db_jobs) +402 for class_list in tqdm(p.imap_unordered(insert_database_worker, worker_args)): +403 pass +404 p.close() +405 p.join() +406 +407 return classes_list +408 +409 def get_classes_in_order(self, molecular_search_settings): +410 """ Get the classes in order +411 +412 Parameters +413 ---------- +414 molecular_search_settings : object +415 An object containing user-defined settings. +416 +417 Returns +418 ------- +419 dict +420 A dictionary of classes in order. +421 structure is ('HC', {'HC': 1}) +422 """ +423 +424 usedAtoms = deepcopy(molecular_search_settings.usedAtoms) +425 +426 usedAtoms.pop("C") +427 usedAtoms.pop("H") +428 +429 min_n, max_n = usedAtoms.get('N') if usedAtoms.get('N') else (0,0) +430 min_o, max_o = usedAtoms.get('O') if usedAtoms.get('O') else (0,0) +431 min_s, max_s = usedAtoms.get('S') if usedAtoms.get('S') else (0,0) +432 min_p, max_p = usedAtoms.get('P') if usedAtoms.get('P') else (0,0) +433 +434 possible_n = [n for n in range(min_n, max_n + 1)] +435 possible_o = [o for o in range(min_o, max_o + 1)] +436 possible_s = [s for s in range(min_s, max_s + 1)] +437 possible_p = [p for p in range(min_p, max_p + 1)] +438 +439 atoms_in_order = ['N', 'O', 'S', 'P'] +440 +441 classe_in_order = {} +442 +443 all_atoms_tuples = itertools.product(possible_n, possible_o, +444 possible_s, possible_p) +445 +446 for atom in atoms_in_order: +447 usedAtoms.pop(atom, None) +448 +449 for selected_atom, min_max_tuple in usedAtoms.items(): +450 +451 min_x = min_max_tuple[0] +452 max_x = min_max_tuple[1] +453 +454 +455 possible_x = [x for x in range(min_x, max_x + 1)] +456 +457 all_atoms_tuples = itertools.product(all_atoms_tuples, possible_x) +458 all_atoms_tuples = [all_atoms_combined[0] + (all_atoms_combined[1],) for all_atoms_combined in +459 all_atoms_tuples] +460 atoms_in_order.append(selected_atom) +461 +462 for all_atoms_tuple in all_atoms_tuples: +463 +464 classe_str = '' +465 classe_dict = {} +466 +467 for each_atoms_index, atom_number in enumerate(all_atoms_tuple): +468 +469 if atom_number != 0: +470 classe_dict[atoms_in_order[each_atoms_index]] = atom_number +471 +472 if not classe_dict: +473 classe_in_order['HC'] = {"HC": ""} +474 continue +475 +476 classe_str =json.dumps(classe_dict) +477 +478 if len(classe_str) > 0: +479 +480 classe_in_order[classe_str] = classe_dict +481 +482 classe_in_order_dict = self.sort_classes(atoms_in_order, classe_in_order) +483 +484 return classe_in_order_dict +485 +486 @staticmethod +487 def sort_classes( atoms_in_order, combination_dict) -> Dict[str, Dict[str, int]]: +488 """ Sort the classes in order +489 +490 Parameters +491 ---------- +492 atoms_in_order : list +493 A list of atoms in order. +494 combination_dict : dict +495 A dictionary of classes. +496 +497 Returns +498 ------- +499 dict +500 A dictionary of classes in order. +501 """ +502 #ensures atoms are always in the order defined at atoms_in_order list +503 join_dict_classes = dict() +504 atoms_in_order = ['N','S','P','O'] + atoms_in_order[4:] + ['HC'] +505 +506 sort_method = lambda atoms_keys: [atoms_in_order.index(atoms_keys)] +507 for class_str, class_dict in combination_dict.items(): +508 +509 sorted_dict_keys = sorted(class_dict, key = sort_method) +510 class_dict = { atom: class_dict[atom] for atom in sorted_dict_keys} +511 class_str = json.dumps(class_dict) +512 # using json for the new database, class +513 # class_str = ' '.join([atom + str(class_dict[atom]) for atom in sorted_dict_keys]) +514 join_dict_classes[class_str] = class_dict +515 +516 return join_dict_classes +517 +518 @staticmethod +519 def get_fixed_initial_number_of_hydrogen( min_h, odd_even): +520 """ Get the fixed initial number of hydrogen atoms +521 +522 Parameters +523 ---------- +524 min_h : int +525 The minimum number of hydrogen atoms. +526 odd_even : str +527 A string indicating whether to retrieve even or odd hydrogen atoms. +528 """ +529 remaining_h = min_h % 2 +530 +531 if odd_even == 'even': +532 +533 if remaining_h == 0: return remaining_h +534 +535 else: return remaining_h + 1 +536 +537 else: +538 +539 if remaining_h == 0: return remaining_h + 1 +540 +541 else: return remaining_h +542 +543 def calc_mz(self, datadict, class_mass=0): +544 """ Calculate the mass-to-charge ratio (m/z) of a molecular formula. +545 +546 Parameters +547 ---------- +548 datadict : dict +549 A dictionary of classes. +550 class_mass : int +551 The mass of the class. +552 +553 Returns +554 ------- +555 float +556 The mass-to-charge ratio (m/z) of a molecular formula. +557 """ +558 mass = class_mass +559 +560 for atom in datadict.keys(): +561 +562 if atom != 'HC': +563 +564 mass = mass + Atoms.atomic_masses[atom] * datadict.get(atom) +565 +566 return mass +567 +568 def calc_dbe_class(self, datadict): +569 """ Calculate the double bond equivalent (DBE) of a molecular formula. +570 +571 Parameters +572 ---------- +573 datadict : dict +574 A dictionary of classes. +575 +576 Returns +577 ------- +578 float +579 The double bond equivalent (DBE) of a molecular formula. +580 """ +581 init_dbe = 0 +582 for atom in datadict.keys(): +583 +584 if atom == 'HC': +585 continue +586 +587 n_atom = int(datadict.get(atom)) +588 +589 clean_atom = ''.join([i for i in atom if not i.isdigit()]) +590 +591 valencia = MSParameters.molecular_search.used_atom_valences.get(clean_atom) +592 +593 if type(valencia) is tuple: +594 valencia = valencia[0] +595 if valencia > 0: +596 #print atom, valencia, n_atom, init_dbe +597 init_dbe = init_dbe + (n_atom * (valencia - 2)) +598 else: +599 continue +600 +601 return (0.5 * init_dbe) +602 +603 def populate_combinations(self, classe_tuple, settings): +604 """ Populate the combinations +605 +606 Parameters +607 ---------- +608 classe_tuple : tuple +609 A tuple containing the class name, the class dictionary, and the class ID. +610 settings : object +611 An object containing user-defined settings. +612 +613 Returns +614 ------- +615 list +616 A list of molecular formula data dictionaries. +617 """ +618 ion_charge = 0 +619 +620 class_dict = classe_tuple[1] +621 odd_or_even = self.get_h_odd_or_even(class_dict) +622 +623 return self.get_mol_formulas(odd_or_even, classe_tuple, settings) +624 +625 def get_or_add(self, SomeClass, kw): +626 """ Get or add a class +627 +628 Parameters +629 ---------- +630 SomeClass : object +631 A class object. +632 kw : dict +633 A dictionary of classes. +634 +635 Returns +636 ------- +637 object +638 A class object. +639 """ +640 obj = self.sql_db.session.query(SomeClass).filter_by(**kw).first() +641 if not obj: +642 obj = SomeClass(**kw) +643 return obj 644 -645 def get_mol_formulas(self, odd_even_tag, classe_tuple, settings): -646 """ Get the molecular formulas -647 -648 Parameters -649 ---------- -650 odd_even_tag : str -651 A string indicating whether to retrieve even or odd hydrogen atoms. -652 classe_tuple : tuple -653 -654 settings : object -655 An object containing user-defined settings. -656 -657 Returns -658 ------- -659 list -660 A list of molecular formula data dictionaries. -661 -662 """ -663 class_str = classe_tuple[0] -664 class_dict = classe_tuple[1] -665 classe_id = classe_tuple[2] -666 -667 results = list() -668 -669 if 'HC' in class_dict: -670 del class_dict['HC'] -671 -672 class_dbe = self.calc_dbe_class(class_dict) -673 class_mass = self.calc_mz(class_dict) -674 -675 carbonHydrogen_mass = self.odd_ch_mass if odd_even_tag == 'odd' else self.even_ch_mass -676 carbonHydrogen_dbe = self.odd_ch_dbe if odd_even_tag == 'odd' else self.even_ch_dbe -677 carbonHydrogen_id = self.odd_ch_id if odd_even_tag == 'odd' else self.even_ch_id -678 -679 for index, carbonHydrogen_obj in enumerate(carbonHydrogen_id): -680 -681 mass = carbonHydrogen_mass[index] + class_mass -682 dbe = carbonHydrogen_dbe[index] + class_dbe -683 -684 if settings.min_mz <= mass <= settings.max_mz: -685 -686 if settings.min_dbe <= dbe <= settings.max_dbe: -687 -688 molecularFormula= {"heteroAtoms_id":classe_id, -689 "carbonHydrogen_id":carbonHydrogen_id[index], -690 "mass":mass, "DBE":dbe} -691 -692 results.append(molecularFormula) -693 -694 return results -695 +645 +646 def get_mol_formulas(self, odd_even_tag, classe_tuple, settings): +647 """ Get the molecular formulas +648 +649 Parameters +650 ---------- +651 odd_even_tag : str +652 A string indicating whether to retrieve even or odd hydrogen atoms. +653 classe_tuple : tuple +654 +655 settings : object +656 An object containing user-defined settings. +657 +658 Returns +659 ------- +660 list +661 A list of molecular formula data dictionaries. +662 +663 """ +664 class_str = classe_tuple[0] +665 class_dict = classe_tuple[1] +666 classe_id = classe_tuple[2] +667 +668 results = list() +669 +670 if 'HC' in class_dict: +671 del class_dict['HC'] +672 +673 class_dbe = self.calc_dbe_class(class_dict) +674 class_mass = self.calc_mz(class_dict) +675 +676 carbonHydrogen_mass = self.odd_ch_mass if odd_even_tag == 'odd' else self.even_ch_mass +677 carbonHydrogen_dbe = self.odd_ch_dbe if odd_even_tag == 'odd' else self.even_ch_dbe +678 carbonHydrogen_id = self.odd_ch_id if odd_even_tag == 'odd' else self.even_ch_id +679 +680 for index, carbonHydrogen_obj in enumerate(carbonHydrogen_id): +681 +682 mass = carbonHydrogen_mass[index] + class_mass +683 dbe = carbonHydrogen_dbe[index] + class_dbe +684 +685 if settings.min_mz <= mass <= settings.max_mz: +686 +687 if settings.min_dbe <= dbe <= settings.max_dbe: +688 +689 molecularFormula= {"heteroAtoms_id":classe_id, +690 "carbonHydrogen_id":carbonHydrogen_id[index], +691 "mass":mass, "DBE":dbe} +692 +693 results.append(molecularFormula) +694 +695 return results 696 -697 def get_h_odd_or_even(self, class_dict): -698 """ Get the hydrogen odd or even -699 -700 Parameters -701 ---------- -702 class_dict : dict -703 A dictionary of classes. -704 -705 Returns -706 ------- -707 str -708 A string indicating whether to retrieve even or odd hydrogen atoms. -709 """ -710 -711 HAS_NITROGEN = 'N' in class_dict.keys() -712 HAS_PHOSPHORUS = 'P' in class_dict.keys() +697 +698 def get_h_odd_or_even(self, class_dict): +699 """ Get the hydrogen odd or even +700 +701 Parameters +702 ---------- +703 class_dict : dict +704 A dictionary of classes. +705 +706 Returns +707 ------- +708 str +709 A string indicating whether to retrieve even or odd hydrogen atoms. +710 """ +711 +712 HAS_NITROGEN = 'N' in class_dict.keys() 713 714 number_of_halogen = self.get_total_halogen_atoms(class_dict) -715 -716 if number_of_halogen > 0: -717 -718 TEM_HALOGEN = True -719 -720 else: -721 -722 TEM_HALOGEN = False -723 -724 if TEM_HALOGEN: -725 -726 remaining_halogen = number_of_halogen % 2 -727 -728 else: -729 -730 remaining_halogen = 0 -731 -732 if HAS_NITROGEN and HAS_PHOSPHORUS: +715 number_of_hetero = self.get_total_heteroatoms(class_dict) +716 +717 if number_of_halogen > 0: +718 +719 HAS_HALOGEN = True +720 +721 else: +722 +723 HAS_HALOGEN = False +724 +725 if HAS_HALOGEN: +726 +727 remaining_halogen = number_of_halogen % 2 +728 +729 else: +730 +731 remaining_halogen = 0 +732 733 -734 number_of_n = class_dict.get('N') + class_dict.get('P') -735 remaining_n = number_of_n % 2 -736 -737 elif HAS_NITROGEN and not HAS_PHOSPHORUS: -738 -739 number_of_n = class_dict.get('N') -740 remaining_n = number_of_n % 2 +734 if number_of_hetero > 0: +735 +736 HAS_OTHER_HETERO = True +737 +738 total_hetero_valence = self.get_total_hetero_valence(class_dict) +739 +740 else: 741 -742 elif HAS_PHOSPHORUS and not HAS_NITROGEN: +742 HAS_OTHER_HETERO = False 743 -744 number_of_n = class_dict.get('P') -745 remaining_n = number_of_n % 2 -746 -747 else: -748 -749 remaining_n = -1 -750 -751 if remaining_n > 0.0: -752 if HAS_NITROGEN or HAS_PHOSPHORUS: +744 total_hetero_valence = 0 +745 +746 if HAS_OTHER_HETERO: +747 +748 remaining_hetero_valence = total_hetero_valence % 2 +749 +750 else: +751 +752 remaining_hetero_valence = 0 753 -754 if TEM_HALOGEN: -755 if remaining_halogen == 0: -756 return 'odd' -757 else: -758 return 'even' -759 else: -760 return 'odd' +754 +755 if HAS_NITROGEN and not HAS_OTHER_HETERO: +756 +757 number_of_n = class_dict.get('N') +758 remaining_n = number_of_n % 2 +759 +760 elif HAS_NITROGEN and HAS_OTHER_HETERO: 761 -762 elif remaining_n == 0.0: -763 -764 if HAS_NITROGEN or HAS_PHOSPHORUS: -765 -766 if TEM_HALOGEN: -767 if remaining_halogen == 0: -768 return 'even' -769 else: -770 return 'odd' -771 else: -772 return 'even' -773 -774 else: -775 -776 if TEM_HALOGEN: -777 if remaining_halogen == 0: -778 return 'even' -779 else: -780 return 'odd' -781 else: -782 return 'even' -783 -784 @staticmethod -785 def get_total_halogen_atoms(class_dict): -786 """ Get the total number of halogen atoms -787 -788 Parameters -789 ---------- -790 class_dict : dict -791 A dictionary of classes. -792 -793 Returns -794 ------- -795 int -796 The total number of halogen atoms. -797 """ -798 atoms = ['F', 'Cl', 'Br', 'I'] -799 -800 total_number = 0 -801 -802 for atom in atoms: -803 -804 if atom in class_dict.keys(): -805 -806 total_number = total_number + class_dict.get(atom) -807 -808 return total_number +762 number_of_n = class_dict.get('N') +763 remaining_n = (number_of_n + remaining_hetero_valence )% 2 +764 +765 elif HAS_OTHER_HETERO and not HAS_NITROGEN: +766 +767 remaining_n = remaining_hetero_valence +768 +769 else: +770 +771 remaining_n = -1 +772 +773 if remaining_n > 0.0: +774 +775 if HAS_NITROGEN or HAS_OTHER_HETERO: +776 +777 if HAS_HALOGEN: +778 if remaining_halogen == 0: +779 return 'odd' +780 else: +781 return 'even' +782 +783 else: +784 return 'odd' +785 +786 elif remaining_n == 0.0: +787 +788 if HAS_NITROGEN or HAS_OTHER_HETERO: +789 +790 if HAS_HALOGEN: +791 if remaining_halogen == 0: +792 return 'even' +793 else: +794 return 'odd' +795 +796 else: +797 return 'even' +798 +799 else: +800 +801 if HAS_HALOGEN: +802 if remaining_halogen == 0: +803 return 'even' +804 else: +805 return 'odd' +806 +807 else: +808 return 'even' +809 +810 +811 +812 @staticmethod +813 def get_total_heteroatoms(class_dict): +814 """ Get the total number of heteroatoms other than N, F, Cl, Br +815 +816 Parameters +817 ---------- +818 class_dict : dict +819 A dictionary of classes. +820 +821 Returns +822 ------- +823 int +824 The total number of heteroatoms. +825 """ +826 +827 total_number = 0 +828 +829 for atom in class_dict.keys(): +830 +831 if atom not in ['HC','C','H','O','N', 'F', 'Cl', 'Br']: +832 total_number = total_number + class_dict.get(atom) +833 +834 return total_number +835 +836 @staticmethod +837 def get_total_hetero_valence(class_dict): +838 """ Get the total valence of heteroatoms other than N, F, Cl, Br +839 +840 Parameters +841 ---------- +842 class_dict : dict +843 A dictionary of classes. +844 +845 Returns +846 ------- +847 int +848 The total heteroatom valence. +849 """ +850 total_valence = 0 +851 +852 for atom in class_dict.keys(): +853 +854 if atom not in ['HC','C','H','O','N', 'F', 'Cl', 'Br']: +855 +856 clean_atom = ''.join([i for i in atom if not i.isdigit()]) +857 +858 atom_valence = MSParameters.molecular_search.used_atom_valences.get(clean_atom) +859 +860 if type(atom_valence) is tuple: +861 atom_valence = atom_valence[0] +862 +863 n_atom =int(class_dict.get(atom)) +864 +865 n_atom_valence = atom_valence * n_atom +866 +867 total_valence = total_valence + n_atom_valence +868 +869 return total_valence +870 +871 @staticmethod +872 def get_total_halogen_atoms(class_dict): +873 """ Get the total number of halogen atoms +874 +875 Parameters +876 ---------- +877 class_dict : dict +878 A dictionary of classes. +879 +880 Returns +881 ------- +882 int +883 The total number of halogen atoms. +884 """ +885 atoms = ['F', 'Cl', 'Br'] +886 +887 total_number = 0 +888 +889 for atom in atoms: +890 +891 if atom in class_dict.keys(): +892 +893 total_number = total_number + class_dict.get(atom) +894 +895 return total_number @@ -1818,7 +1998,9 @@

    Methods
  • get_h_odd_or_even(class_dict)
    Gets the hydrogen odd or even.
  • get_total_halogen_atoms(class_dict)
    -Gets the total number of halogen atoms.
  • +Gets the total number of halogen atoms. +
  • get_total_hetero_valence(class_dict) +Gets the total valence of heteroatoms other than N, F, Cl, and Br
  • @@ -1833,14 +2015,14 @@
    Methods
    -
    132    def __init__(self, sql_db = None):
    -133
    -134        if not sql_db:
    -135            
    -136            self.sql_db = MolForm_SQL()
    -137        else:
    -138            
    -139            self.sql_db = sql_db
    +            
    133    def __init__(self, sql_db = None):
    +134
    +135        if not sql_db:
    +136            
    +137            self.sql_db = MolForm_SQL()
    +138        else:
    +139            
    +140            self.sql_db = sql_db
     
    @@ -1858,9 +2040,9 @@
    Methods
    -
    141    def cProfile_worker(self, args):
    -142        """ cProfile worker for the get_mol_formulas function"""
    -143        cProfile.runctx('self.get_mol_formulas(*args)', globals(), locals(), 'mf_database_cprofile.prof')
    +            
    142    def cProfile_worker(self, args):
    +143        """ cProfile worker for the get_mol_formulas function"""
    +144        cProfile.runctx('self.get_mol_formulas(*args)', globals(), locals(), 'mf_database_cprofile.prof')
     
    @@ -1880,58 +2062,58 @@
    Methods
    -
    145    def check_database_get_class_list(self, molecular_search_settings):
    -146        """ check if the database has all the classes, if not create the missing classes
    -147        
    -148        Parameters
    -149        ----------
    -150        molecular_search_settings : object
    -151            An object containing user-defined settings.
    -152        
    -153        Returns
    -154        -------
    -155        list
    -156            list of tuples with the class name and the class dictionary
    -157        """
    -158        all_class_to_create = []
    -159        
    -160        classes_dict = self.get_classes_in_order(molecular_search_settings)
    -161        
    -162        class_str_set = set(classes_dict.keys())
    -163        
    -164        existing_classes_objs = self.sql_db.session.query(HeteroAtoms).distinct().all()
    -165        
    -166        existing_classes_str = set([classe.name for classe in existing_classes_objs])
    -167
    -168        self.len_existing_classes = len(existing_classes_str)
    -169
    -170        class_to_create = class_str_set - existing_classes_str
    -171        
    -172        class_count= len(existing_classes_objs)
    -173
    -174        data_classes = list()    
    -175        for index, class_str in enumerate(class_to_create):
    -176            
    -177            class_dict = classes_dict.get(class_str)
    -178            halogen_count = self.get_total_halogen_atoms(class_dict)
    -179            data_classes.append({"name":class_str, "id":class_count+ index + 1, "halogensCount": halogen_count})
    -180
    -181        #data_classes = [{"name":class_str, "id":class_count+ index + 1} for index, class_str in enumerate(class_to_create)]
    -182
    -183        if data_classes:
    -184
    -185            list_insert_chunks = chunks(data_classes, self.sql_db.chunks_count)
    -186            for insert_chunk in  list_insert_chunks:   
    -187                insert_query = HeteroAtoms.__table__.insert().values(insert_chunk)
    -188                self.sql_db.session.execute(insert_query)
    -189
    -190        for index, class_str in enumerate(class_to_create):
    -191
    -192            class_tuple = (class_str, classes_dict.get(class_str), class_count+ index + 1)
    -193
    -194            all_class_to_create.append(class_tuple)
    -195
    -196        return [(c_s, c_d) for c_s, c_d in classes_dict.items()], all_class_to_create, existing_classes_objs       
    +            
    146    def check_database_get_class_list(self, molecular_search_settings):
    +147        """ check if the database has all the classes, if not create the missing classes
    +148        
    +149        Parameters
    +150        ----------
    +151        molecular_search_settings : object
    +152            An object containing user-defined settings.
    +153        
    +154        Returns
    +155        -------
    +156        list
    +157            list of tuples with the class name and the class dictionary
    +158        """
    +159        all_class_to_create = []
    +160        
    +161        classes_dict = self.get_classes_in_order(molecular_search_settings)
    +162        
    +163        class_str_set = set(classes_dict.keys())
    +164        
    +165        existing_classes_objs = self.sql_db.session.query(HeteroAtoms).distinct().all()
    +166        
    +167        existing_classes_str = set([classe.name for classe in existing_classes_objs])
    +168
    +169        self.len_existing_classes = len(existing_classes_str)
    +170
    +171        class_to_create = class_str_set - existing_classes_str
    +172        
    +173        class_count= len(existing_classes_objs)
    +174
    +175        data_classes = list()    
    +176        for index, class_str in enumerate(class_to_create):
    +177            
    +178            class_dict = classes_dict.get(class_str)
    +179            halogen_count = self.get_total_halogen_atoms(class_dict)
    +180            data_classes.append({"name":class_str, "id":class_count+ index + 1, "halogensCount": halogen_count})
    +181
    +182        #data_classes = [{"name":class_str, "id":class_count+ index + 1} for index, class_str in enumerate(class_to_create)]
    +183
    +184        if data_classes:
    +185
    +186            list_insert_chunks = chunks(data_classes, self.sql_db.chunks_count)
    +187            for insert_chunk in  list_insert_chunks:   
    +188                insert_query = HeteroAtoms.__table__.insert().values(insert_chunk)
    +189                self.sql_db.session.execute(insert_query)
    +190
    +191        for index, class_str in enumerate(class_to_create):
    +192
    +193            class_tuple = (class_str, classes_dict.get(class_str), class_count+ index + 1)
    +194
    +195            all_class_to_create.append(class_tuple)
    +196
    +197        return [(c_s, c_d) for c_s, c_d in classes_dict.items()], all_class_to_create, existing_classes_objs       
     
    @@ -1964,32 +2146,32 @@
    Returns
    -
    198    def get_carbonsHydrogens(self, settings, odd_even):
    -199            """ Retrieve carbon and hydrogen atoms from the molecular lookup table based on user-defined settings.
    -200
    -201            Parameters
    -202            ----------
    -203            settings : object
    -204                 An object containing user-defined settings.
    -205            odd_even : str
    -206                A string indicating whether to retrieve even or odd hydrogen atoms.
    -207
    -208            Returns
    -209            -------
    -210            list
    -211                A list of CarbonHydrogen objects that satisfy the specified conditions.
    -212            """
    -213            operator = '==' if odd_even == 'even' else '!=' 
    -214            usedAtoms = settings.usedAtoms
    -215            user_min_c, user_max_c = usedAtoms.get('C')
    -216            user_min_h, user_max_h = usedAtoms.get('H')
    -217
    -218            return eval("self.sql_db.session.query(CarbonHydrogen).filter(" 
    -219                                           "CarbonHydrogen.C >= user_min_c,"
    -220                                            "CarbonHydrogen.H >= user_min_h,"
    -221                                            "CarbonHydrogen.C <= user_max_c,"
    -222                                            "CarbonHydrogen.H <= user_max_h,"
    -223                                            "CarbonHydrogen.H % 2" + operator+ "0).all()")
    +            
    199    def get_carbonsHydrogens(self, settings, odd_even):
    +200            """ Retrieve carbon and hydrogen atoms from the molecular lookup table based on user-defined settings.
    +201
    +202            Parameters
    +203            ----------
    +204            settings : object
    +205                 An object containing user-defined settings.
    +206            odd_even : str
    +207                A string indicating whether to retrieve even or odd hydrogen atoms.
    +208
    +209            Returns
    +210            -------
    +211            list
    +212                A list of CarbonHydrogen objects that satisfy the specified conditions.
    +213            """
    +214            operator = '==' if odd_even == 'even' else '!=' 
    +215            usedAtoms = settings.usedAtoms
    +216            user_min_c, user_max_c = usedAtoms.get('C')
    +217            user_min_h, user_max_h = usedAtoms.get('H')
    +218
    +219            return eval("self.sql_db.session.query(CarbonHydrogen).filter(" 
    +220                                           "CarbonHydrogen.C >= user_min_c,"
    +221                                            "CarbonHydrogen.H >= user_min_h,"
    +222                                            "CarbonHydrogen.C <= user_max_c,"
    +223                                            "CarbonHydrogen.H <= user_max_h,"
    +224                                            "CarbonHydrogen.H % 2" + operator+ "0).all()")
     
    @@ -2024,115 +2206,115 @@
    Returns
    -
    225    def add_carbonsHydrogens(self, settings, existing_classes_objs):
    -226        """ Add carbon and hydrogen atoms to the molecular lookup table based on user-defined settings.
    -227
    -228        Parameters
    -229        ----------
    -230        settings : object
    -231            An object containing user-defined settings.
    -232        existing_classes_objs : list
    -233            A list of HeteroAtoms objects.
    -234        """
    -235        usedAtoms = settings.usedAtoms
    -236
    -237        user_min_c, user_max_c = usedAtoms.get('C')
    -238        user_min_h, user_max_h = usedAtoms.get('H')
    -239
    -240        query_obj = self.sql_db.session.query(func.max(CarbonHydrogen.C).label("max_c"), 
    -241                        func.min(CarbonHydrogen.C).label("min_c"),
    -242                        func.max(CarbonHydrogen.H).label("max_h"),
    -243                        func.min(CarbonHydrogen.H).label("min_h"),
    -244                        )
    -245
    +            
    226    def add_carbonsHydrogens(self, settings, existing_classes_objs):
    +227        """ Add carbon and hydrogen atoms to the molecular lookup table based on user-defined settings.
    +228
    +229        Parameters
    +230        ----------
    +231        settings : object
    +232            An object containing user-defined settings.
    +233        existing_classes_objs : list
    +234            A list of HeteroAtoms objects.
    +235        """
    +236        usedAtoms = settings.usedAtoms
    +237
    +238        user_min_c, user_max_c = usedAtoms.get('C')
    +239        user_min_h, user_max_h = usedAtoms.get('H')
    +240
    +241        query_obj = self.sql_db.session.query(func.max(CarbonHydrogen.C).label("max_c"), 
    +242                        func.min(CarbonHydrogen.C).label("min_c"),
    +243                        func.max(CarbonHydrogen.H).label("max_h"),
    +244                        func.min(CarbonHydrogen.H).label("min_h"),
    +245                        )
     246
    -247        database = query_obj.first()
    -248        if database.max_c == user_max_c and database.min_c == user_min_c and database.max_h == user_max_h and database.min_h == user_min_h:   
    -249            #all data is already available at the database
    -250            pass
    -251
    -252        else:
    -253
    -254            current_count = self.sql_db.session.query(CarbonHydrogen.C).count()
    -255            
    -256            databaseCarbonHydrogen = self.sql_db.session.query(CarbonHydrogen).all()
    -257            
    -258            userCarbon = set(range(user_min_c, user_max_c + 1))
    -259            userHydrogen = set(range(user_min_h, user_max_h + 1))
    -260            
    -261            carbon_hydrogen_objs_database = {}
    -262            for obj in databaseCarbonHydrogen:
    -263                
    -264                str_data = "C:{},H:{}".format(obj.C, obj.H)
    -265                carbon_hydrogen_objs_database[str_data] = str_data
    -266
    -267            carbon_hydrogen_objs_to_create = {'even': {}, 'odd': {}}
    -268            
    -269            list_ch_obj_to_add = list()
    -270            i = 0
    -271            for comb in itertools.product(userCarbon, userHydrogen):
    -272                
    -273                C  = comb[0]
    -274                H =  comb[1]
    -275                data = {"C":C,
    -276                       "H":H,
    -277                }
    -278
    -279                data_insert = {"C":C,
    -280                       "H":H,
    -281                }
    -282
    -283                str_data = "C:{},H:{}".format(C,H)
    -284                
    -285                if not str_data in carbon_hydrogen_objs_database.keys():
    -286                    
    -287                    label = 'even' if comb[1]%2 == 0 else 'odd'
    -288                    data["mass"] = (C * Atoms.atomic_masses.get('C')) + (H * Atoms.atomic_masses.get('H'))
    -289                    data["dbe"] = C - (H/2) + 1
    -290                    data["id"] = i + current_count + 1
    -291                    data_insert["id"] = i + current_count + 1
    -292                    i = i + 1 
    -293                    carbon_hydrogen_objs_to_create[label][str_data] = data
    -294                    
    -295                    list_ch_obj_to_add.append(data_insert)
    -296
    -297            if list_ch_obj_to_add:
    -298                # insert carbon hydrogen objs
    -299                list_insert_chunks = chunks(list_ch_obj_to_add, self.sql_db.chunks_count)
    -300                for insert_chunk in  list_insert_chunks:   
    -301                    insert_query = CarbonHydrogen.__table__.insert().values(insert_chunk)
    -302                    self.sql_db.session.execute(insert_query)
    -303                self.sql_db.session.commit()    
    -304            
    -305                
    -306                list_molecular_form= list()
    -307                for classe_obj in existing_classes_objs:
    -308
    -309                    classe_dict = classe_obj.to_dict()  
    -310                    classe_mass = self.calc_mz(classe_dict)
    -311                    classe_dbe = self.calc_dbe_class(classe_dict)
    -312
    -313                    odd_even_label = self.get_h_odd_or_even(classe_dict)
    -314
    -315                    ch_datalist = carbon_hydrogen_objs_to_create.get(odd_even_label).values()
    -316
    -317                    for ch_dict in ch_datalist:
    -318                        mass = ch_dict.get('mass') + classe_mass
    -319                        dbe = ch_dict.get('dbe') + classe_dbe
    -320
    -321                        if settings.min_mz <= mass <= settings.max_mz:
    -322                
    -323                            if settings.min_dbe <= dbe <= settings.max_dbe:
    -324                                
    -325                                list_molecular_form.append( {"heteroAtoms_id":classe_obj.id, 
    -326                                        "carbonHydrogen_id":ch_dict.get('id'), 
    -327                                        "mass":mass, "DBE":dbe})
    -328
    -329                list_insert_chunks = chunks(list_molecular_form, self.sql_db.chunks_count)
    -330                for insert_chunk in  list_insert_chunks:   
    -331                    insert_query = MolecularFormulaLink.__table__.insert().values(insert_chunk)
    -332                    self.sql_db.session.execute(insert_query)
    -333                self.sql_db.session.commit()    
    +247
    +248        database = query_obj.first()
    +249        if database.max_c == user_max_c and database.min_c == user_min_c and database.max_h == user_max_h and database.min_h == user_min_h:   
    +250            #all data is already available at the database
    +251            pass
    +252
    +253        else:
    +254
    +255            current_count = self.sql_db.session.query(CarbonHydrogen.C).count()
    +256            
    +257            databaseCarbonHydrogen = self.sql_db.session.query(CarbonHydrogen).all()
    +258            
    +259            userCarbon = set(range(user_min_c, user_max_c + 1))
    +260            userHydrogen = set(range(user_min_h, user_max_h + 1))
    +261            
    +262            carbon_hydrogen_objs_database = {}
    +263            for obj in databaseCarbonHydrogen:
    +264                
    +265                str_data = "C:{},H:{}".format(obj.C, obj.H)
    +266                carbon_hydrogen_objs_database[str_data] = str_data
    +267
    +268            carbon_hydrogen_objs_to_create = {'even': {}, 'odd': {}}
    +269            
    +270            list_ch_obj_to_add = list()
    +271            i = 0
    +272            for comb in itertools.product(userCarbon, userHydrogen):
    +273                
    +274                C  = comb[0]
    +275                H =  comb[1]
    +276                data = {"C":C,
    +277                       "H":H,
    +278                }
    +279
    +280                data_insert = {"C":C,
    +281                       "H":H,
    +282                }
    +283
    +284                str_data = "C:{},H:{}".format(C,H)
    +285                
    +286                if not str_data in carbon_hydrogen_objs_database.keys():
    +287                    
    +288                    label = 'even' if comb[1]%2 == 0 else 'odd'
    +289                    data["mass"] = (C * Atoms.atomic_masses.get('C')) + (H * Atoms.atomic_masses.get('H'))
    +290                    data["dbe"] = C - (H/2) + 1
    +291                    data["id"] = i + current_count + 1
    +292                    data_insert["id"] = i + current_count + 1
    +293                    i = i + 1 
    +294                    carbon_hydrogen_objs_to_create[label][str_data] = data
    +295                    
    +296                    list_ch_obj_to_add.append(data_insert)
    +297
    +298            if list_ch_obj_to_add:
    +299                # insert carbon hydrogen objs
    +300                list_insert_chunks = chunks(list_ch_obj_to_add, self.sql_db.chunks_count)
    +301                for insert_chunk in  list_insert_chunks:   
    +302                    insert_query = CarbonHydrogen.__table__.insert().values(insert_chunk)
    +303                    self.sql_db.session.execute(insert_query)
    +304                self.sql_db.session.commit()    
    +305            
    +306                
    +307                list_molecular_form= list()
    +308                for classe_obj in existing_classes_objs:
    +309
    +310                    classe_dict = classe_obj.to_dict()  
    +311                    classe_mass = self.calc_mz(classe_dict)
    +312                    classe_dbe = self.calc_dbe_class(classe_dict)
    +313
    +314                    odd_even_label = self.get_h_odd_or_even(classe_dict)
    +315
    +316                    ch_datalist = carbon_hydrogen_objs_to_create.get(odd_even_label).values()
    +317
    +318                    for ch_dict in ch_datalist:
    +319                        mass = ch_dict.get('mass') + classe_mass
    +320                        dbe = ch_dict.get('dbe') + classe_dbe
    +321
    +322                        if settings.min_mz <= mass <= settings.max_mz:
    +323                
    +324                            if settings.min_dbe <= dbe <= settings.max_dbe:
    +325                                
    +326                                list_molecular_form.append( {"heteroAtoms_id":classe_obj.id, 
    +327                                        "carbonHydrogen_id":ch_dict.get('id'), 
    +328                                        "mass":mass, "DBE":dbe})
    +329
    +330                list_insert_chunks = chunks(list_molecular_form, self.sql_db.chunks_count)
    +331                for insert_chunk in  list_insert_chunks:   
    +332                    insert_query = MolecularFormulaLink.__table__.insert().values(insert_chunk)
    +333                    self.sql_db.session.execute(insert_query)
    +334                self.sql_db.session.commit()    
     
    @@ -2161,16 +2343,16 @@
    Parameters
    -
    16    def timed(*args, **kw):
    -17        ts = time.time()
    -18        result = method(*args, **kw)
    -19        te = time.time()
    -20        if 'log_time' in kw:
    -21            name = kw.get('log_name', method.__name__.upper())
    -22            kw['log_time'][name] = int((te - ts) * 1000)
    -23        else:
    -24            print("%r  %2.2f ms" % (method.__name__, (te - ts) * 1000))
    -25        return result
    +            
    343    def timed(*args, **kw):
    +344        ts = time.time()
    +345        result = method(*args, **kw)
    +346        te = time.time()
    +347        if 'log_time' in kw:
    +348            name = kw.get('log_name', method.__name__.upper())
    +349            kw['log_time'][name] = int((te - ts) * 1000)
    +350        else:
    +351            print("%r  %2.2f ms" % (method.__name__, (te - ts) * 1000))
    +352        return result
     
    @@ -2203,82 +2385,82 @@
    Returns
    -
    408    def get_classes_in_order(self, molecular_search_settings):
    -409        """ Get the classes in order
    -410
    -411        Parameters
    -412        ----------
    -413        molecular_search_settings : object
    -414            An object containing user-defined settings.
    -415        
    -416        Returns
    -417        -------
    -418        dict
    -419            A dictionary of classes in order.
    -420            structure is  ('HC', {'HC': 1})
    -421        """
    -422        
    -423        usedAtoms = deepcopy(molecular_search_settings.usedAtoms)
    -424        
    -425        usedAtoms.pop("C")
    -426        usedAtoms.pop("H")
    -427
    -428        min_n, max_n = usedAtoms.get('N') if usedAtoms.get('N') else (0,0)
    -429        min_o, max_o = usedAtoms.get('O') if usedAtoms.get('O') else (0,0)
    -430        min_s, max_s = usedAtoms.get('S') if usedAtoms.get('S') else (0,0)
    -431        min_p, max_p = usedAtoms.get('P') if usedAtoms.get('P') else (0,0)
    -432
    -433        possible_n = [n for n in range(min_n, max_n + 1)]
    -434        possible_o = [o for o in range(min_o, max_o + 1)]
    -435        possible_s = [s for s in range(min_s, max_s + 1)]
    -436        possible_p = [p for p in range(min_p, max_p + 1)]
    -437        
    -438        atoms_in_order = ['N', 'O', 'S', 'P']
    -439
    -440        classe_in_order = {}
    -441
    -442        all_atoms_tuples = itertools.product(possible_n, possible_o,
    -443                                            possible_s, possible_p)
    -444        
    -445        for atom in atoms_in_order:
    -446            usedAtoms.pop(atom, None)
    -447        
    -448        for selected_atom, min_max_tuple in usedAtoms.items():
    -449            
    -450            min_x = min_max_tuple[0]
    -451            max_x = min_max_tuple[1]
    -452            
    -453
    -454            possible_x = [x for x in range(min_x, max_x + 1)]
    -455
    -456            all_atoms_tuples = itertools.product(all_atoms_tuples, possible_x)
    -457            all_atoms_tuples = [all_atoms_combined[0] + (all_atoms_combined[1],) for all_atoms_combined in
    -458                                all_atoms_tuples]
    -459            atoms_in_order.append(selected_atom)
    -460        
    -461        for all_atoms_tuple in all_atoms_tuples:
    -462
    -463            classe_str = ''
    -464            classe_dict = {}
    -465            
    -466            for each_atoms_index, atom_number in enumerate(all_atoms_tuple):
    -467                
    -468                if atom_number != 0:
    -469                    classe_dict[atoms_in_order[each_atoms_index]] = atom_number
    -470            
    -471            if not classe_dict:
    -472                classe_in_order['HC'] = {"HC": ""}
    -473                continue
    -474
    -475            classe_str =json.dumps(classe_dict)
    -476            
    -477            if len(classe_str) > 0:
    -478                
    -479                classe_in_order[classe_str] =  classe_dict
    -480        
    -481        classe_in_order_dict = self.sort_classes(atoms_in_order, classe_in_order)
    -482        
    -483        return classe_in_order_dict
    +            
    409    def get_classes_in_order(self, molecular_search_settings):
    +410        """ Get the classes in order
    +411
    +412        Parameters
    +413        ----------
    +414        molecular_search_settings : object
    +415            An object containing user-defined settings.
    +416        
    +417        Returns
    +418        -------
    +419        dict
    +420            A dictionary of classes in order.
    +421            structure is  ('HC', {'HC': 1})
    +422        """
    +423        
    +424        usedAtoms = deepcopy(molecular_search_settings.usedAtoms)
    +425        
    +426        usedAtoms.pop("C")
    +427        usedAtoms.pop("H")
    +428
    +429        min_n, max_n = usedAtoms.get('N') if usedAtoms.get('N') else (0,0)
    +430        min_o, max_o = usedAtoms.get('O') if usedAtoms.get('O') else (0,0)
    +431        min_s, max_s = usedAtoms.get('S') if usedAtoms.get('S') else (0,0)
    +432        min_p, max_p = usedAtoms.get('P') if usedAtoms.get('P') else (0,0)
    +433
    +434        possible_n = [n for n in range(min_n, max_n + 1)]
    +435        possible_o = [o for o in range(min_o, max_o + 1)]
    +436        possible_s = [s for s in range(min_s, max_s + 1)]
    +437        possible_p = [p for p in range(min_p, max_p + 1)]
    +438        
    +439        atoms_in_order = ['N', 'O', 'S', 'P']
    +440
    +441        classe_in_order = {}
    +442
    +443        all_atoms_tuples = itertools.product(possible_n, possible_o,
    +444                                            possible_s, possible_p)
    +445        
    +446        for atom in atoms_in_order:
    +447            usedAtoms.pop(atom, None)
    +448        
    +449        for selected_atom, min_max_tuple in usedAtoms.items():
    +450            
    +451            min_x = min_max_tuple[0]
    +452            max_x = min_max_tuple[1]
    +453            
    +454
    +455            possible_x = [x for x in range(min_x, max_x + 1)]
    +456
    +457            all_atoms_tuples = itertools.product(all_atoms_tuples, possible_x)
    +458            all_atoms_tuples = [all_atoms_combined[0] + (all_atoms_combined[1],) for all_atoms_combined in
    +459                                all_atoms_tuples]
    +460            atoms_in_order.append(selected_atom)
    +461        
    +462        for all_atoms_tuple in all_atoms_tuples:
    +463
    +464            classe_str = ''
    +465            classe_dict = {}
    +466            
    +467            for each_atoms_index, atom_number in enumerate(all_atoms_tuple):
    +468                
    +469                if atom_number != 0:
    +470                    classe_dict[atoms_in_order[each_atoms_index]] = atom_number
    +471            
    +472            if not classe_dict:
    +473                classe_in_order['HC'] = {"HC": ""}
    +474                continue
    +475
    +476            classe_str =json.dumps(classe_dict)
    +477            
    +478            if len(classe_str) > 0:
    +479                
    +480                classe_in_order[classe_str] =  classe_dict
    +481        
    +482        classe_in_order_dict = self.sort_classes(atoms_in_order, classe_in_order)
    +483        
    +484        return classe_in_order_dict
     
    @@ -2313,37 +2495,37 @@
    Returns
    -
    485    @staticmethod
    -486    def sort_classes( atoms_in_order, combination_dict) -> Dict[str, Dict[str, int]]: 
    -487        """ Sort the classes in order
    -488        
    -489        Parameters
    -490        ----------
    -491        atoms_in_order : list
    -492            A list of atoms in order.
    -493        combination_dict : dict
    -494            A dictionary of classes.
    -495        
    -496        Returns
    -497        -------
    -498        dict
    -499            A dictionary of classes in order.
    -500        """
    -501        #ensures atoms are always in the order defined at atoms_in_order list
    -502        join_dict_classes = dict()
    -503        atoms_in_order =  ['N','S','P','O'] + atoms_in_order[4:] + ['HC']
    -504        
    -505        sort_method = lambda atoms_keys: [atoms_in_order.index(atoms_keys)] 
    -506        for class_str, class_dict in combination_dict.items():
    -507            
    -508            sorted_dict_keys = sorted(class_dict, key = sort_method)
    -509            class_dict = { atom: class_dict[atom] for atom in sorted_dict_keys}
    -510            class_str = json.dumps(class_dict)
    -511            # using json for the new database, class 
    -512            # class_str = ' '.join([atom + str(class_dict[atom]) for atom in sorted_dict_keys])
    -513            join_dict_classes[class_str] =  class_dict
    -514        
    -515        return join_dict_classes
    +            
    486    @staticmethod
    +487    def sort_classes( atoms_in_order, combination_dict) -> Dict[str, Dict[str, int]]: 
    +488        """ Sort the classes in order
    +489        
    +490        Parameters
    +491        ----------
    +492        atoms_in_order : list
    +493            A list of atoms in order.
    +494        combination_dict : dict
    +495            A dictionary of classes.
    +496        
    +497        Returns
    +498        -------
    +499        dict
    +500            A dictionary of classes in order.
    +501        """
    +502        #ensures atoms are always in the order defined at atoms_in_order list
    +503        join_dict_classes = dict()
    +504        atoms_in_order =  ['N','S','P','O'] + atoms_in_order[4:] + ['HC']
    +505        
    +506        sort_method = lambda atoms_keys: [atoms_in_order.index(atoms_keys)] 
    +507        for class_str, class_dict in combination_dict.items():
    +508            
    +509            sorted_dict_keys = sorted(class_dict, key = sort_method)
    +510            class_dict = { atom: class_dict[atom] for atom in sorted_dict_keys}
    +511            class_str = json.dumps(class_dict)
    +512            # using json for the new database, class 
    +513            # class_str = ' '.join([atom + str(class_dict[atom]) for atom in sorted_dict_keys])
    +514            join_dict_classes[class_str] =  class_dict
    +515        
    +516        return join_dict_classes
     
    @@ -2379,30 +2561,30 @@
    Returns
    -
    517    @staticmethod
    -518    def get_fixed_initial_number_of_hydrogen( min_h, odd_even):
    -519        """ Get the fixed initial number of hydrogen atoms
    -520        
    -521        Parameters
    -522        ----------
    -523        min_h : int
    -524            The minimum number of hydrogen atoms.
    -525        odd_even : str
    -526            A string indicating whether to retrieve even or odd hydrogen atoms.
    -527        """
    -528        remaining_h = min_h % 2
    -529        
    -530        if odd_even == 'even':
    -531            
    -532            if remaining_h == 0: return remaining_h
    -533            
    -534            else: return remaining_h + 1    
    -535        
    -536        else:
    -537            
    -538            if remaining_h == 0: return remaining_h + 1
    -539            
    -540            else: return remaining_h    
    +            
    518    @staticmethod
    +519    def get_fixed_initial_number_of_hydrogen( min_h, odd_even):
    +520        """ Get the fixed initial number of hydrogen atoms
    +521        
    +522        Parameters
    +523        ----------
    +524        min_h : int
    +525            The minimum number of hydrogen atoms.
    +526        odd_even : str
    +527            A string indicating whether to retrieve even or odd hydrogen atoms.
    +528        """
    +529        remaining_h = min_h % 2
    +530        
    +531        if odd_even == 'even':
    +532            
    +533            if remaining_h == 0: return remaining_h
    +534            
    +535            else: return remaining_h + 1    
    +536        
    +537        else:
    +538            
    +539            if remaining_h == 0: return remaining_h + 1
    +540            
    +541            else: return remaining_h    
     
    @@ -2431,30 +2613,30 @@
    Parameters
    -
    542    def calc_mz(self, datadict, class_mass=0):
    -543        """ Calculate the mass-to-charge ratio (m/z) of a molecular formula.
    -544        
    -545        Parameters
    -546        ----------
    -547        datadict : dict
    -548            A dictionary of classes.
    -549        class_mass : int
    -550            The mass of the class.
    -551        
    -552        Returns
    -553        -------
    -554        float
    -555            The mass-to-charge ratio (m/z) of a molecular formula.
    -556        """
    -557        mass = class_mass
    -558        
    -559        for atom in datadict.keys():
    -560            
    -561            if atom != 'HC':    
    -562                
    -563                mass = mass + Atoms.atomic_masses[atom]  *  datadict.get(atom)
    -564            
    -565        return mass 
    +            
    543    def calc_mz(self, datadict, class_mass=0):
    +544        """ Calculate the mass-to-charge ratio (m/z) of a molecular formula.
    +545        
    +546        Parameters
    +547        ----------
    +548        datadict : dict
    +549            A dictionary of classes.
    +550        class_mass : int
    +551            The mass of the class.
    +552        
    +553        Returns
    +554        -------
    +555        float
    +556            The mass-to-charge ratio (m/z) of a molecular formula.
    +557        """
    +558        mass = class_mass
    +559        
    +560        for atom in datadict.keys():
    +561            
    +562            if atom != 'HC':    
    +563                
    +564                mass = mass + Atoms.atomic_masses[atom]  *  datadict.get(atom)
    +565            
    +566        return mass 
     
    @@ -2489,40 +2671,40 @@
    Returns
    -
    567    def calc_dbe_class(self, datadict):
    -568        """ Calculate the double bond equivalent (DBE) of a molecular formula.
    -569        
    -570        Parameters
    -571        ----------
    -572        datadict : dict
    -573            A dictionary of classes.
    -574        
    -575        Returns
    -576        -------
    -577        float
    -578            The double bond equivalent (DBE) of a molecular formula.
    -579        """
    -580        init_dbe = 0
    -581        for atom in datadict.keys():
    -582
    -583            if atom == 'HC':
    -584                continue  
    -585            
    -586            n_atom = int(datadict.get(atom))
    -587            
    -588            clean_atom = ''.join([i for i in atom if not i.isdigit()]) 
    -589            
    -590            valencia = MSParameters.molecular_search.used_atom_valences.get(clean_atom)
    -591            
    -592            if type(valencia) is tuple:
    -593                valencia = valencia[0]
    -594            if valencia > 0:
    -595                #print atom, valencia, n_atom, init_dbe
    -596                init_dbe = init_dbe + (n_atom * (valencia - 2))
    -597            else:
    -598                continue
    -599            
    -600        return (0.5 * init_dbe)
    +            
    568    def calc_dbe_class(self, datadict):
    +569        """ Calculate the double bond equivalent (DBE) of a molecular formula.
    +570        
    +571        Parameters
    +572        ----------
    +573        datadict : dict
    +574            A dictionary of classes.
    +575        
    +576        Returns
    +577        -------
    +578        float
    +579            The double bond equivalent (DBE) of a molecular formula.
    +580        """
    +581        init_dbe = 0
    +582        for atom in datadict.keys():
    +583
    +584            if atom == 'HC':
    +585                continue  
    +586            
    +587            n_atom = int(datadict.get(atom))
    +588            
    +589            clean_atom = ''.join([i for i in atom if not i.isdigit()]) 
    +590            
    +591            valencia = MSParameters.molecular_search.used_atom_valences.get(clean_atom)
    +592            
    +593            if type(valencia) is tuple:
    +594                valencia = valencia[0]
    +595            if valencia > 0:
    +596                #print atom, valencia, n_atom, init_dbe
    +597                init_dbe = init_dbe + (n_atom * (valencia - 2))
    +598            else:
    +599                continue
    +600            
    +601        return (0.5 * init_dbe)
     
    @@ -2555,27 +2737,27 @@
    Returns
    -
    602    def populate_combinations(self, classe_tuple, settings):
    -603        """ Populate the combinations
    -604        
    -605        Parameters
    -606        ----------
    -607        classe_tuple : tuple
    -608            A tuple containing the class name, the class dictionary, and the class ID.
    -609        settings : object
    -610            An object containing user-defined settings.
    -611        
    -612        Returns
    -613        -------
    -614        list
    -615            A list of molecular formula data dictionaries.
    -616        """
    -617        ion_charge =  0
    -618        
    -619        class_dict = classe_tuple[1]
    -620        odd_or_even = self.get_h_odd_or_even(class_dict)
    -621        
    -622        return self.get_mol_formulas(odd_or_even, classe_tuple, settings)
    +            
    603    def populate_combinations(self, classe_tuple, settings):
    +604        """ Populate the combinations
    +605        
    +606        Parameters
    +607        ----------
    +608        classe_tuple : tuple
    +609            A tuple containing the class name, the class dictionary, and the class ID.
    +610        settings : object
    +611            An object containing user-defined settings.
    +612        
    +613        Returns
    +614        -------
    +615        list
    +616            A list of molecular formula data dictionaries.
    +617        """
    +618        ion_charge =  0
    +619        
    +620        class_dict = classe_tuple[1]
    +621        odd_or_even = self.get_h_odd_or_even(class_dict)
    +622        
    +623        return self.get_mol_formulas(odd_or_even, classe_tuple, settings)
     
    @@ -2610,25 +2792,25 @@
    Returns
    -
    624    def get_or_add(self, SomeClass, kw):
    -625        """ Get or add a class
    -626        
    -627        Parameters
    -628        ----------
    -629        SomeClass : object
    -630            A class object.
    -631        kw : dict
    -632            A dictionary of classes.
    -633        
    -634        Returns
    -635        -------
    -636        object
    -637            A class object.
    -638        """
    -639        obj = self.sql_db.session.query(SomeClass).filter_by(**kw).first()
    -640        if not obj:
    -641            obj = SomeClass(**kw)
    -642        return obj
    +            
    625    def get_or_add(self, SomeClass, kw):
    +626        """ Get or add a class
    +627        
    +628        Parameters
    +629        ----------
    +630        SomeClass : object
    +631            A class object.
    +632        kw : dict
    +633            A dictionary of classes.
    +634        
    +635        Returns
    +636        -------
    +637        object
    +638            A class object.
    +639        """
    +640        obj = self.sql_db.session.query(SomeClass).filter_by(**kw).first()
    +641        if not obj:
    +642            obj = SomeClass(**kw)
    +643        return obj
     
    @@ -2663,56 +2845,56 @@
    Returns
    -
    645    def get_mol_formulas(self, odd_even_tag, classe_tuple, settings):
    -646        """ Get the molecular formulas
    -647        
    -648        Parameters
    -649        ----------
    -650        odd_even_tag : str
    -651            A string indicating whether to retrieve even or odd hydrogen atoms.
    -652        classe_tuple : tuple
    -653            
    -654        settings : object
    -655            An object containing user-defined settings.
    -656        
    -657        Returns
    -658        -------
    -659        list
    -660            A list of molecular formula data dictionaries.
    -661              
    -662        """
    -663        class_str = classe_tuple[0]
    -664        class_dict = classe_tuple[1]
    -665        classe_id = classe_tuple[2]
    -666        
    -667        results = list()
    -668        
    -669        if 'HC' in class_dict:
    -670            del class_dict['HC']
    -671            
    -672        class_dbe = self.calc_dbe_class(class_dict)    
    -673        class_mass = self.calc_mz(class_dict)
    -674        
    -675        carbonHydrogen_mass = self.odd_ch_mass if odd_even_tag == 'odd' else self.even_ch_mass 
    -676        carbonHydrogen_dbe = self.odd_ch_dbe if odd_even_tag == 'odd' else self.even_ch_dbe 
    -677        carbonHydrogen_id = self.odd_ch_id if odd_even_tag == 'odd' else self.even_ch_id 
    -678        
    -679        for index, carbonHydrogen_obj in enumerate(carbonHydrogen_id):
    -680            
    -681            mass = carbonHydrogen_mass[index] + class_mass
    -682            dbe =  carbonHydrogen_dbe[index] + class_dbe
    -683    
    -684            if settings.min_mz <= mass <= settings.max_mz:
    -685                
    -686                if settings.min_dbe <= dbe <= settings.max_dbe:
    -687                    
    -688                    molecularFormula=  {"heteroAtoms_id":classe_id, 
    -689                            "carbonHydrogen_id":carbonHydrogen_id[index], 
    -690                            "mass":mass, "DBE":dbe}
    -691                    
    -692                    results.append(molecularFormula)
    -693        
    -694        return results
    +            
    646    def get_mol_formulas(self, odd_even_tag, classe_tuple, settings):
    +647        """ Get the molecular formulas
    +648        
    +649        Parameters
    +650        ----------
    +651        odd_even_tag : str
    +652            A string indicating whether to retrieve even or odd hydrogen atoms.
    +653        classe_tuple : tuple
    +654            
    +655        settings : object
    +656            An object containing user-defined settings.
    +657        
    +658        Returns
    +659        -------
    +660        list
    +661            A list of molecular formula data dictionaries.
    +662              
    +663        """
    +664        class_str = classe_tuple[0]
    +665        class_dict = classe_tuple[1]
    +666        classe_id = classe_tuple[2]
    +667        
    +668        results = list()
    +669        
    +670        if 'HC' in class_dict:
    +671            del class_dict['HC']
    +672            
    +673        class_dbe = self.calc_dbe_class(class_dict)    
    +674        class_mass = self.calc_mz(class_dict)
    +675        
    +676        carbonHydrogen_mass = self.odd_ch_mass if odd_even_tag == 'odd' else self.even_ch_mass 
    +677        carbonHydrogen_dbe = self.odd_ch_dbe if odd_even_tag == 'odd' else self.even_ch_dbe 
    +678        carbonHydrogen_id = self.odd_ch_id if odd_even_tag == 'odd' else self.even_ch_id 
    +679        
    +680        for index, carbonHydrogen_obj in enumerate(carbonHydrogen_id):
    +681            
    +682            mass = carbonHydrogen_mass[index] + class_mass
    +683            dbe =  carbonHydrogen_dbe[index] + class_dbe
    +684    
    +685            if settings.min_mz <= mass <= settings.max_mz:
    +686                
    +687                if settings.min_dbe <= dbe <= settings.max_dbe:
    +688                    
    +689                    molecularFormula=  {"heteroAtoms_id":classe_id, 
    +690                            "carbonHydrogen_id":carbonHydrogen_id[index], 
    +691                            "mass":mass, "DBE":dbe}
    +692                    
    +693                    results.append(molecularFormula)
    +694        
    +695        return results
     
    @@ -2748,92 +2930,117 @@
    Returns
    -
    697    def get_h_odd_or_even(self, class_dict):
    -698        """ Get the hydrogen odd or even
    -699        
    -700        Parameters
    -701        ----------
    -702        class_dict : dict
    -703            A dictionary of classes.
    -704        
    -705        Returns
    -706        -------
    -707        str
    -708            A string indicating whether to retrieve even or odd hydrogen atoms.
    -709        """
    -710        
    -711        HAS_NITROGEN = 'N' in class_dict.keys()
    -712        HAS_PHOSPHORUS = 'P' in class_dict.keys()
    +            
    698    def get_h_odd_or_even(self, class_dict):
    +699        """ Get the hydrogen odd or even
    +700        
    +701        Parameters
    +702        ----------
    +703        class_dict : dict
    +704            A dictionary of classes.
    +705        
    +706        Returns
    +707        -------
    +708        str
    +709            A string indicating whether to retrieve even or odd hydrogen atoms.
    +710        """
    +711        
    +712        HAS_NITROGEN = 'N' in class_dict.keys()
     713
     714        number_of_halogen = self.get_total_halogen_atoms(class_dict)
    -715
    -716        if number_of_halogen > 0:
    -717
    -718            TEM_HALOGEN = True
    -719
    -720        else:
    -721
    -722            TEM_HALOGEN = False
    -723
    -724        if TEM_HALOGEN:
    -725
    -726            remaining_halogen = number_of_halogen % 2
    -727
    -728        else:
    -729
    -730            remaining_halogen = 0
    -731
    -732        if HAS_NITROGEN and HAS_PHOSPHORUS:
    +715        number_of_hetero = self.get_total_heteroatoms(class_dict)
    +716        
    +717        if number_of_halogen > 0:
    +718
    +719            HAS_HALOGEN = True
    +720
    +721        else:
    +722
    +723            HAS_HALOGEN = False
    +724
    +725        if HAS_HALOGEN:
    +726
    +727            remaining_halogen = number_of_halogen % 2
    +728
    +729        else:
    +730
    +731            remaining_halogen = 0
    +732
     733
    -734            number_of_n = class_dict.get('N') + class_dict.get('P')
    -735            remaining_n = number_of_n % 2
    -736
    -737        elif HAS_NITROGEN and not HAS_PHOSPHORUS:
    -738
    -739            number_of_n = class_dict.get('N')
    -740            remaining_n = number_of_n % 2
    +734        if number_of_hetero > 0:
    +735
    +736            HAS_OTHER_HETERO = True
    +737
    +738            total_hetero_valence = self.get_total_hetero_valence(class_dict)
    +739        
    +740        else: 
     741
    -742        elif HAS_PHOSPHORUS and not HAS_NITROGEN:
    +742            HAS_OTHER_HETERO = False
     743
    -744            number_of_n = class_dict.get('P')
    -745            remaining_n = number_of_n % 2
    -746
    -747        else:
    -748
    -749            remaining_n = -1
    -750
    -751        if remaining_n > 0.0:
    -752            if HAS_NITROGEN or HAS_PHOSPHORUS:
    +744            total_hetero_valence = 0
    +745
    +746        if HAS_OTHER_HETERO:
    +747
    +748            remaining_hetero_valence = total_hetero_valence % 2
    +749
    +750        else:
    +751
    +752            remaining_hetero_valence = 0
     753
    -754                if TEM_HALOGEN:
    -755                    if remaining_halogen == 0:
    -756                        return 'odd'
    -757                    else:
    -758                        return 'even'
    -759                else:
    -760                    return 'odd'
    +754            
    +755        if HAS_NITROGEN and not HAS_OTHER_HETERO:
    +756
    +757            number_of_n = class_dict.get('N')
    +758            remaining_n = number_of_n % 2
    +759
    +760        elif HAS_NITROGEN and HAS_OTHER_HETERO:
     761
    -762        elif remaining_n == 0.0:
    -763
    -764            if HAS_NITROGEN or HAS_PHOSPHORUS:
    -765
    -766                if TEM_HALOGEN:
    -767                    if remaining_halogen == 0:
    -768                        return 'even'
    -769                    else:
    -770                        return 'odd'
    -771                else:
    -772                    return 'even'
    -773
    -774        else:
    -775
    -776            if TEM_HALOGEN:
    -777                if remaining_halogen == 0:
    -778                    return 'even'
    -779                else:
    -780                    return 'odd'
    -781            else:
    -782                return 'even'
    +762            number_of_n = class_dict.get('N') 
    +763            remaining_n = (number_of_n + remaining_hetero_valence )% 2 
    +764
    +765        elif HAS_OTHER_HETERO and not HAS_NITROGEN:
    +766
    +767            remaining_n = remaining_hetero_valence
    +768
    +769        else:
    +770
    +771            remaining_n = -1
    +772
    +773        if remaining_n > 0.0:
    +774
    +775            if HAS_NITROGEN or HAS_OTHER_HETERO:
    +776
    +777                if HAS_HALOGEN:
    +778                    if remaining_halogen == 0:
    +779                        return 'odd'
    +780                    else:
    +781                        return 'even'
    +782                
    +783                else:
    +784                    return 'odd'
    +785
    +786        elif remaining_n == 0.0:
    +787
    +788            if HAS_NITROGEN or HAS_OTHER_HETERO:
    +789
    +790                if HAS_HALOGEN:
    +791                    if remaining_halogen == 0:
    +792                        return 'even'
    +793                    else:
    +794                        return 'odd'
    +795                
    +796                else:
    +797                    return 'even'
    +798                
    +799        else:
    +800
    +801            if HAS_HALOGEN:
    +802                if remaining_halogen == 0:
    +803                    return 'even'
    +804                else:
    +805                    return 'odd'
    +806            
    +807            else:
    +808                return 'even'
     
    @@ -2854,6 +3061,129 @@
    Returns
    + +
    + +
    +
    @staticmethod
    + + def + get_total_heteroatoms(class_dict): + + + +
    + +
    812    @staticmethod
    +813    def get_total_heteroatoms(class_dict):
    +814        """ Get the total number of heteroatoms other than N, F, Cl, Br
    +815        
    +816        Parameters
    +817        ----------
    +818        class_dict : dict
    +819            A dictionary of classes.
    +820        
    +821        Returns
    +822        -------
    +823        int
    +824            The total number of heteroatoms.
    +825        """
    +826
    +827        total_number = 0
    +828        
    +829        for atom in class_dict.keys():
    +830
    +831            if atom not in ['HC','C','H','O','N', 'F', 'Cl', 'Br']:
    +832                total_number = total_number + class_dict.get(atom)
    +833        
    +834        return total_number                
    +
    + + +

    Get the total number of heteroatoms other than N, F, Cl, Br

    + +
    Parameters
    + +
      +
    • class_dict (dict): +A dictionary of classes.
    • +
    + +
    Returns
    + +
      +
    • int: The total number of heteroatoms.
    • +
    +
    + + +
    +
    + +
    +
    @staticmethod
    + + def + get_total_hetero_valence(class_dict): + + + +
    + +
    836    @staticmethod
    +837    def get_total_hetero_valence(class_dict):
    +838        """ Get the total valence of heteroatoms other than N, F, Cl, Br
    +839        
    +840        Parameters
    +841        ----------
    +842        class_dict : dict
    +843            A dictionary of classes.
    +844        
    +845        Returns
    +846        -------
    +847        int
    +848            The total heteroatom valence.
    +849        """
    +850        total_valence = 0
    +851        
    +852        for atom in class_dict.keys():
    +853
    +854            if atom not in ['HC','C','H','O','N', 'F', 'Cl', 'Br']:
    +855
    +856                clean_atom = ''.join([i for i in atom if not i.isdigit()]) 
    +857
    +858                atom_valence = MSParameters.molecular_search.used_atom_valences.get(clean_atom)
    +859
    +860                if type(atom_valence) is tuple:
    +861                    atom_valence = atom_valence[0]
    +862
    +863                n_atom =int(class_dict.get(atom))
    +864
    +865                n_atom_valence = atom_valence * n_atom
    +866                
    +867                total_valence = total_valence + n_atom_valence
    +868
    +869        return total_valence  
    +
    + + +

    Get the total valence of heteroatoms other than N, F, Cl, Br

    + +
    Parameters
    + +
      +
    • class_dict (dict): +A dictionary of classes.
    • +
    + +
    Returns
    + +
      +
    • int: The total heteroatom valence.
    • +
    +
    + +
    @@ -2867,31 +3197,31 @@
    Returns
    -
    784    @staticmethod
    -785    def get_total_halogen_atoms(class_dict):
    -786        """ Get the total number of halogen atoms
    -787        
    -788        Parameters
    -789        ----------
    -790        class_dict : dict
    -791            A dictionary of classes.
    -792        
    -793        Returns
    -794        -------
    -795        int
    -796            The total number of halogen atoms.
    -797        """
    -798        atoms = ['F', 'Cl', 'Br', 'I']
    -799
    -800        total_number = 0
    -801        
    -802        for atom in atoms:
    -803
    -804            if atom in class_dict.keys():
    -805
    -806                total_number = total_number + class_dict.get(atom)
    -807        
    -808        return total_number    
    +            
    871    @staticmethod
    +872    def get_total_halogen_atoms(class_dict):
    +873        """ Get the total number of halogen atoms
    +874        
    +875        Parameters
    +876        ----------
    +877        class_dict : dict
    +878            A dictionary of classes.
    +879        
    +880        Returns
    +881        -------
    +882        int
    +883            The total number of halogen atoms.
    +884        """
    +885        atoms = ['F', 'Cl', 'Br']
    +886
    +887        total_number = 0
    +888        
    +889        for atom in atoms:
    +890
    +891            if atom in class_dict.keys():
    +892
    +893                total_number = total_number + class_dict.get(atom)
    +894        
    +895        return total_number    
     
    diff --git a/docs/corems/molecular_id/factory/molecularSQL.html b/docs/corems/molecular_id/factory/molecularSQL.html index d8949d57..e5ae4926 100644 --- a/docs/corems/molecular_id/factory/molecularSQL.html +++ b/docs/corems/molecular_id/factory/molecularSQL.html @@ -226,768 +226,772 @@

    2sys.path.append(".") 3import os 4 - 5from sqlalchemy import create_engine, ForeignKey, Column, Integer, String, Float, SMALLINT + 5from sqlalchemy import Numeric, create_engine, ForeignKey, Column, Integer, String, Float, func 6from sqlalchemy.orm import backref, column_property, relationship 7from sqlalchemy.ext.associationproxy import association_proxy 8from sqlalchemy.sql.schema import UniqueConstraint 9from sqlalchemy import exc 10 - 11from sqlalchemy.ext.declarative import declarative_base, declared_attr - 12from sqlalchemy.ext.hybrid import hybrid_property, hybrid_method - 13from sqlalchemy.exc import SQLAlchemyError - 14from sqlalchemy.orm.session import sessionmaker - 15from sqlalchemy.sql.operators import exists - 16from sqlalchemy import event, and_ - 17from sqlalchemy import func - 18 - 19from corems.encapsulation.constant import Atoms, Labels - 20import json - 21from corems.encapsulation.factory.processingSetting import MolecularFormulaSearchSettings - 22from sqlalchemy.orm.scoping import scoped_session - 23from corems import chunks - 24import tqdm - 25 - 26Base = declarative_base() - 27 - 28class HeteroAtoms(Base): - 29 """ HeteroAtoms class for the heteroAtoms table in the SQLite database. - 30 - 31 Attributes - 32 ---------- - 33 id : int - 34 The primary key for the table. - 35 name : str - 36 The name of the heteroAtoms class. - 37 halogensCount : int - 38 The number of halogens in the heteroAtoms class. - 39 carbonHydrogen : relationship - 40 The relationship to the carbonHydrogen table. - 41 - 42 Methods - 43 ------- - 44 * __repr__() - 45 Returns the string representation of the object. - 46 * to_dict() - 47 Returns the heteroAtoms class as a dictionary. - 48 * halogens_count() - 49 Returns the number of halogens as a float. - 50 - 51 - 52 """ - 53 __tablename__ = 'heteroAtoms' - 54 - 55 id = Column(Integer, primary_key=True, - 56 unique = True, - 57 nullable = False) - 58 - 59 name = Column(String, unique=True, nullable=False) - 60 - 61 halogensCount = Column(Integer, unique=False, nullable=False) - 62 - 63 carbonHydrogen = relationship('CarbonHydrogen', secondary='molecularformula', viewonly=True) - 64 - 65 def __repr__(self): - 66 return '<HeteroAtoms Model {} class {}>'.format(self.id, self.name) - 67 - 68 @hybrid_property - 69 def halogens_count(cls): - 70 """ Returns the number of halogens as a float.""" - 71 return cls.halogensCount.cast(Float) - 72 - 73 def to_dict(self): - 74 """ Returns the heteroAtoms class as a dictionary.""" - 75 return json.loads(self.name) - 76 + 11 + 12from sqlalchemy.ext.declarative import declarative_base, declared_attr + 13from sqlalchemy.ext.hybrid import hybrid_property, hybrid_method + 14from sqlalchemy.exc import SQLAlchemyError + 15from sqlalchemy.orm.session import sessionmaker + 16from sqlalchemy.sql.operators import exists + 17from sqlalchemy import event, and_ + 18from sqlalchemy import func + 19 + 20from corems.encapsulation.constant import Atoms, Labels + 21import json + 22from corems.encapsulation.factory.processingSetting import MolecularFormulaSearchSettings + 23from sqlalchemy.orm.scoping import scoped_session + 24from corems import chunks + 25import tqdm + 26 + 27Base = declarative_base() + 28 + 29class HeteroAtoms(Base): + 30 """ HeteroAtoms class for the heteroAtoms table in the SQLite database. + 31 + 32 Attributes + 33 ---------- + 34 id : int + 35 The primary key for the table. + 36 name : str + 37 The name of the heteroAtoms class. + 38 halogensCount : int + 39 The number of halogens in the heteroAtoms class. + 40 carbonHydrogen : relationship + 41 The relationship to the carbonHydrogen table. + 42 + 43 Methods + 44 ------- + 45 * __repr__() + 46 Returns the string representation of the object. + 47 * to_dict() + 48 Returns the heteroAtoms class as a dictionary. + 49 * halogens_count() + 50 Returns the number of halogens as a float. + 51 + 52 + 53 """ + 54 __tablename__ = 'heteroAtoms' + 55 + 56 id = Column(Integer, primary_key=True, + 57 unique = True, + 58 nullable = False) + 59 + 60 name = Column(String, unique=True, nullable=False) + 61 + 62 halogensCount = Column(Integer, unique=False, nullable=False) + 63 + 64 carbonHydrogen = relationship('CarbonHydrogen', secondary='molecularformula', viewonly=True) + 65 + 66 def __repr__(self): + 67 return '<HeteroAtoms Model {} class {}>'.format(self.id, self.name) + 68 + 69 @hybrid_property + 70 def halogens_count(cls): + 71 """ Returns the number of halogens as a float.""" + 72 return cls.halogensCount.cast(Float) + 73 + 74 def to_dict(self): + 75 """ Returns the heteroAtoms class as a dictionary.""" + 76 return json.loads(self.name) 77 - 78class CarbonHydrogen(Base): - 79 """ CarbonHydrogen class for the carbonHydrogen table in the SQLite database. - 80 - 81 Attributes - 82 ---------- - 83 id : int - 84 The primary key for the table. - 85 C : int - 86 The number of carbon atoms. - 87 H : int - 88 The number of hydrogen atoms. - 89 heteroAtoms : relationship - 90 The relationship to the heteroAtoms table. - 91 - 92 Methods - 93 ------- - 94 * __repr__() - 95 Returns the string representation of the object. - 96 * mass() - 97 Returns the mass of the carbonHydrogen class as a float. - 98 * c() - 99 Returns the number of carbon atoms as a float. -100 * h() -101 Returns the number of hydrogen atoms as a float. -102 * dbe() -103 Returns the double bond equivalent as a float. -104 -105 """ -106 -107 __tablename__ = 'carbonHydrogen' -108 __table_args__ = (UniqueConstraint('C', 'H', name='unique_c_h'), ) -109 -110 id = Column(Integer, primary_key=True, -111 unique=True, -112 nullable=False) -113 -114 C = Column(Integer, nullable=False) -115 -116 H = Column(Integer, nullable=False) -117 -118 heteroAtoms = relationship("HeteroAtoms", -119 secondary="molecularformula", -120 viewonly=True -121 ) -122 -123 def __repr__(self): -124 """ Returns the string representation of the object.""" -125 return '<CarbonHydrogen Model {} C{} H{}>'.format(self.id, self.C, self.H) -126 -127 @property -128 def mass(self): -129 """ Returns the mass of the carbonHydrogen class as a float.""" -130 return (self.C * Atoms.atomic_masses.get('C')) + (self.H * Atoms.atomic_masses.get('H')) -131 -132 @hybrid_property -133 def c(cls): -134 """ Returns the number of carbon atoms as a float.""" -135 return cls.C.cast(Float) -136 -137 @hybrid_property -138 def h(cls): -139 """ Returns the number of hydrogen atoms as a float.""" -140 return cls.H.cast(Float) -141 -142 @hybrid_property -143 def dbe(cls): -144 """ Returns the double bond equivalent as a float.""" -145 # return cls.C.cast(Float) - (cls.H.cast(Float) / 2) + 1 -146 return float(cls.C) - float(cls.H / 2) + 1 -147 -148# 264888.88 ms -149class MolecularFormulaLink(Base): -150 """ MolecularFormulaLink class for the molecularformula table in the SQLite database. -151 -152 Attributes -153 ---------- -154 heteroAtoms_id : int -155 The foreign key for the heteroAtoms table. -156 carbonHydrogen_id : int -157 The foreign key for the carbonHydrogen table. -158 mass : float -159 The mass of the molecular formula. -160 DBE : float -161 The double bond equivalent of the molecular formula. -162 carbonHydrogen : relationship -163 The relationship to the carbonHydrogen table. -164 heteroAtoms : relationship -165 The relationship to the heteroAtoms table. -166 C : association_proxy -167 The association proxy for the carbonHydrogen table. -168 H : association_proxy -169 The association proxy for the carbonHydrogen table. -170 classe : association_proxy -171 The association proxy for the heteroAtoms table. -172 -173 Methods -174 ------- -175 * __repr__() -176 Returns the string representation of the object. -177 * to_dict() -178 Returns the molecular formula as a dictionary. -179 * formula_string() -180 Returns the molecular formula as a string. -181 * classe_string() -182 Returns the heteroAtoms class as a string. -183 * _adduct_mz(ion_charge, adduct_atom) -184 Returns the m/z of the adduct ion as a float. -185 * _protonated_mz(ion_charge) -186 Returns the m/z of the protonated ion as a float. -187 * _radical_mz(ion_charge) -188 Returns the m/z of the radical ion as a float. -189 -190 + 78 + 79class CarbonHydrogen(Base): + 80 """ CarbonHydrogen class for the carbonHydrogen table in the SQLite database. + 81 + 82 Attributes + 83 ---------- + 84 id : int + 85 The primary key for the table. + 86 C : int + 87 The number of carbon atoms. + 88 H : int + 89 The number of hydrogen atoms. + 90 heteroAtoms : relationship + 91 The relationship to the heteroAtoms table. + 92 + 93 Methods + 94 ------- + 95 * __repr__() + 96 Returns the string representation of the object. + 97 * mass() + 98 Returns the mass of the carbonHydrogen class as a float. + 99 * c() +100 Returns the number of carbon atoms as a float. +101 * h() +102 Returns the number of hydrogen atoms as a float. +103 * dbe() +104 Returns the double bond equivalent as a float. +105 +106 """ +107 +108 __tablename__ = 'carbonHydrogen' +109 __table_args__ = (UniqueConstraint('C', 'H', name='unique_c_h'), ) +110 +111 id = Column(Integer, primary_key=True, +112 unique=True, +113 nullable=False) +114 +115 C = Column(Integer, nullable=False) +116 +117 H = Column(Integer, nullable=False) +118 +119 heteroAtoms = relationship("HeteroAtoms", +120 secondary="molecularformula", +121 viewonly=True +122 ) +123 +124 def __repr__(self): +125 """ Returns the string representation of the object.""" +126 return '<CarbonHydrogen Model {} C{} H{}>'.format(self.id, self.C, self.H) +127 +128 @property +129 def mass(self): +130 """ Returns the mass of the carbonHydrogen class as a float.""" +131 return (self.C * Atoms.atomic_masses.get('C')) + (self.H * Atoms.atomic_masses.get('H')) +132 +133 @hybrid_property +134 def c(cls): +135 """ Returns the number of carbon atoms as a float.""" +136 return cls.C.cast(Float) +137 +138 @hybrid_property +139 def h(cls): +140 """ Returns the number of hydrogen atoms as a float.""" +141 return cls.H.cast(Float) +142 +143 @hybrid_property +144 def dbe(cls): +145 """ Returns the double bond equivalent as a float.""" +146 # return cls.C.cast(Float) - (cls.H.cast(Float) / 2) + 1 +147 return float(cls.C) - float(cls.H / 2) + 1 +148 +149# 264888.88 ms +150class MolecularFormulaLink(Base): +151 """ MolecularFormulaLink class for the molecularformula table in the SQLite database. +152 +153 Attributes +154 ---------- +155 heteroAtoms_id : int +156 The foreign key for the heteroAtoms table. +157 carbonHydrogen_id : int +158 The foreign key for the carbonHydrogen table. +159 mass : float +160 The mass of the molecular formula. +161 DBE : float +162 The double bond equivalent of the molecular formula. +163 carbonHydrogen : relationship +164 The relationship to the carbonHydrogen table. +165 heteroAtoms : relationship +166 The relationship to the heteroAtoms table. +167 C : association_proxy +168 The association proxy for the carbonHydrogen table. +169 H : association_proxy +170 The association proxy for the carbonHydrogen table. +171 classe : association_proxy +172 The association proxy for the heteroAtoms table. +173 +174 Methods +175 ------- +176 * __repr__() +177 Returns the string representation of the object. +178 * to_dict() +179 Returns the molecular formula as a dictionary. +180 * formula_string() +181 Returns the molecular formula as a string. +182 * classe_string() +183 Returns the heteroAtoms class as a string. +184 * _adduct_mz(ion_charge, adduct_atom) +185 Returns the m/z of the adduct ion as a float. +186 * _protonated_mz(ion_charge) +187 Returns the m/z of the protonated ion as a float. +188 * _radical_mz(ion_charge) +189 Returns the m/z of the radical ion as a float. +190 191 -192 """ -193 __tablename__ = 'molecularformula' -194 __table_args__ = (UniqueConstraint('heteroAtoms_id', 'carbonHydrogen_id', name='unique_molform'), ) -195 -196 # id = Column(Integer, primary_key=True, -197 # unique=True, -198 # nullable=False) -199 -200 heteroAtoms_id = Column(Integer, -201 ForeignKey('heteroAtoms.id'), -202 primary_key=True) -203 -204 carbonHydrogen_id = Column(Integer, -205 ForeignKey('carbonHydrogen.id'), -206 primary_key=True) -207 -208 mass = Column(Float) -209 -210 DBE = Column(Float) -211 -212 carbonHydrogen = relationship(CarbonHydrogen, backref=backref("heteroAtoms_assoc")) -213 -214 heteroAtoms = relationship(HeteroAtoms, backref=backref("carbonHydrogen_assoc")) -215 -216 C = association_proxy('carbonHydrogen', 'C') -217 -218 H = association_proxy('carbonHydrogen', 'H') -219 -220 classe = association_proxy('heteroAtoms', 'name') -221 -222 def to_dict(self): -223 """ Returns the molecular formula as a dictionary. -224 -225 Returns -226 ------- -227 dict -228 The molecular formula as a dictionary. -229 """ -230 carbon = {'C': self.C, 'H': self.H} -231 classe = json.loads(self.classe) -232 if self.classe == '{"HC": ""}': -233 return {**carbon} -234 else: -235 return {**carbon, **classe} -236 -237 @property -238 def formula_string(self): -239 """ Returns the molecular formula as a string.""" -240 class_dict = self.to_dict() -241 class_str = ' '.join([atom + str(class_dict[atom]) for atom in class_dict.keys()]) -242 return class_str.strip() -243 -244 @property -245 def classe_string(self): -246 """ Returns the heteroAtoms class as a string.""" -247 class_dict = json.loads(self.classe) -248 class_str = ' '.join([atom + str(class_dict[atom]) for atom in class_dict.keys()]) -249 return class_str.strip() -250 -251 @hybrid_method -252 def _adduct_mz(self, ion_charge, adduct_atom): -253 """ Returns the m/z of the adduct ion as a float.""" -254 return (self.mass + (Atoms.atomic_masses.get(adduct_atom)) + (ion_charge * -1 * Atoms.electron_mass))/ abs(ion_charge) -255 -256 @hybrid_method -257 def _protonated_mz(self, ion_charge): -258 """ Returns the m/z of the protonated ion as a float.""" -259 return (self.mass + (ion_charge * Atoms.atomic_masses.get("H")) + (ion_charge * -1 * Atoms.electron_mass))/abs(ion_charge) -260 -261 @hybrid_method -262 def _radical_mz(self, ion_charge): -263 """ Returns the m/z of the radical ion as a float.""" -264 return (self.mass + (ion_charge * -1 * Atoms.electron_mass))/ abs(ion_charge) -265 -266 def __repr__(self): -267 """ Returns the string representation of the object.""" -268 return '<MolecularFormulaLink Model {}>'.format(self.formula_string) -269 +192 +193 """ +194 __tablename__ = 'molecularformula' +195 __table_args__ = (UniqueConstraint('heteroAtoms_id', 'carbonHydrogen_id', name='unique_molform'), ) +196 +197 # id = Column(Integer, primary_key=True, +198 # unique=True, +199 # nullable=False) +200 +201 heteroAtoms_id = Column(Integer, +202 ForeignKey('heteroAtoms.id'), +203 primary_key=True) +204 +205 carbonHydrogen_id = Column(Integer, +206 ForeignKey('carbonHydrogen.id'), +207 primary_key=True) +208 +209 mass = Column(Float) +210 +211 DBE = Column(Float) +212 +213 carbonHydrogen = relationship(CarbonHydrogen, backref=backref("heteroAtoms_assoc")) +214 +215 heteroAtoms = relationship(HeteroAtoms, backref=backref("carbonHydrogen_assoc")) +216 +217 C = association_proxy('carbonHydrogen', 'C') +218 +219 H = association_proxy('carbonHydrogen', 'H') +220 +221 classe = association_proxy('heteroAtoms', 'name') +222 +223 def to_dict(self): +224 """ Returns the molecular formula as a dictionary. +225 +226 Returns +227 ------- +228 dict +229 The molecular formula as a dictionary. +230 """ +231 carbon = {'C': self.C, 'H': self.H} +232 classe = json.loads(self.classe) +233 if self.classe == '{"HC": ""}': +234 return {**carbon} +235 else: +236 return {**carbon, **classe} +237 +238 @property +239 def formula_string(self): +240 """ Returns the molecular formula as a string.""" +241 class_dict = self.to_dict() +242 class_str = ' '.join([atom + str(class_dict[atom]) for atom in class_dict.keys()]) +243 return class_str.strip() +244 +245 @property +246 def classe_string(self): +247 """ Returns the heteroAtoms class as a string.""" +248 class_dict = json.loads(self.classe) +249 class_str = ' '.join([atom + str(class_dict[atom]) for atom in class_dict.keys()]) +250 return class_str.strip() +251 +252 @hybrid_method +253 def _adduct_mz(self, ion_charge, adduct_atom): +254 """ Returns the m/z of the adduct ion as a float.""" +255 return (self.mass + (Atoms.atomic_masses.get(adduct_atom)) + (ion_charge * -1 * Atoms.electron_mass))/ abs(ion_charge) +256 +257 @hybrid_method +258 def _protonated_mz(self, ion_charge): +259 """ Returns the m/z of the protonated ion as a float.""" +260 return (self.mass + (ion_charge * Atoms.atomic_masses.get("H")) + (ion_charge * -1 * Atoms.electron_mass))/abs(ion_charge) +261 +262 @hybrid_method +263 def _radical_mz(self, ion_charge): +264 """ Returns the m/z of the radical ion as a float.""" +265 return (self.mass + (ion_charge * -1 * Atoms.electron_mass))/ abs(ion_charge) +266 +267 def __repr__(self): +268 """ Returns the string representation of the object.""" +269 return '<MolecularFormulaLink Model {}>'.format(self.formula_string) 270 -271class MolForm_SQL: -272 """ MolForm_SQL class for the SQLite database. -273 -274 Attributes -275 ---------- -276 engine : sqlalchemy.engine.base.Engine -277 The SQLAlchemy engine. -278 session : sqlalchemy.orm.session.Session -279 The SQLAlchemy session. -280 type : str -281 The type of database. -282 chunks_count : int -283 The number of chunks to use when querying the database. -284 -285 Methods -286 ------- -287 * __init__(url=None, echo=False) -288 Initializes the database. -289 * __exit__(exc_type, exc_val, exc_tb) -290 Closes the database. -291 * initiate_database(url, database_name) -292 Creates the database. -293 * commit() -294 Commits the session. -295 * init_engine(url) -296 Initializes the SQLAlchemy engine. -297 * __enter__() -298 -299 * get_dict_by_classes(classes, ion_type, nominal_mzs, ion_charge, molecular_search_settings, adducts=None) -300 Returns a dictionary of molecular formulas. -301 * check_entry(classe, ion_type, molecular_search_settings) -302 Checks if a molecular formula is in the database. -303 * get_all_classes() -304 Returns a list of all classes in the database. -305 * get_all() -306 Returns a list of all molecular formulas in the database. -307 * delete_entry(row) -308 Deletes a molecular formula from the database. -309 * purge(cls) -310 Deletes all molecular formulas from the database. -311 * clear_data() -312 Clears the database. -313 * close(commit=True) -314 Closes the database. -315 * add_engine_pidguard(engine) -316 Adds multiprocessing guards. -317 -318 """ -319 def __init__(self, url=None, echo=False): -320 -321 self.engine = self.init_engine(url) -322 -323 self.add_engine_pidguard(self.engine) -324 -325 session_factory = sessionmaker(bind=self.engine) -326 -327 Session = scoped_session(session_factory) -328 -329 self.session = session_factory() -330 -331 Base.metadata.create_all(self.engine) -332 -333 self.session.commit() -334 -335 def __exit__(self, exc_type, exc_val, exc_tb): -336 """ Closes the database. -337 -338 Parameters -339 ---------- -340 exc_type : str -341 The exception type. -342 exc_val : str -343 The exception value. -344 exc_tb : str -345 The exception traceback. -346 """ -347 # make sure the dbconnection gets closed -348 -349 self.commit() -350 self.session.close() -351 self.engine.dispose() -352 -353 def initiate_database(self, url, database_name): #CREATION -354 """ Creates the database. -355 -356 Parameters -357 ---------- -358 url : str -359 The URL for the database. -360 database_name : str -361 The name of the database. -362 """ -363 engine = create_engine(url) -364 conn = engine.connect() -365 conn.execute("commit") -366 conn.execute("create database " + database_name) -367 conn.close() -368 -369 def commit(self): -370 """ Commits the session. -371 """ -372 try: -373 self.session.commit() -374 except SQLAlchemyError as e: -375 self.session.rollback() -376 print(str(e)) -377 -378 def init_engine(self, url): -379 """ Initializes the SQLAlchemy engine. -380 -381 Parameters -382 ---------- -383 url : str -384 The URL for the database. -385 -386 Returns -387 ------- -388 sqlalchemy.engine.base.Engine -389 The SQLAlchemy engine. -390 -391 """ -392 if not url or url == 'None' or url == 'False': -393 directory = os.getcwd() -394 -395 if not os.path.isdir(directory + '/db'): -396 os.mkdir(directory + '/db') -397 -398 url = 'sqlite:///{DB}/db/molformulas.sqlite'.format(DB=directory) -399 -400 if url[0:6] == 'sqlite': -401 self.type = 'sqlite' -402 else: -403 self.type = 'normal' -404 -405 if url[0:6] == 'sqlite': -406 engine = create_engine(url, echo = False) -407 self.chunks_count = 50 -408 -409 elif url[0:10] == 'postgresql' or url[0:8] == 'postgres': -410 #postgresql -411 self.chunks_count = 50000 -412 engine = create_engine(url, echo = False, isolation_level="AUTOCOMMIT") -413 -414 return engine# poolclass=NullPool -415 -416 def __enter__(self): -417 """ Returns the object. -418 """ -419 return self -420 -421 def get_dict_by_classes(self, classes, ion_type, nominal_mzs, ion_charge, molecular_search_settings, adducts=None): -422 """ Returns a dictionary of molecular formulas. -423 -424 Parameters -425 ---------- -426 classes : list -427 The list of classes. -428 ion_type : str -429 The ion type. -430 nominal_mzs : list -431 The list of nominal m/z values. -432 ion_charge : int -433 The ion charge. -434 molecular_search_settings : MolecularFormulaSearchSettings -435 The molecular formula search settings. -436 adducts : list, optional -437 The list of adducts. Default is None. -438 -439 Returns -440 ------- -441 dict -442 The dictionary of molecular formulas. -443 -444 Notes -445 ----- -446 Known issue, when using SQLite: -447 if the number of classes and nominal_m/zs are higher than 999 the query will fail -448 Solution: use postgres or split query -449 """ -450 -451 def query_normal(class_list, len_adduct): -452 """ query for normal database -453 -454 Parameters -455 ---------- -456 class_list : list -457 The list of classes. -458 len_adduct : int -459 The length of the adduct. -460 -461 Returns -462 ------- -463 sqlalchemy.orm.query.Query -464 The query. -465 """ -466 base_query = self.session.query(MolecularFormulaLink, CarbonHydrogen, HeteroAtoms)\ -467 .filter(MolecularFormulaLink.carbonHydrogen_id == CarbonHydrogen.id)\ -468 .filter(MolecularFormulaLink.heteroAtoms_id == HeteroAtoms.id) -469 -470 return base_query.filter( -471 and_( -472 HeteroAtoms.name.in_(class_list), -473 and_( -474 MolecularFormulaLink.DBE >= molecular_search_settings.min_dbe, -475 MolecularFormulaLink.DBE <= molecular_search_settings.max_dbe, -476 and_( -477 ((CarbonHydrogen.h + HeteroAtoms.halogens_count - len_adduct) / CarbonHydrogen.c) >= molecular_search_settings.min_hc_filter, -478 ((CarbonHydrogen.h + HeteroAtoms.halogens_count - len_adduct) / CarbonHydrogen.c) <= molecular_search_settings.max_hc_filter, -479 CarbonHydrogen.C >= molecular_search_settings.usedAtoms.get("C")[0], -480 CarbonHydrogen.c <= molecular_search_settings.usedAtoms.get("C")[1], -481 CarbonHydrogen.h >= molecular_search_settings.usedAtoms.get("H")[0], -482 CarbonHydrogen.h <= molecular_search_settings.usedAtoms.get("H")[1], -483 ) -484 ) -485 ) -486 ) -487 -488 def add_dict_formula(formulas, ion_type, ion_charge, adduct_atom=None): -489 """ add molecular formula to dict -490 -491 Parameters -492 ---------- -493 formulas : sqlalchemy.orm.query.Query -494 The query. -495 ion_type : str -496 The ion type. -497 ion_charge : int -498 The ion charge. -499 adduct_atom : str, optional -500 The adduct atom. Default is None. -501 -502 Returns -503 ------- -504 dict -505 The dictionary of molecular formulas. -506 -507 """ -508 "organize data by heteroatom classes" -509 dict_res = {} -510 -511 def nominal_mass_by_ion_type(formula_obj): -512 -513 if ion_type == Labels.protonated_de_ion: -514 -515 return int(formula_obj._protonated_mz(ion_charge)) -516 -517 elif ion_type == Labels.radical_ion: -518 -519 return int(formula_obj._radical_mz(ion_charge)) -520 -521 elif ion_type == Labels.adduct_ion and adduct_atom: -522 -523 return int(formula_obj._adduct_mz(ion_charge, adduct_atom)) -524 -525 for formula_obj, ch_obj, classe_obj in tqdm.tqdm(formulas, desc="Loading molecular formula database"): -526 -527 nominal_mz = nominal_mass_by_ion_type(formula_obj) -528 -529 if self.type != 'normal': -530 if not nominal_mz in nominal_mzs: -531 continue -532 classe = classe_obj.name -533 -534 # classe_str = formula.classe_string -535 -536 # pbar.set_description_str(desc="Loading molecular formula database for class %s " % classe_str) -537 -538 formula_dict = formula_obj.to_dict() -539 -540 if formula_dict.get("O"): -541 -542 if formula_dict.get("O") / formula_dict.get("C") >= molecular_search_settings.max_oc_filter: -543 # print(formula_dict.get("O") / formula_dict.get("C"), molecular_search_settings.max_oc_filter) -544 continue -545 elif formula_dict.get("O") / formula_dict.get("C") <= molecular_search_settings.min_oc_filter: -546 # print(formula_dict.get("O") / formula_dict.get("C"), molecular_search_settings.min_oc_filter) -547 continue -548 #if formula_dict.get("P"): -549 -550 # if not (formula_dict.get("O") -2)/ formula_dict.get("P") >= molecular_search_settings.min_op_filter: -551 -552 # continue -553 -554 if classe in dict_res.keys(): -555 -556 if nominal_mz in dict_res[classe].keys(): -557 -558 dict_res.get(classe).get(nominal_mz).append(formula_obj) -559 -560 else: -561 -562 dict_res.get(classe)[nominal_mz] = [formula_obj ] -563 -564 else: -565 -566 dict_res[classe] = {nominal_mz: [formula_obj] } -567 -568 return dict_res -569 +271 +272class MolForm_SQL: +273 """ MolForm_SQL class for the SQLite database. +274 +275 Attributes +276 ---------- +277 engine : sqlalchemy.engine.base.Engine +278 The SQLAlchemy engine. +279 session : sqlalchemy.orm.session.Session +280 The SQLAlchemy session. +281 type : str +282 The type of database. +283 chunks_count : int +284 The number of chunks to use when querying the database. +285 +286 Methods +287 ------- +288 * __init__(url=None, echo=False) +289 Initializes the database. +290 * __exit__(exc_type, exc_val, exc_tb) +291 Closes the database. +292 * initiate_database(url, database_name) +293 Creates the database. +294 * commit() +295 Commits the session. +296 * init_engine(url) +297 Initializes the SQLAlchemy engine. +298 * __enter__() +299 +300 * get_dict_by_classes(classes, ion_type, nominal_mzs, ion_charge, molecular_search_settings, adducts=None) +301 Returns a dictionary of molecular formulas. +302 * check_entry(classe, ion_type, molecular_search_settings) +303 Checks if a molecular formula is in the database. +304 * get_all_classes() +305 Returns a list of all classes in the database. +306 * get_all() +307 Returns a list of all molecular formulas in the database. +308 * delete_entry(row) +309 Deletes a molecular formula from the database. +310 * purge(cls) +311 Deletes all molecular formulas from the database. +312 * clear_data() +313 Clears the database. +314 * close(commit=True) +315 Closes the database. +316 * add_engine_pidguard(engine) +317 Adds multiprocessing guards. +318 +319 """ +320 def __init__(self, url=None, echo=False): +321 +322 self.engine = self.init_engine(url) +323 +324 self.add_engine_pidguard(self.engine) +325 +326 session_factory = sessionmaker(bind=self.engine) +327 +328 Session = scoped_session(session_factory) +329 +330 self.session = session_factory() +331 +332 Base.metadata.create_all(self.engine) +333 +334 self.session.commit() +335 +336 def __exit__(self, exc_type, exc_val, exc_tb): +337 """ Closes the database. +338 +339 Parameters +340 ---------- +341 exc_type : str +342 The exception type. +343 exc_val : str +344 The exception value. +345 exc_tb : str +346 The exception traceback. +347 """ +348 # make sure the dbconnection gets closed +349 +350 self.commit() +351 self.session.close() +352 self.engine.dispose() +353 +354 def initiate_database(self, url, database_name): #CREATION +355 """ Creates the database. +356 +357 Parameters +358 ---------- +359 url : str +360 The URL for the database. +361 database_name : str +362 The name of the database. +363 """ +364 engine = create_engine(url) +365 conn = engine.connect() +366 conn.execute("commit") +367 conn.execute("create database " + database_name) +368 conn.close() +369 +370 def commit(self): +371 """ Commits the session. +372 """ +373 try: +374 self.session.commit() +375 except SQLAlchemyError as e: +376 self.session.rollback() +377 print(str(e)) +378 +379 def init_engine(self, url): +380 """ Initializes the SQLAlchemy engine. +381 +382 Parameters +383 ---------- +384 url : str +385 The URL for the database. +386 +387 Returns +388 ------- +389 sqlalchemy.engine.base.Engine +390 The SQLAlchemy engine. +391 +392 """ +393 if not url or url == 'None' or url == 'False': +394 directory = os.getcwd() +395 +396 if not os.path.isdir(directory + '/db'): +397 os.mkdir(directory + '/db') +398 +399 url = 'sqlite:///{DB}/db/molformulas.sqlite'.format(DB=directory) +400 +401 if url[0:6] == 'sqlite': +402 self.type = 'sqlite' +403 else: +404 self.type = 'normal' +405 +406 if url[0:6] == 'sqlite': +407 engine = create_engine(url, echo = False) +408 self.chunks_count = 50 +409 +410 elif url[0:10] == 'postgresql' or url[0:8] == 'postgres': +411 #postgresql +412 self.chunks_count = 50000 +413 engine = create_engine(url, echo = False, isolation_level="AUTOCOMMIT") +414 +415 return engine# poolclass=NullPool +416 +417 def __enter__(self): +418 """ Returns the object. +419 """ +420 return self +421 +422 def get_dict_by_classes(self, classes, ion_type, nominal_mzs, ion_charge, molecular_search_settings, adducts=None): +423 """ Returns a dictionary of molecular formulas. +424 +425 Parameters +426 ---------- +427 classes : list +428 The list of classes. +429 ion_type : str +430 The ion type. +431 nominal_mzs : list +432 The list of nominal m/z values. +433 ion_charge : int +434 The ion charge. +435 molecular_search_settings : MolecularFormulaSearchSettings +436 The molecular formula search settings. +437 adducts : list, optional +438 The list of adducts. Default is None. +439 +440 Returns +441 ------- +442 dict +443 The dictionary of molecular formulas. +444 +445 Notes +446 ----- +447 Known issue, when using SQLite: +448 if the number of classes and nominal_m/zs are higher than 999 the query will fail +449 Solution: use postgres or split query +450 """ +451 +452 def query_normal(class_list, len_adduct): +453 """ query for normal database +454 +455 Parameters +456 ---------- +457 class_list : list +458 The list of classes. +459 len_adduct : int +460 The length of the adduct. +461 +462 Returns +463 ------- +464 sqlalchemy.orm.query.Query +465 The query. +466 """ +467 base_query = self.session.query(MolecularFormulaLink, CarbonHydrogen, HeteroAtoms)\ +468 .filter(MolecularFormulaLink.carbonHydrogen_id == CarbonHydrogen.id)\ +469 .filter(MolecularFormulaLink.heteroAtoms_id == HeteroAtoms.id) +470 +471 return base_query.filter( +472 and_( +473 HeteroAtoms.name.in_(class_list), +474 and_( +475 MolecularFormulaLink.DBE >= molecular_search_settings.min_dbe, +476 MolecularFormulaLink.DBE <= molecular_search_settings.max_dbe, +477 and_( +478 ((CarbonHydrogen.h + HeteroAtoms.halogens_count - len_adduct) / CarbonHydrogen.c) >= molecular_search_settings.min_hc_filter, +479 ((CarbonHydrogen.h + HeteroAtoms.halogens_count - len_adduct) / CarbonHydrogen.c) <= molecular_search_settings.max_hc_filter, +480 CarbonHydrogen.C >= molecular_search_settings.usedAtoms.get("C")[0], +481 CarbonHydrogen.c <= molecular_search_settings.usedAtoms.get("C")[1], +482 CarbonHydrogen.h >= molecular_search_settings.usedAtoms.get("H")[0], +483 CarbonHydrogen.h <= molecular_search_settings.usedAtoms.get("H")[1], +484 ) +485 ) +486 ) +487 ) +488 +489 def add_dict_formula(formulas, ion_type, ion_charge, adduct_atom=None): +490 """ add molecular formula to dict +491 +492 Parameters +493 ---------- +494 formulas : sqlalchemy.orm.query.Query +495 The query. +496 ion_type : str +497 The ion type. +498 ion_charge : int +499 The ion charge. +500 adduct_atom : str, optional +501 The adduct atom. Default is None. +502 +503 Returns +504 ------- +505 dict +506 The dictionary of molecular formulas. +507 +508 """ +509 "organize data by heteroatom classes" +510 dict_res = {} +511 +512 def nominal_mass_by_ion_type(formula_obj): +513 +514 if ion_type == Labels.protonated_de_ion: +515 +516 return int(formula_obj._protonated_mz(ion_charge)) +517 +518 elif ion_type == Labels.radical_ion: +519 +520 return int(formula_obj._radical_mz(ion_charge)) +521 +522 elif ion_type == Labels.adduct_ion and adduct_atom: +523 +524 return int(formula_obj._adduct_mz(ion_charge, adduct_atom)) +525 +526 for formula_obj, ch_obj, classe_obj in tqdm.tqdm(formulas, desc="Loading molecular formula database"): +527 +528 nominal_mz = nominal_mass_by_ion_type(formula_obj) +529 +530 if self.type != 'normal': +531 if not nominal_mz in nominal_mzs: +532 continue +533 classe = classe_obj.name +534 +535 # classe_str = formula.classe_string +536 +537 # pbar.set_description_str(desc="Loading molecular formula database for class %s " % classe_str) +538 +539 formula_dict = formula_obj.to_dict() +540 +541 if formula_dict.get("O"): +542 +543 if formula_dict.get("O") / formula_dict.get("C") >= molecular_search_settings.max_oc_filter: +544 # print(formula_dict.get("O") / formula_dict.get("C"), molecular_search_settings.max_oc_filter) +545 continue +546 elif formula_dict.get("O") / formula_dict.get("C") <= molecular_search_settings.min_oc_filter: +547 # print(formula_dict.get("O") / formula_dict.get("C"), molecular_search_settings.min_oc_filter) +548 continue +549 #if formula_dict.get("P"): +550 +551 # if not (formula_dict.get("O") -2)/ formula_dict.get("P") >= molecular_search_settings.min_op_filter: +552 +553 # continue +554 +555 if classe in dict_res.keys(): +556 +557 if nominal_mz in dict_res[classe].keys(): +558 +559 dict_res.get(classe).get(nominal_mz).append(formula_obj) +560 +561 else: +562 +563 dict_res.get(classe)[nominal_mz] = [formula_obj ] +564 +565 else: +566 +567 dict_res[classe] = {nominal_mz: [formula_obj] } +568 +569 return dict_res 570 -571 len_adducts = 0 -572 if ion_type == Labels.adduct_ion: -573 len_adducts = 1 -574 -575 query = query_normal(classes, len_adducts) -576 -577 if ion_type == Labels.protonated_de_ion: -578 if self.type == 'normal': -579 query = query.filter(and_( -580 MolecularFormulaLink._protonated_mz(ion_charge).cast(Integer).in_(nominal_mzs) -581 )) -582 return add_dict_formula(query, ion_type, ion_charge) -583 -584 if ion_type == Labels.radical_ion: -585 if self.type == 'normal': -586 query = query.filter(MolecularFormulaLink._radical_mz(ion_charge).cast(Integer).in_(nominal_mzs)) -587 return add_dict_formula(query, ion_type, ion_charge) -588 -589 if ion_type == Labels.adduct_ion: -590 dict_res = {} -591 if adducts: -592 for atom in adducts: -593 if self.type == 'normal': -594 query = query.filter(MolecularFormulaLink._adduct_mz(ion_charge, atom).cast(Integer).in_(nominal_mzs)) -595 dict_res[atom] = add_dict_formula(query, ion_type, ion_charge, adduct_atom=atom) -596 return dict_res -597 # dump all objs to memory -598 self.session.expunge_all() -599 -600 def check_entry(self,classe, ion_type, molecular_search_settings): -601 """ Checks if a molecular formula is in the database. -602 -603 Parameters -604 ---------- -605 classe : str -606 The class of the molecular formula. -607 ion_type : str -608 The ion type. -609 molecular_search_settings : MolecularFormulaSearchSettings -610 The molecular formula search settings. -611 -612 Returns -613 ------- -614 sqlalchemy.orm.query.Query -615 The query. -616 """ -617 # get all classes, ion_type, ion charge as str add to a dict or list -618 # then check if class in database -619 has_class = self.session.query(exists().where( -620 (MolecularFormulaLink.classe == classe))) -621 -622 return has_class -623 -624 def get_all_classes(self): -625 """ Returns a list of all classes in the database.""" -626 query = self.session.query(MolecularFormulaLink.classe.distinct().label("classe")) -627 -628 return query.all() -629 -630 def get_all(self,): -631 """ Returns a list of all molecular formulas in the database.""" -632 mol_formulas = self.session.query(MolecularFormulaLink).all() -633 -634 return mol_formulas -635 -636 def delete_entry(self, row): -637 """ Deletes a molecular formula from the database.""" -638 try: -639 self.session.delete(row) -640 self.session.commit() -641 -642 except SQLAlchemyError as e: -643 self.session.rollback() -644 print(str(e)) -645 -646 def purge(self, cls): -647 """ Deletes all molecular formulas from the database. -648 -649 Notes -650 ------- -651 Careful, this will delete the entire database table -652 -653 """ -654 self.session.query(cls).delete() -655 self.session.commit() +571 +572 len_adducts = 0 +573 if ion_type == Labels.adduct_ion: +574 len_adducts = 1 +575 +576 query = query_normal(classes, len_adducts) +577 +578 if ion_type == Labels.protonated_de_ion: +579 if self.type == 'normal': +580 +581 query = query.filter( +582 func.floor(MolecularFormulaLink._protonated_mz(ion_charge)).in_(nominal_mzs) +583 ) +584 +585 +586 return add_dict_formula(query, ion_type, ion_charge) +587 +588 if ion_type == Labels.radical_ion: +589 if self.type == 'normal': +590 query = query.filter(func.floor(MolecularFormulaLink._radical_mz(ion_charge)).in_(nominal_mzs)) +591 return add_dict_formula(query, ion_type, ion_charge) +592 +593 if ion_type == Labels.adduct_ion: +594 dict_res = {} +595 if adducts: +596 for atom in adducts: +597 if self.type == 'normal': +598 query = query.filter(func.floor(MolecularFormulaLink._adduct_mz(ion_charge, atom)).in_(nominal_mzs)) +599 dict_res[atom] = add_dict_formula(query, ion_type, ion_charge, adduct_atom=atom) +600 return dict_res +601 # dump all objs to memory +602 self.session.expunge_all() +603 +604 def check_entry(self,classe, ion_type, molecular_search_settings): +605 """ Checks if a molecular formula is in the database. +606 +607 Parameters +608 ---------- +609 classe : str +610 The class of the molecular formula. +611 ion_type : str +612 The ion type. +613 molecular_search_settings : MolecularFormulaSearchSettings +614 The molecular formula search settings. +615 +616 Returns +617 ------- +618 sqlalchemy.orm.query.Query +619 The query. +620 """ +621 # get all classes, ion_type, ion charge as str add to a dict or list +622 # then check if class in database +623 has_class = self.session.query(exists().where( +624 (MolecularFormulaLink.classe == classe))) +625 +626 return has_class +627 +628 def get_all_classes(self): +629 """ Returns a list of all classes in the database.""" +630 query = self.session.query(MolecularFormulaLink.classe.distinct().label("classe")) +631 +632 return query.all() +633 +634 def get_all(self,): +635 """ Returns a list of all molecular formulas in the database.""" +636 mol_formulas = self.session.query(MolecularFormulaLink).all() +637 +638 return mol_formulas +639 +640 def delete_entry(self, row): +641 """ Deletes a molecular formula from the database.""" +642 try: +643 self.session.delete(row) +644 self.session.commit() +645 +646 except SQLAlchemyError as e: +647 self.session.rollback() +648 print(str(e)) +649 +650 def purge(self, cls): +651 """ Deletes all molecular formulas from the database. +652 +653 Notes +654 ------- +655 Careful, this will delete the entire database table 656 -657 def clear_data(self): -658 """ Clears the database. -659 """ -660 meta = Base.metadata -661 for table in reversed(meta.sorted_tables): -662 print ('Clear table %s' % table) -663 self.session.execute(table.delete()) -664 self.session.commit() -665 -666 def close(self, commit=True): -667 """ Closes the database. -668 -669 Parameters -670 ---------- -671 commit : bool, optional -672 Whether to commit the session. Default is True. -673 """ -674 # make sure the dbconnection gets closed -675 -676 if commit: self.commit() -677 self.session.close() -678 self.engine.dispose() -679 -680 def add_engine_pidguard(self, engine): -681 """ Adds multiprocessing guards. -682 -683 Forces a connection to be reconnected if it is detected -684 as having been shared to a sub-process. -685 -686 Parameters -687 ---------- -688 engine : sqlalchemy.engine.base.Engine -689 The SQLAlchemy engine. -690 -691 """ -692 import os, warnings -693 -694 -695 @event.listens_for(engine, "connect") -696 def connect(dbapi_connection, connection_record): -697 """ Forces a connection to be reconnected if it is detected -698 -699 Parameters -700 ---------- -701 dbapi_connection : sqlalchemy.engine.base.Engine -702 The SQLAlchemy engine. -703 connection_record : sqlalchemy.engine.base.Engine -704 The SQLAlchemy engine. -705 """ -706 connection_record.info['pid'] = os.getpid() -707 -708 @event.listens_for(engine, "checkout") -709 def checkout(dbapi_connection, connection_record, connection_proxy): -710 """ Forces a connection to be reconnected if it is detected -711 -712 Parameters -713 ---------- -714 dbapi_connection : sqlalchemy.engine.base.Engine -715 The SQLAlchemy engine. -716 connection_record : sqlalchemy.engine.base.Engine -717 The SQLAlchemy engine. -718 connection_proxy : sqlalchemy.engine.base.Engine +657 """ +658 self.session.query(cls).delete() +659 self.session.commit() +660 +661 def clear_data(self): +662 """ Clears the database. +663 """ +664 meta = Base.metadata +665 for table in reversed(meta.sorted_tables): +666 print ('Clear table %s' % table) +667 self.session.execute(table.delete()) +668 self.session.commit() +669 +670 def close(self, commit=True): +671 """ Closes the database. +672 +673 Parameters +674 ---------- +675 commit : bool, optional +676 Whether to commit the session. Default is True. +677 """ +678 # make sure the dbconnection gets closed +679 +680 if commit: self.commit() +681 self.session.close() +682 self.engine.dispose() +683 +684 def add_engine_pidguard(self, engine): +685 """ Adds multiprocessing guards. +686 +687 Forces a connection to be reconnected if it is detected +688 as having been shared to a sub-process. +689 +690 Parameters +691 ---------- +692 engine : sqlalchemy.engine.base.Engine +693 The SQLAlchemy engine. +694 +695 """ +696 import os, warnings +697 +698 +699 @event.listens_for(engine, "connect") +700 def connect(dbapi_connection, connection_record): +701 """ Forces a connection to be reconnected if it is detected +702 +703 Parameters +704 ---------- +705 dbapi_connection : sqlalchemy.engine.base.Engine +706 The SQLAlchemy engine. +707 connection_record : sqlalchemy.engine.base.Engine +708 The SQLAlchemy engine. +709 """ +710 connection_record.info['pid'] = os.getpid() +711 +712 @event.listens_for(engine, "checkout") +713 def checkout(dbapi_connection, connection_record, connection_proxy): +714 """ Forces a connection to be reconnected if it is detected +715 +716 Parameters +717 ---------- +718 dbapi_connection : sqlalchemy.engine.base.Engine 719 The SQLAlchemy engine. -720 -721 Raises -722 ------ -723 exc.DisconnectionError -724 If the connection record belongs to a different process. -725 -726 """ -727 pid = os.getpid() -728 if connection_record.info['pid'] != pid: -729 # substitute log.debug() or similar here as desired -730 warnings.warn( -731 "Parent process %(orig)s forked (%(newproc)s) with an open " -732 "database connection, " -733 "which is being discarded and recreated." % -734 {"newproc": pid, "orig": connection_record.info['pid']}) -735 connection_record.connection = connection_proxy.connection = None -736 raise exc.DisconnectionError( -737 "Connection record belongs to pid %s, " -738 "attempting to check out in pid %s" % -739 (connection_record.info['pid'], pid) -740 ) -741 -742if __name__ == "__main__": -743 -744 sql = MolForm_SQL(url='sqlite:///') -745 -746 dict_data = {"name": '{"O": 12}'} -747 dict_data2 = {"name": '{"O": 13}'} -748 hetero_obj = HeteroAtoms(**dict_data) -749 hetero_obj2 = HeteroAtoms(**dict_data2) -750 sql.session.add(hetero_obj) -751 sql.session.add(hetero_obj2) -752 -753 print(sql.session.query(HeteroAtoms).all()) -754 #molecular_search_settings = MolecularFormulaSearchSettings() -755 #sql = MolForm_SQL() -756 #query = sql.session.query(MolecularFormulaLink).filter_by(classe = '{"O": 12}').filter(MolecularFormulaLink._adduct_mz(+2, "Na") < 250) -757 #query = sql.get_by_classe('{"O": 12}', molecular_search_settings).filter(MolecularFormulaLink._adduct_mz(+2, "Na") < 250) -758 #classes = ['{"O": 12}']*1 -759 #for i, classe in enumerate(classes): -760 #query = sql.get_by_classe(classe, molecular_search_settings) -761 #query = sql.session.query(MolecularFormulaLink).filter_by(classe = '{"O": 12}').filter(MolecularFormulaLink._adduct_mz(+2, "Na") < 250) -762 #for i in query.filter(MolecularFormulaLink.mass < 250): -763 -764 # print(i._radical_mz(-1), i._protonated_mz(-1), i._adduct_mz(+2, "Na"), i.mass, i.to_dict(), i.formula_string) -765 # -766 +720 connection_record : sqlalchemy.engine.base.Engine +721 The SQLAlchemy engine. +722 connection_proxy : sqlalchemy.engine.base.Engine +723 The SQLAlchemy engine. +724 +725 Raises +726 ------ +727 exc.DisconnectionError +728 If the connection record belongs to a different process. +729 +730 """ +731 pid = os.getpid() +732 if connection_record.info['pid'] != pid: +733 # substitute log.debug() or similar here as desired +734 warnings.warn( +735 "Parent process %(orig)s forked (%(newproc)s) with an open " +736 "database connection, " +737 "which is being discarded and recreated." % +738 {"newproc": pid, "orig": connection_record.info['pid']}) +739 connection_record.connection = connection_proxy.connection = None +740 raise exc.DisconnectionError( +741 "Connection record belongs to pid %s, " +742 "attempting to check out in pid %s" % +743 (connection_record.info['pid'], pid) +744 ) +745 +746if __name__ == "__main__": +747 +748 sql = MolForm_SQL(url='sqlite:///') +749 +750 dict_data = {"name": '{"O": 12}'} +751 dict_data2 = {"name": '{"O": 13}'} +752 hetero_obj = HeteroAtoms(**dict_data) +753 hetero_obj2 = HeteroAtoms(**dict_data2) +754 sql.session.add(hetero_obj) +755 sql.session.add(hetero_obj2) +756 +757 print(sql.session.query(HeteroAtoms).all()) +758 #molecular_search_settings = MolecularFormulaSearchSettings() +759 #sql = MolForm_SQL() +760 #query = sql.session.query(MolecularFormulaLink).filter_by(classe = '{"O": 12}').filter(MolecularFormulaLink._adduct_mz(+2, "Na") < 250) +761 #query = sql.get_by_classe('{"O": 12}', molecular_search_settings).filter(MolecularFormulaLink._adduct_mz(+2, "Na") < 250) +762 #classes = ['{"O": 12}']*1 +763 #for i, classe in enumerate(classes): +764 #query = sql.get_by_classe(classe, molecular_search_settings) +765 #query = sql.session.query(MolecularFormulaLink).filter_by(classe = '{"O": 12}').filter(MolecularFormulaLink._adduct_mz(+2, "Na") < 250) +766 #for i in query.filter(MolecularFormulaLink.mass < 250): +767 +768 # print(i._radical_mz(-1), i._protonated_mz(-1), i._adduct_mz(+2, "Na"), i.mass, i.to_dict(), i.formula_string) +769 # +770

    @@ -1087,54 +1091,54 @@

    -
    29class HeteroAtoms(Base):
    -30    """ HeteroAtoms class for the heteroAtoms table in the SQLite database.
    -31    
    -32    Attributes
    -33    ----------
    -34    id : int
    -35        The primary key for the table.
    -36    name : str
    -37        The name of the heteroAtoms class.
    -38    halogensCount : int
    -39        The number of halogens in the heteroAtoms class.
    -40    carbonHydrogen : relationship
    -41        The relationship to the carbonHydrogen table.
    -42    
    -43    Methods
    -44    -------
    -45    * __repr__()
    -46        Returns the string representation of the object.
    -47    * to_dict()
    -48        Returns the heteroAtoms class as a dictionary.
    -49    * halogens_count()
    -50        Returns the number of halogens as a float.
    -51    
    -52
    -53    """
    -54    __tablename__ = 'heteroAtoms'
    -55
    -56    id = Column(Integer, primary_key=True,
    -57                         unique = True,
    -58                         nullable = False)
    -59
    -60    name = Column(String, unique=True, nullable=False)
    -61
    -62    halogensCount = Column(Integer, unique=False, nullable=False)
    -63
    -64    carbonHydrogen = relationship('CarbonHydrogen', secondary='molecularformula',  viewonly=True)
    -65
    -66    def __repr__(self):
    -67        return '<HeteroAtoms Model {} class {}>'.format(self.id, self.name)      
    -68
    -69    @hybrid_property
    -70    def halogens_count(cls):
    -71        """ Returns the number of halogens as a float."""
    -72        return cls.halogensCount.cast(Float)
    -73
    -74    def to_dict(self):
    -75        """ Returns the heteroAtoms class as a dictionary."""
    -76        return json.loads(self.name)
    +            
    30class HeteroAtoms(Base):
    +31    """ HeteroAtoms class for the heteroAtoms table in the SQLite database.
    +32    
    +33    Attributes
    +34    ----------
    +35    id : int
    +36        The primary key for the table.
    +37    name : str
    +38        The name of the heteroAtoms class.
    +39    halogensCount : int
    +40        The number of halogens in the heteroAtoms class.
    +41    carbonHydrogen : relationship
    +42        The relationship to the carbonHydrogen table.
    +43    
    +44    Methods
    +45    -------
    +46    * __repr__()
    +47        Returns the string representation of the object.
    +48    * to_dict()
    +49        Returns the heteroAtoms class as a dictionary.
    +50    * halogens_count()
    +51        Returns the number of halogens as a float.
    +52    
    +53
    +54    """
    +55    __tablename__ = 'heteroAtoms'
    +56
    +57    id = Column(Integer, primary_key=True,
    +58                         unique = True,
    +59                         nullable = False)
    +60
    +61    name = Column(String, unique=True, nullable=False)
    +62
    +63    halogensCount = Column(Integer, unique=False, nullable=False)
    +64
    +65    carbonHydrogen = relationship('CarbonHydrogen', secondary='molecularformula',  viewonly=True)
    +66
    +67    def __repr__(self):
    +68        return '<HeteroAtoms Model {} class {}>'.format(self.id, self.name)      
    +69
    +70    @hybrid_property
    +71    def halogens_count(cls):
    +72        """ Returns the number of halogens as a float."""
    +73        return cls.halogensCount.cast(Float)
    +74
    +75    def to_dict(self):
    +76        """ Returns the heteroAtoms class as a dictionary."""
    +77        return json.loads(self.name)
     
    @@ -1255,9 +1259,9 @@
    Methods
    -
    74    def to_dict(self):
    -75        """ Returns the heteroAtoms class as a dictionary."""
    -76        return json.loads(self.name)
    +            
    75    def to_dict(self):
    +76        """ Returns the heteroAtoms class as a dictionary."""
    +77        return json.loads(self.name)
     
    @@ -1288,75 +1292,75 @@
    Inherited Members
    -
     79class CarbonHydrogen(Base):
    - 80    """ CarbonHydrogen class for the carbonHydrogen table in the SQLite database.
    - 81    
    - 82    Attributes
    - 83    ----------
    - 84    id : int
    - 85        The primary key for the table.
    - 86    C : int
    - 87        The number of carbon atoms.
    - 88    H : int
    - 89        The number of hydrogen atoms.
    - 90    heteroAtoms : relationship
    - 91        The relationship to the heteroAtoms table.
    - 92    
    - 93    Methods
    - 94    -------
    - 95    * __repr__()
    - 96        Returns the string representation of the object.
    - 97    * mass()
    - 98        Returns the mass of the carbonHydrogen class as a float.
    - 99    * c()
    -100        Returns the number of carbon atoms as a float.
    -101    * h()
    -102        Returns the number of hydrogen atoms as a float.
    -103    * dbe()
    -104        Returns the double bond equivalent as a float.
    -105    
    -106    """
    -107
    -108    __tablename__ = 'carbonHydrogen'
    -109    __table_args__ = (UniqueConstraint('C', 'H', name='unique_c_h'), )
    -110
    -111    id = Column(Integer, primary_key=True,
    -112                unique=True,
    -113                nullable=False)
    -114
    -115    C = Column(Integer, nullable=False)
    -116
    -117    H = Column(Integer, nullable=False)
    -118
    -119    heteroAtoms = relationship("HeteroAtoms",
    -120                               secondary="molecularformula",
    -121                               viewonly=True
    -122                               )
    -123
    -124    def __repr__(self):
    -125        """ Returns the string representation of the object."""
    -126        return '<CarbonHydrogen Model {} C{} H{}>'.format(self.id, self.C, self.H)                     
    -127
    -128    @property
    -129    def mass(self):
    -130        """ Returns the mass of the carbonHydrogen class as a float."""
    -131        return (self.C * Atoms.atomic_masses.get('C')) + (self.H * Atoms.atomic_masses.get('H'))
    -132
    -133    @hybrid_property
    -134    def c(cls):
    -135        """ Returns the number of carbon atoms as a float."""
    -136        return cls.C.cast(Float)
    -137
    -138    @hybrid_property
    -139    def h(cls):
    -140        """ Returns the number of hydrogen atoms as a float."""
    -141        return cls.H.cast(Float)
    -142
    -143    @hybrid_property
    -144    def dbe(cls):
    -145        """ Returns the double bond equivalent as a float."""
    -146        # return cls.C.cast(Float) - (cls.H.cast(Float) / 2) + 1
    -147        return float(cls.C) - float(cls.H / 2) + 1
    +            
     80class CarbonHydrogen(Base):
    + 81    """ CarbonHydrogen class for the carbonHydrogen table in the SQLite database.
    + 82    
    + 83    Attributes
    + 84    ----------
    + 85    id : int
    + 86        The primary key for the table.
    + 87    C : int
    + 88        The number of carbon atoms.
    + 89    H : int
    + 90        The number of hydrogen atoms.
    + 91    heteroAtoms : relationship
    + 92        The relationship to the heteroAtoms table.
    + 93    
    + 94    Methods
    + 95    -------
    + 96    * __repr__()
    + 97        Returns the string representation of the object.
    + 98    * mass()
    + 99        Returns the mass of the carbonHydrogen class as a float.
    +100    * c()
    +101        Returns the number of carbon atoms as a float.
    +102    * h()
    +103        Returns the number of hydrogen atoms as a float.
    +104    * dbe()
    +105        Returns the double bond equivalent as a float.
    +106    
    +107    """
    +108
    +109    __tablename__ = 'carbonHydrogen'
    +110    __table_args__ = (UniqueConstraint('C', 'H', name='unique_c_h'), )
    +111
    +112    id = Column(Integer, primary_key=True,
    +113                unique=True,
    +114                nullable=False)
    +115
    +116    C = Column(Integer, nullable=False)
    +117
    +118    H = Column(Integer, nullable=False)
    +119
    +120    heteroAtoms = relationship("HeteroAtoms",
    +121                               secondary="molecularformula",
    +122                               viewonly=True
    +123                               )
    +124
    +125    def __repr__(self):
    +126        """ Returns the string representation of the object."""
    +127        return '<CarbonHydrogen Model {} C{} H{}>'.format(self.id, self.C, self.H)                     
    +128
    +129    @property
    +130    def mass(self):
    +131        """ Returns the mass of the carbonHydrogen class as a float."""
    +132        return (self.C * Atoms.atomic_masses.get('C')) + (self.H * Atoms.atomic_masses.get('H'))
    +133
    +134    @hybrid_property
    +135    def c(cls):
    +136        """ Returns the number of carbon atoms as a float."""
    +137        return cls.C.cast(Float)
    +138
    +139    @hybrid_property
    +140    def h(cls):
    +141        """ Returns the number of hydrogen atoms as a float."""
    +142        return cls.H.cast(Float)
    +143
    +144    @hybrid_property
    +145    def dbe(cls):
    +146        """ Returns the double bond equivalent as a float."""
    +147        # return cls.C.cast(Float) - (cls.H.cast(Float) / 2) + 1
    +148        return float(cls.C) - float(cls.H / 2) + 1
     
    @@ -1531,126 +1535,126 @@
    Inherited Members
    -
    150class MolecularFormulaLink(Base):
    -151    """ MolecularFormulaLink class for the molecularformula table in the SQLite database.
    -152
    -153    Attributes
    -154    ----------
    -155    heteroAtoms_id : int
    -156        The foreign key for the heteroAtoms table.
    -157    carbonHydrogen_id : int
    -158        The foreign key for the carbonHydrogen table.
    -159    mass : float
    -160        The mass of the molecular formula.
    -161    DBE : float
    -162        The double bond equivalent of the molecular formula.
    -163    carbonHydrogen : relationship
    -164        The relationship to the carbonHydrogen table.
    -165    heteroAtoms : relationship
    -166        The relationship to the heteroAtoms table.
    -167    C : association_proxy
    -168        The association proxy for the carbonHydrogen table.
    -169    H : association_proxy
    -170        The association proxy for the carbonHydrogen table.
    -171    classe : association_proxy
    -172        The association proxy for the heteroAtoms table.
    -173    
    -174    Methods
    -175    -------
    -176    * __repr__()
    -177        Returns the string representation of the object.
    -178    * to_dict()
    -179        Returns the molecular formula as a dictionary.
    -180    * formula_string()
    -181        Returns the molecular formula as a string.
    -182    * classe_string()
    -183        Returns the heteroAtoms class as a string.
    -184    * _adduct_mz(ion_charge, adduct_atom)
    -185        Returns the m/z of the adduct ion as a float.
    -186    * _protonated_mz(ion_charge)
    -187        Returns the m/z of the protonated ion as a float.
    -188    * _radical_mz(ion_charge)
    -189        Returns the m/z of the radical ion as a float.
    -190    
    -191
    +            
    151class MolecularFormulaLink(Base):
    +152    """ MolecularFormulaLink class for the molecularformula table in the SQLite database.
    +153
    +154    Attributes
    +155    ----------
    +156    heteroAtoms_id : int
    +157        The foreign key for the heteroAtoms table.
    +158    carbonHydrogen_id : int
    +159        The foreign key for the carbonHydrogen table.
    +160    mass : float
    +161        The mass of the molecular formula.
    +162    DBE : float
    +163        The double bond equivalent of the molecular formula.
    +164    carbonHydrogen : relationship
    +165        The relationship to the carbonHydrogen table.
    +166    heteroAtoms : relationship
    +167        The relationship to the heteroAtoms table.
    +168    C : association_proxy
    +169        The association proxy for the carbonHydrogen table.
    +170    H : association_proxy
    +171        The association proxy for the carbonHydrogen table.
    +172    classe : association_proxy
    +173        The association proxy for the heteroAtoms table.
    +174    
    +175    Methods
    +176    -------
    +177    * __repr__()
    +178        Returns the string representation of the object.
    +179    * to_dict()
    +180        Returns the molecular formula as a dictionary.
    +181    * formula_string()
    +182        Returns the molecular formula as a string.
    +183    * classe_string()
    +184        Returns the heteroAtoms class as a string.
    +185    * _adduct_mz(ion_charge, adduct_atom)
    +186        Returns the m/z of the adduct ion as a float.
    +187    * _protonated_mz(ion_charge)
    +188        Returns the m/z of the protonated ion as a float.
    +189    * _radical_mz(ion_charge)
    +190        Returns the m/z of the radical ion as a float.
    +191    
     192
    -193    """
    -194    __tablename__ = 'molecularformula'
    -195    __table_args__ = (UniqueConstraint('heteroAtoms_id', 'carbonHydrogen_id', name='unique_molform'), )
    -196
    -197    # id = Column(Integer, primary_key=True,
    -198    #                    unique=True,
    -199    #                    nullable=False)
    -200
    -201    heteroAtoms_id = Column(Integer,
    -202                            ForeignKey('heteroAtoms.id'),
    -203                            primary_key=True)
    -204
    -205    carbonHydrogen_id = Column(Integer,
    -206                               ForeignKey('carbonHydrogen.id'), 
    -207                               primary_key=True)
    -208
    -209    mass = Column(Float)
    -210
    -211    DBE = Column(Float)
    -212
    -213    carbonHydrogen = relationship(CarbonHydrogen, backref=backref("heteroAtoms_assoc"))
    -214
    -215    heteroAtoms = relationship(HeteroAtoms, backref=backref("carbonHydrogen_assoc"))
    -216
    -217    C = association_proxy('carbonHydrogen', 'C')
    -218
    -219    H = association_proxy('carbonHydrogen', 'H')
    -220
    -221    classe = association_proxy('heteroAtoms', 'name')
    -222
    -223    def to_dict(self):
    -224        """ Returns the molecular formula as a dictionary.
    -225        
    -226        Returns
    -227        -------
    -228        dict
    -229            The molecular formula as a dictionary.  
    -230        """
    -231        carbon = {'C': self.C, 'H': self.H}
    -232        classe = json.loads(self.classe)
    -233        if self.classe == '{"HC": ""}':
    -234            return {**carbon}
    -235        else:
    -236            return {**carbon, **classe}
    -237
    -238    @property
    -239    def formula_string(self):
    -240        """ Returns the molecular formula as a string."""
    -241        class_dict = self.to_dict()
    -242        class_str = ' '.join([atom + str(class_dict[atom]) for atom in class_dict.keys()])
    -243        return class_str.strip()
    -244
    -245    @property
    -246    def classe_string(self):
    -247        """ Returns the heteroAtoms class as a string."""
    -248        class_dict = json.loads(self.classe)
    -249        class_str = ' '.join([atom + str(class_dict[atom]) for atom in class_dict.keys()])
    -250        return class_str.strip()
    -251
    -252    @hybrid_method
    -253    def _adduct_mz(self, ion_charge, adduct_atom):
    -254        """ Returns the m/z of the adduct ion as a float."""
    -255        return (self.mass + (Atoms.atomic_masses.get(adduct_atom)) + (ion_charge * -1 * Atoms.electron_mass))/ abs(ion_charge)
    -256
    -257    @hybrid_method
    -258    def _protonated_mz(self, ion_charge):
    -259        """ Returns the m/z of the protonated ion as a float."""
    -260        return (self.mass + (ion_charge * Atoms.atomic_masses.get("H")) + (ion_charge * -1 * Atoms.electron_mass))/abs(ion_charge)
    -261
    -262    @hybrid_method
    -263    def _radical_mz(self, ion_charge):
    -264        """ Returns the m/z of the radical ion as a float."""
    -265        return (self.mass + (ion_charge * -1 * Atoms.electron_mass))/ abs(ion_charge)
    -266
    -267    def __repr__(self):
    -268        """ Returns the string representation of the object."""
    -269        return '<MolecularFormulaLink Model {}>'.format(self.formula_string)       
    +193
    +194    """
    +195    __tablename__ = 'molecularformula'
    +196    __table_args__ = (UniqueConstraint('heteroAtoms_id', 'carbonHydrogen_id', name='unique_molform'), )
    +197
    +198    # id = Column(Integer, primary_key=True,
    +199    #                    unique=True,
    +200    #                    nullable=False)
    +201
    +202    heteroAtoms_id = Column(Integer,
    +203                            ForeignKey('heteroAtoms.id'),
    +204                            primary_key=True)
    +205
    +206    carbonHydrogen_id = Column(Integer,
    +207                               ForeignKey('carbonHydrogen.id'), 
    +208                               primary_key=True)
    +209
    +210    mass = Column(Float)
    +211
    +212    DBE = Column(Float)
    +213
    +214    carbonHydrogen = relationship(CarbonHydrogen, backref=backref("heteroAtoms_assoc"))
    +215
    +216    heteroAtoms = relationship(HeteroAtoms, backref=backref("carbonHydrogen_assoc"))
    +217
    +218    C = association_proxy('carbonHydrogen', 'C')
    +219
    +220    H = association_proxy('carbonHydrogen', 'H')
    +221
    +222    classe = association_proxy('heteroAtoms', 'name')
    +223
    +224    def to_dict(self):
    +225        """ Returns the molecular formula as a dictionary.
    +226        
    +227        Returns
    +228        -------
    +229        dict
    +230            The molecular formula as a dictionary.  
    +231        """
    +232        carbon = {'C': self.C, 'H': self.H}
    +233        classe = json.loads(self.classe)
    +234        if self.classe == '{"HC": ""}':
    +235            return {**carbon}
    +236        else:
    +237            return {**carbon, **classe}
    +238
    +239    @property
    +240    def formula_string(self):
    +241        """ Returns the molecular formula as a string."""
    +242        class_dict = self.to_dict()
    +243        class_str = ' '.join([atom + str(class_dict[atom]) for atom in class_dict.keys()])
    +244        return class_str.strip()
    +245
    +246    @property
    +247    def classe_string(self):
    +248        """ Returns the heteroAtoms class as a string."""
    +249        class_dict = json.loads(self.classe)
    +250        class_str = ' '.join([atom + str(class_dict[atom]) for atom in class_dict.keys()])
    +251        return class_str.strip()
    +252
    +253    @hybrid_method
    +254    def _adduct_mz(self, ion_charge, adduct_atom):
    +255        """ Returns the m/z of the adduct ion as a float."""
    +256        return (self.mass + (Atoms.atomic_masses.get(adduct_atom)) + (ion_charge * -1 * Atoms.electron_mass))/ abs(ion_charge)
    +257
    +258    @hybrid_method
    +259    def _protonated_mz(self, ion_charge):
    +260        """ Returns the m/z of the protonated ion as a float."""
    +261        return (self.mass + (ion_charge * Atoms.atomic_masses.get("H")) + (ion_charge * -1 * Atoms.electron_mass))/abs(ion_charge)
    +262
    +263    @hybrid_method
    +264    def _radical_mz(self, ion_charge):
    +265        """ Returns the m/z of the radical ion as a float."""
    +266        return (self.mass + (ion_charge * -1 * Atoms.electron_mass))/ abs(ion_charge)
    +267
    +268    def __repr__(self):
    +269        """ Returns the string representation of the object."""
    +270        return '<MolecularFormulaLink Model {}>'.format(self.formula_string)       
     
    @@ -1837,20 +1841,20 @@
    Methods
    -
    223    def to_dict(self):
    -224        """ Returns the molecular formula as a dictionary.
    -225        
    -226        Returns
    -227        -------
    -228        dict
    -229            The molecular formula as a dictionary.  
    -230        """
    -231        carbon = {'C': self.C, 'H': self.H}
    -232        classe = json.loads(self.classe)
    -233        if self.classe == '{"HC": ""}':
    -234            return {**carbon}
    -235        else:
    -236            return {**carbon, **classe}
    +            
    224    def to_dict(self):
    +225        """ Returns the molecular formula as a dictionary.
    +226        
    +227        Returns
    +228        -------
    +229        dict
    +230            The molecular formula as a dictionary.  
    +231        """
    +232        carbon = {'C': self.C, 'H': self.H}
    +233        classe = json.loads(self.classe)
    +234        if self.classe == '{"HC": ""}':
    +235            return {**carbon}
    +236        else:
    +237            return {**carbon, **classe}
     
    @@ -1913,476 +1917,479 @@
    Inherited Members
    -
    272class MolForm_SQL:
    -273    """ MolForm_SQL class for the SQLite database.
    -274    
    -275    Attributes
    -276    ----------
    -277    engine : sqlalchemy.engine.base.Engine
    -278        The SQLAlchemy engine.
    -279    session : sqlalchemy.orm.session.Session
    -280        The SQLAlchemy session.
    -281    type : str
    -282        The type of database.
    -283    chunks_count : int
    -284        The number of chunks to use when querying the database.
    -285    
    -286    Methods
    -287    -------
    -288    * __init__(url=None, echo=False)
    -289        Initializes the database.
    -290    * __exit__(exc_type, exc_val, exc_tb)
    -291        Closes the database.
    -292    * initiate_database(url, database_name)
    -293        Creates the database.
    -294    * commit()
    -295        Commits the session.
    -296    * init_engine(url)
    -297        Initializes the SQLAlchemy engine.
    -298    * __enter__()
    -299
    -300    * get_dict_by_classes(classes, ion_type, nominal_mzs, ion_charge, molecular_search_settings, adducts=None)
    -301        Returns a dictionary of molecular formulas.
    -302    * check_entry(classe, ion_type, molecular_search_settings)
    -303        Checks if a molecular formula is in the database.
    -304    * get_all_classes()
    -305        Returns a list of all classes in the database.
    -306    * get_all()
    -307        Returns a list of all molecular formulas in the database.
    -308    * delete_entry(row)
    -309        Deletes a molecular formula from the database.
    -310    * purge(cls)
    -311        Deletes all molecular formulas from the database.
    -312    * clear_data()
    -313        Clears the database.
    -314    * close(commit=True)
    -315        Closes the database.
    -316    * add_engine_pidguard(engine)
    -317        Adds multiprocessing guards.
    -318    
    -319    """
    -320    def __init__(self, url=None, echo=False):
    -321
    -322        self.engine = self.init_engine(url)
    -323
    -324        self.add_engine_pidguard(self.engine)
    -325
    -326        session_factory = sessionmaker(bind=self.engine)
    -327
    -328        Session = scoped_session(session_factory)
    -329
    -330        self.session = session_factory()
    -331
    -332        Base.metadata.create_all(self.engine)
    -333
    -334        self.session.commit()
    -335
    -336    def __exit__(self, exc_type, exc_val, exc_tb):
    -337        """ Closes the database.
    -338        
    -339        Parameters
    -340        ----------
    -341        exc_type : str
    -342            The exception type.
    -343        exc_val : str
    -344            The exception value.
    -345        exc_tb : str
    -346            The exception traceback.
    -347        """
    -348        # make sure the dbconnection gets closed
    -349
    -350        self.commit()
    -351        self.session.close()
    -352        self.engine.dispose()
    -353
    -354    def initiate_database(self, url, database_name):  #CREATION
    -355        """ Creates the database.
    -356        
    -357        Parameters
    -358        ----------
    -359        url : str
    -360            The URL for the database.
    -361        database_name : str
    -362            The name of the database.
    -363        """
    -364        engine = create_engine(url)
    -365        conn = engine.connect()
    -366        conn.execute("commit")
    -367        conn.execute("create database " + database_name)
    -368        conn.close()
    -369
    -370    def commit(self):
    -371        """ Commits the session.
    -372        """
    -373        try:
    -374            self.session.commit()  
    -375        except SQLAlchemyError as e:
    -376            self.session.rollback()
    -377            print(str(e))
    -378
    -379    def init_engine(self, url):
    -380        """ Initializes the SQLAlchemy engine.
    -381        
    -382        Parameters
    -383        ----------
    -384        url : str
    -385            The URL for the database.
    -386        
    -387        Returns
    -388        -------
    -389        sqlalchemy.engine.base.Engine
    -390            The SQLAlchemy engine.
    -391        
    -392        """
    -393        if not url or url == 'None' or url == 'False':
    -394            directory = os.getcwd()
    -395
    -396            if not os.path.isdir(directory + '/db'):
    -397                os.mkdir(directory + '/db')
    -398
    -399            url = 'sqlite:///{DB}/db/molformulas.sqlite'.format(DB=directory)
    -400
    -401        if url[0:6] == 'sqlite':
    -402            self.type = 'sqlite'
    -403        else:
    -404            self.type = 'normal'
    -405            
    -406        if url[0:6] == 'sqlite':
    -407            engine = create_engine(url, echo = False)
    -408            self.chunks_count = 50
    -409        
    -410        elif url[0:10] == 'postgresql' or url[0:8] == 'postgres':
    -411            #postgresql
    -412            self.chunks_count = 50000
    -413            engine = create_engine(url, echo = False, isolation_level="AUTOCOMMIT")
    -414        
    -415        return engine# poolclass=NullPool
    -416
    -417    def __enter__(self):
    -418        """ Returns the object.
    -419        """
    -420        return self
    -421    
    -422    def get_dict_by_classes(self, classes, ion_type, nominal_mzs, ion_charge, molecular_search_settings, adducts=None):
    -423        """ Returns a dictionary of molecular formulas.
    -424        
    -425        Parameters
    -426        ----------
    -427        classes : list
    -428            The list of classes.
    -429        ion_type : str
    -430            The ion type.
    -431        nominal_mzs : list
    -432            The list of nominal m/z values.
    -433        ion_charge : int
    -434            The ion charge.
    -435        molecular_search_settings : MolecularFormulaSearchSettings
    -436            The molecular formula search settings.
    -437        adducts : list, optional
    -438            The list of adducts. Default is None.
    -439        
    -440        Returns
    -441        -------
    -442        dict
    -443            The dictionary of molecular formulas.
    -444        
    -445        Notes
    -446        -----
    -447        Known issue, when using SQLite:
    -448        if the number of classes and nominal_m/zs are higher than 999 the query will fail
    -449        Solution: use postgres or split query
    -450        """                     
    -451         
    -452        def query_normal(class_list, len_adduct):
    -453            """ query for normal database
    -454            
    -455            Parameters
    -456            ----------
    -457            class_list : list
    -458                The list of classes.
    -459            len_adduct : int
    -460                The length of the adduct.
    -461            
    -462            Returns
    -463            -------
    -464            sqlalchemy.orm.query.Query
    -465                The query.
    -466            """
    -467            base_query = self.session.query(MolecularFormulaLink, CarbonHydrogen, HeteroAtoms)\
    -468                                .filter(MolecularFormulaLink.carbonHydrogen_id == CarbonHydrogen.id)\
    -469                                .filter(MolecularFormulaLink.heteroAtoms_id == HeteroAtoms.id)
    -470            
    -471            return base_query.filter(
    -472                and_(
    -473                    HeteroAtoms.name.in_(class_list), 
    -474                    and_(
    -475                        MolecularFormulaLink.DBE >= molecular_search_settings.min_dbe, 
    -476                        MolecularFormulaLink.DBE <= molecular_search_settings.max_dbe, 
    -477                        and_(
    -478                            ((CarbonHydrogen.h + HeteroAtoms.halogens_count - len_adduct) / CarbonHydrogen.c) >= molecular_search_settings.min_hc_filter,
    -479                            ((CarbonHydrogen.h + HeteroAtoms.halogens_count - len_adduct) / CarbonHydrogen.c) <= molecular_search_settings.max_hc_filter,
    -480                            CarbonHydrogen.C >= molecular_search_settings.usedAtoms.get("C")[0],
    -481                            CarbonHydrogen.c <= molecular_search_settings.usedAtoms.get("C")[1],
    -482                            CarbonHydrogen.h >= molecular_search_settings.usedAtoms.get("H")[0],
    -483                            CarbonHydrogen.h <= molecular_search_settings.usedAtoms.get("H")[1],
    -484                        )
    -485                    )
    -486                )
    -487            )
    -488
    -489        def add_dict_formula(formulas, ion_type, ion_charge, adduct_atom=None):
    -490            """ add molecular formula to dict
    -491            
    -492            Parameters
    -493            ----------
    -494            formulas : sqlalchemy.orm.query.Query
    -495                The query.
    -496            ion_type : str
    -497                The ion type.
    -498            ion_charge : int
    -499                The ion charge.
    -500            adduct_atom : str, optional
    -501                The adduct atom. Default is None.
    -502            
    -503            Returns
    -504            -------
    -505            dict
    -506                The dictionary of molecular formulas.
    -507            
    -508            """
    -509            "organize data by heteroatom classes"
    -510            dict_res = {}
    -511
    -512            def nominal_mass_by_ion_type(formula_obj):
    -513                
    -514                if ion_type == Labels.protonated_de_ion:
    -515                
    -516                    return int(formula_obj._protonated_mz(ion_charge))
    -517                
    -518                elif ion_type == Labels.radical_ion:
    -519                    
    -520                    return int(formula_obj._radical_mz(ion_charge))
    -521
    -522                elif ion_type == Labels.adduct_ion and adduct_atom:
    -523                    
    -524                    return int(formula_obj._adduct_mz(ion_charge, adduct_atom))
    -525            
    -526            for formula_obj, ch_obj, classe_obj in tqdm.tqdm(formulas, desc="Loading molecular formula database"):
    -527                
    -528                nominal_mz = nominal_mass_by_ion_type(formula_obj)
    -529                
    -530                if self.type != 'normal':
    -531                    if not nominal_mz in nominal_mzs:
    -532                        continue
    -533                classe = classe_obj.name
    -534
    -535                # classe_str = formula.classe_string
    -536                
    -537                # pbar.set_description_str(desc="Loading molecular formula database for class %s " % classe_str)
    -538                
    -539                formula_dict = formula_obj.to_dict()
    -540
    -541                if formula_dict.get("O"):
    -542                    
    -543                    if formula_dict.get("O") / formula_dict.get("C") >= molecular_search_settings.max_oc_filter:
    -544                        # print(formula_dict.get("O") / formula_dict.get("C"), molecular_search_settings.max_oc_filter)
    -545                        continue
    -546                    elif formula_dict.get("O") / formula_dict.get("C") <= molecular_search_settings.min_oc_filter:
    -547                        # print(formula_dict.get("O") / formula_dict.get("C"), molecular_search_settings.min_oc_filter)
    -548                        continue
    -549                    #if formula_dict.get("P"):
    -550
    -551                    #    if  not (formula_dict.get("O") -2)/ formula_dict.get("P") >= molecular_search_settings.min_op_filter:
    -552                            
    -553                    #        continue
    -554        
    -555                if classe in dict_res.keys():
    -556                    
    -557                    if nominal_mz in dict_res[classe].keys():
    -558                        
    -559                        dict_res.get(classe).get(nominal_mz).append(formula_obj)
    -560                    
    -561                    else:
    -562
    -563                        dict_res.get(classe)[nominal_mz] = [formula_obj ]  
    -564            
    -565                else:
    -566                    
    -567                    dict_res[classe] = {nominal_mz: [formula_obj] }     
    -568            
    -569            return dict_res
    -570        
    +            
    273class MolForm_SQL:
    +274    """ MolForm_SQL class for the SQLite database.
    +275    
    +276    Attributes
    +277    ----------
    +278    engine : sqlalchemy.engine.base.Engine
    +279        The SQLAlchemy engine.
    +280    session : sqlalchemy.orm.session.Session
    +281        The SQLAlchemy session.
    +282    type : str
    +283        The type of database.
    +284    chunks_count : int
    +285        The number of chunks to use when querying the database.
    +286    
    +287    Methods
    +288    -------
    +289    * __init__(url=None, echo=False)
    +290        Initializes the database.
    +291    * __exit__(exc_type, exc_val, exc_tb)
    +292        Closes the database.
    +293    * initiate_database(url, database_name)
    +294        Creates the database.
    +295    * commit()
    +296        Commits the session.
    +297    * init_engine(url)
    +298        Initializes the SQLAlchemy engine.
    +299    * __enter__()
    +300
    +301    * get_dict_by_classes(classes, ion_type, nominal_mzs, ion_charge, molecular_search_settings, adducts=None)
    +302        Returns a dictionary of molecular formulas.
    +303    * check_entry(classe, ion_type, molecular_search_settings)
    +304        Checks if a molecular formula is in the database.
    +305    * get_all_classes()
    +306        Returns a list of all classes in the database.
    +307    * get_all()
    +308        Returns a list of all molecular formulas in the database.
    +309    * delete_entry(row)
    +310        Deletes a molecular formula from the database.
    +311    * purge(cls)
    +312        Deletes all molecular formulas from the database.
    +313    * clear_data()
    +314        Clears the database.
    +315    * close(commit=True)
    +316        Closes the database.
    +317    * add_engine_pidguard(engine)
    +318        Adds multiprocessing guards.
    +319    
    +320    """
    +321    def __init__(self, url=None, echo=False):
    +322
    +323        self.engine = self.init_engine(url)
    +324
    +325        self.add_engine_pidguard(self.engine)
    +326
    +327        session_factory = sessionmaker(bind=self.engine)
    +328
    +329        Session = scoped_session(session_factory)
    +330
    +331        self.session = session_factory()
    +332
    +333        Base.metadata.create_all(self.engine)
    +334
    +335        self.session.commit()
    +336
    +337    def __exit__(self, exc_type, exc_val, exc_tb):
    +338        """ Closes the database.
    +339        
    +340        Parameters
    +341        ----------
    +342        exc_type : str
    +343            The exception type.
    +344        exc_val : str
    +345            The exception value.
    +346        exc_tb : str
    +347            The exception traceback.
    +348        """
    +349        # make sure the dbconnection gets closed
    +350
    +351        self.commit()
    +352        self.session.close()
    +353        self.engine.dispose()
    +354
    +355    def initiate_database(self, url, database_name):  #CREATION
    +356        """ Creates the database.
    +357        
    +358        Parameters
    +359        ----------
    +360        url : str
    +361            The URL for the database.
    +362        database_name : str
    +363            The name of the database.
    +364        """
    +365        engine = create_engine(url)
    +366        conn = engine.connect()
    +367        conn.execute("commit")
    +368        conn.execute("create database " + database_name)
    +369        conn.close()
    +370
    +371    def commit(self):
    +372        """ Commits the session.
    +373        """
    +374        try:
    +375            self.session.commit()  
    +376        except SQLAlchemyError as e:
    +377            self.session.rollback()
    +378            print(str(e))
    +379
    +380    def init_engine(self, url):
    +381        """ Initializes the SQLAlchemy engine.
    +382        
    +383        Parameters
    +384        ----------
    +385        url : str
    +386            The URL for the database.
    +387        
    +388        Returns
    +389        -------
    +390        sqlalchemy.engine.base.Engine
    +391            The SQLAlchemy engine.
    +392        
    +393        """
    +394        if not url or url == 'None' or url == 'False':
    +395            directory = os.getcwd()
    +396
    +397            if not os.path.isdir(directory + '/db'):
    +398                os.mkdir(directory + '/db')
    +399
    +400            url = 'sqlite:///{DB}/db/molformulas.sqlite'.format(DB=directory)
    +401
    +402        if url[0:6] == 'sqlite':
    +403            self.type = 'sqlite'
    +404        else:
    +405            self.type = 'normal'
    +406            
    +407        if url[0:6] == 'sqlite':
    +408            engine = create_engine(url, echo = False)
    +409            self.chunks_count = 50
    +410        
    +411        elif url[0:10] == 'postgresql' or url[0:8] == 'postgres':
    +412            #postgresql
    +413            self.chunks_count = 50000
    +414            engine = create_engine(url, echo = False, isolation_level="AUTOCOMMIT")
    +415        
    +416        return engine# poolclass=NullPool
    +417
    +418    def __enter__(self):
    +419        """ Returns the object.
    +420        """
    +421        return self
    +422    
    +423    def get_dict_by_classes(self, classes, ion_type, nominal_mzs, ion_charge, molecular_search_settings, adducts=None):
    +424        """ Returns a dictionary of molecular formulas.
    +425        
    +426        Parameters
    +427        ----------
    +428        classes : list
    +429            The list of classes.
    +430        ion_type : str
    +431            The ion type.
    +432        nominal_mzs : list
    +433            The list of nominal m/z values.
    +434        ion_charge : int
    +435            The ion charge.
    +436        molecular_search_settings : MolecularFormulaSearchSettings
    +437            The molecular formula search settings.
    +438        adducts : list, optional
    +439            The list of adducts. Default is None.
    +440        
    +441        Returns
    +442        -------
    +443        dict
    +444            The dictionary of molecular formulas.
    +445        
    +446        Notes
    +447        -----
    +448        Known issue, when using SQLite:
    +449        if the number of classes and nominal_m/zs are higher than 999 the query will fail
    +450        Solution: use postgres or split query
    +451        """                     
    +452         
    +453        def query_normal(class_list, len_adduct):
    +454            """ query for normal database
    +455            
    +456            Parameters
    +457            ----------
    +458            class_list : list
    +459                The list of classes.
    +460            len_adduct : int
    +461                The length of the adduct.
    +462            
    +463            Returns
    +464            -------
    +465            sqlalchemy.orm.query.Query
    +466                The query.
    +467            """
    +468            base_query = self.session.query(MolecularFormulaLink, CarbonHydrogen, HeteroAtoms)\
    +469                                .filter(MolecularFormulaLink.carbonHydrogen_id == CarbonHydrogen.id)\
    +470                                .filter(MolecularFormulaLink.heteroAtoms_id == HeteroAtoms.id)
    +471            
    +472            return base_query.filter(
    +473                and_(
    +474                    HeteroAtoms.name.in_(class_list), 
    +475                    and_(
    +476                        MolecularFormulaLink.DBE >= molecular_search_settings.min_dbe, 
    +477                        MolecularFormulaLink.DBE <= molecular_search_settings.max_dbe, 
    +478                        and_(
    +479                            ((CarbonHydrogen.h + HeteroAtoms.halogens_count - len_adduct) / CarbonHydrogen.c) >= molecular_search_settings.min_hc_filter,
    +480                            ((CarbonHydrogen.h + HeteroAtoms.halogens_count - len_adduct) / CarbonHydrogen.c) <= molecular_search_settings.max_hc_filter,
    +481                            CarbonHydrogen.C >= molecular_search_settings.usedAtoms.get("C")[0],
    +482                            CarbonHydrogen.c <= molecular_search_settings.usedAtoms.get("C")[1],
    +483                            CarbonHydrogen.h >= molecular_search_settings.usedAtoms.get("H")[0],
    +484                            CarbonHydrogen.h <= molecular_search_settings.usedAtoms.get("H")[1],
    +485                        )
    +486                    )
    +487                )
    +488            )
    +489
    +490        def add_dict_formula(formulas, ion_type, ion_charge, adduct_atom=None):
    +491            """ add molecular formula to dict
    +492            
    +493            Parameters
    +494            ----------
    +495            formulas : sqlalchemy.orm.query.Query
    +496                The query.
    +497            ion_type : str
    +498                The ion type.
    +499            ion_charge : int
    +500                The ion charge.
    +501            adduct_atom : str, optional
    +502                The adduct atom. Default is None.
    +503            
    +504            Returns
    +505            -------
    +506            dict
    +507                The dictionary of molecular formulas.
    +508            
    +509            """
    +510            "organize data by heteroatom classes"
    +511            dict_res = {}
    +512
    +513            def nominal_mass_by_ion_type(formula_obj):
    +514                
    +515                if ion_type == Labels.protonated_de_ion:
    +516                
    +517                    return int(formula_obj._protonated_mz(ion_charge))
    +518                
    +519                elif ion_type == Labels.radical_ion:
    +520                    
    +521                    return int(formula_obj._radical_mz(ion_charge))
    +522
    +523                elif ion_type == Labels.adduct_ion and adduct_atom:
    +524                    
    +525                    return int(formula_obj._adduct_mz(ion_charge, adduct_atom))
    +526            
    +527            for formula_obj, ch_obj, classe_obj in tqdm.tqdm(formulas, desc="Loading molecular formula database"):
    +528                
    +529                nominal_mz = nominal_mass_by_ion_type(formula_obj)
    +530                
    +531                if self.type != 'normal':
    +532                    if not nominal_mz in nominal_mzs:
    +533                        continue
    +534                classe = classe_obj.name
    +535
    +536                # classe_str = formula.classe_string
    +537                
    +538                # pbar.set_description_str(desc="Loading molecular formula database for class %s " % classe_str)
    +539                
    +540                formula_dict = formula_obj.to_dict()
    +541
    +542                if formula_dict.get("O"):
    +543                    
    +544                    if formula_dict.get("O") / formula_dict.get("C") >= molecular_search_settings.max_oc_filter:
    +545                        # print(formula_dict.get("O") / formula_dict.get("C"), molecular_search_settings.max_oc_filter)
    +546                        continue
    +547                    elif formula_dict.get("O") / formula_dict.get("C") <= molecular_search_settings.min_oc_filter:
    +548                        # print(formula_dict.get("O") / formula_dict.get("C"), molecular_search_settings.min_oc_filter)
    +549                        continue
    +550                    #if formula_dict.get("P"):
    +551
    +552                    #    if  not (formula_dict.get("O") -2)/ formula_dict.get("P") >= molecular_search_settings.min_op_filter:
    +553                            
    +554                    #        continue
    +555        
    +556                if classe in dict_res.keys():
    +557                    
    +558                    if nominal_mz in dict_res[classe].keys():
    +559                        
    +560                        dict_res.get(classe).get(nominal_mz).append(formula_obj)
    +561                    
    +562                    else:
    +563
    +564                        dict_res.get(classe)[nominal_mz] = [formula_obj ]  
    +565            
    +566                else:
    +567                    
    +568                    dict_res[classe] = {nominal_mz: [formula_obj] }     
    +569            
    +570            return dict_res
     571        
    -572        len_adducts = 0
    -573        if ion_type == Labels.adduct_ion:
    -574            len_adducts = 1
    -575        
    -576        query = query_normal(classes, len_adducts)
    -577
    -578        if ion_type == Labels.protonated_de_ion:
    -579            if self.type == 'normal':
    -580                query = query.filter(and_(
    -581                                MolecularFormulaLink._protonated_mz(ion_charge).cast(Integer).in_(nominal_mzs)
    -582                                ))
    -583            return add_dict_formula(query, ion_type, ion_charge)
    -584        
    -585        if ion_type == Labels.radical_ion:
    -586            if self.type == 'normal':
    -587                query = query.filter(MolecularFormulaLink._radical_mz(ion_charge).cast(Integer).in_(nominal_mzs))    
    -588            return add_dict_formula(query, ion_type, ion_charge)
    -589        
    -590        if ion_type == Labels.adduct_ion:
    -591            dict_res = {}
    -592            if adducts: 
    -593                for atom in adducts:
    -594                    if self.type == 'normal':
    -595                        query = query.filter(MolecularFormulaLink._adduct_mz(ion_charge, atom).cast(Integer).in_(nominal_mzs))    
    -596                    dict_res[atom] = add_dict_formula(query, ion_type, ion_charge, adduct_atom=atom)
    -597                return dict_res
    -598        # dump all objs to memory
    -599        self.session.expunge_all()
    -600        
    -601    def check_entry(self,classe, ion_type, molecular_search_settings):
    -602        """ Checks if a molecular formula is in the database.
    -603
    -604        Parameters
    -605        ----------
    -606        classe : str
    -607            The class of the molecular formula.
    -608        ion_type : str
    -609            The ion type.
    -610        molecular_search_settings : MolecularFormulaSearchSettings
    -611            The molecular formula search settings.
    -612        
    -613        Returns
    -614        -------
    -615        sqlalchemy.orm.query.Query
    -616            The query.
    -617        """
    -618        #  get all classes, ion_type, ion charge as str add to a dict or list
    -619        #  then check if class in database
    -620        has_class = self.session.query(exists().where(
    -621            (MolecularFormulaLink.classe == classe)))
    -622        
    -623        return has_class
    -624    
    -625    def get_all_classes(self):
    -626        """ Returns a list of all classes in the database."""
    -627        query = self.session.query(MolecularFormulaLink.classe.distinct().label("classe"))
    -628        
    -629        return query.all()  
    -630    
    -631    def get_all(self,):
    -632        """ Returns a list of all molecular formulas in the database."""
    -633        mol_formulas = self.session.query(MolecularFormulaLink).all()
    -634        
    -635        return mol_formulas
    -636
    -637    def delete_entry(self, row):
    -638        """ Deletes a molecular formula from the database."""
    -639        try:
    -640            self.session.delete(row)  
    -641            self.session.commit()  
    -642        
    -643        except SQLAlchemyError as e:
    -644            self.session.rollback()
    -645            print(str(e))
    -646
    -647    def purge(self, cls):
    -648        """ Deletes all molecular formulas from the database.
    -649        
    -650        Notes 
    -651        -------
    -652        Careful, this will delete the entire database table
    -653
    -654        """
    -655        self.session.query(cls).delete()
    -656        self.session.commit()  
    +572        
    +573        len_adducts = 0
    +574        if ion_type == Labels.adduct_ion:
    +575            len_adducts = 1
    +576        
    +577        query = query_normal(classes, len_adducts)
    +578        
    +579        if ion_type == Labels.protonated_de_ion:
    +580            if self.type == 'normal':
    +581                
    +582                query = query.filter(
    +583                                func.floor(MolecularFormulaLink._protonated_mz(ion_charge)).in_(nominal_mzs)
    +584                                )
    +585                                
    +586                                
    +587            return add_dict_formula(query, ion_type, ion_charge)
    +588        
    +589        if ion_type == Labels.radical_ion:
    +590            if self.type == 'normal':
    +591                query = query.filter(func.floor(MolecularFormulaLink._radical_mz(ion_charge)).in_(nominal_mzs))
    +592            return add_dict_formula(query, ion_type, ion_charge)
    +593        
    +594        if ion_type == Labels.adduct_ion:
    +595            dict_res = {}
    +596            if adducts: 
    +597                for atom in adducts:
    +598                    if self.type == 'normal':
    +599                        query = query.filter(func.floor(MolecularFormulaLink._adduct_mz(ion_charge, atom)).in_(nominal_mzs))    
    +600                    dict_res[atom] = add_dict_formula(query, ion_type, ion_charge, adduct_atom=atom)
    +601                return dict_res
    +602        # dump all objs to memory
    +603        self.session.expunge_all()
    +604        
    +605    def check_entry(self,classe, ion_type, molecular_search_settings):
    +606        """ Checks if a molecular formula is in the database.
    +607
    +608        Parameters
    +609        ----------
    +610        classe : str
    +611            The class of the molecular formula.
    +612        ion_type : str
    +613            The ion type.
    +614        molecular_search_settings : MolecularFormulaSearchSettings
    +615            The molecular formula search settings.
    +616        
    +617        Returns
    +618        -------
    +619        sqlalchemy.orm.query.Query
    +620            The query.
    +621        """
    +622        #  get all classes, ion_type, ion charge as str add to a dict or list
    +623        #  then check if class in database
    +624        has_class = self.session.query(exists().where(
    +625            (MolecularFormulaLink.classe == classe)))
    +626        
    +627        return has_class
    +628    
    +629    def get_all_classes(self):
    +630        """ Returns a list of all classes in the database."""
    +631        query = self.session.query(MolecularFormulaLink.classe.distinct().label("classe"))
    +632        
    +633        return query.all()  
    +634    
    +635    def get_all(self,):
    +636        """ Returns a list of all molecular formulas in the database."""
    +637        mol_formulas = self.session.query(MolecularFormulaLink).all()
    +638        
    +639        return mol_formulas
    +640
    +641    def delete_entry(self, row):
    +642        """ Deletes a molecular formula from the database."""
    +643        try:
    +644            self.session.delete(row)  
    +645            self.session.commit()  
    +646        
    +647        except SQLAlchemyError as e:
    +648            self.session.rollback()
    +649            print(str(e))
    +650
    +651    def purge(self, cls):
    +652        """ Deletes all molecular formulas from the database.
    +653        
    +654        Notes 
    +655        -------
    +656        Careful, this will delete the entire database table
     657
    -658    def clear_data(self):
    -659        """ Clears the database.
    -660        """
    -661        meta = Base.metadata
    -662        for table in reversed(meta.sorted_tables):
    -663            print ('Clear table %s' % table)
    -664            self.session.execute(table.delete())
    -665        self.session.commit()
    -666
    -667    def close(self, commit=True):
    -668        """ Closes the database.
    -669        
    -670        Parameters
    -671        ----------
    -672        commit : bool, optional
    -673            Whether to commit the session. Default is True.
    -674        """
    -675        # make sure the dbconnection gets closed
    -676        
    -677        if commit: self.commit()
    -678        self.session.close()
    -679        self.engine.dispose()    
    -680   
    -681    def add_engine_pidguard(self, engine):
    -682        """ Adds multiprocessing guards.
    -683        
    -684        Forces a connection to be reconnected if it is detected
    -685        as having been shared to a sub-process.
    -686
    -687        Parameters
    -688        ----------
    -689        engine : sqlalchemy.engine.base.Engine
    -690            The SQLAlchemy engine.
    -691        
    -692        """
    -693        import os, warnings
    -694     
    -695
    -696        @event.listens_for(engine, "connect")
    -697        def connect(dbapi_connection, connection_record):
    -698            """ Forces a connection to be reconnected if it is detected
    -699            
    -700            Parameters
    -701            ----------
    -702            dbapi_connection : sqlalchemy.engine.base.Engine
    -703                The SQLAlchemy engine.
    -704            connection_record : sqlalchemy.engine.base.Engine
    -705                The SQLAlchemy engine.
    -706            """
    -707            connection_record.info['pid'] = os.getpid()
    -708
    -709        @event.listens_for(engine, "checkout")
    -710        def checkout(dbapi_connection, connection_record, connection_proxy):
    -711            """ Forces a connection to be reconnected if it is detected
    -712            
    -713            Parameters
    -714            ----------
    -715            dbapi_connection : sqlalchemy.engine.base.Engine
    -716                The SQLAlchemy engine.
    -717            connection_record : sqlalchemy.engine.base.Engine
    -718                The SQLAlchemy engine.
    -719            connection_proxy : sqlalchemy.engine.base.Engine
    +658        """
    +659        self.session.query(cls).delete()
    +660        self.session.commit()  
    +661
    +662    def clear_data(self):
    +663        """ Clears the database.
    +664        """
    +665        meta = Base.metadata
    +666        for table in reversed(meta.sorted_tables):
    +667            print ('Clear table %s' % table)
    +668            self.session.execute(table.delete())
    +669        self.session.commit()
    +670
    +671    def close(self, commit=True):
    +672        """ Closes the database.
    +673        
    +674        Parameters
    +675        ----------
    +676        commit : bool, optional
    +677            Whether to commit the session. Default is True.
    +678        """
    +679        # make sure the dbconnection gets closed
    +680        
    +681        if commit: self.commit()
    +682        self.session.close()
    +683        self.engine.dispose()    
    +684   
    +685    def add_engine_pidguard(self, engine):
    +686        """ Adds multiprocessing guards.
    +687        
    +688        Forces a connection to be reconnected if it is detected
    +689        as having been shared to a sub-process.
    +690
    +691        Parameters
    +692        ----------
    +693        engine : sqlalchemy.engine.base.Engine
    +694            The SQLAlchemy engine.
    +695        
    +696        """
    +697        import os, warnings
    +698     
    +699
    +700        @event.listens_for(engine, "connect")
    +701        def connect(dbapi_connection, connection_record):
    +702            """ Forces a connection to be reconnected if it is detected
    +703            
    +704            Parameters
    +705            ----------
    +706            dbapi_connection : sqlalchemy.engine.base.Engine
    +707                The SQLAlchemy engine.
    +708            connection_record : sqlalchemy.engine.base.Engine
    +709                The SQLAlchemy engine.
    +710            """
    +711            connection_record.info['pid'] = os.getpid()
    +712
    +713        @event.listens_for(engine, "checkout")
    +714        def checkout(dbapi_connection, connection_record, connection_proxy):
    +715            """ Forces a connection to be reconnected if it is detected
    +716            
    +717            Parameters
    +718            ----------
    +719            dbapi_connection : sqlalchemy.engine.base.Engine
     720                The SQLAlchemy engine.
    -721            
    -722            Raises
    -723            ------
    -724            exc.DisconnectionError
    -725                If the connection record belongs to a different process.
    -726            
    -727            """
    -728            pid = os.getpid()
    -729            if connection_record.info['pid'] != pid:
    -730                # substitute log.debug() or similar here as desired
    -731                warnings.warn(
    -732                    "Parent process %(orig)s forked (%(newproc)s) with an open "
    -733                    "database connection, "
    -734                    "which is being discarded and recreated." %
    -735                    {"newproc": pid, "orig": connection_record.info['pid']})
    -736                connection_record.connection = connection_proxy.connection = None
    -737                raise exc.DisconnectionError(
    -738                    "Connection record belongs to pid %s, "
    -739                    "attempting to check out in pid %s" %
    -740                    (connection_record.info['pid'], pid)
    -741                )    
    +721            connection_record : sqlalchemy.engine.base.Engine
    +722                The SQLAlchemy engine.
    +723            connection_proxy : sqlalchemy.engine.base.Engine
    +724                The SQLAlchemy engine.
    +725            
    +726            Raises
    +727            ------
    +728            exc.DisconnectionError
    +729                If the connection record belongs to a different process.
    +730            
    +731            """
    +732            pid = os.getpid()
    +733            if connection_record.info['pid'] != pid:
    +734                # substitute log.debug() or similar here as desired
    +735                warnings.warn(
    +736                    "Parent process %(orig)s forked (%(newproc)s) with an open "
    +737                    "database connection, "
    +738                    "which is being discarded and recreated." %
    +739                    {"newproc": pid, "orig": connection_record.info['pid']})
    +740                connection_record.connection = connection_proxy.connection = None
    +741                raise exc.DisconnectionError(
    +742                    "Connection record belongs to pid %s, "
    +743                    "attempting to check out in pid %s" %
    +744                    (connection_record.info['pid'], pid)
    +745                )    
     
    @@ -2447,21 +2454,21 @@
    Methods
    -
    320    def __init__(self, url=None, echo=False):
    -321
    -322        self.engine = self.init_engine(url)
    -323
    -324        self.add_engine_pidguard(self.engine)
    -325
    -326        session_factory = sessionmaker(bind=self.engine)
    -327
    -328        Session = scoped_session(session_factory)
    -329
    -330        self.session = session_factory()
    -331
    -332        Base.metadata.create_all(self.engine)
    -333
    -334        self.session.commit()
    +            
    321    def __init__(self, url=None, echo=False):
    +322
    +323        self.engine = self.init_engine(url)
    +324
    +325        self.add_engine_pidguard(self.engine)
    +326
    +327        session_factory = sessionmaker(bind=self.engine)
    +328
    +329        Session = scoped_session(session_factory)
    +330
    +331        self.session = session_factory()
    +332
    +333        Base.metadata.create_all(self.engine)
    +334
    +335        self.session.commit()
     
    @@ -2501,21 +2508,21 @@
    Methods
    -
    354    def initiate_database(self, url, database_name):  #CREATION
    -355        """ Creates the database.
    -356        
    -357        Parameters
    -358        ----------
    -359        url : str
    -360            The URL for the database.
    -361        database_name : str
    -362            The name of the database.
    -363        """
    -364        engine = create_engine(url)
    -365        conn = engine.connect()
    -366        conn.execute("commit")
    -367        conn.execute("create database " + database_name)
    -368        conn.close()
    +            
    355    def initiate_database(self, url, database_name):  #CREATION
    +356        """ Creates the database.
    +357        
    +358        Parameters
    +359        ----------
    +360        url : str
    +361            The URL for the database.
    +362        database_name : str
    +363            The name of the database.
    +364        """
    +365        engine = create_engine(url)
    +366        conn = engine.connect()
    +367        conn.execute("commit")
    +368        conn.execute("create database " + database_name)
    +369        conn.close()
     
    @@ -2544,14 +2551,14 @@
    Parameters
    -
    370    def commit(self):
    -371        """ Commits the session.
    -372        """
    -373        try:
    -374            self.session.commit()  
    -375        except SQLAlchemyError as e:
    -376            self.session.rollback()
    -377            print(str(e))
    +            
    371    def commit(self):
    +372        """ Commits the session.
    +373        """
    +374        try:
    +375            self.session.commit()  
    +376        except SQLAlchemyError as e:
    +377            self.session.rollback()
    +378            print(str(e))
     
    @@ -2571,43 +2578,43 @@
    Parameters
    -
    379    def init_engine(self, url):
    -380        """ Initializes the SQLAlchemy engine.
    -381        
    -382        Parameters
    -383        ----------
    -384        url : str
    -385            The URL for the database.
    -386        
    -387        Returns
    -388        -------
    -389        sqlalchemy.engine.base.Engine
    -390            The SQLAlchemy engine.
    -391        
    -392        """
    -393        if not url or url == 'None' or url == 'False':
    -394            directory = os.getcwd()
    -395
    -396            if not os.path.isdir(directory + '/db'):
    -397                os.mkdir(directory + '/db')
    -398
    -399            url = 'sqlite:///{DB}/db/molformulas.sqlite'.format(DB=directory)
    -400
    -401        if url[0:6] == 'sqlite':
    -402            self.type = 'sqlite'
    -403        else:
    -404            self.type = 'normal'
    -405            
    -406        if url[0:6] == 'sqlite':
    -407            engine = create_engine(url, echo = False)
    -408            self.chunks_count = 50
    -409        
    -410        elif url[0:10] == 'postgresql' or url[0:8] == 'postgres':
    -411            #postgresql
    -412            self.chunks_count = 50000
    -413            engine = create_engine(url, echo = False, isolation_level="AUTOCOMMIT")
    -414        
    -415        return engine# poolclass=NullPool
    +            
    380    def init_engine(self, url):
    +381        """ Initializes the SQLAlchemy engine.
    +382        
    +383        Parameters
    +384        ----------
    +385        url : str
    +386            The URL for the database.
    +387        
    +388        Returns
    +389        -------
    +390        sqlalchemy.engine.base.Engine
    +391            The SQLAlchemy engine.
    +392        
    +393        """
    +394        if not url or url == 'None' or url == 'False':
    +395            directory = os.getcwd()
    +396
    +397            if not os.path.isdir(directory + '/db'):
    +398                os.mkdir(directory + '/db')
    +399
    +400            url = 'sqlite:///{DB}/db/molformulas.sqlite'.format(DB=directory)
    +401
    +402        if url[0:6] == 'sqlite':
    +403            self.type = 'sqlite'
    +404        else:
    +405            self.type = 'normal'
    +406            
    +407        if url[0:6] == 'sqlite':
    +408            engine = create_engine(url, echo = False)
    +409            self.chunks_count = 50
    +410        
    +411        elif url[0:10] == 'postgresql' or url[0:8] == 'postgres':
    +412            #postgresql
    +413            self.chunks_count = 50000
    +414            engine = create_engine(url, echo = False, isolation_level="AUTOCOMMIT")
    +415        
    +416        return engine# poolclass=NullPool
     
    @@ -2640,184 +2647,187 @@
    Returns
    -
    422    def get_dict_by_classes(self, classes, ion_type, nominal_mzs, ion_charge, molecular_search_settings, adducts=None):
    -423        """ Returns a dictionary of molecular formulas.
    -424        
    -425        Parameters
    -426        ----------
    -427        classes : list
    -428            The list of classes.
    -429        ion_type : str
    -430            The ion type.
    -431        nominal_mzs : list
    -432            The list of nominal m/z values.
    -433        ion_charge : int
    -434            The ion charge.
    -435        molecular_search_settings : MolecularFormulaSearchSettings
    -436            The molecular formula search settings.
    -437        adducts : list, optional
    -438            The list of adducts. Default is None.
    -439        
    -440        Returns
    -441        -------
    -442        dict
    -443            The dictionary of molecular formulas.
    -444        
    -445        Notes
    -446        -----
    -447        Known issue, when using SQLite:
    -448        if the number of classes and nominal_m/zs are higher than 999 the query will fail
    -449        Solution: use postgres or split query
    -450        """                     
    -451         
    -452        def query_normal(class_list, len_adduct):
    -453            """ query for normal database
    -454            
    -455            Parameters
    -456            ----------
    -457            class_list : list
    -458                The list of classes.
    -459            len_adduct : int
    -460                The length of the adduct.
    -461            
    -462            Returns
    -463            -------
    -464            sqlalchemy.orm.query.Query
    -465                The query.
    -466            """
    -467            base_query = self.session.query(MolecularFormulaLink, CarbonHydrogen, HeteroAtoms)\
    -468                                .filter(MolecularFormulaLink.carbonHydrogen_id == CarbonHydrogen.id)\
    -469                                .filter(MolecularFormulaLink.heteroAtoms_id == HeteroAtoms.id)
    -470            
    -471            return base_query.filter(
    -472                and_(
    -473                    HeteroAtoms.name.in_(class_list), 
    -474                    and_(
    -475                        MolecularFormulaLink.DBE >= molecular_search_settings.min_dbe, 
    -476                        MolecularFormulaLink.DBE <= molecular_search_settings.max_dbe, 
    -477                        and_(
    -478                            ((CarbonHydrogen.h + HeteroAtoms.halogens_count - len_adduct) / CarbonHydrogen.c) >= molecular_search_settings.min_hc_filter,
    -479                            ((CarbonHydrogen.h + HeteroAtoms.halogens_count - len_adduct) / CarbonHydrogen.c) <= molecular_search_settings.max_hc_filter,
    -480                            CarbonHydrogen.C >= molecular_search_settings.usedAtoms.get("C")[0],
    -481                            CarbonHydrogen.c <= molecular_search_settings.usedAtoms.get("C")[1],
    -482                            CarbonHydrogen.h >= molecular_search_settings.usedAtoms.get("H")[0],
    -483                            CarbonHydrogen.h <= molecular_search_settings.usedAtoms.get("H")[1],
    -484                        )
    -485                    )
    -486                )
    -487            )
    -488
    -489        def add_dict_formula(formulas, ion_type, ion_charge, adduct_atom=None):
    -490            """ add molecular formula to dict
    -491            
    -492            Parameters
    -493            ----------
    -494            formulas : sqlalchemy.orm.query.Query
    -495                The query.
    -496            ion_type : str
    -497                The ion type.
    -498            ion_charge : int
    -499                The ion charge.
    -500            adduct_atom : str, optional
    -501                The adduct atom. Default is None.
    -502            
    -503            Returns
    -504            -------
    -505            dict
    -506                The dictionary of molecular formulas.
    -507            
    -508            """
    -509            "organize data by heteroatom classes"
    -510            dict_res = {}
    -511
    -512            def nominal_mass_by_ion_type(formula_obj):
    -513                
    -514                if ion_type == Labels.protonated_de_ion:
    -515                
    -516                    return int(formula_obj._protonated_mz(ion_charge))
    -517                
    -518                elif ion_type == Labels.radical_ion:
    -519                    
    -520                    return int(formula_obj._radical_mz(ion_charge))
    -521
    -522                elif ion_type == Labels.adduct_ion and adduct_atom:
    -523                    
    -524                    return int(formula_obj._adduct_mz(ion_charge, adduct_atom))
    -525            
    -526            for formula_obj, ch_obj, classe_obj in tqdm.tqdm(formulas, desc="Loading molecular formula database"):
    -527                
    -528                nominal_mz = nominal_mass_by_ion_type(formula_obj)
    -529                
    -530                if self.type != 'normal':
    -531                    if not nominal_mz in nominal_mzs:
    -532                        continue
    -533                classe = classe_obj.name
    -534
    -535                # classe_str = formula.classe_string
    -536                
    -537                # pbar.set_description_str(desc="Loading molecular formula database for class %s " % classe_str)
    -538                
    -539                formula_dict = formula_obj.to_dict()
    -540
    -541                if formula_dict.get("O"):
    -542                    
    -543                    if formula_dict.get("O") / formula_dict.get("C") >= molecular_search_settings.max_oc_filter:
    -544                        # print(formula_dict.get("O") / formula_dict.get("C"), molecular_search_settings.max_oc_filter)
    -545                        continue
    -546                    elif formula_dict.get("O") / formula_dict.get("C") <= molecular_search_settings.min_oc_filter:
    -547                        # print(formula_dict.get("O") / formula_dict.get("C"), molecular_search_settings.min_oc_filter)
    -548                        continue
    -549                    #if formula_dict.get("P"):
    -550
    -551                    #    if  not (formula_dict.get("O") -2)/ formula_dict.get("P") >= molecular_search_settings.min_op_filter:
    -552                            
    -553                    #        continue
    -554        
    -555                if classe in dict_res.keys():
    -556                    
    -557                    if nominal_mz in dict_res[classe].keys():
    -558                        
    -559                        dict_res.get(classe).get(nominal_mz).append(formula_obj)
    -560                    
    -561                    else:
    -562
    -563                        dict_res.get(classe)[nominal_mz] = [formula_obj ]  
    -564            
    -565                else:
    -566                    
    -567                    dict_res[classe] = {nominal_mz: [formula_obj] }     
    -568            
    -569            return dict_res
    -570        
    +            
    423    def get_dict_by_classes(self, classes, ion_type, nominal_mzs, ion_charge, molecular_search_settings, adducts=None):
    +424        """ Returns a dictionary of molecular formulas.
    +425        
    +426        Parameters
    +427        ----------
    +428        classes : list
    +429            The list of classes.
    +430        ion_type : str
    +431            The ion type.
    +432        nominal_mzs : list
    +433            The list of nominal m/z values.
    +434        ion_charge : int
    +435            The ion charge.
    +436        molecular_search_settings : MolecularFormulaSearchSettings
    +437            The molecular formula search settings.
    +438        adducts : list, optional
    +439            The list of adducts. Default is None.
    +440        
    +441        Returns
    +442        -------
    +443        dict
    +444            The dictionary of molecular formulas.
    +445        
    +446        Notes
    +447        -----
    +448        Known issue, when using SQLite:
    +449        if the number of classes and nominal_m/zs are higher than 999 the query will fail
    +450        Solution: use postgres or split query
    +451        """                     
    +452         
    +453        def query_normal(class_list, len_adduct):
    +454            """ query for normal database
    +455            
    +456            Parameters
    +457            ----------
    +458            class_list : list
    +459                The list of classes.
    +460            len_adduct : int
    +461                The length of the adduct.
    +462            
    +463            Returns
    +464            -------
    +465            sqlalchemy.orm.query.Query
    +466                The query.
    +467            """
    +468            base_query = self.session.query(MolecularFormulaLink, CarbonHydrogen, HeteroAtoms)\
    +469                                .filter(MolecularFormulaLink.carbonHydrogen_id == CarbonHydrogen.id)\
    +470                                .filter(MolecularFormulaLink.heteroAtoms_id == HeteroAtoms.id)
    +471            
    +472            return base_query.filter(
    +473                and_(
    +474                    HeteroAtoms.name.in_(class_list), 
    +475                    and_(
    +476                        MolecularFormulaLink.DBE >= molecular_search_settings.min_dbe, 
    +477                        MolecularFormulaLink.DBE <= molecular_search_settings.max_dbe, 
    +478                        and_(
    +479                            ((CarbonHydrogen.h + HeteroAtoms.halogens_count - len_adduct) / CarbonHydrogen.c) >= molecular_search_settings.min_hc_filter,
    +480                            ((CarbonHydrogen.h + HeteroAtoms.halogens_count - len_adduct) / CarbonHydrogen.c) <= molecular_search_settings.max_hc_filter,
    +481                            CarbonHydrogen.C >= molecular_search_settings.usedAtoms.get("C")[0],
    +482                            CarbonHydrogen.c <= molecular_search_settings.usedAtoms.get("C")[1],
    +483                            CarbonHydrogen.h >= molecular_search_settings.usedAtoms.get("H")[0],
    +484                            CarbonHydrogen.h <= molecular_search_settings.usedAtoms.get("H")[1],
    +485                        )
    +486                    )
    +487                )
    +488            )
    +489
    +490        def add_dict_formula(formulas, ion_type, ion_charge, adduct_atom=None):
    +491            """ add molecular formula to dict
    +492            
    +493            Parameters
    +494            ----------
    +495            formulas : sqlalchemy.orm.query.Query
    +496                The query.
    +497            ion_type : str
    +498                The ion type.
    +499            ion_charge : int
    +500                The ion charge.
    +501            adduct_atom : str, optional
    +502                The adduct atom. Default is None.
    +503            
    +504            Returns
    +505            -------
    +506            dict
    +507                The dictionary of molecular formulas.
    +508            
    +509            """
    +510            "organize data by heteroatom classes"
    +511            dict_res = {}
    +512
    +513            def nominal_mass_by_ion_type(formula_obj):
    +514                
    +515                if ion_type == Labels.protonated_de_ion:
    +516                
    +517                    return int(formula_obj._protonated_mz(ion_charge))
    +518                
    +519                elif ion_type == Labels.radical_ion:
    +520                    
    +521                    return int(formula_obj._radical_mz(ion_charge))
    +522
    +523                elif ion_type == Labels.adduct_ion and adduct_atom:
    +524                    
    +525                    return int(formula_obj._adduct_mz(ion_charge, adduct_atom))
    +526            
    +527            for formula_obj, ch_obj, classe_obj in tqdm.tqdm(formulas, desc="Loading molecular formula database"):
    +528                
    +529                nominal_mz = nominal_mass_by_ion_type(formula_obj)
    +530                
    +531                if self.type != 'normal':
    +532                    if not nominal_mz in nominal_mzs:
    +533                        continue
    +534                classe = classe_obj.name
    +535
    +536                # classe_str = formula.classe_string
    +537                
    +538                # pbar.set_description_str(desc="Loading molecular formula database for class %s " % classe_str)
    +539                
    +540                formula_dict = formula_obj.to_dict()
    +541
    +542                if formula_dict.get("O"):
    +543                    
    +544                    if formula_dict.get("O") / formula_dict.get("C") >= molecular_search_settings.max_oc_filter:
    +545                        # print(formula_dict.get("O") / formula_dict.get("C"), molecular_search_settings.max_oc_filter)
    +546                        continue
    +547                    elif formula_dict.get("O") / formula_dict.get("C") <= molecular_search_settings.min_oc_filter:
    +548                        # print(formula_dict.get("O") / formula_dict.get("C"), molecular_search_settings.min_oc_filter)
    +549                        continue
    +550                    #if formula_dict.get("P"):
    +551
    +552                    #    if  not (formula_dict.get("O") -2)/ formula_dict.get("P") >= molecular_search_settings.min_op_filter:
    +553                            
    +554                    #        continue
    +555        
    +556                if classe in dict_res.keys():
    +557                    
    +558                    if nominal_mz in dict_res[classe].keys():
    +559                        
    +560                        dict_res.get(classe).get(nominal_mz).append(formula_obj)
    +561                    
    +562                    else:
    +563
    +564                        dict_res.get(classe)[nominal_mz] = [formula_obj ]  
    +565            
    +566                else:
    +567                    
    +568                    dict_res[classe] = {nominal_mz: [formula_obj] }     
    +569            
    +570            return dict_res
     571        
    -572        len_adducts = 0
    -573        if ion_type == Labels.adduct_ion:
    -574            len_adducts = 1
    -575        
    -576        query = query_normal(classes, len_adducts)
    -577
    -578        if ion_type == Labels.protonated_de_ion:
    -579            if self.type == 'normal':
    -580                query = query.filter(and_(
    -581                                MolecularFormulaLink._protonated_mz(ion_charge).cast(Integer).in_(nominal_mzs)
    -582                                ))
    -583            return add_dict_formula(query, ion_type, ion_charge)
    -584        
    -585        if ion_type == Labels.radical_ion:
    -586            if self.type == 'normal':
    -587                query = query.filter(MolecularFormulaLink._radical_mz(ion_charge).cast(Integer).in_(nominal_mzs))    
    -588            return add_dict_formula(query, ion_type, ion_charge)
    -589        
    -590        if ion_type == Labels.adduct_ion:
    -591            dict_res = {}
    -592            if adducts: 
    -593                for atom in adducts:
    -594                    if self.type == 'normal':
    -595                        query = query.filter(MolecularFormulaLink._adduct_mz(ion_charge, atom).cast(Integer).in_(nominal_mzs))    
    -596                    dict_res[atom] = add_dict_formula(query, ion_type, ion_charge, adduct_atom=atom)
    -597                return dict_res
    -598        # dump all objs to memory
    -599        self.session.expunge_all()
    +572        
    +573        len_adducts = 0
    +574        if ion_type == Labels.adduct_ion:
    +575            len_adducts = 1
    +576        
    +577        query = query_normal(classes, len_adducts)
    +578        
    +579        if ion_type == Labels.protonated_de_ion:
    +580            if self.type == 'normal':
    +581                
    +582                query = query.filter(
    +583                                func.floor(MolecularFormulaLink._protonated_mz(ion_charge)).in_(nominal_mzs)
    +584                                )
    +585                                
    +586                                
    +587            return add_dict_formula(query, ion_type, ion_charge)
    +588        
    +589        if ion_type == Labels.radical_ion:
    +590            if self.type == 'normal':
    +591                query = query.filter(func.floor(MolecularFormulaLink._radical_mz(ion_charge)).in_(nominal_mzs))
    +592            return add_dict_formula(query, ion_type, ion_charge)
    +593        
    +594        if ion_type == Labels.adduct_ion:
    +595            dict_res = {}
    +596            if adducts: 
    +597                for atom in adducts:
    +598                    if self.type == 'normal':
    +599                        query = query.filter(func.floor(MolecularFormulaLink._adduct_mz(ion_charge, atom)).in_(nominal_mzs))    
    +600                    dict_res[atom] = add_dict_formula(query, ion_type, ion_charge, adduct_atom=atom)
    +601                return dict_res
    +602        # dump all objs to memory
    +603        self.session.expunge_all()
     
    @@ -2866,29 +2876,29 @@
    Notes
    -
    601    def check_entry(self,classe, ion_type, molecular_search_settings):
    -602        """ Checks if a molecular formula is in the database.
    -603
    -604        Parameters
    -605        ----------
    -606        classe : str
    -607            The class of the molecular formula.
    -608        ion_type : str
    -609            The ion type.
    -610        molecular_search_settings : MolecularFormulaSearchSettings
    -611            The molecular formula search settings.
    -612        
    -613        Returns
    -614        -------
    -615        sqlalchemy.orm.query.Query
    -616            The query.
    -617        """
    -618        #  get all classes, ion_type, ion charge as str add to a dict or list
    -619        #  then check if class in database
    -620        has_class = self.session.query(exists().where(
    -621            (MolecularFormulaLink.classe == classe)))
    -622        
    -623        return has_class
    +            
    605    def check_entry(self,classe, ion_type, molecular_search_settings):
    +606        """ Checks if a molecular formula is in the database.
    +607
    +608        Parameters
    +609        ----------
    +610        classe : str
    +611            The class of the molecular formula.
    +612        ion_type : str
    +613            The ion type.
    +614        molecular_search_settings : MolecularFormulaSearchSettings
    +615            The molecular formula search settings.
    +616        
    +617        Returns
    +618        -------
    +619        sqlalchemy.orm.query.Query
    +620            The query.
    +621        """
    +622        #  get all classes, ion_type, ion charge as str add to a dict or list
    +623        #  then check if class in database
    +624        has_class = self.session.query(exists().where(
    +625            (MolecularFormulaLink.classe == classe)))
    +626        
    +627        return has_class
     
    @@ -2925,11 +2935,11 @@
    Returns
    -
    625    def get_all_classes(self):
    -626        """ Returns a list of all classes in the database."""
    -627        query = self.session.query(MolecularFormulaLink.classe.distinct().label("classe"))
    -628        
    -629        return query.all()  
    +            
    629    def get_all_classes(self):
    +630        """ Returns a list of all classes in the database."""
    +631        query = self.session.query(MolecularFormulaLink.classe.distinct().label("classe"))
    +632        
    +633        return query.all()  
     
    @@ -2949,11 +2959,11 @@
    Returns
    -
    631    def get_all(self,):
    -632        """ Returns a list of all molecular formulas in the database."""
    -633        mol_formulas = self.session.query(MolecularFormulaLink).all()
    -634        
    -635        return mol_formulas
    +            
    635    def get_all(self,):
    +636        """ Returns a list of all molecular formulas in the database."""
    +637        mol_formulas = self.session.query(MolecularFormulaLink).all()
    +638        
    +639        return mol_formulas
     
    @@ -2973,15 +2983,15 @@
    Returns
    -
    637    def delete_entry(self, row):
    -638        """ Deletes a molecular formula from the database."""
    -639        try:
    -640            self.session.delete(row)  
    -641            self.session.commit()  
    -642        
    -643        except SQLAlchemyError as e:
    -644            self.session.rollback()
    -645            print(str(e))
    +            
    641    def delete_entry(self, row):
    +642        """ Deletes a molecular formula from the database."""
    +643        try:
    +644            self.session.delete(row)  
    +645            self.session.commit()  
    +646        
    +647        except SQLAlchemyError as e:
    +648            self.session.rollback()
    +649            print(str(e))
     
    @@ -3001,16 +3011,16 @@
    Returns
    -
    647    def purge(self, cls):
    -648        """ Deletes all molecular formulas from the database.
    -649        
    -650        Notes 
    -651        -------
    -652        Careful, this will delete the entire database table
    -653
    -654        """
    -655        self.session.query(cls).delete()
    -656        self.session.commit()  
    +            
    651    def purge(self, cls):
    +652        """ Deletes all molecular formulas from the database.
    +653        
    +654        Notes 
    +655        -------
    +656        Careful, this will delete the entire database table
    +657
    +658        """
    +659        self.session.query(cls).delete()
    +660        self.session.commit()  
     
    @@ -3034,14 +3044,14 @@
    Notes
    -
    658    def clear_data(self):
    -659        """ Clears the database.
    -660        """
    -661        meta = Base.metadata
    -662        for table in reversed(meta.sorted_tables):
    -663            print ('Clear table %s' % table)
    -664            self.session.execute(table.delete())
    -665        self.session.commit()
    +            
    662    def clear_data(self):
    +663        """ Clears the database.
    +664        """
    +665        meta = Base.metadata
    +666        for table in reversed(meta.sorted_tables):
    +667            print ('Clear table %s' % table)
    +668            self.session.execute(table.delete())
    +669        self.session.commit()
     
    @@ -3061,19 +3071,19 @@
    Notes
    -
    667    def close(self, commit=True):
    -668        """ Closes the database.
    -669        
    -670        Parameters
    -671        ----------
    -672        commit : bool, optional
    -673            Whether to commit the session. Default is True.
    -674        """
    -675        # make sure the dbconnection gets closed
    -676        
    -677        if commit: self.commit()
    -678        self.session.close()
    -679        self.engine.dispose()    
    +            
    671    def close(self, commit=True):
    +672        """ Closes the database.
    +673        
    +674        Parameters
    +675        ----------
    +676        commit : bool, optional
    +677            Whether to commit the session. Default is True.
    +678        """
    +679        # make sure the dbconnection gets closed
    +680        
    +681        if commit: self.commit()
    +682        self.session.close()
    +683        self.engine.dispose()    
     
    @@ -3100,67 +3110,67 @@
    Parameters
    -
    681    def add_engine_pidguard(self, engine):
    -682        """ Adds multiprocessing guards.
    -683        
    -684        Forces a connection to be reconnected if it is detected
    -685        as having been shared to a sub-process.
    -686
    -687        Parameters
    -688        ----------
    -689        engine : sqlalchemy.engine.base.Engine
    -690            The SQLAlchemy engine.
    -691        
    -692        """
    -693        import os, warnings
    -694     
    -695
    -696        @event.listens_for(engine, "connect")
    -697        def connect(dbapi_connection, connection_record):
    -698            """ Forces a connection to be reconnected if it is detected
    -699            
    -700            Parameters
    -701            ----------
    -702            dbapi_connection : sqlalchemy.engine.base.Engine
    -703                The SQLAlchemy engine.
    -704            connection_record : sqlalchemy.engine.base.Engine
    -705                The SQLAlchemy engine.
    -706            """
    -707            connection_record.info['pid'] = os.getpid()
    -708
    -709        @event.listens_for(engine, "checkout")
    -710        def checkout(dbapi_connection, connection_record, connection_proxy):
    -711            """ Forces a connection to be reconnected if it is detected
    -712            
    -713            Parameters
    -714            ----------
    -715            dbapi_connection : sqlalchemy.engine.base.Engine
    -716                The SQLAlchemy engine.
    -717            connection_record : sqlalchemy.engine.base.Engine
    -718                The SQLAlchemy engine.
    -719            connection_proxy : sqlalchemy.engine.base.Engine
    +            
    685    def add_engine_pidguard(self, engine):
    +686        """ Adds multiprocessing guards.
    +687        
    +688        Forces a connection to be reconnected if it is detected
    +689        as having been shared to a sub-process.
    +690
    +691        Parameters
    +692        ----------
    +693        engine : sqlalchemy.engine.base.Engine
    +694            The SQLAlchemy engine.
    +695        
    +696        """
    +697        import os, warnings
    +698     
    +699
    +700        @event.listens_for(engine, "connect")
    +701        def connect(dbapi_connection, connection_record):
    +702            """ Forces a connection to be reconnected if it is detected
    +703            
    +704            Parameters
    +705            ----------
    +706            dbapi_connection : sqlalchemy.engine.base.Engine
    +707                The SQLAlchemy engine.
    +708            connection_record : sqlalchemy.engine.base.Engine
    +709                The SQLAlchemy engine.
    +710            """
    +711            connection_record.info['pid'] = os.getpid()
    +712
    +713        @event.listens_for(engine, "checkout")
    +714        def checkout(dbapi_connection, connection_record, connection_proxy):
    +715            """ Forces a connection to be reconnected if it is detected
    +716            
    +717            Parameters
    +718            ----------
    +719            dbapi_connection : sqlalchemy.engine.base.Engine
     720                The SQLAlchemy engine.
    -721            
    -722            Raises
    -723            ------
    -724            exc.DisconnectionError
    -725                If the connection record belongs to a different process.
    -726            
    -727            """
    -728            pid = os.getpid()
    -729            if connection_record.info['pid'] != pid:
    -730                # substitute log.debug() or similar here as desired
    -731                warnings.warn(
    -732                    "Parent process %(orig)s forked (%(newproc)s) with an open "
    -733                    "database connection, "
    -734                    "which is being discarded and recreated." %
    -735                    {"newproc": pid, "orig": connection_record.info['pid']})
    -736                connection_record.connection = connection_proxy.connection = None
    -737                raise exc.DisconnectionError(
    -738                    "Connection record belongs to pid %s, "
    -739                    "attempting to check out in pid %s" %
    -740                    (connection_record.info['pid'], pid)
    -741                )    
    +721            connection_record : sqlalchemy.engine.base.Engine
    +722                The SQLAlchemy engine.
    +723            connection_proxy : sqlalchemy.engine.base.Engine
    +724                The SQLAlchemy engine.
    +725            
    +726            Raises
    +727            ------
    +728            exc.DisconnectionError
    +729                If the connection record belongs to a different process.
    +730            
    +731            """
    +732            pid = os.getpid()
    +733            if connection_record.info['pid'] != pid:
    +734                # substitute log.debug() or similar here as desired
    +735                warnings.warn(
    +736                    "Parent process %(orig)s forked (%(newproc)s) with an open "
    +737                    "database connection, "
    +738                    "which is being discarded and recreated." %
    +739                    {"newproc": pid, "orig": connection_record.info['pid']})
    +740                connection_record.connection = connection_proxy.connection = None
    +741                raise exc.DisconnectionError(
    +742                    "Connection record belongs to pid %s, "
    +743                    "attempting to check out in pid %s" %
    +744                    (connection_record.info['pid'], pid)
    +745                )    
     
    diff --git a/docs/corems/molecular_id/search/molecularFormulaSearch.html b/docs/corems/molecular_id/search/molecularFormulaSearch.html index 846400a8..e0626d4d 100644 --- a/docs/corems/molecular_id/search/molecularFormulaSearch.html +++ b/docs/corems/molecular_id/search/molecularFormulaSearch.html @@ -1764,16 +1764,16 @@
    Returns
    -
    16    def timed(*args, **kw):
    -17        ts = time.time()
    -18        result = method(*args, **kw)
    -19        te = time.time()
    -20        if 'log_time' in kw:
    -21            name = kw.get('log_name', method.__name__.upper())
    -22            kw['log_time'][name] = int((te - ts) * 1000)
    -23        else:
    -24            print("%r  %2.2f ms" % (method.__name__, (te - ts) * 1000))
    -25        return result
    +            
    343    def timed(*args, **kw):
    +344        ts = time.time()
    +345        result = method(*args, **kw)
    +346        te = time.time()
    +347        if 'log_time' in kw:
    +348            name = kw.get('log_name', method.__name__.upper())
    +349            kw['log_time'][name] = int((te - ts) * 1000)
    +350        else:
    +351            print("%r  %2.2f ms" % (method.__name__, (te - ts) * 1000))
    +352        return result
     
    diff --git a/docs/corems/ms_peak/calc/MSPeakCalc.html b/docs/corems/ms_peak/calc/MSPeakCalc.html index defdf37c..325d066d 100644 --- a/docs/corems/ms_peak/calc/MSPeakCalc.html +++ b/docs/corems/ms_peak/calc/MSPeakCalc.html @@ -833,166 +833,173 @@

    717 """ 718 719 candidates = list(filter(lambda mf: mf.get("O") > 0 and mf.get("N") <=3 and mf.get("P") <= 2 and (3 * mf.get("P")) <= mf.get("O"), self.molecular_formulas)) -720 -721 if lowest_error: -722 return min(candidates, key=lambda m: abs(m.mz_error)) -723 else: -724 return candidates -725 -726 def molecular_formula_water_filter(self, lowest_error=True): -727 """ Filter molecular formula using the 'Water' filter -728 -729 This function applies the Formularity-esque 'Water' filter to possible molecular formula assignments. -730 Water Filter: -731 O > 0 AND N <= 3 AND S <= 2 AND P <= 2 -732 -733 If the lowest_error method is also used, it will return the single formula annotation with the smallest absolute error which also fits the Water filter. -734 Otherwise, it will return all Water-filter compliant formulas. -735 -736 Parameters -737 ---------- -738 lowest_error : bool, optional -739 Return only the lowest error formula which also fits the Water filter. -740 If False, return all Water-filter compliant formulas. Defaults to 2 -741 -742 Returns -743 ------- -744 list -745 List of molecular formula objects which fit the Water filter -746 -747 References -748 ---------- -749 1. Nikola Tolic et al., "Formularity: Software for Automated Formula Assignment of Natural and Other Organic Matter from Ultrahigh-Resolution Mass Spectra" -750 Anal. Chem. 2017, 89, 23, 12659–12665 -751 doi: 10.1021/acs.analchem.7b03318 -752 """ -753 -754 candidates = list(filter(lambda mf: mf.get("O") > 0 and mf.get("N") <=3 and mf.get("S") <=2 and mf.get("P") <= 2, self.molecular_formulas)) -755 -756 if lowest_error: -757 return min(candidates, key=lambda m: abs(m.mz_error)) -758 else: -759 return candidates -760 -761 def molecular_formula_air_filter(self, lowest_error=True): -762 """ Filter molecular formula using the 'Air' filter -763 -764 This function applies the Formularity-esque 'Air' filter to possible molecular formula assignments. -765 Air Filter: -766 O > 0 AND N <= 3 AND S <= 1 AND P = 0 AND 3(S+N) <= O -767 -768 If the lowest_error method is also used, it will return the single formula annotation with the smallest absolute error which also fits the Air filter. -769 Otherwise, it will return all Air-filter compliant formulas. -770 -771 Parameters -772 ---------- -773 lowest_error : bool, optional -774 Return only the lowest error formula which also fits the Air filter. -775 If False, return all Air-filter compliant formulas. Defaults to True. -776 -777 Returns -778 ------- -779 list -780 List of molecular formula objects which fit the Air filter -781 -782 References -783 ---------- -784 1. Nikola Tolic et al., "Formularity: Software for Automated Formula Assignment of Natural and Other Organic Matter from Ultrahigh-Resolution Mass Spectra" -785 Anal. Chem. 2017, 89, 23, 12659–12665 -786 doi: 10.1021/acs.analchem.7b03318 -787 """ -788 -789 -790 candidates = list(filter(lambda mf: mf.get("O") > 0 and mf.get("N") <=2 and mf.get("S") <=1 and mf.get("P") == 0 and 3* (mf.get("S") + mf.get("N")) <= mf.get("O"), self.molecular_formulas)) -791 -792 if lowest_error: -793 return min(candidates, key=lambda m: abs(m.mz_error)) -794 else: -795 return candidates -796 -797 def cia_score_S_P_error(self): -798 """ Compound Identification Algorithm SP Error - Assignment Filter -799 -800 This function applies the Compound Identification Algorithm (CIA) SP Error filter to possible molecular formula assignments. -801 -802 It takes the molecular formula with the lowest S+P count, and returns the formula with the lowest absolute error from this subset. -803 -804 Returns -805 ------- -806 MolecularFormula -807 A single molecular formula which fits the rules of the CIA SP Error filter +720 if len(candidates) >0: +721 if lowest_error: +722 return min(candidates, key=lambda m: abs(m.mz_error)) +723 else: +724 return candidates +725 else: +726 return candidates +727 +728 def molecular_formula_water_filter(self, lowest_error=True): +729 """ Filter molecular formula using the 'Water' filter +730 +731 This function applies the Formularity-esque 'Water' filter to possible molecular formula assignments. +732 Water Filter: +733 O > 0 AND N <= 3 AND S <= 2 AND P <= 2 +734 +735 If the lowest_error method is also used, it will return the single formula annotation with the smallest absolute error which also fits the Water filter. +736 Otherwise, it will return all Water-filter compliant formulas. +737 +738 Parameters +739 ---------- +740 lowest_error : bool, optional +741 Return only the lowest error formula which also fits the Water filter. +742 If False, return all Water-filter compliant formulas. Defaults to 2 +743 +744 Returns +745 ------- +746 list +747 List of molecular formula objects which fit the Water filter +748 +749 References +750 ---------- +751 1. Nikola Tolic et al., "Formularity: Software for Automated Formula Assignment of Natural and Other Organic Matter from Ultrahigh-Resolution Mass Spectra" +752 Anal. Chem. 2017, 89, 23, 12659–12665 +753 doi: 10.1021/acs.analchem.7b03318 +754 """ +755 +756 candidates = list(filter(lambda mf: mf.get("O") > 0 and mf.get("N") <=3 and mf.get("S") <=2 and mf.get("P") <= 2, self.molecular_formulas)) +757 if len(candidates) >0: +758 if lowest_error: +759 return min(candidates, key=lambda m: abs(m.mz_error)) +760 else: +761 return candidates +762 else: +763 return candidates +764 +765 def molecular_formula_air_filter(self, lowest_error=True): +766 """ Filter molecular formula using the 'Air' filter +767 +768 This function applies the Formularity-esque 'Air' filter to possible molecular formula assignments. +769 Air Filter: +770 O > 0 AND N <= 3 AND S <= 1 AND P = 0 AND 3(S+N) <= O +771 +772 If the lowest_error method is also used, it will return the single formula annotation with the smallest absolute error which also fits the Air filter. +773 Otherwise, it will return all Air-filter compliant formulas. +774 +775 Parameters +776 ---------- +777 lowest_error : bool, optional +778 Return only the lowest error formula which also fits the Air filter. +779 If False, return all Air-filter compliant formulas. Defaults to True. +780 +781 Returns +782 ------- +783 list +784 List of molecular formula objects which fit the Air filter +785 +786 References +787 ---------- +788 1. Nikola Tolic et al., "Formularity: Software for Automated Formula Assignment of Natural and Other Organic Matter from Ultrahigh-Resolution Mass Spectra" +789 Anal. Chem. 2017, 89, 23, 12659–12665 +790 doi: 10.1021/acs.analchem.7b03318 +791 """ +792 +793 +794 candidates = list(filter(lambda mf: mf.get("O") > 0 and mf.get("N") <=2 and mf.get("S") <=1 and mf.get("P") == 0 and 3* (mf.get("S") + mf.get("N")) <= mf.get("O"), self.molecular_formulas)) +795 +796 if len(candidates) >0: +797 if lowest_error: +798 return min(candidates, key=lambda m: abs(m.mz_error)) +799 else: +800 return candidates +801 else: +802 return candidates +803 +804 def cia_score_S_P_error(self): +805 """ Compound Identification Algorithm SP Error - Assignment Filter +806 +807 This function applies the Compound Identification Algorithm (CIA) SP Error filter to possible molecular formula assignments. 808 -809 -810 References -811 ---------- -812 1. Elizabeth B. Kujawinski and Mark D. Behn, "Automated Analysis of Electrospray Ionization Fourier Transform Ion Cyclotron Resonance Mass Spectra of Natural Organic Matter" -813 Anal. Chem. 2006, 78, 13, 4363–4373 -814 doi: 10.1021/ac0600306 -815 """ -816 #case EFormulaScore.HAcap: -817 -818 lowest_S_P_mf = min(self.molecular_formulas, key=lambda mf: mf.get('S') + mf.get('P')) -819 lowest_S_P_count = lowest_S_P_mf.get("S") + lowest_S_P_mf.get("P") -820 -821 list_same_s_p = list(filter(lambda mf: mf.get('S') + mf.get('P') == lowest_S_P_count, self.molecular_formulas)) -822 -823 #check if list is not empty -824 if list_same_s_p: -825 -826 return min(list_same_s_p, key=lambda m: abs(m.mz_error)) +809 It takes the molecular formula with the lowest S+P count, and returns the formula with the lowest absolute error from this subset. +810 +811 Returns +812 ------- +813 MolecularFormula +814 A single molecular formula which fits the rules of the CIA SP Error filter +815 +816 +817 References +818 ---------- +819 1. Elizabeth B. Kujawinski and Mark D. Behn, "Automated Analysis of Electrospray Ionization Fourier Transform Ion Cyclotron Resonance Mass Spectra of Natural Organic Matter" +820 Anal. Chem. 2006, 78, 13, 4363–4373 +821 doi: 10.1021/ac0600306 +822 """ +823 #case EFormulaScore.HAcap: +824 +825 lowest_S_P_mf = min(self.molecular_formulas, key=lambda mf: mf.get('S') + mf.get('P')) +826 lowest_S_P_count = lowest_S_P_mf.get("S") + lowest_S_P_mf.get("P") 827 -828 else: -829 -830 return lowest_S_P_mf -831 -832 def cia_score_N_S_P_error(self): -833 """ Compound Identification Algorithm NSP Error - Assignment Filter -834 -835 This function applies the Compound Identification Algorithm (CIA) NSP Error filter to possible molecular formula assignments. -836 -837 It takes the molecular formula with the lowest N+S+P count, and returns the formula with the lowest absolute error from this subset. -838 -839 Returns -840 ------- -841 MolecularFormula -842 A single molecular formula which fits the rules of the CIA NSP Error filter +828 list_same_s_p = list(filter(lambda mf: mf.get('S') + mf.get('P') == lowest_S_P_count, self.molecular_formulas)) +829 +830 #check if list is not empty +831 if list_same_s_p: +832 +833 return min(list_same_s_p, key=lambda m: abs(m.mz_error)) +834 +835 else: +836 +837 return lowest_S_P_mf +838 +839 def cia_score_N_S_P_error(self): +840 """ Compound Identification Algorithm NSP Error - Assignment Filter +841 +842 This function applies the Compound Identification Algorithm (CIA) NSP Error filter to possible molecular formula assignments. 843 -844 References -845 ---------- -846 1. Elizabeth B. Kujawinski and Mark D. Behn, "Automated Analysis of Electrospray Ionization Fourier Transform Ion Cyclotron Resonance Mass Spectra of Natural Organic Matter" -847 Anal. Chem. 2006, 78, 13, 4363–4373 -848 doi: 10.1021/ac0600306 -849 -850 Raises -851 ------- -852 Exception -853 If no molecular formula are associated with mass spectrum peak. -854 """ -855 #case EFormulaScore.HAcap: -856 if self.molecular_formulas: -857 -858 lowest_N_S_P_mf = min(self.molecular_formulas, key=lambda mf: mf.get('N') + mf.get('S') + mf.get('P')) -859 lowest_N_S_P_count = lowest_N_S_P_mf.get("N") + lowest_N_S_P_mf.get("S") + lowest_N_S_P_mf.get("P") -860 -861 list_same_N_S_P = list(filter(lambda mf: mf.get('N') + mf.get('S') + mf.get('P') == lowest_N_S_P_count, self.molecular_formulas)) -862 -863 if list_same_N_S_P: +844 It takes the molecular formula with the lowest N+S+P count, and returns the formula with the lowest absolute error from this subset. +845 +846 Returns +847 ------- +848 MolecularFormula +849 A single molecular formula which fits the rules of the CIA NSP Error filter +850 +851 References +852 ---------- +853 1. Elizabeth B. Kujawinski and Mark D. Behn, "Automated Analysis of Electrospray Ionization Fourier Transform Ion Cyclotron Resonance Mass Spectra of Natural Organic Matter" +854 Anal. Chem. 2006, 78, 13, 4363–4373 +855 doi: 10.1021/ac0600306 +856 +857 Raises +858 ------- +859 Exception +860 If no molecular formula are associated with mass spectrum peak. +861 """ +862 #case EFormulaScore.HAcap: +863 if self.molecular_formulas: 864 -865 SP_filtered_list = list(filter(lambda mf: (mf.get("S") <= 3 ) and (mf.get("P") <= 1 ), list_same_N_S_P)) -866 -867 if SP_filtered_list: -868 -869 return min(SP_filtered_list, key=lambda m: abs(m.mz_error)) -870 -871 else: -872 -873 return min(list_same_N_S_P, key=lambda m: abs(m.mz_error)) -874 -875 else: -876 -877 return lowest_N_S_P_mf -878 else: -879 raise Exception("No molecular formula associated with the mass spectrum peak at m/z: %.6f" % self.mz_exp) +865 lowest_N_S_P_mf = min(self.molecular_formulas, key=lambda mf: mf.get('N') + mf.get('S') + mf.get('P')) +866 lowest_N_S_P_count = lowest_N_S_P_mf.get("N") + lowest_N_S_P_mf.get("S") + lowest_N_S_P_mf.get("P") +867 +868 list_same_N_S_P = list(filter(lambda mf: mf.get('N') + mf.get('S') + mf.get('P') == lowest_N_S_P_count, self.molecular_formulas)) +869 +870 if list_same_N_S_P: +871 +872 SP_filtered_list = list(filter(lambda mf: (mf.get("S") <= 3 ) and (mf.get("P") <= 1 ), list_same_N_S_P)) +873 +874 if SP_filtered_list: +875 +876 return min(SP_filtered_list, key=lambda m: abs(m.mz_error)) +877 +878 else: +879 +880 return min(list_same_N_S_P, key=lambda m: abs(m.mz_error)) +881 +882 else: +883 +884 return lowest_N_S_P_mf +885 else: +886 raise Exception("No molecular formula associated with the mass spectrum peak at m/z: %.6f" % self.mz_exp)

    @@ -1713,166 +1720,173 @@

    718 """ 719 720 candidates = list(filter(lambda mf: mf.get("O") > 0 and mf.get("N") <=3 and mf.get("P") <= 2 and (3 * mf.get("P")) <= mf.get("O"), self.molecular_formulas)) -721 -722 if lowest_error: -723 return min(candidates, key=lambda m: abs(m.mz_error)) -724 else: -725 return candidates -726 -727 def molecular_formula_water_filter(self, lowest_error=True): -728 """ Filter molecular formula using the 'Water' filter -729 -730 This function applies the Formularity-esque 'Water' filter to possible molecular formula assignments. -731 Water Filter: -732 O > 0 AND N <= 3 AND S <= 2 AND P <= 2 -733 -734 If the lowest_error method is also used, it will return the single formula annotation with the smallest absolute error which also fits the Water filter. -735 Otherwise, it will return all Water-filter compliant formulas. -736 -737 Parameters -738 ---------- -739 lowest_error : bool, optional -740 Return only the lowest error formula which also fits the Water filter. -741 If False, return all Water-filter compliant formulas. Defaults to 2 -742 -743 Returns -744 ------- -745 list -746 List of molecular formula objects which fit the Water filter -747 -748 References -749 ---------- -750 1. Nikola Tolic et al., "Formularity: Software for Automated Formula Assignment of Natural and Other Organic Matter from Ultrahigh-Resolution Mass Spectra" -751 Anal. Chem. 2017, 89, 23, 12659–12665 -752 doi: 10.1021/acs.analchem.7b03318 -753 """ -754 -755 candidates = list(filter(lambda mf: mf.get("O") > 0 and mf.get("N") <=3 and mf.get("S") <=2 and mf.get("P") <= 2, self.molecular_formulas)) -756 -757 if lowest_error: -758 return min(candidates, key=lambda m: abs(m.mz_error)) -759 else: -760 return candidates -761 -762 def molecular_formula_air_filter(self, lowest_error=True): -763 """ Filter molecular formula using the 'Air' filter -764 -765 This function applies the Formularity-esque 'Air' filter to possible molecular formula assignments. -766 Air Filter: -767 O > 0 AND N <= 3 AND S <= 1 AND P = 0 AND 3(S+N) <= O -768 -769 If the lowest_error method is also used, it will return the single formula annotation with the smallest absolute error which also fits the Air filter. -770 Otherwise, it will return all Air-filter compliant formulas. -771 -772 Parameters -773 ---------- -774 lowest_error : bool, optional -775 Return only the lowest error formula which also fits the Air filter. -776 If False, return all Air-filter compliant formulas. Defaults to True. -777 -778 Returns -779 ------- -780 list -781 List of molecular formula objects which fit the Air filter -782 -783 References -784 ---------- -785 1. Nikola Tolic et al., "Formularity: Software for Automated Formula Assignment of Natural and Other Organic Matter from Ultrahigh-Resolution Mass Spectra" -786 Anal. Chem. 2017, 89, 23, 12659–12665 -787 doi: 10.1021/acs.analchem.7b03318 -788 """ -789 -790 -791 candidates = list(filter(lambda mf: mf.get("O") > 0 and mf.get("N") <=2 and mf.get("S") <=1 and mf.get("P") == 0 and 3* (mf.get("S") + mf.get("N")) <= mf.get("O"), self.molecular_formulas)) -792 -793 if lowest_error: -794 return min(candidates, key=lambda m: abs(m.mz_error)) -795 else: -796 return candidates -797 -798 def cia_score_S_P_error(self): -799 """ Compound Identification Algorithm SP Error - Assignment Filter -800 -801 This function applies the Compound Identification Algorithm (CIA) SP Error filter to possible molecular formula assignments. -802 -803 It takes the molecular formula with the lowest S+P count, and returns the formula with the lowest absolute error from this subset. -804 -805 Returns -806 ------- -807 MolecularFormula -808 A single molecular formula which fits the rules of the CIA SP Error filter +721 if len(candidates) >0: +722 if lowest_error: +723 return min(candidates, key=lambda m: abs(m.mz_error)) +724 else: +725 return candidates +726 else: +727 return candidates +728 +729 def molecular_formula_water_filter(self, lowest_error=True): +730 """ Filter molecular formula using the 'Water' filter +731 +732 This function applies the Formularity-esque 'Water' filter to possible molecular formula assignments. +733 Water Filter: +734 O > 0 AND N <= 3 AND S <= 2 AND P <= 2 +735 +736 If the lowest_error method is also used, it will return the single formula annotation with the smallest absolute error which also fits the Water filter. +737 Otherwise, it will return all Water-filter compliant formulas. +738 +739 Parameters +740 ---------- +741 lowest_error : bool, optional +742 Return only the lowest error formula which also fits the Water filter. +743 If False, return all Water-filter compliant formulas. Defaults to 2 +744 +745 Returns +746 ------- +747 list +748 List of molecular formula objects which fit the Water filter +749 +750 References +751 ---------- +752 1. Nikola Tolic et al., "Formularity: Software for Automated Formula Assignment of Natural and Other Organic Matter from Ultrahigh-Resolution Mass Spectra" +753 Anal. Chem. 2017, 89, 23, 12659–12665 +754 doi: 10.1021/acs.analchem.7b03318 +755 """ +756 +757 candidates = list(filter(lambda mf: mf.get("O") > 0 and mf.get("N") <=3 and mf.get("S") <=2 and mf.get("P") <= 2, self.molecular_formulas)) +758 if len(candidates) >0: +759 if lowest_error: +760 return min(candidates, key=lambda m: abs(m.mz_error)) +761 else: +762 return candidates +763 else: +764 return candidates +765 +766 def molecular_formula_air_filter(self, lowest_error=True): +767 """ Filter molecular formula using the 'Air' filter +768 +769 This function applies the Formularity-esque 'Air' filter to possible molecular formula assignments. +770 Air Filter: +771 O > 0 AND N <= 3 AND S <= 1 AND P = 0 AND 3(S+N) <= O +772 +773 If the lowest_error method is also used, it will return the single formula annotation with the smallest absolute error which also fits the Air filter. +774 Otherwise, it will return all Air-filter compliant formulas. +775 +776 Parameters +777 ---------- +778 lowest_error : bool, optional +779 Return only the lowest error formula which also fits the Air filter. +780 If False, return all Air-filter compliant formulas. Defaults to True. +781 +782 Returns +783 ------- +784 list +785 List of molecular formula objects which fit the Air filter +786 +787 References +788 ---------- +789 1. Nikola Tolic et al., "Formularity: Software for Automated Formula Assignment of Natural and Other Organic Matter from Ultrahigh-Resolution Mass Spectra" +790 Anal. Chem. 2017, 89, 23, 12659–12665 +791 doi: 10.1021/acs.analchem.7b03318 +792 """ +793 +794 +795 candidates = list(filter(lambda mf: mf.get("O") > 0 and mf.get("N") <=2 and mf.get("S") <=1 and mf.get("P") == 0 and 3* (mf.get("S") + mf.get("N")) <= mf.get("O"), self.molecular_formulas)) +796 +797 if len(candidates) >0: +798 if lowest_error: +799 return min(candidates, key=lambda m: abs(m.mz_error)) +800 else: +801 return candidates +802 else: +803 return candidates +804 +805 def cia_score_S_P_error(self): +806 """ Compound Identification Algorithm SP Error - Assignment Filter +807 +808 This function applies the Compound Identification Algorithm (CIA) SP Error filter to possible molecular formula assignments. 809 -810 -811 References -812 ---------- -813 1. Elizabeth B. Kujawinski and Mark D. Behn, "Automated Analysis of Electrospray Ionization Fourier Transform Ion Cyclotron Resonance Mass Spectra of Natural Organic Matter" -814 Anal. Chem. 2006, 78, 13, 4363–4373 -815 doi: 10.1021/ac0600306 -816 """ -817 #case EFormulaScore.HAcap: -818 -819 lowest_S_P_mf = min(self.molecular_formulas, key=lambda mf: mf.get('S') + mf.get('P')) -820 lowest_S_P_count = lowest_S_P_mf.get("S") + lowest_S_P_mf.get("P") -821 -822 list_same_s_p = list(filter(lambda mf: mf.get('S') + mf.get('P') == lowest_S_P_count, self.molecular_formulas)) -823 -824 #check if list is not empty -825 if list_same_s_p: -826 -827 return min(list_same_s_p, key=lambda m: abs(m.mz_error)) +810 It takes the molecular formula with the lowest S+P count, and returns the formula with the lowest absolute error from this subset. +811 +812 Returns +813 ------- +814 MolecularFormula +815 A single molecular formula which fits the rules of the CIA SP Error filter +816 +817 +818 References +819 ---------- +820 1. Elizabeth B. Kujawinski and Mark D. Behn, "Automated Analysis of Electrospray Ionization Fourier Transform Ion Cyclotron Resonance Mass Spectra of Natural Organic Matter" +821 Anal. Chem. 2006, 78, 13, 4363–4373 +822 doi: 10.1021/ac0600306 +823 """ +824 #case EFormulaScore.HAcap: +825 +826 lowest_S_P_mf = min(self.molecular_formulas, key=lambda mf: mf.get('S') + mf.get('P')) +827 lowest_S_P_count = lowest_S_P_mf.get("S") + lowest_S_P_mf.get("P") 828 -829 else: -830 -831 return lowest_S_P_mf -832 -833 def cia_score_N_S_P_error(self): -834 """ Compound Identification Algorithm NSP Error - Assignment Filter -835 -836 This function applies the Compound Identification Algorithm (CIA) NSP Error filter to possible molecular formula assignments. -837 -838 It takes the molecular formula with the lowest N+S+P count, and returns the formula with the lowest absolute error from this subset. -839 -840 Returns -841 ------- -842 MolecularFormula -843 A single molecular formula which fits the rules of the CIA NSP Error filter +829 list_same_s_p = list(filter(lambda mf: mf.get('S') + mf.get('P') == lowest_S_P_count, self.molecular_formulas)) +830 +831 #check if list is not empty +832 if list_same_s_p: +833 +834 return min(list_same_s_p, key=lambda m: abs(m.mz_error)) +835 +836 else: +837 +838 return lowest_S_P_mf +839 +840 def cia_score_N_S_P_error(self): +841 """ Compound Identification Algorithm NSP Error - Assignment Filter +842 +843 This function applies the Compound Identification Algorithm (CIA) NSP Error filter to possible molecular formula assignments. 844 -845 References -846 ---------- -847 1. Elizabeth B. Kujawinski and Mark D. Behn, "Automated Analysis of Electrospray Ionization Fourier Transform Ion Cyclotron Resonance Mass Spectra of Natural Organic Matter" -848 Anal. Chem. 2006, 78, 13, 4363–4373 -849 doi: 10.1021/ac0600306 -850 -851 Raises -852 ------- -853 Exception -854 If no molecular formula are associated with mass spectrum peak. -855 """ -856 #case EFormulaScore.HAcap: -857 if self.molecular_formulas: -858 -859 lowest_N_S_P_mf = min(self.molecular_formulas, key=lambda mf: mf.get('N') + mf.get('S') + mf.get('P')) -860 lowest_N_S_P_count = lowest_N_S_P_mf.get("N") + lowest_N_S_P_mf.get("S") + lowest_N_S_P_mf.get("P") -861 -862 list_same_N_S_P = list(filter(lambda mf: mf.get('N') + mf.get('S') + mf.get('P') == lowest_N_S_P_count, self.molecular_formulas)) -863 -864 if list_same_N_S_P: +845 It takes the molecular formula with the lowest N+S+P count, and returns the formula with the lowest absolute error from this subset. +846 +847 Returns +848 ------- +849 MolecularFormula +850 A single molecular formula which fits the rules of the CIA NSP Error filter +851 +852 References +853 ---------- +854 1. Elizabeth B. Kujawinski and Mark D. Behn, "Automated Analysis of Electrospray Ionization Fourier Transform Ion Cyclotron Resonance Mass Spectra of Natural Organic Matter" +855 Anal. Chem. 2006, 78, 13, 4363–4373 +856 doi: 10.1021/ac0600306 +857 +858 Raises +859 ------- +860 Exception +861 If no molecular formula are associated with mass spectrum peak. +862 """ +863 #case EFormulaScore.HAcap: +864 if self.molecular_formulas: 865 -866 SP_filtered_list = list(filter(lambda mf: (mf.get("S") <= 3 ) and (mf.get("P") <= 1 ), list_same_N_S_P)) -867 -868 if SP_filtered_list: -869 -870 return min(SP_filtered_list, key=lambda m: abs(m.mz_error)) -871 -872 else: -873 -874 return min(list_same_N_S_P, key=lambda m: abs(m.mz_error)) -875 -876 else: -877 -878 return lowest_N_S_P_mf -879 else: -880 raise Exception("No molecular formula associated with the mass spectrum peak at m/z: %.6f" % self.mz_exp) +866 lowest_N_S_P_mf = min(self.molecular_formulas, key=lambda mf: mf.get('N') + mf.get('S') + mf.get('P')) +867 lowest_N_S_P_count = lowest_N_S_P_mf.get("N") + lowest_N_S_P_mf.get("S") + lowest_N_S_P_mf.get("P") +868 +869 list_same_N_S_P = list(filter(lambda mf: mf.get('N') + mf.get('S') + mf.get('P') == lowest_N_S_P_count, self.molecular_formulas)) +870 +871 if list_same_N_S_P: +872 +873 SP_filtered_list = list(filter(lambda mf: (mf.get("S") <= 3 ) and (mf.get("P") <= 1 ), list_same_N_S_P)) +874 +875 if SP_filtered_list: +876 +877 return min(SP_filtered_list, key=lambda m: abs(m.mz_error)) +878 +879 else: +880 +881 return min(list_same_N_S_P, key=lambda m: abs(m.mz_error)) +882 +883 else: +884 +885 return lowest_N_S_P_mf +886 else: +887 raise Exception("No molecular formula associated with the mass spectrum peak at m/z: %.6f" % self.mz_exp) @@ -3047,11 +3061,13 @@

    Returns
    718 """ 719 720 candidates = list(filter(lambda mf: mf.get("O") > 0 and mf.get("N") <=3 and mf.get("P") <= 2 and (3 * mf.get("P")) <= mf.get("O"), self.molecular_formulas)) -721 -722 if lowest_error: -723 return min(candidates, key=lambda m: abs(m.mz_error)) -724 else: -725 return candidates +721 if len(candidates) >0: +722 if lowest_error: +723 return min(candidates, key=lambda m: abs(m.mz_error)) +724 else: +725 return candidates +726 else: +727 return candidates @@ -3100,40 +3116,42 @@

    References
    -
    727    def molecular_formula_water_filter(self, lowest_error=True):
    -728        """ Filter molecular formula using the 'Water' filter
    -729
    -730        This function applies the Formularity-esque 'Water' filter to possible molecular formula assignments.
    -731        Water Filter:
    -732            O > 0 AND N <= 3 AND S <= 2 AND P <= 2
    -733        
    -734        If the lowest_error method is also used, it will return the single formula annotation with the smallest absolute error which also fits the Water filter.
    -735        Otherwise, it will return all Water-filter compliant formulas.
    -736
    -737        Parameters
    -738        ----------
    -739        lowest_error : bool, optional
    -740            Return only the lowest error formula which also fits the Water filter.
    -741            If False, return all Water-filter compliant formulas. Defaults to 2
    -742
    -743        Returns 
    -744        -------
    -745        list
    -746            List of molecular formula objects which fit the Water filter
    -747
    -748        References
    -749        ----------
    -750        1. Nikola Tolic et al., "Formularity: Software for Automated Formula Assignment of Natural and Other Organic Matter from Ultrahigh-Resolution Mass Spectra"
    -751            Anal. Chem. 2017, 89, 23, 12659–12665
    -752            doi: 10.1021/acs.analchem.7b03318
    -753        """
    -754       
    -755        candidates = list(filter(lambda mf: mf.get("O") > 0 and mf.get("N") <=3 and mf.get("S") <=2 and  mf.get("P") <= 2, self.molecular_formulas))
    -756
    -757        if lowest_error:
    -758            return min(candidates, key=lambda m: abs(m.mz_error))
    -759        else:
    -760            return candidates
    +            
    729    def molecular_formula_water_filter(self, lowest_error=True):
    +730        """ Filter molecular formula using the 'Water' filter
    +731
    +732        This function applies the Formularity-esque 'Water' filter to possible molecular formula assignments.
    +733        Water Filter:
    +734            O > 0 AND N <= 3 AND S <= 2 AND P <= 2
    +735        
    +736        If the lowest_error method is also used, it will return the single formula annotation with the smallest absolute error which also fits the Water filter.
    +737        Otherwise, it will return all Water-filter compliant formulas.
    +738
    +739        Parameters
    +740        ----------
    +741        lowest_error : bool, optional
    +742            Return only the lowest error formula which also fits the Water filter.
    +743            If False, return all Water-filter compliant formulas. Defaults to 2
    +744
    +745        Returns 
    +746        -------
    +747        list
    +748            List of molecular formula objects which fit the Water filter
    +749
    +750        References
    +751        ----------
    +752        1. Nikola Tolic et al., "Formularity: Software for Automated Formula Assignment of Natural and Other Organic Matter from Ultrahigh-Resolution Mass Spectra"
    +753            Anal. Chem. 2017, 89, 23, 12659–12665
    +754            doi: 10.1021/acs.analchem.7b03318
    +755        """
    +756       
    +757        candidates = list(filter(lambda mf: mf.get("O") > 0 and mf.get("N") <=3 and mf.get("S") <=2 and  mf.get("P") <= 2, self.molecular_formulas))
    +758        if len(candidates) >0:
    +759            if lowest_error:
    +760                return min(candidates, key=lambda m: abs(m.mz_error))
    +761            else:
    +762                return candidates
    +763        else:
    +764            return candidates
     
    @@ -3181,41 +3199,44 @@
    References
    -
    762    def molecular_formula_air_filter(self, lowest_error=True):
    -763        """ Filter molecular formula using the 'Air' filter
    -764
    -765        This function applies the Formularity-esque 'Air' filter to possible molecular formula assignments.
    -766        Air Filter:
    -767            O > 0 AND N <= 3 AND S <= 1 AND P = 0 AND 3(S+N) <= O
    -768        
    -769        If the lowest_error method is also used, it will return the single formula annotation with the smallest absolute error which also fits the Air filter.
    -770        Otherwise, it will return all Air-filter compliant formulas.
    -771
    -772        Parameters
    -773        ----------
    -774        lowest_error : bool, optional
    -775            Return only the lowest error formula which also fits the Air filter.
    -776            If False, return all Air-filter compliant formulas. Defaults to True.
    -777
    -778        Returns
    -779        -------
    -780        list
    -781            List of molecular formula objects which fit the Air filter
    -782            
    -783        References
    -784        ----------
    -785        1. Nikola Tolic et al., "Formularity: Software for Automated Formula Assignment of Natural and Other Organic Matter from Ultrahigh-Resolution Mass Spectra"
    -786            Anal. Chem. 2017, 89, 23, 12659–12665
    -787            doi: 10.1021/acs.analchem.7b03318
    -788        """
    -789
    -790       
    -791        candidates = list(filter(lambda mf: mf.get("O") > 0 and mf.get("N") <=2 and mf.get("S") <=1 and  mf.get("P") == 0 and 3* (mf.get("S") + mf.get("N")) <= mf.get("O"), self.molecular_formulas))
    -792        
    -793        if lowest_error:
    -794            return min(candidates, key=lambda m: abs(m.mz_error))
    -795        else:
    -796            return candidates
    +            
    766    def molecular_formula_air_filter(self, lowest_error=True):
    +767        """ Filter molecular formula using the 'Air' filter
    +768
    +769        This function applies the Formularity-esque 'Air' filter to possible molecular formula assignments.
    +770        Air Filter:
    +771            O > 0 AND N <= 3 AND S <= 1 AND P = 0 AND 3(S+N) <= O
    +772        
    +773        If the lowest_error method is also used, it will return the single formula annotation with the smallest absolute error which also fits the Air filter.
    +774        Otherwise, it will return all Air-filter compliant formulas.
    +775
    +776        Parameters
    +777        ----------
    +778        lowest_error : bool, optional
    +779            Return only the lowest error formula which also fits the Air filter.
    +780            If False, return all Air-filter compliant formulas. Defaults to True.
    +781
    +782        Returns
    +783        -------
    +784        list
    +785            List of molecular formula objects which fit the Air filter
    +786            
    +787        References
    +788        ----------
    +789        1. Nikola Tolic et al., "Formularity: Software for Automated Formula Assignment of Natural and Other Organic Matter from Ultrahigh-Resolution Mass Spectra"
    +790            Anal. Chem. 2017, 89, 23, 12659–12665
    +791            doi: 10.1021/acs.analchem.7b03318
    +792        """
    +793
    +794       
    +795        candidates = list(filter(lambda mf: mf.get("O") > 0 and mf.get("N") <=2 and mf.get("S") <=1 and  mf.get("P") == 0 and 3* (mf.get("S") + mf.get("N")) <= mf.get("O"), self.molecular_formulas))
    +796        
    +797        if len(candidates) >0:
    +798            if lowest_error:
    +799                return min(candidates, key=lambda m: abs(m.mz_error))
    +800            else:
    +801                return candidates
    +802        else:
    +803            return candidates
     
    @@ -3264,40 +3285,40 @@
    References
    -
    798    def cia_score_S_P_error(self):
    -799        """ Compound Identification Algorithm SP Error - Assignment Filter
    -800         
    -801        This function applies the Compound Identification Algorithm (CIA) SP Error filter to possible molecular formula assignments.
    -802
    -803        It takes the molecular formula with the lowest S+P count, and returns the formula with the lowest absolute error from this subset.
    -804        
    -805        Returns
    -806        -------
    -807        MolecularFormula
    -808            A single molecular formula which fits the rules of the CIA SP Error filter
    +            
    805    def cia_score_S_P_error(self):
    +806        """ Compound Identification Algorithm SP Error - Assignment Filter
    +807         
    +808        This function applies the Compound Identification Algorithm (CIA) SP Error filter to possible molecular formula assignments.
     809
    -810
    -811        References
    -812        ----------
    -813        1. Elizabeth B. Kujawinski and Mark D. Behn, "Automated Analysis of Electrospray Ionization Fourier Transform Ion Cyclotron Resonance Mass Spectra of Natural Organic Matter"
    -814            Anal. Chem. 2006, 78, 13, 4363–4373
    -815            doi: 10.1021/ac0600306
    -816        """
    -817        #case EFormulaScore.HAcap:
    -818
    -819        lowest_S_P_mf = min(self.molecular_formulas, key=lambda mf: mf.get('S') + mf.get('P'))
    -820        lowest_S_P_count = lowest_S_P_mf.get("S") + lowest_S_P_mf.get("P")
    -821        
    -822        list_same_s_p = list(filter(lambda mf: mf.get('S') + mf.get('P') == lowest_S_P_count, self.molecular_formulas))
    -823
    -824        #check if list is not empty
    -825        if list_same_s_p:
    -826        
    -827            return min(list_same_s_p, key=lambda m: abs(m.mz_error))
    +810        It takes the molecular formula with the lowest S+P count, and returns the formula with the lowest absolute error from this subset.
    +811        
    +812        Returns
    +813        -------
    +814        MolecularFormula
    +815            A single molecular formula which fits the rules of the CIA SP Error filter
    +816
    +817
    +818        References
    +819        ----------
    +820        1. Elizabeth B. Kujawinski and Mark D. Behn, "Automated Analysis of Electrospray Ionization Fourier Transform Ion Cyclotron Resonance Mass Spectra of Natural Organic Matter"
    +821            Anal. Chem. 2006, 78, 13, 4363–4373
    +822            doi: 10.1021/ac0600306
    +823        """
    +824        #case EFormulaScore.HAcap:
    +825
    +826        lowest_S_P_mf = min(self.molecular_formulas, key=lambda mf: mf.get('S') + mf.get('P'))
    +827        lowest_S_P_count = lowest_S_P_mf.get("S") + lowest_S_P_mf.get("P")
     828        
    -829        else:
    -830        
    -831            return lowest_S_P_mf
    +829        list_same_s_p = list(filter(lambda mf: mf.get('S') + mf.get('P') == lowest_S_P_count, self.molecular_formulas))
    +830
    +831        #check if list is not empty
    +832        if list_same_s_p:
    +833        
    +834            return min(list_same_s_p, key=lambda m: abs(m.mz_error))
    +835        
    +836        else:
    +837        
    +838            return lowest_S_P_mf
     
    @@ -3335,54 +3356,54 @@
    References
    -
    833    def cia_score_N_S_P_error(self):
    -834        """ Compound Identification Algorithm NSP Error - Assignment Filter
    -835        
    -836        This function applies the Compound Identification Algorithm (CIA) NSP Error filter to possible molecular formula assignments.
    -837
    -838        It takes the molecular formula with the lowest N+S+P count, and returns the formula with the lowest absolute error from this subset.
    -839
    -840        Returns
    -841        -------
    -842        MolecularFormula
    -843            A single molecular formula which fits the rules of the CIA NSP Error filter
    +            
    840    def cia_score_N_S_P_error(self):
    +841        """ Compound Identification Algorithm NSP Error - Assignment Filter
    +842        
    +843        This function applies the Compound Identification Algorithm (CIA) NSP Error filter to possible molecular formula assignments.
     844
    -845        References
    -846        ----------
    -847        1. Elizabeth B. Kujawinski and Mark D. Behn, "Automated Analysis of Electrospray Ionization Fourier Transform Ion Cyclotron Resonance Mass Spectra of Natural Organic Matter"
    -848            Anal. Chem. 2006, 78, 13, 4363–4373
    -849            doi: 10.1021/ac0600306
    -850
    -851        Raises
    -852        -------
    -853        Exception
    -854            If no molecular formula are associated with mass spectrum peak.
    -855        """
    -856        #case EFormulaScore.HAcap:
    -857        if self.molecular_formulas:
    -858
    -859            lowest_N_S_P_mf = min(self.molecular_formulas, key=lambda mf: mf.get('N') + mf.get('S') + mf.get('P'))
    -860            lowest_N_S_P_count = lowest_N_S_P_mf.get("N") + lowest_N_S_P_mf.get("S") + lowest_N_S_P_mf.get("P")
    -861
    -862            list_same_N_S_P = list(filter(lambda mf: mf.get('N') + mf.get('S') + mf.get('P') == lowest_N_S_P_count, self.molecular_formulas))
    -863
    -864            if list_same_N_S_P:
    +845        It takes the molecular formula with the lowest N+S+P count, and returns the formula with the lowest absolute error from this subset.
    +846
    +847        Returns
    +848        -------
    +849        MolecularFormula
    +850            A single molecular formula which fits the rules of the CIA NSP Error filter
    +851
    +852        References
    +853        ----------
    +854        1. Elizabeth B. Kujawinski and Mark D. Behn, "Automated Analysis of Electrospray Ionization Fourier Transform Ion Cyclotron Resonance Mass Spectra of Natural Organic Matter"
    +855            Anal. Chem. 2006, 78, 13, 4363–4373
    +856            doi: 10.1021/ac0600306
    +857
    +858        Raises
    +859        -------
    +860        Exception
    +861            If no molecular formula are associated with mass spectrum peak.
    +862        """
    +863        #case EFormulaScore.HAcap:
    +864        if self.molecular_formulas:
     865
    -866                SP_filtered_list =  list(filter(lambda mf: (mf.get("S") <= 3 ) and  (mf.get("P")  <= 1 ), list_same_N_S_P))
    -867                
    -868                if SP_filtered_list:
    -869                    
    -870                    return min(SP_filtered_list, key=lambda m: abs(m.mz_error)) 
    -871                
    -872                else:    
    -873                    
    -874                    return min(list_same_N_S_P, key=lambda m: abs(m.mz_error))            
    -875            
    -876            else:
    -877                
    -878                return lowest_N_S_P_mf 
    -879        else:
    -880            raise Exception("No molecular formula associated with the mass spectrum peak at m/z: %.6f" % self.mz_exp)
    +866            lowest_N_S_P_mf = min(self.molecular_formulas, key=lambda mf: mf.get('N') + mf.get('S') + mf.get('P'))
    +867            lowest_N_S_P_count = lowest_N_S_P_mf.get("N") + lowest_N_S_P_mf.get("S") + lowest_N_S_P_mf.get("P")
    +868
    +869            list_same_N_S_P = list(filter(lambda mf: mf.get('N') + mf.get('S') + mf.get('P') == lowest_N_S_P_count, self.molecular_formulas))
    +870
    +871            if list_same_N_S_P:
    +872
    +873                SP_filtered_list =  list(filter(lambda mf: (mf.get("S") <= 3 ) and  (mf.get("P")  <= 1 ), list_same_N_S_P))
    +874                
    +875                if SP_filtered_list:
    +876                    
    +877                    return min(SP_filtered_list, key=lambda m: abs(m.mz_error)) 
    +878                
    +879                else:    
    +880                    
    +881                    return min(list_same_N_S_P, key=lambda m: abs(m.mz_error))            
    +882            
    +883            else:
    +884                
    +885                return lowest_N_S_P_mf 
    +886        else:
    +887            raise Exception("No molecular formula associated with the mass spectrum peak at m/z: %.6f" % self.mz_exp)
     
    diff --git a/docs/corems/ms_peak/factory/MSPeakClasses.html b/docs/corems/ms_peak/factory/MSPeakClasses.html index 939b5cd0..bdced71e 100644 --- a/docs/corems/ms_peak/factory/MSPeakClasses.html +++ b/docs/corems/ms_peak/factory/MSPeakClasses.html @@ -94,491 +94,492 @@

    2__date__ = "Jun 12, 2019" 3 4from copy import deepcopy - 5from corems.molecular_formula.factory.MolecularFormulaFactory import MolecularFormula - 6from numpy import nan - 7from corems.ms_peak.calc.MSPeakCalc import MSPeakCalculation - 8from corems.mass_spectra.calc import SignalProcessing as sp - 9from numpy import NaN, power - 10 + 5import math + 6from corems.molecular_formula.factory.MolecularFormulaFactory import MolecularFormula + 7from numpy import nan + 8from corems.ms_peak.calc.MSPeakCalc import MSPeakCalculation + 9from corems.mass_spectra.calc import SignalProcessing as sp + 10from numpy import NaN, power 11 - 12class _MSPeak(MSPeakCalculation): - 13 """ A class representing a peak in a mass spectrum. - 14 - 15 Parameters: - 16 ---------- - 17 ion_charge : int - 18 The ion charge of the peak. - 19 mz_exp : float - 20 The experimental m/z value of the peak. - 21 abundance : float - 22 The abundance of the peak. - 23 resolving_power : float - 24 The resolving power of the peak. - 25 signal_to_noise : float - 26 The signal-to-noise ratio of the peak. - 27 indexes : list[int] - 28 The profile indexes of the peak. - 29 index : int - 30 The index of the peak. - 31 ms_parent : MSParent, optional - 32 The parent mass spectrum object. - 33 exp_freq : float, optional - 34 The experimental frequency of the peak. - 35 - 36 Methods: - 37 ------- - 38 * __len__(). - 39 Returns the number of molecular formulas associated with the peak. - 40 * __setitem__(position, molecular_formula_obj). - 41 Sets the molecular formula at the specified position. - 42 * __getitem__(position) -> MolecularFormula. - 43 Returns the molecular formula at the specified position. - 44 * change_kendrick_base(kendrick_dict_base). - 45 Changes the kendrick base for the peak. - 46 * add_molecular_formula(molecular_formula_obj). - 47 Adds a molecular formula to the peak. - 48 * remove_molecular_formula(mf_obj). - 49 Removes a molecular formula from the peak. - 50 * clear_molecular_formulas(). - 51 Clears all molecular formulas associated with the peak. - 52 * plot_simulation(sim_type="lorentz", ax=None, color="green", oversample_multiplier=1, delta_rp=0, mz_overlay=1). - 53 Plots the simulated peak. - 54 * plot(ax=None, color="black", derivative=True, deriv_color='red'). - 55 Plots the peak. - 56 * best_molecular_formula_candidate(). - 57 Returns the best molecular formula candidate for the peak. - 58 """ - 59 - 60 def __init__( - 61 self, - 62 ion_charge, - 63 mz_exp, - 64 abundance, - 65 resolving_power, - 66 signal_to_noise, - 67 indexes, - 68 index, - 69 ms_parent=None, - 70 exp_freq=None, - 71 ): - 72 self._ms_parent = ms_parent - 73 # needed to create the object - 74 self.ion_charge = int(ion_charge) - 75 self._mz_exp = float(mz_exp) - 76 self.mass = float(mz_exp) / float(ion_charge) - 77 self.abundance = float(abundance) - 78 self.resolving_power = float(resolving_power) - 79 self.signal_to_noise = float(signal_to_noise) - 80 # profile indexes - 81 #TODO fix these names from 'scan' to be more logical about peak indexes. - 82 self.start_scan = int(indexes[0]) - 83 self.apex_scan = int(indexes[1]) - 84 self.final_scan = int(indexes[2]) - 85 - 86 # mass spec obj index - 87 self.index = int(index) - 88 # parent mass spectrum obj instance - 89 - 90 # updated after mass error prediction' - 91 self.predicted_std = None - 92 # updated after calibration' - 93 self.mz_cal = None - 94 # updated individual calculation' - 95 self.baseline_noise = None - 96 - 97 if exp_freq: - 98 self.freq_exp = float(exp_freq) - 99 -100 if self._ms_parent is not None: -101 kendrick_dict_base = self._ms_parent.mspeaks_settings.kendrick_base -102 else: -103 kendrick_dict_base = {"C": 1, "H": 2} -104 self._kmd, self._kendrick_mass, self._nominal_km = self._calc_kmd( -105 kendrick_dict_base -106 ) -107 -108 "updated after molecular formula ID" -109 -110 self.molecular_formulas = [] -111 self._confidence_score = None -112 # placeholder for found isotopologues index -113 self.isotopologue_indexes = [] -114 # placeholder for found isotopologues molecular formula obj -115 self.found_isotopologues = {} -116 -117 # Label for what type of peak it is - real signal, noise, sinc wiggle, magnetron or harmonic peak, etc. -118 self.peak_type = None -119 -120 def __len__(self): -121 return len(self.molecular_formulas) -122 -123 def __setitem__(self, position, molecular_formula_obj): -124 self.molecular_formulas[position] = molecular_formula_obj -125 -126 def __getitem__(self, position) -> MolecularFormula: -127 return self.molecular_formulas[position] -128 -129 def change_kendrick_base(self, kendrick_dict_base): -130 """ Changes the kendrick base for the peak. -131 -132 Parameters: -133 ---------- -134 kendrick_dict_base : dict -135 The kendrick base dictionary. -136 Default is {"C": 1, "H": 2}. (CH2) -137 """ -138 self._kmd, self._kendrick_mass, self._nominal_km = self._calc_kmd( -139 kendrick_dict_base -140 ) -141 -142 def add_molecular_formula(self, molecular_formula_obj): -143 """ Adds a molecular formula to the peak. -144 -145 Parameters: -146 ---------- -147 molecular_formula_obj : MolecularFormula -148 The molecular formula object to be added. -149 -150 Returns: -151 ------- -152 MolecularFormula -153 The molecular formula object added. -154 -155 """ -156 # freeze state -157 molecular_formula_obj._mspeak_parent = self -158 -159 # new_mol_formula = deepcopy(molecular_formula_obj) -160 # add link mass spectrum obj instance -161 -162 # new_mol_formula.mspeak_parent = self -163 -164 self.molecular_formulas.append(molecular_formula_obj) -165 -166 return molecular_formula_obj -167 -168 def remove_molecular_formula(self, mf_obj): -169 """ Removes a molecular formula from the peak. -170 -171 Parameters: -172 ---------- -173 mf_obj : MolecularFormula -174 The molecular formula object to be removed. -175 """ -176 self.molecular_formulas.remove(mf_obj) -177 -178 def clear_molecular_formulas(self): -179 """ Clears all molecular formulas associated with the peak. -180 """ -181 self.molecular_formulas = [] -182 -183 @property -184 def mz_exp(self): -185 """ The experimental m/z value of the peak.""" -186 if self.mz_cal: -187 return self.mz_cal -188 else: -189 return self._mz_exp -190 -191 @mz_exp.setter -192 def mz_exp(self, mz_exp): -193 """ Sets the experimental m/z value of the peak.""" -194 self._mz_exp = mz_exp -195 -196 @property -197 def area(self): -198 """ The area of the peak.""" -199 if self._ms_parent.is_centroid: -200 return nan -201 else: -202 return self.calc_area() -203 -204 @property -205 def nominal_mz_exp(self): -206 """ The experimental nominal (integer) m/z value of the peak.""" -207 return int(self.mz_exp) -208 -209 @property -210 def kmd(self): -211 """ The Kendrick mass defect of the peak.""" -212 return self._kmd -213 -214 @property -215 def kendrick_mass(self): -216 """ The Kendrick mass of the peak.""" -217 return self._kendrick_mass -218 -219 @property -220 def knm(self): -221 """ The Kendrick nominal mass of the peak.""" -222 return self._nominal_km -223 -224 @property -225 def is_assigned(self) -> bool: -226 """ Whether the peak is assigned or not.""" -227 return bool(self.molecular_formulas) -228 -229 def plot_simulation( -230 self, -231 sim_type="lorentz", -232 ax=None, -233 color="green", -234 oversample_multiplier=1, -235 delta_rp=0, -236 mz_overlay=1, -237 ): -238 """ Plots the simulated peak. -239 -240 Parameters: -241 ---------- -242 sim_type : str, optional -243 The type of simulation to be plotted. -244 Default is "lorentz". -245 ax : matplotlib.axes, optional -246 The axes to plot the simulated peak. -247 Default is None. -248 color : str, optional -249 The color of the simulated peak. -250 Default is "green". -251 oversample_multiplier : int, optional -252 The oversample multiplier. -253 Default is 1. -254 delta_rp : int, optional -255 A delta value to the resolving power -256 Default is 0. -257 mz_overlay : int, optional -258 The mz overlay. -259 Default is 1. -260 -261 Returns: -262 ------- -263 matplotlib.axes -264 The axes where the simulated peak was plotted. -265 -266 """ -267 if self._ms_parent: -268 import matplotlib.pyplot as plt -269 -270 x, y = eval( -271 "self." -272 + sim_type -273 + "(oversample_multiplier=" -274 + str(oversample_multiplier) -275 + ", delta_rp=" -276 + str(delta_rp) -277 + ", mz_overlay=" -278 + str(mz_overlay) -279 + ")" -280 ) -281 -282 if ax is None: -283 ax = plt.gca() -284 ax.plot(x, y, color=color, label="Simulation") -285 ax.set(xlabel="m/z", ylabel="abundance") -286 -287 plt.legend() -288 return ax -289 -290 def plot( -291 self, ax=None, color :str="black", derivative : bool=True, deriv_color :str="red"): # pragma: no cover -292 """ Plots the peak. -293 -294 Parameters: -295 ---------- -296 ax : matplotlib.axes, optional -297 The axes to plot the peak. -298 Default is None. -299 color : str, optional -300 The color of the peak. -301 Default is "black". -302 derivative : bool, optional -303 Whether to plot the derivative of the peak. -304 Default is True. -305 deriv_color : str, optional -306 The color of the derivative of the peak. -307 Default is "red". -308 -309 Returns: -310 ------- -311 matplotlib.axes -312 The axes where the peak was plotted. -313 -314 """ -315 if self._ms_parent: -316 import matplotlib.pyplot as plt -317 -318 if ax is None: -319 ax = plt.gca() -320 x = self._ms_parent.mz_exp_profile[self.start_scan : self.final_scan] -321 y = self._ms_parent.abundance_profile[self.start_scan : self.final_scan] -322 -323 ax.plot(x, y, color=color, label="Data") -324 ax.set(xlabel="m/z", ylabel="abundance") -325 if derivative and not self._ms_parent.is_centroid: -326 dy = sp.derivate( -327 self._ms_parent.abundance_profile[ -328 self.start_index : self.final_index + 1 -329 ] -330 ) -331 ax.plot(x, dy, c=deriv_color) -332 else: -333 ax.plot( -334 (self.mz_exp, self.mz_exp), -335 (0, self.abundance), -336 color=color, -337 label="Data", -338 ) -339 -340 # plt.legend() -341 -342 return ax -343 -344 else: -345 print("Centroid Peak Object") -346 -347 @property -348 def best_molecular_formula_candidate(self): -349 """ The best molecular formula candidate for the peak. -350 -351 Returns a single best formula candidate based on the user defined score method. -352 Score method is set with: -353 molecular_search_settings.score_method -354 -355 Returns -356 ------- -357 MolecularFormula -358 The best molecular formula candidate for the peak. -359 -360 """ -361 if ( -362 self._ms_parent.molecular_search_settings.score_method -363 == "N_S_P_lowest_error" -364 ): -365 return self.cia_score_N_S_P_error() -366 -367 elif ( -368 self._ms_parent.molecular_search_settings.score_method == "S_P_lowest_error" -369 ): -370 return self.cia_score_S_P_error() -371 -372 elif self._ms_parent.molecular_search_settings.score_method == "lowest_error": -373 return self.molecular_formula_lowest_error() -374 -375 elif ( -376 self._ms_parent.molecular_search_settings.score_method == "air_filter_error" -377 ): -378 return self.molecular_formula_air_filter() -379 -380 elif ( -381 self._ms_parent.molecular_search_settings.score_method -382 == "water_filter_error" -383 ): -384 return self.molecular_formula_water_filter() -385 -386 elif ( -387 self._ms_parent.molecular_search_settings.score_method -388 == "earth_filter_error" -389 ): -390 return self.molecular_formula_earth_filter() -391 -392 elif self._ms_parent.molecular_search_settings.score_method == "prob_score": -393 return self.molecular_formula_highest_prob_score() -394 else: -395 raise TypeError( -396 "Unknown score method selected: % s, \ -397 Please check score_method at \ -398 encapsulation.settings.molecular_id.MolecularIDSettings.MolecularFormulaSearchSettings", -399 self._ms_parent.parameters.molecular_search.score_method, -400 ) -401 + 12 + 13class _MSPeak(MSPeakCalculation): + 14 """ A class representing a peak in a mass spectrum. + 15 + 16 Parameters: + 17 ---------- + 18 ion_charge : int + 19 The ion charge of the peak. + 20 mz_exp : float + 21 The experimental m/z value of the peak. + 22 abundance : float + 23 The abundance of the peak. + 24 resolving_power : float + 25 The resolving power of the peak. + 26 signal_to_noise : float + 27 The signal-to-noise ratio of the peak. + 28 indexes : list[int] + 29 The profile indexes of the peak. + 30 index : int + 31 The index of the peak. + 32 ms_parent : MSParent, optional + 33 The parent mass spectrum object. + 34 exp_freq : float, optional + 35 The experimental frequency of the peak. + 36 + 37 Methods: + 38 ------- + 39 * __len__(). + 40 Returns the number of molecular formulas associated with the peak. + 41 * __setitem__(position, molecular_formula_obj). + 42 Sets the molecular formula at the specified position. + 43 * __getitem__(position) -> MolecularFormula. + 44 Returns the molecular formula at the specified position. + 45 * change_kendrick_base(kendrick_dict_base). + 46 Changes the kendrick base for the peak. + 47 * add_molecular_formula(molecular_formula_obj). + 48 Adds a molecular formula to the peak. + 49 * remove_molecular_formula(mf_obj). + 50 Removes a molecular formula from the peak. + 51 * clear_molecular_formulas(). + 52 Clears all molecular formulas associated with the peak. + 53 * plot_simulation(sim_type="lorentz", ax=None, color="green", oversample_multiplier=1, delta_rp=0, mz_overlay=1). + 54 Plots the simulated peak. + 55 * plot(ax=None, color="black", derivative=True, deriv_color='red'). + 56 Plots the peak. + 57 * best_molecular_formula_candidate(). + 58 Returns the best molecular formula candidate for the peak. + 59 """ + 60 + 61 def __init__( + 62 self, + 63 ion_charge, + 64 mz_exp, + 65 abundance, + 66 resolving_power, + 67 signal_to_noise, + 68 indexes, + 69 index, + 70 ms_parent=None, + 71 exp_freq=None, + 72 ): + 73 self._ms_parent = ms_parent + 74 # needed to create the object + 75 self.ion_charge = int(ion_charge) + 76 self._mz_exp = float(mz_exp) + 77 self.mass = float(mz_exp) / float(ion_charge) + 78 self.abundance = float(abundance) + 79 self.resolving_power = float(resolving_power) + 80 self.signal_to_noise = float(signal_to_noise) + 81 # profile indexes + 82 #TODO fix these names from 'scan' to be more logical about peak indexes. + 83 self.start_scan = int(indexes[0]) + 84 self.apex_scan = int(indexes[1]) + 85 self.final_scan = int(indexes[2]) + 86 + 87 # mass spec obj index + 88 self.index = int(index) + 89 # parent mass spectrum obj instance + 90 + 91 # updated after mass error prediction' + 92 self.predicted_std = None + 93 # updated after calibration' + 94 self.mz_cal = None + 95 # updated individual calculation' + 96 self.baseline_noise = None + 97 + 98 if exp_freq: + 99 self.freq_exp = float(exp_freq) +100 +101 if self._ms_parent is not None: +102 kendrick_dict_base = self._ms_parent.mspeaks_settings.kendrick_base +103 else: +104 kendrick_dict_base = {"C": 1, "H": 2} +105 self._kmd, self._kendrick_mass, self._nominal_km = self._calc_kmd( +106 kendrick_dict_base +107 ) +108 +109 "updated after molecular formula ID" +110 +111 self.molecular_formulas = [] +112 self._confidence_score = None +113 # placeholder for found isotopologues index +114 self.isotopologue_indexes = [] +115 # placeholder for found isotopologues molecular formula obj +116 self.found_isotopologues = {} +117 +118 # Label for what type of peak it is - real signal, noise, sinc wiggle, magnetron or harmonic peak, etc. +119 self.peak_type = None +120 +121 def __len__(self): +122 return len(self.molecular_formulas) +123 +124 def __setitem__(self, position, molecular_formula_obj): +125 self.molecular_formulas[position] = molecular_formula_obj +126 +127 def __getitem__(self, position) -> MolecularFormula: +128 return self.molecular_formulas[position] +129 +130 def change_kendrick_base(self, kendrick_dict_base): +131 """ Changes the kendrick base for the peak. +132 +133 Parameters: +134 ---------- +135 kendrick_dict_base : dict +136 The kendrick base dictionary. +137 Default is {"C": 1, "H": 2}. (CH2) +138 """ +139 self._kmd, self._kendrick_mass, self._nominal_km = self._calc_kmd( +140 kendrick_dict_base +141 ) +142 +143 def add_molecular_formula(self, molecular_formula_obj): +144 """ Adds a molecular formula to the peak. +145 +146 Parameters: +147 ---------- +148 molecular_formula_obj : MolecularFormula +149 The molecular formula object to be added. +150 +151 Returns: +152 ------- +153 MolecularFormula +154 The molecular formula object added. +155 +156 """ +157 # freeze state +158 molecular_formula_obj._mspeak_parent = self +159 +160 # new_mol_formula = deepcopy(molecular_formula_obj) +161 # add link mass spectrum obj instance +162 +163 # new_mol_formula.mspeak_parent = self +164 +165 self.molecular_formulas.append(molecular_formula_obj) +166 +167 return molecular_formula_obj +168 +169 def remove_molecular_formula(self, mf_obj): +170 """ Removes a molecular formula from the peak. +171 +172 Parameters: +173 ---------- +174 mf_obj : MolecularFormula +175 The molecular formula object to be removed. +176 """ +177 self.molecular_formulas.remove(mf_obj) +178 +179 def clear_molecular_formulas(self): +180 """ Clears all molecular formulas associated with the peak. +181 """ +182 self.molecular_formulas = [] +183 +184 @property +185 def mz_exp(self): +186 """ The experimental m/z value of the peak.""" +187 if self.mz_cal: +188 return self.mz_cal +189 else: +190 return self._mz_exp +191 +192 @mz_exp.setter +193 def mz_exp(self, mz_exp): +194 """ Sets the experimental m/z value of the peak.""" +195 self._mz_exp = mz_exp +196 +197 @property +198 def area(self): +199 """ The area of the peak.""" +200 if self._ms_parent.is_centroid: +201 return nan +202 else: +203 return self.calc_area() +204 +205 @property +206 def nominal_mz_exp(self): +207 """ The experimental nominal (integer) m/z value of the peak.""" +208 return math.floor(self.mz_exp) +209 +210 @property +211 def kmd(self): +212 """ The Kendrick mass defect of the peak.""" +213 return self._kmd +214 +215 @property +216 def kendrick_mass(self): +217 """ The Kendrick mass of the peak.""" +218 return self._kendrick_mass +219 +220 @property +221 def knm(self): +222 """ The Kendrick nominal mass of the peak.""" +223 return self._nominal_km +224 +225 @property +226 def is_assigned(self) -> bool: +227 """ Whether the peak is assigned or not.""" +228 return bool(self.molecular_formulas) +229 +230 def plot_simulation( +231 self, +232 sim_type="lorentz", +233 ax=None, +234 color="green", +235 oversample_multiplier=1, +236 delta_rp=0, +237 mz_overlay=1, +238 ): +239 """ Plots the simulated peak. +240 +241 Parameters: +242 ---------- +243 sim_type : str, optional +244 The type of simulation to be plotted. +245 Default is "lorentz". +246 ax : matplotlib.axes, optional +247 The axes to plot the simulated peak. +248 Default is None. +249 color : str, optional +250 The color of the simulated peak. +251 Default is "green". +252 oversample_multiplier : int, optional +253 The oversample multiplier. +254 Default is 1. +255 delta_rp : int, optional +256 A delta value to the resolving power +257 Default is 0. +258 mz_overlay : int, optional +259 The mz overlay. +260 Default is 1. +261 +262 Returns: +263 ------- +264 matplotlib.axes +265 The axes where the simulated peak was plotted. +266 +267 """ +268 if self._ms_parent: +269 import matplotlib.pyplot as plt +270 +271 x, y = eval( +272 "self." +273 + sim_type +274 + "(oversample_multiplier=" +275 + str(oversample_multiplier) +276 + ", delta_rp=" +277 + str(delta_rp) +278 + ", mz_overlay=" +279 + str(mz_overlay) +280 + ")" +281 ) +282 +283 if ax is None: +284 ax = plt.gca() +285 ax.plot(x, y, color=color, label="Simulation") +286 ax.set(xlabel="m/z", ylabel="abundance") +287 +288 plt.legend() +289 return ax +290 +291 def plot( +292 self, ax=None, color :str="black", derivative : bool=True, deriv_color :str="red"): # pragma: no cover +293 """ Plots the peak. +294 +295 Parameters: +296 ---------- +297 ax : matplotlib.axes, optional +298 The axes to plot the peak. +299 Default is None. +300 color : str, optional +301 The color of the peak. +302 Default is "black". +303 derivative : bool, optional +304 Whether to plot the derivative of the peak. +305 Default is True. +306 deriv_color : str, optional +307 The color of the derivative of the peak. +308 Default is "red". +309 +310 Returns: +311 ------- +312 matplotlib.axes +313 The axes where the peak was plotted. +314 +315 """ +316 if self._ms_parent: +317 import matplotlib.pyplot as plt +318 +319 if ax is None: +320 ax = plt.gca() +321 x = self._ms_parent.mz_exp_profile[self.start_scan : self.final_scan] +322 y = self._ms_parent.abundance_profile[self.start_scan : self.final_scan] +323 +324 ax.plot(x, y, color=color, label="Data") +325 ax.set(xlabel="m/z", ylabel="abundance") +326 if derivative and not self._ms_parent.is_centroid: +327 dy = sp.derivate( +328 self._ms_parent.abundance_profile[ +329 self.start_index : self.final_index + 1 +330 ] +331 ) +332 ax.plot(x, dy, c=deriv_color) +333 else: +334 ax.plot( +335 (self.mz_exp, self.mz_exp), +336 (0, self.abundance), +337 color=color, +338 label="Data", +339 ) +340 +341 # plt.legend() +342 +343 return ax +344 +345 else: +346 print("Centroid Peak Object") +347 +348 @property +349 def best_molecular_formula_candidate(self): +350 """ The best molecular formula candidate for the peak. +351 +352 Returns a single best formula candidate based on the user defined score method. +353 Score method is set with: +354 molecular_search_settings.score_method +355 +356 Returns +357 ------- +358 MolecularFormula +359 The best molecular formula candidate for the peak. +360 +361 """ +362 if ( +363 self._ms_parent.molecular_search_settings.score_method +364 == "N_S_P_lowest_error" +365 ): +366 return self.cia_score_N_S_P_error() +367 +368 elif ( +369 self._ms_parent.molecular_search_settings.score_method == "S_P_lowest_error" +370 ): +371 return self.cia_score_S_P_error() +372 +373 elif self._ms_parent.molecular_search_settings.score_method == "lowest_error": +374 return self.molecular_formula_lowest_error() +375 +376 elif ( +377 self._ms_parent.molecular_search_settings.score_method == "air_filter_error" +378 ): +379 return self.molecular_formula_air_filter() +380 +381 elif ( +382 self._ms_parent.molecular_search_settings.score_method +383 == "water_filter_error" +384 ): +385 return self.molecular_formula_water_filter() +386 +387 elif ( +388 self._ms_parent.molecular_search_settings.score_method +389 == "earth_filter_error" +390 ): +391 return self.molecular_formula_earth_filter() +392 +393 elif self._ms_parent.molecular_search_settings.score_method == "prob_score": +394 return self.molecular_formula_highest_prob_score() +395 else: +396 raise TypeError( +397 "Unknown score method selected: % s, \ +398 Please check score_method at \ +399 encapsulation.settings.molecular_id.MolecularIDSettings.MolecularFormulaSearchSettings", +400 self._ms_parent.parameters.molecular_search.score_method, +401 ) 402 -403class ICRMassPeak(_MSPeak): -404 """A class representing a peak in an ICR mass spectrum. -405 -406 """ -407 def __init__(self, *args, ms_parent=None, exp_freq=None): -408 super().__init__(*args, exp_freq=exp_freq, ms_parent=ms_parent) -409 -410 def resolving_power_calc(self, B, T): -411 """ Calculate the theoretical resolving power of the peak. -412 -413 Parameters -414 ---------- -415 T: float -416 transient time -417 B: float -418 Magnetic Filed Strength (Tesla) -419 -420 Returns -421 ------- -422 float -423 Theoretical resolving power of the peak. -424 -425 References -426 ---------- -427 1. Marshall et al. (Mass Spectrom Rev. 1998 Jan-Feb;17(1):1-35.) -428 DOI: 10.1002/(SICI)1098-2787(1998)17:1<1::AID-MAS1>3.0.CO;2-K -429 """ -430 return (1.274e7 * self.ion_charge * B * T) / (self.mz_exp * self.ion_charge) -431 -432 def set_calc_resolving_power(self, B : float, T : float): -433 """ Set the resolving power of the peak to the calculated one. -434 """ -435 self.resolving_power = self.resolving_power_calc(B, T) -436 -437 def _mz_to_f_bruker(self): -438 """ [Not Functional] Convert a peak m/z value to frequency -439 -440 # Currently Broken - Not sure why -441 if self.mz_cal: -442 mz_val = self.mz_cal -443 else: -444 mz_val = self.mz_exp -445 Aterm, Bterm, Cterm = self._ms_parent.Aterm, self._ms_parent.Bterm, self._ms_parent.Cterm -446 # Check if the Bterm of Ledford equation scales with the ICR trap voltage or not then Bterm = Bterm*trap_voltage -447 -448 if Cterm == 0: -449 -450 if Bterm == 0: -451 #uncalibrated data -452 freq_domain = Aterm / mz_val -453 -454 else: -455 -456 freq_domain = (Aterm / (mz_val)) - Bterm -457 -458 # @will I need you insight here, not sure what is the inverted ledford equation that Bruker refers to -459 else: -460 -461 freq_domain = (Aterm / mz_val) + (Bterm / power(mz_val, 2)) + Cterm -462 -463 return freq_domain -464 """ -465 print("Function not confirmed to work, disabled.") -466 return None -467 +403 +404class ICRMassPeak(_MSPeak): +405 """A class representing a peak in an ICR mass spectrum. +406 +407 """ +408 def __init__(self, *args, ms_parent=None, exp_freq=None): +409 super().__init__(*args, exp_freq=exp_freq, ms_parent=ms_parent) +410 +411 def resolving_power_calc(self, B, T): +412 """ Calculate the theoretical resolving power of the peak. +413 +414 Parameters +415 ---------- +416 T: float +417 transient time +418 B: float +419 Magnetic Filed Strength (Tesla) +420 +421 Returns +422 ------- +423 float +424 Theoretical resolving power of the peak. +425 +426 References +427 ---------- +428 1. Marshall et al. (Mass Spectrom Rev. 1998 Jan-Feb;17(1):1-35.) +429 DOI: 10.1002/(SICI)1098-2787(1998)17:1<1::AID-MAS1>3.0.CO;2-K +430 """ +431 return (1.274e7 * self.ion_charge * B * T) / (self.mz_exp * self.ion_charge) +432 +433 def set_calc_resolving_power(self, B : float, T : float): +434 """ Set the resolving power of the peak to the calculated one. +435 """ +436 self.resolving_power = self.resolving_power_calc(B, T) +437 +438 def _mz_to_f_bruker(self): +439 """ [Not Functional] Convert a peak m/z value to frequency +440 +441 # Currently Broken - Not sure why +442 if self.mz_cal: +443 mz_val = self.mz_cal +444 else: +445 mz_val = self.mz_exp +446 Aterm, Bterm, Cterm = self._ms_parent.Aterm, self._ms_parent.Bterm, self._ms_parent.Cterm +447 # Check if the Bterm of Ledford equation scales with the ICR trap voltage or not then Bterm = Bterm*trap_voltage +448 +449 if Cterm == 0: +450 +451 if Bterm == 0: +452 #uncalibrated data +453 freq_domain = Aterm / mz_val +454 +455 else: +456 +457 freq_domain = (Aterm / (mz_val)) - Bterm +458 +459 # @will I need you insight here, not sure what is the inverted ledford equation that Bruker refers to +460 else: +461 +462 freq_domain = (Aterm / mz_val) + (Bterm / power(mz_val, 2)) + Cterm +463 +464 return freq_domain +465 """ +466 print("Function not confirmed to work, disabled.") +467 return None 468 -469class TOFMassPeak(_MSPeak): -470 """ A class representing a peak in a TOF mass spectrum. -471 +469 +470class TOFMassPeak(_MSPeak): +471 """ A class representing a peak in a TOF mass spectrum. 472 -473 """ -474 def __init__(self, *args, exp_freq=None): -475 super().__init__(*args, exp_freq=exp_freq) -476 -477 def set_calc_resolving_power(self): -478 return 0 -479 +473 +474 """ +475 def __init__(self, *args, exp_freq=None): +476 super().__init__(*args, exp_freq=exp_freq) +477 +478 def set_calc_resolving_power(self): +479 return 0 480 -481class OrbiMassPeak(_MSPeak): -482 """ A class representing a peak in an Orbitrap mass spectrum. -483 -484 """ -485 def __init__(self, *args, exp_freq=None): -486 super().__init__(*args, exp_freq=exp_freq) -487 -488 def set_calc_resolving_power(self): -489 return 0 +481 +482class OrbiMassPeak(_MSPeak): +483 """ A class representing a peak in an Orbitrap mass spectrum. +484 +485 """ +486 def __init__(self, *args, exp_freq=None): +487 super().__init__(*args, exp_freq=exp_freq) +488 +489 def set_calc_resolving_power(self): +490 return 0

    @@ -594,70 +595,70 @@

    -
    404class ICRMassPeak(_MSPeak):
    -405    """A class representing a peak in an ICR mass spectrum.
    -406    
    -407    """
    -408    def __init__(self, *args, ms_parent=None, exp_freq=None):
    -409        super().__init__(*args, exp_freq=exp_freq, ms_parent=ms_parent)
    -410
    -411    def resolving_power_calc(self, B, T):
    -412        """ Calculate the theoretical resolving power of the peak.
    -413        
    -414        Parameters
    -415        ----------
    -416        T: float
    -417            transient time
    -418        B: float
    -419            Magnetic Filed Strength (Tesla)
    -420        
    -421        Returns
    -422        -------
    -423        float
    -424            Theoretical resolving power of the peak.
    -425
    -426        References
    -427        ----------
    -428        1. Marshall et al. (Mass Spectrom Rev. 1998 Jan-Feb;17(1):1-35.)
    -429            DOI: 10.1002/(SICI)1098-2787(1998)17:1<1::AID-MAS1>3.0.CO;2-K
    -430        """
    -431        return (1.274e7 * self.ion_charge * B * T) / (self.mz_exp * self.ion_charge)
    -432
    -433    def set_calc_resolving_power(self, B : float, T : float):
    -434        """ Set the resolving power of the peak to the calculated one.
    -435        """
    -436        self.resolving_power = self.resolving_power_calc(B, T)
    -437
    -438    def _mz_to_f_bruker(self):
    -439        """ [Not Functional] Convert a peak m/z value to frequency
    -440        
    -441        # Currently Broken - Not sure why
    -442        if self.mz_cal:
    -443            mz_val = self.mz_cal
    -444        else:
    -445            mz_val = self.mz_exp
    -446        Aterm, Bterm, Cterm = self._ms_parent.Aterm, self._ms_parent.Bterm, self._ms_parent.Cterm
    -447        # Check if the Bterm of Ledford equation scales with the ICR trap voltage or not then Bterm = Bterm*trap_voltage
    -448        
    -449        if Cterm == 0:
    -450            
    -451            if Bterm == 0:
    -452                #uncalibrated data
    -453                freq_domain = Aterm / mz_val
    -454                
    -455            else:
    -456                
    -457                freq_domain = (Aterm / (mz_val)) - Bterm
    -458
    -459        # @will I need you insight here, not sure what is the inverted ledford equation that Bruker refers to
    -460        else:
    -461
    -462            freq_domain = (Aterm / mz_val) + (Bterm / power(mz_val, 2)) + Cterm
    -463
    -464        return freq_domain
    -465        """
    -466        print("Function not confirmed to work, disabled.")
    -467        return None
    +            
    405class ICRMassPeak(_MSPeak):
    +406    """A class representing a peak in an ICR mass spectrum.
    +407    
    +408    """
    +409    def __init__(self, *args, ms_parent=None, exp_freq=None):
    +410        super().__init__(*args, exp_freq=exp_freq, ms_parent=ms_parent)
    +411
    +412    def resolving_power_calc(self, B, T):
    +413        """ Calculate the theoretical resolving power of the peak.
    +414        
    +415        Parameters
    +416        ----------
    +417        T: float
    +418            transient time
    +419        B: float
    +420            Magnetic Filed Strength (Tesla)
    +421        
    +422        Returns
    +423        -------
    +424        float
    +425            Theoretical resolving power of the peak.
    +426
    +427        References
    +428        ----------
    +429        1. Marshall et al. (Mass Spectrom Rev. 1998 Jan-Feb;17(1):1-35.)
    +430            DOI: 10.1002/(SICI)1098-2787(1998)17:1<1::AID-MAS1>3.0.CO;2-K
    +431        """
    +432        return (1.274e7 * self.ion_charge * B * T) / (self.mz_exp * self.ion_charge)
    +433
    +434    def set_calc_resolving_power(self, B : float, T : float):
    +435        """ Set the resolving power of the peak to the calculated one.
    +436        """
    +437        self.resolving_power = self.resolving_power_calc(B, T)
    +438
    +439    def _mz_to_f_bruker(self):
    +440        """ [Not Functional] Convert a peak m/z value to frequency
    +441        
    +442        # Currently Broken - Not sure why
    +443        if self.mz_cal:
    +444            mz_val = self.mz_cal
    +445        else:
    +446            mz_val = self.mz_exp
    +447        Aterm, Bterm, Cterm = self._ms_parent.Aterm, self._ms_parent.Bterm, self._ms_parent.Cterm
    +448        # Check if the Bterm of Ledford equation scales with the ICR trap voltage or not then Bterm = Bterm*trap_voltage
    +449        
    +450        if Cterm == 0:
    +451            
    +452            if Bterm == 0:
    +453                #uncalibrated data
    +454                freq_domain = Aterm / mz_val
    +455                
    +456            else:
    +457                
    +458                freq_domain = (Aterm / (mz_val)) - Bterm
    +459
    +460        # @will I need you insight here, not sure what is the inverted ledford equation that Bruker refers to
    +461        else:
    +462
    +463            freq_domain = (Aterm / mz_val) + (Bterm / power(mz_val, 2)) + Cterm
    +464
    +465        return freq_domain
    +466        """
    +467        print("Function not confirmed to work, disabled.")
    +468        return None
     
    @@ -675,8 +676,8 @@

    -
    408    def __init__(self, *args, ms_parent=None, exp_freq=None):
    -409        super().__init__(*args, exp_freq=exp_freq, ms_parent=ms_parent)
    +            
    409    def __init__(self, *args, ms_parent=None, exp_freq=None):
    +410        super().__init__(*args, exp_freq=exp_freq, ms_parent=ms_parent)
     
    @@ -694,27 +695,27 @@

    -
    411    def resolving_power_calc(self, B, T):
    -412        """ Calculate the theoretical resolving power of the peak.
    -413        
    -414        Parameters
    -415        ----------
    -416        T: float
    -417            transient time
    -418        B: float
    -419            Magnetic Filed Strength (Tesla)
    -420        
    -421        Returns
    -422        -------
    -423        float
    -424            Theoretical resolving power of the peak.
    -425
    -426        References
    -427        ----------
    -428        1. Marshall et al. (Mass Spectrom Rev. 1998 Jan-Feb;17(1):1-35.)
    -429            DOI: 10.1002/(SICI)1098-2787(1998)17:1<1::AID-MAS1>3.0.CO;2-K
    -430        """
    -431        return (1.274e7 * self.ion_charge * B * T) / (self.mz_exp * self.ion_charge)
    +            
    412    def resolving_power_calc(self, B, T):
    +413        """ Calculate the theoretical resolving power of the peak.
    +414        
    +415        Parameters
    +416        ----------
    +417        T: float
    +418            transient time
    +419        B: float
    +420            Magnetic Filed Strength (Tesla)
    +421        
    +422        Returns
    +423        -------
    +424        float
    +425            Theoretical resolving power of the peak.
    +426
    +427        References
    +428        ----------
    +429        1. Marshall et al. (Mass Spectrom Rev. 1998 Jan-Feb;17(1):1-35.)
    +430            DOI: 10.1002/(SICI)1098-2787(1998)17:1<1::AID-MAS1>3.0.CO;2-K
    +431        """
    +432        return (1.274e7 * self.ion_charge * B * T) / (self.mz_exp * self.ion_charge)
     
    @@ -756,10 +757,10 @@
    References
    -
    433    def set_calc_resolving_power(self, B : float, T : float):
    -434        """ Set the resolving power of the peak to the calculated one.
    -435        """
    -436        self.resolving_power = self.resolving_power_calc(B, T)
    +            
    434    def set_calc_resolving_power(self, B : float, T : float):
    +435        """ Set the resolving power of the peak to the calculated one.
    +436        """
    +437        self.resolving_power = self.resolving_power_calc(B, T)
     
    @@ -840,16 +841,16 @@
    Inherited Members
    -
    470class TOFMassPeak(_MSPeak):
    -471    """ A class representing a peak in a TOF mass spectrum.
    -472    
    +            
    471class TOFMassPeak(_MSPeak):
    +472    """ A class representing a peak in a TOF mass spectrum.
     473    
    -474    """
    -475    def __init__(self, *args, exp_freq=None):
    -476        super().__init__(*args, exp_freq=exp_freq)
    -477
    -478    def set_calc_resolving_power(self):
    -479        return 0
    +474    
    +475    """
    +476    def __init__(self, *args, exp_freq=None):
    +477        super().__init__(*args, exp_freq=exp_freq)
    +478
    +479    def set_calc_resolving_power(self):
    +480        return 0
     
    @@ -867,8 +868,8 @@
    Inherited Members
    -
    475    def __init__(self, *args, exp_freq=None):
    -476        super().__init__(*args, exp_freq=exp_freq)
    +            
    476    def __init__(self, *args, exp_freq=None):
    +477        super().__init__(*args, exp_freq=exp_freq)
     
    @@ -886,8 +887,8 @@
    Inherited Members
    -
    478    def set_calc_resolving_power(self):
    -479        return 0
    +            
    479    def set_calc_resolving_power(self):
    +480        return 0
     
    @@ -966,15 +967,15 @@
    Inherited Members
    -
    482class OrbiMassPeak(_MSPeak):
    -483    """ A class representing a peak in an Orbitrap mass spectrum.
    -484    
    -485    """
    -486    def __init__(self, *args, exp_freq=None):
    -487        super().__init__(*args, exp_freq=exp_freq)
    -488
    -489    def set_calc_resolving_power(self):
    -490        return 0
    +            
    483class OrbiMassPeak(_MSPeak):
    +484    """ A class representing a peak in an Orbitrap mass spectrum.
    +485    
    +486    """
    +487    def __init__(self, *args, exp_freq=None):
    +488        super().__init__(*args, exp_freq=exp_freq)
    +489
    +490    def set_calc_resolving_power(self):
    +491        return 0
     
    @@ -992,8 +993,8 @@
    Inherited Members
    -
    486    def __init__(self, *args, exp_freq=None):
    -487        super().__init__(*args, exp_freq=exp_freq)
    +            
    487    def __init__(self, *args, exp_freq=None):
    +488        super().__init__(*args, exp_freq=exp_freq)
     
    @@ -1011,8 +1012,8 @@
    Inherited Members
    -
    489    def set_calc_resolving_power(self):
    -490        return 0
    +            
    490    def set_calc_resolving_power(self):
    +491        return 0
     
    diff --git a/docs/search.js b/docs/search.js index e11a2ad5..f538bafb 100644 --- a/docs/search.js +++ b/docs/search.js @@ -1,6 +1,6 @@ window.pdocSearch = (function(){ /** elasticlunr - http://weixsong.github.io * Copyright (C) 2017 Oliver Nightingale * Copyright (C) 2017 Wei Song * MIT Licensed */!function(){function e(e){if(null===e||"object"!=typeof e)return e;var t=e.constructor();for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}var t=function(e){var n=new t.Index;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),e&&e.call(n,n),n};t.version="0.9.5",lunr=t,t.utils={},t.utils.warn=function(e){return function(t){e.console&&console.warn&&console.warn(t)}}(this),t.utils.toString=function(e){return void 0===e||null===e?"":e.toString()},t.EventEmitter=function(){this.events={}},t.EventEmitter.prototype.addListener=function(){var e=Array.prototype.slice.call(arguments),t=e.pop(),n=e;if("function"!=typeof t)throw new TypeError("last argument must be a function");n.forEach(function(e){this.hasHandler(e)||(this.events[e]=[]),this.events[e].push(t)},this)},t.EventEmitter.prototype.removeListener=function(e,t){if(this.hasHandler(e)){var n=this.events[e].indexOf(t);-1!==n&&(this.events[e].splice(n,1),0==this.events[e].length&&delete this.events[e])}},t.EventEmitter.prototype.emit=function(e){if(this.hasHandler(e)){var t=Array.prototype.slice.call(arguments,1);this.events[e].forEach(function(e){e.apply(void 0,t)},this)}},t.EventEmitter.prototype.hasHandler=function(e){return e in this.events},t.tokenizer=function(e){if(!arguments.length||null===e||void 0===e)return[];if(Array.isArray(e)){var n=e.filter(function(e){return null===e||void 0===e?!1:!0});n=n.map(function(e){return t.utils.toString(e).toLowerCase()});var i=[];return n.forEach(function(e){var n=e.split(t.tokenizer.seperator);i=i.concat(n)},this),i}return e.toString().trim().toLowerCase().split(t.tokenizer.seperator)},t.tokenizer.defaultSeperator=/[\s\-]+/,t.tokenizer.seperator=t.tokenizer.defaultSeperator,t.tokenizer.setSeperator=function(e){null!==e&&void 0!==e&&"object"==typeof e&&(t.tokenizer.seperator=e)},t.tokenizer.resetSeperator=function(){t.tokenizer.seperator=t.tokenizer.defaultSeperator},t.tokenizer.getSeperator=function(){return t.tokenizer.seperator},t.Pipeline=function(){this._queue=[]},t.Pipeline.registeredFunctions={},t.Pipeline.registerFunction=function(e,n){n in t.Pipeline.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[n]=e},t.Pipeline.getRegisteredFunction=function(e){return e in t.Pipeline.registeredFunctions!=!0?null:t.Pipeline.registeredFunctions[e]},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(e){var i=t.Pipeline.getRegisteredFunction(e);if(!i)throw new Error("Cannot load un-registered function: "+e);n.add(i)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(e){t.Pipeline.warnIfFunctionNotRegistered(e),this._queue.push(e)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._queue.indexOf(e);if(-1===i)throw new Error("Cannot find existingFn");this._queue.splice(i+1,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._queue.indexOf(e);if(-1===i)throw new Error("Cannot find existingFn");this._queue.splice(i,0,n)},t.Pipeline.prototype.remove=function(e){var t=this._queue.indexOf(e);-1!==t&&this._queue.splice(t,1)},t.Pipeline.prototype.run=function(e){for(var t=[],n=e.length,i=this._queue.length,o=0;n>o;o++){for(var r=e[o],s=0;i>s&&(r=this._queue[s](r,o,e),void 0!==r&&null!==r);s++);void 0!==r&&null!==r&&t.push(r)}return t},t.Pipeline.prototype.reset=function(){this._queue=[]},t.Pipeline.prototype.get=function(){return this._queue},t.Pipeline.prototype.toJSON=function(){return this._queue.map(function(e){return t.Pipeline.warnIfFunctionNotRegistered(e),e.label})},t.Index=function(){this._fields=[],this._ref="id",this.pipeline=new t.Pipeline,this.documentStore=new t.DocumentStore,this.index={},this.eventEmitter=new t.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))},t.Index.prototype.on=function(){var e=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,e)},t.Index.prototype.off=function(e,t){return this.eventEmitter.removeListener(e,t)},t.Index.load=function(e){e.version!==t.version&&t.utils.warn("version mismatch: current "+t.version+" importing "+e.version);var n=new this;n._fields=e.fields,n._ref=e.ref,n.documentStore=t.DocumentStore.load(e.documentStore),n.pipeline=t.Pipeline.load(e.pipeline),n.index={};for(var i in e.index)n.index[i]=t.InvertedIndex.load(e.index[i]);return n},t.Index.prototype.addField=function(e){return this._fields.push(e),this.index[e]=new t.InvertedIndex,this},t.Index.prototype.setRef=function(e){return this._ref=e,this},t.Index.prototype.saveDocument=function(e){return this.documentStore=new t.DocumentStore(e),this},t.Index.prototype.addDoc=function(e,n){if(e){var n=void 0===n?!0:n,i=e[this._ref];this.documentStore.addDoc(i,e),this._fields.forEach(function(n){var o=this.pipeline.run(t.tokenizer(e[n]));this.documentStore.addFieldLength(i,n,o.length);var r={};o.forEach(function(e){e in r?r[e]+=1:r[e]=1},this);for(var s in r){var u=r[s];u=Math.sqrt(u),this.index[n].addToken(s,{ref:i,tf:u})}},this),n&&this.eventEmitter.emit("add",e,this)}},t.Index.prototype.removeDocByRef=function(e){if(e&&this.documentStore.isDocStored()!==!1&&this.documentStore.hasDoc(e)){var t=this.documentStore.getDoc(e);this.removeDoc(t,!1)}},t.Index.prototype.removeDoc=function(e,n){if(e){var n=void 0===n?!0:n,i=e[this._ref];this.documentStore.hasDoc(i)&&(this.documentStore.removeDoc(i),this._fields.forEach(function(n){var o=this.pipeline.run(t.tokenizer(e[n]));o.forEach(function(e){this.index[n].removeToken(e,i)},this)},this),n&&this.eventEmitter.emit("remove",e,this))}},t.Index.prototype.updateDoc=function(e,t){var t=void 0===t?!0:t;this.removeDocByRef(e[this._ref],!1),this.addDoc(e,!1),t&&this.eventEmitter.emit("update",e,this)},t.Index.prototype.idf=function(e,t){var n="@"+t+"/"+e;if(Object.prototype.hasOwnProperty.call(this._idfCache,n))return this._idfCache[n];var i=this.index[t].getDocFreq(e),o=1+Math.log(this.documentStore.length/(i+1));return this._idfCache[n]=o,o},t.Index.prototype.getFields=function(){return this._fields.slice()},t.Index.prototype.search=function(e,n){if(!e)return[];e="string"==typeof e?{any:e}:JSON.parse(JSON.stringify(e));var i=null;null!=n&&(i=JSON.stringify(n));for(var o=new t.Configuration(i,this.getFields()).get(),r={},s=Object.keys(e),u=0;u0&&t.push(e);for(var i in n)"docs"!==i&&"df"!==i&&this.expandToken(e+i,t,n[i]);return t},t.InvertedIndex.prototype.toJSON=function(){return{root:this.root}},t.Configuration=function(e,n){var e=e||"";if(void 0==n||null==n)throw new Error("fields should not be null");this.config={};var i;try{i=JSON.parse(e),this.buildUserConfig(i,n)}catch(o){t.utils.warn("user configuration parse failed, will use default configuration"),this.buildDefaultConfig(n)}},t.Configuration.prototype.buildDefaultConfig=function(e){this.reset(),e.forEach(function(e){this.config[e]={boost:1,bool:"OR",expand:!1}},this)},t.Configuration.prototype.buildUserConfig=function(e,n){var i="OR",o=!1;if(this.reset(),"bool"in e&&(i=e.bool||i),"expand"in e&&(o=e.expand||o),"fields"in e)for(var r in e.fields)if(n.indexOf(r)>-1){var s=e.fields[r],u=o;void 0!=s.expand&&(u=s.expand),this.config[r]={boost:s.boost||0===s.boost?s.boost:1,bool:s.bool||i,expand:u}}else t.utils.warn("field name in user configuration not found in index instance fields");else this.addAllFields2UserConfig(i,o,n)},t.Configuration.prototype.addAllFields2UserConfig=function(e,t,n){n.forEach(function(n){this.config[n]={boost:1,bool:e,expand:t}},this)},t.Configuration.prototype.get=function(){return this.config},t.Configuration.prototype.reset=function(){this.config={}},lunr.SortedSet=function(){this.length=0,this.elements=[]},lunr.SortedSet.load=function(e){var t=new this;return t.elements=e,t.length=e.length,t},lunr.SortedSet.prototype.add=function(){var e,t;for(e=0;e1;){if(r===e)return o;e>r&&(t=o),r>e&&(n=o),i=n-t,o=t+Math.floor(i/2),r=this.elements[o]}return r===e?o:-1},lunr.SortedSet.prototype.locationFor=function(e){for(var t=0,n=this.elements.length,i=n-t,o=t+Math.floor(i/2),r=this.elements[o];i>1;)e>r&&(t=o),r>e&&(n=o),i=n-t,o=t+Math.floor(i/2),r=this.elements[o];return r>e?o:e>r?o+1:void 0},lunr.SortedSet.prototype.intersect=function(e){for(var t=new lunr.SortedSet,n=0,i=0,o=this.length,r=e.length,s=this.elements,u=e.elements;;){if(n>o-1||i>r-1)break;s[n]!==u[i]?s[n]u[i]&&i++:(t.add(s[n]),n++,i++)}return t},lunr.SortedSet.prototype.clone=function(){var e=new lunr.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},lunr.SortedSet.prototype.union=function(e){var t,n,i;this.length>=e.length?(t=this,n=e):(t=e,n=this),i=t.clone();for(var o=0,r=n.toArray();o\"CoreMS

    \n\n
    \n\n
    \n
    \n\"CoreMS\n
    \n
    \n\n

    Table of Contents

    \n\n\n\n
    \n\n

    CoreMS

    \n\n

    CoreMS is a comprehensive mass spectrometry framework for software development and data analysis of small molecules analysis.

    \n\n

    Data handling and software development for modern mass spectrometry (MS) is an interdisciplinary endeavor requiring skills in computational science and a deep understanding of MS. To enable scientific software development to keep pace with fast improvements in MS technology, we have developed a Python software framework named CoreMS. The goal of the framework is to provide a fundamental, high-level basis for working with all mass spectrometry data types, allowing custom workflows for data signal processing, annotation, and curation. The data structures were designed with an intuitive, mass spectrometric hierarchical structure, thus allowing organized and easy access to the data and calculations. Moreover, CoreMS supports direct access for almost all vendors\u2019 data formats, allowing for the centralization and automation of all data processing workflows from the raw signal to data annotation and curation.

    \n\n

    CoreMS aims to provide

    \n\n
      \n
    • logical mass spectrometric data structure
    • \n
    • self-containing data and metadata storage
    • \n
    • modern molecular formulae assignment algorithms
    • \n
    • dynamic molecular search space database search and generator
    • \n
    \n\n
    \n\n

    Current Version

    \n\n

    2.0

    \n\n
    \n\n

    Main Developers/Contact

    \n\n\n\n
    \n\n

    Contributing

    \n\n

    As an open source project, CoreMS welcomes contributions of all forms. Before contributing, please see our Dev Guide

    \n\n
    \n\n

    Data formats

    \n\n

    Data input formats

    \n\n
      \n
    • Bruker Solarix (CompassXtract)
    • \n
    • Bruker Solarix transients, ser and fid (FT magnitude mode only)
    • \n
    • ThermoFisher (.raw)
    • \n
    • Spectroswiss signal booster data-acquisition station (.hdf5)
    • \n
    • MagLab ICR data-acquisition station (FT and magnitude mode) (.dat)
    • \n
    • ANDI NetCDF for GC-MS (.cdf)
    • \n
    • Generic mass list in profile and centroid mde (include all delimiters types and Excel formats)
    • \n
    • CoreMS exported processed mass list files(excel, .csv, .txt, pandas dataframe as .pkl)
    • \n
    • CoreMS self-containing Hierarchical Data Format (.hdf5)
    • \n
    • Pandas Dataframe
    • \n
    • Support for cloud Storage using s3path.S3path(see examples of usage here: S3 Support)
    • \n
    \n\n

    Data output formats

    \n\n
      \n
    • Pandas data frame (can be saved using pickle, h5, etc)
    • \n
    • Text Files (.csv, tab separated .txt, etc)
    • \n
    • Microsoft Excel (xlsx)
    • \n
    • Automatic JSON for metadata storage and reuse
    • \n
    • Self-containing Hierarchical Data Format (.hdf5) including raw data and ime-series data-point for processed data-sets with all associated metadata stored as json attributes
    • \n
    \n\n

    Data structure types

    \n\n
      \n
    • LC-MS
    • \n
    • GC-MS
    • \n
    • Transient
    • \n
    • Mass Spectra
    • \n
    • Mass Spectrum
    • \n
    • Mass Spectral Peak
    • \n
    • Molecular Formula
    • \n
    \n\n

    In progress data structures

    \n\n
      \n
    • IMS-MS
    • \n
    • LC-IMS-MS
    • \n
    • Collections
    • \n
    • Molecular Structure
    • \n
    \n\n
    \n\n

    Available features

    \n\n

    FT-MS Signal Processing, Calibration, and Molecular Formula Search and Assignment

    \n\n
      \n
    • Apodization, Zerofilling, and Magnitude mode FT
    • \n
    • Manual and automatic noise threshold calculation
    • \n
    • Peak picking using apex quadratic fitting
    • \n
    • Experimental resolving power calculation
    • \n
    • Frequency and m/z domain calibration functions:
    • \n
    • LedFord equation
    • \n
    • Linear equation
    • \n
    • Quadratic equation
    • \n
    • Automatic search most abundant Ox homologue series
    • \n
    • Automatic local (SQLite) or external (PostgreSQL) database check, generation, and search
    • \n
    • Automatic molecular formulae assignments algorithm for ESI(-) MS for natural organic matter analysis
    • \n
    • Automatic fine isotopic structure calculation and search for all isotopes
    • \n
    • Flexible Kendrick normalization base
    • \n
    • Kendrick filter using density-based clustering
    • \n
    • Kendrick classification
    • \n
    • Heteroatoms classification and visualization
    • \n
    \n\n

    GC-MS Signal Processing, Calibration, and Compound Identification

    \n\n
      \n
    • Baseline detection, subtraction, smoothing
    • \n
    • m/z based Chromatogram Peak Deconvolution,
    • \n
    • Manual and automatic noise threshold calculation
    • \n
    • First and second derivatives peak picking methods
    • \n
    • Peak Area Calculation
    • \n
    • Retention Index Calibration
    • \n
    • Automatic local (SQLite) or external (MongoDB or PostgreSQL) database check, generation, and search
    • \n
    • Automatic molecular match algorithm with all spectral similarity methods
    • \n
    \n\n

    High Resolution Mass Spectrum Simulations

    \n\n
      \n
    • Peak shape (Lorentz, Gaussian, Voigt, and pseudo-Voigt)
    • \n
    • Peak fitting for peak shape definition
    • \n
    • Peak position in function of data points, signal to noise and resolving power (Lorentz and Gaussian)
    • \n
    • Prediction of mass error distribution
    • \n
    • Calculated ICR Resolving Power based on magnetic field (B), and transient time(T)
    • \n
    \n\n
    \n\n

    Installation

    \n\n
    \n
    pip install corems\n
    \n
    \n\n

    By default the molecular formula database will be generated using SQLite

    \n\n

    To use Postgresql the easiest way is to build a docker container:

    \n\n
    \n
    docker-compose up -d\n
    \n
    \n\n
      \n
    • Change the url_database on MSParameters.molecular_search.url_database to: \"postgresql+psycopg2://coremsappdb:coremsapppnnl@localhost:5432/coremsapp\"
    • \n
    • Set the url_database env variable COREMS_DATABASE_URL to: \"postgresql+psycopg2://coremsappdb:coremsapppnnl@localhost:5432/coremsapp\"
    • \n
    \n\n

    Thermo Raw File Access:

    \n\n

    To be able to open thermo file a installation of pythonnet is needed:

    \n\n
      \n
    • Windows: \n
      \n
      pip install pythonnet\n
      \n
    • \n
    \n\n
      \n
    • Mac and Linux:\n
      \n
      brew install mono\npip install pythonnet   \n
      \n
    • \n
    \n\n
    \n\n

    Docker stack

    \n\n

    Another option to use CoreMS is to run the docker stack that will start the CoreMS containers

    \n\n

    Molecular Database and Jupyter Notebook Docker Containers

    \n\n

    A docker container containing:

    \n\n
      \n
    • A custom python distribution will all dependencies installed
    • \n
    • A Jupyter notebook server with workflow examples
    • \n
    • A PostgreSQL database for the molecular formulae assignment
    • \n
    \n\n

    If you don't have docker installed, the easiest way is to install docker for desktop

    \n\n
      \n
    1. Start the containers using docker-compose (easiest way):

      \n\n

      On docker-compose-jupyter.yml there is a volume mapping for the tests_data directory with the data provided for testing, to change to your data location:

      \n\n
        \n
      • locate the volumes on docker-compose-jupyter.yml:

        \n\n
        \n
        volumes:\n  - ./tests/tests_data:/home/CoreMS/data\n
        \n
      • \n
      • change \"./tests/tests_data\" to your data directory location

        \n\n
        \n
        volumes:\n  - path_to_your_data_directory:/home/corems/data\n
        \n
      • \n
      • save the file and then call:

        \n\n
        \n
        docker-compose -f docker-compose-jupyter.yml up\n
        \n
      • \n
    2. \n
    3. Another option is to manually build the containers:

      \n\n
        \n
      • Build the corems image:

        \n\n
        \n
        docker build -t corems:local .\n
        \n
      • \n
      • Start the database container:

        \n\n
        \n
        docker-compose up -d   \n
        \n
      • \n
      • Start the Jupyter Notebook:

        \n\n
        \n
        docker run --rm -v ./data:/home/CoreMS/data corems:local\n
        \n
      • \n
      • Open your browser, copy and past the URL address provided in the terminal: http://localhost:8888/?token=<token>.

      • \n
      • Open the CoreMS-Tutorial.ipynb

      • \n
    4. \n
    \n\n
    \n\n

    Simple Script Example

    \n\n

    More examples can be found under the directory examples/scripts, examples/notebooks

    \n\n
      \n
    • Basic functionality example
    • \n
    \n\n
    \n
    from corems.transient.input.brukerSolarix import ReadBrukerSolarix\nfrom corems.molecular_id.search.molecularFormulaSearch import SearchMolecularFormulas\nfrom corems.mass_spectrum.output.export import HighResMassSpecExport\nfrom matplotlib import pyplot\n\nfile_path= 'tests/tests_data/ftms/ESI_NEG_SRFA.d'\n\n# Instatiate the Bruker Solarix reader with the filepath\nbruker_reader = ReadBrukerSolarix(file_path)\n\n# Use the reader to instatiate a transient object\nbruker_transient_obj = bruker_reader.get_transient()\n\n# Calculate the transient duration time\nT =  bruker_transient_obj.transient_time\n\n# Use the transient object to instatitate a mass spectrum object\nmass_spectrum_obj = bruker_transient_obj.get_mass_spectrum(plot_result=False, auto_process=True)\n\n# The following SearchMolecularFormulas function does the following\n# - searches monoisotopic molecular formulas for all mass spectral peaks\n# - calculates fine isotopic structure based on monoisotopic molecular formulas found and current dynamic range\n# - searches molecular formulas of correspondent calculated isotopologues\n# - settings are stored at SearchConfig.json and can be changed directly on the file or inside the framework class\n\nSearchMolecularFormulas(mass_spectrum_obj, first_hit=False).run_worker_mass_spectrum()\n\n# Iterate over mass spectral peaks objs within the mass_spectrum_obj\nfor mspeak in mass_spectrum_obj.sort_by_abundance():\n\n    # If there is at least one molecular formula associated, mspeak returns True\n    if  mspeak:\n\n        # Get the molecular formula with the highest mass accuracy\n        molecular_formula = mspeak.molecular_formula_lowest_error\n\n        # Plot mz and peak height\n        pyplot.plot(mspeak.mz_exp, mspeak.abundance, 'o', c='g')\n\n        # Iterate over all molecular formulas associated with the ms peaks obj\n        for molecular_formula in mspeak:\n\n            # Check if the molecular formula is a isotopologue\n            if molecular_formula.is_isotopologue:\n\n                # Access the molecular formula text representation and print\n                print (molecular_formula.string)\n\n                # Get 13C atoms count\n                print (molecular_formula['13C'])\n    else:\n        # Get mz and peak height\n        print(mspeak.mz_exp,mspeak.abundance)\n\n# Save data\n## to a csv file\nmass_spectrum_obj.to_csv("filename")\nmass_spectrum_obj.to_hdf("filename")\n# to pandas Datarame pickle\nmass_spectrum_obj.to_pandas("filename")\n\n# Extract data as a pandas Dataframe\ndf = mass_spectrum_obj.to_dataframe()\n
    \n
    \n\n
    \n\n

    UML Diagrams

    \n\n

    UML (unified modeling language) diagrams for Direct Infusion FT-MS and GC-MS classes can be found here.

    \n\n
    \n\n

    Citing CoreMS

    \n\n

    If you use CoreMS in your work, please use the following citation:\nVersion 2.0.0 Release on GitHub, archived on Zenodo:

    \n\n

    \"DOI\"

    \n\n
    Yuri E. Corilo, William R. Kew, Lee Ann McCue (2021, March 27). EMSL-Computing/CoreMS: CoreMS 2.0.0 (Version v2.0.0), as developed on Github. Zenodo. http://doi.org/10.5281/zenodo.4641552\n
    \n\n
    \n\n

    This material was prepared as an account of work sponsored by an agency of the\nUnited States Government. Neither the United States Government nor the United\nStates Department of Energy, nor Battelle, nor any of their employees, nor any\njurisdiction or organization that has cooperated in the development of these\nmaterials, makes any warranty, express or implied, or assumes any legal\nliability or responsibility for the accuracy, completeness, or usefulness or\nany information, apparatus, product, software, or process disclosed, or\nrepresents that its use would not infringe privately owned rights.

    \n\n

    Reference herein to any specific commercial product, process, or service by\ntrade name, trademark, manufacturer, or otherwise does not necessarily\nconstitute or imply its endorsement, recommendation, or favoring by the United\nStates Government or any agency thereof, or Battelle Memorial Institute. The\nviews and opinions of authors expressed herein do not necessarily state or\nreflect those of the United States Government or any agency thereof.

    \n\n
                 PACIFIC NORTHWEST NATIONAL LABORATORY\n                          operated by\n                            BATTELLE\n                            for the\n               UNITED STATES DEPARTMENT OF ENERGY\n                under Contract DE-AC05-76RL01830\n
    \n"}, {"fullname": "corems.timeit", "modulename": "corems", "qualname": "timeit", "kind": "function", "doc": "

    \n", "signature": "(method):", "funcdef": "def"}, {"fullname": "corems.SuppressPrints", "modulename": "corems", "qualname": "SuppressPrints", "kind": "class", "doc": "

    \n"}, {"fullname": "corems.get_filenames", "modulename": "corems", "qualname": "get_filenames", "kind": "function", "doc": "

    \n", "signature": "(app=None):", "funcdef": "def"}, {"fullname": "corems.get_filename", "modulename": "corems", "qualname": "get_filename", "kind": "function", "doc": "

    \n", "signature": "(app=None):", "funcdef": "def"}, {"fullname": "corems.get_dirname", "modulename": "corems", "qualname": "get_dirname", "kind": "function", "doc": "

    \n", "signature": "(app=None):", "funcdef": "def"}, {"fullname": "corems.get_dirnames", "modulename": "corems", "qualname": "get_dirnames", "kind": "function", "doc": "

    \n", "signature": "(app=None):", "funcdef": "def"}, {"fullname": "corems.chunks", "modulename": "corems", "qualname": "chunks", "kind": "function", "doc": "

    Yield successive n-sized chunks from lst.

    \n", "signature": "(lst, n):", "funcdef": "def"}, {"fullname": "corems.corems_md5", "modulename": "corems", "qualname": "corems_md5", "kind": "function", "doc": "

    \n", "signature": "(fname):", "funcdef": "def"}, {"fullname": "corems.chroma_peak", "modulename": "corems.chroma_peak", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.chroma_peak.calc", "modulename": "corems.chroma_peak.calc", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.chroma_peak.calc.ChromaPeakCalc", "modulename": "corems.chroma_peak.calc.ChromaPeakCalc", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.chroma_peak.calc.ChromaPeakCalc.GCPeakCalculation", "modulename": "corems.chroma_peak.calc.ChromaPeakCalc", "qualname": "GCPeakCalculation", "kind": "class", "doc": "

    Class for performing peak calculations in GC chromatography.

    \n\n
    Methods
    \n\n
      \n
    • calc_area(self, tic: List[float], dx: float) -> None: Calculate the area under the curve of the chromatogram.
    • \n
    • linear_ri(self, right_ri: float, left_ri: float, left_rt: float, right_rt: float) -> float: Calculate the retention index using linear interpolation.
    • \n
    • calc_ri(self, rt_ri_pairs: List[Tuple[float, float]]) -> int: Calculate the retention index based on the given retention time - retention index pairs.
    • \n
    \n"}, {"fullname": "corems.chroma_peak.calc.ChromaPeakCalc.GCPeakCalculation.calc_area", "modulename": "corems.chroma_peak.calc.ChromaPeakCalc", "qualname": "GCPeakCalculation.calc_area", "kind": "function", "doc": "

    Calculate the area under the curve of the chromatogram.

    \n\n
    Parameters
    \n\n
      \n
    • tic (List[float]):\nThe total ion current (TIC) values.
    • \n
    • dx (float):\nThe spacing between data points.
    • \n
    \n", "signature": "(self, tic: list[float], dx: float) -> None:", "funcdef": "def"}, {"fullname": "corems.chroma_peak.calc.ChromaPeakCalc.GCPeakCalculation.linear_ri", "modulename": "corems.chroma_peak.calc.ChromaPeakCalc", "qualname": "GCPeakCalculation.linear_ri", "kind": "function", "doc": "

    Calculate the retention index using linear interpolation.

    \n\n
    Parameters
    \n\n
      \n
    • right_ri (float):\nThe retention index at the right reference point.
    • \n
    • left_ri (float):\nThe retention index at the left reference point.
    • \n
    • left_rt (float):\nThe retention time at the left reference point.
    • \n
    • right_rt (float):\nThe retention time at the right reference point.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: The calculated retention index.
    • \n
    \n", "signature": "(\tself,\tright_ri: float,\tleft_ri: float,\tleft_rt: float,\tright_rt: float) -> float:", "funcdef": "def"}, {"fullname": "corems.chroma_peak.calc.ChromaPeakCalc.GCPeakCalculation.calc_ri", "modulename": "corems.chroma_peak.calc.ChromaPeakCalc", "qualname": "GCPeakCalculation.calc_ri", "kind": "function", "doc": "

    Calculate the retention index based on the given retention time - retention index pairs.

    \n\n
    Parameters
    \n\n
      \n
    • rt_ri_pairs (List[Tuple[float, float]]):\nThe list of retention time - retention index pairs.
    • \n
    \n", "signature": "(self, rt_ri_pairs: list[tuple[float, float]]) -> None:", "funcdef": "def"}, {"fullname": "corems.chroma_peak.factory", "modulename": "corems.chroma_peak.factory", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.ChromaPeakBase", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "ChromaPeakBase", "kind": "class", "doc": "

    Base class for chromatographic peak (ChromaPeak) objects.

    \n\n
    Parameters
    \n\n
      \n
    • chromatogram_parent (Chromatogram):\nThe parent chromatogram object.
    • \n
    • mass_spectrum_obj (MassSpectrum):\nThe mass spectrum object.
    • \n
    • start_index (int):\nThe start index of the peak.
    • \n
    • index (int):\nThe index of the peak.
    • \n
    • final_index (int):\nThe final index of the peak.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • start_scan (int):\nThe start scan of the peak.
    • \n
    • final_scan (int):\nThe final scan of the peak.
    • \n
    • apex_scan (int):\nThe apex scan of the peak.
    • \n
    • chromatogram_parent (Chromatogram):\nThe parent chromatogram object.
    • \n
    • mass_spectrum (MassSpectrum):\nThe mass spectrum object.
    • \n
    • _area (float):\nThe area of the peak.
    • \n
    \n\n
    Properties
    \n\n
      \n
    • retention_time : float. \nThe retention time of the peak.
    • \n
    • tic : float. \nThe total ion current of the peak.
    • \n
    • area : float. \nThe area of the peak.
    • \n
    • rt_list : list. \nThe list of retention times within the peak.
    • \n
    • tic_list : list.\nThe list of total ion currents within the peak.
    • \n
    \n\n

    Methods

    \n\n
      \n
    • None
    • \n
    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.ChromaPeakBase.__init__", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "ChromaPeakBase.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tchromatogram_parent,\tmass_spectrum_obj,\tstart_index,\tindex,\tfinal_index)"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.ChromaPeakBase.start_scan", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "ChromaPeakBase.start_scan", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.ChromaPeakBase.final_scan", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "ChromaPeakBase.final_scan", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.ChromaPeakBase.apex_scan", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "ChromaPeakBase.apex_scan", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.ChromaPeakBase.chromatogram_parent", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "ChromaPeakBase.chromatogram_parent", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.ChromaPeakBase.mass_spectrum", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "ChromaPeakBase.mass_spectrum", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.ChromaPeakBase.retention_time", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "ChromaPeakBase.retention_time", "kind": "variable", "doc": "

    Retention Time

    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.ChromaPeakBase.tic", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "ChromaPeakBase.tic", "kind": "variable", "doc": "

    Total Ion Current

    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.ChromaPeakBase.area", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "ChromaPeakBase.area", "kind": "variable", "doc": "

    Peak Area

    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.ChromaPeakBase.rt_list", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "ChromaPeakBase.rt_list", "kind": "variable", "doc": "

    Retention Time List

    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.ChromaPeakBase.tic_list", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "ChromaPeakBase.tic_list", "kind": "variable", "doc": "

    Total Ion Current List

    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.DataDependentPeak", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "DataDependentPeak", "kind": "class", "doc": "

    Data dependent peak (DataDependentPeak) object.

    \n\n
    Parameters
    \n\n
      \n
    • chromatogram_parent (Chromatogram):\nThe parent chromatogram object.
    • \n
    • mass_spectrum_obj (MassSpectrum):\nThe mass spectrum object.
    • \n
    • peak_indexes (tuple):\nThe start, apex and final indexes of the peak.
    • \n
    • eic_data (EIC_Data):\nThe EIC data object.
    • \n
    • Attributes
    • \n
    • --------
    • \n
    • _eic_data (EIC_Data):\nThe EIC data object.
    • \n
    • _possible_molecular_formulae (list):\nThe list of possible molecular formulas.
    • \n
    \n\n
    Properties
    \n\n
      \n
    • eic_rt_list : list. \nEIC retention time list.
    • \n
    • eic_list : list.\nEIC list.
    • \n
    • targeted_molecular_formulas : list.\nThe list of possible molecular formulas.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • add_dependent_mass_spectrum(mass_spectrum).
      \nAdd a dependent mass spectrum to the peak.
    • \n
    • add_molecular_formula(molfform).
      \nAdd a molecular formula to the peak.
    • \n
    \n", "bases": "ChromaPeakBase"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.DataDependentPeak.__init__", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "DataDependentPeak.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tchromatogram_parent,\tmass_spectrum_obj,\tpeak_indexes,\teic_data: corems.mass_spectra.factory.LC_Temp.EIC_Data,\tpossible_molform=None)"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.DataDependentPeak.add_dependent_mass_spectrum", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "DataDependentPeak.add_dependent_mass_spectrum", "kind": "function", "doc": "

    Add a dependent mass spectrum to the peak.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (MassSpectrum):\nThe mass spectrum object.
    • \n
    \n", "signature": "(self, mass_spectrum):", "funcdef": "def"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.DataDependentPeak.add_molecular_formula", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "DataDependentPeak.add_molecular_formula", "kind": "function", "doc": "

    Add a molecular formula to the peak.

    \n\n
    Parameters
    \n\n
      \n
    • molfform (str):\nThe molecular formula.
    • \n
    \n", "signature": "(self, molfform):", "funcdef": "def"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.DataDependentPeak.eic_rt_list", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "DataDependentPeak.eic_rt_list", "kind": "variable", "doc": "

    EIC Retention Time List

    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.DataDependentPeak.eic_list", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "DataDependentPeak.eic_list", "kind": "variable", "doc": "

    EIC List

    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.DataDependentPeak.targeted_molecular_formulas", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "DataDependentPeak.targeted_molecular_formulas", "kind": "variable", "doc": "

    Targeted Molecular Formulas

    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.GCPeak", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "GCPeak", "kind": "class", "doc": "

    Class representing a peak in a gas chromatography (GC) chromatogram.

    \n\n
    Parameters
    \n\n
      \n
    • chromatogram_parent (Chromatogram):\nThe parent chromatogram object.
    • \n
    • mass_spectrum_obj (MassSpectrum):\nThe mass spectrum object associated with the peak.
    • \n
    • indexes (tuple):\nThe indexes of the peak in the chromatogram.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • _compounds (list):\nList of compounds associated with the peak.
    • \n
    • _ri (float or None):\nRetention index of the peak.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • __len__(). Returns the number of compounds associated with the peak.
    • \n
    • __getitem__(position). Returns the compound at the specified position.
    • \n
    • remove_compound(compounds_obj). Removes the specified compound from the peak.
    • \n
    • clear_compounds(). Removes all compounds from the peak.
    • \n
    • add_compound(compounds_dict, spectral_similarity_scores, ri_score=None, similarity_score=None). Adds a compound to the peak with the specified attributes.
    • \n
    • ri(). Returns the retention index of the peak.
    • \n
    • highest_ss_compound(). Returns the compound with the highest spectral similarity score.
    • \n
    • highest_score_compound(). Returns the compound with the highest similarity score.
    • \n
    • compound_names(). Returns a list of names of compounds associated with the peak.
    • \n
    \n", "bases": "ChromaPeakBase, corems.chroma_peak.calc.ChromaPeakCalc.GCPeakCalculation"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.GCPeak.__init__", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "GCPeak.__init__", "kind": "function", "doc": "

    \n", "signature": "(chromatogram_parent, mass_spectrum_obj, indexes)"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.GCPeak.remove_compound", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "GCPeak.remove_compound", "kind": "function", "doc": "

    \n", "signature": "(self, compounds_obj):", "funcdef": "def"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.GCPeak.clear_compounds", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "GCPeak.clear_compounds", "kind": "function", "doc": "

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.GCPeak.add_compound", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "GCPeak.add_compound", "kind": "function", "doc": "

    Adds a compound to the peak with the specified attributes.

    \n\n
    Parameters
    \n\n
      \n
    • compounds_dict (dict):\nDictionary containing the compound information.
    • \n
    • spectral_similarity_scores (dict):\nDictionary containing the spectral similarity scores.
    • \n
    • ri_score (float or None, optional):\nThe retention index score of the compound. Default is None.
    • \n
    • similarity_score (float or None, optional):\nThe similarity score of the compound. Default is None.
    • \n
    \n", "signature": "(\tself,\tcompounds_dict,\tspectral_similarity_scores,\tri_score=None,\tsimilarity_score=None):", "funcdef": "def"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.GCPeak.ri", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "GCPeak.ri", "kind": "variable", "doc": "

    Returns the retention index of the peak.

    \n\n
    Returns
    \n\n
      \n
    • float or None: The retention index of the peak.
    • \n
    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.GCPeak.highest_ss_compound", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "GCPeak.highest_ss_compound", "kind": "variable", "doc": "

    Returns the compound with the highest spectral similarity score.

    \n\n
    Returns
    \n\n
      \n
    • LowResCompoundRef or None: The compound with the highest spectral similarity score.
    • \n
    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.GCPeak.highest_score_compound", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "GCPeak.highest_score_compound", "kind": "variable", "doc": "

    Returns the compound with the highest similarity score.

    \n\n
    Returns
    \n\n
      \n
    • LowResCompoundRef or None: The compound with the highest similarity score.
    • \n
    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.GCPeak.compound_names", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "GCPeak.compound_names", "kind": "variable", "doc": "

    Returns a list of names of compounds associated with the peak.

    \n\n
    Returns
    \n\n
      \n
    • list: List of names of compounds associated with the peak.
    • \n
    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.GCPeakDeconvolved", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "GCPeakDeconvolved", "kind": "class", "doc": "

    Represents a deconvolved peak in a chromatogram.

    \n\n
    Parameters
    \n\n
      \n
    • chromatogram_parent (Chromatogram):\nThe parent chromatogram object.
    • \n
    • mass_spectra (list):\nList of mass spectra associated with the peak.
    • \n
    • apex_index (int):\nIndex of the apex mass spectrum in the mass_spectra list.
    • \n
    • rt_list (list):\nList of retention times.
    • \n
    • tic_list (list):\nList of total ion currents.
    • \n
    \n", "bases": "GCPeak"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.GCPeakDeconvolved.__init__", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "GCPeakDeconvolved.__init__", "kind": "function", "doc": "

    \n", "signature": "(chromatogram_parent, mass_spectra, apex_index, rt_list, tic_list)"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.GCPeakDeconvolved.mass_spectra", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "GCPeakDeconvolved.mass_spectra", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.GCPeakDeconvolved.rt_list", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "GCPeakDeconvolved.rt_list", "kind": "variable", "doc": "

    Get the list of retention times.

    \n\n
    Returns
    \n\n
      \n
    • list: The list of retention times.
    • \n
    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.GCPeakDeconvolved.tic_list", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "GCPeakDeconvolved.tic_list", "kind": "variable", "doc": "

    Get the list of total ion currents.

    \n\n
    Returns
    \n\n
      \n
    • list: The list of total ion currents.
    • \n
    \n"}, {"fullname": "corems.collection", "modulename": "corems.collection", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.collection.factory", "modulename": "corems.collection.factory", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.collection.input", "modulename": "corems.collection.input", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.collection.output", "modulename": "corems.collection.output", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.encapsulation", "modulename": "corems.encapsulation", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.encapsulation.constant", "modulename": "corems.encapsulation.constant", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.encapsulation.constant.Labels", "modulename": "corems.encapsulation.constant", "qualname": "Labels", "kind": "class", "doc": "

    Class for Labels used in CoreMS

    \n\n

    These labels are used to define:

    \n\n
      \n
    • types of columns in plaintext data inputs,
    • \n
    • types of data/mass spectra
    • \n
    • types of assignment for ions
    • \n
    \n"}, {"fullname": "corems.encapsulation.constant.Labels.mz", "modulename": "corems.encapsulation.constant", "qualname": "Labels.mz", "kind": "variable", "doc": "

    \n", "default_value": "'m/z'"}, {"fullname": "corems.encapsulation.constant.Labels.abundance", "modulename": "corems.encapsulation.constant", "qualname": "Labels.abundance", "kind": "variable", "doc": "

    \n", "default_value": "'Peak Height'"}, {"fullname": "corems.encapsulation.constant.Labels.rp", "modulename": "corems.encapsulation.constant", "qualname": "Labels.rp", "kind": "variable", "doc": "

    \n", "default_value": "'Resolving Power'"}, {"fullname": "corems.encapsulation.constant.Labels.s2n", "modulename": "corems.encapsulation.constant", "qualname": "Labels.s2n", "kind": "variable", "doc": "

    \n", "default_value": "'S/N'"}, {"fullname": "corems.encapsulation.constant.Labels.label", "modulename": "corems.encapsulation.constant", "qualname": "Labels.label", "kind": "variable", "doc": "

    \n", "default_value": "'label'"}, {"fullname": "corems.encapsulation.constant.Labels.bruker_profile", "modulename": "corems.encapsulation.constant", "qualname": "Labels.bruker_profile", "kind": "variable", "doc": "

    \n", "default_value": "'Bruker_Profile'"}, {"fullname": "corems.encapsulation.constant.Labels.thermo_profile", "modulename": "corems.encapsulation.constant", "qualname": "Labels.thermo_profile", "kind": "variable", "doc": "

    \n", "default_value": "'Thermo_Profile'"}, {"fullname": "corems.encapsulation.constant.Labels.simulated_profile", "modulename": "corems.encapsulation.constant", "qualname": "Labels.simulated_profile", "kind": "variable", "doc": "

    \n", "default_value": "'Simulated Profile'"}, {"fullname": "corems.encapsulation.constant.Labels.booster_profile", "modulename": "corems.encapsulation.constant", "qualname": "Labels.booster_profile", "kind": "variable", "doc": "

    \n", "default_value": "'Booster Profile'"}, {"fullname": "corems.encapsulation.constant.Labels.bruker_frequency", "modulename": "corems.encapsulation.constant", "qualname": "Labels.bruker_frequency", "kind": "variable", "doc": "

    \n", "default_value": "'Bruker_Frequency'"}, {"fullname": "corems.encapsulation.constant.Labels.midas_frequency", "modulename": "corems.encapsulation.constant", "qualname": "Labels.midas_frequency", "kind": "variable", "doc": "

    \n", "default_value": "'Midas_Frequency'"}, {"fullname": "corems.encapsulation.constant.Labels.thermo_centroid", "modulename": "corems.encapsulation.constant", "qualname": "Labels.thermo_centroid", "kind": "variable", "doc": "

    \n", "default_value": "'Thermo_Centroid'"}, {"fullname": "corems.encapsulation.constant.Labels.corems_centroid", "modulename": "corems.encapsulation.constant", "qualname": "Labels.corems_centroid", "kind": "variable", "doc": "

    \n", "default_value": "'CoreMS_Centroid'"}, {"fullname": "corems.encapsulation.constant.Labels.gcms_centroid", "modulename": "corems.encapsulation.constant", "qualname": "Labels.gcms_centroid", "kind": "variable", "doc": "

    \n", "default_value": "'Thermo_Centroid'"}, {"fullname": "corems.encapsulation.constant.Labels.unassigned", "modulename": "corems.encapsulation.constant", "qualname": "Labels.unassigned", "kind": "variable", "doc": "

    \n", "default_value": "'unassigned'"}, {"fullname": "corems.encapsulation.constant.Labels.radical_ion", "modulename": "corems.encapsulation.constant", "qualname": "Labels.radical_ion", "kind": "variable", "doc": "

    \n", "default_value": "'RADICAL'"}, {"fullname": "corems.encapsulation.constant.Labels.protonated_de_ion", "modulename": "corems.encapsulation.constant", "qualname": "Labels.protonated_de_ion", "kind": "variable", "doc": "

    \n", "default_value": "'DE_OR_PROTONATED'"}, {"fullname": "corems.encapsulation.constant.Labels.protonated", "modulename": "corems.encapsulation.constant", "qualname": "Labels.protonated", "kind": "variable", "doc": "

    \n", "default_value": "'protonated'"}, {"fullname": "corems.encapsulation.constant.Labels.de_protonated", "modulename": "corems.encapsulation.constant", "qualname": "Labels.de_protonated", "kind": "variable", "doc": "

    \n", "default_value": "'de-protonated'"}, {"fullname": "corems.encapsulation.constant.Labels.adduct_ion", "modulename": "corems.encapsulation.constant", "qualname": "Labels.adduct_ion", "kind": "variable", "doc": "

    \n", "default_value": "'ADDUCT'"}, {"fullname": "corems.encapsulation.constant.Labels.neutral", "modulename": "corems.encapsulation.constant", "qualname": "Labels.neutral", "kind": "variable", "doc": "

    \n", "default_value": "'neutral'"}, {"fullname": "corems.encapsulation.constant.Labels.ion_type", "modulename": "corems.encapsulation.constant", "qualname": "Labels.ion_type", "kind": "variable", "doc": "

    \n", "default_value": "'IonType'"}, {"fullname": "corems.encapsulation.constant.Labels.ion_type_translate", "modulename": "corems.encapsulation.constant", "qualname": "Labels.ion_type_translate", "kind": "variable", "doc": "

    \n", "default_value": "{'protonated': 'DE_OR_PROTONATED', 'de-protonated': 'DE_OR_PROTONATED', 'radical': 'RADICAL', 'adduct': 'ADDUCT'}"}, {"fullname": "corems.encapsulation.constant.Atoms", "modulename": "corems.encapsulation.constant", "qualname": "Atoms", "kind": "class", "doc": "

    Class for Atoms in CoreMS

    \n\n

    This class includes key properties of atoms (and the electron) and isotopes, including their exact masses, relative abundances, and covalences. \nIt also associates which isotopes are for the same element, and provides an ordering of elements.

    \n\n
    References
    \n\n
      \n
    1. NIST - Last Accessed 2019-06-12\nhttps://www.nist.gov/pml/atomic-weights-and-isotopic-compositions-relative-atomic-masses
    2. \n
    \n"}, {"fullname": "corems.encapsulation.constant.Atoms.electron_mass", "modulename": "corems.encapsulation.constant", "qualname": "Atoms.electron_mass", "kind": "variable", "doc": "

    \n", "default_value": "0.000548579909065"}, {"fullname": "corems.encapsulation.constant.Atoms.atomic_masses", "modulename": "corems.encapsulation.constant", "qualname": "Atoms.atomic_masses", "kind": "variable", "doc": "

    \n", "default_value": "{'H': 1.00782503223, 'D': 2.01410177812, 'T': 3.0160492779, '3He': 3.0160293201, 'He': 4.00260325413, '6Li': 6.0151228874, '7Li': 7.0160034366, '9Be': 9.012183065, '10B': 10.01293695, '11B': 11.00930536, 'C': 12.0, '13C': 13.00335483507, '14C': 14.0032419884, 'N': 14.00307400443, '15N': 15.00010889888, 'O': 15.99491461957, '17O': 16.9991317565, '18O': 17.99915961286, 'F': 18.99840316273, '20Ne': 19.9924401762, '21Ne': 20.993846685, '22Ne': 21.991385114, 'Na': 22.989769282, '24Mg': 23.985041697, '25Mg': 24.985836976, '26Mg': 25.982592968, 'Al': 26.98153853, '28Si': 27.97692653465, '29Si': 28.9764946649, '30Si': 29.973770136, 'P': 30.97376199842, 'S': 31.9720711744, '33S': 32.9714589098, '34S': 33.967867004, '36S': 35.96708071, 'Cl': 34.968852682, '37Cl': 36.965902602, '36Ar': 35.967545105, '38Ar': 37.96273211, '40Ar': 39.9623831237, 'K': 38.9637064864, '40K': 39.963998166, '41K': 40.9618252579, 'Ca': 39.962590863, '42Ca': 41.95861783, '43Ca': 42.95876644, '44Ca': 43.95548156, '46Ca': 45.953689, '48Ca': 47.95252276, '45Sc': 44.95590828, '46Ti': 45.95262772, '47Ti': 46.95175879, '48Ti': 47.94794198, '49Ti': 48.94786568, '50Ti': 49.94478689, '50V': 49.94715601, 'V': 50.94395704, '50Cr': 49.94604183, 'Cr': 51.94050623, '53Cr': 52.94064815, '54Cr': 53.93887916, 'Mn': 54.93804391, '54Fe': 53.93960899, 'Fe': 55.93493633, '57Fe': 56.93539284, '58Fe': 57.93327443, 'Co': 58.93319429, 'Ni': 57.93534241, '60Ni': 59.93078588, '61Ni': 60.93105557, '62Ni': 61.92834537, '64Ni': 63.92796682, 'Cu': 62.92959772, '65Cu': 64.9277897, 'Zn': 63.92914201, '66Zn': 65.92603381, '67Zn': 66.92712775, '68Zn': 67.92484455, '70Zn': 69.9253192, '69Ga': 68.9255735, '71Ga': 70.92470258, '70Ge': 69.92424875, '72Ge': 71.922075826, '73Ge': 72.923458956, '74Ge': 73.921177761, '76Ge': 75.921402726, 'As': 74.92159457, '74Se': 73.922475934, '76Se': 75.919213704, '77Se': 76.919914154, '78Se': 77.91730928, 'Se': 79.9165218, '82Se': 81.9166995, 'Br': 78.9183376, '81Br': 80.9162897, '78Kr': 77.92036494, '80Kr': 79.91637808, '82Kr': 81.91348273, '83Kr': 82.91412716, '84Kr': 83.9114977282, '86Kr': 85.9106106269, '85Rb': 84.9117897379, '87Rb': 86.909180531, '84Sr': 83.9134191, '86Sr': 85.9092606, '87Sr': 86.9088775, '88Sr': 87.9056125, '89Y': 88.9058403, '90Zr': 89.9046977, '91Zr': 90.9056396, '92Zr': 91.9050347, '94Zr': 93.9063108, '96Zr': 95.9082714, '93Nb': 92.906373, '92Mo': 91.90680796, '94Mo': 93.9050849, '95Mo': 94.90583877, '96Mo': 95.90467612, '97Mo': 96.90601812, 'Mo': 97.90540482, '100Mo': 99.9074718, '97Tc': 96.9063667, '98Tc': 97.9072124, '99Tc': 98.9062508, '96Ru': 95.90759025, '98Ru': 97.9052868, '99Ru': 98.9059341, '100Ru': 99.9042143, '101Ru': 100.9055769, '102Ru': 101.9043441, '104Ru': 103.9054275, '103Rh': 102.905498, '102Pd': 101.9056022, '104Pd': 103.9040305, '105Pd': 104.9050796, '106Pd': 105.9034804, '108Pd': 107.9038916, '110Pd': 109.9051722, '107Ag': 106.9050916, '109Ag': 108.9047553, '106Cd': 105.9064599, '108Cd': 107.9041834, '110Cd': 109.90300661, '111Cd': 110.90418287, 'Cd': 111.90276287, '113Cd': 112.90440813, '114Cd': 113.90336509, '116Cd': 115.90476315, '113In': 112.90406184, 'In': 114.903878776, '112Sn': 111.90482387, '114Sn': 113.9027827, '115Sn': 114.903344699, '116Sn': 115.9017428, '117Sn': 116.90295398, '118Sn': 117.90160657, '119Sn': 118.90331117, '120Sn': 119.90220163, '122Sn': 121.9034438, '124Sn': 123.9052766, '121Sb': 120.903812, '123Sb': 122.9042132, '120Te': 119.9040593, '122Te': 121.9030435, '123Te': 122.9042698, '124Te': 123.9028171, '125Te': 124.9044299, '126Te': 125.9033109, '128Te': 127.90446128, '130Te': 129.906222748, 'I': 126.9044719, '124Xe': 123.905892, '126Xe': 125.9042983, '128Xe': 127.903531, '129Xe': 128.9047808611, '130Xe': 129.903509349, '131Xe': 130.90508406, '132Xe': 131.9041550856, '134Xe': 133.90539466, '136Xe': 135.907214484, '133Cs': 132.905451961, '130Ba': 129.9063207, '132Ba': 131.9050611, '134Ba': 133.90450818, '135Ba': 134.90568838, '136Ba': 135.90457573, '137Ba': 136.90582714, '138Ba': 137.905247, '138La': 137.9071149, '139La': 138.9063563, '136Ce': 135.90712921, '138Ce': 137.905991, '140Ce': 139.9054431, '142Ce': 141.9092504, '141Pr': 140.9076576, '142Nd': 141.907729, '143Nd': 142.90982, '144Nd': 143.910093, '145Nd': 144.9125793, '146Nd': 145.9131226, '148Nd': 147.9168993, '150Nd': 149.9209022, '145Pm': 144.9127559, '147Pm': 146.915145, '144Sm': 143.9120065, '147Sm': 146.9149044, '148Sm': 147.9148292, '149Sm': 148.9171921, '150Sm': 149.9172829, '152Sm': 151.9197397, '154Sm': 153.9222169, '151Eu': 150.9198578, '153Eu': 152.921238, '152Gd': 151.9197995, '154Gd': 153.9208741, '155Gd': 154.9226305, '156Gd': 155.9221312, '157Gd': 156.9239686, '158Gd': 157.9241123, '160Gd': 159.9270624, '159Tb': 158.9253547, '156Dy': 155.9242847, '158Dy': 157.9244159, '160Dy': 159.9252046, '161Dy': 160.9269405, '162Dy': 161.9268056, '163Dy': 162.9287383, '164Dy': 163.9291819, '165Ho': 164.9303288, '162Er': 161.9287884, '164Er': 163.9292088, '166Er': 165.9302995, '167Er': 166.9320546, '168Er': 167.9323767, '170Er': 169.9354702, '169Tm': 168.9342179, '168Yb': 167.9338896, '170Yb': 169.9347664, '171Yb': 170.9363302, '172Yb': 171.9363859, '173Yb': 172.9382151, '174Yb': 173.9388664, '176Yb': 175.9425764, '175Lu': 174.9407752, '176Lu': 175.9426897, '174Hf': 173.9400461, '176Hf': 175.9414076, '177Hf': 176.9432277, '178Hf': 177.9437058, '179Hf': 178.9458232, '180Hf': 179.946557, '180Ta': 179.9474648, '181Ta': 180.9479958, '180W': 179.9467108, '182W': 181.94820394, '183W': 182.95022275, '184W': 183.95093092, '186W': 185.9543628, '185Re': 184.9529545, '187Re': 186.9557501, '184Os': 183.9524885, '186Os': 185.953835, '187Os': 186.9557474, '188Os': 187.9558352, '189Os': 188.9581442, '190Os': 189.9584437, '192Os': 191.961477, '191Ir': 190.9605893, '193Ir': 192.9629216, '190Pt': 189.9599297, '192Pt': 191.9610387, '194Pt': 193.9626809, '195Pt': 194.9647917, '196Pt': 195.96495209, '198Pt': 197.9678949, '197Au': 196.96656879, '196Hg': 195.9658326, '198Hg': 197.9667686, '199Hg': 198.96828064, '200Hg': 199.96832659, '201Hg': 200.97030284, '202Hg': 201.9706434, '204Hg': 203.97349398, '203Tl': 202.9723446, '205Tl': 204.9744278, '204Pb': 203.973044, '206Pb': 205.9744657, '207Pb': 206.9758973, 'Pb': 207.9766525, '209Bi': 208.9803991, '209Po': 208.9824308, '210Po': 209.9828741, '210At': 209.9871479, '211At': 210.9874966, '211Rn': 210.9906011, '220Rn': 220.0113941, '222Rn': 222.0175782, '223Fr': 223.019736, '223Ra': 223.0185023, '224Ra': 224.020212, '226Ra': 226.0254103, '228Ra': 228.0310707, '227Ac': 227.0277523, '230Th': 230.0331341, '232Th': 232.0380558, '231Pa': 231.0358842, '233U': 233.0396355, '234U': 234.0409523, '235U': 235.0439301, '236U': 236.0455682, '238U': 238.0507884, '236Np': 236.04657, '237Np': 237.0481736, '238Pu': 238.0495601, '239Pu': 239.0521636, '240Pu': 240.0538138, '241Pu': 241.0568517, '242Pu': 242.0587428, '244Pu': 244.0642053, '241Am': 241.0568293, '243Am': 243.0613813, '243Cm': 243.0613893, '244Cm': 244.0627528, '245Cm': 245.0654915, '246Cm': 246.0672238, '247Cm': 247.0703541, '248Cm': 248.0723499, '247Bk': 247.0703073, '249Bk': 249.0749877, '249Cf': 249.0748539, '250Cf': 250.0764062, '251Cf': 251.0795886, '252Cf': 252.0816272, '252Es': 252.08298, '257Fm': 257.0951061, '258Md': 258.0984315, '260Md': 260.10365, '259No': 259.10103, '262Lr': 262.10961, '267Rf': 267.12179, '268Db': 268.12567, '271Sg': 271.13393, '272Bh': 272.13826, '270Hs': 270.13429, '276Mt': 276.15159, '281Ds': 281.16451, '280Rg': 280.16514, '285Cn': 285.17712, '284Nh': 284.17873, '289Fl': 289.19042, '288Mc': 288.19274, '293Lv': 293.20449, '292Ts': 292.20746, '294Og': 294.21392}"}, {"fullname": "corems.encapsulation.constant.Atoms.atoms_order", "modulename": "corems.encapsulation.constant", "qualname": "Atoms.atoms_order", "kind": "variable", "doc": "

    \n", "default_value": "['C', 'H', 'O', 'Cl', 'Na', 'S', 'N', '13C', '34S', '37Cl', 'Fe', 'Ca', 'P', 'V', 'I', 'Ac', 'Al', 'Ar', 'As', 'At', 'Au', 'Co', 'Cs', 'D', 'F', 'Fr', '18O', '17O', 'He', 'Po', 'Ra', 'Rh', 'Rn', 'Be', 'Bi', 'Nb, 54Fe', '57Fe', 'Ni', '60Ni', '61Ni', '62Ni', '10B', '11B', '6Li', '7Li', 'La', 'Mn', '107Ag', '109Ag', '100Mo', '100Ru', '101Ru', '102Pd', '102Ru', '104Pd', '104Ru', '105Pd', 'Cd', '106Cd', '106Pd', '108Cd', '108Pd', '110Cd', '110Pd', '111Cd', '112Cd', '112Sn', '113Cd', '113In', '114Cd', '114Sn', 'In', '115In', '115Sn', '116Cd', '116Sn', '117Sn', '118Sn', '119Sn', '120Sn', '120Te', '121Sb', '122Sn', '122Te', '123Sb', '123Te', '124Sn', '124Te', '124Xe', '125Te', '126Te', '126Xe', '128Te', '128Xe', '129Xe', '130Ba', '130Te', '130Xe', '131Xe', '132Ba', '132Xe', '134Ba', '134Xe', '135Ba', '136Ba', '136Xe', '137Ba', '138Ba', '15N', '174Hf', '176Hf', '177Hf', '178Hf', '179Hf', '180Hf', '180W', '182W', '183W', '184Os', '184W', '185Re', '186Os', '186W', '187Os', '187Re', '188Os', '189Os', '190Os', '190Pt', '191Ir', '192Ir', '192Os', '192Pt', '194Pt', '195Pt', '196Hg', '196Pt', '198Hg', '198Pt', '199Hg', '200Hg', '201Hg', '202Hg', '203Tl', '204Hg', '204Pb', '205Tl', '206Pb', '207Pb', '208Pb', 'Pb', '20Ne', '22Ne', '24Mg', '25Mg', '26Mg', '28Si', '29Si', '30Si', 'K', '40Ca', '41K', '44Ca', '46Ti', '47Ti', '48Ti', '49Ti', '50Cr', '50Ti', '50V', '51V', 'Cr', '52Cr', '53Cr', '54Cr', 'Cu', 'Zn', '65Cu', '66Zn', '67Zn', '68Zn', '69Ga', '70Ge', '71Ga', '72Ge', '73Ge', '74Ge', '76Ge', '76Se', '77Se', '78Se', 'Br', '81Br', '80Kr', 'Se', '82Kr', '82Se', '83Kr', '84Kr', '85Rb', '86Kr', '86Sr', '87Rb', '87Sr', '88Sr', '90Zr', '91Zr', '92Mo', '92Zr', '94Mo', '94Zr', '95Mo', '96Mo', '96Ru', '96Zr', '97Mo', 'Mo', '98Ru', '99Ru']"}, {"fullname": "corems.encapsulation.constant.Atoms.atoms_covalence", "modulename": "corems.encapsulation.constant", "qualname": "Atoms.atoms_covalence", "kind": "variable", "doc": "

    \n", "default_value": "{'C': 4, '13C': 4, 'N': 3, 'O': 2, 'S': 2, 'H': 1, 'F': (1, 0), 'Cl': (1, 0), 'Br': (1, 0), 'I': (1, 0), 'At': 1, 'Li': (1, 0), 'Na': (1, 0), 'K': (1, 0), 'Rb': 1, 'Cs': 1, 'Fr': 1, 'B': (4, 3, 2, 1), 'In': (3, 2, 1), 'Al': (3, 1, 2), 'P': (3, 5, 4, 2, 1), 'Ga': (3, 1, 2), 'Mg': (2, 1), 'Be': (2, 1), 'Ca': (2, 1), 'Sr': (2, 1), 'Ba': 2, 'Ra': 2, 'V': (5, 4, 3, 2, 1), 'Fe': (3, 2, 4, 5, 6), 'Si': (4, 3, 2), 'Sc': (3, 2, 1), 'Ti': (4, 3, 2, 1), 'Cr': (1, 2, 3, 4, 5, 6), 'Mn': (1, 2, 3, 4, 5, 6, 7), 'Co': (1, 2, 3, 4, 5), 'Ni': (1, 2, 3, 4), 'Cu': (2, 1, 3, 4), 'Zn': (2, 1), 'Ge': (4, 3, 2, 1), 'As': (5, 3, 2, 1), 'Se': (6, 4, 2, 1), 'Y': (3, 2, 1), 'Zr': (4, 3, 2, 1), 'Nb': (5, 4, 3, 2, 1), 'Mo': (6, 5, 4, 3, 2, 1), 'Tc': (7, 6, 5, 4, 3, 2, 1), 'Ru': (8, 7, 6, 5, 4, 3, 2, 1), 'Rh': (6, 5, 4, 3, 2, 1), 'Pd': (4, 2, 1), 'Ag': (0, 1, 2, 3, 4), 'Cd': (2, 1), 'Sn': (4, 2), 'Sb': (5, 3), 'Te': (6, 5, 4, 2), 'La': (3, 2), 'Hf': (4, 3, 2), 'Ta': (5, 4, 3, 2), 'W': (6, 5, 4, 3, 2, 1), 'Re': (4, 7, 6, 5, 3, 2, 1), 'Os': (4, 8, 7, 6, 5, 3, 2, 1), 'Ir': (4, 8, 6, 5, 3, 2, 1), 'Pt': (4, 6, 5, 3, 2, 1), 'Au': (3, 5, 2, 1), 'Hg': (1, 2, 4), 'Tl': (3, 1), 'Pb': (4, 2), 'Bi': (3, 1, 5), 'Po': (2, 4, 6), 'Ac': (3, 2)}"}, {"fullname": "corems.encapsulation.constant.Atoms.isotopic_abundance", "modulename": "corems.encapsulation.constant", "qualname": "Atoms.isotopic_abundance", "kind": "variable", "doc": "

    \n", "default_value": "{'H': 0.999885, 'D': 0.000115, 'T': 0, '3He': 1.34e-06, 'He': 0.99999866, '6Li': 0.0759, 'Li': 0.9241, '9Be': 1.0, '10B': 0.199, '11B': 0.801, 'C': 0.9893, '13C': 0.0107, '14C': 0, 'N': 0.99636, '15N': 0.00364, 'O': 0.99757, '17O': 0.00038, '18O': 0.00205, 'F': 1.0, '20Ne': 0.9048, '21Ne': 0.0027, '22Ne': 0.0925, 'Na': 1.0, '24Mg': 0.7899, '25Mg': 0.1, '26Mg': 0.1101, 'Al': 1.0, '28Si': 0.92223, '29Si': 0.04685, '30Si': 0.03092, 'P': 1.0, 'S': 0.9499, '33S': 0.0075, '34S': 0.0425, '36S': 0.0001, 'Cl': 0.7576, '37Cl': 0.2424, '36Ar': 0.003336, '38Ar': 0.000629, '40Ar': 0.996035, 'K': 0.932581, '40K': 0.000117, '41K': 0.067302, 'Ca': 0.96941, '42Ca': 0.00647, '43Ca': 0.00135, '44Ca': 0.02086, '46Ca': 4e-05, '48Ca': 0.001872, '45Sc': 1.0, '46Ti': 0.0825, '47Ti': 0.0744, '48Ti': 0.7372, '49Ti': 0.0541, '50Ti': 0.0518, '50V': 0.0025, 'V': 0.9975, '50Cr': 0.04345, 'Cr': 0.83789, '53Cr': 0.09501, '54Cr': 0.02365, 'Mn': 1.0, '54Fe': 0.05845, 'Fe': 0.91754, '57Fe': 0.02119, '58Fe': 0.00282, 'Co': 1.0, 'Ni': 0.68077, '60Ni': 0.26223, '61Ni': 0.011399, '62Ni': 0.036346, '64Ni': 0.009255, 'Cu': 0.6915, '65Cu': 0.3085, 'Zn': 0.4917, '66Zn': 0.2773, '67Zn': 0.0404, '68Zn': 0.1845, '70Zn': 0.0061, '69Ga': 0.60108, '71Ga': 0.39892, '70Ge': 0.2057, '72Ge': 0.2745, '73Ge': 0.0775, '74Ge': 0.365, '76Ge': 0.0773, 'As': 1.0, '74Se': 0.0089, '76Se': 0.0937, '77Se': 0.0763, '78Se': 0.2377, 'Se': 0.4961, '82Se': 0.0873, 'Br': 0.5069, '81Br': 0.4931, '78Kr': 0.00355, '80Kr': 0.02286, '82Kr': 0.11593, '83Kr': 0.115, '84Kr': 0.56987, '86Kr': 0.17279, '85Rb': 0.7217, '87Rb': 0.2783, '84Sr': 0.0056, '86Sr': 0.0986, '87Sr': 0.07, '88Sr': 0.8258, '89Y': 1.0, '90Zr': 0.5145, '91Zr': 0.1122, '92Zr': 0.1715, '94Zr': 0.1738, '96Zr': 0.028, '93Nb': 1.0, '92Mo': 0.1453, '94Mo': 0.0915, '95Mo': 0.1584, '96Mo': 0.1667, '97Mo': 0.096, 'Mo': 0.2439, '100Mo': 0.0982, '97Tc': 0, '98Tc': 0, '99Tc': 0, '96Ru': 0.0554, '98Ru': 0.0187, '99Ru': 0.1276, '100Ru': 0.126, '101Ru': 0.1706, '102Ru': 0.3155, '104Ru': 0.1862, '103Rh': 1.0, '102Pd': 0.0102, '104Pd': 0.1114, '105Pd': 0.2233, '106Pd': 0.2733, '108Pd': 0.2646, '110Pd': 0.1172, '107Ag': 0.51839, '109Ag': 0.48161, '106Cd': 0.0125, '108Cd': 0.0089, '110Cd': 0.1249, '111Cd': 0.128, 'Cd': 0.2413, '113Cd': 0.1222, '114Cd': 0.2873, '116Cd': 0.0749, '113In': 0.0429, 'In': 0.9571, '112Sn': 0.0097, '114Sn': 0.0066, '115Sn': 0.0034, '116Sn': 0.1454, '117Sn': 0.0768, '118Sn': 0.2422, '119Sn': 0.0859, '120Sn': 0.3258, '122Sn': 0.0463, '124Sn': 0.0579, '121Sb': 0.5721, '123Sb': 0.4279, '120Te': 0.0009, '122Te': 0.0255, '123Te': 0.0089, '124Te': 0.0474, '125Te': 0.0707, '126Te': 0.1884, '128Te': 0.3174, '130Te': 0.3408, '127I': 1.0, 'I': 1.0, '124Xe': 0.000952, '126Xe': 0.00089, '128Xe': 0.019102, '129Xe': 0.264006, '130Xe': 0.04071, '131Xe': 0.212324, '132Xe': 0.269086, '134Xe': 0.104357, '136Xe': 0.088573, '133Cs': 1.0, '130Ba': 0.00106, '132Ba': 0.00101, '134Ba': 0.02417, '135Ba': 0.06592, '136Ba': 0.07854, '137Ba': 0.11232, '138Ba': 0.71698, '138La': 0.0008881, '139La': 0.9991119, '136Ce': 0.00185, '138Ce': 0.00251, '140Ce': 0.8845, '142Ce': 0.11114, '141Pr': 1.0, '142Nd': 0.27152, '143Nd': 0.12174, '144Nd': 0.23798, '145Nd': 0.08293, '146Nd': 0.17189, '148Nd': 0.05756, '150Nd': 0.05638, '145Pm': 0, '147Pm': 0, '144Sm': 0.0307, '147Sm': 0.1499, '148Sm': 0.1124, '149Sm': 0.1382, '150Sm': 0.0738, '152Sm': 0.2675, '154Sm': 0.2275, '151Eu': 0.4781, '153Eu': 0.5219, '152Gd': 0.002, '154Gd': 0.0218, '155Gd': 0.148, '156Gd': 0.2047, '157Gd': 0.1565, '158Gd': 0.2484, '160Gd': 0.2186, '159Tb': 1.0, '156Dy': 0.00056, '158Dy': 0.00095, '160Dy': 0.02329, '161Dy': 0.18889, '162Dy': 0.25475, '163Dy': 0.24896, '164Dy': 0.2826, '165Ho': 1.0, '162Er': 0.00139, '164Er': 0.01601, '166Er': 0.33503, '167Er': 0.22869, '168Er': 0.26978, '170Er': 0.1491, '169Tm': 1.0, '168Yb': 0.00123, '170Yb': 0.02982, '171Yb': 0.1409, '172Yb': 0.2168, '173Yb': 0.16103, '174Yb': 0.32026, '176Yb': 0.12996, '175Lu': 0.97401, '176Lu': 0.02599, '174Hf': 0.0016, '176Hf': 0.0526, '177Hf': 0.186, '178Hf': 0.2728, '179Hf': 0.1362, '180Hf': 0.3508, '180Ta': 0.0001201, '181Ta': 0.9998799, '180W': 0.0012, '182W': 0.265, '183W': 0.1431, '184W': 0.3064, '186W': 0.2843, '185Re': 0.374, '187Re': 0.626, '184Os': 0.0002, '186Os': 0.0159, '187Os': 0.0196, '188Os': 0.1324, '189Os': 0.1615, '190Os': 0.2626, '192Os': 0.4078, '191Ir': 0.373, '193Ir': 0.627, '190Pt': 0.00012, '192Pt': 0.00782, '194Pt': 0.3286, '195Pt': 0.3378, '196Pt': 0.2521, '198Pt': 0.07356, '197Au': 1.0, '196Hg': 0.0015, '198Hg': 0.0997, '199Hg': 0.16872, '200Hg': 0.231, '201Hg': 0.1318, '202Hg': 0.2986, '204Hg': 0.0687, '203Tl': 0.2952, '205Tl': 0.7048, '204Pb': 0.014, '206Pb': 0.241, '207Pb': 0.221, 'Pb': 0.524, '209Bi': 1.0, '209Po': 0, '210Po': 0, '210At': 0, '211At': 0, '211Rn': 0, '220Rn': 0, '222Rn': 0, '223Fr': 0, '223Ra': 0, '224Ra': 0, '226Ra': 0, '228Ra': 0, '227Ac': 0, '230Th': 0, '232Th': 1.0, '231Pa': 1.0, '233U': 0, '234U': 5.4e-05, '235U': 0.007204, '236U': 0, '238U': 0.992742, '236Np': 0, '237Np': 0, '238Pu': 0, '239Pu': 0, '240Pu': 0, '241Pu': 0, '242Pu': 0, '244Pu': 0, '241Am': 0, '243Am': 0, '243Cm': 0, '244Cm': 0, '245Cm': 0, '246Cm': 0, '247Cm': 0, '248Cm': 0, '247Bk': 0, '249Bk': 0, '249Cf': 0, '250Cf': 0, '251Cf': 0, '252Cf': 0, '252Es': 0, '257Fm': 0, '258Md': 0, '260Md': 0, '259No': 0, '262Lr': 0, '267Rf': 0, '268Db': 0, '271Sg': 0, '272Bh': 0, '270Hs': 0, '276Mt': 0, '281Ds': 0, '280Rg': 0, '285Cn': 0, '284Nh': 0, '289Fl': 0, '288Mc': 0, '293Lv': 0, '292Ts': 0, '294Og': 0}"}, {"fullname": "corems.encapsulation.constant.Atoms.isotopes", "modulename": "corems.encapsulation.constant", "qualname": "Atoms.isotopes", "kind": "variable", "doc": "

    \n", "default_value": "{'F': ['Flourine'], 'Na': ['Sodium'], 'Al': ['Aluminum'], 'P': ['Phosphorus'], 'Sc': ['Scandium'], 'Co': ['Cobalt'], 'He': ['Helium'], 'Ar': ['Argon'], 'H': ['Hydrogen', ['D']], 'Cl': ['Chlorine', ['37Cl']], 'Li': ['Lithium', ['6Li']], 'Be': ['Beryllium'], 'B': ['Boron', ['11B']], 'C': ['Carbon', ['13C']], 'O': ['Oxygen', ['18O', '17O']], 'S': ['Sulfur', ['34S']], 'N': ['Nitrogen', ['15N']], 'V': ['Vanadium', ['50V']], 'Ne': ['Neon', ['20Ne', '22Ne']], 'Mg': ['Magnesium', ['24Mg', '26Mg', '25Mg']], 'Si': ['Silicon', ['28Si', '29Si', '30Si']], 'K': ['Potassium', ['40K', '41K']], 'Ca': ['Calcium', ['43Ca', '44Ca']], 'Ti': ['Titanium', ['48Ti', '46Ti', '47Ti', '49Ti', '50Ti']], 'Cr': ['Chromium', ['53Cr', '50Cr', '54Cr']], 'Fe': ['Iron', ['54Fe', '57Fe', '58Fe']], 'Mn': ['Manganese'], 'Ni': ['Nickel', ['60Ni', '62Ni', '61Ni']], 'Cu': ['Copper', ['65Cu']], 'Zn': ['Zinc', ['66Zn', '68Zn', '67Zn', '70Zn']], 'Ga': ['Gallium', ['69Ga', '71Ga']], 'Ge': ['Germanium', ['74Ge', '72Ge', '70Ge', '73Ge', '76Ge']], 'As': ['Arsenic'], 'Se': ['Selenium', ['78Se', '76Se', '82Se', '77Se']], 'Br': ['Bromine', ['81Br']], 'Kr': ['Krypton', ['84Kr', '86Kr', '82Kr', '83Kr', '80Kr']], 'Rb': ['Rubidium', ['85Rb', '87Rb']], 'Sr': ['Strontium', ['88Sr', '86Sr', '87Sr']], 'Y': ['Yttrium'], 'Zr': ['Zironium', ['90Zr', '94Zr', '92Zr', '91Zr', '96Zr']], 'Nb': ['Niobium'], 'Mo': ['Molybdenum', ['96Mo', '95Mo', '92Mo', '100Mo', '97Mo', '94Mo']], 'Tc': ['Technetium'], 'Ru': ['Ruthenium', ['102Ru', '104Ru', '101Ru', '99Ru', '100Ru', '96Ru', '98Ru']], 'Rh': ['Rhodium'], 'Pd': ['Palladium', ['106Pd', '108Pd', '105Pd', '110Pd', '104Pd', '102Pd']], 'Ag': ['Silver', ['107Ag', '109Ag']], 'Cd': ['Cadmium', ['114Cd', '111Cd', '110Cd', '113Cd', '116Cd', '106Cd', '108Cd']], 'In': ['Indium', ['113In']], 'Sn': ['Tin', ['120Sn', '118Sn', '116Sn', '119Sn', '117Sn', '124Sn', '122Sn', '112Sn']], 'Sb': ['Antimony', ['121Sb', '123Sb']], 'Te': ['Tellurium', ['130Te', '128Te', '126Te', '125Te', '124Te', '122Te']], 'I': ['Iodine'], 'Xe': ['Xenon', ['132Xe', '129Xe', '131Xe', '134Xe', '136Xe', '130Xe', '128Xe']], 'Cs': ['Cesium'], 'Ba': ['Barium', ['138Ba', '137Ba', '136Ba', '135Ba', '134Ba']], 'La': ['Lanthanum'], 'Hf': ['Hafnium', ['180Hf', '178Hf', '177Hf', '179Hf', '176Hf']], 'Ta': ['Tantalum'], 'W': ['Tungsten', ['184W', '186W', '182W', '183W']], 'Re': ['Rhenium', ['187Re', '185Re']], 'Os': ['Osmium', ['192Os', '190Os', '189Os', '188Os', '187Os', '186Os']], 'Ir': ['Iridium', ['193Ir', '191Ir']], 'Pt': ['Platinum', ['195Pt', '194Pt', '196Pt', '198Pt', '192Pt']], 'Au': ['Gold'], 'Hg': ['Mercury', ['202Hg', '200Hg', '199Hg', '201Hg', '198Hg', '204Hg']], 'Tl': ['Thallium', ['205Tl', '203Tl']], 'Pb': ['Lead', ['206Pb', '207Pb', '204Pb']], 'Bi': ['Bismuth'], 'Po': ['Polonium'], 'At': ['Aslatine'], 'Rn': ['Radon'], 'Fr': ['Francium'], 'Ra': ['Radium'], 'Ac': ['Actinium']}"}, {"fullname": "corems.encapsulation.factory", "modulename": "corems.encapsulation.factory", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.parameters", "modulename": "corems.encapsulation.factory.parameters", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.parameters.MSParameters", "modulename": "corems.encapsulation.factory.parameters", "qualname": "MSParameters", "kind": "class", "doc": "

    MSParameters class is used to store the parameters used for the processing of the mass spectrum

    \n\n

    Each attibute is a class that contains the parameters for the processing of the mass spectrum, see the corems.encapsulation.factory.processingSetting module for more details.

    \n\n
    Attributes
    \n\n
      \n
    • molecular_search (MolecularFormulaSearchSettings):\nMolecularFormulaSearchSettings object
    • \n
    • transient (TransientSetting):\nTransientSetting object
    • \n
    • mass_spectrum (MassSpectrumSetting):\nMassSpectrumSetting object
    • \n
    • ms_peak (MassSpecPeakSetting):\nMassSpecPeakSetting object
    • \n
    • data_input (DataInputSetting):\nDataInputSetting object
    • \n
    \n"}, {"fullname": "corems.encapsulation.factory.parameters.MSParameters.molecular_search", "modulename": "corems.encapsulation.factory.parameters", "qualname": "MSParameters.molecular_search", "kind": "variable", "doc": "

    \n", "default_value": "MolecularFormulaSearchSettings(use_isotopologue_filter=False, isotopologue_filter_threshold=33.0, isotopologue_filter_atoms=('Cl', 'Br'), use_runtime_kendrick_filter=False, use_min_peaks_filter=True, min_peaks_per_class=15, url_database='postgresql+psycopg2://coremsappdb:coremsapppnnl@molformdb:5432/coremsapp', db_jobs=3, db_chunk_size=300, ion_charge=-1, min_hc_filter=0.3, max_hc_filter=3.0, min_oc_filter=0.0, max_oc_filter=1.2, min_op_filter=2.0, use_pah_line_rule=False, min_dbe=0.0, max_dbe=40.0, mz_error_score_weight=0.6, isotopologue_score_weight=0.4, adduct_atoms_neg=('Cl', 'Br'), adduct_atoms_pos=('Na', 'K'), score_methods=('S_P_lowest_error', 'N_S_P_lowest_error', 'lowest_error', 'prob_score', 'air_filter_error', 'water_filter_error', 'earth_filter_error'), score_method='prob_score', output_min_score=0.1, output_score_method='All Candidates', isRadical=False, isProtonated=True, isAdduct=False, usedAtoms={'C': (1, 100), 'H': (1, 200)}, ionization_type='ESI', min_ppm_error=-10.0, max_ppm_error=10.0, min_abun_error=-100.0, max_abun_error=100.0, mz_error_range=1.5, error_method='None', mz_error_average=0.0, used_atom_valences={'C': 4, '13C': 4, 'N': 3, 'O': 2, 'S': 2, 'H': 1, 'F': (1, 0), 'Cl': (1, 0), 'Br': (1, 0), 'I': (1, 0), 'At': 1, 'Li': (1, 0), 'Na': (1, 0), 'K': (1, 0), 'Rb': 1, 'Cs': 1, 'Fr': 1, 'B': (4, 3, 2, 1), 'In': (3, 2, 1), 'Al': (3, 1, 2), 'P': (3, 5, 4, 2, 1), 'Ga': (3, 1, 2), 'Mg': (2, 1), 'Be': (2, 1), 'Ca': (2, 1), 'Sr': (2, 1), 'Ba': 2, 'Ra': 2, 'V': (5, 4, 3, 2, 1), 'Fe': (3, 2, 4, 5, 6), 'Si': (4, 3, 2), 'Sc': (3, 2, 1), 'Ti': (4, 3, 2, 1), 'Cr': (1, 2, 3, 4, 5, 6), 'Mn': (1, 2, 3, 4, 5, 6, 7), 'Co': (1, 2, 3, 4, 5), 'Ni': (1, 2, 3, 4), 'Cu': (2, 1, 3, 4), 'Zn': (2, 1), 'Ge': (4, 3, 2, 1), 'As': (5, 3, 2, 1), 'Se': (6, 4, 2, 1), 'Y': (3, 2, 1), 'Zr': (4, 3, 2, 1), 'Nb': (5, 4, 3, 2, 1), 'Mo': (6, 5, 4, 3, 2, 1), 'Tc': (7, 6, 5, 4, 3, 2, 1), 'Ru': (8, 7, 6, 5, 4, 3, 2, 1), 'Rh': (6, 5, 4, 3, 2, 1), 'Pd': (4, 2, 1), 'Ag': (0, 1, 2, 3, 4), 'Cd': (2, 1), 'Sn': (4, 2), 'Sb': (5, 3), 'Te': (6, 5, 4, 2), 'La': (3, 2), 'Hf': (4, 3, 2), 'Ta': (5, 4, 3, 2), 'W': (6, 5, 4, 3, 2, 1), 'Re': (4, 7, 6, 5, 3, 2, 1), 'Os': (4, 8, 7, 6, 5, 3, 2, 1), 'Ir': (4, 8, 6, 5, 3, 2, 1), 'Pt': (4, 6, 5, 3, 2, 1), 'Au': (3, 5, 2, 1), 'Hg': (1, 2, 4), 'Tl': (3, 1), 'Pb': (4, 2), 'Bi': (3, 1, 5), 'Po': (2, 4, 6), 'Ac': (3, 2)})"}, {"fullname": "corems.encapsulation.factory.parameters.MSParameters.transient", "modulename": "corems.encapsulation.factory.parameters", "qualname": "MSParameters.transient", "kind": "variable", "doc": "

    \n", "default_value": "TransientSetting(implemented_apodization_function=('Hamming', 'Hanning', 'Blackman', 'Full-Sine', 'Half-Sine', 'Kaiser', 'Half-Kaiser'), apodization_method='Hanning', number_of_truncations=0, number_of_zero_fills=1, next_power_of_two=False, kaiser_beta=8.6)"}, {"fullname": "corems.encapsulation.factory.parameters.MSParameters.mass_spectrum", "modulename": "corems.encapsulation.factory.parameters", "qualname": "MSParameters.mass_spectrum", "kind": "variable", "doc": "

    \n", "default_value": "MassSpectrumSetting(noise_threshold_method='log', noise_threshold_methods_implemented=('minima', 'signal_noise', 'relative_abundance', 'absolute_abundance', 'log'), noise_threshold_min_std=6, noise_threshold_min_s2n=4.0, noise_threshold_min_relative_abundance=6.0, noise_threshold_absolute_abundance=1000000.0, noise_threshold_log_nsigma=6, noise_threshold_log_nsigma_corr_factor=0.463, noise_threshold_log_nsigma_bins=500, noise_min_mz=50.0, noise_max_mz=1200.0, min_picking_mz=50.0, max_picking_mz=1200.0, picking_point_extrapolate=3, calib_minimize_method='Powell', calib_pol_order=2, max_calib_ppm_error=1.0, min_calib_ppm_error=-1.0, calib_sn_threshold=2.0, do_calibration=True)"}, {"fullname": "corems.encapsulation.factory.parameters.MSParameters.ms_peak", "modulename": "corems.encapsulation.factory.parameters", "qualname": "MSParameters.ms_peak", "kind": "variable", "doc": "

    \n", "default_value": "MassSpecPeakSetting(kendrick_base={'C': 1, 'H': 2}, kendrick_rounding_method='floor', implemented_kendrick_rounding_methods=('floor', 'ceil', 'round'), peak_derivative_threshold=0.0, peak_min_prominence_percent=0.1, min_peak_datapoints=5.0, peak_max_prominence_percent=0.1, peak_height_max_percent=10.0, legacy_resolving_power=True)"}, {"fullname": "corems.encapsulation.factory.parameters.MSParameters.data_input", "modulename": "corems.encapsulation.factory.parameters", "qualname": "MSParameters.data_input", "kind": "variable", "doc": "

    \n", "default_value": "DataInputSetting(header_translate={'m/z': 'm/z', 'mOz': 'm/z', 'Mass': 'm/z', 'Resolving Power': 'Resolving Power', 'Res.': 'Resolving Power', 'Intensity': 'Peak Height', 'I': 'Peak Height', 'Abundance': 'Peak Height', 'Signal/Noise': 'S/N', 'S/N': 'S/N', 'abs_abu': 'Peak Height', 'sn': 'S/N', 'resolution': 'Resolving Power'})"}, {"fullname": "corems.encapsulation.factory.parameters.GCMSParameters", "modulename": "corems.encapsulation.factory.parameters", "qualname": "GCMSParameters", "kind": "class", "doc": "

    GCMSParameters class is used to store the parameters used for the processing of the gas chromatograph mass spectrum

    \n\n

    Each attibute is a class that contains the parameters for the processing of the data, see the corems.encapsulation.factory.processingSetting module for more details.

    \n\n
    Attributes
    \n\n
      \n
    • molecular_search (MolecularFormulaSearchSettings):\nMolecularFormulaSearchSettings object
    • \n
    • gc_ms (GasChromatographSetting):\nGasChromatographSetting object
    • \n
    \n"}, {"fullname": "corems.encapsulation.factory.parameters.GCMSParameters.molecular_search", "modulename": "corems.encapsulation.factory.parameters", "qualname": "GCMSParameters.molecular_search", "kind": "variable", "doc": "

    \n", "default_value": "CompoundSearchSettings(url_database='sqlite:///db/pnnl_lowres_gcms_compounds.sqlite', ri_search_range=35.0, rt_search_range=1.0, correlation_threshold=0.5, score_threshold=0.0, ri_spacing=200.0, ri_std=3.0, ri_calibration_compound_names=['Methyl Caprylate', 'Methyl Caprate', 'Methyl Pelargonate', 'Methyl Laurate', 'Methyl Myristate', 'Methyl Palmitate', 'Methyl Stearate', 'Methyl Eicosanoate', 'Methyl Docosanoate', 'Methyl Linocerate', 'Methyl Hexacosanoate', 'Methyl Octacosanoate', 'Methyl Triacontanoate'], exploratory_mode=False, score_methods=('highest_sim_score', 'highest_ss'), output_score_method='All')"}, {"fullname": "corems.encapsulation.factory.parameters.GCMSParameters.gc_ms", "modulename": "corems.encapsulation.factory.parameters", "qualname": "GCMSParameters.gc_ms", "kind": "variable", "doc": "

    \n", "default_value": "GasChromatographSetting(use_deconvolution=False, implemented_smooth_method=('savgol', 'hanning', 'blackman', 'bartlett', 'flat', 'boxcar'), smooth_window=5, smooth_method='savgol', savgol_pol_order=2, peak_derivative_threshold=0.0005, peak_height_max_percent=10.0, peak_max_prominence_percent=1.0, min_peak_datapoints=5.0, max_peak_width=0.1, noise_threshold_method='manual_relative_abundance', noise_threshold_methods_implemented=('auto_relative_abundance', 'manual_relative_abundance', 'second_derivative'), std_noise_threshold=3, peak_height_min_percent=0.1, peak_min_prominence_percent=0.1, eic_signal_threshold=0.01, max_rt_distance=0.025)"}, {"fullname": "corems.encapsulation.factory.parameters.LCMSParameters", "modulename": "corems.encapsulation.factory.parameters", "qualname": "LCMSParameters", "kind": "class", "doc": "

    LCMSParameters class is used to store the parameters used for the processing of the liquid chromatograph mass spectrum

    \n\n

    Each attibute is a class that contains the parameters for the processing of the data, see the corems.encapsulation.factory.processingSetting module for more details.

    \n\n
    Attributes
    \n\n
      \n
    • lc_ms (LiquidChromatographSetting):\nLiquidChromatographSetting object
    • \n
    • mass_spectrum (MassSpectrumSetting):\nMassSpectrumSetting object
    • \n
    • ms_peak (MassSpecPeakSetting):\nMassSpecPeakSetting object
    • \n
    • ms1_molecular_search (MolecularFormulaSearchSettings):\nMolecularFormulaSearchSettings object
    • \n
    • ms2_molecular_search (MolecularFormulaSearchSettings):\nMolecularFormulaSearchSettings object
    • \n
    \n"}, {"fullname": "corems.encapsulation.factory.parameters.LCMSParameters.lc_ms", "modulename": "corems.encapsulation.factory.parameters", "qualname": "LCMSParameters.lc_ms", "kind": "variable", "doc": "

    \n", "default_value": "LiquidChromatographSetting(scans=(0, 1), eic_tolerance_ppm=5.0, enforce_target_ms2=True, average_target_mz=True, smooth_window=5, smooth_method='savgol', implemented_smooth_method=('savgol', 'hanning', 'blackman', 'bartlett', 'flat', 'boxcar'), savgol_pol_order=2, peak_height_max_percent=10.0, peak_max_prominence_percent=1.0, peak_derivative_threshold=0.0005, min_peak_datapoints=5.0, noise_threshold_method='manual_relative_abundance', noise_threshold_methods_implemented=('auto_relative_abundance', 'manual_relative_abundance', 'second_derivative'), std_noise_threshold=3, peak_height_min_percent=0.1, eic_signal_threshold=0.01)"}, {"fullname": "corems.encapsulation.factory.parameters.LCMSParameters.mass_spectrum", "modulename": "corems.encapsulation.factory.parameters", "qualname": "LCMSParameters.mass_spectrum", "kind": "variable", "doc": "

    \n", "default_value": "MassSpectrumSetting(noise_threshold_method='log', noise_threshold_methods_implemented=('minima', 'signal_noise', 'relative_abundance', 'absolute_abundance', 'log'), noise_threshold_min_std=6, noise_threshold_min_s2n=4.0, noise_threshold_min_relative_abundance=6.0, noise_threshold_absolute_abundance=1000000.0, noise_threshold_log_nsigma=6, noise_threshold_log_nsigma_corr_factor=0.463, noise_threshold_log_nsigma_bins=500, noise_min_mz=50.0, noise_max_mz=1200.0, min_picking_mz=50.0, max_picking_mz=1200.0, picking_point_extrapolate=3, calib_minimize_method='Powell', calib_pol_order=2, max_calib_ppm_error=1.0, min_calib_ppm_error=-1.0, calib_sn_threshold=2.0, do_calibration=True)"}, {"fullname": "corems.encapsulation.factory.parameters.LCMSParameters.ms_peak", "modulename": "corems.encapsulation.factory.parameters", "qualname": "LCMSParameters.ms_peak", "kind": "variable", "doc": "

    \n", "default_value": "MassSpecPeakSetting(kendrick_base={'C': 1, 'H': 2}, kendrick_rounding_method='floor', implemented_kendrick_rounding_methods=('floor', 'ceil', 'round'), peak_derivative_threshold=0.0, peak_min_prominence_percent=0.1, min_peak_datapoints=5.0, peak_max_prominence_percent=0.1, peak_height_max_percent=10.0, legacy_resolving_power=True)"}, {"fullname": "corems.encapsulation.factory.parameters.LCMSParameters.ms1_molecular_search", "modulename": "corems.encapsulation.factory.parameters", "qualname": "LCMSParameters.ms1_molecular_search", "kind": "variable", "doc": "

    \n", "default_value": "MolecularFormulaSearchSettings(use_isotopologue_filter=False, isotopologue_filter_threshold=33.0, isotopologue_filter_atoms=('Cl', 'Br'), use_runtime_kendrick_filter=False, use_min_peaks_filter=True, min_peaks_per_class=15, url_database='postgresql+psycopg2://coremsappdb:coremsapppnnl@molformdb:5432/coremsapp', db_jobs=3, db_chunk_size=300, ion_charge=-1, min_hc_filter=0.3, max_hc_filter=3.0, min_oc_filter=0.0, max_oc_filter=1.2, min_op_filter=2.0, use_pah_line_rule=False, min_dbe=0.0, max_dbe=40.0, mz_error_score_weight=0.6, isotopologue_score_weight=0.4, adduct_atoms_neg=('Cl', 'Br'), adduct_atoms_pos=('Na', 'K'), score_methods=('S_P_lowest_error', 'N_S_P_lowest_error', 'lowest_error', 'prob_score', 'air_filter_error', 'water_filter_error', 'earth_filter_error'), score_method='prob_score', output_min_score=0.1, output_score_method='All Candidates', isRadical=False, isProtonated=True, isAdduct=False, usedAtoms={'C': (1, 100), 'H': (1, 200)}, ionization_type='ESI', min_ppm_error=-10.0, max_ppm_error=10.0, min_abun_error=-100.0, max_abun_error=100.0, mz_error_range=1.5, error_method='None', mz_error_average=0.0, used_atom_valences={'C': 4, '13C': 4, 'N': 3, 'O': 2, 'S': 2, 'H': 1, 'F': (1, 0), 'Cl': (1, 0), 'Br': (1, 0), 'I': (1, 0), 'At': 1, 'Li': (1, 0), 'Na': (1, 0), 'K': (1, 0), 'Rb': 1, 'Cs': 1, 'Fr': 1, 'B': (4, 3, 2, 1), 'In': (3, 2, 1), 'Al': (3, 1, 2), 'P': (3, 5, 4, 2, 1), 'Ga': (3, 1, 2), 'Mg': (2, 1), 'Be': (2, 1), 'Ca': (2, 1), 'Sr': (2, 1), 'Ba': 2, 'Ra': 2, 'V': (5, 4, 3, 2, 1), 'Fe': (3, 2, 4, 5, 6), 'Si': (4, 3, 2), 'Sc': (3, 2, 1), 'Ti': (4, 3, 2, 1), 'Cr': (1, 2, 3, 4, 5, 6), 'Mn': (1, 2, 3, 4, 5, 6, 7), 'Co': (1, 2, 3, 4, 5), 'Ni': (1, 2, 3, 4), 'Cu': (2, 1, 3, 4), 'Zn': (2, 1), 'Ge': (4, 3, 2, 1), 'As': (5, 3, 2, 1), 'Se': (6, 4, 2, 1), 'Y': (3, 2, 1), 'Zr': (4, 3, 2, 1), 'Nb': (5, 4, 3, 2, 1), 'Mo': (6, 5, 4, 3, 2, 1), 'Tc': (7, 6, 5, 4, 3, 2, 1), 'Ru': (8, 7, 6, 5, 4, 3, 2, 1), 'Rh': (6, 5, 4, 3, 2, 1), 'Pd': (4, 2, 1), 'Ag': (0, 1, 2, 3, 4), 'Cd': (2, 1), 'Sn': (4, 2), 'Sb': (5, 3), 'Te': (6, 5, 4, 2), 'La': (3, 2), 'Hf': (4, 3, 2), 'Ta': (5, 4, 3, 2), 'W': (6, 5, 4, 3, 2, 1), 'Re': (4, 7, 6, 5, 3, 2, 1), 'Os': (4, 8, 7, 6, 5, 3, 2, 1), 'Ir': (4, 8, 6, 5, 3, 2, 1), 'Pt': (4, 6, 5, 3, 2, 1), 'Au': (3, 5, 2, 1), 'Hg': (1, 2, 4), 'Tl': (3, 1), 'Pb': (4, 2), 'Bi': (3, 1, 5), 'Po': (2, 4, 6), 'Ac': (3, 2)})"}, {"fullname": "corems.encapsulation.factory.parameters.LCMSParameters.ms2_molecular_search", "modulename": "corems.encapsulation.factory.parameters", "qualname": "LCMSParameters.ms2_molecular_search", "kind": "variable", "doc": "

    \n", "default_value": "MolecularFormulaSearchSettings(use_isotopologue_filter=False, isotopologue_filter_threshold=33.0, isotopologue_filter_atoms=('Cl', 'Br'), use_runtime_kendrick_filter=False, use_min_peaks_filter=True, min_peaks_per_class=15, url_database='postgresql+psycopg2://coremsappdb:coremsapppnnl@molformdb:5432/coremsapp', db_jobs=3, db_chunk_size=300, ion_charge=-1, min_hc_filter=0.3, max_hc_filter=3.0, min_oc_filter=0.0, max_oc_filter=1.2, min_op_filter=2.0, use_pah_line_rule=False, min_dbe=0.0, max_dbe=40.0, mz_error_score_weight=0.6, isotopologue_score_weight=0.4, adduct_atoms_neg=('Cl', 'Br'), adduct_atoms_pos=('Na', 'K'), score_methods=('S_P_lowest_error', 'N_S_P_lowest_error', 'lowest_error', 'prob_score', 'air_filter_error', 'water_filter_error', 'earth_filter_error'), score_method='prob_score', output_min_score=0.1, output_score_method='All Candidates', isRadical=False, isProtonated=True, isAdduct=False, usedAtoms={'C': (1, 100), 'H': (1, 200)}, ionization_type='ESI', min_ppm_error=-10.0, max_ppm_error=10.0, min_abun_error=-100.0, max_abun_error=100.0, mz_error_range=1.5, error_method='None', mz_error_average=0.0, used_atom_valences={'C': 4, '13C': 4, 'N': 3, 'O': 2, 'S': 2, 'H': 1, 'F': (1, 0), 'Cl': (1, 0), 'Br': (1, 0), 'I': (1, 0), 'At': 1, 'Li': (1, 0), 'Na': (1, 0), 'K': (1, 0), 'Rb': 1, 'Cs': 1, 'Fr': 1, 'B': (4, 3, 2, 1), 'In': (3, 2, 1), 'Al': (3, 1, 2), 'P': (3, 5, 4, 2, 1), 'Ga': (3, 1, 2), 'Mg': (2, 1), 'Be': (2, 1), 'Ca': (2, 1), 'Sr': (2, 1), 'Ba': 2, 'Ra': 2, 'V': (5, 4, 3, 2, 1), 'Fe': (3, 2, 4, 5, 6), 'Si': (4, 3, 2), 'Sc': (3, 2, 1), 'Ti': (4, 3, 2, 1), 'Cr': (1, 2, 3, 4, 5, 6), 'Mn': (1, 2, 3, 4, 5, 6, 7), 'Co': (1, 2, 3, 4, 5), 'Ni': (1, 2, 3, 4), 'Cu': (2, 1, 3, 4), 'Zn': (2, 1), 'Ge': (4, 3, 2, 1), 'As': (5, 3, 2, 1), 'Se': (6, 4, 2, 1), 'Y': (3, 2, 1), 'Zr': (4, 3, 2, 1), 'Nb': (5, 4, 3, 2, 1), 'Mo': (6, 5, 4, 3, 2, 1), 'Tc': (7, 6, 5, 4, 3, 2, 1), 'Ru': (8, 7, 6, 5, 4, 3, 2, 1), 'Rh': (6, 5, 4, 3, 2, 1), 'Pd': (4, 2, 1), 'Ag': (0, 1, 2, 3, 4), 'Cd': (2, 1), 'Sn': (4, 2), 'Sb': (5, 3), 'Te': (6, 5, 4, 2), 'La': (3, 2), 'Hf': (4, 3, 2), 'Ta': (5, 4, 3, 2), 'W': (6, 5, 4, 3, 2, 1), 'Re': (4, 7, 6, 5, 3, 2, 1), 'Os': (4, 8, 7, 6, 5, 3, 2, 1), 'Ir': (4, 8, 6, 5, 3, 2, 1), 'Pt': (4, 6, 5, 3, 2, 1), 'Au': (3, 5, 2, 1), 'Hg': (1, 2, 4), 'Tl': (3, 1), 'Pb': (4, 2), 'Bi': (3, 1, 5), 'Po': (2, 4, 6), 'Ac': (3, 2)})"}, {"fullname": "corems.encapsulation.factory.parameters.default_parameters", "modulename": "corems.encapsulation.factory.parameters", "qualname": "default_parameters", "kind": "function", "doc": "

    Generate parameters dictionary with the default parameters for data processing\n To gather parameters from instrument data during the data parsing step, a parameters dictionary with the default parameters needs to be generated.\n This dictionary acts as a placeholder and is later used as an argument for all the class constructor methods during instantiation. \n The data gathered from the instrument is added to the class properties.

    \n\n
    Parameters
    \n\n
      \n
    • file_location (str):\npath to the file
    • \n
    \n\n
    Returns
    \n\n
      \n
    • parameters (dict):\ndictionary with the default parameters for data processing
    • \n
    \n", "signature": "(file_location):", "funcdef": "def"}, {"fullname": "corems.encapsulation.factory.processingSetting", "modulename": "corems.encapsulation.factory.processingSetting", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.TransientSetting", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "TransientSetting", "kind": "class", "doc": "

    Transient processing settings class

    \n\n
    Attributes
    \n\n
      \n
    • implemented_apodization_function (tuple):\nAvailable apodization functions
    • \n
    • apodization_method (str):\nApodization function to use. Hanning is a good default for Fourier transform magnitude mode. For absorption mode processing, Half-Sine or Half-Kaiser may be more appropriate.
    • \n
    • number_of_truncations (int):\nHow many times to truncate the transient prior to Fourier transform
    • \n
    • number_of_zero_fills (int):\nHow many times to zero fille the transient prior to Fourier transform.
    • \n
    • next_power_of_two (bool):\nIf True, zero fill to the next power of two after the new length of len(transient)+(number_of_zero_fills*len(transient)).
    • \n
    • kaiser_beta (float):\nBeta parameter for Kaiser or Half-Kaiser apodisation function. 0 is rectangular, 5 is similar to Hamming,\n6 is similar to hanning, and 8.6 is similar to Blackman (from numpy docs)
    • \n
    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.TransientSetting.__init__", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "TransientSetting.__init__", "kind": "function", "doc": "

    \n", "signature": "(\timplemented_apodization_function: tuple = ('Hamming', 'Hanning', 'Blackman', 'Full-Sine', 'Half-Sine', 'Kaiser', 'Half-Kaiser'),\tapodization_method: str = 'Hanning',\tnumber_of_truncations: int = 0,\tnumber_of_zero_fills: int = 1,\tnext_power_of_two: bool = False,\tkaiser_beta: float = 8.6)"}, {"fullname": "corems.encapsulation.factory.processingSetting.TransientSetting.implemented_apodization_function", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "TransientSetting.implemented_apodization_function", "kind": "variable", "doc": "

    \n", "annotation": ": tuple", "default_value": "('Hamming', 'Hanning', 'Blackman', 'Full-Sine', 'Half-Sine', 'Kaiser', 'Half-Kaiser')"}, {"fullname": "corems.encapsulation.factory.processingSetting.TransientSetting.apodization_method", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "TransientSetting.apodization_method", "kind": "variable", "doc": "

    \n", "annotation": ": str", "default_value": "'Hanning'"}, {"fullname": "corems.encapsulation.factory.processingSetting.TransientSetting.number_of_truncations", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "TransientSetting.number_of_truncations", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "0"}, {"fullname": "corems.encapsulation.factory.processingSetting.TransientSetting.number_of_zero_fills", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "TransientSetting.number_of_zero_fills", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "1"}, {"fullname": "corems.encapsulation.factory.processingSetting.TransientSetting.next_power_of_two", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "TransientSetting.next_power_of_two", "kind": "variable", "doc": "

    \n", "annotation": ": bool", "default_value": "False"}, {"fullname": "corems.encapsulation.factory.processingSetting.TransientSetting.kaiser_beta", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "TransientSetting.kaiser_beta", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "8.6"}, {"fullname": "corems.encapsulation.factory.processingSetting.DataInputSetting", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "DataInputSetting", "kind": "class", "doc": "

    Data input settings class

    \n\n
    Attributes
    \n\n
      \n
    • header_translate (dict):\nDictionary with the header labels to be translated to the corems labels. For example, {'m/z':'m/z', 'Resolving Power':'Resolving Power', 'Abundance':'Abundance' , 'S/N':'S/N'}
    • \n
    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.DataInputSetting.__init__", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "DataInputSetting.__init__", "kind": "function", "doc": "

    \n", "signature": "(header_translate: dict = <factory>)"}, {"fullname": "corems.encapsulation.factory.processingSetting.DataInputSetting.header_translate", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "DataInputSetting.header_translate", "kind": "variable", "doc": "

    \n", "annotation": ": dict"}, {"fullname": "corems.encapsulation.factory.processingSetting.DataInputSetting.add_mz_label", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "DataInputSetting.add_mz_label", "kind": "function", "doc": "

    Add a label to the header_translate dictionary to be translated to the corems label for mz.

    \n", "signature": "(self, label):", "funcdef": "def"}, {"fullname": "corems.encapsulation.factory.processingSetting.DataInputSetting.add_peak_height_label", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "DataInputSetting.add_peak_height_label", "kind": "function", "doc": "

    Add a label to the header_translate dictionary to be translated to the corems label for peak height.

    \n", "signature": "(self, label):", "funcdef": "def"}, {"fullname": "corems.encapsulation.factory.processingSetting.DataInputSetting.add_sn_label", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "DataInputSetting.add_sn_label", "kind": "function", "doc": "

    Add a label to the header_translate dictionary to be translated to the corems label for signal to noise.

    \n", "signature": "(self, label):", "funcdef": "def"}, {"fullname": "corems.encapsulation.factory.processingSetting.DataInputSetting.add_resolving_power_label", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "DataInputSetting.add_resolving_power_label", "kind": "function", "doc": "

    Add a label to the header_translate dictionary to be translated to the corems label for resolving power.

    \n", "signature": "(self, label):", "funcdef": "def"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting", "kind": "class", "doc": "

    Liquid chromatograph processing settings class

    \n\n
    Attributes
    \n\n
      \n
    • scans (list or tuple, optional):\nList of select scan to average or a tuple containing the range to average. Default is (0, 1).
    • \n
    • eic_tolerance_ppm (float, optional):\nMass tolerance in ppm for extracted ion chromatogram peak detection. Default is 5.
    • \n
    • correct_eic_baseline (bool, optional):\nIf True, correct the baseline of the extracted ion chromatogram. Default is True.
    • \n
    • enforce_target_ms2 (bool, optional):\nOnly extract EICs for target_mz if the m/z was selected as precursor for ms2. Default is True.
    • \n
    • average_target_mz (bool, optional):\nIf True, average the target_mz EICs. Default is True.
    • \n
    • smooth_window (int, optional):\nWindow size for smoothing the ion chromatogram. Default is 5.
    • \n
    • smooth_method (str, optional):\nSmoothing method to use. Default is 'savgol'. Other options are 'hanning', 'blackman', 'bartlett', 'flat', 'boxcar'.
    • \n
    • implemented_smooth_method (tuple, optional):\nSmoothing methods that can be implemented. Values are ('savgol', 'hanning', 'blackman', 'bartlett', 'flat', 'boxcar').
    • \n
    • savgol_pol_order (int, optional):\nPolynomial order for Savitzky-Golay smoothing. Default is 2.
    • \n
    • peak_height_max_percent (float, optional):\n1-100 % used for baseline detection use 0.1 for second_derivative and 10 for other methods. Default is 10.
    • \n
    • peak_max_prominence_percent (float, optional):\n1-100 % used for baseline detection. Default is 1.
    • \n
    • peak_derivative_threshold (float, optional):\nThreshold for defining derivative crossing. Default is 0.0005.
    • \n
    • min_peak_datapoints (float, optional):\nminimum data point to define a chromatografic peak. Default is 5.
    • \n
    • noise_threshold_method (str, optional):\nMethod for detecting noise threshold. Default is 'manual_relative_abundance'.
    • \n
    • noise_threshold_methods_implemented (tuple, optional):\nMethods for detected noise threshold that can be implemented. Default is ('auto_relative_abundance', 'manual_relative_abundance', 'second_derivative').
    • \n
    • std_noise_threshold (int, optional):\nthe amount of standard deviations used to calculate noise thresould, average + (std_noise_threshold * noise). Default is 3.
    • \n
    • peak_height_min_percent (float, optional):\n0-100 % used for peak detection. Default is 0.1.
    • \n
    • eic_signal_threshold (float, optional):\n0-100 % used for extracted ion chromatogram peak detection. Default is 0.01.
    • \n
    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.__init__", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tscans: list | tuple = (0, 1),\teic_tolerance_ppm: float = 5,\tenforce_target_ms2: bool = True,\taverage_target_mz: bool = True,\tsmooth_window: int = 5,\tsmooth_method: str = 'savgol',\timplemented_smooth_method: tuple = ('savgol', 'hanning', 'blackman', 'bartlett', 'flat', 'boxcar'),\tsavgol_pol_order: int = 2,\tpeak_height_max_percent: float = 10,\tpeak_max_prominence_percent: float = 1,\tpeak_derivative_threshold: float = 0.0005,\tmin_peak_datapoints: float = 5,\tnoise_threshold_method: str = 'manual_relative_abundance',\tnoise_threshold_methods_implemented: tuple = ('auto_relative_abundance', 'manual_relative_abundance', 'second_derivative'),\tstd_noise_threshold: int = 3,\tpeak_height_min_percent: float = 0.1,\teic_signal_threshold: float = 0.01)"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.scans", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.scans", "kind": "variable", "doc": "

    \n", "annotation": ": list | tuple", "default_value": "(0, 1)"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.eic_tolerance_ppm", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.eic_tolerance_ppm", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "5"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.correct_eic_baseline", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.correct_eic_baseline", "kind": "variable", "doc": "

    \n", "default_value": "True"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.enforce_target_ms2", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.enforce_target_ms2", "kind": "variable", "doc": "

    \n", "annotation": ": bool", "default_value": "True"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.average_target_mz", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.average_target_mz", "kind": "variable", "doc": "

    \n", "annotation": ": bool", "default_value": "True"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.smooth_window", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.smooth_window", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "5"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.smooth_method", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.smooth_method", "kind": "variable", "doc": "

    \n", "annotation": ": str", "default_value": "'savgol'"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.implemented_smooth_method", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.implemented_smooth_method", "kind": "variable", "doc": "

    \n", "annotation": ": tuple", "default_value": "('savgol', 'hanning', 'blackman', 'bartlett', 'flat', 'boxcar')"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.savgol_pol_order", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.savgol_pol_order", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "2"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.peak_height_max_percent", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.peak_height_max_percent", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "10"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.peak_max_prominence_percent", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.peak_max_prominence_percent", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "1"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.peak_derivative_threshold", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.peak_derivative_threshold", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.0005"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.min_peak_datapoints", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.min_peak_datapoints", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "5"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.noise_threshold_method", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.noise_threshold_method", "kind": "variable", "doc": "

    \n", "annotation": ": str", "default_value": "'manual_relative_abundance'"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.noise_threshold_methods_implemented", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.noise_threshold_methods_implemented", "kind": "variable", "doc": "

    \n", "annotation": ": tuple", "default_value": "('auto_relative_abundance', 'manual_relative_abundance', 'second_derivative')"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.std_noise_threshold", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.std_noise_threshold", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "3"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.peak_height_min_percent", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.peak_height_min_percent", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.1"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.eic_signal_threshold", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.eic_signal_threshold", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.01"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting", "kind": "class", "doc": "

    Mass spectrum processing settings class

    \n\n
    Attributes
    \n\n
      \n
    • noise_threshold_method (str, optional):\nMethod for detecting noise threshold. Default is 'log'.
    • \n
    • noise_threshold_methods_implemented (tuple, optional):\nMethods for detected noise threshold that can be implemented. Default is ('minima', 'signal_noise', 'relative_abundance', 'absolute_abundance', 'log').
    • \n
    • noise_threshold_min_std (int, optional):\nMinumum value for noise thresholding when using 'minima' noise threshold method. Default is 6.
    • \n
    • noise_threshold_min_s2n (float, optional):\nMinimum value for noise thresholding when using 'signal_noise' noise threshold method. Default is 4.
    • \n
    • noise_threshold_min_relative_abundance (float, optional):\nMinimum value for noise thresholding when using 'relative_abundance' noise threshold method. Default is 6.
    • \n
    • noise_threshold_absolute_abundance (float, optional):\nMinimum value for noise thresholding when using 'absolute_abundance' noise threshold method. Default is 1_000_000.
    • \n
    • noise_threshold_log_nsigma (int, optional):\nNumber of standard deviations to use when using 'log' noise threshold method. Default is 6.
    • \n
    • noise_threshold_log_nsigma_corr_factor (float, optional):\nCorrection factor for log noise threshold method. Default is 0.463.
    • \n
    • noise_threshold_log_nsigma_bins (int, optional):\nNumber of bins to use for histogram when using 'log' noise threshold method. Default is 500.
    • \n
    • noise_min_mz (float, optional):\nMinimum m/z to use for noise thresholding. Default is 50.0.
    • \n
    • noise_max_mz (float, optional):\nMaximum m/z to use for noise thresholding. Default is 1200.0.
    • \n
    • min_picking_mz (float, optional):\nMinimum m/z to use for peak picking. Default is 50.0.
    • \n
    • max_picking_mz (float, optional):\nMaximum m/z to use for peak picking. Default is 1200.0.
    • \n
    • picking_point_extrapolate (int, optional):\nHow many data points (in each direction) to extrapolate the mz axis and 0 pad the abundance axis. Default is 3.
    • \n
    • calib_minimize_method (str, optional):\nMinimization method to use for calibration. Default is 'Powell'.
    • \n
    • calib_pol_order (int, optional):\nPolynomial order to use for calibration. Default is 2.
    • \n
    • max_calib_ppm_error (float, optional):\nMaximum ppm error to use for calibration. Default is 1.0.
    • \n
    • min_calib_ppm_error (float, optional):\nMinimum ppm error to use for calibration. Default is -1.0.
    • \n
    • calib_sn_threshold (float, optional):\nSignal to noise threshold to use for calibration. Default is 2.0.
    • \n
    • do_calibration (bool, optional):\nIf True, perform calibration. Default is True.
    • \n
    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.__init__", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tnoise_threshold_method: str = 'log',\tnoise_threshold_methods_implemented: tuple = ('minima', 'signal_noise', 'relative_abundance', 'absolute_abundance', 'log'),\tnoise_threshold_min_std: int = 6,\tnoise_threshold_min_s2n: float = 4,\tnoise_threshold_min_relative_abundance: float = 6,\tnoise_threshold_absolute_abundance: float = 1000000,\tnoise_threshold_log_nsigma: int = 6,\tnoise_threshold_log_nsigma_corr_factor: float = 0.463,\tnoise_threshold_log_nsigma_bins: int = 500,\tnoise_min_mz: float = 50.0,\tnoise_max_mz: float = 1200.0,\tmin_picking_mz: float = 50.0,\tmax_picking_mz: float = 1200.0,\tpicking_point_extrapolate: int = 3,\tcalib_minimize_method: str = 'Powell',\tcalib_pol_order: int = 2,\tmax_calib_ppm_error: float = 1.0,\tmin_calib_ppm_error: float = -1.0,\tcalib_sn_threshold: float = 2.0,\tdo_calibration: bool = True)"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.noise_threshold_method", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.noise_threshold_method", "kind": "variable", "doc": "

    \n", "annotation": ": str", "default_value": "'log'"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.noise_threshold_methods_implemented", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.noise_threshold_methods_implemented", "kind": "variable", "doc": "

    \n", "annotation": ": tuple", "default_value": "('minima', 'signal_noise', 'relative_abundance', 'absolute_abundance', 'log')"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.noise_threshold_min_std", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.noise_threshold_min_std", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "6"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.noise_threshold_min_s2n", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.noise_threshold_min_s2n", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "4"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.noise_threshold_min_relative_abundance", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.noise_threshold_min_relative_abundance", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "6"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.noise_threshold_absolute_abundance", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.noise_threshold_absolute_abundance", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "1000000"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.noise_threshold_log_nsigma", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.noise_threshold_log_nsigma", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "6"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.noise_threshold_log_nsigma_corr_factor", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.noise_threshold_log_nsigma_corr_factor", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.463"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.noise_threshold_log_nsigma_bins", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.noise_threshold_log_nsigma_bins", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "500"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.noise_min_mz", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.noise_min_mz", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "50.0"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.noise_max_mz", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.noise_max_mz", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "1200.0"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.min_picking_mz", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.min_picking_mz", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "50.0"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.max_picking_mz", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.max_picking_mz", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "1200.0"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.picking_point_extrapolate", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.picking_point_extrapolate", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "3"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.calib_minimize_method", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.calib_minimize_method", "kind": "variable", "doc": "

    \n", "annotation": ": str", "default_value": "'Powell'"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.calib_pol_order", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.calib_pol_order", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "2"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.max_calib_ppm_error", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.max_calib_ppm_error", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "1.0"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.min_calib_ppm_error", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.min_calib_ppm_error", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "-1.0"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.calib_sn_threshold", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.calib_sn_threshold", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "2.0"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.do_calibration", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.do_calibration", "kind": "variable", "doc": "

    \n", "annotation": ": bool", "default_value": "True"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpecPeakSetting", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpecPeakSetting", "kind": "class", "doc": "

    Mass spectrum peak processing settings class

    \n\n
    Attributes
    \n\n
      \n
    • kendrick_base (Dict, optional):\nDictionary specifying the elements and their counts in the Kendrick base.\nDefaults to {'C': 1, 'H': 2}.
    • \n
    • kendrick_rounding_method (str, optional):\nMethod for calculating the nominal Kendrick mass. Valid values are 'floor', 'ceil', or 'round'.\nDefaults to 'floor'.
    • \n
    • implemented_kendrick_rounding_methods (tuple):\nTuple of valid rounding methods for calculating the nominal Kendrick mass.\nDefaults to ('floor', 'ceil', 'round').
    • \n
    • peak_derivative_threshold (float, optional):\nThreshold for defining derivative crossing. Should be a value between 0 and 1.\nDefaults to 0.0.
    • \n
    • peak_min_prominence_percent (float, optional):\nMinimum prominence percentage used for peak detection. Should be a value between 1 and 100.\nDefaults to 0.1.
    • \n
    • min_peak_datapoints (float, optional):\nMinimum number of data points used for peak detection. Should be a value between 0 and infinity.\nDefaults to 5.
    • \n
    • peak_max_prominence_percent (float, optional):\nMaximum prominence percentage used for baseline detection. Should be a value between 1 and 100.\nDefaults to 0.1.
    • \n
    • peak_height_max_percent (float, optional):\nMaximum height percentage used for baseline detection. Should be a value between 1 and 100.\nDefaults to 10.
    • \n
    • legacy_resolving_power (bool, optional):\nFlag indicating whether to use the legacy (CoreMS v1) resolving power calculation.\nDefaults to True.
    • \n
    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpecPeakSetting.__init__", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpecPeakSetting.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tkendrick_base: Dict = <factory>,\tkendrick_rounding_method: str = 'floor',\timplemented_kendrick_rounding_methods: tuple = ('floor', 'ceil', 'round'),\tpeak_derivative_threshold: float = 0.0,\tpeak_min_prominence_percent: float = 0.1,\tmin_peak_datapoints: float = 5,\tpeak_max_prominence_percent: float = 0.1,\tpeak_height_max_percent: float = 10,\tlegacy_resolving_power: bool = True)"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpecPeakSetting.kendrick_base", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpecPeakSetting.kendrick_base", "kind": "variable", "doc": "

    \n", "annotation": ": Dict"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpecPeakSetting.kendrick_rounding_method", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpecPeakSetting.kendrick_rounding_method", "kind": "variable", "doc": "

    \n", "annotation": ": str", "default_value": "'floor'"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpecPeakSetting.implemented_kendrick_rounding_methods", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpecPeakSetting.implemented_kendrick_rounding_methods", "kind": "variable", "doc": "

    \n", "annotation": ": tuple", "default_value": "('floor', 'ceil', 'round')"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpecPeakSetting.peak_derivative_threshold", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpecPeakSetting.peak_derivative_threshold", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.0"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpecPeakSetting.peak_min_prominence_percent", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpecPeakSetting.peak_min_prominence_percent", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.1"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpecPeakSetting.min_peak_datapoints", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpecPeakSetting.min_peak_datapoints", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "5"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpecPeakSetting.peak_max_prominence_percent", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpecPeakSetting.peak_max_prominence_percent", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.1"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpecPeakSetting.peak_height_max_percent", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpecPeakSetting.peak_height_max_percent", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "10"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpecPeakSetting.legacy_resolving_power", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpecPeakSetting.legacy_resolving_power", "kind": "variable", "doc": "

    \n", "annotation": ": bool", "default_value": "True"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting", "kind": "class", "doc": "

    Gas chromatograph processing settings class

    \n\n
    Attributes
    \n\n
      \n
    • use_deconvolution (bool, optional):\nIf True, use deconvolution. Default is False.
    • \n
    • implemented_smooth_method (tuple, optional):\nSmoothing methods that can be implemented. Default is ('savgol', 'hanning', 'blackman', 'bartlett', 'flat', 'boxcar').
    • \n
    • smooth_window (int, optional):\nWindow size for smoothing the ion chromatogram. Default is 5.
    • \n
    • smooth_method (str, optional):\nSmoothing method to use. Default is 'savgol'. Other options are 'hanning', 'blackman', 'bartlett', 'flat', 'boxcar'.
    • \n
    • savgol_pol_order (int, optional):\nPolynomial order for Savitzky-Golay smoothing. Default is 2.
    • \n
    • peak_derivative_threshold (float, optional):\nThreshold for defining derivative crossing. Should be a value between 0 and 1.\nDefaults to 0.0005.
    • \n
    • peak_height_max_percent (float, optional):\nMaximum height percentage used for baseline detection. Should be a value between 1 and 100.\nDefaults to 10.
    • \n
    • peak_max_prominence_percent (float, optional):\nMaximum prominence percentage used for baseline detection. Should be a value between 1 and 100.\nDefaults to 1.
    • \n
    • min_peak_datapoints (float, optional):\nMinimum number of data points used for peak detection. Should be a value between 0 and infinity.\nDefaults to 5.
    • \n
    • max_peak_width (float, optional):\nMaximum peak width used for peak detection. Should be a value between 0 and infinity.\nDefaults to 0.1.
    • \n
    • noise_threshold_method (str, optional):\nMethod for detecting noise threshold. Default is 'manual_relative_abundance'.
    • \n
    • noise_threshold_methods_implemented (tuple, optional):\nMethods for detected noise threshold that can be implemented. Default is ('auto_relative_abundance', 'manual_relative_abundance', 'second_derivative').
    • \n
    • std_noise_threshold (int, optional):\nDefault is 3.
    • \n
    • peak_height_min_percent (float, optional):\n0-100 % used for peak detection. Default is 0.1.
    • \n
    • peak_min_prominence_percent (float, optional):\n0-100 % used for peak detection. Default is 0.1.
    • \n
    • eic_signal_threshold (float, optional):\n0-100 % used for extracted ion chromatogram peak detection. Default is 0.01.
    • \n
    • max_rt_distance (float, optional):\nMaximum distance allowance for hierarchical cluster, in minutes. Default is 0.025.
    • \n
    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.__init__", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tuse_deconvolution: bool = False,\timplemented_smooth_method: tuple = ('savgol', 'hanning', 'blackman', 'bartlett', 'flat', 'boxcar'),\tsmooth_window: int = 5,\tsmooth_method: str = 'savgol',\tsavgol_pol_order: int = 2,\tpeak_derivative_threshold: float = 0.0005,\tpeak_height_max_percent: float = 10,\tpeak_max_prominence_percent: float = 1,\tmin_peak_datapoints: float = 5,\tmax_peak_width: float = 0.1,\tnoise_threshold_method: str = 'manual_relative_abundance',\tnoise_threshold_methods_implemented: tuple = ('auto_relative_abundance', 'manual_relative_abundance', 'second_derivative'),\tstd_noise_threshold: int = 3,\tpeak_height_min_percent: float = 0.1,\tpeak_min_prominence_percent: float = 0.1,\teic_signal_threshold: float = 0.01,\tmax_rt_distance: float = 0.025)"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.use_deconvolution", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.use_deconvolution", "kind": "variable", "doc": "

    \n", "annotation": ": bool", "default_value": "False"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.implemented_smooth_method", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.implemented_smooth_method", "kind": "variable", "doc": "

    \n", "annotation": ": tuple", "default_value": "('savgol', 'hanning', 'blackman', 'bartlett', 'flat', 'boxcar')"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.smooth_window", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.smooth_window", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "5"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.smooth_method", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.smooth_method", "kind": "variable", "doc": "

    \n", "annotation": ": str", "default_value": "'savgol'"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.savgol_pol_order", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.savgol_pol_order", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "2"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.peak_derivative_threshold", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.peak_derivative_threshold", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.0005"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.peak_height_max_percent", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.peak_height_max_percent", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "10"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.peak_max_prominence_percent", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.peak_max_prominence_percent", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "1"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.min_peak_datapoints", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.min_peak_datapoints", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "5"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.max_peak_width", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.max_peak_width", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.1"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.noise_threshold_method", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.noise_threshold_method", "kind": "variable", "doc": "

    \n", "annotation": ": str", "default_value": "'manual_relative_abundance'"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.noise_threshold_methods_implemented", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.noise_threshold_methods_implemented", "kind": "variable", "doc": "

    \n", "annotation": ": tuple", "default_value": "('auto_relative_abundance', 'manual_relative_abundance', 'second_derivative')"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.std_noise_threshold", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.std_noise_threshold", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "3"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.peak_height_min_percent", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.peak_height_min_percent", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.1"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.peak_min_prominence_percent", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.peak_min_prominence_percent", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.1"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.eic_signal_threshold", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.eic_signal_threshold", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.01"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.max_rt_distance", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.max_rt_distance", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.025"}, {"fullname": "corems.encapsulation.factory.processingSetting.CompoundSearchSettings", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "CompoundSearchSettings", "kind": "class", "doc": "

    Settings for compound search

    \n\n
    Attributes
    \n\n
      \n
    • url_database (str, optional):\nURL for the database. Default is 'sqlite:///db/pnnl_lowres_gcms_compounds.sqlite'.
    • \n
    • ri_search_range (float, optional):\nRetention index search range. Default is 35.
    • \n
    • rt_search_range (float, optional):\nRetention time search range, in minutes. Default is 1.0.
    • \n
    • correlation_threshold (float, optional):\nThreshold for correlation for spectral similarity. Default is 0.5.
    • \n
    • score_threshold (float, optional):\nThreshold for compsite score. Default is 0.0.
    • \n
    • ri_spacing (float, optional):\nRetention index spacing. Default is 200.
    • \n
    • ri_std (float, optional):\nRetention index standard deviation. Default is 3.
    • \n
    • ri_calibration_compound_names (list, optional):\nList of compound names to use for retention index calibration. Default is ['Methyl Caprylate', 'Methyl Caprate', 'Methyl Pelargonate', 'Methyl Laurate', 'Methyl Myristate', 'Methyl Palmitate', 'Methyl Stearate', 'Methyl Eicosanoate', 'Methyl Docosanoate', 'Methyl Linocerate', 'Methyl Hexacosanoate', 'Methyl Octacosanoate', 'Methyl Triacontanoate'].
    • \n
    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.CompoundSearchSettings.__init__", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "CompoundSearchSettings.__init__", "kind": "function", "doc": "

    \n", "signature": "(\turl_database: str = 'postgresql+psycopg2://coremsappdb:coremsapppnnl@localhost:5432/lowres',\tri_search_range: float = 35,\trt_search_range: float = 1.0,\tcorrelation_threshold: float = 0.5,\tscore_threshold: float = 0.0,\tri_spacing: float = 200,\tri_std: float = 3,\tri_calibration_compound_names: List = <factory>,\texploratory_mode: bool = False,\tscore_methods: tuple = ('highest_sim_score', 'highest_ss'),\toutput_score_method: str = 'All')"}, {"fullname": "corems.encapsulation.factory.processingSetting.CompoundSearchSettings.url_database", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "CompoundSearchSettings.url_database", "kind": "variable", "doc": "

    \n", "annotation": ": str", "default_value": "'postgresql+psycopg2://coremsappdb:coremsapppnnl@localhost:5432/lowres'"}, {"fullname": "corems.encapsulation.factory.processingSetting.CompoundSearchSettings.ri_search_range", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "CompoundSearchSettings.ri_search_range", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "35"}, {"fullname": "corems.encapsulation.factory.processingSetting.CompoundSearchSettings.rt_search_range", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "CompoundSearchSettings.rt_search_range", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "1.0"}, {"fullname": "corems.encapsulation.factory.processingSetting.CompoundSearchSettings.correlation_threshold", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "CompoundSearchSettings.correlation_threshold", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.5"}, {"fullname": "corems.encapsulation.factory.processingSetting.CompoundSearchSettings.score_threshold", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "CompoundSearchSettings.score_threshold", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.0"}, {"fullname": "corems.encapsulation.factory.processingSetting.CompoundSearchSettings.ri_spacing", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "CompoundSearchSettings.ri_spacing", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "200"}, {"fullname": "corems.encapsulation.factory.processingSetting.CompoundSearchSettings.ri_std", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "CompoundSearchSettings.ri_std", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "3"}, {"fullname": "corems.encapsulation.factory.processingSetting.CompoundSearchSettings.ri_calibration_compound_names", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "CompoundSearchSettings.ri_calibration_compound_names", "kind": "variable", "doc": "

    \n", "annotation": ": List"}, {"fullname": "corems.encapsulation.factory.processingSetting.CompoundSearchSettings.exploratory_mode", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "CompoundSearchSettings.exploratory_mode", "kind": "variable", "doc": "

    \n", "annotation": ": bool", "default_value": "False"}, {"fullname": "corems.encapsulation.factory.processingSetting.CompoundSearchSettings.score_methods", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "CompoundSearchSettings.score_methods", "kind": "variable", "doc": "

    \n", "annotation": ": tuple", "default_value": "('highest_sim_score', 'highest_ss')"}, {"fullname": "corems.encapsulation.factory.processingSetting.CompoundSearchSettings.output_score_method", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "CompoundSearchSettings.output_score_method", "kind": "variable", "doc": "

    \n", "annotation": ": str", "default_value": "'All'"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularLookupDictSettings", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularLookupDictSettings", "kind": "class", "doc": "

    Settings for molecular searching

    \n\n

    These are used to generate the database entries, do not change.

    \n\n
    Attributes
    \n\n
      \n
    • usedAtoms (dict, optional):\nDictionary of atoms and ranges. Default is {'C': (1, 90), 'H': (4, 200), 'O': (0, 12), 'N': (0, 0), 'S': (0, 0), 'P': (0, 0), 'Cl': (0, 0)}.
    • \n
    • min_mz (float, optional):\nMinimum m/z to use for searching. Default is 50.0.
    • \n
    • max_mz (float, optional):\nMaximum m/z to use for searching. Default is 1200.0.
    • \n
    • min_dbe (float, optional):\nMinimum double bond equivalent to use for searching. Default is 0.
    • \n
    • max_dbe (float, optional):\nMaximum double bond equivalent to use for searching. Default is 50.
    • \n
    • use_pah_line_rule (bool, optional):\nIf True, use the PAH line rule. Default is False.
    • \n
    • isRadical (bool, optional):\nIf True, search for radical ions. Default is True.
    • \n
    • isProtonated (bool, optional):\nIf True, search for protonated ions. Default is True.
    • \n
    • min_op_filter (float, optional):\nMinimum oxygen to phosphorous ratio. Default is 2.
    • \n
    • min_hc_filter (float, optional):\nMinimum hydrogen to carbon ratio. Default is 0.3.
    • \n
    • min_oc_filter (float, optional):\nMinimum oxygen to carbon ratio. Default is 1.2.
    • \n
    • max_oc_filter (float, optional):\nMaximum oxygen to carbon ratio. Default is 0.0.
    • \n
    • url_database (str, optional):\nURL for the database. Default is None.
    • \n
    • db_jobs (int, optional):\nNumber of jobs to use for database queries. Default is 1.
    • \n
    • used_atom_valences (dict, optional):\nDictionary of atoms and valences. Default is {'C': 4, '13C': 4, 'H': 1, 'O': 2, '18O': 2, 'N': 3, 'S': 2, '34S': 2, 'P': 3, 'Cl': 1, '37Cl': 1, 'Br': 1, 'Na': 1, 'F': 1, 'K': 0}.
    • \n
    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularLookupDictSettings.usedAtoms", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularLookupDictSettings.usedAtoms", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularLookupDictSettings.min_mz", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularLookupDictSettings.min_mz", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularLookupDictSettings.max_mz", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularLookupDictSettings.max_mz", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularLookupDictSettings.min_dbe", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularLookupDictSettings.min_dbe", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularLookupDictSettings.max_dbe", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularLookupDictSettings.max_dbe", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularLookupDictSettings.use_pah_line_rule", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularLookupDictSettings.use_pah_line_rule", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularLookupDictSettings.isRadical", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularLookupDictSettings.isRadical", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularLookupDictSettings.isProtonated", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularLookupDictSettings.isProtonated", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularLookupDictSettings.min_op_filter", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularLookupDictSettings.min_op_filter", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularLookupDictSettings.min_hc_filter", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularLookupDictSettings.min_hc_filter", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularLookupDictSettings.min_oc_filter", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularLookupDictSettings.min_oc_filter", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularLookupDictSettings.max_oc_filter", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularLookupDictSettings.max_oc_filter", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularLookupDictSettings.url_database", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularLookupDictSettings.url_database", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularLookupDictSettings.db_jobs", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularLookupDictSettings.db_jobs", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularLookupDictSettings.used_atom_valences", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularLookupDictSettings.used_atom_valences", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings", "kind": "class", "doc": "

    Settings for molecular searching

    \n\n
    Attributes
    \n\n
      \n
    • use_isotopologue_filter (bool, optional):\nIf True, use isotopologue filter. Default is False.
    • \n
    • isotopologue_filter_threshold (float, optional):\nThreshold for isotopologue filter. Default is 33.
    • \n
    • isotopologue_filter_atoms (tuple, optional):\nTuple of atoms to use for isotopologue filter. Default is ('Cl', 'Br').
    • \n
    • use_runtime_kendrick_filter (bool, optional):\nIf True, use runtime Kendrick filter. Default is False.
    • \n
    • use_min_peaks_filter (bool, optional):\nIf True, use minimum peaks filter. Default is True.
    • \n
    • min_peaks_per_class (int, optional):\nMinimum number of peaks per class. Default is 15.
    • \n
    • url_database (str, optional):\nURL for the database. Default is 'postgresql+psycopg2://coremsappdb:coremsapppnnl@localhost:5432/coremsapp'.
    • \n
    • db_jobs (int, optional):\nNumber of jobs to use for database queries. Default is 3.
    • \n
    • db_chunk_size (int, optional):\nChunk size to use for database queries. Default is 300.
    • \n
    • ion_charge (int, optional):\nIon charge. Default is -1.
    • \n
    • min_hc_filter (float, optional):\nMinimum hydrogen to carbon ratio. Default is 0.3.
    • \n
    • max_hc_filter (float, optional):\nMaximum hydrogen to carbon ratio. Default is 3.
    • \n
    • min_oc_filter (float, optional):\nMinimum oxygen to carbon ratio. Default is 0.0.
    • \n
    • max_oc_filter (float, optional):\nMaximum oxygen to carbon ratio. Default is 1.2.
    • \n
    • min_op_filter (float, optional):\nMinimum oxygen to phosphorous ratio. Default is 2.
    • \n
    • use_pah_line_rule (bool, optional):\nIf True, use the PAH line rule. Default is False.
    • \n
    • min_dbe (float, optional):\nMinimum double bond equivalent to use for searching. Default is 0.
    • \n
    • max_dbe (float, optional):\nMaximum double bond equivalent to use for searching. Default is 40.
    • \n
    • mz_error_score_weight (float, optional):\nWeight for m/z error score to contribute to composite score. Default is 0.6.
    • \n
    • isotopologue_score_weight (float, optional):\nWeight for isotopologue score to contribute to composite score. Default is 0.4.
    • \n
    • adduct_atoms_neg (tuple, optional):\nTuple of atoms to use in negative polarity. Default is ('Cl', 'Br').
    • \n
    • adduct_atoms_pos (tuple, optional):\nTuple of atoms to use in positive polarity. Default is ('Na', 'K').
    • \n
    • score_methods (tuple, optional):\nTuple of score method that can be implemented. \nDefault is ('S_P_lowest_error', 'N_S_P_lowest_error', 'lowest_error', 'prob_score', 'air_filter_error', 'water_filter_error', 'earth_filter_error').
    • \n
    • score_method (str, optional):\nScore method to use. Default is 'prob_score'. Options are 'S_P_lowest_error', 'N_S_P_lowest_error', 'lowest_error', 'prob_score', 'air_filter_error', 'water_filter_error', 'earth_filter_error'.
    • \n
    • output_min_score (float, optional):\nMinimum score for output. Default is 0.1.
    • \n
    • output_score_method (str, optional):\nScore method to use for output. Default is 'All Candidates'.
    • \n
    • output_min_score (float, optional):\nMinimum score for output. Default is 0.1.
    • \n
    • isRadical (bool, optional):\nIf True, search for radical ions. Default is False.
    • \n
    • isProtonated (bool, optional):\nIf True, search for protonated ions. Default is True.
    • \n
    • isAdduct (bool, optional):\nIf True, search for adduct ions. Default is False.
    • \n
    • usedAtoms (dict, optional):\nDictionary of atoms and ranges. Default is {'C': (1, 90), 'H': (4, 200), 'O': (0, 12), 'N': (0, 0), 'S': (0, 0), 'P': (0, 0), 'Cl': (0, 0)}.
    • \n
    • ionization_type (str, optional):\nIonization type. Default is 'ESI'.
    • \n
    • min_ppm_error (float, optional):\nMinimum ppm error. Default is -10.0.
    • \n
    • max_ppm_error (float, optional):\nMaximum ppm error. Default is 10.0.
    • \n
    • min_abun_error (float, optional):\nMinimum abundance error for isotolopologue search. Default is -100.0.
    • \n
    • max_abun_error (float, optional):\nMaximum abundance error for isotolopologue search. Default is 100.0.
    • \n
    • mz_error_range (float, optional):\nm/z error range. Default is 1.5.
    • \n
    • error_method (str, optional):\nError method. Default is 'None'. Options are 'distance', 'lowest', 'symmetrical','average' 'None'.
    • \n
    • mz_error_average (float, optional):\nm/z error average. Default is 0.0.
    • \n
    • used_atom_valences (dict, optional):\nDictionary of atoms and valences. Default is {'C': 4, '13C': 4, 'H': 1, 'O': 2, '18O': 2, 'N': 3, 'S': 2, '34S': 2, 'P': 3, 'Cl': 1, '37Cl': 1, 'Br': 1, 'Na': 1, 'F': 1, 'K': 0}.
    • \n
    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.__init__", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tuse_isotopologue_filter: bool = False,\tisotopologue_filter_threshold: float = 33,\tisotopologue_filter_atoms: tuple = ('Cl', 'Br'),\tuse_runtime_kendrick_filter: bool = False,\tuse_min_peaks_filter: bool = True,\tmin_peaks_per_class: int = 15,\turl_database: str = 'postgresql+psycopg2://coremsappdb:coremsapppnnl@localhost:5432/coremsapp',\tdb_jobs: int = 3,\tdb_chunk_size: int = 300,\tion_charge: int = -1,\tmin_hc_filter: float = 0.3,\tmax_hc_filter: float = 3,\tmin_oc_filter: float = 0.0,\tmax_oc_filter: float = 1.2,\tmin_op_filter: float = 2,\tuse_pah_line_rule: bool = False,\tmin_dbe: float = 0,\tmax_dbe: float = 40,\tmz_error_score_weight: float = 0.6,\tisotopologue_score_weight: float = 0.4,\tadduct_atoms_neg: tuple = ('Cl', 'Br'),\tadduct_atoms_pos: tuple = ('Na', 'K'),\tscore_methods: tuple = ('S_P_lowest_error', 'N_S_P_lowest_error', 'lowest_error', 'prob_score', 'air_filter_error', 'water_filter_error', 'earth_filter_error'),\tscore_method: str = 'prob_score',\toutput_min_score: float = 0.1,\toutput_score_method: str = 'All Candidates',\tisRadical: bool = False,\tisProtonated: bool = True,\tisAdduct: bool = False,\tusedAtoms: dict = <factory>,\tionization_type: str = 'ESI',\tmin_ppm_error: float = -10.0,\tmax_ppm_error: float = 10.0,\tmin_abun_error: float = -100.0,\tmax_abun_error: float = 100.0,\tmz_error_range: float = 1.5,\terror_method: str = 'None',\tmz_error_average: float = 0.0,\tused_atom_valences: dict = <factory>)"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.use_isotopologue_filter", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.use_isotopologue_filter", "kind": "variable", "doc": "

    \n", "annotation": ": bool", "default_value": "False"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.isotopologue_filter_threshold", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.isotopologue_filter_threshold", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "33"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.isotopologue_filter_atoms", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.isotopologue_filter_atoms", "kind": "variable", "doc": "

    \n", "annotation": ": tuple", "default_value": "('Cl', 'Br')"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.use_runtime_kendrick_filter", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.use_runtime_kendrick_filter", "kind": "variable", "doc": "

    \n", "annotation": ": bool", "default_value": "False"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.use_min_peaks_filter", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.use_min_peaks_filter", "kind": "variable", "doc": "

    \n", "annotation": ": bool", "default_value": "True"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.min_peaks_per_class", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.min_peaks_per_class", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "15"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.url_database", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.url_database", "kind": "variable", "doc": "

    \n", "annotation": ": str", "default_value": "'postgresql+psycopg2://coremsappdb:coremsapppnnl@localhost:5432/coremsapp'"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.db_jobs", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.db_jobs", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "3"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.db_chunk_size", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.db_chunk_size", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "300"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.ion_charge", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.ion_charge", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "-1"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.min_hc_filter", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.min_hc_filter", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.3"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.max_hc_filter", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.max_hc_filter", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "3"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.min_oc_filter", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.min_oc_filter", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.0"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.max_oc_filter", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.max_oc_filter", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "1.2"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.min_op_filter", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.min_op_filter", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "2"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.use_pah_line_rule", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.use_pah_line_rule", "kind": "variable", "doc": "

    \n", "annotation": ": bool", "default_value": "False"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.min_dbe", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.min_dbe", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.max_dbe", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.max_dbe", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "40"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.mz_error_score_weight", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.mz_error_score_weight", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.6"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.isotopologue_score_weight", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.isotopologue_score_weight", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.4"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.adduct_atoms_neg", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.adduct_atoms_neg", "kind": "variable", "doc": "

    \n", "annotation": ": tuple", "default_value": "('Cl', 'Br')"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.adduct_atoms_pos", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.adduct_atoms_pos", "kind": "variable", "doc": "

    \n", "annotation": ": tuple", "default_value": "('Na', 'K')"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.score_methods", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.score_methods", "kind": "variable", "doc": "

    \n", "annotation": ": tuple", "default_value": "('S_P_lowest_error', 'N_S_P_lowest_error', 'lowest_error', 'prob_score', 'air_filter_error', 'water_filter_error', 'earth_filter_error')"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.score_method", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.score_method", "kind": "variable", "doc": "

    \n", "annotation": ": str", "default_value": "'prob_score'"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.output_min_score", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.output_min_score", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.1"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.output_score_method", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.output_score_method", "kind": "variable", "doc": "

    \n", "annotation": ": str", "default_value": "'All Candidates'"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.isRadical", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.isRadical", "kind": "variable", "doc": "

    \n", "annotation": ": bool", "default_value": "False"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.isProtonated", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.isProtonated", "kind": "variable", "doc": "

    \n", "annotation": ": bool", "default_value": "True"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.isAdduct", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.isAdduct", "kind": "variable", "doc": "

    \n", "annotation": ": bool", "default_value": "False"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.usedAtoms", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.usedAtoms", "kind": "variable", "doc": "

    \n", "annotation": ": dict"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.ionization_type", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.ionization_type", "kind": "variable", "doc": "

    \n", "annotation": ": str", "default_value": "'ESI'"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.min_ppm_error", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.min_ppm_error", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "-10.0"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.max_ppm_error", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.max_ppm_error", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "10.0"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.min_abun_error", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.min_abun_error", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "-100.0"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.max_abun_error", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.max_abun_error", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "100.0"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.mz_error_range", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.mz_error_range", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "1.5"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.error_method", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.error_method", "kind": "variable", "doc": "

    \n", "annotation": ": str", "default_value": "'None'"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.mz_error_average", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.mz_error_average", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.0"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.used_atom_valences", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.used_atom_valences", "kind": "variable", "doc": "

    \n", "annotation": ": dict"}, {"fullname": "corems.encapsulation.input", "modulename": "corems.encapsulation.input", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.encapsulation.input.parameter_from_json", "modulename": "corems.encapsulation.input.parameter_from_json", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.encapsulation.input.parameter_from_json.load_and_set_toml_parameters_ms", "modulename": "corems.encapsulation.input.parameter_from_json", "qualname": "load_and_set_toml_parameters_ms", "kind": "function", "doc": "

    Load parameters from a toml file and set the parameters in the mass_spec_obj

    \n\n
    Parameters
    \n\n
      \n
    • mass_spec_obj (MassSpectrum):\ncorems MassSpectrum object
    • \n
    • parameters_path (str, optional):\npath to the parameters file, by default False
    • \n
    \n\n
    Raises
    \n\n
      \n
    • FileNotFoundError: if the file is not found
    • \n
    \n", "signature": "(mass_spec_obj, parameters_path=False):", "funcdef": "def"}, {"fullname": "corems.encapsulation.input.parameter_from_json.load_and_set_parameters_ms", "modulename": "corems.encapsulation.input.parameter_from_json", "qualname": "load_and_set_parameters_ms", "kind": "function", "doc": "

    Load parameters from a json file and set the parameters in the mass_spec_obj

    \n\n
    Parameters
    \n\n
      \n
    • mass_spec_obj (MassSpectrum):\ncorems MassSpectrum object
    • \n
    • parameters_path (str, optional):\npath to the parameters file, by default False
    • \n
    \n\n
    Raises
    \n\n
      \n
    • FileNotFoundError: if the file is not found
    • \n
    \n", "signature": "(mass_spec_obj, parameters_path=False):", "funcdef": "def"}, {"fullname": "corems.encapsulation.input.parameter_from_json.load_and_set_toml_parameters_gcms", "modulename": "corems.encapsulation.input.parameter_from_json", "qualname": "load_and_set_toml_parameters_gcms", "kind": "function", "doc": "

    Load parameters from a toml file and set the parameters in the GCMS object

    \n\n
    Parameters
    \n\n
      \n
    • gcms_obj (GCMSBase):\ncorems GCMSBase object
    • \n
    • parameters_path (str, optional):\npath to the parameters file, by default False
    • \n
    \n\n
    Raises
    \n\n
      \n
    • FileNotFoundError: if the file is not found
    • \n
    \n", "signature": "(gcms_obj, parameters_path=False):", "funcdef": "def"}, {"fullname": "corems.encapsulation.input.parameter_from_json.load_and_set_parameters_gcms", "modulename": "corems.encapsulation.input.parameter_from_json", "qualname": "load_and_set_parameters_gcms", "kind": "function", "doc": "

    Load parameters from a json file and set the parameters in the GCMS object

    \n\n
    Parameters
    \n\n
      \n
    • gcms_obj (GCMSBase):\ncorems GCMSBase object
    • \n
    • parameters_path (str, optional):\npath to the parameters file, by default False
    • \n
    \n\n
    Raises
    \n\n
      \n
    • FileNotFoundError: if the file is not found
    • \n
    \n", "signature": "(gcms_obj, parameters_path=False):", "funcdef": "def"}, {"fullname": "corems.encapsulation.input.parameter_from_json.load_and_set_toml_parameters_class", "modulename": "corems.encapsulation.input.parameter_from_json", "qualname": "load_and_set_toml_parameters_class", "kind": "function", "doc": "

    Load parameters from a toml file and set the parameters in the instance_parameters_class

    \n\n
    Parameters
    \n\n
      \n
    • parameter_label (str):\nlabel of the parameters in the toml file
    • \n
    • instance_parameters_class (object):\ninstance of the parameters class
    • \n
    • parameters_path (str, optional):\npath to the parameters file, by default False
    • \n
    \n\n
    Raises
    \n\n
      \n
    • FileNotFoundError: if the file is not found
    • \n
    \n\n
    Returns
    \n\n
      \n
    • object: instance of the parameters class
    • \n
    \n", "signature": "(parameter_label, instance_parameters_class, parameters_path=False):", "funcdef": "def"}, {"fullname": "corems.encapsulation.input.parameter_from_json.load_and_set_parameters_class", "modulename": "corems.encapsulation.input.parameter_from_json", "qualname": "load_and_set_parameters_class", "kind": "function", "doc": "

    Load parameters from a json file and set the parameters in the instance_parameters_class

    \n\n
    Parameters
    \n\n
      \n
    • parameter_label (str):\nlabel of the parameters in the json file
    • \n
    • instance_parameters_class (object):\ninstance of the parameters class
    • \n
    • parameters_path (str, optional):\npath to the parameters file, by default False
    • \n
    \n\n
    Raises
    \n\n
      \n
    • FileNotFoundError: if the file is not found
    • \n
    \n\n
    Returns
    \n\n
      \n
    • object: instance of the parameters class
    • \n
    \n", "signature": "(parameter_label, instance_parameters_class, parameters_path=False):", "funcdef": "def"}, {"fullname": "corems.encapsulation.output", "modulename": "corems.encapsulation.output", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.encapsulation.output.parameter_to_dict", "modulename": "corems.encapsulation.output.parameter_to_dict", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.encapsulation.output.parameter_to_dict.get_dict_all_default_data", "modulename": "corems.encapsulation.output.parameter_to_dict", "qualname": "get_dict_all_default_data", "kind": "function", "doc": "

    Return a dictionary with all default parameters for MS and GCMS

    \n", "signature": "():", "funcdef": "def"}, {"fullname": "corems.encapsulation.output.parameter_to_dict.get_dict_data_ms", "modulename": "corems.encapsulation.output.parameter_to_dict", "qualname": "get_dict_data_ms", "kind": "function", "doc": "

    Return a dictionary with all parameters for MS

    \n", "signature": "(mass_spec):", "funcdef": "def"}, {"fullname": "corems.encapsulation.output.parameter_to_dict.get_dict_ms_default_data", "modulename": "corems.encapsulation.output.parameter_to_dict", "qualname": "get_dict_ms_default_data", "kind": "function", "doc": "

    Return a dictionary with all default parameters for MS including data input

    \n", "signature": "():", "funcdef": "def"}, {"fullname": "corems.encapsulation.output.parameter_to_dict.get_dict_gcms_default_data", "modulename": "corems.encapsulation.output.parameter_to_dict", "qualname": "get_dict_gcms_default_data", "kind": "function", "doc": "

    Return a dictionary with all default parameters for GCMS

    \n", "signature": "():", "funcdef": "def"}, {"fullname": "corems.encapsulation.output.parameter_to_dict.get_dict_data_gcms", "modulename": "corems.encapsulation.output.parameter_to_dict", "qualname": "get_dict_data_gcms", "kind": "function", "doc": "

    Return a dictionary with all parameters for GCMS

    \n", "signature": "(gcms):", "funcdef": "def"}, {"fullname": "corems.encapsulation.output.parameter_to_json", "modulename": "corems.encapsulation.output.parameter_to_json", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.encapsulation.output.parameter_to_json.dump_all_settings_json", "modulename": "corems.encapsulation.output.parameter_to_json", "qualname": "dump_all_settings_json", "kind": "function", "doc": "

    Write JSON file into current directory with all the default settings for the CoreMS package.

    \n\n

    Parameters:

    \n\n

    filename : str, optional\n The name of the JSON file to be created. Default is 'SettingsCoreMS.json'.\nfile_path : str or Path, optional\n The path where the JSON file will be saved. If not provided, the file will be saved in the current working directory.

    \n", "signature": "(filename='SettingsCoreMS.json', file_path=None):", "funcdef": "def"}, {"fullname": "corems.encapsulation.output.parameter_to_json.dump_ms_settings_json", "modulename": "corems.encapsulation.output.parameter_to_json", "qualname": "dump_ms_settings_json", "kind": "function", "doc": "

    Write JSON file into current directory with all the mass spectrum default settings for the CoreMS package.

    \n\n
    Parameters
    \n\n
      \n
    • filename (str, optional):\nThe name of the JSON file to be created. Default is 'SettingsCoreMS.json'.
    • \n
    • file_path (str or Path, optional):\nThe path where the JSON file will be saved. If not provided, the file will be saved in the current working directory.
    • \n
    \n", "signature": "(filename='SettingsCoreMS.json', file_path=None):", "funcdef": "def"}, {"fullname": "corems.encapsulation.output.parameter_to_json.dump_gcms_settings_json", "modulename": "corems.encapsulation.output.parameter_to_json", "qualname": "dump_gcms_settings_json", "kind": "function", "doc": "

    Write JSON file into current directory containing the default GCMS settings data.

    \n\n
    Parameters
    \n\n
      \n
    • filename (str, optional):\nThe name of the JSON file to be created. Default is 'SettingsCoreMS.json'.
    • \n
    • file_path (str or Path-like object, optional):\nThe path where the JSON file will be saved. If not provided, the file will be saved in the current working directory.
    • \n
    \n", "signature": "(filename='SettingsCoreMS.json', file_path=None):", "funcdef": "def"}, {"fullname": "corems.encapsulation.output.parameter_to_json.dump_all_settings_toml", "modulename": "corems.encapsulation.output.parameter_to_json", "qualname": "dump_all_settings_toml", "kind": "function", "doc": "

    Write TOML file into the specified file path or the current directory with all the default settings for the CoreMS package.

    \n\n
    Parameters
    \n\n
      \n
    • filename (str, optional):\nThe name of the TOML file. Defaults to 'SettingsCoreMS.toml'.
    • \n
    • file_path (str or Path, optional):\nThe path where the TOML file will be saved. If not provided, the file will be saved in the current directory.
    • \n
    \n", "signature": "(filename='SettingsCoreMS.toml', file_path=None):", "funcdef": "def"}, {"fullname": "corems.encapsulation.output.parameter_to_json.dump_ms_settings_toml", "modulename": "corems.encapsulation.output.parameter_to_json", "qualname": "dump_ms_settings_toml", "kind": "function", "doc": "

    Write TOML file into the current directory with all the mass spectrum default settings for the CoreMS package.

    \n\n
    Parameters
    \n\n
      \n
    • filename (str, optional):\nThe name of the TOML file to be created. Default is 'SettingsCoreMS.toml'.
    • \n
    • file_path (str or Path, optional):\nThe path where the TOML file should be saved. If not provided, the file will be saved in the current working directory.
    • \n
    \n", "signature": "(filename='SettingsCoreMS.toml', file_path=None):", "funcdef": "def"}, {"fullname": "corems.encapsulation.output.parameter_to_json.dump_gcms_settings_toml", "modulename": "corems.encapsulation.output.parameter_to_json", "qualname": "dump_gcms_settings_toml", "kind": "function", "doc": "

    Write TOML file into current directory containing the default GCMS settings data.

    \n\n
    Parameters
    \n\n
      \n
    • filename (str, optional):\nThe name of the TOML file. Defaults to 'SettingsCoreMS.toml'.
    • \n
    • file_path (str or Path, optional):\nThe path where the TOML file will be saved. If not provided, the file will be saved in the current working directory.
    • \n
    \n", "signature": "(filename='SettingsCoreMS.toml', file_path=None):", "funcdef": "def"}, {"fullname": "corems.mass_spectra", "modulename": "corems.mass_spectra", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc", "modulename": "corems.mass_spectra.calc", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc.GC_Calc", "modulename": "corems.mass_spectra.calc.GC_Calc", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc.GC_Calc.GC_Calculations", "modulename": "corems.mass_spectra.calc.GC_Calc", "qualname": "GC_Calculations", "kind": "class", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc.GC_Calc.GC_Calculations.calibrate_ri", "modulename": "corems.mass_spectra.calc.GC_Calc", "qualname": "GC_Calculations.calibrate_ri", "kind": "function", "doc": "

    \n", "signature": "(self, ref_dict, cal_file_path):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.GC_Calc.GC_Calculations.smooth_tic", "modulename": "corems.mass_spectra.calc.GC_Calc", "qualname": "GC_Calculations.smooth_tic", "kind": "function", "doc": "

    \n", "signature": "(self, tic):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.GC_Calc.GC_Calculations.centroid_detector", "modulename": "corems.mass_spectra.calc.GC_Calc", "qualname": "GC_Calculations.centroid_detector", "kind": "function", "doc": "

    \n", "signature": "(self, tic, rt):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.GC_Calc.GC_Calculations.remove_outliers", "modulename": "corems.mass_spectra.calc.GC_Calc", "qualname": "GC_Calculations.remove_outliers", "kind": "function", "doc": "

    \n", "signature": "(self, data):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.GC_Deconvolution", "modulename": "corems.mass_spectra.calc.GC_Deconvolution", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc.GC_Deconvolution.MassDeconvolution", "modulename": "corems.mass_spectra.calc.GC_Deconvolution", "qualname": "MassDeconvolution", "kind": "class", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc.GC_Deconvolution.MassDeconvolution.run_deconvolution", "modulename": "corems.mass_spectra.calc.GC_Deconvolution", "qualname": "MassDeconvolution.run_deconvolution", "kind": "function", "doc": "

    \n", "signature": "(self, plot_res=False):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.GC_Deconvolution.MassDeconvolution.centroid_detector", "modulename": "corems.mass_spectra.calc.GC_Deconvolution", "qualname": "MassDeconvolution.centroid_detector", "kind": "function", "doc": "

    this function has been replaced with sp.peak_picking_first_derivative\nand it not used

    \n", "signature": "(self, tic, rt):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.GC_Deconvolution.MassDeconvolution.ion_extracted_chroma", "modulename": "corems.mass_spectra.calc.GC_Deconvolution", "qualname": "MassDeconvolution.ion_extracted_chroma", "kind": "function", "doc": "

    \n", "signature": "(self, mass_spectra_obj):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.GC_Deconvolution.MassDeconvolution.hc", "modulename": "corems.mass_spectra.calc.GC_Deconvolution", "qualname": "MassDeconvolution.hc", "kind": "function", "doc": "

    \n", "signature": "(self, X, Y, max_rt_distance=0.025):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.GC_Deconvolution.MassDeconvolution.find_peaks_entity", "modulename": "corems.mass_spectra.calc.GC_Deconvolution", "qualname": "MassDeconvolution.find_peaks_entity", "kind": "function", "doc": "

    combine eic with mathing rt apexes

    \n", "signature": "(self, eic_dict):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.GC_Deconvolution.MassDeconvolution.mass_spec_factory", "modulename": "corems.mass_spectra.calc.GC_Deconvolution", "qualname": "MassDeconvolution.mass_spec_factory", "kind": "function", "doc": "

    \n", "signature": "(self, rt, datadict):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.GC_Deconvolution.MassDeconvolution.smooth_signal", "modulename": "corems.mass_spectra.calc.GC_Deconvolution", "qualname": "MassDeconvolution.smooth_signal", "kind": "function", "doc": "

    \n", "signature": "(self, signal):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.GC_Deconvolution.MassDeconvolution.add_gcpeak", "modulename": "corems.mass_spectra.calc.GC_Deconvolution", "qualname": "MassDeconvolution.add_gcpeak", "kind": "function", "doc": "

    \n", "signature": "(\tself,\tnew_apex_index,\tstart_rt,\tfinal_rt,\tpeak_rt,\tsmoothed_tic,\tdatadict,\tplot_res):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.GC_Deconvolution.MassDeconvolution.deconvolution", "modulename": "corems.mass_spectra.calc.GC_Deconvolution", "qualname": "MassDeconvolution.deconvolution", "kind": "function", "doc": "

    \n", "signature": "(self, peaks_entity_data, plot_res):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.GC_Deconvolution.MassDeconvolution.quadratic_interpolation", "modulename": "corems.mass_spectra.calc.GC_Deconvolution", "qualname": "MassDeconvolution.quadratic_interpolation", "kind": "function", "doc": "

    \n", "signature": "(self, rt_list, tic_list, apex_index):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.GC_RI_Calibration", "modulename": "corems.mass_spectra.calc.GC_RI_Calibration", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc.GC_RI_Calibration.get_rt_ri_pairs", "modulename": "corems.mass_spectra.calc.GC_RI_Calibration", "qualname": "get_rt_ri_pairs", "kind": "function", "doc": "

    \n", "signature": "(gcms_ref_obj, sql_obj=None):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.LC_Calc", "modulename": "corems.mass_spectra.calc.LC_Calc", "kind": "module", "doc": "

    Created on Jun 14, 2019

    \n\n

    @author: eber373

    \n"}, {"fullname": "corems.mass_spectra.calc.LC_Calc.LC_Calculations", "modulename": "corems.mass_spectra.calc.LC_Calc", "qualname": "LC_Calculations", "kind": "class", "doc": "

    classdocs

    \n"}, {"fullname": "corems.mass_spectra.calc.LC_Calc.LC_Calculations.get_max_eic", "modulename": "corems.mass_spectra.calc.LC_Calc", "qualname": "LC_Calculations.get_max_eic", "kind": "function", "doc": "

    \n", "signature": "(eic_data: dict):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.LC_Calc.LC_Calculations.smooth_tic", "modulename": "corems.mass_spectra.calc.LC_Calc", "qualname": "LC_Calculations.smooth_tic", "kind": "function", "doc": "

    \n", "signature": "(self, tic):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.LC_Calc.LC_Calculations.eic_centroid_detector", "modulename": "corems.mass_spectra.calc.LC_Calc", "qualname": "LC_Calculations.eic_centroid_detector", "kind": "function", "doc": "

    \n", "signature": "(self, rt, eic, max_eic):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.LC_Calc.LC_Calculations.centroid_detector", "modulename": "corems.mass_spectra.calc.LC_Calc", "qualname": "LC_Calculations.centroid_detector", "kind": "function", "doc": "

    \n", "signature": "(self, rt, tic):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.LC_Calc.LC_Calculations.find_nearest_scan", "modulename": "corems.mass_spectra.calc.LC_Calc", "qualname": "LC_Calculations.find_nearest_scan", "kind": "function", "doc": "

    \n", "signature": "(self, rt):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.LF_Targeted", "modulename": "corems.mass_spectra.calc.LF_Targeted", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc.LF_Targeted.LossFinderTargeted", "modulename": "corems.mass_spectra.calc.LF_Targeted", "qualname": "LossFinderTargeted", "kind": "class", "doc": "

    \n", "bases": "corems.mass_spectra.calc.GC_Calc.GC_Calculations"}, {"fullname": "corems.mass_spectra.calc.LF_Targeted.LossFinderTargeted.__init__", "modulename": "corems.mass_spectra.calc.LF_Targeted", "qualname": "LossFinderTargeted.__init__", "kind": "function", "doc": "

    \n", "signature": "(ref_file='Unknown', noise_cutoff='Unknown', tolerance='Unknown')"}, {"fullname": "corems.mass_spectra.calc.LF_Targeted.LossFinderTargeted.tolerance", "modulename": "corems.mass_spectra.calc.LF_Targeted", "qualname": "LossFinderTargeted.tolerance", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc.LF_Targeted.LossFinderTargeted.noise_cutoff", "modulename": "corems.mass_spectra.calc.LF_Targeted", "qualname": "LossFinderTargeted.noise_cutoff", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc.LF_Targeted.LossFinderTargeted.offset_hits", "modulename": "corems.mass_spectra.calc.LF_Targeted", "qualname": "LossFinderTargeted.offset_hits", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc.LF_Targeted.LossFinderTargeted.mz_filtered", "modulename": "corems.mass_spectra.calc.LF_Targeted", "qualname": "LossFinderTargeted.mz_filtered", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc.LF_Targeted.LossFinderTargeted.abund_filtered", "modulename": "corems.mass_spectra.calc.LF_Targeted", "qualname": "LossFinderTargeted.abund_filtered", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc.LF_Targeted.LossFinderTargeted.mz_count", "modulename": "corems.mass_spectra.calc.LF_Targeted", "qualname": "LossFinderTargeted.mz_count", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc.LF_Targeted.LossFinderTargeted.ms_info_get", "modulename": "corems.mass_spectra.calc.LF_Targeted", "qualname": "LossFinderTargeted.ms_info_get", "kind": "function", "doc": "

    \n", "signature": "(self, mass_spectra_obj):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.LF_Targeted.LossFinderTargeted.loss_ref_get", "modulename": "corems.mass_spectra.calc.LF_Targeted", "qualname": "LossFinderTargeted.loss_ref_get", "kind": "function", "doc": "

    \n", "signature": "(self, file_location, tolerance):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.LF_Targeted.LossFinderTargeted.threshold_filter", "modulename": "corems.mass_spectra.calc.LF_Targeted", "qualname": "LossFinderTargeted.threshold_filter", "kind": "function", "doc": "

    \n", "signature": "(self, mz_dict, Intensity, noise_cutoff):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.LF_Targeted.LossFinderTargeted.mz_pair_checker", "modulename": "corems.mass_spectra.calc.LF_Targeted", "qualname": "LossFinderTargeted.mz_pair_checker", "kind": "function", "doc": "

    \n", "signature": "(self, chem, lower, upper, mz1, spectrum, Intensity, scan_number):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.LF_Targeted.LossFinderTargeted.findpeakoffset", "modulename": "corems.mass_spectra.calc.LF_Targeted", "qualname": "LossFinderTargeted.findpeakoffset", "kind": "function", "doc": "

    \n", "signature": "(self, range_ref, mz_filtered, abund_filtered):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.LF_Targeted.LossFinderTargeted.LF_out", "modulename": "corems.mass_spectra.calc.LF_Targeted", "qualname": "LossFinderTargeted.LF_out", "kind": "function", "doc": "

    \n", "signature": "(self, LF_dict, mz_count):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.LF_Targeted.LossFinderTargeted.plot_offset", "modulename": "corems.mass_spectra.calc.LF_Targeted", "qualname": "LossFinderTargeted.plot_offset", "kind": "function", "doc": "

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.MZSearch", "modulename": "corems.mass_spectra.calc.MZSearch", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc.MZSearch.SearchResults", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "SearchResults", "kind": "class", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc.MZSearch.SearchResults.__init__", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "SearchResults.__init__", "kind": "function", "doc": "

    \n", "signature": "(calculated_mz: float, exp_mz: float, error: float, tolerance: float)"}, {"fullname": "corems.mass_spectra.calc.MZSearch.SearchResults.calculated_mz", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "SearchResults.calculated_mz", "kind": "variable", "doc": "

    \n", "annotation": ": float"}, {"fullname": "corems.mass_spectra.calc.MZSearch.SearchResults.exp_mz", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "SearchResults.exp_mz", "kind": "variable", "doc": "

    \n", "annotation": ": float"}, {"fullname": "corems.mass_spectra.calc.MZSearch.SearchResults.error", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "SearchResults.error", "kind": "variable", "doc": "

    \n", "annotation": ": float"}, {"fullname": "corems.mass_spectra.calc.MZSearch.SearchResults.tolerance", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "SearchResults.tolerance", "kind": "variable", "doc": "

    \n", "annotation": ": float"}, {"fullname": "corems.mass_spectra.calc.MZSearch.MZSearch", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "MZSearch", "kind": "class", "doc": "

    A class that represents a thread of control.

    \n\n

    This class can be safely subclassed in a limited fashion. There are two ways\nto specify the activity: by passing a callable object to the constructor, or\nby overriding the run() method in a subclass.

    \n", "bases": "threading.Thread"}, {"fullname": "corems.mass_spectra.calc.MZSearch.MZSearch.__init__", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "MZSearch.__init__", "kind": "function", "doc": "
    Parameters
    \n\n
      \n
    • calculated_mzs ([float] calculated m/z):

    • \n
    • exp_mzs ([float] experimental m/z):

    • \n
    • method (string,):\nppm or ppb

    • \n
    • call run to trigger the m/z search algorithm
    • \n
    • or start if using it as thread
    • \n
    \n", "signature": "(\texp_mzs: List[float],\tcalculated_mzs: List[float],\ttolerance,\tmethod='ppm',\taverage_target_mz=True)"}, {"fullname": "corems.mass_spectra.calc.MZSearch.MZSearch.method", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "MZSearch.method", "kind": "variable", "doc": "

    method: string,\n ppm or ppb

    \n"}, {"fullname": "corems.mass_spectra.calc.MZSearch.MZSearch.results", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "MZSearch.results", "kind": "variable", "doc": "

    {calculated_mz: [SearchResults]}\ncontains the results of the search

    \n"}, {"fullname": "corems.mass_spectra.calc.MZSearch.MZSearch.averaged_target_mz", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "MZSearch.averaged_target_mz", "kind": "variable", "doc": "

    [float]\ncontains the average target m/z to be searched against

    \n"}, {"fullname": "corems.mass_spectra.calc.MZSearch.MZSearch.calculated_mzs", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "MZSearch.calculated_mzs", "kind": "variable", "doc": "

    [float]\ncontains the mz target to be searched against

    \n"}, {"fullname": "corems.mass_spectra.calc.MZSearch.MZSearch.exp_mzs", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "MZSearch.exp_mzs", "kind": "variable", "doc": "

    [float]\ncontains the exp mz to be searched against

    \n"}, {"fullname": "corems.mass_spectra.calc.MZSearch.MZSearch.tolerance", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "MZSearch.tolerance", "kind": "variable", "doc": "

    method: string,\n ppm or ppb

    \n"}, {"fullname": "corems.mass_spectra.calc.MZSearch.MZSearch.colapse_calculated", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "MZSearch.colapse_calculated", "kind": "function", "doc": "

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.MZSearch.MZSearch.run", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "MZSearch.run", "kind": "function", "doc": "

    Method representing the thread's activity.

    \n\n

    You may override this method in a subclass. The standard run() method\ninvokes the callable object passed to the object's constructor as the\ntarget argument, if any, with sequential and keyword arguments taken\nfrom the args and kwargs arguments, respectively.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.MZSearch.MZSearch.calc_mz_error", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "MZSearch.calc_mz_error", "kind": "function", "doc": "
    Parameters
    \n\n
      \n
    • calculated_mz (float,):

    • \n
    • exp_mz (float):

    • \n
    • method (string,):\nppm or ppb

    • \n
    \n", "signature": "(calculated_mz, exp_mz, method='ppm'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.MZSearch.MZSearch.check_ppm_error", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "MZSearch.check_ppm_error", "kind": "function", "doc": "

    \n", "signature": "(tolerance, error):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.MZSearch.MZSearch.get_nominal_exp", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "MZSearch.get_nominal_exp", "kind": "function", "doc": "

    \n", "signature": "(self, exp_mzs) -> dict:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.MZSearch.MZSearch.search_mz", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "MZSearch.search_mz", "kind": "function", "doc": "

    \n", "signature": "(self, results, dict_nominal_exp_mz, calculated_mz, offset) -> None:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.SignalProcessing", "modulename": "corems.mass_spectra.calc.SignalProcessing", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc.SignalProcessing.peak_detector", "modulename": "corems.mass_spectra.calc.SignalProcessing", "qualname": "peak_detector", "kind": "function", "doc": "

    \n", "signature": "(tic, max_tic):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.SignalProcessing.find_nearest_scan", "modulename": "corems.mass_spectra.calc.SignalProcessing", "qualname": "find_nearest_scan", "kind": "function", "doc": "

    \n", "signature": "(data, nodes):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.SignalProcessing.peak_picking_first_derivative", "modulename": "corems.mass_spectra.calc.SignalProcessing", "qualname": "peak_picking_first_derivative", "kind": "function", "doc": "

    \n", "signature": "(\tdomain,\tsignal,\tmax_height,\tmax_prominence,\tmax_signal,\tmin_peak_datapoints,\tpeak_derivative_thresould,\tsignal_threshold=0.1,\tcorrect_baseline=True,\tplot_res=False,\tabun_norm=100,\tcheck_abundance=False):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.SignalProcessing.find_minima", "modulename": "corems.mass_spectra.calc.SignalProcessing", "qualname": "find_minima", "kind": "function", "doc": "

    \n", "signature": "(index, tic, right=True):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.SignalProcessing.derivate", "modulename": "corems.mass_spectra.calc.SignalProcessing", "qualname": "derivate", "kind": "function", "doc": "

    \n", "signature": "(data_array):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.SignalProcessing.minima_detector", "modulename": "corems.mass_spectra.calc.SignalProcessing", "qualname": "minima_detector", "kind": "function", "doc": "

    \n", "signature": "(tic, max_tic, peak_height_max_percent, peak_max_prominence_percent):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.SignalProcessing.baseline_detector", "modulename": "corems.mass_spectra.calc.SignalProcessing", "qualname": "baseline_detector", "kind": "function", "doc": "

    \n", "signature": "(\ttic,\trt,\tpeak_height_max_percent,\tpeak_max_prominence_percent,\tdo_interpolation=True):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.SignalProcessing.peak_detector_generator", "modulename": "corems.mass_spectra.calc.SignalProcessing", "qualname": "peak_detector_generator", "kind": "function", "doc": "

    \n", "signature": "(\ttic,\tstds,\tmethod,\trt,\tmax_height,\tmin_height,\tmax_prominence,\tmin_datapoints):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.SignalProcessing.smooth_signal", "modulename": "corems.mass_spectra.calc.SignalProcessing", "qualname": "smooth_signal", "kind": "function", "doc": "

    smooth the data using a window with requested size.

    \n\n

    This method is based on the convolution of a scaled window with the signal.\nThe signal is prepared by introducing reflected copies of the signal \n(with the window size) in both ends so that transient parts are minimized\nin the begining and end part of the output signal.

    \n\n

    output:\n the smoothed signal

    \n\n

    see also:

    \n\n

    numpy.hanning, numpy.hamming, numpy.bartlett, numpy.blackman, numpy.convolve\nscipy.signal.savgol_filter

    \n", "signature": "(x, window_len, window, pol_order, implemented_smooth_method):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.SignalProcessing.second_derivative_threshold", "modulename": "corems.mass_spectra.calc.SignalProcessing", "qualname": "second_derivative_threshold", "kind": "function", "doc": "

    \n", "signature": "(tic, stds, rt, peak_height_max_percent, peak_max_prominence_percent):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory", "modulename": "corems.mass_spectra.factory", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class", "modulename": "corems.mass_spectra.factory.GC_Class", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase", "kind": "class", "doc": "

    Base class for GC-MS data processing.

    \n\n
    Parameters
    \n\n
      \n
    • file_location (str, pathlib.Path, or s3path.S3Path):\nPath object containing the file location.
    • \n
    • analyzer (str, optional):\nName of the analyzer. Defaults to 'Unknown'.
    • \n
    • instrument_label (str, optional):\nLabel of the instrument. Defaults to 'Unknown'.
    • \n
    • sample_name (str, optional):\nName of the sample. If not provided, it is derived from the file location.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • file_location (pathlib.Path):\nPath object containing the file location.
    • \n
    • sample_name (str):\nName of the sample.
    • \n
    • analyzer (str):\nName of the analyzer.
    • \n
    • instrument_label (str):\nLabel of the instrument.
    • \n
    • gcpeaks (list):\nList of GCPeak objects.
    • \n
    • ri_pairs_ref (None):\nReference retention index pairs.
    • \n
    • cal_file_path (None):\nCalibration file path.
    • \n
    • _parameters (GCMSParameters):\nGC-MS parameters.
    • \n
    • _retention_time_list (list):\nList of retention times.
    • \n
    • _scans_number_list (list):\nList of scan numbers.
    • \n
    • _tic_list (list):\nList of total ion chromatogram values.
    • \n
    • _ms (dict):\nDictionary containing all mass spectra.
    • \n
    • _processed_tic (list):\nList of processed total ion chromatogram values.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • process_chromatogram(plot_res=False). Process the chromatogram.
    • \n
    • plot_gc_peaks(ax=None, color='red'). Plot the GC peaks.
    • \n
    \n", "bases": "corems.mass_spectra.calc.GC_Calc.GC_Calculations, corems.mass_spectra.calc.GC_Deconvolution.MassDeconvolution"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.__init__", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tfile_location,\tanalyzer='Unknown',\tinstrument_label='Unknown',\tsample_name=None)"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.file_location", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.file_location", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.analyzer", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.analyzer", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.instrument_label", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.instrument_label", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.gcpeaks", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.gcpeaks", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.ri_pairs_ref", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.ri_pairs_ref", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.cal_file_path", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.cal_file_path", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.process_chromatogram", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.process_chromatogram", "kind": "function", "doc": "

    Process the chromatogram.

    \n\n

    This method processes the chromatogram.

    \n\n
    Parameters
    \n\n
      \n
    • plot_res (bool, optional):\nIf True, plot the results. Defaults to False.
    • \n
    \n", "signature": "(self, plot_res=False):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.add_mass_spectrum", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.add_mass_spectrum", "kind": "function", "doc": "

    Add a mass spectrum to the GC-MS object.

    \n\n

    This method adds a mass spectrum to the GC-MS object.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spec (MassSpectrum):\nMass spectrum to be added.
    • \n
    \n", "signature": "(self, mass_spec):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.set_tic_list_from_data", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.set_tic_list_from_data", "kind": "function", "doc": "

    Set the total ion chromatogram list from the mass spectra data within the GC-MS data object.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.set_retention_time_from_data", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.set_retention_time_from_data", "kind": "function", "doc": "

    Set the retention time list from the mass spectra data within the GC-MS data object.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.set_scans_number_from_data", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.set_scans_number_from_data", "kind": "function", "doc": "

    Set the scan number list from the mass spectra data within the GC-MS data object.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.parameter", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.parameter", "kind": "variable", "doc": "

    GCMS Parameters

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.molecular_search_settings", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.molecular_search_settings", "kind": "variable", "doc": "

    Molecular Search Settings

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.chromatogram_settings", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.chromatogram_settings", "kind": "variable", "doc": "

    Chromatogram Settings

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.scans_number", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.scans_number", "kind": "variable", "doc": "

    Scans Number

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.retention_time", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.retention_time", "kind": "variable", "doc": "

    Retention Time

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.processed_tic", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.processed_tic", "kind": "variable", "doc": "

    Processed Total Ion Current

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.tic", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.tic", "kind": "variable", "doc": "

    Total Ion Current

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.max_tic", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.max_tic", "kind": "variable", "doc": "

    Maximum Total Ion Current

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.min_tic", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.min_tic", "kind": "variable", "doc": "

    Minimum Total Ion Current

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.dynamic_range", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.dynamic_range", "kind": "variable", "doc": "

    Dynamic Range of the Total Ion Current

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.matched_peaks", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.matched_peaks", "kind": "variable", "doc": "

    Matched Peaks

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.sorted_gcpeaks", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.sorted_gcpeaks", "kind": "variable", "doc": "

    Sorted GC Peaks, by retention time

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.unique_metabolites", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.unique_metabolites", "kind": "variable", "doc": "

    Unique Metabolites

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.metabolites_data", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.metabolites_data", "kind": "variable", "doc": "

    Metabolites Data

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.no_matched_peaks", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.no_matched_peaks", "kind": "variable", "doc": "

    Peaks with no Matched Metabolites

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.plot_gc_peaks", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.plot_gc_peaks", "kind": "function", "doc": "

    Plot the GC peaks.

    \n\n

    This method plots the GC peaks.

    \n\n
    Parameters
    \n\n
      \n
    • ax (matplotlib.axes.Axes, optional):\nAxes object to plot the GC peaks. Defaults to None.
    • \n
    • color (str, optional):\nColor of the GC peaks. Defaults to 'red'.
    • \n
    \n", "signature": "(self, ax=None, color='red'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.to_excel", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.to_excel", "kind": "function", "doc": "

    Export the GC-MS data to an Excel file.

    \n\n

    This method exports the GC-MS data to an Excel file.

    \n\n
    Parameters
    \n\n
      \n
    • out_file_path (str, pathlib.Path, or s3path.S3Path):\nPath object containing the file location.
    • \n
    • write_mode (str, optional):\nWrite mode. Defaults to 'ab'.
    • \n
    • write_metadata (bool, optional):\nIf True, write the metadata. Defaults to True.
    • \n
    • id_label (str, optional):\nLabel of the ID. Defaults to 'corems:'.
    • \n
    \n", "signature": "(\tself,\tout_file_path,\twrite_mode='ab',\twrite_metadata=True,\tid_label='corems:'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.to_csv", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.to_csv", "kind": "function", "doc": "

    Export the GC-MS data to a CSV file.

    \n\n
    Parameters
    \n\n
      \n
    • out_file_path (str, pathlib.Path, or s3path.S3Path):\nPath object containing the file location.
    • \n
    • separate_output (bool, optional):\nIf True, separate the output. Defaults to False.
    • \n
    • write_metadata (bool, optional):\nIf True, write the metadata. Defaults to True.
    • \n
    \n", "signature": "(\tself,\tout_file_path,\tseparate_output=False,\twrite_metadata=True,\tid_label='corems:'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.to_pandas", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.to_pandas", "kind": "function", "doc": "

    Export the GC-MS data to a Pandas dataframe.

    \n\n
    Parameters
    \n\n
      \n
    • out_file_path (str, pathlib.Path, or s3path.S3Path):\nPath object containing the file location.
    • \n
    • write_metadata (bool, optional):\nIf True, write the metadata. Defaults to True.
    • \n
    • id_label (str, optional):\nLabel of the ID. Defaults to 'corems:'.
    • \n
    \n", "signature": "(self, out_file_path, write_metadata=True, id_label='corems:'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.to_dataframe", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.to_dataframe", "kind": "function", "doc": "

    Export the GC-MS data to a Pandas dataframe.

    \n\n
    Parameters
    \n\n
      \n
    • id_label (str, optional):\nLabel of the ID. Defaults to 'corems:'.
    • \n
    \n", "signature": "(self, id_label='corems:'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.processing_stats", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.processing_stats", "kind": "function", "doc": "

    Return the processing statistics.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.parameters_json", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.parameters_json", "kind": "function", "doc": "

    Return the parameters in JSON format.

    \n\n
    Parameters
    \n\n
      \n
    • id_label (str, optional):\nLabel of the ID. Defaults to 'corems:'.
    • \n
    • output_path (str, optional):\nPath object containing the file location. Defaults to \" \".
    • \n
    \n", "signature": "(self, id_label='corems:', output_path=' '):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.to_json", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.to_json", "kind": "function", "doc": "

    Export the GC-MS data to a JSON file.

    \n\n
    Parameters
    \n\n
      \n
    • id_label (str, optional):\nLabel of the ID. Defaults to 'corems:'.
    • \n
    \n", "signature": "(self, id_label='corems:'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.to_hdf", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.to_hdf", "kind": "function", "doc": "

    Export the GC-MS data to a HDF file.

    \n\n
    Parameters
    \n\n
      \n
    • id_label (str, optional):\nLabel of the ID. Defaults to 'corems:'.
    • \n
    \n", "signature": "(self, id_label='corems:'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.plot_chromatogram", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.plot_chromatogram", "kind": "function", "doc": "

    Plot the chromatogram.

    \n\n
    Parameters
    \n\n
      \n
    • ax (matplotlib.axes.Axes, optional):\nAxes object to plot the chromatogram. Defaults to None.
    • \n
    • color (str, optional):\nColor of the chromatogram. Defaults to 'blue'.
    • \n
    \n", "signature": "(self, ax=None, color='blue'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.plot_smoothed_chromatogram", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.plot_smoothed_chromatogram", "kind": "function", "doc": "

    Plot the smoothed chromatogram.

    \n\n
    Parameters
    \n\n
      \n
    • ax (matplotlib.axes.Axes, optional):\nAxes object to plot the smoothed chromatogram. Defaults to None.
    • \n
    • color (str, optional):\nColor of the smoothed chromatogram. Defaults to 'green'.
    • \n
    \n", "signature": "(self, ax=None, color='green'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.plot_detected_baseline", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.plot_detected_baseline", "kind": "function", "doc": "

    Plot the detected baseline.

    \n\n
    Parameters
    \n\n
      \n
    • ax (matplotlib.axes.Axes, optional):\nAxes object to plot the detected baseline. Defaults to None.
    • \n
    • color (str, optional):\nColor of the detected baseline. Defaults to 'blue'.
    • \n
    \n", "signature": "(self, ax=None, color='blue'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.plot_baseline_subtraction", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.plot_baseline_subtraction", "kind": "function", "doc": "

    Plot the baseline subtraction.

    \n\n
    Parameters
    \n\n
      \n
    • ax (matplotlib.axes.Axes, optional):\nAxes object to plot the baseline subtraction. Defaults to None.
    • \n
    • color (str, optional):\nColor of the baseline subtraction. Defaults to 'black'.
    • \n
    \n", "signature": "(self, ax=None, color='black'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.peaks_rt_tic", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.peaks_rt_tic", "kind": "function", "doc": "

    Return the peaks, retention time, and total ion chromatogram.

    \n\n
    Parameters
    \n\n
      \n
    • json_string (bool, optional):\nIf True, return the peaks, retention time, and total ion chromatogram in JSON format. Defaults to False.
    • \n
    \n", "signature": "(self, json_string=False):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.plot_processed_chromatogram", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.plot_processed_chromatogram", "kind": "function", "doc": "

    Plot the processed chromatogram.

    \n\n
    Parameters
    \n\n
      \n
    • ax (matplotlib.axes.Axes, optional):\nAxes object to plot the processed chromatogram. Defaults to None.
    • \n
    • color (str, optional):\nColor of the processed chromatogram. Defaults to 'black'.
    • \n
    \n", "signature": "(self, ax=None, color='black'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.LC_Class", "modulename": "corems.mass_spectra.factory.LC_Class", "kind": "module", "doc": "

    Created on Oct 15, 2021

    \n"}, {"fullname": "corems.mass_spectra.factory.LC_Class.LCMSBase", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "LCMSBase", "kind": "class", "doc": "

    classdocs

    \n", "bases": "collections.abc.Mapping, corems.mass_spectra.calc.LC_Calc.LC_Calculations"}, {"fullname": "corems.mass_spectra.factory.LC_Class.LCMSBase.__init__", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "LCMSBase.__init__", "kind": "function", "doc": "

    Parameters

    \n\n
       ----------\n   file_location: text,  pathlib.Path(), or s3path.S3Path\n
    \n\n

    Path object from pathlib containing the file location

    \n", "signature": "(\tfile_location,\tanalyzer='Unknown',\tinstrument_label='Unknown',\tsample_name=None)"}, {"fullname": "corems.mass_spectra.factory.LC_Class.LCMSBase.file_location", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "LCMSBase.file_location", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.LC_Class.LCMSBase.analyzer", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "LCMSBase.analyzer", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.LC_Class.LCMSBase.instrument_label", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "LCMSBase.instrument_label", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.LC_Class.LCMSBase.add_mass_spectrum", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "LCMSBase.add_mass_spectrum", "kind": "function", "doc": "

    \n", "signature": "(self, mass_spec):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.LC_Class.LCMSBase.set_tic_list_from_data", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "LCMSBase.set_tic_list_from_data", "kind": "function", "doc": "

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.LC_Class.LCMSBase.set_retention_time_from_data", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "LCMSBase.set_retention_time_from_data", "kind": "function", "doc": "

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.LC_Class.LCMSBase.set_scans_number_from_data", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "LCMSBase.set_scans_number_from_data", "kind": "function", "doc": "

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.LC_Class.LCMSBase.scans_number", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "LCMSBase.scans_number", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.LC_Class.LCMSBase.retention_time", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "LCMSBase.retention_time", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.LC_Class.LCMSBase.tic", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "LCMSBase.tic", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.LC_Class.DataDependentLCMS", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "DataDependentLCMS", "kind": "class", "doc": "

    classdocs

    \n", "bases": "corems.mass_spectra.calc.LC_Calc.LC_Calculations"}, {"fullname": "corems.mass_spectra.factory.LC_Class.DataDependentLCMS.__init__", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "DataDependentLCMS.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tfile_location,\ttarget_mzs: List[float],\tparser,\tanalyzer: str = 'Unknown',\tinstrument_label: str = 'Unknown',\tsample_name: str = None)"}, {"fullname": "corems.mass_spectra.factory.LC_Class.DataDependentLCMS.file_location", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "DataDependentLCMS.file_location", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.LC_Class.DataDependentLCMS.add_peak", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "DataDependentLCMS.add_peak", "kind": "function", "doc": "

    \n", "signature": "(self, mass_spectrum, peak_scans, eic_data, possible_molform=None):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.LC_Class.DataDependentLCMS.ms1_molecular_search_settings", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "DataDependentLCMS.ms1_molecular_search_settings", "kind": "variable", "doc": "

    \n", "annotation": ": corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings"}, {"fullname": "corems.mass_spectra.factory.LC_Class.DataDependentLCMS.chromatogram_settings", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "DataDependentLCMS.chromatogram_settings", "kind": "variable", "doc": "

    \n", "annotation": ": corems.encapsulation.factory.processingSetting.LiquidChromatographSetting"}, {"fullname": "corems.mass_spectra.factory.LC_Class.DataDependentLCMS.parameters", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "DataDependentLCMS.parameters", "kind": "variable", "doc": "

    \n", "annotation": ": corems.encapsulation.factory.parameters.LCMSParameters"}, {"fullname": "corems.mass_spectra.factory.LC_Class.DataDependentLCMS.eic_scans_number", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "DataDependentLCMS.eic_scans_number", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.LC_Class.DataDependentLCMS.scans_number", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "DataDependentLCMS.scans_number", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.LC_Class.DataDependentLCMS.retention_time", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "DataDependentLCMS.retention_time", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.LC_Class.DataDependentLCMS.tic", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "DataDependentLCMS.tic", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.LC_Class.DataDependentLCMS.get_tic", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "DataDependentLCMS.get_tic", "kind": "function", "doc": "

    ms_type: str ('MS', MS2')\nstart_scan: int default -1 will select the lowest available\nend_scan: int default -1 will select the highest available\nreturns:\n chroma: dict\n {\n Scan: [int]\n original thermo scan numberMS\n Time: [floats]\n list of retention times\n TIC: [floats]\n total ion chromatogram\n Apexes: [int]
    \n original thermo apex scan number after peak picking
    \n }

    \n", "signature": "(\tself,\tms_type='MS !d',\tpeak_detection=True,\tsmooth=True,\tplot=False,\tax=None) -> Tuple[corems.mass_spectra.factory.LC_Temp.TIC_Data, matplotlib.axes._axes.Axes]:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.LC_Class.DataDependentLCMS.get_eics", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "DataDependentLCMS.get_eics", "kind": "function", "doc": "

    ms_type: str ('MS', MS2')\nstart_scan: int default -1 will select the lowest available\nend_scan: int default -1 will select the highest available

    \n\n

    returns:

    \n\n
    chroma: dict{target_mz: EIC_Data(\n                            Scans: [int]\n                                original thermo scan numbers\n                            Time: [floats]\n                                list of retention times\n                            TIC: [floats]\n                                total ion chromatogram\n                            Apexes: [int]    \n                                original thermo apex scan number after peak picking \n                            )\n
    \n", "signature": "(\tself,\ttic_data: dict,\tms_type='MS !d',\tpeak_detection=True,\tsmooth=True,\tplot=False,\tax=None,\tlegend=False) -> Tuple[Dict[float, corems.mass_spectra.factory.LC_Temp.EIC_Data], matplotlib.axes._axes.Axes]:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.LC_Class.DataDependentLCMS.process_ms1", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "DataDependentLCMS.process_ms1", "kind": "function", "doc": "

    \n", "signature": "(self, dict_tarrget_mzs):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.LC_Temp", "modulename": "corems.mass_spectra.factory.LC_Temp", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.LC_Temp.TIC_Data", "modulename": "corems.mass_spectra.factory.LC_Temp", "qualname": "TIC_Data", "kind": "class", "doc": "

    Scans: [int]\n original thermo scan numbers\nTime: [floats]\n list of retention times\nTIC: [floats]\n total ion chromatogram\nApexes: [int]
    \n original thermo apex scan number after peak picking

    \n"}, {"fullname": "corems.mass_spectra.factory.LC_Temp.TIC_Data.__init__", "modulename": "corems.mass_spectra.factory.LC_Temp", "qualname": "TIC_Data.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tscans: List[int] = <factory>,\ttime: List[float] = <factory>,\ttic: List[float] = <factory>,\tapexes: List[int] = <factory>)"}, {"fullname": "corems.mass_spectra.factory.LC_Temp.TIC_Data.scans", "modulename": "corems.mass_spectra.factory.LC_Temp", "qualname": "TIC_Data.scans", "kind": "variable", "doc": "

    \n", "annotation": ": List[int]"}, {"fullname": "corems.mass_spectra.factory.LC_Temp.TIC_Data.time", "modulename": "corems.mass_spectra.factory.LC_Temp", "qualname": "TIC_Data.time", "kind": "variable", "doc": "

    \n", "annotation": ": List[float]"}, {"fullname": "corems.mass_spectra.factory.LC_Temp.TIC_Data.tic", "modulename": "corems.mass_spectra.factory.LC_Temp", "qualname": "TIC_Data.tic", "kind": "variable", "doc": "

    \n", "annotation": ": List[float]"}, {"fullname": "corems.mass_spectra.factory.LC_Temp.TIC_Data.apexes", "modulename": "corems.mass_spectra.factory.LC_Temp", "qualname": "TIC_Data.apexes", "kind": "variable", "doc": "

    \n", "annotation": ": List[int]"}, {"fullname": "corems.mass_spectra.factory.LC_Temp.EIC_Data", "modulename": "corems.mass_spectra.factory.LC_Temp", "qualname": "EIC_Data", "kind": "class", "doc": "

    Scans: [int]\n original thermo scan numbers\nTime: [floats]\n list of retention times\nEIC: [floats]\n extracted ion chromatogram\nApexes: [int]
    \n original thermo apex scan number after peak picking

    \n"}, {"fullname": "corems.mass_spectra.factory.LC_Temp.EIC_Data.__init__", "modulename": "corems.mass_spectra.factory.LC_Temp", "qualname": "EIC_Data.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tscans: List[int] = <factory>,\ttime: List[float] = <factory>,\teic: List[float] = <factory>,\tapexes: List[int] = <factory>)"}, {"fullname": "corems.mass_spectra.factory.LC_Temp.EIC_Data.scans", "modulename": "corems.mass_spectra.factory.LC_Temp", "qualname": "EIC_Data.scans", "kind": "variable", "doc": "

    \n", "annotation": ": List[int]"}, {"fullname": "corems.mass_spectra.factory.LC_Temp.EIC_Data.time", "modulename": "corems.mass_spectra.factory.LC_Temp", "qualname": "EIC_Data.time", "kind": "variable", "doc": "

    \n", "annotation": ": List[float]"}, {"fullname": "corems.mass_spectra.factory.LC_Temp.EIC_Data.eic", "modulename": "corems.mass_spectra.factory.LC_Temp", "qualname": "EIC_Data.eic", "kind": "variable", "doc": "

    \n", "annotation": ": List[float]"}, {"fullname": "corems.mass_spectra.factory.LC_Temp.EIC_Data.apexes", "modulename": "corems.mass_spectra.factory.LC_Temp", "qualname": "EIC_Data.apexes", "kind": "variable", "doc": "

    \n", "annotation": ": List[int]"}, {"fullname": "corems.mass_spectra.input", "modulename": "corems.mass_spectra.input", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.andiNetCDF", "modulename": "corems.mass_spectra.input.andiNetCDF", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.andiNetCDF.ReadAndiNetCDF", "modulename": "corems.mass_spectra.input.andiNetCDF", "qualname": "ReadAndiNetCDF", "kind": "class", "doc": "

    A class for reading AndiNetCDF files and extracting mass spectra data.

    \n\n
    Parameters
    \n\n
      \n
    • file_location (str or Path):\nThe location of the AndiNetCDF file.
    • \n
    • analyzer (str, optional):\nThe type of analyzer used (default is 'Quadruple').
    • \n
    • instrument_label (str, optional):\nThe label of the instrument (default is 'GCMS-Agilent').
    • \n
    • auto_process (bool, optional):\nWhether to automatically process the data (default is True).
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • file_location (Path):\nThe path to the AndiNetCDF file.
    • \n
    • net_cdf_obj (Dataset):\nThe NetCDF dataset object.
    • \n
    • ionization_type (str):\nThe ionization type used in the experiment.
    • \n
    • experiment_type (str):\nThe type of experiment.
    • \n
    • list_scans (range):\nThe range of scan numbers in the dataset.
    • \n
    • initial_scan_number (int):\nThe number of the initial scan.
    • \n
    • final_scan_number (int):\nThe number of the final scan.
    • \n
    • analyzer (str):\nThe type of analyzer used.
    • \n
    • instrument_label (str):\nThe label of the instrument.
    • \n
    • gcms (GCMSBase):\nThe GCMSBase object for storing mass spectra data.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • polarity(). \nGet the polarity of the ionization.
    • \n
    • get_mass_spectrum(mz, abun, rp, d_params). \nAdd a mass spectrum to the GCMSBase object.
    • \n
    • run(). \nPopulate the GCMSBase object with mass spectra data.
    • \n
    • import_mass_spectra(d_params). \nImport mass spectra data from the AndiNetCDF file.
    • \n
    • get_gcms_obj(). \nGet the GCMSBase object.
    • \n
    \n", "bases": "threading.Thread"}, {"fullname": "corems.mass_spectra.input.andiNetCDF.ReadAndiNetCDF.__init__", "modulename": "corems.mass_spectra.input.andiNetCDF", "qualname": "ReadAndiNetCDF.__init__", "kind": "function", "doc": "

    This constructor should always be called with keyword arguments. Arguments are:

    \n\n

    group should be None; reserved for future extension when a ThreadGroup\nclass is implemented.

    \n\n

    target is the callable object to be invoked by the run()\nmethod. Defaults to None, meaning nothing is called.

    \n\n

    name is the thread name. By default, a unique name is constructed of\nthe form \"Thread-N\" where N is a small decimal number.

    \n\n

    args is the argument tuple for the target invocation. Defaults to ().

    \n\n

    kwargs is a dictionary of keyword arguments for the target\ninvocation. Defaults to {}.

    \n\n

    If a subclass overrides the constructor, it must make sure to invoke\nthe base class constructor (Thread.__init__()) before doing anything\nelse to the thread.

    \n", "signature": "(\tfile_location: str | pathlib.Path,\tanalyzer='Quadruple',\tinstrument_label='GCMS-Agilent',\tauto_process=True)"}, {"fullname": "corems.mass_spectra.input.andiNetCDF.ReadAndiNetCDF.ionization_type", "modulename": "corems.mass_spectra.input.andiNetCDF", "qualname": "ReadAndiNetCDF.ionization_type", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.andiNetCDF.ReadAndiNetCDF.experiment_type", "modulename": "corems.mass_spectra.input.andiNetCDF", "qualname": "ReadAndiNetCDF.experiment_type", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.andiNetCDF.ReadAndiNetCDF.list_scans", "modulename": "corems.mass_spectra.input.andiNetCDF", "qualname": "ReadAndiNetCDF.list_scans", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.andiNetCDF.ReadAndiNetCDF.initial_scan_number", "modulename": "corems.mass_spectra.input.andiNetCDF", "qualname": "ReadAndiNetCDF.initial_scan_number", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.andiNetCDF.ReadAndiNetCDF.final_scan_number", "modulename": "corems.mass_spectra.input.andiNetCDF", "qualname": "ReadAndiNetCDF.final_scan_number", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.andiNetCDF.ReadAndiNetCDF.analyzer", "modulename": "corems.mass_spectra.input.andiNetCDF", "qualname": "ReadAndiNetCDF.analyzer", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.andiNetCDF.ReadAndiNetCDF.instrument_label", "modulename": "corems.mass_spectra.input.andiNetCDF", "qualname": "ReadAndiNetCDF.instrument_label", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.andiNetCDF.ReadAndiNetCDF.gcms", "modulename": "corems.mass_spectra.input.andiNetCDF", "qualname": "ReadAndiNetCDF.gcms", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.andiNetCDF.ReadAndiNetCDF.polarity", "modulename": "corems.mass_spectra.input.andiNetCDF", "qualname": "ReadAndiNetCDF.polarity", "kind": "variable", "doc": "

    Get the polarity of the ionization.

    \n"}, {"fullname": "corems.mass_spectra.input.andiNetCDF.ReadAndiNetCDF.get_mass_spectrum", "modulename": "corems.mass_spectra.input.andiNetCDF", "qualname": "ReadAndiNetCDF.get_mass_spectrum", "kind": "function", "doc": "

    Add a mass spectrum to the GCMSBase object.

    \n\n
    Parameters
    \n\n
      \n
    • mz (array-like):\nThe m/z values of the mass spectrum.
    • \n
    • abun (array-like):\nThe abundance values of the mass spectrum.
    • \n
    • rp (array-like):\nThe resolution values of the mass spectrum.
    • \n
    • d_params (dict):\nAdditional parameters for the mass spectrum.
    • \n
    \n", "signature": "(self, mz, abun, rp, d_params):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.andiNetCDF.ReadAndiNetCDF.run", "modulename": "corems.mass_spectra.input.andiNetCDF", "qualname": "ReadAndiNetCDF.run", "kind": "function", "doc": "

    Populate the GCMSBase object with mass spectra data.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.andiNetCDF.ReadAndiNetCDF.import_mass_spectra", "modulename": "corems.mass_spectra.input.andiNetCDF", "qualname": "ReadAndiNetCDF.import_mass_spectra", "kind": "function", "doc": "

    Import mass spectra data from the AndiNetCDF file.

    \n\n
    Parameters
    \n\n
      \n
    • d_params (dict):\nAdditional parameters for the mass spectra.
    • \n
    \n", "signature": "(self, d_params):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.andiNetCDF.ReadAndiNetCDF.get_gcms_obj", "modulename": "corems.mass_spectra.input.andiNetCDF", "qualname": "ReadAndiNetCDF.get_gcms_obj", "kind": "function", "doc": "

    Get the GCMSBase object.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.boosterHDF5", "modulename": "corems.mass_spectra.input.boosterHDF5", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra", "kind": "class", "doc": "

    Class for reading HDF5 files containing booster mass spectra.

    \n\n
    Parameters
    \n\n
      \n
    • file_location (Path or S3Path):\nThe full path to the HDF5 file.
    • \n
    • analyzer (str, optional):\nThe type of analyzer used for the mass spectra. Defaults to \"ICR\".
    • \n
    • instrument_label (str, optional):\nThe label of the instrument. Defaults to \"21T\".
    • \n
    • auto_process (bool, optional):\nWhether to automatically process the mass spectra. Defaults to True.
    • \n
    \n", "bases": "threading.Thread"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra.__init__", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra.__init__", "kind": "function", "doc": "

    Initialize the ReadHDF_BoosterMassSpectra class.

    \n\n
    Parameters
    \n\n
      \n
    • file_location (Path or S3Path):\nThe full path to the HDF5 file.
    • \n
    • analyzer (str, optional):\nThe type of analyzer used for the mass spectra. Defaults to \"ICR\".
    • \n
    • instrument_label (str, optional):\nThe label of the instrument. Defaults to \"21T\".
    • \n
    • auto_process (bool, optional):\nWhether to automatically process the mass spectra. Defaults to True.
    • \n
    \n", "signature": "(\tfile_location: pathlib.Path | s3path.S3Path,\tanalyzer='ICR',\tinstrument_label='21T',\tauto_process=True)"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra.lcms", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra.lcms", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra.hdf_obj", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra.hdf_obj", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra.list_scans", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra.list_scans", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra.initial_scan_number", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra.initial_scan_number", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra.final_scan_number", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra.final_scan_number", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra.file_location", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra.file_location", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra.auto_process", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra.auto_process", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra.analyzer", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra.analyzer", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra.instrument_label", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra.instrument_label", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra.get_polarity", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra.get_polarity", "kind": "function", "doc": "

    Get the polarity of a scan.

    \n\n
    Parameters
    \n\n
      \n
    • file_location (Path or S3Path):\nThe full path to the HDF5 file.
    • \n
    • scan (int):\nThe scan number.
    • \n
    \n", "signature": "(self, file_location: pathlib.Path | s3path.S3Path, scan: int):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra.get_attr_data", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra.get_attr_data", "kind": "function", "doc": "

    Get the attribute data of a scan.

    \n\n
    Parameters
    \n\n
      \n
    • scan (int):\nThe scan number.
    • \n
    • attr_srt (str):\nThe attribute name.
    • \n
    \n", "signature": "(self, scan, attr_srt):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra.import_mass_spectra", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra.import_mass_spectra", "kind": "function", "doc": "

    Import the mass spectra from the HDF5 file.

    \n\n
    Parameters
    \n\n
      \n
    • d_params (dict):\nThe parameters for importing the mass spectra.
    • \n
    \n", "signature": "(self, d_params: dict):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra.get_mass_spectrum", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra.get_mass_spectrum", "kind": "function", "doc": "

    Get the mass spectrum for a scan.

    \n\n
    Parameters
    \n\n
      \n
    • scan (int):\nThe scan number.
    • \n
    • d_params (dict):\nThe parameters for creating the mass spectrum.
    • \n
    \n", "signature": "(self, scan: int, d_params: dict):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra.run", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra.run", "kind": "function", "doc": "

    Run the thread to create the LCMS object.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra.get_lcms_obj", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra.get_lcms_obj", "kind": "function", "doc": "

    Get the LCMS object.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.brukerSolarix", "modulename": "corems.mass_spectra.input.brukerSolarix", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.brukerSolarix.ReadBruker_SolarixTransientMassSpectra", "modulename": "corems.mass_spectra.input.brukerSolarix", "qualname": "ReadBruker_SolarixTransientMassSpectra", "kind": "class", "doc": "

    Class for reading Bruker Solarix Transient Mass Spectra.

    \n\n
    Parameters
    \n\n
      \n
    • d_directory_location (str, pathlib.Path, or s3path.S3Path):\nPath object from pathlib containing the file location.
    • \n
    • analyzer (str, optional):\nType of analyzer used in the mass spectrometer. Defaults to \"ICR\".
    • \n
    • instrument_label (str, optional):\nLabel for the instrument. Defaults to \"15T\".
    • \n
    • auto_process (bool, optional):\nFlag indicating whether to automatically process the mass spectra. Defaults to True.
    • \n
    • keep_profile (bool, optional):\nFlag indicating whether to keep the profile data in the mass spectra. Defaults to False.
    • \n
    \n", "bases": "threading.Thread"}, {"fullname": "corems.mass_spectra.input.brukerSolarix.ReadBruker_SolarixTransientMassSpectra.__init__", "modulename": "corems.mass_spectra.input.brukerSolarix", "qualname": "ReadBruker_SolarixTransientMassSpectra.__init__", "kind": "function", "doc": "

    This constructor should always be called with keyword arguments. Arguments are:

    \n\n

    group should be None; reserved for future extension when a ThreadGroup\nclass is implemented.

    \n\n

    target is the callable object to be invoked by the run()\nmethod. Defaults to None, meaning nothing is called.

    \n\n

    name is the thread name. By default, a unique name is constructed of\nthe form \"Thread-N\" where N is a small decimal number.

    \n\n

    args is the argument tuple for the target invocation. Defaults to ().

    \n\n

    kwargs is a dictionary of keyword arguments for the target\ninvocation. Defaults to {}.

    \n\n

    If a subclass overrides the constructor, it must make sure to invoke\nthe base class constructor (Thread.__init__()) before doing anything\nelse to the thread.

    \n", "signature": "(\td_directory_location: str | pathlib.Path | s3path.S3Path,\tanalyzer='ICR',\tinstrument_label='15T',\tauto_process=True,\tkeep_profile=False)"}, {"fullname": "corems.mass_spectra.input.brukerSolarix.ReadBruker_SolarixTransientMassSpectra.scan_attr", "modulename": "corems.mass_spectra.input.brukerSolarix", "qualname": "ReadBruker_SolarixTransientMassSpectra.scan_attr", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.brukerSolarix.ReadBruker_SolarixTransientMassSpectra.lcms", "modulename": "corems.mass_spectra.input.brukerSolarix", "qualname": "ReadBruker_SolarixTransientMassSpectra.lcms", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.brukerSolarix.ReadBruker_SolarixTransientMassSpectra.auto_process", "modulename": "corems.mass_spectra.input.brukerSolarix", "qualname": "ReadBruker_SolarixTransientMassSpectra.auto_process", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.brukerSolarix.ReadBruker_SolarixTransientMassSpectra.keep_profile", "modulename": "corems.mass_spectra.input.brukerSolarix", "qualname": "ReadBruker_SolarixTransientMassSpectra.keep_profile", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.brukerSolarix.ReadBruker_SolarixTransientMassSpectra.get_scan_attr", "modulename": "corems.mass_spectra.input.brukerSolarix", "qualname": "ReadBruker_SolarixTransientMassSpectra.get_scan_attr", "kind": "function", "doc": "

    Get the scan attributes from the scan.xml file.

    \n\n
    Returns
    \n\n
      \n
    • dict: Dictionary containing the scan number as key and a tuple of retention time and TIC as value.
    • \n
    \n", "signature": "(self) -> dict:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.brukerSolarix.ReadBruker_SolarixTransientMassSpectra.import_mass_spectra", "modulename": "corems.mass_spectra.input.brukerSolarix", "qualname": "ReadBruker_SolarixTransientMassSpectra.import_mass_spectra", "kind": "function", "doc": "

    Import the mass spectra from the scan.xml file.

    \n", "signature": "(self) -> None:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.brukerSolarix.ReadBruker_SolarixTransientMassSpectra.get_mass_spectrum", "modulename": "corems.mass_spectra.input.brukerSolarix", "qualname": "ReadBruker_SolarixTransientMassSpectra.get_mass_spectrum", "kind": "function", "doc": "

    Get the mass spectrum for a given scan number.

    \n\n
    Parameters
    \n\n
      \n
    • scan_number (int):\nScan number.
    • \n
    \n", "signature": "(self, scan_number: int):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.brukerSolarix.ReadBruker_SolarixTransientMassSpectra.run", "modulename": "corems.mass_spectra.input.brukerSolarix", "qualname": "ReadBruker_SolarixTransientMassSpectra.run", "kind": "function", "doc": "

    Run the import_mass_spectra method.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.brukerSolarix.ReadBruker_SolarixTransientMassSpectra.get_lcms_obj", "modulename": "corems.mass_spectra.input.brukerSolarix", "qualname": "ReadBruker_SolarixTransientMassSpectra.get_lcms_obj", "kind": "function", "doc": "

    Get the LCMSBase object.

    \n\n
    Raises
    \n\n
      \n
    • Exception: If the LCMSBase object is empty.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.coremsHDF5", "modulename": "corems.mass_spectra.input.coremsHDF5", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.coremsHDF5.ReadCoreMSHDF_MassSpectra", "modulename": "corems.mass_spectra.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectra", "kind": "class", "doc": "

    Class for reading CoreMS HDF5 mass spectra.

    \n\n
    Parameters
    \n\n
      \n
    • file_location (str):\nThe file location of the CoreMS HDF5 file.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • lcms (LCMSBase):\nThe LCMSBase object for storing mass spectra.
    • \n
    • list_scans (list):\nThe list of scan numbers in the HDF5 file.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • import_mass_spectra()\nImports the mass spectra from the HDF5 file.
    • \n
    • run()\nCreates the LCMS object by importing the mass spectra.
    • \n
    • get_lcms_obj()\nReturns the LCMS object.
    • \n
    \n\n
    Raises
    \n\n
      \n
    • Exception: If the LCMS object is empty.
    • \n
    \n", "bases": "corems.mass_spectrum.input.coremsHDF5.ReadCoreMSHDF_MassSpectrum, threading.Thread"}, {"fullname": "corems.mass_spectra.input.coremsHDF5.ReadCoreMSHDF_MassSpectra.__init__", "modulename": "corems.mass_spectra.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectra.__init__", "kind": "function", "doc": "

    This constructor should always be called with keyword arguments. Arguments are:

    \n\n

    group should be None; reserved for future extension when a ThreadGroup\nclass is implemented.

    \n\n

    target is the callable object to be invoked by the run()\nmethod. Defaults to None, meaning nothing is called.

    \n\n

    name is the thread name. By default, a unique name is constructed of\nthe form \"Thread-N\" where N is a small decimal number.

    \n\n

    args is the argument tuple for the target invocation. Defaults to ().

    \n\n

    kwargs is a dictionary of keyword arguments for the target\ninvocation. Defaults to {}.

    \n\n

    If a subclass overrides the constructor, it must make sure to invoke\nthe base class constructor (Thread.__init__()) before doing anything\nelse to the thread.

    \n", "signature": "(file_location: str)"}, {"fullname": "corems.mass_spectra.input.coremsHDF5.ReadCoreMSHDF_MassSpectra.lcms", "modulename": "corems.mass_spectra.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectra.lcms", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.coremsHDF5.ReadCoreMSHDF_MassSpectra.list_scans", "modulename": "corems.mass_spectra.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectra.list_scans", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.coremsHDF5.ReadCoreMSHDF_MassSpectra.import_mass_spectra", "modulename": "corems.mass_spectra.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectra.import_mass_spectra", "kind": "function", "doc": "

    Imports the mass spectra from the HDF5 file.

    \n", "signature": "(self) -> None:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.coremsHDF5.ReadCoreMSHDF_MassSpectra.run", "modulename": "corems.mass_spectra.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectra.run", "kind": "function", "doc": "

    Creates the LCMS object by importing the mass spectra.

    \n", "signature": "(self) -> None:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.coremsHDF5.ReadCoreMSHDF_MassSpectra.get_lcms_obj", "modulename": "corems.mass_spectra.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectra.get_lcms_obj", "kind": "function", "doc": "

    Returns the LCMS object.

    \n\n
    Returns
    \n\n
      \n
    • LCMSBase: The LCMS object.
    • \n
    \n\n
    Raises
    \n\n
      \n
    • Exception: If the LCMS object is empty.
    • \n
    \n", "signature": "(self) -> corems.mass_spectra.factory.LC_Class.LCMSBase:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.massList", "modulename": "corems.mass_spectra.input.massList", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.massList.ReadCoremsMassSpectraText", "modulename": "corems.mass_spectra.input.massList", "qualname": "ReadCoremsMassSpectraText", "kind": "class", "doc": "

    Class for reading CoreMS mass spectra from a text file.

    \n\n
    Parameters
    \n\n
      \n
    • file_location (str, pathlib.Path, or s3path.S3Path):\nPath object from pathlib containing the file location
    • \n
    • analyzer (str, optional):\nName of the analyzer, by default 'Unknown'
    • \n
    • instrument_label (str, optional):\nLabel of the instrument, by default 'Unknown'
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • lcms (LCMSBase):\nLCMSBase object for storing the mass spectra data.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • get_scans_filename(). Get the filenames of all the scan files associated with the CoreMS file.
    • \n
    • set_filepath_datatype_and_delimiter(file_path_obj). Set the file path, data type, and delimiter based on the file path object.
    • \n
    • import_mass_spectra(). Import the mass spectra from the scan files and add them to the LCMSBase object.
    • \n
    • run(). Run the import_mass_spectra method to create the LCMSBase object.
    • \n
    • get_lcms_obj(). Get the LCMSBase object.
    • \n
    \n", "bases": "corems.mass_spectrum.input.massList.ReadCoremsMasslist, threading.Thread"}, {"fullname": "corems.mass_spectra.input.massList.ReadCoremsMassSpectraText.__init__", "modulename": "corems.mass_spectra.input.massList", "qualname": "ReadCoremsMassSpectraText.__init__", "kind": "function", "doc": "

    This constructor should always be called with keyword arguments. Arguments are:

    \n\n

    group should be None; reserved for future extension when a ThreadGroup\nclass is implemented.

    \n\n

    target is the callable object to be invoked by the run()\nmethod. Defaults to None, meaning nothing is called.

    \n\n

    name is the thread name. By default, a unique name is constructed of\nthe form \"Thread-N\" where N is a small decimal number.

    \n\n

    args is the argument tuple for the target invocation. Defaults to ().

    \n\n

    kwargs is a dictionary of keyword arguments for the target\ninvocation. Defaults to {}.

    \n\n

    If a subclass overrides the constructor, it must make sure to invoke\nthe base class constructor (Thread.__init__()) before doing anything\nelse to the thread.

    \n", "signature": "(file_location, analyzer='Unknown', instrument_label='Unknown')"}, {"fullname": "corems.mass_spectra.input.massList.ReadCoremsMassSpectraText.lcms", "modulename": "corems.mass_spectra.input.massList", "qualname": "ReadCoremsMassSpectraText.lcms", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.massList.ReadCoremsMassSpectraText.get_scans_filename", "modulename": "corems.mass_spectra.input.massList", "qualname": "ReadCoremsMassSpectraText.get_scans_filename", "kind": "function", "doc": "

    \n", "signature": "(self) -> list:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.massList.ReadCoremsMassSpectraText.set_filepath_datatype_and_delimiter", "modulename": "corems.mass_spectra.input.massList", "qualname": "ReadCoremsMassSpectraText.set_filepath_datatype_and_delimiter", "kind": "function", "doc": "

    \n", "signature": "(self, file_path_obj) -> None:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.massList.ReadCoremsMassSpectraText.import_mass_spectra", "modulename": "corems.mass_spectra.input.massList", "qualname": "ReadCoremsMassSpectraText.import_mass_spectra", "kind": "function", "doc": "

    \n", "signature": "(self) -> None:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.massList.ReadCoremsMassSpectraText.run", "modulename": "corems.mass_spectra.input.massList", "qualname": "ReadCoremsMassSpectraText.run", "kind": "function", "doc": "

    Creates the LCMS object and imports mass spectra.

    \n", "signature": "(self) -> None:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.massList.ReadCoremsMassSpectraText.get_lcms_obj", "modulename": "corems.mass_spectra.input.massList", "qualname": "ReadCoremsMassSpectraText.get_lcms_obj", "kind": "function", "doc": "

    Returns the LCMSBase object associated with the massList.

    \n\n

    If the LCMSBase object is already initialized, it is returned.\nOtherwise, an exception is raised.

    \n\n

    Raises:\n Exception: If the LCMSBase object is not initialized.

    \n", "signature": "(self) -> corems.mass_spectra.factory.LC_Class.LCMSBase:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader", "modulename": "corems.mass_spectra.input.rawFileReader", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass", "kind": "class", "doc": "

    Class for reading Thermo Raw files and extracting information from them.

    \n\n

    Parameters:

    \n\n

    file_location : str or pathlib.Path or s3path.S3Path\n Thermo Raw file path or S3 path.

    \n\n

    Attributes:

    \n\n

    file_path : str or pathlib.Path or s3path.S3Path\n The file path of the Thermo Raw file.\nparameters : LCMSParameters\n The LCMS parameters for the Thermo Raw file.\nchromatogram_settings : LiquidChromatographSetting\n The chromatogram settings for the Thermo Raw file.\nscans : list or tuple\n The selected scans for the Thermo Raw file.\nstart_scan : int\n The starting scan number for the Thermo Raw file.\nend_scan : int\n The ending scan number for the Thermo Raw file.

    \n\n

    Methods:

    \n\n
      \n
    • set_msordertype(scanFilter, mstype: str = 'ms1') -> scanFilter\nConvert the user-passed MS Type string to a Thermo MSOrderType object.
    • \n
    • get_creation_time() -> datetime.datetime\nExtract the creation date stamp from the .RAW file and return it as a formatted datetime object.
    • \n
    • remove_temp_file()\nRemove the temporary file if the path is from S3Path.
    • \n
    • get_polarity_mode(scan_number: int) -> int\nGet the polarity mode for the given scan number.
    • \n
    • get_filter_for_scan_num(scan_number: int) -> List[str]\nGet the filter for the given scan number.
    • \n
    • check_full_scan(scan_number: int) -> bool\nCheck if the given scan number is a full scan.
    • \n
    • get_all_filters() -> Tuple[Dict[int, str], List[str]]\nGet all scan filters for the Thermo Raw file.
    • \n
    • get_scan_header(scan: int) -> Dict[str, Any]\nGet the full dictionary of scan header metadata for the given scan number.
    • \n
    • get_rt_time_from_trace(trace) -> Tuple[List[float], List[float], List[int]]\nGet the retention time, intensity, and scan number from the given trace.
    • \n
    • get_eics(target_mzs: List[float], tic_data: Dict[str, Any], ms_type: str = 'MS !d',\n peak_detection: bool = True, smooth: bool = True, plot: bool = False,\n ax: Optional[matplotlib.axes.Axes] = None, legend: bool = False) -> Tuple[Dict[float, EIC_Data], matplotlib.axes.Axes]\nGet the extracted ion chromatograms (EICs) for the target m/z values.
    • \n
    \n"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.__init__", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.__init__", "kind": "function", "doc": "

    file_location: srt pathlib.Path or s3path.S3Path\nThermo Raw file path

    \n", "signature": "(file_location)"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.iRawDataPlus", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.iRawDataPlus", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.res", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.res", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.file_path", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.file_path", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.iFileHeader", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.iFileHeader", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.parameters", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.parameters", "kind": "variable", "doc": "

    Get or set the LCMSParameters object.

    \n", "annotation": ": corems.encapsulation.factory.parameters.LCMSParameters"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.chromatogram_settings", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.chromatogram_settings", "kind": "variable", "doc": "

    Get or set the LiquidChromatographSetting object.

    \n", "annotation": ": corems.encapsulation.factory.processingSetting.LiquidChromatographSetting"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.scans", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.scans", "kind": "variable", "doc": "

    scans : list or tuple\nIf list uses Thermo AverageScansInScanRange for selected scans, ortherwise uses Thermo AverageScans for a scan range

    \n", "annotation": ": list | tuple"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.start_scan", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.start_scan", "kind": "variable", "doc": "

    Get the starting scan number for the Thermo Raw file.

    \n", "annotation": ": int"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.end_scan", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.end_scan", "kind": "variable", "doc": "

    Get the ending scan number for the Thermo Raw file.

    \n", "annotation": ": int"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.set_msordertype", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.set_msordertype", "kind": "function", "doc": "

    Function to convert user passed string MS Type to Thermo MSOrderType object\nLimited to MS1 through MS10.

    \n\n

    Parameters:

    \n\n

    scanFilter : Thermo.ScanFilter\n The scan filter object.\nmstype : str, optional\n The MS Type string, by default 'ms1'

    \n", "signature": "(self, scanFilter, mstype: str = 'ms1'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.get_creation_time", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.get_creation_time", "kind": "function", "doc": "

    Extract the creation date stamp from the .RAW file\nReturn formatted creation date stamp.

    \n", "signature": "(self) -> datetime.datetime:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.remove_temp_file", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.remove_temp_file", "kind": "function", "doc": "

    if the path is from S3Path data cannot be serialized to io.ByteStream and\na temporary copy is stored at the temp dir\nuse this function only at the end of your execution scrip\nsome LCMS class methods depend on this file

    \n", "signature": "(self) -> None:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.get_polarity_mode", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.get_polarity_mode", "kind": "function", "doc": "

    Get the polarity mode for the given scan number.

    \n\n

    Parameters:

    \n\n

    scan_number : int\n The scan number.

    \n\n

    Raises:

    \n\n

    Exception\n If the polarity mode is unknown.

    \n", "signature": "(self, scan_number: int) -> int:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.get_filter_for_scan_num", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.get_filter_for_scan_num", "kind": "function", "doc": "

    Returns the closest matching run time that corresponds to scan_number for the current\ncontroller. This function is only supported for MS device controllers.\ne.g. ['FTMS', '-', 'p', 'NSI', 'Full', 'ms', '[200.00-1000.00]']

    \n\n

    Parameters:

    \n\n

    scan_number : int\n The scan number.

    \n", "signature": "(self, scan_number: int) -> System.Collections.Generic.List[String]:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.check_full_scan", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.check_full_scan", "kind": "function", "doc": "

    \n", "signature": "(self, scan_number: int) -> bool:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.get_all_filters", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.get_all_filters", "kind": "function", "doc": "

    Get all scan filters.\nThis function is only supported for MS device controllers.\ne.g. ['FTMS', '-', 'p', 'NSI', 'Full', 'ms', '[200.00-1000.00]']

    \n", "signature": "(self) -> Tuple[Dict[int, str], System.Collections.Generic.List[String]]:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.get_scan_header", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.get_scan_header", "kind": "function", "doc": "

    Get full dictionary of scan header meta data, i.e. AGC status, ion injection time, etc.

    \n\n

    Parameters:

    \n\n

    scan : int\n The scan number.

    \n", "signature": "(self, scan: int) -> Dict[str, Any]:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.get_rt_time_from_trace", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.get_rt_time_from_trace", "kind": "function", "doc": "

    trace: ThermoFisher.CommonCore.Data.Business.ChromatogramSignal

    \n", "signature": "(\ttrace) -> Tuple[System.Collections.Generic.List[Double], System.Collections.Generic.List[Double], System.Collections.Generic.List[Int32]]:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.get_eics", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.get_eics", "kind": "function", "doc": "

    ms_type: str ('MS', MS2')\nstart_scan: int default -1 will select the lowest available\nend_scan: int default -1 will select the highest available

    \n\n

    returns:

    \n\n
    chroma: dict{target_mz: EIC_Data(\n                            Scans: [int]\n                                original thermo scan numbers\n                            Time: [floats]\n                                list of retention times\n                            TIC: [floats]\n                                total ion chromatogram\n                            Apexes: [int]\n                                original thermo apex scan number after peak picking\n                            )\n
    \n", "signature": "(\tself,\ttarget_mzs: System.Collections.Generic.List[Double],\ttic_data: Dict[str, Any],\tms_type='MS !d',\tpeak_detection=True,\tsmooth=True,\tplot=False,\tax: Optional[matplotlib.axes._axes.Axes] = None,\tlegend=False) -> Tuple[Dict[float, corems.mass_spectra.factory.LC_Temp.EIC_Data], matplotlib.axes._axes.Axes]:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.get_tic", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.get_tic", "kind": "function", "doc": "

    ms_type: str ('MS', MS2')

    \n\n

    returns:\n chroma: dict\n {\n Scan: [int]\n original thermo scan numberMS\n Time: [floats]\n list of retention times\n TIC: [floats]\n total ion chromatogram\n Apexes: [int]\n original thermo apex scan number after peak picking\n }

    \n", "signature": "(\tself,\tms_type='MS !d',\tpeak_detection=True,\tsmooth=True,\tplot=False,\tax=None) -> Tuple[corems.mass_spectra.factory.LC_Temp.TIC_Data, matplotlib.axes._axes.Axes]:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.get_average_mass_spectrum", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.get_average_mass_spectrum", "kind": "function", "doc": "

    Averages mass spectra over a scan range using Thermo's AverageScansInScanRange method\nor a scan list using Thermo's AverageScans method\nspectrum_mode: str\n centroid or profile mass spectrum\nauto_process: bool\n If true performs peak picking, and noise threshold calculation after creation of mass spectrum object\nms_type: str\n String of form 'ms1' or 'ms2' or 'MS3' etc. Valid up to MS10.\n Internal function converts to Thermo MSOrderType class.

    \n", "signature": "(\tself,\tspectrum_mode: str = 'profile',\tauto_process: bool = True,\tppm_tolerance: float = 5.0,\tms_type: str = 'MS1') -> corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecProfile | corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroid:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.set_metadata", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.set_metadata", "kind": "function", "doc": "

    Collect metadata to be ingested in the mass spectrum object

    \n\n

    scans_list: list[int] or false\nlastScanNumber: int\nfirstScanNumber: int

    \n", "signature": "(\tself,\tfirstScanNumber=0,\tlastScanNumber=0,\tscans_list=False,\tlabel='Thermo_Profile'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.get_centroid_msms_data", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.get_centroid_msms_data", "kind": "function", "doc": "

    Deprecated since version 2.0:\nThis function will be removed in CoreMS 2.0. Please use get_average_mass_spectrum() instead for similar functionality.

    \n", "signature": "(self, scan):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.get_average_mass_spectrum_by_scanlist", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.get_average_mass_spectrum_by_scanlist", "kind": "function", "doc": "

    Averages selected scans mass spectra using Thermo's AverageScans method\nscans_list: list[int]\nauto_process: bool\n If true performs peak picking, and noise threshold calculation after creation of mass spectrum object\nReturns:\n MassSpecProfile

    \n\n

    Deprecated since version 2.0.

    \n\n

    This function will be removed in CoreMS 2.0. Please use get_average_mass_spectrum() instead for similar functionality.

    \n", "signature": "(\tself,\tscans_list: System.Collections.Generic.List[Int32],\tauto_process: bool = True,\tppm_tolerance: float = 5.0) -> corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecProfile:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ImportDataDependentThermoMSFileReader", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ImportDataDependentThermoMSFileReader", "kind": "class", "doc": "

    Collection of methdos to import LC data dependent acquisition from Thermo's raw file\nIntended do create the LCMS object --> ChromaPeaks --> MSobj FullScan --> Dependent MS/MS Obj

    \n", "bases": "ThermoBaseClass, corems.mass_spectra.calc.LC_Calc.LC_Calculations"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ImportDataDependentThermoMSFileReader.__init__", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ImportDataDependentThermoMSFileReader.__init__", "kind": "function", "doc": "

    target_mzs: list[float] monoisotopic target m/z or None\n Details: None will defalt to depends scans selected m/\nfile_location: str, Path, or S3Path

    \n", "signature": "(\tfile_location: str,\tselected_mzs: System.Collections.Generic.List[Double] = None)"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ImportDataDependentThermoMSFileReader.lcms", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ImportDataDependentThermoMSFileReader.lcms", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ImportDataDependentThermoMSFileReader.selected_mzs", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ImportDataDependentThermoMSFileReader.selected_mzs", "kind": "variable", "doc": "

    \n", "annotation": ": System.Collections.Generic.List[Double]"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ImportDataDependentThermoMSFileReader.get_lcms_obj", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ImportDataDependentThermoMSFileReader.get_lcms_obj", "kind": "function", "doc": "

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ImportDataDependentThermoMSFileReader.get_precursors_list", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ImportDataDependentThermoMSFileReader.get_precursors_list", "kind": "function", "doc": "

    returns a set of unique precursors m/z\nprecision_decimals: int\n change this parameters does not seem to affect the number of dependent scans selected\n needs more investigation

    \n", "signature": "(self, precision_decimals=5):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ImportMassSpectraThermoMSFileReader", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ImportMassSpectraThermoMSFileReader", "kind": "class", "doc": "

    Collection of methdos to import Summed/Averaged mass spectrum from Thermo's raw file\nCurrently only for profile mode data\nReturns MassSpecProfile object

    \n", "bases": "ThermoBaseClass, corems.mass_spectra.calc.LC_Calc.LC_Calculations"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ImportMassSpectraThermoMSFileReader.get_icr_transient_times", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ImportMassSpectraThermoMSFileReader.get_icr_transient_times", "kind": "function", "doc": "

    Return a list for transient time targets for all scans, or selected scans range\nResolving Power and Transient time targets based on 7T FT-ICR MS system

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ImportMassSpectraThermoMSFileReader.RawFileReader", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ImportMassSpectraThermoMSFileReader.RawFileReader", "kind": "class", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ImportMassSpectraThermoMSFileReader.RawFileReader.get_data", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ImportMassSpectraThermoMSFileReader.RawFileReader.get_data", "kind": "function", "doc": "

    Retrieve mass spectrometry data for a given scan.

    \n\n
    Parameters
    \n\n
      \n
    • scan (int):\nThe scan number.
    • \n
    • d_parameter (dict):\nA dictionary to store additional parameters.
    • \n
    • scan_type (str):\nThe type of scan (\"Centroid\" or \"Profile\").
    • \n
    \n", "signature": "(self, scan: int, d_parameter: dict, scan_type: str):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ImportMassSpectraThermoMSFileReader.get_best_scans_idx", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ImportMassSpectraThermoMSFileReader.get_best_scans_idx", "kind": "function", "doc": "

    Method to determine the best scan indexes for selective co-addition.

    \n\n
    Parameters
    \n\n
      \n
    • stdevs (int, optional):\nThe number of standard deviations to use as the cutoff for filtering out datapoints. Default is 2.
    • \n
    • method (str, optional):\nThe method to calculate the mean or median of the TIC values. Default is \"mean\".
    • \n
    • plot (bool, optional):\nWhether to plot the TIC with horizontal lines for the standard deviation cutoffs. Default is False.
    • \n
    \n\n
    Notes
    \n\n

    This method calculates the mean (default) or median of the TIC values and sets an upper and lower limit\nbased on a specified number of standard deviations. The scans with TIC values outside of this range are\nconsidered the best scans for selective co-addition.

    \n\n

    Empirically, using 1-2 standard deviations is enough to filter out the worst datapoints.

    \n\n

    If plot is True, a matplotlib figure is returned along with the list of scan indexes.

    \n\n
    Examples
    \n\n
    \n
    >>> reader = RawFileReader()\n>>> scans = reader.get_best_scans_idx(stdevs=2, method="mean", plot=True)\n
    \n
    \n", "signature": "(self, stdevs=2, method='mean', plot=False):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output", "modulename": "corems.mass_spectra.output", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.output.export", "modulename": "corems.mass_spectra.output.export", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport", "kind": "class", "doc": "

    A class to export low resolution GC-MS data.

    \n\n

    This class provides methods to export low resolution GC-MS data to various formats such as Excel, CSV, HDF5, and Pandas DataFrame.

    \n\n

    Parameters:

    \n\n

    out_file_path : str\n The output file path.\ngcms : object\n The low resolution GCMS object.

    \n\n

    Attributes:

    \n\n

    output_file : Path\n The output file path as a Path object.\ngcms : object\n The low resolution GCMS object.

    \n\n

    Methods:

    \n\n
      \n
    • get_pandas_df(id_label=\"corems:\"). Get the exported data as a Pandas DataFrame.
    • \n
    • get_json(nan=False, id_label=\"corems:\"). Get the exported data as a JSON string.
    • \n
    • to_pandas(write_metadata=True, id_label=\"corems:\"). Export the data to a Pandas DataFrame and save it as a pickle file.
    • \n
    • to_excel(write_mode='a', write_metadata=True, id_label=\"corems:\"),\nExport the data to an Excel file.
    • \n
    • to_csv(separate_output=False, write_mode=\"w\", write_metadata=True, id_label=\"corems:\").\nExport the data to a CSV file.
    • \n
    • to_hdf(id_label=\"corems:\").\nExport the data to an HDF5 file.
    • \n
    • get_data_stats(gcms).\nGet statistics about the GCMS data.
    • \n
    \n"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.__init__", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.__init__", "kind": "function", "doc": "

    \n", "signature": "(out_file_path, gcms)"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.output_file", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.output_file", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.gcms", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.gcms", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.get_pandas_df", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.get_pandas_df", "kind": "function", "doc": "

    Get the exported data as a Pandas DataFrame.

    \n\n

    Parameters:

    \n\n

    id_label : str, optional\n The ID label for the data. Default is \"corems:\".

    \n\n

    Returns:

    \n\n

    DataFrame\n The exported data as a Pandas DataFrame.

    \n", "signature": "(self, id_label='corems:'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.get_json", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.get_json", "kind": "function", "doc": "

    Get the exported data as a JSON string.

    \n\n

    Parameters:

    \n\n

    nan : bool, optional\n Whether to include NaN values in the JSON string. Default is False.\nid_label : str, optional\n The ID label for the data. Default is \"corems:\".

    \n", "signature": "(self, nan=False, id_label='corems:'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.to_pandas", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.to_pandas", "kind": "function", "doc": "

    Export the data to a Pandas DataFrame and save it as a pickle file.

    \n\n

    Parameters:

    \n\n

    write_metadata : bool, optional\n Whether to write metadata to the output file.\nid_label : str, optional\n The ID label for the data.

    \n", "signature": "(self, write_metadata=True, id_label='corems:'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.to_excel", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.to_excel", "kind": "function", "doc": "

    Export the data to an Excel file.

    \n\n

    Parameters:

    \n\n

    write_mode : str, optional\n The write mode for the Excel file. Default is 'a' (append).\nwrite_metadata : bool, optional\n Whether to write metadata to the output file. Default is True.\nid_label : str, optional\n The ID label for the data. Default is \"corems:\".

    \n", "signature": "(self, write_mode='a', write_metadata=True, id_label='corems:'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.to_csv", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.to_csv", "kind": "function", "doc": "

    Export the data to a CSV file.

    \n\n

    Parameters:

    \n\n

    separate_output : bool, optional\n Whether to separate the output into multiple files. Default is False.\nwrite_mode : str, optional\n The write mode for the CSV file. Default is 'w' (write).\nwrite_metadata : bool, optional\n Whether to write metadata to the output file. Default is True.\nid_label : str, optional\n The ID label for the data. Default is \"corems:\".

    \n", "signature": "(\tself,\tseparate_output=False,\twrite_mode='w',\twrite_metadata=True,\tid_label='corems:'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.to_hdf", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.to_hdf", "kind": "function", "doc": "

    Export the data to an HDF5 file.

    \n\n

    Parameters:

    \n\n

    id_label : str, optional\n The ID label for the data. Default is \"corems:\".

    \n", "signature": "(self, id_label='corems:'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.get_data_stats", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.get_data_stats", "kind": "function", "doc": "

    Get statistics about the GCMS data.

    \n\n

    Parameters:

    \n\n

    gcms : object\n The low resolution GCMS object.

    \n\n

    Returns:

    \n\n

    dict\n A dictionary containing the data statistics.

    \n", "signature": "(self, gcms):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.get_calibration_stats", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.get_calibration_stats", "kind": "function", "doc": "

    Get statistics about the GC-MS calibration.

    \n\n

    Parameters:

    \n", "signature": "(self, gcms, id_label):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.get_blank_stats", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.get_blank_stats", "kind": "function", "doc": "

    Get statistics about the GC-MS blank.

    \n", "signature": "(self, gcms):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.get_instrument_metadata", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.get_instrument_metadata", "kind": "function", "doc": "

    Get metadata about the GC-MS instrument.

    \n", "signature": "(self, gcms):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.get_data_metadata", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.get_data_metadata", "kind": "function", "doc": "

    Get metadata about the GC-MS data.

    \n\n

    Parameters:

    \n\n

    gcms : object\n The low resolution GCMS object.\nid_label : str \n The ID label for the data.\noutput_path : str\n The output file path.

    \n\n

    Returns:

    \n\n

    dict\n A dictionary containing the data metadata.

    \n", "signature": "(self, gcms, id_label, output_path):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.get_parameters_json", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.get_parameters_json", "kind": "function", "doc": "

    Get the parameters as a JSON string.

    \n\n

    Parameters:

    \n\n

    gcms : GCMS object\n The low resolution GCMS object.\nid_label : str\n The ID label for the data.\noutput_path : str\n The output file path.

    \n\n

    Returns:

    \n\n

    str\n The parameters as a JSON string.

    \n", "signature": "(self, gcms, id_label, output_path):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.write_settings", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.write_settings", "kind": "function", "doc": "

    Write the settings to a JSON file.

    \n\n

    Parameters:

    \n\n

    output_path : str\n The output file path.\ngcms : GCMS object\n The low resolution GCMS object.\nid_label : str\n The ID label for the data. Default is \"emsl:\".

    \n", "signature": "(self, output_path, gcms, id_label='emsl:'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.get_list_dict_data", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.get_list_dict_data", "kind": "function", "doc": "

    Get the exported data as a list of dictionaries.

    \n\n

    Parameters:

    \n\n

    gcms : object\n The low resolution GCMS object.\ninclude_no_match : bool, optional\n Whether to include no match data. Default is True.\nno_match_inline : bool, optional\n Whether to include no match data inline. Default is False.

    \n\n

    Returns:

    \n\n

    list\n The exported data as a list of dictionaries.

    \n", "signature": "(self, gcms, include_no_match=True, no_match_inline=False):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.HighResMassSpectraExport", "modulename": "corems.mass_spectra.output.export", "qualname": "HighResMassSpectraExport", "kind": "class", "doc": "

    A class to export high resolution mass spectra data.

    \n\n

    This class provides methods to export high resolution mass spectra data to various formats such as Excel, CSV, HDF5, and Pandas DataFrame.

    \n\n

    Parameters:

    \n\n

    out_file_path : str | Path\n The output file path.\nmass_spectra : object\n The high resolution mass spectra object.\noutput_type : str, optional\n The output type. Default is 'excel'.

    \n", "bases": "corems.mass_spectrum.output.export.HighResMassSpecExport"}, {"fullname": "corems.mass_spectra.output.export.HighResMassSpectraExport.__init__", "modulename": "corems.mass_spectra.output.export", "qualname": "HighResMassSpectraExport.__init__", "kind": "function", "doc": "

    This constructor should always be called with keyword arguments. Arguments are:

    \n\n

    group should be None; reserved for future extension when a ThreadGroup\nclass is implemented.

    \n\n

    target is the callable object to be invoked by the run()\nmethod. Defaults to None, meaning nothing is called.

    \n\n

    name is the thread name. By default, a unique name is constructed of\nthe form \"Thread-N\" where N is a small decimal number.

    \n\n

    args is the argument tuple for the target invocation. Defaults to ().

    \n\n

    kwargs is a dictionary of keyword arguments for the target\ninvocation. Defaults to {}.

    \n\n

    If a subclass overrides the constructor, it must make sure to invoke\nthe base class constructor (Thread.__init__()) before doing anything\nelse to the thread.

    \n", "signature": "(out_file_path, mass_spectra, output_type='excel')"}, {"fullname": "corems.mass_spectra.output.export.HighResMassSpectraExport.output_file", "modulename": "corems.mass_spectra.output.export", "qualname": "HighResMassSpectraExport.output_file", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.output.export.HighResMassSpectraExport.dir_loc", "modulename": "corems.mass_spectra.output.export", "qualname": "HighResMassSpectraExport.dir_loc", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.output.export.HighResMassSpectraExport.mass_spectra", "modulename": "corems.mass_spectra.output.export", "qualname": "HighResMassSpectraExport.mass_spectra", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.output.export.HighResMassSpectraExport.get_pandas_df", "modulename": "corems.mass_spectra.output.export", "qualname": "HighResMassSpectraExport.get_pandas_df", "kind": "function", "doc": "

    Get the exported data as a Pandas DataFrame.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.HighResMassSpectraExport.to_pandas", "modulename": "corems.mass_spectra.output.export", "qualname": "HighResMassSpectraExport.to_pandas", "kind": "function", "doc": "

    Export the data to a Pandas DataFrame and save it as a pickle file.

    \n\n

    Parameters:

    \n\n

    write_metadata : bool, optional\n Whether to write metadata to the output file. Default is True.

    \n", "signature": "(self, write_metadata=True):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.HighResMassSpectraExport.to_excel", "modulename": "corems.mass_spectra.output.export", "qualname": "HighResMassSpectraExport.to_excel", "kind": "function", "doc": "

    Export the data to an Excel file.

    \n\n

    Parameters:

    \n\n

    write_metadata : bool, optional\n Whether to write metadata to the output file. Default is True.

    \n", "signature": "(self, write_metadata=True):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.HighResMassSpectraExport.to_csv", "modulename": "corems.mass_spectra.output.export", "qualname": "HighResMassSpectraExport.to_csv", "kind": "function", "doc": "

    Export the data to a CSV file.

    \n\n

    Parameters:

    \n\n

    write_metadata : bool, optional\n Whether to write metadata to the output file. Default is True.

    \n", "signature": "(self, write_metadata=True):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.HighResMassSpectraExport.get_mass_spectra_attrs", "modulename": "corems.mass_spectra.output.export", "qualname": "HighResMassSpectraExport.get_mass_spectra_attrs", "kind": "function", "doc": "

    Get the mass spectra attributes as a JSON string.

    \n\n

    Parameters:

    \n\n

    mass_spectra : object\n The high resolution mass spectra object.

    \n\n

    Returns:

    \n\n

    str\n The mass spectra attributes as a JSON string.

    \n", "signature": "(self, mass_spectra):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.HighResMassSpectraExport.to_hdf", "modulename": "corems.mass_spectra.output.export", "qualname": "HighResMassSpectraExport.to_hdf", "kind": "function", "doc": "

    Export the data to an HDF5 file.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum", "modulename": "corems.mass_spectrum", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc", "modulename": "corems.mass_spectrum.calc", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.AutoRecalibration", "modulename": "corems.mass_spectrum.calc.AutoRecalibration", "kind": "module", "doc": "

    Created on March 23 2023

    \n\n

    @author: Will Kew

    \n\n

    Modules for automatic mass internal recalibration

    \n"}, {"fullname": "corems.mass_spectrum.calc.AutoRecalibration.HighResRecalibration", "modulename": "corems.mass_spectrum.calc.AutoRecalibration", "qualname": "HighResRecalibration", "kind": "class", "doc": "

    This class is designed for high resolution (FTICR, Orbitrap) data of complex mixture, e.g. Organic matter

    \n\n

    The tool first does a broad mass range search for the most commonly expected ion type (i.e. CHO, deprotonated - for negative ESI)\nAnd then the assigned data mass error distribution is searched, with a gaussian fit to the most prominent range. \nThis tool works when the data are of sufficient quality, and not outwith the typical expected range of the mass analyzer\nIt presumes the mean error is out by 0-several ppm, but that the spread of error values is modest (<2ppm)

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (MassSpectrum):\nCoreMS mass spectrum object
    • \n
    • plot (bool, optional):\nWhether to plot the error distribution. The default is False.
    • \n
    • docker (bool, optional):\nWhether to use the docker database. The default is True. If not, it uses a dynamically generated sqlite database.
    • \n
    • ppmFWHMprior (float, optional):\nThe FWHM of the prior distribution (ppm). The default is 3.
    • \n
    • ppmRangeprior (float, optional):\nThe range of the prior distribution (ppm). The default is 15.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • determine_error_boundaries(). Determine the error boundaries for recalibration space.
    • \n
    \n\n
    Notes
    \n\n

    This initialisation function creates a copy of the MassSpectrum object to avoid over-writing assignments. \nPossible future task is to make the base class copyable.

    \n"}, {"fullname": "corems.mass_spectrum.calc.AutoRecalibration.HighResRecalibration.__init__", "modulename": "corems.mass_spectrum.calc.AutoRecalibration", "qualname": "HighResRecalibration.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tmass_spectrum,\tplot: bool = False,\tdocker: bool = True,\tppmFWHMprior: float = 3,\tppmRangeprior: float = 15)"}, {"fullname": "corems.mass_spectrum.calc.AutoRecalibration.HighResRecalibration.mass_spectrum", "modulename": "corems.mass_spectrum.calc.AutoRecalibration", "qualname": "HighResRecalibration.mass_spectrum", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.AutoRecalibration.HighResRecalibration.plot", "modulename": "corems.mass_spectrum.calc.AutoRecalibration", "qualname": "HighResRecalibration.plot", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.AutoRecalibration.HighResRecalibration.docker", "modulename": "corems.mass_spectrum.calc.AutoRecalibration", "qualname": "HighResRecalibration.docker", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.AutoRecalibration.HighResRecalibration.ppmFWHMprior", "modulename": "corems.mass_spectrum.calc.AutoRecalibration", "qualname": "HighResRecalibration.ppmFWHMprior", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.AutoRecalibration.HighResRecalibration.ppmRangeprior", "modulename": "corems.mass_spectrum.calc.AutoRecalibration", "qualname": "HighResRecalibration.ppmRangeprior", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.AutoRecalibration.HighResRecalibration.set_uncal_settings", "modulename": "corems.mass_spectrum.calc.AutoRecalibration", "qualname": "HighResRecalibration.set_uncal_settings", "kind": "function", "doc": "

    Set uncalibrated formula search settings

    \n\n

    This function serves the uncalibrated data (hence broad error tolerance)\nIt only allows CHO formula in deprotonated ion type- as most common for SRFA ESI negative mode

    \n\n

    This will not work for positive mode data, or for other ion types, or other expected elemental searches.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.AutoRecalibration.HighResRecalibration.positive_search_settings", "modulename": "corems.mass_spectrum.calc.AutoRecalibration", "qualname": "HighResRecalibration.positive_search_settings", "kind": "function", "doc": "

    Set the positive mode elemental search settings

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.AutoRecalibration.HighResRecalibration.get_error_range", "modulename": "corems.mass_spectrum.calc.AutoRecalibration", "qualname": "HighResRecalibration.get_error_range", "kind": "function", "doc": "

    Get the error range from the error distribution

    \n\n

    Using lmfit and seaborn kdeplot to extract the error range from the error distribution of assigned species.

    \n\n
    Parameters
    \n\n
      \n
    • errors (list):\nlist of the errors of the assigned species (ppm)
    • \n
    \n", "signature": "(self, errors: list):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.AutoRecalibration.HighResRecalibration.determine_error_boundaries", "modulename": "corems.mass_spectrum.calc.AutoRecalibration", "qualname": "HighResRecalibration.determine_error_boundaries", "kind": "function", "doc": "

    Determine the error boundaries for recalibration space

    \n\n

    This is the main function in this class\nSets the Molecular Formulas search settings, performs the initial formula search\nConverts the data to a dataframe, and gets the error range\nReturns the error thresholds.

    \n\n
    Returns
    \n\n
      \n
    • mean_error (float):\nmean mass error of the Gaussian distribution (ppm)
    • \n
    • fwhm_error (float):\nfull width half max of the gaussian error distribution (ppm)
    • \n
    • ppm_thresh (list):\nrecommended thresholds for the recalibration parameters (ppm)\nConsists of [mean_error-fwhm_error,mean_error+fwhm_error]
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.Calibration", "modulename": "corems.mass_spectrum.calc.Calibration", "kind": "module", "doc": "

    Created on Wed May 13 02:16:09 2020

    \n\n

    @author: Will Kew

    \n"}, {"fullname": "corems.mass_spectrum.calc.Calibration.MzDomainCalibration", "modulename": "corems.mass_spectrum.calc.Calibration", "qualname": "MzDomainCalibration", "kind": "class", "doc": "

    MzDomainCalibration class for recalibrating mass spectra

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (CoreMS MassSpectrum Object):\nThe mass spectrum to be calibrated.
    • \n
    • ref_masslist (str):\nThe path to a reference mass list.
    • \n
    • mzsegment (tuple of floats, optional):\nThe mz range to recalibrate, or None. Used for calibration of specific parts of the mz domain at a time.\nFuture work - allow multiple mzsegments to be passed.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • mass_spectrum (CoreMS MassSpectrum Object):\nThe mass spectrum to be calibrated.
    • \n
    • mzsegment (tuple of floats or None):\nThe mz range to recalibrate, or None.
    • \n
    • ref_mass_list_path (str or Path):\nThe path to the reference mass list.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • run(). \nMain function to run this class.
    • \n
    • load_ref_mass_list(). \nLoad reference mass list (Bruker format).
    • \n
    • gen_ref_mass_list_from_assigned(min_conf=0.7). \nGenerate reference mass list from assigned masses.
    • \n
    • find_calibration_points(df_ref, calib_ppm_error_threshold=(-1, 1), calib_snr_threshold=5). \nFind calibration points in the mass spectrum based on the reference mass list.
    • \n
    • robust_calib(param, cal_peaks_mz, cal_refs_mz, order=1). \nRecalibration function.
    • \n
    • recalibrate_mass_spectrum(cal_peaks_mz, cal_refs_mz, order=1, diagnostic=False). \nMain recalibration function which uses a robust linear regression.
    • \n
    \n"}, {"fullname": "corems.mass_spectrum.calc.Calibration.MzDomainCalibration.__init__", "modulename": "corems.mass_spectrum.calc.Calibration", "qualname": "MzDomainCalibration.__init__", "kind": "function", "doc": "

    \n", "signature": "(mass_spectrum, ref_masslist, mzsegment=None)"}, {"fullname": "corems.mass_spectrum.calc.Calibration.MzDomainCalibration.mass_spectrum", "modulename": "corems.mass_spectrum.calc.Calibration", "qualname": "MzDomainCalibration.mass_spectrum", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.Calibration.MzDomainCalibration.mzsegment", "modulename": "corems.mass_spectrum.calc.Calibration", "qualname": "MzDomainCalibration.mzsegment", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.Calibration.MzDomainCalibration.ref_mass_list_path", "modulename": "corems.mass_spectrum.calc.Calibration", "qualname": "MzDomainCalibration.ref_mass_list_path", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.Calibration.MzDomainCalibration.load_ref_mass_list", "modulename": "corems.mass_spectrum.calc.Calibration", "qualname": "MzDomainCalibration.load_ref_mass_list", "kind": "function", "doc": "

    Load reference mass list (Bruker format)

    \n\n

    Loads in a reference mass list from a .ref file\nNote that some versions of Bruker's software produce .ref files with a different format. \nAs such, users may need to manually edit the .ref file in a text editor to ensure it is in the correct format. \nCoreMS includes an example .ref file with the correct format for reference.

    \n\n
    Returns
    \n\n
      \n
    • df_ref (Pandas DataFrame):\nreference mass list object.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.Calibration.MzDomainCalibration.gen_ref_mass_list_from_assigned", "modulename": "corems.mass_spectrum.calc.Calibration", "qualname": "MzDomainCalibration.gen_ref_mass_list_from_assigned", "kind": "function", "doc": "

    Generate reference mass list from assigned masses

    \n\n

    This function will generate a ref mass dataframe object from an assigned corems mass spec obj\nusing assigned masses above a certain minimum confidence threshold.

    \n\n

    This function needs to be retested and check it is covered in the unit tests.

    \n\n
    Parameters
    \n\n
      \n
    • min_conf (float, optional):\nminimum confidence score. The default is 0.7.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • df_ref (Pandas DataFrame):\nreference mass list - based on calculated masses.
    • \n
    \n", "signature": "(self, min_conf: float = 0.7):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.Calibration.MzDomainCalibration.find_calibration_points", "modulename": "corems.mass_spectrum.calc.Calibration", "qualname": "MzDomainCalibration.find_calibration_points", "kind": "function", "doc": "

    Function to find calibration points in the mass spectrum

    \n\n

    Based on the reference mass list.

    \n\n
    Parameters
    \n\n
      \n
    • df_ref (Pandas DataFrame):\nreference mass list for recalibration.
    • \n
    • calib_ppm_error_threshold (tuple of floats, optional):\nppm error for finding calibration masses in the spectrum. The default is -1,1.\nNote: This is based on the calculation of ppm = ((mz_measure - mz_theoretical)/mz_theoretical)*1e6. \n Some software does this the other way around and value signs must be inverted for that to work.
    • \n
    • calib_snr_threshold (float, optional):\nsnr threshold for finding calibration masses in the spectrum. The default is 5.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • cal_peaks_mz (list of floats):\nmasses of measured ions to use in calibration routine
    • \n
    • cal_refs_mz (list of floats):\nreference mz values of found calibration points.
    • \n
    \n", "signature": "(\tself,\tdf_ref,\tcalib_ppm_error_threshold: tuple[float, float] = (-1, 1),\tcalib_snr_threshold: float = 5):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.Calibration.MzDomainCalibration.robust_calib", "modulename": "corems.mass_spectrum.calc.Calibration", "qualname": "MzDomainCalibration.robust_calib", "kind": "function", "doc": "

    Recalibration function

    \n\n

    Computes the rms of m/z errors to minimize when calibrating.\nThis is adapted from from spike.

    \n\n
    Parameters
    \n\n
      \n
    • param (list of floats):\ngenerated by minimize function from scipy optimize.
    • \n
    • cal_peaks_mz (list of floats):\nmasses of measured peaks to use in mass calibration.
    • \n
    • cal_peaks_mz (list of floats):\nreference mz values of found calibration points.
    • \n
    • order (int, optional):\norder of the recalibration function. 1 = linear, 2 = quadratic. The default is 1.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • rmserror (float):\nroot mean square mass error for calibration points.
    • \n
    \n", "signature": "(\tself,\tparam: list[float],\tcal_peaks_mz: list[float],\tcal_refs_mz: list[float],\torder: int = 1):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.Calibration.MzDomainCalibration.recalibrate_mass_spectrum", "modulename": "corems.mass_spectrum.calc.Calibration", "qualname": "MzDomainCalibration.recalibrate_mass_spectrum", "kind": "function", "doc": "

    Main recalibration function which uses a robust linear regression

    \n\n

    This function performs the recalibration of the mass spectrum object. \nIt iteratively applies

    \n\n
    Parameters
    \n\n
      \n
    • cal_peaks_mz (list of float):\nmasses of measured peaks to use in mass calibration.
    • \n
    • cal_refs_mz (list of float):\nreference mz values of found calibration points.
    • \n
    • order (int, optional):\norder of the recalibration function. 1 = linear, 2 = quadratic. The default is 1.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • mass_spectrum (CoreMS mass spectrum object):\nCalibrated mass spectrum object
    • \n
    \n\n
    Notes
    \n\n

    This function is adapted, in part, from the SPIKE project [1,2] and is based on the robust linear regression method.

    \n\n
    References
    \n\n
      \n
    1. Chiron L., Coutouly M-A., Starck J-P., Rolando C., Delsuc M-A. \nSPIKE a Processing Software dedicated to Fourier Spectroscopies \nhttps://arxiv.org/abs/1608.06777 (2016)
    2. \n
    3. SPIKE - https://github.com/spike-project/spike
    4. \n
    \n", "signature": "(\tself,\tcal_peaks_mz: list[float],\tcal_refs_mz: list[float],\torder: int = 1,\tdiagnostic: bool = False):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.Calibration.MzDomainCalibration.run", "modulename": "corems.mass_spectrum.calc.Calibration", "qualname": "MzDomainCalibration.run", "kind": "function", "doc": "

    Run the calibration routine

    \n\n

    This function runs the calibration routine.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.CalibrationCalc", "modulename": "corems.mass_spectrum.calc.CalibrationCalc", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.CalibrationCalc.FreqDomain_Calibration", "modulename": "corems.mass_spectrum.calc.CalibrationCalc", "qualname": "FreqDomain_Calibration", "kind": "class", "doc": "

    Frequency Domain Calibration class for mass spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (MassSpectrum):\nThe mass spectrum object.
    • \n
    • selected_mass_peaks (list):\nList of selected mass peaks.
    • \n
    • include_isotopologue (bool, optional):\nFlag to include isotopologues, by default False.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • mz_exp (ndarray):\nArray of experimental m/z values.
    • \n
    • mz_calc (ndarray):\nArray of calculated m/z values.
    • \n
    • freq_exp (ndarray):\nArray of experimental frequencies.
    • \n
    • mass_spectrum (MassSpectrum):\nThe mass spectrum object.
    • \n
    • freq_exp_ms (ndarray):\nArray of experimental frequencies for mass spectrum.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • recal_mass_spec(mz_domain, Aterm, Bterm, Cterm). \nRecalibrate the mass spectrum with the given parameters.
    • \n
    • linear(). \nPerform linear calibration.
    • \n
    • quadratic(iteration=False). \nPerform quadratic calibration.
    • \n
    • ledford_calibration(iteration=False). \nPerform Ledford calibration.
    • \n
    • step_fit(steps=4).
      \nPerform step fit calibration.
    • \n
    \n"}, {"fullname": "corems.mass_spectrum.calc.CalibrationCalc.FreqDomain_Calibration.__init__", "modulename": "corems.mass_spectrum.calc.CalibrationCalc", "qualname": "FreqDomain_Calibration.__init__", "kind": "function", "doc": "

    \n", "signature": "(mass_spectrum, selected_mass_peaks, include_isotopologue=False)"}, {"fullname": "corems.mass_spectrum.calc.CalibrationCalc.FreqDomain_Calibration.selected_mspeaks", "modulename": "corems.mass_spectrum.calc.CalibrationCalc", "qualname": "FreqDomain_Calibration.selected_mspeaks", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.CalibrationCalc.FreqDomain_Calibration.mz_exp", "modulename": "corems.mass_spectrum.calc.CalibrationCalc", "qualname": "FreqDomain_Calibration.mz_exp", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.CalibrationCalc.FreqDomain_Calibration.mz_calc", "modulename": "corems.mass_spectrum.calc.CalibrationCalc", "qualname": "FreqDomain_Calibration.mz_calc", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.CalibrationCalc.FreqDomain_Calibration.freq_exp", "modulename": "corems.mass_spectrum.calc.CalibrationCalc", "qualname": "FreqDomain_Calibration.freq_exp", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.CalibrationCalc.FreqDomain_Calibration.mass_spectrum", "modulename": "corems.mass_spectrum.calc.CalibrationCalc", "qualname": "FreqDomain_Calibration.mass_spectrum", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.CalibrationCalc.FreqDomain_Calibration.freq_exp_ms", "modulename": "corems.mass_spectrum.calc.CalibrationCalc", "qualname": "FreqDomain_Calibration.freq_exp_ms", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.CalibrationCalc.FreqDomain_Calibration.recal_mass_spec", "modulename": "corems.mass_spectrum.calc.CalibrationCalc", "qualname": "FreqDomain_Calibration.recal_mass_spec", "kind": "function", "doc": "

    Recalibrate the mass spectrum with the given parameters.

    \n\n
    Parameters
    \n\n
      \n
    • mz_domain (ndarray):\nArray of m/z values for recalibration.
    • \n
    • Aterm (float):\nAterm parameter for recalibration.
    • \n
    • Bterm (float):\nBterm parameter for recalibration.
    • \n
    • Cterm (float):\nCterm parameter for recalibration.
    • \n
    \n", "signature": "(self, mz_domain, Aterm, Bterm, Cterm):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.CalibrationCalc.FreqDomain_Calibration.linear", "modulename": "corems.mass_spectrum.calc.CalibrationCalc", "qualname": "FreqDomain_Calibration.linear", "kind": "function", "doc": "

    Perform linear calibration.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.CalibrationCalc.FreqDomain_Calibration.quadratic", "modulename": "corems.mass_spectrum.calc.CalibrationCalc", "qualname": "FreqDomain_Calibration.quadratic", "kind": "function", "doc": "

    Perform quadratic calibration.

    \n\n
    Parameters
    \n\n
      \n
    • iteration (bool, optional):\nFlag to perform iterative calibration, by default False.
    • \n
    \n", "signature": "(self, iteration: bool = False):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.CalibrationCalc.FreqDomain_Calibration.ledford_calibration", "modulename": "corems.mass_spectrum.calc.CalibrationCalc", "qualname": "FreqDomain_Calibration.ledford_calibration", "kind": "function", "doc": "

    Perform Ledford calibration.

    \n\n
    Parameters
    \n\n
      \n
    • iteration (bool, optional):\nFlag to perform iterative calibration, by default False.
    • \n
    \n", "signature": "(self, iteration: bool = False):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.CalibrationCalc.FreqDomain_Calibration.step_fit", "modulename": "corems.mass_spectrum.calc.CalibrationCalc", "qualname": "FreqDomain_Calibration.step_fit", "kind": "function", "doc": "

    Perform step fit calibration.

    \n\n
    Parameters
    \n\n
      \n
    • steps (int, optional):\nNumber of steps for step fit calibration, by default 4.
    • \n
    \n", "signature": "(self, steps: int = 4):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.KendrickGroup", "modulename": "corems.mass_spectrum.calc.KendrickGroup", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.KendrickGroup.KendrickGrouping", "modulename": "corems.mass_spectrum.calc.KendrickGroup", "qualname": "KendrickGrouping", "kind": "class", "doc": "

    Class for Kendrick grouping of mass spectra.

    \n\n
    Methods
    \n\n
      \n
    • mz_odd_even_index_lists(). \nGet odd and even indexes lists.
    • \n
    • calc_error(current, test). \nCalculate the error between two values.
    • \n
    • populate_kendrick_index_dict_error(list_indexes, sort=True). \nPopulate the Kendrick index dictionary based on error.
    • \n
    • populate_kendrick_index_dict_rounding(list_indexes, sort=True). \nPopulate the Kendrick index dictionary based on rounding.
    • \n
    • sort_abundance_kendrick_dict(even_kendrick_group_index, odd_kendrick_group_index). \nSort the Kendrick index dictionary based on abundance.
    • \n
    • kendrick_groups_indexes(sort=True). \nGet the Kendrick groups indexes dictionary.
    • \n
    \n"}, {"fullname": "corems.mass_spectrum.calc.KendrickGroup.KendrickGrouping.mz_odd_even_index_lists", "modulename": "corems.mass_spectrum.calc.KendrickGroup", "qualname": "KendrickGrouping.mz_odd_even_index_lists", "kind": "function", "doc": "

    Get odd and even indexes lists.

    \n\n
    Returns
    \n\n
      \n
    • tuple: A tuple containing the lists of even and odd indexes.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.KendrickGroup.KendrickGrouping.calc_error", "modulename": "corems.mass_spectrum.calc.KendrickGroup", "qualname": "KendrickGrouping.calc_error", "kind": "function", "doc": "

    Calculate the error between two values.

    \n\n
    Parameters
    \n\n
      \n
    • current (float):\nThe current value.
    • \n
    • test (float):\nThe test value.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: The calculated error.
    • \n
    \n", "signature": "(self, current: float, test: float):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.KendrickGroup.KendrickGrouping.populate_kendrick_index_dict_error", "modulename": "corems.mass_spectrum.calc.KendrickGroup", "qualname": "KendrickGrouping.populate_kendrick_index_dict_error", "kind": "function", "doc": "

    Populate the Kendrick index dictionary based on error.

    \n\n
    Parameters
    \n\n
      \n
    • list_indexes (list):\nThe list of indexes.
    • \n
    • sort (bool, optional):\nWhether to sort the dictionary by abundance (default is True).
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: The Kendrick index dictionary.
    • \n
    \n", "signature": "(self, list_indexes: list, sort: bool = True):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.KendrickGroup.KendrickGrouping.populate_kendrick_index_dict_rounding", "modulename": "corems.mass_spectrum.calc.KendrickGroup", "qualname": "KendrickGrouping.populate_kendrick_index_dict_rounding", "kind": "function", "doc": "

    Populate the Kendrick index dictionary based on rounding.

    \n\n
    Parameters
    \n\n
      \n
    • list_indexes (list):\nThe list of indexes.
    • \n
    • sort (bool, optional):\nWhether to sort the dictionary by abundance (default is True).
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: The Kendrick index dictionary.
    • \n
    \n", "signature": "(self, list_indexes: list, sort: bool = True):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.KendrickGroup.KendrickGrouping.sort_abundance_kendrick_dict", "modulename": "corems.mass_spectrum.calc.KendrickGroup", "qualname": "KendrickGrouping.sort_abundance_kendrick_dict", "kind": "function", "doc": "

    Sort the Kendrick index dictionary based on abundance.

    \n\n
    Parameters
    \n\n
      \n
    • even_kendrick_group_index (dict):\nThe Kendrick index dictionary for even indexes.
    • \n
    • odd_kendrick_group_index (dict):\nThe Kendrick index dictionary for odd indexes.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: The sorted Kendrick index dictionary.
    • \n
    \n", "signature": "(\tself,\teven_kendrick_group_index: dict,\todd_kendrick_group_index: dict):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.KendrickGroup.KendrickGrouping.kendrick_groups_indexes", "modulename": "corems.mass_spectrum.calc.KendrickGroup", "qualname": "KendrickGrouping.kendrick_groups_indexes", "kind": "function", "doc": "

    Get the Kendrick groups indexes dictionary.

    \n\n
    Parameters
    \n\n
      \n
    • sort (bool, optional):\nWhether to sort the dictionary by abundance (default is True).
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: The Kendrick groups indexes dictionary.
    • \n
    \n", "signature": "(self, sort: bool = True):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction.MassErrorPrediction", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "qualname": "MassErrorPrediction", "kind": "class", "doc": "

    Class for mass error prediction.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (list):\nList of mass spectrum objects.
    • \n
    • mz_overlay (int, optional):\nThe mz overlay value for peak simulation. Default is 10.
    • \n
    • rp_increments (int, optional):\nThe resolving power increments for peak simulation. Default is 10000.
    • \n
    • base_line_target (float, optional):\nThe target value for the baseline resolution. Default is 0.01.
    • \n
    • max_interation (int, optional):\nThe maximum number of iterations for peak simulation. Default is 1000.
    • \n
    • interpolation (str, optional):\nThe interpolation method for missing data. Default is 'linear'.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • mass_spectrum_obj (list):\nList of mass spectrum objects.
    • \n
    • mz_overlay (int):\nThe mz overlay value for peak simulation.
    • \n
    • rp_increments (int):\nThe resolving power increments for peak simulation.
    • \n
    • base_line_target (float):\nThe target value for the baseline resolution.
    • \n
    • max_interation (int):\nThe maximum number of iterations for peak simulation.
    • \n
    • df (DataFrame or None):\nThe calculated error distribution dataframe.
    • \n
    • interpolation (str):\nThe interpolation method for missing data.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • run().\nRuns the mass error prediction calculation.
    • \n
    • get_results().\nReturns the calculated error distribution dataframe.
    • \n
    \n", "bases": "threading.Thread"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction.MassErrorPrediction.__init__", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "qualname": "MassErrorPrediction.__init__", "kind": "function", "doc": "

    This constructor should always be called with keyword arguments. Arguments are:

    \n\n

    group should be None; reserved for future extension when a ThreadGroup\nclass is implemented.

    \n\n

    target is the callable object to be invoked by the run()\nmethod. Defaults to None, meaning nothing is called.

    \n\n

    name is the thread name. By default, a unique name is constructed of\nthe form \"Thread-N\" where N is a small decimal number.

    \n\n

    args is the argument tuple for the target invocation. Defaults to ().

    \n\n

    kwargs is a dictionary of keyword arguments for the target\ninvocation. Defaults to {}.

    \n\n

    If a subclass overrides the constructor, it must make sure to invoke\nthe base class constructor (Thread.__init__()) before doing anything\nelse to the thread.

    \n", "signature": "(\tmass_spectrum,\tmz_overlay=10,\trp_increments=10000,\tbase_line_target: float = 0.01,\tmax_interation=1000,\tinterpolation='linear')"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction.MassErrorPrediction.mass_spectrum_obj", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "qualname": "MassErrorPrediction.mass_spectrum_obj", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction.MassErrorPrediction.mz_overlay", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "qualname": "MassErrorPrediction.mz_overlay", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction.MassErrorPrediction.rp_increments", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "qualname": "MassErrorPrediction.rp_increments", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction.MassErrorPrediction.base_line_target", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "qualname": "MassErrorPrediction.base_line_target", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction.MassErrorPrediction.max_interation", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "qualname": "MassErrorPrediction.max_interation", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction.MassErrorPrediction.df", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "qualname": "MassErrorPrediction.df", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction.MassErrorPrediction.interpolation", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "qualname": "MassErrorPrediction.interpolation", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction.MassErrorPrediction.run", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "qualname": "MassErrorPrediction.run", "kind": "function", "doc": "

    Runs the mass error prediction calculation.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction.MassErrorPrediction.get_results", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "qualname": "MassErrorPrediction.get_results", "kind": "function", "doc": "

    Returns the calculated error distribution dataframe.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction.MassErrorPrediction.calc_error_dist", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "qualname": "MassErrorPrediction.calc_error_dist", "kind": "function", "doc": "

    Calculate the error distribution.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction.MassErrorPrediction.sum_data", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "qualname": "MassErrorPrediction.sum_data", "kind": "function", "doc": "

    Sum the abundances of the simulated peaks.

    \n\n
    Parameters
    \n\n
      \n
    • tuple_mz_abun_list (tuple):\nA tuple containing the mz and abundance lists.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • tuple: A tuple containing the summed mz and abundance lists.
    • \n
    \n", "signature": "(self, tuple_mz_abun_list: tuple):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction.MassErrorPrediction.calc_error", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "qualname": "MassErrorPrediction.calc_error", "kind": "function", "doc": "

    Calculate the error between two values.

    \n\n
    Parameters
    \n\n
      \n
    • mass_ref (float):\nThe reference value.
    • \n
    • mass_sim (float):\nThe simulated value.
    • \n
    • factor (float):\nThe factor to multiply the error by.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: The calculated error.
    • \n
    \n", "signature": "(self, mass_ref, mass_sim, factor):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction.MassErrorPrediction.find_peak_apex", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "qualname": "MassErrorPrediction.find_peak_apex", "kind": "function", "doc": "

    Find the peak apex.

    \n\n
    Parameters
    \n\n
      \n
    • mz (array):\nThe mz array.
    • \n
    • abund (array):\nThe abundance array.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • tuple: A tuple containing the peak apex mass and abundance.
    • \n
    \n", "signature": "(self, mz, abund):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction.MassErrorPrediction.find_peak_valley", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "qualname": "MassErrorPrediction.find_peak_valley", "kind": "function", "doc": "

    Find the peak valley.

    \n\n
    Parameters
    \n\n
      \n
    • mz (array):\nThe mz array.
    • \n
    • abund (array):\nThe abundance array.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • tuple: A tuple containing the peak valley mz and abundance.
    • \n
    \n", "signature": "(self, mz, abund):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.MassSpectrumCalc", "modulename": "corems.mass_spectrum.calc.MassSpectrumCalc", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.MassSpectrumCalc.MassSpecCalc", "modulename": "corems.mass_spectrum.calc.MassSpectrumCalc", "qualname": "MassSpecCalc", "kind": "class", "doc": "

    Class for Mass Spectrum Calculations

    \n\n

    Class including numerical calculations related to mass spectrum class\nInherited PeakPicking and NoiseThresholdCalc ensuring its methods are \navailable to the instantiated mass spectrum class object

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (MassSpectrum):\nCoreMS mass spectrum object
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • All Attributes are derivative from the MassSpecBase Class
    • \n
    \n\n
    Methods
    \n\n
      \n
    • check_mspeaks(). \nCheck if the mspeaks attribute is populated
    • \n
    • sort_by_abundance(). \nSort the mspeaks by abundance
    • \n
    • percentile_assigned(report_error=False,verbose=True). \nCalculate the percentage of assigned peaks
    • \n
    • resolving_power_calc(B, T). \nCalculate the resolving power
    • \n
    • number_average_molecular_weight(profile=False). \nCalculate the number average molecular weight
    • \n
    • weight_average_molecular_weight(profile=False). \nCalculate the weight average molecular weight
    • \n
    \n", "bases": "corems.mass_spectrum.calc.PeakPicking.PeakPicking, corems.mass_spectrum.calc.NoiseCalc.NoiseThresholdCalc"}, {"fullname": "corems.mass_spectrum.calc.MassSpectrumCalc.MassSpecCalc.percentile_assigned", "modulename": "corems.mass_spectrum.calc.MassSpectrumCalc", "qualname": "MassSpecCalc.percentile_assigned", "kind": "function", "doc": "

    Percentage of peaks which are assigned

    \n\n
    Parameters
    \n\n
      \n
    • report_error (bool, optional):\nReport the error of the assigned peaks. Default is False.
    • \n
    • verbose (bool, optional):\nPrint the results. Default is True.
    • \n
    \n", "signature": "(self, report_error: bool = False, verbose: bool = True):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.MassSpectrumCalc.MassSpecCalc.resolving_power_calc", "modulename": "corems.mass_spectrum.calc.MassSpectrumCalc", "qualname": "MassSpecCalc.resolving_power_calc", "kind": "function", "doc": "

    Calculate the theoretical resolving power

    \n\n

    Calls on the MSPeak object function to calculate the resolving power of a peak, this calcs for all peaks in a spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • T (float):\ntransient time
    • \n
    • B (float):\nMagnetic Filed Strength (Tesla)
    • \n
    \n\n
    References
    \n\n
      \n
    1. Marshall et al. (Mass Spectrom Rev. 1998 Jan-Feb;17(1):1-35.)\nDOI: 10.1002/(SICI)1098-2787(1998)17:1<1::AID-MAS1>3.0.CO;2-K
    2. \n
    \n", "signature": "(self, B: float, T: float):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.MassSpectrumCalc.MassSpecCalc.number_average_molecular_weight", "modulename": "corems.mass_spectrum.calc.MassSpectrumCalc", "qualname": "MassSpecCalc.number_average_molecular_weight", "kind": "function", "doc": "

    Average molecular weight calculation

    \n\n
    Parameters
    \n\n
      \n
    • profile (bool, optional):\nis data profile or centroid mode. The default is False (e.g. Centroid data)
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: The average molecular weight.
    • \n
    \n", "signature": "(self, profile: bool = False):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.MassSpectrumCalc.MassSpecCalc.weight_average_molecular_weight", "modulename": "corems.mass_spectrum.calc.MassSpectrumCalc", "qualname": "MassSpecCalc.weight_average_molecular_weight", "kind": "function", "doc": "

    Weighted Average molecular weight calculation

    \n\n
    Returns
    \n\n
      \n
    • float: The weight average molecular weight.
    • \n
    \n", "signature": "(self, profile: bool = False):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.MeanResolvingPowerFilter", "modulename": "corems.mass_spectrum.calc.MeanResolvingPowerFilter", "kind": "module", "doc": "

    Created on June 2nd 2023

    \n\n

    @author: Will Kew

    \n\n

    Module for mean resolving power filtration\nBased upon the work in:

    \n\n

    Kanawati, B, Bader, TM, Wanczek, K-P, Li, Y, Schmitt-Kopplin, P. \nFourier transform (FT)-artifacts and power-function resolution filter in Fourier transform mass spectrometry. \nRapid Commun Mass Spectrom. 2017; 31: 1607- 1615. https://doi.org/10.1002/rcm.7940

    \n\n

    Calculates a m/z normalised resolving power, fits a gaussian distribution to this, and then filters out peaks which are outside of the user defined number of standard deviations

    \n"}, {"fullname": "corems.mass_spectrum.calc.MeanResolvingPowerFilter.MeanResolvingPowerFilter", "modulename": "corems.mass_spectrum.calc.MeanResolvingPowerFilter", "qualname": "MeanResolvingPowerFilter", "kind": "class", "doc": "

    Class for for mean resolving power filtration.

    \n\n

    This module implements a mean resolving power filter based on the work described [1]

    \n\n

    The MeanResolvingPowerFilter class provides methods to calculate the m/z normalized resolving power, fit a Gaussian distribution to it, and filter out peaks that are outside of the user-defined number of standard deviations.

    \n\n
    Attributes
    \n\n
      \n
    • mass_spectrum (object) (The mass spectrum object.):

    • \n
    • ndeviations (int) (The number of standard deviations used for filtering.):

    • \n
    • plot (bool) (Flag indicating whether to plot the results.):

    • \n
    • guess_pars (bool) (Flag indicating whether to guess the parameters for the Gaussian model.):

    • \n
    \n\n
    Methods
    \n\n
      \n
    • extract_peaks(): Extracts the peaks from the mass spectrum.
    • \n
    • normalise_rps(tmpdf_ms): Normalizes the resolving powers to be independent of m/z.
    • \n
    • calculate_distribution(tmpdf_ms): Calculates the distribution of the resolving powers.
    • \n
    • create_index_list_to_remove(tmpdf_ms, rps_thresh): Creates an index list of peaks to remove based on the calculated thresholds.
    • \n
    • main(): Executes the main filtering process and returns the index list of peaks to remove.
    • \n
    \n\n
    References
    \n\n
      \n
    1. Kanawati, B, Bader, TM, Wanczek, K-P, Li, Y, Schmitt-Kopplin, P. \nFourier transform (FT)-artifacts and power-function resolution filter in Fourier transform mass spectrometry. \nRapid Commun Mass Spectrom. 2017; 31: 1607- 1615. https://doi.org/10.1002/rcm.7940
    2. \n
    \n"}, {"fullname": "corems.mass_spectrum.calc.MeanResolvingPowerFilter.MeanResolvingPowerFilter.__init__", "modulename": "corems.mass_spectrum.calc.MeanResolvingPowerFilter", "qualname": "MeanResolvingPowerFilter.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tmass_spectrum,\tndeviations: float = 3,\tplot: bool = False,\tguess_pars: bool = False)"}, {"fullname": "corems.mass_spectrum.calc.MeanResolvingPowerFilter.MeanResolvingPowerFilter.mass_spectrum", "modulename": "corems.mass_spectrum.calc.MeanResolvingPowerFilter", "qualname": "MeanResolvingPowerFilter.mass_spectrum", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.MeanResolvingPowerFilter.MeanResolvingPowerFilter.plot", "modulename": "corems.mass_spectrum.calc.MeanResolvingPowerFilter", "qualname": "MeanResolvingPowerFilter.plot", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.MeanResolvingPowerFilter.MeanResolvingPowerFilter.ndeviations", "modulename": "corems.mass_spectrum.calc.MeanResolvingPowerFilter", "qualname": "MeanResolvingPowerFilter.ndeviations", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.MeanResolvingPowerFilter.MeanResolvingPowerFilter.guess_pars", "modulename": "corems.mass_spectrum.calc.MeanResolvingPowerFilter", "qualname": "MeanResolvingPowerFilter.guess_pars", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.MeanResolvingPowerFilter.MeanResolvingPowerFilter.extract_peaks", "modulename": "corems.mass_spectrum.calc.MeanResolvingPowerFilter", "qualname": "MeanResolvingPowerFilter.extract_peaks", "kind": "function", "doc": "

    Extracts the peaks from the mass spectrum.

    \n\n
    Returns
    \n\n
      \n
    • tmpdf_ms (Pandas DataFrame):\nA DataFrame containing the extracted peaks.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.MeanResolvingPowerFilter.MeanResolvingPowerFilter.normalise_rps", "modulename": "corems.mass_spectrum.calc.MeanResolvingPowerFilter", "qualname": "MeanResolvingPowerFilter.normalise_rps", "kind": "function", "doc": "

    Normalizes the resolving powers to be independent of m/z.

    \n\n
    Parameters
    \n\n
      \n
    • tmpdf_ms (Pandas DataFrame):\nA DataFrame containing the extracted peaks.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • tmpdf_ms (Pandas DataFrame):\nA DataFrame with the resolving powers normalized.
    • \n
    \n", "signature": "(self, tmpdf_ms):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.MeanResolvingPowerFilter.MeanResolvingPowerFilter.calculate_distribution", "modulename": "corems.mass_spectrum.calc.MeanResolvingPowerFilter", "qualname": "MeanResolvingPowerFilter.calculate_distribution", "kind": "function", "doc": "

    Calculates the distribution of the resolving powers.

    \n\n
    Parameters
    \n\n
      \n
    • tmpdf_ms (Pandas DataFrame):\nA DataFrame containing the extracted peaks with normalized resolving powers.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • rps_thresh (list):\nA list of the calculated thresholds for filtering.
    • \n
    \n", "signature": "(self, tmpdf_ms):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.MeanResolvingPowerFilter.MeanResolvingPowerFilter.create_index_list_to_remove", "modulename": "corems.mass_spectrum.calc.MeanResolvingPowerFilter", "qualname": "MeanResolvingPowerFilter.create_index_list_to_remove", "kind": "function", "doc": "

    Creates an index list of peaks to remove based on the calculated thresholds.

    \n\n
    Parameters
    \n\n
      \n
    • tmpdf_ms (Pandas DataFrame):\nA DataFrame containing the extracted peaks with normalized resolving powers.
    • \n
    • rps_thresh (list):\nA list of the calculated thresholds for filtering.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • index_to_keep (list):\nA list of indices of peaks to keep.
    • \n
    \n", "signature": "(self, tmpdf_ms, rps_thresh: list):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.MeanResolvingPowerFilter.MeanResolvingPowerFilter.main", "modulename": "corems.mass_spectrum.calc.MeanResolvingPowerFilter", "qualname": "MeanResolvingPowerFilter.main", "kind": "function", "doc": "

    Executes the main filtering process and returns the index list of peaks to remove.

    \n\n
    Returns
    \n\n
      \n
    • index_to_remove (list):\nA list of indices of peaks to remove.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.NoiseCalc", "modulename": "corems.mass_spectrum.calc.NoiseCalc", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.NoiseCalc.NoiseThresholdCalc", "modulename": "corems.mass_spectrum.calc.NoiseCalc", "qualname": "NoiseThresholdCalc", "kind": "class", "doc": "

    Class for noise threshold calculation.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (MassSpectrum):\nThe mass spectrum object.
    • \n
    • settings (MSParameters):\nThe mass spectrum parameters object.
    • \n
    • is_centroid (bool):\nFlag indicating whether the mass spectrum is centroid or profile.
    • \n
    • baseline_noise (float):\nThe baseline noise.
    • \n
    • baseline_noise_std (float):\nThe baseline noise standard deviation.
    • \n
    • max_signal_to_noise (float):\nThe maximum signal to noise.
    • \n
    • max_abundance (float):\nThe maximum abundance.
    • \n
    • abundance (np.array):\nThe abundance array.
    • \n
    • abundance_profile (np.array):\nThe abundance profile array.
    • \n
    • mz_exp (np.array):\nThe experimental m/z array.
    • \n
    • mz_exp_profile (np.array):\nThe experimental m/z profile array.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • None
    • \n
    \n\n
    Methods
    \n\n
      \n
    • get_noise_threshold(). Get the noise threshold.
    • \n
    • cut_mz_domain_noise(). Cut the m/z domain to the noise threshold regions.
    • \n
    • get_noise_average(ymincentroid). \nGet the average noise and standard deviation.
    • \n
    • get_abundance_minima_centroid(abun_cut)\nGet the abundance minima for centroid data.
    • \n
    • run_log_noise_threshold_calc(). \nRun the log noise threshold calculation.
    • \n
    • run_noise_threshold_calc(). \nRun the noise threshold calculation.
    • \n
    \n"}, {"fullname": "corems.mass_spectrum.calc.NoiseCalc.NoiseThresholdCalc.get_noise_threshold", "modulename": "corems.mass_spectrum.calc.NoiseCalc", "qualname": "NoiseThresholdCalc.get_noise_threshold", "kind": "function", "doc": "

    Get the noise threshold.

    \n\n
    Returns
    \n\n
      \n
    • Tuple[Tuple[float, float], Tuple[float, float]]: A tuple containing the m/z and abundance noise thresholds.\n(min_mz, max_mz), (noise_threshold, noise_threshold)
    • \n
    \n", "signature": "(self) -> Tuple[Tuple[float, float], Tuple[float, float]]:", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.NoiseCalc.NoiseThresholdCalc.cut_mz_domain_noise", "modulename": "corems.mass_spectrum.calc.NoiseCalc", "qualname": "NoiseThresholdCalc.cut_mz_domain_noise", "kind": "function", "doc": "

    Cut the m/z domain to the noise threshold regions.

    \n\n
    Returns
    \n\n
      \n
    • Tuple[np.array, np.array]: A tuple containing the m/z and abundance arrays of the truncated spectrum region.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.NoiseCalc.NoiseThresholdCalc.get_noise_average", "modulename": "corems.mass_spectrum.calc.NoiseCalc", "qualname": "NoiseThresholdCalc.get_noise_average", "kind": "function", "doc": "

    Get the average noise and standard deviation.

    \n\n
    Parameters
    \n\n
      \n
    • ymincentroid (np.array):\nThe ymincentroid array.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • Tuple[float, float]: A tuple containing the average noise and standard deviation.
    • \n
    \n", "signature": "(self, ymincentroid):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.NoiseCalc.NoiseThresholdCalc.get_abundance_minima_centroid", "modulename": "corems.mass_spectrum.calc.NoiseCalc", "qualname": "NoiseThresholdCalc.get_abundance_minima_centroid", "kind": "function", "doc": "

    Get the abundance minima for centroid data.

    \n\n
    Parameters
    \n\n
      \n
    • abun_cut (np.array):\nThe abundance cut array.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • np.array: The abundance minima array.
    • \n
    \n", "signature": "(self, abun_cut):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.NoiseCalc.NoiseThresholdCalc.run_log_noise_threshold_calc", "modulename": "corems.mass_spectrum.calc.NoiseCalc", "qualname": "NoiseThresholdCalc.run_log_noise_threshold_calc", "kind": "function", "doc": "

    Run the log noise threshold calculation.

    \n\n
    Returns
    \n\n
      \n
    • Tuple[float, float]: A tuple containing the average noise and standard deviation.
    • \n
    \n\n
    Notes
    \n\n

    Method for estimating the noise based on decimal log of all the data point

    \n\n

    Idea is that you calculate a histogram of of the log10(abundance) values. \nThe maximum of the histogram == the standard deviation of the noise.

    \n\n

    For aFT data it is a gaussian distribution of noise - not implemented here!\nFor mFT data it is a Rayleigh distribution, and the value is actually 10^(abu_max)*0.463.

    \n\n

    See the publication cited above for the derivation of this.

    \n\n
    References
    \n\n
      \n
    1. dx.doi.org/10.1021/ac403278t | Anal. Chem. 2014, 86, 3308\u22123316
    2. \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.NoiseCalc.NoiseThresholdCalc.run_noise_threshold_calc", "modulename": "corems.mass_spectrum.calc.NoiseCalc", "qualname": "NoiseThresholdCalc.run_noise_threshold_calc", "kind": "function", "doc": "

    Runs noise threshold calculation (not log based method)

    \n\n
    Returns
    \n\n
      \n
    • Tuple[float, float]: A tuple containing the average noise and standard deviation.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.NoiseCalc_Bayes", "modulename": "corems.mass_spectrum.calc.NoiseCalc_Bayes", "kind": "module", "doc": "

    This code is for Bayesian estimation of the noise levels. \nIt is it not implemented or used in the current code base. \nThe packages it uses are not part of the requirements. \nIf you want to use it, you will need to install them manually.

    \n"}, {"fullname": "corems.mass_spectrum.calc.NoiseCalc_Bayes.BayesNoiseCalc", "modulename": "corems.mass_spectrum.calc.NoiseCalc_Bayes", "qualname": "BayesNoiseCalc", "kind": "class", "doc": "

    Class for noise threshold calculation.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (MassSpectrum):\nThe mass spectrum object.
    • \n
    • settings (MSParameters):\nThe mass spectrum parameters object.
    • \n
    • is_centroid (bool):\nFlag indicating whether the mass spectrum is centroid or profile.
    • \n
    • baseline_noise (float):\nThe baseline noise.
    • \n
    • baseline_noise_std (float):\nThe baseline noise standard deviation.
    • \n
    • max_signal_to_noise (float):\nThe maximum signal to noise.
    • \n
    • max_abundance (float):\nThe maximum abundance.
    • \n
    • abundance (np.array):\nThe abundance array.
    • \n
    • abundance_profile (np.array):\nThe abundance profile array.
    • \n
    • mz_exp (np.array):\nThe experimental m/z array.
    • \n
    • mz_exp_profile (np.array):\nThe experimental m/z profile array.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • None
    • \n
    \n\n
    Methods
    \n\n
      \n
    • get_noise_threshold(). Get the noise threshold.
    • \n
    • cut_mz_domain_noise(). Cut the m/z domain to the noise threshold regions.
    • \n
    • get_noise_average(ymincentroid). \nGet the average noise and standard deviation.
    • \n
    • get_abundance_minima_centroid(abun_cut)\nGet the abundance minima for centroid data.
    • \n
    • run_log_noise_threshold_calc(). \nRun the log noise threshold calculation.
    • \n
    • run_noise_threshold_calc(). \nRun the noise threshold calculation.
    • \n
    \n", "bases": "corems.mass_spectrum.calc.NoiseCalc.NoiseThresholdCalc"}, {"fullname": "corems.mass_spectrum.calc.NoiseCalc_Bayes.BayesNoiseCalc.from_posterior", "modulename": "corems.mass_spectrum.calc.NoiseCalc_Bayes", "qualname": "BayesNoiseCalc.from_posterior", "kind": "function", "doc": "

    Legacy code for Bayesian efforts - not used.

    \n\n

    pymc3 is not installed by default, \n if have plans to use it manual installation of pymc3 \n package before using this method is needed

    \n", "signature": "(self, param, samples):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.NoiseCalc_Bayes.BayesNoiseCalc.error_model_from_trace", "modulename": "corems.mass_spectrum.calc.NoiseCalc_Bayes", "qualname": "BayesNoiseCalc.error_model_from_trace", "kind": "function", "doc": "

    Legacy code for Bayesian efforts - not used.

    \n\n

    pymc3 is not installed by default, \n if have plans to use it manual installation of pymc3 \n package before using this method is needed

    \n", "signature": "(self, trace, ymincentroid):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.NoiseCalc_Bayes.BayesNoiseCalc.simple_model_error_dist", "modulename": "corems.mass_spectrum.calc.NoiseCalc_Bayes", "qualname": "BayesNoiseCalc.simple_model_error_dist", "kind": "function", "doc": "

    Legacy code for Bayesian efforts - not used.

    \n\n

    pymc3 is not installed by default, \n if have plans to use it manual installation of pymc3 \n package before using this method is needed

    \n", "signature": "(self, ymincentroid):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.PeakPicking", "modulename": "corems.mass_spectrum.calc.PeakPicking", "kind": "module", "doc": "

    @author: Yuri E. Corilo\n@date: Jun 27, 2019

    \n"}, {"fullname": "corems.mass_spectrum.calc.PeakPicking.PeakPicking", "modulename": "corems.mass_spectrum.calc.PeakPicking", "qualname": "PeakPicking", "kind": "class", "doc": "

    Class for peak picking.

    \n\n
    Parameters
    \n\n
      \n
    • None
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • None
    • \n
    \n\n
    Methods
    \n\n
      \n
    • cut_mz_domain_peak_picking().\nCut the m/z domain for peak picking.
    • \n
    • extrapolate_axes_for_pp().\nExtrapolate the m/z axis and fill the abundance axis with 0s.
    • \n
    • do_peak_picking().\nPerform peak picking.
    • \n
    • find_minima(apex_index, abundance, len_abundance, right=True).\nFind the minima of a peak.
    • \n
    • calculate_resolving_power(intes, massa, current_index).\nCalculate the resolving power of a peak.
    • \n
    • cal_minima(mass, abun).\nCalculate the minima of a peak.
    • \n
    • calc_centroid(mass, abund, freq).\nCalculate the centroid of a peak.
    • \n
    \n"}, {"fullname": "corems.mass_spectrum.calc.PeakPicking.PeakPicking.cut_mz_domain_peak_picking", "modulename": "corems.mass_spectrum.calc.PeakPicking", "qualname": "PeakPicking.cut_mz_domain_peak_picking", "kind": "function", "doc": "

    Cut the m/z domain for peak picking.

    \n\n
    Returns
    \n\n
      \n
    • mz_domain_X_low_cutoff (ndarray):\nThe m/z values within the specified range.
    • \n
    • mz_domain_low_Y_cutoff (ndarray):\nThe abundance values within the specified range.
    • \n
    • freq_domain_low_Y_cutoff (ndarray or None):\nThe frequency values within the specified range, if available.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.PeakPicking.PeakPicking.extrapolate_axes_for_pp", "modulename": "corems.mass_spectrum.calc.PeakPicking", "qualname": "PeakPicking.extrapolate_axes_for_pp", "kind": "function", "doc": "

    Extrapolate the m/z axis and fill the abundance axis with 0s.

    \n\n
    Returns
    \n\n
      \n
    • mz (ndarray):\nThe extrapolated m/z axis.
    • \n
    • abund (ndarray):\nThe abundance axis with 0s filled.
    • \n
    • freq (ndarray or None):\nThe extrapolated frequency axis, if available.
    • \n
    \n\n
    Notes
    \n\n

    This function will extrapolate the mz axis by N datapoints, and fill the abundance axis with 0s. \nThis should prevent peak picking issues at the spectrum edge.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.PeakPicking.PeakPicking.do_peak_picking", "modulename": "corems.mass_spectrum.calc.PeakPicking", "qualname": "PeakPicking.do_peak_picking", "kind": "function", "doc": "

    Perform peak picking.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.PeakPicking.PeakPicking.find_minima", "modulename": "corems.mass_spectrum.calc.PeakPicking", "qualname": "PeakPicking.find_minima", "kind": "function", "doc": "

    Find the minima of a peak.

    \n\n
    Parameters
    \n\n
      \n
    • apex_index (int):\nThe index of the peak apex.
    • \n
    • abundance (ndarray):\nThe abundance values.
    • \n
    • len_abundance (int):\nThe length of the abundance array.
    • \n
    • right (bool, optional):\nFlag indicating whether to search for minima to the right of the apex (default is True).
    • \n
    \n\n
    Returns
    \n\n
      \n
    • int: The index of the minima.
    • \n
    \n", "signature": "(self, apex_index, abundance, len_abundance, right=True):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.PeakPicking.PeakPicking.calculate_resolving_power", "modulename": "corems.mass_spectrum.calc.PeakPicking", "qualname": "PeakPicking.calculate_resolving_power", "kind": "function", "doc": "

    Calculate the resolving power of a peak.

    \n\n
    Parameters
    \n\n
      \n
    • intes (ndarray):\nThe intensity values.
    • \n
    • massa (ndarray):\nThe mass values.
    • \n
    • current_index (int):\nThe index of the current peak.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: The resolving power of the peak.
    • \n
    \n\n
    Notes
    \n\n

    This is a conservative calculation of resolving power,\nthe peak need to be resolved at least at the half-maximum magnitude,\notherwise, the combined full width at half maximum is used to calculate resolving power.

    \n", "signature": "(self, intes, massa, current_index):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.PeakPicking.PeakPicking.cal_minima", "modulename": "corems.mass_spectrum.calc.PeakPicking", "qualname": "PeakPicking.cal_minima", "kind": "function", "doc": "

    Calculate the minima of a peak.

    \n\n
    Parameters
    \n\n
      \n
    • mass (ndarray):\nThe mass values.
    • \n
    • abun (ndarray):\nThe abundance values.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • ndarray or None: The mass values at the minima, if found.
    • \n
    \n", "signature": "(self, mass, abun):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.PeakPicking.PeakPicking.calc_centroid", "modulename": "corems.mass_spectrum.calc.PeakPicking", "qualname": "PeakPicking.calc_centroid", "kind": "function", "doc": "

    Calculate the centroid of a peak.

    \n\n
    Parameters
    \n\n
      \n
    • mass (ndarray):\nThe mass values.
    • \n
    • abund (ndarray):\nThe abundance values.
    • \n
    • freq (ndarray or None):\nThe frequency values, if available.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • None
    • \n
    \n", "signature": "(self, mass, abund, freq):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.PeakPicking.PeakPicking.get_threshold", "modulename": "corems.mass_spectrum.calc.PeakPicking", "qualname": "PeakPicking.get_threshold", "kind": "function", "doc": "

    Get the intensity threshold for peak picking.

    \n\n
    Parameters
    \n\n
      \n
    • intes (ndarray):\nThe intensity values.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: The intensity threshold.
    • \n
    • float: The factor to multiply the intensity threshold by.
    • \n
    \n", "signature": "(self, intes):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.PeakPicking.PeakPicking.find_apex_fit_quadratic", "modulename": "corems.mass_spectrum.calc.PeakPicking", "qualname": "PeakPicking.find_apex_fit_quadratic", "kind": "function", "doc": "

    Find the apex of a peak.

    \n\n
    Parameters
    \n\n
      \n
    • mass (ndarray):\nThe mass values.
    • \n
    • abund (ndarray):\nThe abundance values.
    • \n
    • freq (ndarray or None):\nThe frequency values, if available.
    • \n
    • current_index (int):\nThe index of the current peak.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: The m/z value of the peak apex.
    • \n
    • float: The frequency value of the peak apex, if available.
    • \n
    • float: The abundance value of the peak apex.
    • \n
    \n", "signature": "(self, mass, abund, freq, current_index):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.PeakPicking.PeakPicking.check_prominence", "modulename": "corems.mass_spectrum.calc.PeakPicking", "qualname": "PeakPicking.check_prominence", "kind": "function", "doc": "

    Check the prominence of a peak.

    \n\n
    Parameters
    \n\n
      \n
    • abun (ndarray):\nThe abundance values.
    • \n
    • current_index (int):\nThe index of the current peak.
    • \n
    • len_abundance (int):\nThe length of the abundance array.
    • \n
    • peak_height_diff (function):\nThe function to calculate the peak height difference.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • tuple or False: A tuple containing the indexes of the peak, if the prominence is above the threshold.\nOtherwise, False.
    • \n
    \n", "signature": "(self, abun, current_index, len_abundance, peak_height_diff) -> tuple:", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.PeakPicking.PeakPicking.use_the_max", "modulename": "corems.mass_spectrum.calc.PeakPicking", "qualname": "PeakPicking.use_the_max", "kind": "function", "doc": "

    Use the max peak height as the centroid

    \n\n
    Parameters
    \n\n
      \n
    • mass (ndarray):\nThe mass values.
    • \n
    • abund (ndarray):\nThe abundance values.
    • \n
    • current_index (int):\nThe index of the current peak.
    • \n
    • len_abundance (int):\nThe length of the abundance array.
    • \n
    • peak_height_diff (function):\nThe function to calculate the peak height difference.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: The m/z value of the peak apex.
    • \n
    • float: The abundance value of the peak apex.
    • \n
    • tuple or None: A tuple containing the indexes of the peak, if the prominence is above the threshold.\nOtherwise, None.
    • \n
    \n", "signature": "(self, mass, abund, current_index, len_abundance, peak_height_diff):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.PeakPicking.PeakPicking.calc_centroid_legacy", "modulename": "corems.mass_spectrum.calc.PeakPicking", "qualname": "PeakPicking.calc_centroid_legacy", "kind": "function", "doc": "

    Legacy centroid calculation\nDeprecated - for deletion.

    \n", "signature": "(self, mass, abund, freq):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory", "modulename": "corems.mass_spectrum.factory", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.overrides", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "overrides", "kind": "function", "doc": "

    Checks if the method overrides a method from an interface class.

    \n", "signature": "(interface_class):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase", "kind": "class", "doc": "

    A mass spectrum base class, stores the profile data and instrument settings.

    \n\n

    Iteration over a list of MSPeaks classes stored at the _mspeaks attributes.\n_mspeaks is populated under the hood by calling process_mass_spec method.\nIteration is null if _mspeaks is empty.

    \n\n
    Parameters
    \n\n
      \n
    • mz_exp (array_like):\nThe m/z values of the mass spectrum.
    • \n
    • abundance (array_like):\nThe abundance values of the mass spectrum.
    • \n
    • d_params (dict):\nA dictionary of parameters for the mass spectrum.
    • \n
    • **kwargs: Additional keyword arguments.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • mspeaks (list):\nA list of mass peaks.
    • \n
    • is_calibrated (bool):\nWhether the mass spectrum is calibrated.
    • \n
    • is_centroid (bool):\nWhether the mass spectrum is centroided.
    • \n
    • has_frequency (bool):\nWhether the mass spectrum has a frequency domain.
    • \n
    • calibration_order (None or int):\nThe order of the mass spectrum's calibration.
    • \n
    • calibration_points (None or ndarray):\nThe calibration points of the mass spectrum.
    • \n
    • calibration_RMS (None or float):\nThe root mean square of the mass spectrum's calibration.
    • \n
    • calibration_segment (None or CalibrationSegment):\nThe calibration segment of the mass spectrum.
    • \n
    • _abundance (ndarray):\nThe abundance values of the mass spectrum.
    • \n
    • _mz_exp (ndarray):\nThe m/z values of the mass spectrum.
    • \n
    • _mspeaks (list):\nA list of mass peaks.
    • \n
    • _dict_nominal_masses_indexes (dict):\nA dictionary of nominal masses and their indexes.
    • \n
    • _baseline_noise (float):\nThe baseline noise of the mass spectrum.
    • \n
    • _baseline_noise_std (float):\nThe standard deviation of the baseline noise of the mass spectrum.
    • \n
    • _dynamic_range (float or None):\nThe dynamic range of the mass spectrum.
    • \n
    • _transient_settings (None or TransientSettings):\nThe transient settings of the mass spectrum.
    • \n
    • _frequency_domain (None or FrequencyDomain):\nThe frequency domain of the mass spectrum.
    • \n
    • _mz_cal_profile (None or MzCalibrationProfile):\nThe m/z calibration profile of the mass spectrum.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • process_mass_spec(). Main function to process the mass spectrum, \nincluding calculating the noise threshold, peak picking, and resetting the MSpeak indexes.
    • \n
    \n\n

    See also: MassSpecCentroid(), MassSpecfromFreq(), MassSpecProfile()

    \n", "bases": "corems.mass_spectrum.calc.MassSpectrumCalc.MassSpecCalc, corems.mass_spectrum.calc.KendrickGroup.KendrickGrouping"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.__init__", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.__init__", "kind": "function", "doc": "

    \n", "signature": "(mz_exp, abundance, d_params, **kwargs)"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.mspeaks", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.mspeaks", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.is_calibrated", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.is_calibrated", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.is_centroid", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.is_centroid", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.has_frequency", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.has_frequency", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.calibration_order", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.calibration_order", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.calibration_points", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.calibration_points", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.calibration_RMS", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.calibration_RMS", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.calibration_segment", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.calibration_segment", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.set_indexes", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.set_indexes", "kind": "function", "doc": "

    Set the mass spectrum to iterate over only the selected MSpeaks indexes.

    \n\n
    Parameters
    \n\n
      \n
    • list_indexes (list of int):\nA list of integers representing the indexes of the MSpeaks to iterate over.
    • \n
    \n", "signature": "(self, list_indexes):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.reset_indexes", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.reset_indexes", "kind": "function", "doc": "

    Reset the mass spectrum to iterate over all MSpeaks objects.

    \n\n

    This method resets the mass spectrum to its original state, allowing iteration over all MSpeaks objects.\nIt also sets the index of each MSpeak object to its corresponding position in the mass spectrum.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.add_mspeak", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.add_mspeak", "kind": "function", "doc": "

    Add a new MSPeak object to the MassSpectrum object.

    \n\n
    Parameters
    \n\n
      \n
    • ion_charge (int):\nThe ion charge of the MSPeak.
    • \n
    • mz_exp (float):\nThe experimental m/z value of the MSPeak.
    • \n
    • abundance (float):\nThe abundance of the MSPeak.
    • \n
    • resolving_power (float):\nThe resolving power of the MSPeak.
    • \n
    • signal_to_noise (float):\nThe signal-to-noise ratio of the MSPeak.
    • \n
    • massspec_indexes (list):\nA list of indexes of the MSPeak in the MassSpectrum object.
    • \n
    • exp_freq (float, optional):\nThe experimental frequency of the MSPeak. Defaults to None.
    • \n
    • ms_parent (MSParent, optional):\nThe MSParent object associated with the MSPeak. Defaults to None.
    • \n
    \n", "signature": "(\tself,\tion_charge,\tmz_exp,\tabundance,\tresolving_power,\tsignal_to_noise,\tmassspec_indexes,\texp_freq=None,\tms_parent=None):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.reset_cal_therms", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.reset_cal_therms", "kind": "function", "doc": "

    Reset calibration terms and recalculate the mass-to-charge ratio and abundance.

    \n\n
    Parameters
    \n\n
      \n
    • Aterm (float):\nThe A-term calibration coefficient.
    • \n
    • Bterm (float):\nThe B-term calibration coefficient.
    • \n
    • C (float):\nThe C-term calibration coefficient.
    • \n
    • fas (float, optional):\nThe frequency amplitude scaling factor. Default is 0.
    • \n
    \n", "signature": "(self, Aterm, Bterm, C, fas=0):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.clear_molecular_formulas", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.clear_molecular_formulas", "kind": "function", "doc": "

    Clear the molecular formulas for all mspeaks in the MassSpectrum.

    \n\n
    Returns
    \n\n
      \n
    • numpy.ndarray: An array of the cleared molecular formulas for each mspeak in the MassSpectrum.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.process_mass_spec", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.process_mass_spec", "kind": "function", "doc": "

    Process the mass spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • keep_profile (bool, optional):\nWhether to keep the profile data after processing. Defaults to True.
    • \n
    \n\n
    Notes
    \n\n

    This method does the following:

    \n\n
      \n
    • calculates the noise threshold
    • \n
    • does peak picking (creates mspeak_objs)
    • \n
    • resets the mspeak_obj indexes
    • \n
    \n", "signature": "(self, keep_profile=True):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.cal_noise_threshold", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.cal_noise_threshold", "kind": "function", "doc": "

    Calculate the noise threshold of the mass spectrum.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.parameters", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.parameters", "kind": "variable", "doc": "

    Return the parameters of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.set_parameter_from_json", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.set_parameter_from_json", "kind": "function", "doc": "

    Set the parameters of the mass spectrum from a JSON file.

    \n\n
    Parameters
    \n\n
      \n
    • parameters_path (str):\nThe path to the JSON file containing the parameters.
    • \n
    \n", "signature": "(self, parameters_path):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.set_parameter_from_toml", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.set_parameter_from_toml", "kind": "function", "doc": "

    \n", "signature": "(self, parameters_path):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.mspeaks_settings", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.mspeaks_settings", "kind": "variable", "doc": "

    Return the MS peak settings of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.settings", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.settings", "kind": "variable", "doc": "

    Return the settings of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.molecular_search_settings", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.molecular_search_settings", "kind": "variable", "doc": "

    Return the molecular search settings of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.mz_cal_profile", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.mz_cal_profile", "kind": "variable", "doc": "

    Return the calibrated m/z profile of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.mz_cal", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.mz_cal", "kind": "variable", "doc": "

    Return the calibrated m/z values of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.mz_exp", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.mz_exp", "kind": "variable", "doc": "

    Return the experimental m/z values of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.freq_exp_profile", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.freq_exp_profile", "kind": "variable", "doc": "

    Return the experimental frequency profile of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.mz_exp_profile", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.mz_exp_profile", "kind": "variable", "doc": "

    Return the experimental m/z profile of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.abundance_profile", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.abundance_profile", "kind": "variable", "doc": "

    Return the abundance profile of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.abundance", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.abundance", "kind": "variable", "doc": "

    Return the abundance values of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.freq_exp", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.freq_exp", "kind": "function", "doc": "

    Return the experimental frequency values of the mass spectrum.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.resolving_power", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.resolving_power", "kind": "variable", "doc": "

    Return the resolving power values of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.signal_to_noise", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.signal_to_noise", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.nominal_mz", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.nominal_mz", "kind": "variable", "doc": "

    Return the nominal m/z values of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.get_mz_and_abundance_peaks_tuples", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.get_mz_and_abundance_peaks_tuples", "kind": "function", "doc": "

    Return a list of tuples containing the m/z and abundance values of the mass spectrum.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.kmd", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.kmd", "kind": "variable", "doc": "

    Return the Kendrick mass defect values of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.kendrick_mass", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.kendrick_mass", "kind": "variable", "doc": "

    Return the Kendrick mass values of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.max_mz_exp", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.max_mz_exp", "kind": "variable", "doc": "

    Return the maximum experimental m/z value of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.min_mz_exp", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.min_mz_exp", "kind": "variable", "doc": "

    Return the minimum experimental m/z value of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.max_abundance", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.max_abundance", "kind": "variable", "doc": "

    Return the maximum abundance value of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.max_signal_to_noise", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.max_signal_to_noise", "kind": "variable", "doc": "

    Return the maximum signal-to-noise ratio of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.most_abundant_mspeak", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.most_abundant_mspeak", "kind": "variable", "doc": "

    Return the most abundant MSpeak object of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.min_abundance", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.min_abundance", "kind": "variable", "doc": "

    Return the minimum abundance value of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.dynamic_range", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.dynamic_range", "kind": "variable", "doc": "

    Return the dynamic range of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.baseline_noise", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.baseline_noise", "kind": "variable", "doc": "

    Return the baseline noise of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.baseline_noise_std", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.baseline_noise_std", "kind": "variable", "doc": "

    Return the standard deviation of the baseline noise of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.Aterm", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.Aterm", "kind": "variable", "doc": "

    Return the A-term calibration coefficient of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.Bterm", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.Bterm", "kind": "variable", "doc": "

    Return the B-term calibration coefficient of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.Cterm", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.Cterm", "kind": "variable", "doc": "

    Return the C-term calibration coefficient of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.filename", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.filename", "kind": "variable", "doc": "

    Return the filename of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.dir_location", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.dir_location", "kind": "variable", "doc": "

    Return the directory location of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.sort_by_mz", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.sort_by_mz", "kind": "function", "doc": "

    Sort the mass spectrum by m/z values.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.sort_by_abundance", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.sort_by_abundance", "kind": "function", "doc": "

    Sort the mass spectrum by abundance values.

    \n", "signature": "(self, reverse=False):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.tic", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.tic", "kind": "variable", "doc": "

    Return the total ion current of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.check_mspeaks_warning", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.check_mspeaks_warning", "kind": "function", "doc": "

    Check if the mass spectrum has MSpeaks objects.

    \n\n
    Raises
    \n\n
      \n
    • Warning: If the mass spectrum has no MSpeaks objects.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.check_mspeaks", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.check_mspeaks", "kind": "function", "doc": "

    Check if the mass spectrum has MSpeaks objects.

    \n\n
    Raises
    \n\n
      \n
    • Exception: If the mass spectrum has no MSpeaks objects.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.remove_assignment_by_index", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.remove_assignment_by_index", "kind": "function", "doc": "

    Remove the molecular formula assignment of the MSpeaks objects at the specified indexes.

    \n\n
    Parameters
    \n\n
      \n
    • indexes (list of int):\nA list of indexes of the MSpeaks objects to remove the molecular formula assignment from.
    • \n
    \n", "signature": "(self, indexes):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.filter_by_index", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.filter_by_index", "kind": "function", "doc": "

    Filter the mass spectrum by the specified indexes.

    \n\n
    Parameters
    \n\n
      \n
    • list_indexes (list of int):\nA list of indexes of the MSpeaks objects to keep.
    • \n
    \n", "signature": "(self, list_indexes):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.filter_by_mz", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.filter_by_mz", "kind": "function", "doc": "

    Filter the mass spectrum by the specified m/z range.

    \n\n
    Parameters
    \n\n
      \n
    • min_mz (float):\nThe minimum m/z value to keep.
    • \n
    • max_mz (float):\nThe maximum m/z value to keep.
    • \n
    \n", "signature": "(self, min_mz, max_mz):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.filter_by_s2n", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.filter_by_s2n", "kind": "function", "doc": "

    Filter the mass spectrum by the specified signal-to-noise ratio range.

    \n\n
    Parameters
    \n\n
      \n
    • min_s2n (float):\nThe minimum signal-to-noise ratio to keep.
    • \n
    • max_s2n (float, optional):\nThe maximum signal-to-noise ratio to keep. Defaults to False (no maximum).
    • \n
    \n", "signature": "(self, min_s2n, max_s2n=False):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.filter_by_abundance", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.filter_by_abundance", "kind": "function", "doc": "

    Filter the mass spectrum by the specified abundance range.

    \n\n
    Parameters
    \n\n
      \n
    • min_abund (float):\nThe minimum abundance to keep.
    • \n
    • max_abund (float, optional):\nThe maximum abundance to keep. Defaults to False (no maximum).
    • \n
    \n", "signature": "(self, min_abund, max_abund=False):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.filter_by_max_resolving_power", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.filter_by_max_resolving_power", "kind": "function", "doc": "

    Filter the mass spectrum by the specified maximum resolving power.

    \n\n
    Parameters
    \n\n
      \n
    • B (float):

    • \n
    • T (float):

    • \n
    \n", "signature": "(self, B, T):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.filter_by_mean_resolving_power", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.filter_by_mean_resolving_power", "kind": "function", "doc": "

    Filter the mass spectrum by the specified mean resolving power.

    \n\n
    Parameters
    \n\n
      \n
    • ndeviations (float, optional):\nThe number of standard deviations to use for filtering. Defaults to 3.
    • \n
    • plot (bool, optional):\nWhether to plot the resolving power distribution. Defaults to False.
    • \n
    • guess_pars (bool, optional):\nWhether to guess the parameters for the Gaussian model. Defaults to False.
    • \n
    \n", "signature": "(self, ndeviations=3, plot=False, guess_pars=False):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.filter_by_min_resolving_power", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.filter_by_min_resolving_power", "kind": "function", "doc": "

    Filter the mass spectrum by the specified minimum resolving power.

    \n\n
    Parameters
    \n\n
      \n
    • B (float):

    • \n
    • T (float):

    • \n
    \n", "signature": "(self, B, T):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.filter_by_noise_threshold", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.filter_by_noise_threshold", "kind": "function", "doc": "

    Filter the mass spectrum by the noise threshold.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.find_peaks", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.find_peaks", "kind": "function", "doc": "

    Find the peaks of the mass spectrum.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.change_kendrick_base_all_mspeaks", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.change_kendrick_base_all_mspeaks", "kind": "function", "doc": "

    Change the Kendrick base of all MSpeaks objects.

    \n\n
    Parameters
    \n\n
      \n
    • kendrick_dict_base (dict):\nA dictionary of the Kendrick base to change to.
    • \n
    \n\n
    Notes
    \n\n

    Example of kendrick_dict_base parameter: kendrick_dict_base = {\"C\": 1, \"H\": 2} or {\"C\": 1, \"H\": 1, \"O\":1} etc

    \n", "signature": "(self, kendrick_dict_base):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.get_nominal_mz_first_last_indexes", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.get_nominal_mz_first_last_indexes", "kind": "function", "doc": "

    Return the first and last indexes of the MSpeaks objects with the specified nominal mass.

    \n\n
    Parameters
    \n\n
      \n
    • nominal_mass (int):\nThe nominal mass to get the indexes for.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • tuple: A tuple containing the first and last indexes of the MSpeaks objects with the specified nominal mass.
    • \n
    \n", "signature": "(self, nominal_mass):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.get_masses_count_by_nominal_mass", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.get_masses_count_by_nominal_mass", "kind": "function", "doc": "

    Return a dictionary of the nominal masses and their counts.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.datapoints_count_by_nominal_mz", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.datapoints_count_by_nominal_mz", "kind": "function", "doc": "

    Return a dictionary of the nominal masses and their counts.

    \n\n
    Parameters
    \n\n
      \n
    • mz_overlay (float, optional):\nThe m/z overlay to use for counting. Defaults to 0.1.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: A dictionary of the nominal masses and their counts.
    • \n
    \n", "signature": "(self, mz_overlay=0.1):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.get_nominal_mass_indexes", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.get_nominal_mass_indexes", "kind": "function", "doc": "

    Return the indexes of the MSpeaks objects with the specified nominal mass.

    \n\n
    Parameters
    \n\n
      \n
    • nominal_mass (int):\nThe nominal mass to get the indexes for.
    • \n
    • overlay (float, optional):\nThe m/z overlay to use for counting. Defaults to 0.1.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • generator: A generator of the indexes of the MSpeaks objects with the specified nominal mass.
    • \n
    \n", "signature": "(self, nominal_mass, overlay=0.1):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.plot_centroid", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.plot_centroid", "kind": "function", "doc": "

    Plot the centroid data of the mass spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • ax (matplotlib.axes.Axes, optional):\nThe matplotlib axes to plot on. Defaults to None.
    • \n
    • c (str, optional):\nThe color to use for the plot. Defaults to 'g' (green).
    • \n
    \n\n
    Returns
    \n\n
      \n
    • matplotlib.axes.Axes: The matplotlib axes containing the plot.
    • \n
    \n\n
    Raises
    \n\n
      \n
    • Exception: If no centroid data is found.
    • \n
    \n", "signature": "(self, ax=None, c='g'):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.plot_profile_and_noise_threshold", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.plot_profile_and_noise_threshold", "kind": "function", "doc": "

    Plot the profile data and noise threshold of the mass spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • ax (matplotlib.axes.Axes, optional):\nThe matplotlib axes to plot on. Defaults to None.
    • \n
    • legend (bool, optional):\nWhether to show the legend. Defaults to False.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • matplotlib.axes.Axes: The matplotlib axes containing the plot.
    • \n
    \n\n
    Raises
    \n\n
      \n
    • Exception: If no noise threshold is found.
    • \n
    \n", "signature": "(self, ax=None, legend=False):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.plot_mz_domain_profile", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.plot_mz_domain_profile", "kind": "function", "doc": "

    Plot the m/z domain profile of the mass spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • color (str, optional):\nThe color to use for the plot. Defaults to 'green'.
    • \n
    • ax (matplotlib.axes.Axes, optional):\nThe matplotlib axes to plot on. Defaults to None.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • matplotlib.axes.Axes: The matplotlib axes containing the plot.
    • \n
    \n", "signature": "(self, color='green', ax=None):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.to_excel", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.to_excel", "kind": "function", "doc": "

    Export the mass spectrum to an Excel file.

    \n\n
    Parameters
    \n\n
      \n
    • out_file_path (str):\nThe path to the Excel file to export to.
    • \n
    • write_metadata (bool, optional):\nWhether to write the metadata to the Excel file. Defaults to True.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • None
    • \n
    \n", "signature": "(self, out_file_path, write_metadata=True):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.to_hdf", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.to_hdf", "kind": "function", "doc": "

    Export the mass spectrum to an HDF file.

    \n\n
    Parameters
    \n\n
      \n
    • out_file_path (str):\nThe path to the HDF file to export to.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • None
    • \n
    \n", "signature": "(self, out_file_path):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.to_csv", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.to_csv", "kind": "function", "doc": "

    Export the mass spectrum to a CSV file.

    \n\n
    Parameters
    \n\n
      \n
    • out_file_path (str):\nThe path to the CSV file to export to.
    • \n
    • write_metadata (bool, optional):\nWhether to write the metadata to the CSV file. Defaults to True.
    • \n
    \n", "signature": "(self, out_file_path, write_metadata=True):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.to_pandas", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.to_pandas", "kind": "function", "doc": "

    Export the mass spectrum to a Pandas dataframe with pkl extension.

    \n\n
    Parameters
    \n\n
      \n
    • out_file_path (str):\nThe path to the CSV file to export to.
    • \n
    • write_metadata (bool, optional):\nWhether to write the metadata to the CSV file. Defaults to True.
    • \n
    \n", "signature": "(self, out_file_path, write_metadata=True):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.to_dataframe", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.to_dataframe", "kind": "function", "doc": "

    Return the mass spectrum as a Pandas dataframe.

    \n\n
    Returns
    \n\n
      \n
    • pandas.DataFrame: The mass spectrum as a Pandas dataframe.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.to_json", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.to_json", "kind": "function", "doc": "

    Return the mass spectrum as a JSON file.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.parameters_json", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.parameters_json", "kind": "function", "doc": "

    Return the parameters of the mass spectrum as a JSON string.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.parameters_toml", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.parameters_toml", "kind": "function", "doc": "

    Return the parameters of the mass spectrum as a TOML string.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecProfile", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecProfile", "kind": "class", "doc": "

    A mass spectrum class when the entry point is on profile format

    \n\n
    Notes
    \n\n

    Stores the profile data and instrument settings. \nIteration over a list of MSPeaks classes stored at the _mspeaks attributes.\n_mspeaks is populated under the hood by calling process_mass_spec method.\nIteration is null if _mspeaks is empty. Many more attributes and methods inherited from MassSpecBase().

    \n\n
    Parameters
    \n\n
      \n
    • data_dict (dict):\nA dictionary containing the profile data.
    • \n
    • d_params : dict{'str' (float, int or str}):\ncontains the instrument settings and processing settings
    • \n
    • auto_process (bool, optional):\nWhether to automatically process the mass spectrum. Defaults to True.
    • \n
    \n\n
    Attributes
    \n\n

    _abundance : ndarray\n The abundance values of the mass spectrum.\n_mz_exp : ndarray\n The m/z values of the mass spectrum.\n_mspeaks : list\n A list of mass peaks.

    \n\n
    Methods
    \n\n
      \n
    • process_mass_spec(). Process the mass spectrum.
    • \n
    \n\n

    see also: MassSpecBase(), MassSpecfromFreq(), MassSpecCentroid()

    \n", "bases": "MassSpecBase"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecProfile.__init__", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecProfile.__init__", "kind": "function", "doc": "

    \n", "signature": "(data_dict, d_params, auto_process=True)"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecfromFreq", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecfromFreq", "kind": "class", "doc": "

    A mass spectrum class when data entry is on frequency domain

    \n\n
    Notes
    \n\n
      \n
    • Transform to m/z based on the settings stored at d_params
    • \n
    • Stores the profile data and instrument settings
    • \n
    • Iteration over a list of MSPeaks classes stored at the _mspeaks attributes
    • \n
    • _mspeaks is populated under the hood by calling process_mass_spec method
    • \n
    • iteration is null if _mspeaks is empty
    • \n
    \n\n
    Parameters
    \n\n
      \n
    • frequency_domain (list(float)):\nall datapoints in frequency domain in Hz
    • \n
    • magnitude : frequency_domain (list(float)):\nall datapoints in for magnitude of each frequency datapoint
    • \n
    • d_params : dict{'str' (float, int or str}):\ncontains the instrument settings and processing settings
    • \n
    • auto_process (bool, optional):\nWhether to automatically process the mass spectrum. Defaults to True.
    • \n
    • keep_profile (bool, optional):\nWhether to keep the profile data. Defaults to True.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • has_frequency (bool):\nWhether the mass spectrum has frequency data.
    • \n
    • _frequency_domain (list(float)):\nFrequency domain in Hz
    • \n
    • label (str):\nstore label (Bruker, Midas Transient, see Labels class ). It across distinct processing points
    • \n
    • _abundance (ndarray):\nThe abundance values of the mass spectrum.
    • \n
    • _mz_exp (ndarray):\nThe m/z values of the mass spectrum.
    • \n
    • _mspeaks (list):\nA list of mass peaks.
    • \n
    • See Also (all the attributes of MassSpecBase class):
    • \n
    \n\n
    Methods
    \n\n
      \n
    • _set_mz_domain().\ncalculates the m_z based on the setting of d_params
    • \n
    • process_mass_spec(). Process the mass spectrum.
    • \n
    \n\n

    see also: MassSpecBase(), MassSpecProfile(), MassSpecCentroid()

    \n", "bases": "MassSpecBase"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecfromFreq.__init__", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecfromFreq.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tfrequency_domain,\tmagnitude,\td_params,\tauto_process=True,\tkeep_profile=True)"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecfromFreq.has_frequency", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecfromFreq.has_frequency", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecfromFreq.magnetron_frequency", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecfromFreq.magnetron_frequency", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecfromFreq.magnetron_frequency_sigma", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecfromFreq.magnetron_frequency_sigma", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecfromFreq.transient_settings", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecfromFreq.transient_settings", "kind": "variable", "doc": "

    Return the transient settings of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecfromFreq.calc_magnetron_freq", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecfromFreq.calc_magnetron_freq", "kind": "function", "doc": "

    Calculates the magnetron frequency of the mass spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • max_magnetron_freq (float, optional):\nThe maximum magnetron frequency. Defaults to 50.
    • \n
    • magnetron_freq_bins (int, optional):\nThe number of bins to use for the histogram. Defaults to 300.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • None
    • \n
    \n\n
    Notes
    \n\n

    Calculates the magnetron frequency by examining all the picked peaks and the distances between them in the frequency domain.\nA histogram of those values below the threshold 'max_magnetron_freq' with the 'magnetron_freq_bins' number of bins is calculated.\nA gaussian model is fit to this histogram - the center value of this (statistically probably) the magnetron frequency.\nThis appears to work well or nOmega datasets, but may not work well for 1x datasets or those with very low magnetron peaks.

    \n", "signature": "(self, max_magnetron_freq=50, magnetron_freq_bins=300):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroid", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecCentroid", "kind": "class", "doc": "

    A mass spectrum class when the entry point is on centroid format

    \n\n
    Notes
    \n\n
      \n
    • Stores the centroid data and instrument settings
    • \n
    • Simulate profile data based on Gaussian or Lorentzian peak shape
    • \n
    • Iteration over a list of MSPeaks classes stored at the _mspeaks attributes
    • \n
    • _mspeaks is populated under the hood by calling process_mass_spec method
    • \n
    • iteration is null if _mspeaks is empty
    • \n
    \n\n
    Parameters
    \n\n
      \n
    • data_dict : dict {string (numpy array float64 )):\ncontains keys [m/z, Abundance, Resolving Power, S/N]
    • \n
    • d_params : dict{'str' (float, int or str}):\ncontains the instrument settings and processing settings
    • \n
    • auto_process (bool, optional):\nWhether to automatically process the mass spectrum. Defaults to True.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • label (str):\nstore label (Bruker, Midas Transient, see Labels class)
    • \n
    • _baseline_noise (float):\nstore baseline noise
    • \n
    • _baseline_noise_std (float):\nstore baseline noise std
    • \n
    • _abundance (ndarray):\nThe abundance values of the mass spectrum.
    • \n
    • _mz_exp (ndarray):\nThe m/z values of the mass spectrum.
    • \n
    • _mspeaks (list):\nA list of mass peaks.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • process_mass_spec().\nProcess the mass spectrum. Overriden from MassSpecBase. Populates the _mspeaks list with MSpeaks class using the centroid data.
    • \n
    • __simulate_profile__data__().\nSimulate profile data based on Gaussian or Lorentzian peak shape. Needs theoretical resolving power calculation and define peak shape, intended for plotting and inspection purposes only.
    • \n
    \n\n

    see also: MassSpecBase(), MassSpecfromFreq(), MassSpecProfile()

    \n", "bases": "MassSpecBase"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroid.__init__", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecCentroid.__init__", "kind": "function", "doc": "

    \n", "signature": "(data_dict, d_params, auto_process=True)"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroid.is_centroid", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecCentroid.is_centroid", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroid.data_dict", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecCentroid.data_dict", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroid.mz_exp_profile", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecCentroid.mz_exp_profile", "kind": "variable", "doc": "

    Return the m/z profile of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroid.abundance_profile", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecCentroid.abundance_profile", "kind": "variable", "doc": "

    Return the abundance profile of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroid.tic", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecCentroid.tic", "kind": "variable", "doc": "

    Return the total ion current of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroid.process_mass_spec", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecCentroid.process_mass_spec", "kind": "function", "doc": "

    Process the mass spectrum.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroidLowRes", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecCentroidLowRes", "kind": "class", "doc": "

    A mass spectrum class when the entry point is on low resolution centroid format

    \n\n
    Notes
    \n\n

    Does not store MSPeak Objs, will iterate over mz, abundance pairs instead

    \n\n
    Parameters
    \n\n
      \n
    • data_dict : dict {string (numpy array float64 )):\ncontains keys [m/z, Abundance, Resolving Power, S/N]
    • \n
    • d_params : dict{'str' (float, int or str}):\ncontains the instrument settings and processing settings
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • _processed_tic (float):\nstore processed total ion current
    • \n
    • _abundance (ndarray):\nThe abundance values of the mass spectrum.
    • \n
    • _mz_exp (ndarray):\nThe m/z values of the mass spectrum.
    • \n
    \n", "bases": "MassSpecCentroid"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroidLowRes.__init__", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecCentroidLowRes.__init__", "kind": "function", "doc": "

    \n", "signature": "(data_dict, d_params)"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroidLowRes.mz_exp", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecCentroidLowRes.mz_exp", "kind": "variable", "doc": "

    Return the m/z values of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroidLowRes.abundance", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecCentroidLowRes.abundance", "kind": "variable", "doc": "

    Return the abundance values of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroidLowRes.processed_tic", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecCentroidLowRes.processed_tic", "kind": "variable", "doc": "

    Return the processed total ion current of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroidLowRes.tic", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecCentroidLowRes.tic", "kind": "variable", "doc": "

    Return the total ion current of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroidLowRes.mz_abun_tuples", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecCentroidLowRes.mz_abun_tuples", "kind": "variable", "doc": "

    Return the m/z and abundance values of the mass spectrum as a list of tuples.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroidLowRes.mz_abun_dict", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecCentroidLowRes.mz_abun_dict", "kind": "variable", "doc": "

    Return the m/z and abundance values of the mass spectrum as a dictionary.

    \n"}, {"fullname": "corems.mass_spectrum.input", "modulename": "corems.mass_spectrum.input", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.baseClass", "modulename": "corems.mass_spectrum.input.baseClass", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass", "kind": "class", "doc": "

    The MassListBaseClass object reads mass list data types and returns the mass spectrum obj

    \n\n
    Parameters
    \n\n
      \n
    • file_location (Path or S3Path):\nFull data path.
    • \n
    • isCentroid (bool, optional):\nDetermines the mass spectrum data structure. If set to True, it assumes centroid mode. If set to False, it assumes profile mode and attempts to peak pick. Default is True.
    • \n
    • analyzer (str, optional):\nThe analyzer used for the mass spectrum. Default is 'Unknown'.
    • \n
    • instrument_label (str, optional):\nThe label of the instrument used for the mass spectrum. Default is 'Unknown'.
    • \n
    • sample_name (str, optional):\nThe name of the sample. Default is None.
    • \n
    • header_lines (int, optional):\nThe number of lines to skip in the file, including the column labels line. Default is 0.
    • \n
    • isThermoProfile (bool, optional):\nDetermines the number of expected columns in the file. If set to True, only m/z and intensity columns are expected. Signal-to-noise ratio (S/N) and resolving power (RP) will be calculated based on the data. Default is False.
    • \n
    • headerless (bool, optional):\nIf True, assumes that there are no headers present in the file (e.g., a .xy file from Bruker) and assumes two columns: m/z and intensity. Default is False.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • parameters (DataInputSetting):\nThe data input settings for the mass spectrum.
    • \n
    • data_type (str):\nThe type of data in the file.
    • \n
    • delimiter (str):\nThe delimiter used to read text-based files.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • set_parameter_from_toml(parameters_path). Sets the data input settings from a TOML file.
    • \n
    • set_parameter_from_json(parameters_path). Sets the data input settings from a JSON file.
    • \n
    • get_dataframe(). Reads the file and returns the data as a pandas DataFrame.
    • \n
    • load_settings(mass_spec_obj, output_parameters). Loads the settings for the mass spectrum.
    • \n
    • get_output_parameters(polarity, scan_index=0). Returns the output parameters for the mass spectrum.
    • \n
    • clean_data_frame(dataframe). Cleans the data frame by removing columns that are not in the expected columns set.
    • \n
    \n"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.__init__", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tfile_location: pathlib.Path | s3path.S3Path,\tisCentroid: bool = True,\tanalyzer: str = 'Unknown',\tinstrument_label: str = 'Unknown',\tsample_name: str = None,\theader_lines: int = 0,\tisThermoProfile: bool = False,\theaderless: bool = False)"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.file_location", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.file_location", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.header_lines", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.header_lines", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.isCentroid", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.isCentroid", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.isThermoProfile", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.isThermoProfile", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.headerless", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.headerless", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.analyzer", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.analyzer", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.instrument_label", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.instrument_label", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.sample_name", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.sample_name", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.parameters", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.parameters", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.set_parameter_from_toml", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.set_parameter_from_toml", "kind": "function", "doc": "

    \n", "signature": "(self, parameters_path):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.set_parameter_from_json", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.set_parameter_from_json", "kind": "function", "doc": "

    \n", "signature": "(self, parameters_path):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.data_type", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.data_type", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.delimiter", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.delimiter", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.encoding_detector", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.encoding_detector", "kind": "function", "doc": "

    Detects the encoding of a file.

    \n\n
    Parameters
    \n\n
      \n
    • file_location (str):\nThe location of the file to be analyzed.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • str: The detected encoding of the file.
    • \n
    \n", "signature": "(self, file_location) -> str:", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.set_data_type", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.set_data_type", "kind": "function", "doc": "

    Set the data type and delimiter based on the file extension.

    \n\n
    Raises
    \n\n
      \n
    • TypeError: If the data type could not be automatically recognized.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.get_dataframe", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.get_dataframe", "kind": "function", "doc": "

    Get the data as a pandas DataFrame.

    \n\n
    Returns
    \n\n
      \n
    • pandas.DataFrame: The data as a pandas DataFrame.
    • \n
    \n\n
    Raises
    \n\n
      \n
    • TypeError: If the data type is not supported.
    • \n
    \n", "signature": "(self) -> pandas.core.frame.DataFrame:", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.load_settings", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.load_settings", "kind": "function", "doc": "

    TODO loading output parameters from json file is not functional

    \n\n

    Load settings from a JSON file and apply them to the given mass_spec_obj.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spec_obj (MassSpec):\nThe mass spectrum object to apply the settings to.
    • \n
    \n", "signature": "(self, mass_spec_obj, output_parameters):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.get_output_parameters", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.get_output_parameters", "kind": "function", "doc": "

    Get the output parameters for the mass spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • polarity (int):\nThe polarity of the mass spectrum +1 or -1.
    • \n
    • scan_index (int, optional):\nThe index of the scan. Default is 0.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: A dictionary containing the output parameters.
    • \n
    \n", "signature": "(self, polarity: int, scan_index: int = 0) -> dict:", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.clean_data_frame", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.clean_data_frame", "kind": "function", "doc": "

    Clean the input dataframe by removing columns that are not expected.

    \n\n
    Parameters
    \n\n
      \n
    • pandas.DataFrame: The input dataframe to be cleaned.
    • \n
    \n", "signature": "(self, dataframe):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.check_columns", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.check_columns", "kind": "function", "doc": "

    Check if the given header labels match the expected columns.

    \n\n
    Parameters
    \n\n
      \n
    • header_labels (list):\nThe header labels to be checked.
    • \n
    \n\n
    Raises
    \n\n
      \n
    • Exception: If any expected column is not found in the header labels.
    • \n
    \n", "signature": "(self, header_labels: list[str]):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.read_xml_peaks", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.read_xml_peaks", "kind": "function", "doc": "

    Read peaks from a Bruker .xml file and return a pandas DataFrame.

    \n\n
    Parameters
    \n\n
      \n
    • data (str):\nThe path to the .xml file.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • pandas.DataFrame: A DataFrame containing the peak data with columns: 'm/z', 'I', 'Resolving Power', 'Area', 'S/N', 'fwhm'.
    • \n
    \n", "signature": "(self, data: str) -> pandas.core.frame.DataFrame:", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.get_xml_polarity", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.get_xml_polarity", "kind": "function", "doc": "

    Get the polarity from an XML peaklist.

    \n\n
    Returns
    \n\n
      \n
    • int: The polarity of the XML peaklist. Returns -1 for negative polarity, +1 for positive polarity.
    • \n
    \n\n
    Raises
    \n\n
      \n
    • Exception: If the data type is not XML peaklist in Bruker format or if the polarity is unhandled.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.boosterHDF5", "modulename": "corems.mass_spectrum.input.boosterHDF5", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.boosterHDF5.ReadHDF_BoosterMassSpectrum", "modulename": "corems.mass_spectrum.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectrum", "kind": "class", "doc": "

    The ReadHDF_BoosterMassSpectrum class parses the mass spectrum data from an HDF file and generate a mass spectrum object.

    \n\n
    Parameters
    \n\n
      \n
    • file_location (str):\nThe path to the HDF file.
    • \n
    • isCentroid (bool, optional):\nSpecifies whether the mass spectrum is centroided or not. Default is False.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • polarity (int):\nThe polarity of the mass spectrum.
    • \n
    • h5pydata (h5py.File):\nThe HDF file object.
    • \n
    • scans (list):\nThe list of scan names in the HDF file.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • get_data_profile(mz, abundance, auto_process). Returns a MassSpecProfile object from the given m/z and abundance arrays.
    • \n
    • get_attr_data(scan, attr_srt). Returns the attribute value for the given scan and attribute name.
    • \n
    • get_polarity(file_location). Returns the polarity of the mass spectrum.
    • \n
    • get_mass_spectrum(auto_process). Returns the mass spectrum as a MassSpecProfile object.
    • \n
    • get_output_parameters(). Returns the default output parameters for the mass spectrum.
    • \n
    \n", "bases": "corems.mass_spectrum.input.baseClass.MassListBaseClass"}, {"fullname": "corems.mass_spectrum.input.boosterHDF5.ReadHDF_BoosterMassSpectrum.__init__", "modulename": "corems.mass_spectrum.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectrum.__init__", "kind": "function", "doc": "

    \n", "signature": "(file_location, isCentroid=False)"}, {"fullname": "corems.mass_spectrum.input.boosterHDF5.ReadHDF_BoosterMassSpectrum.polarity", "modulename": "corems.mass_spectrum.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectrum.polarity", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.boosterHDF5.ReadHDF_BoosterMassSpectrum.get_data_profile", "modulename": "corems.mass_spectrum.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectrum.get_data_profile", "kind": "function", "doc": "

    Returns a MassSpecProfile object from the given m/z and abundance arrays.

    \n\n
    Parameters
    \n\n
      \n
    • mz (array_like):\nThe m/z values.
    • \n
    • abundance (array_like):\nThe abundance values.
    • \n
    • auto_process (bool):\nSpecifies whether to automatically process the mass spectrum.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • MassSpecProfile: The MassSpecProfile object.
    • \n
    \n", "signature": "(\tself,\tmz,\tabundance,\tauto_process) -> corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecProfile:", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.boosterHDF5.ReadHDF_BoosterMassSpectrum.get_attr_data", "modulename": "corems.mass_spectrum.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectrum.get_attr_data", "kind": "function", "doc": "

    Returns the attribute value for the given scan and attribute name.

    \n\n
    Parameters
    \n\n
      \n
    • scan (int):\nThe scan index.
    • \n
    • attr_srt (str):\nThe attribute name.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • object: The attribute value.
    • \n
    \n", "signature": "(self, scan, attr_srt):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.boosterHDF5.ReadHDF_BoosterMassSpectrum.get_polarity", "modulename": "corems.mass_spectrum.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectrum.get_polarity", "kind": "function", "doc": "

    Returns the polarity of the mass spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • file_location (str):\nThe path to the HDF file.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • int: The polarity of the mass spectrum.
    • \n
    \n", "signature": "(self, file_location: str | s3path.S3Path) -> int:", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.boosterHDF5.ReadHDF_BoosterMassSpectrum.get_mass_spectrum", "modulename": "corems.mass_spectrum.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectrum.get_mass_spectrum", "kind": "function", "doc": "

    Returns the mass spectrum as a MassSpecProfile object.

    \n\n
    Parameters
    \n\n
      \n
    • auto_process (bool, optional):\nSpecifies whether to automatically process the mass spectrum. Default is True.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • MassSpecProfile: The MassSpecProfile object.
    • \n
    \n", "signature": "(\tself,\tauto_process=True) -> corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecProfile:", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.boosterHDF5.ReadHDF_BoosterMassSpectrum.get_output_parameters", "modulename": "corems.mass_spectrum.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectrum.get_output_parameters", "kind": "function", "doc": "

    Returns the default output parameters for the mass spectrum.

    \n\n
    Returns
    \n\n
      \n
    • dict: The default output parameters.
    • \n
    \n", "signature": "(self) -> dict:", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.coremsHDF5", "modulename": "corems.mass_spectrum.input.coremsHDF5", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.coremsHDF5.ReadCoreMSHDF_MassSpectrum", "modulename": "corems.mass_spectrum.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectrum", "kind": "class", "doc": "

    Class for reading mass spectrum data from a CoreMS HDF5 file.

    \n\n
    Attributes
    \n\n
      \n
    • h5pydata (h5py.File):\nThe HDF5 file object.
    • \n
    • scans (list):\nList of scan labels in the HDF5 file.
    • \n
    \n\n
    Parameters
    \n\n
      \n
    • file_location (str or S3Path):\nThe path to the CoreMS HDF5 file.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • load_raw_data(mass_spectrum, scan_index=0) Load raw data into the mass spectrum object.
    • \n
    • get_mass_spectrum(scan_number=0, time_index=-1, auto_process=True, load_settings=True, load_raw=True).Get a mass spectrum object.
    • \n
    • load_settings(mass_spectrum, scan_index=0, time_index=-1). Load settings into the mass spectrum object.
    • \n
    • get_dataframe(scan_index=0, time_index=-1). Get a pandas DataFrame representing the mass spectrum.
    • \n
    • get_time_index_to_pull(scan_label, time_index). Get the time index to pull from the HDF5 file.
    • \n
    • get_high_level_attr_data(attr_str). Get high-level attribute data from the HDF5 file.
    • \n
    • get_scan_group_attr_data(scan_index, time_index, attr_group, attr_srt=None). Get scan group attribute data from the HDF5 file.
    • \n
    • get_raw_data_attr_data(scan_index, attr_group, attr_str). Get raw data attribute data from the HDF5 file.
    • \n
    • get_output_parameters(polarity, scan_index=0). Get the output parameters for the mass spectrum.
    • \n
    \n", "bases": "corems.mass_spectrum.input.massList.ReadCoremsMasslist"}, {"fullname": "corems.mass_spectrum.input.coremsHDF5.ReadCoreMSHDF_MassSpectrum.__init__", "modulename": "corems.mass_spectrum.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectrum.__init__", "kind": "function", "doc": "

    \n", "signature": "(file_location)"}, {"fullname": "corems.mass_spectrum.input.coremsHDF5.ReadCoreMSHDF_MassSpectrum.h5pydata", "modulename": "corems.mass_spectrum.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectrum.h5pydata", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.coremsHDF5.ReadCoreMSHDF_MassSpectrum.scans", "modulename": "corems.mass_spectrum.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectrum.scans", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.coremsHDF5.ReadCoreMSHDF_MassSpectrum.load_raw_data", "modulename": "corems.mass_spectrum.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectrum.load_raw_data", "kind": "function", "doc": "

    Load raw data into the mass spectrum object.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (MassSpecCentroid):\nThe mass spectrum object to load the raw data into.
    • \n
    • scan_index (int, optional):\nThe index of the scan to load the raw data from. Default is 0.
    • \n
    \n", "signature": "(self, mass_spectrum, scan_index=0):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.coremsHDF5.ReadCoreMSHDF_MassSpectrum.get_mass_spectrum", "modulename": "corems.mass_spectrum.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectrum.get_mass_spectrum", "kind": "function", "doc": "

    Get a mass spectrum object.

    \n\n
    Parameters
    \n\n
      \n
    • scan_number (int, optional):\nThe index of the scan to retrieve the mass spectrum from. Default is 0.
    • \n
    • time_index (int, optional):\nThe index of the time point to retrieve the mass spectrum from. Default is -1.
    • \n
    • auto_process (bool, optional):\nWhether to automatically process the mass spectrum. Default is True.
    • \n
    • load_settings (bool, optional):\nWhether to load the settings into the mass spectrum object. Default is True.
    • \n
    • load_raw (bool, optional):\nWhether to load the raw data into the mass spectrum object. Default is True.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • MassSpecCentroid: The mass spectrum object.
    • \n
    \n", "signature": "(\tself,\tscan_number=0,\ttime_index=-1,\tauto_process=True,\tload_settings=True,\tload_raw=True):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.coremsHDF5.ReadCoreMSHDF_MassSpectrum.load_settings", "modulename": "corems.mass_spectrum.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectrum.load_settings", "kind": "function", "doc": "

    Load settings into the mass spectrum object.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (MassSpecCentroid):\nThe mass spectrum object to load the settings into.
    • \n
    • scan_index (int, optional):\nThe index of the scan to load the settings from. Default is 0.
    • \n
    • time_index (int, optional):\nThe index of the time point to load the settings from. Default is -1.
    • \n
    \n", "signature": "(self, mass_spectrum, scan_index=0, time_index=-1):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.coremsHDF5.ReadCoreMSHDF_MassSpectrum.get_dataframe", "modulename": "corems.mass_spectrum.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectrum.get_dataframe", "kind": "function", "doc": "

    Get a pandas DataFrame representing the mass spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • scan_index (int, optional):\nThe index of the scan to retrieve the DataFrame from. Default is 0.
    • \n
    • time_index (int, optional):\nThe index of the time point to retrieve the DataFrame from. Default is -1.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • DataFrame: The pandas DataFrame representing the mass spectrum.
    • \n
    \n", "signature": "(self, scan_index=0, time_index=-1):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.coremsHDF5.ReadCoreMSHDF_MassSpectrum.get_time_index_to_pull", "modulename": "corems.mass_spectrum.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectrum.get_time_index_to_pull", "kind": "function", "doc": "

    Get the time index to pull from the HDF5 file.

    \n\n
    Parameters
    \n\n
      \n
    • scan_label (str):\nThe label of the scan.
    • \n
    • time_index (int):\nThe index of the time point.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • str: The time index to pull.
    • \n
    \n", "signature": "(self, scan_label, time_index):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.coremsHDF5.ReadCoreMSHDF_MassSpectrum.get_high_level_attr_data", "modulename": "corems.mass_spectrum.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectrum.get_high_level_attr_data", "kind": "function", "doc": "

    Get high-level attribute data from the HDF5 file.

    \n\n
    Parameters
    \n\n
      \n
    • attr_str (str):\nThe attribute string.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: The attribute data.
    • \n
    \n\n
    Raises
    \n\n
      \n
    • KeyError: If the attribute string is not found in the HDF5 file.
    • \n
    \n", "signature": "(self, attr_str):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.coremsHDF5.ReadCoreMSHDF_MassSpectrum.get_scan_group_attr_data", "modulename": "corems.mass_spectrum.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectrum.get_scan_group_attr_data", "kind": "function", "doc": "

    Get scan group attribute data from the HDF5 file.

    \n\n
    Parameters
    \n\n
      \n
    • scan_index (int):\nThe index of the scan.
    • \n
    • time_index (int):\nThe index of the time point.
    • \n
    • attr_group (str):\nThe attribute group.
    • \n
    • attr_srt (str, optional):\nThe attribute string. Default is None.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: The attribute data.
    • \n
    \n\n
    Notes
    \n\n

    This method retrieves attribute data from the HDF5 file for a specific scan and time point.\nThe attribute data is stored in the specified attribute group.\nIf an attribute string is provided, only the corresponding attribute value is returned.\nIf no attribute string is provided, all attribute data in the group is returned as a dictionary.

    \n", "signature": "(self, scan_index, time_index, attr_group, attr_srt=None):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.coremsHDF5.ReadCoreMSHDF_MassSpectrum.get_raw_data_attr_data", "modulename": "corems.mass_spectrum.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectrum.get_raw_data_attr_data", "kind": "function", "doc": "

    Get raw data attribute data from the HDF5 file.

    \n\n
    Parameters
    \n\n
      \n
    • scan_index (int):\nThe index of the scan.
    • \n
    • attr_group (str):\nThe attribute group.
    • \n
    • attr_str (str):\nThe attribute string.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: The attribute data.
    • \n
    \n\n
    Raises
    \n\n
      \n
    • KeyError: If the attribute string is not found in the attribute group.
    • \n
    \n\n
    Notes
    \n\n

    This method retrieves the attribute data associated with a specific scan, attribute group, and attribute string\nfrom the HDF5 file. It returns the attribute data as a dictionary.

    \n\n

    Example usage:

    \n\n
    \n
    >>> data = get_raw_data_attr_data(0, "group1", "attribute1")\n>>> print(data)\n{'key1': 'value1', 'key2': 'value2'}\n
    \n
    \n", "signature": "(self, scan_index, attr_group, attr_str):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.coremsHDF5.ReadCoreMSHDF_MassSpectrum.get_output_parameters", "modulename": "corems.mass_spectrum.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectrum.get_output_parameters", "kind": "function", "doc": "

    Get the output parameters for the mass spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • polarity (str):\nThe polarity of the mass spectrum.
    • \n
    • scan_index (int, optional):\nThe index of the scan. Default is 0.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: The output parameters.
    • \n
    \n", "signature": "(self, polarity, scan_index=0):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.massList", "modulename": "corems.mass_spectrum.input.massList", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.massList.ReadCoremsMasslist", "modulename": "corems.mass_spectrum.input.massList", "qualname": "ReadCoremsMasslist", "kind": "class", "doc": "

    The ReadCoremsMasslist object reads processed mass list data types\nand returns the mass spectrum obj with the molecular formula obj

    \n\n

    Only available for centroid mass spectrum type: it will ignore the parameter isCentroid \nPlease see MassListBaseClass for more details

    \n", "bases": "corems.mass_spectrum.input.baseClass.MassListBaseClass"}, {"fullname": "corems.mass_spectrum.input.massList.ReadCoremsMasslist.get_mass_spectrum", "modulename": "corems.mass_spectrum.input.massList", "qualname": "ReadCoremsMasslist.get_mass_spectrum", "kind": "function", "doc": "

    Get the mass spectrum object from the processed mass list data.

    \n\n
    Parameters
    \n\n
      \n
    • loadSettings (bool, optional):\nWhether to load the settings for the mass spectrum. Default is True.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • MassSpecCentroid: The mass spectrum object.
    • \n
    \n\n
    Raises
    \n\n
      \n
    • ValueError: If the input file is not a valid CoreMS file.
    • \n
    \n", "signature": "(\tself,\tloadSettings: bool = True) -> corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroid:", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.massList.ReadCoremsMasslist.add_molecular_formula", "modulename": "corems.mass_spectrum.input.massList", "qualname": "ReadCoremsMasslist.add_molecular_formula", "kind": "function", "doc": "

    Add molecular formula information to the mass spectrum object.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spec_obj (MassSpecCentroid):\nThe mass spectrum object to add the molecular formula to.
    • \n
    • dataframe (pandas.DataFrame):\nThe processed mass list data.
    • \n
    \n", "signature": "(self, mass_spec_obj, dataframe):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.massList.ReadMassList", "modulename": "corems.mass_spectrum.input.massList", "qualname": "ReadMassList", "kind": "class", "doc": "

    The ReadMassList object reads unprocessed mass list data types\nand returns the mass spectrum object.

    \n\n
    Parameters
    \n\n
      \n
    • MassListBaseClass (class):\nThe base class for reading mass list data types.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • get_mass_spectrum(polarity, scan=0, auto_process=True, loadSettings=True). Reads mass list data types and returns the mass spectrum object.
    • \n
    \n", "bases": "corems.mass_spectrum.input.baseClass.MassListBaseClass"}, {"fullname": "corems.mass_spectrum.input.massList.ReadMassList.get_mass_spectrum", "modulename": "corems.mass_spectrum.input.massList", "qualname": "ReadMassList.get_mass_spectrum", "kind": "function", "doc": "

    Reads mass list data types and returns the mass spectrum object.

    \n\n
    Parameters
    \n\n
      \n
    • polarity (int):\nThe polarity of the mass spectrum (+1 or -1).
    • \n
    • scan (int, optional):\nThe scan number of the mass spectrum (default is 0).
    • \n
    • auto_process (bool, optional):\nFlag indicating whether to automatically process the mass spectrum (default is True).
    • \n
    • loadSettings (bool, optional):\nFlag indicating whether to load settings for the mass spectrum (default is True).
    • \n
    \n\n
    Returns
    \n\n
      \n
    • mass_spec (MassSpecCentroid or MassSpecProfile):\nThe mass spectrum object.
    • \n
    \n", "signature": "(\tself,\tpolarity: int,\tscan: int = 0,\tauto_process: bool = True,\tloadSettings: bool = True):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.massList.ReadBrukerXMLList", "modulename": "corems.mass_spectrum.input.massList", "qualname": "ReadBrukerXMLList", "kind": "class", "doc": "

    The ReadBrukerXMLList object reads Bruker XML objects\nand returns the mass spectrum object.\nSee MassListBaseClass for details

    \n\n
    Parameters
    \n\n
      \n
    • MassListBaseClass (class):\nThe base class for reading mass list data types and returning the mass spectrum object.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • get_mass_spectrum(polarity: bool = None, scan: int = 0, auto_process: bool = True, loadSettings: bool = True). Reads mass list data types and returns the mass spectrum object.
    • \n
    \n", "bases": "corems.mass_spectrum.input.baseClass.MassListBaseClass"}, {"fullname": "corems.mass_spectrum.input.massList.ReadBrukerXMLList.get_mass_spectrum", "modulename": "corems.mass_spectrum.input.massList", "qualname": "ReadBrukerXMLList.get_mass_spectrum", "kind": "function", "doc": "

    Reads mass list data types and returns the mass spectrum object.

    \n\n
    Parameters
    \n\n
      \n
    • polarity (bool, optional):\nThe polarity of the mass spectrum. Can be +1 or -1. If not provided, it will be determined from the XML file.
    • \n
    • scan (int, optional):\nThe scan number of the mass spectrum. Default is 0.
    • \n
    • auto_process (bool, optional):\nWhether to automatically process the mass spectrum. Default is True.
    • \n
    • loadSettings (bool, optional):\nWhether to load the settings for the mass spectrum. Default is True.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • mass_spec (MassSpecCentroid):\nThe mass spectrum object representing the centroided mass spectrum.
    • \n
    \n", "signature": "(\tself,\tpolarity: bool = None,\tscan: int = 0,\tauto_process: bool = True,\tloadSettings: bool = True):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.numpyArray", "modulename": "corems.mass_spectrum.input.numpyArray", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.numpyArray.ms_from_array_profile", "modulename": "corems.mass_spectrum.input.numpyArray", "qualname": "ms_from_array_profile", "kind": "function", "doc": "

    Create a MassSpecProfile object from an array of m/z values and abundance values.

    \n\n

    Parameters:\n mz (numpy.ndarray): Array of m/z values.\n abundance (numpy.ndarray): Array of abundance values.\n dataname (str): Name of the data.\n polarity (int, optional): Polarity of the data. Defaults to -1.\n auto_process (bool, optional): Flag to automatically process the data. Defaults to True.\n data_type (str, optional): Type of the data. Defaults to Labels.simulated_profile.

    \n\n

    Returns:\n MassSpecProfile: The created MassSpecProfile object.

    \n", "signature": "(\tmz,\tabundance,\tdataname: str,\tpolarity: int = -1,\tauto_process: bool = True,\tdata_type: str = 'Simulated Profile'):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.numpyArray.ms_from_array_centroid", "modulename": "corems.mass_spectrum.input.numpyArray", "qualname": "ms_from_array_centroid", "kind": "function", "doc": "

    Create a MassSpecCentroid object from an array of m/z values, abundance values, resolution power, and signal-to-noise ratio.

    \n\n

    Parameters:\n mz (numpy.ndarray): Array of m/z values.\n abundance (numpy.ndarray): Array of abundance values.\n rp list(float): Resolution power.\n s2n list(float): Signal-to-noise ratio.\n dataname (str): Name of the data.\n polarity (int, optional): Polarity of the data. Defaults to -1.\n auto_process (bool, optional): Flag to automatically process the data. Defaults to True.

    \n\n

    Returns:\n MassSpecCentroid: The created MassSpecCentroid object.

    \n", "signature": "(\tmz,\tabundance,\trp: list[float],\ts2n: list[float],\tdataname: str,\tpolarity: int = -1,\tauto_process: bool = True):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.numpyArray.get_output_parameters", "modulename": "corems.mass_spectrum.input.numpyArray", "qualname": "get_output_parameters", "kind": "function", "doc": "

    Get the output parameters for creating a MassSpecProfile or MassSpecCentroid object.

    \n\n

    Parameters:\n polarity (int): Polarity of the data.\n file_location (str): File location.

    \n\n

    Returns:\n dict: Output parameters.

    \n", "signature": "(polarity: int, file_location: str):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.win_only", "modulename": "corems.mass_spectrum.input.win_only", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.output", "modulename": "corems.mass_spectrum.output", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.output.export", "modulename": "corems.mass_spectrum.output.export", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport", "kind": "class", "doc": "

    A class for exporting high-resolution mass spectra.

    \n\n
    Parameters
    \n\n
      \n
    • out_file_path (str):\nThe output file path.
    • \n
    • mass_spectrum (MassSpectrum):\nThe mass spectrum to export.
    • \n
    • output_type (str, optional):\nThe type of output file. Defaults to 'excel'. Can be 'excel', 'csv', 'pandas' or 'hdf5'.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • output_file (Path):\nThe output file path.
    • \n
    • output_type (str):\nThe type of output file.
    • \n
    • mass_spectrum (MassSpectrum):\nThe mass spectrum to export.
    • \n
    • atoms_order_list (list):\nThe list of assigned atoms in the order specified by Atoms.atoms_order list.
    • \n
    • columns_label (list):\nThe column labels in order.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • save().\nSave the mass spectrum data to the output file.
    • \n
    • run().\nRun the export process.
    • \n
    • get_pandas_df().\nReturns the mass spectrum data as a pandas DataFrame.
    • \n
    • write_settings(output_path, mass_spectrum).\nWrites the settings of the mass spectrum to a JSON file.
    • \n
    • to_pandas(write_metadata=True).\nExports the mass spectrum data to a pandas DataFrame and saves it as a pickle file.
    • \n
    • to_excel(write_metadata=True).\nExports the mass spectrum data to an Excel file.
    • \n
    • to_csv(write_metadata=True).\nExports the mass spectrum data to a CSV file.
    • \n
    • to_json().\nExports the mass spectrum data to a JSON string.
    • \n
    • to_hdf().\nExports the mass spectrum data to an HDF5 file.
    • \n
    • parameters_to_toml().\nConverts the mass spectrum parameters to a TOML string.
    • \n
    • parameters_to_json().\nConverts the mass spectrum parameters to a JSON string.
    • \n
    • get_mass_spec_attrs(mass_spectrum).\nReturns the mass spectrum attributes as a dictionary.
    • \n
    • get_all_used_atoms_in_order(mass_spectrum).\nReturns the list of assigned atoms in the order specified by Atoms.atoms_order list.
    • \n
    • list_dict_to_list(mass_spectrum, is_hdf5=False).\nReturns the mass spectrum data as a list of dictionaries.
    • \n
    • get_list_dict_data(mass_spectrum, include_no_match=True, include_isotopologues=True, isotopologue_inline=True, no_match_inline=False, is_hdf5=False).\nReturns the mass spectrum data as a list of dictionaries.
    • \n
    \n", "bases": "threading.Thread"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.__init__", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.__init__", "kind": "function", "doc": "

    This constructor should always be called with keyword arguments. Arguments are:

    \n\n

    group should be None; reserved for future extension when a ThreadGroup\nclass is implemented.

    \n\n

    target is the callable object to be invoked by the run()\nmethod. Defaults to None, meaning nothing is called.

    \n\n

    name is the thread name. By default, a unique name is constructed of\nthe form \"Thread-N\" where N is a small decimal number.

    \n\n

    args is the argument tuple for the target invocation. Defaults to ().

    \n\n

    kwargs is a dictionary of keyword arguments for the target\ninvocation. Defaults to {}.

    \n\n

    If a subclass overrides the constructor, it must make sure to invoke\nthe base class constructor (Thread.__init__()) before doing anything\nelse to the thread.

    \n", "signature": "(out_file_path, mass_spectrum, output_type='excel')"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.output_file", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.output_file", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.output_type", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.output_type", "kind": "variable", "doc": "

    Returns the output type of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.mass_spectrum", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.mass_spectrum", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.atoms_order_list", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.atoms_order_list", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.save", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.save", "kind": "function", "doc": "

    Save the mass spectrum data to the output file.

    \n\n
    Raises
    \n\n
      \n
    • ValueError: If the output type is not supported.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.run", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.run", "kind": "function", "doc": "

    Run the export process.

    \n\n

    This method is called when the thread starts.\nIt calls the save method to perform the export.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.get_pandas_df", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.get_pandas_df", "kind": "function", "doc": "

    Returns the mass spectrum data as a pandas DataFrame.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.write_settings", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.write_settings", "kind": "function", "doc": "

    Writes the settings of the mass spectrum to a JSON file.

    \n\n
    Parameters
    \n\n
      \n
    • output_path (str):\nThe output file path.
    • \n
    • mass_spectrum (MassSpectrum):\nThe mass spectrum to export.
    • \n
    \n", "signature": "(self, output_path, mass_spectrum):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.to_pandas", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.to_pandas", "kind": "function", "doc": "

    Exports the mass spectrum data to a pandas DataFrame and saves it as a pickle file.

    \n\n
    Parameters
    \n\n
      \n
    • write_metadata (bool, optional):\nWhether to write the metadata to a JSON file. Defaults to True.
    • \n
    \n", "signature": "(self, write_metadata=True):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.to_excel", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.to_excel", "kind": "function", "doc": "

    Exports the mass spectrum data to an Excel file.

    \n\n
    Parameters
    \n\n
      \n
    • write_metadata (bool, optional):\nWhether to write the metadata to a JSON file. Defaults to True.
    • \n
    \n", "signature": "(self, write_metadata=True):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.to_csv", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.to_csv", "kind": "function", "doc": "

    Exports the mass spectrum data to a CSV file.

    \n\n
    Parameters
    \n\n
      \n
    • write_metadata (bool, optional):\nWhether to write the metadata to a JSON file. Defaults to True.
    • \n
    \n", "signature": "(self, write_metadata=True):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.to_json", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.to_json", "kind": "function", "doc": "

    Exports the mass spectrum data to a JSON string.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.to_hdf", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.to_hdf", "kind": "function", "doc": "

    Exports the mass spectrum data to an HDF5 file.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.parameters_to_toml", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.parameters_to_toml", "kind": "function", "doc": "

    Converts the mass spectrum parameters to a TOML string.

    \n\n
    Returns
    \n\n
      \n
    • str: The TOML string of the mass spectrum parameters.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.parameters_to_json", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.parameters_to_json", "kind": "function", "doc": "

    Converts the mass spectrum parameters to a JSON string.

    \n\n
    Returns
    \n\n
      \n
    • str: The JSON string of the mass spectrum parameters.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.get_mass_spec_attrs", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.get_mass_spec_attrs", "kind": "function", "doc": "

    Returns the mass spectrum attributes as a dictionary.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (MassSpectrum):\nThe mass spectrum to export.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: The mass spectrum attributes.
    • \n
    \n", "signature": "(self, mass_spectrum):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.get_all_used_atoms_in_order", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.get_all_used_atoms_in_order", "kind": "function", "doc": "

    Returns the list of assigned atoms in the order specified by Atoms.atoms_order list.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (MassSpectrum):\nThe mass spectrum to export.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: The list of assigned atoms in the order specified by Atoms.atoms_order list.
    • \n
    \n", "signature": "(self, mass_spectrum):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.list_dict_to_list", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.list_dict_to_list", "kind": "function", "doc": "

    Returns the mass spectrum data as a list of dictionaries.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (MassSpectrum):\nThe mass spectrum to export.
    • \n
    • is_hdf5 (bool, optional):\nWhether the mass spectrum is being exported to an HDF5 file. Defaults to False.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: The mass spectrum data as a list of dictionaries.
    • \n
    \n", "signature": "(self, mass_spectrum, is_hdf5=False):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.get_list_dict_data", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.get_list_dict_data", "kind": "function", "doc": "

    Returns the mass spectrum data as a list of dictionaries.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (MassSpectrum):\nThe mass spectrum to export.
    • \n
    • include_no_match (bool, optional):\nWhether to include unassigned (no match) data. Defaults to True.
    • \n
    • include_isotopologues (bool, optional):\nWhether to include isotopologues. Defaults to True.
    • \n
    • isotopologue_inline (bool, optional):\nWhether to include isotopologues inline. Defaults to True.
    • \n
    • no_match_inline (bool, optional):\nWhether to include unassigned (no match) data inline. Defaults to False.
    • \n
    • is_hdf5 (bool, optional):\nWhether the mass spectrum is being exported to an HDF5 file. Defaults to False.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: The mass spectrum data as a list of dictionaries.
    • \n
    \n", "signature": "(\tself,\tmass_spectrum,\tinclude_no_match=True,\tinclude_isotopologues=True,\tisotopologue_inline=True,\tno_match_inline=False,\tis_hdf5=False):", "funcdef": "def"}, {"fullname": "corems.molecular_formula", "modulename": "corems.molecular_formula", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.calc", "modulename": "corems.molecular_formula.calc", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.calc.MolecularFormulaCalc", "modulename": "corems.molecular_formula.calc.MolecularFormulaCalc", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.calc.MolecularFormulaCalc.MolecularFormulaCalc", "modulename": "corems.molecular_formula.calc.MolecularFormulaCalc", "qualname": "MolecularFormulaCalc", "kind": "class", "doc": "

    Class of calculations related to molecular formula

    \n\n

    This class is not intended to be used directly, but rather to be inherited by other classes in the molecular_formula/factory module like MolecularFormula, MolecularFormulaIsotopologue, and LCMSLibRefMolecularFormula

    \n\n
    Attributes
    \n\n
      \n
    • mz_calc (float):\nThe m/z value of the molecular formula.
    • \n
    • neutral_mass (float):\nThe neutral mass of the molecular formula.
    • \n
    • ion_charge (int):\nThe ion charge of the molecular formula.
    • \n
    • _external_mz (float):\nThe externally provided m/z value of the molecular formula.
    • \n
    • _d_molecular_formula (dict):\nThe dictionary representation of the molecular formula.
    • \n
    • _mspeak_parent (object):\nThe parent MS peak object associated with the molecular formula.
    • \n
    • _assignment_mass_error (float):\nThe mass error of the molecular formula.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • _calc_resolving_power_low_pressure(B, T) \nCalculate the resolving power at low pressure.
    • \n
    • _calc_resolving_power_high_pressure(B, T)\nCalculate the resolving power at high pressure.
    • \n
    • _adduct_mz(adduct_atom, ion_charge)\nGet the m/z value of an adducted ion version of the molecular formula.
    • \n
    • _protonated_mz(ion_charge)\nGet the m/z value of a protonated or deprotonated ion version of the molecular formula.
    • \n
    • _radical_mz(ion_charge)\nGet the m/z value of a radical ion version of the molecular formula.
    • \n
    • _neutral_mass()\nGet the neutral mass of the molecular formula.
    • \n
    • _calc_mz()\nGet the m/z value of the molecular formula.
    • \n
    • _calc_assignment_mass_error(method='ppm')\nCalculate the mass error of the molecular formula.
    • \n
    • _calc_mz_confidence(mean=0)\nCalculate the m/z confidence of the molecular formula.
    • \n
    • _calc_isotopologue_confidence()\nCalculate the isotopologue confidence of the molecular formula.
    • \n
    • normalize_distance(dist, dist_range)\nNormalize the distance value.
    • \n
    • subtract_formula(formula_obj, formated=True)\nSubtract a formula from the current formula object.
    • \n
    • _calc_average_mz_score()\nCalculate the average m/z error score of the molecular formula identification, including the isotopologues.
    • \n
    \n"}, {"fullname": "corems.molecular_formula.calc.MolecularFormulaCalc.MolecularFormulaCalc.normalize_distance", "modulename": "corems.molecular_formula.calc.MolecularFormulaCalc", "qualname": "MolecularFormulaCalc.normalize_distance", "kind": "function", "doc": "

    Normalize the distance value.

    \n\n
    Parameters
    \n\n
      \n
    • dist (float):\nThe distance value to be normalized.
    • \n
    • dist_range (list):\nThe range of the distance value.
    • \n
    \n", "signature": "(self, dist, dist_range):", "funcdef": "def"}, {"fullname": "corems.molecular_formula.calc.MolecularFormulaCalc.MolecularFormulaCalc.subtract_formula", "modulename": "corems.molecular_formula.calc.MolecularFormulaCalc", "qualname": "MolecularFormulaCalc.subtract_formula", "kind": "function", "doc": "

    Subtract a formula from the current formula object

    \n\n
    Parameters
    \n\n
      \n
    • formula_obj (MolecularFormula):\nMolecularFormula object to be subtracted from the current formula object
    • \n
    • formated (bool, optional):\nIf True, returns the formula in string format, by default True
    • \n
    \n", "signature": "(self, formula_obj, formated=True):", "funcdef": "def"}, {"fullname": "corems.molecular_formula.calc.MolecularFormulaCalc.MolecularFormulaCalc.dbe_ai", "modulename": "corems.molecular_formula.calc.MolecularFormulaCalc", "qualname": "MolecularFormulaCalc.dbe_ai", "kind": "variable", "doc": "

    Calculate the double bond equivalent (DBE) of the molecular formula, based on the number of carbons, hydrogens, and oxygens.

    \n"}, {"fullname": "corems.molecular_formula.factory", "modulename": "corems.molecular_formula.factory", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase", "kind": "class", "doc": "

    Base class for representing a molecular formula.

    \n\n
    Parameters
    \n\n
      \n
    • molecular_formula (dict, list, str):\nThe molecular formula.
    • \n
    • ion_charge (int):\nThe ion charge.
    • \n
    • ion_type (str, optional):\nThe ion type. Defaults to None.
    • \n
    • adduct_atom (str, optional):\nThe adduct atom. Defaults to None.
    • \n
    • mspeak_parent (_MSPeak, optional):\nThe parent mass spectrum peak object instance. Defaults to None.
    • \n
    • external_mz (float, optional):\nThe external m/z value. Defaults to None.
    • \n
    \n\n
    Raises
    \n\n
      \n
    • TypeError: If the ion type is not 'DE_OR_PROTONATED', 'RADICAL' or 'ADDUCT'.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • isotopologue_count_percentile (float):\nThe isotopologue count percentile.
    • \n
    • O_C (float):\nThe O/C ratio.
    • \n
    • H_C (float):\nThe H/C ratio.
    • \n
    • dbe (float):\nThe double bond equivalent.
    • \n
    • mz_nominal_calc (int):\nThe nominal m/z value.
    • \n
    • mz_error (float):\nThe m/z error.
    • \n
    • mz_calc (float):\nThe m/z value.
    • \n
    • protonated_mz (float):\nThe protonated or deprotonated m/z value.
    • \n
    • radical_mz (float):\nThe radical m/z value.
    • \n
    • neutral_mass (float):\nThe neutral mass.
    • \n
    • ion_type (str):\nThe ion type.
    • \n
    • ion_charge (int):\nThe ion charge.
    • \n
    • atoms (list):\nThe atoms in the molecular formula.
    • \n
    • confidence_score (float):\nThe confidence score of the molecular formula identification.
    • \n
    • isotopologue_similarity (float):\nThe isotopologue similarity score of the molecular formula identification.
    • \n
    • average_mz_error_score (float):\nThe average m/z error score of the molecular formula identification, including the isotopologues.
    • \n
    • mz_error_score (float):\nThe m/z error score of the molecular formula identification.
    • \n
    • kmd (float):\nThe Kendrick mass defect (KMD).
    • \n
    • kendrick_mass (float):\nThe Kendrick mass.
    • \n
    • knm (float):\nThe nominal Kendrick mass.
    • \n
    • string (str):\nThe molecular formula string.
    • \n
    • string_formated (str):\nThe molecular formula string formated with subscripts and superscripts.
    • \n
    • class_label (str):\nThe class label.
    • \n
    • class_dict (dict):\nThe class dictionary.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • change_kendrick_base(kendrick_dict_base).\nChange the Kendrick base.
    • \n
    • isotopologues(min_abundance, current_mono_abundance, dynamic_range).\nCalculate the isotopologues.
    • \n
    • atoms_qnt(atom).\nGet the atom quantity.
    • \n
    • atoms_symbol(atom).\nGet the atom symbol without the mass number.
    • \n
    • to_dict().\nGet the molecular formula as a dictionary.
    • \n
    • to_list().\nGet the molecular formula as a list.
    • \n
    \n", "bases": "corems.molecular_formula.calc.MolecularFormulaCalc.MolecularFormulaCalc"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.__init__", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tmolecular_formula,\tion_charge,\tion_type=None,\tadduct_atom=None,\tmspeak_parent=None,\texternal_mz=None)"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.is_isotopologue", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.is_isotopologue", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.expected_isotopologues", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.expected_isotopologues", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.mspeak_mf_isotopologues_indexes", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.mspeak_mf_isotopologues_indexes", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.get", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.get", "kind": "function", "doc": "

    Get the atom quantity of a specific atom.

    \n\n
    Parameters
    \n\n
      \n
    • atom (str):\nThe atom symbol.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • int: The atom quantity.
    • \n
    \n", "signature": "(self, atom):", "funcdef": "def"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.split", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.split", "kind": "function", "doc": "

    Splits the molecular formula string.

    \n\n
    Parameters
    \n\n
      \n
    • delimiters (list):\nThe list of delimiters.
    • \n
    • string (str):\nThe molecular formula string.
    • \n
    • maxsplit (int, optional):\nThe maximum number of splits. Defaults to 0.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: The molecular formula list.
    • \n
    \n\n
    Notes
    \n\n

    Does not work when formula has atoms with same characters in a row that below to different atoms, i.e. C10H21NNa.

    \n", "signature": "(self, delimiters, string, maxsplit=0):", "funcdef": "def"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.isotopologue_count_percentile", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.isotopologue_count_percentile", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.O_C", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.O_C", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.H_C", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.H_C", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.dbe", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.dbe", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.mz_nominal_calc", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.mz_nominal_calc", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.mz_error", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.mz_error", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.mz_calc", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.mz_calc", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.protonated_mz", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.protonated_mz", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.radical_mz", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.radical_mz", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.neutral_mass", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.neutral_mass", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.adduct_mz", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.adduct_mz", "kind": "function", "doc": "

    Get m/z of an adducted ion version of the molecular formula.

    \n\n
    Parameters
    \n\n
      \n
    • adduct_atom (str):\nThe adduct atom.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: The m/z value of the adducted ion version of the molecular formula.
    • \n
    \n", "signature": "(self, adduct_atom):", "funcdef": "def"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.ion_type", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.ion_type", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.ion_charge", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.ion_charge", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.atoms", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.atoms", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.confidence_score", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.confidence_score", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.isotopologue_similarity", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.isotopologue_similarity", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.average_mz_error_score", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.average_mz_error_score", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.mz_error_score", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.mz_error_score", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.kmd", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.kmd", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.kendrick_mass", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.kendrick_mass", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.knm", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.knm", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.change_kendrick_base", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.change_kendrick_base", "kind": "function", "doc": "

    Change the Kendrick base.

    \n\n
    Parameters
    \n\n
      \n
    • kendrick_dict_base (dict):\nThe Kendrick base dictionary. Ex: {\"C\": 1, \"H\": 2}
    • \n
    \n", "signature": "(self, kendrick_dict_base):", "funcdef": "def"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.isotopologues", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.isotopologues", "kind": "function", "doc": "

    Calculate the isotopologues for a given molecular formula.

    \n\n
    Parameters
    \n\n
      \n
    • min_abundance (float):\nThe minimum abundance.
    • \n
    • current_mono_abundance (float):\nThe current monoisotopic abundance.
    • \n
    • dynamic_range (float):\nThe dynamic range.
    • \n
    \n\n
    Yields
    \n\n
      \n
    • MolecularFormulaIsotopologue: The molecular formula isotopologue.
    • \n
    \n\n
    Notes
    \n\n

    This calculation ignores the hydrogen isotopes.

    \n", "signature": "(self, min_abundance, current_mono_abundance, dynamic_range):", "funcdef": "def"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.atoms_qnt", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.atoms_qnt", "kind": "function", "doc": "

    Get the atom quantity of a specific atom in the molecular formula.

    \n", "signature": "(self, atom):", "funcdef": "def"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.atoms_symbol", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.atoms_symbol", "kind": "function", "doc": "

    Get the atom symbol without the mass number.

    \n", "signature": "(self, atom):", "funcdef": "def"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.string", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.string", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.string_formated", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.string_formated", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.to_dict", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.to_dict", "kind": "function", "doc": "

    Returns the molecular formula as a dictionary.

    \n\n
    Returns
    \n\n
      \n
    • dict: The molecular formula as a dictionary.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.to_list", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.to_list", "kind": "function", "doc": "

    Returns the molecular formula as a list.

    \n\n
    Returns
    \n\n
      \n
    • list: The molecular formula as a list.
    • \n
    \n\n
    Raises
    \n\n
      \n
    • Exception: If the molecular formula identification was not performed yet.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.class_label", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.class_label", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.class_dict", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.class_dict", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaIsotopologue", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaIsotopologue", "kind": "class", "doc": "

    Class for representing a molecular formula isotopologue.

    \n\n
    Parameters
    \n\n
      \n
    • _d_molecular_formula (dict):\nThe molecular formula as a dictionary.
    • \n
    • prob_ratio (float):\nThe probability ratio.
    • \n
    • mono_abundance (float):\nThe monoisotopic abundance.
    • \n
    • ion_charge (int):\nThe ion charge.
    • \n
    • mspeak_parent (object, optional):\nThe parent mass spectrum peak object instance. Defaults to None.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • prob_ratio (float):\nThe probability ratio.
    • \n
    • abundance_calc (float):\nThe calculated abundance.
    • \n
    • area_error (float):\nThe area error.
    • \n
    • abundance_error (float):\nThe abundance error.
    • \n
    • is_isotopologue (bool):\nThe isotopologue flag. Defaults to True.
    • \n
    • mspeak_index_mono_isotopic (int):\nThe index of the monoisotopic peak in the mass spectrum peak list. Defaults to None.
    • \n
    • mono_isotopic_formula_index (int):\nThe index of the monoisotopic formula in the molecular formula list. Defaults to None.
    • \n
    \n", "bases": "MolecularFormulaBase"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaIsotopologue.__init__", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaIsotopologue.__init__", "kind": "function", "doc": "

    \n", "signature": "(\t_d_molecular_formula,\tprob_ratio,\tmono_abundance,\tion_charge,\tmspeak_parent=None)"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaIsotopologue.prob_ratio", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaIsotopologue.prob_ratio", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaIsotopologue.abundance_calc", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaIsotopologue.abundance_calc", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaIsotopologue.is_isotopologue", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaIsotopologue.is_isotopologue", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaIsotopologue.mspeak_index_mono_isotopic", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaIsotopologue.mspeak_index_mono_isotopic", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaIsotopologue.mono_isotopic_formula_index", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaIsotopologue.mono_isotopic_formula_index", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaIsotopologue.area_error", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaIsotopologue.area_error", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaIsotopologue.abundance_error", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaIsotopologue.abundance_error", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.LCMSLibRefMolecularFormula", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "LCMSLibRefMolecularFormula", "kind": "class", "doc": "

    Class for representing a molecular formula associated with a molecule in a LCMS library reference.

    \n\n
    Parameters
    \n\n
      \n
    • molecular_formula (dict, list, str):\nThe molecular formula.
    • \n
    • ion_charge (int):\nThe ion charge.
    • \n
    • ion_type (str, optional):\nThe ion type. Defaults to None.
    • \n
    • adduct_atom (str, optional):\nThe adduct atom. Defaults to None.
    • \n
    • mspeak_parent (object, optional):\nThe parent mass spectrum peak object instance. Defaults to None.
    • \n
    • name (str, optional):\nThe name of the reference molecule. Defaults to None.
    • \n
    • kegg_id (str, optional):\nThe KEGG ID of the reference molecule. Defaults to None.
    • \n
    • cas (str, optional):\nThe CAS number of the reference molecule. Defaults to None.
    • \n
    \n", "bases": "MolecularFormulaBase"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.LCMSLibRefMolecularFormula.__init__", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "LCMSLibRefMolecularFormula.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tmolecular_formula,\tion_charge,\tion_type=None,\tadduct_atom=None,\tmspeak_parent=None,\tname=None,\tkegg_id=None,\tcas=None)"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.LCMSLibRefMolecularFormula.name", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "LCMSLibRefMolecularFormula.name", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.LCMSLibRefMolecularFormula.kegg_id", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "LCMSLibRefMolecularFormula.kegg_id", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.LCMSLibRefMolecularFormula.cas", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "LCMSLibRefMolecularFormula.cas", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormula", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormula", "kind": "class", "doc": "

    General class for representing a molecular formula.

    \n\n
    Parameters
    \n\n
      \n
    • molecular_formula (dict, list, str):\nThe molecular formula.
    • \n
    • ion_charge (int):\nThe ion charge.
    • \n
    • ion_type (str, optional):\nThe ion type. Defaults to None.
    • \n
    • adduct_atom (str, optional):\nThe adduct atom. Defaults to None.
    • \n
    • mspeak_parent (object, optional):\nThe parent mass spectrum peak object instance. Defaults to None.
    • \n
    • external_mz (float, optional):\nThe external m/z value. Defaults to False.
    • \n
    \n", "bases": "MolecularFormulaBase"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormula.__init__", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormula.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tmolecular_formula,\tion_charge,\tion_type=None,\tadduct_atom=None,\tmspeak_parent=None,\texternal_mz=False)"}, {"fullname": "corems.molecular_formula.input", "modulename": "corems.molecular_formula.input", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.input.masslist_ref", "modulename": "corems.molecular_formula.input.masslist_ref", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.input.masslist_ref.MolecularFormulaLinkProxy", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "MolecularFormulaLinkProxy", "kind": "class", "doc": "

    Proxy class for MolecularFormulaLink to be used in the molecular formula ref file import

    \n\n
    Parameters
    \n\n
      \n
    • molecular_formula (MolecularFormula | LCMSLibRefMolecularFormula):\ncorems MolecularFormula or LCMSLibRefMolecularFormula object
    • \n
    • mz (float):\ntarget m/z
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • C (int):\nnumber of carbon atoms
    • \n
    • H (int):\nnumber of hydrogen atoms
    • \n
    • H_C (float):\nratio of hydrogen to carbon atoms
    • \n
    • class_label (str):\nmolecular formula class label
    • \n
    • mz_calc (float):\ncalculated m/z
    • \n
    • dbe (int):\ndouble bond equivalent
    • \n
    • formula_dict (dict):\nmolecular formula dictionary
    • \n
    \n\n
    Methods
    \n\n
      \n
    • to_dict(). \nreturn molecular formula dictionary
    • \n
    \n"}, {"fullname": "corems.molecular_formula.input.masslist_ref.MolecularFormulaLinkProxy.__init__", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "MolecularFormulaLinkProxy.__init__", "kind": "function", "doc": "

    \n", "signature": "(molecular_formula, mz)"}, {"fullname": "corems.molecular_formula.input.masslist_ref.MolecularFormulaLinkProxy.C", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "MolecularFormulaLinkProxy.C", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.input.masslist_ref.MolecularFormulaLinkProxy.H", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "MolecularFormulaLinkProxy.H", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.input.masslist_ref.MolecularFormulaLinkProxy.H_C", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "MolecularFormulaLinkProxy.H_C", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.input.masslist_ref.MolecularFormulaLinkProxy.class_label", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "MolecularFormulaLinkProxy.class_label", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.input.masslist_ref.MolecularFormulaLinkProxy.mz_calc", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "MolecularFormulaLinkProxy.mz_calc", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.input.masslist_ref.MolecularFormulaLinkProxy.dbe", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "MolecularFormulaLinkProxy.dbe", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.input.masslist_ref.MolecularFormulaLinkProxy.formula_dict", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "MolecularFormulaLinkProxy.formula_dict", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.input.masslist_ref.MolecularFormulaLinkProxy.to_dict", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "MolecularFormulaLinkProxy.to_dict", "kind": "function", "doc": "

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_formula.input.masslist_ref.ImportMassListRef", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "ImportMassListRef", "kind": "class", "doc": "

    Import Mass List from Reference File

    \n\n
    Parameters
    \n\n
      \n
    • ref_file_location (str):\npath to the reference file
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • ref_file_location (str):\npath to the reference file
    • \n
    \n\n
    Methods
    \n\n
      \n
    • molecular_formula_ref(mz, molecular_formula). \nReturn MolecularFormulaLinkProxy object
    • \n
    • from_lcms_lib_file(ion_charge, ion_types).\nReturn Dict[standard_name, Dict[m/z, List[MolecularFormula]]] from LCMS library reference file
    • \n
    • from_bruker_ref_file().\nReturn List[MolecularFormula] from Bruker reference file
    • \n
    • from_corems_ref_file(delimiter).\nReturn List[MolecularFormula] from CoreMS reference file
    • \n
    • split(delimiters, string, maxsplit).\nSplits a string using a list of delimiters.
    • \n
    • mformula_s_to_dict(s_mformulatring, iontype).\nConverts a molecular formula string to a dict
    • \n
    \n"}, {"fullname": "corems.molecular_formula.input.masslist_ref.ImportMassListRef.__init__", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "ImportMassListRef.__init__", "kind": "function", "doc": "

    \n", "signature": "(ref_file_location)"}, {"fullname": "corems.molecular_formula.input.masslist_ref.ImportMassListRef.ref_file_location", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "ImportMassListRef.ref_file_location", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.input.masslist_ref.ImportMassListRef.molecular_formula_ref", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "ImportMassListRef.molecular_formula_ref", "kind": "function", "doc": "

    Instantiate a MolecularFormulaLinkProxy object

    \n\n
    Parameters
    \n\n
      \n
    • mz (float):\ntarget m/z
    • \n
    • molecular_formula (MolecularFormula | LCMSLibRefMolecularFormula):\ncorems MolecularFormula or LCMSLibRefMolecularFormula object
    • \n
    \n\n
    Returns
    \n\n
      \n
    • MolecularFormulaLinkProxy: MolecularFormulaLinkProxy object
    • \n
    \n", "signature": "(self, mz, molecular_formula):", "funcdef": "def"}, {"fullname": "corems.molecular_formula.input.masslist_ref.ImportMassListRef.from_lcms_lib_file", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "ImportMassListRef.from_lcms_lib_file", "kind": "function", "doc": "

    Create a dictionary of LCMSLibRefMolecularFormula objects from LCMS library reference file

    \n\n
    Parameters
    \n\n
      \n
    • ion_charge (float):\nion charge
    • \n
    • ion_types (List[str]):\nlist of ion types
    • \n
    \n\n
    Returns
    \n\n
      \n
    • Dict: Dict[standard_name, Dict[m/z, List[MolecularFormula]]] from LCMS library reference file. m/z is the target m/z; standard_name is the name of the molecular standard mix; MolecularFormula is the corems molecular formula class
    • \n
    \n", "signature": "(\tself,\tion_charge: float,\tion_types: List[str]) -> Dict[str, Dict[float, List[corems.molecular_formula.factory.MolecularFormulaFactory.LCMSLibRefMolecularFormula]]]:", "funcdef": "def"}, {"fullname": "corems.molecular_formula.input.masslist_ref.ImportMassListRef.from_bruker_ref_file", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "ImportMassListRef.from_bruker_ref_file", "kind": "function", "doc": "

    Create a list of MolecularFormula objects from Bruker reference file

    \n\n
    Returns
    \n\n
      \n
    • List[MolecularFormula]: List of MolecularFormula objects from Bruker reference file
    • \n
    \n", "signature": "(\tself) -> List[corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormula]:", "funcdef": "def"}, {"fullname": "corems.molecular_formula.input.masslist_ref.ImportMassListRef.from_corems_ref_file", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "ImportMassListRef.from_corems_ref_file", "kind": "function", "doc": "

    Create a list of MolecularFormula objects from CoreMS reference file

    \n\n

    Not being used

    \n\n
    Parameters
    \n\n
      \n
    • delimiter (str):\ndelimiter used in the reference file
    • \n
    \n\n
    Returns
    \n\n
      \n
    • List[MolecularFormula]: List of MolecularFormula objects from CoreMS reference file
    • \n
    \n", "signature": "(self, delimiter='\\t'):", "funcdef": "def"}, {"fullname": "corems.molecular_formula.input.masslist_ref.ImportMassListRef.split", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "ImportMassListRef.split", "kind": "function", "doc": "

    Splits a string using a list of delimiters.

    \n\n

    Does not work when formula has atoms with same characters, i.e - C10H21NNa

    \n\n
    Parameters
    \n\n
      \n
    • delimiters (list):\nlist of delimiters
    • \n
    • string (str):\nstring to be split
    • \n
    • maxsplit (int, optional):\nmaximum number of splits. Default is 0
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: list of strings obtained after splitting the string
    • \n
    • list: list of counts obtained after splitting the string
    • \n
    \n", "signature": "(self, delimiters, string, maxsplit=0):", "funcdef": "def"}, {"fullname": "corems.molecular_formula.input.masslist_ref.ImportMassListRef.mformula_s_to_dict", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "ImportMassListRef.mformula_s_to_dict", "kind": "function", "doc": "

    Converts a molecular formula string to a dict

    \n\n
    Parameters
    \n\n
      \n
    • s_mformulatring (str):\nmolecular formula string, i.e. 'C10H21NNa'
    • \n
    • iontype (str, optional):\nion type. Default is 'unknown'
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: molecular formula dictionary
    • \n
    \n\n
    Notes
    \n\n

    Does not work if the atomic mass number is passed i.e. 37Cl, 81Br, convention follow the light isotope labeling 35Cl is Cl, 12C is C, etc.\nIf you need to use heavy isotopes please use another reference file format that separate the formula string by a blank space and parse it using the function corems_ref_file

    \n\n
    Raises
    \n\n
      \n
    • TypeError: Atom does not exist in Atoms.atoms_order list
    • \n
    • Exception: Empty molecular formula
    • \n
    \n", "signature": "(self, s_mformulatring, iontype='unknown'):", "funcdef": "def"}, {"fullname": "corems.molecular_id", "modulename": "corems.molecular_id", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc", "modulename": "corems.molecular_id.calc", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.ClusterFilter", "modulename": "corems.molecular_id.calc.ClusterFilter", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.ClusterFilter.ClusteringFilter", "modulename": "corems.molecular_id.calc.ClusterFilter", "qualname": "ClusteringFilter", "kind": "class", "doc": "

    Class for filtering and clustering mass spectra data using various algorithms.

    \n\n
    Attributes
    \n\n
      \n
    • mass_spectrum (MassSpectrum):\nMass spectrum object.
    • \n
    • ms_peaks (list):\nList of mass peaks.
    • \n
    • ms_peak_indexes (list):\nList of peak indexes.
    • \n
    • min_samples (int):\nMinimum number of samples in a cluster.
    • \n
    • eps (float):\nThe maximum distance between two samples for one to be considered as in the neighborhood of the other.
    • \n
    • bandwidth (float):\nBandwidth used in MeanShift algorithm.
    • \n
    • quantile (float):\nQuantile used in estimate_bandwidth function.
    • \n
    • n_samples (int):\nNumber of samples used in estimate_bandwidth function.
    • \n
    • bin_seeding (bool):\nIf true, initial kernel locations are not locations of all points, but rather the location of the discretized version of points, where points are binned onto a grid whose coarseness corresponds to the bandwidth. Setting this option to True will speed up the algorithm because fewer seeds will be initialized.
    • \n
    • min_peaks_per_class (int):\nMinimum number of peaks per class.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • get_mass_error_matrix_data(ms_peaks).\nGet the mass error matrix data from a list of mass peaks.
    • \n
    • get_kendrick_matrix_data(mass_spectrum).\nGet the Kendrick matrix data from a mass spectrum.
    • \n
    • filter_kendrick(mass_spectrum).\nFilter the mass spectrum data using the Kendrick algorithm.
    • \n
    • filter_kendrick_by_index(ms_peak_indexes, mass_spectrum_obj).\nFilter the mass spectrum data using the Kendrick algorithm based on a list of peak indexes.
    • \n
    • remove_assignment_by_mass_error(mass_spectrum).\nRemove assignments from the mass spectrum based on mass error.
    • \n
    \n"}, {"fullname": "corems.molecular_id.calc.ClusterFilter.ClusteringFilter.get_mass_error_matrix_data", "modulename": "corems.molecular_id.calc.ClusterFilter", "qualname": "ClusteringFilter.get_mass_error_matrix_data", "kind": "function", "doc": "

    Get the mass error matrix data from a list of mass peaks.

    \n\n
    Parameters
    \n\n
      \n
    • ms_peaks (list):\nList of mass peaks.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • matrix_data (ndarray):\nMatrix data containing mass and error values.
    • \n
    • list_indexes_mass_spec (list):\nList of indexes of mass peaks in the original mass spectrum.
    • \n
    \n", "signature": "(self, ms_peaks):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.ClusterFilter.ClusteringFilter.get_kendrick_matrix_data", "modulename": "corems.molecular_id.calc.ClusterFilter", "qualname": "ClusteringFilter.get_kendrick_matrix_data", "kind": "function", "doc": "

    Get the Kendrick matrix data from a mass spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (MassSpectrum):\nMass spectrum object.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • matrix_data (ndarray):\nMatrix data containing Kendrick mass and Kendrick mass defect values.
    • \n
    \n", "signature": "(self, mass_spectrum):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.ClusterFilter.ClusteringFilter.filter_kendrick", "modulename": "corems.molecular_id.calc.ClusterFilter", "qualname": "ClusteringFilter.filter_kendrick", "kind": "function", "doc": "

    Filter the mass spectrum data using the Kendrick algorithm.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (MassSpectrum):\nMass spectrum object.
    • \n
    \n", "signature": "(self, mass_spectrum):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.ClusterFilter.ClusteringFilter.filter_kendrick_by_index", "modulename": "corems.molecular_id.calc.ClusterFilter", "qualname": "ClusteringFilter.filter_kendrick_by_index", "kind": "function", "doc": "

    Filter the mass spectrum data using the Kendrick algorithm based on a list of peak indexes.

    \n\n
    Parameters
    \n\n
      \n
    • ms_peak_indexes (list):\nList of peak indexes.
    • \n
    • mass_spectrum_obj (MassSpectrum):\nMass spectrum object.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • noise_idx (list):\nList of indexes of noise points in the mass spectrum.
    • \n
    \n", "signature": "(self, ms_peak_indexes, mass_spectrum_obj):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.ClusterFilter.ClusteringFilter.remove_assignment_by_mass_error", "modulename": "corems.molecular_id.calc.ClusterFilter", "qualname": "ClusteringFilter.remove_assignment_by_mass_error", "kind": "function", "doc": "

    Remove assignments from the mass spectrum based on mass error.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (MassSpectrum):\nMass spectrum object.
    • \n
    \n", "signature": "(self, mass_spectrum):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.KendrickGroup", "modulename": "corems.molecular_id.calc.KendrickGroup", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.MolecularFilter", "modulename": "corems.molecular_id.calc.MolecularFilter", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.MolecularFilter.MolecularFormulaSearchFilters", "modulename": "corems.molecular_id.calc.MolecularFilter", "qualname": "MolecularFormulaSearchFilters", "kind": "class", "doc": "

    Class containing static methods for filtering molecular formulas in a mass spectrum.

    \n\n
    Methods
    \n\n
      \n
    • filter_kendrick(ms_peak_indexes, mass_spectrum_obj).
      \nApply Kendrick filter to the mass spectrum.
    • \n
    • check_min_peaks(ms_peak_indexes, mass_spectrum_obj).
      \nCheck if the number of peaks per class meets the minimum requirement.
    • \n
    • filter_isotopologue(ms_peak_indexes, mass_spectrum_obj).
      \nApply isotopologue filter to the mass spectrum.
    • \n
    \n"}, {"fullname": "corems.molecular_id.calc.MolecularFilter.MolecularFormulaSearchFilters.filter_kendrick", "modulename": "corems.molecular_id.calc.MolecularFilter", "qualname": "MolecularFormulaSearchFilters.filter_kendrick", "kind": "function", "doc": "

    Apply Kendrick filter to the mass spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • ms_peak_indexes (list):\nList of peak indexes and their associated molecular formula objects.
    • \n
    • mass_spectrum_obj (MassSpectrum):\nThe mass spectrum object.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • filtered_ms_peak_indexes (list):\nList of peak indexes and their associated molecular formula objects after applying the Kendrick filter.
    • \n
    \n", "signature": "(ms_peak_indexes, mass_spectrum_obj):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.MolecularFilter.MolecularFormulaSearchFilters.check_min_peaks", "modulename": "corems.molecular_id.calc.MolecularFilter", "qualname": "MolecularFormulaSearchFilters.check_min_peaks", "kind": "function", "doc": "

    Check if the number of peaks per class meets the minimum requirement.

    \n\n
    Parameters
    \n\n
      \n
    • ms_peak_indexes (list):\nList of peak indexes and their associated molecular formula objects.
    • \n
    • mass_spectrum_obj (MassSpectrum):\nThe mass spectrum object.
    • \n
    \n", "signature": "(ms_peak_indexes, mass_spectrum):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.MolecularFilter.MolecularFormulaSearchFilters.filter_isotopologue", "modulename": "corems.molecular_id.calc.MolecularFilter", "qualname": "MolecularFormulaSearchFilters.filter_isotopologue", "kind": "function", "doc": "

    Apply isotopologue filter to the mass spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • ms_peak_indexes (list):\nList of peak indexes and their associated molecular formula objects.
    • \n
    • mass_spectrum_obj (MassSpectrum):\nThe mass spectrum object.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • filtered_ms_peak_indexes (list):\nList of peak indexes and their associated molecular formula objects after applying the isotopologue filter.
    • \n
    \n", "signature": "(ms_peak_indexes, mass_spectrum):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.methods_name", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "methods_name", "kind": "variable", "doc": "

    \n", "default_value": "{'chebyshev_distance': 'Chebyshev Distance', 'squared_euclidean_distance': 'Squared Euclidean Distance', 'fidelity_similarity': 'Fidelity Similarity', 'matusita_distance': 'Matusita Distance', 'squared_chord_distance': 'Squared-chord Distance', 'harmonic_mean_similarity': 'Harmonic mean Distance', 'Pearson_chi_squared_distance': 'Pearson Chi Squared Distance', 'Neyman_chi_squared_distance': 'Neyman Chi Squared Distance', 'probabilistic_symmetric_chi_squared_distance': 'Probabilistic symmetric X2 Distance', 'topsoe_distance': 'Topsoe Distance', 'chernoff_distance': 'Chernoff Distance', 'ruzicka_distance': 'Ruzicka Distance', 'roberts_distance': 'Roberts Distance', 'motyka_distance': 'Motyka Distance', 'canberra_distance': 'Canberra Distance', 'canberra_metric': 'Canberra Metric', 'kulczynski_1_distance': 'Kulczynski 1 Distance', 'lorentzian_distance': 'Lorentzian Distance', 'clark_distance': 'Clark Distance', 'hellinger_distance': 'Hellinger Distance', 'whittaker_index_of_association_distance': 'Whittaker index of association Distance', 'spectral_contrast_angle_distance': 'Spectral Contrast Angle', 'wave_hedges_distance': 'Wave Hedges Distance', 'dice_similarity': 'Dice Similarity', 'inner_product_distance': 'Inner Product Distance', 'divergence_distance': 'Divergence Distance', 'jensen_difference_distance': 'Jensen Differences Distance', 'kumar_johnson_distance': 'Kumar Johnson Distance', 'avg_l_distance': 'Avg (L1, L8) Distance', 'vicis_wave_hadges_distance': 'Vicis Wave Hadges Distance', 'vicis_symmetric_chi_squared_1_distance': 'Vicis-Symmetric X2 1 Distance', 'vicis_symmetric_chi_squared_2_distance': 'Vicis-Symmetric X2 2 Distance', 'vicis_symmetric_chi_squared_3_distance': 'Vicis-Symmetric X2 3 Distance', 'max_symmetric_chi_squared_distance': 'Max Symmetric Chi Squared Distance', 'min_symmetric_chi_squared_distance': 'Min Symmetric Chi Squared Distance', 'additive_sym_chi_sq': 'Additive Symmetric Chi Squared', 'bhattacharya_distance': 'Battacharya Distance', 'generalized_ochiai_index': 'Generalized Ochiai Index', 'gower_distance': 'Gower Distance', 'impr_sqrt_cosine_sim': 'Improved Square Root Cosine Similarity', 'intersection_sim': 'Intersection Similarity', 'j_divergence': 'J Divergence', 'jensen_shannon_index': 'Jensen Shannon Index', 'k_divergence': 'K Divergence', 'VW6': 'VW6', 'VW5': 'VW5', 'VW4': 'VW4', 'VW3': 'VW3', 'VW2': 'VW2', 'VW1': 'VW1', 'taneja_divergence': 'Taneja Divergence', 'symmetric_chi_squared_distance': 'Symmetric Chi Squared Distance', 'squared_chi_squared_distance': 'Squared Chi Squared Distance', 'square_root_cosine_correlation': 'Square Root Cosine Correlation', 'sorensen_distance': 'Sorensen Distance', 'Minokowski_3': 'Minokowski 3 Distance', 'Minokowski_4': 'Minokowski 4 Distance', 'kumarjohnson_divergence': 'Kumar Johnson Divergence', 'kumarhassebrook_similarity': 'Kumar Hassebrook Similarity', 'kullbackleibler_divergence': 'Kullback Leibler Divergence', 'soergel_distance': 'Soergel Distance'}"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.methods_scale", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "methods_scale", "kind": "variable", "doc": "

    \n", "default_value": "{'entropy': [0, 1.3862943611198906], 'weighted_entropy': [0, 1.3862943611198906], 'absolute_value': [0, 2], 'avg_l': [0, 1.5], 'bhattacharya_1': [0, 2.4674011002723395], 'bhattacharya_2': [0, inf], 'canberra': [0, inf], 'clark': [0, inf], 'divergence': [0, inf], 'euclidean': [0, 1.4142135623730951], 'hellinger': [0, inf], 'improved_similarity': [0, inf], 'lorentzian': [0, inf], 'manhattan': [0, 2], 'matusita': [0, 1.4142135623730951], 'mean_character': [0, 2], 'motyka': [-0.5, 0], 'ms_for_id': [-inf, 0], 'ms_for_id_v1': [0, inf], 'pearson_correlation': [-1, 1], 'penrose_shape': [0, 1.4142135623730951], 'penrose_size': [0, inf], 'probabilistic_symmetric_chi_squared': [0, 1], 'similarity_index': [0, inf], 'squared_chord': [0, 2], 'squared_euclidean': [0, 2], 'symmetric_chi_squared': [0, 0.7071067811865476], 'topsoe': [0, 1.4142135623730951], 'vicis_symmetric_chi_squared_3': [0, 2], 'wave_hedges': [0, inf], 'whittaker_index_of_association': [0, inf]}"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity", "kind": "class", "doc": "

    Class containing methods for calculating spectral similarity between two mass spectra.

    \n\n
    Parameters
    \n\n
      \n
    • ms_mz_abun_dict (dict):\nDictionary of mass to abundance values for the experimental mass spectrum.
    • \n
    • ref_obj (dict):\nDictionary of mass to abundance values for the reference mass spectrum.
    • \n
    • norm_func (function):\nFunction to normalize the abundance values.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • normalize_func (function):\nFunction to normalize the abundance values.
    • \n
    • ms_mz_abun_dict (dict):\nDictionary of mass to abundance values for the experimental mass spectrum.
    • \n
    • ref_obj (dict):\nDictionary of mass to abundance values for the reference mass spectrum.
    • \n
    • exp_abun (list):\nList of abundance values for the experimental mass spectrum.
    • \n
    • exp_mz (list):\nList of mass values for the experimental mass spectrum.
    • \n
    • ref_mz (list):\nList of mass values for the reference mass spectrum.
    • \n
    • ref_abun (list):\nList of abundance values for the reference mass spectrum.
    • \n
    • ref_mz_abun_dict (dict):\nDictionary of mass to abundance values for the reference mass spectrum.
    • \n
    • df (DataFrame):\nDataFrame containing the experimental and reference mass spectrum data.
    • \n
    • zero_filled_u_l (tuple):\nTuple containing the experimental and reference mass spectrum data after zero filling and normalization.
    • \n
    • common_mz_values (list):\nList of common mass values between the experimental and reference mass spectra.
    • \n
    • n_x_y (int):\nNumber of common mass values between the experimental and reference mass spectra.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • nan_fill(df, fill_with=0).\nFill missing mass values with a given value.
    • \n
    • normalize(x, y, norm_func=sum).\nNormalize the abundance values.
    • \n
    • weighted_cosine_correlation(a=0.5, b=1.3, nanfill=1e-10).\nCalculate the weighted cosine correlation between the experimental and reference mass spectra.
    • \n
    • cosine_correlation().\nCalculate the cosine correlation between the experimental and reference mass spectra.
    • \n
    • stein_scott().\nCalculate the Stein-Scott similarity between the experimental and reference mass spectra.
    • \n
    • pearson_correlation().\nCalculate the Pearson correlation between the experimental and reference mass spectra.
    • \n
    • spearman_correlation().\nCalculate the Spearman correlation between the experimental and reference mass spectra.
    • \n
    \n"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.__init__", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.__init__", "kind": "function", "doc": "

    \n", "signature": "(ms_mz_abun_dict, ref_obj, norm_func=<built-in function sum>)"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.normalize_func", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.normalize_func", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.ms_mz_abun_dict", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.ms_mz_abun_dict", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.ref_obj", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.ref_obj", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.exp_abun", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.exp_abun", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.exp_mz", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.exp_mz", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.ref_mz", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.ref_mz", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.ref_abun", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.ref_abun", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.ref_mz_abun_dict", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.ref_mz_abun_dict", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.df", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.df", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.zero_filled_u_l", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.zero_filled_u_l", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.common_mz_values", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.common_mz_values", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.n_x_y", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.n_x_y", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.nan_fill", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.nan_fill", "kind": "function", "doc": "

    Fill missing mass values with a given value.

    \n\n
    Parameters
    \n\n
      \n
    • df (DataFrame):\nDataFrame containing the experimental and reference mass spectrum data.
    • \n
    • fill_with (float):\nValue to fill missing mass values with.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • x (list):\nList of abundance values for the experimental mass spectrum.
    • \n
    • y (list):\nList of abundance values for the reference mass spectrum.
    • \n
    \n", "signature": "(self, df, fill_with=0):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.normalize", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.normalize", "kind": "function", "doc": "

    Normalize the abundance values.

    \n\n
    Parameters
    \n\n
      \n
    • x (list):\nList of abundance values for the experimental mass spectrum.
    • \n
    • y (list):\nList of abundance values for the reference mass spectrum.
    • \n
    • norm_func (function):\nFunction to normalize the abundance values.\nDefault is sum
    • \n
    \n\n
    Returns
    \n\n
      \n
    • u_l (tuple):\nTuple containing the experimental and reference mass spectrum data after zero filling and normalization.
    • \n
    \n", "signature": "(self, x, y, norm_func=<built-in function sum>):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.weighted_cosine_correlation", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.weighted_cosine_correlation", "kind": "function", "doc": "

    Calculate the weighted cosine correlation between the experimental and reference mass spectra.

    \n\n
    Parameters
    \n\n
      \n
    • a (float):\nWeighting factor for the abundance values.\nDefault is 0.5
    • \n
    • b (float):\nWeighting factor for the mass values.\nDefault is 1.3
    • \n
    • nanfill (float):\nValue to fill missing mass values with.\nDefault is 1e-10
    • \n
    \n\n
    Returns
    \n\n
      \n
    • correlation (float):\nWeighted cosine correlation between the experimental and reference mass spectra.
    • \n
    \n", "signature": "(self, a=0.5, b=1.3, nanfill=1e-10):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.cosine_correlation", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.cosine_correlation", "kind": "function", "doc": "

    Calculate the cosine correlation between the experimental and reference mass spectra.

    \n\n
    Returns
    \n\n
      \n
    • correlation (float):\nCosine correlation between the experimental and reference mass spectra.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.stein_scott", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.stein_scott", "kind": "function", "doc": "

    Calculate the Stein-Scott similarity between the experimental and reference mass spectra.

    \n\n
    Returns
    \n\n
      \n
    • s_ss_x_y (float):\nStein-Scott similarity between the experimental and reference mass spectra.
    • \n
    • s_ss_x_y_nist (float):\nStein-Scott similarity between the experimental and reference mass spectra.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.pearson_correlation", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.pearson_correlation", "kind": "function", "doc": "

    Calculate the Pearson correlation between the experimental and reference mass spectra.

    \n\n
    Returns
    \n\n
      \n
    • correlation (float):\nPearson correlation between the experimental and reference mass spectra.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.spearman_correlation", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.spearman_correlation", "kind": "function", "doc": "

    Calculate the Spearman correlation between the experimental and reference mass spectra.

    \n\n
    Returns
    \n\n
      \n
    • coorelation (float):\nSpearman correlation between the experimental and reference mass spectra.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.kendall_tau", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.kendall_tau", "kind": "function", "doc": "

    Calculate the Kendall's tau correlation between the experimental and reference mass spectra.

    \n\n
    Returns
    \n\n
      \n
    • correlation (float):\nKendall's tau correlation between the experimental and reference mass spectra.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.dft_correlation", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.dft_correlation", "kind": "function", "doc": "

    Calculate the DFT correlation between the experimental and reference mass spectra.

    \n\n
    Returns
    \n\n
      \n
    • correlation (float):\nDFT correlation between the experimental and reference mass spectra.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.dwt_correlation", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.dwt_correlation", "kind": "function", "doc": "

    Calculate the DWT correlation between the experimental and reference mass spectra.

    \n\n
    Returns
    \n\n
      \n
    • correlation (float):\nDWT correlation between the experimental and reference mass spectra.
    • \n
    \n\n
    Notes
    \n\n

    This function requires the PyWavelets library to be installed. \n This is not a default requirement as this function is not widely used.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.euclidean_distance", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.euclidean_distance", "kind": "function", "doc": "

    Calculate the Euclidean distance between the experimental and reference mass spectra.

    \n\n
    Returns
    \n\n
      \n
    • correlation (float):\nEuclidean distance between the experimental and reference mass spectra.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.manhattan_distance", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.manhattan_distance", "kind": "function", "doc": "

    Calculate the Manhattan distance between the experimental and reference mass spectra.

    \n\n
    Returns
    \n\n
      \n
    • correlation (float):\nManhattan distance between the experimental and reference mass spectra.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.jaccard_distance", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.jaccard_distance", "kind": "function", "doc": "

    Calculate the Jaccard distance between the experimental and reference mass spectra.

    \n\n
    Returns
    \n\n
      \n
    • correlation (float):\nJaccard distance between the experimental and reference mass spectra.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.extra_distances", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.extra_distances", "kind": "function", "doc": "

    Function to calculate distances using additional metrics defined in math_distance.py

    \n\n

    Currently, calculates all distances.

    \n\n
    Returns
    \n\n
      \n
    • dict_res (dict):\nDictionary containing the distances between the experimental and reference mass spectra.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance", "modulename": "corems.molecular_id.calc.math_distance", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.math_distance.entropy_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "entropy_distance", "kind": "function", "doc": "

    Calculate entropy distance between two vectors

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Entropy distance between v and y
    • \n
    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.weighted_entropy_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "weighted_entropy_distance", "kind": "function", "doc": "

    Calculate weighted entropy distance between two vectors

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Weighted entropy distance between v and y
    • \n
    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.chebyshev_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "chebyshev_distance", "kind": "function", "doc": "

    Chebyshev distance

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Chebyshev distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\underset{i}{\\max}{(|v_{i}\\ -\\ y_{i}|)}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.squared_euclidean_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "squared_euclidean_distance", "kind": "function", "doc": "

    Squared Euclidean distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Squared Euclidean distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sum(v_{i}-y_{i})^2$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.fidelity_similarity", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "fidelity_similarity", "kind": "function", "doc": "

    Fidelity similarity:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Fidelity similarity between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sum\\sqrt{v_{i}y_{i}}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.matusita_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "matusita_distance", "kind": "function", "doc": "

    Matusita distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Matusita distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sqrt{\\sum(\\sqrt{v_{i}}-\\sqrt{y_{i}})^2}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.squared_chord_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "squared_chord_distance", "kind": "function", "doc": "

    Squared-chord distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Squared-chord distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sum(\\sqrt{v_{i}}-\\sqrt{y_{i}})^2$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.bhattacharya_1_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "bhattacharya_1_distance", "kind": "function", "doc": "

    Bhattacharya 1 distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Bhattacharya 1 distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$(\\arccos{(\\sum\\sqrt{v_{i}y_{i}})})^2$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.bhattacharya_2_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "bhattacharya_2_distance", "kind": "function", "doc": "

    Bhattacharya 2 distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Bhattacharya 2 distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$-\\ln{(\\sum\\sqrt{v_{i}y_{i}})}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.harmonic_mean_similarity", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "harmonic_mean_similarity", "kind": "function", "doc": "

    Harmonic mean similarity:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Harmonic mean similarity between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$#1-2\\sum(\\frac{v_{i}y_{i}}{v_{i}+y_{i}})\n2\\sum(\\frac{v_{i}y_{i}}{v_{i}+y_{i}})$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.chernoff_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "chernoff_distance", "kind": "function", "doc": "

    Chernoff distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Chernoff distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\max{(-ln\\sum(v_{i}^ty_{i}^{1-t})^{1-t})},\\ t=0.1,\\ 0\\le\\ t<1$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.ruzicka_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "ruzicka_distance", "kind": "function", "doc": "

    Ruzicka distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Ruzicka distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\frac{\\sum{|v_{i}-y_{i}|}}{\\sum{\\max(v_{i},y_{i})}}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.roberts_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "roberts_distance", "kind": "function", "doc": "

    Roberts distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Roberts distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$1-\\sum\\frac{(v_{i}+y_{i})\\frac{\\min{(v_{i},y_{i})}}{\\max{(v_{i},y_{i})}}}{\\sum(v_{i}+y_{i})}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.intersection_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "intersection_distance", "kind": "function", "doc": "

    Intersection distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Intersection distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$1-\\frac{\\sum\\min{(v_{i},y_{i})}}{\\min(\\sum{v_{i},\\sum{y_{i})}}}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.motyka_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "motyka_distance", "kind": "function", "doc": "

    Motyka distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Motyka distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$-\\frac{\\sum\\min{(y_{i},v_{i})}}{\\sum(y_{i}+v_{i})}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.canberra_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "canberra_distance", "kind": "function", "doc": "

    Canberra distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Canberra distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$#\\sum\\frac{|v_{i}-y_{i}|}{|v_{i}|+|y_{i}|}\n\\sum_{i}\\frac{|y_{i} - v_{i}|}{y_{i} + v_{i}}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.canberra_metric", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "canberra_metric", "kind": "function", "doc": "

    Canberra Metric

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Canberra metric between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\frac{1}{\\sum_{i}I(v_{i}\\neq 0)}\\sum_{i}\\frac{|y_{i}-v_{i}|}{(y_{i}+v_{i})}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.kulczynski_1_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "kulczynski_1_distance", "kind": "function", "doc": "

    Kulczynski 1 distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Kulczynski 1 distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\frac{\\sum{|v_i}-y_i|}{\\sum m\\ i\\ n\\ (v_i,y_i)}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.baroni_urbani_buser_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "baroni_urbani_buser_distance", "kind": "function", "doc": "

    Baroni-Urbani-Buser distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Baroni-Urbani-Buser distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$1-\\frac{\\sum\\min{(v_i,y_i)}+\\sqrt{\\sum\\min{(v_i,y_i)}\\sum(\\max{(v)}-\\max{(v_i,y_i)})}}{\\sum{\\max{(v_i,y_i)}+\\sqrt{\\sum{\\min{(v_i,y_i)}\\sum(\\max{(v)}-\\max{(v_i,y_i)})}}}}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.penrose_size_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "penrose_size_distance", "kind": "function", "doc": "

    Penrose size distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Penrose size distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sqrt N\\sum{|y_i-v_i|}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.mean_character_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "mean_character_distance", "kind": "function", "doc": "

    Mean character distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Mean character distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\frac{1}{N}\\sum{|y_i-v_i|}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.lorentzian_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "lorentzian_distance", "kind": "function", "doc": "

    Lorentzian distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Lorentzian distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sum{\\ln(1+|v_i-y_i|)}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.penrose_shape_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "penrose_shape_distance", "kind": "function", "doc": "

    Penrose shape distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Penrose shape distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sqrt{\\sum((v_i-\\bar{v})-(y_i-\\bar{y}))^2}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.clark_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "clark_distance", "kind": "function", "doc": "

    Clark distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Clark distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$#(\\frac{1}{N}\\sum(\\frac{v_i-y_i}{|v_i|+|y_i|})^2)^\\frac{1}{2}\n\\sqrt{\\sum(\\frac{|v_i-y_i|}{v_i+y_i})^2}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.hellinger_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "hellinger_distance", "kind": "function", "doc": "

    Hellinger distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Hellinger distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$#\\sqrt{2\\sum(\\sqrt{\\frac{v_i}{\\bar{v}}}-\\sqrt{\\frac{y_i}{\\bar{y}}})^2}\n\\sqrt{2\\sum(\\sqrt{v_i}-\\sqrt{y_i})^2}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.whittaker_index_of_association_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "whittaker_index_of_association_distance", "kind": "function", "doc": "

    Whittaker index of association distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Whittaker index of association distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\frac{1}{2}\\sum|\\frac{v_i}{\\bar{v}}-\\frac{y_i}{\\bar{y}}|$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.similarity_index_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "similarity_index_distance", "kind": "function", "doc": "

    Similarity Index Distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Similarity Index Distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sqrt{\\frac{\\sum{\\frac{v_i-y_i}{y_i}}^2}{N}}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.improved_similarity_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "improved_similarity_distance", "kind": "function", "doc": "

    Improved Similarity Index:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Improved Similarity Index between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sqrt{\\frac{1}{N}\\sum{\\frac{y_i-v_i}{y_i+v_i}}^2}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.absolute_value_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "absolute_value_distance", "kind": "function", "doc": "

    Absolute Value Distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Absolute Value Distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\frac { \\sum(|y_i-v_i|)}{\\sum v_i}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.spectral_contrast_angle_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "spectral_contrast_angle_distance", "kind": "function", "doc": "

    Spectral Contrast Angle:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Spectral Contrast Angle between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$1 - \\frac{\\sum{y_iv_i}}{\\sqrt{\\sum y_i^2\\sum v_i^2}}\n\\arccos(\\frac{\\sum_{P}y_{p}^* v_{p}^}{\\sqrt{\\sum_{P}y_{p}^{2} \\sum_{P}v_{p}^{*2}}})$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.wave_hedges_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "wave_hedges_distance", "kind": "function", "doc": "

    Wave Hedges distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Wave Hedges distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sum\\frac{|v_i-y_i|}{\\max{(v_i,y_i)}}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.dice_similarity", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "dice_similarity", "kind": "function", "doc": "

    Dice similarity:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Dice similarity between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\frac{\\sum(v_i-y_i)^2}{\\sum v_i^2+\\sum y_i^2}\n\\frac{2 * \\sum_{i}v_{i}y_{i}}{\\sum_{i}y_{i}^2 + \\sum_{i}v_{i}^2}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.inner_product_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "inner_product_distance", "kind": "function", "doc": "

    Inner Product distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Inner product distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$1-\\sum{v_iy_i}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.divergence_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "divergence_distance", "kind": "function", "doc": "

    Divergence distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Divergence distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$2\\sum\\frac{(v_i-y_i)^2}{(v_i+y_i)^2}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.jensen_difference_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "jensen_difference_distance", "kind": "function", "doc": "

    Jensen difference:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Jensen difference distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sum[\\frac{1}{2}(v_i\\ln{v_i}+y_i\\ln{y_i})-(\\frac{v_i+y_i}{2})\\ln{(\\frac{v_i+y_i}{2})}]$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.kumar_johnson_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "kumar_johnson_distance", "kind": "function", "doc": "

    Kumar-Johnson distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Kumar Johnson distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sum\\frac{(v_i^2-y_i^2)^2}{2(v_iy_i)^\\frac{3}{2}}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.avg_l_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "avg_l_distance", "kind": "function", "doc": "

    Avg (L1, L\u221e) distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Average L distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\frac{1}{2}(\\sum|v_i-y_i|+\\underset{i}{\\max}{|v_i-y_i|})$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.vicis_wave_hadges_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "vicis_wave_hadges_distance", "kind": "function", "doc": "

    Vicis-Wave Hadges distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Vicis Wave Hadges distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sum\\frac{|v_i-y_i|}{\\min{(v_i,\\ y_i)}}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.vicis_symmetric_chi_squared_1_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "vicis_symmetric_chi_squared_1_distance", "kind": "function", "doc": "

    Vicis-Symmetric \u03c72 1 distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Vici Symmetric \u03c72 1 distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sum\\frac{(v_i-y_i)^2}{\\min{(v_i,y_i)^2}}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.vicis_symmetric_chi_squared_2_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "vicis_symmetric_chi_squared_2_distance", "kind": "function", "doc": "

    Vicis-Symmetric \u03c72 2 distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Vicis Symmetric \u03c72 2 distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sum\\frac{(v_i-y_i)^2}{\\min{(v_i,y_i)}}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.vicis_symmetric_chi_squared_3_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "vicis_symmetric_chi_squared_3_distance", "kind": "function", "doc": "

    Vicis-Symmetric \u03c72 3 distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Vici Symmetric \u03c72 3 distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sum\\frac{(v_i-y_i)^2}{\\max{(v_i,y_i)}}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.max_symmetric_chi_squared_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "max_symmetric_chi_squared_distance", "kind": "function", "doc": "

    Max-Symmetric \u03c72 distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Max-Symmetric \u03c72 distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\max{(\\sum\\frac{(v_i-y_i)^2}{v_i},\\sum\\frac{(v_i-y_i)^2}{y_i})}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.min_symmetric_chi_squared_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "min_symmetric_chi_squared_distance", "kind": "function", "doc": "

    Min-Symmetric \u03c72 distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Min-Symmetric \u03c72 distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\min{(\\sum\\frac{(v_i-y_i)^2}{v_i},\\sum\\frac{(v_i-y_i)^2}{y_i})}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.additive_sym_chi_sq", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "additive_sym_chi_sq", "kind": "function", "doc": "

    Additive Symmetric \u03c72 distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Additive Symmetric \u03c72 distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sum_{i}\\frac{(y_{i} - v_{i})^2(y_{i}+v_{i})}{y_{i}v_{i}}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.bhattacharya_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "bhattacharya_distance", "kind": "function", "doc": "

    Bhattacharya Distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Bhattcharya distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$-ln(\\sum_{i}\\sqrt{y_{i}v_{i}})$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.generalized_ochiai_index", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "generalized_ochiai_index", "kind": "function", "doc": "

    Generalized Ochiai Index

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Generalized Ochiai Index between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$1 - \\frac{\\sum_{i}min(y_{i}, v_{i})}{\\sqrt{\\sum_{i}y_{i} \\sum_{i}v_{i}}}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.gower_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "gower_distance", "kind": "function", "doc": "

    Gower Distance

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Gower distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\frac{1}{N}\\sum_{i}|y_{i} - v_{i}|$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.impr_sqrt_cosine_sim", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "impr_sqrt_cosine_sim", "kind": "function", "doc": "

    Improved Square Root Cosine Similarity

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Improved Square Root Cosine Similarity between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\frac{\\sum_{i}\\sqrt{y_{i}v_{i}}}{\\sum_{i}\\sqrt{y_{i}}\\sum_{i}\\sqrt{v_{i}}}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.intersection_sim", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "intersection_sim", "kind": "function", "doc": "

    Intersection Similarity

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Intersection Similarity between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sum_{i}min(y_{i}, v_{i})$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.j_divergence", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "j_divergence", "kind": "function", "doc": "

    J Divergence

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: J Divergence between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sum_{i}(y_{i} - v_{i}) ln(\\frac{y_{i}}{v_{i}})$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.jensen_shannon_index", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "jensen_shannon_index", "kind": "function", "doc": "

    Jensen-Shannon Index

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Jensen Shannon Index between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\frac{1}{2}[\\sum_{i}y_{i}ln(\\frac{2y_{i}}{y_{i} + v_{i}}) + \\sum_{i}v_{i}ln(\\frac{2v_{i}}{y_{i}+v_{i}})]$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.k_divergence", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "k_divergence", "kind": "function", "doc": "

    K-Divergence

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: K-Divergence between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sum_{i}y_{i}ln(\\frac{2y_{i}}{y_{i} + v_{i}})$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.topsoe_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "topsoe_distance", "kind": "function", "doc": "

    Topsoe distance

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Topsoe distance between v and y
    • \n
    • Notes
    • \n
    • -----
    • \n
    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.probabilistic_symmetric_chi_squared_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "probabilistic_symmetric_chi_squared_distance", "kind": "function", "doc": "

    Fixed\n\"I commented out the previous one; please review\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.VW6", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "VW6", "kind": "function", "doc": "

    \"appears to be the same as max_symmetric_chi_squared_distance\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.VW5", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "VW5", "kind": "function", "doc": "

    \"appears to be the same as max_symmetric_chi_squared_distance\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.VW4", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "VW4", "kind": "function", "doc": "

    \"Tecnically the Symmetric chi2 eq63\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.VW3", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "VW3", "kind": "function", "doc": "

    \"New\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.VW2", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "VW2", "kind": "function", "doc": "

    \"New\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.VW1", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "VW1", "kind": "function", "doc": "

    \"New\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.taneja_divergence", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "taneja_divergence", "kind": "function", "doc": "

    \"New\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.symmetric_chi_squared_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "symmetric_chi_squared_distance", "kind": "function", "doc": "

    \"New\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.squared_chi_squared_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "squared_chi_squared_distance", "kind": "function", "doc": "

    \"New\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.square_root_cosine_correlation", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "square_root_cosine_correlation", "kind": "function", "doc": "

    \"New\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.sorensen_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "sorensen_distance", "kind": "function", "doc": "

    \"New\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.Pearson_chi_squared_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "Pearson_chi_squared_distance", "kind": "function", "doc": "

    \"New\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.Neyman_chi_squared_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "Neyman_chi_squared_distance", "kind": "function", "doc": "

    \"New\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.Minokowski_3", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "Minokowski_3", "kind": "function", "doc": "

    \"New\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.Minokowski_4", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "Minokowski_4", "kind": "function", "doc": "

    \"New\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.kumarjohnson_divergence", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "kumarjohnson_divergence", "kind": "function", "doc": "

    \"New\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.kumarhassebrook_similarity", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "kumarhassebrook_similarity", "kind": "function", "doc": "

    \"New\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.kullbackleibler_divergence", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "kullbackleibler_divergence", "kind": "function", "doc": "

    \"New\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.soergel_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "soergel_distance", "kind": "function", "doc": "

    \"New\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory", "modulename": "corems.molecular_id.factory", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL", "modulename": "corems.molecular_id.factory.EI_SQL", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Base", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Base", "kind": "class", "doc": "

    The base class of the class hierarchy.

    \n\n

    When called, it accepts no arguments and returns a new featureless\ninstance that has no instance attributes and cannot be given any.

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Base.__init__", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Base.__init__", "kind": "function", "doc": "

    A simple constructor that allows initialization from kwargs.

    \n\n

    Sets attributes on the constructed instance using the names and\nvalues in kwargs.

    \n\n

    Only keys that are present as\nattributes of the instance's class are allowed. These could be,\nfor example, any mapped columns or relationships.

    \n", "signature": "(**kwargs)"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Base.registry", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Base.registry", "kind": "variable", "doc": "

    \n", "default_value": "<sqlalchemy.orm.decl_api.registry object>"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Base.metadata", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Base.metadata", "kind": "variable", "doc": "

    \n", "default_value": "MetaData()"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Metadatar", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Metadatar", "kind": "class", "doc": "

    This class is used to store the metadata of the compounds in the database

    \n\n
    Attributes
    \n\n
      \n
    • id (int):\nThe id of the compound.
    • \n
    • cas (str):\nThe CAS number of the compound.
    • \n
    • inchikey (str):\nThe InChiKey of the compound.
    • \n
    • inchi (str):\nThe InChi of the compound.
    • \n
    • chebi (str):\nThe ChEBI ID of the compound.
    • \n
    • smiles (str):\nThe SMILES of the compound.
    • \n
    • kegg (str):\nThe KEGG ID of the compound.
    • \n
    • iupac_name (str):\nThe IUPAC name of the compound.
    • \n
    • traditional_name (str):\nThe traditional name of the compound.
    • \n
    • common_name (str):\nThe common name of the compound.
    • \n
    • data_id (int):\nThe id of the compound in the molecularData table.
    • \n
    • data (LowResolutionEICompound):\nThe compound object.
    • \n
    \n", "bases": "sqlalchemy.orm.decl_api.Base"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Metadatar.__init__", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Metadatar.__init__", "kind": "function", "doc": "

    A simple constructor that allows initialization from kwargs.

    \n\n

    Sets attributes on the constructed instance using the names and\nvalues in kwargs.

    \n\n

    Only keys that are present as\nattributes of the instance's class are allowed. These could be,\nfor example, any mapped columns or relationships.

    \n", "signature": "(**kwargs)"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Metadatar.id", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Metadatar.id", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Metadatar.cas", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Metadatar.cas", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Metadatar.inchikey", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Metadatar.inchikey", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Metadatar.inchi", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Metadatar.inchi", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Metadatar.chebi", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Metadatar.chebi", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Metadatar.smiles", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Metadatar.smiles", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Metadatar.kegg", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Metadatar.kegg", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Metadatar.iupac_name", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Metadatar.iupac_name", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Metadatar.traditional_name", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Metadatar.traditional_name", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Metadatar.common_name", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Metadatar.common_name", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Metadatar.data_id", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Metadatar.data_id", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Metadatar.data", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Metadatar.data", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound", "kind": "class", "doc": "

    This class is used to store the molecular and spectral data of the compounds in the low res EI database

    \n\n
    Attributes
    \n\n
      \n
    • id (int):\nThe id of the compound.
    • \n
    • name (str):\nThe name of the compound.
    • \n
    • classify (str):\nThe classification of the compound.
    • \n
    • formula (str):\nThe formula of the compound.
    • \n
    • ri (float):\nThe retention index of the compound.
    • \n
    • retention_time (float):\nThe retention time of the compound.
    • \n
    • source (str):\nThe source of the compound.
    • \n
    • casno (str):\nThe CAS number of the compound.
    • \n
    • comment (str):\nThe comment of the compound.
    • \n
    • source_temp_c (float):\nThe source temperature of the spectra.
    • \n
    • ev (float):\nThe electron volts of the spectra.
    • \n
    • peaks_count (int):\nThe number of peaks in the spectra.
    • \n
    • mz (numpy.ndarray):\nThe m/z values of the spectra.
    • \n
    • abundance (numpy.ndarray):\nThe abundance values of the spectra.
    • \n
    • metadatar (Metadatar):\nThe metadata object.
    • \n
    \n", "bases": "sqlalchemy.orm.decl_api.Base"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.__init__", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.__init__", "kind": "function", "doc": "

    \n", "signature": "(dict_data)"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.id", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.id", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.name", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.name", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.classify", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.classify", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.formula", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.formula", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.ri", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.ri", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.retention_time", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.retention_time", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.derivativenum", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.derivativenum", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.derivatization", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.derivatization", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.source", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.source", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.casno", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.casno", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.comment", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.comment", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.source_temp_c", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.source_temp_c", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.ev", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.ev", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.peaks_count", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.peaks_count", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.mz", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.mz", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.abundance", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.abundance", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.metadatar", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.metadatar", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.MetaboliteMetadata", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "MetaboliteMetadata", "kind": "class", "doc": "

    Dataclass for the Metabolite Metadata

    \n\n
    Attributes
    \n\n
      \n
    • id (int):\nThe id of the compound.
    • \n
    • cas (str):\nThe CAS number of the compound.
    • \n
    • inchikey (str):\nThe InChiKey of the compound.
    • \n
    • inchi (str):\nThe InChi of the compound.
    • \n
    • chebi (str):\nThe ChEBI ID of the compound.
    • \n
    • smiles (str):\nThe SMILES of the compound.
    • \n
    • kegg (str):\nThe KEGG ID of the compound.
    • \n
    • iupac_name (str):\nThe IUPAC name of the compound.
    • \n
    • traditional_name (str):\nThe traditional name of the compound.
    • \n
    • common_name (str):\nThe common name of the compound.
    • \n
    • data_id (int):\nThe id of the compound in the molecularData table.
    • \n
    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.MetaboliteMetadata.__init__", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "MetaboliteMetadata.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tid: int,\tcas: str,\tinchikey: str,\tinchi: str,\tchebi: str,\tsmiles: str,\tkegg: str,\tdata_id: int,\tiupac_name: str,\ttraditional_name: str,\tcommon_name: str)"}, {"fullname": "corems.molecular_id.factory.EI_SQL.MetaboliteMetadata.id", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "MetaboliteMetadata.id", "kind": "variable", "doc": "

    \n", "annotation": ": int"}, {"fullname": "corems.molecular_id.factory.EI_SQL.MetaboliteMetadata.cas", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "MetaboliteMetadata.cas", "kind": "variable", "doc": "

    \n", "annotation": ": str"}, {"fullname": "corems.molecular_id.factory.EI_SQL.MetaboliteMetadata.inchikey", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "MetaboliteMetadata.inchikey", "kind": "variable", "doc": "

    \n", "annotation": ": str"}, {"fullname": "corems.molecular_id.factory.EI_SQL.MetaboliteMetadata.inchi", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "MetaboliteMetadata.inchi", "kind": "variable", "doc": "

    \n", "annotation": ": str"}, {"fullname": "corems.molecular_id.factory.EI_SQL.MetaboliteMetadata.chebi", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "MetaboliteMetadata.chebi", "kind": "variable", "doc": "

    \n", "annotation": ": str"}, {"fullname": "corems.molecular_id.factory.EI_SQL.MetaboliteMetadata.smiles", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "MetaboliteMetadata.smiles", "kind": "variable", "doc": "

    \n", "annotation": ": str"}, {"fullname": "corems.molecular_id.factory.EI_SQL.MetaboliteMetadata.kegg", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "MetaboliteMetadata.kegg", "kind": "variable", "doc": "

    \n", "annotation": ": str"}, {"fullname": "corems.molecular_id.factory.EI_SQL.MetaboliteMetadata.data_id", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "MetaboliteMetadata.data_id", "kind": "variable", "doc": "

    \n", "annotation": ": int"}, {"fullname": "corems.molecular_id.factory.EI_SQL.MetaboliteMetadata.iupac_name", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "MetaboliteMetadata.iupac_name", "kind": "variable", "doc": "

    \n", "annotation": ": str"}, {"fullname": "corems.molecular_id.factory.EI_SQL.MetaboliteMetadata.traditional_name", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "MetaboliteMetadata.traditional_name", "kind": "variable", "doc": "

    \n", "annotation": ": str"}, {"fullname": "corems.molecular_id.factory.EI_SQL.MetaboliteMetadata.common_name", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "MetaboliteMetadata.common_name", "kind": "variable", "doc": "

    \n", "annotation": ": str"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef", "kind": "class", "doc": "

    Dataclass for the Low Resolution Compound Reference

    \n\n

    This class is used to store the molecular and spectral data of the compounds in the low res EI database

    \n\n
    Parameters
    \n\n
      \n
    • compounds_dict (dict):\nA dictionary representing the compound.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • id (int):\nThe id of the compound.
    • \n
    • name (str):\nThe name of the compound.
    • \n
    • ri (str):\nThe retention index of the compound.
    • \n
    • retention_time (str):\nThe retention time of the compound.
    • \n
    • casno (str):\nThe CAS number of the compound.
    • \n
    • comment (str):\nThe comment of the compound.
    • \n
    • peaks_count (int):\nThe number of peaks in the spectra.
    • \n
    • classify (str):\nThe classification of the compound.
    • \n
    • derivativenum (str):\nThe derivative number of the compound.
    • \n
    • derivatization (str):\nThe derivatization applied to the compound.
    • \n
    • mz (numpy.ndarray):\nThe m/z values of the spectra.
    • \n
    • abundance (numpy.ndarray):\nThe abundance values of the spectra.
    • \n
    • source_temp_c (float):\nThe source temperature of the spectra.
    • \n
    • ev (float):\nThe electron volts of the spectra.
    • \n
    • formula (str):\nThe formula of the compound.
    • \n
    • source (str):\nThe source of the spectra data.
    • \n
    • classify (str):\nThe classification of the compound.
    • \n
    • metadata (MetaboliteMetadata):\nThe metadata object.
    • \n
    • similarity_score (float):\nThe similarity score of the compound.
    • \n
    • ri_score (float):\nThe RI score of the compound.
    • \n
    • spectral_similarity_score (float):\nThe spectral similarity score of the compound.
    • \n
    • spectral_similarity_scores (dict):\nThe spectral similarity scores of the compound.
    • \n
    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.__init__", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.__init__", "kind": "function", "doc": "

    \n", "signature": "(compounds_dict)"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.id", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.id", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.name", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.name", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.ri", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.ri", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.retention_time", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.retention_time", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.casno", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.casno", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.comment", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.comment", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.peaks_count", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.peaks_count", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.classify", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.classify", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.derivativenum", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.derivativenum", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.derivatization", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.derivatization", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.mz", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.mz", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.abundance", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.abundance", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.source_temp_c", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.source_temp_c", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.ev", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.ev", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.formula", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.formula", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.source", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.source", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.similarity_score", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.similarity_score", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.ri_score", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.ri_score", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.spectral_similarity_score", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.spectral_similarity_score", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.spectral_similarity_scores", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.spectral_similarity_scores", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite", "kind": "class", "doc": "

    A class for interacting with a SQLite database for low-resolution EI compounds.

    \n\n
    Parameters
    \n\n
      \n
    • url (str, optional):\nThe URL of the SQLite database. Default is 'sqlite://'.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • engine (sqlalchemy.engine.Engine):\nThe SQLAlchemy engine for connecting to the database.
    • \n
    • session (sqlalchemy.orm.Session):\nThe SQLAlchemy session for executing database operations.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • __init__(self, url='sqlite://').\nInitializes the EI_LowRes_SQLite object.
    • \n
    • __exit__(self, exc_type, exc_val, exc_tb).\nCloses the database connection.
    • \n
    • init_engine(self, url).\nInitializes the SQLAlchemy engine.
    • \n
    • __enter__(self).\nReturns the EI_LowRes_SQLite object.
    • \n
    • add_compound_list(self, data_dict_list).\nAdds a list of compounds to the database.
    • \n
    • add_compound(self, data_dict).\nAdds a single compound to the database.
    • \n
    • commit(self).\nCommits the changes to the database.
    • \n
    • row_to_dict(self, row).\nConverts a database row to a dictionary.
    • \n
    • get_all(self).\nRetrieves all compounds from the database.
    • \n
    • query_min_max_rt(self, min_max_rt).\nQueries compounds based on retention time range.
    • \n
    • query_min_max_ri(self, min_max_ri).\nQueries compounds based on RI range.
    • \n
    • query_names_and_rt(self, min_max_rt, compound_names).\nQueries compounds based on compound names and retention time range.
    • \n
    • query_min_max_ri_and_rt(self, min_max_ri, min_max_rt).\nQueries compounds based on RI range and retention time range.
    • \n
    • delete_compound(self, compound).\nDeletes a compound from the database.
    • \n
    • purge(self).\nDeletes all compounds from the database table.
    • \n
    • clear_data(self).\nClears all tables in the database.
    • \n
    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite.__init__", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite.__init__", "kind": "function", "doc": "

    \n", "signature": "(url='sqlite://')"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite.engine", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite.engine", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite.session", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite.session", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite.init_engine", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite.init_engine", "kind": "function", "doc": "

    Initializes the SQLAlchemy engine.

    \n\n
    Parameters
    \n\n
      \n
    • url (str):\nThe URL of the SQLite database.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • sqlalchemy.engine.Engine: The SQLAlchemy engine for connecting to the database.
    • \n
    \n", "signature": "(self, url):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite.add_compound_list", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite.add_compound_list", "kind": "function", "doc": "

    Adds a list of compounds to the database.

    \n\n
    Parameters
    \n\n
      \n
    • data_dict_list (list of dict):\nA list of dictionaries representing the compounds.
    • \n
    \n", "signature": "(self, data_dict_list):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite.add_compound", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite.add_compound", "kind": "function", "doc": "

    Adds a single compound to the database.

    \n\n
    Parameters
    \n\n
      \n
    • data_dict (dict):\nA dictionary representing the compound.
    • \n
    \n", "signature": "(self, data_dict):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite.commit", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite.commit", "kind": "function", "doc": "

    Commits the changes to the database.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite.row_to_dict", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite.row_to_dict", "kind": "function", "doc": "

    Converts a database row to a dictionary.

    \n\n
    Parameters
    \n\n
      \n
    • row (sqlalchemy.engine.row.Row):\nA row from the database.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: A dictionary representing the compound.
    • \n
    \n", "signature": "(self, row):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite.get_all", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite.get_all", "kind": "function", "doc": "

    Retrieves all compounds from the database.

    \n\n
    Returns
    \n\n
      \n
    • list: A list of dictionaries representing the compounds.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite.query_min_max_rt", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite.query_min_max_rt", "kind": "function", "doc": "

    Queries compounds based on retention time range.

    \n\n
    Parameters
    \n\n
      \n
    • min_max_rt (tuple):\nA tuple containing the minimum and maximum retention time values.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: A list of dictionaries representing the compounds.
    • \n
    \n", "signature": "(self, min_max_rt):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite.query_min_max_ri", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite.query_min_max_ri", "kind": "function", "doc": "

    Queries compounds based on RI range.

    \n\n
    Parameters
    \n\n
      \n
    • min_max_ri (tuple):\nA tuple containing the minimum and maximum RI values.
    • \n
    \n", "signature": "(self, min_max_ri):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite.query_names_and_rt", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite.query_names_and_rt", "kind": "function", "doc": "

    Queries compounds based on compound names and retention time range.

    \n\n
    Parameters
    \n\n
      \n
    • min_max_rt (tuple):\nA tuple containing the minimum and maximum retention time values.
    • \n
    • compound_names (list):\nA list of compound names.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: A list of dictionaries representing the compounds.
    • \n
    \n", "signature": "(self, min_max_rt, compound_names):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite.query_min_max_ri_and_rt", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite.query_min_max_ri_and_rt", "kind": "function", "doc": "

    Queries compounds based on RI range and retention time range.

    \n\n
    Parameters
    \n\n
      \n
    • min_max_ri (tuple):\nA tuple containing the minimum and maximum RI values.
    • \n
    • min_max_rt (tuple):\nA tuple containing the minimum and maximum retention time values.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: A list of dictionaries representing the compounds.
    • \n
    \n", "signature": "(self, min_max_ri, min_max_rt):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite.delete_compound", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite.delete_compound", "kind": "function", "doc": "

    Deletes a compound from the database.

    \n\n
    Parameters
    \n\n
      \n
    • compound (LowResolutionEICompound):\nA compound object.
    • \n
    \n", "signature": "(self, compound):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite.purge", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite.purge", "kind": "function", "doc": "

    Deletes all compounds from the database table.

    \n\n
    Notes
    \n\n

    Careful, this will delete the entire database table.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite.clear_data", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite.clear_data", "kind": "function", "doc": "

    Clears all tables in the database.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.profiled", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "profiled", "kind": "function", "doc": "

    A context manager for profiling.

    \n", "signature": "():", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.insert_database_worker", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "insert_database_worker", "kind": "function", "doc": "

    Inserts data into the database.

    \n", "signature": "(args):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations", "kind": "class", "doc": "

    A class for generating molecular formula combinations.

    \n\n
    Parameters
    \n\n
      \n
    • molecular_search_settings (object):\nAn object containing user-defined settings.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • sql_db (MolForm_SQL):\nThe SQLite database object.
    • \n
    • len_existing_classes (int):\nThe number of existing classes in the SQLite database.
    • \n
    • odd_ch_id (list):\nA list of odd carbon and hydrogen atom IDs.
    • \n
    • odd_ch_dict (list):\nA list of odd carbon and hydrogen atom dictionaries.
    • \n
    • odd_ch_mass (list):\nA list of odd carbon and hydrogen atom masses.
    • \n
    • odd_ch_dbe (list):\nA list of odd carbon and hydrogen atom double bond equivalents.
    • \n
    • even_ch_id (list):\nA list of even carbon and hydrogen atom IDs.
    • \n
    • even_ch_dict (list):\nA list of even carbon and hydrogen atom dictionaries.
    • \n
    • even_ch_mass (list):\nA list of even carbon and hydrogen atom masses.
    • \n
    • even_ch_dbe (list):\nA list of even carbon and hydrogen atom double bond equivalents.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • cProfile_worker(args)
      \nA cProfile worker for the get_mol_formulas function.
    • \n
    • check_database_get_class_list(molecular_search_settings)
      \nChecks if the database has all the classes, if not create the missing classes.
    • \n
    • get_carbonsHydrogens(settings, odd_even)
      \nRetrieves carbon and hydrogen atoms from the molecular lookup table based on user-defined settings.
    • \n
    • add_carbonsHydrogens(settings, existing_classes_objs)
      \nAdds carbon and hydrogen atoms to the molecular lookup table based on user-defined settings.
    • \n
    • runworker(molecular_search_settings)
      \nRuns the molecular formula lookup table worker.
    • \n
    • get_classes_in_order(molecular_search_settings)
      \nGets the classes in order.
    • \n
    • sort_classes(atoms_in_order, combination_dict)
      \nSorts the classes in order.
    • \n
    • get_fixed_initial_number_of_hydrogen(min_h, odd_even)
      \nGets the fixed initial number of hydrogen atoms.
    • \n
    • calc_mz(datadict, class_mass=0)
      \nCalculates the mass-to-charge ratio (m/z) of a molecular formula.
    • \n
    • calc_dbe_class(datadict)
      \nCalculates the double bond equivalent (DBE) of a molecular formula.
    • \n
    • populate_combinations(classe_tuple, settings)
      \nPopulates the combinations.
    • \n
    • get_or_add(SomeClass, kw)
      \nGets or adds a class.
    • \n
    • get_mol_formulas(odd_even_tag, classe_tuple, settings)
      \nGets the molecular formulas.
    • \n
    • get_h_odd_or_even(class_dict)
      \nGets the hydrogen odd or even.
    • \n
    • get_total_halogen_atoms(class_dict)
      \nGets the total number of halogen atoms.
    • \n
    \n"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.__init__", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.__init__", "kind": "function", "doc": "

    \n", "signature": "(sql_db=None)"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.cProfile_worker", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.cProfile_worker", "kind": "function", "doc": "

    cProfile worker for the get_mol_formulas function

    \n", "signature": "(self, args):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.check_database_get_class_list", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.check_database_get_class_list", "kind": "function", "doc": "

    check if the database has all the classes, if not create the missing classes

    \n\n
    Parameters
    \n\n
      \n
    • molecular_search_settings (object):\nAn object containing user-defined settings.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: list of tuples with the class name and the class dictionary
    • \n
    \n", "signature": "(self, molecular_search_settings):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.get_carbonsHydrogens", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.get_carbonsHydrogens", "kind": "function", "doc": "

    Retrieve carbon and hydrogen atoms from the molecular lookup table based on user-defined settings.

    \n\n
    Parameters
    \n\n
      \n
    • settings (object):\nAn object containing user-defined settings.
    • \n
    • odd_even (str):\nA string indicating whether to retrieve even or odd hydrogen atoms.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: A list of CarbonHydrogen objects that satisfy the specified conditions.
    • \n
    \n", "signature": "(self, settings, odd_even):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.add_carbonsHydrogens", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.add_carbonsHydrogens", "kind": "function", "doc": "

    Add carbon and hydrogen atoms to the molecular lookup table based on user-defined settings.

    \n\n
    Parameters
    \n\n
      \n
    • settings (object):\nAn object containing user-defined settings.
    • \n
    • existing_classes_objs (list):\nA list of HeteroAtoms objects.
    • \n
    \n", "signature": "(self, settings, existing_classes_objs):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.runworker", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.runworker", "kind": "function", "doc": "

    Run the molecular formula lookup table worker.

    \n\n
    Parameters
    \n\n
      \n
    • molecular_search_settings (object):\nAn object containing user-defined settings.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: A list of tuples with the class name and the class dictionary.
    • \n
    \n", "signature": "(*args, **kw):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.get_classes_in_order", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.get_classes_in_order", "kind": "function", "doc": "

    Get the classes in order

    \n\n
    Parameters
    \n\n
      \n
    • molecular_search_settings (object):\nAn object containing user-defined settings.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: A dictionary of classes in order.\nstructure is ('HC', {'HC': 1})
    • \n
    \n", "signature": "(self, molecular_search_settings):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.sort_classes", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.sort_classes", "kind": "function", "doc": "

    Sort the classes in order

    \n\n
    Parameters
    \n\n
      \n
    • atoms_in_order (list):\nA list of atoms in order.
    • \n
    • combination_dict (dict):\nA dictionary of classes.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: A dictionary of classes in order.
    • \n
    \n", "signature": "(atoms_in_order, combination_dict) -> Dict[str, Dict[str, int]]:", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.get_fixed_initial_number_of_hydrogen", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.get_fixed_initial_number_of_hydrogen", "kind": "function", "doc": "

    Get the fixed initial number of hydrogen atoms

    \n\n
    Parameters
    \n\n
      \n
    • min_h (int):\nThe minimum number of hydrogen atoms.
    • \n
    • odd_even (str):\nA string indicating whether to retrieve even or odd hydrogen atoms.
    • \n
    \n", "signature": "(min_h, odd_even):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.calc_mz", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.calc_mz", "kind": "function", "doc": "

    Calculate the mass-to-charge ratio (m/z) of a molecular formula.

    \n\n
    Parameters
    \n\n
      \n
    • datadict (dict):\nA dictionary of classes.
    • \n
    • class_mass (int):\nThe mass of the class.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: The mass-to-charge ratio (m/z) of a molecular formula.
    • \n
    \n", "signature": "(self, datadict, class_mass=0):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.calc_dbe_class", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.calc_dbe_class", "kind": "function", "doc": "

    Calculate the double bond equivalent (DBE) of a molecular formula.

    \n\n
    Parameters
    \n\n
      \n
    • datadict (dict):\nA dictionary of classes.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: The double bond equivalent (DBE) of a molecular formula.
    • \n
    \n", "signature": "(self, datadict):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.populate_combinations", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.populate_combinations", "kind": "function", "doc": "

    Populate the combinations

    \n\n
    Parameters
    \n\n
      \n
    • classe_tuple (tuple):\nA tuple containing the class name, the class dictionary, and the class ID.
    • \n
    • settings (object):\nAn object containing user-defined settings.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: A list of molecular formula data dictionaries.
    • \n
    \n", "signature": "(self, classe_tuple, settings):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.get_or_add", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.get_or_add", "kind": "function", "doc": "

    Get or add a class

    \n\n
    Parameters
    \n\n
      \n
    • SomeClass (object):\nA class object.
    • \n
    • kw (dict):\nA dictionary of classes.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • object: A class object.
    • \n
    \n", "signature": "(self, SomeClass, kw):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.get_mol_formulas", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.get_mol_formulas", "kind": "function", "doc": "

    Get the molecular formulas

    \n\n
    Parameters
    \n\n
      \n
    • odd_even_tag (str):\nA string indicating whether to retrieve even or odd hydrogen atoms.
    • \n
    • classe_tuple (tuple):

    • \n
    • settings (object):\nAn object containing user-defined settings.

    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: A list of molecular formula data dictionaries.
    • \n
    \n", "signature": "(self, odd_even_tag, classe_tuple, settings):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.get_h_odd_or_even", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.get_h_odd_or_even", "kind": "function", "doc": "

    Get the hydrogen odd or even

    \n\n
    Parameters
    \n\n
      \n
    • class_dict (dict):\nA dictionary of classes.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • str: A string indicating whether to retrieve even or odd hydrogen atoms.
    • \n
    \n", "signature": "(self, class_dict):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.get_total_halogen_atoms", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.get_total_halogen_atoms", "kind": "function", "doc": "

    Get the total number of halogen atoms

    \n\n
    Parameters
    \n\n
      \n
    • class_dict (dict):\nA dictionary of classes.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • int: The total number of halogen atoms.
    • \n
    \n", "signature": "(class_dict):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification", "modulename": "corems.molecular_id.factory.classification", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.classification.flatten_list", "modulename": "corems.molecular_id.factory.classification", "qualname": "flatten_list", "kind": "function", "doc": "

    \n", "signature": "(l):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification", "kind": "class", "doc": "

    Class for grouping mass spectrum data by heteroatom classes (Nn, Oo, Ss, NnOo, NnSs, etc..)

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (MassSpectrum):\nThe mass spectrum object.
    • \n
    • choose_molecular_formula (bool, optional):\nIf True, the molecular formula with the highest abundance is chosen. If False, all molecular formulas are considered. Default is True.
    • \n
    \n\n
    Raises
    \n\n
      \n
    • Exception: If no molecular formula is associated with any mspeak objects.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • _ms_grouped_class (dict):\nA dictionary of classes and a list of ms_peak objects.
    • \n
    • choose_mf (bool):\nIf True, the molecular formula with the highest abundance is chosen. If False, all molecular formulas are considered.
    • \n
    • total_peaks (int):\nThe total number of peaks.
    • \n
    • sum_abundance (float):\nThe sum of the abundance of all peaks.
    • \n
    • min_max_mz (tuple):\nThe minimum and maximum mz values.
    • \n
    • min_max_abundance (tuple):\nThe minimum and maximum abundance values.
    • \n
    • min_ppm_error (float):\nThe minimum ppm error.
    • \n
    • max_ppm_error (float):\nThe maximum ppm error.
    • \n
    • all_identified_atoms (list):\nA list of all identified atoms.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • __len__().\nReturns the number of classes.
    • \n
    • __getitem__(classe)
      \nReturns the molecular formula list for specified class.
    • \n
    • __iter__().\nReturns an iterator over the keys of the dictionary.
    • \n
    • get_classes(threshold_perc=1, isotopologue=True).\nReturns a list of classes with abundance percentile above threshold.
    • \n
    • molecular_formula_string(classe).\nReturns a list of molecular formula string for specified class.
    • \n
    • molecular_formula(classe).\nReturns a list of molecular formula for specified class.
    • \n
    • carbon_number(classe).\nReturns a list of carbon number for specified class.
    • \n
    • atom_count(atom, classe).\nReturns a list of atom count for specified class.
    • \n
    • dbe(classe).\nReturns a list of DBE for specified class.
    • \n
    • atoms_ratio(classe, numerator, denominator).\nReturns a list of atoms ratio for specified class.
    • \n
    • mz_exp(classe).\nReturns a list of experimental mz for specified class.
    • \n
    • abundance(classe).\nReturns a list of abundance for specified class.
    • \n
    • mz_error(classe).\nReturns a list of mz error for specified class.
    • \n
    • mz_calc(classe).\nReturns a list of calculated mz for specified class.
    • \n
    • peaks_count_percentile(classe).\nReturns the peaks count percentile of a specific class.
    • \n
    • abundance_count_percentile(classe).\nReturns the abundance percentile of a specific class.
    • \n
    • mz_exp_assigned().\nReturns a list of experimental mz for all assigned classes.
    • \n
    • abundance_assigned().\nReturns a list of abundance for all classes.
    • \n
    • mz_exp_all().\nReturns a list of mz for all classes.
    • \n
    \n", "bases": "collections.abc.Mapping"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.__init__", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.__init__", "kind": "function", "doc": "

    \n", "signature": "(mass_spectrum, choose_molecular_formula=True)"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.choose_mf", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.choose_mf", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.total_peaks", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.total_peaks", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.sum_abundance", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.sum_abundance", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.min_max_mz", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.min_max_mz", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.min_max_abundance", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.min_max_abundance", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.min_ppm_error", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.min_ppm_error", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.max_ppm_error", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.max_ppm_error", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.all_identified_atoms", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.all_identified_atoms", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.get_classes", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.get_classes", "kind": "function", "doc": "

    Return a list of classes with abundance percentile above threshold

    \n", "signature": "(self, threshold_perc=1, isotopologue=True):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.molecular_formula_string", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.molecular_formula_string", "kind": "function", "doc": "

    Return a list of molecular formula string for specified class

    \n", "signature": "(self, classe):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.molecular_formula", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.molecular_formula", "kind": "function", "doc": "

    Return a list of molecular formula for specified class

    \n", "signature": "(self, classe):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.carbon_number", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.carbon_number", "kind": "function", "doc": "

    Return a list of carbon number for specified class

    \n", "signature": "(self, classe):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.atom_count", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.atom_count", "kind": "function", "doc": "

    Return a list of atom count for specified class

    \n", "signature": "(self, atom, classe):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.dbe", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.dbe", "kind": "function", "doc": "

    Return a list of DBE for specified class

    \n", "signature": "(self, classe):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.atoms_ratio", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.atoms_ratio", "kind": "function", "doc": "

    Return a list of atoms ratio for specified class

    \n", "signature": "(self, classe, numerator, denominator):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.mz_exp", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.mz_exp", "kind": "function", "doc": "

    Return a list of experimental mz for specified class

    \n", "signature": "(self, classe):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.abundance", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.abundance", "kind": "function", "doc": "

    Return a list of abundance for specified class

    \n", "signature": "(self, classe):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.mz_error", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.mz_error", "kind": "function", "doc": "

    Return a list of mz error for specified class

    \n", "signature": "(self, classe):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.mz_calc", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.mz_calc", "kind": "function", "doc": "

    Return a list of calculated mz for specified class

    \n", "signature": "(self, classe):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.peaks_count_percentile", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.peaks_count_percentile", "kind": "function", "doc": "

    Return the peaks count percentile of a specific class

    \n", "signature": "(self, classe):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.abundance_count_percentile", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.abundance_count_percentile", "kind": "function", "doc": "

    Return the abundance percentile of a specific class

    \n", "signature": "(self, classe):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.mz_exp_assigned", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.mz_exp_assigned", "kind": "function", "doc": "

    Return a list of experimental mz for all assigned classes

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.abundance_assigned", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.abundance_assigned", "kind": "function", "doc": "

    Return a list of abundance for all classes

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.mz_exp_all", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.mz_exp_all", "kind": "function", "doc": "

    Return a list of mz for all classes

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.mz_error_all", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.mz_error_all", "kind": "function", "doc": "

    Return a list of mz error for all classes

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.carbon_number_all", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.carbon_number_all", "kind": "function", "doc": "

    Return a list of carbon number for all classes

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.dbe_all", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.dbe_all", "kind": "function", "doc": "

    Return a list of DBE for all classes

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.atoms_ratio_all", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.atoms_ratio_all", "kind": "function", "doc": "

    Return a list of atoms ratio for all classes

    \n", "signature": "(self, numerator, denominator):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.to_dataframe", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.to_dataframe", "kind": "function", "doc": "

    Return a pandas dataframe with all the data from the class

    \n\n
    Parameters
    \n\n
      \n
    • include_isotopologue (bool, optional):\nInclude isotopologues, by default False
    • \n
    • abundance_perc_threshold (int, optional):\nAbundance percentile threshold, by default 5
    • \n
    • include_unassigned (bool, optional):\nInclude unassigned peaks, by default False
    • \n
    \n\n
    Returns
    \n\n
      \n
    • DataFrame: Pandas dataframe with all the data from the class
    • \n
    \n", "signature": "(\tself,\tinclude_isotopologue=False,\tabundance_perc_threshold=5,\tinclude_unassigned=False):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.plot_ms_assigned_unassigned", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.plot_ms_assigned_unassigned", "kind": "function", "doc": "

    Plot stick mass spectrum of all classes

    \n\n
    Parameters
    \n\n
      \n
    • assigned_color (str, optional):\nMatplotlib color for the assigned peaks, by default \"b\"
    • \n
    • unassigned_color (str, optional):\nMatplotlib color for the unassigned peaks, by default \"r\"
    • \n
    \n\n
    Returns
    \n\n
      \n
    • ax (matplotlib.axes):\nMatplotlib axes object
    • \n
    \n", "signature": "(self, assigned_color='b', unassigned_color='r'):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.plot_mz_error", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.plot_mz_error", "kind": "function", "doc": "

    Plot mz error scatter plot of all classes

    \n\n
    Parameters
    \n\n
      \n
    • color (str, optional):\nMatplotlib color, by default \"g\"
    • \n
    \n\n
    Returns
    \n\n
      \n
    • ax (matplotlib.axes):\nMatplotlib axes object
    • \n
    \n", "signature": "(self, color='g'):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.plot_mz_error_class", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.plot_mz_error_class", "kind": "function", "doc": "

    Plot mz error scatter plot of a specific class

    \n\n
    Parameters
    \n\n
      \n
    • classe (str):\nClass name
    • \n
    • color (str, optional):\nMatplotlib color, by default \"g\"
    • \n
    \n\n
    Returns
    \n\n
      \n
    • ax (matplotlib.axes):\nMatplotlib axes object
    • \n
    \n", "signature": "(self, classe, color='g'):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.plot_ms_class", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.plot_ms_class", "kind": "function", "doc": "

    Plot stick mass spectrum of a specific class

    \n\n
    Parameters
    \n\n
      \n
    • classe (str):\nClass name
    • \n
    • color (str, optional):\nMatplotlib color, by default \"g\"
    • \n
    \n\n
    Returns
    \n\n
      \n
    • ax (matplotlib.axes):\nMatplotlib axes object
    • \n
    \n", "signature": "(self, classe, color='g'):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.plot_van_krevelen", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.plot_van_krevelen", "kind": "function", "doc": "

    Plot Van Krevelen Diagram

    \n\n
    Parameters
    \n\n
      \n
    • classe (str):\nClass name
    • \n
    • max_hc (float, optional):\nMax H/C ratio, by default 2.5
    • \n
    • max_oc (float, optional):\nMax O/C ratio, by default 2
    • \n
    • ticks_number (int, optional):\nNumber of ticks, by default 5
    • \n
    • color (str, optional):\nMatplotlib color, by default \"viridis\"
    • \n
    \n\n
    Returns
    \n\n
      \n
    • ax (matplotlib.axes):\nMatplotlib axes object
    • \n
    • abun_perc (float):\nClass percentile of the relative abundance
    • \n
    \n", "signature": "(self, classe, max_hc=2.5, max_oc=2, ticks_number=5, color='viridis'):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.plot_dbe_vs_carbon_number", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.plot_dbe_vs_carbon_number", "kind": "function", "doc": "

    Plot DBE vs Carbon Number

    \n\n
    Parameters
    \n\n
      \n
    • classe (str):\nClass name
    • \n
    • max_c (int, optional):\nMax Carbon Number, by default 50
    • \n
    • max_dbe (int, optional):\nMax DBE, by default 40
    • \n
    • dbe_incr (int, optional):\nDBE increment, by default 5
    • \n
    • c_incr (int, optional):\nCarbon Number increment, by default 10
    • \n
    • color (str, optional):\nMatplotlib color, by default \"viridis\"
    • \n
    \n\n
    Returns
    \n\n
      \n
    • ax (matplotlib.axes):\nMatplotlib axes object
    • \n
    • abun_perc (float):\nClass percentile of the relative abundance
    • \n
    \n", "signature": "(\tself,\tclasse,\tmax_c=50,\tmax_dbe=40,\tdbe_incr=5,\tc_incr=10,\tcolor='viridis'):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.molecularSQL", "modulename": "corems.molecular_id.factory.molecularSQL", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.Base", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "Base", "kind": "class", "doc": "

    The base class of the class hierarchy.

    \n\n

    When called, it accepts no arguments and returns a new featureless\ninstance that has no instance attributes and cannot be given any.

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.Base.__init__", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "Base.__init__", "kind": "function", "doc": "

    A simple constructor that allows initialization from kwargs.

    \n\n

    Sets attributes on the constructed instance using the names and\nvalues in kwargs.

    \n\n

    Only keys that are present as\nattributes of the instance's class are allowed. These could be,\nfor example, any mapped columns or relationships.

    \n", "signature": "(**kwargs)"}, {"fullname": "corems.molecular_id.factory.molecularSQL.Base.registry", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "Base.registry", "kind": "variable", "doc": "

    \n", "default_value": "<sqlalchemy.orm.decl_api.registry object>"}, {"fullname": "corems.molecular_id.factory.molecularSQL.Base.metadata", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "Base.metadata", "kind": "variable", "doc": "

    \n", "default_value": "MetaData()"}, {"fullname": "corems.molecular_id.factory.molecularSQL.HeteroAtoms", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "HeteroAtoms", "kind": "class", "doc": "

    HeteroAtoms class for the heteroAtoms table in the SQLite database.

    \n\n
    Attributes
    \n\n
      \n
    • id (int):\nThe primary key for the table.
    • \n
    • name (str):\nThe name of the heteroAtoms class.
    • \n
    • halogensCount (int):\nThe number of halogens in the heteroAtoms class.
    • \n
    • carbonHydrogen (relationship):\nThe relationship to the carbonHydrogen table.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • __repr__()\nReturns the string representation of the object.
    • \n
    • to_dict()\nReturns the heteroAtoms class as a dictionary.
    • \n
    • halogens_count()\nReturns the number of halogens as a float.
    • \n
    \n", "bases": "sqlalchemy.orm.decl_api.Base"}, {"fullname": "corems.molecular_id.factory.molecularSQL.HeteroAtoms.__init__", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "HeteroAtoms.__init__", "kind": "function", "doc": "

    A simple constructor that allows initialization from kwargs.

    \n\n

    Sets attributes on the constructed instance using the names and\nvalues in kwargs.

    \n\n

    Only keys that are present as\nattributes of the instance's class are allowed. These could be,\nfor example, any mapped columns or relationships.

    \n", "signature": "(**kwargs)"}, {"fullname": "corems.molecular_id.factory.molecularSQL.HeteroAtoms.id", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "HeteroAtoms.id", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.HeteroAtoms.name", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "HeteroAtoms.name", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.HeteroAtoms.halogensCount", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "HeteroAtoms.halogensCount", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.HeteroAtoms.carbonHydrogen", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "HeteroAtoms.carbonHydrogen", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.HeteroAtoms.halogens_count", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "HeteroAtoms.halogens_count", "kind": "variable", "doc": "

    Returns the number of halogens as a float.

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.HeteroAtoms.to_dict", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "HeteroAtoms.to_dict", "kind": "function", "doc": "

    Returns the heteroAtoms class as a dictionary.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.molecularSQL.CarbonHydrogen", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "CarbonHydrogen", "kind": "class", "doc": "

    CarbonHydrogen class for the carbonHydrogen table in the SQLite database.

    \n\n
    Attributes
    \n\n
      \n
    • id (int):\nThe primary key for the table.
    • \n
    • C (int):\nThe number of carbon atoms.
    • \n
    • H (int):\nThe number of hydrogen atoms.
    • \n
    • heteroAtoms (relationship):\nThe relationship to the heteroAtoms table.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • __repr__()\nReturns the string representation of the object.
    • \n
    • mass()\nReturns the mass of the carbonHydrogen class as a float.
    • \n
    • c()\nReturns the number of carbon atoms as a float.
    • \n
    • h()\nReturns the number of hydrogen atoms as a float.
    • \n
    • dbe()\nReturns the double bond equivalent as a float.
    • \n
    \n", "bases": "sqlalchemy.orm.decl_api.Base"}, {"fullname": "corems.molecular_id.factory.molecularSQL.CarbonHydrogen.__init__", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "CarbonHydrogen.__init__", "kind": "function", "doc": "

    A simple constructor that allows initialization from kwargs.

    \n\n

    Sets attributes on the constructed instance using the names and\nvalues in kwargs.

    \n\n

    Only keys that are present as\nattributes of the instance's class are allowed. These could be,\nfor example, any mapped columns or relationships.

    \n", "signature": "(**kwargs)"}, {"fullname": "corems.molecular_id.factory.molecularSQL.CarbonHydrogen.id", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "CarbonHydrogen.id", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.CarbonHydrogen.C", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "CarbonHydrogen.C", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.CarbonHydrogen.H", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "CarbonHydrogen.H", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.CarbonHydrogen.heteroAtoms", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "CarbonHydrogen.heteroAtoms", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.CarbonHydrogen.mass", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "CarbonHydrogen.mass", "kind": "variable", "doc": "

    Returns the mass of the carbonHydrogen class as a float.

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.CarbonHydrogen.c", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "CarbonHydrogen.c", "kind": "variable", "doc": "

    Returns the number of carbon atoms as a float.

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.CarbonHydrogen.h", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "CarbonHydrogen.h", "kind": "variable", "doc": "

    Returns the number of hydrogen atoms as a float.

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.CarbonHydrogen.dbe", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "CarbonHydrogen.dbe", "kind": "variable", "doc": "

    Returns the double bond equivalent as a float.

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolecularFormulaLink", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolecularFormulaLink", "kind": "class", "doc": "

    MolecularFormulaLink class for the molecularformula table in the SQLite database.

    \n\n
    Attributes
    \n\n
      \n
    • heteroAtoms_id (int):\nThe foreign key for the heteroAtoms table.
    • \n
    • carbonHydrogen_id (int):\nThe foreign key for the carbonHydrogen table.
    • \n
    • mass (float):\nThe mass of the molecular formula.
    • \n
    • DBE (float):\nThe double bond equivalent of the molecular formula.
    • \n
    • carbonHydrogen (relationship):\nThe relationship to the carbonHydrogen table.
    • \n
    • heteroAtoms (relationship):\nThe relationship to the heteroAtoms table.
    • \n
    • C (association_proxy):\nThe association proxy for the carbonHydrogen table.
    • \n
    • H (association_proxy):\nThe association proxy for the carbonHydrogen table.
    • \n
    • classe (association_proxy):\nThe association proxy for the heteroAtoms table.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • __repr__()\nReturns the string representation of the object.
    • \n
    • to_dict()\nReturns the molecular formula as a dictionary.
    • \n
    • formula_string()\nReturns the molecular formula as a string.
    • \n
    • classe_string()\nReturns the heteroAtoms class as a string.
    • \n
    • _adduct_mz(ion_charge, adduct_atom)\nReturns the m/z of the adduct ion as a float.
    • \n
    • _protonated_mz(ion_charge)\nReturns the m/z of the protonated ion as a float.
    • \n
    • _radical_mz(ion_charge)\nReturns the m/z of the radical ion as a float.
    • \n
    \n", "bases": "sqlalchemy.orm.decl_api.Base"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolecularFormulaLink.__init__", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolecularFormulaLink.__init__", "kind": "function", "doc": "

    A simple constructor that allows initialization from kwargs.

    \n\n

    Sets attributes on the constructed instance using the names and\nvalues in kwargs.

    \n\n

    Only keys that are present as\nattributes of the instance's class are allowed. These could be,\nfor example, any mapped columns or relationships.

    \n", "signature": "(**kwargs)"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolecularFormulaLink.heteroAtoms_id", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolecularFormulaLink.heteroAtoms_id", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolecularFormulaLink.carbonHydrogen_id", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolecularFormulaLink.carbonHydrogen_id", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolecularFormulaLink.mass", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolecularFormulaLink.mass", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolecularFormulaLink.DBE", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolecularFormulaLink.DBE", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolecularFormulaLink.carbonHydrogen", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolecularFormulaLink.carbonHydrogen", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolecularFormulaLink.heteroAtoms", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolecularFormulaLink.heteroAtoms", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolecularFormulaLink.C", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolecularFormulaLink.C", "kind": "variable", "doc": "

    A descriptor that presents a read/write view of an object attribute.

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolecularFormulaLink.H", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolecularFormulaLink.H", "kind": "variable", "doc": "

    A descriptor that presents a read/write view of an object attribute.

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolecularFormulaLink.classe", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolecularFormulaLink.classe", "kind": "variable", "doc": "

    A descriptor that presents a read/write view of an object attribute.

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolecularFormulaLink.to_dict", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolecularFormulaLink.to_dict", "kind": "function", "doc": "

    Returns the molecular formula as a dictionary.

    \n\n
    Returns
    \n\n
      \n
    • dict: The molecular formula as a dictionary.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolecularFormulaLink.formula_string", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolecularFormulaLink.formula_string", "kind": "variable", "doc": "

    Returns the molecular formula as a string.

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolecularFormulaLink.classe_string", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolecularFormulaLink.classe_string", "kind": "variable", "doc": "

    Returns the heteroAtoms class as a string.

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolForm_SQL", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolForm_SQL", "kind": "class", "doc": "

    MolForm_SQL class for the SQLite database.

    \n\n
    Attributes
    \n\n
      \n
    • engine (sqlalchemy.engine.base.Engine):\nThe SQLAlchemy engine.
    • \n
    • session (sqlalchemy.orm.session.Session):\nThe SQLAlchemy session.
    • \n
    • type (str):\nThe type of database.
    • \n
    • chunks_count (int):\nThe number of chunks to use when querying the database.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • __init__(url=None, echo=False)\nInitializes the database.
    • \n
    • __exit__(exc_type, exc_val, exc_tb)\nCloses the database.
    • \n
    • initiate_database(url, database_name)\nCreates the database.
    • \n
    • commit()\nCommits the session.
    • \n
    • init_engine(url)\nInitializes the SQLAlchemy engine.
    • \n
    • __enter__()

    • \n
    • get_dict_by_classes(classes, ion_type, nominal_mzs, ion_charge, molecular_search_settings, adducts=None)\nReturns a dictionary of molecular formulas.

    • \n
    • check_entry(classe, ion_type, molecular_search_settings)\nChecks if a molecular formula is in the database.
    • \n
    • get_all_classes()\nReturns a list of all classes in the database.
    • \n
    • get_all()\nReturns a list of all molecular formulas in the database.
    • \n
    • delete_entry(row)\nDeletes a molecular formula from the database.
    • \n
    • purge(cls)\nDeletes all molecular formulas from the database.
    • \n
    • clear_data()\nClears the database.
    • \n
    • close(commit=True)\nCloses the database.
    • \n
    • add_engine_pidguard(engine)\nAdds multiprocessing guards.
    • \n
    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolForm_SQL.__init__", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolForm_SQL.__init__", "kind": "function", "doc": "

    \n", "signature": "(url=None, echo=False)"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolForm_SQL.engine", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolForm_SQL.engine", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolForm_SQL.session", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolForm_SQL.session", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolForm_SQL.initiate_database", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolForm_SQL.initiate_database", "kind": "function", "doc": "

    Creates the database.

    \n\n
    Parameters
    \n\n
      \n
    • url (str):\nThe URL for the database.
    • \n
    • database_name (str):\nThe name of the database.
    • \n
    \n", "signature": "(self, url, database_name):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolForm_SQL.commit", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolForm_SQL.commit", "kind": "function", "doc": "

    Commits the session.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolForm_SQL.init_engine", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolForm_SQL.init_engine", "kind": "function", "doc": "

    Initializes the SQLAlchemy engine.

    \n\n
    Parameters
    \n\n
      \n
    • url (str):\nThe URL for the database.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • sqlalchemy.engine.base.Engine: The SQLAlchemy engine.
    • \n
    \n", "signature": "(self, url):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolForm_SQL.get_dict_by_classes", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolForm_SQL.get_dict_by_classes", "kind": "function", "doc": "

    Returns a dictionary of molecular formulas.

    \n\n
    Parameters
    \n\n
      \n
    • classes (list):\nThe list of classes.
    • \n
    • ion_type (str):\nThe ion type.
    • \n
    • nominal_mzs (list):\nThe list of nominal m/z values.
    • \n
    • ion_charge (int):\nThe ion charge.
    • \n
    • molecular_search_settings (MolecularFormulaSearchSettings):\nThe molecular formula search settings.
    • \n
    • adducts (list, optional):\nThe list of adducts. Default is None.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: The dictionary of molecular formulas.
    • \n
    \n\n
    Notes
    \n\n

    Known issue, when using SQLite:\nif the number of classes and nominal_m/zs are higher than 999 the query will fail\nSolution: use postgres or split query

    \n", "signature": "(\tself,\tclasses,\tion_type,\tnominal_mzs,\tion_charge,\tmolecular_search_settings,\tadducts=None):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolForm_SQL.check_entry", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolForm_SQL.check_entry", "kind": "function", "doc": "

    Checks if a molecular formula is in the database.

    \n\n
    Parameters
    \n\n
      \n
    • classe (str):\nThe class of the molecular formula.
    • \n
    • ion_type (str):\nThe ion type.
    • \n
    • molecular_search_settings (MolecularFormulaSearchSettings):\nThe molecular formula search settings.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • sqlalchemy.orm.query.Query: The query.
    • \n
    \n", "signature": "(self, classe, ion_type, molecular_search_settings):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolForm_SQL.get_all_classes", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolForm_SQL.get_all_classes", "kind": "function", "doc": "

    Returns a list of all classes in the database.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolForm_SQL.get_all", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolForm_SQL.get_all", "kind": "function", "doc": "

    Returns a list of all molecular formulas in the database.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolForm_SQL.delete_entry", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolForm_SQL.delete_entry", "kind": "function", "doc": "

    Deletes a molecular formula from the database.

    \n", "signature": "(self, row):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolForm_SQL.purge", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolForm_SQL.purge", "kind": "function", "doc": "

    Deletes all molecular formulas from the database.

    \n\n
    Notes
    \n\n

    Careful, this will delete the entire database table

    \n", "signature": "(self, cls):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolForm_SQL.clear_data", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolForm_SQL.clear_data", "kind": "function", "doc": "

    Clears the database.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolForm_SQL.close", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolForm_SQL.close", "kind": "function", "doc": "

    Closes the database.

    \n\n
    Parameters
    \n\n
      \n
    • commit (bool, optional):\nWhether to commit the session. Default is True.
    • \n
    \n", "signature": "(self, commit=True):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolForm_SQL.add_engine_pidguard", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolForm_SQL.add_engine_pidguard", "kind": "function", "doc": "

    Adds multiprocessing guards.

    \n\n

    Forces a connection to be reconnected if it is detected\nas having been shared to a sub-process.

    \n\n
    Parameters
    \n\n
      \n
    • engine (sqlalchemy.engine.base.Engine):\nThe SQLAlchemy engine.
    • \n
    \n", "signature": "(self, engine):", "funcdef": "def"}, {"fullname": "corems.molecular_id.input", "modulename": "corems.molecular_id.input", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.input.nistMSI", "modulename": "corems.molecular_id.input.nistMSI", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.input.nistMSI.ReadNistMSI", "modulename": "corems.molecular_id.input.nistMSI", "qualname": "ReadNistMSI", "kind": "class", "doc": "

    A class for reading NIST MSI files and storing the data in a SQLite database.

    \n\n
    Parameters
    \n\n
      \n
    • file_path (str):\nThe path to the NIST MSI file.
    • \n
    • url (str, optional):\nThe URL for the SQLite database. Default is 'sqlite://'.
    • \n
    \n\n
    Raises
    \n\n
      \n
    • FileExistsError: If the specified file does not exist.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • file_path (str):\nThe path to the NIST MSI file.
    • \n
    • url (str):\nThe URL for the SQLite database.
    • \n
    • sqlLite_obj (EI_LowRes_SQLite):\nThe SQLite object for storing the compound data.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • run().\nRuns the thread and initializes the SQLite object.
    • \n
    • get_sqlLite_obj().\nReturns the SQLite object.
    • \n
    • get_compound_data_dict_list().\nParses the NIST MSI file and returns a list of compound data dictionaries.
    • \n
    \n", "bases": "threading.Thread"}, {"fullname": "corems.molecular_id.input.nistMSI.ReadNistMSI.__init__", "modulename": "corems.molecular_id.input.nistMSI", "qualname": "ReadNistMSI.__init__", "kind": "function", "doc": "

    This constructor should always be called with keyword arguments. Arguments are:

    \n\n

    group should be None; reserved for future extension when a ThreadGroup\nclass is implemented.

    \n\n

    target is the callable object to be invoked by the run()\nmethod. Defaults to None, meaning nothing is called.

    \n\n

    name is the thread name. By default, a unique name is constructed of\nthe form \"Thread-N\" where N is a small decimal number.

    \n\n

    args is the argument tuple for the target invocation. Defaults to ().

    \n\n

    kwargs is a dictionary of keyword arguments for the target\ninvocation. Defaults to {}.

    \n\n

    If a subclass overrides the constructor, it must make sure to invoke\nthe base class constructor (Thread.__init__()) before doing anything\nelse to the thread.

    \n", "signature": "(file_path, url='sqlite://')"}, {"fullname": "corems.molecular_id.input.nistMSI.ReadNistMSI.file_path", "modulename": "corems.molecular_id.input.nistMSI", "qualname": "ReadNistMSI.file_path", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.input.nistMSI.ReadNistMSI.url", "modulename": "corems.molecular_id.input.nistMSI", "qualname": "ReadNistMSI.url", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.input.nistMSI.ReadNistMSI.run", "modulename": "corems.molecular_id.input.nistMSI", "qualname": "ReadNistMSI.run", "kind": "function", "doc": "

    Runs the thread and initializes the SQLite object.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.input.nistMSI.ReadNistMSI.get_sqlLite_obj", "modulename": "corems.molecular_id.input.nistMSI", "qualname": "ReadNistMSI.get_sqlLite_obj", "kind": "function", "doc": "

    Returns the SQLite object.

    \n\n
    Returns
    \n\n
      \n
    • EI_LowRes_SQLite: The SQLite object for storing the compound data.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.input.nistMSI.ReadNistMSI.get_compound_data_dict_list", "modulename": "corems.molecular_id.input.nistMSI", "qualname": "ReadNistMSI.get_compound_data_dict_list", "kind": "function", "doc": "

    Parses the NIST MSI file and returns a list of compound data dictionaries.

    \n\n
    Returns
    \n\n
      \n
    • list: A list of compound data dictionaries.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search", "modulename": "corems.molecular_id.search", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.compoundSearch", "modulename": "corems.molecular_id.search.compoundSearch", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.compoundSearch.LowResMassSpectralMatch", "modulename": "corems.molecular_id.search.compoundSearch", "qualname": "LowResMassSpectralMatch", "kind": "class", "doc": "

    A class representing a low-resolution mass spectral match.

    \n\n
    Parameters
    \n\n
      \n
    • gcms_obj (object):\nThe GC-MS object.
    • \n
    • sql_obj (object, optional):\nThe SQL object for database operations. Default is None.
    • \n
    • calibration (bool, optional):\nFlag indicating if the match is for calibration. Default is False.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • gcms_obj (object):\nThe GC-MS object.
    • \n
    • sql_obj (object):\nThe SQL object for database operations.
    • \n
    • calibration (bool):\nFlag indicating if the match is for calibration.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • metabolite_detector_score(gc_peak, ref_obj, spectral_simi).\nCalculates the spectral similarity scores and the similarity score for a given GC peak and reference object.
    • \n
    • run().\nRuns the low-resolution mass spectral match.
    • \n
    \n", "bases": "threading.Thread"}, {"fullname": "corems.molecular_id.search.compoundSearch.LowResMassSpectralMatch.__init__", "modulename": "corems.molecular_id.search.compoundSearch", "qualname": "LowResMassSpectralMatch.__init__", "kind": "function", "doc": "

    This constructor should always be called with keyword arguments. Arguments are:

    \n\n

    group should be None; reserved for future extension when a ThreadGroup\nclass is implemented.

    \n\n

    target is the callable object to be invoked by the run()\nmethod. Defaults to None, meaning nothing is called.

    \n\n

    name is the thread name. By default, a unique name is constructed of\nthe form \"Thread-N\" where N is a small decimal number.

    \n\n

    args is the argument tuple for the target invocation. Defaults to ().

    \n\n

    kwargs is a dictionary of keyword arguments for the target\ninvocation. Defaults to {}.

    \n\n

    If a subclass overrides the constructor, it must make sure to invoke\nthe base class constructor (Thread.__init__()) before doing anything\nelse to the thread.

    \n", "signature": "(gcms_obj, sql_obj=None, calibration=False)"}, {"fullname": "corems.molecular_id.search.compoundSearch.LowResMassSpectralMatch.gcms_obj", "modulename": "corems.molecular_id.search.compoundSearch", "qualname": "LowResMassSpectralMatch.gcms_obj", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.compoundSearch.LowResMassSpectralMatch.calibration", "modulename": "corems.molecular_id.search.compoundSearch", "qualname": "LowResMassSpectralMatch.calibration", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.compoundSearch.LowResMassSpectralMatch.metabolite_detector_score", "modulename": "corems.molecular_id.search.compoundSearch", "qualname": "LowResMassSpectralMatch.metabolite_detector_score", "kind": "function", "doc": "

    Calculates the spectral similarity scores and the similarity score for a given GC peak and reference object.

    \n\n
    Parameters
    \n\n
      \n
    • gc_peak (object):\nThe GC peak object.
    • \n
    • ref_obj (object):\nThe reference object.
    • \n
    • spectral_simi (object):\nThe spectral similarity object.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • tuple: A tuple containing the spectral similarity scores, RI score, and similarity score.
    • \n
    \n", "signature": "(self, gc_peak, ref_obj, spectral_simi):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.compoundSearch.LowResMassSpectralMatch.run", "modulename": "corems.molecular_id.search.compoundSearch", "qualname": "LowResMassSpectralMatch.run", "kind": "function", "doc": "

    Runs the low-resolution mass spectral match.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.findOxygenPeaks", "modulename": "corems.molecular_id.search.findOxygenPeaks", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.findOxygenPeaks.FindOxygenPeaks", "modulename": "corems.molecular_id.search.findOxygenPeaks", "qualname": "FindOxygenPeaks", "kind": "class", "doc": "

    Class to find Oxygen peaks in a mass spectrum for formula assignment search

    \n\n

    Class to walk 14Da units over oxygen space for negative ion mass spectrum of natural organic matter\nReturns a list of MSPeak class containing the possible Molecular Formula class objects.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum_obj (MassSpec class):\nThis is where we store MassSpec class obj,
    • \n
    • lookupTableSettings (MolecularLookupTableSettings class):\nThis is where we store MolecularLookupTableSettings class obj
    • \n
    • min_O , max_O (int):\nminium and maximum of Oxygen to allow the software to look for\nit will override the settings at lookupTableSettings.usedAtoms\ndefault min = 1, max = 22
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • mass_spectrum_obj (MassSpec class):\nThis is where we store MassSpec class obj,
    • \n
    • lookupTableSettings (MolecularLookupTableSettings class):\nThis is where we store MolecularLookupTableSettings class obj
    • \n
    \n\n
    Methods
    \n\n
      \n
    • run().\nwill be called when the instantiated class method start is called
    • \n
    • get_list_found_peaks().\nreturns a list of MSpeaks classes cotaining all the MolecularFormula candidates inside the MSPeak\nfor more details of the structure see MSPeak class and MolecularFormula class
    • \n
    • set_mass_spec_indexes_by_found_peaks().\nset the mass spectrum to interate over only the selected indexes
    • \n
    \n", "bases": "threading.Thread"}, {"fullname": "corems.molecular_id.search.findOxygenPeaks.FindOxygenPeaks.__init__", "modulename": "corems.molecular_id.search.findOxygenPeaks", "qualname": "FindOxygenPeaks.__init__", "kind": "function", "doc": "

    This constructor should always be called with keyword arguments. Arguments are:

    \n\n

    group should be None; reserved for future extension when a ThreadGroup\nclass is implemented.

    \n\n

    target is the callable object to be invoked by the run()\nmethod. Defaults to None, meaning nothing is called.

    \n\n

    name is the thread name. By default, a unique name is constructed of\nthe form \"Thread-N\" where N is a small decimal number.

    \n\n

    args is the argument tuple for the target invocation. Defaults to ().

    \n\n

    kwargs is a dictionary of keyword arguments for the target\ninvocation. Defaults to {}.

    \n\n

    If a subclass overrides the constructor, it must make sure to invoke\nthe base class constructor (Thread.__init__()) before doing anything\nelse to the thread.

    \n", "signature": "(\tmass_spectrum_obj,\tsql_db: bool = False,\tmin_O: int = 1,\tmax_O: int = 22)"}, {"fullname": "corems.molecular_id.search.findOxygenPeaks.FindOxygenPeaks.mass_spectrum_obj", "modulename": "corems.molecular_id.search.findOxygenPeaks", "qualname": "FindOxygenPeaks.mass_spectrum_obj", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.findOxygenPeaks.FindOxygenPeaks.min_0", "modulename": "corems.molecular_id.search.findOxygenPeaks", "qualname": "FindOxygenPeaks.min_0", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.findOxygenPeaks.FindOxygenPeaks.max_O", "modulename": "corems.molecular_id.search.findOxygenPeaks", "qualname": "FindOxygenPeaks.max_O", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.findOxygenPeaks.FindOxygenPeaks.run", "modulename": "corems.molecular_id.search.findOxygenPeaks", "qualname": "FindOxygenPeaks.run", "kind": "function", "doc": "

    Run the thread

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.findOxygenPeaks.FindOxygenPeaks.find_most_abundant_formula", "modulename": "corems.molecular_id.search.findOxygenPeaks", "qualname": "FindOxygenPeaks.find_most_abundant_formula", "kind": "function", "doc": "

    Find the most abundant formula in the mass spectrum

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum_obj (MassSpec class):\nMass spectrum object
    • \n
    \n\n
    Returns
    \n\n
      \n
    • MolecularFormula class obj: most abundant MolecularFormula with the lowest mass error
    • \n
    \n", "signature": "(self, mass_spectrum_obj):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.findOxygenPeaks.FindOxygenPeaks.find_most_abundant_formula_test", "modulename": "corems.molecular_id.search.findOxygenPeaks", "qualname": "FindOxygenPeaks.find_most_abundant_formula_test", "kind": "function", "doc": "

    [Test function] Find the most abundant formula in the mass spectrum

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum_obj (MassSpec class):\nMass spectrum object
    • \n
    • settings (MolecularSearchSettings class):\nMolecular search settings object
    • \n
    \n\n
    Returns
    \n\n
      \n
    • MolecularFormula class obj: most abundant MolecularFormula with the lowest mass error
    • \n
    \n", "signature": "(self, mass_spectrum_obj, settings):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.findOxygenPeaks.FindOxygenPeaks.find_series_mspeaks", "modulename": "corems.molecular_id.search.findOxygenPeaks", "qualname": "FindOxygenPeaks.find_series_mspeaks", "kind": "function", "doc": "

    Find a series of abundant peaks in the mass spectrum for a given molecular formula

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum_obj (MassSpec class):\nMass spectrum object
    • \n
    • molecular_formula_obj_reference (MolecularFormula class):\nMolecular formula object
    • \n
    • deltamz (float):\ndelta m/z to look for peaks
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: list of MSpeak class objects
    • \n
    \n", "signature": "(self, mass_spectrum_obj, molecular_formula_obj_reference, deltamz=14):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.findOxygenPeaks.FindOxygenPeaks.get_list_found_peaks", "modulename": "corems.molecular_id.search.findOxygenPeaks", "qualname": "FindOxygenPeaks.get_list_found_peaks", "kind": "function", "doc": "

    Get the list of found peaks

    \n\n
    Returns
    \n\n
      \n
    • list: list of MSpeak class objects
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.findOxygenPeaks.FindOxygenPeaks.set_mass_spec_indexes_by_found_peaks", "modulename": "corems.molecular_id.search.findOxygenPeaks", "qualname": "FindOxygenPeaks.set_mass_spec_indexes_by_found_peaks", "kind": "function", "doc": "

    Set the mass spectrum to interate over only the selected indexes.

    \n\n
    Notes
    \n\n

    Warning!!!!\nset the mass spectrum to interate over only the selected indexes\ndon not forget to call mass_spectrum_obj.reset_indexes after the job is done

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.last_error", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "last_error", "kind": "variable", "doc": "

    \n", "default_value": "0"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.last_dif", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "last_dif", "kind": "variable", "doc": "

    \n", "default_value": "0"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.closest_error", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "closest_error", "kind": "variable", "doc": "

    \n", "default_value": "0"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.error_average", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "error_average", "kind": "variable", "doc": "

    \n", "default_value": "0"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.nbValues", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "nbValues", "kind": "variable", "doc": "

    \n", "default_value": "0"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulas", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulas", "kind": "class", "doc": "

    Class for searching molecular formulas in a mass spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum_obj (MassSpectrum):\nThe mass spectrum object.
    • \n
    • sql_db (MolForm_SQL, optional):\nThe SQL database object, by default None.
    • \n
    • first_hit (bool, optional):\nFlag to indicate whether to skip peaks that already have a molecular formula assigned, by default False.
    • \n
    • find_isotopologues (bool, optional):\nFlag to indicate whether to find isotopologues, by default True.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • mass_spectrum_obj (MassSpectrum):\nThe mass spectrum object.
    • \n
    • sql_db (MolForm_SQL):\nThe SQL database object.
    • \n
    • first_hit (bool):\nFlag to indicate whether to skip peaks that already have a molecular formula assigned.
    • \n
    • find_isotopologues (bool):\nFlag to indicate whether to find isotopologues.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • run_search().\nRun the molecular formula search.
    • \n
    • run_worker_mass_spectrum().\nRun the molecular formula search on the mass spectrum object.
    • \n
    • run_worker_ms_peaks().\nRun the molecular formula search on the given list of mass spectrum peaks.
    • \n
    • database_to_dict().\nConvert the database results to a dictionary.
    • \n
    • run_molecular_formula().\nRun the molecular formula search on the given list of mass spectrum peaks.
    • \n
    • search_mol_formulas().\nSearch for molecular formulas in the mass spectrum.
    • \n
    \n"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulas.__init__", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulas.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tmass_spectrum_obj,\tsql_db=None,\tfirst_hit: bool = False,\tfind_isotopologues: bool = True)"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulas.first_hit", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulas.first_hit", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulas.find_isotopologues", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulas.find_isotopologues", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulas.mass_spectrum_obj", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulas.mass_spectrum_obj", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulas.run_search", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulas.run_search", "kind": "function", "doc": "

    Run the molecular formula search.

    \n\n
    Parameters
    \n\n
      \n
    • mspeaks (list of MSPeak):\nThe list of mass spectrum peaks.
    • \n
    • query (dict):\nThe query dictionary containing the possible molecular formulas.
    • \n
    • min_abundance (float):\nThe minimum abundance threshold.
    • \n
    • ion_type (str):\nThe ion type.
    • \n
    • ion_charge (int):\nThe ion charge.
    • \n
    • adduct_atom (str, optional):\nThe adduct atom, by default None.
    • \n
    \n", "signature": "(\tself,\tmspeaks: list,\tquery: dict,\tmin_abundance: float,\tion_type: str,\tion_charge: int,\tadduct_atom=None):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulas.run_worker_mass_spectrum", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulas.run_worker_mass_spectrum", "kind": "function", "doc": "

    Run the molecular formula search on the mass spectrum object.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulas.run_worker_ms_peaks", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulas.run_worker_ms_peaks", "kind": "function", "doc": "

    Run the molecular formula search on the given list of mass spectrum peaks.

    \n\n
    Parameters
    \n\n
      \n
    • ms_peaks (list of MSPeak):\nThe list of mass spectrum peaks.
    • \n
    \n", "signature": "(self, ms_peaks):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulas.database_to_dict", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulas.database_to_dict", "kind": "function", "doc": "

    Convert the database results to a dictionary.

    \n\n
    Parameters
    \n\n
      \n
    • classe_str_list (list):\nThe list of class strings.
    • \n
    • nominal_mzs (list):\nThe list of nominal m/z values.
    • \n
    • mf_search_settings (MolecularFormulaSearchSettings):\nThe molecular formula search settings.
    • \n
    • ion_charge (int):\nThe ion charge.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: The dictionary containing the database results.
    • \n
    \n", "signature": "(classe_str_list, nominal_mzs, mf_search_settings, ion_charge):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulas.run_molecular_formula", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulas.run_molecular_formula", "kind": "function", "doc": "

    Run the molecular formula search on the given list of mass spectrum peaks.

    \n\n
    Parameters
    \n\n
      \n
    • ms_peaks (list of MSPeak):\nThe list of mass spectrum peaks.
    • \n
    \n", "signature": "(*args, **kw):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulas.search_mol_formulas", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulas.search_mol_formulas", "kind": "function", "doc": "

    Search for molecular formulas in the mass spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • possible_formulas_list (list of MolecularFormula):\nThe list of possible molecular formulas.
    • \n
    • ion_type (str):\nThe ion type.
    • \n
    • neutral_molform (bool, optional):\nFlag to indicate whether the molecular formulas are neutral, by default True.
    • \n
    • find_isotopologues (bool, optional):\nFlag to indicate whether to find isotopologues, by default True.
    • \n
    • adduct_atom (str, optional):\nThe adduct atom, by default None.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list of MSPeak: The list of mass spectrum peaks with assigned molecular formulas.
    • \n
    \n", "signature": "(\tself,\tpossible_formulas_list: List[corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormula],\tion_type: str,\tneutral_molform=True,\tfind_isotopologues=True,\tadduct_atom=None) -> List[corems.ms_peak.factory.MSPeakClasses._MSPeak]:", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulaWorker", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulaWorker", "kind": "class", "doc": "

    Class for searching molecular formulas in a mass spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • find_isotopologues (bool, optional):\nFlag to indicate whether to find isotopologues, by default True.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • find_isotopologues (bool):\nFlag to indicate whether to find isotopologues.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • reset_error().\nReset the error variables.
    • \n
    • set_last_error().\nSet the last error.
    • \n
    • find_formulas().\nFind the formulas.
    • \n
    • calc_error().\nCalculate the error.
    • \n
    \n"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulaWorker.__init__", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulaWorker.__init__", "kind": "function", "doc": "

    \n", "signature": "(find_isotopologues=True)"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulaWorker.find_isotopologues", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulaWorker.find_isotopologues", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulaWorker.reset_error", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulaWorker.reset_error", "kind": "function", "doc": "

    Reset the error variables.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum_obj (MassSpectrum):\nThe mass spectrum object.
    • \n
    \n", "signature": "(self, mass_spectrum_obj):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulaWorker.set_last_error", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulaWorker.set_last_error", "kind": "function", "doc": "

    Set the last error.

    \n\n
    Parameters
    \n\n
      \n
    • error (float):\nThe error.
    • \n
    • mass_spectrum_obj (MassSpectrum):\nThe mass spectrum object.
    • \n
    \n", "signature": "(self, error, mass_spectrum_obj):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulaWorker.calc_error", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulaWorker.calc_error", "kind": "function", "doc": "

    Calculate the error.

    \n\n
    Parameters
    \n\n
      \n
    • mz_exp (float):\nThe experimental m/z value.
    • \n
    • mz_calc (float):\nThe calculated m/z value.
    • \n
    • method (str, optional):\nThe method, by default 'ppm'.
    • \n
    \n\n
    Raises
    \n\n
      \n
    • Exception: If the method is not ppm or ppb.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: The error.
    • \n
    \n", "signature": "(mz_exp, mz_calc, method='ppm'):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulaWorker.find_formulas", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulaWorker.find_formulas", "kind": "function", "doc": "

    Find the formulas.

    \n\n
    Parameters
    \n\n
      \n
    • formulas (list of MolecularFormula):\nThe list of molecular formulas.
    • \n
    • min_abundance (float):\nThe minimum abundance threshold.
    • \n
    • mass_spectrum_obj (MassSpectrum):\nThe mass spectrum object.
    • \n
    • ms_peak (MSPeak):\nThe mass spectrum peak.
    • \n
    • ion_type (str):\nThe ion type.
    • \n
    • ion_charge (int):\nThe ion charge.
    • \n
    • adduct_atom (str, optional):\nThe adduct atom, by default None.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list of MSPeak: The list of mass spectrum peaks with assigned molecular formulas.
    • \n
    \n\n
    Notes
    \n\n

    Uses the closest error the next search (this is not ideal, it needs to use confidence \nmetric to choose the right candidate then propagate the error using the error from the best candidate).\nIt needs to add s/n to the equation.\nIt need optimization to define the mz_error_range within a m/z unit since it is directly proportional \nwith the mass, and inversely proportional to the rp. It's not linear, i.e., sigma mass.\nThe idea it to correlate sigma to resolving power, signal to noise and sample complexity per mz unit.\nMethod='distance'

    \n", "signature": "(\tself,\tformulas,\tmin_abundance,\tmass_spectrum_obj,\tms_peak,\tion_type,\tion_charge,\tadduct_atom=None):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulasLC", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulasLC", "kind": "class", "doc": "

    Class for searching molecular formulas in a LC object.

    \n\n
    Parameters
    \n\n
      \n
    • lcms_obj (LC):\nThe LC object.
    • \n
    • sql_db (MolForm_SQL, optional):\nThe SQL database object, by default None.
    • \n
    • first_hit (bool, optional):\nFlag to indicate whether to skip peaks that already have a molecular formula assigned, by default False.
    • \n
    • find_isotopologues (bool, optional):\nFlag to indicate whether to find isotopologues, by default True.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • run_untargeted_worker_ms1().\nRun untargeted molecular formula search on the ms1 mass spectrum.
    • \n
    • run_target_worker_ms1().\nRun targeted molecular formula search on the ms1 mass spectrum.
    • \n
    \n", "bases": "SearchMolecularFormulas"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulasLC.__init__", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulasLC.__init__", "kind": "function", "doc": "

    \n", "signature": "(lcms_obj, sql_db=None, first_hit=False, find_isotopologues=True)"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulasLC.first_hit", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulasLC.first_hit", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulasLC.find_isotopologues", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulasLC.find_isotopologues", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulasLC.lcms_obj", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulasLC.lcms_obj", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulasLC.run_untargeted_worker_ms1", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulasLC.run_untargeted_worker_ms1", "kind": "function", "doc": "

    Run untargeted molecular formula search on the ms1 mass spectrum.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulasLC.run_target_worker_ms1", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulasLC.run_target_worker_ms1", "kind": "function", "doc": "

    Run targeted molecular formula search on the ms1 mass spectrum.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.priorityAssignment", "modulename": "corems.molecular_id.search.priorityAssignment", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.priorityAssignment.OxygenPriorityAssignment", "modulename": "corems.molecular_id.search.priorityAssignment", "qualname": "OxygenPriorityAssignment", "kind": "class", "doc": "

    A class for assigning priority to oxygen classes in a molecular search.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum_obj (MassSpectrum):\nThe mass spectrum object.
    • \n
    • sql_db (bool, optional):\nWhether to use an SQL database. The default is False.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • mass_spectrum_obj (MassSpectrum):\nThe mass spectrum object.
    • \n
    • sql_db (MolForm_SQL):\nThe SQL database object.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • run().\nRun the priority assignment process.
    • \n
    • create_data_base().\nCreate the molecular database for the specified heteroatomic classes.
    • \n
    • run_worker_mass_spectrum(assign_classes_order_tuples).\nRun the molecular formula search for each class in the specified order.
    • \n
    • get_dict_molecular_database(classe_str_list).\nGet the molecular database as a dictionary.
    • \n
    • ox_classes_and_peaks_in_order_().\nGet the oxygen classes and associated peaks in order.
    • \n
    • get_classes_in_order(dict_ox_class_and_ms_peak)
      \nGet the classes in order.
    • \n
    \n", "bases": "threading.Thread"}, {"fullname": "corems.molecular_id.search.priorityAssignment.OxygenPriorityAssignment.__init__", "modulename": "corems.molecular_id.search.priorityAssignment", "qualname": "OxygenPriorityAssignment.__init__", "kind": "function", "doc": "

    This constructor should always be called with keyword arguments. Arguments are:

    \n\n

    group should be None; reserved for future extension when a ThreadGroup\nclass is implemented.

    \n\n

    target is the callable object to be invoked by the run()\nmethod. Defaults to None, meaning nothing is called.

    \n\n

    name is the thread name. By default, a unique name is constructed of\nthe form \"Thread-N\" where N is a small decimal number.

    \n\n

    args is the argument tuple for the target invocation. Defaults to ().

    \n\n

    kwargs is a dictionary of keyword arguments for the target\ninvocation. Defaults to {}.

    \n\n

    If a subclass overrides the constructor, it must make sure to invoke\nthe base class constructor (Thread.__init__()) before doing anything\nelse to the thread.

    \n", "signature": "(mass_spectrum_obj, sql_db=False)"}, {"fullname": "corems.molecular_id.search.priorityAssignment.OxygenPriorityAssignment.mass_spectrum_obj", "modulename": "corems.molecular_id.search.priorityAssignment", "qualname": "OxygenPriorityAssignment.mass_spectrum_obj", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.priorityAssignment.OxygenPriorityAssignment.run", "modulename": "corems.molecular_id.search.priorityAssignment", "qualname": "OxygenPriorityAssignment.run", "kind": "function", "doc": "

    Run the priority assignment process.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.priorityAssignment.OxygenPriorityAssignment.create_data_base", "modulename": "corems.molecular_id.search.priorityAssignment", "qualname": "OxygenPriorityAssignment.create_data_base", "kind": "function", "doc": "

    Create the molecular database for the specified heteroatomic classes.

    \n\n
    Returns
    \n\n
      \n
    • assign_classes_order_str_dict_tuple_ (list):\nA list of tuples containing the class names and dictionaries of class attributes.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.priorityAssignment.OxygenPriorityAssignment.run_worker_mass_spectrum", "modulename": "corems.molecular_id.search.priorityAssignment", "qualname": "OxygenPriorityAssignment.run_worker_mass_spectrum", "kind": "function", "doc": "

    Run the molecular formula search for each class in the specified order.

    \n\n
    Parameters
    \n\n
      \n
    • assign_classes_order_tuples (list):\nA list of tuples containing the class names and dictionaries of class attributes.
    • \n
    \n", "signature": "(self, assign_classes_order_tuples):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.priorityAssignment.OxygenPriorityAssignment.get_dict_molecular_database", "modulename": "corems.molecular_id.search.priorityAssignment", "qualname": "OxygenPriorityAssignment.get_dict_molecular_database", "kind": "function", "doc": "

    Get the molecular database as a dictionary.

    \n\n
    Parameters
    \n\n
      \n
    • classe_str_list (list):\nA list of class names.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: A dictionary containing the molecular database.
    • \n
    \n", "signature": "(self, classe_str_list):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.priorityAssignment.OxygenPriorityAssignment.ox_classes_and_peaks_in_order_", "modulename": "corems.molecular_id.search.priorityAssignment", "qualname": "OxygenPriorityAssignment.ox_classes_and_peaks_in_order_", "kind": "function", "doc": "

    Get the oxygen classes and associated peaks in order.

    \n\n
    Returns
    \n\n
      \n
    • dict: A dictionary containing the oxygen classes and associated peaks.
    • \n
    \n", "signature": "(self) -> dict:", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.priorityAssignment.OxygenPriorityAssignment.get_classes_in_order", "modulename": "corems.molecular_id.search.priorityAssignment", "qualname": "OxygenPriorityAssignment.get_classes_in_order", "kind": "function", "doc": "

    Get the classes in order.

    \n\n
    Parameters
    \n\n
      \n
    • dict_ox_class_and_ms_peak (dict):\nA dictionary containing the oxygen classes and associated peaks.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: A list of tuples containing the class names and dictionaries of class attributes.
    • \n
    \n\n
    Notes
    \n\n

    structure is \n ('HC', {'HC': 1})

    \n", "signature": "(self, dict_ox_class_and_ms_peak) -> [(<class 'str'>, <class 'dict'>)]:", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.priorityAssignment.OxygenPriorityAssignment.get_class_strings_dict", "modulename": "corems.molecular_id.search.priorityAssignment", "qualname": "OxygenPriorityAssignment.get_class_strings_dict", "kind": "function", "doc": "

    Get the class strings and dictionaries.

    \n\n
    Parameters
    \n\n
      \n
    • all_atoms_tuples (tuple):\nA tuple containing the atoms.
    • \n
    • atoms_in_order (list):\nA list of atoms in order.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: A list of tuples containing the class strings and dictionaries.
    • \n
    \n", "signature": "(all_atoms_tuples, atoms_in_order) -> [(<class 'str'>, <class 'dict'>)]:", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.priorityAssignment.OxygenPriorityAssignment.combine_ox_class_with_other", "modulename": "corems.molecular_id.search.priorityAssignment", "qualname": "OxygenPriorityAssignment.combine_ox_class_with_other", "kind": "function", "doc": "

    Combine the oxygen classes with other classes.

    \n\n
    Parameters
    \n\n
      \n
    • atoms_in_order (list):\nA list of atoms in order.
    • \n
    • classes_strings_dict_tuples (list):

    • \n
    • dict_ox_class_and_ms_peak (dict):\nA dictionary containing the oxygen classes and associated peaks.

    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: A list of dictionaries.
    • \n
    \n", "signature": "(\tatoms_in_order,\tclasses_strings_dict_tuples,\tdict_ox_class_and_ms_peak) -> [<class 'dict'>]:", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.priorityAssignment.OxygenPriorityAssignment.sort_classes", "modulename": "corems.molecular_id.search.priorityAssignment", "qualname": "OxygenPriorityAssignment.sort_classes", "kind": "function", "doc": "

    Sort the classes.

    \n\n
    Parameters
    \n\n
      \n
    • atoms_in_order (list):\nA list of atoms in order.
    • \n
    • combination_tuples (list):
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: A list of tuples containing the class strings and dictionaries.
    • \n
    \n", "signature": "(atoms_in_order, combination_tuples) -> [(<class 'str'>, <class 'dict'>)]:", "funcdef": "def"}, {"fullname": "corems.ms_peak", "modulename": "corems.ms_peak", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.ms_peak.calc", "modulename": "corems.ms_peak.calc", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc", "modulename": "corems.ms_peak.calc.MSPeakCalc", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation", "kind": "class", "doc": "

    Class to perform calculations on MSPeak objects.

    \n\n

    This class provides methods to perform various calculations on MSPeak objects, such as calculating Kendrick Mass Defect (KMD) and Kendrick Mass (KM), calculating peak area, and fitting peak lineshape using different models.

    \n\n
    Parameters
    \n\n
      \n
    • None
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • _ms_parent (MSParent):\nThe parent MSParent object associated with the MSPeakCalculation object.
    • \n
    • mz_exp (float):\nThe experimental m/z value of the peak.
    • \n
    • start_scan (int):\nThe start scan index of the peak.
    • \n
    • final_scan (int):\nThe final scan index of the peak.
    • \n
    • resolving_power (float):\nThe resolving power of the peak.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • _calc_kmd(dict_base).\nCalculate the Kendrick Mass Defect (KMD) and Kendrick Mass (KM) for a given base formula.
    • \n
    • calc_area().\nCalculate the peak area using numpy's trapezoidal fit.
    • \n
    • fit_peak(mz_extend=6, delta_rp=0, model='Gaussian').\nPerform lineshape analysis on a peak using lmfit module.
    • \n
    • voigt_pso(w, r, yoff, width, loc, a).\nCalculate the Voigt function for particle swarm optimization (PSO) fitting.
    • \n
    • objective_pso(x, w, u).\nCalculate the objective function for PSO fitting.
    • \n
    • minimize_pso(lower, upper, w, u).\nMinimize the objective function using the particle swarm optimization algorithm.
    • \n
    • fit_peak_pso(mz_extend=6, upsample_multiplier=5).\nPerform lineshape analysis on a peak using particle swarm optimization (PSO) fitting.
    • \n
    • voigt(oversample_multiplier=1, delta_rp=0, mz_overlay=1).\n[Legacy] Perform voigt lineshape analysis on a peak.
    • \n
    • pseudovoigt(oversample_multiplier=1, delta_rp=0, mz_overlay=1, fraction=0.5).\n[Legacy] Perform pseudovoigt lineshape analysis on a peak.
    • \n
    • lorentz(oversample_multiplier=1, delta_rp=0, mz_overlay=1).\n[Legacy] Perform lorentz lineshape analysis on a peak.
    • \n
    • gaussian(oversample_multiplier=1, delta_rp=0, mz_overlay=1).\n[Legacy] Perform gaussian lineshape analysis on a peak.
    • \n
    • get_mz_domain(oversample_multiplier, mz_overlay).\n[Legacy] Resample/interpolate datapoints for lineshape analysis.
    • \n
    • number_possible_assignments().\nReturn the number of possible molecular formula assignments for the peak.
    • \n
    • molecular_formula_lowest_error().\nReturn the molecular formula with the smallest absolute mz error.
    • \n
    • molecular_formula_highest_prob_score().\nReturn the molecular formula with the highest confidence score.
    • \n
    • molecular_formula_earth_filter(lowest_error=True).\nFilter molecular formula using the 'Earth' filter.
    • \n
    • molecular_formula_water_filter(lowest_error=True).\nFilter molecular formula using the 'Water' filter.
    • \n
    • molecular_formula_air_filter(lowest_error=True).\nFilter molecular formula using the 'Air' filter.
    • \n
    • cia_score_S_P_error().\nCompound Identification Algorithm SP Error - Assignment Filter.
    • \n
    • cia_score_N_S_P_error().\nCompound Identification Algorithm NSP Error - Assignment Filter.
    • \n
    \n"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.calc_area", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.calc_area", "kind": "function", "doc": "

    Calculate the peak area using numpy's trapezoidal fit

    \n\n

    uses provided mz_domain to accurately integrate areas independent of digital resolution

    \n\n
    Returns
    \n\n
      \n
    • float: peak area
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.fit_peak", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.fit_peak", "kind": "function", "doc": "

    Lineshape analysis on a peak using lmfit module.

    \n\n

    Model and fit peak lineshape by defined function - using lmfit module\nDoes not oversample/resample/interpolate data points \nBetter to go back to time domain and perform more zero filling - if possible.

    \n\n
    Parameters
    \n\n
      \n
    • mz_extend (int):\nextra points left and right of peak definition to include in fitting
    • \n
    • delta_rp (float):\ndelta resolving power to add to resolving power
    • \n
    • model (str):\nType of lineshape model to use.\nModels allowed: Gaussian, Lorentz, Voigt
    • \n
    \n\n
    Returns
    \n\n
      \n
    • mz_domain (ndarray):\nx-axis domain for fit
    • \n
    • fit_peak (lmfit object):\nfit results object from lmfit module
    • \n
    \n\n
    Notes
    \n\n

    Returns the calculated mz domain, initial defined abundance profile, and the fit peak results object from lmfit module\nmz_extend here extends the x-axis domain so that we have sufficient points either side of the apex to fit.\nTakes about 10ms per peak

    \n", "signature": "(self, mz_extend=6, delta_rp=0, model='Gaussian'):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.voigt_pso", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.voigt_pso", "kind": "function", "doc": "

    Voigt function for particle swarm optimisation (PSO) fitting

    \n\n

    From https://github.com/pnnl/nmrfit/blob/master/nmrfit/equations.py.\nCalculates a Voigt function over w based on the relevant properties of the distribution.

    \n\n
    Parameters
    \n\n
      \n
    • w (ndarray):\nArray over which the Voigt function will be evaluated.
    • \n
    • r (float):\nRatio between the Guassian and Lorentzian functions.
    • \n
    • yoff (float):\nY-offset of the Voigt function.
    • \n
    • width (float):\nThe width of the Voigt function.
    • \n
    • loc (float):\nCenter of the Voigt function.
    • \n
    • a (float):\nArea of the Voigt function.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • V (ndarray):\nArray defining the Voigt function over w.
    • \n
    \n\n
    References
    \n\n
      \n
    1. https://github.com/pnnl/nmrfit
    2. \n
    \n\n
    Notes
    \n\n

    Particle swarm optimisation (PSO) fitting function can be significantly more computationally expensive than lmfit, with more parameters to optimise.

    \n", "signature": "(self, w, r, yoff, width, loc, a):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.objective_pso", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.objective_pso", "kind": "function", "doc": "

    Objective function for particle swarm optimisation (PSO) fitting

    \n\n

    The objective function used to fit supplied data. Evaluates sum of squared differences between the fit and the data.

    \n\n
    Parameters
    \n\n
      \n
    • x (list of floats):\nParameter vector.
    • \n
    • w (ndarray):\nArray of frequency data.
    • \n
    • u (ndarray):\nArray of data to be fit.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • rmse (float):\nRoot mean square error between the data and fit.
    • \n
    \n\n
    References
    \n\n
      \n
    1. https://github.com/pnnl/nmrfit
    2. \n
    \n", "signature": "(self, x, w, u):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.minimize_pso", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.minimize_pso", "kind": "function", "doc": "

    Minimization function for particle swarm optimisation (PSO) fitting

    \n\n

    Minimizes the objective function using the particle swarm optimization algorithm.\nMinimization function based on defined parameters

    \n\n
    Parameters
    \n\n
      \n
    • lower (list of floats):\nLower bounds for the parameters.
    • \n
    • upper (list of floats):\nUpper bounds for the parameters.
    • \n
    • w (ndarray):\nArray of frequency data.
    • \n
    • u (ndarray):\nArray of data to be fit.
    • \n
    \n\n
    Notes
    \n\n

    Particle swarm optimisation (PSO) fitting function can be significantly more computationally expensive than lmfit, with more parameters to optimise.\nCurrent parameters take ~2 seconds per peak.

    \n\n
    References
    \n\n
      \n
    1. https://github.com/pnnl/nmrfit
    2. \n
    \n", "signature": "(self, lower, upper, w, u):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.fit_peak_pso", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.fit_peak_pso", "kind": "function", "doc": "

    Lineshape analysis on a peak using particle swarm optimisation (PSO) fitting

    \n\n

    Function to fit a Voigt peakshape using particle swarm optimisation (PSO).\nShould return better results than lmfit, but much more computationally expensive

    \n\n
    Parameters
    \n\n
      \n
    • mz_extend (int, optional):\nextra points left and right of peak definition to include in fitting. Defaults to 6.
    • \n
    • upsample_multiplier (int, optional):\nfactor to increase x-axis points by for simulation of fitted lineshape function. Defaults to 5.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • xopt (array):\nvariables describing the voigt function.\nG/L ratio, width (fwhm), apex (x-axis), area.\ny-axis offset is fixed at 0
    • \n
    • fopt (float):\nobjective score (rmse)
    • \n
    • psfit (array):\nrecalculated y values based on function and optimised fit
    • \n
    • psfit_hdp (tuple of arrays):\n0 - linspace x-axis upsampled grid\n1 - recalculated y values based on function and upsampled x-axis grid\nDoes not change results, but aids in visualisation of the 'true' voigt lineshape
    • \n
    \n\n
    Notes
    \n\n

    Particle swarm optimisation (PSO) fitting function can be significantly more computationally expensive than lmfit, with more parameters to optimise.

    \n", "signature": "(self, mz_extend: int = 6, upsample_multiplier: int = 5):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.voigt", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.voigt", "kind": "function", "doc": "

    [Legacy] Voigt lineshape analysis function\nLegacy function for voigt lineshape analysis

    \n\n
    Parameters
    \n\n
      \n
    • oversample_multiplier (int):\nfactor to increase x-axis points by for simulation of fitted lineshape function
    • \n
    • delta_rp (float):\ndelta resolving power to add to resolving power
    • \n
    • mz_overlay (int):\nextra points left and right of peak definition to include in fitting
    • \n
    \n\n
    Returns
    \n\n
      \n
    • mz_domain (ndarray):\nx-axis domain for fit
    • \n
    • calc_abundance (ndarray):\ncalculated abundance profile based on voigt function
    • \n
    \n", "signature": "(self, oversample_multiplier=1, delta_rp=0, mz_overlay=1):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.pseudovoigt", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.pseudovoigt", "kind": "function", "doc": "

    [Legacy] pseudovoigt lineshape function

    \n\n

    Legacy function for pseudovoigt lineshape analysis. \nNote - Code may not be functional currently.

    \n\n
    Parameters
    \n\n
      \n
    • oversample_multiplier (int, optional):\nfactor to increase x-axis points by for simulation of fitted lineshape function. Defaults to 1.
    • \n
    • delta_rp (float, optional):\ndelta resolving power to add to resolving power. Defaults to 0.
    • \n
    • mz_overlay (int, optional):\nextra points left and right of peak definition to include in fitting. Defaults to 1.
    • \n
    • fraction (float, optional):\nfraction of gaussian component in pseudovoigt function. Defaults to 0.5.
    • \n
    \n", "signature": "(\tself,\toversample_multiplier=1,\tdelta_rp=0,\tmz_overlay=1,\tfraction=0.5):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.lorentz", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.lorentz", "kind": "function", "doc": "

    [Legacy] Lorentz lineshape analysis function

    \n\n

    Legacy function for lorentz lineshape analysis

    \n\n
    Parameters
    \n\n
      \n
    • oversample_multiplier (int):\nfactor to increase x-axis points by for simulation of fitted lineshape function
    • \n
    • delta_rp (float):\ndelta resolving power to add to resolving power
    • \n
    • mz_overlay (int):\nextra points left and right of peak definition to include in fitting
    • \n
    \n\n
    Returns
    \n\n
      \n
    • mz_domain (ndarray):\nx-axis domain for fit
    • \n
    • calc_abundance (ndarray):\ncalculated abundance profile based on lorentz function
    • \n
    \n", "signature": "(self, oversample_multiplier=1, delta_rp=0, mz_overlay=1):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.gaussian", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.gaussian", "kind": "function", "doc": "

    [Legacy] Gaussian lineshape analysis function\nLegacy gaussian lineshape analysis function

    \n\n
    Parameters
    \n\n
      \n
    • oversample_multiplier (int):\nfactor to increase x-axis points by for simulation of fitted lineshape function
    • \n
    • delta_rp (float):\ndelta resolving power to add to resolving power
    • \n
    • mz_overlay (int):\nextra points left and right of peak definition to include in fitting
    • \n
    \n\n
    Returns
    \n\n
      \n
    • mz_domain (ndarray):\nx-axis domain for fit
    • \n
    • calc_abundance (ndarray):\ncalculated abundance profile based on gaussian function
    • \n
    \n", "signature": "(self, oversample_multiplier=1, delta_rp=0, mz_overlay=1):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.get_mz_domain", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.get_mz_domain", "kind": "function", "doc": "

    [Legacy] function to resample/interpolate datapoints for lineshape analysis

    \n\n

    This code is used for the legacy line fitting functions and not recommended.\nLegacy function to support expanding mz domain for legacy lineshape functions

    \n\n
    Parameters
    \n\n
      \n
    • oversample_multiplier (int):\nfactor to increase x-axis points by for simulation of fitted lineshape function
    • \n
    • mz_overlay (int):\nextra points left and right of peak definition to include in fitting
    • \n
    \n\n
    Returns
    \n\n
      \n
    • mz_domain (ndarray):\nx-axis domain for fit
    • \n
    \n", "signature": "(self, oversample_multiplier, mz_overlay):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.number_possible_assignments", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.number_possible_assignments", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.molecular_formula_lowest_error", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.molecular_formula_lowest_error", "kind": "function", "doc": "

    Return the molecular formula with the smallest absolute mz error

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.molecular_formula_highest_prob_score", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.molecular_formula_highest_prob_score", "kind": "function", "doc": "

    Return the molecular formula with the highest confidence score score

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.molecular_formula_earth_filter", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.molecular_formula_earth_filter", "kind": "function", "doc": "

    Filter molecular formula using the 'Earth' filter

    \n\n

    This function applies the Formularity-esque 'Earth' filter to possible molecular formula assignments.\nEarth Filter:\n O > 0 AND N <= 3 AND P <= 2 AND 3P <= O

    \n\n

    If the lowest_error method is also used, it will return the single formula annotation with the smallest absolute error which also fits the Earth filter. \nOtherwise, it will return all Earth-filter compliant formulas.

    \n\n
    Parameters
    \n\n
      \n
    • lowest_error (bool, optional.):\nReturn only the lowest error formula which also fits the Earth filter. \nIf False, return all Earth-filter compliant formulas. Default is True.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: List of molecular formula objects which fit the Earth filter
    • \n
    \n\n
    References
    \n\n
      \n
    1. Nikola Tolic et al., \"Formularity: Software for Automated Formula Assignment of Natural and Other Organic Matter from Ultrahigh-Resolution Mass Spectra\"\nAnal. Chem. 2017, 89, 23, 12659\u201312665\ndoi: 10.1021/acs.analchem.7b03318
    2. \n
    \n", "signature": "(self, lowest_error=True):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.molecular_formula_water_filter", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.molecular_formula_water_filter", "kind": "function", "doc": "

    Filter molecular formula using the 'Water' filter

    \n\n

    This function applies the Formularity-esque 'Water' filter to possible molecular formula assignments.\nWater Filter:\n O > 0 AND N <= 3 AND S <= 2 AND P <= 2

    \n\n

    If the lowest_error method is also used, it will return the single formula annotation with the smallest absolute error which also fits the Water filter.\nOtherwise, it will return all Water-filter compliant formulas.

    \n\n
    Parameters
    \n\n
      \n
    • lowest_error (bool, optional):\nReturn only the lowest error formula which also fits the Water filter.\nIf False, return all Water-filter compliant formulas. Defaults to 2
    • \n
    \n\n
    Returns
    \n\n

    list\n List of molecular formula objects which fit the Water filter

    \n\n
    References
    \n\n
      \n
    1. Nikola Tolic et al., \"Formularity: Software for Automated Formula Assignment of Natural and Other Organic Matter from Ultrahigh-Resolution Mass Spectra\"\nAnal. Chem. 2017, 89, 23, 12659\u201312665\ndoi: 10.1021/acs.analchem.7b03318
    2. \n
    \n", "signature": "(self, lowest_error=True):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.molecular_formula_air_filter", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.molecular_formula_air_filter", "kind": "function", "doc": "

    Filter molecular formula using the 'Air' filter

    \n\n

    This function applies the Formularity-esque 'Air' filter to possible molecular formula assignments.\nAir Filter:\n O > 0 AND N <= 3 AND S <= 1 AND P = 0 AND 3(S+N) <= O

    \n\n

    If the lowest_error method is also used, it will return the single formula annotation with the smallest absolute error which also fits the Air filter.\nOtherwise, it will return all Air-filter compliant formulas.

    \n\n
    Parameters
    \n\n
      \n
    • lowest_error (bool, optional):\nReturn only the lowest error formula which also fits the Air filter.\nIf False, return all Air-filter compliant formulas. Defaults to True.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: List of molecular formula objects which fit the Air filter
    • \n
    \n\n
    References
    \n\n
      \n
    1. Nikola Tolic et al., \"Formularity: Software for Automated Formula Assignment of Natural and Other Organic Matter from Ultrahigh-Resolution Mass Spectra\"\nAnal. Chem. 2017, 89, 23, 12659\u201312665\ndoi: 10.1021/acs.analchem.7b03318
    2. \n
    \n", "signature": "(self, lowest_error=True):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.cia_score_S_P_error", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.cia_score_S_P_error", "kind": "function", "doc": "

    Compound Identification Algorithm SP Error - Assignment Filter

    \n\n

    This function applies the Compound Identification Algorithm (CIA) SP Error filter to possible molecular formula assignments.

    \n\n

    It takes the molecular formula with the lowest S+P count, and returns the formula with the lowest absolute error from this subset.

    \n\n
    Returns
    \n\n
      \n
    • MolecularFormula: A single molecular formula which fits the rules of the CIA SP Error filter
    • \n
    \n\n
    References
    \n\n
      \n
    1. Elizabeth B. Kujawinski and Mark D. Behn, \"Automated Analysis of Electrospray Ionization Fourier Transform Ion Cyclotron Resonance Mass Spectra of Natural Organic Matter\"\nAnal. Chem. 2006, 78, 13, 4363\u20134373\ndoi: 10.1021/ac0600306
    2. \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.cia_score_N_S_P_error", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.cia_score_N_S_P_error", "kind": "function", "doc": "

    Compound Identification Algorithm NSP Error - Assignment Filter

    \n\n

    This function applies the Compound Identification Algorithm (CIA) NSP Error filter to possible molecular formula assignments.

    \n\n

    It takes the molecular formula with the lowest N+S+P count, and returns the formula with the lowest absolute error from this subset.

    \n\n
    Returns
    \n\n
      \n
    • MolecularFormula: A single molecular formula which fits the rules of the CIA NSP Error filter
    • \n
    \n\n
    References
    \n\n
      \n
    1. Elizabeth B. Kujawinski and Mark D. Behn, \"Automated Analysis of Electrospray Ionization Fourier Transform Ion Cyclotron Resonance Mass Spectra of Natural Organic Matter\"\nAnal. Chem. 2006, 78, 13, 4363\u20134373\ndoi: 10.1021/ac0600306
    2. \n
    \n\n
    Raises
    \n\n
      \n
    • Exception: If no molecular formula are associated with mass spectrum peak.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.ms_peak.factory", "modulename": "corems.ms_peak.factory", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.ms_peak.factory.MSPeakClasses", "modulename": "corems.ms_peak.factory.MSPeakClasses", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.ms_peak.factory.MSPeakClasses.ICRMassPeak", "modulename": "corems.ms_peak.factory.MSPeakClasses", "qualname": "ICRMassPeak", "kind": "class", "doc": "

    A class representing a peak in an ICR mass spectrum.

    \n", "bases": "_MSPeak"}, {"fullname": "corems.ms_peak.factory.MSPeakClasses.ICRMassPeak.__init__", "modulename": "corems.ms_peak.factory.MSPeakClasses", "qualname": "ICRMassPeak.__init__", "kind": "function", "doc": "

    \n", "signature": "(*args, ms_parent=None, exp_freq=None)"}, {"fullname": "corems.ms_peak.factory.MSPeakClasses.ICRMassPeak.resolving_power_calc", "modulename": "corems.ms_peak.factory.MSPeakClasses", "qualname": "ICRMassPeak.resolving_power_calc", "kind": "function", "doc": "

    Calculate the theoretical resolving power of the peak.

    \n\n
    Parameters
    \n\n
      \n
    • T (float):\ntransient time
    • \n
    • B (float):\nMagnetic Filed Strength (Tesla)
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Theoretical resolving power of the peak.
    • \n
    \n\n
    References
    \n\n
      \n
    1. Marshall et al. (Mass Spectrom Rev. 1998 Jan-Feb;17(1):1-35.)\nDOI: 10.1002/(SICI)1098-2787(1998)17:1<1::AID-MAS1>3.0.CO;2-K
    2. \n
    \n", "signature": "(self, B, T):", "funcdef": "def"}, {"fullname": "corems.ms_peak.factory.MSPeakClasses.ICRMassPeak.set_calc_resolving_power", "modulename": "corems.ms_peak.factory.MSPeakClasses", "qualname": "ICRMassPeak.set_calc_resolving_power", "kind": "function", "doc": "

    Set the resolving power of the peak to the calculated one.

    \n", "signature": "(self, B: float, T: float):", "funcdef": "def"}, {"fullname": "corems.ms_peak.factory.MSPeakClasses.TOFMassPeak", "modulename": "corems.ms_peak.factory.MSPeakClasses", "qualname": "TOFMassPeak", "kind": "class", "doc": "

    A class representing a peak in a TOF mass spectrum.

    \n", "bases": "_MSPeak"}, {"fullname": "corems.ms_peak.factory.MSPeakClasses.TOFMassPeak.__init__", "modulename": "corems.ms_peak.factory.MSPeakClasses", "qualname": "TOFMassPeak.__init__", "kind": "function", "doc": "

    \n", "signature": "(*args, exp_freq=None)"}, {"fullname": "corems.ms_peak.factory.MSPeakClasses.TOFMassPeak.set_calc_resolving_power", "modulename": "corems.ms_peak.factory.MSPeakClasses", "qualname": "TOFMassPeak.set_calc_resolving_power", "kind": "function", "doc": "

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.ms_peak.factory.MSPeakClasses.OrbiMassPeak", "modulename": "corems.ms_peak.factory.MSPeakClasses", "qualname": "OrbiMassPeak", "kind": "class", "doc": "

    A class representing a peak in an Orbitrap mass spectrum.

    \n", "bases": "_MSPeak"}, {"fullname": "corems.ms_peak.factory.MSPeakClasses.OrbiMassPeak.__init__", "modulename": "corems.ms_peak.factory.MSPeakClasses", "qualname": "OrbiMassPeak.__init__", "kind": "function", "doc": "

    \n", "signature": "(*args, exp_freq=None)"}, {"fullname": "corems.ms_peak.factory.MSPeakClasses.OrbiMassPeak.set_calc_resolving_power", "modulename": "corems.ms_peak.factory.MSPeakClasses", "qualname": "OrbiMassPeak.set_calc_resolving_power", "kind": "function", "doc": "

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.transient", "modulename": "corems.transient", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.transient.calc", "modulename": "corems.transient.calc", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.transient.calc.TransientCalc", "modulename": "corems.transient.calc.TransientCalc", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.transient.calc.TransientCalc.TransientCalculations", "modulename": "corems.transient.calc.TransientCalc", "qualname": "TransientCalculations", "kind": "class", "doc": "

    Transient Calculations

    \n\n
    Parameters
    \n\n
      \n
    • parameters (corems.transient.parameters.TransientParameters):\nThe transient parameters
    • \n
    • bandwidth (float):\nThe bandwidth of the transient (Hz)
    • \n
    • number_data_points (int):\nThe number of data points of the transient
    • \n
    • exc_low_freq (float):\nThe low frequency of the excitation (Hz)
    • \n
    • exc_high_freq (float):\nThe high frequency of the excitation (Hz)
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • parameters (corems.transient.parameters.TransientParameters):\nThe transient parameters
    • \n
    • bandwidth (float):\nThe bandwidth of the transient (Hz)
    • \n
    • number_data_points (int):\nThe number of data points of the transient
    • \n
    • exc_low_freq (float):\nThe low frequency of the excitation (Hz)
    • \n
    • exc_high_freq (float):\nThe high frequency of the excitation (Hz)
    • \n
    \n\n
    Methods
    \n\n
      \n
    • cal_transient_time().\nCalculate the time domain length of the transient
    • \n
    • zero_fill(transient).\nZero fill the transient
    • \n
    • truncation(transient).\nTruncate the transient
    • \n
    • apodization(transient).
      \nApodization of the transient
    • \n
    • calculate_frequency_domain(number_data_points).\nCalculate the frequency domain (axis) of the transient
    • \n
    • cut_freq_domain(freqdomain_X, freqdomain_Y).\nCut the frequency domain of the transient
    • \n
    • phase_and_absorption_mode_ft().\n[Not Functional] Produce a phased absorption mode FT spectrum
    • \n
    • magnitude_mode_ft(transient).\nPerform magnitude mode FT of the transient
    • \n
    • correct_dc_offset().\n[Not Yet Implemented] Correct the DC offset of the transient
    • \n
    \n"}, {"fullname": "corems.transient.calc.TransientCalc.TransientCalculations.cal_transient_time", "modulename": "corems.transient.calc.TransientCalc", "qualname": "TransientCalculations.cal_transient_time", "kind": "function", "doc": "

    Calculate the time domain length of the transient

    \n\n
    Returns
    \n\n
      \n
    • float: The time domain length of the transient (s)
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.transient.calc.TransientCalc.TransientCalculations.zero_fill", "modulename": "corems.transient.calc.TransientCalc", "qualname": "TransientCalculations.zero_fill", "kind": "function", "doc": "

    Zero fill the transient

    \n\n
    Parameters
    \n\n
      \n
    • transient (numpy.ndarray):\nThe transient data points
    • \n
    \n\n
    Returns
    \n\n
      \n
    • numpy.ndarray: The transient data points zerofilled
    • \n
    \n\n
    Notes
    \n\n

    The number of zero fills is defined by the transient parameter number_of_zero_fills.\nThe function first calculate the next power of two of the transient length and zero fills to that length, to take advantage of FFT algorithm.\n If the parameter next_power_of_two is set to False, the function will zero fill to the length of the original transient times the number of zero fills

    \n", "signature": "(self, transient):", "funcdef": "def"}, {"fullname": "corems.transient.calc.TransientCalc.TransientCalculations.truncation", "modulename": "corems.transient.calc.TransientCalc", "qualname": "TransientCalculations.truncation", "kind": "function", "doc": "

    Truncate the transient

    \n\n
    Parameters
    \n\n
      \n
    • transient (numpy.ndarray):\nThe transient data points
    • \n
    \n\n
    Returns
    \n\n
      \n
    • numpy.ndarray: The truncated transient data points
    • \n
    \n\n
    Notes
    \n\n

    The number of truncations is defined by the transient parameter number_of_truncations

    \n", "signature": "(self, transient):", "funcdef": "def"}, {"fullname": "corems.transient.calc.TransientCalc.TransientCalculations.apodization", "modulename": "corems.transient.calc.TransientCalc", "qualname": "TransientCalculations.apodization", "kind": "function", "doc": "

    Apodization of the transient

    \n\n
    Parameters
    \n\n
      \n
    • transient (numpy.ndarray):\nThe transient data points
    • \n
    \n\n
    Returns
    \n\n
      \n
    • numpy.ndarray: The apodized transient data points
    • \n
    \n\n
    Notes
    \n\n

    The apodization method is defined by the transient parameter apodization_method.\nThe following apodization methods are available:\n Hamming,\n Hanning,\n Blackman,\n Full-Sine,\n Half-Sine,\n Kaiser,\n Half-Kaiser.

    \n\n

    For Kaiser and Half-Kaiser, an additional parameter 'beta' is required, set by the transient parameter kaiser_beta.

    \n", "signature": "(self, transient):", "funcdef": "def"}, {"fullname": "corems.transient.calc.TransientCalc.TransientCalculations.calculate_frequency_domain", "modulename": "corems.transient.calc.TransientCalc", "qualname": "TransientCalculations.calculate_frequency_domain", "kind": "function", "doc": "

    Calculate the frequency domain (axis) of the transient

    \n\n
    Parameters
    \n\n
      \n
    • number_data_points (int):\nThe number of data points of the transient
    • \n
    \n\n
    Returns
    \n\n
      \n
    • numpy.ndarray: The frequency domain of the transient (Hz)
    • \n
    \n", "signature": "(self, number_data_points):", "funcdef": "def"}, {"fullname": "corems.transient.calc.TransientCalc.TransientCalculations.cut_freq_domain", "modulename": "corems.transient.calc.TransientCalc", "qualname": "TransientCalculations.cut_freq_domain", "kind": "function", "doc": "

    Cut the frequency domain of the transient

    \n\n
    Parameters
    \n\n
      \n
    • freqdomain_X (numpy.ndarray):\nThe frequency domain of the transient (Hz)
    • \n
    • freqdomain_Y (numpy.ndarray):\nThe frequency domain of the transient (Hz)
    • \n
    \n\n
    Returns
    \n\n
      \n
    • numpy.ndarray: The frequency domain of the transient (Hz)
    • \n
    • numpy.ndarray: The frequency domain of the transient (Hz)
    • \n
    \n", "signature": "(self, freqdomain_X, freqdomain_Y):", "funcdef": "def"}, {"fullname": "corems.transient.calc.TransientCalc.TransientCalculations.phase_and_absorption_mode_ft", "modulename": "corems.transient.calc.TransientCalc", "qualname": "TransientCalculations.phase_and_absorption_mode_ft", "kind": "function", "doc": "

    [Not Functional] Produce a phased absorption mode FT spectrum

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.transient.calc.TransientCalc.TransientCalculations.perform_magniture_mode_ft", "modulename": "corems.transient.calc.TransientCalc", "qualname": "TransientCalculations.perform_magniture_mode_ft", "kind": "function", "doc": "

    Perform magnitude mode FT of the transient

    \n\n

    Parameters

    \n\n

    transient : numpy.ndarray\n The transient data points

    \n\n
    Returns
    \n\n
      \n
    • numpy.ndarray: The frequency domain of the transient (Hz)
    • \n
    • numpy.ndarray: The magnitude of the transient (a.u.)
    • \n
    \n", "signature": "(self, transient):", "funcdef": "def"}, {"fullname": "corems.transient.calc.TransientCalc.TransientCalculations.correct_dc_offset", "modulename": "corems.transient.calc.TransientCalc", "qualname": "TransientCalculations.correct_dc_offset", "kind": "function", "doc": "

    [Not Yet Implemented] Correct the DC offset of the transient

    \n\n

    A simple baseline correction to compensate for a DC offset in the recorded transient.\nNot implemented.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.transient.factory", "modulename": "corems.transient.factory", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.transient.factory.TransientClasses", "modulename": "corems.transient.factory.TransientClasses", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.transient.factory.TransientClasses.Transient", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient", "kind": "class", "doc": "

    The Transient object contains the transient data and the parameters used to process it

    \n\n
    Parameters
    \n\n
      \n
    • data (numpy.ndarray):\nArray with the transient data
    • \n
    • d_params (dict):\nDictionary with the parameters to be set
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • calibration_terms (tuple):\nTuple with the calibration terms (A, B, C)
    • \n
    • bandwidth (float):\nThe bandwidth of the transient (Hz)
    • \n
    • number_data_points (int):\nThe number of data points of the transient
    • \n
    • polarity (int):\nThe polarity of the transient
    • \n
    • transient_time (float):\nThe time domain length of the transient
    • \n
    • d_params (dict):\nDictionary with the parameters to be set
    • \n
    • frequency_domain (numpy.ndarray):\nArray with the frequency domain
    • \n
    • magnitude (numpy.ndarray):\nArray with the magnitude
    • \n
    • _full_filename_path (str):\nThe full path of the transient file
    • \n
    • _exc_high_freq (float):\nThe high frequency of the excitation (Hz)
    • \n
    • _exc_low_freq (float):\nThe low frequency of the excitation (Hz)
    • \n
    • _parameters (corems.transient.parameters.TransientParameters):\nThe transient parameters
    • \n
    • _transient_data (numpy.ndarray):\nArray with the transient data
    • \n
    \n\n
    Methods
    \n\n
      \n
    • get_frequency_domain(plot_result=True).\nGet the frequency domain and magnitude from the transient data
    • \n
    • get_mass_spectrum(auto_process=True, plot_result=True, keep_profile=True).
      \nGet the mass spectrum from the transient data
    • \n
    • set_processing_parameter(apodization_method, number_of_truncations, number_of_zero_fills).
      \nSet the processing parameters
    • \n
    • scale_plot_size(factor=1.5).\nScale the plot size by a factor
    • \n
    • plot_transient(ax=None, c='k').\nPlot the transient data
    • \n
    • plot_zerofilled_transient(ax=None, c='k').\nPlot the transient data with zero fill
    • \n
    • plot_apodized_transient(ax=None, c='k').\nPlot the transient data with apodization
    • \n
    • plot_frequency_domain(ax=None, c='k').\nPlot the frequency domain and magnitude
    • \n
    • set_parameter_from_toml(parameters_path).\nSet the processing parameters from a toml file
    • \n
    • set_parameter_from_json(parameters_path).\nSet the processing parameters from a json file
    • \n
    \n", "bases": "corems.transient.calc.TransientCalc.TransientCalculations"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.__init__", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.__init__", "kind": "function", "doc": "

    \n", "signature": "(data, d_params)"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.d_params", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.d_params", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.frequency_domain", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.frequency_domain", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.magnitude", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.magnitude", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.scale_plot_size", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.scale_plot_size", "kind": "function", "doc": "

    Scale the plot size by a factor

    \n\n
    Parameters
    \n\n
      \n
    • factor (float, optional):\nThe factor to scale the plot size, by default 1.5
    • \n
    \n", "signature": "(self, factor=1.5):", "funcdef": "def"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.set_processing_parameter", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.set_processing_parameter", "kind": "function", "doc": "

    Set the processing parameters

    \n\n
    Parameters
    \n\n
      \n
    • apodization_method (str):\nApodization method to be used
    • \n
    • number_of_truncations (int):\nNumber of truncations to be used
    • \n
    • number_of_zero_fills (int):\nNumber of zero fills to be used
    • \n
    \n", "signature": "(\tself,\tapodization_method: str,\tnumber_of_truncations: int,\tnumber_of_zero_fills: int):", "funcdef": "def"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.parameters", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.parameters", "kind": "variable", "doc": "

    The transient parameters

    \n"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.set_parameter_from_toml", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.set_parameter_from_toml", "kind": "function", "doc": "

    Set the processing parameters from a toml file

    \n", "signature": "(self, parameters_path):", "funcdef": "def"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.set_parameter_from_json", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.set_parameter_from_json", "kind": "function", "doc": "

    Set the processing parameters from a json file

    \n", "signature": "(self, parameters_path):", "funcdef": "def"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.get_frequency_domain", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.get_frequency_domain", "kind": "function", "doc": "

    Get the frequency domain and magnitude from the transient data

    \n\n
    Parameters
    \n\n
      \n
    • plot_result (bool, optional):\nPlot the frequency domain and magnitude, by default True
    • \n
    \n\n
    Returns
    \n\n
      \n
    • frequency_domain (numpy.ndarray):\nArray with the frequency domain
    • \n
    • magnitude (numpy.ndarray):\nArray with the magnitude
    • \n
    \n", "signature": "(self, plot_result=True):", "funcdef": "def"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.get_mass_spectrum", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.get_mass_spectrum", "kind": "function", "doc": "

    Get the mass spectrum from the transient data

    \n\n
    Parameters
    \n\n
      \n
    • auto_process (bool, optional):\nProcess the transient data, by default True
    • \n
    • plot_result (bool, optional):\nPlot the frequency domain and magnitude, by default True
    • \n
    • keep_profile (bool, optional):\nKeep the profile data, by default True
    • \n
    \n\n
    Returns
    \n\n
      \n
    • MassSpecfromFreq: Mass spectrum object
    • \n
    \n", "signature": "(\tself,\tauto_process: bool = True,\tplot_result: bool = True,\tkeep_profile: bool = True) -> corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecfromFreq:", "funcdef": "def"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.filename", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.filename", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.dir_location", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.dir_location", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.A_therm", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.A_therm", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.B_therm", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.B_therm", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.C_therm", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.C_therm", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.plot_transient", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.plot_transient", "kind": "function", "doc": "

    Plot the transient data

    \n\n
    Parameters
    \n\n
      \n
    • ax (matplotlib.axes, optional):\nMatplotlib axes object, by default None
    • \n
    • c (str, optional):\nColor, by default 'k'
    • \n
    \n\n
    Returns
    \n\n
      \n
    • matplotlib.axes: Matplotlib axes object
    • \n
    \n", "signature": "(self, ax=None, c='k'):", "funcdef": "def"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.plot_zerofilled_transient", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.plot_zerofilled_transient", "kind": "function", "doc": "

    Plot the transient data with zero fill

    \n\n
    Parameters
    \n\n
      \n
    • ax (matplotlib.axes, optional):\nMatplotlib axes object, by default None
    • \n
    • c (str, optional):\nColor, by default 'k'
    • \n
    \n\n
    Returns
    \n\n
      \n
    • matplotlib.axes: Matplotlib axes object
    • \n
    \n", "signature": "(self, ax=None, c='k'):", "funcdef": "def"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.plot_apodized_transient", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.plot_apodized_transient", "kind": "function", "doc": "

    Plot the transient data with apodization

    \n\n
    Parameters
    \n\n
      \n
    • ax (matplotlib.axes, optional):\nMatplotlib axes object, by default None
    • \n
    • c (str, optional):\nColor, by default 'k'
    • \n
    \n\n
    Returns
    \n\n
      \n
    • matplotlib.axes: Matplotlib axes object
    • \n
    \n", "signature": "(self, ax=None, c='k'):", "funcdef": "def"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.plot_frequency_domain", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.plot_frequency_domain", "kind": "function", "doc": "

    Plot the frequency domain and magnitude

    \n\n
    Parameters
    \n\n
      \n
    • ax (matplotlib.axes, optional):\nMatplotlib axes object, by default None
    • \n
    • c (str, optional):\nColor, by default 'k'
    • \n
    \n\n
    Returns
    \n\n
      \n
    • matplotlib.axes: Matplotlib axes object
    • \n
    \n", "signature": "(self, ax=None, c='k'):", "funcdef": "def"}, {"fullname": "corems.transient.input", "modulename": "corems.transient.input", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.transient.input.brukerSolarix", "modulename": "corems.transient.input.brukerSolarix", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.transient.input.brukerSolarix.ReadBrukerSolarix", "modulename": "corems.transient.input.brukerSolarix", "qualname": "ReadBrukerSolarix", "kind": "class", "doc": "

    A class used to Read a single Transient from Bruker's FT-MS acquisition station (fid, or ser)

    \n\n
    Parameters
    \n\n
      \n
    • d_directory_location (str):\nthe full path of the .d folder
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • d_directory_location (str):\nthe full path of the .d folder
    • \n
    • file_location (str):\nthe full path of the .d folder
    • \n
    • parameter_filename_location (str):\nthe full path of the apexAcquisition.method file
    • \n
    • transient_data_path (str):\nthe full path of the fid or ser file
    • \n
    • scan_attr (str):\nthe full path of the scan.xml file
    • \n
    \n\n
    Methods
    \n\n
      \n
    • get_transient().\nRead the data and settings returning a Transient class
    • \n
    • get_scan_attr().\nRead the scan retention times, TIC values and scan indices.
    • \n
    • locate_file(folder, type_file_name).\nFind the full path of a specific file within the acquisition .d folder or subfolders
    • \n
    • parse_parameters(parameters_filename).\nOpen the given file and retrieve all parameters from apexAcquisition.method
    • \n
    • fix_freq_limits(d_parameters).\nRead and set the correct frequency limits for the spectrum
    • \n
    • get_excite_sweep_range(filename).\nDetermine excitation sweep range from ExciteSweep file
    • \n
    \n"}, {"fullname": "corems.transient.input.brukerSolarix.ReadBrukerSolarix.__init__", "modulename": "corems.transient.input.brukerSolarix", "qualname": "ReadBrukerSolarix.__init__", "kind": "function", "doc": "

    \n", "signature": "(d_directory_location)"}, {"fullname": "corems.transient.input.brukerSolarix.ReadBrukerSolarix.d_directory_location", "modulename": "corems.transient.input.brukerSolarix", "qualname": "ReadBrukerSolarix.d_directory_location", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.transient.input.brukerSolarix.ReadBrukerSolarix.file_location", "modulename": "corems.transient.input.brukerSolarix", "qualname": "ReadBrukerSolarix.file_location", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.transient.input.brukerSolarix.ReadBrukerSolarix.get_scan_attr", "modulename": "corems.transient.input.brukerSolarix", "qualname": "ReadBrukerSolarix.get_scan_attr", "kind": "function", "doc": "

    Function to get the scan retention times, TIC values and scan indices.

    \n\n

    Gets information from scan.xml file in the bruker .d folder.\nNote this file is only present in some .d format - e.g. for imaging mode data, it is not present.

    \n\n
    Returns
    \n\n
      \n
    • dict_scan_rt_tic (dict):\na dictionary with scan number as key and rt and tic as values
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.transient.input.brukerSolarix.ReadBrukerSolarix.get_transient", "modulename": "corems.transient.input.brukerSolarix", "qualname": "ReadBrukerSolarix.get_transient", "kind": "function", "doc": "

    Function to get the transient data and parameters from a Bruker Solarix .d folder.

    \n\n
    Parameters
    \n\n
      \n
    • scan_number (int):\nthe scan number to be read. Default is 1.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • Transient: a transient object
    • \n
    \n", "signature": "(self, scan_number=1):", "funcdef": "def"}, {"fullname": "corems.transient.input.brukerSolarix.ReadBrukerSolarix.fix_freq_limits", "modulename": "corems.transient.input.brukerSolarix", "qualname": "ReadBrukerSolarix.fix_freq_limits", "kind": "function", "doc": "

    Function to read and set the correct frequency limits for the spectrum

    \n\n
    Notes
    \n\n

    This is using the excitation limits from the apexAcquisition.method file,\nwhich may not match the intended detection limits in edge cases. \nIn default acquisitions, excitation and detection are the same. \nBut, they may not be in some cases with selective excitation, custom excite waveforms, or in 2DMS applications.

    \n\n
    Parameters
    \n\n
      \n
    • d_parameters (dict):\na dictionary with the parameters from the apexAcquisition.method file
    • \n
    \n", "signature": "(self, d_parameters):", "funcdef": "def"}, {"fullname": "corems.transient.input.brukerSolarix.ReadBrukerSolarix.get_excite_sweep_range", "modulename": "corems.transient.input.brukerSolarix", "qualname": "ReadBrukerSolarix.get_excite_sweep_range", "kind": "function", "doc": "

    Function to determine excitation sweep range from ExciteSweep file

    \n\n

    This looks at the first and last rows of the ExciteSweep file to determine the excitation frequency range.\nNote that this assumes the excitation sweep was linear and the first and last rows are the lowest and highest frequencies.\nThis is presumably always true, but again may be incorrect for edge cases with custom excitation waveforms.

    \n\n
    Parameters
    \n\n
      \n
    • filename (str):\nthe full path to the ExciteSweep file
    • \n
    \n", "signature": "(filename):", "funcdef": "def"}, {"fullname": "corems.transient.input.brukerSolarix.ReadBrukerSolarix.locate_file", "modulename": "corems.transient.input.brukerSolarix", "qualname": "ReadBrukerSolarix.locate_file", "kind": "function", "doc": "

    Function to locate a file in a folder

    \n\n

    Find the full path of a specific file within the acquisition .d folder or subfolders

    \n\n
    Parameters
    \n\n
      \n
    • folder (str):\nthe full path to the folder
    • \n
    • type_file_name (str):\nthe name of the file to be located\nExpected options: ExciteSweep or apexAcquisition.method
    • \n
    \n\n
    Returns
    \n\n
      \n
    • str: the full path to the file
    • \n
    \n\n
    Notes
    \n\n

    adapted from code from SPIKE library, https://github.com/spike-project/spike

    \n", "signature": "(folder, type_file_name):", "funcdef": "def"}, {"fullname": "corems.transient.input.brukerSolarix.ReadBrukerSolarix.parse_parameters", "modulename": "corems.transient.input.brukerSolarix", "qualname": "ReadBrukerSolarix.parse_parameters", "kind": "function", "doc": "

    Function to parse the parameters from apexAcquisition.method file

    \n\n

    Open the given file and retrieve all parameters from apexAcquisition.method\n None is written when no value for value is found

    \n\n
    structure : <param name = \"AMS_ActiveExclusion\"><value>0</value></param>\n
    \n\n
    Parameters
    \n\n
      \n
    • parameters_filename (str):\nthe full path to the apexAcquisition.method file
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: a dictionary with the parameters and values
    • \n
    \n\n
    Notes
    \n\n

    Adapted from code from SPIKE library, https://github.com/spike-project/spike.\nCode may not handle all possible parameters, but should be sufficient for most common use cases

    \n", "signature": "(parameters_filename):", "funcdef": "def"}, {"fullname": "corems.transient.input.midasDatFile", "modulename": "corems.transient.input.midasDatFile", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.transient.input.midasDatFile.ReadMidasDatFile", "modulename": "corems.transient.input.midasDatFile", "qualname": "ReadMidasDatFile", "kind": "class", "doc": "

    [Not Implemented] Reads MIDAS .dat files (binary transient data)

    \n\n

    This class will read .dat binary format transient data, e.g. midas format from Predator or Thermo datastations\nThis code is not yet implemented and is not fully functional.

    \n\n
    Parameters
    \n\n
      \n
    • filename_path (str):\nThe path to the .dat file
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • filename_path (str):\nThe path to the .dat file
    • \n
    • d_params (dict):\nA dictionary with the parameters of the .dat file
    • \n
    • transient_data (numpy.ndarray):\nThe transient data
    • \n
    \n\n
    Methods
    \n\n
      \n
    • read_file().\nReads the .dat file and returns the transient data and the parameters
    • \n
    • get_transient_data(data_file, d_params).\nReads the transient data from the .dat file
    • \n
    • parse_parameter(f).\nParses the parameters from the .dat file
    • \n
    \n\n
    Raises
    \n\n
      \n
    • NotImplementedError: This class is not yet implemented.
    • \n
    \n"}, {"fullname": "corems.transient.input.midasDatFile.ReadMidasDatFile.__init__", "modulename": "corems.transient.input.midasDatFile", "qualname": "ReadMidasDatFile.__init__", "kind": "function", "doc": "

    \n", "signature": "(filename_path)"}, {"fullname": "corems.transient.input.midasDatFile.ReadMidasDatFile.filename_path", "modulename": "corems.transient.input.midasDatFile", "qualname": "ReadMidasDatFile.filename_path", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.transient.input.midasDatFile.ReadMidasDatFile.read_file", "modulename": "corems.transient.input.midasDatFile", "qualname": "ReadMidasDatFile.read_file", "kind": "function", "doc": "

    Reads the .dat file and returns the transient data and the parameters

    \n\n
    Returns
    \n\n
      \n
    • transient_data (numpy.ndarray):\nThe transient data
    • \n
    • d_params (dict):\nA dictionary with the parameters of the .dat file
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.transient.input.midasDatFile.ReadMidasDatFile.get_transient_data", "modulename": "corems.transient.input.midasDatFile", "qualname": "ReadMidasDatFile.get_transient_data", "kind": "function", "doc": "

    Reads the transient data from the .dat file

    \n\n
    Parameters
    \n\n
      \n
    • data_file (file):\nThe .dat file
    • \n
    • d_params (dict):\nA dictionary with the parameters of the .dat file
    • \n
    \n\n
    Returns
    \n\n
      \n
    • myarray (numpy.ndarray):\nThe transient data
    • \n
    \n", "signature": "(self, data_file, d_params):", "funcdef": "def"}, {"fullname": "corems.transient.input.midasDatFile.ReadMidasDatFile.parse_parameter", "modulename": "corems.transient.input.midasDatFile", "qualname": "ReadMidasDatFile.parse_parameter", "kind": "function", "doc": "

    Parses the parameters from the .dat file

    \n\n
    Parameters
    \n\n
      \n
    • f (file):\nThe .dat file
    • \n
    \n\n
    Returns
    \n\n
      \n
    • output_parameters (dict):\nA dictionary with the parameters of the .dat file
    • \n
    \n", "signature": "(self, f):", "funcdef": "def"}]; + /** pdoc search index */const docs = [{"fullname": "corems", "modulename": "corems", "kind": "module", "doc": "
    \n\n
    \n
    \n\"CoreMS\n
    \n
    \n\n
    \n\n

    Table of Contents

    \n\n\n\n

    CoreMS

    \n\n

    CoreMS is a comprehensive mass spectrometry framework for software development and data analysis of small molecules analysis.

    \n\n

    Data handling and software development for modern mass spectrometry (MS) is an interdisciplinary endeavor requiring skills in computational science and a deep understanding of MS. To enable scientific software development to keep pace with fast improvements in MS technology, we have developed a Python software framework named CoreMS. The goal of the framework is to provide a fundamental, high-level basis for working with all mass spectrometry data types, allowing custom workflows for data signal processing, annotation, and curation. The data structures were designed with an intuitive, mass spectrometric hierarchical structure, thus allowing organized and easy access to the data and calculations. Moreover, CoreMS supports direct access for almost all vendors\u2019 data formats, allowing for the centralization and automation of all data processing workflows from the raw signal to data annotation and curation.

    \n\n

    CoreMS aims to provide

    \n\n
      \n
    • logical mass spectrometric data structure
    • \n
    • self-containing data and metadata storage
    • \n
    • modern molecular formulae assignment algorithms
    • \n
    • dynamic molecular search space database search and generator
    • \n
    \n\n

    Current Version

    \n\n

    2.0

    \n\n

    Main Developers/Contact

    \n\n\n\n

    Data formats

    \n\n

    Data input formats

    \n\n
      \n
    • Bruker Solarix (CompassXtract)
    • \n
    • Bruker Solarix transients, ser and fid (FT magnitude mode only)
    • \n
    • ThermoFisher (.raw)
    • \n
    • Spectroswiss signal booster data-acquisition station (.hdf5)
    • \n
    • MagLab ICR data-acquisition station (FT and magnitude mode) (.dat)
    • \n
    • ANDI NetCDF for GC-MS (.cdf)
    • \n
    • Generic mass list in profile and centroid mde (include all delimiters types and Excel formats)
    • \n
    • CoreMS exported processed mass list files(excel, .csv, .txt, pandas dataframe as .pkl)
    • \n
    • CoreMS self-containing Hierarchical Data Format (.hdf5)
    • \n
    • Pandas Dataframe
    • \n
    • Support for cloud Storage using s3path.S3path(see examples of usage here: S3 Support)
    • \n
    \n\n

    Data output formats

    \n\n
      \n
    • Pandas data frame (can be saved using pickle, h5, etc)
    • \n
    • Text Files (.csv, tab separated .txt, etc)
    • \n
    • Microsoft Excel (xlsx)
    • \n
    • Automatic JSON for metadata storage and reuse
    • \n
    • Self-containing Hierarchical Data Format (.hdf5) including raw data and ime-series data-point for processed data-sets with all associated metadata stored as json attributes
    • \n
    \n\n

    Data structure types

    \n\n
      \n
    • LC-MS
    • \n
    • GC-MS
    • \n
    • Transient
    • \n
    • Mass Spectra
    • \n
    • Mass Spectrum
    • \n
    • Mass Spectral Peak
    • \n
    • Molecular Formula
    • \n
    \n\n

    In progress data structures

    \n\n
      \n
    • IMS-MS
    • \n
    • LC-IMS-MS
    • \n
    • Collections
    • \n
    • Molecular Structure
    • \n
    \n\n
    \n\n

    Available features

    \n\n

    FT-MS Signal Processing, Calibration, and Molecular Formula Search and Assignment

    \n\n
      \n
    • Apodization, Zerofilling, and Magnitude mode FT
    • \n
    • Manual and automatic noise threshold calculation
    • \n
    • Peak picking using apex quadratic fitting
    • \n
    • Experimental resolving power calculation
    • \n
    • Frequency and m/z domain calibration functions:
    • \n
    • LedFord equation
    • \n
    • Linear equation
    • \n
    • Quadratic equation
    • \n
    • Automatic search most abundant Ox homologue series
    • \n
    • Automatic local (SQLite) or external (PostgreSQL) database check, generation, and search
    • \n
    • Automatic molecular formulae assignments algorithm for ESI(-) MS for natural organic matter analysis
    • \n
    • Automatic fine isotopic structure calculation and search for all isotopes
    • \n
    • Flexible Kendrick normalization base
    • \n
    • Kendrick filter using density-based clustering
    • \n
    • Kendrick classification
    • \n
    • Heteroatoms classification and visualization
    • \n
    \n\n

    GC-MS Signal Processing, Calibration, and Compound Identification

    \n\n
      \n
    • Baseline detection, subtraction, smoothing
    • \n
    • m/z based Chromatogram Peak Deconvolution,
    • \n
    • Manual and automatic noise threshold calculation
    • \n
    • First and second derivatives peak picking methods
    • \n
    • Peak Area Calculation
    • \n
    • Retention Index Calibration
    • \n
    • Automatic local (SQLite) or external (MongoDB or PostgreSQL) database check, generation, and search
    • \n
    • Automatic molecular match algorithm with all spectral similarity methods
    • \n
    \n\n

    High Resolution Mass Spectrum Simulations

    \n\n
      \n
    • Peak shape (Lorentz, Gaussian, Voigt, and pseudo-Voigt)
    • \n
    • Peak fitting for peak shape definition
    • \n
    • Peak position in function of data points, signal to noise and resolving power (Lorentz and Gaussian)
    • \n
    • Prediction of mass error distribution
    • \n
    • Calculated ICR Resolving Power based on magnetic field (B), and transient time(T)
    • \n
    \n\n
    \n\n

    Installation

    \n\n
    \n
    pip install corems\n
    \n
    \n\n

    By default the molecular formula database will be generated using SQLite

    \n\n

    To use Postgresql the easiest way is to build a docker container:

    \n\n
    \n
    docker-compose up -d\n
    \n
    \n\n
      \n
    • Change the url_database on MSParameters.molecular_search.url_database to: \"postgresql+psycopg2://coremsappdb:coremsapppnnl@localhost:5432/coremsapp\"
    • \n
    • Set the url_database env variable COREMS_DATABASE_URL to: \"postgresql+psycopg2://coremsappdb:coremsapppnnl@localhost:5432/coremsapp\"
    • \n
    \n\n

    Thermo Raw File Access:

    \n\n

    To be able to open thermo file a installation of pythonnet is needed:

    \n\n
      \n
    • Windows: \n
      \n
      pip install pythonnet\n
      \n
    • \n
    \n\n
      \n
    • Mac and Linux:\n
      \n
      brew install mono\npip install pythonnet   \n
      \n
    • \n
    \n\n
    \n\n

    Docker stack

    \n\n

    Another option to use CoreMS is to run the docker stack that will start the CoreMS containers

    \n\n

    Molecular Database and Jupyter Notebook Docker Containers

    \n\n

    A docker container containing:

    \n\n
      \n
    • A custom python distribution will all dependencies installed
    • \n
    • A Jupyter notebook server with workflow examples
    • \n
    • A PostgreSQL database for the molecular formulae assignment
    • \n
    \n\n

    If you don't have docker installed, the easiest way is to install docker for desktop

    \n\n
      \n
    1. Start the containers using docker-compose (easiest way):

      \n\n

      On docker-compose-jupyter.yml there is a volume mapping for the tests_data directory with the data provided for testing, to change to your data location:

      \n\n
        \n
      • locate the volumes on docker-compose-jupyter.yml:

        \n\n
        \n
        volumes:\n  - ./tests/tests_data:/home/CoreMS/data\n
        \n
      • \n
      • change \"./tests/tests_data\" to your data directory location

        \n\n
        \n
        volumes:\n  - path_to_your_data_directory:/home/corems/data\n
        \n
      • \n
      • save the file and then call:

        \n\n
        \n
        docker-compose -f docker-compose-jupyter.yml up\n
        \n
      • \n
    2. \n
    3. Another option is to manually build the containers:

      \n\n
        \n
      • Build the corems image:

        \n\n
        \n
        docker build -t corems:local .\n
        \n
      • \n
      • Start the database container:

        \n\n
        \n
        docker-compose up -d   \n
        \n
      • \n
      • Start the Jupyter Notebook:

        \n\n
        \n
        docker run --rm -v ./data:/home/CoreMS/data corems:local\n
        \n
      • \n
      • Open your browser, copy and past the URL address provided in the terminal: http://localhost:8888/?token=<token>.

      • \n
      • Open the CoreMS-Tutorial.ipynb

      • \n
    4. \n
    \n\n
    \n\n

    Simple Script Example

    \n\n

    More examples can be found under the directory examples/scripts, examples/notebooks

    \n\n
      \n
    • Basic functionality example
    • \n
    \n\n
    \n
    from corems.transient.input.brukerSolarix import ReadBrukerSolarix\nfrom corems.molecular_id.search.molecularFormulaSearch import SearchMolecularFormulas\nfrom corems.mass_spectrum.output.export import HighResMassSpecExport\nfrom matplotlib import pyplot\n\nfile_path= 'tests/tests_data/ftms/ESI_NEG_SRFA.d'\n\n# Instatiate the Bruker Solarix reader with the filepath\nbruker_reader = ReadBrukerSolarix(file_path)\n\n# Use the reader to instatiate a transient object\nbruker_transient_obj = bruker_reader.get_transient()\n\n# Calculate the transient duration time\nT =  bruker_transient_obj.transient_time\n\n# Use the transient object to instatitate a mass spectrum object\nmass_spectrum_obj = bruker_transient_obj.get_mass_spectrum(plot_result=False, auto_process=True)\n\n# The following SearchMolecularFormulas function does the following\n# - searches monoisotopic molecular formulas for all mass spectral peaks\n# - calculates fine isotopic structure based on monoisotopic molecular formulas found and current dynamic range\n# - searches molecular formulas of correspondent calculated isotopologues\n# - settings are stored at SearchConfig.json and can be changed directly on the file or inside the framework class\n\nSearchMolecularFormulas(mass_spectrum_obj, first_hit=False).run_worker_mass_spectrum()\n\n# Iterate over mass spectral peaks objs within the mass_spectrum_obj\nfor mspeak in mass_spectrum_obj.sort_by_abundance():\n\n    # If there is at least one molecular formula associated, mspeak returns True\n    if  mspeak:\n\n        # Get the molecular formula with the highest mass accuracy\n        molecular_formula = mspeak.molecular_formula_lowest_error\n\n        # Plot mz and peak height\n        pyplot.plot(mspeak.mz_exp, mspeak.abundance, 'o', c='g')\n\n        # Iterate over all molecular formulas associated with the ms peaks obj\n        for molecular_formula in mspeak:\n\n            # Check if the molecular formula is a isotopologue\n            if molecular_formula.is_isotopologue:\n\n                # Access the molecular formula text representation and print\n                print (molecular_formula.string)\n\n                # Get 13C atoms count\n                print (molecular_formula['13C'])\n    else:\n        # Get mz and peak height\n        print(mspeak.mz_exp,mspeak.abundance)\n\n# Save data\n## to a csv file\nmass_spectrum_obj.to_csv("filename")\nmass_spectrum_obj.to_hdf("filename")\n# to pandas Datarame pickle\nmass_spectrum_obj.to_pandas("filename")\n\n# Extract data as a pandas Dataframe\ndf = mass_spectrum_obj.to_dataframe()\n
    \n
    \n\n

    UML Diagrams

    \n\n

    UML (unified modeling language) diagrams for Direct Infusion FT-MS and GC-MS classes can be found here.

    \n\n

    Citing CoreMS

    \n\n

    If you use CoreMS in your work, please use the following citation:\nVersion 2.0 Release on GitHub, archived on Zenodo:

    \n\n

    \"DOI\"

    \n\n
    Yuri E. Corilo, William R. Kew, Lee Ann McCue (2021, March 27). EMSL-Computing/CoreMS: CoreMS 2.0 (Version v2.0), as developed on Github. Zenodo. http://doi.org/10.5281/zenodo.4641552\n
    \n\n

    This material was prepared as an account of work sponsored by an agency of the\nUnited States Government. Neither the United States Government nor the United\nStates Department of Energy, nor Battelle, nor any of their employees, nor any\njurisdiction or organization that has cooperated in the development of these\nmaterials, makes any warranty, express or implied, or assumes any legal\nliability or responsibility for the accuracy, completeness, or usefulness or\nany information, apparatus, product, software, or process disclosed, or\nrepresents that its use would not infringe privately owned rights.

    \n\n

    Reference herein to any specific commercial product, process, or service by\ntrade name, trademark, manufacturer, or otherwise does not necessarily\nconstitute or imply its endorsement, recommendation, or favoring by the United\nStates Government or any agency thereof, or Battelle Memorial Institute. The\nviews and opinions of authors expressed herein do not necessarily state or\nreflect those of the United States Government or any agency thereof.

    \n\n
                 PACIFIC NORTHWEST NATIONAL LABORATORY\n                          operated by\n                            BATTELLE\n                            for the\n               UNITED STATES DEPARTMENT OF ENERGY\n                under Contract DE-AC05-76RL01830\n
    \n"}, {"fullname": "corems.timeit", "modulename": "corems", "qualname": "timeit", "kind": "function", "doc": "

    \n", "signature": "(method):", "funcdef": "def"}, {"fullname": "corems.SuppressPrints", "modulename": "corems", "qualname": "SuppressPrints", "kind": "class", "doc": "

    \n"}, {"fullname": "corems.get_filenames", "modulename": "corems", "qualname": "get_filenames", "kind": "function", "doc": "

    \n", "signature": "(app=None):", "funcdef": "def"}, {"fullname": "corems.get_filename", "modulename": "corems", "qualname": "get_filename", "kind": "function", "doc": "

    \n", "signature": "(app=None):", "funcdef": "def"}, {"fullname": "corems.get_dirname", "modulename": "corems", "qualname": "get_dirname", "kind": "function", "doc": "

    \n", "signature": "(app=None):", "funcdef": "def"}, {"fullname": "corems.get_dirnames", "modulename": "corems", "qualname": "get_dirnames", "kind": "function", "doc": "

    \n", "signature": "(app=None):", "funcdef": "def"}, {"fullname": "corems.chunks", "modulename": "corems", "qualname": "chunks", "kind": "function", "doc": "

    Yield successive n-sized chunks from lst.

    \n", "signature": "(lst, n):", "funcdef": "def"}, {"fullname": "corems.corems_md5", "modulename": "corems", "qualname": "corems_md5", "kind": "function", "doc": "

    \n", "signature": "(fname):", "funcdef": "def"}, {"fullname": "corems.chroma_peak", "modulename": "corems.chroma_peak", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.chroma_peak.calc", "modulename": "corems.chroma_peak.calc", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.chroma_peak.calc.ChromaPeakCalc", "modulename": "corems.chroma_peak.calc.ChromaPeakCalc", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.chroma_peak.calc.ChromaPeakCalc.GCPeakCalculation", "modulename": "corems.chroma_peak.calc.ChromaPeakCalc", "qualname": "GCPeakCalculation", "kind": "class", "doc": "

    Class for performing peak calculations in GC chromatography.

    \n\n
    Methods
    \n\n
      \n
    • calc_area(self, tic: List[float], dx: float) -> None: Calculate the area under the curve of the chromatogram.
    • \n
    • linear_ri(self, right_ri: float, left_ri: float, left_rt: float, right_rt: float) -> float: Calculate the retention index using linear interpolation.
    • \n
    • calc_ri(self, rt_ri_pairs: List[Tuple[float, float]]) -> int: Calculate the retention index based on the given retention time - retention index pairs.
    • \n
    \n"}, {"fullname": "corems.chroma_peak.calc.ChromaPeakCalc.GCPeakCalculation.calc_area", "modulename": "corems.chroma_peak.calc.ChromaPeakCalc", "qualname": "GCPeakCalculation.calc_area", "kind": "function", "doc": "

    Calculate the area under the curve of the chromatogram.

    \n\n
    Parameters
    \n\n
      \n
    • tic (List[float]):\nThe total ion current (TIC) values.
    • \n
    • dx (float):\nThe spacing between data points.
    • \n
    \n", "signature": "(self, tic: list[float], dx: float) -> None:", "funcdef": "def"}, {"fullname": "corems.chroma_peak.calc.ChromaPeakCalc.GCPeakCalculation.linear_ri", "modulename": "corems.chroma_peak.calc.ChromaPeakCalc", "qualname": "GCPeakCalculation.linear_ri", "kind": "function", "doc": "

    Calculate the retention index using linear interpolation.

    \n\n
    Parameters
    \n\n
      \n
    • right_ri (float):\nThe retention index at the right reference point.
    • \n
    • left_ri (float):\nThe retention index at the left reference point.
    • \n
    • left_rt (float):\nThe retention time at the left reference point.
    • \n
    • right_rt (float):\nThe retention time at the right reference point.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: The calculated retention index.
    • \n
    \n", "signature": "(\tself,\tright_ri: float,\tleft_ri: float,\tleft_rt: float,\tright_rt: float) -> float:", "funcdef": "def"}, {"fullname": "corems.chroma_peak.calc.ChromaPeakCalc.GCPeakCalculation.calc_ri", "modulename": "corems.chroma_peak.calc.ChromaPeakCalc", "qualname": "GCPeakCalculation.calc_ri", "kind": "function", "doc": "

    Calculate the retention index based on the given retention time - retention index pairs.

    \n\n
    Parameters
    \n\n
      \n
    • rt_ri_pairs (List[Tuple[float, float]]):\nThe list of retention time - retention index pairs.
    • \n
    \n", "signature": "(self, rt_ri_pairs: list[tuple[float, float]]) -> None:", "funcdef": "def"}, {"fullname": "corems.chroma_peak.factory", "modulename": "corems.chroma_peak.factory", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.ChromaPeakBase", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "ChromaPeakBase", "kind": "class", "doc": "

    Base class for chromatographic peak (ChromaPeak) objects.

    \n\n
    Parameters
    \n\n
      \n
    • chromatogram_parent (Chromatogram):\nThe parent chromatogram object.
    • \n
    • mass_spectrum_obj (MassSpectrum):\nThe mass spectrum object.
    • \n
    • start_index (int):\nThe start index of the peak.
    • \n
    • index (int):\nThe index of the peak.
    • \n
    • final_index (int):\nThe final index of the peak.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • start_scan (int):\nThe start scan of the peak.
    • \n
    • final_scan (int):\nThe final scan of the peak.
    • \n
    • apex_scan (int):\nThe apex scan of the peak.
    • \n
    • chromatogram_parent (Chromatogram):\nThe parent chromatogram object.
    • \n
    • mass_spectrum (MassSpectrum):\nThe mass spectrum object.
    • \n
    • _area (float):\nThe area of the peak.
    • \n
    \n\n
    Properties
    \n\n
      \n
    • retention_time : float. \nThe retention time of the peak.
    • \n
    • tic : float. \nThe total ion current of the peak.
    • \n
    • area : float. \nThe area of the peak.
    • \n
    • rt_list : list. \nThe list of retention times within the peak.
    • \n
    • tic_list : list.\nThe list of total ion currents within the peak.
    • \n
    \n\n

    Methods

    \n\n
      \n
    • None
    • \n
    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.ChromaPeakBase.__init__", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "ChromaPeakBase.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tchromatogram_parent,\tmass_spectrum_obj,\tstart_index,\tindex,\tfinal_index)"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.ChromaPeakBase.start_scan", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "ChromaPeakBase.start_scan", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.ChromaPeakBase.final_scan", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "ChromaPeakBase.final_scan", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.ChromaPeakBase.apex_scan", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "ChromaPeakBase.apex_scan", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.ChromaPeakBase.chromatogram_parent", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "ChromaPeakBase.chromatogram_parent", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.ChromaPeakBase.mass_spectrum", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "ChromaPeakBase.mass_spectrum", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.ChromaPeakBase.retention_time", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "ChromaPeakBase.retention_time", "kind": "variable", "doc": "

    Retention Time

    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.ChromaPeakBase.tic", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "ChromaPeakBase.tic", "kind": "variable", "doc": "

    Total Ion Current

    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.ChromaPeakBase.area", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "ChromaPeakBase.area", "kind": "variable", "doc": "

    Peak Area

    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.ChromaPeakBase.rt_list", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "ChromaPeakBase.rt_list", "kind": "variable", "doc": "

    Retention Time List

    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.ChromaPeakBase.tic_list", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "ChromaPeakBase.tic_list", "kind": "variable", "doc": "

    Total Ion Current List

    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.DataDependentPeak", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "DataDependentPeak", "kind": "class", "doc": "

    Data dependent peak (DataDependentPeak) object.

    \n\n
    Parameters
    \n\n
      \n
    • chromatogram_parent (Chromatogram):\nThe parent chromatogram object.
    • \n
    • mass_spectrum_obj (MassSpectrum):\nThe mass spectrum object.
    • \n
    • peak_indexes (tuple):\nThe start, apex and final indexes of the peak.
    • \n
    • eic_data (EIC_Data):\nThe EIC data object.
    • \n
    • Attributes
    • \n
    • --------
    • \n
    • _eic_data (EIC_Data):\nThe EIC data object.
    • \n
    • _possible_molecular_formulae (list):\nThe list of possible molecular formulas.
    • \n
    \n\n
    Properties
    \n\n
      \n
    • eic_rt_list : list. \nEIC retention time list.
    • \n
    • eic_list : list.\nEIC list.
    • \n
    • targeted_molecular_formulas : list.\nThe list of possible molecular formulas.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • add_dependent_mass_spectrum(mass_spectrum).
      \nAdd a dependent mass spectrum to the peak.
    • \n
    • add_molecular_formula(molfform).
      \nAdd a molecular formula to the peak.
    • \n
    \n", "bases": "ChromaPeakBase"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.DataDependentPeak.__init__", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "DataDependentPeak.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tchromatogram_parent,\tmass_spectrum_obj,\tpeak_indexes,\teic_data: corems.mass_spectra.factory.LC_Temp.EIC_Data,\tpossible_molform=None)"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.DataDependentPeak.add_dependent_mass_spectrum", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "DataDependentPeak.add_dependent_mass_spectrum", "kind": "function", "doc": "

    Add a dependent mass spectrum to the peak.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (MassSpectrum):\nThe mass spectrum object.
    • \n
    \n", "signature": "(self, mass_spectrum):", "funcdef": "def"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.DataDependentPeak.add_molecular_formula", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "DataDependentPeak.add_molecular_formula", "kind": "function", "doc": "

    Add a molecular formula to the peak.

    \n\n
    Parameters
    \n\n
      \n
    • molfform (str):\nThe molecular formula.
    • \n
    \n", "signature": "(self, molfform):", "funcdef": "def"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.DataDependentPeak.eic_rt_list", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "DataDependentPeak.eic_rt_list", "kind": "variable", "doc": "

    EIC Retention Time List

    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.DataDependentPeak.eic_list", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "DataDependentPeak.eic_list", "kind": "variable", "doc": "

    EIC List

    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.DataDependentPeak.targeted_molecular_formulas", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "DataDependentPeak.targeted_molecular_formulas", "kind": "variable", "doc": "

    Targeted Molecular Formulas

    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.GCPeak", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "GCPeak", "kind": "class", "doc": "

    Class representing a peak in a gas chromatography (GC) chromatogram.

    \n\n
    Parameters
    \n\n
      \n
    • chromatogram_parent (Chromatogram):\nThe parent chromatogram object.
    • \n
    • mass_spectrum_obj (MassSpectrum):\nThe mass spectrum object associated with the peak.
    • \n
    • indexes (tuple):\nThe indexes of the peak in the chromatogram.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • _compounds (list):\nList of compounds associated with the peak.
    • \n
    • _ri (float or None):\nRetention index of the peak.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • __len__(). Returns the number of compounds associated with the peak.
    • \n
    • __getitem__(position). Returns the compound at the specified position.
    • \n
    • remove_compound(compounds_obj). Removes the specified compound from the peak.
    • \n
    • clear_compounds(). Removes all compounds from the peak.
    • \n
    • add_compound(compounds_dict, spectral_similarity_scores, ri_score=None, similarity_score=None). Adds a compound to the peak with the specified attributes.
    • \n
    • ri(). Returns the retention index of the peak.
    • \n
    • highest_ss_compound(). Returns the compound with the highest spectral similarity score.
    • \n
    • highest_score_compound(). Returns the compound with the highest similarity score.
    • \n
    • compound_names(). Returns a list of names of compounds associated with the peak.
    • \n
    \n", "bases": "ChromaPeakBase, corems.chroma_peak.calc.ChromaPeakCalc.GCPeakCalculation"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.GCPeak.__init__", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "GCPeak.__init__", "kind": "function", "doc": "

    \n", "signature": "(chromatogram_parent, mass_spectrum_obj, indexes)"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.GCPeak.remove_compound", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "GCPeak.remove_compound", "kind": "function", "doc": "

    \n", "signature": "(self, compounds_obj):", "funcdef": "def"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.GCPeak.clear_compounds", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "GCPeak.clear_compounds", "kind": "function", "doc": "

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.GCPeak.add_compound", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "GCPeak.add_compound", "kind": "function", "doc": "

    Adds a compound to the peak with the specified attributes.

    \n\n
    Parameters
    \n\n
      \n
    • compounds_dict (dict):\nDictionary containing the compound information.
    • \n
    • spectral_similarity_scores (dict):\nDictionary containing the spectral similarity scores.
    • \n
    • ri_score (float or None, optional):\nThe retention index score of the compound. Default is None.
    • \n
    • similarity_score (float or None, optional):\nThe similarity score of the compound. Default is None.
    • \n
    \n", "signature": "(\tself,\tcompounds_dict,\tspectral_similarity_scores,\tri_score=None,\tsimilarity_score=None):", "funcdef": "def"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.GCPeak.ri", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "GCPeak.ri", "kind": "variable", "doc": "

    Returns the retention index of the peak.

    \n\n
    Returns
    \n\n
      \n
    • float or None: The retention index of the peak.
    • \n
    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.GCPeak.highest_ss_compound", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "GCPeak.highest_ss_compound", "kind": "variable", "doc": "

    Returns the compound with the highest spectral similarity score.

    \n\n
    Returns
    \n\n
      \n
    • LowResCompoundRef or None: The compound with the highest spectral similarity score.
    • \n
    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.GCPeak.highest_score_compound", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "GCPeak.highest_score_compound", "kind": "variable", "doc": "

    Returns the compound with the highest similarity score.

    \n\n
    Returns
    \n\n
      \n
    • LowResCompoundRef or None: The compound with the highest similarity score.
    • \n
    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.GCPeak.compound_names", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "GCPeak.compound_names", "kind": "variable", "doc": "

    Returns a list of names of compounds associated with the peak.

    \n\n
    Returns
    \n\n
      \n
    • list: List of names of compounds associated with the peak.
    • \n
    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.GCPeakDeconvolved", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "GCPeakDeconvolved", "kind": "class", "doc": "

    Represents a deconvolved peak in a chromatogram.

    \n\n
    Parameters
    \n\n
      \n
    • chromatogram_parent (Chromatogram):\nThe parent chromatogram object.
    • \n
    • mass_spectra (list):\nList of mass spectra associated with the peak.
    • \n
    • apex_index (int):\nIndex of the apex mass spectrum in the mass_spectra list.
    • \n
    • rt_list (list):\nList of retention times.
    • \n
    • tic_list (list):\nList of total ion currents.
    • \n
    \n", "bases": "GCPeak"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.GCPeakDeconvolved.__init__", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "GCPeakDeconvolved.__init__", "kind": "function", "doc": "

    \n", "signature": "(chromatogram_parent, mass_spectra, apex_index, rt_list, tic_list)"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.GCPeakDeconvolved.mass_spectra", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "GCPeakDeconvolved.mass_spectra", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.GCPeakDeconvolved.rt_list", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "GCPeakDeconvolved.rt_list", "kind": "variable", "doc": "

    Get the list of retention times.

    \n\n
    Returns
    \n\n
      \n
    • list: The list of retention times.
    • \n
    \n"}, {"fullname": "corems.chroma_peak.factory.ChromaPeakClasses.GCPeakDeconvolved.tic_list", "modulename": "corems.chroma_peak.factory.ChromaPeakClasses", "qualname": "GCPeakDeconvolved.tic_list", "kind": "variable", "doc": "

    Get the list of total ion currents.

    \n\n
    Returns
    \n\n
      \n
    • list: The list of total ion currents.
    • \n
    \n"}, {"fullname": "corems.collection", "modulename": "corems.collection", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.collection.factory", "modulename": "corems.collection.factory", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.collection.input", "modulename": "corems.collection.input", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.collection.output", "modulename": "corems.collection.output", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.encapsulation", "modulename": "corems.encapsulation", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.encapsulation.constant", "modulename": "corems.encapsulation.constant", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.encapsulation.constant.Labels", "modulename": "corems.encapsulation.constant", "qualname": "Labels", "kind": "class", "doc": "

    Class for Labels used in CoreMS

    \n\n

    These labels are used to define:

    \n\n
      \n
    • types of columns in plaintext data inputs,
    • \n
    • types of data/mass spectra
    • \n
    • types of assignment for ions
    • \n
    \n"}, {"fullname": "corems.encapsulation.constant.Labels.mz", "modulename": "corems.encapsulation.constant", "qualname": "Labels.mz", "kind": "variable", "doc": "

    \n", "default_value": "'m/z'"}, {"fullname": "corems.encapsulation.constant.Labels.abundance", "modulename": "corems.encapsulation.constant", "qualname": "Labels.abundance", "kind": "variable", "doc": "

    \n", "default_value": "'Peak Height'"}, {"fullname": "corems.encapsulation.constant.Labels.rp", "modulename": "corems.encapsulation.constant", "qualname": "Labels.rp", "kind": "variable", "doc": "

    \n", "default_value": "'Resolving Power'"}, {"fullname": "corems.encapsulation.constant.Labels.s2n", "modulename": "corems.encapsulation.constant", "qualname": "Labels.s2n", "kind": "variable", "doc": "

    \n", "default_value": "'S/N'"}, {"fullname": "corems.encapsulation.constant.Labels.label", "modulename": "corems.encapsulation.constant", "qualname": "Labels.label", "kind": "variable", "doc": "

    \n", "default_value": "'label'"}, {"fullname": "corems.encapsulation.constant.Labels.bruker_profile", "modulename": "corems.encapsulation.constant", "qualname": "Labels.bruker_profile", "kind": "variable", "doc": "

    \n", "default_value": "'Bruker_Profile'"}, {"fullname": "corems.encapsulation.constant.Labels.thermo_profile", "modulename": "corems.encapsulation.constant", "qualname": "Labels.thermo_profile", "kind": "variable", "doc": "

    \n", "default_value": "'Thermo_Profile'"}, {"fullname": "corems.encapsulation.constant.Labels.simulated_profile", "modulename": "corems.encapsulation.constant", "qualname": "Labels.simulated_profile", "kind": "variable", "doc": "

    \n", "default_value": "'Simulated Profile'"}, {"fullname": "corems.encapsulation.constant.Labels.booster_profile", "modulename": "corems.encapsulation.constant", "qualname": "Labels.booster_profile", "kind": "variable", "doc": "

    \n", "default_value": "'Booster Profile'"}, {"fullname": "corems.encapsulation.constant.Labels.bruker_frequency", "modulename": "corems.encapsulation.constant", "qualname": "Labels.bruker_frequency", "kind": "variable", "doc": "

    \n", "default_value": "'Bruker_Frequency'"}, {"fullname": "corems.encapsulation.constant.Labels.midas_frequency", "modulename": "corems.encapsulation.constant", "qualname": "Labels.midas_frequency", "kind": "variable", "doc": "

    \n", "default_value": "'Midas_Frequency'"}, {"fullname": "corems.encapsulation.constant.Labels.thermo_centroid", "modulename": "corems.encapsulation.constant", "qualname": "Labels.thermo_centroid", "kind": "variable", "doc": "

    \n", "default_value": "'Thermo_Centroid'"}, {"fullname": "corems.encapsulation.constant.Labels.corems_centroid", "modulename": "corems.encapsulation.constant", "qualname": "Labels.corems_centroid", "kind": "variable", "doc": "

    \n", "default_value": "'CoreMS_Centroid'"}, {"fullname": "corems.encapsulation.constant.Labels.gcms_centroid", "modulename": "corems.encapsulation.constant", "qualname": "Labels.gcms_centroid", "kind": "variable", "doc": "

    \n", "default_value": "'Thermo_Centroid'"}, {"fullname": "corems.encapsulation.constant.Labels.unassigned", "modulename": "corems.encapsulation.constant", "qualname": "Labels.unassigned", "kind": "variable", "doc": "

    \n", "default_value": "'unassigned'"}, {"fullname": "corems.encapsulation.constant.Labels.radical_ion", "modulename": "corems.encapsulation.constant", "qualname": "Labels.radical_ion", "kind": "variable", "doc": "

    \n", "default_value": "'RADICAL'"}, {"fullname": "corems.encapsulation.constant.Labels.protonated_de_ion", "modulename": "corems.encapsulation.constant", "qualname": "Labels.protonated_de_ion", "kind": "variable", "doc": "

    \n", "default_value": "'DE_OR_PROTONATED'"}, {"fullname": "corems.encapsulation.constant.Labels.protonated", "modulename": "corems.encapsulation.constant", "qualname": "Labels.protonated", "kind": "variable", "doc": "

    \n", "default_value": "'protonated'"}, {"fullname": "corems.encapsulation.constant.Labels.de_protonated", "modulename": "corems.encapsulation.constant", "qualname": "Labels.de_protonated", "kind": "variable", "doc": "

    \n", "default_value": "'de-protonated'"}, {"fullname": "corems.encapsulation.constant.Labels.adduct_ion", "modulename": "corems.encapsulation.constant", "qualname": "Labels.adduct_ion", "kind": "variable", "doc": "

    \n", "default_value": "'ADDUCT'"}, {"fullname": "corems.encapsulation.constant.Labels.neutral", "modulename": "corems.encapsulation.constant", "qualname": "Labels.neutral", "kind": "variable", "doc": "

    \n", "default_value": "'neutral'"}, {"fullname": "corems.encapsulation.constant.Labels.ion_type", "modulename": "corems.encapsulation.constant", "qualname": "Labels.ion_type", "kind": "variable", "doc": "

    \n", "default_value": "'IonType'"}, {"fullname": "corems.encapsulation.constant.Labels.ion_type_translate", "modulename": "corems.encapsulation.constant", "qualname": "Labels.ion_type_translate", "kind": "variable", "doc": "

    \n", "default_value": "{'protonated': 'DE_OR_PROTONATED', 'de-protonated': 'DE_OR_PROTONATED', 'radical': 'RADICAL', 'adduct': 'ADDUCT'}"}, {"fullname": "corems.encapsulation.constant.Atoms", "modulename": "corems.encapsulation.constant", "qualname": "Atoms", "kind": "class", "doc": "

    Class for Atoms in CoreMS

    \n\n

    This class includes key properties of atoms (and the electron) and isotopes, including their exact masses, relative abundances, and covalences. \nIt also associates which isotopes are for the same element, and provides an ordering of elements.

    \n\n

    IUPAC definition of monoisotopic mass is based on the most abundant isotopes of each element present.\nHere, we will use atom symbols with isotope numbers for all isotopes excluding the most abundant one.\nThis list has been corrected up to Iodine.

    \n\n
    References
    \n\n
      \n
    1. NIST - Last Accessed 2019-06-12\nhttps://www.nist.gov/pml/atomic-weights-and-isotopic-compositions-relative-atomic-masses
    2. \n
    \n"}, {"fullname": "corems.encapsulation.constant.Atoms.electron_mass", "modulename": "corems.encapsulation.constant", "qualname": "Atoms.electron_mass", "kind": "variable", "doc": "

    \n", "default_value": "0.000548579909065"}, {"fullname": "corems.encapsulation.constant.Atoms.atomic_masses", "modulename": "corems.encapsulation.constant", "qualname": "Atoms.atomic_masses", "kind": "variable", "doc": "

    \n", "default_value": "{'H': 1.00782503223, 'D': 2.01410177812, 'T': 3.0160492779, '3He': 3.0160293201, 'He': 4.00260325413, '6Li': 6.0151228874, 'Li': 7.0160034366, 'Be': 9.012183065, '10B': 10.01293695, 'B': 11.00930536, 'C': 12.0, '13C': 13.00335483507, '14C': 14.0032419884, 'N': 14.00307400443, '15N': 15.00010889888, 'O': 15.99491461957, '17O': 16.9991317565, '18O': 17.99915961286, 'F': 18.99840316273, 'Ne': 19.9924401762, '21Ne': 20.993846685, '22Ne': 21.991385114, 'Na': 22.989769282, 'Mg': 23.985041697, '25Mg': 24.985836976, '26Mg': 25.982592968, 'Al': 26.98153853, 'Si': 27.97692653465, '29Si': 28.9764946649, '30Si': 29.973770136, 'P': 30.97376199842, 'S': 31.9720711744, '33S': 32.9714589098, '34S': 33.967867004, '36S': 35.96708071, 'Cl': 34.968852682, '37Cl': 36.965902602, '36Ar': 35.967545105, '38Ar': 37.96273211, 'Ar': 39.9623831237, 'K': 38.9637064864, '40K': 39.963998166, '41K': 40.9618252579, 'Ca': 39.962590863, '42Ca': 41.95861783, '43Ca': 42.95876644, '44Ca': 43.95548156, '46Ca': 45.953689, '48Ca': 47.95252276, 'Sc': 44.95590828, '46Ti': 45.95262772, '47Ti': 46.95175879, 'Ti': 47.94794198, '49Ti': 48.94786568, '50Ti': 49.94478689, '50V': 49.94715601, 'V': 50.94395704, '50Cr': 49.94604183, 'Cr': 51.94050623, '53Cr': 52.94064815, '54Cr': 53.93887916, 'Mn': 54.93804391, '54Fe': 53.93960899, 'Fe': 55.93493633, '57Fe': 56.93539284, '58Fe': 57.93327443, 'Co': 58.93319429, 'Ni': 57.93534241, '60Ni': 59.93078588, '61Ni': 60.93105557, '62Ni': 61.92834537, '64Ni': 63.92796682, 'Cu': 62.92959772, '65Cu': 64.9277897, 'Zn': 63.92914201, '66Zn': 65.92603381, '67Zn': 66.92712775, '68Zn': 67.92484455, '70Zn': 69.9253192, 'Ga': 68.9255735, '71Ga': 70.92470258, '70Ge': 69.92424875, '72Ge': 71.922075826, '73Ge': 72.923458956, 'Ge': 73.921177761, '76Ge': 75.921402726, 'As': 74.92159457, '74Se': 73.922475934, '76Se': 75.919213704, '77Se': 76.919914154, '78Se': 77.91730928, 'Se': 79.9165218, '82Se': 81.9166995, 'Br': 78.9183376, '81Br': 80.9162897, '78Kr': 77.92036494, '80Kr': 79.91637808, '82Kr': 81.91348273, '83Kr': 82.91412716, 'Kr': 83.9114977282, '86Kr': 85.9106106269, 'Rb': 84.9117897379, '87Rb': 86.909180531, '84Sr': 83.9134191, '86Sr': 85.9092606, '87Sr': 86.9088775, 'Sr': 87.9056125, 'Y': 88.9058403, 'Zr': 89.9046977, '91Zr': 90.9056396, '92Zr': 91.9050347, '94Zr': 93.9063108, '96Zr': 95.9082714, 'Nb': 92.906373, '92Mo': 91.90680796, '94Mo': 93.9050849, '95Mo': 94.90583877, '96Mo': 95.90467612, '97Mo': 96.90601812, 'Mo': 97.90540482, '100Mo': 99.9074718, 'Tc': 98.9062508, '96Ru': 95.90759025, '98Ru': 97.9052868, '99Ru': 98.9059341, '100Ru': 99.9042143, '101Ru': 100.9055769, 'Ru': 101.9043441, '104Ru': 103.9054275, 'Rh': 102.905498, '102Pd': 101.9056022, '104Pd': 103.9040305, '105Pd': 104.9050796, 'Pd': 105.9034804, '108Pd': 107.9038916, '110Pd': 109.9051722, 'Ag': 106.9050916, '109Ag': 108.9047553, '106Cd': 105.9064599, '108Cd': 107.9041834, '110Cd': 109.90300661, '111Cd': 110.90418287, 'Cd': 111.90276287, '113Cd': 112.90440813, '114Cd': 113.90336509, '116Cd': 115.90476315, '113In': 112.90406184, 'In': 114.903878776, '112Sn': 111.90482387, '114Sn': 113.9027827, '115Sn': 114.903344699, '116Sn': 115.9017428, '117Sn': 116.90295398, '118Sn': 117.90160657, '119Sn': 118.90331117, 'Sn': 119.90220163, '122Sn': 121.9034438, '124Sn': 123.9052766, 'Sb': 120.903812, '123Sb': 122.9042132, '120Te': 119.9040593, '122Te': 121.9030435, '123Te': 122.9042698, '124Te': 123.9028171, '125Te': 124.9044299, '126Te': 125.9033109, '128Te': 127.90446128, 'Te': 129.906222748, 'I': 126.9044719, '124Xe': 123.905892, '126Xe': 125.9042983, '128Xe': 127.903531, '129Xe': 128.9047808611, '130Xe': 129.903509349, '131Xe': 130.90508406, 'Xe': 131.9041550856, '134Xe': 133.90539466, '136Xe': 135.907214484, 'Cs': 132.905451961, '130Ba': 129.9063207, '132Ba': 131.9050611, '134Ba': 133.90450818, '135Ba': 134.90568838, '136Ba': 135.90457573, '137Ba': 136.90582714, 'Ba': 137.905247, '138La': 137.9071149, 'La': 138.9063563, '136Ce': 135.90712921, '138Ce': 137.905991, 'Ce': 139.9054431, '142Ce': 141.9092504, 'Pr': 140.9076576, 'Nd': 141.907729, '143Nd': 142.90982, '144Nd': 143.910093, '145Nd': 144.9125793, '146Nd': 145.9131226, '148Nd': 147.9168993, '150Nd': 149.9209022, '145Pm': 144.9127559, '147Pm': 146.915145, '144Sm': 143.9120065, '147Sm': 146.9149044, '148Sm': 147.9148292, '149Sm': 148.9171921, '150Sm': 149.9172829, 'Sm': 151.9197397, '154Sm': 153.9222169, '151Eu': 150.9198578, 'Eu': 152.921238, '152Gd': 151.9197995, '154Gd': 153.9208741, '155Gd': 154.9226305, '156Gd': 155.9221312, '157Gd': 156.9239686, 'Gd': 157.9241123, '160Gd': 159.9270624, 'Tb': 158.9253547, '156Dy': 155.9242847, '158Dy': 157.9244159, '160Dy': 159.9252046, '161Dy': 160.9269405, '162Dy': 161.9268056, '163Dy': 162.9287383, 'Dy': 163.9291819, 'Ho': 164.9303288, '162Er': 161.9287884, '164Er': 163.9292088, 'Er': 165.9302995, '167Er': 166.9320546, '168Er': 167.9323767, '170Er': 169.9354702, 'Tm': 168.9342179, '168Yb': 167.9338896, '170Yb': 169.9347664, '171Yb': 170.9363302, '172Yb': 171.9363859, '173Yb': 172.9382151, 'Yb': 173.9388664, '176Yb': 175.9425764, 'Lu': 174.9407752, '176Lu': 175.9426897, '174Hf': 173.9400461, '176Hf': 175.9414076, '177Hf': 176.9432277, '178Hf': 177.9437058, '179Hf': 178.9458232, 'Hf': 179.946557, '180Ta': 179.9474648, 'Ta': 180.9479958, '180W': 179.9467108, '182W': 181.94820394, '183W': 182.95022275, 'W': 183.95093092, '186W': 185.9543628, '185Re': 184.9529545, 'Re': 186.9557501, '184Os': 183.9524885, '186Os': 185.953835, '187Os': 186.9557474, '188Os': 187.9558352, '189Os': 188.9581442, '190Os': 189.9584437, '192Os': 191.961477, '191Ir': 190.9605893, 'Ir': 192.9629216, '190Pt': 189.9599297, '192Pt': 191.9610387, '194Pt': 193.9626809, 'Pt': 194.9647917, '196Pt': 195.96495209, '198Pt': 197.9678949, 'Au': 196.96656879, '196Hg': 195.9658326, '198Hg': 197.9667686, '199Hg': 198.96828064, '200Hg': 199.96832659, '201Hg': 200.97030284, 'Hg': 201.9706434, '204Hg': 203.97349398, '203Tl': 202.9723446, 'Tl': 204.9744278, '204Pb': 203.973044, '206Pb': 205.9744657, '207Pb': 206.9758973, 'Pb': 207.9766525, 'Bi': 208.9803991, '209Po': 208.9824308, '210Po': 209.9828741, '210At': 209.9871479, '211At': 210.9874966, '211Rn': 210.9906011, '220Rn': 220.0113941, '222Rn': 222.0175782, '223Fr': 223.019736, '223Ra': 223.0185023, '224Ra': 224.020212, '226Ra': 226.0254103, '228Ra': 228.0310707, '227Ac': 227.0277523, '230Th': 230.0331341, 'Th': 232.0380558, 'Pa': 231.0358842, '233U': 233.0396355, '234U': 234.0409523, '235U': 235.0439301, '236U': 236.0455682, 'U': 238.0507884, '236Np': 236.04657, '237Np': 237.0481736, '238Pu': 238.0495601, '239Pu': 239.0521636, '240Pu': 240.0538138, '241Pu': 241.0568517, '242Pu': 242.0587428, '244Pu': 244.0642053, '241Am': 241.0568293, '243Am': 243.0613813, '243Cm': 243.0613893, '244Cm': 244.0627528, '245Cm': 245.0654915, '246Cm': 246.0672238, '247Cm': 247.0703541, '248Cm': 248.0723499, '247Bk': 247.0703073, '249Bk': 249.0749877, '249Cf': 249.0748539, '250Cf': 250.0764062, '251Cf': 251.0795886, '252Cf': 252.0816272, '252Es': 252.08298, '257Fm': 257.0951061, '258Md': 258.0984315, '260Md': 260.10365, '259No': 259.10103, '262Lr': 262.10961, '267Rf': 267.12179, '268Db': 268.12567, '271Sg': 271.13393, '272Bh': 272.13826, '270Hs': 270.13429, '276Mt': 276.15159, '281Ds': 281.16451, '280Rg': 280.16514, '285Cn': 285.17712, '284Nh': 284.17873, '289Fl': 289.19042, '288Mc': 288.19274, '293Lv': 293.20449, '292Ts': 292.20746, '294Og': 294.21392}"}, {"fullname": "corems.encapsulation.constant.Atoms.atoms_order", "modulename": "corems.encapsulation.constant", "qualname": "Atoms.atoms_order", "kind": "variable", "doc": "

    \n", "default_value": "['C', 'H', 'O', 'N', 'P', 'S', 'F', 'Cl', 'Br', 'I', 'At', 'Li', 'Na', 'K', 'Rb', 'Cs', 'Fr', 'He', 'Ne', 'Ar', 'Kr', 'Xe', 'Rn', 'Be', 'B', 'Mg', 'Al', 'Si', 'Ca', 'Sc', 'Ti', 'V', 'Cr', 'Mn', 'Fe', 'Co', 'Ni', 'Cu', 'Zn', 'Ga', 'Ge', 'As', 'Se', 'Sr', 'Y', 'Zr', 'Nb', 'Mo', 'Tc', 'Ru', 'Rh', 'Pd', 'Ag', 'Cd', 'In', 'Sn', 'Sb', 'Te', 'Ba', 'La', 'Hf', 'Ta', 'W', 'Re', 'Os', 'Ir', 'Pt', 'Au', 'Hg', 'Tl', 'Pb', 'Bi', 'Po', 'Ra', 'Ac', 'Rf', 'Db', 'Sg', 'Bh', 'Hs', 'Mt', 'Ds', 'Rg', 'Cn', 'Nh', 'Fl', 'Mc', 'Lv', 'Ts', 'Og', 'Ce', 'Pr', 'Nd', 'Pm', 'Sm', 'Eu', 'Gd', 'Tb', 'Dy', 'Ho', 'Er', 'Tm', 'Yb', 'Lu', 'Th', 'Pa', 'U', 'Np', 'Pu', 'Am', 'Cm', 'Bk', 'Cf', 'Es', 'Fm', 'Md', 'No', 'Lr', 'D', '6Li', '10B', '13C', '15N', '17O', '18O', '22Ne', '25Mg', '26Mg', '29Si', '30Si', '33S', '34S', '36S', '37Cl', '40Ca', '41K', '44Ca', '46Ti', '47Ti', '49Ti', '50Cr', '50Ti', '50V', '53Cr', '54Cr', '54Fe', '57Fe', '58Fe', '60Ni', '61Ni', '62Ni', '65Cu', '66Zn', '67Zn', '68Zn', '70Ge', '71Ga', '72Ge', '73Ge', '76Ge', '76Se', '77Se', '78Se', '81Br', '80Kr', '82Kr', '82Se', '83Kr', '85Rb', '86Kr', '86Sr', '87Rb', '87Sr', '88Sr', '91Zr', '92Mo', '92Zr', '94Mo', '94Zr', '95Mo', '96Mo', '96Ru', '96Zr', '97Mo', '98Ru', '99Ru', '100Mo', '100Ru', '101Ru', '102Pd', '104Pd', '104Ru', '105Pd', '106Cd', '106Pd', '108Cd', '108Pd', '109Ag', '110Cd', '110Pd', '111Cd', '112Cd', '112Sn', '113Cd', '113In', '114Cd', '114Sn', '115In', '115Sn', '116Cd', '116Sn', '117Sn', '118Sn', '119Sn', '120Sn', '120Te', '121Sb', '122Sn', '122Te', '123Sb', '123Te', '124Sn', '124Te', '124Xe', '125Te', '126Te', '126Xe', '128Te', '128Xe', '129Xe', '130Ba', '130Te', '130Xe', '131Xe', '132Ba', '132Xe', '134Ba', '134Xe', '135Ba', '136Ba', '136Xe', '137Ba', '138Ba', '174Hf', '176Hf', '177Hf', '178Hf', '179Hf', '180Hf', '180W', '182W', '183W', '184Os', '184W', '185Re', '186Os', '186W', '187Os', '187Re', '188Os', '189Os', '190Os', '190Pt', '191Ir', '192Ir', '192Os', '192Pt', '194Pt', '195Pt', '196Hg', '196Pt', '198Hg', '198Pt', '199Hg', '200Hg', '201Hg', '202Hg', '203Tl', '204Hg', '204Pb', '205Tl', '206Pb', '207Pb', '208Pb']"}, {"fullname": "corems.encapsulation.constant.Atoms.atoms_covalence", "modulename": "corems.encapsulation.constant", "qualname": "Atoms.atoms_covalence", "kind": "variable", "doc": "

    \n", "default_value": "{'C': 4, '13C': 4, 'N': 3, 'O': 2, 'S': 2, 'H': 1, 'F': (1, 0), 'Cl': (1, 0), 'Br': (1, 0), 'I': (1, 0), 'At': 1, 'Li': (1, 0), 'Na': (1, 0), 'K': (1, 0), 'Rb': 1, 'Cs': 1, 'Fr': 1, 'B': (4, 3, 2, 1), 'In': (3, 2, 1), 'Al': (3, 1, 2), 'P': (3, 5, 4, 2, 1), 'Ga': (3, 1, 2), 'Mg': (2, 1), 'Be': (2, 1), 'Ca': (2, 1), 'Sr': (2, 1), 'Ba': 2, 'Ra': 2, 'V': (5, 4, 3, 2, 1), 'Fe': (3, 2, 4, 5, 6), 'Si': (4, 3, 2), 'Sc': (3, 2, 1), 'Ti': (4, 3, 2, 1), 'Cr': (1, 2, 3, 4, 5, 6), 'Mn': (1, 2, 3, 4, 5, 6, 7), 'Co': (1, 2, 3, 4, 5), 'Ni': (1, 2, 3, 4), 'Cu': (2, 1, 3, 4), 'Zn': (2, 1), 'Ge': (4, 3, 2, 1), 'As': (5, 3, 2, 1), 'Se': (6, 4, 2, 1), 'Y': (3, 2, 1), 'Zr': (4, 3, 2, 1), 'Nb': (5, 4, 3, 2, 1), 'Mo': (6, 5, 4, 3, 2, 1), 'Tc': (7, 6, 5, 4, 3, 2, 1), 'Ru': (8, 7, 6, 5, 4, 3, 2, 1), 'Rh': (6, 5, 4, 3, 2, 1), 'Pd': (4, 2, 1), 'Ag': (0, 1, 2, 3, 4), 'Cd': (2, 1), 'Sn': (4, 2), 'Sb': (5, 3), 'Te': (6, 5, 4, 2), 'La': (3, 2), 'Hf': (4, 3, 2), 'Ta': (5, 4, 3, 2), 'W': (6, 5, 4, 3, 2, 1), 'Re': (4, 7, 6, 5, 3, 2, 1), 'Os': (4, 8, 7, 6, 5, 3, 2, 1), 'Ir': (4, 8, 6, 5, 3, 2, 1), 'Pt': (4, 6, 5, 3, 2, 1), 'Au': (3, 5, 2, 1), 'Hg': (1, 2, 4), 'Tl': (3, 1), 'Pb': (4, 2), 'Bi': (3, 1, 5), 'Po': (2, 4, 6), 'Ac': (3, 2)}"}, {"fullname": "corems.encapsulation.constant.Atoms.isotopic_abundance", "modulename": "corems.encapsulation.constant", "qualname": "Atoms.isotopic_abundance", "kind": "variable", "doc": "

    \n", "default_value": "{'H': 0.999885, 'D': 0.000115, 'T': 0, '3He': 1.34e-06, 'He': 0.99999866, '6Li': 0.0759, 'Li': 0.9241, 'Be': 1.0, '10B': 0.199, 'B': 0.801, 'C': 0.9893, '13C': 0.0107, '14C': 0, 'N': 0.99636, '15N': 0.00364, 'O': 0.99757, '17O': 0.00038, '18O': 0.00205, 'F': 1.0, 'Ne': 0.9048, '21Ne': 0.0027, '22Ne': 0.0925, 'Na': 1.0, 'Mg': 0.7899, '25Mg': 0.1, '26Mg': 0.1101, 'Al': 1.0, 'Si': 0.92223, '29Si': 0.04685, '30Si': 0.03092, 'P': 1.0, 'S': 0.9499, '33S': 0.0075, '34S': 0.0425, '36S': 0.0001, 'Cl': 0.7576, '37Cl': 0.2424, '36Ar': 0.003336, '38Ar': 0.000629, 'Ar': 0.996035, 'K': 0.932581, '40K': 0.000117, '41K': 0.067302, 'Ca': 0.96941, '42Ca': 0.00647, '43Ca': 0.00135, '44Ca': 0.02086, '46Ca': 4e-05, '48Ca': 0.001872, 'Sc': 1.0, '46Ti': 0.0825, '47Ti': 0.0744, 'Ti': 0.7372, '49Ti': 0.0541, '50Ti': 0.0518, '50V': 0.0025, 'V': 0.9975, '50Cr': 0.04345, 'Cr': 0.83789, '53Cr': 0.09501, '54Cr': 0.02365, 'Mn': 1.0, '54Fe': 0.05845, 'Fe': 0.91754, '57Fe': 0.02119, '58Fe': 0.00282, 'Co': 1.0, 'Ni': 0.68077, '60Ni': 0.26223, '61Ni': 0.011399, '62Ni': 0.036346, '64Ni': 0.009255, 'Cu': 0.6915, '65Cu': 0.3085, 'Zn': 0.4917, '66Zn': 0.2773, '67Zn': 0.0404, '68Zn': 0.1845, '70Zn': 0.0061, 'Ga': 0.60108, '71Ga': 0.39892, '70Ge': 0.2057, '72Ge': 0.2745, '73Ge': 0.0775, 'Ge': 0.365, '76Ge': 0.0773, 'As': 1.0, '74Se': 0.0089, '76Se': 0.0937, '77Se': 0.0763, '78Se': 0.2377, 'Se': 0.4961, '82Se': 0.0873, 'Br': 0.5069, '81Br': 0.4931, '78Kr': 0.00355, '80Kr': 0.02286, '82Kr': 0.11593, '83Kr': 0.115, 'Kr': 0.56987, '86Kr': 0.17279, 'Rb': 0.7217, '87Rb': 0.2783, '84Sr': 0.0056, '86Sr': 0.0986, '87Sr': 0.07, 'Sr': 0.8258, 'Y': 1.0, 'Zr': 0.5145, '91Zr': 0.1122, '92Zr': 0.1715, '94Zr': 0.1738, '96Zr': 0.028, 'Nb': 1.0, '92Mo': 0.1453, '94Mo': 0.0915, '95Mo': 0.1584, '96Mo': 0.1667, '97Mo': 0.096, 'Mo': 0.2439, '100Mo': 0.0982, '99Tc': 0, '96Ru': 0.0554, '98Ru': 0.0187, '99Ru': 0.1276, '100Ru': 0.126, '101Ru': 0.1706, 'Ru': 0.3155, '104Ru': 0.1862, 'Rh': 1.0, '102Pd': 0.0102, '104Pd': 0.1114, '105Pd': 0.2233, 'Pd': 0.2733, '108Pd': 0.2646, '110Pd': 0.1172, 'Ag': 0.51839, '109Ag': 0.48161, '106Cd': 0.0125, '108Cd': 0.0089, '110Cd': 0.1249, '111Cd': 0.128, 'Cd': 0.2413, '113Cd': 0.1222, '114Cd': 0.2873, '116Cd': 0.0749, '113In': 0.0429, 'In': 0.9571, '112Sn': 0.0097, '114Sn': 0.0066, '115Sn': 0.0034, '116Sn': 0.1454, '117Sn': 0.0768, '118Sn': 0.2422, '119Sn': 0.0859, 'Sn': 0.3258, '122Sn': 0.0463, '124Sn': 0.0579, 'Sb': 0.5721, '123Sb': 0.4279, '120Te': 0.0009, '122Te': 0.0255, '123Te': 0.0089, '124Te': 0.0474, '125Te': 0.0707, '126Te': 0.1884, '128Te': 0.3174, 'Te': 0.3408, 'I': 1.0, '124Xe': 0.000952, '126Xe': 0.00089, '128Xe': 0.019102, '129Xe': 0.264006, '130Xe': 0.04071, '131Xe': 0.212324, 'Xe': 0.269086, '134Xe': 0.104357, '136Xe': 0.088573, 'Cs': 1.0, '130Ba': 0.00106, '132Ba': 0.00101, '134Ba': 0.02417, '135Ba': 0.06592, '136Ba': 0.07854, '137Ba': 0.11232, 'Ba': 0.71698, '138La': 0.0008881, 'La': 0.9991119, '136Ce': 0.00185, '138Ce': 0.00251, 'Ce': 0.8845, '142Ce': 0.11114, 'Pr': 1.0, 'Nd': 0.27152, '143Nd': 0.12174, '144Nd': 0.23798, '145Nd': 0.08293, '146Nd': 0.17189, '148Nd': 0.05756, '150Nd': 0.05638, '145Pm': 0, '147Pm': 0, '144Sm': 0.0307, '147Sm': 0.1499, '148Sm': 0.1124, '149Sm': 0.1382, '150Sm': 0.0738, 'Sm': 0.2675, '154Sm': 0.2275, '151Eu': 0.4781, 'Eu': 0.5219, '152Gd': 0.002, '154Gd': 0.0218, '155Gd': 0.148, '156Gd': 0.2047, '157Gd': 0.1565, 'Gd': 0.2484, '160Gd': 0.2186, 'Tb': 1.0, '156Dy': 0.00056, '158Dy': 0.00095, '160Dy': 0.02329, '161Dy': 0.18889, '162Dy': 0.25475, '163Dy': 0.24896, 'Dy': 0.2826, 'Ho': 1.0, '162Er': 0.00139, '164Er': 0.01601, 'Er': 0.33503, '167Er': 0.22869, '168Er': 0.26978, '170Er': 0.1491, 'Tm': 1.0, '168Yb': 0.00123, '170Yb': 0.02982, '171Yb': 0.1409, '172Yb': 0.2168, '173Yb': 0.16103, 'Yb': 0.32026, '176Yb': 0.12996, 'Lu': 0.97401, '176Lu': 0.02599, '174Hf': 0.0016, '176Hf': 0.0526, '177Hf': 0.186, '178Hf': 0.2728, '179Hf': 0.1362, 'Hf': 0.3508, '180Ta': 0.0001201, 'Ta': 0.9998799, '180W': 0.0012, '182W': 0.265, '183W': 0.1431, 'W': 0.3064, '186W': 0.2843, '185Re': 0.374, 'Re': 0.626, '184Os': 0.0002, '186Os': 0.0159, '187Os': 0.0196, '188Os': 0.1324, '189Os': 0.1615, '190Os': 0.2626, 'Os': 0.4078, '191Ir': 0.373, 'Ir': 0.627, '190Pt': 0.00012, '192Pt': 0.00782, '194Pt': 0.3286, 'Pt': 0.3378, '196Pt': 0.2521, '198Pt': 0.07356, 'Au': 1.0, '196Hg': 0.0015, '198Hg': 0.0997, '199Hg': 0.16872, '200Hg': 0.231, '201Hg': 0.1318, 'Hg': 0.2986, '204Hg': 0.0687, '203Tl': 0.2952, 'Tl': 0.7048, '204Pb': 0.014, '206Pb': 0.241, '207Pb': 0.221, 'Pb': 0.524, 'Bi': 1.0, '209Po': 0, '210Po': 0, '210At': 0, '211At': 0, '211Rn': 0, '220Rn': 0, '222Rn': 0, '223Fr': 0, '223Ra': 0, '224Ra': 0, '226Ra': 0, '228Ra': 0, '227Ac': 0, '230Th': 0, 'Th': 1.0, 'Pa': 1.0, '233U': 0, '234U': 5.4e-05, '235U': 0.007204, '236U': 0, 'U': 0.992742, '236Np': 0, '237Np': 0, '238Pu': 0, '239Pu': 0, '240Pu': 0, '241Pu': 0, '242Pu': 0, '244Pu': 0, '241Am': 0, '243Am': 0, '243Cm': 0, '244Cm': 0, '245Cm': 0, '246Cm': 0, '247Cm': 0, '248Cm': 0, '247Bk': 0, '249Bk': 0, '249Cf': 0, '250Cf': 0, '251Cf': 0, '252Cf': 0, '252Es': 0, '257Fm': 0, '258Md': 0, '260Md': 0, '259No': 0, '262Lr': 0, '267Rf': 0, '268Db': 0, '271Sg': 0, '272Bh': 0, '270Hs': 0, '276Mt': 0, '281Ds': 0, '280Rg': 0, '285Cn': 0, '284Nh': 0, '289Fl': 0, '288Mc': 0, '293Lv': 0, '292Ts': 0, '294Og': 0}"}, {"fullname": "corems.encapsulation.constant.Atoms.isotopes", "modulename": "corems.encapsulation.constant", "qualname": "Atoms.isotopes", "kind": "variable", "doc": "

    \n", "default_value": "{'H': ['Hydrogen', ['D', 'T']], 'He': ['Helium', ['3He']], 'Li': ['Lithium', ['6Li']], 'Be': ['Beryllium', [None]], 'B': ['Boron', ['10B']], 'C': ['Carbon', ['13C']], 'N': ['Nitrogen', ['15N']], 'O': ['Oxygen', ['18O', '17O']], 'F': ['Fluorine', [None]], 'Ne': ['Neon', ['22Ne', '21Ne']], 'Na': ['Sodium', [None]], 'Mg': ['Magnesium', ['26Mg', '25Mg']], 'Al': ['Aluminum', [None]], 'Si': ['Silicon', ['29Si', '30Si']], 'P': ['Phosphorus', [None]], 'S': ['Sulfur', ['34S', '33S', '36S']], 'Cl': ['Chlorine', ['37Cl']], 'Ar': ['Argon', ['36Ar', '38Ar']], 'K': ['Potassium', ['41K', '40K']], 'Ca': ['Calcium', ['44Ca', '48Ca', '43Ca', '42Ca', '46Ca']], 'Sc': ['Scandium', [None]], 'Ti': ['Titanium', ['46Ti', '47Ti', '49Ti', '50Ti']], 'V': ['Vanadium', ['50V']], 'Cr': ['Chromium', ['53Cr', '50Cr', '54Cr']], 'Mn': ['Manganese', [None]], 'Fe': ['Iron', ['54Fe', '57Fe', '58Fe']], 'Co': ['Cobalt', [None]], 'Ni': ['Nickel', ['60Ni', '62Ni', '61Ni', '64Ni']], 'Cu': ['Copper', ['65Cu']], 'Zn': ['Zinc', ['66Zn', '68Zn', '67Zn', '70Zn']], 'Ga': ['Gallium', ['71Ga']], 'Ge': ['Germanium', ['72Ge', '70Ge', '73Ge', '76Ge']], 'As': ['Arsenic', [None]], 'Se': ['Selenium', ['78Se', '76Se', '82Se', '77Se', '74Se']], 'Br': ['Bromine', ['81Br']], 'Kr': ['Krypton', ['86Kr', '82Kr', '83Kr', '80Kr']], 'Rb': ['Rubidium', ['87Rb']], 'Sr': ['Strontium', ['86Sr', '87Sr', '84Sr']], 'Y': ['Yttrium', [None]], 'Zr': ['Zirconium', ['94Zr', '92Zr', '91Zr', '96Zr']], 'Nb': ['Niobium', [None]], 'Mo': ['Molybdenum', ['96Mo', '95Mo', '92Mo', '100Mo', '97Mo', '94Mo']], 'Tc': ['Technetium', [None]], 'Ru': ['Ruthenium', ['104Ru', '101Ru', '99Ru', '100Ru', '96Ru', '98Ru']], 'Rh': ['Rhodium', [None]], 'Pd': ['Palladium', ['108Pd', '105Pd', '110Pd', '104Pd', '102Pd']], 'Ag': ['Silver', ['109Ag']], 'Cd': ['Cadmium', ['114Cd', '111Cd', '110Cd', '113Cd', '116Cd', '106Cd', '108Cd']], 'In': ['Indium', ['113In']], 'Sn': ['Tin', ['118Sn', '116Sn', '119Sn', '117Sn', '124Sn', '122Sn', '112Sn', '114Sn', '115Sn']], 'Sb': ['Antimony', ['123Sb']], 'Te': ['Tellurium', ['128Te', '126Te', '125Te', '124Te', '122Te', '123Te', '120Te']], 'I': ['Iodine', [None]], 'Xe': ['Xenon', ['129Xe', '131Xe', '134Xe', '136Xe', '130Xe', '128Xe']], 'Cs': ['Cesium', [None]], 'Ba': ['Barium', ['137Ba', '136Ba', '135Ba', '134Ba']], 'La': ['Lanthanum', ['138La']], 'Hf': ['Hafnium', ['178Hf', '177Hf', '179Hf', '176Hf']], 'Ta': ['Tantalum', ['180Ta']], 'W': ['Tungsten', ['186W', '182W', '183W']], 'Re': ['Rhenium', ['185Re']], 'Os': ['Osmium', ['190Os', '189Os', '188Os', '187Os', '186Os']], 'Ir': ['Iridium', ['191Ir']], 'Pt': ['Platinum', ['194Pt', '196Pt', '198Pt', '192Pt']], 'Au': ['Gold', [None]], 'Hg': ['Mercury', ['200Hg', '199Hg', '201Hg', '198Hg', '204Hg']], 'Tl': ['Thallium', ['203Tl']], 'Pb': ['Lead', ['206Pb', '207Pb', '204Pb']], 'Bi': ['Bismuth', [None]], 'Po': ['Polonium', [None]], 'At': ['Astatine', [None]], 'Rn': ['Radon', [None]], 'Fr': ['Francium', [None]], 'Ra': ['Radium', [None]], 'Ac': ['Actinium', [None]], 'Rf': ['Rutherfordium', [None]], 'Db': ['Dubnium', [None]], 'Sg': ['Seaborgium', [None]], 'Bh': ['Bohrium', [None]], 'Hs': ['Hassium', [None]], 'Mt': ['Meitnerium', [None]], 'Ds': ['Darmstadtium', [None]], 'Rg': ['Roentgenium', [None]], 'Cn': ['Copernicium', [None]], 'Nh': ['Nihonium', [None]], 'Fl': ['Flerovium', [None]], 'Mc': ['Moscovium', [None]], 'Lv': ['Livermorium', [None]], 'Ts': ['Tennessine', [None]], 'Og': ['Oganesson', [None]], 'Ce': ['Cerium', ['142Ce', '138Ce136Ce']], 'Pr': ['Praseodymium', [None]], 'Nd': ['Neodymium', [None]], 'Pm': ['Promethium', [None]], 'Sm': ['Samarium', [None]], 'Eu': ['Europium', [None]], 'Gd': ['Gadolinium', [None]], 'Tb': ['Terbium', [None]], 'Dy': ['Dysprosium', [None]], 'Ho': ['Holmium', [None]], 'Er': ['Erbium', [None]], 'Tm': ['Thulium', [None]], 'Yb': ['Ytterbium', [None]], 'Lu': ['Lutetium', ['176Lu']], 'Th': ['Thorium', [None]], 'Pa': ['Protactinium', [None]], 'U': ['Uranium', ['235U', '234U']], 'Np': ['Neptunium', [None]], 'Pu': ['Plutonium', [None]], 'Am': ['Americium', [None]], 'Cm': ['Curium', [None]], 'Bk': ['Berkelium', [None]], 'Cf': ['Californium', [None]], 'Es': ['Einsteinium', [None]], 'Fm': ['Fermium', [None]], 'Md': ['Mendelevium', [None]], 'No': ['Nobelium', [None]], 'Lr': ['Lawrencium', [None]]}"}, {"fullname": "corems.encapsulation.factory", "modulename": "corems.encapsulation.factory", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.parameters", "modulename": "corems.encapsulation.factory.parameters", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.parameters.MSParameters", "modulename": "corems.encapsulation.factory.parameters", "qualname": "MSParameters", "kind": "class", "doc": "

    MSParameters class is used to store the parameters used for the processing of the mass spectrum

    \n\n

    Each attibute is a class that contains the parameters for the processing of the mass spectrum, see the corems.encapsulation.factory.processingSetting module for more details.

    \n\n
    Attributes
    \n\n
      \n
    • molecular_search (MolecularFormulaSearchSettings):\nMolecularFormulaSearchSettings object
    • \n
    • transient (TransientSetting):\nTransientSetting object
    • \n
    • mass_spectrum (MassSpectrumSetting):\nMassSpectrumSetting object
    • \n
    • ms_peak (MassSpecPeakSetting):\nMassSpecPeakSetting object
    • \n
    • data_input (DataInputSetting):\nDataInputSetting object
    • \n
    \n"}, {"fullname": "corems.encapsulation.factory.parameters.MSParameters.molecular_search", "modulename": "corems.encapsulation.factory.parameters", "qualname": "MSParameters.molecular_search", "kind": "variable", "doc": "

    \n", "default_value": "MolecularFormulaSearchSettings(use_isotopologue_filter=False, isotopologue_filter_threshold=33.0, isotopologue_filter_atoms=('Cl', 'Br'), use_runtime_kendrick_filter=False, use_min_peaks_filter=True, min_peaks_per_class=15, url_database='postgresql+psycopg2://coremsappdb:coremsapppnnl@molformdb:5432/coremsapp', db_jobs=3, db_chunk_size=300, ion_charge=-1, min_hc_filter=0.3, max_hc_filter=3.0, min_oc_filter=0.0, max_oc_filter=1.2, min_op_filter=2.0, use_pah_line_rule=False, min_dbe=0.0, max_dbe=40.0, mz_error_score_weight=0.6, isotopologue_score_weight=0.4, adduct_atoms_neg=('Cl', 'Br'), adduct_atoms_pos=('Na', 'K'), score_methods=('S_P_lowest_error', 'N_S_P_lowest_error', 'lowest_error', 'prob_score', 'air_filter_error', 'water_filter_error', 'earth_filter_error'), score_method='prob_score', output_min_score=0.1, output_score_method='All Candidates', isRadical=False, isProtonated=True, isAdduct=False, usedAtoms={'C': (1, 100), 'H': (1, 200)}, ionization_type='ESI', min_ppm_error=-10.0, max_ppm_error=10.0, min_abun_error=-100.0, max_abun_error=100.0, mz_error_range=1.5, error_method='None', mz_error_average=0.0, used_atom_valences={'C': 4, '13C': 4, 'N': 3, 'O': 2, 'S': 2, 'H': 1, 'F': 1, 'Cl': 1, 'Br': 1, 'I': 1, 'At': 1, 'Li': 1, 'Na': 1, 'K': 1, 'Rb': 1, 'Cs': 1, 'Fr': 1, 'B': 4, 'In': 3, 'Al': 3, 'P': 3, 'Ga': 3, 'Mg': 2, 'Be': 2, 'Ca': 2, 'Sr': 2, 'Ba': 2, 'Ra': 2, 'V': 5, 'Fe': 3, 'Si': 4, 'Sc': 3, 'Ti': 4, 'Cr': 1, 'Mn': 1, 'Co': 1, 'Ni': 1, 'Cu': 2, 'Zn': 2, 'Ge': 4, 'As': 5, 'Se': 6, 'Y': 3, 'Zr': 4, 'Nb': 5, 'Mo': 6, 'Tc': 7, 'Ru': 8, 'Rh': 6, 'Pd': 4, 'Ag': 0, 'Cd': 2, 'Sn': 4, 'Sb': 5, 'Te': 6, 'La': 3, 'Hf': 4, 'Ta': 5, 'W': 6, 'Re': 4, 'Os': 4, 'Ir': 4, 'Pt': 4, 'Au': 3, 'Hg': 1, 'Tl': 3, 'Pb': 4, 'Bi': 3, 'Po': 2, 'Ac': 3})"}, {"fullname": "corems.encapsulation.factory.parameters.MSParameters.transient", "modulename": "corems.encapsulation.factory.parameters", "qualname": "MSParameters.transient", "kind": "variable", "doc": "

    \n", "default_value": "TransientSetting(implemented_apodization_function=('Hamming', 'Hanning', 'Blackman', 'Full-Sine', 'Half-Sine', 'Kaiser', 'Half-Kaiser'), apodization_method='Hanning', number_of_truncations=0, number_of_zero_fills=1, next_power_of_two=False, kaiser_beta=8.6)"}, {"fullname": "corems.encapsulation.factory.parameters.MSParameters.mass_spectrum", "modulename": "corems.encapsulation.factory.parameters", "qualname": "MSParameters.mass_spectrum", "kind": "variable", "doc": "

    \n", "default_value": "MassSpectrumSetting(noise_threshold_method='log', noise_threshold_methods_implemented=('minima', 'signal_noise', 'relative_abundance', 'absolute_abundance', 'log'), noise_threshold_min_std=6, noise_threshold_min_s2n=4.0, noise_threshold_min_relative_abundance=6.0, noise_threshold_absolute_abundance=1000000.0, noise_threshold_log_nsigma=6, noise_threshold_log_nsigma_corr_factor=0.463, noise_threshold_log_nsigma_bins=500, noise_min_mz=50.0, noise_max_mz=1200.0, min_picking_mz=50.0, max_picking_mz=1200.0, picking_point_extrapolate=3, calib_minimize_method='Powell', calib_pol_order=2, max_calib_ppm_error=1.0, min_calib_ppm_error=-1.0, calib_sn_threshold=2.0, do_calibration=True)"}, {"fullname": "corems.encapsulation.factory.parameters.MSParameters.ms_peak", "modulename": "corems.encapsulation.factory.parameters", "qualname": "MSParameters.ms_peak", "kind": "variable", "doc": "

    \n", "default_value": "MassSpecPeakSetting(kendrick_base={'C': 1, 'H': 2}, kendrick_rounding_method='floor', implemented_kendrick_rounding_methods=('floor', 'ceil', 'round'), peak_derivative_threshold=0.0, peak_min_prominence_percent=0.1, min_peak_datapoints=5.0, peak_max_prominence_percent=0.1, peak_height_max_percent=10.0, legacy_resolving_power=True)"}, {"fullname": "corems.encapsulation.factory.parameters.MSParameters.data_input", "modulename": "corems.encapsulation.factory.parameters", "qualname": "MSParameters.data_input", "kind": "variable", "doc": "

    \n", "default_value": "DataInputSetting(header_translate={'m/z': 'm/z', 'mOz': 'm/z', 'Mass': 'm/z', 'Resolving Power': 'Resolving Power', 'Res.': 'Resolving Power', 'Intensity': 'Peak Height', 'I': 'Peak Height', 'Abundance': 'Peak Height', 'Signal/Noise': 'S/N', 'S/N': 'S/N', 'abs_abu': 'Peak Height', 'sn': 'S/N', 'resolution': 'Resolving Power'})"}, {"fullname": "corems.encapsulation.factory.parameters.GCMSParameters", "modulename": "corems.encapsulation.factory.parameters", "qualname": "GCMSParameters", "kind": "class", "doc": "

    GCMSParameters class is used to store the parameters used for the processing of the gas chromatograph mass spectrum

    \n\n

    Each attibute is a class that contains the parameters for the processing of the data, see the corems.encapsulation.factory.processingSetting module for more details.

    \n\n
    Attributes
    \n\n
      \n
    • molecular_search (MolecularFormulaSearchSettings):\nMolecularFormulaSearchSettings object
    • \n
    • gc_ms (GasChromatographSetting):\nGasChromatographSetting object
    • \n
    \n"}, {"fullname": "corems.encapsulation.factory.parameters.GCMSParameters.molecular_search", "modulename": "corems.encapsulation.factory.parameters", "qualname": "GCMSParameters.molecular_search", "kind": "variable", "doc": "

    \n", "default_value": "CompoundSearchSettings(url_database='sqlite:///db/pnnl_lowres_gcms_compounds.sqlite', ri_search_range=35.0, rt_search_range=1.0, correlation_threshold=0.5, score_threshold=0.0, ri_spacing=200.0, ri_std=3.0, ri_calibration_compound_names=['Methyl Caprylate', 'Methyl Caprate', 'Methyl Pelargonate', 'Methyl Laurate', 'Methyl Myristate', 'Methyl Palmitate', 'Methyl Stearate', 'Methyl Eicosanoate', 'Methyl Docosanoate', 'Methyl Linocerate', 'Methyl Hexacosanoate', 'Methyl Octacosanoate', 'Methyl Triacontanoate'], exploratory_mode=False, score_methods=('highest_sim_score', 'highest_ss'), output_score_method='All')"}, {"fullname": "corems.encapsulation.factory.parameters.GCMSParameters.gc_ms", "modulename": "corems.encapsulation.factory.parameters", "qualname": "GCMSParameters.gc_ms", "kind": "variable", "doc": "

    \n", "default_value": "GasChromatographSetting(use_deconvolution=False, implemented_smooth_method=('savgol', 'hanning', 'blackman', 'bartlett', 'flat', 'boxcar'), smooth_window=5, smooth_method='savgol', savgol_pol_order=2, peak_derivative_threshold=0.0005, peak_height_max_percent=10.0, peak_max_prominence_percent=1.0, min_peak_datapoints=5.0, max_peak_width=0.1, noise_threshold_method='manual_relative_abundance', noise_threshold_methods_implemented=('auto_relative_abundance', 'manual_relative_abundance', 'second_derivative'), std_noise_threshold=3, peak_height_min_percent=0.1, peak_min_prominence_percent=0.1, eic_signal_threshold=0.01, max_rt_distance=0.025)"}, {"fullname": "corems.encapsulation.factory.parameters.LCMSParameters", "modulename": "corems.encapsulation.factory.parameters", "qualname": "LCMSParameters", "kind": "class", "doc": "

    LCMSParameters class is used to store the parameters used for the processing of the liquid chromatograph mass spectrum

    \n\n

    Each attibute is a class that contains the parameters for the processing of the data, see the corems.encapsulation.factory.processingSetting module for more details.

    \n\n
    Attributes
    \n\n
      \n
    • lc_ms (LiquidChromatographSetting):\nLiquidChromatographSetting object
    • \n
    • mass_spectrum (MassSpectrumSetting):\nMassSpectrumSetting object
    • \n
    • ms_peak (MassSpecPeakSetting):\nMassSpecPeakSetting object
    • \n
    • ms1_molecular_search (MolecularFormulaSearchSettings):\nMolecularFormulaSearchSettings object
    • \n
    • ms2_molecular_search (MolecularFormulaSearchSettings):\nMolecularFormulaSearchSettings object
    • \n
    \n"}, {"fullname": "corems.encapsulation.factory.parameters.LCMSParameters.lc_ms", "modulename": "corems.encapsulation.factory.parameters", "qualname": "LCMSParameters.lc_ms", "kind": "variable", "doc": "

    \n", "default_value": "LiquidChromatographSetting(scans=(0, 1), eic_tolerance_ppm=5.0, enforce_target_ms2=True, average_target_mz=True, smooth_window=5, smooth_method='savgol', implemented_smooth_method=('savgol', 'hanning', 'blackman', 'bartlett', 'flat', 'boxcar'), savgol_pol_order=2, peak_height_max_percent=10.0, peak_max_prominence_percent=1.0, peak_derivative_threshold=0.0005, min_peak_datapoints=5.0, noise_threshold_method='manual_relative_abundance', noise_threshold_methods_implemented=('auto_relative_abundance', 'manual_relative_abundance', 'second_derivative'), std_noise_threshold=3, peak_height_min_percent=0.1, eic_signal_threshold=0.01)"}, {"fullname": "corems.encapsulation.factory.parameters.LCMSParameters.mass_spectrum", "modulename": "corems.encapsulation.factory.parameters", "qualname": "LCMSParameters.mass_spectrum", "kind": "variable", "doc": "

    \n", "default_value": "MassSpectrumSetting(noise_threshold_method='log', noise_threshold_methods_implemented=('minima', 'signal_noise', 'relative_abundance', 'absolute_abundance', 'log'), noise_threshold_min_std=6, noise_threshold_min_s2n=4.0, noise_threshold_min_relative_abundance=6.0, noise_threshold_absolute_abundance=1000000.0, noise_threshold_log_nsigma=6, noise_threshold_log_nsigma_corr_factor=0.463, noise_threshold_log_nsigma_bins=500, noise_min_mz=50.0, noise_max_mz=1200.0, min_picking_mz=50.0, max_picking_mz=1200.0, picking_point_extrapolate=3, calib_minimize_method='Powell', calib_pol_order=2, max_calib_ppm_error=1.0, min_calib_ppm_error=-1.0, calib_sn_threshold=2.0, do_calibration=True)"}, {"fullname": "corems.encapsulation.factory.parameters.LCMSParameters.ms_peak", "modulename": "corems.encapsulation.factory.parameters", "qualname": "LCMSParameters.ms_peak", "kind": "variable", "doc": "

    \n", "default_value": "MassSpecPeakSetting(kendrick_base={'C': 1, 'H': 2}, kendrick_rounding_method='floor', implemented_kendrick_rounding_methods=('floor', 'ceil', 'round'), peak_derivative_threshold=0.0, peak_min_prominence_percent=0.1, min_peak_datapoints=5.0, peak_max_prominence_percent=0.1, peak_height_max_percent=10.0, legacy_resolving_power=True)"}, {"fullname": "corems.encapsulation.factory.parameters.LCMSParameters.ms1_molecular_search", "modulename": "corems.encapsulation.factory.parameters", "qualname": "LCMSParameters.ms1_molecular_search", "kind": "variable", "doc": "

    \n", "default_value": "MolecularFormulaSearchSettings(use_isotopologue_filter=False, isotopologue_filter_threshold=33.0, isotopologue_filter_atoms=('Cl', 'Br'), use_runtime_kendrick_filter=False, use_min_peaks_filter=True, min_peaks_per_class=15, url_database='postgresql+psycopg2://coremsappdb:coremsapppnnl@molformdb:5432/coremsapp', db_jobs=3, db_chunk_size=300, ion_charge=-1, min_hc_filter=0.3, max_hc_filter=3.0, min_oc_filter=0.0, max_oc_filter=1.2, min_op_filter=2.0, use_pah_line_rule=False, min_dbe=0.0, max_dbe=40.0, mz_error_score_weight=0.6, isotopologue_score_weight=0.4, adduct_atoms_neg=('Cl', 'Br'), adduct_atoms_pos=('Na', 'K'), score_methods=('S_P_lowest_error', 'N_S_P_lowest_error', 'lowest_error', 'prob_score', 'air_filter_error', 'water_filter_error', 'earth_filter_error'), score_method='prob_score', output_min_score=0.1, output_score_method='All Candidates', isRadical=False, isProtonated=True, isAdduct=False, usedAtoms={'C': (1, 100), 'H': (1, 200)}, ionization_type='ESI', min_ppm_error=-10.0, max_ppm_error=10.0, min_abun_error=-100.0, max_abun_error=100.0, mz_error_range=1.5, error_method='None', mz_error_average=0.0, used_atom_valences={'C': 4, '13C': 4, 'N': 3, 'O': 2, 'S': 2, 'H': 1, 'F': 1, 'Cl': 1, 'Br': 1, 'I': 1, 'At': 1, 'Li': 1, 'Na': 1, 'K': 1, 'Rb': 1, 'Cs': 1, 'Fr': 1, 'B': 4, 'In': 3, 'Al': 3, 'P': 3, 'Ga': 3, 'Mg': 2, 'Be': 2, 'Ca': 2, 'Sr': 2, 'Ba': 2, 'Ra': 2, 'V': 5, 'Fe': 3, 'Si': 4, 'Sc': 3, 'Ti': 4, 'Cr': 1, 'Mn': 1, 'Co': 1, 'Ni': 1, 'Cu': 2, 'Zn': 2, 'Ge': 4, 'As': 5, 'Se': 6, 'Y': 3, 'Zr': 4, 'Nb': 5, 'Mo': 6, 'Tc': 7, 'Ru': 8, 'Rh': 6, 'Pd': 4, 'Ag': 0, 'Cd': 2, 'Sn': 4, 'Sb': 5, 'Te': 6, 'La': 3, 'Hf': 4, 'Ta': 5, 'W': 6, 'Re': 4, 'Os': 4, 'Ir': 4, 'Pt': 4, 'Au': 3, 'Hg': 1, 'Tl': 3, 'Pb': 4, 'Bi': 3, 'Po': 2, 'Ac': 3})"}, {"fullname": "corems.encapsulation.factory.parameters.LCMSParameters.ms2_molecular_search", "modulename": "corems.encapsulation.factory.parameters", "qualname": "LCMSParameters.ms2_molecular_search", "kind": "variable", "doc": "

    \n", "default_value": "MolecularFormulaSearchSettings(use_isotopologue_filter=False, isotopologue_filter_threshold=33.0, isotopologue_filter_atoms=('Cl', 'Br'), use_runtime_kendrick_filter=False, use_min_peaks_filter=True, min_peaks_per_class=15, url_database='postgresql+psycopg2://coremsappdb:coremsapppnnl@molformdb:5432/coremsapp', db_jobs=3, db_chunk_size=300, ion_charge=-1, min_hc_filter=0.3, max_hc_filter=3.0, min_oc_filter=0.0, max_oc_filter=1.2, min_op_filter=2.0, use_pah_line_rule=False, min_dbe=0.0, max_dbe=40.0, mz_error_score_weight=0.6, isotopologue_score_weight=0.4, adduct_atoms_neg=('Cl', 'Br'), adduct_atoms_pos=('Na', 'K'), score_methods=('S_P_lowest_error', 'N_S_P_lowest_error', 'lowest_error', 'prob_score', 'air_filter_error', 'water_filter_error', 'earth_filter_error'), score_method='prob_score', output_min_score=0.1, output_score_method='All Candidates', isRadical=False, isProtonated=True, isAdduct=False, usedAtoms={'C': (1, 100), 'H': (1, 200)}, ionization_type='ESI', min_ppm_error=-10.0, max_ppm_error=10.0, min_abun_error=-100.0, max_abun_error=100.0, mz_error_range=1.5, error_method='None', mz_error_average=0.0, used_atom_valences={'C': 4, '13C': 4, 'N': 3, 'O': 2, 'S': 2, 'H': 1, 'F': 1, 'Cl': 1, 'Br': 1, 'I': 1, 'At': 1, 'Li': 1, 'Na': 1, 'K': 1, 'Rb': 1, 'Cs': 1, 'Fr': 1, 'B': 4, 'In': 3, 'Al': 3, 'P': 3, 'Ga': 3, 'Mg': 2, 'Be': 2, 'Ca': 2, 'Sr': 2, 'Ba': 2, 'Ra': 2, 'V': 5, 'Fe': 3, 'Si': 4, 'Sc': 3, 'Ti': 4, 'Cr': 1, 'Mn': 1, 'Co': 1, 'Ni': 1, 'Cu': 2, 'Zn': 2, 'Ge': 4, 'As': 5, 'Se': 6, 'Y': 3, 'Zr': 4, 'Nb': 5, 'Mo': 6, 'Tc': 7, 'Ru': 8, 'Rh': 6, 'Pd': 4, 'Ag': 0, 'Cd': 2, 'Sn': 4, 'Sb': 5, 'Te': 6, 'La': 3, 'Hf': 4, 'Ta': 5, 'W': 6, 'Re': 4, 'Os': 4, 'Ir': 4, 'Pt': 4, 'Au': 3, 'Hg': 1, 'Tl': 3, 'Pb': 4, 'Bi': 3, 'Po': 2, 'Ac': 3})"}, {"fullname": "corems.encapsulation.factory.parameters.default_parameters", "modulename": "corems.encapsulation.factory.parameters", "qualname": "default_parameters", "kind": "function", "doc": "

    Generate parameters dictionary with the default parameters for data processing\n To gather parameters from instrument data during the data parsing step, a parameters dictionary with the default parameters needs to be generated.\n This dictionary acts as a placeholder and is later used as an argument for all the class constructor methods during instantiation. \n The data gathered from the instrument is added to the class properties.

    \n\n
    Parameters
    \n\n
      \n
    • file_location (str):\npath to the file
    • \n
    \n\n
    Returns
    \n\n
      \n
    • parameters (dict):\ndictionary with the default parameters for data processing
    • \n
    \n", "signature": "(file_location):", "funcdef": "def"}, {"fullname": "corems.encapsulation.factory.processingSetting", "modulename": "corems.encapsulation.factory.processingSetting", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.TransientSetting", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "TransientSetting", "kind": "class", "doc": "

    Transient processing settings class

    \n\n
    Attributes
    \n\n
      \n
    • implemented_apodization_function (tuple):\nAvailable apodization functions
    • \n
    • apodization_method (str):\nApodization function to use. Hanning is a good default for Fourier transform magnitude mode. For absorption mode processing, Half-Sine or Half-Kaiser may be more appropriate.
    • \n
    • number_of_truncations (int):\nHow many times to truncate the transient prior to Fourier transform
    • \n
    • number_of_zero_fills (int):\nHow many times to zero fille the transient prior to Fourier transform.
    • \n
    • next_power_of_two (bool):\nIf True, zero fill to the next power of two after the new length of len(transient)+(number_of_zero_fills*len(transient)).
    • \n
    • kaiser_beta (float):\nBeta parameter for Kaiser or Half-Kaiser apodisation function. 0 is rectangular, 5 is similar to Hamming,\n6 is similar to hanning, and 8.6 is similar to Blackman (from numpy docs)
    • \n
    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.TransientSetting.__init__", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "TransientSetting.__init__", "kind": "function", "doc": "

    \n", "signature": "(\timplemented_apodization_function: tuple = ('Hamming', 'Hanning', 'Blackman', 'Full-Sine', 'Half-Sine', 'Kaiser', 'Half-Kaiser'),\tapodization_method: str = 'Hanning',\tnumber_of_truncations: int = 0,\tnumber_of_zero_fills: int = 1,\tnext_power_of_two: bool = False,\tkaiser_beta: float = 8.6)"}, {"fullname": "corems.encapsulation.factory.processingSetting.TransientSetting.implemented_apodization_function", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "TransientSetting.implemented_apodization_function", "kind": "variable", "doc": "

    \n", "annotation": ": tuple", "default_value": "('Hamming', 'Hanning', 'Blackman', 'Full-Sine', 'Half-Sine', 'Kaiser', 'Half-Kaiser')"}, {"fullname": "corems.encapsulation.factory.processingSetting.TransientSetting.apodization_method", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "TransientSetting.apodization_method", "kind": "variable", "doc": "

    \n", "annotation": ": str", "default_value": "'Hanning'"}, {"fullname": "corems.encapsulation.factory.processingSetting.TransientSetting.number_of_truncations", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "TransientSetting.number_of_truncations", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "0"}, {"fullname": "corems.encapsulation.factory.processingSetting.TransientSetting.number_of_zero_fills", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "TransientSetting.number_of_zero_fills", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "1"}, {"fullname": "corems.encapsulation.factory.processingSetting.TransientSetting.next_power_of_two", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "TransientSetting.next_power_of_two", "kind": "variable", "doc": "

    \n", "annotation": ": bool", "default_value": "False"}, {"fullname": "corems.encapsulation.factory.processingSetting.TransientSetting.kaiser_beta", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "TransientSetting.kaiser_beta", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "8.6"}, {"fullname": "corems.encapsulation.factory.processingSetting.DataInputSetting", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "DataInputSetting", "kind": "class", "doc": "

    Data input settings class

    \n\n
    Attributes
    \n\n
      \n
    • header_translate (dict):\nDictionary with the header labels to be translated to the corems labels. For example, {'m/z':'m/z', 'Resolving Power':'Resolving Power', 'Abundance':'Abundance' , 'S/N':'S/N'}
    • \n
    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.DataInputSetting.__init__", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "DataInputSetting.__init__", "kind": "function", "doc": "

    \n", "signature": "(header_translate: dict = <factory>)"}, {"fullname": "corems.encapsulation.factory.processingSetting.DataInputSetting.header_translate", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "DataInputSetting.header_translate", "kind": "variable", "doc": "

    \n", "annotation": ": dict"}, {"fullname": "corems.encapsulation.factory.processingSetting.DataInputSetting.add_mz_label", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "DataInputSetting.add_mz_label", "kind": "function", "doc": "

    Add a label to the header_translate dictionary to be translated to the corems label for mz.

    \n", "signature": "(self, label):", "funcdef": "def"}, {"fullname": "corems.encapsulation.factory.processingSetting.DataInputSetting.add_peak_height_label", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "DataInputSetting.add_peak_height_label", "kind": "function", "doc": "

    Add a label to the header_translate dictionary to be translated to the corems label for peak height.

    \n", "signature": "(self, label):", "funcdef": "def"}, {"fullname": "corems.encapsulation.factory.processingSetting.DataInputSetting.add_sn_label", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "DataInputSetting.add_sn_label", "kind": "function", "doc": "

    Add a label to the header_translate dictionary to be translated to the corems label for signal to noise.

    \n", "signature": "(self, label):", "funcdef": "def"}, {"fullname": "corems.encapsulation.factory.processingSetting.DataInputSetting.add_resolving_power_label", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "DataInputSetting.add_resolving_power_label", "kind": "function", "doc": "

    Add a label to the header_translate dictionary to be translated to the corems label for resolving power.

    \n", "signature": "(self, label):", "funcdef": "def"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting", "kind": "class", "doc": "

    Liquid chromatograph processing settings class

    \n\n
    Attributes
    \n\n
      \n
    • scans (list or tuple, optional):\nList of select scan to average or a tuple containing the range to average. Default is (0, 1).
    • \n
    • eic_tolerance_ppm (float, optional):\nMass tolerance in ppm for extracted ion chromatogram peak detection. Default is 5.
    • \n
    • correct_eic_baseline (bool, optional):\nIf True, correct the baseline of the extracted ion chromatogram. Default is True.
    • \n
    • enforce_target_ms2 (bool, optional):\nOnly extract EICs for target_mz if the m/z was selected as precursor for ms2. Default is True.
    • \n
    • average_target_mz (bool, optional):\nIf True, average the target_mz EICs. Default is True.
    • \n
    • smooth_window (int, optional):\nWindow size for smoothing the ion chromatogram. Default is 5.
    • \n
    • smooth_method (str, optional):\nSmoothing method to use. Default is 'savgol'. Other options are 'hanning', 'blackman', 'bartlett', 'flat', 'boxcar'.
    • \n
    • implemented_smooth_method (tuple, optional):\nSmoothing methods that can be implemented. Values are ('savgol', 'hanning', 'blackman', 'bartlett', 'flat', 'boxcar').
    • \n
    • savgol_pol_order (int, optional):\nPolynomial order for Savitzky-Golay smoothing. Default is 2.
    • \n
    • peak_height_max_percent (float, optional):\n1-100 % used for baseline detection use 0.1 for second_derivative and 10 for other methods. Default is 10.
    • \n
    • peak_max_prominence_percent (float, optional):\n1-100 % used for baseline detection. Default is 1.
    • \n
    • peak_derivative_threshold (float, optional):\nThreshold for defining derivative crossing. Default is 0.0005.
    • \n
    • min_peak_datapoints (float, optional):\nminimum data point to define a chromatografic peak. Default is 5.
    • \n
    • noise_threshold_method (str, optional):\nMethod for detecting noise threshold. Default is 'manual_relative_abundance'.
    • \n
    • noise_threshold_methods_implemented (tuple, optional):\nMethods for detected noise threshold that can be implemented. Default is ('auto_relative_abundance', 'manual_relative_abundance', 'second_derivative').
    • \n
    • std_noise_threshold (int, optional):\nthe amount of standard deviations used to calculate noise thresould, average + (std_noise_threshold * noise). Default is 3.
    • \n
    • peak_height_min_percent (float, optional):\n0-100 % used for peak detection. Default is 0.1.
    • \n
    • eic_signal_threshold (float, optional):\n0-100 % used for extracted ion chromatogram peak detection. Default is 0.01.
    • \n
    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.__init__", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tscans: list | tuple = (0, 1),\teic_tolerance_ppm: float = 5,\tenforce_target_ms2: bool = True,\taverage_target_mz: bool = True,\tsmooth_window: int = 5,\tsmooth_method: str = 'savgol',\timplemented_smooth_method: tuple = ('savgol', 'hanning', 'blackman', 'bartlett', 'flat', 'boxcar'),\tsavgol_pol_order: int = 2,\tpeak_height_max_percent: float = 10,\tpeak_max_prominence_percent: float = 1,\tpeak_derivative_threshold: float = 0.0005,\tmin_peak_datapoints: float = 5,\tnoise_threshold_method: str = 'manual_relative_abundance',\tnoise_threshold_methods_implemented: tuple = ('auto_relative_abundance', 'manual_relative_abundance', 'second_derivative'),\tstd_noise_threshold: int = 3,\tpeak_height_min_percent: float = 0.1,\teic_signal_threshold: float = 0.01)"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.scans", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.scans", "kind": "variable", "doc": "

    \n", "annotation": ": list | tuple", "default_value": "(0, 1)"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.eic_tolerance_ppm", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.eic_tolerance_ppm", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "5"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.correct_eic_baseline", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.correct_eic_baseline", "kind": "variable", "doc": "

    \n", "default_value": "True"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.enforce_target_ms2", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.enforce_target_ms2", "kind": "variable", "doc": "

    \n", "annotation": ": bool", "default_value": "True"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.average_target_mz", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.average_target_mz", "kind": "variable", "doc": "

    \n", "annotation": ": bool", "default_value": "True"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.smooth_window", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.smooth_window", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "5"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.smooth_method", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.smooth_method", "kind": "variable", "doc": "

    \n", "annotation": ": str", "default_value": "'savgol'"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.implemented_smooth_method", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.implemented_smooth_method", "kind": "variable", "doc": "

    \n", "annotation": ": tuple", "default_value": "('savgol', 'hanning', 'blackman', 'bartlett', 'flat', 'boxcar')"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.savgol_pol_order", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.savgol_pol_order", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "2"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.peak_height_max_percent", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.peak_height_max_percent", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "10"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.peak_max_prominence_percent", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.peak_max_prominence_percent", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "1"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.peak_derivative_threshold", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.peak_derivative_threshold", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.0005"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.min_peak_datapoints", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.min_peak_datapoints", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "5"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.noise_threshold_method", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.noise_threshold_method", "kind": "variable", "doc": "

    \n", "annotation": ": str", "default_value": "'manual_relative_abundance'"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.noise_threshold_methods_implemented", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.noise_threshold_methods_implemented", "kind": "variable", "doc": "

    \n", "annotation": ": tuple", "default_value": "('auto_relative_abundance', 'manual_relative_abundance', 'second_derivative')"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.std_noise_threshold", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.std_noise_threshold", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "3"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.peak_height_min_percent", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.peak_height_min_percent", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.1"}, {"fullname": "corems.encapsulation.factory.processingSetting.LiquidChromatographSetting.eic_signal_threshold", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "LiquidChromatographSetting.eic_signal_threshold", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.01"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting", "kind": "class", "doc": "

    Mass spectrum processing settings class

    \n\n
    Attributes
    \n\n
      \n
    • noise_threshold_method (str, optional):\nMethod for detecting noise threshold. Default is 'log'.
    • \n
    • noise_threshold_methods_implemented (tuple, optional):\nMethods for detected noise threshold that can be implemented. Default is ('minima', 'signal_noise', 'relative_abundance', 'absolute_abundance', 'log').
    • \n
    • noise_threshold_min_std (int, optional):\nMinumum value for noise thresholding when using 'minima' noise threshold method. Default is 6.
    • \n
    • noise_threshold_min_s2n (float, optional):\nMinimum value for noise thresholding when using 'signal_noise' noise threshold method. Default is 4.
    • \n
    • noise_threshold_min_relative_abundance (float, optional):\nMinimum value for noise thresholding when using 'relative_abundance' noise threshold method. Default is 6.
    • \n
    • noise_threshold_absolute_abundance (float, optional):\nMinimum value for noise thresholding when using 'absolute_abundance' noise threshold method. Default is 1_000_000.
    • \n
    • noise_threshold_log_nsigma (int, optional):\nNumber of standard deviations to use when using 'log' noise threshold method. Default is 6.
    • \n
    • noise_threshold_log_nsigma_corr_factor (float, optional):\nCorrection factor for log noise threshold method. Default is 0.463.
    • \n
    • noise_threshold_log_nsigma_bins (int, optional):\nNumber of bins to use for histogram when using 'log' noise threshold method. Default is 500.
    • \n
    • noise_min_mz (float, optional):\nMinimum m/z to use for noise thresholding. Default is 50.0.
    • \n
    • noise_max_mz (float, optional):\nMaximum m/z to use for noise thresholding. Default is 1200.0.
    • \n
    • min_picking_mz (float, optional):\nMinimum m/z to use for peak picking. Default is 50.0.
    • \n
    • max_picking_mz (float, optional):\nMaximum m/z to use for peak picking. Default is 1200.0.
    • \n
    • picking_point_extrapolate (int, optional):\nHow many data points (in each direction) to extrapolate the mz axis and 0 pad the abundance axis. Default is 3.
    • \n
    • calib_minimize_method (str, optional):\nMinimization method to use for calibration. Default is 'Powell'.
    • \n
    • calib_pol_order (int, optional):\nPolynomial order to use for calibration. Default is 2.
    • \n
    • max_calib_ppm_error (float, optional):\nMaximum ppm error to use for calibration. Default is 1.0.
    • \n
    • min_calib_ppm_error (float, optional):\nMinimum ppm error to use for calibration. Default is -1.0.
    • \n
    • calib_sn_threshold (float, optional):\nSignal to noise threshold to use for calibration. Default is 2.0.
    • \n
    • do_calibration (bool, optional):\nIf True, perform calibration. Default is True.
    • \n
    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.__init__", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tnoise_threshold_method: str = 'log',\tnoise_threshold_methods_implemented: tuple = ('minima', 'signal_noise', 'relative_abundance', 'absolute_abundance', 'log'),\tnoise_threshold_min_std: int = 6,\tnoise_threshold_min_s2n: float = 4,\tnoise_threshold_min_relative_abundance: float = 6,\tnoise_threshold_absolute_abundance: float = 1000000,\tnoise_threshold_log_nsigma: int = 6,\tnoise_threshold_log_nsigma_corr_factor: float = 0.463,\tnoise_threshold_log_nsigma_bins: int = 500,\tnoise_min_mz: float = 50.0,\tnoise_max_mz: float = 1200.0,\tmin_picking_mz: float = 50.0,\tmax_picking_mz: float = 1200.0,\tpicking_point_extrapolate: int = 3,\tcalib_minimize_method: str = 'Powell',\tcalib_pol_order: int = 2,\tmax_calib_ppm_error: float = 1.0,\tmin_calib_ppm_error: float = -1.0,\tcalib_sn_threshold: float = 2.0,\tdo_calibration: bool = True)"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.noise_threshold_method", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.noise_threshold_method", "kind": "variable", "doc": "

    \n", "annotation": ": str", "default_value": "'log'"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.noise_threshold_methods_implemented", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.noise_threshold_methods_implemented", "kind": "variable", "doc": "

    \n", "annotation": ": tuple", "default_value": "('minima', 'signal_noise', 'relative_abundance', 'absolute_abundance', 'log')"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.noise_threshold_min_std", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.noise_threshold_min_std", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "6"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.noise_threshold_min_s2n", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.noise_threshold_min_s2n", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "4"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.noise_threshold_min_relative_abundance", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.noise_threshold_min_relative_abundance", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "6"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.noise_threshold_absolute_abundance", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.noise_threshold_absolute_abundance", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "1000000"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.noise_threshold_log_nsigma", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.noise_threshold_log_nsigma", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "6"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.noise_threshold_log_nsigma_corr_factor", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.noise_threshold_log_nsigma_corr_factor", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.463"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.noise_threshold_log_nsigma_bins", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.noise_threshold_log_nsigma_bins", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "500"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.noise_min_mz", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.noise_min_mz", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "50.0"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.noise_max_mz", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.noise_max_mz", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "1200.0"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.min_picking_mz", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.min_picking_mz", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "50.0"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.max_picking_mz", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.max_picking_mz", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "1200.0"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.picking_point_extrapolate", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.picking_point_extrapolate", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "3"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.calib_minimize_method", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.calib_minimize_method", "kind": "variable", "doc": "

    \n", "annotation": ": str", "default_value": "'Powell'"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.calib_pol_order", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.calib_pol_order", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "2"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.max_calib_ppm_error", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.max_calib_ppm_error", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "1.0"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.min_calib_ppm_error", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.min_calib_ppm_error", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "-1.0"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.calib_sn_threshold", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.calib_sn_threshold", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "2.0"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpectrumSetting.do_calibration", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpectrumSetting.do_calibration", "kind": "variable", "doc": "

    \n", "annotation": ": bool", "default_value": "True"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpecPeakSetting", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpecPeakSetting", "kind": "class", "doc": "

    Mass spectrum peak processing settings class

    \n\n
    Attributes
    \n\n
      \n
    • kendrick_base (Dict, optional):\nDictionary specifying the elements and their counts in the Kendrick base.\nDefaults to {'C': 1, 'H': 2}.
    • \n
    • kendrick_rounding_method (str, optional):\nMethod for calculating the nominal Kendrick mass. Valid values are 'floor', 'ceil', or 'round'.\nDefaults to 'floor'.
    • \n
    • implemented_kendrick_rounding_methods (tuple):\nTuple of valid rounding methods for calculating the nominal Kendrick mass.\nDefaults to ('floor', 'ceil', 'round').
    • \n
    • peak_derivative_threshold (float, optional):\nThreshold for defining derivative crossing. Should be a value between 0 and 1.\nDefaults to 0.0.
    • \n
    • peak_min_prominence_percent (float, optional):\nMinimum prominence percentage used for peak detection. Should be a value between 1 and 100.\nDefaults to 0.1.
    • \n
    • min_peak_datapoints (float, optional):\nMinimum number of data points used for peak detection. Should be a value between 0 and infinity.\nDefaults to 5.
    • \n
    • peak_max_prominence_percent (float, optional):\nMaximum prominence percentage used for baseline detection. Should be a value between 1 and 100.\nDefaults to 0.1.
    • \n
    • peak_height_max_percent (float, optional):\nMaximum height percentage used for baseline detection. Should be a value between 1 and 100.\nDefaults to 10.
    • \n
    • legacy_resolving_power (bool, optional):\nFlag indicating whether to use the legacy (CoreMS v1) resolving power calculation.\nDefaults to True.
    • \n
    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpecPeakSetting.__init__", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpecPeakSetting.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tkendrick_base: Dict = <factory>,\tkendrick_rounding_method: str = 'floor',\timplemented_kendrick_rounding_methods: tuple = ('floor', 'ceil', 'round'),\tpeak_derivative_threshold: float = 0.0,\tpeak_min_prominence_percent: float = 0.1,\tmin_peak_datapoints: float = 5,\tpeak_max_prominence_percent: float = 0.1,\tpeak_height_max_percent: float = 10,\tlegacy_resolving_power: bool = True)"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpecPeakSetting.kendrick_base", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpecPeakSetting.kendrick_base", "kind": "variable", "doc": "

    \n", "annotation": ": Dict"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpecPeakSetting.kendrick_rounding_method", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpecPeakSetting.kendrick_rounding_method", "kind": "variable", "doc": "

    \n", "annotation": ": str", "default_value": "'floor'"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpecPeakSetting.implemented_kendrick_rounding_methods", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpecPeakSetting.implemented_kendrick_rounding_methods", "kind": "variable", "doc": "

    \n", "annotation": ": tuple", "default_value": "('floor', 'ceil', 'round')"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpecPeakSetting.peak_derivative_threshold", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpecPeakSetting.peak_derivative_threshold", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.0"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpecPeakSetting.peak_min_prominence_percent", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpecPeakSetting.peak_min_prominence_percent", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.1"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpecPeakSetting.min_peak_datapoints", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpecPeakSetting.min_peak_datapoints", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "5"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpecPeakSetting.peak_max_prominence_percent", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpecPeakSetting.peak_max_prominence_percent", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.1"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpecPeakSetting.peak_height_max_percent", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpecPeakSetting.peak_height_max_percent", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "10"}, {"fullname": "corems.encapsulation.factory.processingSetting.MassSpecPeakSetting.legacy_resolving_power", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MassSpecPeakSetting.legacy_resolving_power", "kind": "variable", "doc": "

    \n", "annotation": ": bool", "default_value": "True"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting", "kind": "class", "doc": "

    Gas chromatograph processing settings class

    \n\n
    Attributes
    \n\n
      \n
    • use_deconvolution (bool, optional):\nIf True, use deconvolution. Default is False.
    • \n
    • implemented_smooth_method (tuple, optional):\nSmoothing methods that can be implemented. Default is ('savgol', 'hanning', 'blackman', 'bartlett', 'flat', 'boxcar').
    • \n
    • smooth_window (int, optional):\nWindow size for smoothing the ion chromatogram. Default is 5.
    • \n
    • smooth_method (str, optional):\nSmoothing method to use. Default is 'savgol'. Other options are 'hanning', 'blackman', 'bartlett', 'flat', 'boxcar'.
    • \n
    • savgol_pol_order (int, optional):\nPolynomial order for Savitzky-Golay smoothing. Default is 2.
    • \n
    • peak_derivative_threshold (float, optional):\nThreshold for defining derivative crossing. Should be a value between 0 and 1.\nDefaults to 0.0005.
    • \n
    • peak_height_max_percent (float, optional):\nMaximum height percentage used for baseline detection. Should be a value between 1 and 100.\nDefaults to 10.
    • \n
    • peak_max_prominence_percent (float, optional):\nMaximum prominence percentage used for baseline detection. Should be a value between 1 and 100.\nDefaults to 1.
    • \n
    • min_peak_datapoints (float, optional):\nMinimum number of data points used for peak detection. Should be a value between 0 and infinity.\nDefaults to 5.
    • \n
    • max_peak_width (float, optional):\nMaximum peak width used for peak detection. Should be a value between 0 and infinity.\nDefaults to 0.1.
    • \n
    • noise_threshold_method (str, optional):\nMethod for detecting noise threshold. Default is 'manual_relative_abundance'.
    • \n
    • noise_threshold_methods_implemented (tuple, optional):\nMethods for detected noise threshold that can be implemented. Default is ('auto_relative_abundance', 'manual_relative_abundance', 'second_derivative').
    • \n
    • std_noise_threshold (int, optional):\nDefault is 3.
    • \n
    • peak_height_min_percent (float, optional):\n0-100 % used for peak detection. Default is 0.1.
    • \n
    • peak_min_prominence_percent (float, optional):\n0-100 % used for peak detection. Default is 0.1.
    • \n
    • eic_signal_threshold (float, optional):\n0-100 % used for extracted ion chromatogram peak detection. Default is 0.01.
    • \n
    • max_rt_distance (float, optional):\nMaximum distance allowance for hierarchical cluster, in minutes. Default is 0.025.
    • \n
    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.__init__", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tuse_deconvolution: bool = False,\timplemented_smooth_method: tuple = ('savgol', 'hanning', 'blackman', 'bartlett', 'flat', 'boxcar'),\tsmooth_window: int = 5,\tsmooth_method: str = 'savgol',\tsavgol_pol_order: int = 2,\tpeak_derivative_threshold: float = 0.0005,\tpeak_height_max_percent: float = 10,\tpeak_max_prominence_percent: float = 1,\tmin_peak_datapoints: float = 5,\tmax_peak_width: float = 0.1,\tnoise_threshold_method: str = 'manual_relative_abundance',\tnoise_threshold_methods_implemented: tuple = ('auto_relative_abundance', 'manual_relative_abundance', 'second_derivative'),\tstd_noise_threshold: int = 3,\tpeak_height_min_percent: float = 0.1,\tpeak_min_prominence_percent: float = 0.1,\teic_signal_threshold: float = 0.01,\tmax_rt_distance: float = 0.025)"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.use_deconvolution", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.use_deconvolution", "kind": "variable", "doc": "

    \n", "annotation": ": bool", "default_value": "False"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.implemented_smooth_method", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.implemented_smooth_method", "kind": "variable", "doc": "

    \n", "annotation": ": tuple", "default_value": "('savgol', 'hanning', 'blackman', 'bartlett', 'flat', 'boxcar')"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.smooth_window", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.smooth_window", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "5"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.smooth_method", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.smooth_method", "kind": "variable", "doc": "

    \n", "annotation": ": str", "default_value": "'savgol'"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.savgol_pol_order", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.savgol_pol_order", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "2"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.peak_derivative_threshold", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.peak_derivative_threshold", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.0005"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.peak_height_max_percent", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.peak_height_max_percent", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "10"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.peak_max_prominence_percent", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.peak_max_prominence_percent", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "1"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.min_peak_datapoints", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.min_peak_datapoints", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "5"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.max_peak_width", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.max_peak_width", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.1"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.noise_threshold_method", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.noise_threshold_method", "kind": "variable", "doc": "

    \n", "annotation": ": str", "default_value": "'manual_relative_abundance'"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.noise_threshold_methods_implemented", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.noise_threshold_methods_implemented", "kind": "variable", "doc": "

    \n", "annotation": ": tuple", "default_value": "('auto_relative_abundance', 'manual_relative_abundance', 'second_derivative')"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.std_noise_threshold", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.std_noise_threshold", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "3"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.peak_height_min_percent", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.peak_height_min_percent", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.1"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.peak_min_prominence_percent", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.peak_min_prominence_percent", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.1"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.eic_signal_threshold", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.eic_signal_threshold", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.01"}, {"fullname": "corems.encapsulation.factory.processingSetting.GasChromatographSetting.max_rt_distance", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "GasChromatographSetting.max_rt_distance", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.025"}, {"fullname": "corems.encapsulation.factory.processingSetting.CompoundSearchSettings", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "CompoundSearchSettings", "kind": "class", "doc": "

    Settings for compound search

    \n\n
    Attributes
    \n\n
      \n
    • url_database (str, optional):\nURL for the database. Default is 'sqlite:///db/pnnl_lowres_gcms_compounds.sqlite'.
    • \n
    • ri_search_range (float, optional):\nRetention index search range. Default is 35.
    • \n
    • rt_search_range (float, optional):\nRetention time search range, in minutes. Default is 1.0.
    • \n
    • correlation_threshold (float, optional):\nThreshold for correlation for spectral similarity. Default is 0.5.
    • \n
    • score_threshold (float, optional):\nThreshold for compsite score. Default is 0.0.
    • \n
    • ri_spacing (float, optional):\nRetention index spacing. Default is 200.
    • \n
    • ri_std (float, optional):\nRetention index standard deviation. Default is 3.
    • \n
    • ri_calibration_compound_names (list, optional):\nList of compound names to use for retention index calibration. Default is ['Methyl Caprylate', 'Methyl Caprate', 'Methyl Pelargonate', 'Methyl Laurate', 'Methyl Myristate', 'Methyl Palmitate', 'Methyl Stearate', 'Methyl Eicosanoate', 'Methyl Docosanoate', 'Methyl Linocerate', 'Methyl Hexacosanoate', 'Methyl Octacosanoate', 'Methyl Triacontanoate'].
    • \n
    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.CompoundSearchSettings.__init__", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "CompoundSearchSettings.__init__", "kind": "function", "doc": "

    \n", "signature": "(\turl_database: str = 'postgresql+psycopg2://coremsappdb:coremsapppnnl@localhost:5432/lowres',\tri_search_range: float = 35,\trt_search_range: float = 1.0,\tcorrelation_threshold: float = 0.5,\tscore_threshold: float = 0.0,\tri_spacing: float = 200,\tri_std: float = 3,\tri_calibration_compound_names: List = <factory>,\texploratory_mode: bool = False,\tscore_methods: tuple = ('highest_sim_score', 'highest_ss'),\toutput_score_method: str = 'All')"}, {"fullname": "corems.encapsulation.factory.processingSetting.CompoundSearchSettings.url_database", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "CompoundSearchSettings.url_database", "kind": "variable", "doc": "

    \n", "annotation": ": str", "default_value": "'postgresql+psycopg2://coremsappdb:coremsapppnnl@localhost:5432/lowres'"}, {"fullname": "corems.encapsulation.factory.processingSetting.CompoundSearchSettings.ri_search_range", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "CompoundSearchSettings.ri_search_range", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "35"}, {"fullname": "corems.encapsulation.factory.processingSetting.CompoundSearchSettings.rt_search_range", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "CompoundSearchSettings.rt_search_range", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "1.0"}, {"fullname": "corems.encapsulation.factory.processingSetting.CompoundSearchSettings.correlation_threshold", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "CompoundSearchSettings.correlation_threshold", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.5"}, {"fullname": "corems.encapsulation.factory.processingSetting.CompoundSearchSettings.score_threshold", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "CompoundSearchSettings.score_threshold", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.0"}, {"fullname": "corems.encapsulation.factory.processingSetting.CompoundSearchSettings.ri_spacing", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "CompoundSearchSettings.ri_spacing", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "200"}, {"fullname": "corems.encapsulation.factory.processingSetting.CompoundSearchSettings.ri_std", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "CompoundSearchSettings.ri_std", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "3"}, {"fullname": "corems.encapsulation.factory.processingSetting.CompoundSearchSettings.ri_calibration_compound_names", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "CompoundSearchSettings.ri_calibration_compound_names", "kind": "variable", "doc": "

    \n", "annotation": ": List"}, {"fullname": "corems.encapsulation.factory.processingSetting.CompoundSearchSettings.exploratory_mode", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "CompoundSearchSettings.exploratory_mode", "kind": "variable", "doc": "

    \n", "annotation": ": bool", "default_value": "False"}, {"fullname": "corems.encapsulation.factory.processingSetting.CompoundSearchSettings.score_methods", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "CompoundSearchSettings.score_methods", "kind": "variable", "doc": "

    \n", "annotation": ": tuple", "default_value": "('highest_sim_score', 'highest_ss')"}, {"fullname": "corems.encapsulation.factory.processingSetting.CompoundSearchSettings.output_score_method", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "CompoundSearchSettings.output_score_method", "kind": "variable", "doc": "

    \n", "annotation": ": str", "default_value": "'All'"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularLookupDictSettings", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularLookupDictSettings", "kind": "class", "doc": "

    Settings for molecular searching

    \n\n

    These are used to generate the database entries, do not change.

    \n\n
    Attributes
    \n\n
      \n
    • usedAtoms (dict, optional):\nDictionary of atoms and ranges. Default is {'C': (1, 90), 'H': (4, 200), 'O': (0, 12), 'N': (0, 0), 'S': (0, 0), 'P': (0, 0), 'Cl': (0, 0)}.
    • \n
    • min_mz (float, optional):\nMinimum m/z to use for searching. Default is 50.0.
    • \n
    • max_mz (float, optional):\nMaximum m/z to use for searching. Default is 1200.0.
    • \n
    • min_dbe (float, optional):\nMinimum double bond equivalent to use for searching. Default is 0.
    • \n
    • max_dbe (float, optional):\nMaximum double bond equivalent to use for searching. Default is 50.
    • \n
    • use_pah_line_rule (bool, optional):\nIf True, use the PAH line rule. Default is False.
    • \n
    • isRadical (bool, optional):\nIf True, search for radical ions. Default is True.
    • \n
    • isProtonated (bool, optional):\nIf True, search for protonated ions. Default is True.
    • \n
    • min_op_filter (float, optional):\nMinimum oxygen to phosphorous ratio. Default is 2.
    • \n
    • min_hc_filter (float, optional):\nMinimum hydrogen to carbon ratio. Default is 0.3.
    • \n
    • min_oc_filter (float, optional):\nMinimum oxygen to carbon ratio. Default is 1.2.
    • \n
    • max_oc_filter (float, optional):\nMaximum oxygen to carbon ratio. Default is 0.0.
    • \n
    • url_database (str, optional):\nURL for the database. Default is None.
    • \n
    • db_jobs (int, optional):\nNumber of jobs to use for database queries. Default is 1.
    • \n
    • used_atom_valences (dict, optional):\nDictionary of atoms and valences. Default is {'C': 4, '13C': 4, 'H': 1, 'O': 2, '18O': 2, 'N': 3, 'S': 2, '34S': 2, 'P': 3, 'Cl': 1, '37Cl': 1, 'Br': 1, 'Na': 1, 'F': 1, 'K': 0}.
    • \n
    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularLookupDictSettings.usedAtoms", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularLookupDictSettings.usedAtoms", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularLookupDictSettings.min_mz", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularLookupDictSettings.min_mz", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularLookupDictSettings.max_mz", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularLookupDictSettings.max_mz", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularLookupDictSettings.min_dbe", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularLookupDictSettings.min_dbe", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularLookupDictSettings.max_dbe", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularLookupDictSettings.max_dbe", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularLookupDictSettings.use_pah_line_rule", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularLookupDictSettings.use_pah_line_rule", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularLookupDictSettings.isRadical", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularLookupDictSettings.isRadical", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularLookupDictSettings.isProtonated", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularLookupDictSettings.isProtonated", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularLookupDictSettings.min_op_filter", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularLookupDictSettings.min_op_filter", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularLookupDictSettings.min_hc_filter", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularLookupDictSettings.min_hc_filter", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularLookupDictSettings.min_oc_filter", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularLookupDictSettings.min_oc_filter", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularLookupDictSettings.max_oc_filter", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularLookupDictSettings.max_oc_filter", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularLookupDictSettings.url_database", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularLookupDictSettings.url_database", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularLookupDictSettings.db_jobs", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularLookupDictSettings.db_jobs", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularLookupDictSettings.used_atom_valences", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularLookupDictSettings.used_atom_valences", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings", "kind": "class", "doc": "

    Settings for molecular searching

    \n\n
    Attributes
    \n\n
      \n
    • use_isotopologue_filter (bool, optional):\nIf True, use isotopologue filter. Default is False.
    • \n
    • isotopologue_filter_threshold (float, optional):\nThreshold for isotopologue filter. Default is 33.
    • \n
    • isotopologue_filter_atoms (tuple, optional):\nTuple of atoms to use for isotopologue filter. Default is ('Cl', 'Br').
    • \n
    • use_runtime_kendrick_filter (bool, optional):\nIf True, use runtime Kendrick filter. Default is False.
    • \n
    • use_min_peaks_filter (bool, optional):\nIf True, use minimum peaks filter. Default is True.
    • \n
    • min_peaks_per_class (int, optional):\nMinimum number of peaks per class. Default is 15.
    • \n
    • url_database (str, optional):\nURL for the database. Default is 'postgresql+psycopg2://coremsappdb:coremsapppnnl@localhost:5432/coremsapp'.
    • \n
    • db_jobs (int, optional):\nNumber of jobs to use for database queries. Default is 3.
    • \n
    • db_chunk_size (int, optional):\nChunk size to use for database queries. Default is 300.
    • \n
    • ion_charge (int, optional):\nIon charge. Default is -1.
    • \n
    • min_hc_filter (float, optional):\nMinimum hydrogen to carbon ratio. Default is 0.3.
    • \n
    • max_hc_filter (float, optional):\nMaximum hydrogen to carbon ratio. Default is 3.
    • \n
    • min_oc_filter (float, optional):\nMinimum oxygen to carbon ratio. Default is 0.0.
    • \n
    • max_oc_filter (float, optional):\nMaximum oxygen to carbon ratio. Default is 1.2.
    • \n
    • min_op_filter (float, optional):\nMinimum oxygen to phosphorous ratio. Default is 2.
    • \n
    • use_pah_line_rule (bool, optional):\nIf True, use the PAH line rule. Default is False.
    • \n
    • min_dbe (float, optional):\nMinimum double bond equivalent to use for searching. Default is 0.
    • \n
    • max_dbe (float, optional):\nMaximum double bond equivalent to use for searching. Default is 40.
    • \n
    • mz_error_score_weight (float, optional):\nWeight for m/z error score to contribute to composite score. Default is 0.6.
    • \n
    • isotopologue_score_weight (float, optional):\nWeight for isotopologue score to contribute to composite score. Default is 0.4.
    • \n
    • adduct_atoms_neg (tuple, optional):\nTuple of atoms to use in negative polarity. Default is ('Cl', 'Br').
    • \n
    • adduct_atoms_pos (tuple, optional):\nTuple of atoms to use in positive polarity. Default is ('Na', 'K').
    • \n
    • score_methods (tuple, optional):\nTuple of score method that can be implemented. \nDefault is ('S_P_lowest_error', 'N_S_P_lowest_error', 'lowest_error', 'prob_score', 'air_filter_error', 'water_filter_error', 'earth_filter_error').
    • \n
    • score_method (str, optional):\nScore method to use. Default is 'prob_score'. Options are 'S_P_lowest_error', 'N_S_P_lowest_error', 'lowest_error', 'prob_score', 'air_filter_error', 'water_filter_error', 'earth_filter_error'.
    • \n
    • output_min_score (float, optional):\nMinimum score for output. Default is 0.1.
    • \n
    • output_score_method (str, optional):\nScore method to use for output. Default is 'All Candidates'.
    • \n
    • output_min_score (float, optional):\nMinimum score for output. Default is 0.1.
    • \n
    • isRadical (bool, optional):\nIf True, search for radical ions. Default is False.
    • \n
    • isProtonated (bool, optional):\nIf True, search for protonated ions. Default is True.
    • \n
    • isAdduct (bool, optional):\nIf True, search for adduct ions. Default is False.
    • \n
    • usedAtoms (dict, optional):\nDictionary of atoms and ranges. Default is {'C': (1, 90), 'H': (4, 200), 'O': (0, 12), 'N': (0, 0), 'S': (0, 0), 'P': (0, 0), 'Cl': (0, 0)}.
    • \n
    • ionization_type (str, optional):\nIonization type. Default is 'ESI'.
    • \n
    • min_ppm_error (float, optional):\nMinimum ppm error. Default is -10.0.
    • \n
    • max_ppm_error (float, optional):\nMaximum ppm error. Default is 10.0.
    • \n
    • min_abun_error (float, optional):\nMinimum abundance error for isotolopologue search. Default is -100.0.
    • \n
    • max_abun_error (float, optional):\nMaximum abundance error for isotolopologue search. Default is 100.0.
    • \n
    • mz_error_range (float, optional):\nm/z error range. Default is 1.5.
    • \n
    • error_method (str, optional):\nError method. Default is 'None'. Options are 'distance', 'lowest', 'symmetrical','average' 'None'.
    • \n
    • mz_error_average (float, optional):\nm/z error average. Default is 0.0.
    • \n
    • used_atom_valences (dict, optional):\nDictionary of atoms and valences. Default is {'C': 4, '13C': 4, 'H': 1, 'O': 2, '18O': 2, 'N': 3, 'S': 2, '34S': 2, 'P': 3, 'Cl': 1, '37Cl': 1, 'Br': 1, 'Na': 1, 'F': 1, 'K': 0}.
    • \n
    \n"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.__init__", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tuse_isotopologue_filter: bool = False,\tisotopologue_filter_threshold: float = 33,\tisotopologue_filter_atoms: tuple = ('Cl', 'Br'),\tuse_runtime_kendrick_filter: bool = False,\tuse_min_peaks_filter: bool = True,\tmin_peaks_per_class: int = 15,\turl_database: str = 'postgresql+psycopg2://coremsappdb:coremsapppnnl@localhost:5432/coremsapp',\tdb_jobs: int = 3,\tdb_chunk_size: int = 300,\tion_charge: int = -1,\tmin_hc_filter: float = 0.3,\tmax_hc_filter: float = 3,\tmin_oc_filter: float = 0.0,\tmax_oc_filter: float = 1.2,\tmin_op_filter: float = 2,\tuse_pah_line_rule: bool = False,\tmin_dbe: float = 0,\tmax_dbe: float = 40,\tmz_error_score_weight: float = 0.6,\tisotopologue_score_weight: float = 0.4,\tadduct_atoms_neg: tuple = ('Cl', 'Br'),\tadduct_atoms_pos: tuple = ('Na', 'K'),\tscore_methods: tuple = ('S_P_lowest_error', 'N_S_P_lowest_error', 'lowest_error', 'prob_score', 'air_filter_error', 'water_filter_error', 'earth_filter_error'),\tscore_method: str = 'prob_score',\toutput_min_score: float = 0.1,\toutput_score_method: str = 'All Candidates',\tisRadical: bool = False,\tisProtonated: bool = True,\tisAdduct: bool = False,\tusedAtoms: dict = <factory>,\tionization_type: str = 'ESI',\tmin_ppm_error: float = -10.0,\tmax_ppm_error: float = 10.0,\tmin_abun_error: float = -100.0,\tmax_abun_error: float = 100.0,\tmz_error_range: float = 1.5,\terror_method: str = 'None',\tmz_error_average: float = 0.0,\tused_atom_valences: dict = <factory>)"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.use_isotopologue_filter", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.use_isotopologue_filter", "kind": "variable", "doc": "

    \n", "annotation": ": bool", "default_value": "False"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.isotopologue_filter_threshold", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.isotopologue_filter_threshold", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "33"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.isotopologue_filter_atoms", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.isotopologue_filter_atoms", "kind": "variable", "doc": "

    \n", "annotation": ": tuple", "default_value": "('Cl', 'Br')"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.use_runtime_kendrick_filter", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.use_runtime_kendrick_filter", "kind": "variable", "doc": "

    \n", "annotation": ": bool", "default_value": "False"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.use_min_peaks_filter", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.use_min_peaks_filter", "kind": "variable", "doc": "

    \n", "annotation": ": bool", "default_value": "True"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.min_peaks_per_class", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.min_peaks_per_class", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "15"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.url_database", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.url_database", "kind": "variable", "doc": "

    \n", "annotation": ": str", "default_value": "'postgresql+psycopg2://coremsappdb:coremsapppnnl@localhost:5432/coremsapp'"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.db_jobs", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.db_jobs", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "3"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.db_chunk_size", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.db_chunk_size", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "300"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.ion_charge", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.ion_charge", "kind": "variable", "doc": "

    \n", "annotation": ": int", "default_value": "-1"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.min_hc_filter", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.min_hc_filter", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.3"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.max_hc_filter", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.max_hc_filter", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "3"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.min_oc_filter", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.min_oc_filter", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.0"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.max_oc_filter", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.max_oc_filter", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "1.2"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.min_op_filter", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.min_op_filter", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "2"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.use_pah_line_rule", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.use_pah_line_rule", "kind": "variable", "doc": "

    \n", "annotation": ": bool", "default_value": "False"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.min_dbe", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.min_dbe", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.max_dbe", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.max_dbe", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "40"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.mz_error_score_weight", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.mz_error_score_weight", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.6"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.isotopologue_score_weight", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.isotopologue_score_weight", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.4"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.adduct_atoms_neg", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.adduct_atoms_neg", "kind": "variable", "doc": "

    \n", "annotation": ": tuple", "default_value": "('Cl', 'Br')"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.adduct_atoms_pos", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.adduct_atoms_pos", "kind": "variable", "doc": "

    \n", "annotation": ": tuple", "default_value": "('Na', 'K')"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.score_methods", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.score_methods", "kind": "variable", "doc": "

    \n", "annotation": ": tuple", "default_value": "('S_P_lowest_error', 'N_S_P_lowest_error', 'lowest_error', 'prob_score', 'air_filter_error', 'water_filter_error', 'earth_filter_error')"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.score_method", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.score_method", "kind": "variable", "doc": "

    \n", "annotation": ": str", "default_value": "'prob_score'"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.output_min_score", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.output_min_score", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.1"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.output_score_method", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.output_score_method", "kind": "variable", "doc": "

    \n", "annotation": ": str", "default_value": "'All Candidates'"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.isRadical", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.isRadical", "kind": "variable", "doc": "

    \n", "annotation": ": bool", "default_value": "False"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.isProtonated", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.isProtonated", "kind": "variable", "doc": "

    \n", "annotation": ": bool", "default_value": "True"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.isAdduct", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.isAdduct", "kind": "variable", "doc": "

    \n", "annotation": ": bool", "default_value": "False"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.usedAtoms", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.usedAtoms", "kind": "variable", "doc": "

    \n", "annotation": ": dict"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.ionization_type", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.ionization_type", "kind": "variable", "doc": "

    \n", "annotation": ": str", "default_value": "'ESI'"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.min_ppm_error", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.min_ppm_error", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "-10.0"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.max_ppm_error", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.max_ppm_error", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "10.0"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.min_abun_error", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.min_abun_error", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "-100.0"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.max_abun_error", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.max_abun_error", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "100.0"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.mz_error_range", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.mz_error_range", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "1.5"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.error_method", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.error_method", "kind": "variable", "doc": "

    \n", "annotation": ": str", "default_value": "'None'"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.mz_error_average", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.mz_error_average", "kind": "variable", "doc": "

    \n", "annotation": ": float", "default_value": "0.0"}, {"fullname": "corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings.used_atom_valences", "modulename": "corems.encapsulation.factory.processingSetting", "qualname": "MolecularFormulaSearchSettings.used_atom_valences", "kind": "variable", "doc": "

    \n", "annotation": ": dict"}, {"fullname": "corems.encapsulation.input", "modulename": "corems.encapsulation.input", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.encapsulation.input.parameter_from_json", "modulename": "corems.encapsulation.input.parameter_from_json", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.encapsulation.input.parameter_from_json.load_and_set_toml_parameters_ms", "modulename": "corems.encapsulation.input.parameter_from_json", "qualname": "load_and_set_toml_parameters_ms", "kind": "function", "doc": "

    Load parameters from a toml file and set the parameters in the mass_spec_obj

    \n\n
    Parameters
    \n\n
      \n
    • mass_spec_obj (MassSpectrum):\ncorems MassSpectrum object
    • \n
    • parameters_path (str, optional):\npath to the parameters file, by default False
    • \n
    \n\n
    Raises
    \n\n
      \n
    • FileNotFoundError: if the file is not found
    • \n
    \n", "signature": "(mass_spec_obj, parameters_path=False):", "funcdef": "def"}, {"fullname": "corems.encapsulation.input.parameter_from_json.load_and_set_parameters_ms", "modulename": "corems.encapsulation.input.parameter_from_json", "qualname": "load_and_set_parameters_ms", "kind": "function", "doc": "

    Load parameters from a json file and set the parameters in the mass_spec_obj

    \n\n
    Parameters
    \n\n
      \n
    • mass_spec_obj (MassSpectrum):\ncorems MassSpectrum object
    • \n
    • parameters_path (str, optional):\npath to the parameters file, by default False
    • \n
    \n\n
    Raises
    \n\n
      \n
    • FileNotFoundError: if the file is not found
    • \n
    \n", "signature": "(mass_spec_obj, parameters_path=False):", "funcdef": "def"}, {"fullname": "corems.encapsulation.input.parameter_from_json.load_and_set_toml_parameters_gcms", "modulename": "corems.encapsulation.input.parameter_from_json", "qualname": "load_and_set_toml_parameters_gcms", "kind": "function", "doc": "

    Load parameters from a toml file and set the parameters in the GCMS object

    \n\n
    Parameters
    \n\n
      \n
    • gcms_obj (GCMSBase):\ncorems GCMSBase object
    • \n
    • parameters_path (str, optional):\npath to the parameters file, by default False
    • \n
    \n\n
    Raises
    \n\n
      \n
    • FileNotFoundError: if the file is not found
    • \n
    \n", "signature": "(gcms_obj, parameters_path=False):", "funcdef": "def"}, {"fullname": "corems.encapsulation.input.parameter_from_json.load_and_set_parameters_gcms", "modulename": "corems.encapsulation.input.parameter_from_json", "qualname": "load_and_set_parameters_gcms", "kind": "function", "doc": "

    Load parameters from a json file and set the parameters in the GCMS object

    \n\n
    Parameters
    \n\n
      \n
    • gcms_obj (GCMSBase):\ncorems GCMSBase object
    • \n
    • parameters_path (str, optional):\npath to the parameters file, by default False
    • \n
    \n\n
    Raises
    \n\n
      \n
    • FileNotFoundError: if the file is not found
    • \n
    \n", "signature": "(gcms_obj, parameters_path=False):", "funcdef": "def"}, {"fullname": "corems.encapsulation.input.parameter_from_json.load_and_set_toml_parameters_class", "modulename": "corems.encapsulation.input.parameter_from_json", "qualname": "load_and_set_toml_parameters_class", "kind": "function", "doc": "

    Load parameters from a toml file and set the parameters in the instance_parameters_class

    \n\n
    Parameters
    \n\n
      \n
    • parameter_label (str):\nlabel of the parameters in the toml file
    • \n
    • instance_parameters_class (object):\ninstance of the parameters class
    • \n
    • parameters_path (str, optional):\npath to the parameters file, by default False
    • \n
    \n\n
    Raises
    \n\n
      \n
    • FileNotFoundError: if the file is not found
    • \n
    \n\n
    Returns
    \n\n
      \n
    • object: instance of the parameters class
    • \n
    \n", "signature": "(parameter_label, instance_parameters_class, parameters_path=False):", "funcdef": "def"}, {"fullname": "corems.encapsulation.input.parameter_from_json.load_and_set_parameters_class", "modulename": "corems.encapsulation.input.parameter_from_json", "qualname": "load_and_set_parameters_class", "kind": "function", "doc": "

    Load parameters from a json file and set the parameters in the instance_parameters_class

    \n\n
    Parameters
    \n\n
      \n
    • parameter_label (str):\nlabel of the parameters in the json file
    • \n
    • instance_parameters_class (object):\ninstance of the parameters class
    • \n
    • parameters_path (str, optional):\npath to the parameters file, by default False
    • \n
    \n\n
    Raises
    \n\n
      \n
    • FileNotFoundError: if the file is not found
    • \n
    \n\n
    Returns
    \n\n
      \n
    • object: instance of the parameters class
    • \n
    \n", "signature": "(parameter_label, instance_parameters_class, parameters_path=False):", "funcdef": "def"}, {"fullname": "corems.encapsulation.output", "modulename": "corems.encapsulation.output", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.encapsulation.output.parameter_to_dict", "modulename": "corems.encapsulation.output.parameter_to_dict", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.encapsulation.output.parameter_to_dict.get_dict_all_default_data", "modulename": "corems.encapsulation.output.parameter_to_dict", "qualname": "get_dict_all_default_data", "kind": "function", "doc": "

    Return a dictionary with all default parameters for MS and GCMS

    \n", "signature": "():", "funcdef": "def"}, {"fullname": "corems.encapsulation.output.parameter_to_dict.get_dict_data_ms", "modulename": "corems.encapsulation.output.parameter_to_dict", "qualname": "get_dict_data_ms", "kind": "function", "doc": "

    Return a dictionary with all parameters for MS

    \n", "signature": "(mass_spec):", "funcdef": "def"}, {"fullname": "corems.encapsulation.output.parameter_to_dict.get_dict_ms_default_data", "modulename": "corems.encapsulation.output.parameter_to_dict", "qualname": "get_dict_ms_default_data", "kind": "function", "doc": "

    Return a dictionary with all default parameters for MS including data input

    \n", "signature": "():", "funcdef": "def"}, {"fullname": "corems.encapsulation.output.parameter_to_dict.get_dict_gcms_default_data", "modulename": "corems.encapsulation.output.parameter_to_dict", "qualname": "get_dict_gcms_default_data", "kind": "function", "doc": "

    Return a dictionary with all default parameters for GCMS

    \n", "signature": "():", "funcdef": "def"}, {"fullname": "corems.encapsulation.output.parameter_to_dict.get_dict_data_gcms", "modulename": "corems.encapsulation.output.parameter_to_dict", "qualname": "get_dict_data_gcms", "kind": "function", "doc": "

    Return a dictionary with all parameters for GCMS

    \n", "signature": "(gcms):", "funcdef": "def"}, {"fullname": "corems.encapsulation.output.parameter_to_json", "modulename": "corems.encapsulation.output.parameter_to_json", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.encapsulation.output.parameter_to_json.dump_all_settings_json", "modulename": "corems.encapsulation.output.parameter_to_json", "qualname": "dump_all_settings_json", "kind": "function", "doc": "

    Write JSON file into current directory with all the default settings for the CoreMS package.

    \n\n

    Parameters:

    \n\n

    filename : str, optional\n The name of the JSON file to be created. Default is 'SettingsCoreMS.json'.\nfile_path : str or Path, optional\n The path where the JSON file will be saved. If not provided, the file will be saved in the current working directory.

    \n", "signature": "(filename='SettingsCoreMS.json', file_path=None):", "funcdef": "def"}, {"fullname": "corems.encapsulation.output.parameter_to_json.dump_ms_settings_json", "modulename": "corems.encapsulation.output.parameter_to_json", "qualname": "dump_ms_settings_json", "kind": "function", "doc": "

    Write JSON file into current directory with all the mass spectrum default settings for the CoreMS package.

    \n\n
    Parameters
    \n\n
      \n
    • filename (str, optional):\nThe name of the JSON file to be created. Default is 'SettingsCoreMS.json'.
    • \n
    • file_path (str or Path, optional):\nThe path where the JSON file will be saved. If not provided, the file will be saved in the current working directory.
    • \n
    \n", "signature": "(filename='SettingsCoreMS.json', file_path=None):", "funcdef": "def"}, {"fullname": "corems.encapsulation.output.parameter_to_json.dump_gcms_settings_json", "modulename": "corems.encapsulation.output.parameter_to_json", "qualname": "dump_gcms_settings_json", "kind": "function", "doc": "

    Write JSON file into current directory containing the default GCMS settings data.

    \n\n
    Parameters
    \n\n
      \n
    • filename (str, optional):\nThe name of the JSON file to be created. Default is 'SettingsCoreMS.json'.
    • \n
    • file_path (str or Path-like object, optional):\nThe path where the JSON file will be saved. If not provided, the file will be saved in the current working directory.
    • \n
    \n", "signature": "(filename='SettingsCoreMS.json', file_path=None):", "funcdef": "def"}, {"fullname": "corems.encapsulation.output.parameter_to_json.dump_all_settings_toml", "modulename": "corems.encapsulation.output.parameter_to_json", "qualname": "dump_all_settings_toml", "kind": "function", "doc": "

    Write TOML file into the specified file path or the current directory with all the default settings for the CoreMS package.

    \n\n
    Parameters
    \n\n
      \n
    • filename (str, optional):\nThe name of the TOML file. Defaults to 'SettingsCoreMS.toml'.
    • \n
    • file_path (str or Path, optional):\nThe path where the TOML file will be saved. If not provided, the file will be saved in the current directory.
    • \n
    \n", "signature": "(filename='SettingsCoreMS.toml', file_path=None):", "funcdef": "def"}, {"fullname": "corems.encapsulation.output.parameter_to_json.dump_ms_settings_toml", "modulename": "corems.encapsulation.output.parameter_to_json", "qualname": "dump_ms_settings_toml", "kind": "function", "doc": "

    Write TOML file into the current directory with all the mass spectrum default settings for the CoreMS package.

    \n\n
    Parameters
    \n\n
      \n
    • filename (str, optional):\nThe name of the TOML file to be created. Default is 'SettingsCoreMS.toml'.
    • \n
    • file_path (str or Path, optional):\nThe path where the TOML file should be saved. If not provided, the file will be saved in the current working directory.
    • \n
    \n", "signature": "(filename='SettingsCoreMS.toml', file_path=None):", "funcdef": "def"}, {"fullname": "corems.encapsulation.output.parameter_to_json.dump_gcms_settings_toml", "modulename": "corems.encapsulation.output.parameter_to_json", "qualname": "dump_gcms_settings_toml", "kind": "function", "doc": "

    Write TOML file into current directory containing the default GCMS settings data.

    \n\n
    Parameters
    \n\n
      \n
    • filename (str, optional):\nThe name of the TOML file. Defaults to 'SettingsCoreMS.toml'.
    • \n
    • file_path (str or Path, optional):\nThe path where the TOML file will be saved. If not provided, the file will be saved in the current working directory.
    • \n
    \n", "signature": "(filename='SettingsCoreMS.toml', file_path=None):", "funcdef": "def"}, {"fullname": "corems.mass_spectra", "modulename": "corems.mass_spectra", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc", "modulename": "corems.mass_spectra.calc", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc.GC_Calc", "modulename": "corems.mass_spectra.calc.GC_Calc", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc.GC_Calc.GC_Calculations", "modulename": "corems.mass_spectra.calc.GC_Calc", "qualname": "GC_Calculations", "kind": "class", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc.GC_Calc.GC_Calculations.calibrate_ri", "modulename": "corems.mass_spectra.calc.GC_Calc", "qualname": "GC_Calculations.calibrate_ri", "kind": "function", "doc": "

    \n", "signature": "(self, ref_dict, cal_file_path):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.GC_Calc.GC_Calculations.smooth_tic", "modulename": "corems.mass_spectra.calc.GC_Calc", "qualname": "GC_Calculations.smooth_tic", "kind": "function", "doc": "

    \n", "signature": "(self, tic):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.GC_Calc.GC_Calculations.centroid_detector", "modulename": "corems.mass_spectra.calc.GC_Calc", "qualname": "GC_Calculations.centroid_detector", "kind": "function", "doc": "

    \n", "signature": "(self, tic, rt):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.GC_Calc.GC_Calculations.remove_outliers", "modulename": "corems.mass_spectra.calc.GC_Calc", "qualname": "GC_Calculations.remove_outliers", "kind": "function", "doc": "

    \n", "signature": "(self, data):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.GC_Deconvolution", "modulename": "corems.mass_spectra.calc.GC_Deconvolution", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc.GC_Deconvolution.MassDeconvolution", "modulename": "corems.mass_spectra.calc.GC_Deconvolution", "qualname": "MassDeconvolution", "kind": "class", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc.GC_Deconvolution.MassDeconvolution.run_deconvolution", "modulename": "corems.mass_spectra.calc.GC_Deconvolution", "qualname": "MassDeconvolution.run_deconvolution", "kind": "function", "doc": "

    \n", "signature": "(self, plot_res=False):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.GC_Deconvolution.MassDeconvolution.centroid_detector", "modulename": "corems.mass_spectra.calc.GC_Deconvolution", "qualname": "MassDeconvolution.centroid_detector", "kind": "function", "doc": "

    this function has been replaced with sp.peak_picking_first_derivative\nand it not used

    \n", "signature": "(self, tic, rt):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.GC_Deconvolution.MassDeconvolution.ion_extracted_chroma", "modulename": "corems.mass_spectra.calc.GC_Deconvolution", "qualname": "MassDeconvolution.ion_extracted_chroma", "kind": "function", "doc": "

    \n", "signature": "(self, mass_spectra_obj):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.GC_Deconvolution.MassDeconvolution.hc", "modulename": "corems.mass_spectra.calc.GC_Deconvolution", "qualname": "MassDeconvolution.hc", "kind": "function", "doc": "

    \n", "signature": "(self, X, Y, max_rt_distance=0.025):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.GC_Deconvolution.MassDeconvolution.find_peaks_entity", "modulename": "corems.mass_spectra.calc.GC_Deconvolution", "qualname": "MassDeconvolution.find_peaks_entity", "kind": "function", "doc": "

    combine eic with mathing rt apexes

    \n", "signature": "(self, eic_dict):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.GC_Deconvolution.MassDeconvolution.mass_spec_factory", "modulename": "corems.mass_spectra.calc.GC_Deconvolution", "qualname": "MassDeconvolution.mass_spec_factory", "kind": "function", "doc": "

    \n", "signature": "(self, rt, datadict):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.GC_Deconvolution.MassDeconvolution.smooth_signal", "modulename": "corems.mass_spectra.calc.GC_Deconvolution", "qualname": "MassDeconvolution.smooth_signal", "kind": "function", "doc": "

    \n", "signature": "(self, signal):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.GC_Deconvolution.MassDeconvolution.add_gcpeak", "modulename": "corems.mass_spectra.calc.GC_Deconvolution", "qualname": "MassDeconvolution.add_gcpeak", "kind": "function", "doc": "

    \n", "signature": "(\tself,\tnew_apex_index,\tstart_rt,\tfinal_rt,\tpeak_rt,\tsmoothed_tic,\tdatadict,\tplot_res):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.GC_Deconvolution.MassDeconvolution.deconvolution", "modulename": "corems.mass_spectra.calc.GC_Deconvolution", "qualname": "MassDeconvolution.deconvolution", "kind": "function", "doc": "

    \n", "signature": "(self, peaks_entity_data, plot_res):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.GC_Deconvolution.MassDeconvolution.quadratic_interpolation", "modulename": "corems.mass_spectra.calc.GC_Deconvolution", "qualname": "MassDeconvolution.quadratic_interpolation", "kind": "function", "doc": "

    \n", "signature": "(self, rt_list, tic_list, apex_index):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.GC_RI_Calibration", "modulename": "corems.mass_spectra.calc.GC_RI_Calibration", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc.GC_RI_Calibration.get_rt_ri_pairs", "modulename": "corems.mass_spectra.calc.GC_RI_Calibration", "qualname": "get_rt_ri_pairs", "kind": "function", "doc": "

    \n", "signature": "(gcms_ref_obj, sql_obj=None):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.LC_Calc", "modulename": "corems.mass_spectra.calc.LC_Calc", "kind": "module", "doc": "

    Created on Jun 14, 2019

    \n\n

    @author: eber373

    \n"}, {"fullname": "corems.mass_spectra.calc.LC_Calc.LC_Calculations", "modulename": "corems.mass_spectra.calc.LC_Calc", "qualname": "LC_Calculations", "kind": "class", "doc": "

    classdocs

    \n"}, {"fullname": "corems.mass_spectra.calc.LC_Calc.LC_Calculations.get_max_eic", "modulename": "corems.mass_spectra.calc.LC_Calc", "qualname": "LC_Calculations.get_max_eic", "kind": "function", "doc": "

    \n", "signature": "(eic_data: dict):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.LC_Calc.LC_Calculations.smooth_tic", "modulename": "corems.mass_spectra.calc.LC_Calc", "qualname": "LC_Calculations.smooth_tic", "kind": "function", "doc": "

    \n", "signature": "(self, tic):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.LC_Calc.LC_Calculations.eic_centroid_detector", "modulename": "corems.mass_spectra.calc.LC_Calc", "qualname": "LC_Calculations.eic_centroid_detector", "kind": "function", "doc": "

    \n", "signature": "(self, rt, eic, max_eic):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.LC_Calc.LC_Calculations.centroid_detector", "modulename": "corems.mass_spectra.calc.LC_Calc", "qualname": "LC_Calculations.centroid_detector", "kind": "function", "doc": "

    \n", "signature": "(self, rt, tic):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.LC_Calc.LC_Calculations.find_nearest_scan", "modulename": "corems.mass_spectra.calc.LC_Calc", "qualname": "LC_Calculations.find_nearest_scan", "kind": "function", "doc": "

    \n", "signature": "(self, rt):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.LF_Targeted", "modulename": "corems.mass_spectra.calc.LF_Targeted", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc.LF_Targeted.LossFinderTargeted", "modulename": "corems.mass_spectra.calc.LF_Targeted", "qualname": "LossFinderTargeted", "kind": "class", "doc": "

    \n", "bases": "corems.mass_spectra.calc.GC_Calc.GC_Calculations"}, {"fullname": "corems.mass_spectra.calc.LF_Targeted.LossFinderTargeted.__init__", "modulename": "corems.mass_spectra.calc.LF_Targeted", "qualname": "LossFinderTargeted.__init__", "kind": "function", "doc": "

    \n", "signature": "(ref_file='Unknown', noise_cutoff='Unknown', tolerance='Unknown')"}, {"fullname": "corems.mass_spectra.calc.LF_Targeted.LossFinderTargeted.tolerance", "modulename": "corems.mass_spectra.calc.LF_Targeted", "qualname": "LossFinderTargeted.tolerance", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc.LF_Targeted.LossFinderTargeted.noise_cutoff", "modulename": "corems.mass_spectra.calc.LF_Targeted", "qualname": "LossFinderTargeted.noise_cutoff", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc.LF_Targeted.LossFinderTargeted.offset_hits", "modulename": "corems.mass_spectra.calc.LF_Targeted", "qualname": "LossFinderTargeted.offset_hits", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc.LF_Targeted.LossFinderTargeted.mz_filtered", "modulename": "corems.mass_spectra.calc.LF_Targeted", "qualname": "LossFinderTargeted.mz_filtered", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc.LF_Targeted.LossFinderTargeted.abund_filtered", "modulename": "corems.mass_spectra.calc.LF_Targeted", "qualname": "LossFinderTargeted.abund_filtered", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc.LF_Targeted.LossFinderTargeted.mz_count", "modulename": "corems.mass_spectra.calc.LF_Targeted", "qualname": "LossFinderTargeted.mz_count", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc.LF_Targeted.LossFinderTargeted.ms_info_get", "modulename": "corems.mass_spectra.calc.LF_Targeted", "qualname": "LossFinderTargeted.ms_info_get", "kind": "function", "doc": "

    \n", "signature": "(self, mass_spectra_obj):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.LF_Targeted.LossFinderTargeted.loss_ref_get", "modulename": "corems.mass_spectra.calc.LF_Targeted", "qualname": "LossFinderTargeted.loss_ref_get", "kind": "function", "doc": "

    \n", "signature": "(self, file_location, tolerance):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.LF_Targeted.LossFinderTargeted.threshold_filter", "modulename": "corems.mass_spectra.calc.LF_Targeted", "qualname": "LossFinderTargeted.threshold_filter", "kind": "function", "doc": "

    \n", "signature": "(self, mz_dict, Intensity, noise_cutoff):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.LF_Targeted.LossFinderTargeted.mz_pair_checker", "modulename": "corems.mass_spectra.calc.LF_Targeted", "qualname": "LossFinderTargeted.mz_pair_checker", "kind": "function", "doc": "

    \n", "signature": "(self, chem, lower, upper, mz1, spectrum, Intensity, scan_number):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.LF_Targeted.LossFinderTargeted.findpeakoffset", "modulename": "corems.mass_spectra.calc.LF_Targeted", "qualname": "LossFinderTargeted.findpeakoffset", "kind": "function", "doc": "

    \n", "signature": "(self, range_ref, mz_filtered, abund_filtered):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.LF_Targeted.LossFinderTargeted.LF_out", "modulename": "corems.mass_spectra.calc.LF_Targeted", "qualname": "LossFinderTargeted.LF_out", "kind": "function", "doc": "

    \n", "signature": "(self, LF_dict, mz_count):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.LF_Targeted.LossFinderTargeted.plot_offset", "modulename": "corems.mass_spectra.calc.LF_Targeted", "qualname": "LossFinderTargeted.plot_offset", "kind": "function", "doc": "

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.MZSearch", "modulename": "corems.mass_spectra.calc.MZSearch", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc.MZSearch.SearchResults", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "SearchResults", "kind": "class", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc.MZSearch.SearchResults.__init__", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "SearchResults.__init__", "kind": "function", "doc": "

    \n", "signature": "(calculated_mz: float, exp_mz: float, error: float, tolerance: float)"}, {"fullname": "corems.mass_spectra.calc.MZSearch.SearchResults.calculated_mz", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "SearchResults.calculated_mz", "kind": "variable", "doc": "

    \n", "annotation": ": float"}, {"fullname": "corems.mass_spectra.calc.MZSearch.SearchResults.exp_mz", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "SearchResults.exp_mz", "kind": "variable", "doc": "

    \n", "annotation": ": float"}, {"fullname": "corems.mass_spectra.calc.MZSearch.SearchResults.error", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "SearchResults.error", "kind": "variable", "doc": "

    \n", "annotation": ": float"}, {"fullname": "corems.mass_spectra.calc.MZSearch.SearchResults.tolerance", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "SearchResults.tolerance", "kind": "variable", "doc": "

    \n", "annotation": ": float"}, {"fullname": "corems.mass_spectra.calc.MZSearch.MZSearch", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "MZSearch", "kind": "class", "doc": "

    A class that represents a thread of control.

    \n\n

    This class can be safely subclassed in a limited fashion. There are two ways\nto specify the activity: by passing a callable object to the constructor, or\nby overriding the run() method in a subclass.

    \n", "bases": "threading.Thread"}, {"fullname": "corems.mass_spectra.calc.MZSearch.MZSearch.__init__", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "MZSearch.__init__", "kind": "function", "doc": "
    Parameters
    \n\n
      \n
    • calculated_mzs ([float] calculated m/z):

    • \n
    • exp_mzs ([float] experimental m/z):

    • \n
    • method (string,):\nppm or ppb

    • \n
    • call run to trigger the m/z search algorithm
    • \n
    • or start if using it as thread
    • \n
    \n", "signature": "(\texp_mzs: List[float],\tcalculated_mzs: List[float],\ttolerance,\tmethod='ppm',\taverage_target_mz=True)"}, {"fullname": "corems.mass_spectra.calc.MZSearch.MZSearch.method", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "MZSearch.method", "kind": "variable", "doc": "

    method: string,\n ppm or ppb

    \n"}, {"fullname": "corems.mass_spectra.calc.MZSearch.MZSearch.results", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "MZSearch.results", "kind": "variable", "doc": "

    {calculated_mz: [SearchResults]}\ncontains the results of the search

    \n"}, {"fullname": "corems.mass_spectra.calc.MZSearch.MZSearch.averaged_target_mz", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "MZSearch.averaged_target_mz", "kind": "variable", "doc": "

    [float]\ncontains the average target m/z to be searched against

    \n"}, {"fullname": "corems.mass_spectra.calc.MZSearch.MZSearch.calculated_mzs", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "MZSearch.calculated_mzs", "kind": "variable", "doc": "

    [float]\ncontains the mz target to be searched against

    \n"}, {"fullname": "corems.mass_spectra.calc.MZSearch.MZSearch.exp_mzs", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "MZSearch.exp_mzs", "kind": "variable", "doc": "

    [float]\ncontains the exp mz to be searched against

    \n"}, {"fullname": "corems.mass_spectra.calc.MZSearch.MZSearch.tolerance", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "MZSearch.tolerance", "kind": "variable", "doc": "

    method: string,\n ppm or ppb

    \n"}, {"fullname": "corems.mass_spectra.calc.MZSearch.MZSearch.colapse_calculated", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "MZSearch.colapse_calculated", "kind": "function", "doc": "

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.MZSearch.MZSearch.run", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "MZSearch.run", "kind": "function", "doc": "

    Method representing the thread's activity.

    \n\n

    You may override this method in a subclass. The standard run() method\ninvokes the callable object passed to the object's constructor as the\ntarget argument, if any, with sequential and keyword arguments taken\nfrom the args and kwargs arguments, respectively.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.MZSearch.MZSearch.calc_mz_error", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "MZSearch.calc_mz_error", "kind": "function", "doc": "
    Parameters
    \n\n
      \n
    • calculated_mz (float,):

    • \n
    • exp_mz (float):

    • \n
    • method (string,):\nppm or ppb

    • \n
    \n", "signature": "(calculated_mz, exp_mz, method='ppm'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.MZSearch.MZSearch.check_ppm_error", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "MZSearch.check_ppm_error", "kind": "function", "doc": "

    \n", "signature": "(tolerance, error):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.MZSearch.MZSearch.get_nominal_exp", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "MZSearch.get_nominal_exp", "kind": "function", "doc": "

    \n", "signature": "(self, exp_mzs) -> dict:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.MZSearch.MZSearch.search_mz", "modulename": "corems.mass_spectra.calc.MZSearch", "qualname": "MZSearch.search_mz", "kind": "function", "doc": "

    \n", "signature": "(self, results, dict_nominal_exp_mz, calculated_mz, offset) -> None:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.SignalProcessing", "modulename": "corems.mass_spectra.calc.SignalProcessing", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.calc.SignalProcessing.peak_detector", "modulename": "corems.mass_spectra.calc.SignalProcessing", "qualname": "peak_detector", "kind": "function", "doc": "

    \n", "signature": "(tic, max_tic):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.SignalProcessing.find_nearest_scan", "modulename": "corems.mass_spectra.calc.SignalProcessing", "qualname": "find_nearest_scan", "kind": "function", "doc": "

    \n", "signature": "(data, nodes):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.SignalProcessing.peak_picking_first_derivative", "modulename": "corems.mass_spectra.calc.SignalProcessing", "qualname": "peak_picking_first_derivative", "kind": "function", "doc": "

    \n", "signature": "(\tdomain,\tsignal,\tmax_height,\tmax_prominence,\tmax_signal,\tmin_peak_datapoints,\tpeak_derivative_thresould,\tsignal_threshold=0.1,\tcorrect_baseline=True,\tplot_res=False,\tabun_norm=100,\tcheck_abundance=False):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.SignalProcessing.find_minima", "modulename": "corems.mass_spectra.calc.SignalProcessing", "qualname": "find_minima", "kind": "function", "doc": "

    \n", "signature": "(index, tic, right=True):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.SignalProcessing.derivate", "modulename": "corems.mass_spectra.calc.SignalProcessing", "qualname": "derivate", "kind": "function", "doc": "

    \n", "signature": "(data_array):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.SignalProcessing.minima_detector", "modulename": "corems.mass_spectra.calc.SignalProcessing", "qualname": "minima_detector", "kind": "function", "doc": "

    \n", "signature": "(tic, max_tic, peak_height_max_percent, peak_max_prominence_percent):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.SignalProcessing.baseline_detector", "modulename": "corems.mass_spectra.calc.SignalProcessing", "qualname": "baseline_detector", "kind": "function", "doc": "

    \n", "signature": "(\ttic,\trt,\tpeak_height_max_percent,\tpeak_max_prominence_percent,\tdo_interpolation=True):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.SignalProcessing.peak_detector_generator", "modulename": "corems.mass_spectra.calc.SignalProcessing", "qualname": "peak_detector_generator", "kind": "function", "doc": "

    \n", "signature": "(\ttic,\tstds,\tmethod,\trt,\tmax_height,\tmin_height,\tmax_prominence,\tmin_datapoints):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.SignalProcessing.smooth_signal", "modulename": "corems.mass_spectra.calc.SignalProcessing", "qualname": "smooth_signal", "kind": "function", "doc": "

    smooth the data using a window with requested size.

    \n\n

    This method is based on the convolution of a scaled window with the signal.\nThe signal is prepared by introducing reflected copies of the signal \n(with the window size) in both ends so that transient parts are minimized\nin the begining and end part of the output signal.

    \n\n

    output:\n the smoothed signal

    \n\n

    see also:

    \n\n

    numpy.hanning, numpy.hamming, numpy.bartlett, numpy.blackman, numpy.convolve\nscipy.signal.savgol_filter

    \n", "signature": "(x, window_len, window, pol_order, implemented_smooth_method):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.calc.SignalProcessing.second_derivative_threshold", "modulename": "corems.mass_spectra.calc.SignalProcessing", "qualname": "second_derivative_threshold", "kind": "function", "doc": "

    \n", "signature": "(tic, stds, rt, peak_height_max_percent, peak_max_prominence_percent):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory", "modulename": "corems.mass_spectra.factory", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class", "modulename": "corems.mass_spectra.factory.GC_Class", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase", "kind": "class", "doc": "

    Base class for GC-MS data processing.

    \n\n
    Parameters
    \n\n
      \n
    • file_location (str, pathlib.Path, or s3path.S3Path):\nPath object containing the file location.
    • \n
    • analyzer (str, optional):\nName of the analyzer. Defaults to 'Unknown'.
    • \n
    • instrument_label (str, optional):\nLabel of the instrument. Defaults to 'Unknown'.
    • \n
    • sample_name (str, optional):\nName of the sample. If not provided, it is derived from the file location.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • file_location (pathlib.Path):\nPath object containing the file location.
    • \n
    • sample_name (str):\nName of the sample.
    • \n
    • analyzer (str):\nName of the analyzer.
    • \n
    • instrument_label (str):\nLabel of the instrument.
    • \n
    • gcpeaks (list):\nList of GCPeak objects.
    • \n
    • ri_pairs_ref (None):\nReference retention index pairs.
    • \n
    • cal_file_path (None):\nCalibration file path.
    • \n
    • _parameters (GCMSParameters):\nGC-MS parameters.
    • \n
    • _retention_time_list (list):\nList of retention times.
    • \n
    • _scans_number_list (list):\nList of scan numbers.
    • \n
    • _tic_list (list):\nList of total ion chromatogram values.
    • \n
    • _ms (dict):\nDictionary containing all mass spectra.
    • \n
    • _processed_tic (list):\nList of processed total ion chromatogram values.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • process_chromatogram(plot_res=False). Process the chromatogram.
    • \n
    • plot_gc_peaks(ax=None, color='red'). Plot the GC peaks.
    • \n
    \n", "bases": "corems.mass_spectra.calc.GC_Calc.GC_Calculations, corems.mass_spectra.calc.GC_Deconvolution.MassDeconvolution"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.__init__", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tfile_location,\tanalyzer='Unknown',\tinstrument_label='Unknown',\tsample_name=None)"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.file_location", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.file_location", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.analyzer", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.analyzer", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.instrument_label", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.instrument_label", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.gcpeaks", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.gcpeaks", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.ri_pairs_ref", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.ri_pairs_ref", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.cal_file_path", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.cal_file_path", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.process_chromatogram", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.process_chromatogram", "kind": "function", "doc": "

    Process the chromatogram.

    \n\n

    This method processes the chromatogram.

    \n\n
    Parameters
    \n\n
      \n
    • plot_res (bool, optional):\nIf True, plot the results. Defaults to False.
    • \n
    \n", "signature": "(self, plot_res=False):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.add_mass_spectrum", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.add_mass_spectrum", "kind": "function", "doc": "

    Add a mass spectrum to the GC-MS object.

    \n\n

    This method adds a mass spectrum to the GC-MS object.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spec (MassSpectrum):\nMass spectrum to be added.
    • \n
    \n", "signature": "(self, mass_spec):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.set_tic_list_from_data", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.set_tic_list_from_data", "kind": "function", "doc": "

    Set the total ion chromatogram list from the mass spectra data within the GC-MS data object.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.set_retention_time_from_data", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.set_retention_time_from_data", "kind": "function", "doc": "

    Set the retention time list from the mass spectra data within the GC-MS data object.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.set_scans_number_from_data", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.set_scans_number_from_data", "kind": "function", "doc": "

    Set the scan number list from the mass spectra data within the GC-MS data object.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.parameter", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.parameter", "kind": "variable", "doc": "

    GCMS Parameters

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.molecular_search_settings", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.molecular_search_settings", "kind": "variable", "doc": "

    Molecular Search Settings

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.chromatogram_settings", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.chromatogram_settings", "kind": "variable", "doc": "

    Chromatogram Settings

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.scans_number", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.scans_number", "kind": "variable", "doc": "

    Scans Number

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.retention_time", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.retention_time", "kind": "variable", "doc": "

    Retention Time

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.processed_tic", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.processed_tic", "kind": "variable", "doc": "

    Processed Total Ion Current

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.tic", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.tic", "kind": "variable", "doc": "

    Total Ion Current

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.max_tic", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.max_tic", "kind": "variable", "doc": "

    Maximum Total Ion Current

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.min_tic", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.min_tic", "kind": "variable", "doc": "

    Minimum Total Ion Current

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.dynamic_range", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.dynamic_range", "kind": "variable", "doc": "

    Dynamic Range of the Total Ion Current

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.matched_peaks", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.matched_peaks", "kind": "variable", "doc": "

    Matched Peaks

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.sorted_gcpeaks", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.sorted_gcpeaks", "kind": "variable", "doc": "

    Sorted GC Peaks, by retention time

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.unique_metabolites", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.unique_metabolites", "kind": "variable", "doc": "

    Unique Metabolites

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.metabolites_data", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.metabolites_data", "kind": "variable", "doc": "

    Metabolites Data

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.no_matched_peaks", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.no_matched_peaks", "kind": "variable", "doc": "

    Peaks with no Matched Metabolites

    \n"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.plot_gc_peaks", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.plot_gc_peaks", "kind": "function", "doc": "

    Plot the GC peaks.

    \n\n

    This method plots the GC peaks.

    \n\n
    Parameters
    \n\n
      \n
    • ax (matplotlib.axes.Axes, optional):\nAxes object to plot the GC peaks. Defaults to None.
    • \n
    • color (str, optional):\nColor of the GC peaks. Defaults to 'red'.
    • \n
    \n", "signature": "(self, ax=None, color='red'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.to_excel", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.to_excel", "kind": "function", "doc": "

    Export the GC-MS data to an Excel file.

    \n\n

    This method exports the GC-MS data to an Excel file.

    \n\n
    Parameters
    \n\n
      \n
    • out_file_path (str, pathlib.Path, or s3path.S3Path):\nPath object containing the file location.
    • \n
    • write_mode (str, optional):\nWrite mode. Defaults to 'ab'.
    • \n
    • write_metadata (bool, optional):\nIf True, write the metadata. Defaults to True.
    • \n
    • id_label (str, optional):\nLabel of the ID. Defaults to 'corems:'.
    • \n
    \n", "signature": "(\tself,\tout_file_path,\twrite_mode='ab',\twrite_metadata=True,\tid_label='corems:'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.to_csv", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.to_csv", "kind": "function", "doc": "

    Export the GC-MS data to a CSV file.

    \n\n
    Parameters
    \n\n
      \n
    • out_file_path (str, pathlib.Path, or s3path.S3Path):\nPath object containing the file location.
    • \n
    • separate_output (bool, optional):\nIf True, separate the output. Defaults to False.
    • \n
    • write_metadata (bool, optional):\nIf True, write the metadata. Defaults to True.
    • \n
    \n", "signature": "(\tself,\tout_file_path,\tseparate_output=False,\twrite_metadata=True,\tid_label='corems:'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.to_pandas", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.to_pandas", "kind": "function", "doc": "

    Export the GC-MS data to a Pandas dataframe.

    \n\n
    Parameters
    \n\n
      \n
    • out_file_path (str, pathlib.Path, or s3path.S3Path):\nPath object containing the file location.
    • \n
    • write_metadata (bool, optional):\nIf True, write the metadata. Defaults to True.
    • \n
    • id_label (str, optional):\nLabel of the ID. Defaults to 'corems:'.
    • \n
    \n", "signature": "(self, out_file_path, write_metadata=True, id_label='corems:'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.to_dataframe", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.to_dataframe", "kind": "function", "doc": "

    Export the GC-MS data to a Pandas dataframe.

    \n\n
    Parameters
    \n\n
      \n
    • id_label (str, optional):\nLabel of the ID. Defaults to 'corems:'.
    • \n
    \n", "signature": "(self, id_label='corems:'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.processing_stats", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.processing_stats", "kind": "function", "doc": "

    Return the processing statistics.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.parameters_json", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.parameters_json", "kind": "function", "doc": "

    Return the parameters in JSON format.

    \n\n
    Parameters
    \n\n
      \n
    • id_label (str, optional):\nLabel of the ID. Defaults to 'corems:'.
    • \n
    • output_path (str, optional):\nPath object containing the file location. Defaults to \" \".
    • \n
    \n", "signature": "(self, id_label='corems:', output_path=' '):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.to_json", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.to_json", "kind": "function", "doc": "

    Export the GC-MS data to a JSON file.

    \n\n
    Parameters
    \n\n
      \n
    • id_label (str, optional):\nLabel of the ID. Defaults to 'corems:'.
    • \n
    \n", "signature": "(self, id_label='corems:'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.to_hdf", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.to_hdf", "kind": "function", "doc": "

    Export the GC-MS data to a HDF file.

    \n\n
    Parameters
    \n\n
      \n
    • id_label (str, optional):\nLabel of the ID. Defaults to 'corems:'.
    • \n
    \n", "signature": "(self, id_label='corems:'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.plot_chromatogram", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.plot_chromatogram", "kind": "function", "doc": "

    Plot the chromatogram.

    \n\n
    Parameters
    \n\n
      \n
    • ax (matplotlib.axes.Axes, optional):\nAxes object to plot the chromatogram. Defaults to None.
    • \n
    • color (str, optional):\nColor of the chromatogram. Defaults to 'blue'.
    • \n
    \n", "signature": "(self, ax=None, color='blue'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.plot_smoothed_chromatogram", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.plot_smoothed_chromatogram", "kind": "function", "doc": "

    Plot the smoothed chromatogram.

    \n\n
    Parameters
    \n\n
      \n
    • ax (matplotlib.axes.Axes, optional):\nAxes object to plot the smoothed chromatogram. Defaults to None.
    • \n
    • color (str, optional):\nColor of the smoothed chromatogram. Defaults to 'green'.
    • \n
    \n", "signature": "(self, ax=None, color='green'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.plot_detected_baseline", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.plot_detected_baseline", "kind": "function", "doc": "

    Plot the detected baseline.

    \n\n
    Parameters
    \n\n
      \n
    • ax (matplotlib.axes.Axes, optional):\nAxes object to plot the detected baseline. Defaults to None.
    • \n
    • color (str, optional):\nColor of the detected baseline. Defaults to 'blue'.
    • \n
    \n", "signature": "(self, ax=None, color='blue'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.plot_baseline_subtraction", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.plot_baseline_subtraction", "kind": "function", "doc": "

    Plot the baseline subtraction.

    \n\n
    Parameters
    \n\n
      \n
    • ax (matplotlib.axes.Axes, optional):\nAxes object to plot the baseline subtraction. Defaults to None.
    • \n
    • color (str, optional):\nColor of the baseline subtraction. Defaults to 'black'.
    • \n
    \n", "signature": "(self, ax=None, color='black'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.peaks_rt_tic", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.peaks_rt_tic", "kind": "function", "doc": "

    Return the peaks, retention time, and total ion chromatogram.

    \n\n
    Parameters
    \n\n
      \n
    • json_string (bool, optional):\nIf True, return the peaks, retention time, and total ion chromatogram in JSON format. Defaults to False.
    • \n
    \n", "signature": "(self, json_string=False):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.GC_Class.GCMSBase.plot_processed_chromatogram", "modulename": "corems.mass_spectra.factory.GC_Class", "qualname": "GCMSBase.plot_processed_chromatogram", "kind": "function", "doc": "

    Plot the processed chromatogram.

    \n\n
    Parameters
    \n\n
      \n
    • ax (matplotlib.axes.Axes, optional):\nAxes object to plot the processed chromatogram. Defaults to None.
    • \n
    • color (str, optional):\nColor of the processed chromatogram. Defaults to 'black'.
    • \n
    \n", "signature": "(self, ax=None, color='black'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.LC_Class", "modulename": "corems.mass_spectra.factory.LC_Class", "kind": "module", "doc": "

    Created on Oct 15, 2021

    \n"}, {"fullname": "corems.mass_spectra.factory.LC_Class.LCMSBase", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "LCMSBase", "kind": "class", "doc": "

    classdocs

    \n", "bases": "collections.abc.Mapping, corems.mass_spectra.calc.LC_Calc.LC_Calculations"}, {"fullname": "corems.mass_spectra.factory.LC_Class.LCMSBase.__init__", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "LCMSBase.__init__", "kind": "function", "doc": "

    Parameters

    \n\n
       ----------\n   file_location: text,  pathlib.Path(), or s3path.S3Path\n
    \n\n

    Path object from pathlib containing the file location

    \n", "signature": "(\tfile_location,\tanalyzer='Unknown',\tinstrument_label='Unknown',\tsample_name=None)"}, {"fullname": "corems.mass_spectra.factory.LC_Class.LCMSBase.file_location", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "LCMSBase.file_location", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.LC_Class.LCMSBase.analyzer", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "LCMSBase.analyzer", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.LC_Class.LCMSBase.instrument_label", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "LCMSBase.instrument_label", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.LC_Class.LCMSBase.add_mass_spectrum", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "LCMSBase.add_mass_spectrum", "kind": "function", "doc": "

    \n", "signature": "(self, mass_spec):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.LC_Class.LCMSBase.set_tic_list_from_data", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "LCMSBase.set_tic_list_from_data", "kind": "function", "doc": "

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.LC_Class.LCMSBase.set_retention_time_from_data", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "LCMSBase.set_retention_time_from_data", "kind": "function", "doc": "

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.LC_Class.LCMSBase.set_scans_number_from_data", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "LCMSBase.set_scans_number_from_data", "kind": "function", "doc": "

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.LC_Class.LCMSBase.scans_number", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "LCMSBase.scans_number", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.LC_Class.LCMSBase.retention_time", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "LCMSBase.retention_time", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.LC_Class.LCMSBase.tic", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "LCMSBase.tic", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.LC_Class.DataDependentLCMS", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "DataDependentLCMS", "kind": "class", "doc": "

    classdocs

    \n", "bases": "corems.mass_spectra.calc.LC_Calc.LC_Calculations"}, {"fullname": "corems.mass_spectra.factory.LC_Class.DataDependentLCMS.__init__", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "DataDependentLCMS.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tfile_location,\ttarget_mzs: List[float],\tparser,\tanalyzer: str = 'Unknown',\tinstrument_label: str = 'Unknown',\tsample_name: str = None)"}, {"fullname": "corems.mass_spectra.factory.LC_Class.DataDependentLCMS.file_location", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "DataDependentLCMS.file_location", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.LC_Class.DataDependentLCMS.add_peak", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "DataDependentLCMS.add_peak", "kind": "function", "doc": "

    \n", "signature": "(self, mass_spectrum, peak_scans, eic_data, possible_molform=None):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.LC_Class.DataDependentLCMS.ms1_molecular_search_settings", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "DataDependentLCMS.ms1_molecular_search_settings", "kind": "variable", "doc": "

    \n", "annotation": ": corems.encapsulation.factory.processingSetting.MolecularFormulaSearchSettings"}, {"fullname": "corems.mass_spectra.factory.LC_Class.DataDependentLCMS.chromatogram_settings", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "DataDependentLCMS.chromatogram_settings", "kind": "variable", "doc": "

    \n", "annotation": ": corems.encapsulation.factory.processingSetting.LiquidChromatographSetting"}, {"fullname": "corems.mass_spectra.factory.LC_Class.DataDependentLCMS.parameters", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "DataDependentLCMS.parameters", "kind": "variable", "doc": "

    \n", "annotation": ": corems.encapsulation.factory.parameters.LCMSParameters"}, {"fullname": "corems.mass_spectra.factory.LC_Class.DataDependentLCMS.eic_scans_number", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "DataDependentLCMS.eic_scans_number", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.LC_Class.DataDependentLCMS.scans_number", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "DataDependentLCMS.scans_number", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.LC_Class.DataDependentLCMS.retention_time", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "DataDependentLCMS.retention_time", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.LC_Class.DataDependentLCMS.tic", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "DataDependentLCMS.tic", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.LC_Class.DataDependentLCMS.get_tic", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "DataDependentLCMS.get_tic", "kind": "function", "doc": "

    ms_type: str ('MS', MS2')\nstart_scan: int default -1 will select the lowest available\nend_scan: int default -1 will select the highest available\nreturns:\n chroma: dict\n {\n Scan: [int]\n original thermo scan numberMS\n Time: [floats]\n list of retention times\n TIC: [floats]\n total ion chromatogram\n Apexes: [int]
    \n original thermo apex scan number after peak picking
    \n }

    \n", "signature": "(\tself,\tms_type='MS !d',\tpeak_detection=True,\tsmooth=True,\tplot=False,\tax=None) -> Tuple[corems.mass_spectra.factory.LC_Temp.TIC_Data, matplotlib.axes._axes.Axes]:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.LC_Class.DataDependentLCMS.get_eics", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "DataDependentLCMS.get_eics", "kind": "function", "doc": "

    ms_type: str ('MS', MS2')\nstart_scan: int default -1 will select the lowest available\nend_scan: int default -1 will select the highest available

    \n\n

    returns:

    \n\n
    chroma: dict{target_mz: EIC_Data(\n                            Scans: [int]\n                                original thermo scan numbers\n                            Time: [floats]\n                                list of retention times\n                            TIC: [floats]\n                                total ion chromatogram\n                            Apexes: [int]    \n                                original thermo apex scan number after peak picking \n                            )\n
    \n", "signature": "(\tself,\ttic_data: dict,\tms_type='MS !d',\tpeak_detection=True,\tsmooth=True,\tplot=False,\tax=None,\tlegend=False) -> Tuple[Dict[float, corems.mass_spectra.factory.LC_Temp.EIC_Data], matplotlib.axes._axes.Axes]:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.LC_Class.DataDependentLCMS.process_ms1", "modulename": "corems.mass_spectra.factory.LC_Class", "qualname": "DataDependentLCMS.process_ms1", "kind": "function", "doc": "

    \n", "signature": "(self, dict_tarrget_mzs):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.factory.LC_Temp", "modulename": "corems.mass_spectra.factory.LC_Temp", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.factory.LC_Temp.TIC_Data", "modulename": "corems.mass_spectra.factory.LC_Temp", "qualname": "TIC_Data", "kind": "class", "doc": "

    Scans: [int]\n original thermo scan numbers\nTime: [floats]\n list of retention times\nTIC: [floats]\n total ion chromatogram\nApexes: [int]
    \n original thermo apex scan number after peak picking

    \n"}, {"fullname": "corems.mass_spectra.factory.LC_Temp.TIC_Data.__init__", "modulename": "corems.mass_spectra.factory.LC_Temp", "qualname": "TIC_Data.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tscans: List[int] = <factory>,\ttime: List[float] = <factory>,\ttic: List[float] = <factory>,\tapexes: List[int] = <factory>)"}, {"fullname": "corems.mass_spectra.factory.LC_Temp.TIC_Data.scans", "modulename": "corems.mass_spectra.factory.LC_Temp", "qualname": "TIC_Data.scans", "kind": "variable", "doc": "

    \n", "annotation": ": List[int]"}, {"fullname": "corems.mass_spectra.factory.LC_Temp.TIC_Data.time", "modulename": "corems.mass_spectra.factory.LC_Temp", "qualname": "TIC_Data.time", "kind": "variable", "doc": "

    \n", "annotation": ": List[float]"}, {"fullname": "corems.mass_spectra.factory.LC_Temp.TIC_Data.tic", "modulename": "corems.mass_spectra.factory.LC_Temp", "qualname": "TIC_Data.tic", "kind": "variable", "doc": "

    \n", "annotation": ": List[float]"}, {"fullname": "corems.mass_spectra.factory.LC_Temp.TIC_Data.apexes", "modulename": "corems.mass_spectra.factory.LC_Temp", "qualname": "TIC_Data.apexes", "kind": "variable", "doc": "

    \n", "annotation": ": List[int]"}, {"fullname": "corems.mass_spectra.factory.LC_Temp.EIC_Data", "modulename": "corems.mass_spectra.factory.LC_Temp", "qualname": "EIC_Data", "kind": "class", "doc": "

    Scans: [int]\n original thermo scan numbers\nTime: [floats]\n list of retention times\nEIC: [floats]\n extracted ion chromatogram\nApexes: [int]
    \n original thermo apex scan number after peak picking

    \n"}, {"fullname": "corems.mass_spectra.factory.LC_Temp.EIC_Data.__init__", "modulename": "corems.mass_spectra.factory.LC_Temp", "qualname": "EIC_Data.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tscans: List[int] = <factory>,\ttime: List[float] = <factory>,\teic: List[float] = <factory>,\tapexes: List[int] = <factory>)"}, {"fullname": "corems.mass_spectra.factory.LC_Temp.EIC_Data.scans", "modulename": "corems.mass_spectra.factory.LC_Temp", "qualname": "EIC_Data.scans", "kind": "variable", "doc": "

    \n", "annotation": ": List[int]"}, {"fullname": "corems.mass_spectra.factory.LC_Temp.EIC_Data.time", "modulename": "corems.mass_spectra.factory.LC_Temp", "qualname": "EIC_Data.time", "kind": "variable", "doc": "

    \n", "annotation": ": List[float]"}, {"fullname": "corems.mass_spectra.factory.LC_Temp.EIC_Data.eic", "modulename": "corems.mass_spectra.factory.LC_Temp", "qualname": "EIC_Data.eic", "kind": "variable", "doc": "

    \n", "annotation": ": List[float]"}, {"fullname": "corems.mass_spectra.factory.LC_Temp.EIC_Data.apexes", "modulename": "corems.mass_spectra.factory.LC_Temp", "qualname": "EIC_Data.apexes", "kind": "variable", "doc": "

    \n", "annotation": ": List[int]"}, {"fullname": "corems.mass_spectra.input", "modulename": "corems.mass_spectra.input", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.andiNetCDF", "modulename": "corems.mass_spectra.input.andiNetCDF", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.andiNetCDF.ReadAndiNetCDF", "modulename": "corems.mass_spectra.input.andiNetCDF", "qualname": "ReadAndiNetCDF", "kind": "class", "doc": "

    A class for reading AndiNetCDF files and extracting mass spectra data.

    \n\n
    Parameters
    \n\n
      \n
    • file_location (str or Path):\nThe location of the AndiNetCDF file.
    • \n
    • analyzer (str, optional):\nThe type of analyzer used (default is 'Quadruple').
    • \n
    • instrument_label (str, optional):\nThe label of the instrument (default is 'GCMS-Agilent').
    • \n
    • auto_process (bool, optional):\nWhether to automatically process the data (default is True).
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • file_location (Path):\nThe path to the AndiNetCDF file.
    • \n
    • net_cdf_obj (Dataset):\nThe NetCDF dataset object.
    • \n
    • ionization_type (str):\nThe ionization type used in the experiment.
    • \n
    • experiment_type (str):\nThe type of experiment.
    • \n
    • list_scans (range):\nThe range of scan numbers in the dataset.
    • \n
    • initial_scan_number (int):\nThe number of the initial scan.
    • \n
    • final_scan_number (int):\nThe number of the final scan.
    • \n
    • analyzer (str):\nThe type of analyzer used.
    • \n
    • instrument_label (str):\nThe label of the instrument.
    • \n
    • gcms (GCMSBase):\nThe GCMSBase object for storing mass spectra data.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • polarity(). \nGet the polarity of the ionization.
    • \n
    • get_mass_spectrum(mz, abun, rp, d_params). \nAdd a mass spectrum to the GCMSBase object.
    • \n
    • run(). \nPopulate the GCMSBase object with mass spectra data.
    • \n
    • import_mass_spectra(d_params). \nImport mass spectra data from the AndiNetCDF file.
    • \n
    • get_gcms_obj(). \nGet the GCMSBase object.
    • \n
    \n", "bases": "threading.Thread"}, {"fullname": "corems.mass_spectra.input.andiNetCDF.ReadAndiNetCDF.__init__", "modulename": "corems.mass_spectra.input.andiNetCDF", "qualname": "ReadAndiNetCDF.__init__", "kind": "function", "doc": "

    This constructor should always be called with keyword arguments. Arguments are:

    \n\n

    group should be None; reserved for future extension when a ThreadGroup\nclass is implemented.

    \n\n

    target is the callable object to be invoked by the run()\nmethod. Defaults to None, meaning nothing is called.

    \n\n

    name is the thread name. By default, a unique name is constructed of\nthe form \"Thread-N\" where N is a small decimal number.

    \n\n

    args is the argument tuple for the target invocation. Defaults to ().

    \n\n

    kwargs is a dictionary of keyword arguments for the target\ninvocation. Defaults to {}.

    \n\n

    If a subclass overrides the constructor, it must make sure to invoke\nthe base class constructor (Thread.__init__()) before doing anything\nelse to the thread.

    \n", "signature": "(\tfile_location: str | pathlib.Path,\tanalyzer='Quadruple',\tinstrument_label='GCMS-Agilent',\tauto_process=True)"}, {"fullname": "corems.mass_spectra.input.andiNetCDF.ReadAndiNetCDF.ionization_type", "modulename": "corems.mass_spectra.input.andiNetCDF", "qualname": "ReadAndiNetCDF.ionization_type", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.andiNetCDF.ReadAndiNetCDF.experiment_type", "modulename": "corems.mass_spectra.input.andiNetCDF", "qualname": "ReadAndiNetCDF.experiment_type", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.andiNetCDF.ReadAndiNetCDF.list_scans", "modulename": "corems.mass_spectra.input.andiNetCDF", "qualname": "ReadAndiNetCDF.list_scans", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.andiNetCDF.ReadAndiNetCDF.initial_scan_number", "modulename": "corems.mass_spectra.input.andiNetCDF", "qualname": "ReadAndiNetCDF.initial_scan_number", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.andiNetCDF.ReadAndiNetCDF.final_scan_number", "modulename": "corems.mass_spectra.input.andiNetCDF", "qualname": "ReadAndiNetCDF.final_scan_number", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.andiNetCDF.ReadAndiNetCDF.analyzer", "modulename": "corems.mass_spectra.input.andiNetCDF", "qualname": "ReadAndiNetCDF.analyzer", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.andiNetCDF.ReadAndiNetCDF.instrument_label", "modulename": "corems.mass_spectra.input.andiNetCDF", "qualname": "ReadAndiNetCDF.instrument_label", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.andiNetCDF.ReadAndiNetCDF.gcms", "modulename": "corems.mass_spectra.input.andiNetCDF", "qualname": "ReadAndiNetCDF.gcms", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.andiNetCDF.ReadAndiNetCDF.polarity", "modulename": "corems.mass_spectra.input.andiNetCDF", "qualname": "ReadAndiNetCDF.polarity", "kind": "variable", "doc": "

    Get the polarity of the ionization.

    \n"}, {"fullname": "corems.mass_spectra.input.andiNetCDF.ReadAndiNetCDF.get_mass_spectrum", "modulename": "corems.mass_spectra.input.andiNetCDF", "qualname": "ReadAndiNetCDF.get_mass_spectrum", "kind": "function", "doc": "

    Add a mass spectrum to the GCMSBase object.

    \n\n
    Parameters
    \n\n
      \n
    • mz (array-like):\nThe m/z values of the mass spectrum.
    • \n
    • abun (array-like):\nThe abundance values of the mass spectrum.
    • \n
    • rp (array-like):\nThe resolution values of the mass spectrum.
    • \n
    • d_params (dict):\nAdditional parameters for the mass spectrum.
    • \n
    \n", "signature": "(self, mz, abun, rp, d_params):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.andiNetCDF.ReadAndiNetCDF.run", "modulename": "corems.mass_spectra.input.andiNetCDF", "qualname": "ReadAndiNetCDF.run", "kind": "function", "doc": "

    Populate the GCMSBase object with mass spectra data.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.andiNetCDF.ReadAndiNetCDF.import_mass_spectra", "modulename": "corems.mass_spectra.input.andiNetCDF", "qualname": "ReadAndiNetCDF.import_mass_spectra", "kind": "function", "doc": "

    Import mass spectra data from the AndiNetCDF file.

    \n\n
    Parameters
    \n\n
      \n
    • d_params (dict):\nAdditional parameters for the mass spectra.
    • \n
    \n", "signature": "(self, d_params):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.andiNetCDF.ReadAndiNetCDF.get_gcms_obj", "modulename": "corems.mass_spectra.input.andiNetCDF", "qualname": "ReadAndiNetCDF.get_gcms_obj", "kind": "function", "doc": "

    Get the GCMSBase object.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.boosterHDF5", "modulename": "corems.mass_spectra.input.boosterHDF5", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra", "kind": "class", "doc": "

    Class for reading HDF5 files containing booster mass spectra.

    \n\n
    Parameters
    \n\n
      \n
    • file_location (Path or S3Path):\nThe full path to the HDF5 file.
    • \n
    • analyzer (str, optional):\nThe type of analyzer used for the mass spectra. Defaults to \"ICR\".
    • \n
    • instrument_label (str, optional):\nThe label of the instrument. Defaults to \"21T\".
    • \n
    • auto_process (bool, optional):\nWhether to automatically process the mass spectra. Defaults to True.
    • \n
    \n", "bases": "threading.Thread"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra.__init__", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra.__init__", "kind": "function", "doc": "

    Initialize the ReadHDF_BoosterMassSpectra class.

    \n\n
    Parameters
    \n\n
      \n
    • file_location (Path or S3Path):\nThe full path to the HDF5 file.
    • \n
    • analyzer (str, optional):\nThe type of analyzer used for the mass spectra. Defaults to \"ICR\".
    • \n
    • instrument_label (str, optional):\nThe label of the instrument. Defaults to \"21T\".
    • \n
    • auto_process (bool, optional):\nWhether to automatically process the mass spectra. Defaults to True.
    • \n
    \n", "signature": "(\tfile_location: pathlib.Path | s3path.S3Path,\tanalyzer='ICR',\tinstrument_label='21T',\tauto_process=True)"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra.lcms", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra.lcms", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra.hdf_obj", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra.hdf_obj", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra.list_scans", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra.list_scans", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra.initial_scan_number", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra.initial_scan_number", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra.final_scan_number", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra.final_scan_number", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra.file_location", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra.file_location", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra.auto_process", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra.auto_process", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra.analyzer", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra.analyzer", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra.instrument_label", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra.instrument_label", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra.get_polarity", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra.get_polarity", "kind": "function", "doc": "

    Get the polarity of a scan.

    \n\n
    Parameters
    \n\n
      \n
    • file_location (Path or S3Path):\nThe full path to the HDF5 file.
    • \n
    • scan (int):\nThe scan number.
    • \n
    \n", "signature": "(self, file_location: pathlib.Path | s3path.S3Path, scan: int):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra.get_attr_data", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra.get_attr_data", "kind": "function", "doc": "

    Get the attribute data of a scan.

    \n\n
    Parameters
    \n\n
      \n
    • scan (int):\nThe scan number.
    • \n
    • attr_srt (str):\nThe attribute name.
    • \n
    \n", "signature": "(self, scan, attr_srt):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra.import_mass_spectra", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra.import_mass_spectra", "kind": "function", "doc": "

    Import the mass spectra from the HDF5 file.

    \n\n
    Parameters
    \n\n
      \n
    • d_params (dict):\nThe parameters for importing the mass spectra.
    • \n
    \n", "signature": "(self, d_params: dict):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra.get_mass_spectrum", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra.get_mass_spectrum", "kind": "function", "doc": "

    Get the mass spectrum for a scan.

    \n\n
    Parameters
    \n\n
      \n
    • scan (int):\nThe scan number.
    • \n
    • d_params (dict):\nThe parameters for creating the mass spectrum.
    • \n
    \n", "signature": "(self, scan: int, d_params: dict):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra.run", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra.run", "kind": "function", "doc": "

    Run the thread to create the LCMS object.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.boosterHDF5.ReadHDF_BoosterMassSpectra.get_lcms_obj", "modulename": "corems.mass_spectra.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectra.get_lcms_obj", "kind": "function", "doc": "

    Get the LCMS object.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.brukerSolarix", "modulename": "corems.mass_spectra.input.brukerSolarix", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.brukerSolarix.ReadBruker_SolarixTransientMassSpectra", "modulename": "corems.mass_spectra.input.brukerSolarix", "qualname": "ReadBruker_SolarixTransientMassSpectra", "kind": "class", "doc": "

    Class for reading Bruker Solarix Transient Mass Spectra.

    \n\n
    Parameters
    \n\n
      \n
    • d_directory_location (str, pathlib.Path, or s3path.S3Path):\nPath object from pathlib containing the file location.
    • \n
    • analyzer (str, optional):\nType of analyzer used in the mass spectrometer. Defaults to \"ICR\".
    • \n
    • instrument_label (str, optional):\nLabel for the instrument. Defaults to \"15T\".
    • \n
    • auto_process (bool, optional):\nFlag indicating whether to automatically process the mass spectra. Defaults to True.
    • \n
    • keep_profile (bool, optional):\nFlag indicating whether to keep the profile data in the mass spectra. Defaults to False.
    • \n
    \n", "bases": "threading.Thread"}, {"fullname": "corems.mass_spectra.input.brukerSolarix.ReadBruker_SolarixTransientMassSpectra.__init__", "modulename": "corems.mass_spectra.input.brukerSolarix", "qualname": "ReadBruker_SolarixTransientMassSpectra.__init__", "kind": "function", "doc": "

    This constructor should always be called with keyword arguments. Arguments are:

    \n\n

    group should be None; reserved for future extension when a ThreadGroup\nclass is implemented.

    \n\n

    target is the callable object to be invoked by the run()\nmethod. Defaults to None, meaning nothing is called.

    \n\n

    name is the thread name. By default, a unique name is constructed of\nthe form \"Thread-N\" where N is a small decimal number.

    \n\n

    args is the argument tuple for the target invocation. Defaults to ().

    \n\n

    kwargs is a dictionary of keyword arguments for the target\ninvocation. Defaults to {}.

    \n\n

    If a subclass overrides the constructor, it must make sure to invoke\nthe base class constructor (Thread.__init__()) before doing anything\nelse to the thread.

    \n", "signature": "(\td_directory_location: str | pathlib.Path | s3path.S3Path,\tanalyzer='ICR',\tinstrument_label='15T',\tauto_process=True,\tkeep_profile=False)"}, {"fullname": "corems.mass_spectra.input.brukerSolarix.ReadBruker_SolarixTransientMassSpectra.scan_attr", "modulename": "corems.mass_spectra.input.brukerSolarix", "qualname": "ReadBruker_SolarixTransientMassSpectra.scan_attr", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.brukerSolarix.ReadBruker_SolarixTransientMassSpectra.lcms", "modulename": "corems.mass_spectra.input.brukerSolarix", "qualname": "ReadBruker_SolarixTransientMassSpectra.lcms", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.brukerSolarix.ReadBruker_SolarixTransientMassSpectra.auto_process", "modulename": "corems.mass_spectra.input.brukerSolarix", "qualname": "ReadBruker_SolarixTransientMassSpectra.auto_process", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.brukerSolarix.ReadBruker_SolarixTransientMassSpectra.keep_profile", "modulename": "corems.mass_spectra.input.brukerSolarix", "qualname": "ReadBruker_SolarixTransientMassSpectra.keep_profile", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.brukerSolarix.ReadBruker_SolarixTransientMassSpectra.get_scan_attr", "modulename": "corems.mass_spectra.input.brukerSolarix", "qualname": "ReadBruker_SolarixTransientMassSpectra.get_scan_attr", "kind": "function", "doc": "

    Get the scan attributes from the scan.xml file.

    \n\n
    Returns
    \n\n
      \n
    • dict: Dictionary containing the scan number as key and a tuple of retention time and TIC as value.
    • \n
    \n", "signature": "(self) -> dict:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.brukerSolarix.ReadBruker_SolarixTransientMassSpectra.import_mass_spectra", "modulename": "corems.mass_spectra.input.brukerSolarix", "qualname": "ReadBruker_SolarixTransientMassSpectra.import_mass_spectra", "kind": "function", "doc": "

    Import the mass spectra from the scan.xml file.

    \n", "signature": "(self) -> None:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.brukerSolarix.ReadBruker_SolarixTransientMassSpectra.get_mass_spectrum", "modulename": "corems.mass_spectra.input.brukerSolarix", "qualname": "ReadBruker_SolarixTransientMassSpectra.get_mass_spectrum", "kind": "function", "doc": "

    Get the mass spectrum for a given scan number.

    \n\n
    Parameters
    \n\n
      \n
    • scan_number (int):\nScan number.
    • \n
    \n", "signature": "(self, scan_number: int):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.brukerSolarix.ReadBruker_SolarixTransientMassSpectra.run", "modulename": "corems.mass_spectra.input.brukerSolarix", "qualname": "ReadBruker_SolarixTransientMassSpectra.run", "kind": "function", "doc": "

    Run the import_mass_spectra method.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.brukerSolarix.ReadBruker_SolarixTransientMassSpectra.get_lcms_obj", "modulename": "corems.mass_spectra.input.brukerSolarix", "qualname": "ReadBruker_SolarixTransientMassSpectra.get_lcms_obj", "kind": "function", "doc": "

    Get the LCMSBase object.

    \n\n
    Raises
    \n\n
      \n
    • Exception: If the LCMSBase object is empty.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.coremsHDF5", "modulename": "corems.mass_spectra.input.coremsHDF5", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.coremsHDF5.ReadCoreMSHDF_MassSpectra", "modulename": "corems.mass_spectra.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectra", "kind": "class", "doc": "

    Class for reading CoreMS HDF5 mass spectra.

    \n\n
    Parameters
    \n\n
      \n
    • file_location (str):\nThe file location of the CoreMS HDF5 file.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • lcms (LCMSBase):\nThe LCMSBase object for storing mass spectra.
    • \n
    • list_scans (list):\nThe list of scan numbers in the HDF5 file.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • import_mass_spectra()\nImports the mass spectra from the HDF5 file.
    • \n
    • run()\nCreates the LCMS object by importing the mass spectra.
    • \n
    • get_lcms_obj()\nReturns the LCMS object.
    • \n
    \n\n
    Raises
    \n\n
      \n
    • Exception: If the LCMS object is empty.
    • \n
    \n", "bases": "corems.mass_spectrum.input.coremsHDF5.ReadCoreMSHDF_MassSpectrum, threading.Thread"}, {"fullname": "corems.mass_spectra.input.coremsHDF5.ReadCoreMSHDF_MassSpectra.__init__", "modulename": "corems.mass_spectra.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectra.__init__", "kind": "function", "doc": "

    This constructor should always be called with keyword arguments. Arguments are:

    \n\n

    group should be None; reserved for future extension when a ThreadGroup\nclass is implemented.

    \n\n

    target is the callable object to be invoked by the run()\nmethod. Defaults to None, meaning nothing is called.

    \n\n

    name is the thread name. By default, a unique name is constructed of\nthe form \"Thread-N\" where N is a small decimal number.

    \n\n

    args is the argument tuple for the target invocation. Defaults to ().

    \n\n

    kwargs is a dictionary of keyword arguments for the target\ninvocation. Defaults to {}.

    \n\n

    If a subclass overrides the constructor, it must make sure to invoke\nthe base class constructor (Thread.__init__()) before doing anything\nelse to the thread.

    \n", "signature": "(file_location: str)"}, {"fullname": "corems.mass_spectra.input.coremsHDF5.ReadCoreMSHDF_MassSpectra.lcms", "modulename": "corems.mass_spectra.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectra.lcms", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.coremsHDF5.ReadCoreMSHDF_MassSpectra.list_scans", "modulename": "corems.mass_spectra.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectra.list_scans", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.coremsHDF5.ReadCoreMSHDF_MassSpectra.import_mass_spectra", "modulename": "corems.mass_spectra.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectra.import_mass_spectra", "kind": "function", "doc": "

    Imports the mass spectra from the HDF5 file.

    \n", "signature": "(self) -> None:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.coremsHDF5.ReadCoreMSHDF_MassSpectra.run", "modulename": "corems.mass_spectra.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectra.run", "kind": "function", "doc": "

    Creates the LCMS object by importing the mass spectra.

    \n", "signature": "(self) -> None:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.coremsHDF5.ReadCoreMSHDF_MassSpectra.get_lcms_obj", "modulename": "corems.mass_spectra.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectra.get_lcms_obj", "kind": "function", "doc": "

    Returns the LCMS object.

    \n\n
    Returns
    \n\n
      \n
    • LCMSBase: The LCMS object.
    • \n
    \n\n
    Raises
    \n\n
      \n
    • Exception: If the LCMS object is empty.
    • \n
    \n", "signature": "(self) -> corems.mass_spectra.factory.LC_Class.LCMSBase:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.massList", "modulename": "corems.mass_spectra.input.massList", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.massList.ReadCoremsMassSpectraText", "modulename": "corems.mass_spectra.input.massList", "qualname": "ReadCoremsMassSpectraText", "kind": "class", "doc": "

    Class for reading CoreMS mass spectra from a text file.

    \n\n
    Parameters
    \n\n
      \n
    • file_location (str, pathlib.Path, or s3path.S3Path):\nPath object from pathlib containing the file location
    • \n
    • analyzer (str, optional):\nName of the analyzer, by default 'Unknown'
    • \n
    • instrument_label (str, optional):\nLabel of the instrument, by default 'Unknown'
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • lcms (LCMSBase):\nLCMSBase object for storing the mass spectra data.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • get_scans_filename(). Get the filenames of all the scan files associated with the CoreMS file.
    • \n
    • set_filepath_datatype_and_delimiter(file_path_obj). Set the file path, data type, and delimiter based on the file path object.
    • \n
    • import_mass_spectra(). Import the mass spectra from the scan files and add them to the LCMSBase object.
    • \n
    • run(). Run the import_mass_spectra method to create the LCMSBase object.
    • \n
    • get_lcms_obj(). Get the LCMSBase object.
    • \n
    \n", "bases": "corems.mass_spectrum.input.massList.ReadCoremsMasslist, threading.Thread"}, {"fullname": "corems.mass_spectra.input.massList.ReadCoremsMassSpectraText.__init__", "modulename": "corems.mass_spectra.input.massList", "qualname": "ReadCoremsMassSpectraText.__init__", "kind": "function", "doc": "

    This constructor should always be called with keyword arguments. Arguments are:

    \n\n

    group should be None; reserved for future extension when a ThreadGroup\nclass is implemented.

    \n\n

    target is the callable object to be invoked by the run()\nmethod. Defaults to None, meaning nothing is called.

    \n\n

    name is the thread name. By default, a unique name is constructed of\nthe form \"Thread-N\" where N is a small decimal number.

    \n\n

    args is the argument tuple for the target invocation. Defaults to ().

    \n\n

    kwargs is a dictionary of keyword arguments for the target\ninvocation. Defaults to {}.

    \n\n

    If a subclass overrides the constructor, it must make sure to invoke\nthe base class constructor (Thread.__init__()) before doing anything\nelse to the thread.

    \n", "signature": "(file_location, analyzer='Unknown', instrument_label='Unknown')"}, {"fullname": "corems.mass_spectra.input.massList.ReadCoremsMassSpectraText.lcms", "modulename": "corems.mass_spectra.input.massList", "qualname": "ReadCoremsMassSpectraText.lcms", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.massList.ReadCoremsMassSpectraText.get_scans_filename", "modulename": "corems.mass_spectra.input.massList", "qualname": "ReadCoremsMassSpectraText.get_scans_filename", "kind": "function", "doc": "

    \n", "signature": "(self) -> list:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.massList.ReadCoremsMassSpectraText.set_filepath_datatype_and_delimiter", "modulename": "corems.mass_spectra.input.massList", "qualname": "ReadCoremsMassSpectraText.set_filepath_datatype_and_delimiter", "kind": "function", "doc": "

    \n", "signature": "(self, file_path_obj) -> None:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.massList.ReadCoremsMassSpectraText.import_mass_spectra", "modulename": "corems.mass_spectra.input.massList", "qualname": "ReadCoremsMassSpectraText.import_mass_spectra", "kind": "function", "doc": "

    \n", "signature": "(self) -> None:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.massList.ReadCoremsMassSpectraText.run", "modulename": "corems.mass_spectra.input.massList", "qualname": "ReadCoremsMassSpectraText.run", "kind": "function", "doc": "

    Creates the LCMS object and imports mass spectra.

    \n", "signature": "(self) -> None:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.massList.ReadCoremsMassSpectraText.get_lcms_obj", "modulename": "corems.mass_spectra.input.massList", "qualname": "ReadCoremsMassSpectraText.get_lcms_obj", "kind": "function", "doc": "

    Returns the LCMSBase object associated with the massList.

    \n\n

    If the LCMSBase object is already initialized, it is returned.\nOtherwise, an exception is raised.

    \n\n

    Raises:\n Exception: If the LCMSBase object is not initialized.

    \n", "signature": "(self) -> corems.mass_spectra.factory.LC_Class.LCMSBase:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader", "modulename": "corems.mass_spectra.input.rawFileReader", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass", "kind": "class", "doc": "

    Class for reading Thermo Raw files and extracting information from them.

    \n\n

    Parameters:

    \n\n

    file_location : str or pathlib.Path or s3path.S3Path\n Thermo Raw file path or S3 path.

    \n\n

    Attributes:

    \n\n

    file_path : str or pathlib.Path or s3path.S3Path\n The file path of the Thermo Raw file.\nparameters : LCMSParameters\n The LCMS parameters for the Thermo Raw file.\nchromatogram_settings : LiquidChromatographSetting\n The chromatogram settings for the Thermo Raw file.\nscans : list or tuple\n The selected scans for the Thermo Raw file.\nstart_scan : int\n The starting scan number for the Thermo Raw file.\nend_scan : int\n The ending scan number for the Thermo Raw file.

    \n\n

    Methods:

    \n\n
      \n
    • set_msordertype(scanFilter, mstype: str = 'ms1') -> scanFilter\nConvert the user-passed MS Type string to a Thermo MSOrderType object.
    • \n
    • get_creation_time() -> datetime.datetime\nExtract the creation date stamp from the .RAW file and return it as a formatted datetime object.
    • \n
    • remove_temp_file()\nRemove the temporary file if the path is from S3Path.
    • \n
    • get_polarity_mode(scan_number: int) -> int\nGet the polarity mode for the given scan number.
    • \n
    • get_filter_for_scan_num(scan_number: int) -> List[str]\nGet the filter for the given scan number.
    • \n
    • check_full_scan(scan_number: int) -> bool\nCheck if the given scan number is a full scan.
    • \n
    • get_all_filters() -> Tuple[Dict[int, str], List[str]]\nGet all scan filters for the Thermo Raw file.
    • \n
    • get_scan_header(scan: int) -> Dict[str, Any]\nGet the full dictionary of scan header metadata for the given scan number.
    • \n
    • get_rt_time_from_trace(trace) -> Tuple[List[float], List[float], List[int]]\nGet the retention time, intensity, and scan number from the given trace.
    • \n
    • get_eics(target_mzs: List[float], tic_data: Dict[str, Any], ms_type: str = 'MS !d',\n peak_detection: bool = True, smooth: bool = True, plot: bool = False,\n ax: Optional[matplotlib.axes.Axes] = None, legend: bool = False) -> Tuple[Dict[float, EIC_Data], matplotlib.axes.Axes]\nGet the extracted ion chromatograms (EICs) for the target m/z values.
    • \n
    \n"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.__init__", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.__init__", "kind": "function", "doc": "

    file_location: srt pathlib.Path or s3path.S3Path\nThermo Raw file path

    \n", "signature": "(file_location)"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.iRawDataPlus", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.iRawDataPlus", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.res", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.res", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.file_path", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.file_path", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.iFileHeader", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.iFileHeader", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.parameters", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.parameters", "kind": "variable", "doc": "

    Get or set the LCMSParameters object.

    \n", "annotation": ": corems.encapsulation.factory.parameters.LCMSParameters"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.chromatogram_settings", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.chromatogram_settings", "kind": "variable", "doc": "

    Get or set the LiquidChromatographSetting object.

    \n", "annotation": ": corems.encapsulation.factory.processingSetting.LiquidChromatographSetting"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.scans", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.scans", "kind": "variable", "doc": "

    scans : list or tuple\nIf list uses Thermo AverageScansInScanRange for selected scans, ortherwise uses Thermo AverageScans for a scan range

    \n", "annotation": ": list | tuple"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.start_scan", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.start_scan", "kind": "variable", "doc": "

    Get the starting scan number for the Thermo Raw file.

    \n", "annotation": ": int"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.end_scan", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.end_scan", "kind": "variable", "doc": "

    Get the ending scan number for the Thermo Raw file.

    \n", "annotation": ": int"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.set_msordertype", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.set_msordertype", "kind": "function", "doc": "

    Function to convert user passed string MS Type to Thermo MSOrderType object\nLimited to MS1 through MS10.

    \n\n

    Parameters:

    \n\n

    scanFilter : Thermo.ScanFilter\n The scan filter object.\nmstype : str, optional\n The MS Type string, by default 'ms1'

    \n", "signature": "(self, scanFilter, mstype: str = 'ms1'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.get_creation_time", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.get_creation_time", "kind": "function", "doc": "

    Extract the creation date stamp from the .RAW file\nReturn formatted creation date stamp.

    \n", "signature": "(self) -> datetime.datetime:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.remove_temp_file", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.remove_temp_file", "kind": "function", "doc": "

    if the path is from S3Path data cannot be serialized to io.ByteStream and\na temporary copy is stored at the temp dir\nuse this function only at the end of your execution scrip\nsome LCMS class methods depend on this file

    \n", "signature": "(self) -> None:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.get_polarity_mode", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.get_polarity_mode", "kind": "function", "doc": "

    Get the polarity mode for the given scan number.

    \n\n

    Parameters:

    \n\n

    scan_number : int\n The scan number.

    \n\n

    Raises:

    \n\n

    Exception\n If the polarity mode is unknown.

    \n", "signature": "(self, scan_number: int) -> int:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.get_filter_for_scan_num", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.get_filter_for_scan_num", "kind": "function", "doc": "

    Returns the closest matching run time that corresponds to scan_number for the current\ncontroller. This function is only supported for MS device controllers.\ne.g. ['FTMS', '-', 'p', 'NSI', 'Full', 'ms', '[200.00-1000.00]']

    \n\n

    Parameters:

    \n\n

    scan_number : int\n The scan number.

    \n", "signature": "(self, scan_number: int) -> System.Collections.Generic.List[String]:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.check_full_scan", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.check_full_scan", "kind": "function", "doc": "

    \n", "signature": "(self, scan_number: int) -> bool:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.get_all_filters", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.get_all_filters", "kind": "function", "doc": "

    Get all scan filters.\nThis function is only supported for MS device controllers.\ne.g. ['FTMS', '-', 'p', 'NSI', 'Full', 'ms', '[200.00-1000.00]']

    \n", "signature": "(self) -> Tuple[Dict[int, str], System.Collections.Generic.List[String]]:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.get_scan_header", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.get_scan_header", "kind": "function", "doc": "

    Get full dictionary of scan header meta data, i.e. AGC status, ion injection time, etc.

    \n\n

    Parameters:

    \n\n

    scan : int\n The scan number.

    \n", "signature": "(self, scan: int) -> Dict[str, Any]:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.get_rt_time_from_trace", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.get_rt_time_from_trace", "kind": "function", "doc": "

    trace: ThermoFisher.CommonCore.Data.Business.ChromatogramSignal

    \n", "signature": "(\ttrace) -> Tuple[System.Collections.Generic.List[Double], System.Collections.Generic.List[Double], System.Collections.Generic.List[Int32]]:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.get_eics", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.get_eics", "kind": "function", "doc": "

    ms_type: str ('MS', MS2')\nstart_scan: int default -1 will select the lowest available\nend_scan: int default -1 will select the highest available

    \n\n

    returns:

    \n\n
    chroma: dict{target_mz: EIC_Data(\n                            Scans: [int]\n                                original thermo scan numbers\n                            Time: [floats]\n                                list of retention times\n                            TIC: [floats]\n                                total ion chromatogram\n                            Apexes: [int]\n                                original thermo apex scan number after peak picking\n                            )\n
    \n", "signature": "(\tself,\ttarget_mzs: System.Collections.Generic.List[Double],\ttic_data: Dict[str, Any],\tms_type='MS !d',\tpeak_detection=True,\tsmooth=True,\tplot=False,\tax: Optional[matplotlib.axes._axes.Axes] = None,\tlegend=False) -> Tuple[Dict[float, corems.mass_spectra.factory.LC_Temp.EIC_Data], matplotlib.axes._axes.Axes]:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.get_tic", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.get_tic", "kind": "function", "doc": "

    ms_type: str ('MS', MS2')

    \n\n

    returns:\n chroma: dict\n {\n Scan: [int]\n original thermo scan numberMS\n Time: [floats]\n list of retention times\n TIC: [floats]\n total ion chromatogram\n Apexes: [int]\n original thermo apex scan number after peak picking\n }

    \n", "signature": "(\tself,\tms_type='MS !d',\tpeak_detection=True,\tsmooth=True,\tplot=False,\tax=None) -> Tuple[corems.mass_spectra.factory.LC_Temp.TIC_Data, matplotlib.axes._axes.Axes]:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.get_average_mass_spectrum", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.get_average_mass_spectrum", "kind": "function", "doc": "

    Averages mass spectra over a scan range using Thermo's AverageScansInScanRange method\nor a scan list using Thermo's AverageScans method\nspectrum_mode: str\n centroid or profile mass spectrum\nauto_process: bool\n If true performs peak picking, and noise threshold calculation after creation of mass spectrum object\nms_type: str\n String of form 'ms1' or 'ms2' or 'MS3' etc. Valid up to MS10.\n Internal function converts to Thermo MSOrderType class.

    \n", "signature": "(\tself,\tspectrum_mode: str = 'profile',\tauto_process: bool = True,\tppm_tolerance: float = 5.0,\tms_type: str = 'MS1') -> corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecProfile | corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroid:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.set_metadata", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.set_metadata", "kind": "function", "doc": "

    Collect metadata to be ingested in the mass spectrum object

    \n\n

    scans_list: list[int] or false\nlastScanNumber: int\nfirstScanNumber: int

    \n", "signature": "(\tself,\tfirstScanNumber=0,\tlastScanNumber=0,\tscans_list=False,\tlabel='Thermo_Profile'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.get_centroid_msms_data", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.get_centroid_msms_data", "kind": "function", "doc": "

    Deprecated since version 2.0:\nThis function will be removed in CoreMS 2.0. Please use get_average_mass_spectrum() instead for similar functionality.

    \n", "signature": "(self, scan):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ThermoBaseClass.get_average_mass_spectrum_by_scanlist", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ThermoBaseClass.get_average_mass_spectrum_by_scanlist", "kind": "function", "doc": "

    Averages selected scans mass spectra using Thermo's AverageScans method\nscans_list: list[int]\nauto_process: bool\n If true performs peak picking, and noise threshold calculation after creation of mass spectrum object\nReturns:\n MassSpecProfile

    \n\n

    Deprecated since version 2.0.

    \n\n

    This function will be removed in CoreMS 2.0. Please use get_average_mass_spectrum() instead for similar functionality.

    \n", "signature": "(\tself,\tscans_list: System.Collections.Generic.List[Int32],\tauto_process: bool = True,\tppm_tolerance: float = 5.0) -> corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecProfile:", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ImportDataDependentThermoMSFileReader", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ImportDataDependentThermoMSFileReader", "kind": "class", "doc": "

    Collection of methdos to import LC data dependent acquisition from Thermo's raw file\nIntended do create the LCMS object --> ChromaPeaks --> MSobj FullScan --> Dependent MS/MS Obj

    \n", "bases": "ThermoBaseClass, corems.mass_spectra.calc.LC_Calc.LC_Calculations"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ImportDataDependentThermoMSFileReader.__init__", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ImportDataDependentThermoMSFileReader.__init__", "kind": "function", "doc": "

    target_mzs: list[float] monoisotopic target m/z or None\n Details: None will defalt to depends scans selected m/\nfile_location: str, Path, or S3Path

    \n", "signature": "(\tfile_location: str,\tselected_mzs: System.Collections.Generic.List[Double] = None)"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ImportDataDependentThermoMSFileReader.lcms", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ImportDataDependentThermoMSFileReader.lcms", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ImportDataDependentThermoMSFileReader.selected_mzs", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ImportDataDependentThermoMSFileReader.selected_mzs", "kind": "variable", "doc": "

    \n", "annotation": ": System.Collections.Generic.List[Double]"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ImportDataDependentThermoMSFileReader.get_lcms_obj", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ImportDataDependentThermoMSFileReader.get_lcms_obj", "kind": "function", "doc": "

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ImportDataDependentThermoMSFileReader.get_precursors_list", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ImportDataDependentThermoMSFileReader.get_precursors_list", "kind": "function", "doc": "

    returns a set of unique precursors m/z\nprecision_decimals: int\n change this parameters does not seem to affect the number of dependent scans selected\n needs more investigation

    \n", "signature": "(self, precision_decimals=5):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ImportMassSpectraThermoMSFileReader", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ImportMassSpectraThermoMSFileReader", "kind": "class", "doc": "

    Collection of methdos to import Summed/Averaged mass spectrum from Thermo's raw file\nCurrently only for profile mode data\nReturns MassSpecProfile object

    \n", "bases": "ThermoBaseClass, corems.mass_spectra.calc.LC_Calc.LC_Calculations"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ImportMassSpectraThermoMSFileReader.get_icr_transient_times", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ImportMassSpectraThermoMSFileReader.get_icr_transient_times", "kind": "function", "doc": "

    Return a list for transient time targets for all scans, or selected scans range\nResolving Power and Transient time targets based on 7T FT-ICR MS system

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ImportMassSpectraThermoMSFileReader.RawFileReader", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ImportMassSpectraThermoMSFileReader.RawFileReader", "kind": "class", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ImportMassSpectraThermoMSFileReader.RawFileReader.get_data", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ImportMassSpectraThermoMSFileReader.RawFileReader.get_data", "kind": "function", "doc": "

    Retrieve mass spectrometry data for a given scan.

    \n\n
    Parameters
    \n\n
      \n
    • scan (int):\nThe scan number.
    • \n
    • d_parameter (dict):\nA dictionary to store additional parameters.
    • \n
    • scan_type (str):\nThe type of scan (\"Centroid\" or \"Profile\").
    • \n
    \n", "signature": "(self, scan: int, d_parameter: dict, scan_type: str):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.input.rawFileReader.ImportMassSpectraThermoMSFileReader.get_best_scans_idx", "modulename": "corems.mass_spectra.input.rawFileReader", "qualname": "ImportMassSpectraThermoMSFileReader.get_best_scans_idx", "kind": "function", "doc": "

    Method to determine the best scan indexes for selective co-addition.

    \n\n
    Parameters
    \n\n
      \n
    • stdevs (int, optional):\nThe number of standard deviations to use as the cutoff for filtering out datapoints. Default is 2.
    • \n
    • method (str, optional):\nThe method to calculate the mean or median of the TIC values. Default is \"mean\".
    • \n
    • plot (bool, optional):\nWhether to plot the TIC with horizontal lines for the standard deviation cutoffs. Default is False.
    • \n
    \n\n
    Notes
    \n\n

    This method calculates the mean (default) or median of the TIC values and sets an upper and lower limit\nbased on a specified number of standard deviations. The scans with TIC values outside of this range are\nconsidered the best scans for selective co-addition.

    \n\n

    Empirically, using 1-2 standard deviations is enough to filter out the worst datapoints.

    \n\n

    If plot is True, a matplotlib figure is returned along with the list of scan indexes.

    \n\n
    Examples
    \n\n
    \n
    >>> reader = RawFileReader()\n>>> scans = reader.get_best_scans_idx(stdevs=2, method="mean", plot=True)\n
    \n
    \n", "signature": "(self, stdevs=2, method='mean', plot=False):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output", "modulename": "corems.mass_spectra.output", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.output.export", "modulename": "corems.mass_spectra.output.export", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport", "kind": "class", "doc": "

    A class to export low resolution GC-MS data.

    \n\n

    This class provides methods to export low resolution GC-MS data to various formats such as Excel, CSV, HDF5, and Pandas DataFrame.

    \n\n

    Parameters:

    \n\n

    out_file_path : str\n The output file path.\ngcms : object\n The low resolution GCMS object.

    \n\n

    Attributes:

    \n\n

    output_file : Path\n The output file path as a Path object.\ngcms : object\n The low resolution GCMS object.

    \n\n

    Methods:

    \n\n
      \n
    • get_pandas_df(id_label=\"corems:\"). Get the exported data as a Pandas DataFrame.
    • \n
    • get_json(nan=False, id_label=\"corems:\"). Get the exported data as a JSON string.
    • \n
    • to_pandas(write_metadata=True, id_label=\"corems:\"). Export the data to a Pandas DataFrame and save it as a pickle file.
    • \n
    • to_excel(write_mode='a', write_metadata=True, id_label=\"corems:\"),\nExport the data to an Excel file.
    • \n
    • to_csv(separate_output=False, write_mode=\"w\", write_metadata=True, id_label=\"corems:\").\nExport the data to a CSV file.
    • \n
    • to_hdf(id_label=\"corems:\").\nExport the data to an HDF5 file.
    • \n
    • get_data_stats(gcms).\nGet statistics about the GCMS data.
    • \n
    \n"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.__init__", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.__init__", "kind": "function", "doc": "

    \n", "signature": "(out_file_path, gcms)"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.output_file", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.output_file", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.gcms", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.gcms", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.get_pandas_df", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.get_pandas_df", "kind": "function", "doc": "

    Get the exported data as a Pandas DataFrame.

    \n\n

    Parameters:

    \n\n

    id_label : str, optional\n The ID label for the data. Default is \"corems:\".

    \n\n

    Returns:

    \n\n

    DataFrame\n The exported data as a Pandas DataFrame.

    \n", "signature": "(self, id_label='corems:'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.get_json", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.get_json", "kind": "function", "doc": "

    Get the exported data as a JSON string.

    \n\n

    Parameters:

    \n\n

    nan : bool, optional\n Whether to include NaN values in the JSON string. Default is False.\nid_label : str, optional\n The ID label for the data. Default is \"corems:\".

    \n", "signature": "(self, nan=False, id_label='corems:'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.to_pandas", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.to_pandas", "kind": "function", "doc": "

    Export the data to a Pandas DataFrame and save it as a pickle file.

    \n\n

    Parameters:

    \n\n

    write_metadata : bool, optional\n Whether to write metadata to the output file.\nid_label : str, optional\n The ID label for the data.

    \n", "signature": "(self, write_metadata=True, id_label='corems:'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.to_excel", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.to_excel", "kind": "function", "doc": "

    Export the data to an Excel file.

    \n\n

    Parameters:

    \n\n

    write_mode : str, optional\n The write mode for the Excel file. Default is 'a' (append).\nwrite_metadata : bool, optional\n Whether to write metadata to the output file. Default is True.\nid_label : str, optional\n The ID label for the data. Default is \"corems:\".

    \n", "signature": "(self, write_mode='a', write_metadata=True, id_label='corems:'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.to_csv", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.to_csv", "kind": "function", "doc": "

    Export the data to a CSV file.

    \n\n

    Parameters:

    \n\n

    separate_output : bool, optional\n Whether to separate the output into multiple files. Default is False.\nwrite_mode : str, optional\n The write mode for the CSV file. Default is 'w' (write).\nwrite_metadata : bool, optional\n Whether to write metadata to the output file. Default is True.\nid_label : str, optional\n The ID label for the data. Default is \"corems:\".

    \n", "signature": "(\tself,\tseparate_output=False,\twrite_mode='w',\twrite_metadata=True,\tid_label='corems:'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.to_hdf", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.to_hdf", "kind": "function", "doc": "

    Export the data to an HDF5 file.

    \n\n

    Parameters:

    \n\n

    id_label : str, optional\n The ID label for the data. Default is \"corems:\".

    \n", "signature": "(self, id_label='corems:'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.get_data_stats", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.get_data_stats", "kind": "function", "doc": "

    Get statistics about the GCMS data.

    \n\n

    Parameters:

    \n\n

    gcms : object\n The low resolution GCMS object.

    \n\n

    Returns:

    \n\n

    dict\n A dictionary containing the data statistics.

    \n", "signature": "(self, gcms):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.get_calibration_stats", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.get_calibration_stats", "kind": "function", "doc": "

    Get statistics about the GC-MS calibration.

    \n\n

    Parameters:

    \n", "signature": "(self, gcms, id_label):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.get_blank_stats", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.get_blank_stats", "kind": "function", "doc": "

    Get statistics about the GC-MS blank.

    \n", "signature": "(self, gcms):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.get_instrument_metadata", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.get_instrument_metadata", "kind": "function", "doc": "

    Get metadata about the GC-MS instrument.

    \n", "signature": "(self, gcms):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.get_data_metadata", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.get_data_metadata", "kind": "function", "doc": "

    Get metadata about the GC-MS data.

    \n\n

    Parameters:

    \n\n

    gcms : object\n The low resolution GCMS object.\nid_label : str \n The ID label for the data.\noutput_path : str\n The output file path.

    \n\n

    Returns:

    \n\n

    dict\n A dictionary containing the data metadata.

    \n", "signature": "(self, gcms, id_label, output_path):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.get_parameters_json", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.get_parameters_json", "kind": "function", "doc": "

    Get the parameters as a JSON string.

    \n\n

    Parameters:

    \n\n

    gcms : GCMS object\n The low resolution GCMS object.\nid_label : str\n The ID label for the data.\noutput_path : str\n The output file path.

    \n\n

    Returns:

    \n\n

    str\n The parameters as a JSON string.

    \n", "signature": "(self, gcms, id_label, output_path):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.write_settings", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.write_settings", "kind": "function", "doc": "

    Write the settings to a JSON file.

    \n\n

    Parameters:

    \n\n

    output_path : str\n The output file path.\ngcms : GCMS object\n The low resolution GCMS object.\nid_label : str\n The ID label for the data. Default is \"emsl:\".

    \n", "signature": "(self, output_path, gcms, id_label='emsl:'):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.LowResGCMSExport.get_list_dict_data", "modulename": "corems.mass_spectra.output.export", "qualname": "LowResGCMSExport.get_list_dict_data", "kind": "function", "doc": "

    Get the exported data as a list of dictionaries.

    \n\n

    Parameters:

    \n\n

    gcms : object\n The low resolution GCMS object.\ninclude_no_match : bool, optional\n Whether to include no match data. Default is True.\nno_match_inline : bool, optional\n Whether to include no match data inline. Default is False.

    \n\n

    Returns:

    \n\n

    list\n The exported data as a list of dictionaries.

    \n", "signature": "(self, gcms, include_no_match=True, no_match_inline=False):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.HighResMassSpectraExport", "modulename": "corems.mass_spectra.output.export", "qualname": "HighResMassSpectraExport", "kind": "class", "doc": "

    A class to export high resolution mass spectra data.

    \n\n

    This class provides methods to export high resolution mass spectra data to various formats such as Excel, CSV, HDF5, and Pandas DataFrame.

    \n\n

    Parameters:

    \n\n

    out_file_path : str | Path\n The output file path.\nmass_spectra : object\n The high resolution mass spectra object.\noutput_type : str, optional\n The output type. Default is 'excel'.

    \n", "bases": "corems.mass_spectrum.output.export.HighResMassSpecExport"}, {"fullname": "corems.mass_spectra.output.export.HighResMassSpectraExport.__init__", "modulename": "corems.mass_spectra.output.export", "qualname": "HighResMassSpectraExport.__init__", "kind": "function", "doc": "

    This constructor should always be called with keyword arguments. Arguments are:

    \n\n

    group should be None; reserved for future extension when a ThreadGroup\nclass is implemented.

    \n\n

    target is the callable object to be invoked by the run()\nmethod. Defaults to None, meaning nothing is called.

    \n\n

    name is the thread name. By default, a unique name is constructed of\nthe form \"Thread-N\" where N is a small decimal number.

    \n\n

    args is the argument tuple for the target invocation. Defaults to ().

    \n\n

    kwargs is a dictionary of keyword arguments for the target\ninvocation. Defaults to {}.

    \n\n

    If a subclass overrides the constructor, it must make sure to invoke\nthe base class constructor (Thread.__init__()) before doing anything\nelse to the thread.

    \n", "signature": "(out_file_path, mass_spectra, output_type='excel')"}, {"fullname": "corems.mass_spectra.output.export.HighResMassSpectraExport.output_file", "modulename": "corems.mass_spectra.output.export", "qualname": "HighResMassSpectraExport.output_file", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.output.export.HighResMassSpectraExport.dir_loc", "modulename": "corems.mass_spectra.output.export", "qualname": "HighResMassSpectraExport.dir_loc", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.output.export.HighResMassSpectraExport.mass_spectra", "modulename": "corems.mass_spectra.output.export", "qualname": "HighResMassSpectraExport.mass_spectra", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectra.output.export.HighResMassSpectraExport.get_pandas_df", "modulename": "corems.mass_spectra.output.export", "qualname": "HighResMassSpectraExport.get_pandas_df", "kind": "function", "doc": "

    Get the exported data as a Pandas DataFrame.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.HighResMassSpectraExport.to_pandas", "modulename": "corems.mass_spectra.output.export", "qualname": "HighResMassSpectraExport.to_pandas", "kind": "function", "doc": "

    Export the data to a Pandas DataFrame and save it as a pickle file.

    \n\n

    Parameters:

    \n\n

    write_metadata : bool, optional\n Whether to write metadata to the output file. Default is True.

    \n", "signature": "(self, write_metadata=True):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.HighResMassSpectraExport.to_excel", "modulename": "corems.mass_spectra.output.export", "qualname": "HighResMassSpectraExport.to_excel", "kind": "function", "doc": "

    Export the data to an Excel file.

    \n\n

    Parameters:

    \n\n

    write_metadata : bool, optional\n Whether to write metadata to the output file. Default is True.

    \n", "signature": "(self, write_metadata=True):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.HighResMassSpectraExport.to_csv", "modulename": "corems.mass_spectra.output.export", "qualname": "HighResMassSpectraExport.to_csv", "kind": "function", "doc": "

    Export the data to a CSV file.

    \n\n

    Parameters:

    \n\n

    write_metadata : bool, optional\n Whether to write metadata to the output file. Default is True.

    \n", "signature": "(self, write_metadata=True):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.HighResMassSpectraExport.get_mass_spectra_attrs", "modulename": "corems.mass_spectra.output.export", "qualname": "HighResMassSpectraExport.get_mass_spectra_attrs", "kind": "function", "doc": "

    Get the mass spectra attributes as a JSON string.

    \n\n

    Parameters:

    \n\n

    mass_spectra : object\n The high resolution mass spectra object.

    \n\n

    Returns:

    \n\n

    str\n The mass spectra attributes as a JSON string.

    \n", "signature": "(self, mass_spectra):", "funcdef": "def"}, {"fullname": "corems.mass_spectra.output.export.HighResMassSpectraExport.to_hdf", "modulename": "corems.mass_spectra.output.export", "qualname": "HighResMassSpectraExport.to_hdf", "kind": "function", "doc": "

    Export the data to an HDF5 file.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum", "modulename": "corems.mass_spectrum", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc", "modulename": "corems.mass_spectrum.calc", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.AutoRecalibration", "modulename": "corems.mass_spectrum.calc.AutoRecalibration", "kind": "module", "doc": "

    Created on March 23 2023

    \n\n

    @author: Will Kew

    \n\n

    Modules for automatic mass internal recalibration

    \n"}, {"fullname": "corems.mass_spectrum.calc.AutoRecalibration.HighResRecalibration", "modulename": "corems.mass_spectrum.calc.AutoRecalibration", "qualname": "HighResRecalibration", "kind": "class", "doc": "

    This class is designed for high resolution (FTICR, Orbitrap) data of complex mixture, e.g. Organic matter

    \n\n

    The tool first does a broad mass range search for the most commonly expected ion type (i.e. CHO, deprotonated - for negative ESI)\nAnd then the assigned data mass error distribution is searched, with a gaussian fit to the most prominent range. \nThis tool works when the data are of sufficient quality, and not outwith the typical expected range of the mass analyzer\nIt presumes the mean error is out by 0-several ppm, but that the spread of error values is modest (<2ppm)

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (MassSpectrum):\nCoreMS mass spectrum object
    • \n
    • plot (bool, optional):\nWhether to plot the error distribution. The default is False.
    • \n
    • docker (bool, optional):\nWhether to use the docker database. The default is True. If not, it uses a dynamically generated sqlite database.
    • \n
    • ppmFWHMprior (float, optional):\nThe FWHM of the prior distribution (ppm). The default is 3.
    • \n
    • ppmRangeprior (float, optional):\nThe range of the prior distribution (ppm). The default is 15.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • determine_error_boundaries(). Determine the error boundaries for recalibration space.
    • \n
    \n\n
    Notes
    \n\n

    This initialisation function creates a copy of the MassSpectrum object to avoid over-writing assignments. \nPossible future task is to make the base class copyable.

    \n"}, {"fullname": "corems.mass_spectrum.calc.AutoRecalibration.HighResRecalibration.__init__", "modulename": "corems.mass_spectrum.calc.AutoRecalibration", "qualname": "HighResRecalibration.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tmass_spectrum,\tplot: bool = False,\tdocker: bool = True,\tppmFWHMprior: float = 3,\tppmRangeprior: float = 15)"}, {"fullname": "corems.mass_spectrum.calc.AutoRecalibration.HighResRecalibration.mass_spectrum", "modulename": "corems.mass_spectrum.calc.AutoRecalibration", "qualname": "HighResRecalibration.mass_spectrum", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.AutoRecalibration.HighResRecalibration.plot", "modulename": "corems.mass_spectrum.calc.AutoRecalibration", "qualname": "HighResRecalibration.plot", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.AutoRecalibration.HighResRecalibration.docker", "modulename": "corems.mass_spectrum.calc.AutoRecalibration", "qualname": "HighResRecalibration.docker", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.AutoRecalibration.HighResRecalibration.ppmFWHMprior", "modulename": "corems.mass_spectrum.calc.AutoRecalibration", "qualname": "HighResRecalibration.ppmFWHMprior", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.AutoRecalibration.HighResRecalibration.ppmRangeprior", "modulename": "corems.mass_spectrum.calc.AutoRecalibration", "qualname": "HighResRecalibration.ppmRangeprior", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.AutoRecalibration.HighResRecalibration.set_uncal_settings", "modulename": "corems.mass_spectrum.calc.AutoRecalibration", "qualname": "HighResRecalibration.set_uncal_settings", "kind": "function", "doc": "

    Set uncalibrated formula search settings

    \n\n

    This function serves the uncalibrated data (hence broad error tolerance)\nIt only allows CHO formula in deprotonated ion type- as most common for SRFA ESI negative mode

    \n\n

    This will not work for positive mode data, or for other ion types, or other expected elemental searches.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.AutoRecalibration.HighResRecalibration.positive_search_settings", "modulename": "corems.mass_spectrum.calc.AutoRecalibration", "qualname": "HighResRecalibration.positive_search_settings", "kind": "function", "doc": "

    Set the positive mode elemental search settings

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.AutoRecalibration.HighResRecalibration.get_error_range", "modulename": "corems.mass_spectrum.calc.AutoRecalibration", "qualname": "HighResRecalibration.get_error_range", "kind": "function", "doc": "

    Get the error range from the error distribution

    \n\n

    Using lmfit and seaborn kdeplot to extract the error range from the error distribution of assigned species.

    \n\n
    Parameters
    \n\n
      \n
    • errors (list):\nlist of the errors of the assigned species (ppm)
    • \n
    \n", "signature": "(self, errors: list):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.AutoRecalibration.HighResRecalibration.determine_error_boundaries", "modulename": "corems.mass_spectrum.calc.AutoRecalibration", "qualname": "HighResRecalibration.determine_error_boundaries", "kind": "function", "doc": "

    Determine the error boundaries for recalibration space

    \n\n

    This is the main function in this class\nSets the Molecular Formulas search settings, performs the initial formula search\nConverts the data to a dataframe, and gets the error range\nReturns the error thresholds.

    \n\n
    Returns
    \n\n
      \n
    • mean_error (float):\nmean mass error of the Gaussian distribution (ppm)
    • \n
    • fwhm_error (float):\nfull width half max of the gaussian error distribution (ppm)
    • \n
    • ppm_thresh (list):\nrecommended thresholds for the recalibration parameters (ppm)\nConsists of [mean_error-fwhm_error,mean_error+fwhm_error]
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.Calibration", "modulename": "corems.mass_spectrum.calc.Calibration", "kind": "module", "doc": "

    Created on Wed May 13 02:16:09 2020

    \n\n

    @author: Will Kew

    \n"}, {"fullname": "corems.mass_spectrum.calc.Calibration.MzDomainCalibration", "modulename": "corems.mass_spectrum.calc.Calibration", "qualname": "MzDomainCalibration", "kind": "class", "doc": "

    MzDomainCalibration class for recalibrating mass spectra

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (CoreMS MassSpectrum Object):\nThe mass spectrum to be calibrated.
    • \n
    • ref_masslist (str):\nThe path to a reference mass list.
    • \n
    • mzsegment (tuple of floats, optional):\nThe mz range to recalibrate, or None. Used for calibration of specific parts of the mz domain at a time.\nFuture work - allow multiple mzsegments to be passed.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • mass_spectrum (CoreMS MassSpectrum Object):\nThe mass spectrum to be calibrated.
    • \n
    • mzsegment (tuple of floats or None):\nThe mz range to recalibrate, or None.
    • \n
    • ref_mass_list_path (str or Path):\nThe path to the reference mass list.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • run(). \nMain function to run this class.
    • \n
    • load_ref_mass_list(). \nLoad reference mass list (Bruker format).
    • \n
    • gen_ref_mass_list_from_assigned(min_conf=0.7). \nGenerate reference mass list from assigned masses.
    • \n
    • find_calibration_points(df_ref, calib_ppm_error_threshold=(-1, 1), calib_snr_threshold=5). \nFind calibration points in the mass spectrum based on the reference mass list.
    • \n
    • robust_calib(param, cal_peaks_mz, cal_refs_mz, order=1). \nRecalibration function.
    • \n
    • recalibrate_mass_spectrum(cal_peaks_mz, cal_refs_mz, order=1, diagnostic=False). \nMain recalibration function which uses a robust linear regression.
    • \n
    \n"}, {"fullname": "corems.mass_spectrum.calc.Calibration.MzDomainCalibration.__init__", "modulename": "corems.mass_spectrum.calc.Calibration", "qualname": "MzDomainCalibration.__init__", "kind": "function", "doc": "

    \n", "signature": "(mass_spectrum, ref_masslist, mzsegment=None)"}, {"fullname": "corems.mass_spectrum.calc.Calibration.MzDomainCalibration.mass_spectrum", "modulename": "corems.mass_spectrum.calc.Calibration", "qualname": "MzDomainCalibration.mass_spectrum", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.Calibration.MzDomainCalibration.mzsegment", "modulename": "corems.mass_spectrum.calc.Calibration", "qualname": "MzDomainCalibration.mzsegment", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.Calibration.MzDomainCalibration.ref_mass_list_path", "modulename": "corems.mass_spectrum.calc.Calibration", "qualname": "MzDomainCalibration.ref_mass_list_path", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.Calibration.MzDomainCalibration.load_ref_mass_list", "modulename": "corems.mass_spectrum.calc.Calibration", "qualname": "MzDomainCalibration.load_ref_mass_list", "kind": "function", "doc": "

    Load reference mass list (Bruker format)

    \n\n

    Loads in a reference mass list from a .ref file\nNote that some versions of Bruker's software produce .ref files with a different format. \nAs such, users may need to manually edit the .ref file in a text editor to ensure it is in the correct format. \nCoreMS includes an example .ref file with the correct format for reference.

    \n\n
    Returns
    \n\n
      \n
    • df_ref (Pandas DataFrame):\nreference mass list object.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.Calibration.MzDomainCalibration.gen_ref_mass_list_from_assigned", "modulename": "corems.mass_spectrum.calc.Calibration", "qualname": "MzDomainCalibration.gen_ref_mass_list_from_assigned", "kind": "function", "doc": "

    Generate reference mass list from assigned masses

    \n\n

    This function will generate a ref mass dataframe object from an assigned corems mass spec obj\nusing assigned masses above a certain minimum confidence threshold.

    \n\n

    This function needs to be retested and check it is covered in the unit tests.

    \n\n
    Parameters
    \n\n
      \n
    • min_conf (float, optional):\nminimum confidence score. The default is 0.7.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • df_ref (Pandas DataFrame):\nreference mass list - based on calculated masses.
    • \n
    \n", "signature": "(self, min_conf: float = 0.7):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.Calibration.MzDomainCalibration.find_calibration_points", "modulename": "corems.mass_spectrum.calc.Calibration", "qualname": "MzDomainCalibration.find_calibration_points", "kind": "function", "doc": "

    Function to find calibration points in the mass spectrum

    \n\n

    Based on the reference mass list.

    \n\n
    Parameters
    \n\n
      \n
    • df_ref (Pandas DataFrame):\nreference mass list for recalibration.
    • \n
    • calib_ppm_error_threshold (tuple of floats, optional):\nppm error for finding calibration masses in the spectrum. The default is -1,1.\nNote: This is based on the calculation of ppm = ((mz_measure - mz_theoretical)/mz_theoretical)*1e6. \n Some software does this the other way around and value signs must be inverted for that to work.
    • \n
    • calib_snr_threshold (float, optional):\nsnr threshold for finding calibration masses in the spectrum. The default is 5.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • cal_peaks_mz (list of floats):\nmasses of measured ions to use in calibration routine
    • \n
    • cal_refs_mz (list of floats):\nreference mz values of found calibration points.
    • \n
    \n", "signature": "(\tself,\tdf_ref,\tcalib_ppm_error_threshold: tuple[float, float] = (-1, 1),\tcalib_snr_threshold: float = 5):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.Calibration.MzDomainCalibration.robust_calib", "modulename": "corems.mass_spectrum.calc.Calibration", "qualname": "MzDomainCalibration.robust_calib", "kind": "function", "doc": "

    Recalibration function

    \n\n

    Computes the rms of m/z errors to minimize when calibrating.\nThis is adapted from from spike.

    \n\n
    Parameters
    \n\n
      \n
    • param (list of floats):\ngenerated by minimize function from scipy optimize.
    • \n
    • cal_peaks_mz (list of floats):\nmasses of measured peaks to use in mass calibration.
    • \n
    • cal_peaks_mz (list of floats):\nreference mz values of found calibration points.
    • \n
    • order (int, optional):\norder of the recalibration function. 1 = linear, 2 = quadratic. The default is 1.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • rmserror (float):\nroot mean square mass error for calibration points.
    • \n
    \n", "signature": "(\tself,\tparam: list[float],\tcal_peaks_mz: list[float],\tcal_refs_mz: list[float],\torder: int = 1):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.Calibration.MzDomainCalibration.recalibrate_mass_spectrum", "modulename": "corems.mass_spectrum.calc.Calibration", "qualname": "MzDomainCalibration.recalibrate_mass_spectrum", "kind": "function", "doc": "

    Main recalibration function which uses a robust linear regression

    \n\n

    This function performs the recalibration of the mass spectrum object. \nIt iteratively applies

    \n\n
    Parameters
    \n\n
      \n
    • cal_peaks_mz (list of float):\nmasses of measured peaks to use in mass calibration.
    • \n
    • cal_refs_mz (list of float):\nreference mz values of found calibration points.
    • \n
    • order (int, optional):\norder of the recalibration function. 1 = linear, 2 = quadratic. The default is 1.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • mass_spectrum (CoreMS mass spectrum object):\nCalibrated mass spectrum object
    • \n
    \n\n
    Notes
    \n\n

    This function is adapted, in part, from the SPIKE project [1,2] and is based on the robust linear regression method.

    \n\n
    References
    \n\n
      \n
    1. Chiron L., Coutouly M-A., Starck J-P., Rolando C., Delsuc M-A. \nSPIKE a Processing Software dedicated to Fourier Spectroscopies \nhttps://arxiv.org/abs/1608.06777 (2016)
    2. \n
    3. SPIKE - https://github.com/spike-project/spike
    4. \n
    \n", "signature": "(\tself,\tcal_peaks_mz: list[float],\tcal_refs_mz: list[float],\torder: int = 1,\tdiagnostic: bool = False):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.Calibration.MzDomainCalibration.run", "modulename": "corems.mass_spectrum.calc.Calibration", "qualname": "MzDomainCalibration.run", "kind": "function", "doc": "

    Run the calibration routine

    \n\n

    This function runs the calibration routine.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.CalibrationCalc", "modulename": "corems.mass_spectrum.calc.CalibrationCalc", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.CalibrationCalc.FreqDomain_Calibration", "modulename": "corems.mass_spectrum.calc.CalibrationCalc", "qualname": "FreqDomain_Calibration", "kind": "class", "doc": "

    Frequency Domain Calibration class for mass spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (MassSpectrum):\nThe mass spectrum object.
    • \n
    • selected_mass_peaks (list):\nList of selected mass peaks.
    • \n
    • include_isotopologue (bool, optional):\nFlag to include isotopologues, by default False.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • mz_exp (ndarray):\nArray of experimental m/z values.
    • \n
    • mz_calc (ndarray):\nArray of calculated m/z values.
    • \n
    • freq_exp (ndarray):\nArray of experimental frequencies.
    • \n
    • mass_spectrum (MassSpectrum):\nThe mass spectrum object.
    • \n
    • freq_exp_ms (ndarray):\nArray of experimental frequencies for mass spectrum.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • recal_mass_spec(mz_domain, Aterm, Bterm, Cterm). \nRecalibrate the mass spectrum with the given parameters.
    • \n
    • linear(). \nPerform linear calibration.
    • \n
    • quadratic(iteration=False). \nPerform quadratic calibration.
    • \n
    • ledford_calibration(iteration=False). \nPerform Ledford calibration.
    • \n
    • step_fit(steps=4).
      \nPerform step fit calibration.
    • \n
    \n"}, {"fullname": "corems.mass_spectrum.calc.CalibrationCalc.FreqDomain_Calibration.__init__", "modulename": "corems.mass_spectrum.calc.CalibrationCalc", "qualname": "FreqDomain_Calibration.__init__", "kind": "function", "doc": "

    \n", "signature": "(mass_spectrum, selected_mass_peaks, include_isotopologue=False)"}, {"fullname": "corems.mass_spectrum.calc.CalibrationCalc.FreqDomain_Calibration.selected_mspeaks", "modulename": "corems.mass_spectrum.calc.CalibrationCalc", "qualname": "FreqDomain_Calibration.selected_mspeaks", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.CalibrationCalc.FreqDomain_Calibration.mz_exp", "modulename": "corems.mass_spectrum.calc.CalibrationCalc", "qualname": "FreqDomain_Calibration.mz_exp", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.CalibrationCalc.FreqDomain_Calibration.mz_calc", "modulename": "corems.mass_spectrum.calc.CalibrationCalc", "qualname": "FreqDomain_Calibration.mz_calc", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.CalibrationCalc.FreqDomain_Calibration.freq_exp", "modulename": "corems.mass_spectrum.calc.CalibrationCalc", "qualname": "FreqDomain_Calibration.freq_exp", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.CalibrationCalc.FreqDomain_Calibration.mass_spectrum", "modulename": "corems.mass_spectrum.calc.CalibrationCalc", "qualname": "FreqDomain_Calibration.mass_spectrum", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.CalibrationCalc.FreqDomain_Calibration.freq_exp_ms", "modulename": "corems.mass_spectrum.calc.CalibrationCalc", "qualname": "FreqDomain_Calibration.freq_exp_ms", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.CalibrationCalc.FreqDomain_Calibration.recal_mass_spec", "modulename": "corems.mass_spectrum.calc.CalibrationCalc", "qualname": "FreqDomain_Calibration.recal_mass_spec", "kind": "function", "doc": "

    Recalibrate the mass spectrum with the given parameters.

    \n\n
    Parameters
    \n\n
      \n
    • mz_domain (ndarray):\nArray of m/z values for recalibration.
    • \n
    • Aterm (float):\nAterm parameter for recalibration.
    • \n
    • Bterm (float):\nBterm parameter for recalibration.
    • \n
    • Cterm (float):\nCterm parameter for recalibration.
    • \n
    \n", "signature": "(self, mz_domain, Aterm, Bterm, Cterm):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.CalibrationCalc.FreqDomain_Calibration.linear", "modulename": "corems.mass_spectrum.calc.CalibrationCalc", "qualname": "FreqDomain_Calibration.linear", "kind": "function", "doc": "

    Perform linear calibration.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.CalibrationCalc.FreqDomain_Calibration.quadratic", "modulename": "corems.mass_spectrum.calc.CalibrationCalc", "qualname": "FreqDomain_Calibration.quadratic", "kind": "function", "doc": "

    Perform quadratic calibration.

    \n\n
    Parameters
    \n\n
      \n
    • iteration (bool, optional):\nFlag to perform iterative calibration, by default False.
    • \n
    \n", "signature": "(self, iteration: bool = False):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.CalibrationCalc.FreqDomain_Calibration.ledford_calibration", "modulename": "corems.mass_spectrum.calc.CalibrationCalc", "qualname": "FreqDomain_Calibration.ledford_calibration", "kind": "function", "doc": "

    Perform Ledford calibration.

    \n\n
    Parameters
    \n\n
      \n
    • iteration (bool, optional):\nFlag to perform iterative calibration, by default False.
    • \n
    \n", "signature": "(self, iteration: bool = False):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.CalibrationCalc.FreqDomain_Calibration.step_fit", "modulename": "corems.mass_spectrum.calc.CalibrationCalc", "qualname": "FreqDomain_Calibration.step_fit", "kind": "function", "doc": "

    Perform step fit calibration.

    \n\n
    Parameters
    \n\n
      \n
    • steps (int, optional):\nNumber of steps for step fit calibration, by default 4.
    • \n
    \n", "signature": "(self, steps: int = 4):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.KendrickGroup", "modulename": "corems.mass_spectrum.calc.KendrickGroup", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.KendrickGroup.KendrickGrouping", "modulename": "corems.mass_spectrum.calc.KendrickGroup", "qualname": "KendrickGrouping", "kind": "class", "doc": "

    Class for Kendrick grouping of mass spectra.

    \n\n
    Methods
    \n\n
      \n
    • mz_odd_even_index_lists(). \nGet odd and even indexes lists.
    • \n
    • calc_error(current, test). \nCalculate the error between two values.
    • \n
    • populate_kendrick_index_dict_error(list_indexes, sort=True). \nPopulate the Kendrick index dictionary based on error.
    • \n
    • populate_kendrick_index_dict_rounding(list_indexes, sort=True). \nPopulate the Kendrick index dictionary based on rounding.
    • \n
    • sort_abundance_kendrick_dict(even_kendrick_group_index, odd_kendrick_group_index). \nSort the Kendrick index dictionary based on abundance.
    • \n
    • kendrick_groups_indexes(sort=True). \nGet the Kendrick groups indexes dictionary.
    • \n
    \n"}, {"fullname": "corems.mass_spectrum.calc.KendrickGroup.KendrickGrouping.mz_odd_even_index_lists", "modulename": "corems.mass_spectrum.calc.KendrickGroup", "qualname": "KendrickGrouping.mz_odd_even_index_lists", "kind": "function", "doc": "

    Get odd and even indexes lists.

    \n\n
    Returns
    \n\n
      \n
    • tuple: A tuple containing the lists of even and odd indexes.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.KendrickGroup.KendrickGrouping.calc_error", "modulename": "corems.mass_spectrum.calc.KendrickGroup", "qualname": "KendrickGrouping.calc_error", "kind": "function", "doc": "

    Calculate the error between two values.

    \n\n
    Parameters
    \n\n
      \n
    • current (float):\nThe current value.
    • \n
    • test (float):\nThe test value.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: The calculated error.
    • \n
    \n", "signature": "(self, current: float, test: float):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.KendrickGroup.KendrickGrouping.populate_kendrick_index_dict_error", "modulename": "corems.mass_spectrum.calc.KendrickGroup", "qualname": "KendrickGrouping.populate_kendrick_index_dict_error", "kind": "function", "doc": "

    Populate the Kendrick index dictionary based on error.

    \n\n
    Parameters
    \n\n
      \n
    • list_indexes (list):\nThe list of indexes.
    • \n
    • sort (bool, optional):\nWhether to sort the dictionary by abundance (default is True).
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: The Kendrick index dictionary.
    • \n
    \n", "signature": "(self, list_indexes: list, sort: bool = True):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.KendrickGroup.KendrickGrouping.populate_kendrick_index_dict_rounding", "modulename": "corems.mass_spectrum.calc.KendrickGroup", "qualname": "KendrickGrouping.populate_kendrick_index_dict_rounding", "kind": "function", "doc": "

    Populate the Kendrick index dictionary based on rounding.

    \n\n
    Parameters
    \n\n
      \n
    • list_indexes (list):\nThe list of indexes.
    • \n
    • sort (bool, optional):\nWhether to sort the dictionary by abundance (default is True).
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: The Kendrick index dictionary.
    • \n
    \n", "signature": "(self, list_indexes: list, sort: bool = True):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.KendrickGroup.KendrickGrouping.sort_abundance_kendrick_dict", "modulename": "corems.mass_spectrum.calc.KendrickGroup", "qualname": "KendrickGrouping.sort_abundance_kendrick_dict", "kind": "function", "doc": "

    Sort the Kendrick index dictionary based on abundance.

    \n\n
    Parameters
    \n\n
      \n
    • even_kendrick_group_index (dict):\nThe Kendrick index dictionary for even indexes.
    • \n
    • odd_kendrick_group_index (dict):\nThe Kendrick index dictionary for odd indexes.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: The sorted Kendrick index dictionary.
    • \n
    \n", "signature": "(\tself,\teven_kendrick_group_index: dict,\todd_kendrick_group_index: dict):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.KendrickGroup.KendrickGrouping.kendrick_groups_indexes", "modulename": "corems.mass_spectrum.calc.KendrickGroup", "qualname": "KendrickGrouping.kendrick_groups_indexes", "kind": "function", "doc": "

    Get the Kendrick groups indexes dictionary.

    \n\n
    Parameters
    \n\n
      \n
    • sort (bool, optional):\nWhether to sort the dictionary by abundance (default is True).
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: The Kendrick groups indexes dictionary.
    • \n
    \n", "signature": "(self, sort: bool = True):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction.MassErrorPrediction", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "qualname": "MassErrorPrediction", "kind": "class", "doc": "

    Class for mass error prediction.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (list):\nList of mass spectrum objects.
    • \n
    • mz_overlay (int, optional):\nThe mz overlay value for peak simulation. Default is 10.
    • \n
    • rp_increments (int, optional):\nThe resolving power increments for peak simulation. Default is 10000.
    • \n
    • base_line_target (float, optional):\nThe target value for the baseline resolution. Default is 0.01.
    • \n
    • max_interation (int, optional):\nThe maximum number of iterations for peak simulation. Default is 1000.
    • \n
    • interpolation (str, optional):\nThe interpolation method for missing data. Default is 'linear'.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • mass_spectrum_obj (list):\nList of mass spectrum objects.
    • \n
    • mz_overlay (int):\nThe mz overlay value for peak simulation.
    • \n
    • rp_increments (int):\nThe resolving power increments for peak simulation.
    • \n
    • base_line_target (float):\nThe target value for the baseline resolution.
    • \n
    • max_interation (int):\nThe maximum number of iterations for peak simulation.
    • \n
    • df (DataFrame or None):\nThe calculated error distribution dataframe.
    • \n
    • interpolation (str):\nThe interpolation method for missing data.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • run().\nRuns the mass error prediction calculation.
    • \n
    • get_results().\nReturns the calculated error distribution dataframe.
    • \n
    \n", "bases": "threading.Thread"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction.MassErrorPrediction.__init__", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "qualname": "MassErrorPrediction.__init__", "kind": "function", "doc": "

    This constructor should always be called with keyword arguments. Arguments are:

    \n\n

    group should be None; reserved for future extension when a ThreadGroup\nclass is implemented.

    \n\n

    target is the callable object to be invoked by the run()\nmethod. Defaults to None, meaning nothing is called.

    \n\n

    name is the thread name. By default, a unique name is constructed of\nthe form \"Thread-N\" where N is a small decimal number.

    \n\n

    args is the argument tuple for the target invocation. Defaults to ().

    \n\n

    kwargs is a dictionary of keyword arguments for the target\ninvocation. Defaults to {}.

    \n\n

    If a subclass overrides the constructor, it must make sure to invoke\nthe base class constructor (Thread.__init__()) before doing anything\nelse to the thread.

    \n", "signature": "(\tmass_spectrum,\tmz_overlay=10,\trp_increments=10000,\tbase_line_target: float = 0.01,\tmax_interation=1000,\tinterpolation='linear')"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction.MassErrorPrediction.mass_spectrum_obj", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "qualname": "MassErrorPrediction.mass_spectrum_obj", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction.MassErrorPrediction.mz_overlay", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "qualname": "MassErrorPrediction.mz_overlay", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction.MassErrorPrediction.rp_increments", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "qualname": "MassErrorPrediction.rp_increments", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction.MassErrorPrediction.base_line_target", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "qualname": "MassErrorPrediction.base_line_target", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction.MassErrorPrediction.max_interation", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "qualname": "MassErrorPrediction.max_interation", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction.MassErrorPrediction.df", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "qualname": "MassErrorPrediction.df", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction.MassErrorPrediction.interpolation", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "qualname": "MassErrorPrediction.interpolation", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction.MassErrorPrediction.run", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "qualname": "MassErrorPrediction.run", "kind": "function", "doc": "

    Runs the mass error prediction calculation.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction.MassErrorPrediction.get_results", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "qualname": "MassErrorPrediction.get_results", "kind": "function", "doc": "

    Returns the calculated error distribution dataframe.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction.MassErrorPrediction.calc_error_dist", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "qualname": "MassErrorPrediction.calc_error_dist", "kind": "function", "doc": "

    Calculate the error distribution.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction.MassErrorPrediction.sum_data", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "qualname": "MassErrorPrediction.sum_data", "kind": "function", "doc": "

    Sum the abundances of the simulated peaks.

    \n\n
    Parameters
    \n\n
      \n
    • tuple_mz_abun_list (tuple):\nA tuple containing the mz and abundance lists.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • tuple: A tuple containing the summed mz and abundance lists.
    • \n
    \n", "signature": "(self, tuple_mz_abun_list: tuple):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction.MassErrorPrediction.calc_error", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "qualname": "MassErrorPrediction.calc_error", "kind": "function", "doc": "

    Calculate the error between two values.

    \n\n
    Parameters
    \n\n
      \n
    • mass_ref (float):\nThe reference value.
    • \n
    • mass_sim (float):\nThe simulated value.
    • \n
    • factor (float):\nThe factor to multiply the error by.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: The calculated error.
    • \n
    \n", "signature": "(self, mass_ref, mass_sim, factor):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction.MassErrorPrediction.find_peak_apex", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "qualname": "MassErrorPrediction.find_peak_apex", "kind": "function", "doc": "

    Find the peak apex.

    \n\n
    Parameters
    \n\n
      \n
    • mz (array):\nThe mz array.
    • \n
    • abund (array):\nThe abundance array.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • tuple: A tuple containing the peak apex mass and abundance.
    • \n
    \n", "signature": "(self, mz, abund):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.MassErrorPrediction.MassErrorPrediction.find_peak_valley", "modulename": "corems.mass_spectrum.calc.MassErrorPrediction", "qualname": "MassErrorPrediction.find_peak_valley", "kind": "function", "doc": "

    Find the peak valley.

    \n\n
    Parameters
    \n\n
      \n
    • mz (array):\nThe mz array.
    • \n
    • abund (array):\nThe abundance array.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • tuple: A tuple containing the peak valley mz and abundance.
    • \n
    \n", "signature": "(self, mz, abund):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.MassSpectrumCalc", "modulename": "corems.mass_spectrum.calc.MassSpectrumCalc", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.MassSpectrumCalc.MassSpecCalc", "modulename": "corems.mass_spectrum.calc.MassSpectrumCalc", "qualname": "MassSpecCalc", "kind": "class", "doc": "

    Class for Mass Spectrum Calculations

    \n\n

    Class including numerical calculations related to mass spectrum class\nInherited PeakPicking and NoiseThresholdCalc ensuring its methods are \navailable to the instantiated mass spectrum class object

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (MassSpectrum):\nCoreMS mass spectrum object
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • All Attributes are derivative from the MassSpecBase Class
    • \n
    \n\n
    Methods
    \n\n
      \n
    • check_mspeaks(). \nCheck if the mspeaks attribute is populated
    • \n
    • sort_by_abundance(). \nSort the mspeaks by abundance
    • \n
    • percentile_assigned(report_error=False,verbose=True). \nCalculate the percentage of assigned peaks
    • \n
    • resolving_power_calc(B, T). \nCalculate the resolving power
    • \n
    • number_average_molecular_weight(profile=False). \nCalculate the number average molecular weight
    • \n
    • weight_average_molecular_weight(profile=False). \nCalculate the weight average molecular weight
    • \n
    \n", "bases": "corems.mass_spectrum.calc.PeakPicking.PeakPicking, corems.mass_spectrum.calc.NoiseCalc.NoiseThresholdCalc"}, {"fullname": "corems.mass_spectrum.calc.MassSpectrumCalc.MassSpecCalc.percentile_assigned", "modulename": "corems.mass_spectrum.calc.MassSpectrumCalc", "qualname": "MassSpecCalc.percentile_assigned", "kind": "function", "doc": "

    Percentage of peaks which are assigned

    \n\n
    Parameters
    \n\n
      \n
    • report_error (bool, optional):\nReport the error of the assigned peaks. Default is False.
    • \n
    • verbose (bool, optional):\nPrint the results. Default is True.
    • \n
    \n", "signature": "(self, report_error: bool = False, verbose: bool = True):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.MassSpectrumCalc.MassSpecCalc.resolving_power_calc", "modulename": "corems.mass_spectrum.calc.MassSpectrumCalc", "qualname": "MassSpecCalc.resolving_power_calc", "kind": "function", "doc": "

    Calculate the theoretical resolving power

    \n\n

    Calls on the MSPeak object function to calculate the resolving power of a peak, this calcs for all peaks in a spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • T (float):\ntransient time
    • \n
    • B (float):\nMagnetic Filed Strength (Tesla)
    • \n
    \n\n
    References
    \n\n
      \n
    1. Marshall et al. (Mass Spectrom Rev. 1998 Jan-Feb;17(1):1-35.)\nDOI: 10.1002/(SICI)1098-2787(1998)17:1<1::AID-MAS1>3.0.CO;2-K
    2. \n
    \n", "signature": "(self, B: float, T: float):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.MassSpectrumCalc.MassSpecCalc.number_average_molecular_weight", "modulename": "corems.mass_spectrum.calc.MassSpectrumCalc", "qualname": "MassSpecCalc.number_average_molecular_weight", "kind": "function", "doc": "

    Average molecular weight calculation

    \n\n
    Parameters
    \n\n
      \n
    • profile (bool, optional):\nis data profile or centroid mode. The default is False (e.g. Centroid data)
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: The average molecular weight.
    • \n
    \n", "signature": "(self, profile: bool = False):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.MassSpectrumCalc.MassSpecCalc.weight_average_molecular_weight", "modulename": "corems.mass_spectrum.calc.MassSpectrumCalc", "qualname": "MassSpecCalc.weight_average_molecular_weight", "kind": "function", "doc": "

    Weighted Average molecular weight calculation

    \n\n
    Returns
    \n\n
      \n
    • float: The weight average molecular weight.
    • \n
    \n", "signature": "(self, profile: bool = False):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.MeanResolvingPowerFilter", "modulename": "corems.mass_spectrum.calc.MeanResolvingPowerFilter", "kind": "module", "doc": "

    Created on June 2nd 2023

    \n\n

    @author: Will Kew

    \n\n

    Module for mean resolving power filtration\nBased upon the work in:

    \n\n

    Kanawati, B, Bader, TM, Wanczek, K-P, Li, Y, Schmitt-Kopplin, P. \nFourier transform (FT)-artifacts and power-function resolution filter in Fourier transform mass spectrometry. \nRapid Commun Mass Spectrom. 2017; 31: 1607- 1615. https://doi.org/10.1002/rcm.7940

    \n\n

    Calculates a m/z normalised resolving power, fits a gaussian distribution to this, and then filters out peaks which are outside of the user defined number of standard deviations

    \n"}, {"fullname": "corems.mass_spectrum.calc.MeanResolvingPowerFilter.MeanResolvingPowerFilter", "modulename": "corems.mass_spectrum.calc.MeanResolvingPowerFilter", "qualname": "MeanResolvingPowerFilter", "kind": "class", "doc": "

    Class for for mean resolving power filtration.

    \n\n

    This module implements a mean resolving power filter based on the work described [1]

    \n\n

    The MeanResolvingPowerFilter class provides methods to calculate the m/z normalized resolving power, fit a Gaussian distribution to it, and filter out peaks that are outside of the user-defined number of standard deviations.

    \n\n
    Attributes
    \n\n
      \n
    • mass_spectrum (object) (The mass spectrum object.):

    • \n
    • ndeviations (int) (The number of standard deviations used for filtering.):

    • \n
    • plot (bool) (Flag indicating whether to plot the results.):

    • \n
    • guess_pars (bool) (Flag indicating whether to guess the parameters for the Gaussian model.):

    • \n
    \n\n
    Methods
    \n\n
      \n
    • extract_peaks(): Extracts the peaks from the mass spectrum.
    • \n
    • normalise_rps(tmpdf_ms): Normalizes the resolving powers to be independent of m/z.
    • \n
    • calculate_distribution(tmpdf_ms): Calculates the distribution of the resolving powers.
    • \n
    • create_index_list_to_remove(tmpdf_ms, rps_thresh): Creates an index list of peaks to remove based on the calculated thresholds.
    • \n
    • main(): Executes the main filtering process and returns the index list of peaks to remove.
    • \n
    \n\n
    References
    \n\n
      \n
    1. Kanawati, B, Bader, TM, Wanczek, K-P, Li, Y, Schmitt-Kopplin, P. \nFourier transform (FT)-artifacts and power-function resolution filter in Fourier transform mass spectrometry. \nRapid Commun Mass Spectrom. 2017; 31: 1607- 1615. https://doi.org/10.1002/rcm.7940
    2. \n
    \n"}, {"fullname": "corems.mass_spectrum.calc.MeanResolvingPowerFilter.MeanResolvingPowerFilter.__init__", "modulename": "corems.mass_spectrum.calc.MeanResolvingPowerFilter", "qualname": "MeanResolvingPowerFilter.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tmass_spectrum,\tndeviations: float = 3,\tplot: bool = False,\tguess_pars: bool = False)"}, {"fullname": "corems.mass_spectrum.calc.MeanResolvingPowerFilter.MeanResolvingPowerFilter.mass_spectrum", "modulename": "corems.mass_spectrum.calc.MeanResolvingPowerFilter", "qualname": "MeanResolvingPowerFilter.mass_spectrum", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.MeanResolvingPowerFilter.MeanResolvingPowerFilter.plot", "modulename": "corems.mass_spectrum.calc.MeanResolvingPowerFilter", "qualname": "MeanResolvingPowerFilter.plot", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.MeanResolvingPowerFilter.MeanResolvingPowerFilter.ndeviations", "modulename": "corems.mass_spectrum.calc.MeanResolvingPowerFilter", "qualname": "MeanResolvingPowerFilter.ndeviations", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.MeanResolvingPowerFilter.MeanResolvingPowerFilter.guess_pars", "modulename": "corems.mass_spectrum.calc.MeanResolvingPowerFilter", "qualname": "MeanResolvingPowerFilter.guess_pars", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.MeanResolvingPowerFilter.MeanResolvingPowerFilter.extract_peaks", "modulename": "corems.mass_spectrum.calc.MeanResolvingPowerFilter", "qualname": "MeanResolvingPowerFilter.extract_peaks", "kind": "function", "doc": "

    Extracts the peaks from the mass spectrum.

    \n\n
    Returns
    \n\n
      \n
    • tmpdf_ms (Pandas DataFrame):\nA DataFrame containing the extracted peaks.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.MeanResolvingPowerFilter.MeanResolvingPowerFilter.normalise_rps", "modulename": "corems.mass_spectrum.calc.MeanResolvingPowerFilter", "qualname": "MeanResolvingPowerFilter.normalise_rps", "kind": "function", "doc": "

    Normalizes the resolving powers to be independent of m/z.

    \n\n
    Parameters
    \n\n
      \n
    • tmpdf_ms (Pandas DataFrame):\nA DataFrame containing the extracted peaks.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • tmpdf_ms (Pandas DataFrame):\nA DataFrame with the resolving powers normalized.
    • \n
    \n", "signature": "(self, tmpdf_ms):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.MeanResolvingPowerFilter.MeanResolvingPowerFilter.calculate_distribution", "modulename": "corems.mass_spectrum.calc.MeanResolvingPowerFilter", "qualname": "MeanResolvingPowerFilter.calculate_distribution", "kind": "function", "doc": "

    Calculates the distribution of the resolving powers.

    \n\n
    Parameters
    \n\n
      \n
    • tmpdf_ms (Pandas DataFrame):\nA DataFrame containing the extracted peaks with normalized resolving powers.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • rps_thresh (list):\nA list of the calculated thresholds for filtering.
    • \n
    \n", "signature": "(self, tmpdf_ms):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.MeanResolvingPowerFilter.MeanResolvingPowerFilter.create_index_list_to_remove", "modulename": "corems.mass_spectrum.calc.MeanResolvingPowerFilter", "qualname": "MeanResolvingPowerFilter.create_index_list_to_remove", "kind": "function", "doc": "

    Creates an index list of peaks to remove based on the calculated thresholds.

    \n\n
    Parameters
    \n\n
      \n
    • tmpdf_ms (Pandas DataFrame):\nA DataFrame containing the extracted peaks with normalized resolving powers.
    • \n
    • rps_thresh (list):\nA list of the calculated thresholds for filtering.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • index_to_keep (list):\nA list of indices of peaks to keep.
    • \n
    \n", "signature": "(self, tmpdf_ms, rps_thresh: list):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.MeanResolvingPowerFilter.MeanResolvingPowerFilter.main", "modulename": "corems.mass_spectrum.calc.MeanResolvingPowerFilter", "qualname": "MeanResolvingPowerFilter.main", "kind": "function", "doc": "

    Executes the main filtering process and returns the index list of peaks to remove.

    \n\n
    Returns
    \n\n
      \n
    • index_to_remove (list):\nA list of indices of peaks to remove.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.NoiseCalc", "modulename": "corems.mass_spectrum.calc.NoiseCalc", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.calc.NoiseCalc.NoiseThresholdCalc", "modulename": "corems.mass_spectrum.calc.NoiseCalc", "qualname": "NoiseThresholdCalc", "kind": "class", "doc": "

    Class for noise threshold calculation.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (MassSpectrum):\nThe mass spectrum object.
    • \n
    • settings (MSParameters):\nThe mass spectrum parameters object.
    • \n
    • is_centroid (bool):\nFlag indicating whether the mass spectrum is centroid or profile.
    • \n
    • baseline_noise (float):\nThe baseline noise.
    • \n
    • baseline_noise_std (float):\nThe baseline noise standard deviation.
    • \n
    • max_signal_to_noise (float):\nThe maximum signal to noise.
    • \n
    • max_abundance (float):\nThe maximum abundance.
    • \n
    • abundance (np.array):\nThe abundance array.
    • \n
    • abundance_profile (np.array):\nThe abundance profile array.
    • \n
    • mz_exp (np.array):\nThe experimental m/z array.
    • \n
    • mz_exp_profile (np.array):\nThe experimental m/z profile array.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • None
    • \n
    \n\n
    Methods
    \n\n
      \n
    • get_noise_threshold(). Get the noise threshold.
    • \n
    • cut_mz_domain_noise(). Cut the m/z domain to the noise threshold regions.
    • \n
    • get_noise_average(ymincentroid). \nGet the average noise and standard deviation.
    • \n
    • get_abundance_minima_centroid(abun_cut)\nGet the abundance minima for centroid data.
    • \n
    • run_log_noise_threshold_calc(). \nRun the log noise threshold calculation.
    • \n
    • run_noise_threshold_calc(). \nRun the noise threshold calculation.
    • \n
    \n"}, {"fullname": "corems.mass_spectrum.calc.NoiseCalc.NoiseThresholdCalc.get_noise_threshold", "modulename": "corems.mass_spectrum.calc.NoiseCalc", "qualname": "NoiseThresholdCalc.get_noise_threshold", "kind": "function", "doc": "

    Get the noise threshold.

    \n\n
    Returns
    \n\n
      \n
    • Tuple[Tuple[float, float], Tuple[float, float]]: A tuple containing the m/z and abundance noise thresholds.\n(min_mz, max_mz), (noise_threshold, noise_threshold)
    • \n
    \n", "signature": "(self) -> Tuple[Tuple[float, float], Tuple[float, float]]:", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.NoiseCalc.NoiseThresholdCalc.cut_mz_domain_noise", "modulename": "corems.mass_spectrum.calc.NoiseCalc", "qualname": "NoiseThresholdCalc.cut_mz_domain_noise", "kind": "function", "doc": "

    Cut the m/z domain to the noise threshold regions.

    \n\n
    Returns
    \n\n
      \n
    • Tuple[np.array, np.array]: A tuple containing the m/z and abundance arrays of the truncated spectrum region.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.NoiseCalc.NoiseThresholdCalc.get_noise_average", "modulename": "corems.mass_spectrum.calc.NoiseCalc", "qualname": "NoiseThresholdCalc.get_noise_average", "kind": "function", "doc": "

    Get the average noise and standard deviation.

    \n\n
    Parameters
    \n\n
      \n
    • ymincentroid (np.array):\nThe ymincentroid array.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • Tuple[float, float]: A tuple containing the average noise and standard deviation.
    • \n
    \n", "signature": "(self, ymincentroid):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.NoiseCalc.NoiseThresholdCalc.get_abundance_minima_centroid", "modulename": "corems.mass_spectrum.calc.NoiseCalc", "qualname": "NoiseThresholdCalc.get_abundance_minima_centroid", "kind": "function", "doc": "

    Get the abundance minima for centroid data.

    \n\n
    Parameters
    \n\n
      \n
    • abun_cut (np.array):\nThe abundance cut array.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • np.array: The abundance minima array.
    • \n
    \n", "signature": "(self, abun_cut):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.NoiseCalc.NoiseThresholdCalc.run_log_noise_threshold_calc", "modulename": "corems.mass_spectrum.calc.NoiseCalc", "qualname": "NoiseThresholdCalc.run_log_noise_threshold_calc", "kind": "function", "doc": "

    Run the log noise threshold calculation.

    \n\n
    Returns
    \n\n
      \n
    • Tuple[float, float]: A tuple containing the average noise and standard deviation.
    • \n
    \n\n
    Notes
    \n\n

    Method for estimating the noise based on decimal log of all the data point

    \n\n

    Idea is that you calculate a histogram of of the log10(abundance) values. \nThe maximum of the histogram == the standard deviation of the noise.

    \n\n

    For aFT data it is a gaussian distribution of noise - not implemented here!\nFor mFT data it is a Rayleigh distribution, and the value is actually 10^(abu_max)*0.463.

    \n\n

    See the publication cited above for the derivation of this.

    \n\n
    References
    \n\n
      \n
    1. dx.doi.org/10.1021/ac403278t | Anal. Chem. 2014, 86, 3308\u22123316
    2. \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.NoiseCalc.NoiseThresholdCalc.run_noise_threshold_calc", "modulename": "corems.mass_spectrum.calc.NoiseCalc", "qualname": "NoiseThresholdCalc.run_noise_threshold_calc", "kind": "function", "doc": "

    Runs noise threshold calculation (not log based method)

    \n\n
    Returns
    \n\n
      \n
    • Tuple[float, float]: A tuple containing the average noise and standard deviation.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.NoiseCalc_Bayes", "modulename": "corems.mass_spectrum.calc.NoiseCalc_Bayes", "kind": "module", "doc": "

    This code is for Bayesian estimation of the noise levels. \nIt is it not implemented or used in the current code base. \nThe packages it uses are not part of the requirements. \nIf you want to use it, you will need to install them manually.

    \n"}, {"fullname": "corems.mass_spectrum.calc.NoiseCalc_Bayes.BayesNoiseCalc", "modulename": "corems.mass_spectrum.calc.NoiseCalc_Bayes", "qualname": "BayesNoiseCalc", "kind": "class", "doc": "

    Class for noise threshold calculation.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (MassSpectrum):\nThe mass spectrum object.
    • \n
    • settings (MSParameters):\nThe mass spectrum parameters object.
    • \n
    • is_centroid (bool):\nFlag indicating whether the mass spectrum is centroid or profile.
    • \n
    • baseline_noise (float):\nThe baseline noise.
    • \n
    • baseline_noise_std (float):\nThe baseline noise standard deviation.
    • \n
    • max_signal_to_noise (float):\nThe maximum signal to noise.
    • \n
    • max_abundance (float):\nThe maximum abundance.
    • \n
    • abundance (np.array):\nThe abundance array.
    • \n
    • abundance_profile (np.array):\nThe abundance profile array.
    • \n
    • mz_exp (np.array):\nThe experimental m/z array.
    • \n
    • mz_exp_profile (np.array):\nThe experimental m/z profile array.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • None
    • \n
    \n\n
    Methods
    \n\n
      \n
    • get_noise_threshold(). Get the noise threshold.
    • \n
    • cut_mz_domain_noise(). Cut the m/z domain to the noise threshold regions.
    • \n
    • get_noise_average(ymincentroid). \nGet the average noise and standard deviation.
    • \n
    • get_abundance_minima_centroid(abun_cut)\nGet the abundance minima for centroid data.
    • \n
    • run_log_noise_threshold_calc(). \nRun the log noise threshold calculation.
    • \n
    • run_noise_threshold_calc(). \nRun the noise threshold calculation.
    • \n
    \n", "bases": "corems.mass_spectrum.calc.NoiseCalc.NoiseThresholdCalc"}, {"fullname": "corems.mass_spectrum.calc.NoiseCalc_Bayes.BayesNoiseCalc.from_posterior", "modulename": "corems.mass_spectrum.calc.NoiseCalc_Bayes", "qualname": "BayesNoiseCalc.from_posterior", "kind": "function", "doc": "

    Legacy code for Bayesian efforts - not used.

    \n\n

    pymc3 is not installed by default, \n if have plans to use it manual installation of pymc3 \n package before using this method is needed

    \n", "signature": "(self, param, samples):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.NoiseCalc_Bayes.BayesNoiseCalc.error_model_from_trace", "modulename": "corems.mass_spectrum.calc.NoiseCalc_Bayes", "qualname": "BayesNoiseCalc.error_model_from_trace", "kind": "function", "doc": "

    Legacy code for Bayesian efforts - not used.

    \n\n

    pymc3 is not installed by default, \n if have plans to use it manual installation of pymc3 \n package before using this method is needed

    \n", "signature": "(self, trace, ymincentroid):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.NoiseCalc_Bayes.BayesNoiseCalc.simple_model_error_dist", "modulename": "corems.mass_spectrum.calc.NoiseCalc_Bayes", "qualname": "BayesNoiseCalc.simple_model_error_dist", "kind": "function", "doc": "

    Legacy code for Bayesian efforts - not used.

    \n\n

    pymc3 is not installed by default, \n if have plans to use it manual installation of pymc3 \n package before using this method is needed

    \n", "signature": "(self, ymincentroid):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.PeakPicking", "modulename": "corems.mass_spectrum.calc.PeakPicking", "kind": "module", "doc": "

    @author: Yuri E. Corilo\n@date: Jun 27, 2019

    \n"}, {"fullname": "corems.mass_spectrum.calc.PeakPicking.PeakPicking", "modulename": "corems.mass_spectrum.calc.PeakPicking", "qualname": "PeakPicking", "kind": "class", "doc": "

    Class for peak picking.

    \n\n
    Parameters
    \n\n
      \n
    • None
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • None
    • \n
    \n\n
    Methods
    \n\n
      \n
    • cut_mz_domain_peak_picking().\nCut the m/z domain for peak picking.
    • \n
    • extrapolate_axes_for_pp().\nExtrapolate the m/z axis and fill the abundance axis with 0s.
    • \n
    • do_peak_picking().\nPerform peak picking.
    • \n
    • find_minima(apex_index, abundance, len_abundance, right=True).\nFind the minima of a peak.
    • \n
    • calculate_resolving_power(intes, massa, current_index).\nCalculate the resolving power of a peak.
    • \n
    • cal_minima(mass, abun).\nCalculate the minima of a peak.
    • \n
    • calc_centroid(mass, abund, freq).\nCalculate the centroid of a peak.
    • \n
    \n"}, {"fullname": "corems.mass_spectrum.calc.PeakPicking.PeakPicking.cut_mz_domain_peak_picking", "modulename": "corems.mass_spectrum.calc.PeakPicking", "qualname": "PeakPicking.cut_mz_domain_peak_picking", "kind": "function", "doc": "

    Cut the m/z domain for peak picking.

    \n\n
    Returns
    \n\n
      \n
    • mz_domain_X_low_cutoff (ndarray):\nThe m/z values within the specified range.
    • \n
    • mz_domain_low_Y_cutoff (ndarray):\nThe abundance values within the specified range.
    • \n
    • freq_domain_low_Y_cutoff (ndarray or None):\nThe frequency values within the specified range, if available.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.PeakPicking.PeakPicking.extrapolate_axes_for_pp", "modulename": "corems.mass_spectrum.calc.PeakPicking", "qualname": "PeakPicking.extrapolate_axes_for_pp", "kind": "function", "doc": "

    Extrapolate the m/z axis and fill the abundance axis with 0s.

    \n\n
    Returns
    \n\n
      \n
    • mz (ndarray):\nThe extrapolated m/z axis.
    • \n
    • abund (ndarray):\nThe abundance axis with 0s filled.
    • \n
    • freq (ndarray or None):\nThe extrapolated frequency axis, if available.
    • \n
    \n\n
    Notes
    \n\n

    This function will extrapolate the mz axis by N datapoints, and fill the abundance axis with 0s. \nThis should prevent peak picking issues at the spectrum edge.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.PeakPicking.PeakPicking.do_peak_picking", "modulename": "corems.mass_spectrum.calc.PeakPicking", "qualname": "PeakPicking.do_peak_picking", "kind": "function", "doc": "

    Perform peak picking.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.PeakPicking.PeakPicking.find_minima", "modulename": "corems.mass_spectrum.calc.PeakPicking", "qualname": "PeakPicking.find_minima", "kind": "function", "doc": "

    Find the minima of a peak.

    \n\n
    Parameters
    \n\n
      \n
    • apex_index (int):\nThe index of the peak apex.
    • \n
    • abundance (ndarray):\nThe abundance values.
    • \n
    • len_abundance (int):\nThe length of the abundance array.
    • \n
    • right (bool, optional):\nFlag indicating whether to search for minima to the right of the apex (default is True).
    • \n
    \n\n
    Returns
    \n\n
      \n
    • int: The index of the minima.
    • \n
    \n", "signature": "(self, apex_index, abundance, len_abundance, right=True):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.PeakPicking.PeakPicking.calculate_resolving_power", "modulename": "corems.mass_spectrum.calc.PeakPicking", "qualname": "PeakPicking.calculate_resolving_power", "kind": "function", "doc": "

    Calculate the resolving power of a peak.

    \n\n
    Parameters
    \n\n
      \n
    • intes (ndarray):\nThe intensity values.
    • \n
    • massa (ndarray):\nThe mass values.
    • \n
    • current_index (int):\nThe index of the current peak.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: The resolving power of the peak.
    • \n
    \n\n
    Notes
    \n\n

    This is a conservative calculation of resolving power,\nthe peak need to be resolved at least at the half-maximum magnitude,\notherwise, the combined full width at half maximum is used to calculate resolving power.

    \n", "signature": "(self, intes, massa, current_index):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.PeakPicking.PeakPicking.cal_minima", "modulename": "corems.mass_spectrum.calc.PeakPicking", "qualname": "PeakPicking.cal_minima", "kind": "function", "doc": "

    Calculate the minima of a peak.

    \n\n
    Parameters
    \n\n
      \n
    • mass (ndarray):\nThe mass values.
    • \n
    • abun (ndarray):\nThe abundance values.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • ndarray or None: The mass values at the minima, if found.
    • \n
    \n", "signature": "(self, mass, abun):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.PeakPicking.PeakPicking.calc_centroid", "modulename": "corems.mass_spectrum.calc.PeakPicking", "qualname": "PeakPicking.calc_centroid", "kind": "function", "doc": "

    Calculate the centroid of a peak.

    \n\n
    Parameters
    \n\n
      \n
    • mass (ndarray):\nThe mass values.
    • \n
    • abund (ndarray):\nThe abundance values.
    • \n
    • freq (ndarray or None):\nThe frequency values, if available.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • None
    • \n
    \n", "signature": "(self, mass, abund, freq):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.PeakPicking.PeakPicking.get_threshold", "modulename": "corems.mass_spectrum.calc.PeakPicking", "qualname": "PeakPicking.get_threshold", "kind": "function", "doc": "

    Get the intensity threshold for peak picking.

    \n\n
    Parameters
    \n\n
      \n
    • intes (ndarray):\nThe intensity values.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: The intensity threshold.
    • \n
    • float: The factor to multiply the intensity threshold by.
    • \n
    \n", "signature": "(self, intes):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.PeakPicking.PeakPicking.find_apex_fit_quadratic", "modulename": "corems.mass_spectrum.calc.PeakPicking", "qualname": "PeakPicking.find_apex_fit_quadratic", "kind": "function", "doc": "

    Find the apex of a peak.

    \n\n
    Parameters
    \n\n
      \n
    • mass (ndarray):\nThe mass values.
    • \n
    • abund (ndarray):\nThe abundance values.
    • \n
    • freq (ndarray or None):\nThe frequency values, if available.
    • \n
    • current_index (int):\nThe index of the current peak.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: The m/z value of the peak apex.
    • \n
    • float: The frequency value of the peak apex, if available.
    • \n
    • float: The abundance value of the peak apex.
    • \n
    \n", "signature": "(self, mass, abund, freq, current_index):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.PeakPicking.PeakPicking.check_prominence", "modulename": "corems.mass_spectrum.calc.PeakPicking", "qualname": "PeakPicking.check_prominence", "kind": "function", "doc": "

    Check the prominence of a peak.

    \n\n
    Parameters
    \n\n
      \n
    • abun (ndarray):\nThe abundance values.
    • \n
    • current_index (int):\nThe index of the current peak.
    • \n
    • len_abundance (int):\nThe length of the abundance array.
    • \n
    • peak_height_diff (function):\nThe function to calculate the peak height difference.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • tuple or False: A tuple containing the indexes of the peak, if the prominence is above the threshold.\nOtherwise, False.
    • \n
    \n", "signature": "(self, abun, current_index, len_abundance, peak_height_diff) -> tuple:", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.PeakPicking.PeakPicking.use_the_max", "modulename": "corems.mass_spectrum.calc.PeakPicking", "qualname": "PeakPicking.use_the_max", "kind": "function", "doc": "

    Use the max peak height as the centroid

    \n\n
    Parameters
    \n\n
      \n
    • mass (ndarray):\nThe mass values.
    • \n
    • abund (ndarray):\nThe abundance values.
    • \n
    • current_index (int):\nThe index of the current peak.
    • \n
    • len_abundance (int):\nThe length of the abundance array.
    • \n
    • peak_height_diff (function):\nThe function to calculate the peak height difference.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: The m/z value of the peak apex.
    • \n
    • float: The abundance value of the peak apex.
    • \n
    • tuple or None: A tuple containing the indexes of the peak, if the prominence is above the threshold.\nOtherwise, None.
    • \n
    \n", "signature": "(self, mass, abund, current_index, len_abundance, peak_height_diff):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.calc.PeakPicking.PeakPicking.calc_centroid_legacy", "modulename": "corems.mass_spectrum.calc.PeakPicking", "qualname": "PeakPicking.calc_centroid_legacy", "kind": "function", "doc": "

    Legacy centroid calculation\nDeprecated - for deletion.

    \n", "signature": "(self, mass, abund, freq):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory", "modulename": "corems.mass_spectrum.factory", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.overrides", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "overrides", "kind": "function", "doc": "

    Checks if the method overrides a method from an interface class.

    \n", "signature": "(interface_class):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase", "kind": "class", "doc": "

    A mass spectrum base class, stores the profile data and instrument settings.

    \n\n

    Iteration over a list of MSPeaks classes stored at the _mspeaks attributes.\n_mspeaks is populated under the hood by calling process_mass_spec method.\nIteration is null if _mspeaks is empty.

    \n\n
    Parameters
    \n\n
      \n
    • mz_exp (array_like):\nThe m/z values of the mass spectrum.
    • \n
    • abundance (array_like):\nThe abundance values of the mass spectrum.
    • \n
    • d_params (dict):\nA dictionary of parameters for the mass spectrum.
    • \n
    • **kwargs: Additional keyword arguments.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • mspeaks (list):\nA list of mass peaks.
    • \n
    • is_calibrated (bool):\nWhether the mass spectrum is calibrated.
    • \n
    • is_centroid (bool):\nWhether the mass spectrum is centroided.
    • \n
    • has_frequency (bool):\nWhether the mass spectrum has a frequency domain.
    • \n
    • calibration_order (None or int):\nThe order of the mass spectrum's calibration.
    • \n
    • calibration_points (None or ndarray):\nThe calibration points of the mass spectrum.
    • \n
    • calibration_RMS (None or float):\nThe root mean square of the mass spectrum's calibration.
    • \n
    • calibration_segment (None or CalibrationSegment):\nThe calibration segment of the mass spectrum.
    • \n
    • _abundance (ndarray):\nThe abundance values of the mass spectrum.
    • \n
    • _mz_exp (ndarray):\nThe m/z values of the mass spectrum.
    • \n
    • _mspeaks (list):\nA list of mass peaks.
    • \n
    • _dict_nominal_masses_indexes (dict):\nA dictionary of nominal masses and their indexes.
    • \n
    • _baseline_noise (float):\nThe baseline noise of the mass spectrum.
    • \n
    • _baseline_noise_std (float):\nThe standard deviation of the baseline noise of the mass spectrum.
    • \n
    • _dynamic_range (float or None):\nThe dynamic range of the mass spectrum.
    • \n
    • _transient_settings (None or TransientSettings):\nThe transient settings of the mass spectrum.
    • \n
    • _frequency_domain (None or FrequencyDomain):\nThe frequency domain of the mass spectrum.
    • \n
    • _mz_cal_profile (None or MzCalibrationProfile):\nThe m/z calibration profile of the mass spectrum.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • process_mass_spec(). Main function to process the mass spectrum, \nincluding calculating the noise threshold, peak picking, and resetting the MSpeak indexes.
    • \n
    \n\n

    See also: MassSpecCentroid(), MassSpecfromFreq(), MassSpecProfile()

    \n", "bases": "corems.mass_spectrum.calc.MassSpectrumCalc.MassSpecCalc, corems.mass_spectrum.calc.KendrickGroup.KendrickGrouping"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.__init__", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.__init__", "kind": "function", "doc": "

    \n", "signature": "(mz_exp, abundance, d_params, **kwargs)"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.mspeaks", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.mspeaks", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.is_calibrated", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.is_calibrated", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.is_centroid", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.is_centroid", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.has_frequency", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.has_frequency", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.calibration_order", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.calibration_order", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.calibration_points", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.calibration_points", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.calibration_RMS", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.calibration_RMS", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.calibration_segment", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.calibration_segment", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.set_indexes", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.set_indexes", "kind": "function", "doc": "

    Set the mass spectrum to iterate over only the selected MSpeaks indexes.

    \n\n
    Parameters
    \n\n
      \n
    • list_indexes (list of int):\nA list of integers representing the indexes of the MSpeaks to iterate over.
    • \n
    \n", "signature": "(self, list_indexes):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.reset_indexes", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.reset_indexes", "kind": "function", "doc": "

    Reset the mass spectrum to iterate over all MSpeaks objects.

    \n\n

    This method resets the mass spectrum to its original state, allowing iteration over all MSpeaks objects.\nIt also sets the index of each MSpeak object to its corresponding position in the mass spectrum.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.add_mspeak", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.add_mspeak", "kind": "function", "doc": "

    Add a new MSPeak object to the MassSpectrum object.

    \n\n
    Parameters
    \n\n
      \n
    • ion_charge (int):\nThe ion charge of the MSPeak.
    • \n
    • mz_exp (float):\nThe experimental m/z value of the MSPeak.
    • \n
    • abundance (float):\nThe abundance of the MSPeak.
    • \n
    • resolving_power (float):\nThe resolving power of the MSPeak.
    • \n
    • signal_to_noise (float):\nThe signal-to-noise ratio of the MSPeak.
    • \n
    • massspec_indexes (list):\nA list of indexes of the MSPeak in the MassSpectrum object.
    • \n
    • exp_freq (float, optional):\nThe experimental frequency of the MSPeak. Defaults to None.
    • \n
    • ms_parent (MSParent, optional):\nThe MSParent object associated with the MSPeak. Defaults to None.
    • \n
    \n", "signature": "(\tself,\tion_charge,\tmz_exp,\tabundance,\tresolving_power,\tsignal_to_noise,\tmassspec_indexes,\texp_freq=None,\tms_parent=None):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.reset_cal_therms", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.reset_cal_therms", "kind": "function", "doc": "

    Reset calibration terms and recalculate the mass-to-charge ratio and abundance.

    \n\n
    Parameters
    \n\n
      \n
    • Aterm (float):\nThe A-term calibration coefficient.
    • \n
    • Bterm (float):\nThe B-term calibration coefficient.
    • \n
    • C (float):\nThe C-term calibration coefficient.
    • \n
    • fas (float, optional):\nThe frequency amplitude scaling factor. Default is 0.
    • \n
    \n", "signature": "(self, Aterm, Bterm, C, fas=0):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.clear_molecular_formulas", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.clear_molecular_formulas", "kind": "function", "doc": "

    Clear the molecular formulas for all mspeaks in the MassSpectrum.

    \n\n
    Returns
    \n\n
      \n
    • numpy.ndarray: An array of the cleared molecular formulas for each mspeak in the MassSpectrum.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.process_mass_spec", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.process_mass_spec", "kind": "function", "doc": "

    Process the mass spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • keep_profile (bool, optional):\nWhether to keep the profile data after processing. Defaults to True.
    • \n
    \n\n
    Notes
    \n\n

    This method does the following:

    \n\n
      \n
    • calculates the noise threshold
    • \n
    • does peak picking (creates mspeak_objs)
    • \n
    • resets the mspeak_obj indexes
    • \n
    \n", "signature": "(self, keep_profile=True):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.cal_noise_threshold", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.cal_noise_threshold", "kind": "function", "doc": "

    Calculate the noise threshold of the mass spectrum.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.parameters", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.parameters", "kind": "variable", "doc": "

    Return the parameters of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.set_parameter_from_json", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.set_parameter_from_json", "kind": "function", "doc": "

    Set the parameters of the mass spectrum from a JSON file.

    \n\n
    Parameters
    \n\n
      \n
    • parameters_path (str):\nThe path to the JSON file containing the parameters.
    • \n
    \n", "signature": "(self, parameters_path):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.set_parameter_from_toml", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.set_parameter_from_toml", "kind": "function", "doc": "

    \n", "signature": "(self, parameters_path):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.mspeaks_settings", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.mspeaks_settings", "kind": "variable", "doc": "

    Return the MS peak settings of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.settings", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.settings", "kind": "variable", "doc": "

    Return the settings of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.molecular_search_settings", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.molecular_search_settings", "kind": "variable", "doc": "

    Return the molecular search settings of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.mz_cal_profile", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.mz_cal_profile", "kind": "variable", "doc": "

    Return the calibrated m/z profile of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.mz_cal", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.mz_cal", "kind": "variable", "doc": "

    Return the calibrated m/z values of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.mz_exp", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.mz_exp", "kind": "variable", "doc": "

    Return the experimental m/z values of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.freq_exp_profile", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.freq_exp_profile", "kind": "variable", "doc": "

    Return the experimental frequency profile of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.mz_exp_profile", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.mz_exp_profile", "kind": "variable", "doc": "

    Return the experimental m/z profile of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.abundance_profile", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.abundance_profile", "kind": "variable", "doc": "

    Return the abundance profile of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.abundance", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.abundance", "kind": "variable", "doc": "

    Return the abundance values of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.freq_exp", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.freq_exp", "kind": "function", "doc": "

    Return the experimental frequency values of the mass spectrum.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.resolving_power", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.resolving_power", "kind": "variable", "doc": "

    Return the resolving power values of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.signal_to_noise", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.signal_to_noise", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.nominal_mz", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.nominal_mz", "kind": "variable", "doc": "

    Return the nominal m/z values of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.get_mz_and_abundance_peaks_tuples", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.get_mz_and_abundance_peaks_tuples", "kind": "function", "doc": "

    Return a list of tuples containing the m/z and abundance values of the mass spectrum.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.kmd", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.kmd", "kind": "variable", "doc": "

    Return the Kendrick mass defect values of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.kendrick_mass", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.kendrick_mass", "kind": "variable", "doc": "

    Return the Kendrick mass values of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.max_mz_exp", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.max_mz_exp", "kind": "variable", "doc": "

    Return the maximum experimental m/z value of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.min_mz_exp", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.min_mz_exp", "kind": "variable", "doc": "

    Return the minimum experimental m/z value of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.max_abundance", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.max_abundance", "kind": "variable", "doc": "

    Return the maximum abundance value of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.max_signal_to_noise", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.max_signal_to_noise", "kind": "variable", "doc": "

    Return the maximum signal-to-noise ratio of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.most_abundant_mspeak", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.most_abundant_mspeak", "kind": "variable", "doc": "

    Return the most abundant MSpeak object of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.min_abundance", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.min_abundance", "kind": "variable", "doc": "

    Return the minimum abundance value of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.dynamic_range", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.dynamic_range", "kind": "variable", "doc": "

    Return the dynamic range of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.baseline_noise", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.baseline_noise", "kind": "variable", "doc": "

    Return the baseline noise of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.baseline_noise_std", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.baseline_noise_std", "kind": "variable", "doc": "

    Return the standard deviation of the baseline noise of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.Aterm", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.Aterm", "kind": "variable", "doc": "

    Return the A-term calibration coefficient of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.Bterm", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.Bterm", "kind": "variable", "doc": "

    Return the B-term calibration coefficient of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.Cterm", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.Cterm", "kind": "variable", "doc": "

    Return the C-term calibration coefficient of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.filename", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.filename", "kind": "variable", "doc": "

    Return the filename of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.dir_location", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.dir_location", "kind": "variable", "doc": "

    Return the directory location of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.sort_by_mz", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.sort_by_mz", "kind": "function", "doc": "

    Sort the mass spectrum by m/z values.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.sort_by_abundance", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.sort_by_abundance", "kind": "function", "doc": "

    Sort the mass spectrum by abundance values.

    \n", "signature": "(self, reverse=False):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.tic", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.tic", "kind": "variable", "doc": "

    Return the total ion current of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.check_mspeaks_warning", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.check_mspeaks_warning", "kind": "function", "doc": "

    Check if the mass spectrum has MSpeaks objects.

    \n\n
    Raises
    \n\n
      \n
    • Warning: If the mass spectrum has no MSpeaks objects.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.check_mspeaks", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.check_mspeaks", "kind": "function", "doc": "

    Check if the mass spectrum has MSpeaks objects.

    \n\n
    Raises
    \n\n
      \n
    • Exception: If the mass spectrum has no MSpeaks objects.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.remove_assignment_by_index", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.remove_assignment_by_index", "kind": "function", "doc": "

    Remove the molecular formula assignment of the MSpeaks objects at the specified indexes.

    \n\n
    Parameters
    \n\n
      \n
    • indexes (list of int):\nA list of indexes of the MSpeaks objects to remove the molecular formula assignment from.
    • \n
    \n", "signature": "(self, indexes):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.filter_by_index", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.filter_by_index", "kind": "function", "doc": "

    Filter the mass spectrum by the specified indexes.

    \n\n
    Parameters
    \n\n
      \n
    • list_indexes (list of int):\nA list of indexes of the MSpeaks objects to keep.
    • \n
    \n", "signature": "(self, list_indexes):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.filter_by_mz", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.filter_by_mz", "kind": "function", "doc": "

    Filter the mass spectrum by the specified m/z range.

    \n\n
    Parameters
    \n\n
      \n
    • min_mz (float):\nThe minimum m/z value to keep.
    • \n
    • max_mz (float):\nThe maximum m/z value to keep.
    • \n
    \n", "signature": "(self, min_mz, max_mz):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.filter_by_s2n", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.filter_by_s2n", "kind": "function", "doc": "

    Filter the mass spectrum by the specified signal-to-noise ratio range.

    \n\n
    Parameters
    \n\n
      \n
    • min_s2n (float):\nThe minimum signal-to-noise ratio to keep.
    • \n
    • max_s2n (float, optional):\nThe maximum signal-to-noise ratio to keep. Defaults to False (no maximum).
    • \n
    \n", "signature": "(self, min_s2n, max_s2n=False):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.filter_by_abundance", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.filter_by_abundance", "kind": "function", "doc": "

    Filter the mass spectrum by the specified abundance range.

    \n\n
    Parameters
    \n\n
      \n
    • min_abund (float):\nThe minimum abundance to keep.
    • \n
    • max_abund (float, optional):\nThe maximum abundance to keep. Defaults to False (no maximum).
    • \n
    \n", "signature": "(self, min_abund, max_abund=False):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.filter_by_max_resolving_power", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.filter_by_max_resolving_power", "kind": "function", "doc": "

    Filter the mass spectrum by the specified maximum resolving power.

    \n\n
    Parameters
    \n\n
      \n
    • B (float):

    • \n
    • T (float):

    • \n
    \n", "signature": "(self, B, T):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.filter_by_mean_resolving_power", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.filter_by_mean_resolving_power", "kind": "function", "doc": "

    Filter the mass spectrum by the specified mean resolving power.

    \n\n
    Parameters
    \n\n
      \n
    • ndeviations (float, optional):\nThe number of standard deviations to use for filtering. Defaults to 3.
    • \n
    • plot (bool, optional):\nWhether to plot the resolving power distribution. Defaults to False.
    • \n
    • guess_pars (bool, optional):\nWhether to guess the parameters for the Gaussian model. Defaults to False.
    • \n
    \n", "signature": "(self, ndeviations=3, plot=False, guess_pars=False):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.filter_by_min_resolving_power", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.filter_by_min_resolving_power", "kind": "function", "doc": "

    Filter the mass spectrum by the specified minimum resolving power.

    \n\n
    Parameters
    \n\n
      \n
    • B (float):

    • \n
    • T (float):

    • \n
    \n", "signature": "(self, B, T):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.filter_by_noise_threshold", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.filter_by_noise_threshold", "kind": "function", "doc": "

    Filter the mass spectrum by the noise threshold.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.find_peaks", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.find_peaks", "kind": "function", "doc": "

    Find the peaks of the mass spectrum.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.change_kendrick_base_all_mspeaks", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.change_kendrick_base_all_mspeaks", "kind": "function", "doc": "

    Change the Kendrick base of all MSpeaks objects.

    \n\n
    Parameters
    \n\n
      \n
    • kendrick_dict_base (dict):\nA dictionary of the Kendrick base to change to.
    • \n
    \n\n
    Notes
    \n\n

    Example of kendrick_dict_base parameter: kendrick_dict_base = {\"C\": 1, \"H\": 2} or {\"C\": 1, \"H\": 1, \"O\":1} etc

    \n", "signature": "(self, kendrick_dict_base):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.get_nominal_mz_first_last_indexes", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.get_nominal_mz_first_last_indexes", "kind": "function", "doc": "

    Return the first and last indexes of the MSpeaks objects with the specified nominal mass.

    \n\n
    Parameters
    \n\n
      \n
    • nominal_mass (int):\nThe nominal mass to get the indexes for.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • tuple: A tuple containing the first and last indexes of the MSpeaks objects with the specified nominal mass.
    • \n
    \n", "signature": "(self, nominal_mass):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.get_masses_count_by_nominal_mass", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.get_masses_count_by_nominal_mass", "kind": "function", "doc": "

    Return a dictionary of the nominal masses and their counts.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.datapoints_count_by_nominal_mz", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.datapoints_count_by_nominal_mz", "kind": "function", "doc": "

    Return a dictionary of the nominal masses and their counts.

    \n\n
    Parameters
    \n\n
      \n
    • mz_overlay (float, optional):\nThe m/z overlay to use for counting. Defaults to 0.1.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: A dictionary of the nominal masses and their counts.
    • \n
    \n", "signature": "(self, mz_overlay=0.1):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.get_nominal_mass_indexes", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.get_nominal_mass_indexes", "kind": "function", "doc": "

    Return the indexes of the MSpeaks objects with the specified nominal mass.

    \n\n
    Parameters
    \n\n
      \n
    • nominal_mass (int):\nThe nominal mass to get the indexes for.
    • \n
    • overlay (float, optional):\nThe m/z overlay to use for counting. Defaults to 0.1.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • generator: A generator of the indexes of the MSpeaks objects with the specified nominal mass.
    • \n
    \n", "signature": "(self, nominal_mass, overlay=0.1):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.plot_centroid", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.plot_centroid", "kind": "function", "doc": "

    Plot the centroid data of the mass spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • ax (matplotlib.axes.Axes, optional):\nThe matplotlib axes to plot on. Defaults to None.
    • \n
    • c (str, optional):\nThe color to use for the plot. Defaults to 'g' (green).
    • \n
    \n\n
    Returns
    \n\n
      \n
    • matplotlib.axes.Axes: The matplotlib axes containing the plot.
    • \n
    \n\n
    Raises
    \n\n
      \n
    • Exception: If no centroid data is found.
    • \n
    \n", "signature": "(self, ax=None, c='g'):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.plot_profile_and_noise_threshold", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.plot_profile_and_noise_threshold", "kind": "function", "doc": "

    Plot the profile data and noise threshold of the mass spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • ax (matplotlib.axes.Axes, optional):\nThe matplotlib axes to plot on. Defaults to None.
    • \n
    • legend (bool, optional):\nWhether to show the legend. Defaults to False.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • matplotlib.axes.Axes: The matplotlib axes containing the plot.
    • \n
    \n\n
    Raises
    \n\n
      \n
    • Exception: If no noise threshold is found.
    • \n
    \n", "signature": "(self, ax=None, legend=False):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.plot_mz_domain_profile", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.plot_mz_domain_profile", "kind": "function", "doc": "

    Plot the m/z domain profile of the mass spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • color (str, optional):\nThe color to use for the plot. Defaults to 'green'.
    • \n
    • ax (matplotlib.axes.Axes, optional):\nThe matplotlib axes to plot on. Defaults to None.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • matplotlib.axes.Axes: The matplotlib axes containing the plot.
    • \n
    \n", "signature": "(self, color='green', ax=None):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.to_excel", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.to_excel", "kind": "function", "doc": "

    Export the mass spectrum to an Excel file.

    \n\n
    Parameters
    \n\n
      \n
    • out_file_path (str):\nThe path to the Excel file to export to.
    • \n
    • write_metadata (bool, optional):\nWhether to write the metadata to the Excel file. Defaults to True.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • None
    • \n
    \n", "signature": "(self, out_file_path, write_metadata=True):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.to_hdf", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.to_hdf", "kind": "function", "doc": "

    Export the mass spectrum to an HDF file.

    \n\n
    Parameters
    \n\n
      \n
    • out_file_path (str):\nThe path to the HDF file to export to.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • None
    • \n
    \n", "signature": "(self, out_file_path):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.to_csv", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.to_csv", "kind": "function", "doc": "

    Export the mass spectrum to a CSV file.

    \n\n
    Parameters
    \n\n
      \n
    • out_file_path (str):\nThe path to the CSV file to export to.
    • \n
    • write_metadata (bool, optional):\nWhether to write the metadata to the CSV file. Defaults to True.
    • \n
    \n", "signature": "(self, out_file_path, write_metadata=True):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.to_pandas", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.to_pandas", "kind": "function", "doc": "

    Export the mass spectrum to a Pandas dataframe with pkl extension.

    \n\n
    Parameters
    \n\n
      \n
    • out_file_path (str):\nThe path to the CSV file to export to.
    • \n
    • write_metadata (bool, optional):\nWhether to write the metadata to the CSV file. Defaults to True.
    • \n
    \n", "signature": "(self, out_file_path, write_metadata=True):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.to_dataframe", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.to_dataframe", "kind": "function", "doc": "

    Return the mass spectrum as a Pandas dataframe.

    \n\n
    Returns
    \n\n
      \n
    • pandas.DataFrame: The mass spectrum as a Pandas dataframe.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.to_json", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.to_json", "kind": "function", "doc": "

    Return the mass spectrum as a JSON file.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.parameters_json", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.parameters_json", "kind": "function", "doc": "

    Return the parameters of the mass spectrum as a JSON string.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecBase.parameters_toml", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecBase.parameters_toml", "kind": "function", "doc": "

    Return the parameters of the mass spectrum as a TOML string.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecProfile", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecProfile", "kind": "class", "doc": "

    A mass spectrum class when the entry point is on profile format

    \n\n
    Notes
    \n\n

    Stores the profile data and instrument settings. \nIteration over a list of MSPeaks classes stored at the _mspeaks attributes.\n_mspeaks is populated under the hood by calling process_mass_spec method.\nIteration is null if _mspeaks is empty. Many more attributes and methods inherited from MassSpecBase().

    \n\n
    Parameters
    \n\n
      \n
    • data_dict (dict):\nA dictionary containing the profile data.
    • \n
    • d_params : dict{'str' (float, int or str}):\ncontains the instrument settings and processing settings
    • \n
    • auto_process (bool, optional):\nWhether to automatically process the mass spectrum. Defaults to True.
    • \n
    \n\n
    Attributes
    \n\n

    _abundance : ndarray\n The abundance values of the mass spectrum.\n_mz_exp : ndarray\n The m/z values of the mass spectrum.\n_mspeaks : list\n A list of mass peaks.

    \n\n
    Methods
    \n\n
      \n
    • process_mass_spec(). Process the mass spectrum.
    • \n
    \n\n

    see also: MassSpecBase(), MassSpecfromFreq(), MassSpecCentroid()

    \n", "bases": "MassSpecBase"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecProfile.__init__", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecProfile.__init__", "kind": "function", "doc": "

    \n", "signature": "(data_dict, d_params, auto_process=True)"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecfromFreq", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecfromFreq", "kind": "class", "doc": "

    A mass spectrum class when data entry is on frequency domain

    \n\n
    Notes
    \n\n
      \n
    • Transform to m/z based on the settings stored at d_params
    • \n
    • Stores the profile data and instrument settings
    • \n
    • Iteration over a list of MSPeaks classes stored at the _mspeaks attributes
    • \n
    • _mspeaks is populated under the hood by calling process_mass_spec method
    • \n
    • iteration is null if _mspeaks is empty
    • \n
    \n\n
    Parameters
    \n\n
      \n
    • frequency_domain (list(float)):\nall datapoints in frequency domain in Hz
    • \n
    • magnitude : frequency_domain (list(float)):\nall datapoints in for magnitude of each frequency datapoint
    • \n
    • d_params : dict{'str' (float, int or str}):\ncontains the instrument settings and processing settings
    • \n
    • auto_process (bool, optional):\nWhether to automatically process the mass spectrum. Defaults to True.
    • \n
    • keep_profile (bool, optional):\nWhether to keep the profile data. Defaults to True.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • has_frequency (bool):\nWhether the mass spectrum has frequency data.
    • \n
    • _frequency_domain (list(float)):\nFrequency domain in Hz
    • \n
    • label (str):\nstore label (Bruker, Midas Transient, see Labels class ). It across distinct processing points
    • \n
    • _abundance (ndarray):\nThe abundance values of the mass spectrum.
    • \n
    • _mz_exp (ndarray):\nThe m/z values of the mass spectrum.
    • \n
    • _mspeaks (list):\nA list of mass peaks.
    • \n
    • See Also (all the attributes of MassSpecBase class):
    • \n
    \n\n
    Methods
    \n\n
      \n
    • _set_mz_domain().\ncalculates the m_z based on the setting of d_params
    • \n
    • process_mass_spec(). Process the mass spectrum.
    • \n
    \n\n

    see also: MassSpecBase(), MassSpecProfile(), MassSpecCentroid()

    \n", "bases": "MassSpecBase"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecfromFreq.__init__", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecfromFreq.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tfrequency_domain,\tmagnitude,\td_params,\tauto_process=True,\tkeep_profile=True)"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecfromFreq.has_frequency", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecfromFreq.has_frequency", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecfromFreq.magnetron_frequency", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecfromFreq.magnetron_frequency", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecfromFreq.magnetron_frequency_sigma", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecfromFreq.magnetron_frequency_sigma", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecfromFreq.transient_settings", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecfromFreq.transient_settings", "kind": "variable", "doc": "

    Return the transient settings of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecfromFreq.calc_magnetron_freq", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecfromFreq.calc_magnetron_freq", "kind": "function", "doc": "

    Calculates the magnetron frequency of the mass spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • max_magnetron_freq (float, optional):\nThe maximum magnetron frequency. Defaults to 50.
    • \n
    • magnetron_freq_bins (int, optional):\nThe number of bins to use for the histogram. Defaults to 300.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • None
    • \n
    \n\n
    Notes
    \n\n

    Calculates the magnetron frequency by examining all the picked peaks and the distances between them in the frequency domain.\nA histogram of those values below the threshold 'max_magnetron_freq' with the 'magnetron_freq_bins' number of bins is calculated.\nA gaussian model is fit to this histogram - the center value of this (statistically probably) the magnetron frequency.\nThis appears to work well or nOmega datasets, but may not work well for 1x datasets or those with very low magnetron peaks.

    \n", "signature": "(self, max_magnetron_freq=50, magnetron_freq_bins=300):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroid", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecCentroid", "kind": "class", "doc": "

    A mass spectrum class when the entry point is on centroid format

    \n\n
    Notes
    \n\n
      \n
    • Stores the centroid data and instrument settings
    • \n
    • Simulate profile data based on Gaussian or Lorentzian peak shape
    • \n
    • Iteration over a list of MSPeaks classes stored at the _mspeaks attributes
    • \n
    • _mspeaks is populated under the hood by calling process_mass_spec method
    • \n
    • iteration is null if _mspeaks is empty
    • \n
    \n\n
    Parameters
    \n\n
      \n
    • data_dict : dict {string (numpy array float64 )):\ncontains keys [m/z, Abundance, Resolving Power, S/N]
    • \n
    • d_params : dict{'str' (float, int or str}):\ncontains the instrument settings and processing settings
    • \n
    • auto_process (bool, optional):\nWhether to automatically process the mass spectrum. Defaults to True.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • label (str):\nstore label (Bruker, Midas Transient, see Labels class)
    • \n
    • _baseline_noise (float):\nstore baseline noise
    • \n
    • _baseline_noise_std (float):\nstore baseline noise std
    • \n
    • _abundance (ndarray):\nThe abundance values of the mass spectrum.
    • \n
    • _mz_exp (ndarray):\nThe m/z values of the mass spectrum.
    • \n
    • _mspeaks (list):\nA list of mass peaks.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • process_mass_spec().\nProcess the mass spectrum. Overriden from MassSpecBase. Populates the _mspeaks list with MSpeaks class using the centroid data.
    • \n
    • __simulate_profile__data__().\nSimulate profile data based on Gaussian or Lorentzian peak shape. Needs theoretical resolving power calculation and define peak shape, intended for plotting and inspection purposes only.
    • \n
    \n\n

    see also: MassSpecBase(), MassSpecfromFreq(), MassSpecProfile()

    \n", "bases": "MassSpecBase"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroid.__init__", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecCentroid.__init__", "kind": "function", "doc": "

    \n", "signature": "(data_dict, d_params, auto_process=True)"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroid.is_centroid", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecCentroid.is_centroid", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroid.data_dict", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecCentroid.data_dict", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroid.mz_exp_profile", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecCentroid.mz_exp_profile", "kind": "variable", "doc": "

    Return the m/z profile of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroid.abundance_profile", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecCentroid.abundance_profile", "kind": "variable", "doc": "

    Return the abundance profile of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroid.tic", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecCentroid.tic", "kind": "variable", "doc": "

    Return the total ion current of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroid.process_mass_spec", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecCentroid.process_mass_spec", "kind": "function", "doc": "

    Process the mass spectrum.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroidLowRes", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecCentroidLowRes", "kind": "class", "doc": "

    A mass spectrum class when the entry point is on low resolution centroid format

    \n\n
    Notes
    \n\n

    Does not store MSPeak Objs, will iterate over mz, abundance pairs instead

    \n\n
    Parameters
    \n\n
      \n
    • data_dict : dict {string (numpy array float64 )):\ncontains keys [m/z, Abundance, Resolving Power, S/N]
    • \n
    • d_params : dict{'str' (float, int or str}):\ncontains the instrument settings and processing settings
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • _processed_tic (float):\nstore processed total ion current
    • \n
    • _abundance (ndarray):\nThe abundance values of the mass spectrum.
    • \n
    • _mz_exp (ndarray):\nThe m/z values of the mass spectrum.
    • \n
    \n", "bases": "MassSpecCentroid"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroidLowRes.__init__", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecCentroidLowRes.__init__", "kind": "function", "doc": "

    \n", "signature": "(data_dict, d_params)"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroidLowRes.mz_exp", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecCentroidLowRes.mz_exp", "kind": "variable", "doc": "

    Return the m/z values of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroidLowRes.abundance", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecCentroidLowRes.abundance", "kind": "variable", "doc": "

    Return the abundance values of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroidLowRes.processed_tic", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecCentroidLowRes.processed_tic", "kind": "variable", "doc": "

    Return the processed total ion current of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroidLowRes.tic", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecCentroidLowRes.tic", "kind": "variable", "doc": "

    Return the total ion current of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroidLowRes.mz_abun_tuples", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecCentroidLowRes.mz_abun_tuples", "kind": "variable", "doc": "

    Return the m/z and abundance values of the mass spectrum as a list of tuples.

    \n"}, {"fullname": "corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroidLowRes.mz_abun_dict", "modulename": "corems.mass_spectrum.factory.MassSpectrumClasses", "qualname": "MassSpecCentroidLowRes.mz_abun_dict", "kind": "variable", "doc": "

    Return the m/z and abundance values of the mass spectrum as a dictionary.

    \n"}, {"fullname": "corems.mass_spectrum.input", "modulename": "corems.mass_spectrum.input", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.baseClass", "modulename": "corems.mass_spectrum.input.baseClass", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass", "kind": "class", "doc": "

    The MassListBaseClass object reads mass list data types and returns the mass spectrum obj

    \n\n
    Parameters
    \n\n
      \n
    • file_location (Path or S3Path):\nFull data path.
    • \n
    • isCentroid (bool, optional):\nDetermines the mass spectrum data structure. If set to True, it assumes centroid mode. If set to False, it assumes profile mode and attempts to peak pick. Default is True.
    • \n
    • analyzer (str, optional):\nThe analyzer used for the mass spectrum. Default is 'Unknown'.
    • \n
    • instrument_label (str, optional):\nThe label of the instrument used for the mass spectrum. Default is 'Unknown'.
    • \n
    • sample_name (str, optional):\nThe name of the sample. Default is None.
    • \n
    • header_lines (int, optional):\nThe number of lines to skip in the file, including the column labels line. Default is 0.
    • \n
    • isThermoProfile (bool, optional):\nDetermines the number of expected columns in the file. If set to True, only m/z and intensity columns are expected. Signal-to-noise ratio (S/N) and resolving power (RP) will be calculated based on the data. Default is False.
    • \n
    • headerless (bool, optional):\nIf True, assumes that there are no headers present in the file (e.g., a .xy file from Bruker) and assumes two columns: m/z and intensity. Default is False.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • parameters (DataInputSetting):\nThe data input settings for the mass spectrum.
    • \n
    • data_type (str):\nThe type of data in the file.
    • \n
    • delimiter (str):\nThe delimiter used to read text-based files.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • set_parameter_from_toml(parameters_path). Sets the data input settings from a TOML file.
    • \n
    • set_parameter_from_json(parameters_path). Sets the data input settings from a JSON file.
    • \n
    • get_dataframe(). Reads the file and returns the data as a pandas DataFrame.
    • \n
    • load_settings(mass_spec_obj, output_parameters). Loads the settings for the mass spectrum.
    • \n
    • get_output_parameters(polarity, scan_index=0). Returns the output parameters for the mass spectrum.
    • \n
    • clean_data_frame(dataframe). Cleans the data frame by removing columns that are not in the expected columns set.
    • \n
    \n"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.__init__", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tfile_location: pathlib.Path | s3path.S3Path,\tisCentroid: bool = True,\tanalyzer: str = 'Unknown',\tinstrument_label: str = 'Unknown',\tsample_name: str = None,\theader_lines: int = 0,\tisThermoProfile: bool = False,\theaderless: bool = False)"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.file_location", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.file_location", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.header_lines", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.header_lines", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.isCentroid", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.isCentroid", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.isThermoProfile", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.isThermoProfile", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.headerless", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.headerless", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.analyzer", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.analyzer", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.instrument_label", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.instrument_label", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.sample_name", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.sample_name", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.parameters", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.parameters", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.set_parameter_from_toml", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.set_parameter_from_toml", "kind": "function", "doc": "

    \n", "signature": "(self, parameters_path):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.set_parameter_from_json", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.set_parameter_from_json", "kind": "function", "doc": "

    \n", "signature": "(self, parameters_path):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.data_type", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.data_type", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.delimiter", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.delimiter", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.encoding_detector", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.encoding_detector", "kind": "function", "doc": "

    Detects the encoding of a file.

    \n\n
    Parameters
    \n\n
      \n
    • file_location (str):\nThe location of the file to be analyzed.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • str: The detected encoding of the file.
    • \n
    \n", "signature": "(self, file_location) -> str:", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.set_data_type", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.set_data_type", "kind": "function", "doc": "

    Set the data type and delimiter based on the file extension.

    \n\n
    Raises
    \n\n
      \n
    • TypeError: If the data type could not be automatically recognized.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.get_dataframe", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.get_dataframe", "kind": "function", "doc": "

    Get the data as a pandas DataFrame.

    \n\n
    Returns
    \n\n
      \n
    • pandas.DataFrame: The data as a pandas DataFrame.
    • \n
    \n\n
    Raises
    \n\n
      \n
    • TypeError: If the data type is not supported.
    • \n
    \n", "signature": "(self) -> pandas.core.frame.DataFrame:", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.load_settings", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.load_settings", "kind": "function", "doc": "

    TODO loading output parameters from json file is not functional

    \n\n

    Load settings from a JSON file and apply them to the given mass_spec_obj.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spec_obj (MassSpec):\nThe mass spectrum object to apply the settings to.
    • \n
    \n", "signature": "(self, mass_spec_obj, output_parameters):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.get_output_parameters", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.get_output_parameters", "kind": "function", "doc": "

    Get the output parameters for the mass spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • polarity (int):\nThe polarity of the mass spectrum +1 or -1.
    • \n
    • scan_index (int, optional):\nThe index of the scan. Default is 0.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: A dictionary containing the output parameters.
    • \n
    \n", "signature": "(self, polarity: int, scan_index: int = 0) -> dict:", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.clean_data_frame", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.clean_data_frame", "kind": "function", "doc": "

    Clean the input dataframe by removing columns that are not expected.

    \n\n
    Parameters
    \n\n
      \n
    • pandas.DataFrame: The input dataframe to be cleaned.
    • \n
    \n", "signature": "(self, dataframe):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.check_columns", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.check_columns", "kind": "function", "doc": "

    Check if the given header labels match the expected columns.

    \n\n
    Parameters
    \n\n
      \n
    • header_labels (list):\nThe header labels to be checked.
    • \n
    \n\n
    Raises
    \n\n
      \n
    • Exception: If any expected column is not found in the header labels.
    • \n
    \n", "signature": "(self, header_labels: list[str]):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.read_xml_peaks", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.read_xml_peaks", "kind": "function", "doc": "

    Read peaks from a Bruker .xml file and return a pandas DataFrame.

    \n\n
    Parameters
    \n\n
      \n
    • data (str):\nThe path to the .xml file.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • pandas.DataFrame: A DataFrame containing the peak data with columns: 'm/z', 'I', 'Resolving Power', 'Area', 'S/N', 'fwhm'.
    • \n
    \n", "signature": "(self, data: str) -> pandas.core.frame.DataFrame:", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.baseClass.MassListBaseClass.get_xml_polarity", "modulename": "corems.mass_spectrum.input.baseClass", "qualname": "MassListBaseClass.get_xml_polarity", "kind": "function", "doc": "

    Get the polarity from an XML peaklist.

    \n\n
    Returns
    \n\n
      \n
    • int: The polarity of the XML peaklist. Returns -1 for negative polarity, +1 for positive polarity.
    • \n
    \n\n
    Raises
    \n\n
      \n
    • Exception: If the data type is not XML peaklist in Bruker format or if the polarity is unhandled.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.boosterHDF5", "modulename": "corems.mass_spectrum.input.boosterHDF5", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.boosterHDF5.ReadHDF_BoosterMassSpectrum", "modulename": "corems.mass_spectrum.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectrum", "kind": "class", "doc": "

    The ReadHDF_BoosterMassSpectrum class parses the mass spectrum data from an HDF file and generate a mass spectrum object.

    \n\n
    Parameters
    \n\n
      \n
    • file_location (str):\nThe path to the HDF file.
    • \n
    • isCentroid (bool, optional):\nSpecifies whether the mass spectrum is centroided or not. Default is False.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • polarity (int):\nThe polarity of the mass spectrum.
    • \n
    • h5pydata (h5py.File):\nThe HDF file object.
    • \n
    • scans (list):\nThe list of scan names in the HDF file.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • get_data_profile(mz, abundance, auto_process). Returns a MassSpecProfile object from the given m/z and abundance arrays.
    • \n
    • get_attr_data(scan, attr_srt). Returns the attribute value for the given scan and attribute name.
    • \n
    • get_polarity(file_location). Returns the polarity of the mass spectrum.
    • \n
    • get_mass_spectrum(auto_process). Returns the mass spectrum as a MassSpecProfile object.
    • \n
    • get_output_parameters(). Returns the default output parameters for the mass spectrum.
    • \n
    \n", "bases": "corems.mass_spectrum.input.baseClass.MassListBaseClass"}, {"fullname": "corems.mass_spectrum.input.boosterHDF5.ReadHDF_BoosterMassSpectrum.__init__", "modulename": "corems.mass_spectrum.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectrum.__init__", "kind": "function", "doc": "

    \n", "signature": "(file_location, isCentroid=False)"}, {"fullname": "corems.mass_spectrum.input.boosterHDF5.ReadHDF_BoosterMassSpectrum.polarity", "modulename": "corems.mass_spectrum.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectrum.polarity", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.boosterHDF5.ReadHDF_BoosterMassSpectrum.get_data_profile", "modulename": "corems.mass_spectrum.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectrum.get_data_profile", "kind": "function", "doc": "

    Returns a MassSpecProfile object from the given m/z and abundance arrays.

    \n\n
    Parameters
    \n\n
      \n
    • mz (array_like):\nThe m/z values.
    • \n
    • abundance (array_like):\nThe abundance values.
    • \n
    • auto_process (bool):\nSpecifies whether to automatically process the mass spectrum.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • MassSpecProfile: The MassSpecProfile object.
    • \n
    \n", "signature": "(\tself,\tmz,\tabundance,\tauto_process) -> corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecProfile:", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.boosterHDF5.ReadHDF_BoosterMassSpectrum.get_attr_data", "modulename": "corems.mass_spectrum.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectrum.get_attr_data", "kind": "function", "doc": "

    Returns the attribute value for the given scan and attribute name.

    \n\n
    Parameters
    \n\n
      \n
    • scan (int):\nThe scan index.
    • \n
    • attr_srt (str):\nThe attribute name.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • object: The attribute value.
    • \n
    \n", "signature": "(self, scan, attr_srt):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.boosterHDF5.ReadHDF_BoosterMassSpectrum.get_polarity", "modulename": "corems.mass_spectrum.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectrum.get_polarity", "kind": "function", "doc": "

    Returns the polarity of the mass spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • file_location (str):\nThe path to the HDF file.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • int: The polarity of the mass spectrum.
    • \n
    \n", "signature": "(self, file_location: str | s3path.S3Path) -> int:", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.boosterHDF5.ReadHDF_BoosterMassSpectrum.get_mass_spectrum", "modulename": "corems.mass_spectrum.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectrum.get_mass_spectrum", "kind": "function", "doc": "

    Returns the mass spectrum as a MassSpecProfile object.

    \n\n
    Parameters
    \n\n
      \n
    • auto_process (bool, optional):\nSpecifies whether to automatically process the mass spectrum. Default is True.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • MassSpecProfile: The MassSpecProfile object.
    • \n
    \n", "signature": "(\tself,\tauto_process=True) -> corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecProfile:", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.boosterHDF5.ReadHDF_BoosterMassSpectrum.get_output_parameters", "modulename": "corems.mass_spectrum.input.boosterHDF5", "qualname": "ReadHDF_BoosterMassSpectrum.get_output_parameters", "kind": "function", "doc": "

    Returns the default output parameters for the mass spectrum.

    \n\n
    Returns
    \n\n
      \n
    • dict: The default output parameters.
    • \n
    \n", "signature": "(self) -> dict:", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.coremsHDF5", "modulename": "corems.mass_spectrum.input.coremsHDF5", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.coremsHDF5.ReadCoreMSHDF_MassSpectrum", "modulename": "corems.mass_spectrum.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectrum", "kind": "class", "doc": "

    Class for reading mass spectrum data from a CoreMS HDF5 file.

    \n\n
    Attributes
    \n\n
      \n
    • h5pydata (h5py.File):\nThe HDF5 file object.
    • \n
    • scans (list):\nList of scan labels in the HDF5 file.
    • \n
    \n\n
    Parameters
    \n\n
      \n
    • file_location (str or S3Path):\nThe path to the CoreMS HDF5 file.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • load_raw_data(mass_spectrum, scan_index=0) Load raw data into the mass spectrum object.
    • \n
    • get_mass_spectrum(scan_number=0, time_index=-1, auto_process=True, load_settings=True, load_raw=True).Get a mass spectrum object.
    • \n
    • load_settings(mass_spectrum, scan_index=0, time_index=-1). Load settings into the mass spectrum object.
    • \n
    • get_dataframe(scan_index=0, time_index=-1). Get a pandas DataFrame representing the mass spectrum.
    • \n
    • get_time_index_to_pull(scan_label, time_index). Get the time index to pull from the HDF5 file.
    • \n
    • get_high_level_attr_data(attr_str). Get high-level attribute data from the HDF5 file.
    • \n
    • get_scan_group_attr_data(scan_index, time_index, attr_group, attr_srt=None). Get scan group attribute data from the HDF5 file.
    • \n
    • get_raw_data_attr_data(scan_index, attr_group, attr_str). Get raw data attribute data from the HDF5 file.
    • \n
    • get_output_parameters(polarity, scan_index=0). Get the output parameters for the mass spectrum.
    • \n
    \n", "bases": "corems.mass_spectrum.input.massList.ReadCoremsMasslist"}, {"fullname": "corems.mass_spectrum.input.coremsHDF5.ReadCoreMSHDF_MassSpectrum.__init__", "modulename": "corems.mass_spectrum.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectrum.__init__", "kind": "function", "doc": "

    \n", "signature": "(file_location)"}, {"fullname": "corems.mass_spectrum.input.coremsHDF5.ReadCoreMSHDF_MassSpectrum.h5pydata", "modulename": "corems.mass_spectrum.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectrum.h5pydata", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.coremsHDF5.ReadCoreMSHDF_MassSpectrum.scans", "modulename": "corems.mass_spectrum.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectrum.scans", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.coremsHDF5.ReadCoreMSHDF_MassSpectrum.load_raw_data", "modulename": "corems.mass_spectrum.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectrum.load_raw_data", "kind": "function", "doc": "

    Load raw data into the mass spectrum object.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (MassSpecCentroid):\nThe mass spectrum object to load the raw data into.
    • \n
    • scan_index (int, optional):\nThe index of the scan to load the raw data from. Default is 0.
    • \n
    \n", "signature": "(self, mass_spectrum, scan_index=0):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.coremsHDF5.ReadCoreMSHDF_MassSpectrum.get_mass_spectrum", "modulename": "corems.mass_spectrum.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectrum.get_mass_spectrum", "kind": "function", "doc": "

    Get a mass spectrum object.

    \n\n
    Parameters
    \n\n
      \n
    • scan_number (int, optional):\nThe index of the scan to retrieve the mass spectrum from. Default is 0.
    • \n
    • time_index (int, optional):\nThe index of the time point to retrieve the mass spectrum from. Default is -1.
    • \n
    • auto_process (bool, optional):\nWhether to automatically process the mass spectrum. Default is True.
    • \n
    • load_settings (bool, optional):\nWhether to load the settings into the mass spectrum object. Default is True.
    • \n
    • load_raw (bool, optional):\nWhether to load the raw data into the mass spectrum object. Default is True.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • MassSpecCentroid: The mass spectrum object.
    • \n
    \n", "signature": "(\tself,\tscan_number=0,\ttime_index=-1,\tauto_process=True,\tload_settings=True,\tload_raw=True):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.coremsHDF5.ReadCoreMSHDF_MassSpectrum.load_settings", "modulename": "corems.mass_spectrum.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectrum.load_settings", "kind": "function", "doc": "

    Load settings into the mass spectrum object.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (MassSpecCentroid):\nThe mass spectrum object to load the settings into.
    • \n
    • scan_index (int, optional):\nThe index of the scan to load the settings from. Default is 0.
    • \n
    • time_index (int, optional):\nThe index of the time point to load the settings from. Default is -1.
    • \n
    \n", "signature": "(self, mass_spectrum, scan_index=0, time_index=-1):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.coremsHDF5.ReadCoreMSHDF_MassSpectrum.get_dataframe", "modulename": "corems.mass_spectrum.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectrum.get_dataframe", "kind": "function", "doc": "

    Get a pandas DataFrame representing the mass spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • scan_index (int, optional):\nThe index of the scan to retrieve the DataFrame from. Default is 0.
    • \n
    • time_index (int, optional):\nThe index of the time point to retrieve the DataFrame from. Default is -1.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • DataFrame: The pandas DataFrame representing the mass spectrum.
    • \n
    \n", "signature": "(self, scan_index=0, time_index=-1):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.coremsHDF5.ReadCoreMSHDF_MassSpectrum.get_time_index_to_pull", "modulename": "corems.mass_spectrum.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectrum.get_time_index_to_pull", "kind": "function", "doc": "

    Get the time index to pull from the HDF5 file.

    \n\n
    Parameters
    \n\n
      \n
    • scan_label (str):\nThe label of the scan.
    • \n
    • time_index (int):\nThe index of the time point.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • str: The time index to pull.
    • \n
    \n", "signature": "(self, scan_label, time_index):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.coremsHDF5.ReadCoreMSHDF_MassSpectrum.get_high_level_attr_data", "modulename": "corems.mass_spectrum.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectrum.get_high_level_attr_data", "kind": "function", "doc": "

    Get high-level attribute data from the HDF5 file.

    \n\n
    Parameters
    \n\n
      \n
    • attr_str (str):\nThe attribute string.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: The attribute data.
    • \n
    \n\n
    Raises
    \n\n
      \n
    • KeyError: If the attribute string is not found in the HDF5 file.
    • \n
    \n", "signature": "(self, attr_str):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.coremsHDF5.ReadCoreMSHDF_MassSpectrum.get_scan_group_attr_data", "modulename": "corems.mass_spectrum.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectrum.get_scan_group_attr_data", "kind": "function", "doc": "

    Get scan group attribute data from the HDF5 file.

    \n\n
    Parameters
    \n\n
      \n
    • scan_index (int):\nThe index of the scan.
    • \n
    • time_index (int):\nThe index of the time point.
    • \n
    • attr_group (str):\nThe attribute group.
    • \n
    • attr_srt (str, optional):\nThe attribute string. Default is None.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: The attribute data.
    • \n
    \n\n
    Notes
    \n\n

    This method retrieves attribute data from the HDF5 file for a specific scan and time point.\nThe attribute data is stored in the specified attribute group.\nIf an attribute string is provided, only the corresponding attribute value is returned.\nIf no attribute string is provided, all attribute data in the group is returned as a dictionary.

    \n", "signature": "(self, scan_index, time_index, attr_group, attr_srt=None):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.coremsHDF5.ReadCoreMSHDF_MassSpectrum.get_raw_data_attr_data", "modulename": "corems.mass_spectrum.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectrum.get_raw_data_attr_data", "kind": "function", "doc": "

    Get raw data attribute data from the HDF5 file.

    \n\n
    Parameters
    \n\n
      \n
    • scan_index (int):\nThe index of the scan.
    • \n
    • attr_group (str):\nThe attribute group.
    • \n
    • attr_str (str):\nThe attribute string.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: The attribute data.
    • \n
    \n\n
    Raises
    \n\n
      \n
    • KeyError: If the attribute string is not found in the attribute group.
    • \n
    \n\n
    Notes
    \n\n

    This method retrieves the attribute data associated with a specific scan, attribute group, and attribute string\nfrom the HDF5 file. It returns the attribute data as a dictionary.

    \n\n

    Example usage:

    \n\n
    \n
    >>> data = get_raw_data_attr_data(0, "group1", "attribute1")\n>>> print(data)\n{'key1': 'value1', 'key2': 'value2'}\n
    \n
    \n", "signature": "(self, scan_index, attr_group, attr_str):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.coremsHDF5.ReadCoreMSHDF_MassSpectrum.get_output_parameters", "modulename": "corems.mass_spectrum.input.coremsHDF5", "qualname": "ReadCoreMSHDF_MassSpectrum.get_output_parameters", "kind": "function", "doc": "

    Get the output parameters for the mass spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • polarity (str):\nThe polarity of the mass spectrum.
    • \n
    • scan_index (int, optional):\nThe index of the scan. Default is 0.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: The output parameters.
    • \n
    \n", "signature": "(self, polarity, scan_index=0):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.massList", "modulename": "corems.mass_spectrum.input.massList", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.massList.ReadCoremsMasslist", "modulename": "corems.mass_spectrum.input.massList", "qualname": "ReadCoremsMasslist", "kind": "class", "doc": "

    The ReadCoremsMasslist object reads processed mass list data types\nand returns the mass spectrum obj with the molecular formula obj

    \n\n

    Only available for centroid mass spectrum type: it will ignore the parameter isCentroid \nPlease see MassListBaseClass for more details

    \n", "bases": "corems.mass_spectrum.input.baseClass.MassListBaseClass"}, {"fullname": "corems.mass_spectrum.input.massList.ReadCoremsMasslist.get_mass_spectrum", "modulename": "corems.mass_spectrum.input.massList", "qualname": "ReadCoremsMasslist.get_mass_spectrum", "kind": "function", "doc": "

    Get the mass spectrum object from the processed mass list data.

    \n\n
    Parameters
    \n\n
      \n
    • loadSettings (bool, optional):\nWhether to load the settings for the mass spectrum. Default is True.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • MassSpecCentroid: The mass spectrum object.
    • \n
    \n\n
    Raises
    \n\n
      \n
    • ValueError: If the input file is not a valid CoreMS file.
    • \n
    \n", "signature": "(\tself,\tloadSettings: bool = True) -> corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecCentroid:", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.massList.ReadCoremsMasslist.add_molecular_formula", "modulename": "corems.mass_spectrum.input.massList", "qualname": "ReadCoremsMasslist.add_molecular_formula", "kind": "function", "doc": "

    Add molecular formula information to the mass spectrum object.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spec_obj (MassSpecCentroid):\nThe mass spectrum object to add the molecular formula to.
    • \n
    • dataframe (pandas.DataFrame):\nThe processed mass list data.
    • \n
    \n", "signature": "(self, mass_spec_obj, dataframe):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.massList.ReadMassList", "modulename": "corems.mass_spectrum.input.massList", "qualname": "ReadMassList", "kind": "class", "doc": "

    The ReadMassList object reads unprocessed mass list data types\nand returns the mass spectrum object.

    \n\n
    Parameters
    \n\n
      \n
    • MassListBaseClass (class):\nThe base class for reading mass list data types.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • get_mass_spectrum(polarity, scan=0, auto_process=True, loadSettings=True). Reads mass list data types and returns the mass spectrum object.
    • \n
    \n", "bases": "corems.mass_spectrum.input.baseClass.MassListBaseClass"}, {"fullname": "corems.mass_spectrum.input.massList.ReadMassList.get_mass_spectrum", "modulename": "corems.mass_spectrum.input.massList", "qualname": "ReadMassList.get_mass_spectrum", "kind": "function", "doc": "

    Reads mass list data types and returns the mass spectrum object.

    \n\n
    Parameters
    \n\n
      \n
    • polarity (int):\nThe polarity of the mass spectrum (+1 or -1).
    • \n
    • scan (int, optional):\nThe scan number of the mass spectrum (default is 0).
    • \n
    • auto_process (bool, optional):\nFlag indicating whether to automatically process the mass spectrum (default is True).
    • \n
    • loadSettings (bool, optional):\nFlag indicating whether to load settings for the mass spectrum (default is True).
    • \n
    \n\n
    Returns
    \n\n
      \n
    • mass_spec (MassSpecCentroid or MassSpecProfile):\nThe mass spectrum object.
    • \n
    \n", "signature": "(\tself,\tpolarity: int,\tscan: int = 0,\tauto_process: bool = True,\tloadSettings: bool = True):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.massList.ReadBrukerXMLList", "modulename": "corems.mass_spectrum.input.massList", "qualname": "ReadBrukerXMLList", "kind": "class", "doc": "

    The ReadBrukerXMLList object reads Bruker XML objects\nand returns the mass spectrum object.\nSee MassListBaseClass for details

    \n\n
    Parameters
    \n\n
      \n
    • MassListBaseClass (class):\nThe base class for reading mass list data types and returning the mass spectrum object.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • get_mass_spectrum(polarity: bool = None, scan: int = 0, auto_process: bool = True, loadSettings: bool = True). Reads mass list data types and returns the mass spectrum object.
    • \n
    \n", "bases": "corems.mass_spectrum.input.baseClass.MassListBaseClass"}, {"fullname": "corems.mass_spectrum.input.massList.ReadBrukerXMLList.get_mass_spectrum", "modulename": "corems.mass_spectrum.input.massList", "qualname": "ReadBrukerXMLList.get_mass_spectrum", "kind": "function", "doc": "

    Reads mass list data types and returns the mass spectrum object.

    \n\n
    Parameters
    \n\n
      \n
    • polarity (bool, optional):\nThe polarity of the mass spectrum. Can be +1 or -1. If not provided, it will be determined from the XML file.
    • \n
    • scan (int, optional):\nThe scan number of the mass spectrum. Default is 0.
    • \n
    • auto_process (bool, optional):\nWhether to automatically process the mass spectrum. Default is True.
    • \n
    • loadSettings (bool, optional):\nWhether to load the settings for the mass spectrum. Default is True.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • mass_spec (MassSpecCentroid):\nThe mass spectrum object representing the centroided mass spectrum.
    • \n
    \n", "signature": "(\tself,\tpolarity: bool = None,\tscan: int = 0,\tauto_process: bool = True,\tloadSettings: bool = True):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.numpyArray", "modulename": "corems.mass_spectrum.input.numpyArray", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.input.numpyArray.ms_from_array_profile", "modulename": "corems.mass_spectrum.input.numpyArray", "qualname": "ms_from_array_profile", "kind": "function", "doc": "

    Create a MassSpecProfile object from an array of m/z values and abundance values.

    \n\n
    Parameters
    \n\n
      \n
    • mz (numpy.ndarray):\nArray of m/z values.
    • \n
    • abundance (numpy.ndarray):\nArray of abundance values.
    • \n
    • dataname (str):\nName of the data.
    • \n
    • polarity (int, optional):\nPolarity of the data. The default is -1.
    • \n
    • auto_process (bool, optional):\nFlag to automatically process the data. The default is True.
    • \n
    • data_type (str, optional):\nType of the data. The default is Labels.simulated_profile.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • MassSpecProfile: The created MassSpecProfile object.
    • \n
    \n", "signature": "(\tmz,\tabundance,\tdataname: str,\tpolarity: int = -1,\tauto_process: bool = True,\tdata_type: str = 'Simulated Profile'):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.numpyArray.ms_from_array_centroid", "modulename": "corems.mass_spectrum.input.numpyArray", "qualname": "ms_from_array_centroid", "kind": "function", "doc": "

    Create a MassSpecCentroid object from an array of m/z values, abundance values, resolution power, and signal-to-noise ratio.

    \n\n
    Parameters
    \n\n
      \n
    • mz (numpy.ndarray):\nArray of m/z values.
    • \n
    • abundance (numpy.ndarray):\nArray of abundance values.
    • \n
    • rp (list(float)):\nList of resolving power values.
    • \n
    • s2n (list(float)):\nList of signal-to-noise ratio values.
    • \n
    • dataname (str):\nName of the data.
    • \n
    • polarity (int, optional):\nPolarity of the data. The default is -1.
    • \n
    • auto_process (bool, optional):
    • \n
    \n\n
    Returns
    \n\n
      \n
    • MassSpecCentroid: The created MassSpecCentroid object.
    • \n
    \n", "signature": "(\tmz,\tabundance,\trp: list[float],\ts2n: list[float],\tdataname: str,\tpolarity: int = -1,\tauto_process: bool = True):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.numpyArray.get_output_parameters", "modulename": "corems.mass_spectrum.input.numpyArray", "qualname": "get_output_parameters", "kind": "function", "doc": "

    Generate the output parameters for creating a MassSpecProfile or MassSpecCentroid object.

    \n\n
    Parameters
    \n\n
      \n
    • polarity (int):\nPolarity of the data.
    • \n
    • file_location (str):\nFile location.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: Output parameters.
    • \n
    \n", "signature": "(polarity: int, file_location: str):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.input.win_only", "modulename": "corems.mass_spectrum.input.win_only", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.output", "modulename": "corems.mass_spectrum.output", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.output.export", "modulename": "corems.mass_spectrum.output.export", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport", "kind": "class", "doc": "

    A class for exporting high-resolution mass spectra.

    \n\n
    Parameters
    \n\n
      \n
    • out_file_path (str):\nThe output file path.
    • \n
    • mass_spectrum (MassSpectrum):\nThe mass spectrum to export.
    • \n
    • output_type (str, optional):\nThe type of output file. Defaults to 'excel'. Can be 'excel', 'csv', 'pandas' or 'hdf5'.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • output_file (Path):\nThe output file path.
    • \n
    • output_type (str):\nThe type of output file.
    • \n
    • mass_spectrum (MassSpectrum):\nThe mass spectrum to export.
    • \n
    • atoms_order_list (list):\nThe list of assigned atoms in the order specified by Atoms.atoms_order list.
    • \n
    • columns_label (list):\nThe column labels in order.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • save().\nSave the mass spectrum data to the output file.
    • \n
    • run().\nRun the export process.
    • \n
    • get_pandas_df().\nReturns the mass spectrum data as a pandas DataFrame.
    • \n
    • write_settings(output_path, mass_spectrum).\nWrites the settings of the mass spectrum to a JSON file.
    • \n
    • to_pandas(write_metadata=True).\nExports the mass spectrum data to a pandas DataFrame and saves it as a pickle file.
    • \n
    • to_excel(write_metadata=True).\nExports the mass spectrum data to an Excel file.
    • \n
    • to_csv(write_metadata=True).\nExports the mass spectrum data to a CSV file.
    • \n
    • to_json().\nExports the mass spectrum data to a JSON string.
    • \n
    • to_hdf().\nExports the mass spectrum data to an HDF5 file.
    • \n
    • parameters_to_toml().\nConverts the mass spectrum parameters to a TOML string.
    • \n
    • parameters_to_json().\nConverts the mass spectrum parameters to a JSON string.
    • \n
    • get_mass_spec_attrs(mass_spectrum).\nReturns the mass spectrum attributes as a dictionary.
    • \n
    • get_all_used_atoms_in_order(mass_spectrum).\nReturns the list of assigned atoms in the order specified by Atoms.atoms_order list.
    • \n
    • list_dict_to_list(mass_spectrum, is_hdf5=False).\nReturns the mass spectrum data as a list of dictionaries.
    • \n
    • get_list_dict_data(mass_spectrum, include_no_match=True, include_isotopologues=True, isotopologue_inline=True, no_match_inline=False, is_hdf5=False).\nReturns the mass spectrum data as a list of dictionaries.
    • \n
    \n", "bases": "threading.Thread"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.__init__", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.__init__", "kind": "function", "doc": "

    This constructor should always be called with keyword arguments. Arguments are:

    \n\n

    group should be None; reserved for future extension when a ThreadGroup\nclass is implemented.

    \n\n

    target is the callable object to be invoked by the run()\nmethod. Defaults to None, meaning nothing is called.

    \n\n

    name is the thread name. By default, a unique name is constructed of\nthe form \"Thread-N\" where N is a small decimal number.

    \n\n

    args is the argument tuple for the target invocation. Defaults to ().

    \n\n

    kwargs is a dictionary of keyword arguments for the target\ninvocation. Defaults to {}.

    \n\n

    If a subclass overrides the constructor, it must make sure to invoke\nthe base class constructor (Thread.__init__()) before doing anything\nelse to the thread.

    \n", "signature": "(out_file_path, mass_spectrum, output_type='excel')"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.output_file", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.output_file", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.output_type", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.output_type", "kind": "variable", "doc": "

    Returns the output type of the mass spectrum.

    \n"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.mass_spectrum", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.mass_spectrum", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.atoms_order_list", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.atoms_order_list", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.save", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.save", "kind": "function", "doc": "

    Save the mass spectrum data to the output file.

    \n\n
    Raises
    \n\n
      \n
    • ValueError: If the output type is not supported.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.run", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.run", "kind": "function", "doc": "

    Run the export process.

    \n\n

    This method is called when the thread starts.\nIt calls the save method to perform the export.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.get_pandas_df", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.get_pandas_df", "kind": "function", "doc": "

    Returns the mass spectrum data as a pandas DataFrame.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.write_settings", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.write_settings", "kind": "function", "doc": "

    Writes the settings of the mass spectrum to a JSON file.

    \n\n
    Parameters
    \n\n
      \n
    • output_path (str):\nThe output file path.
    • \n
    • mass_spectrum (MassSpectrum):\nThe mass spectrum to export.
    • \n
    \n", "signature": "(self, output_path, mass_spectrum):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.to_pandas", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.to_pandas", "kind": "function", "doc": "

    Exports the mass spectrum data to a pandas DataFrame and saves it as a pickle file.

    \n\n
    Parameters
    \n\n
      \n
    • write_metadata (bool, optional):\nWhether to write the metadata to a JSON file. Defaults to True.
    • \n
    \n", "signature": "(self, write_metadata=True):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.to_excel", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.to_excel", "kind": "function", "doc": "

    Exports the mass spectrum data to an Excel file.

    \n\n
    Parameters
    \n\n
      \n
    • write_metadata (bool, optional):\nWhether to write the metadata to a JSON file. Defaults to True.
    • \n
    \n", "signature": "(self, write_metadata=True):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.to_csv", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.to_csv", "kind": "function", "doc": "

    Exports the mass spectrum data to a CSV file.

    \n\n
    Parameters
    \n\n
      \n
    • write_metadata (bool, optional):\nWhether to write the metadata to a JSON file. Defaults to True.
    • \n
    \n", "signature": "(self, write_metadata=True):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.to_json", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.to_json", "kind": "function", "doc": "

    Exports the mass spectrum data to a JSON string.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.to_hdf", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.to_hdf", "kind": "function", "doc": "

    Exports the mass spectrum data to an HDF5 file.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.parameters_to_toml", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.parameters_to_toml", "kind": "function", "doc": "

    Converts the mass spectrum parameters to a TOML string.

    \n\n
    Returns
    \n\n
      \n
    • str: The TOML string of the mass spectrum parameters.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.parameters_to_json", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.parameters_to_json", "kind": "function", "doc": "

    Converts the mass spectrum parameters to a JSON string.

    \n\n
    Returns
    \n\n
      \n
    • str: The JSON string of the mass spectrum parameters.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.get_mass_spec_attrs", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.get_mass_spec_attrs", "kind": "function", "doc": "

    Returns the mass spectrum attributes as a dictionary.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (MassSpectrum):\nThe mass spectrum to export.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: The mass spectrum attributes.
    • \n
    \n", "signature": "(self, mass_spectrum):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.get_all_used_atoms_in_order", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.get_all_used_atoms_in_order", "kind": "function", "doc": "

    Returns the list of assigned atoms in the order specified by Atoms.atoms_order list.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (MassSpectrum):\nThe mass spectrum to export.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: The list of assigned atoms in the order specified by Atoms.atoms_order list.
    • \n
    \n", "signature": "(self, mass_spectrum):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.list_dict_to_list", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.list_dict_to_list", "kind": "function", "doc": "

    Returns the mass spectrum data as a list of dictionaries.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (MassSpectrum):\nThe mass spectrum to export.
    • \n
    • is_hdf5 (bool, optional):\nWhether the mass spectrum is being exported to an HDF5 file. Defaults to False.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: The mass spectrum data as a list of dictionaries.
    • \n
    \n", "signature": "(self, mass_spectrum, is_hdf5=False):", "funcdef": "def"}, {"fullname": "corems.mass_spectrum.output.export.HighResMassSpecExport.get_list_dict_data", "modulename": "corems.mass_spectrum.output.export", "qualname": "HighResMassSpecExport.get_list_dict_data", "kind": "function", "doc": "

    Returns the mass spectrum data as a list of dictionaries.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (MassSpectrum):\nThe mass spectrum to export.
    • \n
    • include_no_match (bool, optional):\nWhether to include unassigned (no match) data. Defaults to True.
    • \n
    • include_isotopologues (bool, optional):\nWhether to include isotopologues. Defaults to True.
    • \n
    • isotopologue_inline (bool, optional):\nWhether to include isotopologues inline. Defaults to True.
    • \n
    • no_match_inline (bool, optional):\nWhether to include unassigned (no match) data inline. Defaults to False.
    • \n
    • is_hdf5 (bool, optional):\nWhether the mass spectrum is being exported to an HDF5 file. Defaults to False.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: The mass spectrum data as a list of dictionaries.
    • \n
    \n", "signature": "(\tself,\tmass_spectrum,\tinclude_no_match=True,\tinclude_isotopologues=True,\tisotopologue_inline=True,\tno_match_inline=False,\tis_hdf5=False):", "funcdef": "def"}, {"fullname": "corems.molecular_formula", "modulename": "corems.molecular_formula", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.calc", "modulename": "corems.molecular_formula.calc", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.calc.MolecularFormulaCalc", "modulename": "corems.molecular_formula.calc.MolecularFormulaCalc", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.calc.MolecularFormulaCalc.MolecularFormulaCalc", "modulename": "corems.molecular_formula.calc.MolecularFormulaCalc", "qualname": "MolecularFormulaCalc", "kind": "class", "doc": "

    Class of calculations related to molecular formula

    \n\n

    This class is not intended to be used directly, but rather to be inherited by other classes in the molecular_formula/factory module like MolecularFormula, MolecularFormulaIsotopologue, and LCMSLibRefMolecularFormula

    \n\n
    Attributes
    \n\n
      \n
    • mz_calc (float):\nThe m/z value of the molecular formula.
    • \n
    • neutral_mass (float):\nThe neutral mass of the molecular formula.
    • \n
    • ion_charge (int):\nThe ion charge of the molecular formula.
    • \n
    • _external_mz (float):\nThe externally provided m/z value of the molecular formula.
    • \n
    • _d_molecular_formula (dict):\nThe dictionary representation of the molecular formula.
    • \n
    • _mspeak_parent (object):\nThe parent MS peak object associated with the molecular formula.
    • \n
    • _assignment_mass_error (float):\nThe mass error of the molecular formula.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • _calc_resolving_power_low_pressure(B, T) \nCalculate the resolving power at low pressure.
    • \n
    • _calc_resolving_power_high_pressure(B, T)\nCalculate the resolving power at high pressure.
    • \n
    • _adduct_mz(adduct_atom, ion_charge)\nGet the m/z value of an adducted ion version of the molecular formula.
    • \n
    • _protonated_mz(ion_charge)\nGet the m/z value of a protonated or deprotonated ion version of the molecular formula.
    • \n
    • _radical_mz(ion_charge)\nGet the m/z value of a radical ion version of the molecular formula.
    • \n
    • _neutral_mass()\nGet the neutral mass of the molecular formula.
    • \n
    • _calc_mz()\nGet the m/z value of the molecular formula.
    • \n
    • _calc_assignment_mass_error(method='ppm')\nCalculate the mass error of the molecular formula.
    • \n
    • _calc_mz_confidence(mean=0)\nCalculate the m/z confidence of the molecular formula.
    • \n
    • _calc_isotopologue_confidence()\nCalculate the isotopologue confidence of the molecular formula.
    • \n
    • normalize_distance(dist, dist_range)\nNormalize the distance value.
    • \n
    • subtract_formula(formula_obj, formated=True)\nSubtract a formula from the current formula object.
    • \n
    • _calc_average_mz_score()\nCalculate the average m/z error score of the molecular formula identification, including the isotopologues.
    • \n
    \n"}, {"fullname": "corems.molecular_formula.calc.MolecularFormulaCalc.MolecularFormulaCalc.normalize_distance", "modulename": "corems.molecular_formula.calc.MolecularFormulaCalc", "qualname": "MolecularFormulaCalc.normalize_distance", "kind": "function", "doc": "

    Normalize the distance value.

    \n\n
    Parameters
    \n\n
      \n
    • dist (float):\nThe distance value to be normalized.
    • \n
    • dist_range (list):\nThe range of the distance value.
    • \n
    \n", "signature": "(self, dist, dist_range):", "funcdef": "def"}, {"fullname": "corems.molecular_formula.calc.MolecularFormulaCalc.MolecularFormulaCalc.subtract_formula", "modulename": "corems.molecular_formula.calc.MolecularFormulaCalc", "qualname": "MolecularFormulaCalc.subtract_formula", "kind": "function", "doc": "

    Subtract a formula from the current formula object

    \n\n
    Parameters
    \n\n
      \n
    • formula_obj (MolecularFormula):\nMolecularFormula object to be subtracted from the current formula object
    • \n
    • formated (bool, optional):\nIf True, returns the formula in string format, by default True
    • \n
    \n", "signature": "(self, formula_obj, formated=True):", "funcdef": "def"}, {"fullname": "corems.molecular_formula.calc.MolecularFormulaCalc.MolecularFormulaCalc.dbe_ai", "modulename": "corems.molecular_formula.calc.MolecularFormulaCalc", "qualname": "MolecularFormulaCalc.dbe_ai", "kind": "variable", "doc": "

    Calculate the double bond equivalent (DBE) of the molecular formula, based on the number of carbons, hydrogens, and oxygens.

    \n"}, {"fullname": "corems.molecular_formula.factory", "modulename": "corems.molecular_formula.factory", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase", "kind": "class", "doc": "

    Base class for representing a molecular formula.

    \n\n
    Parameters
    \n\n
      \n
    • molecular_formula (dict, list, str):\nThe molecular formula.
    • \n
    • ion_charge (int):\nThe ion charge.
    • \n
    • ion_type (str, optional):\nThe ion type. Defaults to None.
    • \n
    • adduct_atom (str, optional):\nThe adduct atom. Defaults to None.
    • \n
    • mspeak_parent (_MSPeak, optional):\nThe parent mass spectrum peak object instance. Defaults to None.
    • \n
    • external_mz (float, optional):\nThe external m/z value. Defaults to None.
    • \n
    \n\n
    Raises
    \n\n
      \n
    • TypeError: If the ion type is not 'DE_OR_PROTONATED', 'RADICAL' or 'ADDUCT'.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • isotopologue_count_percentile (float):\nThe isotopologue count percentile.
    • \n
    • O_C (float):\nThe O/C ratio.
    • \n
    • H_C (float):\nThe H/C ratio.
    • \n
    • dbe (float):\nThe double bond equivalent.
    • \n
    • mz_nominal_calc (int):\nThe nominal m/z value.
    • \n
    • mz_error (float):\nThe m/z error.
    • \n
    • mz_calc (float):\nThe m/z value.
    • \n
    • protonated_mz (float):\nThe protonated or deprotonated m/z value.
    • \n
    • radical_mz (float):\nThe radical m/z value.
    • \n
    • neutral_mass (float):\nThe neutral mass.
    • \n
    • ion_type (str):\nThe ion type.
    • \n
    • ion_charge (int):\nThe ion charge.
    • \n
    • atoms (list):\nThe atoms in the molecular formula.
    • \n
    • confidence_score (float):\nThe confidence score of the molecular formula identification.
    • \n
    • isotopologue_similarity (float):\nThe isotopologue similarity score of the molecular formula identification.
    • \n
    • average_mz_error_score (float):\nThe average m/z error score of the molecular formula identification, including the isotopologues.
    • \n
    • mz_error_score (float):\nThe m/z error score of the molecular formula identification.
    • \n
    • kmd (float):\nThe Kendrick mass defect (KMD).
    • \n
    • kendrick_mass (float):\nThe Kendrick mass.
    • \n
    • knm (float):\nThe nominal Kendrick mass.
    • \n
    • string (str):\nThe molecular formula string.
    • \n
    • string_formated (str):\nThe molecular formula string formated with subscripts and superscripts.
    • \n
    • class_label (str):\nThe class label.
    • \n
    • class_dict (dict):\nThe class dictionary.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • change_kendrick_base(kendrick_dict_base).\nChange the Kendrick base.
    • \n
    • isotopologues(min_abundance, current_mono_abundance, dynamic_range).\nCalculate the isotopologues.
    • \n
    • atoms_qnt(atom).\nGet the atom quantity.
    • \n
    • atoms_symbol(atom).\nGet the atom symbol without the mass number.
    • \n
    • to_dict().\nGet the molecular formula as a dictionary.
    • \n
    • to_list().\nGet the molecular formula as a list.
    • \n
    \n", "bases": "corems.molecular_formula.calc.MolecularFormulaCalc.MolecularFormulaCalc"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.__init__", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tmolecular_formula,\tion_charge,\tion_type=None,\tadduct_atom=None,\tmspeak_parent=None,\texternal_mz=None)"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.is_isotopologue", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.is_isotopologue", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.expected_isotopologues", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.expected_isotopologues", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.mspeak_mf_isotopologues_indexes", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.mspeak_mf_isotopologues_indexes", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.get", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.get", "kind": "function", "doc": "

    Get the atom quantity of a specific atom.

    \n\n
    Parameters
    \n\n
      \n
    • atom (str):\nThe atom symbol.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • int: The atom quantity.
    • \n
    \n", "signature": "(self, atom):", "funcdef": "def"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.split", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.split", "kind": "function", "doc": "

    Splits the molecular formula string.

    \n\n
    Parameters
    \n\n
      \n
    • delimiters (list):\nThe list of delimiters.
    • \n
    • string (str):\nThe molecular formula string.
    • \n
    • maxsplit (int, optional):\nThe maximum number of splits. Defaults to 0.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: The molecular formula list.
    • \n
    \n\n
    Notes
    \n\n

    Does not work when formula has atoms with same characters in a row that below to different atoms, i.e. C10H21NNa.

    \n", "signature": "(self, delimiters, string, maxsplit=0):", "funcdef": "def"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.isotopologue_count_percentile", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.isotopologue_count_percentile", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.O_C", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.O_C", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.H_C", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.H_C", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.dbe", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.dbe", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.mz_nominal_calc", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.mz_nominal_calc", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.mz_error", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.mz_error", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.mz_calc", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.mz_calc", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.protonated_mz", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.protonated_mz", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.radical_mz", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.radical_mz", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.neutral_mass", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.neutral_mass", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.adduct_mz", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.adduct_mz", "kind": "function", "doc": "

    Get m/z of an adducted ion version of the molecular formula.

    \n\n
    Parameters
    \n\n
      \n
    • adduct_atom (str):\nThe adduct atom.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: The m/z value of the adducted ion version of the molecular formula.
    • \n
    \n", "signature": "(self, adduct_atom):", "funcdef": "def"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.ion_type", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.ion_type", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.ion_charge", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.ion_charge", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.atoms", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.atoms", "kind": "variable", "doc": "

    Get the atoms in the molecular formula.

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.confidence_score", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.confidence_score", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.isotopologue_similarity", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.isotopologue_similarity", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.average_mz_error_score", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.average_mz_error_score", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.mz_error_score", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.mz_error_score", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.kmd", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.kmd", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.kendrick_mass", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.kendrick_mass", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.knm", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.knm", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.change_kendrick_base", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.change_kendrick_base", "kind": "function", "doc": "

    Change the Kendrick base.

    \n\n
    Parameters
    \n\n
      \n
    • kendrick_dict_base (dict):\nThe Kendrick base dictionary. Ex: {\"C\": 1, \"H\": 2}
    • \n
    \n", "signature": "(self, kendrick_dict_base):", "funcdef": "def"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.isotopologues", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.isotopologues", "kind": "function", "doc": "

    Calculate the isotopologues for a given molecular formula.

    \n\n
    Parameters
    \n\n
      \n
    • min_abundance (float):\nThe minimum abundance.
    • \n
    • current_mono_abundance (float):\nThe current monoisotopic abundance.
    • \n
    • dynamic_range (float):\nThe dynamic range.
    • \n
    \n\n
    Yields
    \n\n
      \n
    • MolecularFormulaIsotopologue: The molecular formula isotopologue.
    • \n
    \n\n
    Notes
    \n\n

    This calculation ignores the hydrogen isotopes.

    \n", "signature": "(self, min_abundance, current_mono_abundance, dynamic_range):", "funcdef": "def"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.atoms_qnt", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.atoms_qnt", "kind": "function", "doc": "

    Get the atom quantity of a specific atom in the molecular formula.

    \n", "signature": "(self, atom):", "funcdef": "def"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.atoms_symbol", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.atoms_symbol", "kind": "function", "doc": "

    Get the atom symbol without the mass number.

    \n", "signature": "(self, atom):", "funcdef": "def"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.string", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.string", "kind": "variable", "doc": "

    Returns the molecular formula as a string.

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.string_formated", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.string_formated", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.to_dict", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.to_dict", "kind": "function", "doc": "

    Returns the molecular formula as a dictionary.

    \n\n
    Returns
    \n\n
      \n
    • dict: The molecular formula as a dictionary.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.to_list", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.to_list", "kind": "function", "doc": "

    Returns the molecular formula as a list.

    \n\n
    Returns
    \n\n
      \n
    • list: The molecular formula as a list.
    • \n
    \n\n
    Raises
    \n\n
      \n
    • Exception: If the molecular formula identification was not performed yet.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.class_label", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.class_label", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaBase.class_dict", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaBase.class_dict", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaIsotopologue", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaIsotopologue", "kind": "class", "doc": "

    Class for representing a molecular formula isotopologue.

    \n\n
    Parameters
    \n\n
      \n
    • _d_molecular_formula (dict):\nThe molecular formula as a dictionary.
    • \n
    • prob_ratio (float):\nThe probability ratio.
    • \n
    • mono_abundance (float):\nThe monoisotopic abundance.
    • \n
    • ion_charge (int):\nThe ion charge.
    • \n
    • mspeak_parent (object, optional):\nThe parent mass spectrum peak object instance. Defaults to None.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • prob_ratio (float):\nThe probability ratio.
    • \n
    • abundance_calc (float):\nThe calculated abundance.
    • \n
    • area_error (float):\nThe area error.
    • \n
    • abundance_error (float):\nThe abundance error.
    • \n
    • is_isotopologue (bool):\nThe isotopologue flag. Defaults to True.
    • \n
    • mspeak_index_mono_isotopic (int):\nThe index of the monoisotopic peak in the mass spectrum peak list. Defaults to None.
    • \n
    • mono_isotopic_formula_index (int):\nThe index of the monoisotopic formula in the molecular formula list. Defaults to None.
    • \n
    \n", "bases": "MolecularFormulaBase"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaIsotopologue.__init__", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaIsotopologue.__init__", "kind": "function", "doc": "

    \n", "signature": "(\t_d_molecular_formula,\tprob_ratio,\tmono_abundance,\tion_charge,\tmspeak_parent=None)"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaIsotopologue.prob_ratio", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaIsotopologue.prob_ratio", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaIsotopologue.abundance_calc", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaIsotopologue.abundance_calc", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaIsotopologue.is_isotopologue", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaIsotopologue.is_isotopologue", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaIsotopologue.mspeak_index_mono_isotopic", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaIsotopologue.mspeak_index_mono_isotopic", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaIsotopologue.mono_isotopic_formula_index", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaIsotopologue.mono_isotopic_formula_index", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaIsotopologue.area_error", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaIsotopologue.area_error", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormulaIsotopologue.abundance_error", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormulaIsotopologue.abundance_error", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.LCMSLibRefMolecularFormula", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "LCMSLibRefMolecularFormula", "kind": "class", "doc": "

    Class for representing a molecular formula associated with a molecule in a LCMS library reference.

    \n\n
    Parameters
    \n\n
      \n
    • molecular_formula (dict, list, str):\nThe molecular formula.
    • \n
    • ion_charge (int):\nThe ion charge.
    • \n
    • ion_type (str, optional):\nThe ion type. Defaults to None.
    • \n
    • adduct_atom (str, optional):\nThe adduct atom. Defaults to None.
    • \n
    • mspeak_parent (object, optional):\nThe parent mass spectrum peak object instance. Defaults to None.
    • \n
    • name (str, optional):\nThe name of the reference molecule. Defaults to None.
    • \n
    • kegg_id (str, optional):\nThe KEGG ID of the reference molecule. Defaults to None.
    • \n
    • cas (str, optional):\nThe CAS number of the reference molecule. Defaults to None.
    • \n
    \n", "bases": "MolecularFormulaBase"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.LCMSLibRefMolecularFormula.__init__", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "LCMSLibRefMolecularFormula.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tmolecular_formula,\tion_charge,\tion_type=None,\tadduct_atom=None,\tmspeak_parent=None,\tname=None,\tkegg_id=None,\tcas=None)"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.LCMSLibRefMolecularFormula.name", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "LCMSLibRefMolecularFormula.name", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.LCMSLibRefMolecularFormula.kegg_id", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "LCMSLibRefMolecularFormula.kegg_id", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.LCMSLibRefMolecularFormula.cas", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "LCMSLibRefMolecularFormula.cas", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormula", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormula", "kind": "class", "doc": "

    General class for representing a molecular formula.

    \n\n
    Parameters
    \n\n
      \n
    • molecular_formula (dict, list, str):\nThe molecular formula.
    • \n
    • ion_charge (int):\nThe ion charge.
    • \n
    • ion_type (str, optional):\nThe ion type. Defaults to None.
    • \n
    • adduct_atom (str, optional):\nThe adduct atom. Defaults to None.
    • \n
    • mspeak_parent (object, optional):\nThe parent mass spectrum peak object instance. Defaults to None.
    • \n
    • external_mz (float, optional):\nThe external m/z value. Defaults to False.
    • \n
    \n", "bases": "MolecularFormulaBase"}, {"fullname": "corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormula.__init__", "modulename": "corems.molecular_formula.factory.MolecularFormulaFactory", "qualname": "MolecularFormula.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tmolecular_formula,\tion_charge,\tion_type=None,\tadduct_atom=None,\tmspeak_parent=None,\texternal_mz=False)"}, {"fullname": "corems.molecular_formula.input", "modulename": "corems.molecular_formula.input", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.input.masslist_ref", "modulename": "corems.molecular_formula.input.masslist_ref", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.input.masslist_ref.MolecularFormulaLinkProxy", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "MolecularFormulaLinkProxy", "kind": "class", "doc": "

    Proxy class for MolecularFormulaLink to be used in the molecular formula ref file import

    \n\n
    Parameters
    \n\n
      \n
    • molecular_formula (MolecularFormula | LCMSLibRefMolecularFormula):\ncorems MolecularFormula or LCMSLibRefMolecularFormula object
    • \n
    • mz (float):\ntarget m/z
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • C (int):\nnumber of carbon atoms
    • \n
    • H (int):\nnumber of hydrogen atoms
    • \n
    • H_C (float):\nratio of hydrogen to carbon atoms
    • \n
    • class_label (str):\nmolecular formula class label
    • \n
    • mz_calc (float):\ncalculated m/z
    • \n
    • dbe (int):\ndouble bond equivalent
    • \n
    • formula_dict (dict):\nmolecular formula dictionary
    • \n
    \n\n
    Methods
    \n\n
      \n
    • to_dict(). \nreturn molecular formula dictionary
    • \n
    \n"}, {"fullname": "corems.molecular_formula.input.masslist_ref.MolecularFormulaLinkProxy.__init__", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "MolecularFormulaLinkProxy.__init__", "kind": "function", "doc": "

    \n", "signature": "(molecular_formula, mz)"}, {"fullname": "corems.molecular_formula.input.masslist_ref.MolecularFormulaLinkProxy.C", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "MolecularFormulaLinkProxy.C", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.input.masslist_ref.MolecularFormulaLinkProxy.H", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "MolecularFormulaLinkProxy.H", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.input.masslist_ref.MolecularFormulaLinkProxy.H_C", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "MolecularFormulaLinkProxy.H_C", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.input.masslist_ref.MolecularFormulaLinkProxy.class_label", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "MolecularFormulaLinkProxy.class_label", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.input.masslist_ref.MolecularFormulaLinkProxy.mz_calc", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "MolecularFormulaLinkProxy.mz_calc", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.input.masslist_ref.MolecularFormulaLinkProxy.dbe", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "MolecularFormulaLinkProxy.dbe", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.input.masslist_ref.MolecularFormulaLinkProxy.formula_dict", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "MolecularFormulaLinkProxy.formula_dict", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.input.masslist_ref.MolecularFormulaLinkProxy.to_dict", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "MolecularFormulaLinkProxy.to_dict", "kind": "function", "doc": "

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_formula.input.masslist_ref.ImportMassListRef", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "ImportMassListRef", "kind": "class", "doc": "

    Import Mass List from Reference File

    \n\n
    Parameters
    \n\n
      \n
    • ref_file_location (str):\npath to the reference file
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • ref_file_location (str):\npath to the reference file
    • \n
    \n\n
    Methods
    \n\n
      \n
    • molecular_formula_ref(mz, molecular_formula). \nReturn MolecularFormulaLinkProxy object
    • \n
    • from_lcms_lib_file(ion_charge, ion_types).\nReturn Dict[standard_name, Dict[m/z, List[MolecularFormula]]] from LCMS library reference file
    • \n
    • from_bruker_ref_file().\nReturn List[MolecularFormula] from Bruker reference file
    • \n
    • from_corems_ref_file(delimiter).\nReturn List[MolecularFormula] from CoreMS reference file
    • \n
    • split(delimiters, string, maxsplit).\nSplits a string using a list of delimiters.
    • \n
    • mformula_s_to_dict(s_mformulatring, iontype).\nConverts a molecular formula string to a dict
    • \n
    \n"}, {"fullname": "corems.molecular_formula.input.masslist_ref.ImportMassListRef.__init__", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "ImportMassListRef.__init__", "kind": "function", "doc": "

    \n", "signature": "(ref_file_location)"}, {"fullname": "corems.molecular_formula.input.masslist_ref.ImportMassListRef.ref_file_location", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "ImportMassListRef.ref_file_location", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_formula.input.masslist_ref.ImportMassListRef.molecular_formula_ref", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "ImportMassListRef.molecular_formula_ref", "kind": "function", "doc": "

    Instantiate a MolecularFormulaLinkProxy object

    \n\n
    Parameters
    \n\n
      \n
    • mz (float):\ntarget m/z
    • \n
    • molecular_formula (MolecularFormula | LCMSLibRefMolecularFormula):\ncorems MolecularFormula or LCMSLibRefMolecularFormula object
    • \n
    \n\n
    Returns
    \n\n
      \n
    • MolecularFormulaLinkProxy: MolecularFormulaLinkProxy object
    • \n
    \n", "signature": "(self, mz, molecular_formula):", "funcdef": "def"}, {"fullname": "corems.molecular_formula.input.masslist_ref.ImportMassListRef.from_lcms_lib_file", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "ImportMassListRef.from_lcms_lib_file", "kind": "function", "doc": "

    Create a dictionary of LCMSLibRefMolecularFormula objects from LCMS library reference file

    \n\n
    Parameters
    \n\n
      \n
    • ion_charge (float):\nion charge
    • \n
    • ion_types (List[str]):\nlist of ion types
    • \n
    \n\n
    Returns
    \n\n
      \n
    • Dict: Dict[standard_name, Dict[m/z, List[MolecularFormula]]] from LCMS library reference file. m/z is the target m/z; standard_name is the name of the molecular standard mix; MolecularFormula is the corems molecular formula class
    • \n
    \n", "signature": "(\tself,\tion_charge: float,\tion_types: List[str]) -> Dict[str, Dict[float, List[corems.molecular_formula.factory.MolecularFormulaFactory.LCMSLibRefMolecularFormula]]]:", "funcdef": "def"}, {"fullname": "corems.molecular_formula.input.masslist_ref.ImportMassListRef.from_bruker_ref_file", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "ImportMassListRef.from_bruker_ref_file", "kind": "function", "doc": "

    Create a list of MolecularFormula objects from Bruker reference file

    \n\n
    Returns
    \n\n
      \n
    • List[MolecularFormula]: List of MolecularFormula objects from Bruker reference file
    • \n
    \n", "signature": "(\tself) -> List[corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormula]:", "funcdef": "def"}, {"fullname": "corems.molecular_formula.input.masslist_ref.ImportMassListRef.from_corems_ref_file", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "ImportMassListRef.from_corems_ref_file", "kind": "function", "doc": "

    Create a list of MolecularFormula objects from CoreMS reference file

    \n\n

    Not being used

    \n\n
    Parameters
    \n\n
      \n
    • delimiter (str):\ndelimiter used in the reference file
    • \n
    \n\n
    Returns
    \n\n
      \n
    • List[MolecularFormula]: List of MolecularFormula objects from CoreMS reference file
    • \n
    \n", "signature": "(self, delimiter='\\t'):", "funcdef": "def"}, {"fullname": "corems.molecular_formula.input.masslist_ref.ImportMassListRef.split", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "ImportMassListRef.split", "kind": "function", "doc": "

    Splits a string using a list of delimiters.

    \n\n

    Does not work when formula has atoms with same characters, i.e - C10H21NNa

    \n\n
    Parameters
    \n\n
      \n
    • delimiters (list):\nlist of delimiters
    • \n
    • string (str):\nstring to be split
    • \n
    • maxsplit (int, optional):\nmaximum number of splits. Default is 0
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: list of strings obtained after splitting the string
    • \n
    • list: list of counts obtained after splitting the string
    • \n
    \n", "signature": "(self, delimiters, string, maxsplit=0):", "funcdef": "def"}, {"fullname": "corems.molecular_formula.input.masslist_ref.ImportMassListRef.mformula_s_to_dict", "modulename": "corems.molecular_formula.input.masslist_ref", "qualname": "ImportMassListRef.mformula_s_to_dict", "kind": "function", "doc": "

    Converts a molecular formula string to a dict

    \n\n
    Parameters
    \n\n
      \n
    • s_mformulatring (str):\nmolecular formula string, i.e. 'C10H21NNa'
    • \n
    • iontype (str, optional):\nion type. Default is 'unknown'
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: molecular formula dictionary
    • \n
    \n\n
    Notes
    \n\n

    Does not work if the atomic mass number is passed i.e. 37Cl, 81Br, convention follow the light isotope labeling 35Cl is Cl, 12C is C, etc.\nIf you need to use heavy isotopes please use another reference file format that separate the formula string by a blank space and parse it using the function corems_ref_file

    \n\n
    Raises
    \n\n
      \n
    • TypeError: Atom does not exist in Atoms.atoms_order list
    • \n
    • Exception: Empty molecular formula
    • \n
    \n", "signature": "(self, s_mformulatring, iontype='unknown'):", "funcdef": "def"}, {"fullname": "corems.molecular_id", "modulename": "corems.molecular_id", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc", "modulename": "corems.molecular_id.calc", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.ClusterFilter", "modulename": "corems.molecular_id.calc.ClusterFilter", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.ClusterFilter.ClusteringFilter", "modulename": "corems.molecular_id.calc.ClusterFilter", "qualname": "ClusteringFilter", "kind": "class", "doc": "

    Class for filtering and clustering mass spectra data using various algorithms.

    \n\n
    Attributes
    \n\n
      \n
    • mass_spectrum (MassSpectrum):\nMass spectrum object.
    • \n
    • ms_peaks (list):\nList of mass peaks.
    • \n
    • ms_peak_indexes (list):\nList of peak indexes.
    • \n
    • min_samples (int):\nMinimum number of samples in a cluster.
    • \n
    • eps (float):\nThe maximum distance between two samples for one to be considered as in the neighborhood of the other.
    • \n
    • bandwidth (float):\nBandwidth used in MeanShift algorithm.
    • \n
    • quantile (float):\nQuantile used in estimate_bandwidth function.
    • \n
    • n_samples (int):\nNumber of samples used in estimate_bandwidth function.
    • \n
    • bin_seeding (bool):\nIf true, initial kernel locations are not locations of all points, but rather the location of the discretized version of points, where points are binned onto a grid whose coarseness corresponds to the bandwidth. Setting this option to True will speed up the algorithm because fewer seeds will be initialized.
    • \n
    • min_peaks_per_class (int):\nMinimum number of peaks per class.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • get_mass_error_matrix_data(ms_peaks).\nGet the mass error matrix data from a list of mass peaks.
    • \n
    • get_kendrick_matrix_data(mass_spectrum).\nGet the Kendrick matrix data from a mass spectrum.
    • \n
    • filter_kendrick(mass_spectrum).\nFilter the mass spectrum data using the Kendrick algorithm.
    • \n
    • filter_kendrick_by_index(ms_peak_indexes, mass_spectrum_obj).\nFilter the mass spectrum data using the Kendrick algorithm based on a list of peak indexes.
    • \n
    • remove_assignment_by_mass_error(mass_spectrum).\nRemove assignments from the mass spectrum based on mass error.
    • \n
    \n"}, {"fullname": "corems.molecular_id.calc.ClusterFilter.ClusteringFilter.get_mass_error_matrix_data", "modulename": "corems.molecular_id.calc.ClusterFilter", "qualname": "ClusteringFilter.get_mass_error_matrix_data", "kind": "function", "doc": "

    Get the mass error matrix data from a list of mass peaks.

    \n\n
    Parameters
    \n\n
      \n
    • ms_peaks (list):\nList of mass peaks.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • matrix_data (ndarray):\nMatrix data containing mass and error values.
    • \n
    • list_indexes_mass_spec (list):\nList of indexes of mass peaks in the original mass spectrum.
    • \n
    \n", "signature": "(self, ms_peaks):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.ClusterFilter.ClusteringFilter.get_kendrick_matrix_data", "modulename": "corems.molecular_id.calc.ClusterFilter", "qualname": "ClusteringFilter.get_kendrick_matrix_data", "kind": "function", "doc": "

    Get the Kendrick matrix data from a mass spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (MassSpectrum):\nMass spectrum object.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • matrix_data (ndarray):\nMatrix data containing Kendrick mass and Kendrick mass defect values.
    • \n
    \n", "signature": "(self, mass_spectrum):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.ClusterFilter.ClusteringFilter.filter_kendrick", "modulename": "corems.molecular_id.calc.ClusterFilter", "qualname": "ClusteringFilter.filter_kendrick", "kind": "function", "doc": "

    Filter the mass spectrum data using the Kendrick algorithm.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (MassSpectrum):\nMass spectrum object.
    • \n
    \n", "signature": "(self, mass_spectrum):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.ClusterFilter.ClusteringFilter.filter_kendrick_by_index", "modulename": "corems.molecular_id.calc.ClusterFilter", "qualname": "ClusteringFilter.filter_kendrick_by_index", "kind": "function", "doc": "

    Filter the mass spectrum data using the Kendrick algorithm based on a list of peak indexes.

    \n\n
    Parameters
    \n\n
      \n
    • ms_peak_indexes (list):\nList of peak indexes.
    • \n
    • mass_spectrum_obj (MassSpectrum):\nMass spectrum object.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • noise_idx (list):\nList of indexes of noise points in the mass spectrum.
    • \n
    \n", "signature": "(self, ms_peak_indexes, mass_spectrum_obj):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.ClusterFilter.ClusteringFilter.remove_assignment_by_mass_error", "modulename": "corems.molecular_id.calc.ClusterFilter", "qualname": "ClusteringFilter.remove_assignment_by_mass_error", "kind": "function", "doc": "

    Remove assignments from the mass spectrum based on mass error.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (MassSpectrum):\nMass spectrum object.
    • \n
    \n", "signature": "(self, mass_spectrum):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.KendrickGroup", "modulename": "corems.molecular_id.calc.KendrickGroup", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.MolecularFilter", "modulename": "corems.molecular_id.calc.MolecularFilter", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.MolecularFilter.MolecularFormulaSearchFilters", "modulename": "corems.molecular_id.calc.MolecularFilter", "qualname": "MolecularFormulaSearchFilters", "kind": "class", "doc": "

    Class containing static methods for filtering molecular formulas in a mass spectrum.

    \n\n
    Methods
    \n\n
      \n
    • filter_kendrick(ms_peak_indexes, mass_spectrum_obj).
      \nApply Kendrick filter to the mass spectrum.
    • \n
    • check_min_peaks(ms_peak_indexes, mass_spectrum_obj).
      \nCheck if the number of peaks per class meets the minimum requirement.
    • \n
    • filter_isotopologue(ms_peak_indexes, mass_spectrum_obj).
      \nApply isotopologue filter to the mass spectrum.
    • \n
    \n"}, {"fullname": "corems.molecular_id.calc.MolecularFilter.MolecularFormulaSearchFilters.filter_kendrick", "modulename": "corems.molecular_id.calc.MolecularFilter", "qualname": "MolecularFormulaSearchFilters.filter_kendrick", "kind": "function", "doc": "

    Apply Kendrick filter to the mass spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • ms_peak_indexes (list):\nList of peak indexes and their associated molecular formula objects.
    • \n
    • mass_spectrum_obj (MassSpectrum):\nThe mass spectrum object.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • filtered_ms_peak_indexes (list):\nList of peak indexes and their associated molecular formula objects after applying the Kendrick filter.
    • \n
    \n", "signature": "(ms_peak_indexes, mass_spectrum_obj):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.MolecularFilter.MolecularFormulaSearchFilters.check_min_peaks", "modulename": "corems.molecular_id.calc.MolecularFilter", "qualname": "MolecularFormulaSearchFilters.check_min_peaks", "kind": "function", "doc": "

    Check if the number of peaks per class meets the minimum requirement.

    \n\n
    Parameters
    \n\n
      \n
    • ms_peak_indexes (list):\nList of peak indexes and their associated molecular formula objects.
    • \n
    • mass_spectrum_obj (MassSpectrum):\nThe mass spectrum object.
    • \n
    \n", "signature": "(ms_peak_indexes, mass_spectrum):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.MolecularFilter.MolecularFormulaSearchFilters.filter_isotopologue", "modulename": "corems.molecular_id.calc.MolecularFilter", "qualname": "MolecularFormulaSearchFilters.filter_isotopologue", "kind": "function", "doc": "

    Apply isotopologue filter to the mass spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • ms_peak_indexes (list):\nList of peak indexes and their associated molecular formula objects.
    • \n
    • mass_spectrum_obj (MassSpectrum):\nThe mass spectrum object.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • filtered_ms_peak_indexes (list):\nList of peak indexes and their associated molecular formula objects after applying the isotopologue filter.
    • \n
    \n", "signature": "(ms_peak_indexes, mass_spectrum):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.methods_name", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "methods_name", "kind": "variable", "doc": "

    \n", "default_value": "{'chebyshev_distance': 'Chebyshev Distance', 'squared_euclidean_distance': 'Squared Euclidean Distance', 'fidelity_similarity': 'Fidelity Similarity', 'matusita_distance': 'Matusita Distance', 'squared_chord_distance': 'Squared-chord Distance', 'harmonic_mean_similarity': 'Harmonic mean Distance', 'Pearson_chi_squared_distance': 'Pearson Chi Squared Distance', 'Neyman_chi_squared_distance': 'Neyman Chi Squared Distance', 'probabilistic_symmetric_chi_squared_distance': 'Probabilistic symmetric X2 Distance', 'topsoe_distance': 'Topsoe Distance', 'chernoff_distance': 'Chernoff Distance', 'ruzicka_distance': 'Ruzicka Distance', 'roberts_distance': 'Roberts Distance', 'motyka_distance': 'Motyka Distance', 'canberra_distance': 'Canberra Distance', 'canberra_metric': 'Canberra Metric', 'kulczynski_1_distance': 'Kulczynski 1 Distance', 'lorentzian_distance': 'Lorentzian Distance', 'clark_distance': 'Clark Distance', 'hellinger_distance': 'Hellinger Distance', 'whittaker_index_of_association_distance': 'Whittaker index of association Distance', 'spectral_contrast_angle_distance': 'Spectral Contrast Angle', 'wave_hedges_distance': 'Wave Hedges Distance', 'dice_similarity': 'Dice Similarity', 'inner_product_distance': 'Inner Product Distance', 'divergence_distance': 'Divergence Distance', 'jensen_difference_distance': 'Jensen Differences Distance', 'kumar_johnson_distance': 'Kumar Johnson Distance', 'avg_l_distance': 'Avg (L1, L8) Distance', 'vicis_wave_hadges_distance': 'Vicis Wave Hadges Distance', 'vicis_symmetric_chi_squared_1_distance': 'Vicis-Symmetric X2 1 Distance', 'vicis_symmetric_chi_squared_2_distance': 'Vicis-Symmetric X2 2 Distance', 'vicis_symmetric_chi_squared_3_distance': 'Vicis-Symmetric X2 3 Distance', 'max_symmetric_chi_squared_distance': 'Max Symmetric Chi Squared Distance', 'min_symmetric_chi_squared_distance': 'Min Symmetric Chi Squared Distance', 'additive_sym_chi_sq': 'Additive Symmetric Chi Squared', 'bhattacharya_distance': 'Battacharya Distance', 'generalized_ochiai_index': 'Generalized Ochiai Index', 'gower_distance': 'Gower Distance', 'impr_sqrt_cosine_sim': 'Improved Square Root Cosine Similarity', 'intersection_sim': 'Intersection Similarity', 'j_divergence': 'J Divergence', 'jensen_shannon_index': 'Jensen Shannon Index', 'k_divergence': 'K Divergence', 'VW6': 'VW6', 'VW5': 'VW5', 'VW4': 'VW4', 'VW3': 'VW3', 'VW2': 'VW2', 'VW1': 'VW1', 'taneja_divergence': 'Taneja Divergence', 'symmetric_chi_squared_distance': 'Symmetric Chi Squared Distance', 'squared_chi_squared_distance': 'Squared Chi Squared Distance', 'square_root_cosine_correlation': 'Square Root Cosine Correlation', 'sorensen_distance': 'Sorensen Distance', 'Minokowski_3': 'Minokowski 3 Distance', 'Minokowski_4': 'Minokowski 4 Distance', 'kumarjohnson_divergence': 'Kumar Johnson Divergence', 'kumarhassebrook_similarity': 'Kumar Hassebrook Similarity', 'kullbackleibler_divergence': 'Kullback Leibler Divergence', 'soergel_distance': 'Soergel Distance'}"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.methods_scale", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "methods_scale", "kind": "variable", "doc": "

    \n", "default_value": "{'entropy': [0, 1.3862943611198906], 'weighted_entropy': [0, 1.3862943611198906], 'absolute_value': [0, 2], 'avg_l': [0, 1.5], 'bhattacharya_1': [0, 2.4674011002723395], 'bhattacharya_2': [0, inf], 'canberra': [0, inf], 'clark': [0, inf], 'divergence': [0, inf], 'euclidean': [0, 1.4142135623730951], 'hellinger': [0, inf], 'improved_similarity': [0, inf], 'lorentzian': [0, inf], 'manhattan': [0, 2], 'matusita': [0, 1.4142135623730951], 'mean_character': [0, 2], 'motyka': [-0.5, 0], 'ms_for_id': [-inf, 0], 'ms_for_id_v1': [0, inf], 'pearson_correlation': [-1, 1], 'penrose_shape': [0, 1.4142135623730951], 'penrose_size': [0, inf], 'probabilistic_symmetric_chi_squared': [0, 1], 'similarity_index': [0, inf], 'squared_chord': [0, 2], 'squared_euclidean': [0, 2], 'symmetric_chi_squared': [0, 0.7071067811865476], 'topsoe': [0, 1.4142135623730951], 'vicis_symmetric_chi_squared_3': [0, 2], 'wave_hedges': [0, inf], 'whittaker_index_of_association': [0, inf]}"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity", "kind": "class", "doc": "

    Class containing methods for calculating spectral similarity between two mass spectra.

    \n\n
    Parameters
    \n\n
      \n
    • ms_mz_abun_dict (dict):\nDictionary of mass to abundance values for the experimental mass spectrum.
    • \n
    • ref_obj (dict):\nDictionary of mass to abundance values for the reference mass spectrum.
    • \n
    • norm_func (function):\nFunction to normalize the abundance values.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • normalize_func (function):\nFunction to normalize the abundance values.
    • \n
    • ms_mz_abun_dict (dict):\nDictionary of mass to abundance values for the experimental mass spectrum.
    • \n
    • ref_obj (dict):\nDictionary of mass to abundance values for the reference mass spectrum.
    • \n
    • exp_abun (list):\nList of abundance values for the experimental mass spectrum.
    • \n
    • exp_mz (list):\nList of mass values for the experimental mass spectrum.
    • \n
    • ref_mz (list):\nList of mass values for the reference mass spectrum.
    • \n
    • ref_abun (list):\nList of abundance values for the reference mass spectrum.
    • \n
    • ref_mz_abun_dict (dict):\nDictionary of mass to abundance values for the reference mass spectrum.
    • \n
    • df (DataFrame):\nDataFrame containing the experimental and reference mass spectrum data.
    • \n
    • zero_filled_u_l (tuple):\nTuple containing the experimental and reference mass spectrum data after zero filling and normalization.
    • \n
    • common_mz_values (list):\nList of common mass values between the experimental and reference mass spectra.
    • \n
    • n_x_y (int):\nNumber of common mass values between the experimental and reference mass spectra.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • nan_fill(df, fill_with=0).\nFill missing mass values with a given value.
    • \n
    • normalize(x, y, norm_func=sum).\nNormalize the abundance values.
    • \n
    • weighted_cosine_correlation(a=0.5, b=1.3, nanfill=1e-10).\nCalculate the weighted cosine correlation between the experimental and reference mass spectra.
    • \n
    • cosine_correlation().\nCalculate the cosine correlation between the experimental and reference mass spectra.
    • \n
    • stein_scott().\nCalculate the Stein-Scott similarity between the experimental and reference mass spectra.
    • \n
    • pearson_correlation().\nCalculate the Pearson correlation between the experimental and reference mass spectra.
    • \n
    • spearman_correlation().\nCalculate the Spearman correlation between the experimental and reference mass spectra.
    • \n
    \n"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.__init__", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.__init__", "kind": "function", "doc": "

    \n", "signature": "(ms_mz_abun_dict, ref_obj, norm_func=<built-in function sum>)"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.normalize_func", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.normalize_func", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.ms_mz_abun_dict", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.ms_mz_abun_dict", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.ref_obj", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.ref_obj", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.exp_abun", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.exp_abun", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.exp_mz", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.exp_mz", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.ref_mz", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.ref_mz", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.ref_abun", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.ref_abun", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.ref_mz_abun_dict", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.ref_mz_abun_dict", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.df", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.df", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.zero_filled_u_l", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.zero_filled_u_l", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.common_mz_values", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.common_mz_values", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.n_x_y", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.n_x_y", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.nan_fill", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.nan_fill", "kind": "function", "doc": "

    Fill missing mass values with a given value.

    \n\n
    Parameters
    \n\n
      \n
    • df (DataFrame):\nDataFrame containing the experimental and reference mass spectrum data.
    • \n
    • fill_with (float):\nValue to fill missing mass values with.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • x (list):\nList of abundance values for the experimental mass spectrum.
    • \n
    • y (list):\nList of abundance values for the reference mass spectrum.
    • \n
    \n", "signature": "(self, df, fill_with=0):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.normalize", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.normalize", "kind": "function", "doc": "

    Normalize the abundance values.

    \n\n
    Parameters
    \n\n
      \n
    • x (list):\nList of abundance values for the experimental mass spectrum.
    • \n
    • y (list):\nList of abundance values for the reference mass spectrum.
    • \n
    • norm_func (function):\nFunction to normalize the abundance values.\nDefault is sum
    • \n
    \n\n
    Returns
    \n\n
      \n
    • u_l (tuple):\nTuple containing the experimental and reference mass spectrum data after zero filling and normalization.
    • \n
    \n", "signature": "(self, x, y, norm_func=<built-in function sum>):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.weighted_cosine_correlation", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.weighted_cosine_correlation", "kind": "function", "doc": "

    Calculate the weighted cosine correlation between the experimental and reference mass spectra.

    \n\n
    Parameters
    \n\n
      \n
    • a (float):\nWeighting factor for the abundance values.\nDefault is 0.5
    • \n
    • b (float):\nWeighting factor for the mass values.\nDefault is 1.3
    • \n
    • nanfill (float):\nValue to fill missing mass values with.\nDefault is 1e-10
    • \n
    \n\n
    Returns
    \n\n
      \n
    • correlation (float):\nWeighted cosine correlation between the experimental and reference mass spectra.
    • \n
    \n", "signature": "(self, a=0.5, b=1.3, nanfill=1e-10):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.cosine_correlation", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.cosine_correlation", "kind": "function", "doc": "

    Calculate the cosine correlation between the experimental and reference mass spectra.

    \n\n
    Returns
    \n\n
      \n
    • correlation (float):\nCosine correlation between the experimental and reference mass spectra.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.stein_scott", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.stein_scott", "kind": "function", "doc": "

    Calculate the Stein-Scott similarity between the experimental and reference mass spectra.

    \n\n
    Returns
    \n\n
      \n
    • s_ss_x_y (float):\nStein-Scott similarity between the experimental and reference mass spectra.
    • \n
    • s_ss_x_y_nist (float):\nStein-Scott similarity between the experimental and reference mass spectra.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.pearson_correlation", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.pearson_correlation", "kind": "function", "doc": "

    Calculate the Pearson correlation between the experimental and reference mass spectra.

    \n\n
    Returns
    \n\n
      \n
    • correlation (float):\nPearson correlation between the experimental and reference mass spectra.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.spearman_correlation", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.spearman_correlation", "kind": "function", "doc": "

    Calculate the Spearman correlation between the experimental and reference mass spectra.

    \n\n
    Returns
    \n\n
      \n
    • coorelation (float):\nSpearman correlation between the experimental and reference mass spectra.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.kendall_tau", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.kendall_tau", "kind": "function", "doc": "

    Calculate the Kendall's tau correlation between the experimental and reference mass spectra.

    \n\n
    Returns
    \n\n
      \n
    • correlation (float):\nKendall's tau correlation between the experimental and reference mass spectra.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.dft_correlation", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.dft_correlation", "kind": "function", "doc": "

    Calculate the DFT correlation between the experimental and reference mass spectra.

    \n\n
    Returns
    \n\n
      \n
    • correlation (float):\nDFT correlation between the experimental and reference mass spectra.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.dwt_correlation", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.dwt_correlation", "kind": "function", "doc": "

    Calculate the DWT correlation between the experimental and reference mass spectra.

    \n\n
    Returns
    \n\n
      \n
    • correlation (float):\nDWT correlation between the experimental and reference mass spectra.
    • \n
    \n\n
    Notes
    \n\n

    This function requires the PyWavelets library to be installed. \n This is not a default requirement as this function is not widely used.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.euclidean_distance", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.euclidean_distance", "kind": "function", "doc": "

    Calculate the Euclidean distance between the experimental and reference mass spectra.

    \n\n
    Returns
    \n\n
      \n
    • correlation (float):\nEuclidean distance between the experimental and reference mass spectra.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.manhattan_distance", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.manhattan_distance", "kind": "function", "doc": "

    Calculate the Manhattan distance between the experimental and reference mass spectra.

    \n\n
    Returns
    \n\n
      \n
    • correlation (float):\nManhattan distance between the experimental and reference mass spectra.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.jaccard_distance", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.jaccard_distance", "kind": "function", "doc": "

    Calculate the Jaccard distance between the experimental and reference mass spectra.

    \n\n
    Returns
    \n\n
      \n
    • correlation (float):\nJaccard distance between the experimental and reference mass spectra.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.SpectralSimilarity.SpectralSimilarity.extra_distances", "modulename": "corems.molecular_id.calc.SpectralSimilarity", "qualname": "SpectralSimilarity.extra_distances", "kind": "function", "doc": "

    Function to calculate distances using additional metrics defined in math_distance.py

    \n\n

    Currently, calculates all distances.

    \n\n
    Returns
    \n\n
      \n
    • dict_res (dict):\nDictionary containing the distances between the experimental and reference mass spectra.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance", "modulename": "corems.molecular_id.calc.math_distance", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.calc.math_distance.entropy_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "entropy_distance", "kind": "function", "doc": "

    Calculate entropy distance between two vectors

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Entropy distance between v and y
    • \n
    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.weighted_entropy_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "weighted_entropy_distance", "kind": "function", "doc": "

    Calculate weighted entropy distance between two vectors

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Weighted entropy distance between v and y
    • \n
    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.chebyshev_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "chebyshev_distance", "kind": "function", "doc": "

    Chebyshev distance

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Chebyshev distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\underset{i}{\\max}{(|v_{i}\\ -\\ y_{i}|)}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.squared_euclidean_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "squared_euclidean_distance", "kind": "function", "doc": "

    Squared Euclidean distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Squared Euclidean distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sum(v_{i}-y_{i})^2$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.fidelity_similarity", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "fidelity_similarity", "kind": "function", "doc": "

    Fidelity similarity:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Fidelity similarity between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sum\\sqrt{v_{i}y_{i}}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.matusita_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "matusita_distance", "kind": "function", "doc": "

    Matusita distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Matusita distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sqrt{\\sum(\\sqrt{v_{i}}-\\sqrt{y_{i}})^2}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.squared_chord_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "squared_chord_distance", "kind": "function", "doc": "

    Squared-chord distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Squared-chord distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sum(\\sqrt{v_{i}}-\\sqrt{y_{i}})^2$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.bhattacharya_1_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "bhattacharya_1_distance", "kind": "function", "doc": "

    Bhattacharya 1 distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Bhattacharya 1 distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$(\\arccos{(\\sum\\sqrt{v_{i}y_{i}})})^2$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.bhattacharya_2_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "bhattacharya_2_distance", "kind": "function", "doc": "

    Bhattacharya 2 distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Bhattacharya 2 distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$-\\ln{(\\sum\\sqrt{v_{i}y_{i}})}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.harmonic_mean_similarity", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "harmonic_mean_similarity", "kind": "function", "doc": "

    Harmonic mean similarity:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Harmonic mean similarity between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$#1-2\\sum(\\frac{v_{i}y_{i}}{v_{i}+y_{i}})\n2\\sum(\\frac{v_{i}y_{i}}{v_{i}+y_{i}})$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.chernoff_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "chernoff_distance", "kind": "function", "doc": "

    Chernoff distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Chernoff distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\max{(-ln\\sum(v_{i}^ty_{i}^{1-t})^{1-t})},\\ t=0.1,\\ 0\\le\\ t<1$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.ruzicka_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "ruzicka_distance", "kind": "function", "doc": "

    Ruzicka distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Ruzicka distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\frac{\\sum{|v_{i}-y_{i}|}}{\\sum{\\max(v_{i},y_{i})}}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.roberts_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "roberts_distance", "kind": "function", "doc": "

    Roberts distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Roberts distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$1-\\sum\\frac{(v_{i}+y_{i})\\frac{\\min{(v_{i},y_{i})}}{\\max{(v_{i},y_{i})}}}{\\sum(v_{i}+y_{i})}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.intersection_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "intersection_distance", "kind": "function", "doc": "

    Intersection distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Intersection distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$1-\\frac{\\sum\\min{(v_{i},y_{i})}}{\\min(\\sum{v_{i},\\sum{y_{i})}}}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.motyka_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "motyka_distance", "kind": "function", "doc": "

    Motyka distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Motyka distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$-\\frac{\\sum\\min{(y_{i},v_{i})}}{\\sum(y_{i}+v_{i})}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.canberra_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "canberra_distance", "kind": "function", "doc": "

    Canberra distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Canberra distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$#\\sum\\frac{|v_{i}-y_{i}|}{|v_{i}|+|y_{i}|}\n\\sum_{i}\\frac{|y_{i} - v_{i}|}{y_{i} + v_{i}}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.canberra_metric", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "canberra_metric", "kind": "function", "doc": "

    Canberra Metric

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Canberra metric between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\frac{1}{\\sum_{i}I(v_{i}\\neq 0)}\\sum_{i}\\frac{|y_{i}-v_{i}|}{(y_{i}+v_{i})}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.kulczynski_1_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "kulczynski_1_distance", "kind": "function", "doc": "

    Kulczynski 1 distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Kulczynski 1 distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\frac{\\sum{|v_i}-y_i|}{\\sum m\\ i\\ n\\ (v_i,y_i)}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.baroni_urbani_buser_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "baroni_urbani_buser_distance", "kind": "function", "doc": "

    Baroni-Urbani-Buser distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Baroni-Urbani-Buser distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$1-\\frac{\\sum\\min{(v_i,y_i)}+\\sqrt{\\sum\\min{(v_i,y_i)}\\sum(\\max{(v)}-\\max{(v_i,y_i)})}}{\\sum{\\max{(v_i,y_i)}+\\sqrt{\\sum{\\min{(v_i,y_i)}\\sum(\\max{(v)}-\\max{(v_i,y_i)})}}}}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.penrose_size_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "penrose_size_distance", "kind": "function", "doc": "

    Penrose size distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Penrose size distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sqrt N\\sum{|y_i-v_i|}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.mean_character_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "mean_character_distance", "kind": "function", "doc": "

    Mean character distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Mean character distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\frac{1}{N}\\sum{|y_i-v_i|}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.lorentzian_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "lorentzian_distance", "kind": "function", "doc": "

    Lorentzian distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Lorentzian distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sum{\\ln(1+|v_i-y_i|)}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.penrose_shape_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "penrose_shape_distance", "kind": "function", "doc": "

    Penrose shape distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Penrose shape distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sqrt{\\sum((v_i-\\bar{v})-(y_i-\\bar{y}))^2}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.clark_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "clark_distance", "kind": "function", "doc": "

    Clark distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Clark distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$#(\\frac{1}{N}\\sum(\\frac{v_i-y_i}{|v_i|+|y_i|})^2)^\\frac{1}{2}\n\\sqrt{\\sum(\\frac{|v_i-y_i|}{v_i+y_i})^2}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.hellinger_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "hellinger_distance", "kind": "function", "doc": "

    Hellinger distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Hellinger distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$#\\sqrt{2\\sum(\\sqrt{\\frac{v_i}{\\bar{v}}}-\\sqrt{\\frac{y_i}{\\bar{y}}})^2}\n\\sqrt{2\\sum(\\sqrt{v_i}-\\sqrt{y_i})^2}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.whittaker_index_of_association_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "whittaker_index_of_association_distance", "kind": "function", "doc": "

    Whittaker index of association distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Whittaker index of association distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\frac{1}{2}\\sum|\\frac{v_i}{\\bar{v}}-\\frac{y_i}{\\bar{y}}|$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.similarity_index_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "similarity_index_distance", "kind": "function", "doc": "

    Similarity Index Distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Similarity Index Distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sqrt{\\frac{\\sum{\\frac{v_i-y_i}{y_i}}^2}{N}}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.improved_similarity_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "improved_similarity_distance", "kind": "function", "doc": "

    Improved Similarity Index:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Improved Similarity Index between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sqrt{\\frac{1}{N}\\sum{\\frac{y_i-v_i}{y_i+v_i}}^2}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.absolute_value_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "absolute_value_distance", "kind": "function", "doc": "

    Absolute Value Distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Absolute Value Distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\frac { \\sum(|y_i-v_i|)}{\\sum v_i}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.spectral_contrast_angle_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "spectral_contrast_angle_distance", "kind": "function", "doc": "

    Spectral Contrast Angle:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Spectral Contrast Angle between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$1 - \\frac{\\sum{y_iv_i}}{\\sqrt{\\sum y_i^2\\sum v_i^2}}\n\\arccos(\\frac{\\sum_{P}y_{p}^* v_{p}^}{\\sqrt{\\sum_{P}y_{p}^{2} \\sum_{P}v_{p}^{*2}}})$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.wave_hedges_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "wave_hedges_distance", "kind": "function", "doc": "

    Wave Hedges distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Wave Hedges distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sum\\frac{|v_i-y_i|}{\\max{(v_i,y_i)}}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.dice_similarity", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "dice_similarity", "kind": "function", "doc": "

    Dice similarity:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Dice similarity between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\frac{\\sum(v_i-y_i)^2}{\\sum v_i^2+\\sum y_i^2}\n\\frac{2 * \\sum_{i}v_{i}y_{i}}{\\sum_{i}y_{i}^2 + \\sum_{i}v_{i}^2}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.inner_product_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "inner_product_distance", "kind": "function", "doc": "

    Inner Product distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Inner product distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$1-\\sum{v_iy_i}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.divergence_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "divergence_distance", "kind": "function", "doc": "

    Divergence distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Divergence distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$2\\sum\\frac{(v_i-y_i)^2}{(v_i+y_i)^2}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.jensen_difference_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "jensen_difference_distance", "kind": "function", "doc": "

    Jensen difference:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Jensen difference distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sum[\\frac{1}{2}(v_i\\ln{v_i}+y_i\\ln{y_i})-(\\frac{v_i+y_i}{2})\\ln{(\\frac{v_i+y_i}{2})}]$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.kumar_johnson_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "kumar_johnson_distance", "kind": "function", "doc": "

    Kumar-Johnson distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Kumar Johnson distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sum\\frac{(v_i^2-y_i^2)^2}{2(v_iy_i)^\\frac{3}{2}}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.avg_l_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "avg_l_distance", "kind": "function", "doc": "

    Avg (L1, L\u221e) distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Average L distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\frac{1}{2}(\\sum|v_i-y_i|+\\underset{i}{\\max}{|v_i-y_i|})$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.vicis_wave_hadges_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "vicis_wave_hadges_distance", "kind": "function", "doc": "

    Vicis-Wave Hadges distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Vicis Wave Hadges distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sum\\frac{|v_i-y_i|}{\\min{(v_i,\\ y_i)}}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.vicis_symmetric_chi_squared_1_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "vicis_symmetric_chi_squared_1_distance", "kind": "function", "doc": "

    Vicis-Symmetric \u03c72 1 distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Vici Symmetric \u03c72 1 distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sum\\frac{(v_i-y_i)^2}{\\min{(v_i,y_i)^2}}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.vicis_symmetric_chi_squared_2_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "vicis_symmetric_chi_squared_2_distance", "kind": "function", "doc": "

    Vicis-Symmetric \u03c72 2 distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Vicis Symmetric \u03c72 2 distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sum\\frac{(v_i-y_i)^2}{\\min{(v_i,y_i)}}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.vicis_symmetric_chi_squared_3_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "vicis_symmetric_chi_squared_3_distance", "kind": "function", "doc": "

    Vicis-Symmetric \u03c72 3 distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Vici Symmetric \u03c72 3 distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sum\\frac{(v_i-y_i)^2}{\\max{(v_i,y_i)}}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.max_symmetric_chi_squared_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "max_symmetric_chi_squared_distance", "kind": "function", "doc": "

    Max-Symmetric \u03c72 distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Max-Symmetric \u03c72 distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\max{(\\sum\\frac{(v_i-y_i)^2}{v_i},\\sum\\frac{(v_i-y_i)^2}{y_i})}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.min_symmetric_chi_squared_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "min_symmetric_chi_squared_distance", "kind": "function", "doc": "

    Min-Symmetric \u03c72 distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Min-Symmetric \u03c72 distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\min{(\\sum\\frac{(v_i-y_i)^2}{v_i},\\sum\\frac{(v_i-y_i)^2}{y_i})}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.additive_sym_chi_sq", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "additive_sym_chi_sq", "kind": "function", "doc": "

    Additive Symmetric \u03c72 distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Additive Symmetric \u03c72 distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sum_{i}\\frac{(y_{i} - v_{i})^2(y_{i}+v_{i})}{y_{i}v_{i}}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.bhattacharya_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "bhattacharya_distance", "kind": "function", "doc": "

    Bhattacharya Distance:

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Bhattcharya distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$-ln(\\sum_{i}\\sqrt{y_{i}v_{i}})$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.generalized_ochiai_index", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "generalized_ochiai_index", "kind": "function", "doc": "

    Generalized Ochiai Index

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Generalized Ochiai Index between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$1 - \\frac{\\sum_{i}min(y_{i}, v_{i})}{\\sqrt{\\sum_{i}y_{i} \\sum_{i}v_{i}}}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.gower_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "gower_distance", "kind": "function", "doc": "

    Gower Distance

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Gower distance between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\frac{1}{N}\\sum_{i}|y_{i} - v_{i}|$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.impr_sqrt_cosine_sim", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "impr_sqrt_cosine_sim", "kind": "function", "doc": "

    Improved Square Root Cosine Similarity

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Improved Square Root Cosine Similarity between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\frac{\\sum_{i}\\sqrt{y_{i}v_{i}}}{\\sum_{i}\\sqrt{y_{i}}\\sum_{i}\\sqrt{v_{i}}}$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.intersection_sim", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "intersection_sim", "kind": "function", "doc": "

    Intersection Similarity

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Intersection Similarity between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sum_{i}min(y_{i}, v_{i})$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.j_divergence", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "j_divergence", "kind": "function", "doc": "

    J Divergence

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: J Divergence between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sum_{i}(y_{i} - v_{i}) ln(\\frac{y_{i}}{v_{i}})$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.jensen_shannon_index", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "jensen_shannon_index", "kind": "function", "doc": "

    Jensen-Shannon Index

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Jensen Shannon Index between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\frac{1}{2}[\\sum_{i}y_{i}ln(\\frac{2y_{i}}{y_{i} + v_{i}}) + \\sum_{i}v_{i}ln(\\frac{2v_{i}}{y_{i}+v_{i}})]$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.k_divergence", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "k_divergence", "kind": "function", "doc": "

    K-Divergence

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: K-Divergence between v and y
    • \n
    \n\n
    Notes
    \n\n

    $$\\sum_{i}y_{i}ln(\\frac{2y_{i}}{y_{i} + v_{i}})$$

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.topsoe_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "topsoe_distance", "kind": "function", "doc": "

    Topsoe distance

    \n\n
    Parameters
    \n\n
      \n
    • v (array_like):\nVector 1
    • \n
    • y (array_like):\nVector 2
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Topsoe distance between v and y
    • \n
    • Notes
    • \n
    • -----
    • \n
    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.probabilistic_symmetric_chi_squared_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "probabilistic_symmetric_chi_squared_distance", "kind": "function", "doc": "

    Fixed\n\"I commented out the previous one; please review\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.VW6", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "VW6", "kind": "function", "doc": "

    \"appears to be the same as max_symmetric_chi_squared_distance\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.VW5", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "VW5", "kind": "function", "doc": "

    \"appears to be the same as max_symmetric_chi_squared_distance\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.VW4", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "VW4", "kind": "function", "doc": "

    \"Tecnically the Symmetric chi2 eq63\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.VW3", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "VW3", "kind": "function", "doc": "

    \"New\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.VW2", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "VW2", "kind": "function", "doc": "

    \"New\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.VW1", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "VW1", "kind": "function", "doc": "

    \"New\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.taneja_divergence", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "taneja_divergence", "kind": "function", "doc": "

    \"New\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.symmetric_chi_squared_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "symmetric_chi_squared_distance", "kind": "function", "doc": "

    \"New\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.squared_chi_squared_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "squared_chi_squared_distance", "kind": "function", "doc": "

    \"New\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.square_root_cosine_correlation", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "square_root_cosine_correlation", "kind": "function", "doc": "

    \"New\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.sorensen_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "sorensen_distance", "kind": "function", "doc": "

    \"New\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.Pearson_chi_squared_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "Pearson_chi_squared_distance", "kind": "function", "doc": "

    \"New\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.Neyman_chi_squared_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "Neyman_chi_squared_distance", "kind": "function", "doc": "

    \"New\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.Minokowski_3", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "Minokowski_3", "kind": "function", "doc": "

    \"New\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.Minokowski_4", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "Minokowski_4", "kind": "function", "doc": "

    \"New\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.kumarjohnson_divergence", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "kumarjohnson_divergence", "kind": "function", "doc": "

    \"New\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.kumarhassebrook_similarity", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "kumarhassebrook_similarity", "kind": "function", "doc": "

    \"New\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.kullbackleibler_divergence", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "kullbackleibler_divergence", "kind": "function", "doc": "

    \"New\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.calc.math_distance.soergel_distance", "modulename": "corems.molecular_id.calc.math_distance", "qualname": "soergel_distance", "kind": "function", "doc": "

    \"New\"

    \n", "signature": "(v, y):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory", "modulename": "corems.molecular_id.factory", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL", "modulename": "corems.molecular_id.factory.EI_SQL", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Base", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Base", "kind": "class", "doc": "

    The base class of the class hierarchy.

    \n\n

    When called, it accepts no arguments and returns a new featureless\ninstance that has no instance attributes and cannot be given any.

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Base.__init__", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Base.__init__", "kind": "function", "doc": "

    A simple constructor that allows initialization from kwargs.

    \n\n

    Sets attributes on the constructed instance using the names and\nvalues in kwargs.

    \n\n

    Only keys that are present as\nattributes of the instance's class are allowed. These could be,\nfor example, any mapped columns or relationships.

    \n", "signature": "(**kwargs)"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Base.registry", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Base.registry", "kind": "variable", "doc": "

    \n", "default_value": "<sqlalchemy.orm.decl_api.registry object>"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Base.metadata", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Base.metadata", "kind": "variable", "doc": "

    \n", "default_value": "MetaData()"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Metadatar", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Metadatar", "kind": "class", "doc": "

    This class is used to store the metadata of the compounds in the database

    \n\n
    Attributes
    \n\n
      \n
    • id (int):\nThe id of the compound.
    • \n
    • cas (str):\nThe CAS number of the compound.
    • \n
    • inchikey (str):\nThe InChiKey of the compound.
    • \n
    • inchi (str):\nThe InChi of the compound.
    • \n
    • chebi (str):\nThe ChEBI ID of the compound.
    • \n
    • smiles (str):\nThe SMILES of the compound.
    • \n
    • kegg (str):\nThe KEGG ID of the compound.
    • \n
    • iupac_name (str):\nThe IUPAC name of the compound.
    • \n
    • traditional_name (str):\nThe traditional name of the compound.
    • \n
    • common_name (str):\nThe common name of the compound.
    • \n
    • data_id (int):\nThe id of the compound in the molecularData table.
    • \n
    • data (LowResolutionEICompound):\nThe compound object.
    • \n
    \n", "bases": "sqlalchemy.orm.decl_api.Base"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Metadatar.__init__", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Metadatar.__init__", "kind": "function", "doc": "

    A simple constructor that allows initialization from kwargs.

    \n\n

    Sets attributes on the constructed instance using the names and\nvalues in kwargs.

    \n\n

    Only keys that are present as\nattributes of the instance's class are allowed. These could be,\nfor example, any mapped columns or relationships.

    \n", "signature": "(**kwargs)"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Metadatar.id", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Metadatar.id", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Metadatar.cas", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Metadatar.cas", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Metadatar.inchikey", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Metadatar.inchikey", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Metadatar.inchi", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Metadatar.inchi", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Metadatar.chebi", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Metadatar.chebi", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Metadatar.smiles", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Metadatar.smiles", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Metadatar.kegg", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Metadatar.kegg", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Metadatar.iupac_name", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Metadatar.iupac_name", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Metadatar.traditional_name", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Metadatar.traditional_name", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Metadatar.common_name", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Metadatar.common_name", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Metadatar.data_id", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Metadatar.data_id", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.Metadatar.data", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "Metadatar.data", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound", "kind": "class", "doc": "

    This class is used to store the molecular and spectral data of the compounds in the low res EI database

    \n\n
    Attributes
    \n\n
      \n
    • id (int):\nThe id of the compound.
    • \n
    • name (str):\nThe name of the compound.
    • \n
    • classify (str):\nThe classification of the compound.
    • \n
    • formula (str):\nThe formula of the compound.
    • \n
    • ri (float):\nThe retention index of the compound.
    • \n
    • retention_time (float):\nThe retention time of the compound.
    • \n
    • source (str):\nThe source of the compound.
    • \n
    • casno (str):\nThe CAS number of the compound.
    • \n
    • comment (str):\nThe comment of the compound.
    • \n
    • source_temp_c (float):\nThe source temperature of the spectra.
    • \n
    • ev (float):\nThe electron volts of the spectra.
    • \n
    • peaks_count (int):\nThe number of peaks in the spectra.
    • \n
    • mz (numpy.ndarray):\nThe m/z values of the spectra.
    • \n
    • abundance (numpy.ndarray):\nThe abundance values of the spectra.
    • \n
    • metadatar (Metadatar):\nThe metadata object.
    • \n
    \n", "bases": "sqlalchemy.orm.decl_api.Base"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.__init__", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.__init__", "kind": "function", "doc": "

    \n", "signature": "(dict_data)"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.id", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.id", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.name", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.name", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.classify", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.classify", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.formula", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.formula", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.ri", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.ri", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.retention_time", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.retention_time", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.derivativenum", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.derivativenum", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.derivatization", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.derivatization", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.source", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.source", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.casno", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.casno", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.comment", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.comment", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.source_temp_c", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.source_temp_c", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.ev", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.ev", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.peaks_count", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.peaks_count", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.mz", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.mz", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.abundance", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.abundance", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResolutionEICompound.metadatar", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResolutionEICompound.metadatar", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.MetaboliteMetadata", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "MetaboliteMetadata", "kind": "class", "doc": "

    Dataclass for the Metabolite Metadata

    \n\n
    Attributes
    \n\n
      \n
    • id (int):\nThe id of the compound.
    • \n
    • cas (str):\nThe CAS number of the compound.
    • \n
    • inchikey (str):\nThe InChiKey of the compound.
    • \n
    • inchi (str):\nThe InChi of the compound.
    • \n
    • chebi (str):\nThe ChEBI ID of the compound.
    • \n
    • smiles (str):\nThe SMILES of the compound.
    • \n
    • kegg (str):\nThe KEGG ID of the compound.
    • \n
    • iupac_name (str):\nThe IUPAC name of the compound.
    • \n
    • traditional_name (str):\nThe traditional name of the compound.
    • \n
    • common_name (str):\nThe common name of the compound.
    • \n
    • data_id (int):\nThe id of the compound in the molecularData table.
    • \n
    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.MetaboliteMetadata.__init__", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "MetaboliteMetadata.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tid: int,\tcas: str,\tinchikey: str,\tinchi: str,\tchebi: str,\tsmiles: str,\tkegg: str,\tdata_id: int,\tiupac_name: str,\ttraditional_name: str,\tcommon_name: str)"}, {"fullname": "corems.molecular_id.factory.EI_SQL.MetaboliteMetadata.id", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "MetaboliteMetadata.id", "kind": "variable", "doc": "

    \n", "annotation": ": int"}, {"fullname": "corems.molecular_id.factory.EI_SQL.MetaboliteMetadata.cas", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "MetaboliteMetadata.cas", "kind": "variable", "doc": "

    \n", "annotation": ": str"}, {"fullname": "corems.molecular_id.factory.EI_SQL.MetaboliteMetadata.inchikey", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "MetaboliteMetadata.inchikey", "kind": "variable", "doc": "

    \n", "annotation": ": str"}, {"fullname": "corems.molecular_id.factory.EI_SQL.MetaboliteMetadata.inchi", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "MetaboliteMetadata.inchi", "kind": "variable", "doc": "

    \n", "annotation": ": str"}, {"fullname": "corems.molecular_id.factory.EI_SQL.MetaboliteMetadata.chebi", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "MetaboliteMetadata.chebi", "kind": "variable", "doc": "

    \n", "annotation": ": str"}, {"fullname": "corems.molecular_id.factory.EI_SQL.MetaboliteMetadata.smiles", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "MetaboliteMetadata.smiles", "kind": "variable", "doc": "

    \n", "annotation": ": str"}, {"fullname": "corems.molecular_id.factory.EI_SQL.MetaboliteMetadata.kegg", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "MetaboliteMetadata.kegg", "kind": "variable", "doc": "

    \n", "annotation": ": str"}, {"fullname": "corems.molecular_id.factory.EI_SQL.MetaboliteMetadata.data_id", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "MetaboliteMetadata.data_id", "kind": "variable", "doc": "

    \n", "annotation": ": int"}, {"fullname": "corems.molecular_id.factory.EI_SQL.MetaboliteMetadata.iupac_name", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "MetaboliteMetadata.iupac_name", "kind": "variable", "doc": "

    \n", "annotation": ": str"}, {"fullname": "corems.molecular_id.factory.EI_SQL.MetaboliteMetadata.traditional_name", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "MetaboliteMetadata.traditional_name", "kind": "variable", "doc": "

    \n", "annotation": ": str"}, {"fullname": "corems.molecular_id.factory.EI_SQL.MetaboliteMetadata.common_name", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "MetaboliteMetadata.common_name", "kind": "variable", "doc": "

    \n", "annotation": ": str"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef", "kind": "class", "doc": "

    Dataclass for the Low Resolution Compound Reference

    \n\n

    This class is used to store the molecular and spectral data of the compounds in the low res EI database

    \n\n
    Parameters
    \n\n
      \n
    • compounds_dict (dict):\nA dictionary representing the compound.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • id (int):\nThe id of the compound.
    • \n
    • name (str):\nThe name of the compound.
    • \n
    • ri (str):\nThe retention index of the compound.
    • \n
    • retention_time (str):\nThe retention time of the compound.
    • \n
    • casno (str):\nThe CAS number of the compound.
    • \n
    • comment (str):\nThe comment of the compound.
    • \n
    • peaks_count (int):\nThe number of peaks in the spectra.
    • \n
    • classify (str):\nThe classification of the compound.
    • \n
    • derivativenum (str):\nThe derivative number of the compound.
    • \n
    • derivatization (str):\nThe derivatization applied to the compound.
    • \n
    • mz (numpy.ndarray):\nThe m/z values of the spectra.
    • \n
    • abundance (numpy.ndarray):\nThe abundance values of the spectra.
    • \n
    • source_temp_c (float):\nThe source temperature of the spectra.
    • \n
    • ev (float):\nThe electron volts of the spectra.
    • \n
    • formula (str):\nThe formula of the compound.
    • \n
    • source (str):\nThe source of the spectra data.
    • \n
    • classify (str):\nThe classification of the compound.
    • \n
    • metadata (MetaboliteMetadata):\nThe metadata object.
    • \n
    • similarity_score (float):\nThe similarity score of the compound.
    • \n
    • ri_score (float):\nThe RI score of the compound.
    • \n
    • spectral_similarity_score (float):\nThe spectral similarity score of the compound.
    • \n
    • spectral_similarity_scores (dict):\nThe spectral similarity scores of the compound.
    • \n
    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.__init__", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.__init__", "kind": "function", "doc": "

    \n", "signature": "(compounds_dict)"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.id", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.id", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.name", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.name", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.ri", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.ri", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.retention_time", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.retention_time", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.casno", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.casno", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.comment", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.comment", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.peaks_count", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.peaks_count", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.classify", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.classify", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.derivativenum", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.derivativenum", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.derivatization", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.derivatization", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.mz", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.mz", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.abundance", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.abundance", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.source_temp_c", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.source_temp_c", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.ev", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.ev", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.formula", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.formula", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.source", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.source", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.similarity_score", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.similarity_score", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.ri_score", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.ri_score", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.spectral_similarity_score", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.spectral_similarity_score", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.LowResCompoundRef.spectral_similarity_scores", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "LowResCompoundRef.spectral_similarity_scores", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite", "kind": "class", "doc": "

    A class for interacting with a SQLite database for low-resolution EI compounds.

    \n\n
    Parameters
    \n\n
      \n
    • url (str, optional):\nThe URL of the SQLite database. Default is 'sqlite://'.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • engine (sqlalchemy.engine.Engine):\nThe SQLAlchemy engine for connecting to the database.
    • \n
    • session (sqlalchemy.orm.Session):\nThe SQLAlchemy session for executing database operations.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • __init__(self, url='sqlite://').\nInitializes the EI_LowRes_SQLite object.
    • \n
    • __exit__(self, exc_type, exc_val, exc_tb).\nCloses the database connection.
    • \n
    • init_engine(self, url).\nInitializes the SQLAlchemy engine.
    • \n
    • __enter__(self).\nReturns the EI_LowRes_SQLite object.
    • \n
    • add_compound_list(self, data_dict_list).\nAdds a list of compounds to the database.
    • \n
    • add_compound(self, data_dict).\nAdds a single compound to the database.
    • \n
    • commit(self).\nCommits the changes to the database.
    • \n
    • row_to_dict(self, row).\nConverts a database row to a dictionary.
    • \n
    • get_all(self).\nRetrieves all compounds from the database.
    • \n
    • query_min_max_rt(self, min_max_rt).\nQueries compounds based on retention time range.
    • \n
    • query_min_max_ri(self, min_max_ri).\nQueries compounds based on RI range.
    • \n
    • query_names_and_rt(self, min_max_rt, compound_names).\nQueries compounds based on compound names and retention time range.
    • \n
    • query_min_max_ri_and_rt(self, min_max_ri, min_max_rt).\nQueries compounds based on RI range and retention time range.
    • \n
    • delete_compound(self, compound).\nDeletes a compound from the database.
    • \n
    • purge(self).\nDeletes all compounds from the database table.
    • \n
    • clear_data(self).\nClears all tables in the database.
    • \n
    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite.__init__", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite.__init__", "kind": "function", "doc": "

    \n", "signature": "(url='sqlite://')"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite.engine", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite.engine", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite.session", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite.session", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite.init_engine", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite.init_engine", "kind": "function", "doc": "

    Initializes the SQLAlchemy engine.

    \n\n
    Parameters
    \n\n
      \n
    • url (str):\nThe URL of the SQLite database.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • sqlalchemy.engine.Engine: The SQLAlchemy engine for connecting to the database.
    • \n
    \n", "signature": "(self, url):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite.add_compound_list", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite.add_compound_list", "kind": "function", "doc": "

    Adds a list of compounds to the database.

    \n\n
    Parameters
    \n\n
      \n
    • data_dict_list (list of dict):\nA list of dictionaries representing the compounds.
    • \n
    \n", "signature": "(self, data_dict_list):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite.add_compound", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite.add_compound", "kind": "function", "doc": "

    Adds a single compound to the database.

    \n\n
    Parameters
    \n\n
      \n
    • data_dict (dict):\nA dictionary representing the compound.
    • \n
    \n", "signature": "(self, data_dict):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite.commit", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite.commit", "kind": "function", "doc": "

    Commits the changes to the database.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite.row_to_dict", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite.row_to_dict", "kind": "function", "doc": "

    Converts a database row to a dictionary.

    \n\n
    Parameters
    \n\n
      \n
    • row (sqlalchemy.engine.row.Row):\nA row from the database.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: A dictionary representing the compound.
    • \n
    \n", "signature": "(self, row):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite.get_all", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite.get_all", "kind": "function", "doc": "

    Retrieves all compounds from the database.

    \n\n
    Returns
    \n\n
      \n
    • list: A list of dictionaries representing the compounds.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite.query_min_max_rt", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite.query_min_max_rt", "kind": "function", "doc": "

    Queries compounds based on retention time range.

    \n\n
    Parameters
    \n\n
      \n
    • min_max_rt (tuple):\nA tuple containing the minimum and maximum retention time values.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: A list of dictionaries representing the compounds.
    • \n
    \n", "signature": "(self, min_max_rt):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite.query_min_max_ri", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite.query_min_max_ri", "kind": "function", "doc": "

    Queries compounds based on RI range.

    \n\n
    Parameters
    \n\n
      \n
    • min_max_ri (tuple):\nA tuple containing the minimum and maximum RI values.
    • \n
    \n", "signature": "(self, min_max_ri):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite.query_names_and_rt", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite.query_names_and_rt", "kind": "function", "doc": "

    Queries compounds based on compound names and retention time range.

    \n\n
    Parameters
    \n\n
      \n
    • min_max_rt (tuple):\nA tuple containing the minimum and maximum retention time values.
    • \n
    • compound_names (list):\nA list of compound names.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: A list of dictionaries representing the compounds.
    • \n
    \n", "signature": "(self, min_max_rt, compound_names):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite.query_min_max_ri_and_rt", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite.query_min_max_ri_and_rt", "kind": "function", "doc": "

    Queries compounds based on RI range and retention time range.

    \n\n
    Parameters
    \n\n
      \n
    • min_max_ri (tuple):\nA tuple containing the minimum and maximum RI values.
    • \n
    • min_max_rt (tuple):\nA tuple containing the minimum and maximum retention time values.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: A list of dictionaries representing the compounds.
    • \n
    \n", "signature": "(self, min_max_ri, min_max_rt):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite.delete_compound", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite.delete_compound", "kind": "function", "doc": "

    Deletes a compound from the database.

    \n\n
    Parameters
    \n\n
      \n
    • compound (LowResolutionEICompound):\nA compound object.
    • \n
    \n", "signature": "(self, compound):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite.purge", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite.purge", "kind": "function", "doc": "

    Deletes all compounds from the database table.

    \n\n
    Notes
    \n\n

    Careful, this will delete the entire database table.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.EI_SQL.EI_LowRes_SQLite.clear_data", "modulename": "corems.molecular_id.factory.EI_SQL", "qualname": "EI_LowRes_SQLite.clear_data", "kind": "function", "doc": "

    Clears all tables in the database.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.profiled", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "profiled", "kind": "function", "doc": "

    A context manager for profiling.

    \n", "signature": "():", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.insert_database_worker", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "insert_database_worker", "kind": "function", "doc": "

    Inserts data into the database.

    \n", "signature": "(args):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations", "kind": "class", "doc": "

    A class for generating molecular formula combinations.

    \n\n
    Parameters
    \n\n
      \n
    • molecular_search_settings (object):\nAn object containing user-defined settings.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • sql_db (MolForm_SQL):\nThe SQLite database object.
    • \n
    • len_existing_classes (int):\nThe number of existing classes in the SQLite database.
    • \n
    • odd_ch_id (list):\nA list of odd carbon and hydrogen atom IDs.
    • \n
    • odd_ch_dict (list):\nA list of odd carbon and hydrogen atom dictionaries.
    • \n
    • odd_ch_mass (list):\nA list of odd carbon and hydrogen atom masses.
    • \n
    • odd_ch_dbe (list):\nA list of odd carbon and hydrogen atom double bond equivalents.
    • \n
    • even_ch_id (list):\nA list of even carbon and hydrogen atom IDs.
    • \n
    • even_ch_dict (list):\nA list of even carbon and hydrogen atom dictionaries.
    • \n
    • even_ch_mass (list):\nA list of even carbon and hydrogen atom masses.
    • \n
    • even_ch_dbe (list):\nA list of even carbon and hydrogen atom double bond equivalents.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • cProfile_worker(args)
      \nA cProfile worker for the get_mol_formulas function.
    • \n
    • check_database_get_class_list(molecular_search_settings)
      \nChecks if the database has all the classes, if not create the missing classes.
    • \n
    • get_carbonsHydrogens(settings, odd_even)
      \nRetrieves carbon and hydrogen atoms from the molecular lookup table based on user-defined settings.
    • \n
    • add_carbonsHydrogens(settings, existing_classes_objs)
      \nAdds carbon and hydrogen atoms to the molecular lookup table based on user-defined settings.
    • \n
    • runworker(molecular_search_settings)
      \nRuns the molecular formula lookup table worker.
    • \n
    • get_classes_in_order(molecular_search_settings)
      \nGets the classes in order.
    • \n
    • sort_classes(atoms_in_order, combination_dict)
      \nSorts the classes in order.
    • \n
    • get_fixed_initial_number_of_hydrogen(min_h, odd_even)
      \nGets the fixed initial number of hydrogen atoms.
    • \n
    • calc_mz(datadict, class_mass=0)
      \nCalculates the mass-to-charge ratio (m/z) of a molecular formula.
    • \n
    • calc_dbe_class(datadict)
      \nCalculates the double bond equivalent (DBE) of a molecular formula.
    • \n
    • populate_combinations(classe_tuple, settings)
      \nPopulates the combinations.
    • \n
    • get_or_add(SomeClass, kw)
      \nGets or adds a class.
    • \n
    • get_mol_formulas(odd_even_tag, classe_tuple, settings)
      \nGets the molecular formulas.
    • \n
    • get_h_odd_or_even(class_dict)
      \nGets the hydrogen odd or even.
    • \n
    • get_total_halogen_atoms(class_dict)
      \nGets the total number of halogen atoms.
    • \n
    • get_total_hetero_valence(class_dict)\nGets the total valence of heteroatoms other than N, F, Cl, and Br
    • \n
    \n"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.__init__", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.__init__", "kind": "function", "doc": "

    \n", "signature": "(sql_db=None)"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.cProfile_worker", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.cProfile_worker", "kind": "function", "doc": "

    cProfile worker for the get_mol_formulas function

    \n", "signature": "(self, args):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.check_database_get_class_list", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.check_database_get_class_list", "kind": "function", "doc": "

    check if the database has all the classes, if not create the missing classes

    \n\n
    Parameters
    \n\n
      \n
    • molecular_search_settings (object):\nAn object containing user-defined settings.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: list of tuples with the class name and the class dictionary
    • \n
    \n", "signature": "(self, molecular_search_settings):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.get_carbonsHydrogens", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.get_carbonsHydrogens", "kind": "function", "doc": "

    Retrieve carbon and hydrogen atoms from the molecular lookup table based on user-defined settings.

    \n\n
    Parameters
    \n\n
      \n
    • settings (object):\nAn object containing user-defined settings.
    • \n
    • odd_even (str):\nA string indicating whether to retrieve even or odd hydrogen atoms.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: A list of CarbonHydrogen objects that satisfy the specified conditions.
    • \n
    \n", "signature": "(self, settings, odd_even):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.add_carbonsHydrogens", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.add_carbonsHydrogens", "kind": "function", "doc": "

    Add carbon and hydrogen atoms to the molecular lookup table based on user-defined settings.

    \n\n
    Parameters
    \n\n
      \n
    • settings (object):\nAn object containing user-defined settings.
    • \n
    • existing_classes_objs (list):\nA list of HeteroAtoms objects.
    • \n
    \n", "signature": "(self, settings, existing_classes_objs):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.runworker", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.runworker", "kind": "function", "doc": "

    Run the molecular formula lookup table worker.

    \n\n
    Parameters
    \n\n
      \n
    • molecular_search_settings (object):\nAn object containing user-defined settings.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: A list of tuples with the class name and the class dictionary.
    • \n
    \n", "signature": "(*args, **kw):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.get_classes_in_order", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.get_classes_in_order", "kind": "function", "doc": "

    Get the classes in order

    \n\n
    Parameters
    \n\n
      \n
    • molecular_search_settings (object):\nAn object containing user-defined settings.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: A dictionary of classes in order.\nstructure is ('HC', {'HC': 1})
    • \n
    \n", "signature": "(self, molecular_search_settings):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.sort_classes", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.sort_classes", "kind": "function", "doc": "

    Sort the classes in order

    \n\n
    Parameters
    \n\n
      \n
    • atoms_in_order (list):\nA list of atoms in order.
    • \n
    • combination_dict (dict):\nA dictionary of classes.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: A dictionary of classes in order.
    • \n
    \n", "signature": "(atoms_in_order, combination_dict) -> Dict[str, Dict[str, int]]:", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.get_fixed_initial_number_of_hydrogen", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.get_fixed_initial_number_of_hydrogen", "kind": "function", "doc": "

    Get the fixed initial number of hydrogen atoms

    \n\n
    Parameters
    \n\n
      \n
    • min_h (int):\nThe minimum number of hydrogen atoms.
    • \n
    • odd_even (str):\nA string indicating whether to retrieve even or odd hydrogen atoms.
    • \n
    \n", "signature": "(min_h, odd_even):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.calc_mz", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.calc_mz", "kind": "function", "doc": "

    Calculate the mass-to-charge ratio (m/z) of a molecular formula.

    \n\n
    Parameters
    \n\n
      \n
    • datadict (dict):\nA dictionary of classes.
    • \n
    • class_mass (int):\nThe mass of the class.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: The mass-to-charge ratio (m/z) of a molecular formula.
    • \n
    \n", "signature": "(self, datadict, class_mass=0):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.calc_dbe_class", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.calc_dbe_class", "kind": "function", "doc": "

    Calculate the double bond equivalent (DBE) of a molecular formula.

    \n\n
    Parameters
    \n\n
      \n
    • datadict (dict):\nA dictionary of classes.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: The double bond equivalent (DBE) of a molecular formula.
    • \n
    \n", "signature": "(self, datadict):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.populate_combinations", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.populate_combinations", "kind": "function", "doc": "

    Populate the combinations

    \n\n
    Parameters
    \n\n
      \n
    • classe_tuple (tuple):\nA tuple containing the class name, the class dictionary, and the class ID.
    • \n
    • settings (object):\nAn object containing user-defined settings.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: A list of molecular formula data dictionaries.
    • \n
    \n", "signature": "(self, classe_tuple, settings):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.get_or_add", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.get_or_add", "kind": "function", "doc": "

    Get or add a class

    \n\n
    Parameters
    \n\n
      \n
    • SomeClass (object):\nA class object.
    • \n
    • kw (dict):\nA dictionary of classes.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • object: A class object.
    • \n
    \n", "signature": "(self, SomeClass, kw):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.get_mol_formulas", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.get_mol_formulas", "kind": "function", "doc": "

    Get the molecular formulas

    \n\n
    Parameters
    \n\n
      \n
    • odd_even_tag (str):\nA string indicating whether to retrieve even or odd hydrogen atoms.
    • \n
    • classe_tuple (tuple):

    • \n
    • settings (object):\nAn object containing user-defined settings.

    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: A list of molecular formula data dictionaries.
    • \n
    \n", "signature": "(self, odd_even_tag, classe_tuple, settings):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.get_h_odd_or_even", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.get_h_odd_or_even", "kind": "function", "doc": "

    Get the hydrogen odd or even

    \n\n
    Parameters
    \n\n
      \n
    • class_dict (dict):\nA dictionary of classes.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • str: A string indicating whether to retrieve even or odd hydrogen atoms.
    • \n
    \n", "signature": "(self, class_dict):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.get_total_heteroatoms", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.get_total_heteroatoms", "kind": "function", "doc": "

    Get the total number of heteroatoms other than N, F, Cl, Br

    \n\n
    Parameters
    \n\n
      \n
    • class_dict (dict):\nA dictionary of classes.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • int: The total number of heteroatoms.
    • \n
    \n", "signature": "(class_dict):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.get_total_hetero_valence", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.get_total_hetero_valence", "kind": "function", "doc": "

    Get the total valence of heteroatoms other than N, F, Cl, Br

    \n\n
    Parameters
    \n\n
      \n
    • class_dict (dict):\nA dictionary of classes.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • int: The total heteroatom valence.
    • \n
    \n", "signature": "(class_dict):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.MolecularLookupTable.MolecularCombinations.get_total_halogen_atoms", "modulename": "corems.molecular_id.factory.MolecularLookupTable", "qualname": "MolecularCombinations.get_total_halogen_atoms", "kind": "function", "doc": "

    Get the total number of halogen atoms

    \n\n
    Parameters
    \n\n
      \n
    • class_dict (dict):\nA dictionary of classes.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • int: The total number of halogen atoms.
    • \n
    \n", "signature": "(class_dict):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification", "modulename": "corems.molecular_id.factory.classification", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.classification.flatten_list", "modulename": "corems.molecular_id.factory.classification", "qualname": "flatten_list", "kind": "function", "doc": "

    \n", "signature": "(l):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification", "kind": "class", "doc": "

    Class for grouping mass spectrum data by heteroatom classes (Nn, Oo, Ss, NnOo, NnSs, etc..)

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum (MassSpectrum):\nThe mass spectrum object.
    • \n
    • choose_molecular_formula (bool, optional):\nIf True, the molecular formula with the highest abundance is chosen. If False, all molecular formulas are considered. Default is True.
    • \n
    \n\n
    Raises
    \n\n
      \n
    • Exception: If no molecular formula is associated with any mspeak objects.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • _ms_grouped_class (dict):\nA dictionary of classes and a list of ms_peak objects.
    • \n
    • choose_mf (bool):\nIf True, the molecular formula with the highest abundance is chosen. If False, all molecular formulas are considered.
    • \n
    • total_peaks (int):\nThe total number of peaks.
    • \n
    • sum_abundance (float):\nThe sum of the abundance of all peaks.
    • \n
    • min_max_mz (tuple):\nThe minimum and maximum mz values.
    • \n
    • min_max_abundance (tuple):\nThe minimum and maximum abundance values.
    • \n
    • min_ppm_error (float):\nThe minimum ppm error.
    • \n
    • max_ppm_error (float):\nThe maximum ppm error.
    • \n
    • all_identified_atoms (list):\nA list of all identified atoms.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • __len__().\nReturns the number of classes.
    • \n
    • __getitem__(classe)
      \nReturns the molecular formula list for specified class.
    • \n
    • __iter__().\nReturns an iterator over the keys of the dictionary.
    • \n
    • get_classes(threshold_perc=1, isotopologue=True).\nReturns a list of classes with abundance percentile above threshold.
    • \n
    • molecular_formula_string(classe).\nReturns a list of molecular formula string for specified class.
    • \n
    • molecular_formula(classe).\nReturns a list of molecular formula for specified class.
    • \n
    • carbon_number(classe).\nReturns a list of carbon number for specified class.
    • \n
    • atom_count(atom, classe).\nReturns a list of atom count for specified class.
    • \n
    • dbe(classe).\nReturns a list of DBE for specified class.
    • \n
    • atoms_ratio(classe, numerator, denominator).\nReturns a list of atoms ratio for specified class.
    • \n
    • mz_exp(classe).\nReturns a list of experimental mz for specified class.
    • \n
    • abundance(classe).\nReturns a list of abundance for specified class.
    • \n
    • mz_error(classe).\nReturns a list of mz error for specified class.
    • \n
    • mz_calc(classe).\nReturns a list of calculated mz for specified class.
    • \n
    • peaks_count_percentile(classe).\nReturns the peaks count percentile of a specific class.
    • \n
    • abundance_count_percentile(classe).\nReturns the abundance percentile of a specific class.
    • \n
    • mz_exp_assigned().\nReturns a list of experimental mz for all assigned classes.
    • \n
    • abundance_assigned().\nReturns a list of abundance for all classes.
    • \n
    • mz_exp_all().\nReturns a list of mz for all classes.
    • \n
    \n", "bases": "collections.abc.Mapping"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.__init__", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.__init__", "kind": "function", "doc": "

    \n", "signature": "(mass_spectrum, choose_molecular_formula=True)"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.choose_mf", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.choose_mf", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.total_peaks", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.total_peaks", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.sum_abundance", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.sum_abundance", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.min_max_mz", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.min_max_mz", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.min_max_abundance", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.min_max_abundance", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.min_ppm_error", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.min_ppm_error", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.max_ppm_error", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.max_ppm_error", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.all_identified_atoms", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.all_identified_atoms", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.get_classes", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.get_classes", "kind": "function", "doc": "

    Return a list of classes with abundance percentile above threshold

    \n", "signature": "(self, threshold_perc=1, isotopologue=True):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.molecular_formula_string", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.molecular_formula_string", "kind": "function", "doc": "

    Return a list of molecular formula string for specified class

    \n", "signature": "(self, classe):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.molecular_formula", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.molecular_formula", "kind": "function", "doc": "

    Return a list of molecular formula for specified class

    \n", "signature": "(self, classe):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.carbon_number", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.carbon_number", "kind": "function", "doc": "

    Return a list of carbon number for specified class

    \n", "signature": "(self, classe):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.atom_count", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.atom_count", "kind": "function", "doc": "

    Return a list of atom count for specified class

    \n", "signature": "(self, atom, classe):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.dbe", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.dbe", "kind": "function", "doc": "

    Return a list of DBE for specified class

    \n", "signature": "(self, classe):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.atoms_ratio", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.atoms_ratio", "kind": "function", "doc": "

    Return a list of atoms ratio for specified class

    \n", "signature": "(self, classe, numerator, denominator):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.mz_exp", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.mz_exp", "kind": "function", "doc": "

    Return a list of experimental mz for specified class

    \n", "signature": "(self, classe):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.abundance", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.abundance", "kind": "function", "doc": "

    Return a list of abundance for specified class

    \n", "signature": "(self, classe):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.mz_error", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.mz_error", "kind": "function", "doc": "

    Return a list of mz error for specified class

    \n", "signature": "(self, classe):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.mz_calc", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.mz_calc", "kind": "function", "doc": "

    Return a list of calculated mz for specified class

    \n", "signature": "(self, classe):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.peaks_count_percentile", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.peaks_count_percentile", "kind": "function", "doc": "

    Return the peaks count percentile of a specific class

    \n", "signature": "(self, classe):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.abundance_count_percentile", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.abundance_count_percentile", "kind": "function", "doc": "

    Return the abundance percentile of a specific class

    \n", "signature": "(self, classe):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.mz_exp_assigned", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.mz_exp_assigned", "kind": "function", "doc": "

    Return a list of experimental mz for all assigned classes

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.abundance_assigned", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.abundance_assigned", "kind": "function", "doc": "

    Return a list of abundance for all classes

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.mz_exp_all", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.mz_exp_all", "kind": "function", "doc": "

    Return a list of mz for all classes

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.mz_error_all", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.mz_error_all", "kind": "function", "doc": "

    Return a list of mz error for all classes

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.carbon_number_all", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.carbon_number_all", "kind": "function", "doc": "

    Return a list of carbon number for all classes

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.dbe_all", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.dbe_all", "kind": "function", "doc": "

    Return a list of DBE for all classes

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.atoms_ratio_all", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.atoms_ratio_all", "kind": "function", "doc": "

    Return a list of atoms ratio for all classes

    \n", "signature": "(self, numerator, denominator):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.to_dataframe", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.to_dataframe", "kind": "function", "doc": "

    Return a pandas dataframe with all the data from the class

    \n\n
    Parameters
    \n\n
      \n
    • include_isotopologue (bool, optional):\nInclude isotopologues, by default False
    • \n
    • abundance_perc_threshold (int, optional):\nAbundance percentile threshold, by default 5
    • \n
    • include_unassigned (bool, optional):\nInclude unassigned peaks, by default False
    • \n
    \n\n
    Returns
    \n\n
      \n
    • DataFrame: Pandas dataframe with all the data from the class
    • \n
    \n", "signature": "(\tself,\tinclude_isotopologue=False,\tabundance_perc_threshold=5,\tinclude_unassigned=False):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.plot_ms_assigned_unassigned", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.plot_ms_assigned_unassigned", "kind": "function", "doc": "

    Plot stick mass spectrum of all classes

    \n\n
    Parameters
    \n\n
      \n
    • assigned_color (str, optional):\nMatplotlib color for the assigned peaks, by default \"b\"
    • \n
    • unassigned_color (str, optional):\nMatplotlib color for the unassigned peaks, by default \"r\"
    • \n
    \n\n
    Returns
    \n\n
      \n
    • ax (matplotlib.axes):\nMatplotlib axes object
    • \n
    \n", "signature": "(self, assigned_color='b', unassigned_color='r'):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.plot_mz_error", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.plot_mz_error", "kind": "function", "doc": "

    Plot mz error scatter plot of all classes

    \n\n
    Parameters
    \n\n
      \n
    • color (str, optional):\nMatplotlib color, by default \"g\"
    • \n
    \n\n
    Returns
    \n\n
      \n
    • ax (matplotlib.axes):\nMatplotlib axes object
    • \n
    \n", "signature": "(self, color='g'):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.plot_mz_error_class", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.plot_mz_error_class", "kind": "function", "doc": "

    Plot mz error scatter plot of a specific class

    \n\n
    Parameters
    \n\n
      \n
    • classe (str):\nClass name
    • \n
    • color (str, optional):\nMatplotlib color, by default \"g\"
    • \n
    \n\n
    Returns
    \n\n
      \n
    • ax (matplotlib.axes):\nMatplotlib axes object
    • \n
    \n", "signature": "(self, classe, color='g'):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.plot_ms_class", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.plot_ms_class", "kind": "function", "doc": "

    Plot stick mass spectrum of a specific class

    \n\n
    Parameters
    \n\n
      \n
    • classe (str):\nClass name
    • \n
    • color (str, optional):\nMatplotlib color, by default \"g\"
    • \n
    \n\n
    Returns
    \n\n
      \n
    • ax (matplotlib.axes):\nMatplotlib axes object
    • \n
    \n", "signature": "(self, classe, color='g'):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.plot_van_krevelen", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.plot_van_krevelen", "kind": "function", "doc": "

    Plot Van Krevelen Diagram

    \n\n
    Parameters
    \n\n
      \n
    • classe (str):\nClass name
    • \n
    • max_hc (float, optional):\nMax H/C ratio, by default 2.5
    • \n
    • max_oc (float, optional):\nMax O/C ratio, by default 2
    • \n
    • ticks_number (int, optional):\nNumber of ticks, by default 5
    • \n
    • color (str, optional):\nMatplotlib color, by default \"viridis\"
    • \n
    \n\n
    Returns
    \n\n
      \n
    • ax (matplotlib.axes):\nMatplotlib axes object
    • \n
    • abun_perc (float):\nClass percentile of the relative abundance
    • \n
    \n", "signature": "(self, classe, max_hc=2.5, max_oc=2, ticks_number=5, color='viridis'):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.classification.HeteroatomsClassification.plot_dbe_vs_carbon_number", "modulename": "corems.molecular_id.factory.classification", "qualname": "HeteroatomsClassification.plot_dbe_vs_carbon_number", "kind": "function", "doc": "

    Plot DBE vs Carbon Number

    \n\n
    Parameters
    \n\n
      \n
    • classe (str):\nClass name
    • \n
    • max_c (int, optional):\nMax Carbon Number, by default 50
    • \n
    • max_dbe (int, optional):\nMax DBE, by default 40
    • \n
    • dbe_incr (int, optional):\nDBE increment, by default 5
    • \n
    • c_incr (int, optional):\nCarbon Number increment, by default 10
    • \n
    • color (str, optional):\nMatplotlib color, by default \"viridis\"
    • \n
    \n\n
    Returns
    \n\n
      \n
    • ax (matplotlib.axes):\nMatplotlib axes object
    • \n
    • abun_perc (float):\nClass percentile of the relative abundance
    • \n
    \n", "signature": "(\tself,\tclasse,\tmax_c=50,\tmax_dbe=40,\tdbe_incr=5,\tc_incr=10,\tcolor='viridis'):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.molecularSQL", "modulename": "corems.molecular_id.factory.molecularSQL", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.Base", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "Base", "kind": "class", "doc": "

    The base class of the class hierarchy.

    \n\n

    When called, it accepts no arguments and returns a new featureless\ninstance that has no instance attributes and cannot be given any.

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.Base.__init__", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "Base.__init__", "kind": "function", "doc": "

    A simple constructor that allows initialization from kwargs.

    \n\n

    Sets attributes on the constructed instance using the names and\nvalues in kwargs.

    \n\n

    Only keys that are present as\nattributes of the instance's class are allowed. These could be,\nfor example, any mapped columns or relationships.

    \n", "signature": "(**kwargs)"}, {"fullname": "corems.molecular_id.factory.molecularSQL.Base.registry", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "Base.registry", "kind": "variable", "doc": "

    \n", "default_value": "<sqlalchemy.orm.decl_api.registry object>"}, {"fullname": "corems.molecular_id.factory.molecularSQL.Base.metadata", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "Base.metadata", "kind": "variable", "doc": "

    \n", "default_value": "MetaData()"}, {"fullname": "corems.molecular_id.factory.molecularSQL.HeteroAtoms", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "HeteroAtoms", "kind": "class", "doc": "

    HeteroAtoms class for the heteroAtoms table in the SQLite database.

    \n\n
    Attributes
    \n\n
      \n
    • id (int):\nThe primary key for the table.
    • \n
    • name (str):\nThe name of the heteroAtoms class.
    • \n
    • halogensCount (int):\nThe number of halogens in the heteroAtoms class.
    • \n
    • carbonHydrogen (relationship):\nThe relationship to the carbonHydrogen table.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • __repr__()\nReturns the string representation of the object.
    • \n
    • to_dict()\nReturns the heteroAtoms class as a dictionary.
    • \n
    • halogens_count()\nReturns the number of halogens as a float.
    • \n
    \n", "bases": "sqlalchemy.orm.decl_api.Base"}, {"fullname": "corems.molecular_id.factory.molecularSQL.HeteroAtoms.__init__", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "HeteroAtoms.__init__", "kind": "function", "doc": "

    A simple constructor that allows initialization from kwargs.

    \n\n

    Sets attributes on the constructed instance using the names and\nvalues in kwargs.

    \n\n

    Only keys that are present as\nattributes of the instance's class are allowed. These could be,\nfor example, any mapped columns or relationships.

    \n", "signature": "(**kwargs)"}, {"fullname": "corems.molecular_id.factory.molecularSQL.HeteroAtoms.id", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "HeteroAtoms.id", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.HeteroAtoms.name", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "HeteroAtoms.name", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.HeteroAtoms.halogensCount", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "HeteroAtoms.halogensCount", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.HeteroAtoms.carbonHydrogen", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "HeteroAtoms.carbonHydrogen", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.HeteroAtoms.halogens_count", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "HeteroAtoms.halogens_count", "kind": "variable", "doc": "

    Returns the number of halogens as a float.

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.HeteroAtoms.to_dict", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "HeteroAtoms.to_dict", "kind": "function", "doc": "

    Returns the heteroAtoms class as a dictionary.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.molecularSQL.CarbonHydrogen", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "CarbonHydrogen", "kind": "class", "doc": "

    CarbonHydrogen class for the carbonHydrogen table in the SQLite database.

    \n\n
    Attributes
    \n\n
      \n
    • id (int):\nThe primary key for the table.
    • \n
    • C (int):\nThe number of carbon atoms.
    • \n
    • H (int):\nThe number of hydrogen atoms.
    • \n
    • heteroAtoms (relationship):\nThe relationship to the heteroAtoms table.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • __repr__()\nReturns the string representation of the object.
    • \n
    • mass()\nReturns the mass of the carbonHydrogen class as a float.
    • \n
    • c()\nReturns the number of carbon atoms as a float.
    • \n
    • h()\nReturns the number of hydrogen atoms as a float.
    • \n
    • dbe()\nReturns the double bond equivalent as a float.
    • \n
    \n", "bases": "sqlalchemy.orm.decl_api.Base"}, {"fullname": "corems.molecular_id.factory.molecularSQL.CarbonHydrogen.__init__", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "CarbonHydrogen.__init__", "kind": "function", "doc": "

    A simple constructor that allows initialization from kwargs.

    \n\n

    Sets attributes on the constructed instance using the names and\nvalues in kwargs.

    \n\n

    Only keys that are present as\nattributes of the instance's class are allowed. These could be,\nfor example, any mapped columns or relationships.

    \n", "signature": "(**kwargs)"}, {"fullname": "corems.molecular_id.factory.molecularSQL.CarbonHydrogen.id", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "CarbonHydrogen.id", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.CarbonHydrogen.C", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "CarbonHydrogen.C", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.CarbonHydrogen.H", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "CarbonHydrogen.H", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.CarbonHydrogen.heteroAtoms", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "CarbonHydrogen.heteroAtoms", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.CarbonHydrogen.mass", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "CarbonHydrogen.mass", "kind": "variable", "doc": "

    Returns the mass of the carbonHydrogen class as a float.

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.CarbonHydrogen.c", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "CarbonHydrogen.c", "kind": "variable", "doc": "

    Returns the number of carbon atoms as a float.

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.CarbonHydrogen.h", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "CarbonHydrogen.h", "kind": "variable", "doc": "

    Returns the number of hydrogen atoms as a float.

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.CarbonHydrogen.dbe", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "CarbonHydrogen.dbe", "kind": "variable", "doc": "

    Returns the double bond equivalent as a float.

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolecularFormulaLink", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolecularFormulaLink", "kind": "class", "doc": "

    MolecularFormulaLink class for the molecularformula table in the SQLite database.

    \n\n
    Attributes
    \n\n
      \n
    • heteroAtoms_id (int):\nThe foreign key for the heteroAtoms table.
    • \n
    • carbonHydrogen_id (int):\nThe foreign key for the carbonHydrogen table.
    • \n
    • mass (float):\nThe mass of the molecular formula.
    • \n
    • DBE (float):\nThe double bond equivalent of the molecular formula.
    • \n
    • carbonHydrogen (relationship):\nThe relationship to the carbonHydrogen table.
    • \n
    • heteroAtoms (relationship):\nThe relationship to the heteroAtoms table.
    • \n
    • C (association_proxy):\nThe association proxy for the carbonHydrogen table.
    • \n
    • H (association_proxy):\nThe association proxy for the carbonHydrogen table.
    • \n
    • classe (association_proxy):\nThe association proxy for the heteroAtoms table.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • __repr__()\nReturns the string representation of the object.
    • \n
    • to_dict()\nReturns the molecular formula as a dictionary.
    • \n
    • formula_string()\nReturns the molecular formula as a string.
    • \n
    • classe_string()\nReturns the heteroAtoms class as a string.
    • \n
    • _adduct_mz(ion_charge, adduct_atom)\nReturns the m/z of the adduct ion as a float.
    • \n
    • _protonated_mz(ion_charge)\nReturns the m/z of the protonated ion as a float.
    • \n
    • _radical_mz(ion_charge)\nReturns the m/z of the radical ion as a float.
    • \n
    \n", "bases": "sqlalchemy.orm.decl_api.Base"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolecularFormulaLink.__init__", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolecularFormulaLink.__init__", "kind": "function", "doc": "

    A simple constructor that allows initialization from kwargs.

    \n\n

    Sets attributes on the constructed instance using the names and\nvalues in kwargs.

    \n\n

    Only keys that are present as\nattributes of the instance's class are allowed. These could be,\nfor example, any mapped columns or relationships.

    \n", "signature": "(**kwargs)"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolecularFormulaLink.heteroAtoms_id", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolecularFormulaLink.heteroAtoms_id", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolecularFormulaLink.carbonHydrogen_id", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolecularFormulaLink.carbonHydrogen_id", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolecularFormulaLink.mass", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolecularFormulaLink.mass", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolecularFormulaLink.DBE", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolecularFormulaLink.DBE", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolecularFormulaLink.carbonHydrogen", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolecularFormulaLink.carbonHydrogen", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolecularFormulaLink.heteroAtoms", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolecularFormulaLink.heteroAtoms", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolecularFormulaLink.C", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolecularFormulaLink.C", "kind": "variable", "doc": "

    A descriptor that presents a read/write view of an object attribute.

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolecularFormulaLink.H", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolecularFormulaLink.H", "kind": "variable", "doc": "

    A descriptor that presents a read/write view of an object attribute.

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolecularFormulaLink.classe", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolecularFormulaLink.classe", "kind": "variable", "doc": "

    A descriptor that presents a read/write view of an object attribute.

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolecularFormulaLink.to_dict", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolecularFormulaLink.to_dict", "kind": "function", "doc": "

    Returns the molecular formula as a dictionary.

    \n\n
    Returns
    \n\n
      \n
    • dict: The molecular formula as a dictionary.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolecularFormulaLink.formula_string", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolecularFormulaLink.formula_string", "kind": "variable", "doc": "

    Returns the molecular formula as a string.

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolecularFormulaLink.classe_string", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolecularFormulaLink.classe_string", "kind": "variable", "doc": "

    Returns the heteroAtoms class as a string.

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolForm_SQL", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolForm_SQL", "kind": "class", "doc": "

    MolForm_SQL class for the SQLite database.

    \n\n
    Attributes
    \n\n
      \n
    • engine (sqlalchemy.engine.base.Engine):\nThe SQLAlchemy engine.
    • \n
    • session (sqlalchemy.orm.session.Session):\nThe SQLAlchemy session.
    • \n
    • type (str):\nThe type of database.
    • \n
    • chunks_count (int):\nThe number of chunks to use when querying the database.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • __init__(url=None, echo=False)\nInitializes the database.
    • \n
    • __exit__(exc_type, exc_val, exc_tb)\nCloses the database.
    • \n
    • initiate_database(url, database_name)\nCreates the database.
    • \n
    • commit()\nCommits the session.
    • \n
    • init_engine(url)\nInitializes the SQLAlchemy engine.
    • \n
    • __enter__()

    • \n
    • get_dict_by_classes(classes, ion_type, nominal_mzs, ion_charge, molecular_search_settings, adducts=None)\nReturns a dictionary of molecular formulas.

    • \n
    • check_entry(classe, ion_type, molecular_search_settings)\nChecks if a molecular formula is in the database.
    • \n
    • get_all_classes()\nReturns a list of all classes in the database.
    • \n
    • get_all()\nReturns a list of all molecular formulas in the database.
    • \n
    • delete_entry(row)\nDeletes a molecular formula from the database.
    • \n
    • purge(cls)\nDeletes all molecular formulas from the database.
    • \n
    • clear_data()\nClears the database.
    • \n
    • close(commit=True)\nCloses the database.
    • \n
    • add_engine_pidguard(engine)\nAdds multiprocessing guards.
    • \n
    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolForm_SQL.__init__", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolForm_SQL.__init__", "kind": "function", "doc": "

    \n", "signature": "(url=None, echo=False)"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolForm_SQL.engine", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolForm_SQL.engine", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolForm_SQL.session", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolForm_SQL.session", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolForm_SQL.initiate_database", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolForm_SQL.initiate_database", "kind": "function", "doc": "

    Creates the database.

    \n\n
    Parameters
    \n\n
      \n
    • url (str):\nThe URL for the database.
    • \n
    • database_name (str):\nThe name of the database.
    • \n
    \n", "signature": "(self, url, database_name):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolForm_SQL.commit", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolForm_SQL.commit", "kind": "function", "doc": "

    Commits the session.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolForm_SQL.init_engine", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolForm_SQL.init_engine", "kind": "function", "doc": "

    Initializes the SQLAlchemy engine.

    \n\n
    Parameters
    \n\n
      \n
    • url (str):\nThe URL for the database.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • sqlalchemy.engine.base.Engine: The SQLAlchemy engine.
    • \n
    \n", "signature": "(self, url):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolForm_SQL.get_dict_by_classes", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolForm_SQL.get_dict_by_classes", "kind": "function", "doc": "

    Returns a dictionary of molecular formulas.

    \n\n
    Parameters
    \n\n
      \n
    • classes (list):\nThe list of classes.
    • \n
    • ion_type (str):\nThe ion type.
    • \n
    • nominal_mzs (list):\nThe list of nominal m/z values.
    • \n
    • ion_charge (int):\nThe ion charge.
    • \n
    • molecular_search_settings (MolecularFormulaSearchSettings):\nThe molecular formula search settings.
    • \n
    • adducts (list, optional):\nThe list of adducts. Default is None.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: The dictionary of molecular formulas.
    • \n
    \n\n
    Notes
    \n\n

    Known issue, when using SQLite:\nif the number of classes and nominal_m/zs are higher than 999 the query will fail\nSolution: use postgres or split query

    \n", "signature": "(\tself,\tclasses,\tion_type,\tnominal_mzs,\tion_charge,\tmolecular_search_settings,\tadducts=None):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolForm_SQL.check_entry", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolForm_SQL.check_entry", "kind": "function", "doc": "

    Checks if a molecular formula is in the database.

    \n\n
    Parameters
    \n\n
      \n
    • classe (str):\nThe class of the molecular formula.
    • \n
    • ion_type (str):\nThe ion type.
    • \n
    • molecular_search_settings (MolecularFormulaSearchSettings):\nThe molecular formula search settings.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • sqlalchemy.orm.query.Query: The query.
    • \n
    \n", "signature": "(self, classe, ion_type, molecular_search_settings):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolForm_SQL.get_all_classes", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolForm_SQL.get_all_classes", "kind": "function", "doc": "

    Returns a list of all classes in the database.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolForm_SQL.get_all", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolForm_SQL.get_all", "kind": "function", "doc": "

    Returns a list of all molecular formulas in the database.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolForm_SQL.delete_entry", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolForm_SQL.delete_entry", "kind": "function", "doc": "

    Deletes a molecular formula from the database.

    \n", "signature": "(self, row):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolForm_SQL.purge", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolForm_SQL.purge", "kind": "function", "doc": "

    Deletes all molecular formulas from the database.

    \n\n
    Notes
    \n\n

    Careful, this will delete the entire database table

    \n", "signature": "(self, cls):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolForm_SQL.clear_data", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolForm_SQL.clear_data", "kind": "function", "doc": "

    Clears the database.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolForm_SQL.close", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolForm_SQL.close", "kind": "function", "doc": "

    Closes the database.

    \n\n
    Parameters
    \n\n
      \n
    • commit (bool, optional):\nWhether to commit the session. Default is True.
    • \n
    \n", "signature": "(self, commit=True):", "funcdef": "def"}, {"fullname": "corems.molecular_id.factory.molecularSQL.MolForm_SQL.add_engine_pidguard", "modulename": "corems.molecular_id.factory.molecularSQL", "qualname": "MolForm_SQL.add_engine_pidguard", "kind": "function", "doc": "

    Adds multiprocessing guards.

    \n\n

    Forces a connection to be reconnected if it is detected\nas having been shared to a sub-process.

    \n\n
    Parameters
    \n\n
      \n
    • engine (sqlalchemy.engine.base.Engine):\nThe SQLAlchemy engine.
    • \n
    \n", "signature": "(self, engine):", "funcdef": "def"}, {"fullname": "corems.molecular_id.input", "modulename": "corems.molecular_id.input", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.input.nistMSI", "modulename": "corems.molecular_id.input.nistMSI", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.input.nistMSI.ReadNistMSI", "modulename": "corems.molecular_id.input.nistMSI", "qualname": "ReadNistMSI", "kind": "class", "doc": "

    A class for reading NIST MSI files and storing the data in a SQLite database.

    \n\n
    Parameters
    \n\n
      \n
    • file_path (str):\nThe path to the NIST MSI file.
    • \n
    • url (str, optional):\nThe URL for the SQLite database. Default is 'sqlite://'.
    • \n
    \n\n
    Raises
    \n\n
      \n
    • FileExistsError: If the specified file does not exist.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • file_path (str):\nThe path to the NIST MSI file.
    • \n
    • url (str):\nThe URL for the SQLite database.
    • \n
    • sqlLite_obj (EI_LowRes_SQLite):\nThe SQLite object for storing the compound data.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • run().\nRuns the thread and initializes the SQLite object.
    • \n
    • get_sqlLite_obj().\nReturns the SQLite object.
    • \n
    • get_compound_data_dict_list().\nParses the NIST MSI file and returns a list of compound data dictionaries.
    • \n
    \n", "bases": "threading.Thread"}, {"fullname": "corems.molecular_id.input.nistMSI.ReadNistMSI.__init__", "modulename": "corems.molecular_id.input.nistMSI", "qualname": "ReadNistMSI.__init__", "kind": "function", "doc": "

    This constructor should always be called with keyword arguments. Arguments are:

    \n\n

    group should be None; reserved for future extension when a ThreadGroup\nclass is implemented.

    \n\n

    target is the callable object to be invoked by the run()\nmethod. Defaults to None, meaning nothing is called.

    \n\n

    name is the thread name. By default, a unique name is constructed of\nthe form \"Thread-N\" where N is a small decimal number.

    \n\n

    args is the argument tuple for the target invocation. Defaults to ().

    \n\n

    kwargs is a dictionary of keyword arguments for the target\ninvocation. Defaults to {}.

    \n\n

    If a subclass overrides the constructor, it must make sure to invoke\nthe base class constructor (Thread.__init__()) before doing anything\nelse to the thread.

    \n", "signature": "(file_path, url='sqlite://')"}, {"fullname": "corems.molecular_id.input.nistMSI.ReadNistMSI.file_path", "modulename": "corems.molecular_id.input.nistMSI", "qualname": "ReadNistMSI.file_path", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.input.nistMSI.ReadNistMSI.url", "modulename": "corems.molecular_id.input.nistMSI", "qualname": "ReadNistMSI.url", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.input.nistMSI.ReadNistMSI.run", "modulename": "corems.molecular_id.input.nistMSI", "qualname": "ReadNistMSI.run", "kind": "function", "doc": "

    Runs the thread and initializes the SQLite object.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.input.nistMSI.ReadNistMSI.get_sqlLite_obj", "modulename": "corems.molecular_id.input.nistMSI", "qualname": "ReadNistMSI.get_sqlLite_obj", "kind": "function", "doc": "

    Returns the SQLite object.

    \n\n
    Returns
    \n\n
      \n
    • EI_LowRes_SQLite: The SQLite object for storing the compound data.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.input.nistMSI.ReadNistMSI.get_compound_data_dict_list", "modulename": "corems.molecular_id.input.nistMSI", "qualname": "ReadNistMSI.get_compound_data_dict_list", "kind": "function", "doc": "

    Parses the NIST MSI file and returns a list of compound data dictionaries.

    \n\n
    Returns
    \n\n
      \n
    • list: A list of compound data dictionaries.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search", "modulename": "corems.molecular_id.search", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.compoundSearch", "modulename": "corems.molecular_id.search.compoundSearch", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.compoundSearch.LowResMassSpectralMatch", "modulename": "corems.molecular_id.search.compoundSearch", "qualname": "LowResMassSpectralMatch", "kind": "class", "doc": "

    A class representing a low-resolution mass spectral match.

    \n\n
    Parameters
    \n\n
      \n
    • gcms_obj (object):\nThe GC-MS object.
    • \n
    • sql_obj (object, optional):\nThe SQL object for database operations. Default is None.
    • \n
    • calibration (bool, optional):\nFlag indicating if the match is for calibration. Default is False.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • gcms_obj (object):\nThe GC-MS object.
    • \n
    • sql_obj (object):\nThe SQL object for database operations.
    • \n
    • calibration (bool):\nFlag indicating if the match is for calibration.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • metabolite_detector_score(gc_peak, ref_obj, spectral_simi).\nCalculates the spectral similarity scores and the similarity score for a given GC peak and reference object.
    • \n
    • run().\nRuns the low-resolution mass spectral match.
    • \n
    \n", "bases": "threading.Thread"}, {"fullname": "corems.molecular_id.search.compoundSearch.LowResMassSpectralMatch.__init__", "modulename": "corems.molecular_id.search.compoundSearch", "qualname": "LowResMassSpectralMatch.__init__", "kind": "function", "doc": "

    This constructor should always be called with keyword arguments. Arguments are:

    \n\n

    group should be None; reserved for future extension when a ThreadGroup\nclass is implemented.

    \n\n

    target is the callable object to be invoked by the run()\nmethod. Defaults to None, meaning nothing is called.

    \n\n

    name is the thread name. By default, a unique name is constructed of\nthe form \"Thread-N\" where N is a small decimal number.

    \n\n

    args is the argument tuple for the target invocation. Defaults to ().

    \n\n

    kwargs is a dictionary of keyword arguments for the target\ninvocation. Defaults to {}.

    \n\n

    If a subclass overrides the constructor, it must make sure to invoke\nthe base class constructor (Thread.__init__()) before doing anything\nelse to the thread.

    \n", "signature": "(gcms_obj, sql_obj=None, calibration=False)"}, {"fullname": "corems.molecular_id.search.compoundSearch.LowResMassSpectralMatch.gcms_obj", "modulename": "corems.molecular_id.search.compoundSearch", "qualname": "LowResMassSpectralMatch.gcms_obj", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.compoundSearch.LowResMassSpectralMatch.calibration", "modulename": "corems.molecular_id.search.compoundSearch", "qualname": "LowResMassSpectralMatch.calibration", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.compoundSearch.LowResMassSpectralMatch.metabolite_detector_score", "modulename": "corems.molecular_id.search.compoundSearch", "qualname": "LowResMassSpectralMatch.metabolite_detector_score", "kind": "function", "doc": "

    Calculates the spectral similarity scores and the similarity score for a given GC peak and reference object.

    \n\n
    Parameters
    \n\n
      \n
    • gc_peak (object):\nThe GC peak object.
    • \n
    • ref_obj (object):\nThe reference object.
    • \n
    • spectral_simi (object):\nThe spectral similarity object.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • tuple: A tuple containing the spectral similarity scores, RI score, and similarity score.
    • \n
    \n", "signature": "(self, gc_peak, ref_obj, spectral_simi):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.compoundSearch.LowResMassSpectralMatch.run", "modulename": "corems.molecular_id.search.compoundSearch", "qualname": "LowResMassSpectralMatch.run", "kind": "function", "doc": "

    Runs the low-resolution mass spectral match.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.findOxygenPeaks", "modulename": "corems.molecular_id.search.findOxygenPeaks", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.findOxygenPeaks.FindOxygenPeaks", "modulename": "corems.molecular_id.search.findOxygenPeaks", "qualname": "FindOxygenPeaks", "kind": "class", "doc": "

    Class to find Oxygen peaks in a mass spectrum for formula assignment search

    \n\n

    Class to walk 14Da units over oxygen space for negative ion mass spectrum of natural organic matter\nReturns a list of MSPeak class containing the possible Molecular Formula class objects.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum_obj (MassSpec class):\nThis is where we store MassSpec class obj,
    • \n
    • lookupTableSettings (MolecularLookupTableSettings class):\nThis is where we store MolecularLookupTableSettings class obj
    • \n
    • min_O , max_O (int):\nminium and maximum of Oxygen to allow the software to look for\nit will override the settings at lookupTableSettings.usedAtoms\ndefault min = 1, max = 22
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • mass_spectrum_obj (MassSpec class):\nThis is where we store MassSpec class obj,
    • \n
    • lookupTableSettings (MolecularLookupTableSettings class):\nThis is where we store MolecularLookupTableSettings class obj
    • \n
    \n\n
    Methods
    \n\n
      \n
    • run().\nwill be called when the instantiated class method start is called
    • \n
    • get_list_found_peaks().\nreturns a list of MSpeaks classes cotaining all the MolecularFormula candidates inside the MSPeak\nfor more details of the structure see MSPeak class and MolecularFormula class
    • \n
    • set_mass_spec_indexes_by_found_peaks().\nset the mass spectrum to interate over only the selected indexes
    • \n
    \n", "bases": "threading.Thread"}, {"fullname": "corems.molecular_id.search.findOxygenPeaks.FindOxygenPeaks.__init__", "modulename": "corems.molecular_id.search.findOxygenPeaks", "qualname": "FindOxygenPeaks.__init__", "kind": "function", "doc": "

    This constructor should always be called with keyword arguments. Arguments are:

    \n\n

    group should be None; reserved for future extension when a ThreadGroup\nclass is implemented.

    \n\n

    target is the callable object to be invoked by the run()\nmethod. Defaults to None, meaning nothing is called.

    \n\n

    name is the thread name. By default, a unique name is constructed of\nthe form \"Thread-N\" where N is a small decimal number.

    \n\n

    args is the argument tuple for the target invocation. Defaults to ().

    \n\n

    kwargs is a dictionary of keyword arguments for the target\ninvocation. Defaults to {}.

    \n\n

    If a subclass overrides the constructor, it must make sure to invoke\nthe base class constructor (Thread.__init__()) before doing anything\nelse to the thread.

    \n", "signature": "(\tmass_spectrum_obj,\tsql_db: bool = False,\tmin_O: int = 1,\tmax_O: int = 22)"}, {"fullname": "corems.molecular_id.search.findOxygenPeaks.FindOxygenPeaks.mass_spectrum_obj", "modulename": "corems.molecular_id.search.findOxygenPeaks", "qualname": "FindOxygenPeaks.mass_spectrum_obj", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.findOxygenPeaks.FindOxygenPeaks.min_0", "modulename": "corems.molecular_id.search.findOxygenPeaks", "qualname": "FindOxygenPeaks.min_0", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.findOxygenPeaks.FindOxygenPeaks.max_O", "modulename": "corems.molecular_id.search.findOxygenPeaks", "qualname": "FindOxygenPeaks.max_O", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.findOxygenPeaks.FindOxygenPeaks.run", "modulename": "corems.molecular_id.search.findOxygenPeaks", "qualname": "FindOxygenPeaks.run", "kind": "function", "doc": "

    Run the thread

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.findOxygenPeaks.FindOxygenPeaks.find_most_abundant_formula", "modulename": "corems.molecular_id.search.findOxygenPeaks", "qualname": "FindOxygenPeaks.find_most_abundant_formula", "kind": "function", "doc": "

    Find the most abundant formula in the mass spectrum

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum_obj (MassSpec class):\nMass spectrum object
    • \n
    \n\n
    Returns
    \n\n
      \n
    • MolecularFormula class obj: most abundant MolecularFormula with the lowest mass error
    • \n
    \n", "signature": "(self, mass_spectrum_obj):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.findOxygenPeaks.FindOxygenPeaks.find_most_abundant_formula_test", "modulename": "corems.molecular_id.search.findOxygenPeaks", "qualname": "FindOxygenPeaks.find_most_abundant_formula_test", "kind": "function", "doc": "

    [Test function] Find the most abundant formula in the mass spectrum

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum_obj (MassSpec class):\nMass spectrum object
    • \n
    • settings (MolecularSearchSettings class):\nMolecular search settings object
    • \n
    \n\n
    Returns
    \n\n
      \n
    • MolecularFormula class obj: most abundant MolecularFormula with the lowest mass error
    • \n
    \n", "signature": "(self, mass_spectrum_obj, settings):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.findOxygenPeaks.FindOxygenPeaks.find_series_mspeaks", "modulename": "corems.molecular_id.search.findOxygenPeaks", "qualname": "FindOxygenPeaks.find_series_mspeaks", "kind": "function", "doc": "

    Find a series of abundant peaks in the mass spectrum for a given molecular formula

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum_obj (MassSpec class):\nMass spectrum object
    • \n
    • molecular_formula_obj_reference (MolecularFormula class):\nMolecular formula object
    • \n
    • deltamz (float):\ndelta m/z to look for peaks
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: list of MSpeak class objects
    • \n
    \n", "signature": "(self, mass_spectrum_obj, molecular_formula_obj_reference, deltamz=14):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.findOxygenPeaks.FindOxygenPeaks.get_list_found_peaks", "modulename": "corems.molecular_id.search.findOxygenPeaks", "qualname": "FindOxygenPeaks.get_list_found_peaks", "kind": "function", "doc": "

    Get the list of found peaks

    \n\n
    Returns
    \n\n
      \n
    • list: list of MSpeak class objects
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.findOxygenPeaks.FindOxygenPeaks.set_mass_spec_indexes_by_found_peaks", "modulename": "corems.molecular_id.search.findOxygenPeaks", "qualname": "FindOxygenPeaks.set_mass_spec_indexes_by_found_peaks", "kind": "function", "doc": "

    Set the mass spectrum to interate over only the selected indexes.

    \n\n
    Notes
    \n\n

    Warning!!!!\nset the mass spectrum to interate over only the selected indexes\ndon not forget to call mass_spectrum_obj.reset_indexes after the job is done

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.last_error", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "last_error", "kind": "variable", "doc": "

    \n", "default_value": "0"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.last_dif", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "last_dif", "kind": "variable", "doc": "

    \n", "default_value": "0"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.closest_error", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "closest_error", "kind": "variable", "doc": "

    \n", "default_value": "0"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.error_average", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "error_average", "kind": "variable", "doc": "

    \n", "default_value": "0"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.nbValues", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "nbValues", "kind": "variable", "doc": "

    \n", "default_value": "0"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulas", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulas", "kind": "class", "doc": "

    Class for searching molecular formulas in a mass spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum_obj (MassSpectrum):\nThe mass spectrum object.
    • \n
    • sql_db (MolForm_SQL, optional):\nThe SQL database object, by default None.
    • \n
    • first_hit (bool, optional):\nFlag to indicate whether to skip peaks that already have a molecular formula assigned, by default False.
    • \n
    • find_isotopologues (bool, optional):\nFlag to indicate whether to find isotopologues, by default True.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • mass_spectrum_obj (MassSpectrum):\nThe mass spectrum object.
    • \n
    • sql_db (MolForm_SQL):\nThe SQL database object.
    • \n
    • first_hit (bool):\nFlag to indicate whether to skip peaks that already have a molecular formula assigned.
    • \n
    • find_isotopologues (bool):\nFlag to indicate whether to find isotopologues.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • run_search().\nRun the molecular formula search.
    • \n
    • run_worker_mass_spectrum().\nRun the molecular formula search on the mass spectrum object.
    • \n
    • run_worker_ms_peaks().\nRun the molecular formula search on the given list of mass spectrum peaks.
    • \n
    • database_to_dict().\nConvert the database results to a dictionary.
    • \n
    • run_molecular_formula().\nRun the molecular formula search on the given list of mass spectrum peaks.
    • \n
    • search_mol_formulas().\nSearch for molecular formulas in the mass spectrum.
    • \n
    \n"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulas.__init__", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulas.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tmass_spectrum_obj,\tsql_db=None,\tfirst_hit: bool = False,\tfind_isotopologues: bool = True)"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulas.first_hit", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulas.first_hit", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulas.find_isotopologues", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulas.find_isotopologues", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulas.mass_spectrum_obj", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulas.mass_spectrum_obj", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulas.run_search", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulas.run_search", "kind": "function", "doc": "

    Run the molecular formula search.

    \n\n
    Parameters
    \n\n
      \n
    • mspeaks (list of MSPeak):\nThe list of mass spectrum peaks.
    • \n
    • query (dict):\nThe query dictionary containing the possible molecular formulas.
    • \n
    • min_abundance (float):\nThe minimum abundance threshold.
    • \n
    • ion_type (str):\nThe ion type.
    • \n
    • ion_charge (int):\nThe ion charge.
    • \n
    • adduct_atom (str, optional):\nThe adduct atom, by default None.
    • \n
    \n", "signature": "(\tself,\tmspeaks: list,\tquery: dict,\tmin_abundance: float,\tion_type: str,\tion_charge: int,\tadduct_atom=None):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulas.run_worker_mass_spectrum", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulas.run_worker_mass_spectrum", "kind": "function", "doc": "

    Run the molecular formula search on the mass spectrum object.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulas.run_worker_ms_peaks", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulas.run_worker_ms_peaks", "kind": "function", "doc": "

    Run the molecular formula search on the given list of mass spectrum peaks.

    \n\n
    Parameters
    \n\n
      \n
    • ms_peaks (list of MSPeak):\nThe list of mass spectrum peaks.
    • \n
    \n", "signature": "(self, ms_peaks):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulas.database_to_dict", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulas.database_to_dict", "kind": "function", "doc": "

    Convert the database results to a dictionary.

    \n\n
    Parameters
    \n\n
      \n
    • classe_str_list (list):\nThe list of class strings.
    • \n
    • nominal_mzs (list):\nThe list of nominal m/z values.
    • \n
    • mf_search_settings (MolecularFormulaSearchSettings):\nThe molecular formula search settings.
    • \n
    • ion_charge (int):\nThe ion charge.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: The dictionary containing the database results.
    • \n
    \n", "signature": "(classe_str_list, nominal_mzs, mf_search_settings, ion_charge):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulas.run_molecular_formula", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulas.run_molecular_formula", "kind": "function", "doc": "

    Run the molecular formula search on the given list of mass spectrum peaks.

    \n\n
    Parameters
    \n\n
      \n
    • ms_peaks (list of MSPeak):\nThe list of mass spectrum peaks.
    • \n
    \n", "signature": "(*args, **kw):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulas.search_mol_formulas", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulas.search_mol_formulas", "kind": "function", "doc": "

    Search for molecular formulas in the mass spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • possible_formulas_list (list of MolecularFormula):\nThe list of possible molecular formulas.
    • \n
    • ion_type (str):\nThe ion type.
    • \n
    • neutral_molform (bool, optional):\nFlag to indicate whether the molecular formulas are neutral, by default True.
    • \n
    • find_isotopologues (bool, optional):\nFlag to indicate whether to find isotopologues, by default True.
    • \n
    • adduct_atom (str, optional):\nThe adduct atom, by default None.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list of MSPeak: The list of mass spectrum peaks with assigned molecular formulas.
    • \n
    \n", "signature": "(\tself,\tpossible_formulas_list: List[corems.molecular_formula.factory.MolecularFormulaFactory.MolecularFormula],\tion_type: str,\tneutral_molform=True,\tfind_isotopologues=True,\tadduct_atom=None) -> List[corems.ms_peak.factory.MSPeakClasses._MSPeak]:", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulaWorker", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulaWorker", "kind": "class", "doc": "

    Class for searching molecular formulas in a mass spectrum.

    \n\n
    Parameters
    \n\n
      \n
    • find_isotopologues (bool, optional):\nFlag to indicate whether to find isotopologues, by default True.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • find_isotopologues (bool):\nFlag to indicate whether to find isotopologues.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • reset_error().\nReset the error variables.
    • \n
    • set_last_error().\nSet the last error.
    • \n
    • find_formulas().\nFind the formulas.
    • \n
    • calc_error().\nCalculate the error.
    • \n
    \n"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulaWorker.__init__", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulaWorker.__init__", "kind": "function", "doc": "

    \n", "signature": "(find_isotopologues=True)"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulaWorker.find_isotopologues", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulaWorker.find_isotopologues", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulaWorker.reset_error", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulaWorker.reset_error", "kind": "function", "doc": "

    Reset the error variables.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum_obj (MassSpectrum):\nThe mass spectrum object.
    • \n
    \n", "signature": "(self, mass_spectrum_obj):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulaWorker.set_last_error", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulaWorker.set_last_error", "kind": "function", "doc": "

    Set the last error.

    \n\n
    Parameters
    \n\n
      \n
    • error (float):\nThe error.
    • \n
    • mass_spectrum_obj (MassSpectrum):\nThe mass spectrum object.
    • \n
    \n", "signature": "(self, error, mass_spectrum_obj):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulaWorker.calc_error", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulaWorker.calc_error", "kind": "function", "doc": "

    Calculate the error.

    \n\n
    Parameters
    \n\n
      \n
    • mz_exp (float):\nThe experimental m/z value.
    • \n
    • mz_calc (float):\nThe calculated m/z value.
    • \n
    • method (str, optional):\nThe method, by default 'ppm'.
    • \n
    \n\n
    Raises
    \n\n
      \n
    • Exception: If the method is not ppm or ppb.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: The error.
    • \n
    \n", "signature": "(mz_exp, mz_calc, method='ppm'):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulaWorker.find_formulas", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulaWorker.find_formulas", "kind": "function", "doc": "

    Find the formulas.

    \n\n
    Parameters
    \n\n
      \n
    • formulas (list of MolecularFormula):\nThe list of molecular formulas.
    • \n
    • min_abundance (float):\nThe minimum abundance threshold.
    • \n
    • mass_spectrum_obj (MassSpectrum):\nThe mass spectrum object.
    • \n
    • ms_peak (MSPeak):\nThe mass spectrum peak.
    • \n
    • ion_type (str):\nThe ion type.
    • \n
    • ion_charge (int):\nThe ion charge.
    • \n
    • adduct_atom (str, optional):\nThe adduct atom, by default None.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list of MSPeak: The list of mass spectrum peaks with assigned molecular formulas.
    • \n
    \n\n
    Notes
    \n\n

    Uses the closest error the next search (this is not ideal, it needs to use confidence \nmetric to choose the right candidate then propagate the error using the error from the best candidate).\nIt needs to add s/n to the equation.\nIt need optimization to define the mz_error_range within a m/z unit since it is directly proportional \nwith the mass, and inversely proportional to the rp. It's not linear, i.e., sigma mass.\nThe idea it to correlate sigma to resolving power, signal to noise and sample complexity per mz unit.\nMethod='distance'

    \n", "signature": "(\tself,\tformulas,\tmin_abundance,\tmass_spectrum_obj,\tms_peak,\tion_type,\tion_charge,\tadduct_atom=None):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulasLC", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulasLC", "kind": "class", "doc": "

    Class for searching molecular formulas in a LC object.

    \n\n
    Parameters
    \n\n
      \n
    • lcms_obj (LC):\nThe LC object.
    • \n
    • sql_db (MolForm_SQL, optional):\nThe SQL database object, by default None.
    • \n
    • first_hit (bool, optional):\nFlag to indicate whether to skip peaks that already have a molecular formula assigned, by default False.
    • \n
    • find_isotopologues (bool, optional):\nFlag to indicate whether to find isotopologues, by default True.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • run_untargeted_worker_ms1().\nRun untargeted molecular formula search on the ms1 mass spectrum.
    • \n
    • run_target_worker_ms1().\nRun targeted molecular formula search on the ms1 mass spectrum.
    • \n
    \n", "bases": "SearchMolecularFormulas"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulasLC.__init__", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulasLC.__init__", "kind": "function", "doc": "

    \n", "signature": "(lcms_obj, sql_db=None, first_hit=False, find_isotopologues=True)"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulasLC.first_hit", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulasLC.first_hit", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulasLC.find_isotopologues", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulasLC.find_isotopologues", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulasLC.lcms_obj", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulasLC.lcms_obj", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulasLC.run_untargeted_worker_ms1", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulasLC.run_untargeted_worker_ms1", "kind": "function", "doc": "

    Run untargeted molecular formula search on the ms1 mass spectrum.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.molecularFormulaSearch.SearchMolecularFormulasLC.run_target_worker_ms1", "modulename": "corems.molecular_id.search.molecularFormulaSearch", "qualname": "SearchMolecularFormulasLC.run_target_worker_ms1", "kind": "function", "doc": "

    Run targeted molecular formula search on the ms1 mass spectrum.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.priorityAssignment", "modulename": "corems.molecular_id.search.priorityAssignment", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.priorityAssignment.OxygenPriorityAssignment", "modulename": "corems.molecular_id.search.priorityAssignment", "qualname": "OxygenPriorityAssignment", "kind": "class", "doc": "

    A class for assigning priority to oxygen classes in a molecular search.

    \n\n
    Parameters
    \n\n
      \n
    • mass_spectrum_obj (MassSpectrum):\nThe mass spectrum object.
    • \n
    • sql_db (bool, optional):\nWhether to use an SQL database. The default is False.
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • mass_spectrum_obj (MassSpectrum):\nThe mass spectrum object.
    • \n
    • sql_db (MolForm_SQL):\nThe SQL database object.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • run().\nRun the priority assignment process.
    • \n
    • create_data_base().\nCreate the molecular database for the specified heteroatomic classes.
    • \n
    • run_worker_mass_spectrum(assign_classes_order_tuples).\nRun the molecular formula search for each class in the specified order.
    • \n
    • get_dict_molecular_database(classe_str_list).\nGet the molecular database as a dictionary.
    • \n
    • ox_classes_and_peaks_in_order_().\nGet the oxygen classes and associated peaks in order.
    • \n
    • get_classes_in_order(dict_ox_class_and_ms_peak)
      \nGet the classes in order.
    • \n
    \n", "bases": "threading.Thread"}, {"fullname": "corems.molecular_id.search.priorityAssignment.OxygenPriorityAssignment.__init__", "modulename": "corems.molecular_id.search.priorityAssignment", "qualname": "OxygenPriorityAssignment.__init__", "kind": "function", "doc": "

    This constructor should always be called with keyword arguments. Arguments are:

    \n\n

    group should be None; reserved for future extension when a ThreadGroup\nclass is implemented.

    \n\n

    target is the callable object to be invoked by the run()\nmethod. Defaults to None, meaning nothing is called.

    \n\n

    name is the thread name. By default, a unique name is constructed of\nthe form \"Thread-N\" where N is a small decimal number.

    \n\n

    args is the argument tuple for the target invocation. Defaults to ().

    \n\n

    kwargs is a dictionary of keyword arguments for the target\ninvocation. Defaults to {}.

    \n\n

    If a subclass overrides the constructor, it must make sure to invoke\nthe base class constructor (Thread.__init__()) before doing anything\nelse to the thread.

    \n", "signature": "(mass_spectrum_obj, sql_db=False)"}, {"fullname": "corems.molecular_id.search.priorityAssignment.OxygenPriorityAssignment.mass_spectrum_obj", "modulename": "corems.molecular_id.search.priorityAssignment", "qualname": "OxygenPriorityAssignment.mass_spectrum_obj", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.molecular_id.search.priorityAssignment.OxygenPriorityAssignment.run", "modulename": "corems.molecular_id.search.priorityAssignment", "qualname": "OxygenPriorityAssignment.run", "kind": "function", "doc": "

    Run the priority assignment process.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.priorityAssignment.OxygenPriorityAssignment.create_data_base", "modulename": "corems.molecular_id.search.priorityAssignment", "qualname": "OxygenPriorityAssignment.create_data_base", "kind": "function", "doc": "

    Create the molecular database for the specified heteroatomic classes.

    \n\n
    Returns
    \n\n
      \n
    • assign_classes_order_str_dict_tuple_ (list):\nA list of tuples containing the class names and dictionaries of class attributes.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.priorityAssignment.OxygenPriorityAssignment.run_worker_mass_spectrum", "modulename": "corems.molecular_id.search.priorityAssignment", "qualname": "OxygenPriorityAssignment.run_worker_mass_spectrum", "kind": "function", "doc": "

    Run the molecular formula search for each class in the specified order.

    \n\n
    Parameters
    \n\n
      \n
    • assign_classes_order_tuples (list):\nA list of tuples containing the class names and dictionaries of class attributes.
    • \n
    \n", "signature": "(self, assign_classes_order_tuples):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.priorityAssignment.OxygenPriorityAssignment.get_dict_molecular_database", "modulename": "corems.molecular_id.search.priorityAssignment", "qualname": "OxygenPriorityAssignment.get_dict_molecular_database", "kind": "function", "doc": "

    Get the molecular database as a dictionary.

    \n\n
    Parameters
    \n\n
      \n
    • classe_str_list (list):\nA list of class names.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: A dictionary containing the molecular database.
    • \n
    \n", "signature": "(self, classe_str_list):", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.priorityAssignment.OxygenPriorityAssignment.ox_classes_and_peaks_in_order_", "modulename": "corems.molecular_id.search.priorityAssignment", "qualname": "OxygenPriorityAssignment.ox_classes_and_peaks_in_order_", "kind": "function", "doc": "

    Get the oxygen classes and associated peaks in order.

    \n\n
    Returns
    \n\n
      \n
    • dict: A dictionary containing the oxygen classes and associated peaks.
    • \n
    \n", "signature": "(self) -> dict:", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.priorityAssignment.OxygenPriorityAssignment.get_classes_in_order", "modulename": "corems.molecular_id.search.priorityAssignment", "qualname": "OxygenPriorityAssignment.get_classes_in_order", "kind": "function", "doc": "

    Get the classes in order.

    \n\n
    Parameters
    \n\n
      \n
    • dict_ox_class_and_ms_peak (dict):\nA dictionary containing the oxygen classes and associated peaks.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: A list of tuples containing the class names and dictionaries of class attributes.
    • \n
    \n\n
    Notes
    \n\n

    structure is \n ('HC', {'HC': 1})

    \n", "signature": "(self, dict_ox_class_and_ms_peak) -> [(<class 'str'>, <class 'dict'>)]:", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.priorityAssignment.OxygenPriorityAssignment.get_class_strings_dict", "modulename": "corems.molecular_id.search.priorityAssignment", "qualname": "OxygenPriorityAssignment.get_class_strings_dict", "kind": "function", "doc": "

    Get the class strings and dictionaries.

    \n\n
    Parameters
    \n\n
      \n
    • all_atoms_tuples (tuple):\nA tuple containing the atoms.
    • \n
    • atoms_in_order (list):\nA list of atoms in order.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: A list of tuples containing the class strings and dictionaries.
    • \n
    \n", "signature": "(all_atoms_tuples, atoms_in_order) -> [(<class 'str'>, <class 'dict'>)]:", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.priorityAssignment.OxygenPriorityAssignment.combine_ox_class_with_other", "modulename": "corems.molecular_id.search.priorityAssignment", "qualname": "OxygenPriorityAssignment.combine_ox_class_with_other", "kind": "function", "doc": "

    Combine the oxygen classes with other classes.

    \n\n
    Parameters
    \n\n
      \n
    • atoms_in_order (list):\nA list of atoms in order.
    • \n
    • classes_strings_dict_tuples (list):

    • \n
    • dict_ox_class_and_ms_peak (dict):\nA dictionary containing the oxygen classes and associated peaks.

    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: A list of dictionaries.
    • \n
    \n", "signature": "(\tatoms_in_order,\tclasses_strings_dict_tuples,\tdict_ox_class_and_ms_peak) -> [<class 'dict'>]:", "funcdef": "def"}, {"fullname": "corems.molecular_id.search.priorityAssignment.OxygenPriorityAssignment.sort_classes", "modulename": "corems.molecular_id.search.priorityAssignment", "qualname": "OxygenPriorityAssignment.sort_classes", "kind": "function", "doc": "

    Sort the classes.

    \n\n
    Parameters
    \n\n
      \n
    • atoms_in_order (list):\nA list of atoms in order.
    • \n
    • combination_tuples (list):
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: A list of tuples containing the class strings and dictionaries.
    • \n
    \n", "signature": "(atoms_in_order, combination_tuples) -> [(<class 'str'>, <class 'dict'>)]:", "funcdef": "def"}, {"fullname": "corems.ms_peak", "modulename": "corems.ms_peak", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.ms_peak.calc", "modulename": "corems.ms_peak.calc", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc", "modulename": "corems.ms_peak.calc.MSPeakCalc", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation", "kind": "class", "doc": "

    Class to perform calculations on MSPeak objects.

    \n\n

    This class provides methods to perform various calculations on MSPeak objects, such as calculating Kendrick Mass Defect (KMD) and Kendrick Mass (KM), calculating peak area, and fitting peak lineshape using different models.

    \n\n
    Parameters
    \n\n
      \n
    • None
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • _ms_parent (MSParent):\nThe parent MSParent object associated with the MSPeakCalculation object.
    • \n
    • mz_exp (float):\nThe experimental m/z value of the peak.
    • \n
    • start_scan (int):\nThe start scan index of the peak.
    • \n
    • final_scan (int):\nThe final scan index of the peak.
    • \n
    • resolving_power (float):\nThe resolving power of the peak.
    • \n
    \n\n
    Methods
    \n\n
      \n
    • _calc_kmd(dict_base).\nCalculate the Kendrick Mass Defect (KMD) and Kendrick Mass (KM) for a given base formula.
    • \n
    • calc_area().\nCalculate the peak area using numpy's trapezoidal fit.
    • \n
    • fit_peak(mz_extend=6, delta_rp=0, model='Gaussian').\nPerform lineshape analysis on a peak using lmfit module.
    • \n
    • voigt_pso(w, r, yoff, width, loc, a).\nCalculate the Voigt function for particle swarm optimization (PSO) fitting.
    • \n
    • objective_pso(x, w, u).\nCalculate the objective function for PSO fitting.
    • \n
    • minimize_pso(lower, upper, w, u).\nMinimize the objective function using the particle swarm optimization algorithm.
    • \n
    • fit_peak_pso(mz_extend=6, upsample_multiplier=5).\nPerform lineshape analysis on a peak using particle swarm optimization (PSO) fitting.
    • \n
    • voigt(oversample_multiplier=1, delta_rp=0, mz_overlay=1).\n[Legacy] Perform voigt lineshape analysis on a peak.
    • \n
    • pseudovoigt(oversample_multiplier=1, delta_rp=0, mz_overlay=1, fraction=0.5).\n[Legacy] Perform pseudovoigt lineshape analysis on a peak.
    • \n
    • lorentz(oversample_multiplier=1, delta_rp=0, mz_overlay=1).\n[Legacy] Perform lorentz lineshape analysis on a peak.
    • \n
    • gaussian(oversample_multiplier=1, delta_rp=0, mz_overlay=1).\n[Legacy] Perform gaussian lineshape analysis on a peak.
    • \n
    • get_mz_domain(oversample_multiplier, mz_overlay).\n[Legacy] Resample/interpolate datapoints for lineshape analysis.
    • \n
    • number_possible_assignments().\nReturn the number of possible molecular formula assignments for the peak.
    • \n
    • molecular_formula_lowest_error().\nReturn the molecular formula with the smallest absolute mz error.
    • \n
    • molecular_formula_highest_prob_score().\nReturn the molecular formula with the highest confidence score.
    • \n
    • molecular_formula_earth_filter(lowest_error=True).\nFilter molecular formula using the 'Earth' filter.
    • \n
    • molecular_formula_water_filter(lowest_error=True).\nFilter molecular formula using the 'Water' filter.
    • \n
    • molecular_formula_air_filter(lowest_error=True).\nFilter molecular formula using the 'Air' filter.
    • \n
    • cia_score_S_P_error().\nCompound Identification Algorithm SP Error - Assignment Filter.
    • \n
    • cia_score_N_S_P_error().\nCompound Identification Algorithm NSP Error - Assignment Filter.
    • \n
    \n"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.calc_area", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.calc_area", "kind": "function", "doc": "

    Calculate the peak area using numpy's trapezoidal fit

    \n\n

    uses provided mz_domain to accurately integrate areas independent of digital resolution

    \n\n
    Returns
    \n\n
      \n
    • float: peak area
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.fit_peak", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.fit_peak", "kind": "function", "doc": "

    Lineshape analysis on a peak using lmfit module.

    \n\n

    Model and fit peak lineshape by defined function - using lmfit module\nDoes not oversample/resample/interpolate data points \nBetter to go back to time domain and perform more zero filling - if possible.

    \n\n
    Parameters
    \n\n
      \n
    • mz_extend (int):\nextra points left and right of peak definition to include in fitting
    • \n
    • delta_rp (float):\ndelta resolving power to add to resolving power
    • \n
    • model (str):\nType of lineshape model to use.\nModels allowed: Gaussian, Lorentz, Voigt
    • \n
    \n\n
    Returns
    \n\n
      \n
    • mz_domain (ndarray):\nx-axis domain for fit
    • \n
    • fit_peak (lmfit object):\nfit results object from lmfit module
    • \n
    \n\n
    Notes
    \n\n

    Returns the calculated mz domain, initial defined abundance profile, and the fit peak results object from lmfit module\nmz_extend here extends the x-axis domain so that we have sufficient points either side of the apex to fit.\nTakes about 10ms per peak

    \n", "signature": "(self, mz_extend=6, delta_rp=0, model='Gaussian'):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.voigt_pso", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.voigt_pso", "kind": "function", "doc": "

    Voigt function for particle swarm optimisation (PSO) fitting

    \n\n

    From https://github.com/pnnl/nmrfit/blob/master/nmrfit/equations.py.\nCalculates a Voigt function over w based on the relevant properties of the distribution.

    \n\n
    Parameters
    \n\n
      \n
    • w (ndarray):\nArray over which the Voigt function will be evaluated.
    • \n
    • r (float):\nRatio between the Guassian and Lorentzian functions.
    • \n
    • yoff (float):\nY-offset of the Voigt function.
    • \n
    • width (float):\nThe width of the Voigt function.
    • \n
    • loc (float):\nCenter of the Voigt function.
    • \n
    • a (float):\nArea of the Voigt function.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • V (ndarray):\nArray defining the Voigt function over w.
    • \n
    \n\n
    References
    \n\n
      \n
    1. https://github.com/pnnl/nmrfit
    2. \n
    \n\n
    Notes
    \n\n

    Particle swarm optimisation (PSO) fitting function can be significantly more computationally expensive than lmfit, with more parameters to optimise.

    \n", "signature": "(self, w, r, yoff, width, loc, a):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.objective_pso", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.objective_pso", "kind": "function", "doc": "

    Objective function for particle swarm optimisation (PSO) fitting

    \n\n

    The objective function used to fit supplied data. Evaluates sum of squared differences between the fit and the data.

    \n\n
    Parameters
    \n\n
      \n
    • x (list of floats):\nParameter vector.
    • \n
    • w (ndarray):\nArray of frequency data.
    • \n
    • u (ndarray):\nArray of data to be fit.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • rmse (float):\nRoot mean square error between the data and fit.
    • \n
    \n\n
    References
    \n\n
      \n
    1. https://github.com/pnnl/nmrfit
    2. \n
    \n", "signature": "(self, x, w, u):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.minimize_pso", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.minimize_pso", "kind": "function", "doc": "

    Minimization function for particle swarm optimisation (PSO) fitting

    \n\n

    Minimizes the objective function using the particle swarm optimization algorithm.\nMinimization function based on defined parameters

    \n\n
    Parameters
    \n\n
      \n
    • lower (list of floats):\nLower bounds for the parameters.
    • \n
    • upper (list of floats):\nUpper bounds for the parameters.
    • \n
    • w (ndarray):\nArray of frequency data.
    • \n
    • u (ndarray):\nArray of data to be fit.
    • \n
    \n\n
    Notes
    \n\n

    Particle swarm optimisation (PSO) fitting function can be significantly more computationally expensive than lmfit, with more parameters to optimise.\nCurrent parameters take ~2 seconds per peak.

    \n\n
    References
    \n\n
      \n
    1. https://github.com/pnnl/nmrfit
    2. \n
    \n", "signature": "(self, lower, upper, w, u):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.fit_peak_pso", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.fit_peak_pso", "kind": "function", "doc": "

    Lineshape analysis on a peak using particle swarm optimisation (PSO) fitting

    \n\n

    Function to fit a Voigt peakshape using particle swarm optimisation (PSO).\nShould return better results than lmfit, but much more computationally expensive

    \n\n
    Parameters
    \n\n
      \n
    • mz_extend (int, optional):\nextra points left and right of peak definition to include in fitting. Defaults to 6.
    • \n
    • upsample_multiplier (int, optional):\nfactor to increase x-axis points by for simulation of fitted lineshape function. Defaults to 5.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • xopt (array):\nvariables describing the voigt function.\nG/L ratio, width (fwhm), apex (x-axis), area.\ny-axis offset is fixed at 0
    • \n
    • fopt (float):\nobjective score (rmse)
    • \n
    • psfit (array):\nrecalculated y values based on function and optimised fit
    • \n
    • psfit_hdp (tuple of arrays):\n0 - linspace x-axis upsampled grid\n1 - recalculated y values based on function and upsampled x-axis grid\nDoes not change results, but aids in visualisation of the 'true' voigt lineshape
    • \n
    \n\n
    Notes
    \n\n

    Particle swarm optimisation (PSO) fitting function can be significantly more computationally expensive than lmfit, with more parameters to optimise.

    \n", "signature": "(self, mz_extend: int = 6, upsample_multiplier: int = 5):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.voigt", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.voigt", "kind": "function", "doc": "

    [Legacy] Voigt lineshape analysis function\nLegacy function for voigt lineshape analysis

    \n\n
    Parameters
    \n\n
      \n
    • oversample_multiplier (int):\nfactor to increase x-axis points by for simulation of fitted lineshape function
    • \n
    • delta_rp (float):\ndelta resolving power to add to resolving power
    • \n
    • mz_overlay (int):\nextra points left and right of peak definition to include in fitting
    • \n
    \n\n
    Returns
    \n\n
      \n
    • mz_domain (ndarray):\nx-axis domain for fit
    • \n
    • calc_abundance (ndarray):\ncalculated abundance profile based on voigt function
    • \n
    \n", "signature": "(self, oversample_multiplier=1, delta_rp=0, mz_overlay=1):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.pseudovoigt", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.pseudovoigt", "kind": "function", "doc": "

    [Legacy] pseudovoigt lineshape function

    \n\n

    Legacy function for pseudovoigt lineshape analysis. \nNote - Code may not be functional currently.

    \n\n
    Parameters
    \n\n
      \n
    • oversample_multiplier (int, optional):\nfactor to increase x-axis points by for simulation of fitted lineshape function. Defaults to 1.
    • \n
    • delta_rp (float, optional):\ndelta resolving power to add to resolving power. Defaults to 0.
    • \n
    • mz_overlay (int, optional):\nextra points left and right of peak definition to include in fitting. Defaults to 1.
    • \n
    • fraction (float, optional):\nfraction of gaussian component in pseudovoigt function. Defaults to 0.5.
    • \n
    \n", "signature": "(\tself,\toversample_multiplier=1,\tdelta_rp=0,\tmz_overlay=1,\tfraction=0.5):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.lorentz", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.lorentz", "kind": "function", "doc": "

    [Legacy] Lorentz lineshape analysis function

    \n\n

    Legacy function for lorentz lineshape analysis

    \n\n
    Parameters
    \n\n
      \n
    • oversample_multiplier (int):\nfactor to increase x-axis points by for simulation of fitted lineshape function
    • \n
    • delta_rp (float):\ndelta resolving power to add to resolving power
    • \n
    • mz_overlay (int):\nextra points left and right of peak definition to include in fitting
    • \n
    \n\n
    Returns
    \n\n
      \n
    • mz_domain (ndarray):\nx-axis domain for fit
    • \n
    • calc_abundance (ndarray):\ncalculated abundance profile based on lorentz function
    • \n
    \n", "signature": "(self, oversample_multiplier=1, delta_rp=0, mz_overlay=1):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.gaussian", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.gaussian", "kind": "function", "doc": "

    [Legacy] Gaussian lineshape analysis function\nLegacy gaussian lineshape analysis function

    \n\n
    Parameters
    \n\n
      \n
    • oversample_multiplier (int):\nfactor to increase x-axis points by for simulation of fitted lineshape function
    • \n
    • delta_rp (float):\ndelta resolving power to add to resolving power
    • \n
    • mz_overlay (int):\nextra points left and right of peak definition to include in fitting
    • \n
    \n\n
    Returns
    \n\n
      \n
    • mz_domain (ndarray):\nx-axis domain for fit
    • \n
    • calc_abundance (ndarray):\ncalculated abundance profile based on gaussian function
    • \n
    \n", "signature": "(self, oversample_multiplier=1, delta_rp=0, mz_overlay=1):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.get_mz_domain", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.get_mz_domain", "kind": "function", "doc": "

    [Legacy] function to resample/interpolate datapoints for lineshape analysis

    \n\n

    This code is used for the legacy line fitting functions and not recommended.\nLegacy function to support expanding mz domain for legacy lineshape functions

    \n\n
    Parameters
    \n\n
      \n
    • oversample_multiplier (int):\nfactor to increase x-axis points by for simulation of fitted lineshape function
    • \n
    • mz_overlay (int):\nextra points left and right of peak definition to include in fitting
    • \n
    \n\n
    Returns
    \n\n
      \n
    • mz_domain (ndarray):\nx-axis domain for fit
    • \n
    \n", "signature": "(self, oversample_multiplier, mz_overlay):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.number_possible_assignments", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.number_possible_assignments", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.molecular_formula_lowest_error", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.molecular_formula_lowest_error", "kind": "function", "doc": "

    Return the molecular formula with the smallest absolute mz error

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.molecular_formula_highest_prob_score", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.molecular_formula_highest_prob_score", "kind": "function", "doc": "

    Return the molecular formula with the highest confidence score score

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.molecular_formula_earth_filter", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.molecular_formula_earth_filter", "kind": "function", "doc": "

    Filter molecular formula using the 'Earth' filter

    \n\n

    This function applies the Formularity-esque 'Earth' filter to possible molecular formula assignments.\nEarth Filter:\n O > 0 AND N <= 3 AND P <= 2 AND 3P <= O

    \n\n

    If the lowest_error method is also used, it will return the single formula annotation with the smallest absolute error which also fits the Earth filter. \nOtherwise, it will return all Earth-filter compliant formulas.

    \n\n
    Parameters
    \n\n
      \n
    • lowest_error (bool, optional.):\nReturn only the lowest error formula which also fits the Earth filter. \nIf False, return all Earth-filter compliant formulas. Default is True.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: List of molecular formula objects which fit the Earth filter
    • \n
    \n\n
    References
    \n\n
      \n
    1. Nikola Tolic et al., \"Formularity: Software for Automated Formula Assignment of Natural and Other Organic Matter from Ultrahigh-Resolution Mass Spectra\"\nAnal. Chem. 2017, 89, 23, 12659\u201312665\ndoi: 10.1021/acs.analchem.7b03318
    2. \n
    \n", "signature": "(self, lowest_error=True):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.molecular_formula_water_filter", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.molecular_formula_water_filter", "kind": "function", "doc": "

    Filter molecular formula using the 'Water' filter

    \n\n

    This function applies the Formularity-esque 'Water' filter to possible molecular formula assignments.\nWater Filter:\n O > 0 AND N <= 3 AND S <= 2 AND P <= 2

    \n\n

    If the lowest_error method is also used, it will return the single formula annotation with the smallest absolute error which also fits the Water filter.\nOtherwise, it will return all Water-filter compliant formulas.

    \n\n
    Parameters
    \n\n
      \n
    • lowest_error (bool, optional):\nReturn only the lowest error formula which also fits the Water filter.\nIf False, return all Water-filter compliant formulas. Defaults to 2
    • \n
    \n\n
    Returns
    \n\n

    list\n List of molecular formula objects which fit the Water filter

    \n\n
    References
    \n\n
      \n
    1. Nikola Tolic et al., \"Formularity: Software for Automated Formula Assignment of Natural and Other Organic Matter from Ultrahigh-Resolution Mass Spectra\"\nAnal. Chem. 2017, 89, 23, 12659\u201312665\ndoi: 10.1021/acs.analchem.7b03318
    2. \n
    \n", "signature": "(self, lowest_error=True):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.molecular_formula_air_filter", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.molecular_formula_air_filter", "kind": "function", "doc": "

    Filter molecular formula using the 'Air' filter

    \n\n

    This function applies the Formularity-esque 'Air' filter to possible molecular formula assignments.\nAir Filter:\n O > 0 AND N <= 3 AND S <= 1 AND P = 0 AND 3(S+N) <= O

    \n\n

    If the lowest_error method is also used, it will return the single formula annotation with the smallest absolute error which also fits the Air filter.\nOtherwise, it will return all Air-filter compliant formulas.

    \n\n
    Parameters
    \n\n
      \n
    • lowest_error (bool, optional):\nReturn only the lowest error formula which also fits the Air filter.\nIf False, return all Air-filter compliant formulas. Defaults to True.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • list: List of molecular formula objects which fit the Air filter
    • \n
    \n\n
    References
    \n\n
      \n
    1. Nikola Tolic et al., \"Formularity: Software for Automated Formula Assignment of Natural and Other Organic Matter from Ultrahigh-Resolution Mass Spectra\"\nAnal. Chem. 2017, 89, 23, 12659\u201312665\ndoi: 10.1021/acs.analchem.7b03318
    2. \n
    \n", "signature": "(self, lowest_error=True):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.cia_score_S_P_error", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.cia_score_S_P_error", "kind": "function", "doc": "

    Compound Identification Algorithm SP Error - Assignment Filter

    \n\n

    This function applies the Compound Identification Algorithm (CIA) SP Error filter to possible molecular formula assignments.

    \n\n

    It takes the molecular formula with the lowest S+P count, and returns the formula with the lowest absolute error from this subset.

    \n\n
    Returns
    \n\n
      \n
    • MolecularFormula: A single molecular formula which fits the rules of the CIA SP Error filter
    • \n
    \n\n
    References
    \n\n
      \n
    1. Elizabeth B. Kujawinski and Mark D. Behn, \"Automated Analysis of Electrospray Ionization Fourier Transform Ion Cyclotron Resonance Mass Spectra of Natural Organic Matter\"\nAnal. Chem. 2006, 78, 13, 4363\u20134373\ndoi: 10.1021/ac0600306
    2. \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.ms_peak.calc.MSPeakCalc.MSPeakCalculation.cia_score_N_S_P_error", "modulename": "corems.ms_peak.calc.MSPeakCalc", "qualname": "MSPeakCalculation.cia_score_N_S_P_error", "kind": "function", "doc": "

    Compound Identification Algorithm NSP Error - Assignment Filter

    \n\n

    This function applies the Compound Identification Algorithm (CIA) NSP Error filter to possible molecular formula assignments.

    \n\n

    It takes the molecular formula with the lowest N+S+P count, and returns the formula with the lowest absolute error from this subset.

    \n\n
    Returns
    \n\n
      \n
    • MolecularFormula: A single molecular formula which fits the rules of the CIA NSP Error filter
    • \n
    \n\n
    References
    \n\n
      \n
    1. Elizabeth B. Kujawinski and Mark D. Behn, \"Automated Analysis of Electrospray Ionization Fourier Transform Ion Cyclotron Resonance Mass Spectra of Natural Organic Matter\"\nAnal. Chem. 2006, 78, 13, 4363\u20134373\ndoi: 10.1021/ac0600306
    2. \n
    \n\n
    Raises
    \n\n
      \n
    • Exception: If no molecular formula are associated with mass spectrum peak.
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.ms_peak.factory", "modulename": "corems.ms_peak.factory", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.ms_peak.factory.MSPeakClasses", "modulename": "corems.ms_peak.factory.MSPeakClasses", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.ms_peak.factory.MSPeakClasses.ICRMassPeak", "modulename": "corems.ms_peak.factory.MSPeakClasses", "qualname": "ICRMassPeak", "kind": "class", "doc": "

    A class representing a peak in an ICR mass spectrum.

    \n", "bases": "_MSPeak"}, {"fullname": "corems.ms_peak.factory.MSPeakClasses.ICRMassPeak.__init__", "modulename": "corems.ms_peak.factory.MSPeakClasses", "qualname": "ICRMassPeak.__init__", "kind": "function", "doc": "

    \n", "signature": "(*args, ms_parent=None, exp_freq=None)"}, {"fullname": "corems.ms_peak.factory.MSPeakClasses.ICRMassPeak.resolving_power_calc", "modulename": "corems.ms_peak.factory.MSPeakClasses", "qualname": "ICRMassPeak.resolving_power_calc", "kind": "function", "doc": "

    Calculate the theoretical resolving power of the peak.

    \n\n
    Parameters
    \n\n
      \n
    • T (float):\ntransient time
    • \n
    • B (float):\nMagnetic Filed Strength (Tesla)
    • \n
    \n\n
    Returns
    \n\n
      \n
    • float: Theoretical resolving power of the peak.
    • \n
    \n\n
    References
    \n\n
      \n
    1. Marshall et al. (Mass Spectrom Rev. 1998 Jan-Feb;17(1):1-35.)\nDOI: 10.1002/(SICI)1098-2787(1998)17:1<1::AID-MAS1>3.0.CO;2-K
    2. \n
    \n", "signature": "(self, B, T):", "funcdef": "def"}, {"fullname": "corems.ms_peak.factory.MSPeakClasses.ICRMassPeak.set_calc_resolving_power", "modulename": "corems.ms_peak.factory.MSPeakClasses", "qualname": "ICRMassPeak.set_calc_resolving_power", "kind": "function", "doc": "

    Set the resolving power of the peak to the calculated one.

    \n", "signature": "(self, B: float, T: float):", "funcdef": "def"}, {"fullname": "corems.ms_peak.factory.MSPeakClasses.TOFMassPeak", "modulename": "corems.ms_peak.factory.MSPeakClasses", "qualname": "TOFMassPeak", "kind": "class", "doc": "

    A class representing a peak in a TOF mass spectrum.

    \n", "bases": "_MSPeak"}, {"fullname": "corems.ms_peak.factory.MSPeakClasses.TOFMassPeak.__init__", "modulename": "corems.ms_peak.factory.MSPeakClasses", "qualname": "TOFMassPeak.__init__", "kind": "function", "doc": "

    \n", "signature": "(*args, exp_freq=None)"}, {"fullname": "corems.ms_peak.factory.MSPeakClasses.TOFMassPeak.set_calc_resolving_power", "modulename": "corems.ms_peak.factory.MSPeakClasses", "qualname": "TOFMassPeak.set_calc_resolving_power", "kind": "function", "doc": "

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.ms_peak.factory.MSPeakClasses.OrbiMassPeak", "modulename": "corems.ms_peak.factory.MSPeakClasses", "qualname": "OrbiMassPeak", "kind": "class", "doc": "

    A class representing a peak in an Orbitrap mass spectrum.

    \n", "bases": "_MSPeak"}, {"fullname": "corems.ms_peak.factory.MSPeakClasses.OrbiMassPeak.__init__", "modulename": "corems.ms_peak.factory.MSPeakClasses", "qualname": "OrbiMassPeak.__init__", "kind": "function", "doc": "

    \n", "signature": "(*args, exp_freq=None)"}, {"fullname": "corems.ms_peak.factory.MSPeakClasses.OrbiMassPeak.set_calc_resolving_power", "modulename": "corems.ms_peak.factory.MSPeakClasses", "qualname": "OrbiMassPeak.set_calc_resolving_power", "kind": "function", "doc": "

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.transient", "modulename": "corems.transient", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.transient.calc", "modulename": "corems.transient.calc", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.transient.calc.TransientCalc", "modulename": "corems.transient.calc.TransientCalc", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.transient.calc.TransientCalc.TransientCalculations", "modulename": "corems.transient.calc.TransientCalc", "qualname": "TransientCalculations", "kind": "class", "doc": "

    Transient Calculations

    \n\n
    Parameters
    \n\n
      \n
    • parameters (corems.transient.parameters.TransientParameters):\nThe transient parameters
    • \n
    • bandwidth (float):\nThe bandwidth of the transient (Hz)
    • \n
    • number_data_points (int):\nThe number of data points of the transient
    • \n
    • exc_low_freq (float):\nThe low frequency of the excitation (Hz)
    • \n
    • exc_high_freq (float):\nThe high frequency of the excitation (Hz)
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • parameters (corems.transient.parameters.TransientParameters):\nThe transient parameters
    • \n
    • bandwidth (float):\nThe bandwidth of the transient (Hz)
    • \n
    • number_data_points (int):\nThe number of data points of the transient
    • \n
    • exc_low_freq (float):\nThe low frequency of the excitation (Hz)
    • \n
    • exc_high_freq (float):\nThe high frequency of the excitation (Hz)
    • \n
    \n\n
    Methods
    \n\n
      \n
    • cal_transient_time().\nCalculate the time domain length of the transient
    • \n
    • zero_fill(transient).\nZero fill the transient
    • \n
    • truncation(transient).\nTruncate the transient
    • \n
    • apodization(transient).
      \nApodization of the transient
    • \n
    • calculate_frequency_domain(number_data_points).\nCalculate the frequency domain (axis) of the transient
    • \n
    • cut_freq_domain(freqdomain_X, freqdomain_Y).\nCut the frequency domain of the transient
    • \n
    • phase_and_absorption_mode_ft().\n[Not Functional] Produce a phased absorption mode FT spectrum
    • \n
    • magnitude_mode_ft(transient).\nPerform magnitude mode FT of the transient
    • \n
    • correct_dc_offset().\n[Not Yet Implemented] Correct the DC offset of the transient
    • \n
    \n"}, {"fullname": "corems.transient.calc.TransientCalc.TransientCalculations.cal_transient_time", "modulename": "corems.transient.calc.TransientCalc", "qualname": "TransientCalculations.cal_transient_time", "kind": "function", "doc": "

    Calculate the time domain length of the transient

    \n\n
    Returns
    \n\n
      \n
    • float: The time domain length of the transient (s)
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.transient.calc.TransientCalc.TransientCalculations.zero_fill", "modulename": "corems.transient.calc.TransientCalc", "qualname": "TransientCalculations.zero_fill", "kind": "function", "doc": "

    Zero fill the transient

    \n\n
    Parameters
    \n\n
      \n
    • transient (numpy.ndarray):\nThe transient data points
    • \n
    \n\n
    Returns
    \n\n
      \n
    • numpy.ndarray: The transient data points zerofilled
    • \n
    \n\n
    Notes
    \n\n

    The number of zero fills is defined by the transient parameter number_of_zero_fills.\nThe function first calculate the next power of two of the transient length and zero fills to that length, to take advantage of FFT algorithm.\n If the parameter next_power_of_two is set to False, the function will zero fill to the length of the original transient times the number of zero fills

    \n", "signature": "(self, transient):", "funcdef": "def"}, {"fullname": "corems.transient.calc.TransientCalc.TransientCalculations.truncation", "modulename": "corems.transient.calc.TransientCalc", "qualname": "TransientCalculations.truncation", "kind": "function", "doc": "

    Truncate the transient

    \n\n
    Parameters
    \n\n
      \n
    • transient (numpy.ndarray):\nThe transient data points
    • \n
    \n\n
    Returns
    \n\n
      \n
    • numpy.ndarray: The truncated transient data points
    • \n
    \n\n
    Notes
    \n\n

    The number of truncations is defined by the transient parameter number_of_truncations

    \n", "signature": "(self, transient):", "funcdef": "def"}, {"fullname": "corems.transient.calc.TransientCalc.TransientCalculations.apodization", "modulename": "corems.transient.calc.TransientCalc", "qualname": "TransientCalculations.apodization", "kind": "function", "doc": "

    Apodization of the transient

    \n\n
    Parameters
    \n\n
      \n
    • transient (numpy.ndarray):\nThe transient data points
    • \n
    \n\n
    Returns
    \n\n
      \n
    • numpy.ndarray: The apodized transient data points
    • \n
    \n\n
    Notes
    \n\n

    The apodization method is defined by the transient parameter apodization_method.\nThe following apodization methods are available:\n Hamming,\n Hanning,\n Blackman,\n Full-Sine,\n Half-Sine,\n Kaiser,\n Half-Kaiser.

    \n\n

    For Kaiser and Half-Kaiser, an additional parameter 'beta' is required, set by the transient parameter kaiser_beta.

    \n", "signature": "(self, transient):", "funcdef": "def"}, {"fullname": "corems.transient.calc.TransientCalc.TransientCalculations.calculate_frequency_domain", "modulename": "corems.transient.calc.TransientCalc", "qualname": "TransientCalculations.calculate_frequency_domain", "kind": "function", "doc": "

    Calculate the frequency domain (axis) of the transient

    \n\n
    Parameters
    \n\n
      \n
    • number_data_points (int):\nThe number of data points of the transient
    • \n
    \n\n
    Returns
    \n\n
      \n
    • numpy.ndarray: The frequency domain of the transient (Hz)
    • \n
    \n", "signature": "(self, number_data_points):", "funcdef": "def"}, {"fullname": "corems.transient.calc.TransientCalc.TransientCalculations.cut_freq_domain", "modulename": "corems.transient.calc.TransientCalc", "qualname": "TransientCalculations.cut_freq_domain", "kind": "function", "doc": "

    Cut the frequency domain of the transient

    \n\n
    Parameters
    \n\n
      \n
    • freqdomain_X (numpy.ndarray):\nThe frequency domain of the transient (Hz)
    • \n
    • freqdomain_Y (numpy.ndarray):\nThe frequency domain of the transient (Hz)
    • \n
    \n\n
    Returns
    \n\n
      \n
    • numpy.ndarray: The frequency domain of the transient (Hz)
    • \n
    • numpy.ndarray: The frequency domain of the transient (Hz)
    • \n
    \n", "signature": "(self, freqdomain_X, freqdomain_Y):", "funcdef": "def"}, {"fullname": "corems.transient.calc.TransientCalc.TransientCalculations.phase_and_absorption_mode_ft", "modulename": "corems.transient.calc.TransientCalc", "qualname": "TransientCalculations.phase_and_absorption_mode_ft", "kind": "function", "doc": "

    [Not Functional] Produce a phased absorption mode FT spectrum

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.transient.calc.TransientCalc.TransientCalculations.perform_magniture_mode_ft", "modulename": "corems.transient.calc.TransientCalc", "qualname": "TransientCalculations.perform_magniture_mode_ft", "kind": "function", "doc": "

    Perform magnitude mode FT of the transient

    \n\n

    Parameters

    \n\n

    transient : numpy.ndarray\n The transient data points

    \n\n
    Returns
    \n\n
      \n
    • numpy.ndarray: The frequency domain of the transient (Hz)
    • \n
    • numpy.ndarray: The magnitude of the transient (a.u.)
    • \n
    \n", "signature": "(self, transient):", "funcdef": "def"}, {"fullname": "corems.transient.calc.TransientCalc.TransientCalculations.correct_dc_offset", "modulename": "corems.transient.calc.TransientCalc", "qualname": "TransientCalculations.correct_dc_offset", "kind": "function", "doc": "

    [Not Yet Implemented] Correct the DC offset of the transient

    \n\n

    A simple baseline correction to compensate for a DC offset in the recorded transient.\nNot implemented.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.transient.factory", "modulename": "corems.transient.factory", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.transient.factory.TransientClasses", "modulename": "corems.transient.factory.TransientClasses", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.transient.factory.TransientClasses.Transient", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient", "kind": "class", "doc": "

    The Transient object contains the transient data and the parameters used to process it

    \n\n
    Parameters
    \n\n
      \n
    • data (numpy.ndarray):\nArray with the transient data
    • \n
    • d_params (dict):\nDictionary with the parameters to be set
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • calibration_terms (tuple):\nTuple with the calibration terms (A, B, C)
    • \n
    • bandwidth (float):\nThe bandwidth of the transient (Hz)
    • \n
    • number_data_points (int):\nThe number of data points of the transient
    • \n
    • polarity (int):\nThe polarity of the transient
    • \n
    • transient_time (float):\nThe time domain length of the transient
    • \n
    • d_params (dict):\nDictionary with the parameters to be set
    • \n
    • frequency_domain (numpy.ndarray):\nArray with the frequency domain
    • \n
    • magnitude (numpy.ndarray):\nArray with the magnitude
    • \n
    • _full_filename_path (str):\nThe full path of the transient file
    • \n
    • _exc_high_freq (float):\nThe high frequency of the excitation (Hz)
    • \n
    • _exc_low_freq (float):\nThe low frequency of the excitation (Hz)
    • \n
    • _parameters (corems.transient.parameters.TransientParameters):\nThe transient parameters
    • \n
    • _transient_data (numpy.ndarray):\nArray with the transient data
    • \n
    \n\n
    Methods
    \n\n
      \n
    • get_frequency_domain(plot_result=True).\nGet the frequency domain and magnitude from the transient data
    • \n
    • get_mass_spectrum(auto_process=True, plot_result=True, keep_profile=True).
      \nGet the mass spectrum from the transient data
    • \n
    • set_processing_parameter(apodization_method, number_of_truncations, number_of_zero_fills).
      \nSet the processing parameters
    • \n
    • scale_plot_size(factor=1.5).\nScale the plot size by a factor
    • \n
    • plot_transient(ax=None, c='k').\nPlot the transient data
    • \n
    • plot_zerofilled_transient(ax=None, c='k').\nPlot the transient data with zero fill
    • \n
    • plot_apodized_transient(ax=None, c='k').\nPlot the transient data with apodization
    • \n
    • plot_frequency_domain(ax=None, c='k').\nPlot the frequency domain and magnitude
    • \n
    • set_parameter_from_toml(parameters_path).\nSet the processing parameters from a toml file
    • \n
    • set_parameter_from_json(parameters_path).\nSet the processing parameters from a json file
    • \n
    \n", "bases": "corems.transient.calc.TransientCalc.TransientCalculations"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.__init__", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.__init__", "kind": "function", "doc": "

    \n", "signature": "(data, d_params)"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.d_params", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.d_params", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.frequency_domain", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.frequency_domain", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.magnitude", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.magnitude", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.scale_plot_size", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.scale_plot_size", "kind": "function", "doc": "

    Scale the plot size by a factor

    \n\n
    Parameters
    \n\n
      \n
    • factor (float, optional):\nThe factor to scale the plot size, by default 1.5
    • \n
    \n", "signature": "(self, factor=1.5):", "funcdef": "def"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.set_processing_parameter", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.set_processing_parameter", "kind": "function", "doc": "

    Set the processing parameters

    \n\n
    Parameters
    \n\n
      \n
    • apodization_method (str):\nApodization method to be used
    • \n
    • number_of_truncations (int):\nNumber of truncations to be used
    • \n
    • number_of_zero_fills (int):\nNumber of zero fills to be used
    • \n
    \n", "signature": "(\tself,\tapodization_method: str,\tnumber_of_truncations: int,\tnumber_of_zero_fills: int):", "funcdef": "def"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.parameters", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.parameters", "kind": "variable", "doc": "

    The transient parameters

    \n"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.set_parameter_from_toml", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.set_parameter_from_toml", "kind": "function", "doc": "

    Set the processing parameters from a toml file

    \n", "signature": "(self, parameters_path):", "funcdef": "def"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.set_parameter_from_json", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.set_parameter_from_json", "kind": "function", "doc": "

    Set the processing parameters from a json file

    \n", "signature": "(self, parameters_path):", "funcdef": "def"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.get_frequency_domain", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.get_frequency_domain", "kind": "function", "doc": "

    Get the frequency domain and magnitude from the transient data

    \n\n
    Parameters
    \n\n
      \n
    • plot_result (bool, optional):\nPlot the frequency domain and magnitude, by default True
    • \n
    \n\n
    Returns
    \n\n
      \n
    • frequency_domain (numpy.ndarray):\nArray with the frequency domain
    • \n
    • magnitude (numpy.ndarray):\nArray with the magnitude
    • \n
    \n", "signature": "(self, plot_result=True):", "funcdef": "def"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.get_mass_spectrum", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.get_mass_spectrum", "kind": "function", "doc": "

    Get the mass spectrum from the transient data

    \n\n
    Parameters
    \n\n
      \n
    • auto_process (bool, optional):\nProcess the transient data, by default True
    • \n
    • plot_result (bool, optional):\nPlot the frequency domain and magnitude, by default True
    • \n
    • keep_profile (bool, optional):\nKeep the profile data, by default True
    • \n
    \n\n
    Returns
    \n\n
      \n
    • MassSpecfromFreq: Mass spectrum object
    • \n
    \n", "signature": "(\tself,\tauto_process: bool = True,\tplot_result: bool = True,\tkeep_profile: bool = True) -> corems.mass_spectrum.factory.MassSpectrumClasses.MassSpecfromFreq:", "funcdef": "def"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.filename", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.filename", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.dir_location", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.dir_location", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.A_therm", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.A_therm", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.B_therm", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.B_therm", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.C_therm", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.C_therm", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.plot_transient", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.plot_transient", "kind": "function", "doc": "

    Plot the transient data

    \n\n
    Parameters
    \n\n
      \n
    • ax (matplotlib.axes, optional):\nMatplotlib axes object, by default None
    • \n
    • c (str, optional):\nColor, by default 'k'
    • \n
    \n\n
    Returns
    \n\n
      \n
    • matplotlib.axes: Matplotlib axes object
    • \n
    \n", "signature": "(self, ax=None, c='k'):", "funcdef": "def"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.plot_zerofilled_transient", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.plot_zerofilled_transient", "kind": "function", "doc": "

    Plot the transient data with zero fill

    \n\n
    Parameters
    \n\n
      \n
    • ax (matplotlib.axes, optional):\nMatplotlib axes object, by default None
    • \n
    • c (str, optional):\nColor, by default 'k'
    • \n
    \n\n
    Returns
    \n\n
      \n
    • matplotlib.axes: Matplotlib axes object
    • \n
    \n", "signature": "(self, ax=None, c='k'):", "funcdef": "def"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.plot_apodized_transient", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.plot_apodized_transient", "kind": "function", "doc": "

    Plot the transient data with apodization

    \n\n
    Parameters
    \n\n
      \n
    • ax (matplotlib.axes, optional):\nMatplotlib axes object, by default None
    • \n
    • c (str, optional):\nColor, by default 'k'
    • \n
    \n\n
    Returns
    \n\n
      \n
    • matplotlib.axes: Matplotlib axes object
    • \n
    \n", "signature": "(self, ax=None, c='k'):", "funcdef": "def"}, {"fullname": "corems.transient.factory.TransientClasses.Transient.plot_frequency_domain", "modulename": "corems.transient.factory.TransientClasses", "qualname": "Transient.plot_frequency_domain", "kind": "function", "doc": "

    Plot the frequency domain and magnitude

    \n\n
    Parameters
    \n\n
      \n
    • ax (matplotlib.axes, optional):\nMatplotlib axes object, by default None
    • \n
    • c (str, optional):\nColor, by default 'k'
    • \n
    \n\n
    Returns
    \n\n
      \n
    • matplotlib.axes: Matplotlib axes object
    • \n
    \n", "signature": "(self, ax=None, c='k'):", "funcdef": "def"}, {"fullname": "corems.transient.input", "modulename": "corems.transient.input", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.transient.input.brukerSolarix", "modulename": "corems.transient.input.brukerSolarix", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.transient.input.brukerSolarix.ReadBrukerSolarix", "modulename": "corems.transient.input.brukerSolarix", "qualname": "ReadBrukerSolarix", "kind": "class", "doc": "

    A class used to Read a single Transient from Bruker's FT-MS acquisition station (fid, or ser)

    \n\n
    Parameters
    \n\n
      \n
    • d_directory_location (str):\nthe full path of the .d folder
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • d_directory_location (str):\nthe full path of the .d folder
    • \n
    • file_location (str):\nthe full path of the .d folder
    • \n
    • parameter_filename_location (str):\nthe full path of the apexAcquisition.method file
    • \n
    • transient_data_path (str):\nthe full path of the fid or ser file
    • \n
    • scan_attr (str):\nthe full path of the scan.xml file
    • \n
    \n\n
    Methods
    \n\n
      \n
    • get_transient().\nRead the data and settings returning a Transient class
    • \n
    • get_scan_attr().\nRead the scan retention times, TIC values and scan indices.
    • \n
    • locate_file(folder, type_file_name).\nFind the full path of a specific file within the acquisition .d folder or subfolders
    • \n
    • parse_parameters(parameters_filename).\nOpen the given file and retrieve all parameters from apexAcquisition.method
    • \n
    • fix_freq_limits(d_parameters).\nRead and set the correct frequency limits for the spectrum
    • \n
    • get_excite_sweep_range(filename).\nDetermine excitation sweep range from ExciteSweep file
    • \n
    \n"}, {"fullname": "corems.transient.input.brukerSolarix.ReadBrukerSolarix.__init__", "modulename": "corems.transient.input.brukerSolarix", "qualname": "ReadBrukerSolarix.__init__", "kind": "function", "doc": "

    \n", "signature": "(d_directory_location)"}, {"fullname": "corems.transient.input.brukerSolarix.ReadBrukerSolarix.d_directory_location", "modulename": "corems.transient.input.brukerSolarix", "qualname": "ReadBrukerSolarix.d_directory_location", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.transient.input.brukerSolarix.ReadBrukerSolarix.file_location", "modulename": "corems.transient.input.brukerSolarix", "qualname": "ReadBrukerSolarix.file_location", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.transient.input.brukerSolarix.ReadBrukerSolarix.get_scan_attr", "modulename": "corems.transient.input.brukerSolarix", "qualname": "ReadBrukerSolarix.get_scan_attr", "kind": "function", "doc": "

    Function to get the scan retention times, TIC values and scan indices.

    \n\n

    Gets information from scan.xml file in the bruker .d folder.\nNote this file is only present in some .d format - e.g. for imaging mode data, it is not present.

    \n\n
    Returns
    \n\n
      \n
    • dict_scan_rt_tic (dict):\na dictionary with scan number as key and rt and tic as values
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.transient.input.brukerSolarix.ReadBrukerSolarix.get_transient", "modulename": "corems.transient.input.brukerSolarix", "qualname": "ReadBrukerSolarix.get_transient", "kind": "function", "doc": "

    Function to get the transient data and parameters from a Bruker Solarix .d folder.

    \n\n
    Parameters
    \n\n
      \n
    • scan_number (int):\nthe scan number to be read. Default is 1.
    • \n
    \n\n
    Returns
    \n\n
      \n
    • Transient: a transient object
    • \n
    \n", "signature": "(self, scan_number=1):", "funcdef": "def"}, {"fullname": "corems.transient.input.brukerSolarix.ReadBrukerSolarix.fix_freq_limits", "modulename": "corems.transient.input.brukerSolarix", "qualname": "ReadBrukerSolarix.fix_freq_limits", "kind": "function", "doc": "

    Function to read and set the correct frequency limits for the spectrum

    \n\n
    Notes
    \n\n

    This is using the excitation limits from the apexAcquisition.method file,\nwhich may not match the intended detection limits in edge cases. \nIn default acquisitions, excitation and detection are the same. \nBut, they may not be in some cases with selective excitation, custom excite waveforms, or in 2DMS applications.

    \n\n
    Parameters
    \n\n
      \n
    • d_parameters (dict):\na dictionary with the parameters from the apexAcquisition.method file
    • \n
    \n", "signature": "(self, d_parameters):", "funcdef": "def"}, {"fullname": "corems.transient.input.brukerSolarix.ReadBrukerSolarix.get_excite_sweep_range", "modulename": "corems.transient.input.brukerSolarix", "qualname": "ReadBrukerSolarix.get_excite_sweep_range", "kind": "function", "doc": "

    Function to determine excitation sweep range from ExciteSweep file

    \n\n

    This looks at the first and last rows of the ExciteSweep file to determine the excitation frequency range.\nNote that this assumes the excitation sweep was linear and the first and last rows are the lowest and highest frequencies.\nThis is presumably always true, but again may be incorrect for edge cases with custom excitation waveforms.

    \n\n
    Parameters
    \n\n
      \n
    • filename (str):\nthe full path to the ExciteSweep file
    • \n
    \n", "signature": "(filename):", "funcdef": "def"}, {"fullname": "corems.transient.input.brukerSolarix.ReadBrukerSolarix.locate_file", "modulename": "corems.transient.input.brukerSolarix", "qualname": "ReadBrukerSolarix.locate_file", "kind": "function", "doc": "

    Function to locate a file in a folder

    \n\n

    Find the full path of a specific file within the acquisition .d folder or subfolders

    \n\n
    Parameters
    \n\n
      \n
    • folder (str):\nthe full path to the folder
    • \n
    • type_file_name (str):\nthe name of the file to be located\nExpected options: ExciteSweep or apexAcquisition.method
    • \n
    \n\n
    Returns
    \n\n
      \n
    • str: the full path to the file
    • \n
    \n\n
    Notes
    \n\n

    adapted from code from SPIKE library, https://github.com/spike-project/spike

    \n", "signature": "(folder, type_file_name):", "funcdef": "def"}, {"fullname": "corems.transient.input.brukerSolarix.ReadBrukerSolarix.parse_parameters", "modulename": "corems.transient.input.brukerSolarix", "qualname": "ReadBrukerSolarix.parse_parameters", "kind": "function", "doc": "

    Function to parse the parameters from apexAcquisition.method file

    \n\n

    Open the given file and retrieve all parameters from apexAcquisition.method\n None is written when no value for value is found

    \n\n
    structure : <param name = \"AMS_ActiveExclusion\"><value>0</value></param>\n
    \n\n
    Parameters
    \n\n
      \n
    • parameters_filename (str):\nthe full path to the apexAcquisition.method file
    • \n
    \n\n
    Returns
    \n\n
      \n
    • dict: a dictionary with the parameters and values
    • \n
    \n\n
    Notes
    \n\n

    Adapted from code from SPIKE library, https://github.com/spike-project/spike.\nCode may not handle all possible parameters, but should be sufficient for most common use cases

    \n", "signature": "(parameters_filename):", "funcdef": "def"}, {"fullname": "corems.transient.input.midasDatFile", "modulename": "corems.transient.input.midasDatFile", "kind": "module", "doc": "

    \n"}, {"fullname": "corems.transient.input.midasDatFile.ReadMidasDatFile", "modulename": "corems.transient.input.midasDatFile", "qualname": "ReadMidasDatFile", "kind": "class", "doc": "

    [Not Implemented] Reads MIDAS .dat files (binary transient data)

    \n\n

    This class will read .dat binary format transient data, e.g. midas format from Predator or Thermo datastations\nThis code is not yet implemented and is not fully functional.

    \n\n
    Parameters
    \n\n
      \n
    • filename_path (str):\nThe path to the .dat file
    • \n
    \n\n
    Attributes
    \n\n
      \n
    • filename_path (str):\nThe path to the .dat file
    • \n
    • d_params (dict):\nA dictionary with the parameters of the .dat file
    • \n
    • transient_data (numpy.ndarray):\nThe transient data
    • \n
    \n\n
    Methods
    \n\n
      \n
    • read_file().\nReads the .dat file and returns the transient data and the parameters
    • \n
    • get_transient_data(data_file, d_params).\nReads the transient data from the .dat file
    • \n
    • parse_parameter(f).\nParses the parameters from the .dat file
    • \n
    \n\n
    Raises
    \n\n
      \n
    • NotImplementedError: This class is not yet implemented.
    • \n
    \n"}, {"fullname": "corems.transient.input.midasDatFile.ReadMidasDatFile.__init__", "modulename": "corems.transient.input.midasDatFile", "qualname": "ReadMidasDatFile.__init__", "kind": "function", "doc": "

    \n", "signature": "(filename_path)"}, {"fullname": "corems.transient.input.midasDatFile.ReadMidasDatFile.filename_path", "modulename": "corems.transient.input.midasDatFile", "qualname": "ReadMidasDatFile.filename_path", "kind": "variable", "doc": "

    \n"}, {"fullname": "corems.transient.input.midasDatFile.ReadMidasDatFile.read_file", "modulename": "corems.transient.input.midasDatFile", "qualname": "ReadMidasDatFile.read_file", "kind": "function", "doc": "

    Reads the .dat file and returns the transient data and the parameters

    \n\n
    Returns
    \n\n
      \n
    • transient_data (numpy.ndarray):\nThe transient data
    • \n
    • d_params (dict):\nA dictionary with the parameters of the .dat file
    • \n
    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "corems.transient.input.midasDatFile.ReadMidasDatFile.get_transient_data", "modulename": "corems.transient.input.midasDatFile", "qualname": "ReadMidasDatFile.get_transient_data", "kind": "function", "doc": "

    Reads the transient data from the .dat file

    \n\n
    Parameters
    \n\n
      \n
    • data_file (file):\nThe .dat file
    • \n
    • d_params (dict):\nA dictionary with the parameters of the .dat file
    • \n
    \n\n
    Returns
    \n\n
      \n
    • myarray (numpy.ndarray):\nThe transient data
    • \n
    \n", "signature": "(self, data_file, d_params):", "funcdef": "def"}, {"fullname": "corems.transient.input.midasDatFile.ReadMidasDatFile.parse_parameter", "modulename": "corems.transient.input.midasDatFile", "qualname": "ReadMidasDatFile.parse_parameter", "kind": "function", "doc": "

    Parses the parameters from the .dat file

    \n\n
    Parameters
    \n\n
      \n
    • f (file):\nThe .dat file
    • \n
    \n\n
    Returns
    \n\n
      \n
    • output_parameters (dict):\nA dictionary with the parameters of the .dat file
    • \n
    \n", "signature": "(self, f):", "funcdef": "def"}]; // mirrored in build-search-index.js (part 1) // Also split on html tags. this is a cheap heuristic, but good enough. diff --git a/tests/test_molecularFormulaSearch.py b/tests/test_molecularFormulaSearch.py index 406c02d4..d5818001 100644 --- a/tests/test_molecularFormulaSearch.py +++ b/tests/test_molecularFormulaSearch.py @@ -22,11 +22,22 @@ def create_mass_spectrum(): file_location = Path.cwd() / "tests/tests_data/ftms/ESI_NEG_SRFA.d/" bruker_reader = ReadBrukerSolarix(file_location) - + MSParameters.molecular_search.url_database = '' MSParameters.mass_spectrum.noise_threshold_method = 'log' MSParameters.mass_spectrum.noise_threshold_log_nsigma = 10 MSParameters.ms_peak.peak_min_prominence_percent = 1 + MSParameters.molecular_search.min_ppm_error = -5 + MSParameters.molecular_search.max_ppm_error = 5 + MSParameters.molecular_search.mz_error_range = 1 + MSParameters.molecular_search.isProtonated = True + MSParameters.molecular_search.isRadical= False + MSParameters.molecular_search.isAdduct= False + + usedatoms = {'C': (1,100) , 'H': (4,200), 'O': (0,10), 'N': (0,1), 'P': (0,1)} + MSParameters.molecular_search.usedAtoms = usedatoms + MSParameters.molecular_search.usedAtoms = usedatoms + bruker_transient = bruker_reader.get_transient() mass_spectrum_obj = bruker_transient.get_mass_spectrum( @@ -42,52 +53,49 @@ def create_mass_spectrum(): return mass_spectrum_obj def test_run_molecular_formula_search(): + # Test for generating accurate molecular formula from a single mass using the local sql database + mz = [760.58156938877] + abundance = [1] + rp, s2n = [[1],[1]] - #MSParameters.molecular_search.url_database = '' - MSParameters.molecular_search.usedAtoms['F'] = (0,0) - MSParameters.molecular_search.usedAtoms['P'] = (0,0) - MSParameters.molecular_search.usedAtoms['Cl'] = (0,0) - MSParameters.molecular_search.isAdduct = False - MSParameters.molecular_search.isRadical = False - - MSParameters.molecular_search.used_atom_valences['P'] = 0 - MSParameters.molecular_search.used_atom_valences['F'] = 0 - MSParameters.molecular_search.used_atom_valences['Cl'] = 0 - MSParameters.mass_spectrum.noise_threshold_method = 'relative_abundance' - MSParameters.mass_spectrum.noise_threshold_min_relative_abundance = 0.1 + MSParameters.mass_spectrum.noise_threshold_absolute_abundance = 0 - mz = [215.09269] - abundance = [1] - rp, s2n = [1] ,[1] - dataname = 'one peak' - MSParameters.mass_spectrum.noise_threshold_method = 'relative_abundance' - mass_spectrum_obj = ms_from_array_centroid(mz, abundance, rp, s2n, dataname, auto_process=False) + MSParameters.molecular_search.url_database = '' + MSParameters.molecular_search.error_method = 'None' + MSParameters.molecular_search.min_ppm_error = -5 + MSParameters.molecular_search.max_ppm_error = 5 + MSParameters.molecular_search.mz_error_range = 1 + MSParameters.molecular_search.isProtonated = True + MSParameters.molecular_search.isRadical= False + MSParameters.molecular_search.isAdduct= False - SearchMolecularFormulas(mass_spectrum_obj).run_worker_ms_peaks([mass_spectrum_obj[0]]) + usedatoms = {'C': (1,100) , 'H': (4,200), 'O': (0,10), 'N': (0,1)} + MSParameters.molecular_search.usedAtoms = usedatoms + MSParameters.molecular_search.usedAtoms = usedatoms + mass_spectrum_obj = ms_from_array_centroid(mz, abundance, rp, s2n, 'single mf search', polarity=1, auto_process=True) + mass_spectrum_obj.settings.noise_threshold_method = 'relative threshold' + mass_spectrum_obj.molecular_search_settings.use_min_peaks_filter = False + mass_spectrum_obj.molecular_search_settings.use_min_peaks_filter = 10 + mass_spectrum_obj.molecular_search_settings.use_isotopologue_filter = False + SearchMolecularFormulas(mass_spectrum_obj, find_isotopologues=True).run_worker_ms_peaks([mass_spectrum_obj[0]]) ms_peak = mass_spectrum_obj[0] - print(ms_peak.mz_exp) - if ms_peak.is_assigned: - for formula in ms_peak: - print(formula.string_formated, formula.mz_error) + assert ms_peak[0].string == 'C56 H73 N1' + def test_mspeak_search(): mass_spec_obj = create_mass_spectrum() - - print("OK") - mspeak_obj = mass_spec_obj.most_abundant_mspeak - SearchMolecularFormulas(mass_spec_obj).run_worker_ms_peaks([mspeak_obj]) - - print("OK2") if mspeak_obj.is_assigned: - - print(mspeak_obj.molecular_formula_earth_filter().string) - print(mspeak_obj.molecular_formula_water_filter().string) - print(mspeak_obj.molecular_formula_air_filter().string) + if len(mspeak_obj.molecular_formula_earth_filter()) > 0: + print(mspeak_obj.molecular_formula_earth_filter().string) + if len(mspeak_obj.molecular_formula_water_filter()) > 0: + print(mspeak_obj.molecular_formula_water_filter().string) + if len(mspeak_obj.molecular_formula_air_filter()) > 0: + print(mspeak_obj.molecular_formula_air_filter().string) print(mspeak_obj.cia_score_S_P_error().string) print(mspeak_obj.cia_score_N_S_P_error().string) print(mspeak_obj.best_molecular_formula_candidate.string) @@ -161,5 +169,5 @@ def test_priorityAssignment(): #test_priorityAssignment() #() #test_molecular_formula_search_db() - test_run_molecular_formula_search() - #test_mspeak_search() + #test_run_molecular_formula_search() + test_mspeak_search()