Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rtwindow snap fix #895

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion metatlas/plots/dill2plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -865,13 +865,17 @@ def get_similar_compounds(self, use_labels=True):
out = []
cid_mz_ref = cid.mz_references[0].mz
cid_mass = cid.compound[0].mono_isotopic_molecular_weight
cid_inchikey_prefix = cid.compound[0].inchi_key.split('-')[0]
for compound_iter_idx, _ in enumerate(self.data[0]):
cpd_iter_id = self.data[0][compound_iter_idx]['identification']
if len(cpd_iter_id.compound) == 0 or is_remove(ma_data.extract(cpd_iter_id, ["ms1_notes"])):
continue
mass = cpd_iter_id.compound[0].mono_isotopic_molecular_weight
mz_ref = cpd_iter_id.mz_references[0].mz
if (mz_ref-0.005 <= cid_mz_ref <= mz_ref+0.005) or (mass-0.005 <= cid_mass <= mass+0.005):
inchikey_prefix = cpd_iter_id.compound[0].inchi_key.split('-')[0]
if (mz_ref-0.005 <= cid_mz_ref <= mz_ref+0.005) or \
(mass-0.005 <= cid_mass <= mass+0.005) or \
(cid_inchikey_prefix == inchikey_prefix):
out.append({'index': compound_iter_idx,
'label': cpd_iter_id.name if use_labels else cpd_iter_id.compound[0].name,
'rt': self.data.rts[compound_iter_idx],
Expand Down
Loading