|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.forester.phylogeny.Phylogeny
public class Phylogeny
Field Summary | |
---|---|
static boolean |
ALLOW_MULTIPLE_PARENTS_DEFAULT
|
Constructor Summary | |
---|---|
Phylogeny()
Default Phylogeny constructor. |
Method Summary | |
---|---|
void |
addAsChild(PhylogenyNode parent)
Adds this Phylogeny to the list of child nodes of PhylogenyNode parent and sets the parent of this to parent. |
void |
addAsSibling(PhylogenyNode sibling)
|
double |
calculateSubtreeHeight(PhylogenyNode n)
This calculates the height of the subtree emanating at n for rooted, tree-shaped phylogenies |
Phylogeny |
copy()
Returns a deep copy of this Phylogeny. |
void |
deleteSubtree(PhylogenyNode remove_us,
boolean collapse_resulting_node_with_one_desc)
Need the delete and/or rehash _idhash (not done automatically to allow client multiple deletions in linear time). |
void |
externalNodesHaveChanged()
|
String[] |
getAllExternalNodeNames()
|
Confidence |
getConfidence()
|
String |
getDescription()
|
String |
getDistanceUnit()
|
Set<PhylogenyNode> |
getExternalNodes()
Warning. |
PhylogenyNode |
getFirstExternalNode()
Returns the first external PhylogenyNode. |
double |
getHeight()
This calculates the height for rooted, tree-shaped phylogenies. |
Identifier |
getIdentifier()
|
String |
getName()
Returns the name of this Phylogeny. |
PhylogenyNode |
getNode(int id)
Finds the PhylogenyNode of this Phylogeny which has a matching ID number. |
PhylogenyNode |
getNode(String name)
Returns a PhylogenyNode of this Phylogeny which has a matching name. |
List<PhylogenyNode> |
getNodes(String name)
Returns a List with references to all Nodes of this Phylogeny which have a matching name. |
List<PhylogenyNode> |
getNodesViaSequenceName(String seq_name)
|
List<PhylogenyNode> |
getNodesViaTaxonomyCode(String taxonomy_code)
|
List<PhylogenyNode> |
getNodesWithMatchingSpecies(String specname)
Returns a Vector with references to all Nodes of this Phylogeny which have a matching species name. |
PhylogenyNode |
getNodeViaSequenceName(String seq_name)
|
PhylogenyNode |
getNodeViaTaxonomyCode(String taxonomy_code)
|
int |
getNumberOfBranches()
|
int |
getNumberOfExternalNodes()
Returns the sum of external Nodes of this Phylogeny (int). |
List<PhylogenyNode> |
getParalogousNodes(PhylogenyNode n,
String[] taxonomyCodeRange)
Returns all paralogs of the external PhylogenyNode n of this Phylogeny. |
PhylogenyNode |
getRoot()
Returns the root PhylogenyNode of this Phylogeny. |
String |
getType()
|
void |
hashIDs()
Hashes the ID number of each PhylogenyNode of this Phylogeny to its corresponding PhylogenyNode, in order to make method getNode( id ) run in constant time. |
void |
init()
Deletes this Phylogeny. |
boolean |
isCompletelyBinary()
Returns whether this is a completely binary tree (i.e. |
boolean |
isEmpty()
Checks whether a Phylogeny object is deleted (or empty). |
boolean |
isRerootable()
|
boolean |
isRooted()
Returns true is this Phylogeny is rooted. |
boolean |
isTree()
|
PhylogenyNodeIterator |
iteratorExternalForward()
|
PhylogenyNodeIterator |
iteratorLevelOrder()
|
PhylogenyNodeIterator |
iteratorPostorder()
|
PhylogenyNodeIterator |
iteratorPreorder()
|
int |
levelOrderReID(int start_label)
Resets the ID numbers of the nodes of this Phylogeny in level order, starting with start_label (for the root). |
void |
orderAppearance(boolean order)
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. |
void |
preOrderReId()
|
int |
preOrderReId(int start_label)
Resets the ID numbers of the Nodes of this Phylogeny in preorder, starting with i. WARNING. |
void |
printExtNodes()
Prints descriptions of all external Nodes of this Phylogeny to System.out. |
void |
recalculateNumberOfExternalDescendants(boolean consider_collapsed_nodes)
(Re)counts the number of children for each PhylogenyNode of this Phylogeny. |
void |
reRoot(int id)
Places the root of this Phylogeny on the parent branch of the PhylogenyNode with a corresponding ID. |
void |
reRoot(PhylogenyBranch b)
Places the root of this Phylogeny on Branch b. |
void |
reRoot(PhylogenyNode n)
Places the root of this Phylogeny on the parent branch PhylogenyNode n. |
void |
reRoot(PhylogenyNode n,
double distance_n_to_parent)
|
void |
setAllNodesToNotCollapse()
Sets all Nodes of this Phylogeny to not-collapsed. |
void |
setConfidence(Confidence confidence)
|
void |
setDescription(String description)
|
void |
setDistanceUnit(String _distance_unit)
|
void |
setIdentifier(Identifier identifier)
|
void |
setIndicatorsToZero()
Sets the indicators of all Nodes of this Phylogeny to 0. |
void |
setName(String s)
Sets the name of this Phylogeny to s. |
void |
setRerootable(boolean rerootable)
|
void |
setRoot(PhylogenyNode n)
|
void |
setRooted(boolean b)
Sets whether this Phylogeny is rooted or not. |
void |
setType(String type)
|
Phylogeny |
subTree(PhylogenyNode node)
|
void |
swapChildren(PhylogenyNode node)
Swaps the the two childern of a PhylogenyNode node of this Phylogeny. |
String |
toNewHampshire(boolean simple_nh)
|
String |
toNewHampshireX()
|
String |
toNexus()
|
String |
toPhyloXML(int phyloxml_level)
|
String |
toString()
Converts this Phylogeny to a New Hampshire X (String) representation. |
void |
unRoot()
Removes the root PhylogenyNode this Phylogeny. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final boolean ALLOW_MULTIPLE_PARENTS_DEFAULT
Constructor Detail |
---|
public Phylogeny()
Method Detail |
---|
public void addAsChild(PhylogenyNode parent)
n
- the PhylogenyNode to addpublic void addAsSibling(PhylogenyNode sibling)
public double calculateSubtreeHeight(PhylogenyNode n)
n
- the root-node of a subtree
public Phylogeny copy()
(The resulting Phylogeny has its references in the external nodes corrected, if they are lacking/obsolete in this.)
public void deleteSubtree(PhylogenyNode remove_us, boolean collapse_resulting_node_with_one_desc)
remove_us
- the parent node of the subtree to be deletedpublic void externalNodesHaveChanged()
public String[] getAllExternalNodeNames()
public Confidence getConfidence()
public String getDescription()
public String getDistanceUnit()
public Set<PhylogenyNode> getExternalNodes()
public PhylogenyNode getFirstExternalNode()
public double getHeight()
public Identifier getIdentifier()
public String getName()
public PhylogenyNode getNode(int id) throws NoSuchElementException
id
- ID number (int) of the PhylogenyNode to find
NoSuchElementException
public PhylogenyNode getNode(String name)
name
- name (String) of PhylogenyNode to find
public List<PhylogenyNode> getNodes(String name)
name
- name (String) of Nodes to find
getNodesWithMatchingSpecies(String)
public List<PhylogenyNode> getNodesViaSequenceName(String seq_name)
public List<PhylogenyNode> getNodesViaTaxonomyCode(String taxonomy_code)
public List<PhylogenyNode> getNodesWithMatchingSpecies(String specname)
specname
- species name (String) of Nodes to find
getNodes(String)
public PhylogenyNode getNodeViaSequenceName(String seq_name)
public PhylogenyNode getNodeViaTaxonomyCode(String taxonomy_code)
public int getNumberOfBranches()
public int getNumberOfExternalNodes()
public List<PhylogenyNode> getParalogousNodes(PhylogenyNode n, String[] taxonomyCodeRange)
PRECONDITION: This tree must be binary and rooted, and speciation - duplication need to be assigned for each of its internal Nodes.
Returns null if this Phylogeny is empty or if n is internal.
(Last modified: 11/22/00) Olivier CHABROL : olivier.chabrol@univ-provence.fr
n
- external PhylogenyNode whose orthologs are to be returned
public PhylogenyNode getRoot()
public String getType()
public void hashIDs()
public void init()
public boolean isCompletelyBinary()
public boolean isEmpty()
public boolean isRerootable()
public boolean isRooted()
public boolean isTree()
public PhylogenyNodeIterator iteratorExternalForward()
public PhylogenyNodeIterator iteratorLevelOrder()
public PhylogenyNodeIterator iteratorPostorder()
public PhylogenyNodeIterator iteratorPreorder()
public int levelOrderReID(int start_label)
start_label
- the starting value for the ID numbers
public void orderAppearance(boolean order) throws IllegalStateException
order
- decides in which direction to order
IllegalStateException
public void preOrderReId()
public int preOrderReId(int start_label)
start_label
- the starting value (int)
public void printExtNodes()
public void recalculateNumberOfExternalDescendants(boolean consider_collapsed_nodes)
consider_collapsed_nodes
- set to true to take into account collapsed nodes (collapsed
nodes have 1 child).public void reRoot(int id)
id
- ID (int) of PhylogenyNode of this Phylogenypublic void reRoot(PhylogenyBranch b)
public void reRoot(PhylogenyNode n)
If the resulting reRooted Phylogeny is to be used any further, in most cases the following three methods have to be called on the resulting Phylogeny:
(Last modified: 10/01/01)
n
- PhylogenyNode of this Phylogeny\public void reRoot(PhylogenyNode n, double distance_n_to_parent)
public void setAllNodesToNotCollapse()
In most cases methods adjustNodeCount(false) and recalculateAndReset() need to be called after this method has been called.
public void setConfidence(Confidence confidence)
public void setDescription(String description)
public void setDistanceUnit(String _distance_unit)
public void setIdentifier(Identifier identifier)
public void setIndicatorsToZero()
public void setName(String s)
public void setRerootable(boolean rerootable)
public void setRoot(PhylogenyNode n)
public void setRooted(boolean b)
public void setType(String type)
public Phylogeny subTree(PhylogenyNode node) throws IllegalStateException
IllegalStateException
public void swapChildren(PhylogenyNode node) throws IllegalStateException
(Last modified: 06/13/01)
node
- a PhylogenyNode of this Phylogeny
IllegalStateException
public String toNewHampshire(boolean simple_nh)
public String toNewHampshireX()
public String toNexus()
public String toPhyloXML(int phyloxml_level)
public String toString()
toString
in class Object
toNewHampshireX()
public void unRoot() throws IllegalStateException
IllegalStateException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |