-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feat] added get_model and get_models fct to mmcif (#145)
* [feat] added get_model and get_models fct to mmcif * [docs] add CHANGELOG.md * [feat] added tests for multiple models * [feat] added tests for multiple models * [feat] rename df to biopandas_structure * bump changelog + changelog workflow * Delete docs/sources/CHANGELOG.md --------- Co-authored-by: Arian Jamasb <[email protected]>
- Loading branch information
1 parent
67aa2f2
commit 3e26557
Showing
7 changed files
with
143 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# BioPandas | ||
# Author: Sebastian Raschka <[email protected]> | ||
# Author: Arian Jamasb <[email protected]> | ||
# License: BSD 3 clause | ||
# Project Website: http://rasbt.github.io/biopandas/ | ||
# Code Repository: https://github.com/rasbt/biopandas | ||
import os | ||
|
||
from biopandas.mmcif import PandasMmcif | ||
|
||
TESTDATA_FILENAME = os.path.join(os.path.dirname(__file__), "data", "2jyf.cif.gz") | ||
|
||
def test_label_models(): | ||
biopandas_structure = PandasMmcif().read_mmcif(TESTDATA_FILENAME) | ||
biopandas_structure.label_models() | ||
assert "model_id" in biopandas_structure.df["ATOM"].columns | ||
|
||
def test_get_model(): | ||
biopandas_structure = PandasMmcif().read_mmcif(TESTDATA_FILENAME) | ||
MODEL_INDEX = 1 | ||
new_biopandas_structure = biopandas_structure.get_model(MODEL_INDEX) | ||
assert new_biopandas_structure.df["ATOM"]["pdbx_PDB_model_num"].all() == MODEL_INDEX | ||
|
||
|
||
def test_get_models(): | ||
biopandas_structure = PandasMmcif().read_mmcif(TESTDATA_FILENAME) | ||
MODEL_INDICES = [1, 3, 5] | ||
|
||
new_biopandas_structure = biopandas_structure.get_models(MODEL_INDICES) | ||
assert new_biopandas_structure.df["ATOM"]["pdbx_PDB_model_num"].all() in MODEL_INDICES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters