Skip to content
Snippets Groups Projects
Unverified Commit 34bda02c authored by Peter van 't Hof's avatar Peter van 't Hof Committed by GitHub
Browse files

Merge branch 'master' into SASC-741

parents 8ffea620 605c278c
No related branches found
No related tags found
1 merge request!11Changes needed for the iterative assembly pipeline
...@@ -145,10 +145,9 @@ task SampleConfig { ...@@ -145,10 +145,9 @@ task SampleConfig {
} }
output { output {
Array[String] keys = read_lines(stdout()) File keysFile = stdout()
File? jsonOutput = jsonOutputPath File? jsonOutput = jsonOutputPath
File? tsvOutput = tsvOutputPath File? tsvOutput = tsvOutputPath
Object values = if (defined(tsvOutput) && size(tsvOutput) > 0) then read_map(tsvOutput) else { "": "" }
} }
runtime { runtime {
......
# Copyright Sequencing Analysis Support Core - Leiden University Medical Center 2017 # Copyright Sequencing Analysis Support Core - Leiden University Medical Center 2018
# #
# Tasks from centrifuge # Tasks from centrifuge
task build {
File conversionTable
File taxonomyTree
File inputFasta
String centrifugeIndexBase
String? preCommand
String? centrifugeBuildExecutable = "centrifuge-build"
#Boolean? c = false
Boolean? largeIndex = false
Boolean? noAuto = false
Int? bMax
Int? bMaxDivn
Boolean? noDiffCover = false
Boolean? noRef = false
Boolean? justRef = false
Int? offRate
Int? fTabChars
File? nameTable
File? sizeTable
Int? seed
Int? threads
Int? memory
Int? kmerCount
command {
set -e -o pipefail
${preCommand}
${"mkdir -p $(dirname " + centrifugeIndexBase + ")"}
${centrifugeBuildExecutable} \
${true='--large-index' false='' largeIndex} \
${true='--noauto' false='' noAuto} \
${'--bmax ' + bMax} \
${'--bmaxdivn ' + bMaxDivn} \
${true='--nodc' false='' noDiffCover} \
${true='--noref' false='' noRef} \
${true='--justref' false='' justRef} \
${'--offrate ' + offRate} \
${'--ftabchars ' + fTabChars} \
${'--name-table ' + nameTable } \
${'--size-table ' + sizeTable} \
${'--seed ' + seed} \
${'--kmer-count' + kmerCount} \
${'--threads ' + threads} \
--conversion-table ${conversionTable} \
--taxonomy-tree ${taxonomyTree} \
${inputFasta} \
${centrifugeIndexBase}
}
runtime {
cpu: select_first([threads, 8])
memory: select_first([memory, 20])
}
}
task classify {
String outputDir
Boolean? compressOutput = true
String? preCommand
String indexPrefix
File? unpairedReads
File read1
File? read2
Boolean? fastaInput
# Variables for handling output
String outputFileName = outputDir + "/centrifuge.out"
String reportFileName = outputDir + "/centrifuge_report.tsv"
String finalOutputName = if (compressOutput == true) then outputFileName + ".gz" else outputFileName
String? metFileName # If this is specified, the report file is empty
Int? assignments
Int? minHitLen
Int? minTotalLen
Array[String]? hostTaxIds
Array[String]? excludeTaxIds
Int? threads
Int? memory
command {
set -e -o pipefail
mkdir -p ${outputDir}
${preCommand}
centrifuge \
${"-p " + threads} \
${"-x " + indexPrefix} \
${true="-f" false="" fastaInput} \
${true="-k " false="" defined(assignments)} ${assignments} \
${true="-1 " false="-U " defined(read2)} ${read1} \
${"-2 " + read2} \
${"-U " + unpairedReads} \
${"--report-file " + reportFileName} \
${"--min-hitlen " + minHitLen} \
${"--min-totallen " + minTotalLen} \
${"--met-file " + metFileName} \
${true="--host-taxids " false="" defined(hostTaxIds)} ${sep=',' hostTaxIds} \
${true="--exclude-taxids " false="" defined(excludeTaxIds)} ${sep=',' excludeTaxIds} \
${true="| gzip -c >" false="-S" compressOutput} ${finalOutputName}
}
output {
File classifiedReads = finalOutputName
File reportFile = reportFileName
}
runtime {
cpu: select_first([threads, 1])
memory: select_first([memory, 4])
}
}
task download { task download {
String libraryPath String libraryPath
...@@ -62,55 +170,41 @@ task downloadTaxonomy { ...@@ -62,55 +170,41 @@ task downloadTaxonomy {
} }
} }
task build { task kreport {
File conversionTable
File taxonomyTree
File inputFasta
String centrifugeIndexBase
String? preCommand String? preCommand
String? centrifugeBuildExecutable = "centrifuge-build" File centrifugeOut
#Boolean? c = false Boolean inputIsCompressed
Boolean? largeIndex = false String kreportFileName=sub(centrifugeOut, "\\.out$|\\.out\\.gz$", "\\.kreport")
Boolean? noAuto = false String indexPrefix
Int? bMax Boolean? onlyUnique
Int? bMaxDivn Boolean? showZeros
Boolean? noDiffCover = false Boolean? isCountTable
Boolean? noRef = false Int? minScore
Boolean? justRef = false Int? minLength
Int? offRate Int? cores
Int? fTabChars Int? memory
File? nameTable
File? sizeTable
Int? seed
Int? threads = 1
Int? kmerCount
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ${preCommand}
${"mkdir -p $(dirname " + centrifugeIndexBase + ")"} centrifuge-kreport \
${centrifugeBuildExecutable} \ -x ${indexPrefix} \
${true='--large-index' false='' largeIndex} \ ${true="--only-unique" false="" onlyUnique} \
${true='--noauto' false='' noAuto} \ ${true="--show-zeros" false="" showZeros} \
${'--bmax ' + bMax} \ ${true="--is-count-table" false="" isCountTable} \
${'--bmaxdivn ' + bMaxDivn} \ ${"--min-score " + minScore} \
${true='--nodc' false='' noDiffCover} \ ${"--min-length " + minLength} \
${true='--noref' false='' noRef} \ ${true="<(zcat" false="" inputIsCompressed} ${centrifugeOut}\
${true='--justref' false='' justRef} \ ${true=")" false="" inputIsCompressed} \
${'--offrate ' + offRate} \ > ${kreportFileName}
${'--ftabchars ' + fTabChars} \ }
${'--name-table ' + nameTable } \
${'--size-table ' + sizeTable} \ output {
${'--seed ' + seed} \ File kreport = kreportFileName
${'--kmer-count' + kmerCount} \
${'--threads ' + threads} \
--conversion-table ${conversionTable} \
--taxonomy-tree ${taxonomyTree} \
${inputFasta} \
${centrifugeIndexBase}
} }
runtime { runtime {
cpu: select_first([threads]) cpu: select_first([cores, 1])
memory: select_first([memory, 4])
} }
} }
task flash {
String? preCommand
File inputR1
File inputR2
String outdirPath
String? outPrefix = "flash"
Int? minOverlap
Int? maxOverlap
Boolean? compress = true
Int? threads
Int? memory
command {
set -e -o pipefail
mkdir -p ${outdirPath}
${preCommand}
flash \
${"--threads=" + threads} \
${"--output-directory=" + outdirPath} \
${"--output-prefix=" + outPrefix} \
${true="--compress " false="" defined(compress)} \
${"--min-overlap=" + minOverlap} \
${"--max-overlap=" + maxOverlap} \
${inputR1} ${inputR2}
}
output {
File extendedFrags = outdirPath + "/" + outPrefix + ".extendedFrags.fastq.gz"
File notCombined1 = outdirPath + "/" + outPrefix + ".notCombined_1.fastq.gz"
File notCombined2 = outdirPath + "/" + outPrefix + ".notCombined_2.fastq.gz"
File hist = outdirPath + "/" + outPrefix + ".hist"
File histogram = outdirPath + "/" + outPrefix + ".histogram"
}
runtime {
cpu: select_first([threads, 2])
memory: select_first([memory, 2])
}
}
\ No newline at end of file
...@@ -253,6 +253,7 @@ task SplitNCigarReads { ...@@ -253,6 +253,7 @@ task SplitNCigarReads {
String? preCommand String? preCommand
File input_bam File input_bam
File input_bam_index
File ref_fasta File ref_fasta
File ref_fasta_index File ref_fasta_index
File ref_dict File ref_dict
...@@ -271,13 +272,13 @@ task SplitNCigarReads { ...@@ -271,13 +272,13 @@ task SplitNCigarReads {
SplitNCigarReads \ SplitNCigarReads \
-I ${input_bam} \ -I ${input_bam} \
-R ${ref_fasta} \ -R ${ref_fasta} \
-O ${output_bam} # might have to be -o depending on GATK version \ -O ${output_bam} \
-L ${sep=' -L ' intervals} -L ${sep=' -L ' intervals}
} }
output { output {
File bam = output_bam File bam = output_bam
File bam_index = output_bam + ".bai" File bam_index = sub(output_bam, "\\.bam$", ".bai")
} }
runtime { runtime {
......
...@@ -12,6 +12,7 @@ task Star { ...@@ -12,6 +12,7 @@ task Star {
String? outStd String? outStd
String? twopassMode String? twopassMode
Array[String]? outSAMattrRGline Array[String]? outSAMattrRGline
Int? limitBAMsortRAM
Int? memory Int? memory
...@@ -34,6 +35,7 @@ task Star { ...@@ -34,6 +35,7 @@ task Star {
${"--runThreadN " + runThreadN} \ ${"--runThreadN " + runThreadN} \
${"--outStd " + outStd} \ ${"--outStd " + outStd} \
${"--twopassMode " + twopassMode} \ ${"--twopassMode " + twopassMode} \
${"--limitBAMsortRAM " + limitBAMsortRAM} \
${true="--outSAMattrRGline " false="" defined(outSAMattrRGline)} ${sep=" , " outSAMattrRGline} ${true="--outSAMattrRGline " false="" defined(outSAMattrRGline)} ${sep=" , " outSAMattrRGline}
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment