File: packed-argest.lhs

package info (click to toggle)
genometools 1.6.1%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 50,412 kB
  • sloc: ansic: 271,241; ruby: 30,339; python: 4,880; sh: 3,193; makefile: 1,194; perl: 219; pascal: 159; haskell: 37; sed: 5
file content (47 lines) | stat: -rw-r--r-- 1,477 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
>module Main where

>import List

>db = [s ++ " -db #{dbdna}" | s<-[" -dna"," -smap TransDNA"]]
>plen = [s ++ " -pl" | s<-[" -bck"," "]]
>dirs = [" -dir " ++ s | s<-["fwd","cpl","rev","rcl"]]
>parts = [" -parts " ++ show i | i<-[1,2,3]]
>cartesian x y = [s++t | s<-x, t<-y]

>sufbwt::[String]
>sufbwt = cartesian sufargs bwtargs
>         where sufargs = [" -suf -lcp " ++ dir | dir<-dirs] ++ [" "]
>               bwtargs = [" -bwt"," "]

>packedindex::[String]
>packedindex = cartesian (cartesian bsize blbuck) locfreq
>              where bsize = [" -bsize " ++ show i | i<-[8,9,10]]
>                    blbuck = [" -blbuck " ++ show i | i<-[8,9,10]]
>                    locfreq = [" -locfreq " ++ show i | i<-[0,8,16,32]]

>calls::[String]->[String]
>calls xx = [
>            "def makesuffixeratorarglisttable(dbdna)",
>            "  arglisttable =",
>            "  ["] ++
>           [gencall (d ++ p ++ tis ++ x) | 
>            d<-db,
>            p<-plen,
>            part<-parts,
>            tis<-[" -tis"," "],
>            x<-xx
>            ] ++
>            ["  ]",
>             "  return arglisttable",
>             "end\n"]
>            where sufargs = [" -suf -lcp " ++ dir | dir<-dirs] ++ [" "]
>                  bwtargs = [" -bwt"," "]

>gencall::String->String
>gencall s = "   \"" ++ s ++ "\","

>main::IO ()
>main = writeFile "Suffixerator-table.rb" (unlines (calls packedindex))

main = writeFile "Suffixerator-table.rb" (unlines.calls sufbwt)