public class ActivityProfile
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected double |
activeProbThreshold |
protected int |
contigLength
A cached value of the regionStartLoc contig length, to make calls to
getCurrentContigLength efficient
|
protected int |
maxProbPropagationDistance |
protected SimpleInterval |
regionStartLoc |
protected SimpleInterval |
regionStopLoc |
protected java.util.Set<SimpleInterval> |
restrictToIntervals |
protected htsjdk.samtools.SAMFileHeader |
samHeader |
protected java.util.List<ActivityProfileState> |
stateList |
Constructor and Description |
---|
ActivityProfile(int maxProbPropagationDistance,
double activeProbThreshold,
htsjdk.samtools.SAMFileHeader header)
Create a new empty ActivityProfile
|
ActivityProfile(int maxProbPropagationDistance,
double activeProbThreshold,
java.util.Set<SimpleInterval> intervals,
htsjdk.samtools.SAMFileHeader header)
Create a empty ActivityProfile, restricting output to profiles overlapping intervals, if not null
|
Modifier and Type | Method and Description |
---|---|
void |
add(ActivityProfileState state)
Add the next ActivityProfileState to this profile.
|
java.lang.String |
getContig() |
int |
getEnd() |
protected SimpleInterval |
getLocForOffset(SimpleInterval relativeLoc,
int offset)
Helper function that gets the interval for a site offset from relativeLoc, protecting ourselves from
falling off the edge of the contig.
|
int |
getMaxProbPropagationDistance()
How far away can probability mass be moved around in this profile?
This distance puts an upper limit on how far, in bp, we will ever propagate probability mass around
when adding a new ActivityProfileState.
|
protected double[] |
getProbabilitiesAsArray()
Get the probabilities of the states as a single linear array of doubles
|
SimpleInterval |
getSpan()
Get the span of this activity profile, which is from the start of the first state to the stop of the last
|
protected java.util.List<ActivityProfileState> |
getStateList()
Get the list of activity profile results in this object
|
boolean |
isEmpty()
Is this profile empty? (ie., does it contain no ActivityProfileStates?)
|
java.util.List<AssemblyRegion> |
popReadyAssemblyRegions(int assemblyRegionExtension,
int minRegionSize,
int maxRegionSize,
boolean forceConversion)
Get the next completed assembly regions from this profile, and remove all states supporting them from this profile
Takes the current profile and finds all of the active / inactive from the start of the profile that are
ready.
|
protected java.util.Collection<ActivityProfileState> |
processState(ActivityProfileState justAddedState)
Process justAddedState, returning a collection of derived states that actually be added to the stateList
The purpose of this function is to transform justAddedStates, if needed, into a series of atomic states
that we actually want to track.
|
int |
size()
How many profile results are in this profile?
|
java.lang.String |
toString() |
protected final java.util.List<ActivityProfileState> stateList
protected final java.util.Set<SimpleInterval> restrictToIntervals
protected final int maxProbPropagationDistance
protected final double activeProbThreshold
protected SimpleInterval regionStartLoc
protected SimpleInterval regionStopLoc
protected htsjdk.samtools.SAMFileHeader samHeader
protected int contigLength
public ActivityProfile(int maxProbPropagationDistance, double activeProbThreshold, htsjdk.samtools.SAMFileHeader header)
maxProbPropagationDistance
- region probability propagation distance beyond its maximum sizeactiveProbThreshold
- threshold for the probability of an activity profile state being activepublic ActivityProfile(int maxProbPropagationDistance, double activeProbThreshold, java.util.Set<SimpleInterval> intervals, htsjdk.samtools.SAMFileHeader header)
maxProbPropagationDistance
- region probability propagation distance beyond its maximum sizeactiveProbThreshold
- threshold for the probability of a profile state being activeintervals
- only include states that are within these intervals, if not nullpublic java.lang.String toString()
toString
in class java.lang.Object
public int getMaxProbPropagationDistance()
public int size()
public boolean isEmpty()
public SimpleInterval getSpan()
public java.lang.String getContig()
public int getEnd()
protected java.util.List<ActivityProfileState> getStateList()
protected double[] getProbabilitiesAsArray()
protected SimpleInterval getLocForOffset(SimpleInterval relativeLoc, int offset)
relativeLoc
- the location offset is relative tooffset
- the offset from relativeLoc where we'd like to create a GenomeLocpublic void add(ActivityProfileState state)
state
- a well-formed ActivityProfileState result to incorporate into this profileprotected java.util.Collection<ActivityProfileState> processState(ActivityProfileState justAddedState)
justAddedState
- the state our client provided to use to add to the listpublic java.util.List<AssemblyRegion> popReadyAssemblyRegions(int assemblyRegionExtension, int minRegionSize, int maxRegionSize, boolean forceConversion)
assemblyRegionExtension
- the extension value to provide to the constructed regionsminRegionSize
- the minimum region size, in the case where we have to cut up regions that are too largemaxRegionSize
- the maximize size of the returned regionforceConversion
- if true, we'll return a region whose end isn't sufficiently far from the end of the
stateList. Used to close out the active region when we've hit some kind of end (such
as the end of the contig)