@@ -115,28 +115,35 @@ Below is the ``main.nf`` file for BAMStats.
115115::
116116
117117 #!/usr/bin/env nextflow
118+ nextflow.enable.dsl=2
118119
119- bamFile = file(params.bam_input)
120+ bamFile = Channel.fromPath(params.bam_input)
121+ mem_gb = params.mem_gb
120122
121123 process bamstats {
122124 input:
123- file bam_input from bamFile
124- val mem_gb from params.mem_gb
125+ path( bam_input)
126+ val mem_gb
125127
126128 output:
127- file 'bamstats_report.zip'
129+ path( 'bamstats_report.zip')
128130
129131 """
130132 bash /usr/local/bin/bamstats $mem_gb $bam_input
131133 """
132134 }
133135
136+ workflow {
137+ bamstats(bamFile, mem_gb)
138+ }
139+
140+
134141First we tell Nextflow that the bam\_ input parameter is a file. We do
135142this outside of the process.
136143
137144::
138145
139- bamFile = file (params.bam_input)
146+ bamFile = Channel.fromPath (params.bam_input)
140147
141148Next we will look at the process scope. It is made of the input, output
142149and command sections.
@@ -148,8 +155,9 @@ parameter mem\_gb.
148155::
149156
150157 input:
151- file bam_input from bamFile
152- val mem_gb from params.mem_gb
158+ path(bam_input)
159+ val mem_gb
160+
153161
154162We then define the output of the process as the file
155163``bamstats_report.zip ``. Note that we do not do anything with this
@@ -160,7 +168,7 @@ that connection. However, this is not within the scope of this tutorial.
160168::
161169
162170 output:
163- file 'bamstats_report.zip'
171+ path( 'bamstats_report.zip')
164172
165173The final section is the command section. This section defines what
166174command is run by the process. We run the bamstats command line tool and
0 commit comments