Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
- data EigenstratSnpEntry = EigenstratSnpEntry {}
- data EigenstratIndEntry = EigenstratIndEntry String Sex String
- readEigenstratInd :: MonadIO m => FilePath -> m [EigenstratIndEntry]
- data GenoEntry
- type GenoLine = Vector GenoEntry
- data Sex
- readEigenstratSnpStdIn :: (MonadThrow m, MonadIO m) => Producer EigenstratSnpEntry m ()
- readEigenstratSnpFile :: MonadSafe m => FilePath -> Producer EigenstratSnpEntry m ()
- readEigenstrat :: MonadSafe m => FilePath -> FilePath -> FilePath -> m ([EigenstratIndEntry], Producer (EigenstratSnpEntry, GenoLine) m ())
- writeEigenstrat :: MonadSafe m => FilePath -> FilePath -> FilePath -> [EigenstratIndEntry] -> Consumer (EigenstratSnpEntry, GenoLine) m ()
- writeEigenstratIndFile :: MonadIO m => FilePath -> [EigenstratIndEntry] -> m ()
- writeEigenstratSnp :: MonadIO m => Handle -> Consumer EigenstratSnpEntry m ()
- writeEigenstratGeno :: MonadIO m => Handle -> Consumer GenoLine m ()
Documentation
data EigenstratSnpEntry Source #
A datatype to represent a single genomic SNP. The constructor arguments are: Chromosome, Position, Reference Allele, Alternative Allele.
Instances
Eq EigenstratSnpEntry Source # | |
Defined in SequenceFormats.Eigenstrat (==) :: EigenstratSnpEntry -> EigenstratSnpEntry -> Bool # (/=) :: EigenstratSnpEntry -> EigenstratSnpEntry -> Bool # | |
Show EigenstratSnpEntry Source # | |
Defined in SequenceFormats.Eigenstrat showsPrec :: Int -> EigenstratSnpEntry -> ShowS # show :: EigenstratSnpEntry -> String # showList :: [EigenstratSnpEntry] -> ShowS # |
data EigenstratIndEntry Source #
A datatype to represent a single individual. The constructor arguments are: Name, Sex and Population Name
Instances
Eq EigenstratIndEntry Source # | |
Defined in SequenceFormats.Eigenstrat (==) :: EigenstratIndEntry -> EigenstratIndEntry -> Bool # (/=) :: EigenstratIndEntry -> EigenstratIndEntry -> Bool # | |
Show EigenstratIndEntry Source # | |
Defined in SequenceFormats.Eigenstrat showsPrec :: Int -> EigenstratIndEntry -> ShowS # show :: EigenstratIndEntry -> String # showList :: [EigenstratIndEntry] -> ShowS # |
readEigenstratInd :: MonadIO m => FilePath -> m [EigenstratIndEntry] Source #
Function to read an Eigenstrat individual file. Returns the Eigenstrat Individual Entries as list.
A datatype to represent the genotype of an individual at a SNP.
type GenoLine = Vector GenoEntry Source #
Vector of the genotypes of all individuals at a single SNP.
A datatype to represent Sex in an Eigenstrat Individual file
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.
:: 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.
:: 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.
:: 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.