úÎG AÔf      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdeNone!"%&05:<=DLQRT[Cthe individual RNA mutations. The index should be calculated from linearIndex 0 high mutationSet)how many nucleotides are mutated in totalthe ancestral sequencethe final sequence*A single RNA with pre-calculated elements."All calculations are done at 37 C.JTODO include the basepair probability matrix? Can we "compress" that one?"We do not encode D1S into the jsonewe store just the mutation set, since this is more sparse and gives access to the mutational events.store RNA sequence too, for nowthe mfe structure we getefficient structure encodingmfe energy of the structurethe centroid structure%efficient centroid structure encoding :Given the primary sequence and the mutation set, fill the  structure.NOTE This wraps some ViennaRNA-bindings calls that are in IO.3TODO check if these calls are *really* thread-safe!!Insert a set of mutations in a  ByteString."Ä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.#$Write a generated landscape to disk.(  $primary sequence of the *origin* RNA'set of mutations compared to the origin!"#$%&'()*+,-./   !"#$%&'(/.-, !+*)("#$%& '   !"#$%&'()*+,-./None!"%&05:<=DLQRT[ D Given the  we come from and the @ we mutate into, derive the gain or loss by a scaling function.EMinimal distance algebraETODO The two Ints are the indices of the nodes and could be replaced?FFused co-optimal counter!TODO for now, Int is assumed to be big enough...G@Sum over all states and collapse into boundary unscaled weights.HKThis 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 builderICount co-optimalsJ!Run the minimal distance algebra.jThis produces one-boundary sets. Meaning that for each boundary we get the total distance within the set.LCount the number of co-optimalsN Given the Set1 produced in forwardMinDist14 we can now extract the co-optimal paths using the  Set1 -> () index change.QTODO do we want this one explicitly or make life easy and just extract from all forwardMinDist1 paths?P(Extract the individual partition scores.789:;<=>?@ABCDEFGHIJKLMNOPQR789:;<=>?@ABCDEFGHIJKLMNOPQRDEFGHICBA@?>=<JKLMNOPQ789:;R789:;<=>?@ABCDEFGHIJKLMNOPQRNone!"%&05:<=DLQRT[X Before using aInside the ScoreMat needs to be scaled TODO the Edge needs to be an EdgeWithActive0 to get the active bits on the left in the set.Y(Extract the individual partition scores.Z0Turn the edge probabilities into a score matrix.UVWXYZUVWXYZXWVUYZUVWXYZNone!"%&05:<=DLQRT[]Basepair distance_,Scale function for normal mfe delta energies`1Scale function for normal centroid delta energiesa?Square positive "contributions", making bad moves more unlikelyb,Scale by temperature (for probability stuff)dBasepair distanceStupid fasta readere withDumpFile is like idIO :: a -> IO aó in that it returns the data we give to the function. However, in case the dump file exists, we read it and return its contents, instead of recalculating. If it does not exist, we dump the data in addition to returning it. This forces the  Landscape. [\]^_`abcde7The path we store the serialized and compressed dump inancestral / origin sequencedestination sequenceZthe element which is to be serialized in the dump, or which would be the data in the dump6the data we put in, but maybe taken from the dump fileD[\]^_`abcde[\]^_`abcdeD [\]^_`abcdef      !"#$%&'()*+,-./0123456789:;;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZJ[\]^_`abcdefgh,MutationOrder-0.0.0.1-FxRyfjUwv6gHkYzeoy3zDjBioInf.MutationOrderBioInf.MutationOrder.RNABioInf.MutationOrder.MinDistBioInf.MutationOrder.EdgeProb4PrimitiveArray-Pretty-0.0.0.2-BCsvqrplAkNDUwJiK7DhGXDiagrams.TwoD.ProbabilityGridFWfillFWlinearFWlog FillWeightFSfullFSopacityLinear FSopacityLog FillStyleQLine qlSequenceqlmfe qlensemble qlcentroid Landscapernas mutationCountlandscapeOriginlandscapeDestinationmutationPositionsRNA mutationSetprimarySequence mfeStructuremfeD1S mfeEnergycentroidStructure centroidD1ScentroidEnergybldD1SmkRNAinsertMutationscreateRNAlandscapetoFile toFileJSONfromFile fromFileJSONqlines$fFromJSONLandscape$fToJSONLandscape$fSerializeLandscape$fNFDataLandscape $fFromJSONRNA $fToJSONRNA$fSerializeRNA $fNFDataRNA $fShowRNA$fEqRNA $fGenericRNA$fShowLandscape $fEqLandscape$fGenericLandscape $fShowQLine BoundaryPart bpNormalizedbpUnnormalizedbpTotalBT1LBTUBT1PFLTS1LPFUTS1 ScaleFunctionaMinDist aMinDistCountaInsideaPrettyaCountforwardMinDist1backtrackMinDist1 minDistCountcountBackMinDist1 runCoOptDistrunCountboundaryPartFunFirstboundaryPartFunLast boundaryPart$fShowBoundaryPart$fEqBoundaryPartEBTL1TF1edgeProbPartFunedgeProbScoreMatrixrunMutationOrder posScaledbasepairDistanceMFEbasepairDistanceCentroidmfeDelta centroidDeltasquaredPositivescaleTemperaturescaleByFunction stupidReader withDumpFile