How do I calculate the total read depth and allele frequency using just the target bed file and aligned bam
1
0
Entering edit mode
8.8 years ago

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.

bed bam mpileup allele-frequency • 5.1k views
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode
8.8 years ago

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

ADD COMMENT

Login before adding your answer.

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