add nextflow d30e48d
This commit is contained in:
43
nextflow/tests/blast.nf
Normal file
43
nextflow/tests/blast.nf
Normal file
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env nextflow
|
||||
|
||||
params.db = "$baseDir/blast-db/tiny"
|
||||
params.query = "$baseDir/data/sample.fa"
|
||||
params.chunkSize = 1
|
||||
|
||||
process blast {
|
||||
input:
|
||||
path 'seq.fa'
|
||||
val db
|
||||
|
||||
output:
|
||||
path 'out'
|
||||
|
||||
script:
|
||||
"""
|
||||
blastp -db $db -query seq.fa -outfmt 6 > out
|
||||
"""
|
||||
}
|
||||
|
||||
process sort {
|
||||
input:
|
||||
path 'hits_*'
|
||||
|
||||
output:
|
||||
stdout
|
||||
|
||||
script:
|
||||
"""
|
||||
sort hits_*
|
||||
"""
|
||||
}
|
||||
|
||||
|
||||
workflow {
|
||||
ch_fasta = channel.fromPath(params.query)
|
||||
| splitFasta( by: params.chunkSize, file:true )
|
||||
|
||||
blast(ch_fasta, params.db)
|
||||
| collect
|
||||
| sort
|
||||
| subscribe { hits -> println hits }
|
||||
}
|
||||
Reference in New Issue
Block a user