BiobaseTypes-0.2.0.1: Collection of types for bioinformatics

Safe HaskellNone
LanguageHaskell2010

Biobase.Types.Structure

Contents

Description

Wrappers for structural data. Encoded as bytestrings. This differs from BiobaseXNA, where specialized encodings are used. These structures are supposedly "short", they need to fit into a strict bytestring.

TODO Consider where to move each type. There are merge possibilities between BiobaseXNA and BiobaseTypes.

TODO QuickCheck Arbitrary for RNAss.

Synopsis

Documentation

newtype RNAss Source #

Secondary structure using () for paired elements, and . for unpaired ones. It is assumed that the () match up. These structures from a Monoid.

Constructors

RNAss 

Fields

Instances
Eq RNAss Source # 
Instance details

Defined in Biobase.Types.Structure

Methods

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

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

Data RNAss Source # 
Instance details

Defined in Biobase.Types.Structure

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> RNAss -> c RNAss #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c RNAss #

toConstr :: RNAss -> Constr #

dataTypeOf :: RNAss -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c RNAss) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RNAss) #

gmapT :: (forall b. Data b => b -> b) -> RNAss -> RNAss #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RNAss -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RNAss -> r #

gmapQ :: (forall d. Data d => d -> u) -> RNAss -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> RNAss -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> RNAss -> m RNAss #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> RNAss -> m RNAss #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> RNAss -> m RNAss #

Ord RNAss Source # 
Instance details

Defined in Biobase.Types.Structure

Methods

compare :: RNAss -> RNAss -> Ordering #

(<) :: RNAss -> RNAss -> Bool #

(<=) :: RNAss -> RNAss -> Bool #

(>) :: RNAss -> RNAss -> Bool #

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

max :: RNAss -> RNAss -> RNAss #

min :: RNAss -> RNAss -> RNAss #

Read RNAss Source # 
Instance details

Defined in Biobase.Types.Structure

Show RNAss Source # 
Instance details

Defined in Biobase.Types.Structure

Methods

showsPrec :: Int -> RNAss -> ShowS #

show :: RNAss -> String #

showList :: [RNAss] -> ShowS #

Generic RNAss Source # 
Instance details

Defined in Biobase.Types.Structure

Associated Types

type Rep RNAss :: Type -> Type #

Methods

from :: RNAss -> Rep RNAss x #

to :: Rep RNAss x -> RNAss #

Semigroup RNAss Source # 
Instance details

Defined in Biobase.Types.Structure

Methods

(<>) :: RNAss -> RNAss -> RNAss #

sconcat :: NonEmpty RNAss -> RNAss #

stimes :: Integral b => b -> RNAss -> RNAss #

Monoid RNAss Source # 
Instance details

Defined in Biobase.Types.Structure

Methods

mempty :: RNAss #

mappend :: RNAss -> RNAss -> RNAss #

mconcat :: [RNAss] -> RNAss #

Arbitrary RNAss Source # 
Instance details

Defined in Biobase.Types.Structure

Methods

arbitrary :: Gen RNAss #

shrink :: RNAss -> [RNAss] #

NFData RNAss Source # 
Instance details

Defined in Biobase.Types.Structure

Methods

rnf :: RNAss -> () #

type Rep RNAss Source # 
Instance details

Defined in Biobase.Types.Structure

type Rep RNAss = D1 (MetaData "RNAss" "Biobase.Types.Structure" "BiobaseTypes-0.2.0.1-B9coIbijR6NEFcCxvqIOZp" True) (C1 (MetaCons "RNAss" PrefixI True) (S1 (MetaSel (Just "_rnass") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ByteString)))

newtype RNAensembleStructure Source #

Ensemble structure encoding. *Very* different type ctor name chosen! The structure of this string makes verification much more complicated.

TODO describe encoding used by RNAfold for the ensemble string.

Constructors

RNAes 

Fields

Instances
Eq RNAensembleStructure Source # 
Instance details

Defined in Biobase.Types.Structure

Data RNAensembleStructure Source # 
Instance details

Defined in Biobase.Types.Structure

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> RNAensembleStructure -> c RNAensembleStructure #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c RNAensembleStructure #

toConstr :: RNAensembleStructure -> Constr #

dataTypeOf :: RNAensembleStructure -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c RNAensembleStructure) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RNAensembleStructure) #

gmapT :: (forall b. Data b => b -> b) -> RNAensembleStructure -> RNAensembleStructure #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RNAensembleStructure -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RNAensembleStructure -> r #

gmapQ :: (forall d. Data d => d -> u) -> RNAensembleStructure -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> RNAensembleStructure -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> RNAensembleStructure -> m RNAensembleStructure #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> RNAensembleStructure -> m RNAensembleStructure #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> RNAensembleStructure -> m RNAensembleStructure #

Ord RNAensembleStructure Source # 
Instance details

Defined in Biobase.Types.Structure

Read RNAensembleStructure Source # 
Instance details

Defined in Biobase.Types.Structure

Show RNAensembleStructure Source # 
Instance details

Defined in Biobase.Types.Structure

Generic RNAensembleStructure Source # 
Instance details

Defined in Biobase.Types.Structure

Associated Types

type Rep RNAensembleStructure :: Type -> Type #

NFData RNAensembleStructure Source # 
Instance details

Defined in Biobase.Types.Structure

Methods

rnf :: RNAensembleStructure -> () #

type Rep RNAensembleStructure Source # 
Instance details

Defined in Biobase.Types.Structure

type Rep RNAensembleStructure = D1 (MetaData "RNAensembleStructure" "Biobase.Types.Structure" "BiobaseTypes-0.2.0.1-B9coIbijR6NEFcCxvqIOZp" True) (C1 (MetaCons "RNAes" PrefixI True) (S1 (MetaSel (Just "_rnaes") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ByteString)))

data RNAds Source #

Cofolded structure.

Constructors

RNAds 
Instances
Eq RNAds Source # 
Instance details

Defined in Biobase.Types.Structure

Methods

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

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

Data RNAds Source # 
Instance details

Defined in Biobase.Types.Structure

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> RNAds -> c RNAds #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c RNAds #

toConstr :: RNAds -> Constr #

dataTypeOf :: RNAds -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c RNAds) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RNAds) #

gmapT :: (forall b. Data b => b -> b) -> RNAds -> RNAds #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RNAds -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RNAds -> r #

gmapQ :: (forall d. Data d => d -> u) -> RNAds -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> RNAds -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> RNAds -> m RNAds #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> RNAds -> m RNAds #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> RNAds -> m RNAds #

Ord RNAds Source # 
Instance details

Defined in Biobase.Types.Structure

Methods

compare :: RNAds -> RNAds -> Ordering #

(<) :: RNAds -> RNAds -> Bool #

(<=) :: RNAds -> RNAds -> Bool #

(>) :: RNAds -> RNAds -> Bool #

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

max :: RNAds -> RNAds -> RNAds #

min :: RNAds -> RNAds -> RNAds #

Read RNAds Source # 
Instance details

Defined in Biobase.Types.Structure

Show RNAds Source # 
Instance details

Defined in Biobase.Types.Structure

Methods

showsPrec :: Int -> RNAds -> ShowS #

show :: RNAds -> String #

showList :: [RNAds] -> ShowS #

Generic RNAds Source # 
Instance details

Defined in Biobase.Types.Structure

Associated Types

type Rep RNAds :: Type -> Type #

Methods

from :: RNAds -> Rep RNAds x #

to :: Rep RNAds x -> RNAds #

NFData RNAds Source # 
Instance details

Defined in Biobase.Types.Structure

Methods

rnf :: RNAds -> () #

type Rep RNAds Source # 
Instance details

Defined in Biobase.Types.Structure

type Rep RNAds = D1 (MetaData "RNAds" "Biobase.Types.Structure" "BiobaseTypes-0.2.0.1-B9coIbijR6NEFcCxvqIOZp" False) (C1 (MetaCons "RNAds" PrefixI True) (S1 (MetaSel (Just "_rnadsL") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 ByteString) :*: S1 (MetaSel (Just "_rnadsR") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 ByteString)))

rnads :: Prism' ByteString RNAds Source #

A Prism that turns ByteStrings with a single & into RNAds.

rnads2rnassPair :: Iso' RNAds (RNAss, RNAss) Source #

Isomorphism from RNAds to (RNAss,RNAss). The RNAss are only legal if taken both: rnassFromDimer . both.

mkRNAds :: (Monad m, MonadError RNAStructureError m) => ByteString -> m RNAds Source #

Try to create a dimeric structure.

data RNAStructureError Source #

Capture what might be wrong with the RNAss.

Instances
Show RNAStructureError Source # 
Instance details

Defined in Biobase.Types.Structure

Generic RNAStructureError Source # 
Instance details

Defined in Biobase.Types.Structure

Associated Types

type Rep RNAStructureError :: Type -> Type #

NFData RNAStructureError Source # 
Instance details

Defined in Biobase.Types.Structure

Methods

rnf :: RNAStructureError -> () #

type Rep RNAStructureError Source # 
Instance details

Defined in Biobase.Types.Structure

type Rep RNAStructureError = D1 (MetaData "RNAStructureError" "Biobase.Types.Structure" "BiobaseTypes-0.2.0.1-B9coIbijR6NEFcCxvqIOZp" False) (C1 (MetaCons "RNAStructureError" PrefixI True) (S1 (MetaSel (Just "_rnaStructureError") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String) :*: S1 (MetaSel (Just "_rnaOffender") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ByteString)))

verifyRNAss :: (Monad m, MonadError RNAStructureError m) => RNAss -> m RNAss Source #

Verifies that the given RNAss is properly formatted. Otherwise, error out.

TODO Implement! Check with BiobaseXNA and the stack effort in there. This might influence if the verification goes into BiobaseXNA and happens via an Iso'.

data RNApset Source #

The set of nucleotide pairs, together with the sequence length.

Constructors

RNApset 

Fields

Instances
Eq RNApset Source # 
Instance details

Defined in Biobase.Types.Structure

Methods

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

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

Ord RNApset Source # 
Instance details

Defined in Biobase.Types.Structure

Read RNApset Source # 
Instance details

Defined in Biobase.Types.Structure

Show RNApset Source # 
Instance details

Defined in Biobase.Types.Structure

Generic RNApset Source # 
Instance details

Defined in Biobase.Types.Structure

Associated Types

type Rep RNApset :: Type -> Type #

Methods

from :: RNApset -> Rep RNApset x #

to :: Rep RNApset x -> RNApset #

Arbitrary RNApset Source # 
Instance details

Defined in Biobase.Types.Structure

NFData RNApset Source # 
Instance details

Defined in Biobase.Types.Structure

Methods

rnf :: RNApset -> () #

type Rep RNApset Source # 
Instance details

Defined in Biobase.Types.Structure

type Rep RNApset = D1 (MetaData "RNApset" "Biobase.Types.Structure" "BiobaseTypes-0.2.0.1-B9coIbijR6NEFcCxvqIOZp" False) (C1 (MetaCons "RNApset" PrefixI True) (S1 (MetaSel (Just "_rnapset") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Set (Int, Int))) :*: S1 (MetaSel (Just "_rnapsetSLen") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int)))

rnassPairSet :: MonadError String m => RNAss -> m RNApset Source #

Transform an RNAss into a set of base pairs (i,j). The pairs are 0-based.

rnassSPForest :: MonadError String m => RNAss -> m (SPForest ByteString Char) Source #

Genereate a simple structured/paired forest from a secondary structure string.

compactifySPForest :: SPForest ByteString Char -> SPForest ByteString ByteString Source #

Compactify such an SPForest. This means that all stems are now represented by a single SPT data constructor.

rnassPairSet' :: RNAss -> RNApset Source #

RNA pair set, but a transformation error calls error.

pairDist :: RNApset -> RNApset -> Int Source #

Calculates the number of different base pairs between two structures. This ignores the length of the underlying sequences.

Arbitrary instances. This only creates legal instances, but does *not*