This is a read-only mirror of


From PyMOL Wiki
Revision as of 07:06, 21 April 2011 by Speleo3 (talk | contribs) (obj=all, comma)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


removeAlt removes all atoms from obj that have alternate locations but aren't altloc keep.

The Code

def removeAlt(obj="(all)", keep="A"):
        removeAlt -- remove all alternate location-atoms not of altloc "keep" from object.

                obj -- the object(s) to remove the atoms frmo
                keep -- which type of alt loc to keep

        output: none -- removes atoms

                removeAlt # remove all altLocations that aren't altloc A
                removeAlt pdbID, C  # remove all but C altlocations from pdbID
        # select & remove all non A altlocs
        remStr = "%s and not (alt ''+%s)" % (obj, keep);
        # reset the PDB information
        cmd.alter( obj, "alt=''")

cmd.extend("removeAlt", removeAlt)

See Also

Handling Alternate Locations and alter