Build super matrix using PHYLIP files

Share:

Description

This function could be used to build the super dataframe described by Kress et al.(2009). The out put dataframe could be converted to Phylip format file for phylogenetic analysis.

Usage

1
supermat(rbcl = NULL, matk = NULL, trn = NULL)

Arguments

rbcl

A character string indicting the name of rbcl phylip file.

matk

A character string indicting the name of matK phylip file.

trn

A vector of character strings indicting the names of trnH-psbA phylip files.

Details

The phylip files should be first put into a directory. Users are encouraged to copy the phylip files which generated by software Clustal to a directory, and then set it as the working directory. The function will search the input phylip file names from the working directory and build the "super" dataframe. The dataframe then could be converted to phylip format by dat2phy and be written to the working directory by writeLines so that to generate a super matrix.

Value

The super data frame to be converted to supermatrix.

Note

None.

Author(s)

Jinlong Zhang jinlongzhang01@gmail.com

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 dat2phy, writeLines

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
dir <- system.file("extdata", package = "phylotools")
setwd(dir)
## Supermatrix with "rbcla","matk","trnH-psbA"
supermat1 <- supermat(rbcl = "rbcla.phy", matk = "matK.phy", 
           trn = c("trn1.phy", "trn2.phy","trn3.phy","trn4.phy"))	   
write.mat(supermat1, "result1.phy")


## Supermatrix with"matk","trnH-psbA"
supermat2 <- supermat(matk = "matK.phy", 
           trn = c("trn1.phy", "trn2.phy","trn3.phy","trn4.phy"))	      
write.mat(supermat2, "result2.phy")


## Supermatrix with "rbcla","matk"
supermat3 <- supermat(matk = "matK.phy", rbcl = "rbcla.phy")	   
write.mat(supermat3, "result3.phy")


## Supermatrix with "rbcla","trnH-psbA"
supermat4 <- supermat(rbcl = "rbcla.phy", 
           trn = c("trn1.phy", "trn2.phy","trn3.phy","trn4.phy"))	   
write.mat(supermat4, "result4.phy")

## Delete the results
unlink(c("result1.phy", "result2.phy", "result3.phy", "result4.phy"))

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.