calc.Score {Apoderoides} | R Documentation |
calc.Score
Description
Calculate scores of a phylogenetic tree to find and prioritize erroneous taxa to delete.
Usage
calc.Score(tree,OTUrankData=NULL,
allRankNames=NULL,allCentroids=NULL,allMRCAs=NULL,dropIndex=NULL,
sort=TRUE,show_progress=TRUE,num_threads=1,criteria="composite")
Arguments
tree |
A phylogenetic tree to be checked. This is loaded by ape::read.tree() from a file. |
OTUrankData |
A list composed of two character vectors. The first vector is tips of tree. The second vector is the upper rank of the tips. When this is NULL, the function assumes that all the tree tips are expressed as Genus_species like Homo_sapience, and calculate the score for genera. When this is not NULL, the function returns scores based on the upper rank in this list. |
allRankNames |
This can be omitted. This is a unique character vector of the upper ranks of the tree tips. If given, the calculation will be a little faster. |
allCentroids |
This can be omitted. This is a list of numeric vectors of the centroids of ranks. If given, the calculation will be a little faster. |
allMRCAs |
This can be omitted. This is a list of numeric vectors of the MRCAs of ranks. If given, the calculation will be a little faster. |
dropIndex |
This can be omitted. A numeric vector of indices of tree tips. The tree tips indicated by this dropIndex will be removed from the score calculation. |
sort |
If TRUE, the calculation result is sorted by descending order of the total score. |
show_progress |
If TRUE, calculation progress is shown on the R console. |
num_threads |
A positive integer to specify the number of threads to calculate the scores. |
criteria |
Criteria nodes to calculate the scores."composite", "both", "MRCA" or "centroid". "MRCA" and "centroid" use their corresponding node to calculate both intruder and outlier scores. "composite" calculates intruder scores using MRCA and outlier ones using centroid, which is empirically known to be most effective. "both" calculates both of MRCA-based and centroid-based score. |
Value
A list containing one or two matrices of characters showing the scores. Only when criteria is "both", there are two matrices, and the first one is the score based on the centroids, and the second is that based on the MRCAs. The following explains the columns in the matrix.
OTU |
The name of tree tip. |
perCladeOTUScore |
The final score calculated by "sum" divided by the number of OTUs with the same "#clade". |
sum |
The sum of "intruder" and "outlier" for the OTU. |
intruder |
The intruder score showing how many ranks the OTU intruding into. |
outlier |
The outlier score showing how the OTU is far away from the core clade of the belonging rank. |
#clade |
The clade number. Monophyletic OTUs with the same rank has the same #clade. |
Examples
data(testTree)
#calculate scores for genus
calc.Score(testTree)
data(testRankList)
#calculate scores for the rank in the list
calc.Score(testTree,testRankList)