What are the methods to downsample the Depth of coverage (ex: 50X -> 25X)?
0
0
Entering edit mode
6.0 years ago

Hi folks,

I used this option to downsample the bam files. Am I doing it correctly?

samtools view -s 0.15 -b input.bam > input_15X.bam

Then I used this input_15X.bam to generate wig file using HMMcopy.

readCounter -b input_15X.bam > input_15X.wig

Building index for input_15X.bam, please hold

Index creation successful

But I am getting an empty wig file.

Any recommendations are welcome.

BAM downsample depth wig • 1.9k views
ADD COMMENT
0
Entering edit mode

Out of curiosity, where did you get readCounter from? At a glance I don't see it in HMMcopy.

Does your downsampled bam have any reads at all? Try samtools view -c input_15X.bam or just ls -lh input_15X.bam to see if it has a decent size.

ADD REPLY
0
Entering edit mode

readCounter is present inside the HMMcopy/scripts directory. Thanks, I fixed it. I removed the -b parameter, it was creating the index. Without the -b parameter I got the wiggle file.

But my query is -s 0.15 does it mean 15X or less than 15x?

I am getting error with the BAM file when I tried computing the collectWGSmatrix.

[Tue Apr 10 00:00:36 EDT 2018] picard.analysis.CollectWgsMetrics done. Elapsed time: 22.55 minutes. Runtime.totalMemory()=3056074752 To get help, see http://broadinstitute.github.io/picard/index.html#GettingHelp Exception in thread "main" htsjdk.samtools.SAMFormatException: SAM validation error: ERROR: Record 50656281, Read name HISEQ-MFG:170:c9w21anxx:5:2316:1885:53454, MAPQ should be 0 for unmapped read.

ADD REPLY

Login before adding your answer.

Traffic: 2898 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6