Learn R Programming

Genominator (version 1.26.0)

addPrimingWeights: Adding priming weights to an AlignedRead object.

Description

This function adds priming weights to an AlignedRead object.

Usage

addPrimingWeights(aln, weights = NULL, overwrite = FALSE, ...)

Arguments

aln
An object of class AlignedRead.
weights
A vector of weights as produced by computePrimingWeights.
overwrite
A logical, will a weights entry in the alignData of the aln argument be overwritten?
...
These arguments are passed to computePrimingWeights and are only used if weights are NULL.

Value

An object of class AlignedRead with a weights component in its alignData slot.

Details

If the weights are not supplied, the weights are calculated using the aln object itself.

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

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

Examples

Run this code
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)
}

Run the code above in your browser using DataLab