about VCF and BAM files
2
1
Entering edit mode
Bogdan ▴ 670
@bogdan-2367
Last seen 13 months ago
Palo Alto, CA, USA

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

SNV BAM • 2.4k views
ADD COMMENT
2
Entering edit mode
@martin-morgan-1513
Last seen 4 months ago
United States

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.

 

ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode
Bogdan ▴ 670
@bogdan-2367
Last seen 13 months ago
Palo Alto, CA, USA

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

ADD COMMENT

Login before adding your answer.

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