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
|
#!/usr/bin/env nextflow
python3 = "python3"
resfinder = "/home/projects/cge/apps/resfinder/resfinder/run_resfinder.py"
params.input = './*.fa'
// params.indir = './'
// params.ext = '.fa'
params.outdir = '.'
params.species = 'other'
println("Search pattern: $params.input")
infile_ch = Channel
.fromPath("$params.input", followLinks: true)
.map{ file -> tuple(file.baseName, file) }
process resfinder{
cpus 1
time '30m'
memory '1 GB'
clusterOptions '-V -W group_list=cge -A cge'
executor "PBS"
input:
set sampleID, file(datasetFile) from infile_ch
output:
stdout result
"""
set +u
module unload mgmapper metabat fastqc
module unload ncbi-blast perl
source /home/projects/cge/apps/env/rf4_env/bin/activate
module load perl
module load ncbi-blast/2.8.1+
if [ $params.species = 'other' ]
then
$python3 $resfinder -acq -ifa $datasetFile -o '$params.outdir/$sampleID' -s '$params.species'
else
$python3 $resfinder -acq -ifa $datasetFile -o '$params.outdir/$sampleID' -s '$params.species' --point
fi
"""
}
/*
result.subscribe {
println it
}
*/
|