From 208c46d48b5e6bb835a1266e94c4e96b8efcae95 Mon Sep 17 00:00:00 2001 From: tharwood3 Date: Wed, 29 May 2024 13:53:50 -0700 Subject: [PATCH] feat: functional workflow --- .gitignore | 8 +++++++- nf_workflow.nf | 42 +++++++++++++++++++++++++++++------------- 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index ebc3ff2..e07fc8e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,9 @@ *.ipynb_checkpoints* *.env -*credentials \ No newline at end of file +*credentials +*.log* + +# nextflow output dirs +*.nextflow/ +*nf_output/ +*work/ \ No newline at end of file diff --git a/nf_workflow.nf b/nf_workflow.nf index 3ca33c2..94ce526 100644 --- a/nf_workflow.nf +++ b/nf_workflow.nf @@ -1,31 +1,47 @@ #!/usr/bin/env nextflow nextflow.enable.dsl=2 -params.input_spectra = "README.md" +// Parameters +params.inputfiles1 = "/home/tharwood/repos/test_data/files1/" +params.inputfiles2 = "/home/tharwood/repos/test_data/files2/" -TOOL_FOLDER = "$baseDir/bin" +params.inputfiles1_name = "supern-WAVE-NatCom-NLDM-Day0" +params.inputfiles2_name = "supern-WAVE-NatCom-NLDM-Day7" -process processDataPython { - publishDir "./nf_output", mode: 'copy' +params.exp_name = "wavestab1" - conda "$TOOL_FOLDER/conda_env.yml" +params.publishdir = "$baseDir" +TOOL_FOLDER = "$baseDir/bin/carbon_network/carbon_network/use" + +process analyzeDataWithNetwork { + publishDir "$params.publishdir/nf_output/results", mode: 'copy' + + conda "$TOOL_FOLDER/environment_analysis.yml" input: - file input + path params.inputfiles1 + path params.inputfiles2 output: - file 'python_output.tsv' + path "all_ms1_data.csv" + path "all_ms2_data.csv" + path "OUTPUT_${params.exp_name}_${params.inputfiles1_name}-vs-${params.inputfiles2_name}.csv" + path "AnnotatedCarbonNetwork.graphml" """ - python $TOOL_FOLDER/python_script.py $input python_output.tsv + files1=\$(find $params.inputfiles1 ~+ -type f -name '*.mzML') + files2=\$(find $params.inputfiles2 ~+ -type f -name '*.mzML') + + python $TOOL_FOLDER/analyze_metatlas_data_cli.py \ + --files_group1 \${files1} \ + --files_group2 \${files2} \ + --files_group1_name $params.inputfiles1_name \ + --files_group2_name $params.inputfiles2_name \ + --exp_name $params.exp_name \ """ } workflow { - data_ch = Channel.fromPath(params.input_spectra) - - // Outputting Python - processDataPython(data_ch) - + analyzeDataWithNetwork(params.inputfiles1, params.inputfiles2) }