Skip to content

Commit

Permalink
add gpu option
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyliu1326 committed May 17, 2022
1 parent 6107275 commit 78cd86f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
3 changes: 3 additions & 0 deletions conf/conda.config
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,7 @@ process {
withName:medaka {
conda = "${baseDir}/conda/medaka.yml"
}
withName:medaka_gpu {
conda = "${baseDir}/conda/medaka.yml"
}
}
6 changes: 5 additions & 1 deletion conf/docker.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
process {
withName:medaka_gpu {
container = 'ontresearch/medaka:v1.6.0'
containerOptions = '--gpus 0'
}
withName:medaka {
container = 'staphb/medaka'
container = 'nanozoo/medaka:1.6.0--9469527'
}
withName:nanoq {
container = 'jimmyliu1326/nanoq'
Expand Down
4 changes: 4 additions & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ params {
input = null
outdir = null
help = null
notrim = null
host = null
reference = null
gpu = null
}

process {
Expand Down
18 changes: 14 additions & 4 deletions tCANS.nf
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,17 @@ def helpMessage() {
log.info """
Usage: nextflow run jimmyliu1326/tCANS --input samples.csv --outdir /path/to/output
Required arguments:
--input Path to .csv containing two columns describing Sample ID and path to raw reads directory
--input Path to .csv containing two columns describing Sample ID and path to
raw reads directory
--primers Path to .bed encoding the position of each primer
--reference Path to .fasta reference sequence that corresponds to the coordinates in the primers .bed file
--reference Path to .fasta reference sequence that corresponds to the coordinates
in the primers .bed file
--outdir Output directory path
Optional arguments:
--host Path to host reference genome in FASTA format for dehosting raw reads
--gpu Accelerate specific processes that utilize GPU computing. Must have
NVIDIA Container Toolkit installed to enable GPU computing, otherwise
use CPU. (Only works with -profile docker)
--notrim Disable adapter trimming by Porechop
--help Print pipeline usage statement
""".stripIndent()
Expand Down Expand Up @@ -49,7 +54,7 @@ log.info """\
include { combine; nanoq; porechop } from './modules/nanopore-base.nf'
include { minimap2; minimap2 as minimap2_dehost } from './modules/nanopore-align.nf'
include { dehost } from './modules/dehost.nf'
include { medaka } from './modules/nanopore-polish.nf'
include { medaka; medaka_gpu } from './modules/nanopore-polish.nf'
include { ivar_consensus; ivar_trim; bam2fq; clipbam; ampliconclip } from './modules/ivar.nf'

// define workflow
Expand Down Expand Up @@ -88,5 +93,10 @@ workflow {
ivar_consensus(ivar_trim.out)

// consensus polishing
medaka(bam2fq.out, ivar_consensus.out)
if ( params.gpu ) {
medaka_gpu(ivar_consensus.out.join(bam2fq.out))
} else {
medaka(ivar_consensus.out.join(bam2fq.out))
}

}

0 comments on commit 78cd86f

Please sign in to comment.