computePrimingWeights: Compute weights to correct for random hexamer priming.

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/primingWeights.R

Description

This function computes weights used to correct for random hexamer priming, as per the reference.

Usage

1
2
computePrimingWeights(aln, biasedIndex = 1:2, unbiasedIndex = 24:29,
  weightsLength = 7L, returnSep = FALSE)

Arguments

aln

An object of class AlignedRead.

biasedIndex

A vector of start positions for the biased k-mers.

unbiasedIndex

A vector of start positions for the unbiased k-mers.

weightsLength

The length of the k-mers.

returnSep

A logical indicating whether the numerator and denominator of the weights should be return or the weights themselves.

Value

If returnSep = FALSE a named vector of weights. Otherwise a list with two elements giving the numerator (p_unbiased) and the denominator (p_biased) of the weights.

Author(s)

Kasper Daniel Hansen khansen@jhsph.edu.

References

Hansen, K. D., Brenner, S. E. and Dudoit, S (2010) Biases in Illumina transcriptome sequencing caused by random hexamer priming. Nucleic Acids Res, doi:10.1093/nar/gkq224

See Also

addPrimingWeights and the extended example in the 'Working with ShortRead' vignette.

Examples

1
2
3
4
5
6
7
8
if(require(ShortRead)) {
  bwt.file <- system.file("extdata", "bowtie", "s_1_aligned_bowtie.txt",
                          package="ShortRead")
  aln <- readAligned(bwt.file, type = "Bowtie")
  weights <- computePrimingWeights(aln, weightsLength = 2L)
  aln <- addPrimingWeights(aln, weights = weights)
  head(alignData(aln)$weights)
}

Genominator documentation built on Oct. 31, 2019, 8:56 a.m.