Thanks @Fred, it took me so long to accept your answer because I was testing it on one sample, and it works!
Hi everyone,
I was wondering whether there is any tool to perform a count of how many As, Ts, Gs & Cs are present at a particular genomic position. I have 64 RNASeq samples and a set of genomic locations for which I would like to count the occurrence of each base at that position.
Thanks
2 answers
I don't know of any tool. But I perform similar analysis where I
1) Align the data against reference genome
2) Use the bam file to create mpileup file. Use the match, mismatch information from mpileup (See here:http://samtools.sourceforge.net/pileup.shtml) to calculate the frequency of different nucleotides.
I once found this tool: pileup2base that outputs the number of A C G T and INDELs for each positions of a mpileup file. Maybe you can test it.
If you want to generate the mpileup for a particulat position you can do:
samtools view -h indexed_bam_file.bam chr:start-end | samtools view -Shb - | samtools mpileup - > mpileup_file
Then you can select the line of the mpileup file that corresponds to the exact coordinate.
Log in to answer this question.