Commit f864b0cf authored by cmaffeo2's avatar cmaffeo2
Browse files

Updated bead model handling of extra interhelical bonds due to crossovers...

Updated bead model handling of extra interhelical bonds due to crossovers between distant segments; now works for single crossovers
parent 30a24b44
......@@ -404,13 +404,21 @@ class beadModel():
ds1 = z1 in expandedStrandList[h1][0] and z1 in expandedStrandList[h1][1]
ds2 = z2 in expandedStrandList[h2][0] and z2 in expandedStrandList[h2][1]
if ds1 and ds2:
if h1 != h2:
occ1Above = z1+1 in expandedStrandList[h1][0] or z1+1 in expandedStrandList[h1][1]
occ2Above = z2+1 in expandedStrandList[h2][0] or z2+1 in expandedStrandList[h2][1]
occ1Below = z1-1 in expandedStrandList[h1][0] or z1-1 in expandedStrandList[h1][1]
occ2Below = z2-1 in expandedStrandList[h2][0] or z2-1 in expandedStrandList[h2][1]
if ((not occ1Above) and (not occ2Below)) or \
((not occ1Below) and (not occ2Above)):
extraInterhelicalBondList.append(entry)
else:
if ds1 and ds2:
dsXoList.append(entry)
else:
extraInterhelicalBondList.append(entry)
else:
ssXoList.append(entry)
ssXoList.append(entry)
## Build dictionary of dsDNA crossovers
xoDicts = [dict() for i in range(numHID)]
......@@ -585,14 +593,17 @@ class beadModel():
## Add crossovers
for entry in extraInterhelicalBondList:
h1,f1,z1,h2,f2,z2 = entry
if z1 > z2:
n1 = self.helices[h1].nodes[z1]
n2 = self.helices[h2].nodes[z2]
try:
self._connectNodes(n1,n2,1)
except:
self._connectNodes(n2,n1,1)
assert(True)
n1 = self.helices[h1].nodes[z1]
n2 = self.helices[h2].nodes[z2]
try:
self._connectNodes(n1,n2,1)
except:
assert(True)
try:
self._connectNodes(n2,n1,1)
except:
assert(True)
## Add crossovers
......
......@@ -473,13 +473,21 @@ class beadModelTwist():
ds1 = z1 in expandedStrandList[h1][0] and z1 in expandedStrandList[h1][1]
ds2 = z2 in expandedStrandList[h2][0] and z2 in expandedStrandList[h2][1]
if ds1 and ds2:
if h1 != h2:
occ1Above = z1+1 in expandedStrandList[h1][0] or z1+1 in expandedStrandList[h1][1]
occ2Above = z2+1 in expandedStrandList[h2][0] or z2+1 in expandedStrandList[h2][1]
occ1Below = z1-1 in expandedStrandList[h1][0] or z1-1 in expandedStrandList[h1][1]
occ2Below = z2-1 in expandedStrandList[h2][0] or z2-1 in expandedStrandList[h2][1]
if ((not occ1Above) and (not occ2Below)) or \
((not occ1Below) and (not occ2Above)):
extraInterhelicalBondList.append(entry)
else:
if ds1 and ds2:
dsXoList.append(entry)
else:
extraInterhelicalBondList.append(entry)
else:
ssXoList.append(entry)
ssXoList.append(entry)
## Build dictionary of dsDNA crossovers
xoDicts = [dict() for i in range(numHID)]
......@@ -654,15 +662,17 @@ class beadModelTwist():
## Add crossovers
for entry in extraInterhelicalBondList:
h1,f1,z1,h2,f2,z2 = entry
if z1 > z2:
n1 = self.helices[h1].nodes[z1]
n2 = self.helices[h2].nodes[z2]
try:
self._connectNodes(n1,n2,1)
except:
self._connectNodes(n2,n1,1)
assert(True)
n1 = self.helices[h1].nodes[z1]
n2 = self.helices[h2].nodes[z2]
try:
self._connectNodes(n1,n2,1)
except:
assert(True)
try:
self._connectNodes(n2,n1,1)
except:
assert(True)
## Add crossovers
for hid1 in range(numHID):
......
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