Commit ccc80f18 by peastman

Merge pull request #107 from peastman/pdbx

[WIP] Added support for loading PDBx/mmCIF files
parents bbb8cfa8 eb82172f
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
</head> </head>
<body> <body>
<h1 style="text-align:center">PDBFixer</h1> <h1 style="text-align:center">PDBFixer</h1>
<div style="text-align:center">Copyright 2013-2014 by Peter Eastman and Stanford University</div> <div style="text-align:center">Copyright 2013-2015 by Peter Eastman and Stanford University</div>
<h1>1. Introduction</h1> <h1>1. Introduction</h1>
Protein Data Bank (PDB) files often have a number of problems that must be fixed before they can be used in a molecular dynamics simulation. The details vary depending on how the file was generated. Here are some of the most common ones: Protein Data Bank (PDB or PDBx/mmCIF) files often have a number of problems that must be fixed before they can be used in a molecular dynamics simulation. The details vary depending on how the file was generated. Here are some of the most common ones:
<ol> <ol>
<li>If the structure was generated by X-ray crystallography, most or all of the hydrogen atoms will usually be missing.</li> <li>If the structure was generated by X-ray crystallography, most or all of the hydrogen atoms will usually be missing.</li>
...@@ -34,7 +34,9 @@ To install PDBFixer, navigate to the root directory of the source distribution y ...@@ -34,7 +34,9 @@ To install PDBFixer, navigate to the root directory of the source distribution y
This will install the PDBFixer python package as well as the command line program <tt>pdbfixer</tt>. This will install the PDBFixer python package as well as the command line program <tt>pdbfixer</tt>.
<p> <p>
Before running PDBFixer, you must first install <a href="https://simtk.org/home/openmm">OpenMM</a> 6.0 or later. Follow the installation instructions in the OpenMM manual. It is also recommended that you install CUDA or OpenCL, since the performance will usually be faster than when running on the CPU platform. PDBFixer requires that <a href="http://www.numpy.org">NumPy</a> be installed. Before running PDBFixer, you must first install <a href="https://simtk.org/home/openmm">OpenMM</a> 6.3 or later. Follow the installation instructions in the OpenMM manual. It is also recommended that you install CUDA or OpenCL, since the performance will usually be faster than when running on the CPU platform. PDBFixer requires that <a href="http://www.numpy.org">NumPy</a> be installed.
<p>
Alternatively, PDBFixer is included as part of the <a href="https://omnia.md">Omnia</a> suite for molecular simulation. If you install the suite, PDBFixer and its dependencies will be included.
<h1>3. PDBFixer as a Desktop Application</h1> <h1>3. PDBFixer as a Desktop Application</h1>
...@@ -45,7 +47,7 @@ To run PDBFixer as a desktop application, type ...@@ -45,7 +47,7 @@ To run PDBFixer as a desktop application, type
<p> <p>
on the command line. PDBFixer displays its user interface through a web browser, but it is still a single user desktop application. It should automatically launch a web browser and open a new window displaying the user interface. If for any reason this does not happen, you can launch a web browser yourself and point it to <a href="http://localhost:8000">http://localhost:8000</a>. on the command line. PDBFixer displays its user interface through a web browser, but it is still a single user desktop application. It should automatically launch a web browser and open a new window displaying the user interface. If for any reason this does not happen, you can launch a web browser yourself and point it to <a href="http://localhost:8000">http://localhost:8000</a>.
<p> <p>
The user interface consists of a series of pages for selecting a PDB file and choosing what changes to make to it. Depending on the details of a particular file, some of these pages may be skipped. The user interface consists of a series of pages for selecting a PDB or PDBx/mmCIF file and choosing what changes to make to it. Depending on the details of a particular file, some of these pages may be skipped.
<h3>Load File</h3> <h3>Load File</h3>
......
The SEQRES records in this PDB file include residues that are missing from the atom data section. Do you want to add the missing residues? The sequence records in this PDB file include residues that are missing from the atom data section. Do you want to add the missing residues?
<p> <p>
<form id="mainform" method="post" action="/"> <form id="mainform" method="post" action="/">
<table border="1" id="table"> <table border="1" id="table">
......
...@@ -7,7 +7,7 @@ import time ...@@ -7,7 +7,7 @@ import time
import simtk.openmm.app as app import simtk.openmm.app as app
import simtk.unit as unit import simtk.unit as unit
from .pdbfixer import PDBFixer, proteinResidues, dnaResidues, rnaResidues from .pdbfixer import PDBFixer, proteinResidues, dnaResidues, rnaResidues, _guessFileFormat
from . import uiserver from . import uiserver
try: try:
...@@ -55,8 +55,13 @@ def startPageCallback(parameters, handler): ...@@ -55,8 +55,13 @@ def startPageCallback(parameters, handler):
global fixer global fixer
if 'type' in parameters: if 'type' in parameters:
if parameters.getfirst('type') == 'local': if parameters.getfirst('type') == 'local':
fixer = PDBFixer(pdbfile=parameters['pdbfile'].value.decode().splitlines()) filename = parameters['pdbfile'].filename
fixer.source = parameters['pdbfile'].filename file = StringIO(parameters['pdbfile'].value.decode())
if _guessFileFormat(file, filename) == 'pdbx':
fixer = PDBFixer(pdbxfile=file)
else:
fixer = PDBFixer(pdbfile=file)
fixer.source = filename
else: else:
id = parameters.getfirst('pdbid') id = parameters.getfirst('pdbid')
try: try:
...@@ -238,7 +243,7 @@ def launchUI(): ...@@ -238,7 +243,7 @@ def launchUI():
# down and then the uiserver exits. Without this daemon/sleep combo, the # down and then the uiserver exits. Without this daemon/sleep combo, the
# process cannot be killed with Control-C. Reference stack overflow link: # process cannot be killed with Control-C. Reference stack overflow link:
# http://stackoverflow.com/a/11816038/1079728 # http://stackoverflow.com/a/11816038/1079728
global uiIsRunning global uiIsRunning
uiIsRunning = True uiIsRunning = True
while uiIsRunning: while uiIsRunning:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment