Package phase
Class MarkerCluster
java.lang.Object
phase.MarkerCluster
Class MarkerCluster represents a partition of markers into
contiguous marker clusters.
Instances of class MarkerCluster are immutable.
-
Constructor Summary
ConstructorsConstructorDescriptionMarkerCluster(PhaseData phaseData, int sample) Constructs a newMarkerClusterinstance from the specified data. -
Method Summary
Modifier and TypeMethodDescriptionintclusterEnd(int index) Returns the exclusive end marker for the cluster.intclusterStart(int index) Returns the inclusive start marker for the cluster.booleanisHet(int cluster) Returnstrueif the cluster is a heterozygous genotype, and returnsfalseotherwise.booleanisMaskedHet(int cluster) Returnstrueif the cluster is a masked heterozygote genotype, and returnsfalseotherwise.booleanisMissingGT(int cluster) Returnstrueif the cluster has a missing genotype, and returnsfalseotherwise.booleanisMissingGtOrMaskedHet(int cluster) Returnstrueif the cluster has a missing genotype or a masked heterozygote genotype, and returnsfalseotherwise.booleanisPhasedHet(int cluster) Returnstrueif the cluster has a phased heterozygous genotype, and returnsfalseotherwise.booleanisUnphasedHet(int cluster) Returnstrueif the cluster has an unphased heterozygous genotype, and returnsfalseotherwise.intReturns the number of clusterspRecomb()Return aFloatArrayof sizethis.nClusters()whosek-th element is the probability of transitioning to a random HMM state between thek-th cluster and the previous cluster.Return the estimated haplotypes.Returns a sorted list of cluster indices in increasing order for which the cluster contains an unphased heterozygote.
-
Constructor Details
-
MarkerCluster
Constructs a newMarkerClusterinstance from the specified data.- Parameters:
phaseData- the input data for the next genotype phasing iterationsample- a sample index- Throws:
IndexOutOfBoundsException- ifsample < 0 || sample >= phaseData.targGT().nSamples()NullPointerException- ifphaseData == null
-
-
Method Details
-
samplePhase
Return the estimated haplotypes.- Returns:
- the estimated haplotypes
-
nClusters
public int nClusters()Returns the number of clusters- Returns:
- the number of clusters
-
clusterStart
public int clusterStart(int index) Returns the inclusive start marker for the cluster.- Parameters:
index- a cluster index- Returns:
- the inclusive start marker for the cluster
- Throws:
IndexOutOfBoundsException- ifindex < 0 || index >= this.nClusteres()
-
clusterEnd
public int clusterEnd(int index) Returns the exclusive end marker for the cluster.- Parameters:
index- a cluster index- Returns:
- the exclusive marker for the cluster
- Throws:
IndexOutOfBoundsException- ifindex < 0 || index >= this.nClusteres()
-
pRecomb
Return aFloatArrayof sizethis.nClusters()whosek-th element is the probability of transitioning to a random HMM state between thek-th cluster and the previous cluster.- Returns:
- a
FloatArrayof sizethis.nClusters()whosek-th element is the probability of transitioning to a random HMM state between thek-th cluster and the previous cluster
-
unphasedHetClusters
Returns a sorted list of cluster indices in increasing order for which the cluster contains an unphased heterozygote.- Returns:
- a sorted list of cluster indices in increasing order for which the cluster contains an unphased heterozygote
-
isUnphasedHet
public boolean isUnphasedHet(int cluster) Returnstrueif the cluster has an unphased heterozygous genotype, and returnsfalseotherwise.- Parameters:
cluster- a cluster index- Returns:
trueif the cluster has an unphased heterozygous genotype, and returnsfalseotherwise- Throws:
IndexOutOfBoundsException- ifcluster < 0 || cluster >= this.nClusters()
-
isPhasedHet
public boolean isPhasedHet(int cluster) Returnstrueif the cluster has a phased heterozygous genotype, and returnsfalseotherwise.- Parameters:
cluster- a cluster index- Returns:
trueif the cluster has a phased heterozygous genotype, and returnsfalseotherwise- Throws:
IndexOutOfBoundsException- ifcluster < 0 || cluster >= this.nClusters()
-
isHet
public boolean isHet(int cluster) Returnstrueif the cluster is a heterozygous genotype, and returnsfalseotherwise.- Parameters:
cluster- a cluster index- Returns:
trueif the cluster is a heterozygous genotype, andfalseotherwise- Throws:
IndexOutOfBoundsException- ifcluster < 0 || cluster >= this.nClusters()
-
isMissingGT
public boolean isMissingGT(int cluster) Returnstrueif the cluster has a missing genotype, and returnsfalseotherwise.- Parameters:
cluster- a cluster index- Returns:
trueif the cluster has a missing genotype- Throws:
IndexOutOfBoundsException- ifcluster < 0 || cluster >= this.nClusters()
-
isMaskedHet
public boolean isMaskedHet(int cluster) Returnstrueif the cluster is a masked heterozygote genotype, and returnsfalseotherwise.- Parameters:
cluster- a cluster index- Returns:
trueif the cluster is a masked heterozygote genotype- Throws:
IndexOutOfBoundsException- iftcluster < 0 || cluster >= this.nClusters()
-
isMissingGtOrMaskedHet
public boolean isMissingGtOrMaskedHet(int cluster) Returnstrueif the cluster has a missing genotype or a masked heterozygote genotype, and returnsfalseotherwise.- Parameters:
cluster- a cluster index- Returns:
trueif the cluster has a missing genotype or a masked heterozygote genotype, and returnsfalseotherwise- Throws:
IndexOutOfBoundsException- ifcluster < 0 || cluster >= this.nClusters()
-