public class HaplotypeBlock extends java.lang.Object implements java.lang.Comparable<HaplotypeBlock>
Constructor and Description |
---|
HaplotypeBlock(double maf)
Constructs a haplotype block with the provided minor allele frequency.
|
Modifier and Type | Method and Description |
---|---|
void |
addSnp(Snp snp)
Adds a SNP to the haplotype.
|
int |
compareTo(HaplotypeBlock that) |
boolean |
contains(Snp snp)
Returns true if the SNP is contained within the haplotype block, false otherwise.
|
boolean |
equals(java.lang.Object o) |
DiploidHaplotype |
getDiploidHaplotype(Snp snp,
DiploidGenotype gt)
Gets the diploid haplotype for this haplotype block given the provided SNP and SNP
genotype.
|
Snp |
getFirstSnp()
Gets the arbitrarily first SNP in the haplotype.
|
double[] |
getHaplotypeFrequencies()
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.
|
Snp |
getSnp(java.lang.String name)
Gets a SNP by name if it belongs to this haplotype.
|
DiploidGenotype |
getSnpGenotype(Snp snp,
DiploidHaplotype haplotype)
Gets the expected genotype of the provided SNP given the provided haplotype of this
haplotype block.
|
java.util.Collection<Snp> |
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.
|
java.lang.String |
toString() |
public HaplotypeBlock(double maf)
public double[] getHaplotypeFrequencies()
public void addSnp(Snp snp)
public Snp getSnp(java.lang.String name)
public Snp getFirstSnp()
public boolean contains(Snp snp)
public int size()
public java.util.Collection<Snp> getSnps()
public double getHaplotypeFrequency(int i)
public double getMaf()
public DiploidGenotype getSnpGenotype(Snp snp, DiploidHaplotype haplotype)
public DiploidHaplotype getDiploidHaplotype(Snp snp, DiploidGenotype gt)
public int compareTo(HaplotypeBlock that)
compareTo
in interface java.lang.Comparable<HaplotypeBlock>
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object