kaksFromVariants: Calculate Ka/Ks ratios from a table of variants

Description Usage Arguments Value Author(s) See Also Examples

Description

From a table of variants, determine the ka/ks ratio and the number of synonomous/non-synonomous sites.

Usage

1
2
3
4
5
6
7
8
kaksFromVariants(varTable,
                    seqIDcol = 1,
                    refPosCol = "Reference.Position",
                    refAlleleCol = "Reference",
                    varAlleleCol = "Allele",
                    readCutoffs = 1,
                    codonStartPos = "cds",
                    referenceSeqs)

Arguments

varTable

A data.frame with rows for each position in each gene with a variant present. Columns give various information for each included individual. This is expecting the format from readVariantFiles, which should be easy to emulate. Small changes to the names make it ideal for VarScan formats as well.

seqIDcol

Which column is the sequence ID in? Can be numeric or character.

refPosCol

Which column is the referencece position in? Can be numeric or character.

refAlleleCol

Which column has the reference allele? Can be numeric or character.

varAlleleCol

Which column has the variable alleles? Can be numeric or character.

readCutoffs

How many variable positions need to be present to calculate bias. Set to 1 (or 0 or NULL) to include all. Without a reference, small numbers will be almost meaningless.

codonStartPos

If "cds" assumes all start at position 1 (default). In the future, can be a vector giving which position each gene starts at; currently not handled.

referenceSeqs

List of FASTA sequences, with names being gene names as listed in seqIDcol and containing the sequences. This is the format produced by read.fasta, but can be emulated.

Value

Returns a matrix of info for each gene with:

ka

rate of non-synonomous subsitutions

ks

rate of synonomous subsitutions

kaks

the ka/ks ratio; Note that ka/ks will be NA for genes with no scored variants and for any gene for which ka or ks are returned as negative

nSynSites

the number of sites deemed synonomous (includes half of the two-fold synonomous sites)

nNonSynSites

the number of sites deemed non-synonomous (includes half of the two-fold synonomous sites)

Author(s)

Mark Peterson

See Also

nSynNonSites, determineSynonymous, kaks, read.fasta

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Load needed data
data(varScanExample)
data(fastaExample)

kaksFromVariants(varTable=varScanExample,
                 refPosCol=2,
                 refAlleleCol="Ref",
                 varAlleleCol="Var",
                 referenceSeqs=fastaExample)
                 

rnaseqWrapper documentation built on May 2, 2019, 5:58 a.m.