summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Messick <ericm@nanorex.com>2008-05-19 17:44:24 +0000
committerEric Messick <ericm@nanorex.com>2008-05-19 17:44:24 +0000
commit4cfe3ef85fb970bb4207d14cb7808748de927d76 (patch)
treef902522fe43f35ac005118d436625b505f331da8
parent3e45e230133e0b35d830044e7f006a2cdd814175 (diff)
downloadnanoengineer-theirix-4cfe3ef85fb970bb4207d14cb7808748de927d76.tar.gz
nanoengineer-theirix-4cfe3ef85fb970bb4207d14cb7808748de927d76.zip
Allow anchoring of PAM5 basepair virtual centers
-rwxr-xr-xcad/plugins/NanoDynamics-1/sim-params.txt8
-rwxr-xr-xcad/src/model/PAM_Atom_methods.py2
-rw-r--r--sim/src/pam5_patterns.c46
-rwxr-xr-xsim/src/part.c15
-rwxr-xr-xsim/src/part.h14
-rw-r--r--sim/src/printGromacsTopology.c19
6 files changed, 87 insertions, 17 deletions
diff --git a/cad/plugins/NanoDynamics-1/sim-params.txt b/cad/plugins/NanoDynamics-1/sim-params.txt
index 7d6fce755..b46f85352 100755
--- a/cad/plugins/NanoDynamics-1/sim-params.txt
+++ b/cad/plugins/NanoDynamics-1/sim-params.txt
@@ -59,6 +59,9 @@ element 207 0 0 P5d Hp5 DNA-Pseudo-Hairpin 167.0 0.0 0.0 2
element 208 0 0 P5G Gv5 DNA-Pseudo-Groove 167.0 0.0 0.0 2 100 0 0 820
element 209 0 0 P5G Gr5 DNA-Pseudo-Groove-End 167.0 0.0 0.0 2 100 0 0 820
+element 213 0 0 P5d Ah5 DNA-Pseudo-Axis-Handle 1.0 0.0 0.0 1 100 0 0
+element 219 0 0 P5V vAh5 DNA-Pseudo-Axis-Handle-v 0.0 0.0 0.0 1 100 0 0
+
element 220 0 0 P5V vDa1 virtual-DNA-planeA-1 0.0 0.0 0.0 1 100 0 1
element 221 0 0 P5V vDa1p virtual-DNA-planeA-1p 0.0 0.0 0.0 1 100 0 1
element 222 0 0 P5V vDa2 virtual-DNA-planeA-2 0.0 0.0 0.0 1 100 0 1
@@ -159,6 +162,11 @@ stretch 0.00 519.00 1.0000 -1 -1 9 1 Gv5-1-Gv5
stretch 0.00 519.00 1.0000 -1 -1 9 1 Gv5-1-Gr5
stretch 0.00 519.00 1.0000 -1 -1 9 1 Gr5-1-Gr5
+stretch 0.00 519.00 1.0000 -1 -1 9 1 Gv5-1-Ah5
+stretch 0.00 519.00 1.0000 -1 -1 9 1 Gv5-1-vAh5
+stretch 100.00 0.00 1.0000 -1 -1 9 1 Ah5-1-vAh5
+
+
# this is overridden by separate directional parameters below, but we
# still need a max value for bond stretch indicators
stretch 4.00 510.00 1.0000 -1 -1 9 1 Ss5-1-Pl5
diff --git a/cad/src/model/PAM_Atom_methods.py b/cad/src/model/PAM_Atom_methods.py
index 9dd7325b8..ac4c3b4e3 100755
--- a/cad/src/model/PAM_Atom_methods.py
+++ b/cad/src/model/PAM_Atom_methods.py
@@ -269,7 +269,7 @@ class PAM_Atom_methods:
for n in baggage[:]:
if not n.is_singlet():
baggage.remove(n)
- other.append(n)
+ others.append(n)
continue
pass
diff --git a/sim/src/pam5_patterns.c b/sim/src/pam5_patterns.c
index bd6b87e79..07e1dd50c 100644
--- a/sim/src/pam5_patterns.c
+++ b/sim/src/pam5_patterns.c
@@ -142,6 +142,8 @@ static double vDbx_p[8];
static double vDbx_q[8];
static struct atomType *vDa_type[8];
static struct atomType *vDb_type[8];
+static double axis_pq;
+static struct atomType *vAh5_type;
static struct bondStretch *stretch_5_Pl_Ss_3;
static struct bondStretch *stretch_5_Ss_Pl_3;
@@ -228,6 +230,9 @@ init_stack_match(void)
x_g = param->value;
param = getPatternParameter("PAM5:basis-y_m"); BAIL();
y_m = param->value;
+
+ vAh5_type = getAtomTypeByName("vAh5");
+ changeBasis(x_o, x_g, y_m, 0.0, 0.0, &axis_pq, &axis_pq);
for (i=0; i<8 && i<numStruts; i++) {
sprintf(buf, "strut-%d", i+1);
@@ -335,6 +340,38 @@ pam5_stack_match(struct patternMatch *match)
//printMatch(match);
}
+static void
+pam5_basepair_handle_match(struct patternMatch *match)
+{
+ struct atom *aAh = match->p->atoms[match->atomIndices[0]];
+ struct atom *aGv = match->p->atoms[match->atomIndices[1]];
+ struct atom *aS1 = match->p->atoms[match->atomIndices[2]];
+ struct atom *aS2 = match->p->atoms[match->atomIndices[3]];
+ struct atom *vA;
+ struct bond *bond;
+
+ pam5_requires_gromacs(match->p); BAIL();
+ init_stack_match(); BAIL();
+
+ // S1
+ // |
+ // Gv----Ah
+ // |
+ // S2
+ if (aAh->isGrounded) {
+ vA = makeVirtualAtom(vAh5_type, sp3, 3, 1,
+ aGv, aS1, aS2, NULL,
+ axis_pq, axis_pq, 0.0);
+
+ bond = makeBond(match->p, vA, aAh, '1');
+ queueAtom(match->p, vA);
+ trace_makeVirtualAtom(match, vA);
+ queueBond(match->p, bond);
+ trace_makeBond(match, bond);
+ }
+ //printMatch(match);
+}
+
// Sets the phosphate-sugar bond type differently based on the bond
// direction. This allows the phosphate to be closer to one sugar
// than the other, based on the strand direction.
@@ -573,4 +610,13 @@ createPam5Patterns(void)
t[6] = makeTraversal(a[2], a[6], '1');
t[7] = makeTraversal(a[6], a[7], '1');
makePattern("PAM3-crossover", pam3_crossover_match, 8, 8, t);
+
+ a[0] = makePatternAtom(0, "Ah5");
+ a[1] = makePatternAtom(1, "P5G");
+ a[2] = makePatternAtom(2, "P5S");
+ a[3] = makePatternAtom(3, "P5S");
+ t[0] = makeTraversal(a[0], a[1], '1');
+ t[1] = makeTraversal(a[1], a[2], '1');
+ t[2] = makeTraversal(a[1], a[3], '1');
+ makePattern("PAM5-basepair-handle", pam5_basepair_handle_match, 4, 3, t);
}
diff --git a/sim/src/part.c b/sim/src/part.c
index dbc52e909..80f32ad09 100755
--- a/sim/src/part.c
+++ b/sim/src/part.c
@@ -1659,13 +1659,14 @@ addVirtualAtom(struct part *p, struct atom *a)
if (a == NULL) {
return;
}
- p->num_virtual_atoms++;
- p->virtual_atoms = (struct atom **)accumulator(p->virtual_atoms,
- sizeof(struct atom *) *
- p->num_virtual_atoms,
- 0);
- p->virtual_atoms[p->num_virtual_atoms - 1] = a;
- a->index = p->num_virtual_atoms - 1;
+ p->num_generated_atoms++;
+ p->generated_atoms = (struct atom **)accumulator(p->generated_atoms,
+ sizeof(struct atom *) *
+ p->num_generated_atoms,
+ 0);
+ p->generated_atoms[p->num_generated_atoms - 1] = a;
+ a->index = p->num_generated_atoms - 1;
+ a->isGenerated = 1;
hashtable_put(p->atomTypesUsed, a->type->symbol, a->type);
diff --git a/sim/src/part.h b/sim/src/part.h
index 9c1d42123..d1646d8be 100755
--- a/sim/src/part.h
+++ b/sim/src/part.h
@@ -72,6 +72,13 @@ struct atom
// 4.7 and 5.2.2.
unsigned char virtualFunction;
+ // Determines which atom numbering space this atom lives in.
+ // Atoms read in from the .mmp file have isGenerated == zero, and
+ // are stored in part->atoms. Atoms generated by pattern match
+ // routines have isGenerated != 0, and are stored in
+ // part->generated_atoms.
+ unsigned char isGenerated;
+
union {
struct {
// These are the atoms that the position of this virtual site is
@@ -387,8 +394,11 @@ struct part
int num_atoms;
struct atom **atoms;
- int num_virtual_atoms;
- struct atom **virtual_atoms;
+ // These atoms have been generated internally, so they are
+ // numbered in their own space. Atom numbers for them have
+ // num_atoms added to them.
+ int num_generated_atoms;
+ struct atom **generated_atoms;
int num_charged_atoms;
struct atom **charged_atoms;
diff --git a/sim/src/printGromacsTopology.c b/sim/src/printGromacsTopology.c
index 450385adc..9699f677f 100644
--- a/sim/src/printGromacsTopology.c
+++ b/sim/src/printGromacsTopology.c
@@ -18,7 +18,7 @@ zJ_to_kJpermol(double zeptoJoules)
static int
atomNumber(struct part *p, struct atom *a)
{
- if (a->virtualConstructionAtoms != 0) {
+ if (a->isGenerated != 0) {
return a->index + p->num_atoms + 1;
} else {
return a->index + 1;
@@ -183,7 +183,9 @@ writeGromacsVirtualSite(FILE *top, struct part *p, struct atom *a)
double virtualA = a->creationParameters.v.virtualA;
double virtualB = a->creationParameters.v.virtualB;
- fprintf(top, "%5d %5d %5d %5d %d %f %f\n", atom_num, atomNumber(p, v1), atomNumber(p, v2), atomNumber(p, v3), function, virtualA, virtualB);
+ if (a->virtualConstructionAtoms > 0) {
+ fprintf(top, "%5d %5d %5d %5d %d %f %f\n", atom_num, atomNumber(p, v1), atomNumber(p, v2), atomNumber(p, v3), function, virtualA, virtualB);
+ }
}
static void
@@ -597,7 +599,7 @@ printGromacsToplogy(char *basename, struct part *p)
fprintf(top, "; nr type resnr residue atom cgnr charge mass\n");
fprintf(gro, "Generated by NanoEngineer-1\n");
- fprintf(gro, "%3d\n", p->num_atoms + p->num_virtual_atoms);
+ fprintf(gro, "%3d\n", p->num_atoms + p->num_generated_atoms);
if (EnableNeighborSearchGrid) {
getBoundingVolume(p, &min, &max, vdwCutoff);
@@ -619,8 +621,8 @@ printGromacsToplogy(char *basename, struct part *p)
for (i=0; i<p->num_atoms; i++) {
writeGromacsAtom(top, gro, ndx, p, p->atoms[i], min);
}
- for (i=0; i<p->num_virtual_atoms; i++) {
- writeGromacsAtom(top, gro, ndx, p, p->virtual_atoms[i], min);
+ for (i=0; i<p->num_generated_atoms; i++) {
+ writeGromacsAtom(top, gro, ndx, p, p->generated_atoms[i], min);
}
fprintf(gro, "%10.5f%10.5f%10.5f\n", boxsize.x, boxsize.y, boxsize.z); // periodic box size
@@ -630,8 +632,11 @@ printGromacsToplogy(char *basename, struct part *p)
fprintf(top, "\n");
fprintf(top, "[ virtual_sites3 ]\n");
- for (i=0; i<p->num_virtual_atoms; i++) {
- writeGromacsVirtualSite(top, p, p->virtual_atoms[i]);
+ for (i=0; i<p->num_atoms; i++) {
+ writeGromacsVirtualSite(top, p, p->atoms[i]);
+ }
+ for (i=0; i<p->num_generated_atoms; i++) {
+ writeGromacsVirtualSite(top, p, p->generated_atoms[i]);
}
fprintf(top, "\n");