statalign.postprocess.plugins.contree
Class CNetworkSplit

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

public class CNetworkSplit
extends java.lang.Object

Splits in the consensus network Includes several functions to check degrees of compatibility with another split

Author:
wood

Field Summary
 double direction
           
 double edgelength
           
 java.util.ArrayList<CNetworkEdge> edges
           
 int noOfOccurences
           
 java.util.BitSet split
           
 
Constructor Summary
CNetworkSplit()
          Constructs a new split.
 
Method Summary
 double getSubsetJoins(CNetworkEdge currentEdge, int noOfTaxa)
          Takes an input edge and finds the side of this split it occurs on and then returns the number of taxa on that side of this split.
 boolean isCompatible(CNetworkSplit comp, int noOfTaxa)
          Compares an input split to see if it is compatible with this one.
 boolean isSubset(CNetworkSplit comp, boolean zeroSide, int noOfTaxa)
          Compares an input split to see if the argument split is a subset of the specified side of this split?
 boolean OnZeroSide(CNetworkSplit comp, int noOfTaxa)
          Compares an input split to see if the input split occurs on the zero side of this split.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

edges

public java.util.ArrayList<CNetworkEdge> edges

split

public java.util.BitSet split

edgelength

public double edgelength

noOfOccurences

public int noOfOccurences

direction

public double direction
Constructor Detail

CNetworkSplit

public CNetworkSplit()
Constructs a new split.

Method Detail

isCompatible

public boolean isCompatible(CNetworkSplit comp,
                            int noOfTaxa)
Compares an input split to see if it is compatible with this one. i.e. is one of the sides of one split entirely within one side of the other.

Parameters:
comp - The split to compare this one with
noOfTaxa - The number of taxa as the count function on size of a BitSet is strange

OnZeroSide

public boolean OnZeroSide(CNetworkSplit comp,
                          int noOfTaxa)
Compares an input split to see if the input split occurs on the zero side of this split.

Parameters:
comp - The split to try and find in the zero side of this split
noOfTaxa - The number of taxa as the count function on size of a BitSet is strange

isSubset

public boolean isSubset(CNetworkSplit comp,
                        boolean zeroSide,
                        int noOfTaxa)
Compares an input split to see if the argument split is a subset of the specified side of this split? NOTE: assumes that splits are COMPATIBLE to begin with i.e. all combinations CANNOT be true!!

Parameters:
comp - The split we want to find as a subset
zeroSide - If we want the split on the zeroside of this split then set as true, if on the other side then as false...
noOfTaxa - The number of taxa as the count function on size of a BitSet is strange

getSubsetJoins

public double getSubsetJoins(CNetworkEdge currentEdge,
                             int noOfTaxa)
Takes an input edge and finds the side of this split it occurs on and then returns the number of taxa on that side of this split. NOTE: assumes that splits are COMPATIBLE to begin with i.e. all combinations CANNOT be true!

Parameters:
currentEdge - An edge from this node to compare
noOfTaxa - The number of taxa as the count function on size of a BitSet is strange