biovizBase (version 1.20.0)

pileupGRangesAsVariantTable: Mismatch summary

Description

Compare to reference genome and compute mismatch summary for certain region of reads.

Usage

pileupGRangesAsVariantTable(gr, genome, DNABases=c("A", "C", "G", "T", "N"))

Arguments

gr
A GRanges object, with nucleotides summary, each base take one column in elementMetadata or user can simply passed the returned result from pileupAsGRanges function to this function.
genome
BSgenome object, need to be the reference genome.
DNABases
Nucleotide types contained in passed GRanges object. Default is A/C/G/T/N, it tries to match the column names in elementMetadata to those default nucleotides. And treat the matched column as base names.

Value

  • refNucleotide in reference genome.
  • readNucleotide contained in the reads at particular position, if multiple nucleotide, either matched or unmatched are found, they will be summarized in different rows.
  • countCount for read column.
  • matchLogical value, whether matched to reference genome or not
  • bamCharacter indicate bam file path.

Details

User need to make sure to pass the right reference genome to this function to get the right summary. This function drop the position has no reads and only keep the region with coverage in the summary. The result could be used to show stacked barchart for mismatch summary.

Examples

Run this code
## Not run: 
# library(Rsamtools)
# data(genesymbol)
# library(BSgenome.Hsapiens.UCSC.hg19)    
# bamfile <- system.file("extdata", "SRR027894subRBM17.bam", package="biovizBase")
# test <- pileupAsGRanges(bamfile, region = genesymbol["RBM17"])
# test.match <- pileupGRangesAsVariantTable(test, Hsapiens)
# head(test[,-7])
# head(test.match[,-5])
# ## End(Not run)

Run the code above in your browser using DataCamp Workspace