Skip to content

Latest commit

 

History

History
99 lines (68 loc) · 4.29 KB

README.md

File metadata and controls

99 lines (68 loc) · 4.29 KB

Logo

Working with molecular structures in pandas DataFrames

Continuous Integration Build status Code Coverage Code Health PyPI Version License Python 2.7 Python 3.6 DOI Discuss


Links


If you are a computational biologist, chances are that you cursed one too many times about protein structure files. Yes, I am talking about ye Goode Olde Protein Data Bank format, aka "PDB files." Nothing against PDB, it's a neatly structured format (if deployed correctly); yet, it is a bit cumbersome to work with PDB files in "modern" programming languages -- I am pretty sure we all agree on this.

As machine learning and "data science" person, I fell in love with pandas DataFrames for handling just about everything that can be loaded into memory.
So, why don't we take pandas to the structural biology world? Working with molecular structures of biological macromolecules (from PDB and MOL2 files) in pandas DataFrames is what BioPandas is all about!


Examples

3eiy

# Initialize a new PandasPdb object
# and fetch the PDB file from rcsb.org
>>> from biopandas.pdb import PandasPdb
>>> ppdb = PandasPdb().fetch_pdb('3eiy')
>>> ppdb.df['ATOM'].head()

3eiy head





3eiy head

# Load structures from your drive and compute the
# Root Mean Square Deviation
>>> from biopandas.pdb import PandasPdb
>>> pl1 = PandasPdb().read_pdb('./docking_pose_1.pdb')
>>> pl2 = PandasPdb().read_pdb('./docking_pose_2.pdb')
>>> r = PandasPdb.rmsd(pl1.df['HETATM'], pl2.df['HETATM'],
                       s='hydrogen', invert=True)
>>> print('RMSD: %.4f Angstrom' % r)

RMSD: 2.6444 Angstrom





Quick Install

  • install the latest version (from GitHub): pip install git+git://github.com/rasbt/biopandas.git#egg=biopandas
  • install the latest PyPI version: pip install biopandas
  • install biopandas via conda-forge: conda install biopandas -c conda-forge

For more information, please see http://rasbt.github.io/biopandas/installation/.





Cite as

If you use BioPandas as part of your workflow in a scientific publication, please consider citing the BioPandas repository with the following DOI:

Sebastian Raschka. (2017). rasbt/biopandas: v0.2.0 (2017-04-02). Zenodo. http://doi.org/10.5281/zenodo.439736

@misc{raschkas_2016_49235,
  author       = {Raschka, Sebastian},
  title        = {BioPandas},
  month        = apr,
  year         = 2017,
  doi          = {10.5281/zenodo.439736},
  url          = {http://doi.org/10.5281/zenodo.439736}
}