Skip to content
Snippets Groups Projects
Commit 04d7650b authored by Brandi Cantarel's avatar Brandi Cantarel
Browse files

update bedtools genomecov to reduce memory usage

parent be6af462
Branches
Tags
No related merge requests found
......@@ -79,7 +79,8 @@ fi
if [[ $nuctype == 'dna' ]]
then
bedtools coverage -a ${bed} -b ${sbam} -hist > ${pair_id}.covhist.txt
bedtools sort -faidx $index_path/genome.fa.fai -i ${bed} > panel.sorted.bed
bedtools coverage -sorted -g ${index_path}/genomefile.txt -a panel.sorted.bed -b ${sbam} -hist > ${pair_id}.covhist.txt
grep ^all ${pair_id}.covhist.txt > ${pair_id}.genomecov.txt
perl $baseDir/calculate_depthcov.pl ${pair_id}.covhist.txt
if [[ -z $skiplc ]]
......@@ -87,8 +88,8 @@ then
samtools view -@ $threads -b -L ${bed} -o ${pair_id}.ontarget.bam ${sbam}
samtools index -@ $threads ${pair_id}.ontarget.bam
samtools flagstat ${pair_id}.ontarget.bam > ${pair_id}.ontarget.flagstat.txt
samtools view -@ $threads -b -q 1 ${sbam} | bedtools coverage -hist -b stdin -a ${bed} > ${pair_id}.mapqualcov.txt
java -Xmx64g -Djava.io.tmpdir=${tmpdir} -XX:ParallelGCThreads=$threads -jar $PICARD/picard.jar EstimateLibraryComplexity BARCODE_TAG=RG I=${sbam} OUTPUT=${pair_id}.libcomplex.txt TMP_DIR=${tmpdir}
#samtools view -@ $threads -b -q 1 ${sbam} | bedtools coverage -hist -b stdin -a ${bed} > ${pair_id}.mapqualcov.txt
#java -Xmx64g -Djava.io.tmpdir=${tmpdir} -jar $PICARD/picard.jar CollectAlignmentSummaryMetrics R=${index_path}/genome.fa I=${pair_id}.ontarget.bam OUTPUT=${pair_id}.alignmentsummarymetrics.txt TMP_DIR=${tmpdir}
#samtools view -@ $threads ${sbam} | awk '{sum+=$5} END { print "Mean MAPQ =",sum/NR}' > ${pair_id}.meanmap.txt
fi
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment