packages feed

diversity 0.3.4.1 → 0.3.5.0

raw patch · 2 files changed

+24/−14 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

diversity.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                diversity-version:             0.3.4.1+version:             0.3.5.0 synopsis:            Return the diversity at each position for all sequences in a fasta file description:         Find the diversity of a collection of entities, mainly for use with fasta sequences. Produces a binary which works on fasta files to find the diversity of any order and rarefaction curves for a sliding window across all positions in the sequences. To analyze just a collection of entities, just use the whole sequences and list flag. homepage:            https://github.com/GregorySchwartz/diversity
src/src-exec/Main.hs view
@@ -29,6 +29,7 @@                        , list                   :: Bool                        , sample                 :: Bool                        , rarefactionDF          :: Bool+                       , std                    :: Bool                        , outputRarefaction      :: String                        , outputRarefactionCurve :: String                        , output                 :: String@@ -106,6 +107,11 @@           ( long "rarefaction-df"          <> short 'd'          <> help "Whether to output the rarefaction curve as a data frame" )+      <*> switch+          ( long "std"+         <> short 't'+         <> help "Whether to output to stdout or to a file if no file is\+                 \ supplied" )       <*> strOption           ( long "output-rarefaction"          <> short 'O'@@ -129,7 +135,9 @@  generateDiversity :: Options -> IO () generateDiversity opts = do-    contentsFile <- readFile . inputFasta $ opts+    contentsFile    <- if (null . inputFasta $ opts)+                        then getContents+                        else readFile . inputFasta $ opts     let lineIt       = unlines . (:) ">" . intersperse ">" . lines         contents     = if (list opts) then lineIt contentsFile else contentsFile         label        = inputLabel opts@@ -149,14 +157,16 @@                        window                        fastaList +        howToOutput x = if std opts then putStrLn else writeFile x+     if (null . output $ opts)         then return ()-        else writeFile (output opts)+        else howToOutput (output opts)            . printDiversity label order window            $ positionMap     if (null . outputRarefaction $ opts)         then return ()-        else writeFile (outputRarefaction opts)+        else howToOutput (outputRarefaction opts)            $ printRarefaction              (sample opts)              (fastBin opts)@@ -167,16 +177,16 @@              positionMap     if (null . outputRarefactionCurve $ opts)         then return ()-        else writeFile (outputRarefactionCurve opts) $-            printRarefactionCurve-            (rarefactionDF opts)-            (sample opts)-            (fastBin opts)-            start-            interval-            label-            window-            positionMap+        else howToOutput (outputRarefactionCurve opts)+           $ printRarefactionCurve+             (rarefactionDF opts)+             (sample opts)+             (fastBin opts)+             start+             interval+             label+             window+             positionMap  main :: IO () main = execParser opts >>= generateDiversity