summaryrefslogtreecommitdiff
path: root/cad/src/experimental/namot/NOTES
blob: dcf23e1b53355695b70df34799ddbe6944ef8378 (plain)
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171


 Copyright 2006-2007 Nanorex, Inc.  See LICENSE file for details. 

To build NAMOT, I needed to run 'ldconfig' as root so that the
configure script could find libgsl.so in /usr/local/lib. You find
this out when configure fails by studying config.log.

Also in src/x.h, I needed to comment out the definition for "Byte".
It conflicted with something.

=============================================

I think I can get a lot of use out of the ParseAddUnitInfo and
ParseAddHelixInfo functions.

ProcessString uses functions from top_level_commands in cmds_h.c. This
is the top of a two-deep tree that brings you to functions at the
level of ParseAddUnitInfo. This is a command line interface, and I
have not figured out how to bring up the window for entering the
command line.

Lots of useful structs defined in defs.h.

"H:U:B" means "helix unit base".
"M:C:G" means "molecule chain group".

The generate_bp function generates atomic co-ordinates from H:U:B
parameters. This appears to be the heavy lifting for figuring out
where the atoms will go in the base pairs. For the backbone, the
corresponding functions are generate_sugar and generate_phosphate.

A Base_unit aggregates a sequence of bases and some deformation
information for them. A Helix owns one or more Base_units and each
Base_unit owns one or more Bases. Each base owns one or more atoms.

There is a non-standard use of the word "strands" in a variable name
in generate_bp, where it is actually being used to mean "number of
bases in this base unit". Probably a new programmer was writing this
code and was unfamiliar with the conventional nomenclature.

I think "bendH" means "bend helix", not "bend hydrogen". Several
functions are suffixed with "H", and I suspect that always refers to
"helix".

Places where we assign the X coordinates of molecules, gotten by
searching for the string "->x = ". Ignore occurrences for
_BrokenLinks, Text and Vector_t objects, we only care about ATom
objects.

load_into_sugar  (Loads the furanose co-ordinates in the data structures)
load_into_phop   (Load phosphate into data structures.)
generate_ho3     (Generate HE)  used by "generate_phosphate"
generate_ho5     (Generate HB)  used by "generate_phosphate"
add_c5_hs        (add the c5 hydrogens)
load_into_base   (loads the coordinates into the global data structures)
read_amber       (Loads in amber files.)
read_amber7
read_pdb
rotate           (rotate the molecule(s) around a given axes and a given point)
ALIGN            (Aligns the specified atoms)

Try to find out what SSTBuildAtomics is about. It mightt be important.
It is called by generate. "SST" seems to stand for "single strand".

------------------------------

What are the different kinds of distortions, and how do they modify
the atom coordinates?

These use "->twist" and "->tilt" and "->roll", as well as the
displacement vector for Base_unit.

    add_helix_to_molecule  (add a helix from the helix lib to HUB)
    engage           (Builds canonical helices from minimal information)

Form_lib has three parameters, tilt, twist, and roll.

Unit_lib has several.

Helix_lib has tilt, roll, and twist, and a displacement vector.

Base_unit has three angles (Omega, tau, rho) and a displacement
vector.

-----------------------------

My impression at this point is that I'm likely to make a call to
ParseAddHelixInfo, passing it command line information, it is then
going to cook up the atom positions, and then maybe I can make it
write a PDB file.

To get command line behavior, comment out the call to X11Init in
main() and recompile. You then get a 'namot>' prompt.

Here is my meager understanding about the command line, for the
moment. You can say 'add helix example 0 0 0 0 0 0 a:b:c d:e:f' and
something happens. It must say 'example' because that's the name of a
helix, and until I understand better, the only one NAMOT will accept.

But there isn't a group yet apparently. 'a:b:c' specifies a
molecule-group-chain and those need to be set up first.

ParseAddUnitInfo args:
add unit ade B 0 0 0 0 0.000000 0.000000 3.400000 0.000000 34.000000 0.000000
add unit ade B 0 0 0 0 0.000000 0.000000 3.400000 0.000000 34.000000 0.000000
add unit thy B 0 0 0 0 0.000000 0.000000 3.400000 -0.000000 34.000000 0.000000
add unit thy B 0 0 0 0 0.000000 0.000000 3.400000 -0.000000 34.000000 0.000000

I think this would work. Build NAMOT as a command-line program. Make
repeated calls to ParseAddUnitInfo by putting in "add unit" lines as
standard input. Finish up with a "write pdb foo.pdb" line, and then
use OpenBabel to convert it to a MMP file.

If I use File->Generate to make a double-stranded piece of B-DNA, here
is how I get to load_into_base:

#0  load_into_base (bu_ptr=0x81c9648, all_x=0x81c93b8,
                    all_y=0x81c9498, all_z=0x81c9578) at Bases.c:2979
#1  0x0805cf67 in generate_bp () at Bases.c:632
#2  0x08053104 in generate () at main.c:368
#3  0x08078723 in SetRibose (argc=4, argv=0xbfb590c0) at input.c:901
#4  0x0806d69d in engage (istrand=2, isug=0, form=0x81a8d35 "b",
                          seq=0x81a7478 "gattaca") at builder.c:2433
#5  0x080865ff in ParseGenerateInfo (argc=5, argv=0xbfb5955c) at input2.c:299
#6  0x080832cc in ProcessString (lline=0x81a8ce8 "generate d d b
                                 gattaca\n", RecHist=0 '\0') at cmds_h.c:398
#7  0x08071353 in gen_action_choice_handler (widget=0x819ec78,
                    client_data=0x0, call_data=0x81c9648) at handlers.c:1995
#8  0xb7c9b873 in XtCallCallbackList () from /usr/X11R6/lib/libXt.so.6
#9  0xb7dae9f7 in _XmMenuFocus () from /usr/X11R6/lib/libXm.so.2

The command line arguments handed to ParseGenerateInfo are:
	generate d d b gattaca
argv works like this:
(0) Always the word "generate".
(1) Either "s" or "d", for single or double strand.
(2) Either "d" or "r", for DNA or RNA.
(3) Form, can be "a", "b", or "z", and some other choices. Passed to
	the engage function as its third argument. The other choices
	are "0", "t", and "q", I don't know what those are. This stuff
	is taken from libs/form.lib.
(4) Sequence, e.g. "gattaca".

ParseGenerateInfo does not give the opportunity to apply distortions.
It just makes up a vanilla helix or double helix. But you can use
these:

namot> modify sug w 1:1:1 1:4:2 0.5
# Legitimate parameters: w, q, chi
namot> modify base pt 1:1:1 1:4:2 0.5
# Legitimate parameters here: sx, sy, sz, bu, op, pt
# I don't know what they mean.
INFO:Change of 0.500000 in bu
INFO:Change of 0.500000 in bu
INFO:Change of 0.500000 in bu
INFO:Change of 0.500000 in bu
INFO:Change of 0.500000 in bu
INFO:Change of 0.500000 in bu
INFO:Change of 0.500000 in bu
INFO:Change of 0.500000 in bu
namot> modify phos phi 1:1:1 1:4:2 0.5
# Legitimate parameters: tors, ang1, ang2, phi

Let's take a stab at a Python script. See hack.py.

Oops, I found what appears to be a bug in input.c, lines 1086 and 1102
appear to be swapped. There is also a naming discrepancy between "pr"
and "pt".

Hmm, there is a Python interface called pynamot. Let's try that.