Package pal.coalescent
Class CoalescentIntervals
java.lang.Object
pal.coalescent.CoalescentIntervals
- All Implemented Interfaces:
Serializable
,Report
,Units
A series of coalescent intervals representing the time
order information contained in a (serial) clock-constrained
tree. Can model both n-coalescents and s-coalescents.
- Version:
- $Id: CoalescentIntervals.java,v 1.14 2001/08/04 19:57:31 alexi Exp $
- Author:
- Alexei Drummond, Korbinian Strimmer
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Denotes and interval after which a coalescent event is observed (i.e.static final int
Denotes an interval at the end of which a new sample addition is observed (i.e.static final int
Denotes an interval at the end of which nothing is observed (i.e.Fields inherited from interface pal.misc.Units
DAYS, EXPECTED_SUBSTITUTIONS, GENERATIONS, MONTHS, SAMPLE, SHORT_UNIT_NAMES, UNIT_NAMES, UNKNOWN, YEARS
-
Constructor Summary
ConstructorsConstructorDescriptionParameterless constructor.CoalescentIntervals
(int size) Constructor taking a number of intervals. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the log likelihood of this set of coalescent intervals, given a demographic model.int
getCoalescentEvents
(int i) Returns the number coalescent events in an intervaldouble
getInterval
(int i) Gets an interval.int
get number of intervalsint
getIntervalType
(int i) Returns the type of interval observed.int
getNumLineages
(int i) Returns the number of uncoalesced lineages within this interval.void
getSmallIntervals
(double minSize, boolean[] smallInterval) Returns a list stating which of the intervals are <= minSize (and thus should be pooled).double
get the total height of the genealogy represented by these intervals.int
getUnits()
Returns the units these coalescent intervals are measured in.void
groupIntervals
(CoalescentIntervals reference) Group intervals following a given (compatible) reference.boolean
Checks whether this set of coalescent intervals is fully resolved (i.e.boolean
Checks whether this set of coalescent intervals coalescent only (i.e.void
poolIntervals
(boolean[] smallInterval) Starting at time zero (i.e.void
poolSmallIntervals
(double minSize) Starting at time zero (i.e.void
report
(PrintWriter out) print human readable report (e.g., on parameters and associated model)void
setInterval
(int i, double value) Sets interval.void
setNumLineages
(int i, int numLines) set the number lineages for this particular interval.void
setUnits
(int u) Sets the units these coalescent intervals are measured in.toString()
-
Field Details
-
COALESCENT
public static final int COALESCENTDenotes and interval after which a coalescent event is observed (i.e. the number of lineages is smaller in the next interval)- See Also:
-
NEW_SAMPLE
public static final int NEW_SAMPLEDenotes an interval at the end of which a new sample addition is observed (i.e. the number of lineages is larger in the next interval).- See Also:
-
NOTHING
public static final int NOTHINGDenotes an interval at the end of which nothing is observed (i.e. the number of lineages is the same in the next interval).- See Also:
-
-
Constructor Details
-
CoalescentIntervals
public CoalescentIntervals()Parameterless constructor. -
CoalescentIntervals
public CoalescentIntervals(int size) Constructor taking a number of intervals.
-
-
Method Details
-
setUnits
public void setUnits(int u) Sets the units these coalescent intervals are measured in. -
getUnits
public int getUnits()Returns the units these coalescent intervals are measured in. -
getNumLineages
public int getNumLineages(int i) Returns the number of uncoalesced lineages within this interval. Required for s-coalescents, where new lineages are added as earlier samples are come across. -
setNumLineages
public void setNumLineages(int i, int numLines) set the number lineages for this particular interval. -
getCoalescentEvents
public int getCoalescentEvents(int i) Returns the number coalescent events in an interval -
getIntervalType
public int getIntervalType(int i) Returns the type of interval observed. -
getInterval
public double getInterval(int i) Gets an interval. -
setInterval
public void setInterval(int i, double value) Sets interval. -
getTotalHeight
public double getTotalHeight()get the total height of the genealogy represented by these intervals. -
getIntervalCount
public int getIntervalCount()get number of intervals -
isBinaryCoalescent
public boolean isBinaryCoalescent()Checks whether this set of coalescent intervals is fully resolved (i.e. whether is has exactly one coalescent event in each subsequent interval) -
isCoalescentOnly
public boolean isCoalescentOnly()Checks whether this set of coalescent intervals coalescent only (i.e. whether is has exactly one or more coalescent event in each subsequent interval) -
groupIntervals
Group intervals following a given (compatible) reference. The reference must have the same number of lineages at the start of the first interval, and the present CoalsecentIntervals must be fully resolved. -
getSmallIntervals
public void getSmallIntervals(double minSize, boolean[] smallInterval) Returns a list stating which of the intervals are <= minSize (and thus should be pooled). -
poolIntervals
public void poolIntervals(boolean[] smallInterval) Starting at time zero (i.e. with the interval with largest number of lineages), the specified small intervals are pooled with the next non-small interval (if this does not exist then with the previous non-small interval) -
poolSmallIntervals
public void poolSmallIntervals(double minSize) Starting at time zero (i.e. with the interval with largest number of lineages), small intervals (<= minSize) are pooled with the next non-small interval (if this does not exist then with the previous non-small interval) -
computeLogLikelihood
Returns the log likelihood of this set of coalescent intervals, given a demographic model. -
toString
-
report
Description copied from interface:Report
print human readable report (e.g., on parameters and associated model)
-