Package picard.fingerprint
Class HaplotypeBlock
java.lang.Object
picard.fingerprint.HaplotypeBlock
- All Implemented Interfaces:
Comparable<HaplotypeBlock>
Represents information about a group of SNPs that form a haplotype in perfect LD
with one another.
-
Constructor Summary
ConstructorsConstructorDescriptionHaplotypeBlock
(double maf) Constructs a haplotype block with the provided minor allele frequency. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a SNP to the haplotype.int
compareTo
(HaplotypeBlock that) boolean
Returns true if the SNP is contained within the haplotype block, false otherwise.boolean
getDiploidHaplotype
(Snp snp, DiploidGenotype gt) Gets the diploid haplotype for this haplotype block given the provided SNP and SNP genotype.Gets the arbitrarily first SNP in the haplotype.double[]
Gets the set of haplotype frequencies.double
getHaplotypeFrequency
(int i) Gets the frequency of the i'th diploid haplotype where haplotypes are ordered accorinding to DiploidHaplotype.double
getMaf()
Returns the minor allele frequency of this haplotype.Gets a SNP by name if it belongs to this haplotype.getSnpGenotype
(Snp snp, DiploidHaplotype haplotype) Gets the expected genotype of the provided SNP given the provided haplotype of this haplotype block.getSnps()
Returns an unmodifiable, unordered, collection of all SNPs in this haplotype block.int
hashCode()
int
size()
Returns the number of SNPs within the haplotype block.toString()
-
Constructor Details
-
HaplotypeBlock
public HaplotypeBlock(double maf) Constructs a haplotype block with the provided minor allele frequency.
-
-
Method Details
-
getHaplotypeFrequencies
public double[] getHaplotypeFrequencies()Gets the set of haplotype frequencies. -
addSnp
Adds a SNP to the haplotype. Will throw an exception if the SNP is on the wrong chromosome. -
getSnp
Gets a SNP by name if it belongs to this haplotype. -
getFirstSnp
Gets the arbitrarily first SNP in the haplotype. -
contains
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
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
Gets the expected genotype of the provided SNP given the provided haplotype of this haplotype block. -
getDiploidHaplotype
Gets the diploid haplotype for this haplotype block given the provided SNP and SNP genotype. -
compareTo
- Specified by:
compareTo
in interfaceComparable<HaplotypeBlock>
-
equals
-
hashCode
public int hashCode() -
toString
-