Comparable<HaplotypeBlock>
public class HaplotypeBlock extends Object implements Comparable<HaplotypeBlock>
Constructor | Description |
---|---|
HaplotypeBlock(double maf) |
Constructs a haplotype block with the provided minor allele frequency.
|
Modifier and Type | Method | 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(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(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.
|
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.
|
String |
toString() |
public HaplotypeBlock(double maf)
public double[] getHaplotypeFrequencies()
public void addSnp(Snp snp)
public Snp getFirstSnp()
public boolean contains(Snp snp)
public int size()
public 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 Comparable<HaplotypeBlock>