GetCodonPhase: Determine the best codon phase and return amino acid sequence

Description Usage Arguments Details See Also Examples

Description

GetCodonPhase determines the best translated amino acid sequence from a consensus DNA alignment by identifying the codon phase that produces the fewest number of stop codons. translate from the seqinr package is used to determine the positions of the stop codons in the consensus alignment in all three forward and three reverse codon phases, for a total of six codon phases.

Usage

1
GetCodonPhase(DNA.seq, numcode = 1, NAstring = "X", ambiguous = FALSE)

Arguments

DNA.seq

Vector of the consensus alignment of a DNA sequence.

numcode

The NCBI genetic code number used for translation. By default, the standard genetic code (1) is used. See NCBI Genetic Code website for more details: http://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi?mode=t

NAstring

How to treat the translation of amino acids when there are ambiguous bases in codons.

ambiguous

Indicate whether ambiguous bases are considered. Set as FALSE as a default.

return.all

In case of multiple equally good phases, return all (TRUE, the default) or just one at random.

Details

numStopCodons integer list of the total number of stop codons in each of the six codon phases. stopCodonPositions character list of the beginning position for every stop codon found within each of the six codon phases. translation vector of the amino acid sequence from the codon phase with the fewest number of stop codons.

See Also

translate in seqinr package

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
malMfile <- system.file("sequences/malM.fasta", package = "seqinr")
malMseq <- read.fasta(malMfile)

# DNA sequence is stored under the 
malMtest <- GetCodonPhase(as.character(malMseq[[1]]))

### Example using multiple sequences, and then creating a consensus alignment
fastaf <- system.file("sequences/Anouk.fasta", package = "seqinr")
sample.fasta <- read.alignment(file = system.file("sequences/Anouk.fasta", package = "seqinr"), format = "fasta")

# Get consensus
Anouk <- consensus(sample.fasta, method = "majority")

## End(Not run)

bomeara/sleq documentation built on May 12, 2019, 11:36 p.m.