Subsampling bam file - error DiffBind
1
0
Entering edit mode
@sergioespeso-gil-6997
Last seen 4.8 years ago
New York

Hi community!

I am subsampling input control data for DiffBind analysis to test something. I have merged first input files by using samtools merge and then later samtools view -s "percentage of subsampling"

 

When I am trying to run DiffBind, then I get this error:

'subsampled_input.bam'  does not appear to be a BAM file (bad magic number)

Any ideas? I am browsing in internet. I guess is a problem of the bam file, not of DiffBind. But if you could give some hints I will highly appreciate it. 

 

Thanks

 

Sergio

diffbind samtools • 1.7k views
ADD COMMENT
1
Entering edit mode

Are you *just* using the "-s" option?  "samtools view" by default produces SAM output,  not BAM.  If you haven't already, try "samtools view -b -s ..."

ADD REPLY
0
Entering edit mode

Thanks!!! That´s was the error, now working fine!

I could not live without youuuuuuuu and Rory hahaha  THANKS!!! 

 

ADD REPLY
0
Entering edit mode
Gord Brown ▴ 670
@gord-brown-5664
Last seen 3.9 years ago
United Kingdom

Adding the answer here, just so there's an actual "answer" as opposed to a comment:

Use the "-b" option to samtools to create BAM as opposed to SAM output.

ADD COMMENT

Login before adding your answer.

Traffic: 600 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