BioInf.Keys
Description
Transformation of predictions and known structures into keys. Keys are used for linearization.
NOTE READ THE BIG FAT KEYS WARNING
TODO Generalize and move into its own library
- data Keys
- = HairpinLength Int
- | HairpinClose (ExtPair, Nuc, Nuc)
- | Stem (ExtPair, ExtPair)
- | StemTriplet (ExtPair, ExtPair)
- | InteriorLength Int
- | InteriorAsym Int
- | InteriorClose (ExtPair, Nuc, Nuc)
- | BulgeLength Int
- | BulgeTriplet (ExtPair, ExtPair)
- | BulgeClose ExtPair
- | MbClose (ExtPair, Nuc, Nuc)
- | MultiBranched
- | MultiHelix
- | MultiUnpaired
- | PairDistance Int
- | InterMolInit
- featureVector :: String -> [ExtPairIdx] -> [Int]
- lookupFeatureIndex :: Keys -> Int
- treeToFeatures :: (MkPrimary a, Show a) => a -> SSTree ExtPairIdx t -> [Keys]
- ssTree :: Int -> [ExtPairIdx] -> SSTree ExtPairIdx ()
Documentation
A list of named parameters.
Uniquely tag each key
NOTE BIG FAT WARNING: BE ABSOLUTELY SURE THAT ALL IMPORTS AND EXPORTS FOLLOW THIS ORDERING EXACTLY, OTHERWISE KEYS WILL BE MAPPED TO WRONG POSITIONS DURING LOOKUP AND VALUES END UP SOMEWHERE ELSE.
Constructors
featureVector :: String -> [ExtPairIdx] -> [Int]Source
Training data to feature vector
lookupFeatureIndex :: Keys -> IntSource
transform feature to 0-based index
treeToFeatures :: (MkPrimary a, Show a) => a -> SSTree ExtPairIdx t -> [Keys]Source
Map param keys to thei Int-indices.
And back from Int-indices to the keys.
Takes a primary structure and secondary structure tree and produces a list of keys.
TODO Data.Traversable ?!
TODO better handling of unknown features: we can have genuine errors (pseudoknots) and uncoded features (e.g. hairpins of size > 30)
ssTree :: Int -> [ExtPairIdx] -> SSTree ExtPairIdx ()Source
Create the secondary structure tree
FIXME okPairs is ad-hoc, we should allow for other kinds of pairs!