Package phase

Class MarkerCluster


  • public class MarkerCluster
    extends java.lang.Object

    Class MarkerCluster represents a partition of markers into contiguous marker clusters.

    Instances of class MarkerCluster are immutable.

    • Constructor Summary

      Constructors 
      Constructor Description
      MarkerCluster​(PhaseData phaseData, int sample)
      Constructs a new MarkerCluster instance from the specified data.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int clusterEnd​(int index)
      Returns the exclusive end marker for the cluster.
      int clusterStart​(int index)
      Returns the inclusive start marker for the cluster.
      boolean clustHasMissingGT​(int index)
      Returns true if the cluster has at least one missing genotype, and returns false otherwise.
      int nClusters()
      Returns the number of clusters
      int nMissingGTClusters()
      Returns the number of clusters containing at least one missing genotype.
      FloatArray pRecomb()
      Return a FloatArray of size this.nClusters() whose k-th element is the probability of transitioning to a random HMM state between the k-th cluster and the previous cluster.
      IntArray unphClusters()
      Returns a sorted list of cluster indices in increasing order for which the cluster contains an unphased heterozygote.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MarkerCluster

        public MarkerCluster​(PhaseData phaseData,
                             int sample)
        Constructs a new MarkerCluster instance from the specified data.
        Parameters:
        phaseData - the input data for the next genotype phasing iteration
        sample - a sample index
        Throws:
        java.lang.IndexOutOfBoundsException - if sample < 0 || sample >= phaseData.targGT().nSamples()
        java.lang.NullPointerException - if phaseData == null
    • Method Detail

      • 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:
        java.lang.IndexOutOfBoundsException - if index < 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:
        java.lang.IndexOutOfBoundsException - if index < 0 || index >= this.nClusteres()
      • pRecomb

        public FloatArray pRecomb()
        Return a FloatArray of size this.nClusters() whose k-th element is the probability of transitioning to a random HMM state between the k-th cluster and the previous cluster.
        Returns:
        a FloatArray of size this.nClusters() whose k-th element is the probability of transitioning to a random HMM state between the k-th cluster and the previous cluster
      • unphClusters

        public IntArray unphClusters()
        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
      • clustHasMissingGT

        public boolean clustHasMissingGT​(int index)
        Returns true if the cluster has at least one missing genotype, and returns false otherwise.
        Parameters:
        index - a cluster index
        Returns:
        true if the cluster has at least one missing genotype
        Throws:
        java.lang.IndexOutOfBoundsException - if index < 0 || index >= this.nClusters()
      • nMissingGTClusters

        public int nMissingGTClusters()
        Returns the number of clusters containing at least one missing genotype.
        Returns:
        the number of clusters with at least one missing genotype