Package vcf

Interface GT

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      int allele​(int marker, int hap)
      Returns the allele on the specified haplotype for the specified marker or return -1 if the allele is missing.
      int allele1​(int marker, int sample)
      Returns the first allele for the specified marker and sample or return -1 if the allele is missing.
      int allele2​(int marker, int sample)
      Returns the second allele for the specified marker and sample or return -1 if the allele is missing.
      default float gl​(int marker, int sample, int allele1, int allele2)
      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.
      default boolean isGTData()
      Returns true if the value returned by this.gl() is determined by a called or missing genotype, and returns false otherwise.
      boolean isPhased()
      Returns true if the genotype for each marker and sample is a phased, non-missing genotype, and returns false otherwise.
      boolean isPhased​(int sample)
      Returns true if the genotype for each marker for the specified sample is a phased, nonmissing genotype, and returns false otherwise.
      boolean isPhased​(int marker, int sample)
      Returns true if the genotype for the specified marker and sample is a phased, nonmissing genotype, and returns false otherwise.
      Marker marker​(int marker)
      Returns the specified marker.
      Markers markers()
      Returns the list of markers.
      default int nHaps()
      Returns the number of haplotypes.
      int nMarkers()
      Returns the number of markers.
      int nSamples()
      Returns the number of samples.
      Samples samples()
      Returns the list of samples.
    • Method Detail

      • nMarkers

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

        Markers markers()
        Returns the list of markers.
        Returns:
        the list of markers
      • marker

        Marker marker​(int marker)
        Returns the specified marker.
        Parameters:
        marker - a marker index
        Returns:
        the specified marker
        Throws:
        java.lang.IndexOutOfBoundsException - if marker < 0 || marker >= this.nMarkers()
      • nHaps

        default int nHaps()
        Returns the number of haplotypes. The returned value is equal to 2*this.nSamples().
        Returns:
        the number of haplotypes
      • nSamples

        int nSamples()
        Returns the number of samples.
        Returns:
        the number of samples
      • samples

        Samples samples()
        Returns the list of samples.
        Returns:
        the list of samples
      • allele1

        int allele1​(int marker,
                    int sample)
        Returns the first allele for the specified marker and sample or return -1 if the allele is missing. The two alleles for a sample are arbitrarily ordered if this.unphased(marker, sample) == false.
        Parameters:
        marker - the marker index
        sample - the sample index
        Returns:
        the first allele for the specified marker and sample
        Throws:
        java.lang.IndexOutOfBoundsException - if marker < 0 || marker >= this.nMarkers()
        java.lang.IndexOutOfBoundsException - if sample < 0 || sample >= this.nSamples()
      • allele2

        int allele2​(int marker,
                    int sample)
        Returns the second allele for the specified marker and sample or return -1 if the allele is missing. The two alleles for a sample are arbitrarily ordered if this.unphased(marker, sample) == false.
        Parameters:
        marker - the marker index
        sample - the sample index
        Returns:
        the allele for the specified marker and sample
        Throws:
        java.lang.IndexOutOfBoundsException - if marker < 0 || marker >= this.nMarkers()
        java.lang.IndexOutOfBoundsException - if sample < 0 || sample >= this.nSamples()
      • allele

        int allele​(int marker,
                   int hap)
        Returns the allele on the specified haplotype for the specified marker or return -1 if the allele is missing. The two alleles for an individual are arbitrarily ordered if this.unphased(marker, hap/2) == false.
        Parameters:
        marker - the marker index
        hap - the haplotype index
        Returns:
        the allele on the specified haplotype for the specified marker
        Throws:
        java.lang.IndexOutOfBoundsException - if marker < 0 || marker >= this.nMarkers()
        java.lang.IndexOutOfBoundsException - if hap < 0 || hap >= this.nHaps()
      • isPhased

        boolean isPhased​(int marker,
                         int sample)
        Returns true if the genotype for the specified marker and sample is a phased, nonmissing genotype, and returns false otherwise.
        Parameters:
        marker - the marker index
        sample - the sample index
        Returns:
        true if the genotype for the specified marker and sample is a phased, nonmissing genotype
        Throws:
        java.lang.IndexOutOfBoundsException - if marker < 0 || marker >= this.nMarkers()
        java.lang.IndexOutOfBoundsException - if sample < 0 || sample >= this.nSamples()
      • isPhased

        boolean isPhased​(int sample)
        Returns true if the genotype for each marker for the specified sample is a phased, nonmissing genotype, and returns false otherwise.
        Parameters:
        sample - a sample index
        Returns:
        true if the genotype for each marker for the specified sample is a phased, nonmissing genotype
        Throws:
        java.lang.IndexOutOfBoundsException - if sample < 0 || sample >= this.nSamples()
      • isPhased

        boolean isPhased()
        Returns true if the genotype for each marker and sample is a phased, non-missing genotype, and returns false otherwise.
        Returns:
        true if the genotype for each marker and sample is a phased, non-missing genotype
      • isGTData

        default boolean isGTData()
        Returns true if the value returned by this.gl() is determined by a called or missing genotype, and returns false otherwise.
        Returns:
        true if the value returned by this.gl() is determined by a called or missing genotype
      • gl

        default float gl​(int marker,
                         int sample,
                         int allele1,
                         int allele2)
        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.
        Parameters:
        marker - the marker index
        sample - the sample index
        allele1 - the first allele index
        allele2 - 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
        Throws:
        java.lang.IndexOutOfBoundsException - if marker < 0 || marker >= this.nMarkers()
        java.lang.IndexOutOfBoundsException - if samples < 0 || samples >= this.nSamples()
        java.lang.IndexOutOfBoundsException - if allele1 < 0 || allele1 >= this.marker(marker).nAlleles()
        java.lang.IndexOutOfBoundsException - if allele2 < 0 || allele2 >= this.marker(marker).nAlleles()