MutationOrder-0.0.0.1: Most likely order of mutation events in RNA

BioInf.MutationOrder.MinDist

Description

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.

Synopsis

# Documentation

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.

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

Run the minimal distance algebra.

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

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?

Extract the individual partition scores.

Constructors

 BoundaryPart FieldsbpNormalized :: [(Boundary Last I, Log Double)] bpUnnormalized :: [(Boundary Last I, Log Double)] bpTotal :: Log Double

Instances

 Source # Methods Source # MethodsshowList :: [BoundaryPart] -> ShowS #