Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
- aMinDist :: Monad m => ScaleFunction -> Landscape -> SigMinDist m Double Double ((Int :. From) :. To) (Int :. To)
- aMinDistCount :: Monad m => ScaleFunction -> Landscape -> SigMinDist m (Double, Int) (Double, Int) ((Int :. From) :. To) (Int :. To)
- aInside :: Monad m => Maybe Int -> ScaleFunction -> Landscape -> SigMinDist m (Log Double) (Log Double) ((Int :. From) :. To) (Int :. To)
- aPretty :: Monad m => ScaleFunction -> Landscape -> SigMinDist m Text [Text] ((Int :. From) :. To) (Int :. To)
- aCount :: Monad m => Landscape -> SigMinDist m Integer [Integer] ((Int :. From) :. To) (Int :. To)
- type TS1 x = TwITbl Id Unboxed EmptyOk (BS1 First I) x
- type U x = TwITbl Id Unboxed EmptyOk (Unit I) x
- type PF x = TwITbl Id Unboxed EmptyOk (Boundary First I) x
- type TS1L x = TwITbl Id Unboxed EmptyOk (BS1 Last I) x
- type PFL x = TwITbl Id Unboxed EmptyOk (Boundary Last I) x
- type BT1 x b = TwITblBt Unboxed EmptyOk (BS1 First I) x Id Id b
- type BTU x b = TwITblBt Unboxed EmptyOk (Unit I) x Id Id b
- type BT1L x b = TwITblBt Unboxed EmptyOk (BS1 Last I) x Id Id b
- forwardMinDist1 :: ScaleFunction -> Landscape -> (Z :. TS1L Double) :. U Double
- backtrackMinDist1 :: ScaleFunction -> Landscape -> ((Z :. TS1L Double) :. U Double) -> [Text]
- minDistCount :: ScaleFunction -> Landscape -> (Z :. TS1L (Double, Int)) :. U (Double, Int)
- countBackMinDist1 :: ScaleFunction -> Landscape -> ((Z :. TS1L Double) :. U Double) -> [Integer]
- runCoOptDist :: ScaleFunction -> Landscape -> (Double, [Text])
- runCount :: ScaleFunction -> Landscape -> (Double, Int)
- boundaryPartFunFirst :: Maybe Int -> ScaleFunction -> Landscape -> [(Boundary First I, Log Double)]
- boundaryPartFunLast :: Maybe Int -> ScaleFunction -> Landscape -> BoundaryPart
- data BoundaryPart = BoundaryPart {}
- boundaryPart :: [(Boundary Last I, Log Double)] -> BoundaryPart
Documentation
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.
backtrackMinDist1 :: ScaleFunction -> Landscape -> ((Z :. TS1L Double) :. U Double) -> [Text] Source #
minDistCount :: ScaleFunction -> Landscape -> (Z :. TS1L (Double, Int)) :. U (Double, Int) Source #
Count the number of co-optimals
countBackMinDist1 :: ScaleFunction -> Landscape -> ((Z :. TS1L Double) :. U Double) -> [Integer] Source #
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.
boundaryPartFunLast :: Maybe Int -> ScaleFunction -> Landscape -> BoundaryPart Source #
boundaryPart :: [(Boundary Last I, Log Double)] -> BoundaryPart Source #