Skip to content

Commit 5687aa5

Browse files
committed
updates
1 parent 0669782 commit 5687aa5

File tree

6 files changed

+22
-95
lines changed

6 files changed

+22
-95
lines changed

Makefile

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
run:
22
nextflow run ./nf_workflow.nf -resume -c nextflow.config
33

4-
run_importer_workflow:
5-
nextflow run ./nf_workflow_importer.nf -resume -c nextflow.config
6-
7-
run_slurm:
8-
nextflow run ./nf_workflow.nf -resume -c nextflow_slurm.config
9-
10-
run_docker:
11-
nextflow run ./nf_workflow.nf -resume -with-docker <CONTAINER NAME>
12-
134
init_modules:
145
git submodule update --init --recursive

bin/NextflowModules

data/get_data.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
wget https://external.gnps2.org/gnpslibrary/GNPS-EMBL-MCF.mgf

nf_workflow.nf

Lines changed: 7 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
nextflow.enable.dsl=2
33

44
//
5-
params.input_spectra = "$baseDir/data/"
5+
params.input_libraries = "$baseDir/data/"
66

77
//This publish dir is mostly useful when we want to import modules in other workflows, keep it here usually don't change it
88
params.publishdir = "$launchDir"
@@ -29,70 +29,11 @@ _publishdir = "${_publishdir}/nf_output"
2929
// the publishdir is a key word that we're using around all our modules to control where the output files will be saved
3030
include {summaryLibrary} from "$MODULES_FOLDER/nf_library_search_modules.nf" addParams(publishdir: _publishdir)
3131

32-
process processDataPython {
33-
/* This is a sample process that runs a python script.
34-
35-
For each process, you can specify the publishDir, which is the directory where the output files will be saved.
36-
You can also specify the conda environment that will be used to run the process.
37-
The input and output blocks define the input and output files for the process.
38-
The script block contains the command that will be run in the process.
39-
*/
40-
41-
publishDir "$_publishdir", mode: 'copy'
42-
43-
conda "$TOOL_FOLDER/conda_env.yml"
44-
45-
input:
46-
file input
47-
48-
output:
49-
file 'python_output.tsv'
50-
51-
script:
52-
"""
53-
python $TOOL_FOLDER/python_script.py --input_filename $input --output_filename python_output.tsv
54-
"""
55-
}
56-
57-
workflow Main{
58-
// ------- -------
59-
/*
60-
For each named workflow, add 'take' and 'main' blocks.
61-
62-
--take--
63-
For the take block, you can specify the input parameters that will be passed to the workflow.
64-
Another option instead of passing all the values, is to use a map, which is a dictionary of key-value pairs.
65-
66-
--main--
67-
The main block is where the workflow is defined. You can call other processes and workflows from here.
68-
69-
--emit--
70-
This is an optional block and if you are new to nextflow you can ignore it.
71-
This is can be useful in future generations of nextflow, replacing the need for the 'publishDir' directive.
72-
*/
73-
74-
take:
75-
input_map
76-
77-
main:
78-
libraries_ch = Channel.fromPath(input_map.input_spectra + "/*.mgf" )
79-
// summaryLibrary(libraries_ch)
80-
library_summary_ch = summaryLibrary(libraries_ch)
81-
processDataPython(library_summary_ch)
82-
83-
emit:
84-
library_summary_ch // doesn't need .out as it is already the output of summaryLibrary, assigned to library_summary_ch
85-
py_out = processDataPython.out
86-
}
87-
8832
workflow {
89-
/*
90-
The input map is created to reduce the dependency of the other workflows to the `params`
91-
*/
92-
input_map = [
93-
input_spectra: params.input_spectra
94-
]
95-
out = Main(input_map)
96-
out[0].view() // library_summary_ch
97-
out.py_out.view()
33+
libraries_ch = Channel.fromPath(params.input_libraries + "/*.mgf")
34+
// Get the first one
35+
library_summary_ch = summaryLibrary(libraries_ch.first())
36+
37+
// merge summary files as tsv
38+
library_summary_ch.collectFile(name: 'librarysummary.tsv', keepHeader: true, storeDir: _publishdir + "/librarysummary")
9839
}

workflowdisplay.yaml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
1-
name: template_nextflow_workflow
2-
displayname: STUFF
1+
name: LibrarySummary_workflow
2+
displayname: LibrarySummary_workflow
33
Views:
44
- name: Summary List
55
displayname: Summary List
66
viewname: summarylist
77
displaytype: datatable
88
parameters:
9-
filename: nf_output/python_output.tsv
9+
filename: nf_output/librarysummary/librarysummary.tsv
1010
columns:
11-
- title: "View LCMS"
12-
data: filename
13-
- title: "filename"
14-
data: filename
15-
- title: "OUTPUT"
16-
data: OUTPUT
17-
- title: "OUTPUT2"
18-
data: OUTPUT2
19-
columnDefs: '[ {"targets": 0,"data": null,"render": function ( data, type, row, meta ) {
20-
return `
21-
<a target="_blank" href="/dashboards/lcms?usi=mzspec:GNPS2-${task}:${encodeURIComponent(row["filename"])}">View LCMS - mzspec:GNPS2-${task}:${row["filename"]}</a>
22-
`;}}]'
11+
- title: "spectrum_id"
12+
data: spectrum_id
13+
- title: "compound_name"
14+
data: compound_name
15+
- title: "smiles"
16+
data: smiles
2317

workflowinput.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
workflowname: template_nextflow_workflow
2-
workflowdescription: template_nextflow_workflow
1+
workflowname: LibrarySummary_workflow
2+
workflowdescription: LibrarySummary_workflow
33
workflowlongdescription: This is a template nextflow workflow for GNPS2
44
workflowversion: "2025.06.20"
55
workflowfile: nf_workflow.nf
@@ -12,10 +12,10 @@ parameterlist:
1212

1313
- displayname: Input Data Folder
1414
paramtype: fileselector
15-
nf_paramname: input_spectra
15+
nf_paramname: input_libraries
1616
formplaceholder: Enter the path to data
1717
formvalue: ""
18-
targettaskfolder: input_spectra
18+
targettaskfolder: input_libraries
1919
optional: false
2020
selectsinglefile: false
2121
folderunroll: true

0 commit comments

Comments
 (0)