I have to open a fasta file and match it with a bam file in c++. Unfortunately i open the bam file correctly, but i have no idea how to open the fasta file and match it with the bam. Before beginning the matching, i havo to take care of some informations of the bam file: the quality of the bases, the read quality, the orientation of the read, the initial and final position of the read and the coverage of the reads alignments. After the matching, i would be able to extract the positions where the bam differs from the reference fasta, with the bases differences in those positions. I know i'ts a lot of stuff, but i come from perl and i'm not as good in c++. Thanks in advance
related: http://www.biostars.org/post/show/44424/get-bases-and-quality-from-a-bam-file-c/
If you still need help, write me examples of files and of desired output.
the fasta file is taken form here ftp://hgdownload.cse.ucsc.edu/goldenPath/hg19/chromosomes/ . it's the hg19 human genome. with a bam sorted file in input i want to match it with the fasta and the program will create a text file taking the positions where the a base of the bam file differs from the fasta one. and of course it will sign what is the difference, and if the mutation is heterozygosis or homozygosis. thanks in advance, all help will be very welcome