Package phase

Class MarkerCluster

java.lang.Object
phase.MarkerCluster

public class MarkerCluster extends 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

    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
    isHet(int cluster)
    Returns true if the cluster is a heterozygous genotype, and returns false otherwise.
    boolean
    isMaskedHet(int cluster)
    Returns true if the cluster is a masked heterozygote genotype, and returns false otherwise.
    boolean
    isMissingGT(int cluster)
    Returns true if the cluster has a missing genotype, and returns false otherwise.
    boolean
    Returns true if the cluster has a missing genotype or a masked heterozygote genotype, and returns false otherwise.
    boolean
    isPhasedHet(int cluster)
    Returns true if the cluster has a phased heterozygous genotype, and returns false otherwise.
    boolean
    isUnphasedHet(int cluster)
    Returns true if the cluster has an unphased heterozygous genotype, and returns false otherwise.
    int
    Returns the number of clusters
    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.
    Return the estimated haplotypes.
    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 Details

    • 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:
      IndexOutOfBoundsException - if sample < 0 || sample >= phaseData.targGT().nSamples()
      NullPointerException - if phaseData == null
  • Method Details

    • samplePhase

      public SamplePhase 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 - 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:
      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
    • unphasedHetClusters

      public IntArray 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)
      Returns true if the cluster has an unphased heterozygous genotype, and returns false otherwise.
      Parameters:
      cluster - a cluster index
      Returns:
      true if the cluster has an unphased heterozygous genotype, and returns false otherwise
      Throws:
      IndexOutOfBoundsException - if cluster < 0 || cluster >= this.nClusters()
    • isPhasedHet

      public boolean isPhasedHet(int cluster)
      Returns true if the cluster has a phased heterozygous genotype, and returns false otherwise.
      Parameters:
      cluster - a cluster index
      Returns:
      true if the cluster has a phased heterozygous genotype, and returns false otherwise
      Throws:
      IndexOutOfBoundsException - if cluster < 0 || cluster >= this.nClusters()
    • isHet

      public boolean isHet(int cluster)
      Returns true if the cluster is a heterozygous genotype, and returns false otherwise.
      Parameters:
      cluster - a cluster index
      Returns:
      true if the cluster is a heterozygous genotype, and false otherwise
      Throws:
      IndexOutOfBoundsException - if cluster < 0 || cluster >= this.nClusters()
    • isMissingGT

      public boolean isMissingGT(int cluster)
      Returns true if the cluster has a missing genotype, and returns false otherwise.
      Parameters:
      cluster - a cluster index
      Returns:
      true if the cluster has a missing genotype
      Throws:
      IndexOutOfBoundsException - if cluster < 0 || cluster >= this.nClusters()
    • isMaskedHet

      public boolean isMaskedHet(int cluster)
      Returns true if the cluster is a masked heterozygote genotype, and returns false otherwise.
      Parameters:
      cluster - a cluster index
      Returns:
      true if the cluster is a masked heterozygote genotype
      Throws:
      IndexOutOfBoundsException - ift cluster < 0 || cluster >= this.nClusters()
    • isMissingGtOrMaskedHet

      public boolean isMissingGtOrMaskedHet(int cluster)
      Returns true if the cluster has a missing genotype or a masked heterozygote genotype, and returns false otherwise.
      Parameters:
      cluster - a cluster index
      Returns:
      true if the cluster has a missing genotype or a masked heterozygote genotype, and returns false otherwise
      Throws:
      IndexOutOfBoundsException - if cluster < 0 || cluster >= this.nClusters()