aboutsummaryrefslogtreecommitdiff
path: root/xenomapper.hs
diff options
context:
space:
mode:
authorJustin Bedo <cu@cua0.org>2021-07-29 17:03:11 +1000
committerJustin Bedo <cu@cua0.org>2021-07-29 17:03:11 +1000
commitc10cfb984d3a0881458018325e2b95219ed16829 (patch)
tree7ccbc5fade0d687bceed7510cd5b2d61afeb6839 /xenomapper.hs
parent6bd9f1715fc2e1d4548046e3ce2bd91d64625a1e (diff)
add readme and more friendlier usage instructions
Diffstat (limited to 'xenomapper.hs')
-rw-r--r--xenomapper.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/xenomapper.hs b/xenomapper.hs
index 123b1a5..4546ab2 100644
--- a/xenomapper.hs
+++ b/xenomapper.hs
@@ -36,6 +36,9 @@ filterBams a b = do
main = do
args <- getArgs
-
- withLogging_ (LoggingConf Warning Error Error 10 True) $ do
- decodeBamFiles args (\[(hdr, prim), (_, sec)] -> writeBamFile "primary.bam" hdr $ filterBams prim sec)
+ if length args /= 3 then do
+ path <- getProgName
+ hPutStrLn stderr $ unwords [ "usage:", path, "output.bam", "input1.bam", "input2.bam" ]
+ else
+ withLogging_ (LoggingConf Warning Error Error 10 True) $ do
+ decodeBamFiles (tail args) (\[(hdr, prim), (_, sec)] -> writeBamFile (head args) hdr $ filterBams prim sec)