Search
Question: about VCF and BAM files
1
2.3 years ago by
Bogdan490
Palo Alto, CA, USA
Bogdan490 wrote:

Dear all,

please could you advise : considering a VCF file (and a specific position of a mutation), and a BAM file, what package or function I could use in BioC that will count the reads on FORWARD and REVERSE STRAND, for REFERENCE and ALTERNATE alleles ?  thanks !

-- bogdan

modified 2.3 years ago • written 2.3 years ago by Bogdan490
2
2.3 years ago by
Martin Morgan ♦♦ 22k
United States
Martin Morgan ♦♦ 22k wrote:

You can use Rsamtools::pileup() to create a tally of relevant positions, e.g.,

library(Rsamtools)
example(scanBam, echo=FALSE)         # points to ex1.bam sample file
sbp = ScanBamParam(which=GRanges("seq1", IRanges(c(100, 200), width=1)))
pileup(fl, scanBamParam=sbp)

The VCF could be input from VariantAnnotation::readVcf(), maybe using ScanVcfParam to restrict input to particular fields.

Dear Martin, thank you again for pointing us into the direction of using Rsamtools library. I will repost a similar question, as the output we would like to have would be :

 CHR position refAllele altAllele refCount altCount totalCount chr19 61766 A C 36 10 46 chr19 61774 A G 40 9 49 chr19 61799 T G 43 7 50 chr19 62155 A G 49 11 60 chr19 71178 G C 3 8 11 chr19 80384 C A 6 10 16
0
2.3 years ago by
Bogdan490
Palo Alto, CA, USA
Bogdan490 wrote:

Hi Martin ! thanks, very helpful ! we'll explore this way ! and hey ! ... looking forward to see you guys at Stanford in June !