Entering edit mode
8.8 years ago
bobrowdy123
•
0
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.
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.
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.
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.
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.
Yes, you'll probably want to write a small script.