computePrimingWeights {Genominator} | R Documentation

## Compute weights to correct for random hexamer priming.

### Description

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

### Usage

    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

    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)
    }

[Package Genominator version 1.40.0 Index]