glasgowcompbio / vimms

A programmable and modular LC/MS simulator in Python
MIT License
19 stars 6 forks source link

Adduct and isotope prior of KnownChemicals #193

Closed joewandy closed 2 years ago

joewandy commented 4 years ago

Refer to https://github.com/sdrogers/vimms/blob/master/vimms/Chemicals.py#L160-L170

    def __init__(self, formula, isotopes, adducts, rt, max_intensity, chromatogram, children=None,
                 include_adducts_isotopes=True, total_proportion=0.99, database_accession=None):
        self.formula = formula
        self.mz_diff = isotopes.mz_diff
        if include_adducts_isotopes is True:
            self.isotopes = isotopes.get_isotopes(total_proportion)
            self.adducts = adducts.get_adducts()
        else:
            mz = isotopes.get_isotopes(total_proportion)[0][0]
            self.isotopes = [(mz, 1, "Mono")]
            self.adducts = {POSITIVE: [("M+H", 1)], NEGATIVE: [("M-H", 1)]}

Proposed fix:

joewandy commented 4 years ago

PS. ChemicalMixtureCreator also has the include_adducts_isotopes flag when sampling for chemicals, with the same behaviour as above.

https://github.com/sdrogers/vimms/blob/master/vimms/Chemicals.py#L693

joewandy commented 2 years ago

Seems like this is no longer needed?