Description Usage Arguments Value Author(s) References Examples
Import files created by evaluation of samtools' pileup -cv
command.
1 2 3 | readPileup(file, ...)
## S4 method for signature 'connection'
readPileup(file, ..., variant=c("SNP", "indel", "all"))
|
file |
The file name, or
|
... |
Additional arguments, passed to methods. For instance,
specify |
variant |
Type of variant to parse; select one. |
readPileup
returns a GRanges
object.
The value returned by variant="SNP"
or variant="all"
contains:
The chromosome names (fastq ids) of the reference sequence
The nucleotide position (base 1) of the variant.
The nucleotide in the reference sequence.
The consensus nucleotide, as determined by samtools pileup.
The phred-scaled consensus quality.
The phred-scaled SNP quality (probability of the consensus being identical to the reference).
The root mean square mapping quality of reads overlapping the site.
The number of reads covering the site.
The value returned by variant="indel"
contains space, position,
reference, consensus, consensusQuality, snpQuality, maxMappingQuality,
and coverage fields, and:
The first (typically, in the reference sequence) and second allelic variants.
The number of reads supporting each allele.
The number of additional indels present.
Sean Davis
http://samtools.sourceforge.net/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | fl <- system.file("extdata", "pileup.txt", package="Rsamtools",
mustWork=TRUE)
(res <- readPileup(fl))
xtabs(~referenceBase + consensusBase, mcols(res))[DNA_BASES,]
## Not run: ## uses a pipe, and arguments passed to read.table
## three successive piles of 100 records each
cmd <- "samtools pileup -cvf human_b36_female.fa.gz na19240_3M.bam"
p <- pipe(cmd, "r")
snp <- readPileup(p, nrow=100) # variant="SNP"
indel <- readPileup(p, nrow=100, variant="indel")
all <- readPileup(p, nrow=100, variant="all")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.