Safe Haskell | None |
---|---|
Language | Haskell2010 |
Simple score and distance matrices. These are two-dimensional tables together with row and column vectors of names.
- data ScoreMatrix t = ScoreMatrix {}
- (.!.) :: Unbox t => ScoreMatrix t -> (Int, Int) -> t
- nodeDist :: Unbox t => ScoreMatrix t -> Int -> t
- rowNameOf :: ScoreMatrix t -> Int -> Text
- colNameOf :: ScoreMatrix t -> Int -> Text
- numRows :: Unbox t => ScoreMatrix t -> Int
- numCols :: Unbox t => ScoreMatrix t -> Int
- listOfRowNames :: ScoreMatrix t -> [Text]
- listOfColNames :: ScoreMatrix t -> [Text]
- toPartMatrix :: Double -> ScoreMatrix Double -> ScoreMatrix (Log Double)
- fromFile :: FilePath -> IO (ScoreMatrix Double)
Documentation
data ScoreMatrix t Source #
NxN sized score matrices
TODO needs a vector with the column names!
(.!.) :: Unbox t => ScoreMatrix t -> (Int, Int) -> t Source #
Get the distance between edges (From,To)
.
nodeDist :: Unbox t => ScoreMatrix t -> Int -> t Source #
If the initial node has a "distance", it'll be here
listOfRowNames :: ScoreMatrix t -> [Text] Source #
listOfColNames :: ScoreMatrix t -> [Text] Source #
:: Double | temperature |
-> ScoreMatrix Double | |
-> ScoreMatrix (Log Double) |
Turns a ScoreMatrix
for distances into one scaled by "temperature" for
Inside/Outside calculations. Each value is scaled by
k -> exp $ negate k / r * t
where
r = (n-1) * d
d = mean of genetic distance
Node scores are turned directly into probabilities.
TODO Again, there is overlap and we should really have newtype
Distance
and friends.
TODO newtype Temperature = Temperature Double
TODO fix for rows /= cols!!!