diff --git a/biopandas/mmcif/tests/data/2jyf.cif.gz b/biopandas/mmcif/tests/data/2jyf.cif.gz new file mode 100644 index 0000000..0a3c67f Binary files /dev/null and b/biopandas/mmcif/tests/data/2jyf.cif.gz differ diff --git a/biopandas/mmcif/tests/test_multiple_models.py b/biopandas/mmcif/tests/test_multiple_models.py new file mode 100644 index 0000000..0446025 --- /dev/null +++ b/biopandas/mmcif/tests/test_multiple_models.py @@ -0,0 +1,26 @@ +# BioPandas +# Author: Sebastian Raschka +# Author: Arian Jamasb +# 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_get_model(): + df = PandasMmcif().read_mmcif(TESTDATA_FILENAME) + MODEL_INDEX = 1 + new_df = df.get_model(MODEL_INDEX) + print(df) + assert new_df.df["ATOM"]["pdbx_PDB_model_num"].all() == MODEL_INDEX + + +def test_get_models(): + df = PandasMmcif().read_mmcif(TESTDATA_FILENAME) + MODEL_INDICES = [1, 3, 5] + + new_df = df.get_models(MODEL_INDICES) + assert new_df.df["ATOM"]["pdbx_PDB_model_num"].all() in MODEL_INDICES \ No newline at end of file