SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Samtools tview show problem? yangbinCI Bioinformatics 1 04-24-2012 04:03 AM
samtools idxstats Irina Pulyakhina Bioinformatics 4 10-19-2011 06:05 AM
SAMTools index stats strange result? tatinhawk Bioinformatics 3 09-01-2011 09:29 AM
idxstats option for samtools GenoMax Bioinformatics 0 08-10-2011 07:42 AM
samtools flagstat mismatch in stats rcorbett Bioinformatics 3 09-09-2010 06:36 PM

Reply
 
Thread Tools
Old 04-27-2012, 12:43 PM   #1
kgulukota
Member
 
Location: Illinois

Join Date: Oct 2011
Posts: 30
Default Why does samtools idxstats not show the stats

The ref sequences in my bam file are 1, 2, ...

idxstats reports get that 0 reads are mapped to each reference.

Code:
$ samtools idxstats MyBam.bam
1	197195432	0	0
10	129993255	0	0
11	121843856	0	0
And yet, the bam file is fine, I can see millions of reads mapped to each reference sequence (with samtools view) and I can run mpileup on it as well. Why would idxstats not work? Any ideas?

Thanks,
Gulu
__________________
Kamalakar Gulukota,
Director,
Center for Bioinformatics and Computational Biology
NorthShore University Health System, kgulukota@northshore.org
kgulukota is offline   Reply With Quote
Old 04-27-2012, 01:27 PM   #2
twaddlac
Member
 
Location: Pittsburgh, PA

Join Date: Feb 2011
Posts: 49
Default

I'm not sure why it wouldn't work - I never had a problem with it before.

If you're looking for a workaround you could so something like:
Code:
samtools view MyBam.bam | cut -f3 | sort | uniq -c
Though this will omit the length of the reference.

I hope this helps!
twaddlac is offline   Reply With Quote
Old 04-28-2012, 07:52 AM   #3
kgulukota
Member
 
Location: Illinois

Join Date: Oct 2011
Posts: 30
Default

Thank you twaddlac! Yes, I have been doing something like that. Unfortunately I have multiple files and each file has billions of lines and hence my server takes hours per file for this. I thought idxstats might have a fast way. Oh well ...
__________________
Kamalakar Gulukota,
Director,
Center for Bioinformatics and Computational Biology
NorthShore University Health System, kgulukota@northshore.org
kgulukota is offline   Reply With Quote
Old 04-29-2012, 02:13 AM   #4
maubp
Peter (Biopython etc)
 
Location: Dundee, Scotland, UK

Join Date: Jul 2009
Posts: 1,543
Default

Try reindexing - 'samtools idxstats' relies on extra fields in the BAI file which are not present in very old BAI files (early versions of 'samtools index' didn't write them).
maubp is offline   Reply With Quote
Old 04-29-2012, 09:08 PM   #5
kgulukota
Member
 
Location: Illinois

Join Date: Oct 2011
Posts: 30
Default

Thank you maubp!

I reindexed and it worked fine. (The original .bai file was something I downloaded from a public site along with the bam file).
__________________
Kamalakar Gulukota,
Director,
Center for Bioinformatics and Computational Biology
NorthShore University Health System, kgulukota@northshore.org
kgulukota is offline   Reply With Quote
Old 04-30-2012, 01:18 AM   #6
maubp
Peter (Biopython etc)
 
Location: Dundee, Scotland, UK

Join Date: Jul 2009
Posts: 1,543
Default

Quote:
Originally Posted by kgulukota View Post
Thank you maubp!

I reindexed and it worked fine. (The original .bai file was something I downloaded from a public site along with the bam file).
Great - can you try contacting the site so they can update their BAI files too?
maubp is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 03:26 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO