Package vcf

Interface GTRec

    • Method Detail

      • samples

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

        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

        float gl​(int sample,
                 int allele1,
                 int allele2)
        Returns the probability of the observed data for the specified sample if the specified pair of ordered alleles is the true ordered genotype.
        Parameters:
        sample - the sample index
        allele1 - the first allele index
        allele2 - the second allele index
        Returns:
        the probability of the observed data for the specified sample if the specified pair of ordered alleles is the true ordered genotype.
        Throws:
        java.lang.IndexOutOfBoundsException - if samples < 0 || samples >= this.nSamples()
        java.lang.IndexOutOfBoundsException - if allele1 < 0 || allele1 >= this.marker().nAlleles()
        java.lang.IndexOutOfBoundsException - if allele2 < 0 || allele2 >= this.marker().nAlleles()
      • alleleFreq

        static double[] alleleFreq​(GTRec rec)
        Returns the allele frequencies. The k-th element of the returned array is the frequency of the k-th allele.
        Parameters:
        rec - the genotype data for a marker
        Returns:
        the allele frequencies
      • alleleCounts

        static int[] alleleCounts​(GTRec rec)
        Returns the allele counts. The k-th element of the returned array is the count of the k-th allele.
        Parameters:
        rec - the genotype data for a marker
        Returns:
        the allele frequencies
      • toVcfRec

        static java.lang.String toVcfRec​(GTRec gtRec)
        Returns a VCF record corresponding to the specified GTRec object. The returned VCF record will have missing QUAL and INFO fields, will have "PASS" in the filter field, and will have a GT format field.
        Parameters:
        gtRec - the genotype data
        Returns:
        a VCF record corresponding to the specified GTRec object
        Throws:
        java.lang.NullPointerException - if gtRec == null