add nextflow d30e48d
This commit is contained in:
48
nextflow/tests/basic.nf
Normal file
48
nextflow/tests/basic.nf
Normal file
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env nextflow
|
||||
|
||||
/*
|
||||
* Command line input parameter
|
||||
*/
|
||||
params.in = "$baseDir/data/sample.fa"
|
||||
|
||||
|
||||
/*
|
||||
* split a fasta file in multiple files
|
||||
*/
|
||||
process splitSequences {
|
||||
|
||||
input:
|
||||
path 'input.fa'
|
||||
|
||||
output:
|
||||
path 'seq_*'
|
||||
|
||||
script:
|
||||
"""
|
||||
awk '/^>/{f="seq_"++d} {print > f}' < input.fa
|
||||
"""
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Simple reverse the sequences
|
||||
*/
|
||||
process reverse {
|
||||
|
||||
input:
|
||||
path x
|
||||
|
||||
output:
|
||||
stdout
|
||||
|
||||
script:
|
||||
"""
|
||||
cat $x | rev
|
||||
"""
|
||||
}
|
||||
|
||||
|
||||
workflow {
|
||||
splitSequences(params.in) | reverse | view
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user