File: resfinder.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 (51 lines) | stat: -rw-r--r-- 1,135 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
#!/usr/bin/env nextflow

python3 = "python3"
resfinder = "/home/projects/cge/apps/resfinder/resfinder/run_resfinder.py"

params.indir = './'
params.ext = '.fq.gz'
params.outdir = '.'
params.species = 'other'

println("Search pattern: $params.indir*{1,2}$params.ext")

Channel
    .fromFilePairs("$params.indir*{1,2}$params.ext", followLinks: true)
    .set{ infile_ch }

process resfinder{

    cpus 5
    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 -ifq $datasetFile -o '$params.outdir/$sampleID' -s '$params.species'
    else
        $python3 $resfinder -acq -ifq $datasetFile -o '$params.outdir/$sampleID' -s '$params.species' --point
    fi
    """
}

/*
result.subscribe {
    println it
}
*/