| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Bio.Sequence
Synopsis
- type Range = (Int, Int)
- type ContainsNoWeight s = (IsSequence s, Unit (Weight s))
- type ContainsWeight s = (IsSequence s, NotUnit (Weight s))
- type ContainsNoMarking s = (IsSequence s, Unit (Marking s))
- type ContainsMarking s = (IsSequence s, NotUnit (Marking s))
- type IsBareSequence s = (IsSequence s, Unit (Marking s), Unit (Weight s))
- type IsMarkedSequence s = (IsSequence s, NotUnit (Marking s), Unit (Weight s))
- type IsWeightedSequence s = (IsSequence s, Unit (Marking s), NotUnit (Weight s))
- class IsSequence s => SequenceDecodable a s where
- sequenceDecode :: a -> Either Text s
- class (IsMarking (Marking s), IsWeight (Weight s)) => IsSequence s where
- class IsWeight w where
- class (Eq mk, Ord mk) => IsMarking mk
- type BareSequence a = Sequence () () a
- type MarkedSequence mk a = Sequence mk () a
- type WeightedSequence w a = Sequence () w a
- data Sequence mk w a
- sequ :: Getter (Sequence mk w a) (Vector a)
- markings :: Getter (Sequence mk w a) [(mk, Range)]
- weights :: Getter (Sequence mk w a) (Vector w)
- createSequence :: (ContainsMarking s, ContainsWeight s, MonadError Text m) => [Element s] -> [(Marking s, Range)] -> [Weight s] -> m s
- unsafeCreateSequence :: (ContainsMarking s, ContainsWeight s) => [Element s] -> [(Marking s, Range)] -> [Weight s] -> s
- bareSequence :: IsBareSequence s => [Element s] -> s
- markedSequence :: (IsMarkedSequence s, MonadError Text m) => [Element s] -> [(Marking s, Range)] -> m s
- unsafeMarkedSequence :: IsMarkedSequence s => [Element s] -> [(Marking s, Range)] -> s
- weightedSequence :: (IsWeightedSequence s, MonadError Text m) => [Element s] -> [Weight s] -> m s
- unsafeWeightedSequence :: IsWeightedSequence s => [Element s] -> [Weight s] -> s
- module Bio.Sequence.Functions.Sequence
- module Bio.Sequence.Functions.Weight
- module Bio.Sequence.Functions.Marking
Documentation
type ContainsNoWeight s = (IsSequence s, Unit (Weight s)) Source #
Type alias for constraint that checks whether given instance s of IsSequence
has no weights, markings of s are not checked.
type ContainsWeight s = (IsSequence s, NotUnit (Weight s)) Source #
Type alias for constraint that checks whether given instance s of IsSequence
has weights, markings of s are not checked.
type ContainsNoMarking s = (IsSequence s, Unit (Marking s)) Source #
Type alias for constraint that checks whether given instance s of IsSequence
has no markings, weights of s are not checked.
type ContainsMarking s = (IsSequence s, NotUnit (Marking s)) Source #
Type alias for constraint that checks whether given instance s of IsSequence
has markings, weights of s are not checked.
type IsBareSequence s = (IsSequence s, Unit (Marking s), Unit (Weight s)) Source #
Type alias for constraint that checks whether given instance of IsSequence
has no markings and is not weighted.
type IsMarkedSequence s = (IsSequence s, NotUnit (Marking s), Unit (Weight s)) Source #
Type alias for constraint that checks whether given instance of IsSequence
has markings, but is not weighted.
type IsWeightedSequence s = (IsSequence s, Unit (Marking s), NotUnit (Weight s)) Source #
Type alias for constraint that checks whether given instance of IsSequence
has no markings, but is weighted.
class IsSequence s => SequenceDecodable a s where Source #
Class that allows to decode something into Sequence representation
Methods
sequenceDecode :: a -> Either Text s Source #
Instances
| SequenceDecodable ByteString BasecalledSequence Source # | Converts |
Defined in Bio.ABI.Decode Methods sequenceDecode :: ByteString -> Either Text BasecalledSequence Source # | |
| SequenceDecodable ByteString BasecalledSequence Source # | Converts |
Defined in Bio.ABI.Decode Methods sequenceDecode :: ByteString -> Either Text BasecalledSequence Source # | |
class (IsMarking (Marking s), IsWeight (Weight s)) => IsSequence s where Source #
Type class that describes object that is isomorphisc to Sequence
and contains elements of type Element, is marked with marking of type
Marking and is weighted with weights of type Weight.
Special cases, when IsSequence has no markings, has no weights, or
has no weights and no markings at the same time are aliased:
* IsWeightedSequence is alias for sequence with Marking type set to () and Weight not set to ()
* IsMarkedSequence is alias for sequence with Weight type set to () and Marking not set to ().
* IsBareSequence is alias for sequence with Marking and Weight types
set to ().
Instances of IsSequence can be built only using special constructors:
* createSequence creates IsSequence that has Marking and Weight
that are not set to ().
* bareSequence creates IsSequence that has Marking and Weight
that are set to ().
* weightedSequence creates IsSequence that has Marking set to () and
Weight that is not ().
* markedSequence creates IsSequence that has Weight set to () and
Marking that is not ().
Constraints and constructors mentioned above gaurantee that IsSequence
instances that have no Weights will in compile-time
have () as types assosiated with their Weights.
That is used to make functions that rely on IsSequence instance
having not null weights type-safe.
Methods
toSequence :: s -> Sequence (Marking s) (Weight s) (Element s) Source #
fromSequence :: Sequence (Marking s) (Weight s) (Element s) -> s Source #
Instances
| IsSequence BasecalledSequence Source # | |
Defined in Bio.Sequence.Basecalled.Type Associated Types type Element BasecalledSequence :: Type Source # type Marking BasecalledSequence :: Type Source # type Weight BasecalledSequence :: Type Source # | |
| (IsMarking mk, IsWeight w) => IsSequence (Sequence mk w a) Source # | |
class IsWeight w where Source #
Class that represents objects that can be weights of IsSequences Elements.
class (Eq mk, Ord mk) => IsMarking mk Source #
Class that reprsents objects that can be markings of IsSequence.
Instances
| IsMarking () Source # | |
Defined in Bio.Sequence.Class | |
| IsMarking Feature Source # | |
Defined in Bio.GB.Type | |
type BareSequence a = Sequence () () a Source #
Type alias for sequence that is not weighted and has no markings.
type MarkedSequence mk a = Sequence mk () a Source #
Type alias for sequence that is not weighted, but has markings.
type WeightedSequence w a = Sequence () w a Source #
Type alias for sequence that has no marking but is weighted.
Instances
| Functor (Sequence mk w) Source # | |
| Foldable (Sequence mk w) Source # | |
Defined in Bio.Sequence.Class Methods fold :: Monoid m => Sequence mk w m -> m # foldMap :: Monoid m => (a -> m) -> Sequence mk w a -> m # foldr :: (a -> b -> b) -> b -> Sequence mk w a -> b # foldr' :: (a -> b -> b) -> b -> Sequence mk w a -> b # foldl :: (b -> a -> b) -> b -> Sequence mk w a -> b # foldl' :: (b -> a -> b) -> b -> Sequence mk w a -> b # foldr1 :: (a -> a -> a) -> Sequence mk w a -> a # foldl1 :: (a -> a -> a) -> Sequence mk w a -> a # toList :: Sequence mk w a -> [a] # null :: Sequence mk w a -> Bool # length :: Sequence mk w a -> Int # elem :: Eq a => a -> Sequence mk w a -> Bool # maximum :: Ord a => Sequence mk w a -> a # minimum :: Ord a => Sequence mk w a -> a # | |
| Traversable (Sequence mk w) Source # | |
Defined in Bio.Sequence.Class Methods traverse :: Applicative f => (a -> f b) -> Sequence mk w a -> f (Sequence mk w b) # sequenceA :: Applicative f => Sequence mk w (f a) -> f (Sequence mk w a) # mapM :: Monad m => (a -> m b) -> Sequence mk w a -> m (Sequence mk w b) # sequence :: Monad m => Sequence mk w (m a) -> m (Sequence mk w a) # | |
| (Eq a, Eq mk, Eq w) => Eq (Sequence mk w a) Source # | |
| (Show a, Show mk, Show w) => Show (Sequence mk w a) Source # | |
| Generic (Sequence mk w a) Source # | |
| Semigroup (Sequence mk w a) Source # | |
| Monoid (Sequence mk () a) Source # | |
| (IsMarking mk, IsWeight w) => IsSequence (Sequence mk w a) Source # | |
| type Rep (Sequence mk w a) Source # | |
Defined in Bio.Sequence.Class type Rep (Sequence mk w a) = D1 (MetaData "Sequence" "Bio.Sequence.Class" "cobot-io-0.1.3.1-25h62qSXpkdG6PKxTgorcd" False) (C1 (MetaCons "Sequence" PrefixI True) (S1 (MetaSel (Just "_sequ") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Vector a)) :*: (S1 (MetaSel (Just "_markings") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(mk, Range)]) :*: S1 (MetaSel (Just "_weights") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Vector w))))) | |
| type Element (Sequence mk w a) Source # | |
Defined in Bio.Sequence.Class | |
| type Marking (Sequence mk w a) Source # | |
Defined in Bio.Sequence.Class | |
| type Weight (Sequence mk w a) Source # | |
Defined in Bio.Sequence.Class | |
createSequence :: (ContainsMarking s, ContainsWeight s, MonadError Text m) => [Element s] -> [(Marking s, Range)] -> [Weight s] -> m s Source #
Create IsSequence s that has both markings and weights.
If any of the markings is invalid or length of weights list is not equal to length
of sequence, an error will be thrown.
unsafeCreateSequence :: (ContainsMarking s, ContainsWeight s) => [Element s] -> [(Marking s, Range)] -> [Weight s] -> s Source #
bareSequence :: IsBareSequence s => [Element s] -> s Source #
Create IsBareSequence s, simple sequence without markings and weights.
markedSequence :: (IsMarkedSequence s, MonadError Text m) => [Element s] -> [(Marking s, Range)] -> m s Source #
Create IsMarkedSequence s from list of Elements and Markings that
mark it. If at least one of ranges in given list of Markings is out of bounds,
an error will be thrown.
unsafeMarkedSequence :: IsMarkedSequence s => [Element s] -> [(Marking s, Range)] -> s Source #
weightedSequence :: (IsWeightedSequence s, MonadError Text m) => [Element s] -> [Weight s] -> m s Source #
Create IsWeightedSequence s from list of Elements and Weights
that correspond to each Element. If length of list of Weights
is not equal to length of sequence or lis is null, an error will be thrown.
unsafeWeightedSequence :: IsWeightedSequence s => [Element s] -> [Weight s] -> s Source #