Difference between revisions of "User:Mglerner"

From PyMOLWiki
Jump to navigation Jump to search
Line 5: Line 5:
 
-- '''Michael G. Lerner, PhD <br/>
 
-- '''Michael G. Lerner, PhD <br/>
 
''m dot g dot lerner (_at-) gmail dot com''
 
''m dot g dot lerner (_at-) gmail dot com''
 +
 +
= My open-source toolchain =
 +
 +
* PyMOL (visualization, system setup, etc)
 +
* Python (all scripting/automation tasks)
 +
* numpy (efficient numerical library)
 +
* scipy (including traits for simple GUIs)
 +
* matplotlib (2D plotting)
 +
* GROMACS (simulations)
 +
 +
I also make significant use of CHARMM and Amber. I used to be a heavy Linux supporter, but OS X has all of its advantages without the burden of system administration. If only it had a decent package management system.
  
 
= My ~/.pymolrc runs this .py script=
 
= My ~/.pymolrc runs this .py script=
Line 73: Line 84:
 
</source>
 
</source>
  
== To Do ==
+
= To Do =
 
* Update the PyMOL/APBS plugin page
 
* Update the PyMOL/APBS plugin page
  
  
 
[[User:Mglerner|mglerner]] Tue Nov 17 14:46:42 EST 2009
 
[[User:Mglerner|mglerner]] Tue Nov 17 14:46:42 EST 2009

Revision as of 16:31, 17 November 2009

My name is Michael Lerner. I'm currently an IRTA postdoctoral fellow at NIH in the NHLBI's Laboratory of Computational Biology. Before that, I was a member of Heather Carlson's lab at the University of Michigan.

I wrote the PyMOL/APBS plugin.

-- Michael G. Lerner, PhD
m dot g dot lerner (_at-) gmail dot com

My open-source toolchain

  • PyMOL (visualization, system setup, etc)
  • Python (all scripting/automation tasks)
  • numpy (efficient numerical library)
  • scipy (including traits for simple GUIs)
  • matplotlib (2D plotting)
  • GROMACS (simulations)

I also make significant use of CHARMM and Amber. I used to be a heavy Linux supporter, but OS X has all of its advantages without the burden of system administration. If only it had a decent package management system.

My ~/.pymolrc runs this .py script

#!/usr/bin/env python
from pymol import cmd,stored
cmd.set('pdb_retain_ids',1)
cmd.set('retain_order',1)
import os
def gro(fnm,name=None):
    os.system("/usr/local/bin/editconf -f %s -o /tmp/tmp.pdb" % fnm)
    print "Just did","/usr/local/bin/editconf -f %s -o /tmp/tmp.pdb" % fnm
    if name is None:
        name = fnm[:-4]
    cmd.load("/tmp/tmp.pdb",name)
cmd.extend("gro",gro)

def splitseq(seq,size):
    """ Split up seq in pieces of size """
    return [seq[i:i+size] for i in range(0, len(seq), size)]

def getIDsInSel(sel, sorted=True, reversed=False):
    """
    PARAMETERS
        sel,
            The selection, object or group to iterate over
        sorted (boolean),
            Should the list be sorted?
        reversed (boolean)
            Should the list be reversed before returned?  (Combined
            with the above, you can return a decreasing-sorted list
            of names
 
    RETURNS
        list[] of strings, representing the object IDs desired.

    CREDITS
        This is a very slightly modified version of getNamesInSel 
        from http://pymolwiki.org/index.php/GetNamesInSel
    """
    stored.tempNames = set()
    cmd.iterate(sel, "stored.tempNames.add(ID)")
    rList = list(stored.tempNames)
 
    # if you want the list reversed or sorted,
    # uncomment the following lines
    if sorted:
        rList.sort()
    if reversed:
        rList.reverse()
    return rList
 
cmd.extend("getIDsInSel", getIDsInSel)
def togrp(selname,fname):
    '''Make a GROMACS index group from a selection'''
    f = file(fname,'w')
    f.write('[ %s ]\n'%selname)
    #   1    2    3    4    5    6    7    8    9   10   11   12   13   14   15 
    #7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 
    idxs = getIDsInSel(selname)
    for g in splitseq(idxs,15):
        line = ' '.join(['%4s'%i for i in g])
        line = line + '\n'
        f.write(line)
    f.write('\n')
    f.close()
cmd.extend('togrp',togrp)

To Do

  • Update the PyMOL/APBS plugin page


mglerner Tue Nov 17 14:46:42 EST 2009