Skip to content

Commit 8fafdbc

Browse files
committed
REadd pmdtools view - required apparently
1 parent eeec5d4 commit 8fafdbc

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

main.nf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2035,15 +2035,15 @@ process pmdtools {
20352035
def size = params.large_ref ? '-c' : ''
20362036
def platypus = params.pmdtools_platypus ? '--platypus' : ''
20372037
"""
2038+
## Note all `samtools view` steps ARE required for some reason
20382039
#Run Filtering step
2039-
samtools calmd -b ${bam} ${fasta} | pmdtools --threshold ${params.pmdtools_threshold} ${treatment} ${snpcap} --header | samtools view -@ ${task.cpus - 2} -Sb - > "${libraryid}".pmd.bam
2040+
samtools calmd -b ${bam} ${fasta} | samtools view -h - | pmdtools --threshold ${params.pmdtools_threshold} ${treatment} ${snpcap} --header | samtools view -Sb - > "${libraryid}".pmd.bam
20402041
20412042
#Run Calc Range step
20422043
## To allow early shut off of pipe: https://github.com/nextflow-io/nextflow/issues/1564
20432044
trap 'if [[ \$? == 141 ]]; then echo "Shutting samtools early due to -n parameter" && samtools index ${libraryid}.pmd.bam ${size}; exit 0; fi' EXIT
2044-
samtools calmd -b ${bam} ${fasta} | pmdtools --deamination ${platypus} --range ${params.pmdtools_range} ${treatment} ${snpcap} -n ${params.pmdtools_max_reads} > "${libraryid}".cpg.range."${params.pmdtools_range}".txt
2045+
samtools calmd -b ${bam} ${fasta} | samtools view -h - | pmdtools --deamination ${platypus} --range ${params.pmdtools_range} ${treatment} ${snpcap} -n ${params.pmdtools_max_reads} > "${libraryid}".cpg.range."${params.pmdtools_range}".txt
20452046
2046-
echo "Running indexing"
20472047
samtools index ${libraryid}.pmd.bam ${size}
20482048
"""
20492049
}

0 commit comments

Comments
 (0)