SEQanswers

SEQanswers (http://seqanswers.com/forums/index.php)
-   Bioinformatics (http://seqanswers.com/forums/forumdisplay.php?f=18)
-   -   Extracting base coverage and quality values from BAM files (http://seqanswers.com/forums/showthread.php?t=7427)

unagaswamy 10-20-2010 07:15 AM

Extracting base coverage and quality values from BAM files
 
Experts,
I am interested in extracting base coverage and quality values for non SNP reads from a BAM file?
Thanks,
-Uma

wenhuang 10-20-2010 07:24 AM

pileup in samtools may be what you need.

bioinfosm 10-20-2010 09:36 AM

Yes, pileup is the tool from samtools to display coverage / quality information

unagaswamy 10-21-2010 11:49 AM

Thanks for the info.
Here is what I have tried so far to view the file for a given sample:
samtools view filename.bam chr:start-end

For non SNP positions, I am getting the base coverage using the following command:
samtools view filename.bam chr:start-end |wc -l

Sometimes the actual position is missing when I grep it and ~50 bases around it are printed. My question is how can I trust the wc -l value for a position if that position itself is missing in the BAM file?

unagaswamy 10-25-2010 10:03 AM

Hi Experts,
Can anyone tell me how to extract the base quality from the CQ field of the BAM file? I colleague of mine mentioned that every two ASCII character corresponds to the SOLiD color space. Do I take the average of every overlapping 2 or the max? Any input in this regard is gretaly appreciated!

nilshomer 10-25-2010 09:57 PM

Quote:

Originally Posted by unagaswamy (Post 27789)
Hi Experts,
Can anyone tell me how to extract the base quality from the CQ field of the BAM file? I colleague of mine mentioned that every two ASCII character corresponds to the SOLiD color space. Do I take the average of every overlapping 2 or the max? Any input in this regard is gretaly appreciated!

Is the base quality not already reported in the SAM record (it should be)? As to how to calculate the base qualities during alignment from color qualities, here is the formula MAQ/BWA/BFAST uses: https://sourceforge.net/apps/mediawi...apping_Quality.

unagaswamy 10-28-2010 07:11 AM

Hi nilshomer,
Thanks for the reply. We are generating SAM record only for the SNP positions which does have the base quality. I am interested in the Non-SNP positions as well and hence I'm trying to calcuate the base quality for these positions from the BAM file.
-Uma

unagaswamy 11-05-2010 08:54 AM

Hi All,
I generated a raw pileup for all reference positions using the samtools. An exmaple record for a non-SNP position is below:
chrY 11936864 G G 51 0 60 8 ,,.,,,.. "%`".B"`

This base has a coverage of 8. Which one of these fields (51,0,60) represent the base quality in this case? I am still confused about the ABI's SOLiD base quality!

Any input is greatly appreciated!

Bruins 11-10-2010 06:41 AM

Did you see the SAM FAQ?
http://sourceforge.net/apps/mediawik...pileup_output.

Hope this helps.

unagaswamy 11-11-2010 06:55 AM

Hi Bruins,
Thanks for this very useful link. It definitely answers some of my questions.
-Uma


All times are GMT -8. The time now is 11:17 PM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2020, vBulletin Solutions, Inc.