statalign.postprocess.plugins.contree
Class CNetworkNode

java.lang.Object
  extended by statalign.postprocess.plugins.contree.CNetworkNode

public class CNetworkNode
extends java.lang.Object

Nodes in the consensus network Also includes a substantial amount of code that draws the edges from the node.

Author:
wood

Field Summary
 double angleDirection
           
 double angleWidth
           
 boolean consideration
           
 CNetworkNode CopiedToNode
           
 boolean drawn
           
 java.util.ArrayList<CNetworkEdge> joins
           
 int outputNumber
           
 java.util.ArrayList<CNetworkPath> paths
           
 java.lang.String Taxaname
           
 double xPos
           
 double yPos
           
 
Constructor Summary
CNetworkNode()
          Initialise the node
 
Method Summary
 void AddToPaths(CNetworkPath pathToAdd, java.util.ArrayList<CNetworkNode> nodesToClearUp)
          Add a path to the node path list..
 java.util.ArrayList<CNetworkNode> DrawEdges(int noOfTaxa)
          Function to draw the network i.e. find x and y co-ordinates for nodes.
 CNetworkNode findFirstNonSubset(CNetworkSplit addSplit, java.util.ArrayList<CNetworkNode> consideredNodes, boolean zeroSide, int noOfTaxa)
          Recursive function used to find node at which we can add a split compatible with the network Goes up from first node and finds where edges joining are no longer subset of specified side of split we want to add
 double FindWeighting(CNetworkEdge compEdge, int noOfTaxa)
          Finds the weighting of this this node using the joins that join to it.
 void ListToAdd(CNetworkEdge neighbourLink, boolean start, java.util.ArrayList<CNetworkEdge> ListToAddTo)
          Function returns joined up ArrayList if must be joined in a certain order...
 double returnAngle(double inputAngle)
          Return an angle that is in the range 0 to 2*pi....
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

joins

public java.util.ArrayList<CNetworkEdge> joins

Taxaname

public java.lang.String Taxaname

outputNumber

public int outputNumber

CopiedToNode

public CNetworkNode CopiedToNode

paths

public java.util.ArrayList<CNetworkPath> paths

consideration

public boolean consideration

drawn

public boolean drawn

angleDirection

public double angleDirection

angleWidth

public double angleWidth

xPos

public double xPos

yPos

public double yPos
Constructor Detail

CNetworkNode

public CNetworkNode()
Initialise the node

Method Detail

AddToPaths

public void AddToPaths(CNetworkPath pathToAdd,
                       java.util.ArrayList<CNetworkNode> nodesToClearUp)
Add a path to the node path list..

Parameters:
pathToAdd - Path to add to this node's list
nodesToClearUp - List of nodes to remove paths from at end of adding split

findFirstNonSubset

public CNetworkNode findFirstNonSubset(CNetworkSplit addSplit,
                                       java.util.ArrayList<CNetworkNode> consideredNodes,
                                       boolean zeroSide,
                                       int noOfTaxa)
Recursive function used to find node at which we can add a split compatible with the network Goes up from first node and finds where edges joining are no longer subset of specified side of split we want to add

Parameters:
addSplit - Split that we are adding
consideredNodes - Nodes that we have so far considered
zeroSide - True if looking on zero side of split, otherwise false. Try to choose side with fewer taxa to improve efficiency.
noOfTaxa - Number of taxa

DrawEdges

public java.util.ArrayList<CNetworkNode> DrawEdges(int noOfTaxa)
Function to draw the network i.e. find x and y co-ordinates for nodes.

Parameters:
noOfTaxa - Number of taxa

FindWeighting

public double FindWeighting(CNetworkEdge compEdge,
                            int noOfTaxa)
Finds the weighting of this this node using the joins that join to it. Based on: a) returning "1" if it is a taxon. b) return the number of linked taxon in this direction by finding which node is a subset of this split

Parameters:
compEdge - Edge that we want to find the weighting for
noOfTaxa - Number of taxa

ListToAdd

public void ListToAdd(CNetworkEdge neighbourLink,
                      boolean start,
                      java.util.ArrayList<CNetworkEdge> ListToAddTo)
Function returns joined up ArrayList if must be joined in a certain order... Used for stitching together neighbours Runs recursively!

Parameters:
neighbourLink -
start - begin from start if true, begin from end if false
ListToAddTo -

returnAngle

public double returnAngle(double inputAngle)
Return an angle that is in the range 0 to 2*pi....

Parameters:
inputAngle - Any input angle