Skip to content

Commit

Permalink
Merge branch 'rename_gcms_workflow_cli' into 'lipid_dev'
Browse files Browse the repository at this point in the history
Rename gcms workflow cli

See merge request mass-spectrometry/metams!4
  • Loading branch information
kheal committed Sep 24, 2024
2 parents ac2cd43 + 90756b6 commit 19790a6
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/wdl_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
- name: Run MiniWDL
run: |
# Add the commands to run your MiniWDL workflow
miniwdl run wdl/metaMS.wdl -i wdl/metams_input.json --verbose --no-cache --copy-input-files
miniwdl run wdl/metaMS_gcms.wdl -i wdl/metams_input_gcms.json --verbose --no-cache --copy-input-files
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,17 @@ To be able to open chemstation files a installation of pythonnet is needed:
## Execution

```bash
metaMS dump_toml_template metams.toml
metaMS dump-gcms-toml-template gcms_metams.toml
```
```bash
metaMS dump_corems_toml_template corems.toml
metaMS dump-gcms-corems-toml-template gcms_corems.toml
```

Modify the metams.toml and corems.toml accordingly to your dataset and workflow parameters
make sure to include corems.json path inside the metams.toml: "corems_toml_path": "path_to_corems.toml"
Modify the gcms_metams.toml and gcms_corems.toml accordingly to your dataset and workflow parameters
make sure to include gcms_corems.json path inside the gcms_metams.toml: "corems_toml_path": "path_to_corems.toml"

```bash
metaMS run-gcms-workflow path_to_metams.toml
metaMS run-gcms-workflow path_to_gcms_metams.toml
```

## MiniWDL
Expand All @@ -109,9 +109,9 @@ Make sure you have python 3.9.13 installed before continue

MiniWDL uses the microbiome/metaMS image so there is not need to install metaMS

- Change wdl/metams_input.json to specify the data location
- Change wdl/gcms_metams_input.json to specify the data location

- Change data/corems.toml to specify the workflow parameters
- Change data/gcms_corems.toml to specify the workflow parameters

Install miniWDL:
```bash
Expand All @@ -120,7 +120,7 @@ pip3 install miniwdl

Call:
```bash
miniwdl run wdl/metaMS.wdl -i wdl/metams_input.json --verbose --no-cache --copy-input-files
miniwdl run wdl/metaMS_gcms.wdl -i wdl/metams_input_gcms.json --verbose --no-cache --copy-input-files
```
## MetaMS Docker Container

Expand Down
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions metaMS/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,20 @@ def run_gcms_workflow(gcms_workflow_paramaters_file, jobs, nmdc):
else:
run_gcms_metabolomics_workflow(gcms_workflow_paramaters_file, jobs)

@cli.command()
@cli.command(name='dump-gcms-toml-template')
@click.argument('toml_file_name', required=True, type=str)
def dump_toml_template(toml_file_name):
def dump_gcms_toml_template(toml_file_name):
'''Dumps a toml file template
to be used as the workflow parameters input
to be used as the workflow parameters input for the GCMS workflow
'''
ref_lib_path = Path(toml_file_name).with_suffix('.toml')
with open(ref_lib_path, 'w') as workflow_param:

toml.dump(WorkflowParameters().__dict__, workflow_param)

@cli.command()
@cli.command(name='dump-gcms-corems-toml-template')
@click.argument('toml_file_name', required=True, type=str)
def dump_corems_toml_template(toml_file_name):
def dump_gcms_corems_toml_template(toml_file_name):
'''Dumps a CoreMS toml file template
to be used as the workflow parameters input
'''
Expand Down
10 changes: 5 additions & 5 deletions wdl/metaMS.wdl → wdl/metaMS_gcms.wdl
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
version 1.0

workflow gcmsMetabolomics {
call runMetaMS
call runMetaMSGCMS

output {
String out = runMetaMS.out
File output_file = runMetaMS.output_file
File output_metafile = runMetaMS.output_metafile
String out = runMetaMSGCMS.out
File output_file = runMetaMSGCMS.output_file
File output_metafile = runMetaMSGCMS.output_metafile
}
}

task runMetaMS {
task runMetaMSGCMS {
input {
Array[File] file_paths
File calibration_file_path
Expand Down
15 changes: 0 additions & 15 deletions wdl/metams_input.json

This file was deleted.

15 changes: 15 additions & 0 deletions wdl/metams_input_gcms.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"gcmsMetabolomics.runMetaMSGCMS.file_paths": [
"./data/raw_data/GCMS_FAMES_01_GCMS-01_20191023.cdf",
"./data/raw_data/GCMS_FAMES_01_GCMS-01_20191023.cdf"
],

"gcmsMetabolomics.runMetaMSGCMS.calibration_file_path": "./data/raw_data/GCMS_FAMES_01_GCMS-01_20191023.cdf",
"gcmsMetabolomics.runMetaMSGCMS.output_directory": "test_output",
"gcmsMetabolomics.runMetaMSGCMS.output_filename": "test_dataset",
"gcmsMetabolomics.runMetaMSGCMS.output_type": "csv",
"gcmsMetabolomics.runMetaMSGCMS.corems_toml_path": "./configuration/gcms_corems.toml",
"gcmsMetabolomics.runMetaMSGCMS.nmdc_metadata_path": "./configuration/nmdc_metadata.json",
"gcmsMetabolomics.runMetaMSGCMS.jobs_count": 4

}

0 comments on commit 19790a6

Please sign in to comment.