Description Usage Arguments Value See Also Examples
Create a table of A,C,G,T nucleotide frequencies for pileup result. Source code from: https://seqqc.wordpress.com/2015/03/10/calculate-nucelotide-frequency-with-rsamtools-pileup/
1 | pileup_freqs(plp)
|
plp |
Pileup result returned by |
A data frame (or list, need to check by yourself) of A,C,G,T nucleotide frequencies.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | library(Rsamtools)
# 1. Not run:
plp <- Rsamtools::pileup(...)
# 2. Not run - computing the allelic counts for several SNPs
library(VariantAnnotation)
bamfile <- 'Tumor.rmdup.bam'
bf <- BamFile(bamfile)
#read list of SNPs (several)
vcf <- readVcf("vcfExample_chr17.vcf", "hg19")
vcf.ranges <- rowData(vcf) # You can also create a list of SNPs with GRanges
#compute pileup
#param <- ScanBamParam(which=GRanges("chr17",IRanges(start=685640, end=685650)))
param <- ScanBamParam(which=vcf.ranges)
p_param <- PileupParam(max_depth=1000, ignore_query_Ns=FALSE)
plp <- pileup(bf, scanBamParam=param, pileupParam=p_param)
dim(plp)
#create table of nucleotide frequencies
pileup_freqs(plp)
close(bf)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.