No title

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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import Data.AminoAcid              -- http://lpaste.net/107071
import Data.Bases                  -- http://lpaste.net/107069
import Data.Relation               -- http://lpaste.net/2242323977663938560

{--
@1HaskellADay problem for 2016-02-05

ref: aminos.hs

This exercise is based off the acids.defs file located at:

http://lpaste.net/raw/3763369603112108032

If you read the works of Sowa, etc, you know that any set of conjunctive rules
can be reduced to binary rules, so that, e.g.:

a: gct gcc gca gcg

can be reduced to:

a: gct
a: gcc
a: gca
a: gcg

So, let's do that. Annnnd, make sure the Acids and Bases are capitalized now:

A: GCT
A: GCC
A: GCA
A: GCG

Please, and thank you.

Using the above input file, read it in and output the result as a set of binary
rules (again, as above). Show your result.
--}

binaryRulesM :: FilePath -> IO [(AcidName, NucleotideTriple)]
binaryRulesM = undefined

{-- BONUS ---------------------------------------------------------------------

Output these binary rules as JSON-Statements (see Relation import above),
This involves writing Cypher MERGE statements of the form:

MERGE (a:ACID { name: 'A' })
MERGE (b:TRIPLE { name: 'GCT' })
MERGE (a)-[:REP]->(b)

(The three MERGE-statements form one Statement-block.)

Do that.
--}

mergeAcid :: AcidName -> NucleotideTriple -> Cypher
mergeAcid = undefined

{-- BONUS-BONUS ---------------------------------------------------------------

Send these Cypher-statements to your neo4j graph database (don't have one? You
can download for free or go to, e.g. grapheneDB.com for a free graph DaaS) (or
you can skip the bonus-bonus). Show your graph representation of the Amino Acid
table.
--}

graphAcids :: FilePath -> [(AcidName, NucleotideTriple)] -> IO ()
graphAcids = undefined

-- a solution to this problem is posted at http://lpaste.net/9122099753146908672