BiobaseXNA-0.11.0.0: Efficient RNA/DNA/Protein Primary/Secondary Structure

Safe HaskellNone
LanguageHaskell2010

Biobase.Secondary.New

Contents

Description

New parsers and structures for secondary structures. The structures here a strict.

TODO Parser should check if a #Vienna Secondary Structure or #Extended Secondary Structure precedes the entries.

Synopsis

Documentation

data SubStructure (t :: k) a Source #

A completely closed sub-structure. An unpaired region . is closed. A paired region (r) is closed, where r contains arbitrarily many unpaired and paired elements.

TODO Should be extended with Extended, but this requires knowing which of the ends overlap with paired: left, right, or both.

Constructors

Unpaired 

Fields

Paired 

Fields

Instances
Functor (SubStructure t) Source # 
Instance details

Defined in Biobase.Secondary.New

Methods

fmap :: (a -> b) -> SubStructure t a -> SubStructure t b #

(<$) :: a -> SubStructure t b -> SubStructure t a #

Foldable (SubStructure t) Source # 
Instance details

Defined in Biobase.Secondary.New

Methods

fold :: Monoid m => SubStructure t m -> m #

foldMap :: Monoid m => (a -> m) -> SubStructure t a -> m #

foldr :: (a -> b -> b) -> b -> SubStructure t a -> b #

foldr' :: (a -> b -> b) -> b -> SubStructure t a -> b #

foldl :: (b -> a -> b) -> b -> SubStructure t a -> b #

foldl' :: (b -> a -> b) -> b -> SubStructure t a -> b #

foldr1 :: (a -> a -> a) -> SubStructure t a -> a #

foldl1 :: (a -> a -> a) -> SubStructure t a -> a #

toList :: SubStructure t a -> [a] #

null :: SubStructure t a -> Bool #

length :: SubStructure t a -> Int #

elem :: Eq a => a -> SubStructure t a -> Bool #

maximum :: Ord a => SubStructure t a -> a #

minimum :: Ord a => SubStructure t a -> a #

sum :: Num a => SubStructure t a -> a #

product :: Num a => SubStructure t a -> a #

Traversable (SubStructure t) Source # 
Instance details

Defined in Biobase.Secondary.New

Methods

traverse :: Applicative f => (a -> f b) -> SubStructure t a -> f (SubStructure t b) #

sequenceA :: Applicative f => SubStructure t (f a) -> f (SubStructure t a) #

mapM :: Monad m => (a -> m b) -> SubStructure t a -> m (SubStructure t b) #

sequence :: Monad m => SubStructure t (m a) -> m (SubStructure t a) #

Eq a => Eq (SubStructure t a) Source # 
Instance details

Defined in Biobase.Secondary.New

Methods

(==) :: SubStructure t a -> SubStructure t a -> Bool #

(/=) :: SubStructure t a -> SubStructure t a -> Bool #

Ord a => Ord (SubStructure t a) Source # 
Instance details

Defined in Biobase.Secondary.New

Read a => Read (SubStructure t a) Source # 
Instance details

Defined in Biobase.Secondary.New

Show a => Show (SubStructure t a) Source # 
Instance details

Defined in Biobase.Secondary.New

Generic (SubStructure t a) Source # 
Instance details

Defined in Biobase.Secondary.New

Associated Types

type Rep (SubStructure t a) :: Type -> Type #

Methods

from :: SubStructure t a -> Rep (SubStructure t a) x #

to :: Rep (SubStructure t a) x -> SubStructure t a #

type Rep (SubStructure t a) Source # 
Instance details

Defined in Biobase.Secondary.New

type Rep (SubStructure t a) = D1 (MetaData "SubStructure" "Biobase.Secondary.New" "BiobaseXNA-0.11.0.0-6sSV7wA2ZNJ62zYFxZDZpd" False) (C1 (MetaCons "Unpaired" PrefixI True) (S1 (MetaSel (Just "_label") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 a)) :+: C1 (MetaCons "Paired" PrefixI True) (S1 (MetaSel (Just "_label") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 a) :*: S1 (MetaSel (Just "_subStructures") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Vector (SubStructure t a)))))

label :: forall t a. Lens' (SubStructure t a) a Source #

_Paired :: forall t a t. Prism (SubStructure t a) (SubStructure t a) (a, Vector (SubStructure t a)) (a, Vector (SubStructure t a)) Source #

_Unpaired :: forall t a. Prism' (SubStructure t a) a Source #

newtype FullStructure (t :: k) a Source #

A full structure is composed of a number of sub-structures. The empty structure is a full structure.

Constructors

FullStructure 
Instances
Functor (FullStructure t) Source # 
Instance details

Defined in Biobase.Secondary.New

Methods

fmap :: (a -> b) -> FullStructure t a -> FullStructure t b #

(<$) :: a -> FullStructure t b -> FullStructure t a #

Foldable (FullStructure t) Source # 
Instance details

Defined in Biobase.Secondary.New

Methods

fold :: Monoid m => FullStructure t m -> m #

foldMap :: Monoid m => (a -> m) -> FullStructure t a -> m #

foldr :: (a -> b -> b) -> b -> FullStructure t a -> b #

foldr' :: (a -> b -> b) -> b -> FullStructure t a -> b #

foldl :: (b -> a -> b) -> b -> FullStructure t a -> b #

foldl' :: (b -> a -> b) -> b -> FullStructure t a -> b #

foldr1 :: (a -> a -> a) -> FullStructure t a -> a #

foldl1 :: (a -> a -> a) -> FullStructure t a -> a #

toList :: FullStructure t a -> [a] #

null :: FullStructure t a -> Bool #

length :: FullStructure t a -> Int #

elem :: Eq a => a -> FullStructure t a -> Bool #

maximum :: Ord a => FullStructure t a -> a #

minimum :: Ord a => FullStructure t a -> a #

sum :: Num a => FullStructure t a -> a #

product :: Num a => FullStructure t a -> a #

Traversable (FullStructure t) Source # 
Instance details

Defined in Biobase.Secondary.New

Methods

traverse :: Applicative f => (a -> f b) -> FullStructure t a -> f (FullStructure t b) #

sequenceA :: Applicative f => FullStructure t (f a) -> f (FullStructure t a) #

mapM :: Monad m => (a -> m b) -> FullStructure t a -> m (FullStructure t b) #

sequence :: Monad m => FullStructure t (m a) -> m (FullStructure t a) #

Eq a => Eq (FullStructure t a) Source # 
Instance details

Defined in Biobase.Secondary.New

Methods

(==) :: FullStructure t a -> FullStructure t a -> Bool #

(/=) :: FullStructure t a -> FullStructure t a -> Bool #

Ord a => Ord (FullStructure t a) Source # 
Instance details

Defined in Biobase.Secondary.New

Read a => Read (FullStructure t a) Source # 
Instance details

Defined in Biobase.Secondary.New

Show a => Show (FullStructure t a) Source # 
Instance details

Defined in Biobase.Secondary.New

Generic (FullStructure t a) Source # 
Instance details

Defined in Biobase.Secondary.New

Associated Types

type Rep (FullStructure t a) :: Type -> Type #

Methods

from :: FullStructure t a -> Rep (FullStructure t a) x #

to :: Rep (FullStructure t a) x -> FullStructure t a #

type Rep (FullStructure t a) Source # 
Instance details

Defined in Biobase.Secondary.New

type Rep (FullStructure t a) = D1 (MetaData "FullStructure" "Biobase.Secondary.New" "BiobaseXNA-0.11.0.0-6sSV7wA2ZNJ62zYFxZDZpd" True) (C1 (MetaCons "FullStructure" PrefixI True) (S1 (MetaSel (Just "_fullStructure") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Vector (SubStructure t a)))))

Parses a ViennaRNA secondary structure string.

Transform into a Tree.

toTree Source #

Arguments

:: (SubStructure t a -> Maybe b)

how to handle substructure elements? Nothing means discard this substructure and all children.

-> b

The root label

-> FullStructure (t :: k) a

The FullStructure to transform into a Tree.

-> Tree b 

Transform a FullStructure into a Tree.

Given a full structure generated like this: s = either (error . show) id $ parseVienna $ pack ".()(())."

a tree of just the base paired can be created with toTree (preview (_Paired._1)) () s