Skip to content
Snippets Groups Projects
Commit 6c2f89bb authored by Ruben Vorderman's avatar Ruben Vorderman
Browse files

add task to get contig with most coverage

parent da93300a
No related branches found
No related tags found
2 merge requests!9Changes for virus assembly pipeline,!10Extra tasks required for assembly.
task getContigMostCoverage {
String? preCommand
File bamFile
String? outputFilePath = "output.bam"
command <<<
set -e -o pipefail
${preCommand}
samtools view -hb wgs1.bam $( \
samtools idxstats wgs1.bam \
| grep -ve "^\*" \
| awk '{ print $1"\t"($3/$2)}' \
| sort -rnk2 \
| head -n 1 \
| cut -f1) \
> ${outputFilePath}
samtools index ${outputFilePath}
>>>
parameter_meta {
preCommand: "This command is run before running the samtools command. Can be used to set up environments such as conda."
bamFile: "Must be a sorted BAM file with an index"
outputFilePath: "where the output file is stored"
}
}
\ No newline at end of file
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