Package main

Class CurrentData


  • public class CurrentData
    extends java.lang.Object

    Class CurrentData represents input data for the current marker window. All marker indices returned my methods of class CurrentData are indexed with respect to the current marker window.

    Instances of class CurrentData are immutable.

    • Constructor Summary

      Constructors 
      Constructor Description
      CurrentData​(Par par, GeneticMap genMap, Data data, GT overlapHaps)
      Constructs a new CurrentData instance from the specified data.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<HapPair> addRestrictedRefHapPairs​(java.util.List<BitHapPair> list)
      Returns a list with the specified haplotypes following by the reference haplotype pairs that are restricted to the target data markers.
      Samples allSamples()
      Returns a list of all target and reference samples.
      FloatArray genDist()
      Return a FloatArray of size this.nTargMarkers() whose k-th element is the genetic distance between the k-th target marker and the previous marker, or 0.0 if (k == 0).
      float intensity()
      Returns the intensity used to generate the pRecomb values.
      MarkerMap map()
      Returns the genetic map.
      int markerIndex​(int targetMarker)
      Returns the index of the specified marker in the reference data markers.
      int[] markerIndices()
      Returns an array of length this.nTargMarkers() which maps the k-th marker in the list of target data markers to the index of the marker in the list of reference data markers.
      Markers markers()
      Returns the list of reference data markers.
      int nAllSamples()
      Returns the number of reference and target samples.
      int nextOverlapStart()
      Returns the first marker index in the overlap between this marker window and the next marker window, or returns this.nMarkers() the next marker window is from a different chromosome.
      int nextSpliceStart()
      Returns the first marker index after the splice point between this marker window and the next marker window, or returns this.nMarkers() if there is no overlap or if there are no markers after the splice point.
      int nextTargetOverlapStart()
      Returns the first target marker index in the overlap between this marker window and the next marker window, or returns this.nMarkers() if there is no overlap or if there are no target markers in the overlap.
      int nextTargetSpliceStart()
      Returns the first target marker index after the splice point between this marker window and the next marker window, or returns this.nTargMarkers() if there is no overlap or if there are no target markers after the splice point
      int nHaps()  
      int nMarkers()
      Returns the number of reference data markers.
      int nRefHaps()
      Returns the number of reference haplotypes.
      int nRefSamples()
      Returns the number of reference samples.
      int nTargetSamples()
      Returns the number of target samples.
      int nTargHaps()
      Returns the number of target haplotypes.
      int nTargMarkers()
      Returns the number of target data markers.
      Par par()
      Return the analysis parameters.
      Pedigree ped()
      Returns the parent-offspring relationships.
      int prevSpliceStart()
      Returns the first marker index after the splice point with the previous marker window.
      int prevTargetSpliceStart()
      Returns the first target marker index after the splice point with the previous marker window.
      RefGT refGT()
      Returns the phased, nonmissing reference genotype data or null if there are no reference data.
      Samples refSamples()
      Returns the list of reference samples, or null if there are no reference samples.
      RefGT restrictRefGT()
      Returns the phased, nonmissing reference genotype data for the target data markers or null if there are no reference data.
      GT targGT()
      Returns the genotype likelihoods for the target samples at the target data markers.
      int targMarkerIndex​(int marker)
      Returns the index of the specified marker in the target data, or returns -1 if the marker is not present in the target data.
      int[] targMarkerIndices()
      Returns an array of length this.nMarkers() whose k-th element is the index of the k-th marker in the list of target markers or is -1 if the marker is not present in the target data.
      Markers targMarkers()
      Returns the list of target data markers.
      Samples targSamples()
      Returns the list of target samples.
      int window()
      Returns the marker window index.
      • Methods inherited from class java.lang.Object

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

      • CurrentData

        public CurrentData​(Par par,
                           GeneticMap genMap,
                           Data data,
                           GT overlapHaps)
        Constructs a new CurrentData instance from the specified data.
        Parameters:
        par - the analysis parameters
        genMap - the genetic map or null if no genetic map is specified
        data - input data for the current marker window
        overlapHaps - haplotype constraints in the overlap with previous window or null if no such constraints exist
        Throws:
        java.lang.IllegalArgumentException - if (overlapHaps != null && data.targetSamples().equals(overlapHaps.samples()) == false)
        java.lang.IllegalArgumentException - if (overlapHaps != null && overlapHaps.marker(j).equals(data.targGT().marker(j) == false) for some j satisfying (0 <= j && j <= overlapHaps.nMarkers())
        java.lang.IllegalArgumentException - if overlapHaps != null && overlapHaps.isPhased() == false
        java.lang.NullPointerException - if any parameter is null
    • Method Detail

      • par

        public Par par()
        Return the analysis parameters.
        Returns:
        the analysis parameters
      • window

        public int window()
        Returns the marker window index.
        Returns:
        the marker window index
      • nextOverlapStart

        public int nextOverlapStart()
        Returns the first marker index in the overlap between this marker window and the next marker window, or returns this.nMarkers() the next marker window is from a different chromosome.
        Returns:
        the first marker index in the overlap between this marker window and the next marker window
      • nextTargetOverlapStart

        public int nextTargetOverlapStart()
        Returns the first target marker index in the overlap between this marker window and the next marker window, or returns this.nMarkers() if there is no overlap or if there are no target markers in the overlap.
        Returns:
        the first target marker index in the overlap between this marker window and the next marker window
      • prevSpliceStart

        public int prevSpliceStart()
        Returns the first marker index after the splice point with the previous marker window. Returns 0 if the current marker window is the first marker window.
        Returns:
        the first marker index after the splice point with the previous marker window
      • nextSpliceStart

        public int nextSpliceStart()
        Returns the first marker index after the splice point between this marker window and the next marker window, or returns this.nMarkers() if there is no overlap or if there are no markers after the splice point.
        Returns:
        the first marker index after the next splice point
      • prevTargetSpliceStart

        public int prevTargetSpliceStart()
        Returns the first target marker index after the splice point with the previous marker window. Returns 0 if the current marker window is the first marker window.
        Returns:
        the first target marker index after the splice point with the previous marker window
      • nextTargetSpliceStart

        public int nextTargetSpliceStart()
        Returns the first target marker index after the splice point between this marker window and the next marker window, or returns this.nTargMarkers() if there is no overlap or if there are no target markers after the splice point
        Returns:
        the first target marker index after the next splice point
      • ped

        public Pedigree ped()
        Returns the parent-offspring relationships.
        Returns:
        the parent-offspring relationships
      • nRefHaps

        public int nRefHaps()
        Returns the number of reference haplotypes.
        Returns:
        the number of reference haplotypes
      • nRefSamples

        public int nRefSamples()
        Returns the number of reference samples.
        Returns:
        the number of reference samples
      • refSamples

        public Samples refSamples()
        Returns the list of reference samples, or null if there are no reference samples.
        Returns:
        the list of reference samples, or null if there are no reference samples
      • nTargHaps

        public int nTargHaps()
        Returns the number of target haplotypes.
        Returns:
        the number of target haplotypes
      • nTargetSamples

        public int nTargetSamples()
        Returns the number of target samples.
        Returns:
        the number of target samples
      • targSamples

        public Samples targSamples()
        Returns the list of target samples.
        Returns:
        the list of target samples
      • nHaps

        public int nHaps()
      • nAllSamples

        public int nAllSamples()
        Returns the number of reference and target samples.
        Returns:
        the number of reference and target samples
      • allSamples

        public Samples allSamples()
        Returns a list of all target and reference samples. Target samples are listed first in the same order as the list returned by this.targetSamples(). Reference samples are listed last in the same order as the list returned by this.refSamples().
        Returns:
        a list of all target and reference samples
      • nTargMarkers

        public int nTargMarkers()
        Returns the number of target data markers.
        Returns:
        the number of target data markers
      • targMarkers

        public Markers targMarkers()
        Returns the list of target data markers.
        Returns:
        the list of target data markers
      • nMarkers

        public int nMarkers()
        Returns the number of reference data markers.
        Returns:
        the number of reference data markers
      • markers

        public Markers markers()
        Returns the list of reference data markers.
        Returns:
        the list of reference data markers
      • markerIndex

        public int markerIndex​(int targetMarker)
        Returns the index of the specified marker in the reference data markers.
        Parameters:
        targetMarker - index of a marker in the list of target data markers
        Returns:
        the index of the specified marker in the reference data markers
        Throws:
        java.lang.IndexOutOfBoundsException - if targetMarker < 0 || targetMarker >= this.nTargMarkers()
      • markerIndices

        public int[] markerIndices()
        Returns an array of length this.nTargMarkers() which maps the k-th marker in the list of target data markers to the index of the marker in the list of reference data markers.
        Returns:
        an array of length this.nTargMarkers() which maps the k-th marker in the list of target data markers to the index of the marker in the list of reference data markers
      • targMarkerIndex

        public int targMarkerIndex​(int marker)
        Returns the index of the specified marker in the target data, or returns -1 if the marker is not present in the target data.
        Parameters:
        marker - index of a marker in the reference data
        Returns:
        the index of the specified marker in the target data, or returns -1 if the marker is not present in the target data
        Throws:
        java.lang.IndexOutOfBoundsException - if marker < 0 || marker >= this.nMarkers().
      • targMarkerIndices

        public int[] targMarkerIndices()
        Returns an array of length this.nMarkers() whose k-th element is the index of the k-th marker in the list of target markers or is -1 if the marker is not present in the target data.
        Returns:
        an array of length this.nMarkers() whose k-th element is the index of the k-th marker in the list of target markers or is -1 if the marker is not present in the target data
      • addRestrictedRefHapPairs

        public java.util.List<HapPair> addRestrictedRefHapPairs​(java.util.List<BitHapPair> list)
        Returns a list with the specified haplotypes following by the reference haplotype pairs that are restricted to the target data markers.
        Parameters:
        list - a list of haplotype pairs for target data markers
        Returns:
        a list with the specified haplotypes following by the reference haplotype pairs that are restricted to the target data markers
        Throws:
        java.lang.NullPointerException - if list == null
      • refGT

        public RefGT refGT()
        Returns the phased, nonmissing reference genotype data or null if there are no reference data.
        Returns:
        the reference genotype data or null if there are no reference data
      • restrictRefGT

        public RefGT restrictRefGT()
        Returns the phased, nonmissing reference genotype data for the target data markers or null if there are no reference data.
        Returns:
        the reference genotype data for the target data markers or null if there are no reference data
      • targGT

        public GT targGT()
        Returns the genotype likelihoods for the target samples at the target data markers.
        Returns:
        the genotype likelihoods for the target samples at the target data markers.
      • intensity

        public float intensity()
        Returns the intensity used to generate the pRecomb values.
        Returns:
        the intensity used to generate the pRecomb values
      • map

        public MarkerMap map()
        Returns the genetic map.
        Returns:
        the genetic map
      • genDist

        public FloatArray genDist()
        Return a FloatArray of size this.nTargMarkers() whose k-th element is the genetic distance between the k-th target marker and the previous marker, or 0.0 if (k == 0).
        Returns:
        a FloatArray of size this.nTargMarkers() whose k-th element is the genetic distance between the k-th target marker and the previous marker,