sequence-formats-1.8.1.1: A package with basic parsing utilities for several Bioinformatic data formats.
Safe HaskellSafe-Inferred
LanguageHaskell2010

SequenceFormats.VCF

Description

A module to help with parsing VCF files. The VCF format is defined here: https://en.wikipedia.org/wiki/Variant_Call_Format

Synopsis

Documentation

data VCFheader Source #

A datatype to represent the VCF Header. Most comments are simply parsed as entire lines, but the very last comment line, containing the sample names, is separated out

Constructors

VCFheader 

Fields

Instances

Instances details
Show VCFheader Source # 
Instance details

Defined in SequenceFormats.VCF

data VCFentry Source #

A Datatype representing a single VCF entry.

Constructors

VCFentry 

Fields

Instances

Instances details
Show VCFentry Source # 
Instance details

Defined in SequenceFormats.VCF

Eq VCFentry Source # 
Instance details

Defined in SequenceFormats.VCF

Genomic VCFentry Source # 
Instance details

Defined in SequenceFormats.Genomic

readVCFfromStdIn :: (MonadIO m, MonadThrow m) => m (VCFheader, Producer VCFentry m ()) Source #

Reading a VCF from StdIn. Returns a VCFHeader and a Producer over VCFentries.

readVCFfromFile :: MonadSafe m => FilePath -> m (VCFheader, Producer VCFentry m ()) Source #

Reading a VCF from a file. Returns a VCFHeader and a Producer over VCFentries.

getGenotypes :: VCFentry -> Either String [ByteString] Source #

Extracts the genotype fields (for each sapmle) from a VCF entry

getDosages :: VCFentry -> Either String [Maybe Int] Source #

Extracts the dosages (the sum of non-reference alleles) per sample (returns a Left Error if it fails.)

isTransversionSnp :: ByteString -> [ByteString] -> Bool Source #

returns True if the SNp is a biallelic Transversion SNP (i.e. one of GT, GC, AT, AC)

vcfToFreqSumEntry :: VCFentry -> Either String FreqSumEntry Source #

Converts a VCFentry to the simpler FreqSum format (returns a Left Error if it fails.)

isBiallelicSnp :: ByteString -> [ByteString] -> Bool Source #

returns True if the SNP is biallelic.