sgrep (empty) → 0.0
raw patch · 3 files changed
+39/−0 lines, 3 filesdep +basedep +biodep +regex-compatsetup-changed
Dependencies added: base, bio, regex-compat
Files
- SGrep.hs +17/−0
- Setup.hs +5/−0
- sgrep.cabal +17/−0
+ SGrep.hs view
@@ -0,0 +1,17 @@+-- Sequence Grep - search sequences for regular expressions++module Main where++import Bio.Sequence++import Text.Regex+import System.IO+import System.Environment++main :: IO ()+main = do+ [pat,file] <- getArgs+ let match s = case matchRegex (mkRegex pat) (toStr $ seqheader s) of + Just _ -> True; _ -> False+ hWriteFasta stdout =<< filter match `fmap` readFasta file+
+ Setup.hs view
@@ -0,0 +1,5 @@+#!/usr/bin/env runhaskell+ +import Distribution.Simple+main = defaultMain+
+ sgrep.cabal view
@@ -0,0 +1,17 @@+Name: sgrep+Version: 0.0+License: GPL +Category: Bioinformatics+Author: Ketil Malde+Maintainer: Ketil Malde <ketil@malde.org>+Homepage: http://blog.malde.org/++Synopsis: Sgrep - grep Fasta files for sequences matching a regular expression+Description: This is a simple utility to extract sequences from Fasta files. It+ expects its first parameter to be a regular expression, and its second+ to be a Fasta-formatted file. It will then output all sequences matching+ the regexp to standard output.+Build-Type: Simple+Executable: sgrep+Build-Depends: base>=3 && <5, bio, regex-compat+Main-Is: SGrep.hs