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

Safe HaskellNone
LanguageHaskell2010

SequenceFormats.Eigenstrat

Description

Module to read and parse Eigenstrat-formatted genotype data. The Eigenstrat format is defined at https://github.com/argriffing/eigensoft/blob/master/CONVERTF/README.

Synopsis

Documentation

data EigenstratSnpEntry Source #

A datatype to represent a single genomic SNP. The constructor arguments are: Chromosome, Position, Reference Allele, Alternative Allele.

data EigenstratIndEntry Source #

A datatype to represent a single individual. The constructor arguments are: Name, Sex and Population Name

readEigenstratInd :: MonadIO m => FilePath -> m [EigenstratIndEntry] Source #

Function to read an Eigenstrat individual file. Returns the Eigenstrat Individual Entries as list.

data GenoEntry Source #

A datatype to represent the genotype of an individual at a SNP.

Constructors

HomRef 
Het 
HomAlt 
Missing 
Instances
Eq GenoEntry Source # 
Instance details

Defined in SequenceFormats.Eigenstrat

Show GenoEntry Source # 
Instance details

Defined in SequenceFormats.Eigenstrat

type GenoLine = Vector GenoEntry Source #

Vector of the genotypes of all individuals at a single SNP.

data Sex Source #

A datatype to represent Sex in an Eigenstrat Individual file

Constructors

Male 
Female 
Unknown 
Instances
Eq Sex Source # 
Instance details

Defined in SequenceFormats.Eigenstrat

Methods

(==) :: Sex -> Sex -> Bool #

(/=) :: Sex -> Sex -> Bool #

Show Sex Source # 
Instance details

Defined in SequenceFormats.Eigenstrat

Methods

showsPrec :: Int -> Sex -> ShowS #

show :: Sex -> String #

showList :: [Sex] -> ShowS #

readEigenstratSnpStdIn :: (MonadThrow m, MonadIO m) => Producer EigenstratSnpEntry m () Source #

Function to read a Snp File from StdIn. Returns a Pipes-Producer over the EigenstratSnpEntries.

readEigenstratSnpFile :: MonadSafe m => FilePath -> Producer EigenstratSnpEntry m () Source #

Function to read a Snp File from a file. Returns a Pipes-Producer over the EigenstratSnpEntries.

readEigenstrat Source #

Arguments

:: MonadSafe m 
=> FilePath

The Genotype file

-> FilePath

The Snp File

-> FilePath

The Ind file

-> m ([EigenstratIndEntry], Producer (EigenstratSnpEntry, GenoLine) m ()) 

Function to read a full Eigenstrat database from files. Returns a pair of the Eigenstrat Individual Entries, and a joint Producer over the snp entries and the genotypes.

writeEigenstrat Source #

Arguments

:: MonadSafe m 
=> FilePath

The Genotype file

-> FilePath

The Snp File

-> FilePath

The Ind file

-> [EigenstratIndEntry]

The list of individual entries

-> Consumer (EigenstratSnpEntry, GenoLine) m ()

A consumer to read joint Snp/Genotype entries.

Function to write an Eigenstrat Database. Returns a consumer expecting joint Snp- and Genotype lines.

writeEigenstratIndFile :: MonadIO m => FilePath -> [EigenstratIndEntry] -> m () Source #

Function to write an Eigenstrat Ind file.

writeEigenstratSnp Source #

Arguments

:: MonadIO m 
=> Handle

The Eigenstrat Snp File Handle.

-> Consumer EigenstratSnpEntry m ()

A consumer to read EigenstratSnpEntries

Function to write an Eigenstrat Snp File. Returns a consumer expecting EigenstratSnpEntries.

writeEigenstratGeno Source #

Arguments

:: MonadIO m 
=> Handle

The Genotype file handle

-> Consumer GenoLine m ()

A consumer to read Genotype entries.

Function to write an Eigentrat Geno File. Returns a consumer expecting Eigenstrat Genolines.