Skip to content

Commit

Permalink
Merge branch 'corems2' into 'lipid_dev'
Browse files Browse the repository at this point in the history
Update GC/MS workflow to be CoreMS 3.0 and MetabRef API compatible

See merge request mass-spectrometry/metams!10
  • Loading branch information
kheal committed Dec 16, 2024
2 parents f980552 + 10aaa96 commit 9dd46de
Show file tree
Hide file tree
Showing 10 changed files with 423 additions and 160 deletions.
1 change: 0 additions & 1 deletion .github/workflows/wdl_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,3 @@ jobs:
run: |
# Add the commands to run your MiniWDL workflow
miniwdl run wdl/metaMS_gcms.wdl -i wdl/metams_input_gcms.json --verbose --no-cache --copy-input-files
7 changes: 2 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Python base image
FROM python:3.11.1-bullseye

# Mono: 6.12

RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF \
&& echo "deb http://download.mono-project.com/repo/debian buster/snapshots/6.12 main" > /etc/apt/sources.list.d/mono-official.list \
&& apt-get update \
Expand All @@ -12,17 +12,14 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E03280

# Pythonnet: 3.0.1 (from PyPI)
# Note: pycparser must be installed before pythonnet can be built

RUN pip install pycparser \
&& pip install pythonnet==3.0.1

# Copy MetaMS contents
WORKDIR /metams

COPY metaMS/ /metams/metaMS/
COPY README.md disclaimer.txt Makefile requirements.txt setup.py /metams/
COPY db/ /metams/db/

# Install the MetaMS package in editable mode
RUN pip3 install --editable .


22 changes: 18 additions & 4 deletions configuration/gcms_corems.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
[MolecularSearch]
url_database = "sqlite:////metams/db/pnnl_lowres_gcms_compounds.sqlite"
ri_search_range = 35
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 = [ " [C8] Methyl Caprylate [7.812]", " [C10] Methyl Caprate [10.647]", " [C9] Methyl Pelargonate [9.248]", " [C12] Methyl Laurate [13.250]", " [C14] Methyl Myristate [15.597]", " [C16] Methyl Palmitate [17.723]", " [C18] Methyl Stearate [19.663]", " [C20] Methyl Eicosanoate [21.441]", " [C22] Methyl Docosanoate [23.082]", " [C24] Methyl Linocerate [24.603]", " [C26] Methyl Hexacosanoate [26.023]", " [C28] Methyl Octacosanoate [27.349]", " [C30] Methyl Triacontanoate [28.72]",]
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"
Expand All @@ -17,12 +30,13 @@ implemented_smooth_method = [ "savgol", "hanning", "blackman", "bartlett", "flat
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"
implemented_noise_threshold_methods = [ "auto_relative_abundance", "manual_relative_abundance", "second_derivative",]
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
Expand Down
3 changes: 2 additions & 1 deletion configuration/gcms_metams.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
file_paths = [ "data/raw_data/GCMS_FAMES_01_GCMS-01_20191023.cdf", "data/raw_data/GCMS_FAMES_01_GCMS-01_20191023.cdf"]
calibration_file_path = "data/raw_data/GCMS_FAMES_01_GCMS-01_20191023.cdf"
corems_toml_path = "configuration/corems.toml"
corems_toml_path = "configuration/gcms_corems.toml"
nmdc_metadata_path = "configuration/nmdc_metadata.json"
output_directory = "output"
output_filename = "output"
output_type = "csv"
metabref_token_path = "configuration/metabref.token"
6 changes: 4 additions & 2 deletions metaMS/cli.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
from multiprocessing import Pool
from pathlib import Path

import click
import toml

from corems.encapsulation.output.parameter_to_json import dump_gcms_settings_toml

from metaMS.gcmsWorkflow import (
Expand All @@ -12,6 +10,7 @@
run_gcms_metabolomics_workflow_wdl,
run_nmdc_metabolomics_workflow,
)

from metaMS.lcms_lipidomics_workflow import (
LipidomicsWorkflowParameters,
run_lcms_lipidomics_workflow,
Expand All @@ -32,6 +31,7 @@ def cli():
@click.argument("output_type", required=True, type=str)
@click.argument("corems_toml_path", required=True, type=str)
@click.argument("nmdc_metadata_path", required=True, type=str)
@click.argument("metabref_token_path", required=True, type=str)
@click.option("--jobs", "-j", default=4, help="'cpu's'")
def run_gcms_wdl_workflow(
file_paths,
Expand All @@ -41,6 +41,7 @@ def run_gcms_wdl_workflow(
output_type,
corems_toml_path,
nmdc_metadata_path,
metabref_token_path,
jobs,
):
"""Run the GCMS workflow\n
Expand All @@ -57,6 +58,7 @@ def run_gcms_wdl_workflow(
output_filename,
output_type,
corems_toml_path,
metabref_token_path,
jobs,
)

Expand Down
Loading

0 comments on commit 9dd46de

Please sign in to comment.