consensusProfile: Get sequence information from an alignment

View source: R/consensusProfile.R

consensusProfileR Documentation

Get sequence information from an alignment

Description

consensusProfile() takes a DNA multiple alignment as input and returns all the data needed for subsequent primer and probe design process. The function is a wrapper to Biostrings::consensusMatrix() (Pages et al., 2020).

Usage

consensusProfile(x, ambiguityThreshold = 0)

Arguments

x

A Biostrings::DNAMultipleAlignment object.

ambiguityThreshold

"Detection level" for ambiguous bases. All DNA bases that occur with a relative frequency higher than the specified value will be included when the IUPAC consensus character is determined. Can range from 0 to 0.2, defaults to 0.

Value

An RprimerProfile object, which contains the following information:

position

Position in the alignment.

a

Proportion of A.

c

Proportion of C.

g

Proportion of G.

t

Proportion of T.

other

Proportion of bases other than A, C, G, T.

gaps

Proportion of gaps (recognized as "-" in the alignment).

majority

Majority consensus sequence. Denotes the most frequently occurring nucleotide. If two or more bases occur with the same frequency, the consensus nucleotide will be randomly selected among these.

identity

Proportion of sequences, among all sequences with a DNA base (i.e., A, C, G or T), that has the majority consensus base.

iupac

The consensus sequence expressed in IUPAC format. The IUPAC consensus sequence only takes 'A', 'C', 'G', 'T' and '-' as input. Degenerate bases will be skipped. If a position only contains degenerate bases, the IUPAC consensus will be NA at that position.

coverage

Proportion of sequences in the target alignment, among all sequences with a DNA base, that are covered the IUPAC consensus character. The value will be 1 if there are no "remaining" DNA bases (and/or if ambiguityThreshold = 0).

References

Pages, H., Aboyoun, P., Gentleman R., and DebRoy S. (2020). Biostrings: Efficient manipulation of biological strings. R package version 2.57.2.

Examples

data("exampleRprimerAlignment")
consensusProfile(exampleRprimerAlignment)

consensusProfile(exampleRprimerAlignment, ambiguityThreshold = 0.05)

sofpn/rprimer documentation built on July 2, 2023, 7:15 a.m.