@@ -19,7 +19,7 @@ import qualified Data.Set as Set
19
19
import qualified Data.Vector.Unboxed as V
20
20
import FET
21
21
import GHC.Generics (Generic )
22
- import Prelude (Double , abs , error , fromIntegral ,
22
+ import Prelude (not , Double , abs , error , fromIntegral ,
23
23
otherwise , undefined , (&&) , (*) ,
24
24
(+) , (-) , (/) , (>) )
25
25
import Table
@@ -142,13 +142,15 @@ formatComparisonResult :: Double
142
142
-> Comparison
143
143
-> [ComparisonResult ]
144
144
-> [BS. ByteString ]
145
- formatComparisonResult d xs c cr = x: xs
145
+ formatComparisonResult d xs c cr
146
+ | not (null cr') = x: xs
147
+ | otherwise = xs
146
148
where
147
- cr' = filter (\ z -> d < (abs . compRatio $ z)) cr
148
- x = BS. concat [comparisonHeader, BS. concat comparisonValues]
149
+ cr' = filter (\ z -> d <= (abs . compRatio $ z)) cr
150
+ x = BS. concat [" [#- \n " , comparisonHeader, BS. concat comparisonValues, " -#] \n " ]
149
151
comparisonHeader =
150
- BS. intercalate ( BS. singleton ' \n ' ) [compDetails c
151
- ,columnHeader]
152
+ BS. intercalate " --- \n " [compDetails c
153
+ ,columnHeader]
152
154
columnHeader = " Name\t GroupOne (+)\t GroupOne (-)\t GroupTwo (+)\t GroupTwo (-)\t pValue\t Ratio\n "
153
155
comparisonValues = foldl' formatSingleResult [] (sortComparisonResultByRatio cr')
154
156
-- | Custom sorting function for [ComparisonResult] by abs(ratio).
0 commit comments