Hi James,

just calculate the coordinates and write them out in PDB format, quite
simple task. Try the attached script.

Cheers,
  Thomas

James Starlight wrote, On 01/04/13 09:14:
> Hi Mike,
> 
> Chimera can build such lattices by means of it's build structure
> module. On other hand I want to build such 2D lattices
> http://imageshack.us/photo/my-images/543/lattice.png/
>  made from SP3 carbons as the nodes via some automatic script to
> obtain lattices with desired dimensions.
> 
> James

-- 
Thomas Holder
PyMOL Developer
Schrödinger Contractor
from numpy import array

s = 'HETATM %4d  C03 UNK     1    %8.3f%8.3f%8.3f  0.00  0.00           C  '
c = array([[ 0.064,   2.851,  -1.085 ],
           [ 0.260,   1.969,   0.159 ]])
x_shift = array([ 1.67441517, -0.91605961,  1.66504574])
y_shift = array([-0.69477826, -0.40578592,  2.40198410])

out = open('lattice.pdb', 'w')

i = 0
for x in range(10):
    for y in range(10):
        for v in (c + (x-y/2) * x_shift + y * y_shift):
            i += 1
            print >> out, s % (i, v[0], v[1], v[2])

out.close()

try:
    from pymol import cmd
    cmd.load('lattice.pdb')
except ImportError:
    print 'Please load lattice.pdb with PyMOL'
------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
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

Reply via email to