Learn R Programming

phylotools (version 0.1.2)

edgesub: Substitute character for a sequence from both sides.

Description

Substitute character for a sequence from both sides without changing the internal matched characters.

Usage

edgesub(x, pattern = "-", replacement = "?")

Arguments

x
The input DNA sequence.
pattern
The character that to be substitute.
replacement
The character that will replace the pattern.

Value

This function will return to the substituted pattern of the input DNA sequence.

Details

None.

References

Kress W., Erickson D., Jones F., Swenson N., Perez R., Sanjur O., Bermingham E., Plant DNA barcodes and community phylogeny of a tropical forest dynamics plot in Panama. Proceedings of the National Academy of Sciences of the United States of America. 2009 18621-18626

See Also

See Also framsub, for substitution of a dataframe, which is a general application of this function.

Examples

Run this code

## edgesub example ########
#### Substitute each terminal of the sequence
dna = "---ATTGCCTTAS--TTTAAAAAACCGTTC-----"
edgesub(dna)

Run the code above in your browser using DataLab