Package org.forester.phylogeny
Class PhylogenyMethods
java.lang.Object
org.forester.phylogeny.PhylogenyMethods
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
static enum
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addMolecularSeqsToTree
(Phylogeny phy, Msa msa) static DescriptiveStatistics
static List<DescriptiveStatistics>
static double
calculateDistance
(PhylogenyNode node1, PhylogenyNode node2) Calculates the distance between PhylogenyNodes node1 and node2.static final PhylogenyNode
calculateLCA
(PhylogenyNode node1, PhylogenyNode node2) Returns the LCA of PhylogenyNodes node1 and node2.static final PhylogenyNode
calculateLCAonTreeWithIdsInPreOrder
(PhylogenyNode node1, PhylogenyNode node2) Returns the LCA of PhylogenyNodes node1 and node2.static short
static int
static double
static PhylogenyNode
static DescriptiveStatistics
static int
clone()
static final void
static int
static int
static final HashMap<String,
PhylogenyNode> static void
deleteExternalNodesNegativeSelection
(String[] node_names_to_delete, Phylogeny p) static void
deleteExternalNodesNegativeSelection
(Set<Long> to_delete, Phylogeny phy) deleteExternalNodesPositiveSelection
(String[] node_names_to_keep, Phylogeny p) static void
deleteExternalNodesPositiveSelectionT
(List<Taxonomy> species_to_keep, Phylogeny phy) static final void
static final void
static final List<List<PhylogenyNode>>
divideIntoSubTrees
(Phylogeny phy, double min_distance_to_root) static boolean
static List<PhylogenyNode>
static Color
Convenience methodstatic double
Convenience methodstatic double
Convenience methodstatic double[]
Convenience methodstatic final Event
getEventAtLCA
(PhylogenyNode n1, PhylogenyNode n2) static Taxonomy
Returns taxonomy t if all external descendants have the same taxonomy t, null otherwise.static PhylogenyNode
static double
Returns the largest confidence value found on phy.static int
static String
getSpecies
(PhylogenyNode node) Convenience method for display purposes.static String
Convenience method for display purposes.static final boolean
static boolean
static final boolean
static boolean
isTaxonomyHasIdentifierOfGivenProvider
(Taxonomy tax, String[] providers) static void
midpointRoot
(Phylogeny phylogeny) static void
normalizeBootstrapValues
(Phylogeny phylogeny, double max_bootstrap_value, double max_normalized_value) static List<PhylogenyNode>
Returns a map of distinct taxonomies of all external nodes of node.static void
orderAppearance
(PhylogenyNode n, boolean order, boolean order_ext_alphabetically, PhylogenyMethods.DESCENDANT_SORT_PRIORITY pri) Arranges the order of childern for each node of this Phylogeny in such a way that either the branch with more children is on top (right) or on bottom (left), dependent on the value of boolean order.static void
static final void
preOrderReId
(Phylogeny phy) static final Phylogeny[]
readPhylogenies
(PhylogenyParser parser, File file) static final Phylogeny[]
readPhylogenies
(PhylogenyParser parser, List<File> files) static void
removeNode
(PhylogenyNode remove_me, Phylogeny phylogeny) static List<PhylogenyNode>
searchData
(String query, Phylogeny phy, boolean case_sensitive, boolean partial, boolean regex, boolean search_domains, double domains_confidence_threshold) static List<PhylogenyNode>
searchDataLogicalAnd
(String[] queries, Phylogeny phy, boolean case_sensitive, boolean partial, boolean search_domains, double domains_confidence_threshold) static void
static void
setBootstrapConfidence
(PhylogenyNode node, double bootstrap_confidence_value) Convenience method.static void
setBranchColorValue
(PhylogenyNode node, Color color) static void
setBranchWidthValue
(PhylogenyNode node, double branch_width_value) Convenience methodstatic void
setConfidence
(PhylogenyNode node, double confidence_value) Convenience method.static void
setConfidence
(PhylogenyNode node, double confidence_value, String type) Convenience method.static void
setScientificName
(PhylogenyNode node, String scientific_name) static void
setTaxonomyCode
(PhylogenyNode node, String taxonomy_code) Convenience method to set the taxonomy code of a phylogeny node.static final void
static List<PhylogenyNode>
taxonomyBasedDeletionOfExternalNodes
(Phylogeny reference, Phylogeny to_be_stripped) Removes from Phylogeny to_be_stripped all external Nodes which are associated with a species NOT found in Phylogeny reference.static final void
static final void
transferInternalNodeNamesToConfidence
(Phylogeny phy, String confidence_type) static final void
transferNodeNameToField
(Phylogeny phy, PhylogenyMethods.PhylogenyNodeField field, boolean external_only)
-
Method Details
-
clone
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
extractFastaInformation
-
calculateBranchLengthStatistics
-
calculateConfidenceStatistics
-
calculateDistance
Calculates the distance between PhylogenyNodes node1 and node2.- Parameters:
node1
-node2
-- Returns:
- distance between node1 and node2
-
calculateLCA
Returns the LCA of PhylogenyNodes node1 and node2.- Parameters:
node1
-node2
-- Returns:
- LCA of node1 and node2
-
calculateLCAonTreeWithIdsInPreOrder
public static final PhylogenyNode calculateLCAonTreeWithIdsInPreOrder(PhylogenyNode node1, PhylogenyNode node2) Returns the LCA of PhylogenyNodes node1 and node2. Precondition: ids are in pre-order (or level-order).- Parameters:
node1
-node2
-- Returns:
- LCA of node1 and node2
-
calculateMaxBranchesToLeaf
-
calculateMaxDepth
-
calculateMaxDistanceToRoot
-
calculateNodeWithMaxDistanceToRoot
-
calculateNumberOfExternalNodesWithoutTaxonomy
-
calculateNumberOfDescendantsPerNodeStatistics
-
collapseSubtreeStructure
-
countNumberOfOneDescendantNodes
-
countNumberOfPolytomies
-
createNameToExtNodeMap
-
deleteExternalNodesNegativeSelection
-
deleteExternalNodesNegativeSelection
public static void deleteExternalNodesNegativeSelection(String[] node_names_to_delete, Phylogeny p) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
deleteExternalNodesPositiveSelection
-
deleteExternalNodesPositiveSelectionT
-
deleteInternalNodesWithOnlyOneDescendent
-
deleteNonOrthologousExternalNodes
-
divideIntoSubTrees
public static final List<List<PhylogenyNode>> divideIntoSubTrees(Phylogeny phy, double min_distance_to_root) -
getAllDescendants
-
getBranchColorValue
Convenience method- Parameters:
node
-- Returns:
-
getBranchWidthValue
Convenience method -
getConfidenceValue
Convenience method -
getConfidenceValuesAsArray
Convenience method -
getEventAtLCA
-
getExternalDescendantsTaxonomy
Returns taxonomy t if all external descendants have the same taxonomy t, null otherwise. -
getFurthestDescendant
-
getMaximumConfidenceValue
Returns the largest confidence value found on phy. -
getMinimumDescendentsPerInternalNodes
-
getSpecies
Convenience method for display purposes. Not intended for algorithms. -
getTaxonomyIdentifier
Convenience method for display purposes. Not intended for algorithms. -
isAllDecendentsAreDuplications
-
isHasExternalDescendant
-
isTaxonomyHasIdentifierOfGivenProvider
-
midpointRoot
-
normalizeBootstrapValues
public static void normalizeBootstrapValues(Phylogeny phylogeny, double max_bootstrap_value, double max_normalized_value) -
obtainAllNodesAsList
-
obtainDistinctTaxonomyCounts
Returns a map of distinct taxonomies of all external nodes of node. If at least one of the external nodes has no taxonomy, null is returned. -
orderAppearance
public static void orderAppearance(PhylogenyNode n, boolean order, boolean order_ext_alphabetically, PhylogenyMethods.DESCENDANT_SORT_PRIORITY pri) Arranges the order of childern for each node of this Phylogeny in such a way that either the branch with more children is on top (right) or on bottom (left), dependent on the value of boolean order.- Parameters:
order
- decides in which direction to orderpri
-
-
postorderBranchColorAveragingExternalNodeBased
-
preOrderReId
-
readPhylogenies
public static final Phylogeny[] readPhylogenies(PhylogenyParser parser, File file) throws IOException - Throws:
IOException
-
readPhylogenies
public static final Phylogeny[] readPhylogenies(PhylogenyParser parser, List<File> files) throws IOException - Throws:
IOException
-
removeNode
-
searchData
public static List<PhylogenyNode> searchData(String query, Phylogeny phy, boolean case_sensitive, boolean partial, boolean regex, boolean search_domains, double domains_confidence_threshold) -
searchDataLogicalAnd
public static List<PhylogenyNode> searchDataLogicalAnd(String[] queries, Phylogeny phy, boolean case_sensitive, boolean partial, boolean search_domains, double domains_confidence_threshold) -
setAllIndicatorsToZero
-
setBootstrapConfidence
Convenience method. Sets value for the first confidence value (created if not present, values overwritten otherwise). -
setBranchColorValue
-
setBranchWidthValue
Convenience method -
setConfidence
Convenience method. Sets value for the first confidence value (created if not present, values overwritten otherwise). -
setConfidence
Convenience method. Sets value for the first confidence value (created if not present, values overwritten otherwise). -
setScientificName
-
setTaxonomyCode
public static void setTaxonomyCode(PhylogenyNode node, String taxonomy_code) throws PhyloXmlDataFormatException Convenience method to set the taxonomy code of a phylogeny node.- Parameters:
node
-taxonomy_code
-- Throws:
PhyloXmlDataFormatException
-
sortNodeDescendents
public static final void sortNodeDescendents(PhylogenyNode node, PhylogenyMethods.DESCENDANT_SORT_PRIORITY pri) -
taxonomyBasedDeletionOfExternalNodes
public static List<PhylogenyNode> taxonomyBasedDeletionOfExternalNodes(Phylogeny reference, Phylogeny to_be_stripped) Removes from Phylogeny to_be_stripped all external Nodes which are associated with a species NOT found in Phylogeny reference.- Parameters:
reference
- a reference Phylogenyto_be_stripped
- Phylogeny to be stripped- Returns:
- nodes removed from to_be_stripped
-
transferInternalNamesToBootstrapSupport
-
isInternalNamesLookLikeConfidences
-
transferInternalNodeNamesToConfidence
-
transferNodeNameToField
public static final void transferNodeNameToField(Phylogeny phy, PhylogenyMethods.PhylogenyNodeField field, boolean external_only) throws PhyloXmlDataFormatException - Throws:
PhyloXmlDataFormatException
-
addMolecularSeqsToTree
-