Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: BioPandas/biopandas
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.4.0
Choose a base ref
...
head repository: BioPandas/biopandas
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing with 45,804 additions and 453 deletions.
  1. +11 −2 .appveyor.yml
  2. +61 −0 .github/workflows/autopublish.yaml
  3. +17 −0 .github/workflows/changelog-enforcer.yaml
  4. +100 −0 .github/workflows/publish.yaml
  5. +44 −0 .github/workflows/tests.yaml
  6. +3 −3 README.md
  7. +1 −1 biopandas/__init__.py
  8. +1,043 −0 biopandas/constants.py
  9. +54 −2 biopandas/mmcif/engines.py
  10. +24 −13 biopandas/mmcif/mmcif_parser.py
  11. +221 −49 biopandas/mmcif/pandas_mmcif.py
  12. +15 −0 biopandas/mmtf/__init__.py
  13. +856 −0 biopandas/mmtf/pandas_mmtf.py
  14. +1 −1 biopandas/mol2/__init__.py
  15. +15 −8 biopandas/mol2/pandas_mol2.py
  16. +167 −29 biopandas/pdb/engines.py
  17. +297 −78 biopandas/pdb/pandas_pdb.py
  18. +0 −73 biopandas/pdb/tests/test_write_pdb.py
  19. +3 −3 ci/.travis_install.sh
  20. +2 −2 ci/.travis_test.sh
  21. +70 −16 docs/CHANGELOG.md
  22. +10 −11 docs/CONTRIBUTING.md
  23. +7 −5 docs/index.md
  24. +7,229 −0 docs/tutorials/Working_with_MMTF_Structure_in_DataFrames.ipynb
  25. +241 −4 docs/tutorials/Working_with_PDB_Structures_in_DataFrames.ipynb
  26. BIN docs/tutorials/data/1t48.mmtf
  27. BIN docs/tutorials/data/1t49.mmtf
  28. BIN docs/tutorials/data/3eiy.mmtf
  29. +3 −1 requirements.txt
  30. +5 −2 setup.py
  31. 0 {biopandas/mmcif → }/tests/__init__.py
  32. 0 {biopandas/pdb/tests → tests/mmcif}/__init__.py
  33. 0 {biopandas/mmcif/tests → tests/mmcif}/data/1ehz.cif
  34. 0 {biopandas/mmcif/tests → tests/mmcif}/data/1t48.cif
  35. 0 {biopandas/mmcif/tests → tests/mmcif}/data/1t49.cif
  36. 0 {biopandas/mmcif/tests → tests/mmcif}/data/2d7t.cif
  37. BIN tests/mmcif/data/2jyf.cif.gz
  38. 0 {biopandas/mmcif/tests → tests/mmcif}/data/3eiy.cif
  39. BIN {biopandas/mmcif/tests → tests/mmcif}/data/3eiy.cif.gz
  40. 0 {biopandas/mmcif/tests → tests/mmcif}/data/3eiy_stripped_ele.cif
  41. 0 {biopandas/mmcif/tests → tests/mmcif}/data/4eiy.cif
  42. 0 {biopandas/mmcif/tests → tests/mmcif}/data/5mtn_multichain.cif
  43. 0 {biopandas/mmcif/tests → tests/mmcif}/data/AF-Q5VSL9-F1-model_v2.cif
  44. +9,780 −0 tests/mmcif/data/AF-Q5VSL9-F1-model_v3.cif
  45. +9,782 −0 tests/mmcif/data/AF-Q5VSL9-F1-model_v4.cif
  46. 0 tests/mmcif/data/__init__.py
  47. +20 −9 {biopandas/mmcif/tests → tests/mmcif}/test_amino3to1.py
  48. +10 −4 {biopandas/mmcif/tests → tests/mmcif}/test_assign_df.py
  49. +20 −7 {biopandas/mmcif/tests → tests/mmcif}/test_distance.py
  50. +46 −0 tests/mmcif/test_multiple_models.py
  51. +98 −26 {biopandas/mmcif/tests → tests/mmcif}/test_read_mmcif.py
  52. +22 −11 {biopandas/mmcif/tests → tests/mmcif}/test_rmsd.py
  53. 0 tests/mmtf/__init__.py
  54. BIN tests/mmtf/data/1ehz.mmtf
  55. BIN tests/mmtf/data/1t48.mmtf
  56. BIN tests/mmtf/data/1t49.mmtf
  57. BIN tests/mmtf/data/2d7t.mmtf
  58. BIN tests/mmtf/data/2jyf.mmtf
  59. BIN tests/mmtf/data/3eiy.mmtf
  60. BIN tests/mmtf/data/3eiy.mmtf.gz
  61. BIN tests/mmtf/data/4CUP.mmtf
  62. BIN tests/mmtf/data/4eiy.mmtf
  63. BIN tests/mmtf/data/5mtn.mmtf
  64. 0 tests/mmtf/data/__init__.py
  65. +852 −0 tests/mmtf/test_amino3to1.py
  66. +35 −0 tests/mmtf/test_assign_df.py
  67. +61 −0 tests/mmtf/test_distance.py
  68. +60 −0 tests/mmtf/test_multiple_models.py
  69. +104 −0 tests/mmtf/test_read_mmtf.py
  70. +86 −0 tests/mmtf/test_rmsd.py
  71. +67 −0 tests/mmtf/test_write_mmtf.py
  72. 0 tests/mol2/__init__.py
  73. 0 {biopandas/mol2/tests → tests/mol2}/data/1b5e_1.mol2
  74. 0 {biopandas/mol2/tests → tests/mol2}/data/1b5e_2.mol2
  75. 0 {biopandas/mol2/tests → tests/mol2}/data/40_mol2_files.mol2
  76. BIN {biopandas/mol2/tests → tests/mol2}/data/40_mol2_files.mol2.gz
  77. 0 tests/mol2/data/__init__.py
  78. +134 −0 tests/mol2/data/empty_line.mol2
  79. +15 −7 {biopandas/mol2/tests → tests/mol2}/test_mol2_io.py
  80. +27 −15 {biopandas/mol2/tests → tests/mol2}/test_pandas_mol2.py
  81. 0 tests/pdb/__init__.py
  82. 0 {biopandas/pdb/tests → tests/pdb}/data/1ehz-rna_short.pdb
  83. 0 {biopandas/pdb/tests → tests/pdb}/data/1t48_995.pdb
  84. 0 {biopandas/pdb/tests → tests/pdb}/data/1t49_995.pdb
  85. 0 {biopandas/pdb/tests → tests/pdb}/data/2d7t.pdb
  86. 0 {biopandas/pdb/tests → tests/pdb}/data/2jyf.pdb
  87. 0 {biopandas/pdb/tests → tests/pdb}/data/3eiy.pdb
  88. BIN {biopandas/pdb/tests → tests/pdb}/data/3eiy.pdb.gz
  89. 0 {biopandas/pdb/tests → tests/pdb}/data/3eiy_stripped_no_ele.pdb
  90. 0 {biopandas/pdb/tests → tests/pdb}/data/4eiy_anisouchunk.pdb
  91. 0 {biopandas/pdb/tests → tests/pdb}/data/5mtn_multichain.pdb
  92. 0 {biopandas/pdb/tests → tests/pdb}/data/AF-Q5VSL9-F1-model_v2.pdb
  93. +6,832 −0 tests/pdb/data/AF-Q5VSL9-F1-model_v3.pdb
  94. +6,832 −0 tests/pdb/data/AF-Q5VSL9-F1-model_v4.pdb
  95. 0 tests/pdb/data/__init__.py
  96. 0 {biopandas/pdb/tests → tests/pdb}/data/lig_conf_1.pdb
  97. 0 {biopandas/pdb/tests → tests/pdb}/data/lig_conf_2.pdb
  98. +15 −9 {biopandas/pdb/tests → tests/pdb}/test_amino3to1.py
  99. +12 −5 {biopandas/pdb/tests → tests/pdb}/test_assign_df.py
  100. +21 −7 {biopandas/pdb/tests → tests/pdb}/test_distance.py
  101. +82 −0 tests/pdb/test_gyradius.py
  102. +13 −8 {biopandas/pdb/tests → tests/pdb}/test_impute.py
  103. +10 −2 {biopandas/pdb/tests → tests/pdb}/test_multiple_models.py
  104. +59 −27 {biopandas/pdb/tests → tests/pdb}/test_read_pdb.py
  105. +30 −12 {biopandas/pdb/tests → tests/pdb}/test_rmsd.py
  106. +177 −0 tests/pdb/test_write_pdb.py
  107. 0 {biopandas → tests}/testutils/__init__.py
  108. +2 −1 {biopandas → tests}/testutils/testutils.py
13 changes: 11 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -2,8 +2,17 @@ build: false

environment:
matrix:
- PYTHON_VERSION: 3.7
MINICONDA: C:\Miniconda3
- PYTHON_VERSION: 3.8
MINICONDA: C:\Miniconda3
- PYTHON_VERSION: 3.9
MINICONDA: C:\Miniconda3
- PYTHON_VERSION: "3.10"
MINICONDA: C:\Miniconda3
- PYTHON_VERSION: 3.11
MINICONDA: C:\Miniconda3


init:
- ECHO %PYTHON_VERSION% %MINICONDA%
@@ -14,8 +23,8 @@ install:
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda info -a
- conda create -q -n test-environment python=%PYTHON_VERSION% numpy scipy pandas nose
- conda create -q -n test-environment --channel=conda-forge mmtf-python numpy scipy pandas pytest looseversion importlib_resources python=%PYTHON_VERSION%
- activate test-environment

test_script:
- nosetests -s -v
- pytest -s -v
61 changes: 61 additions & 0 deletions .github/workflows/autopublish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# To create a release, create a tag and push it to GitHub:
#git tag -a "v0.0.1-beta" -m "beta version testing"
#git push --tags
# https://dev.to/iamtekson/publish-package-to-pypi-and-release-new-version-using-github-actions-108k
name: Publish BioPandas to PyPI / GitHub

on:
push:
tags:
- "v*"
jobs:
build-n-publish:
name: Build and publish to PyPI
runs-on: ubuntu-latest

steps:
- name: Checkout source
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Build source and wheel distributions
run: |
python -m pip install --upgrade build twine
python -m build
twine check --strict dist/*
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false

- name: Get Asset name
run: |
export PKG=$(ls dist/ | grep tar)
set -- $PKG
echo "name=$1" >> $GITHUB_ENV
- name: Upload Release Asset (sdist) to GitHub
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/${{ env.name }}
asset_name: ${{ env.name }}
asset_content_type: application/zip
17 changes: 17 additions & 0 deletions .github/workflows/changelog-enforcer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Changelog Enforcer

on: # yamllint disable-line rule:truthy
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]

jobs:

changelog:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: dangoslen/changelog-enforcer@v3
with:
skipLabels: 'skip-changelog'
changeLogPath: 'docs/CHANGELOG.md'
100 changes: 100 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# To create a release, create a tag and push it to GitHub:
#git tag -a "v0.0.1-beta" -m "beta version testing"
#git push --tags
name: Publish BioPandas to PyPI / GitHub

on:
pull_request:
branches: [main]

jobs:
test-style:
name: Run style tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
cache: "pip"

- name: Install package dependencies for testing
run: pip install .[test]

- name: Run all the pytest tests
run: flake8 ./biopandas

test-pytest:
name: Run pytest tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
cache: "pip"

- name: Install package dependencies for testing
run: pip install .[test]

- name: Run all the pytest tests
run: pytest -sv

build-n-publish:
needs: [test-pytest] # only runs if tests are passing
if: startsWith(github.ref, 'refs/tags/v') # Check if the tag starts with 'v'
name: Build and publish to PyPI
runs-on: ubuntu-latest

steps:
- name: Checkout source
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Build source and wheel distributions
run: |
python -m pip install --upgrade build twine
python -m build
twine check --strict dist/*
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: true

- name: Get Asset name
run: |
export PKG=$(ls dist/ | grep tar)
set -- $PKG
echo "name=$1" >> $GITHUB_ENV
- name: Upload Release Asset (sdist) to GitHub
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/${{ env.name }}
asset_name: ${{ env.name }}
asset_content_type: application/zip
44 changes: 44 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: tests

on:
push:
paths-ignore:
- "README.md"
- "docs/**"
- "CHANGELOG.md"

pull_request:
paths-ignore:
- "README.md"
- "docs/*"
- "CHANGELOG.md"

jobs:
build_biopandas:
runs-on: ubuntu-latest
# https://github.com/marketplace/actions/setup-miniconda#use-a-default-shell
defaults:
run:
shell: bash -l {0}

strategy:
matrix:
python-version: [3.7, 3.8, 3.9, "3.10", 3.11]
steps:
- name: Checkout repository
uses: actions/checkout@v3
# See: https://github.com/marketplace/actions/setup-miniconda
- name: Setup miniconda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
miniforge-variant: Mambaforge
conda-channels: conda-forge
python-version: ${{ matrix.python-version }}
use-mamba: true
- name: Install BioPandas
run: pip install -e .
- name: Install Dev Dependencies
run: pip install mmtf-python numpy scipy pandas pytest looseversion importlib_resources
- name: Run unit tests and generate coverage report
run: pytest -s -v
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -15,10 +15,10 @@
<hr>

## Links
- Documentation: [http://rasbt.github.io/biopandas/](http://rasbt.github.io/biopandas/)
- Documentation: [https://BioPandas.github.io/biopandas/](https://BioPandas.github.io/biopandas/)
- Source code repository: [https://github.com/rasbt/biopandas](https://github.com/rasbt/biopandas)
- PyPI: [https://pypi.python.org/pypi/biopandas](https://pypi.python.org/pypi/biopandas)
- How to contribute: [http://rasbt.github.io/biopandas/contributing/](http://rasbt.github.io/biopandas/contributing/)
- How to contribute: [https://biopandas.github.io/biopandas/CONTRIBUTING/](https://biopandas.github.io/biopandas/CONTRIBUTING/)
- Changelog: [./docs/sources/CHANGELOG.md](./docs/sources/CHANGELOG.md)

<br>
@@ -81,7 +81,7 @@ RMSD: 2.6444 Angstrom
- [Pandas](http://pandas.pydata.org) >= 0.19.1


For more information, please see [http://rasbt.github.io/biopandas/installation/](http://rasbt.github.io/biopandas/installation/).
For more information, please see [https://BioPandas.github.io/biopandas/installation/](https://BioPandas.github.io/biopandas/installation/).

<br><br>
<br><br>
2 changes: 1 addition & 1 deletion biopandas/__init__.py
Original file line number Diff line number Diff line change
@@ -24,5 +24,5 @@
# 'X.Y.dev0' is the canonical version of 'X.Y.dev'
#

__version__ = "0.4.0"
__version__ = "0.5.1"
__author__ = "Sebastian Raschka <mail@sebastianraschka.com>"
Loading