sequence-formats-1.4.0.1: A package with basic parsing utilities for several Bioinformatic data formats.

Safe HaskellNone
LanguageHaskell2010

SequenceFormats.FreqSum

Description

Module to parse and write freqSum files. The freqsum format is defined here: https://rarecoal-docs.readthedocs.io/en/latest/rarecoal-tools.html#vcf2freqsum

Synopsis

Documentation

readFreqSumStdIn :: (MonadIO m, MonadThrow m) => m (FreqSumHeader, Producer FreqSumEntry m ()) Source #

A function to read a freqsum file from StdIn. Returns a pair of a freqSum Header and a Producer over all lines.

readFreqSumFile :: MonadSafe m => FilePath -> m (FreqSumHeader, Producer FreqSumEntry m ()) Source #

A function to read a freqsum file from a file. Returns a pair of a freqSum Header and a Producer over all lines.

data FreqSumEntry Source #

A Datatype to denote a single freqSum line

Constructors

FreqSumEntry 

Fields

  • fsChrom :: Chrom

    The chromosome of the site

  • fsPos :: Int

    The position of the site

  • fsSnpId :: Maybe String

    An optional parameter to take the snpId. This is not parsed from or printed to freqSum format but is used in internal conversions from Eigenstrat.

  • fsRef :: Char

    The reference allele

  • fsAlt :: Char

    The alternative allele

  • fsCounts :: [Maybe Int]

    A list of allele counts in each group. Nothing denotes missing data.

data FreqSumHeader Source #

A Datatype representing the Header

Constructors

FreqSumHeader 

Fields

printFreqSumStdOut :: MonadIO m => FreqSumHeader -> Consumer FreqSumEntry m () Source #

A function to write freqSum data to StdOut. Expects the freqSum header as argument, and then returns a Consumer that accepts freqSum entries.

printFreqSumFile :: MonadSafe m => FilePath -> FreqSumHeader -> Consumer FreqSumEntry m () Source #

A function that writes a freqSum file. Expects the FilePath and the freqSum header as arguments, and then returns a Consumer that accepts freqSum entries.

freqSumEntryToText :: FreqSumEntry -> ByteString Source #

This function converts a single freqSum entry to a printable freqSum line.