generated from Wang-Bioinformatics-Lab/Nextflow_Workflow_Template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnf_workflow.nf
56 lines (47 loc) · 1.75 KB
/
nf_workflow.nf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env nextflow
nextflow.enable.dsl=2
params.input_mzmls = "/Users/shipei/Documents/projects/reverse_metabolomics/reverse_metabolomics/generate_library/input"
params.input_csvs = "/Users/shipei/Documents/projects/reverse_metabolomics/reverse_metabolomics/generate_library/input"
params.data_collector = "Minions Hello"
params.pi_name = "Pieter Dorrestein"
params.mass_detect_intensity_tolerance = 5e4
params.min_feature_height = 1.5e5
params.mz_tol_ppm = 10
params.ms2_explanation_cutoff = 0.60
params.adduct_type_mode = "simple"
params.core_adduct_filter = "simple"
TOOL_FOLDER = "$baseDir/bin"
process createLibrary {
publishDir "./nf_output", mode: 'copy'
conda "$TOOL_FOLDER/conda_env.yml"
input:
path mzmls
path csvs
output:
path 'all_library.tsv'
path '*.tsv', optional: true
path '*.pdf', optional: true
path '*.png', optional: true
script:
def escapedDataCollector = params.data_collector.replaceAll(/"/, '\\\\"')
def escapedPiName = params.pi_name.replaceAll(/"/, '\\\\"')
"""
python $TOOL_FOLDER/main_batch.py \
--mzml_files ${mzmls} \
--csv_files ${csvs} \
--data_collector "${escapedDataCollector}" \
--pi_name "${escapedPiName}" \
--mass_detect_int_tol ${params.mass_detect_intensity_tolerance} \
--min_feature_height ${params.min_feature_height} \
--mz_tol_ppm ${params.mz_tol_ppm} \
--ms2_explanation_cutoff ${params.ms2_explanation_cutoff} \
--core_adduct_filter "${params.core_adduct_filter}" \
--adduct_type_mode ${params.adduct_type_mode} \
--plot
"""
}
workflow {
mzmls_ch = Channel.fromPath(params.input_mzmls + "/*.mzML")
csvs_ch = Channel.fromPath(params.input_csvs + "/*.csv")
createLibrary(mzmls_ch.collect(), csvs_ch.collect())
}