Module vcf_rider::mutations [] [src]

Module able to load mutations from a vcf file.

Re-exports

use rust_htslib::bcf;
use std::io;
use itertools::Itertools;
use std::path::Path;

Structs

Coordinate

Struct to represent genomic coordinates. 0 based, end exclusive.

Mutation

Struct used to represent SNPs and indels loaded from vcf files. Suitable only for biallelic polymorphisms.

VcfReader

Struct used to load vcf, it will be used as an Iterator<Mutation>. If accept_phased is false it will panic if there are any unphased mutations, otherwise it will accept them, but beware: sequence where the score will be computed for vcf_rider usually needs to be phased (suppose that two SNPs falls "inside" the same PWM match for the TBA: their phasing will influence the computed score).

Enums

Position

Enum used to represent the relative position of two Coordinate.

Functions

decode_allele

Function used to map 0 and 1 of vcf to a bool. Panics if something different from 0 or 1 is found.

decode_genotype

Function that decodes a genotype in the format "0/1" of the vcf files to our internal representation. Missing data (".") are encoded as the reference.

get_sequence

Returns the encoded sequence for a mutation. 666 for indels, 0-A, 1-C, 2-G, 3-T, 4-N for SNPs.