File: resfinder_asm.nf

package info (click to toggle)
resfinder 4.4.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,240 kB
  • sloc: python: 5,726; sh: 121; makefile: 18
file content (52 lines) | stat: -rw-r--r-- 1,180 bytes parent folder | download | duplicates (3)
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
}
*/