Hi Adam,
The attached script will create covalent bonds for all polar contacts between
two selections.
Example:
run
https://github.com/Pymol-Scripts/Pymol-script-repo/raw/master/get_raw_distances.py
run bond_hbonds.py
fetch 1nz1, async=0
bond_hbonds resi 1-12, resi 12-22
Hope that helps.
Cheers,
Thomas
'''
(c) 2015, Thomas Holder, Schrodinger LLC
License: BSD-2
'''
from pymol import cmd
try:
get_raw_distances
except NameError:
try:
from psico.querying import get_raw_distances
except ImportError:
print 'please install "psico" or download and run the get_raw_distances script from'
print 'http://pymolwiki.org/index.php/get_raw_distances'
@cmd.extend
def bond_hbonds(sele1, sele2, state=1, quiet=1):
'''
DESCRIPTION
Creates covalent bonds for all polar contacts between sele1 and sele2.
Both selections must be in the same object, PyMOL can't create
cross-object bonds.
USAGE
bond_hbonds sele1, sele2 [, state ]
EXAMPLE
fetch 1nz1, async=0
bond_hbonds resi 1-12, resi 12-22
'''
name = cmd.get_unused_name('hbonds')
cmd.distance(name, sele1, sele2, mode=2, state=state)
distances = get_raw_distances(name, state, '(%s) (%s)' % (sele1, sele2))
for idx1, idx2, dist in distances:
cmd.bond(idx1, idx2)
if not int(quiet):
print ' Created %d bonds' % (len(distances))
cmd.delete(name)
On 23 Jun 2015, at 22:51, H. Adam Steinberg <h.adam.steinb...@gmail.com> wrote:
> Hi all,
>
> If I create a string of double-strand DNA, or take a string of double-strand
> DNA or RNA from a structure, is there any automated way to have the bases
> link, AT, UA, GC, so when I manually sculpt or deform the DNA those bases
> would stay together?
>
> I could go through the structure and manually create physical bonds where the
> hydrogen bonds would be, and I’m guessing that would work, but I’m wondering
> if anyone has a script or is there a function that I am unaware of?
>
> Thanks!
>
> H. Adam Steinberg
> 7904 Bowman Rd
> Lodi, WI 53555
> 608/592-2366
--
Thomas Holder
PyMOL Principal Developer
Schrödinger, Inc.
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net