This is a read-only mirror of pymolwiki.org

Difference between revisions of "User:Speleo3"

From PyMOL Wiki
Jump to navigation Jump to search
(my scripts)
(Scripts Pastebin)
Line 13: Line 13:
 
* [[Spectrumany]]
 
* [[Spectrumany]]
 
* [[Supercell]]
 
* [[Supercell]]
 +
 +
=== Scripts Pastebin ===
 +
 +
Some random scripts with no dedicated PyMOLWiki page.
 +
 +
<source lang="python">
 +
def extra_fit(selection='(all)', reference=None, method=cmd.align):
 +
    '''
 +
DESCRIPTION
 +
 +
    Like "intra_fit", but for multiple objects instead of
 +
    multiple states.
 +
    '''
 +
    models = cmd.get_object_list(selection)
 +
    if reference is None:
 +
        reference = models[0]
 +
        models = models[1:]
 +
    elif reference in models:
 +
        models.remove(reference)
 +
    if cmd.is_string(method):
 +
        method = eval(method)
 +
    for model in models:
 +
        print model, method(model, reference)
 +
cmd.extend('extra_fit', extra_fit)
 +
</source>
 +
 +
<source lang="python">
 +
def mse2met(selection='all', quiet=1):
 +
    '''
 +
DESCRIPTION
 +
 +
    Mutate selenomethionine to methionine
 +
    '''
 +
    quiet = int(quiet)
 +
    x = cmd.alter('(%s) and MSE/SE' % selection, 'name="SD";elem="S"')
 +
    cmd.alter('(%s) and MSE/' % selection, 'resn="MET";type="ATOM"')
 +
    if not quiet:
 +
        print 'Altered %d MSE residues to MET' % (x)
 +
    cmd.sort()
 +
cmd.extend('mse2met', mse2met)
 +
 +
def remove_alt(selection='all', keep='A', quiet=1):
 +
    '''
 +
DESCRIPTION
 +
 +
    Remove alternative location atoms.
 +
 +
ARGUMENTS
 +
 +
    selection = string: atom selection
 +
 +
    keep = string: AltLoc to keep {default: A}
 +
    '''
 +
    cmd.remove('(%s) and not alt +%s' % (selection, keep), quiet=int(quiet))
 +
    cmd.alter(selection, 'alt=""')
 +
    cmd.sort()
 +
cmd.extend('remove_alt', remove_alt)
 +
</source>

Revision as of 22:48, 7 January 2011

My name is Thomas Holder and I am a bioinformatician at the MPI for Developmental Biology in Tübingen, Germany.

Contact

  • speleo3/users.sourceforge.net
  • thomas.holder/tuebingen.mpg.de

Scripts written by me

Scripts Pastebin

Some random scripts with no dedicated PyMOLWiki page.

def extra_fit(selection='(all)', reference=None, method=cmd.align):
    '''
DESCRIPTION

    Like "intra_fit", but for multiple objects instead of
    multiple states.
    '''
    models = cmd.get_object_list(selection)
    if reference is None:
        reference = models[0]
        models = models[1:]
    elif reference in models:
        models.remove(reference)
    if cmd.is_string(method):
        method = eval(method)
    for model in models:
        print model, method(model, reference)
cmd.extend('extra_fit', extra_fit)
def mse2met(selection='all', quiet=1):
    '''
DESCRIPTION

    Mutate selenomethionine to methionine
    '''
    quiet = int(quiet)
    x = cmd.alter('(%s) and MSE/SE' % selection, 'name="SD";elem="S"')
    cmd.alter('(%s) and MSE/' % selection, 'resn="MET";type="ATOM"')
    if not quiet:
        print 'Altered %d MSE residues to MET' % (x)
    cmd.sort()
cmd.extend('mse2met', mse2met)

def remove_alt(selection='all', keep='A', quiet=1):
    '''
DESCRIPTION

    Remove alternative location atoms.

ARGUMENTS

    selection = string: atom selection

    keep = string: AltLoc to keep {default: A}
    '''
    cmd.remove('(%s) and not alt +%s' % (selection, keep), quiet=int(quiet))
    cmd.alter(selection, 'alt=""')
    cmd.sort()
cmd.extend('remove_alt', remove_alt)