| trimEnds | R Documentation | 
Trims both ends of a DNA sequence alignment to the first and
last alignment positions that contain a minimum number of IUPAC base
characters ("a", "c", "g", "t", "r",
"y", "s", "w", "k", "m", "b",
"d", "h", "v"). In addition, all gap characters
("-") beyond the first and last base characters of each sequence are
replaced by the  character "n".
trimEnds(x, min.n.seq = 4)
x | 
 An object of class   | 
min.n.seq | 
 A   | 
An object of class DNAbin.
deleteEmptyCells, deleteGaps
# simple example alignment:
x <- structure(list(nb = 5, seq = c("acaaggtaca", "-caaggtac-",
"acaaggtaca", "aca--gtaca", "-ccaggta--"), nam = LETTERS[1:5]),
.Names = c("nb", "seq", "nam"), class = "alignment")
# convert to DNAbin:
x <- as.DNAbin(x)
# fill missing nucleotides:
x <- trimEnds(x)
# show results:
as.character(x[2, ])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.