library(PhyInsight)
The PhyInsight
package is used to efficiently conduct
DNA sequence analyses. In this vignette, use of the package functions in
order to create a phylogenetic tree will be demonstrated. The functions
in this package are used to manipulate DNA strings, remove mismatched
strings, and remove strings that cause distance outliers where
necessary. These processes are performed automatically when the
appropriate functions are used and can save the user much time and
effort.
Any taxon can be used provided the DNA strings are in the correct
format. The Ursidae family will be used as an example of how one can use
PhyInsight
to manipulate DNA strings and build a
phylogenetic tree in just four functions once the specimen dataframe is
ready.
# query the data using the taxon name
<- querySpecData("Ursidae")
specdata
# check the number of DNA marker codes
sort(table(specdata$markercode))
#>
#> 16S D-loop ND1 ND2 ND3 ND4 ND4L ND5-0 ND6 atp6 COII
#> 4 9 14 14 14 14 14 14 14 39 41
#> COXIII CYTB COI-5P
#> 41 42 523
Choosing which gene region(s) to use is an important step and will
vary depending on the research question and the taxa. In this example,
only sequences from the COI-5P
region will be used for the
analysis. Also, getSpeciesRepr()
is used to automatically
select representative observations for each species.
# subset results that only have nucleotides from the COI-5P region
<- subset(specdata, markercode == "COI-5P")
specdata
# get one observation per species
<- getSpeciesRepr(specdata) specdata
Here, functions from the package are used to automatically create a DNA bin, create a DNA string set object, then automatically manipulate the strings.
# generate a DNA bin
<- genDNABin(specdata)
DNABin
# use the DNA bin to create a DNA string set
<- genDNAStringSet(DNABin)
DNAStringset
# automatically manipulate the DNA strings
<- ManipStringSet(DNAStringset) DNAStringSet
Here, the genPhytree()
function is used to automatically
create a phylo tree object. The labels names, offset, and size can also
be edited.
# automatically generate a phylo tree
<- genPhytree(DNAStringSet)
PhyloTree
# change the label names
$tip.label <- paste(specdata$genus_name, "|", specdata$species_name) PhyloTree
# plot the phylo tree
plot(
PhyloTree,label.offset = 0.001,
cex = 1.5
)