MutationOrder- Most likely order of mutation events in RNA

Safe HaskellNone



Calculate minimum-distance Hamiltonian Shortest Paths and probabilities for starting nodes.

NOTE: We explicitly model starting nodes. For symmetrical distance matrices, this reports begin/end probabilities. For asymmetrical distance matrices, a second instances with Last instead of First boundary should be created to calculate begin/end probabilities separately.



type ScaleFunction = RNA -> RNA -> Double Source #

Given the RNA we come from and the RNA we mutate into, derive the gain or loss by a scaling function.

aMinDist :: Monad m => ScaleFunction -> Landscape -> SigMinDist m Double Double ((Int :. From) :. To) (Int :. To) Source #

Minimal distance algebra

TODO The two Ints are the indices of the nodes and could be replaced?

aMinDistCount :: Monad m => ScaleFunction -> Landscape -> SigMinDist m (Double, Int) (Double, Int) ((Int :. From) :. To) (Int :. To) Source #

Fused co-optimal counter!

TODO for now, Int is assumed to be big enough...

aInside :: Monad m => Maybe Int -> ScaleFunction -> Landscape -> SigMinDist m (Log Double) (Log Double) ((Int :. From) :. To) (Int :. To) Source #

Sum over all states and collapse into boundary unscaled weights.

aPretty :: Monad m => ScaleFunction -> Landscape -> SigMinDist m Text [Text] ((Int :. From) :. To) (Int :. To) Source #

This should give the correct order of nodes independent of the underlying Set1 First or Set1 Last because the (From:.To) system is agnostic over these.

TODO Use text builder

aCount :: Monad m => Landscape -> SigMinDist m Integer [Integer] ((Int :. From) :. To) (Int :. To) Source #

Count co-optimals

forwardMinDist1 :: ScaleFunction -> Landscape -> (Z :. TS1L Double) :. U Double Source #

Run the minimal distance algebra.

This produces one-boundary sets. Meaning that for each boundary we get the total distance within the set.

minDistCount :: ScaleFunction -> Landscape -> (Z :. TS1L (Double, Int)) :. U (Double, Int) Source #

Count the number of co-optimals

runCoOptDist :: ScaleFunction -> Landscape -> (Double, [Text]) Source #

Given the Set1 produced in forwardMinDist1 we can now extract the co-optimal paths using the Set1 -> () index change.

TODO do we want this one explicitly or make life easy and just extract from all forwardMinDist1 paths?

boundaryPartFunFirst :: Maybe Int -> ScaleFunction -> Landscape -> [(Boundary First I, Log Double)] Source #

Extract the individual partition scores.