Skip to content

Commit f94cd7b

Browse files
committed
Fixed less than to less than or equal to. Modified output format.
1 parent 93e9a26 commit f94cd7b

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/Comparison.hs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import qualified Data.Set as Set
1919
import qualified Data.Vector.Unboxed as V
2020
import FET
2121
import GHC.Generics (Generic)
22-
import Prelude (Double, abs, error, fromIntegral,
22+
import Prelude (not, Double, abs, error, fromIntegral,
2323
otherwise, undefined, (&&), (*),
2424
(+), (-), (/), (>))
2525
import Table
@@ -142,13 +142,15 @@ formatComparisonResult :: Double
142142
-> Comparison
143143
-> [ComparisonResult]
144144
-> [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
146148
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"]
149151
comparisonHeader =
150-
BS.intercalate (BS.singleton '\n') [compDetails c
151-
,columnHeader]
152+
BS.intercalate "---\n" [compDetails c
153+
,columnHeader]
152154
columnHeader ="Name\tGroupOne (+)\tGroupOne (-)\tGroupTwo (+)\tGroupTwo (-)\tpValue\tRatio\n"
153155
comparisonValues = foldl' formatSingleResult [] (sortComparisonResultByRatio cr')
154156
-- |Custom sorting function for [ComparisonResult] by abs(ratio).

src/UserInput.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ feht = UserInput
6262
<> help "Group2 column name, followed by optional Group2 labels to include as part of the group")
6363
<*> option auto
6464
(long "delimiter"
65-
<> short 'd'
66-
<> metavar "[',', '\\t' ...], DEFAULT='\t'"
65+
<> short 'l'
66+
<> metavar "[',', '\\t' ...], DEFAULT='\\t'"
6767
<> value '\t'
6868
<> help "Delimiter used for both the metadata and data file")
6969
<*> option parseUserMode

0 commit comments

Comments
 (0)