Question: How do I calculate the total read depth and allele frequency using just the target bed file and aligned bam
0
gravatar for bobrowdy123
5.4 years ago by
United States
bobrowdy1230 wrote:

All of what I have come up with so far is that there is pileup but then again a reference has to be used I am trying to use the bam and just the bed file and target I have to extract all the information like total read depth and allele frequency, any help is greatly appreciated. I am a newbie to this.

bam mpileup allele frequency bed • 3.3k views
ADD COMMENTlink modified 21 months ago by Biostar ♦♦ 20 • written 5.4 years ago by bobrowdy1230

This post may help you C: Calculate The Frequency Of Nucleotides At Each Position In An Mpileup File. I guess you already have got a mpileup file. 

ADD REPLYlink written 5.4 years ago by Ashutosh Pandey12k

I looked at this but is there a way to calculate the the total read depth for each base and  obtain the alleles and af? I just want to use the target I have via the BED file as the aligned bam has already been aligned. 

ADD REPLYlink written 5.4 years ago by bobrowdy1230

You should start with generating bed file out of pile up file. Bed file requires three mandatory columns that represent chrom, start and end. You will have to add a third column in your pile up file, start+1 will work and it will then create a bed file based on your pile up file. Now you can use bed intersect feature to extract rows from your pileup file that correspond to the regions in your bed file. After that you can use the python script that i have mentioned in the post that i have mentioned above. You may need to tweak the code a little but it gives you counts fro A, T, C and G and the total counts. The code currently works for SNPs only. 

ADD REPLYlink modified 5.4 years ago • written 5.4 years ago by Ashutosh Pandey12k

The thing is I already have a BED file but, I was wondering if there is some tool that exists which I can use to obtain the information instead of writing or modifying a script. Samtools have anything or use GATK, or VARSCAN. My bed file has the chromosome number, start, end, all tab delimited. I need to use those target regions to calculate the depth per base for that position and obtain af. Thank you for your help.

ADD REPLYlink written 5.4 years ago by bobrowdy1230

Yes, you'll probably want to write a small script.

ADD REPLYlink written 5.4 years ago by Sean Davis26k
0
gravatar for bobrowdy123
5.4 years ago by
United States
bobrowdy1230 wrote:

C: Calculate The Frequency Of Nucleotides At Each Position In An Mpileup File I want to obtain something like this 

ADD COMMENTlink written 5.4 years ago by bobrowdy1230
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: 1485 users visited in the last hour