-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
67 lines (40 loc) · 1.62 KB
/
README
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
HOW TO INSTALL
First run configure:
./configure
If you want to build python module and/or R package, use one of:
./configure --enable-R
./configure --enable-python
./configure --enable-R --enable-python
Now you can build it:
make
If you encounter 'swig error', you can use force to use the bundled the files:
touch python/src/py_wrap.c R/mcs/src/r_wrap.c
If you choose to make python module, cd the `python' folder and install
it:
cd python
python2.4 setup.py install
If you choose to make a R package, cd the `R' folder and install it:
cd R
R CMD INSTALL mcs
HOW TO USE
To use the C library, consult examples in folder `tests':
- test.c: the most simple example
- tes-longresult.c: simple test that loads full match result
- sdf_mcs.cc: example that reads SDF instead of graph file
- test-timed.c: calculation with timeout control
- batch.c: batch processing
To use the python module, consult file tests/calc_mcs.py.
To use the R package, follow the following instructions:
1) to parse SDF, use `graph.from.sdffile'. The only argument is
a URL to sdf or path to a local fle.
z <- graph.from.sdffile("http://bioweb.ucr.edu/ChemMineV2/compound/Aurora/6000/sdf")
zz <- graph.from.sdffile("mycompound.sdf")
2) to calculate mcs, invoke mcs
match <- mcs(z, zz)
the return value are the size, and the lists of matched atoms
in both compounds.
If the calculation takes too long, you may set a timeout:
match <- mcs(z, zz, timeout=30)
The search will run at most 30 seconds in this case.
3) to get the matched substructure, use subsdf:
subsdf(z, match$sub1)