SimpleVariant

data class SimpleVariant(val contig: String, val start: Int, val end: Int, val refAllele: String, val altAlleles: List<String>, val samples: List<String>, val genotypes: List<String>, val originalText: String? = null) : Comparable<SimpleVariant>

Data class to represent a simple VCF variant

Constructors

Link copied to clipboard
constructor(contig: String, start: Int, end: Int, refAllele: String, altAlleles: List<String>, samples: List<String>, genotypes: List<String>, originalText: String? = null)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val end: Int
Link copied to clipboard
val endPosition: <Error class: unknown class>
Link copied to clipboard
Link copied to clipboard

Function to check if this is a deletion. A deletion is a variant where the length of one or more variants is less than the reference allele.

Link copied to clipboard

Function to check if this is an indel. An indel is a variant where the length of one or more variants is not the same as the reference allele.

Link copied to clipboard

Function to check if this is an insertion. An insertion is a variant where the length of one or more variants is greater than the reference allele.

Link copied to clipboard
Link copied to clipboard

An SNP is a variant where the length of the reference allele and all alternate alleles length is 1.

Link copied to clipboard

Function to check if this is a variant. A variant is a site where the genotype is not 0/0 for all samples.

Link copied to clipboard
val length: Int

The length is the number of base pairs of the reference allele associated with this. The start and end positions are inclusive. The reference allele recorded may only be a single base pair, which is the first base pair of the reference sequence.

Link copied to clipboard
Link copied to clipboard
val originalText: String? = null
Link copied to clipboard
val positionRange: <Error class: unknown class>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val start: Int
Link copied to clipboard
val startPosition: <Error class: unknown class>

Functions

Link copied to clipboard
fun allele(index: Int): String

Function to get the allele given the allele index from the genotype. The allele index 0 is the reference allele, and the rest are the alternate alleles. If the allele index is -1, then the allele is missing (.).

Link copied to clipboard
open operator override fun compareTo(other: SimpleVariant): Int
Link copied to clipboard
fun contains(position: Position): Boolean

Returns whether position is within the range of this variant.

fun contains(position: Int): Boolean
Link copied to clipboard
fun genotype(sampleIndex: Int): List<Int>
fun genotype(sample: String): List<Int>

Function to get the genotype of a sample. The returned list of integers are the allele indices for each ploidy. Allele index 0 is the reference allele, and the rest are the alternate alleles. If the genotype is missing, the value will be -1.

Link copied to clipboard
fun genotypeStrs(sampleIndex: Int): List<String>
Link copied to clipboard
fun isDEL(sampleIndex: Int): Boolean
fun isDEL(sample: String): Boolean
Link copied to clipboard
fun isINS(sampleIndex: Int): Boolean
fun isINS(sample: String): Boolean
Link copied to clipboard
fun isPhased(sampleIndex: Int): Boolean
fun isPhased(sample: String): Boolean

Function to check if a sample is phased. A sample is phased if it contains '|' between the genotype. This checks for '/' as a haploid sample will be considered phased.

Link copied to clipboard
fun sample(index: Int): String

Function to get the sample name with given index.

Link copied to clipboard
open override fun toString(): String