Package org.snpeff.vcf
Class VcfGenotype
java.lang.Object
org.snpeff.vcf.VcfGenotype
A VCF genotype field
There is one genotype per sample in each VCF entry
- Author:
- pablocingolani
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a name=value pair WARNING: This method does NOT change the FORMAT field.int
depth()
Depth of coverageGet a genotype fieldint[]
Get genotype numbers as an array E.g.getGenotype
(int idx) Get genotype string by index WARNING: If the genotype is missing, it returns an empty string.int
Return as a genotype SNP code: -1: if missing data of more than one ALT 0: if aa (0/0) 1: if Aa (0/1 or 1/0) 2: if AA (1/1) WARNING: In multi-allelic case, any non-ref is treated as ALTint
Return as a genotype SNP code: 0: if aa (0/0) or any missing value 1: if Aa (0/1 or 1/0) 2: if AA (1/1)Return genotypes as string (e.g.boolean
Is the most likely genotype heterozygous?boolean
Is this genotype homozygous? (either REF or ALT)boolean
Is this genotype homozygous ALT?boolean
Is genotpye missing (e.g.boolean
isPhased()
boolean
isRef()
Is any genotype different than REF? Note: This is calculated for the most likely genotype (GT field)boolean
Is any genotype different than REF? Note: This is calculated for the most likely genotype (GT field)int
plodity()
Genotype plodity (i.e.void
Set a genotype field valuevoid
setGenotype
(String gtValue) Set genotype valuetoString()
-
Field Details
-
GT_FIELD_DEPTH_OF_COVERAGE
- See Also:
-
GT_FIELD_ALLELIC_DEPTH_OF_COVERAGE
- See Also:
-
-
Constructor Details
-
VcfGenotype
-
-
Method Details
-
add
Add a name=value pair WARNING: This method does NOT change the FORMAT field. Use VcfEntry.addFormat() method -
depth
public int depth()Depth of coverage- Returns:
- -1 if not found
-
get
Get a genotype field -
getGenotype
public int[] getGenotype()Get genotype numbers as an array E.g. '0/1' -> {0, 1} WARNING: If the genotype is missing, the numeric value is '-1'. E.g.: './.' -> {-1, -1}- Returns:
-
getGenotype
Get genotype string by index WARNING: If the genotype is missing, it returns an empty string. E.g.: './.' -> getGenotype(0) = ""- Returns:
-
getGenotypeCode
public int getGenotypeCode()Return as a genotype SNP code: -1: if missing data of more than one ALT 0: if aa (0/0) 1: if Aa (0/1 or 1/0) 2: if AA (1/1) WARNING: In multi-allelic case, any non-ref is treated as ALT- Returns:
-
getGenotypeCodeIgnoreMissing
public int getGenotypeCodeIgnoreMissing()Return as a genotype SNP code: 0: if aa (0/0) or any missing value 1: if Aa (0/1 or 1/0) 2: if AA (1/1)- Returns:
-
getGenotypeStr
Return genotypes as string (e.g. "A/C")- Returns:
-
getVcfEntry
-
isHeterozygous
public boolean isHeterozygous()Is the most likely genotype heterozygous?- Returns:
-
isHomozygous
public boolean isHomozygous()Is this genotype homozygous? (either REF or ALT) -
isHomozygousAlt
public boolean isHomozygousAlt()Is this genotype homozygous ALT? -
isMissing
public boolean isMissing()Is genotpye missing (e.g. "GT=./.")- Returns:
-
isPhased
public boolean isPhased() -
isRef
public boolean isRef()Is any genotype different than REF? Note: This is calculated for the most likely genotype (GT field) -
isVariant
public boolean isVariant()Is any genotype different than REF? Note: This is calculated for the most likely genotype (GT field) -
plodity
public int plodity()Genotype plodity (i.e. how many copies of the chromosome does it have) -
set
Set a genotype field value -
setGenotype
Set genotype value -
toString
-