de.charite.compbio.jannovar.pedigree.Disease Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jannovar-core Show documentation
Show all versions of jannovar-core Show documentation
jannovar-core is a library for the functional annotation of genomic variants
package de.charite.compbio.jannovar.pedigree;
/**
* Codes used to denote affection status of a person in a pedigree.
*
* @author Peter N Robinson
* @author Manuel Holtgrewe
*/
public enum Disease {
/** corresponds to 0 = unknown disease status in the PED file. */
UNKNOWN,
/** corresponds to 1 = unaffected in the PED file. */
UNAFFECTED,
/** corresponds to 2 = affected in the PED file. */
AFFECTED;
/**
* @return int
value representation for PED file.
*/
public int toInt() {
switch (this) {
case AFFECTED:
return 2;
case UNAFFECTED:
return 1;
default:
return 0;
}
}
/**
* Parse {@link String} into a Disease
value.
*
* @param s
* String to parse
* @return resulting Disease
object
* @throws PedParseException
* if s
was not equal to "0"
, "1"
, or "2"
.
*/
public static Disease toDisease(String s) throws PedParseException {
if (s.equals("0"))
return UNKNOWN;
else if (s.equals("1"))
return UNAFFECTED;
else if (s.equals("2"))
return AFFECTED;
else
throw new PedParseException("Invalid PED disease status value: " + s);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy