Safe Haskell | None |
---|---|
Language | Haskell2010 |
Here we collect the necessary data structures for the RNAs to be compared. This data is serialized to disk once calculated, since it is most likely the part that takes longest.
TODO if the vienna wrapper allows, we should parallelize the calculations.
TODO nice interface counting up?
- data RNA = RNA {
- mutationSet :: !(Vector (Int, Char))
- primarySequence :: !ByteString
- mfeStructure :: !ByteString
- mfeD1S :: !D1Secondary
- mfeEnergy :: !Double
- centroidStructure :: !ByteString
- centroidD1S :: !D1Secondary
- centroidEnergy :: !Double
- bldD1S :: ByteString -> D1Secondary
- mkRNA :: Maybe (HashMap ByteString QLine) -> ByteString -> Vector (Int, Char) -> RNA
- insertMutations :: Vector (Int, Char) -> ByteString -> ByteString
- data Landscape = Landscape {
- rnas :: HashMap (BitSet I) RNA
- mutationCount :: !Int
- landscapeOrigin :: !ByteString
- landscapeDestination :: !ByteString
- mutationPositions :: !(BimapHashMap Int Int)
- createRNAlandscape :: Maybe (HashMap ByteString QLine) -> Bool -> ByteString -> ByteString -> (Landscape, [(Int, ByteString)])
- toFile :: FilePath -> Landscape -> IO ()
- toFileJSON :: FilePath -> Landscape -> IO ()
- fromFile :: FilePath -> IO Landscape
- fromFileJSON :: FilePath -> IO Landscape
- data QLine = QLine {
- qlSequence :: ByteString
- qlmfe :: (ByteString, Double)
- qlensemble :: (ByteString, Double)
- qlcentroid :: (ByteString, Double)
- qlines :: FilePath -> IO (HashMap ByteString QLine)
Documentation
A single RNA with pre-calculated elements.
All calculations are done at 37 C.
TODO include the basepair probability matrix? Can we "compress" that one?
We do not encode D1S into the json
RNA | |
|
bldD1S :: ByteString -> D1Secondary Source #
:: Maybe (HashMap ByteString QLine) | |
-> ByteString | primary sequence of the *origin* RNA |
-> Vector (Int, Char) | set of mutations compared to the origin |
-> RNA |
Given the primary sequence and the mutation set, fill the RNA
structure.
NOTE This wraps some ViennaRNA-bindings
calls that are in IO
.
TODO check if these calls are *really* thread-safe!
insertMutations :: Vector (Int, Char) -> ByteString -> ByteString Source #
Insert a set of mutations in a ByteString
.
Landscape | |
|
createRNAlandscape :: Maybe (HashMap ByteString QLine) -> Bool -> ByteString -> ByteString -> (Landscape, [(Int, ByteString)]) Source #
TODO prime candidate for parallelization. ViennaRNA-bindings currently does not allow parallel runs! It would be possible to consider externalizing this, but for now we just run single-threaded.
QLine | |
|