Question: What are the methods to downsample the Depth of coverage (ex: 50X -> 25X)?
0
gravatar for bioinforesearchquestions
15 months ago by
United States
bioinforesearchquestions240 wrote:

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.

depth bam downsample wig • 525 views
ADD COMMENTlink modified 15 months ago • written 15 months ago by bioinforesearchquestions240

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 REPLYlink written 15 months ago by dariober10k

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 REPLYlink written 15 months ago by bioinforesearchquestions240
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 970 users visited in the last hour