Package vcf

Class XBasicGT1

  • All Implemented Interfaces:
    XGT1

    public final class XBasicGT1
    extends java.lang.Object
    implements XGT1

    Class XBasicGT1 represents genotype likelihoods for one sample.

    Instances of class XBasicGT1 are immutable.

    • Constructor Summary

      Constructors 
      Constructor Description
      XBasicGT1​(GT gl, int sample)
      Constructs a XBasicGL1 instance from the specified data.
      XBasicGT1​(GT gt, int sample, int father, int mother)
      Constructs a XBasicGL1 instance from the specified data.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int allele1​(int marker)
      Returns the first allele for the specified marker if the observed data include a non-missing allele, and returns -1 otherwise.
      int allele2​(int marker)
      Returns the second allele for the specified marker if the observed data include a non-missing allele, and returns -1 otherwise.
      float gl​(int marker, int a1, int a2)
      Returns the probability of the observed data for the specified marker if the specified pair of ordered alleles is the true ordered genotype.
      int idIndex()
      Returns the sample identifier index.
      Marker marker​(int markerIndex)
      Returns the specified marker.
      Markers markers()
      Returns the list of markers.
      int nMarkers()
      Returns the number of markers.
      java.lang.String toString()
      Returns a string representation of this.
      • Methods inherited from class java.lang.Object

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

      • XBasicGT1

        public XBasicGT1​(GT gl,
                         int sample)
        Constructs a XBasicGL1 instance from the specified data.
        Parameters:
        gl - the genotype likelihoods
        sample - the sample index
        Throws:
        java.lang.IndexOutOfBoundsException - if samples < 0 || sample >= gl.nSamples()
        java.lang.NullPointerException - if gl == null
      • XBasicGT1

        public XBasicGT1​(GT gt,
                         int sample,
                         int father,
                         int mother)
        Constructs a XBasicGL1 instance from the specified data.
        Parameters:
        gt - the genotype data
        sample - the sample index
        father - the sample index of the sample's father, or -1 if the father is not genotyped
        mother - the sample index of the sample's mother, or -1 if the mother is not genotyped
        Throws:
        java.lang.IndexOutOfBoundsException - if samples < 0 || sample >= gl.nSamples()
        java.lang.NullPointerException - if gl == null
    • Method Detail

      • gl

        public float gl​(int marker,
                        int a1,
                        int a2)
        Description copied from interface: XGT1
        Returns the probability of the observed data for the specified marker if the specified pair of ordered alleles is the true ordered genotype.
        Specified by:
        gl in interface XGT1
        Parameters:
        marker - the marker index
        a1 - the first allele index
        a2 - the second allele index
        Returns:
        the probability of the observed data for the specified marker and sample if the specified pair of ordered alleles is the true ordered genotype
      • allele1

        public int allele1​(int marker)
        Description copied from interface: XGT1
        Returns the first allele for the specified marker if the observed data include a non-missing allele, and returns -1 otherwise. Alleles are arbitrarily ordered if the genotype is unphased.
        Specified by:
        allele1 in interface XGT1
        Parameters:
        marker - the marker index
        Returns:
        the first allele for the specified marker if the observed data include a non-missing allele, and -1 otherwise
      • allele2

        public int allele2​(int marker)
        Description copied from interface: XGT1
        Returns the second allele for the specified marker if the observed data include a non-missing allele, and returns -1 otherwise. Alleles are arbitrarily ordered if the genotype is unphased.
        Specified by:
        allele2 in interface XGT1
        Parameters:
        marker - the marker index
        Returns:
        the second allele for the specified marker if the observed data include a non-missing allele, and -1 otherwise
      • nMarkers

        public int nMarkers()
        Description copied from interface: XGT1
        Returns the number of markers.
        Specified by:
        nMarkers in interface XGT1
        Returns:
        the number of markers
      • marker

        public Marker marker​(int markerIndex)
        Description copied from interface: XGT1
        Returns the specified marker.
        Specified by:
        marker in interface XGT1
        Parameters:
        markerIndex - the marker index
        Returns:
        the specified marker
      • markers

        public Markers markers()
        Description copied from interface: XGT1
        Returns the list of markers.
        Specified by:
        markers in interface XGT1
        Returns:
        the list of markers
      • idIndex

        public int idIndex()
        Description copied from interface: XGT1
        Returns the sample identifier index.
        Specified by:
        idIndex in interface XGT1
        Returns:
        the sample identifier index
      • toString

        public java.lang.String toString()
        Description copied from interface: XGT1
        Returns a string representation of this. The exact details of the representation are unspecified and subject to change.
        Specified by:
        toString in interface XGT1
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of this