"""PDBFixer implements many tools for fixing problems in PDB files."""
def__init__(self,structure):
def__init__(self,structure):
"""Create a new PDBFixer to fix problems in a PDB file.
"""Create a new PDBFixer to fix problems in a PDB file.
...
@@ -626,14 +628,49 @@ class PDBFixer(object):
...
@@ -626,14 +628,49 @@ class PDBFixer(object):
if__name__=='__main__':
if__name__=='__main__':
iflen(sys.argv)<2:
iflen(sys.argv)<2:
# Display the UI.
importui
importui
ui.launchUI()
ui.launchUI()
else:
else:
fixer=PDBFixer(PdbStructure(open(sys.argv[1])))
# Run in command line mode.
fromoptparseimportOptionParser
parser=OptionParser(usage="Usage: %prog\n%prog [options] filename\n\nWhen run with no arguments, it launches the user interface. If any arguments are specified, it runs in command line mode.")
parser.add_option('--add-atoms',default='all',dest='atoms',choices=('all','heavy','hydrogen','none'),help='which missing atoms to add: all, heavy, hydrogen, or none [default: all]')
parser.add_option('--keep-heterogens',default='all',dest='heterogens',choices=('all','water','none'),metavar='OPTION',help='which heterogens to keep: all, water, or none [default: all]')
parser.add_option('--replace-nonstandard',action='store_true',default=False,dest='nonstandard',help='replace nonstandard residues with standard equivalents')
parser.add_option('--water-box',dest='box',type='float',nargs=3,metavar='X Y Z',help='add a water box. The value is the box dimensions in nm [example: --water-box=2.5 2.4 3.0]')
parser.add_option('--ph',type='float',default=7.0,dest='ph',help='the pH to use for adding missing hydrogens [default: 7.0]')
parser.add_option('--positive-ion',default='Na+',dest='positiveIon',choices=('Cs+','K+','Li+','Na+','Rb+'),metavar='ION',help='positive ion to include in the water box: Cs+, K+, Li+, Na+, or Rb+ [default: Na+]')
parser.add_option('--negative-ion',default='Cl-',dest='negativeIon',choices=('Cl-','Br-','F-','I-'),metavar='ION',help='positive ion to include in the water box: Cl-, Br-, F-, or I- [default: Cl-]')
parser.add_option('--ionic-strength',type='float',default=0.0,dest='ionic',metavar='STRENGTH',help='molar concentration of ions to add to the water box [default: 0.0]')