cladeFilter: Filtering Sequences of Paralogy or With Other Misleading...

Description Usage Arguments Details Value See Also Examples

View source: R/cladeFilter.R

Description

This function judges whether or not members of a grouping defined by taxa and level grouped in trees, and suggest sequences to be removed when they are not. Rationales for the selection of excluding sequences see Details.

Usage

1
cladeFilter(trees, taxa, level = NULL, write.table = TRUE)

Arguments

trees

a list of objects of class "phylo". A list of test trees such as single gene trees.

taxa

a data.frame with tips and groupings. The first column must be the names of all tips in trees. Other columns specify the groupings.

level

a character specifying the level used as grouping. Should be one of the column names of taxa. Defaults as NULL and use the second column of taxa.

write.table

a logical specifying whether to write out text files containing the number and names of sequences suggested to be removed by cladeFilter for each grouping.

Details

To determine a scenario as the best solution of which sequences to be removed when members of a grouping is separated into more than one sub-clade, cladeFilter first calculate for each subclade the number of tips of a grouping to be remained or removed in the tree, and choose the one with the highest benefit as [number of remaining tips minus that of removing tips] (max.benefit). If this number is the same in more than one subclade, then cladeFilter chooses the one removing the least number of tips (min.rmtips). If both max.benefit and min.rmtips in more than one subclade are the same, cladeFilter searches the lengths of branches subtending to these subclades, remains the one with shortest branch length and removes the others. If the branch lengths are still the same for more than one subclade, cladeFilter then suggests to remove all tips of this grouping because the possibilities for these subclades to be paralogs are similar.

Value

A list of cladeFilter result for all test trees. For a test tree, the result constains: result result of cladeFilter removingTips tip(s) violate the grouping remainingTips tip(s) group mrcaInTree tips in the subclade of the MRCA node of the grouping in the test tree node MRCA node for the grouping subtree the extracted subclade of the grouping

See Also

summarizeMulticf, barplotMulticf, plot.cladeFilter

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
data(Brassidata)
trees <- Brassidata$trees
taxa <- Brassidata$taxaTable
# perform cladeFilter analysis
ures <- cladeFilter(trees = trees, taxa = taxa, level = 2, write.table = FALSE)
# summarize cladeFilter results with multiple groupings
usum <- summarizeMulticf(ures, trees, plot.tree = FALSE, write.table = FALSE)
# to make barplots
utest <- barplotMulticf(x = usum, reorder="up", plot = TRUE, pdf=FALSE)


## End(Not run)

Chien-Hsun/rePhylo documentation built on May 19, 2020, 3:15 a.m.