From 9c2c35ccfb3f87e751e89fefa9eaf7614256a8bb Mon Sep 17 00:00:00 2001
From: Gerardo Tauriello <gerardo.tauriello@unibas.ch>
Date: Mon, 17 Oct 2016 11:00:16 +0200
Subject: [PATCH] Fixes: atom_names in topo creater, GetNumUreyBradleyAngles
 export and doc.

---
 modules/mol/mm/doc/topology.rst         | 49 ++++++++++++++-----------
 modules/mol/mm/pymod/export_topology.cc |  1 +
 modules/mol/mm/src/topology_creator.cc  |  1 +
 3 files changed, 30 insertions(+), 21 deletions(-)

diff --git a/modules/mol/mm/doc/topology.rst b/modules/mol/mm/doc/topology.rst
index dd6cb8370..19760508c 100644
--- a/modules/mol/mm/doc/topology.rst
+++ b/modules/mol/mm/doc/topology.rst
@@ -194,7 +194,7 @@ The Topology Class
 
 
 
-  .. method:: AddHarmonicAngle(index_one, index_two, index_three, angle, 
+  .. method:: AddHarmonicAngle(index_one, index_two, index_three, angle, \
                                force_constant)
 
     :param index_one:   Index of particle 1
@@ -215,8 +215,8 @@ The Topology Class
                          particles
 
 
-  .. method:: AddUreyBradleyAngle(index_one, index_two, index_three, 
-                                  angle, angle_force_constant,
+  .. method:: AddUreyBradleyAngle(index_one, index_two, index_three, \
+                                  angle, angle_force_constant, \
                                   bond_length, bond_force_constant)
 
     :param index_one:   Index of particle 1
@@ -241,8 +241,9 @@ The Topology Class
                          particles
 
 
-  .. method:: AddPeriodicDihedral(index_one, index_two, index_three, index_four,
-                                  multiplicity, phase, force_constant)
+  .. method:: AddPeriodicDihedral(index_one, index_two, index_three, \
+                                  index_four, multiplicity, phase, \
+                                  force_constant)
 
     :param index_one:   Index of particle 1
     :param index_two:   Index of particle 2
@@ -266,8 +267,9 @@ The Topology Class
                          particles
 
 
-  .. method:: AddPeriodicImproper(index_one, index_two, index_three, index_four,
-                                  multiplicity, phase, force_constant)
+  .. method:: AddPeriodicImproper(index_one, index_two, index_three, \
+                                  index_four, multiplicity, phase, \
+                                  force_constant)
 
     :param index_one:   Index of particle 1
     :param index_two:   Index of particle 2
@@ -291,8 +293,8 @@ The Topology Class
                          particles
 
 
-  .. method:: AddHarmonicImproper(index_one, index_two, index_three, index_four,
-                                  angle, force_constant)
+  .. method:: AddHarmonicImproper(index_one, index_two, index_three, \
+                                  index_four, angle, force_constant)
 
     :param index_one:   Index of particle 1
     :param index_two:   Index of particle 2
@@ -314,7 +316,7 @@ The Topology Class
                          particles
 
 
-  .. method:: AddCMap(index_one, index_two, index_three, index_four,
+  .. method:: AddCMap(index_one, index_two, index_three, index_four, \
                       index_five, dimension, values)
 
     :param index_one:   Index of particle 1
@@ -407,8 +409,9 @@ The Topology Class
                          particles
 
 
-  .. method:: AddHarmonicPositionRestraint(index, reference_pos, force_constant,
-                                           x_scale=1.0, y_scale=1.0, z_scale=1.0)
+  .. method:: AddHarmonicPositionRestraint(index, reference_pos, \
+                                           force_constant, x_scale=1.0, \
+                                           y_scale=1.0, z_scale=1.0)
 
     Adds a harmonic position restraint for a particle in the form:
     force_constant*(x_scale*(x-x0)^2+y_scale*(y-y0)^2+z_scale*(z-z0)^2)
@@ -433,7 +436,8 @@ The Topology Class
                          particles
 
 
-  .. method:: AddHarmonicDistanceRestraint(index_one, index_two, length, force_constant)
+  .. method:: AddHarmonicDistanceRestraint(index_one, index_two, length, \
+                                           force_constant)
 
     Adds a force between two particles in the form:
     force_constant * (b-b0)^2
@@ -784,7 +788,8 @@ The Topology Class
     :raises:            :class:`RuntimeError` when index exceeds number of 
                          set Urey-Bradley angles
 
-  .. method:: SetPeriodicDiheralParameters(index, multiplicity, phase, force_constant)
+  .. method:: SetPeriodicDiheralParameters(index, multiplicity, phase, \
+                                           force_constant)
 
     Replaces existing parameters for a particular interaction
 
@@ -801,7 +806,8 @@ The Topology Class
     :raises:            :class:`RuntimeError` when index exceeds number of 
                          set periodic dihedrals
 
-  .. method:: SetPeriodicImproperParameters(index, multiplicity, phase, force_constant)
+  .. method:: SetPeriodicImproperParameters(index, multiplicity, phase, \
+                                            force_constant)
 
     Replaces existing parameters for a particular interaction
 
@@ -880,8 +886,9 @@ The Topology Class
                          set distance constraints
 
 
-  .. method:: SetHarmonicPositionRestraintParameters(index, ref_position, k,[,
-                                                     x_scale=1.0, y_scale=1.0, z_scale=1.0])
+  .. method:: SetHarmonicPositionRestraintParameters(index, ref_position, k,\
+                                                     x_scale=1.0, y_scale=1.0,\
+                                                     z_scale=1.0)
 
     Replaces existing parameters for a particular interaction
 
@@ -1071,7 +1078,7 @@ The Topology Class
                         number of particles in topology
 
 
-  .. method:: GetPeriodicDihedralIndices(index_one, index_two, index_three,
+  .. method:: GetPeriodicDihedralIndices(index_one, index_two, index_three, \
                                          index_four)
 
     :param index_one:   Index of particle 1
@@ -1091,7 +1098,7 @@ The Topology Class
                         number of particles in topology
 
 
-  .. method:: GetPeriodicImpropersIndices(index_one, index_two, index_three,
+  .. method:: GetPeriodicImpropersIndices(index_one, index_two, index_three, \
                                           index_four)
 
     :param index_one:   Index of particle 1
@@ -1111,7 +1118,7 @@ The Topology Class
                         number of particles in topology
 
 
-  .. method:: GetHarmonicImpropersIndices(index_one, index_two, index_three,
+  .. method:: GetHarmonicImpropersIndices(index_one, index_two, index_three, \
                                           index_four)
 
     :param index_one:   Index of particle 1
@@ -1131,7 +1138,7 @@ The Topology Class
                         number of particles in topology
 
 
-  .. method:: GetCMapIndices(index_one, index_two, index_three,
+  .. method:: GetCMapIndices(index_one, index_two, index_three, \
                              index_four, index_five)
 
     :param index_one:   Index of particle 1
diff --git a/modules/mol/mm/pymod/export_topology.cc b/modules/mol/mm/pymod/export_topology.cc
index 2469e7610..1e90e1b96 100644
--- a/modules/mol/mm/pymod/export_topology.cc
+++ b/modules/mol/mm/pymod/export_topology.cc
@@ -489,6 +489,7 @@ void export_Topology()
     .def("GetNumParticles",&ost::mol::mm::Topology::GetNumParticles)
     .def("GetNumHarmonicBonds",&ost::mol::mm::Topology::GetNumHarmonicBonds)
     .def("GetNumHarmonicAngles",&ost::mol::mm::Topology::GetNumHarmonicAngles)
+    .def("GetNumUreyBradleyAngles",&ost::mol::mm::Topology::GetNumUreyBradleyAngles)
     .def("GetNumPeriodicDihedrals",&ost::mol::mm::Topology::GetNumPeriodicDihedrals)
     .def("GetNumPeriodicImpropers",&ost::mol::mm::Topology::GetNumPeriodicImpropers)
     .def("GetNumHarmonicImpropers",&ost::mol::mm::Topology::GetNumHarmonicImpropers)
diff --git a/modules/mol/mm/src/topology_creator.cc b/modules/mol/mm/src/topology_creator.cc
index bb1c418f6..453bf132f 100644
--- a/modules/mol/mm/src/topology_creator.cc
+++ b/modules/mol/mm/src/topology_creator.cc
@@ -253,6 +253,7 @@ TopologyPtr TopologyCreator::Create(ost::mol::EntityHandle& ent,
     residue_names_of_atoms.push_back(i->GetResidue().GetName());
     atom_types.push_back(building_blocks[residue_index]->GetType(i->GetName()));
     atom_charges.push_back(building_blocks[residue_index]->GetCharge(i->GetName()));
+    atom_names.push_back(i->GetName());
     atom_masses.push_back(ff->GetMass(atom_types.back()));
     bonded_atoms = i->GetBondPartners();
     temp.clear();
-- 
GitLab