Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipbear committed Sep 16, 2024
1 parent 9373cfc commit 459b4d2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 3 additions & 1 deletion bin/create_library/merge_df.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import pandas as pd


def merge_compound_feature_tables(compound_df, feature_df, mz_da=0.002, mz_ppm=10):
def merge_compound_feature_tables(compound_df, feature_df, mz_ppm=10):
"""
Merge compound DataFrame with feature table based on m/z values.
"""

mz_da = 200 * mz_ppm / 1e6

# Create empty list to store matches
matches = []

Expand Down
3 changes: 2 additions & 1 deletion bin/create_library/summarize_df.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ def summarize_df(df):
# for INCHI_AUX
isomer_inchi_ls = df.loc[mask, 'inchi_adduct'].unique().tolist()
# remove the current inchi_adduct
isomer_inchi_ls.remove(row['inchi_adduct'])
if row['inchi_adduct'] in isomer_inchi_ls:
isomer_inchi_ls.remove(row['inchi_adduct'])
row['isomer_inchis'] = ';'.join(isomer_inchi_ls)

mask2 = df['SMILES_adduct'] == row['SMILES_adduct']
Expand Down
8 changes: 4 additions & 4 deletions workflowinput.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ workflowname: reverse_metabolomics_create_library_workflow
workflowdescription: This is to create MS/MS libraries for reverse metabolomics.
workflowlongdescription: This is the workflow to create a tsv library from a set of mzML files and compound csv files. The tsv file is ready to be uploaded to GNPS library.
A template for the compound csv file can be found [here](https://docs.google.com/spreadsheets/d/14VoG20s6C8GaoWk1fodWFzg2Ao8p9UuRcvuW7rgiEnA/edit?usp=sharing).
workflowversion: "2024.09.16"
workflowversion: "2024.09.16.2"
workflowfile: nf_workflow.nf
workflowautohide: false
adminonly: false
Expand Down Expand Up @@ -63,9 +63,9 @@ parameterlist:
formvalue: "full"
options:
- value: "simple"
display: "Positive: M+H, M+Na, M+NH4 | Negative: M-H"
display: "Positive: M+H, M+Na, M+NH4 || Negative: M-H"
- value: "full"
display: "Positive: M+H, M+Na, M+NH4, M+K, M+H-H2O, M+H-2H2O, M+H-3H2O | Negative: M-H, M+FA, M+Ac, M+Cl, M+Br, M-H-H2O"
display: "Positive: M+H, M+Na, M+NH4, M+K, M+H-H2O, M+H-2H2O, M+H-3H2O || Negative: M-H, M+FA, M+Ac, M+Cl, M+Br, M-H-H2O"

- displayname: Core Adduct Filter
paramtype: select
Expand All @@ -76,5 +76,5 @@ parameterlist:
display: "True"
- value: "0"
display: "False"
tooltip: "One chemical can have multiple candidate peaks in the LC-MS run. If true, candidate peaks without core adducts will be excluded. Core adducts: M+H, M+NH4, M+H-H2O, M+H-2H2O; M-H"
tooltip: "One chemical can have multiple candidate peaks in the LC-MS run. If true, candidate peaks without core adducts will be excluded. Core adducts: M+H, M+NH4, M+H-H2O, M+H-2H2O || M-H"

0 comments on commit 459b4d2

Please sign in to comment.