Commit c3fd8b3b authored by Jacob Durrant's avatar Jacob Durrant

Moved contents of development branch to master.

parent 0d3736e3
Changes
=======
2.1
---
1. Updated version to 2.1.
2. Now Python3 compatible. Python2 no longer officially supported.
3. Refactored code so that it can now be called as a library.
4. Moved GUI wrapper to new `depreciated/` folder. This feature is no longer
supported.
5. Improved formatting (black) and docstrings.
6. Fixed minor bug that assigned atoms with names like "HG21" to element "HG"
rather than "H". No longer supporting element "HG".
7. Moved examples directory to `povme/examples/`.
8. Can now read both Windows and POSIX path names seamlessly (no need for
separate ini files).
9. Easy testing now available: `python POVME2.py --test` and `python
POVME_pocket_id.py --test`
10. Added project roadmap.
2.0.3
-----
1. Updated citation.
2. Convex hull now calculated based on locations of all heavy atoms. In 2.0.1,
it was all alpha carbons. Take care when comparing POVME 2.0.1 and POVME
2.0.2/2.0.3 output.
3. Fixed NumPy warning.
4. Spelling error ("Angstroms").
2.0.1
-----
Note that POVME 2.0.1 and all earlier versions can be found at
[https://sourceforge.net/projects/povme/files/](https://sourceforge.net/projects/povme/files/).
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [http://durrantlab.com/contact/](http://durrantlab.com/contact/). All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series of actions.
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within the project community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
# How to Contribute
## Introduction
Thank you for your interest in contributing! All types of contributions are
encouraged and valued. Please make sure to read the relevant section before
making your contribution. We at the [Durrant Lab](http://durrantlab.com) look
forward to your contributions.
## Reporting a bug
<!-- * **Do not open up a GitHub issue if the bug is a security vulnerability in
Rails**, and instead to refer to our [security
policy](https://rubyonrails.org/security/).
* **Ensure the bug was not already reported** by searching on GitHub under
[Issues](https://github.com/rails/rails/issues). -->
If you're unable to find an open issue addressing the bug, feel free to [open
a new one](https://docs.gitlab.com/ee/user/project/issues/). Be sure to
include a **title and clear description**, as much relevant information as
possible (e.g., the program, platform, or operating-system version numbers),
and a **code sample** or **test case** demonstrating the expected behavior
that is not occurring.
If you or the maintainers don't respond to an issue for 30 days, the issue may
be closed. If you want to come back to it, reply (once, please), and we'll
reopen the existing issue. Please avoid filing new issues as extensions of one
you already made.
<!-- * If possible, use the relevant bug report templates to create the issue.
Simply copy the content of the appropriate template into a .rb file, make
the necessary changes to demonstrate the issue, and **paste the content into
the issue description**:
* [**Active Record** (models, database)
issues](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_master.rb)
* [**Action Pack** (controllers, routing)
issues](https://github.com/rails/rails/blob/master/guides/bug_report_templates/action_controller_master.rb)
* [**Generic template** for other
issues](https://github.com/rails/rails/blob/master/guides/bug_report_templates/generic_master.rb)
* For more detailed information on submitting a bug report and creating an
issue, visit our [reporting
guidelines](https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#reporting-an-issue). -->
## Project setup to make source-code changes on your computer
This project uses `git` to manage contributions, so start by [reading up on
how to fork a `git`
repository](https://docs.gitlab.com/ee/user/project/repository/forking_workflow.html#creating-a-fork)
if you've never done it before.
Forking will place a copy of the code on your own computer, where you can
modify it to correct bugs or add features.
## Integrating your changes back into the main codebase
Follow these steps to "push" your changes to the main online repository so
others can benefit from them:
* Create a [new merge
request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
with your changes.
* Ensure the description clearly describes the problem and solution. Include
the relevant issue number if applicable.
* Before submitting, please read this CONTRIBUTING.md file to know more about
coding conventions and benchmarks.
## Coding conventions
Be sure to adequately document your code with comments so others can
understand your changes. All classes and functions should have associated doc
strings, formatted as appropriate given the programming language. Here are
some examples:
```python
"""
This file does important calculations. It is a Python file with nice doc strings.
"""
class ImportantCalcs(object):
"""
An important class where important things happen.
"""
def __init__(self, vars=None, receptor_file=None,
file_conversion_class_object=None, test_boot=True):
"""
Required to initialize any conversion.
Inputs:
:param dict vars: Dictionary of user variables
:param str receptor_file: the path for the receptor file
:param obj file_conversion_class_object: object that is used to convert
files from pdb to pdbqt
:param bool test_boot: used to initialize class without objects for
testing purpose
"""
pass
```
```typescript
/**
* Sets the curStarePt variable externally. A useful, well-documented
* TypeScript function.
* @param {number[]} pt The x, y coordinates of the point as a list of
* numbers.
* @returns void
*/
export function setCurStarePt(pt: any): void {
curStarePt.copyFrom(pt);
}
```
If writing Python code, be sure to use the [Black
formatter](https://black.readthedocs.io/en/stable/) before submitting a merge
request. If writing code in JavaScript or TypeScript, please use the [Prettier
formatter](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode).
## Fixing whitespace, formatting code, or making a purely cosmetic patch
Changes that are cosmetic in nature and do not add anything substantial to the
stability, functionality, or testability of the program are unlikely to be
accepted.
<!-- #### **Do you intend to add a new feature or change an existing one?**
* Suggest your change in the [rubyonrails-core mailing
list](https://groups.google.com/forum/?fromgroups#!forum/rubyonrails-core)
and start writing code.
* Do not open an issue on GitHub until you have collected positive feedback
about the change. GitHub issues are primarily intended for bug reports and
fixes. -->
## Asking questions about the program
Ask any question about how to use the program on the appropriate [Durrant Lab
forum](http://durrantlab.com/forums/).
<!-- #### **Do you want to contribute to the Rails documentation?**
* Please read [Contributing to the Rails
Documentation](https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#contributing-to-the-rails-documentation). -->
<!-- This program is a volunteer effort. We encourage you to pitch in and join the
team!
Thanks!
Durrant Lab Team -->
## Acknowledgements
This document was inspired by:
* [Ruby on Rails CONTRIBUTING.md
file](https://raw.githubusercontent.com/rails/rails/master/CONTRIBUTING.md)
(MIT License).
* [weallcontribute](https://github.com/WeAllJS/weallcontribute/blob/latest/CONTRIBUTING.md)
(Public Domain License).
This diff is collapsed.
# POVME 2.1 is released under the GNU General Public License (see
# http://www.gnu.org/licenses/gpl.html). If you have any questions, comments,
# or suggestions, please don't hesitate to contact me, Jacob Durrant, at
# durrantj [at] pitt [dot] edu.
#
# If you use POVME in your work, please cite:
#
# Durrant, J. D., C. A. de Oliveira, et al. (2011). "POVME: An algorithm
# for measuring binding-pocket volumes." J Mol Graph Model 29(5): 773-776.
#
# Durrant, J. D., L. Votapka, et al. (2014). "Povme 2.0: An Enhanced Tool
# for Determining Pocket Shape and Volume Characteristics." J Chem Theory
# Comput 10.11: 5047-56.
from povme import povme
import sys
povme.RunPOVME(sys.argv)
# POVME Pocket ID 1.0 is released under the GNU General Public License (see
# http://www.gnu.org/licenses/gpl.html).
# If you have any questions, comments, or suggestions, please don't hesitate
# to contact me, Jacob Durrant, at durrantj [at] pitt [dot] edu.
# POVME Pocket ID 1.0 is a program for identifying protein pockets and
# generating appropriate pocket-encompassing inclusion spheres. These spheres,
# modified as required, can then be used as POVME input.
from povme import pocket_id
import sys
pocket_id.run_pocket_id(sys.argv)
This diff is collapsed.
# Project Roadmap
This document describes planned updates to the POVME2 codebase.
## Web-Based POVME-Preparation GUI
**Projected Dates**: 6/2020-10/2020
**Description**: We will create a web-based graphical user interface (GUI) so
users can easily define and visualize pocket-encompassing protein regions for
subsequent POVME2 analysis. This process is currently tedious and requires
third-party programs such as VMD.
## POVME MD-Trajectory Handling
**Projected Dates**: 8/2020-12/2020
**Description**: We will update POVME2 to improve MD-trajectory handling.
Before starting POVME2, users must now turn to third-party programs to align
their trajectories and convert them to the multi-frame PDB format. With our
updates, POVME2 will accept a wider range of trajectory-file formats and will
optionally perform trajectory alignment itself.
## Port POVME Itself to the Browser
**Projected Dates**: 10/2020-2/2021
**Description**: We will port POVME2 to the browser. Web POVME2 will eliminate
the need to install Python and other dependencies. Instead, users will visit a
simple webpage. Thanks to WebAssembly (Pyodide), POVME2 calculations will run
directly in the browser, without requiring extensive remote computing
infrastructure.
## Online Tools to Analyze and Display POVME2 Results
**Projected Dates**: 1/2021-3/2021
**Description**: We will create online tools for analyzing and displaying
POVME2 results. Users must currently turn to third-party programs to visualize
POVME2 volume distributions, pocket shapes, etc. We will incorporate graphs,
tables, and 3Dmol.js-powered molecular visualizations directly into the POVME2
web app.
## Online Help System with Tutorials
**Projected Dates**: 4/2021-4/2021
**Description**: For each of our proposed web apps, we will create an online
help system together with new tutorials so users understand how the updated
software works.
## Publication
**Projected Dates**: 5/2021-6/2021
**Description**: To let the community know about our improvements, we will
publish peer-reviewed manuscripts describing POVME2 and BINANA updates.
Nevermmind. You can write to the virtual filesystem:
https://github.com/anpur/line-navigator.
Need to "modularize" code to apply POVME to single PDB string.
BUT MIGHT NEED TO DIVIDE TRAJ PDB INTO MUTLIPLE CHUNKS TO RUN ON MANY
PROCESSORS.
Need to fix branch names. Use versions, then make development into master,
etc.
DONE
====
--test should work
Need to put test on pocket id too.
No longer cares about Windows vs. posix path names (checked on both systems).
This diff is collapsed.
__version__ = "2.1"
__name__ = "povme"
__author__ = "Jacob D. Durrant"
# POVME 2.1 is released under the GNU General Public License (see
# http://www.gnu.org/licenses/gpl.html). If you have any questions, comments,
# or suggestions, please don't hesitate to contact me, Jacob Durrant, at
# durrantj [at] pitt [dot] edu.
#
# If you use POVME in your work, please cite:
#
# Durrant, J. D., C. A. de Oliveira, et al. (2011). "POVME: An algorithm
# for measuring binding-pocket volumes." J Mol Graph Model 29(5): 773-776.
#
# Durrant, J. D., L. Votapka, et al. (2014). "Povme 2.0: An Enhanced Tool
# for Determining Pocket Shape and Volume Characteristics." J Chem Theory
# Comput 10.11: 5047-56.
from pathlib import Path
import gzip
import os
import shutil
try:
from pathlib import WindowsPath as WinPath
t = WinPath()
except:
# This is all that's available on linux. But doesn't work with absolute
# windows paths. On the other hand, paths starting with "C:\" don't make
# sense on linux anyway.
from pathlib import PureWindowsPath as WinPath
def fix_filename(path, must_exist=True):
"""Gets the proper filename, regardless of whether windows or unix
formatted.
path -- A string, the path.
must_exist -- A boolean, whether to use file existance in determining which
path to use.
Returns:
A standardized version of the filename.
"""
if must_exist:
# Figure out path format based on whether the file exists.
path_fixed = Path(path)
if not path_fixed.exists():
# The path doesn't exist. Could it be a windows-formatted path?
path_fixed = Path(WinPath(path))
if not path_fixed.exists():
# No, it really doesn't exist.
raise IOError("File doesn't exist: " + path)
else:
# Try to figure it out without testing if file exists.
if not "/" in path and not "\\" in path:
# No directory, so it doesn't really matter.
path_fixed = Path(path)
elif os.path.dirname(path) == "":
# It must be a windows path.
path_fixed = Path(WinPath(path))
else:
# It's probably a unix path.
path_fixed = Path(path)
return path_fixed
def openfile(path, mode="r"):
"""Opens a file, regardless of whether unix or windows formatted path.
path -- A string, the path.
mode -- A string, the file mode. Defaults to "r".
Returns:
The file object.
"""
return open(fix_filename(path, "r" in mode), mode)
def gzopenfile(path, mode="r"):
"""Opens a gz compressed file, regardless of whether unix or windows
formatted path.
path -- A string, the path.
mode -- A string, the file mode. Defaults to "r".
Returns:
The file object.
"""
return gzip.open(fix_filename(path, "r" in mode), mode)
def setup_testing_dir(files_to_copy_relative_to__file__):
"""Create a temporary directory.
files_to_copy_relative_to__file__ -- A list of files to copy, relative to
the python file calling this function.
"""
# Create a temporary directory.
test_dir = "./testing.tmp/"
if os.path.exists(test_dir):
raise IOError("Delete " + test_dir + " before running the test.")
os.mkdir(test_dir)
# Copy example files to this directory.
for fl in files_to_copy_relative_to__file__:
shutil.copy2(os.path.dirname(__file__) + fl, test_dir)
# Change into testing directory.
os.chdir(test_dir)
def delete_testing_dir():
"""Assuming you are already in the temporary directory, this will delete
it."""
# Assumes you are already in the temporary directory.
os.chdir("..")
shutil.rmtree("./testing.tmp/")
def test_passed():
"""Shows a message saying that a test passed."""
print("")
print("-----------------")
print("Passed all tests!")
print("-----------------")
print("")
# To run the POVME Pocket ID example, type the following into
# the unix command line from the current directory:
python ../../../POVME_pocket_id.py --filename rel1_example.pdb --pocket_detection_resolution 4.0 --pocket_measuring_resolution 1.0 --clashing_cutoff 3.0 --number_of_neighbors 4 --processors 4 --number_of_spheres 5 --sphere_padding 5.0
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
# POVME 2.1 is released under the GNU General Public License (see
# http://www.gnu.org/licenses/gpl.html). If you have any questions, comments,
# or suggestions, please don't hesitate to contact me, Jacob Durrant, at
# durrantj [at] pitt [dot] edu.
#
# If you use POVME in your work, please cite:
#
# Durrant, J. D., C. A. de Oliveira, et al. (2011). "POVME: An algorithm
# for measuring binding-pocket volumes." J Mol Graph Model 29(5): 773-776.
#
# Durrant, J. D., L. Votapka, et al. (2014). "Povme 2.0: An Enhanced Tool
# for Determining Pocket Shape and Volume Characteristics." J Chem Theory
# Comput 10.11: 5047-56.
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