Skip to content

Commit

Permalink
added missing percentage to genoStats output
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan Schiffels committed Apr 11, 2018
1 parent 1b4104a commit 2d6e126
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src-genoStats/genoStats.hs
Expand Up @@ -152,8 +152,11 @@ reportStats names = do

printReports :: (MonadIO m) => [Text] -> (Text, StatsReportAllSamples) -> m ()
printReports names (chrom, reports) =
forM_ (zip names reports) $ \(n, StatsReport mis ref alt het) ->
liftIO . putStrLn $ format (s%"\t"%s%"\t"%d%"\t"%d%"\t"%d%"\t"%d) chrom n mis ref alt het
forM_ (zip names reports) $ \(n, StatsReport mis ref alt het) -> do
let total = mis + ref + alt + het
misPerc = round $ (fromIntegral mis / fromIntegral total) * 100.0
liftIO . putStrLn $ format (s%"\t"%s%"\t"%d%" ("%d%"%)\t"%d%"\t"%d%"\t"%d) chrom n mis
misPerc ref alt het

accumulateAllChromStats :: [Text] -> Fold (Text, StatsReportAllSamples) (Text, StatsReportAllSamples)
accumulateAllChromStats names = Fold step initial extract
Expand Down
2 changes: 1 addition & 1 deletion stack.yaml
Expand Up @@ -3,7 +3,7 @@ packages:
- location: .
- location:
git: https://github.com/stschiff/sequence-formats.git
commit: a44d607e96fb230739613d28a95d89c208f53f76
commit: b781460be6127923b996b9e2295a061f5948e4ba
extra-dep: true
extra-deps: []
resolver: lts-10.5

0 comments on commit 2d6e126

Please sign in to comment.