Calculate transition/transversion ratio overall or by sample
A logical indicating whether TiTv should be calculated by sample or overall for the entire GDS object.
A logical indicating whether to assign
sample IDs as names of the output vector (if
by.sample=FALSE (the default),
titv calulates the
transition/transversion ratio (TiTv) over all samples.
titv calculates TiTv over all
variant genotypes (heterozygous or homozygous non-reference) for each
A single value for TiTv if
a numeric vector containing TiTv for each sample.
1 2 3 4 5 6 7 8 9 10 11 12
gds <- seqOpen(seqExampleFileName("gds")) titv(gds) titv(gds, by.sample=TRUE) ## apply to a subset of variants library(GenomicRanges) chrom <- seqGetData(gds, "chromosome") pos22 <- seqGetData(gds, "position")[chrom == 22] ranges <- GRanges(seqnames="22", IRanges(min(pos22), max(pos22))) applyMethod(gds, titv, ranges) seqClose(gds)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.