code
stringlengths
3
6.57k
etree.SubElement(xml_residue, 'Bond', atomName1=bond[0].name, atomName2=bond[1].name)
etree.ElementTree(root)
etree.tostring(tree, pretty_print=True)
decode('utf-8')
closing(open(save_as, 'w')
f.write(xml)
check_atom_types(cluster, index)
O (in Cu-O-Cu)
O (Si-O-Si)
unique (each atom belongs to one class and one class only)
site(Al)
site(Al)
H (capping)
NeighborList(natural_cutoffs(cluster)
nl.update(cluster)
get_EF_atom_indices(cluster)
all(val not in class_H for val in nl.get_neighbors(atom.index)
get_property_types(cluster, property_list)
O(extra-framework)
O(framework)
len(whole_type_list)
len(my_list)
my_list.append(check_atom_types(cluster, val)
whole_type_list.append(my_list)
all(list(pair)
list(permutations(my_list)
repeated_list.append(my_list)
_get_index_dict(type_dict, whole_type_list, index_list)
type_dict.items()
enumerate(whole_type_list)
any(list(pair)
list(permutations(items)
temp_list.append(index_list[count])
get_type_index_pair(type_dict, whole_type_list, index_list)
_get_index_dict(type_dict, whole_type_list, index_list)
type_dict.items()
tuple(value)
pretty_print(my_dict)
bond (or angle)
bond (or angle)
my_dict.items()
print(key, '-->', value)
type_index_dict.items()
all(single_type not in type_list for single_type in exclude_atom_type)
shortened_list.extend(index_list)
all(list(value)
list(permutations(type_list)
shortened_list.extend(index_list)
all(single_type not in type_list for single_type in exclude_atom_type)
all(list(value)
list(permutations(type_list)
shortened_list.extend(index_list)
any(list(value)
list(permutations(type_list)
shortened_list.extend(index_list)
set_up_openMM_system(folder_path, cluster_tag_number, shortened_bond_list)
PDBFile(folder_path + '/cluster_%s_labeled.pdb' % cluster_tag_number)
list(pdb.topology.atoms()
pdb.topology.addBond(atoms[index[0]], atoms[index[1]])
list(pdb.topology.bonds()
write_xml(atoms, bonds, folder_path + '/forcefield.xml')
ForceField(folder_path + '/forcefield.xml')
FF.createSystem(pdb.topology)
input (more flexible used-designed ff)
CustomBondForce("D*(1-exp(-alpha*(r-r0)
force.addPerBondParameter("D")
force.addPerBondParameter("alpha")
force.addPerBondParameter("r0")
force.setUsesPeriodicBoundaryConditions(periodic=True)
bond_type_index_dict.items()
any(list(val)
list(permutations(bond)
force.addBond(int(bond[0])
int(bond[1])
bond_param_dict.get(my_type)
tuple(reversed(my_type)
force.addBond(int(bond[0])
int(bond[1])
bond_param_dict.get(my_type)
system.addForce(force)
HarmonicAngleForce()
force.setUsesPeriodicBoundaryConditions(periodic=True)
angle_type_index_dict.items()
any(list(val)
list(permutations(angle)
tuple(val)
list(angle_param_dict.keys()
list(permutations(my_type)
force.addAngle(int(angle[0])
int(angle[1])
int(angle[2])
angle_param_dict.get(type_tag[0])
system.addForce(force)
assert(system.usesPeriodicBoundaryConditions()
LangevinMiddleIntegrator(3 * kelvin, 1 / picosecond, 0.4 * picoseconds)
Simulation(pdb.topology, system, integrator)
simulation.context.setPositions(pdb.positions)
simulation.context.getState(getForces=True)
np.array(state.getForces(asNumpy=True)
get_EF_O_index(traj)