Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- codeByTableID :: MonadError String m => [TranslationTable c a] -> Int -> m (TranslationTable c a)
- codeByTableNameInfix :: MonadError String m => [TranslationTable c a] -> Text -> m (TranslationTable c a)
- fromFileOrCached :: (MonadIO m, MonadError String m) => FilePath -> m (TranslationTable Char Char)
- module Biobase.GeneticCodes.Types
- fromByteString :: MonadError String m => ByteString -> m [TranslationTable Char Char]
- fromFile :: (MonadIO m, MonadError String m) => FilePath -> m [TranslationTable Char Char]
- geneticCodes :: [TranslationTable Char Char]
- translate :: Translation t => TranslationTable (CodonType t) (AAType t) -> t -> TargetType t
Documentation
codeByTableID :: MonadError String m => [TranslationTable c a] -> Int -> m (TranslationTable c a) Source #
codeByTableNameInfix :: MonadError String m => [TranslationTable c a] -> Text -> m (TranslationTable c a) Source #
fromFileOrCached :: (MonadIO m, MonadError String m) => FilePath -> m (TranslationTable Char Char) Source #
If the given filepath exists, then we try to load the genetic table from
the file. This will fail if there is not exactly one genetic table there. If
fp
is not a file, we try parsing fp
as a numeric ID and look for that
table. Finally we try finding an infix with that name.
This is all slightly "unsafe" but captures the most common scenario where we either load such a table from file or need selection of the correct one.
If the given filepath is "list"
, then a list of table id's and table names
is returned.
module Biobase.GeneticCodes.Types
fromByteString :: MonadError String m => ByteString -> m [TranslationTable Char Char] Source #
Parse a ByteString with translation tables.
fromFile :: (MonadIO m, MonadError String m) => FilePath -> m [TranslationTable Char Char] Source #
Import translation tables from a given file. In case of parse error, print the error and exit with a failure.
translate :: Translation t => TranslationTable (CodonType t) (AAType t) -> t -> TargetType t Source #
Translate from a given type of sequence t
into the target type.