Class HaplotypeBlock

    • Constructor Detail

      • HaplotypeBlock

        public HaplotypeBlock​(double maf)
        Constructs a haplotype block with the provided minor allele frequency.
    • Method Detail

      • getHaplotypeFrequencies

        public double[] getHaplotypeFrequencies()
        Gets the set of haplotype frequencies.
      • addSnp

        public void addSnp​(Snp snp)
        Adds a SNP to the haplotype. Will throw an exception if the SNP is on the wrong chromosome.
      • getSnp

        public Snp getSnp​(String name)
        Gets a SNP by name if it belongs to this haplotype.
      • getFirstSnp

        public Snp getFirstSnp()
        Gets the arbitrarily first SNP in the haplotype.
      • contains

        public boolean contains​(Snp snp)
        Returns true if the SNP is contained within the haplotype block, false otherwise.
      • size

        public int size()
        Returns the number of SNPs within the haplotype block.
      • getSnps

        public Collection<Snp> getSnps()
        Returns an unmodifiable, unordered, collection of all SNPs in this haplotype block.
      • getHaplotypeFrequency

        public double getHaplotypeFrequency​(int i)
        Gets the frequency of the i'th diploid haplotype where haplotypes are ordered accorinding to DiploidHaplotype.
      • getMaf

        public double getMaf()
        Returns the minor allele frequency of this haplotype.
      • getSnpGenotype

        public DiploidGenotype getSnpGenotype​(Snp snp,
                                              DiploidHaplotype haplotype)
        Gets the expected genotype of the provided SNP given the provided haplotype of this haplotype block.
      • getDiploidHaplotype

        public DiploidHaplotype getDiploidHaplotype​(Snp snp,
                                                    DiploidGenotype gt)
        Gets the diploid haplotype for this haplotype block given the provided SNP and SNP genotype.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object