Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • tbgl/tools/mrdna
1 result
Show changes
Commits on Source (3)
1.0a.dev178
1.0a.dev180
......@@ -95,7 +95,7 @@ def residues_within( cutoff, coords1, coords2, sel1, sel2 ):
return arr_idx1, arr_idx2, distance_matrix
def find_base_position_orientation( u, selection_text='all' ):
def find_base_position_orientation( u, selection_text='nucleic' ):
## Find orientation and center of each nucleotide
transforms,centers = [[],[]]
for r in u.select_atoms(selection_text).residues:
......@@ -126,7 +126,7 @@ def find_base_position_orientation( u, selection_text='all' ):
transforms = np.array(transforms)
return centers,transforms
def find_basepairs( u, centers, transforms, selection_text='all' ):
def find_basepairs( u, centers, transforms, selection_text='nucleic' ):
bonds = { b:"resname {} and name {}".format(resnames[b],bp_bond_atoms[b])
for b in bases }
......@@ -193,7 +193,7 @@ def find_basepairs( u, centers, transforms, selection_text='all' ):
# ...
return basepairs
def find_stacks_mdanalysis( u, centers, transforms, selection_text='all' ):
def find_stacks_mdanalysis( u, centers, transforms, selection_text='nucleic' ):
## Find orientation and center of each nucleotide
expected_stack_positions = []
......@@ -281,7 +281,7 @@ def break_into_contiguous_groups(sequence):
def get_lists_from_pdb(*args, **kwargs):
u = mda.Universe(*args,**kwargs)
for a in u.select_atoms("resname DT* and name C7").atoms:
for a in u.select_atoms("resname DT* THY and name C7").atoms:
a.name = "C5M"
ter = read_ter_from_pdb(*args)
......
......@@ -2045,7 +2045,8 @@ class SegmentModel(ArbdModel):
assert( d > 0.2 )
if key not in self._bonded_potential:
kT = self.configuration.temperature * 0.0019872065 # kcal/mol
self._bonded_potential[key] = WLCSKBond( d, lp, kT, range_=(0,1200) )
_pot = WLCSKBond( d, lp, kT, range_=(0,1200) )
self._bonded_potential[key] = _pot
return self._bonded_potential[key]
def _get_wlc_sk_angle_potential(self, d):
......@@ -2765,31 +2766,19 @@ class SegmentModel(ArbdModel):
bead.type_ = beadtype_s[key]
else:
t0 = bead.type_
t = ParticleType(t0.name)
t.__dict__ = deepcopy(t0.__dict__)
newname = f'{char}{beadtype_count[char]:03d}'
kwargs = {k:v for k,v in bead.type_.__dict__.items() if k not in ParticleType.excludedAttributes}
t = ParticleType( name=newname, **kwargs )
t.__dict__["nts"] = bead.num_nt*2 if char in ("D","O") else bead.num_nt
# t.name = t.name + "%03d" % (t.nts*10**decimals)
t.name = char + "%03d" % (beadtype_count[char])
t.mass = t.nts * 150
t.diffusivity = 120 if t.nts == 0 else min( 50 / np.sqrt(t.nts/5), 120)
beadtype_count[char] += 1
#print( "{} --> {} ({})".format(num_nt0, bead.num_nt, t.name) )
bead.type_ = t
beadtype_s[key]=t
"""
t = deepcopy(bead.type_)
t.__dict__["nts"] = bead.num_nt*2 if char in ("D","O") else bead.num_nt
# t.name = t.name + "%03d" % (t.nts*10**decimals)
t.name = char + "%03d" % (beadtype_count[char])
t.mass = t.nts * 150
t.diffusivity = 120 if t.nts == 0 else min( 50 / np.sqrt(t.nts/5), 120)
beadtype_count[char] += 1
# if self.DEBUG: print( "{} --> {} ({})".format(num_nt0, bead.num_nt, t.name) )
beadtype_s[key] = bead.type_ = t
"""
# (cluster_size[c-1])
import scipy.cluster.hierarchy as hcluster
beads = [b for s in segments for b in s if b.type_.name[0].upper() in ("D","O")]
data = np.array([b.num_nt for b in beads])[:,np.newaxis]
......