Skip to content

Commit

Permalink
Update lipid workflow module and params for cli
Browse files Browse the repository at this point in the history
  • Loading branch information
kheal committed Nov 13, 2024
1 parent 41b0ab3 commit 48c43fe
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM corilo/corems:base-mono-pythonnet
FROM jcarr87/corems-base-py3.10
WORKDIR /metams

COPY metaMS/ /metams/metaMS/
Expand Down
4 changes: 3 additions & 1 deletion configuration/lipidomics_metams.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
directory = "data/raw_data/lipid_data"
output_directory = "output"
corems_toml_path = "configuration/lipidomics_corems.toml"
corems_toml_path = "configuration/emsl_lipidomics_corems_params.toml"
metabref_token_path = "metabref.token"
scan_translator_path = "configuration/emsl_lipidomics_scan_translator.toml"
cores = 1
8 changes: 7 additions & 1 deletion metaMS/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,16 @@ def dump_lipidomics_corems_toml_template(toml_file_name):
type=str,
help="The directory where the output files will be stored",
)
@click.option(
"-t", "--token_path", required=False, type=str, help="The path to the metabref token"
)
@click.option(
"-s", "--scan_translator_path", required=False, type=str, help="The path to the scan translator file"
)
@click.option(
"-j", "--cores", required=False, type=int, help="'cpu's to use for processing"
)
def run_lipidomics_workflow(paramaters_file, directory, output_directory, cores):
def run_lipidomics_workflow(paramaters_file, directory, output_directory, token_path, scan_translator_path, cores):
"""Run the lipidomics workflow
Parameters
Expand Down
22 changes: 21 additions & 1 deletion metaMS/lcms_lipidomics_workflow.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from dataclasses import dataclass
import toml
from pathlib import Path


@dataclass
Expand All @@ -15,14 +16,21 @@ class LipidomicsWorkflowParameters:
The directory where the output files will be stored
corems_toml_path : str
The path to the corems configuration file
metabref_token_path : str
The path to the metabref token file
See https://metabref.emsl.pnnl.gov/api for more information for how to get a token
scan_translator_path : str
The path to the scan translator file, optional
cores : int
The number of cores to use for processing
The number of cores to use for processing, optional
"""

directory: str = "data/..."
output_directory: str = "output/..."
corems_toml_path: str = "configuration/lipidomics_corems.toml"
metabref_token_path: str = None
scan_translator_path: str = None
cores: int = 1


Expand All @@ -31,6 +39,8 @@ def run_lcms_lipidomics_workflow(
directory=None,
output_directory=None,
corems_toml_path=None,
metabref_token_path=None,
scan_translator_path=None,
cores=None,
):
if lipidomics_workflow_paramaters_file is not None:
Expand All @@ -41,8 +51,18 @@ def run_lcms_lipidomics_workflow(
lipid_workflow_params = LipidomicsWorkflowParameters(
directory=directory,
output_directory=output_directory,
metabref_token_path=metabref_token_path,
scan_translator_path=scan_translator_path,
corems_toml_path=corems_toml_path,
cores=cores,
)

# Make output dir and get list of files to process
out_dir = Path(lipid_workflow_params.output_directory)
out_dir.mkdir(parents=True, exist_ok=True)

file_dir = Path(lipid_workflow_params.directory)
files_list = list(file_dir.glob("*.raw"))
out_paths_list = [out_dir / f.stem for f in files_list]

# TODO KRH: Add full lipidomics workflow here
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
corems>=1.5.0
corems>=3.0.0
Click>=7.1.1
requests
nmdc-schema>=7.0.0
Expand Down
6 changes: 4 additions & 2 deletions wdl/metaMS_lipidomics.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ task runLipidomicsMetaMS {
}

runtime {
docker: "microbiomedata/metams:2.2.2"
docker: "local-metams:latest"
#TODO KRH: Change to dockerhub version after we've pushed the updated image
}
}
}

2 changes: 1 addition & 1 deletion wdl/metams_input_lipidomics.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"lcmsLipidomics.runLipidomicsMetaMS.config_file": "configuration/lipidomics_metams.toml"
"lcmsLipidomics.runLipidomicsMetaMS.config_file": "lipidomics_metams.toml"
}

0 comments on commit 48c43fe

Please sign in to comment.