Commit b74a226a authored by cmaffeo2's avatar cmaffeo2
Browse files

Made ssDNA in atomic model be centered on C3' atom rather than dsDNA center

parent d653044e
......@@ -50,7 +50,7 @@ class CanonicalNucleotide():
self.indices = self.indices - minIdx
def transformed(self, orientation, translation, scale=0.5):
def transformed(self, orientation, translation, scale=0.5, singleStranded=False):
# rotationAboutZ -= 68
c = copy.copy(self)
c.props = copy.deepcopy(self.props)
......@@ -58,9 +58,14 @@ class CanonicalNucleotide():
## Find transformation
R = CanonicalNucleotide.DefaultOrientation.dot( orientation )
center = np.array((0,0,0))
if singleStranded:
i0 = self.index("C3'")
center = np.array([c.props[k][i0] for k in ('x','y','z')])
## Apply transformation
for i in range(len(c)):
rvec = np.array([c.props[k][i] for k in ('x','y','z')])
rvec = np.array([c.props[k][i] for k in ('x','y','z')]) - center
rvec = rvec.dot( R )
for k,r,o in zip(('x','y','z'), rvec, translation):
c.props[k][i] = r + o
......
......@@ -46,7 +46,8 @@ class abstractNucleotide():
atoms = canonicalNtRev[ key ]
if transform:
atoms = atoms.transformed(self.orientation, self.position, scale)
singleStranded = (self.basepair is None)
atoms = atoms.transformed(self.orientation, self.position, scale, singleStranded)
return atoms
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment