Class VcfGenotype
java.lang.Object
org.pharmgkb.parser.vcf.model.genotype.VcfGenotype
A diploid (or haploid; see below) genotype matching the VCF 4.2 specification.
For example:
- A/A (an unphased homozygous genotype)
- A|ATG (an phased heterozygous 2bp insertion of TG)
Genotype.fromString("A").toString(); // prints A|A
Always use equals(Object) to compare genotypes, not toString().equals.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic VcfGenotypefromNumberString(VcfPosition position, String genotype) static VcfGenotypefromString(String genotype) static VcfGenotypefromVcf(VcfPosition position, VcfSample sample) inthashCode()booleanbooleanisNoCall()booleanisPhased()makeGt(VcfPosition position) toString()
-
Constructor Details
-
VcfGenotype
Note:
The same logic applies with haploid genotypes.VcfGenotype homozygous = new VcfGenotype("A", "A", false); homogyzgous.isPhased(); // false
-
-
Method Details
-
fromString
- Parameters:
genotype- A string like A/TT
-
fromVcf
@Nullable public static VcfGenotype fromVcf(@Nonnull VcfPosition position, @Nonnull VcfSample sample) - Returns:
- The genotype, or null if GT is null
-
fromNumberString
- Parameters:
genotype- A string like 0/1- Returns:
- The genotype, or null if GT is null
-
makeGt
-
isPhased
public boolean isPhased()- Returns:
- True if the genotype is effectively phased.: returns true for haploid genotypes and homozygous genotypes
-
isHomozygous
public boolean isHomozygous() -
isNoCall
public boolean isNoCall() -
getAllele1
-
getAllele2
-
getAlleleSet
-
toString
-
equals
-
hashCode
public int hashCode()
-