Use this function to extract the genotypes from the GT field. Will return as a IntegerMatrix of dimensions haplotypes x variants. That is, each (diploid) individual will have two consecutve rows. No existing support for using the phase of the genotypes (if present) or for handling missing values or variable ploidy.

extract_genotypes(vcf, index, reg)

Arguments

vcf

the VCF/BCF file path

index

the CSI/TBI index file path

reg

a region query of the form: chr:start-end

Value

a integer matrix of dimension (number of haplotypes x number of variants).

Examples

# NOT RUN {
extract_genotypes(vcf, index, "1:10001-100500")
# }