Skip to content

Commit

Permalink
feat: functional workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tharwood3 committed May 29, 2024
1 parent 4a26237 commit 208c46d
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 14 deletions.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
*.ipynb_checkpoints*
*.env
*credentials
*credentials
*.log*

# nextflow output dirs
*.nextflow/
*nf_output/
*work/
42 changes: 29 additions & 13 deletions nf_workflow.nf
Original file line number Diff line number Diff line change
@@ -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)
}

0 comments on commit 208c46d

Please sign in to comment.