Skip to content

Commit 7a1517d

Browse files
author
Arian Jamasb
committed
deprecate MMTF parsing from PDB hosting
1 parent bf53321 commit 7a1517d

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

Diff for: biopandas/mmtf/pandas_mmtf.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,7 @@ def read_mmtf(self, filename: Union[str, os.PathLike]):
5858
return self
5959

6060
def fetch_mmtf(self, pdb_code: str):
61-
self.code = pdb_code
62-
self.mmtf = fetch(pdb_code)
63-
df = self._mmtf_to_df(self.mmtf)
64-
self._df["ATOM"] = df.loc[df.record_name == "ATOM"]
65-
self._df["HETATM"] = df.loc[df.record_name == "HETATM"]
66-
return self
61+
raise DeprecationWarning("PDB No longer serves MMTF files.")
6762

6863
@staticmethod
6964
def _mmtf_to_df(mmtf_obj: MMTFDecoder) -> pd.DataFrame:

Diff for: biopandas/mmtf/tests/test_read_mmtf.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Project Website: http://rasbt.github.io/biopandas/
55
# Code Repository: https://github.com/rasbt/biopandas
66

7-
7+
import pytest
88
import os
99
from urllib.error import HTTPError, URLError
1010
from urllib.request import urlopen
@@ -42,6 +42,7 @@
4242
#"charge",
4343
]
4444

45+
@pytest.mark.skip(reason="PDB No longer serves MMTF files.")
4546
def test_fetch_pdb():
4647
"""Test fetch_pdb"""
4748
ppdb = PandasMmtf()

Diff for: biopandas/mmtf/tests/test_write_mmtf.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import os
2+
import pytest
23

34
import pandas as pd
45
from pandas.testing import assert_frame_equal
56

67
from biopandas.mmtf.pandas_mmtf import PandasMmtf, write_mmtf
78

8-
9+
@pytest.mark.skip(reason="PDB No longer serves MMTF files.")
910
def test_write_mmtf_bp():
1011
PDB_CODES = ["4hhb", "3eiy", "1t48", "1ehz", "4ggb", "1bxa", "1cbn", "1rcf"]
1112
for pdb in PDB_CODES:
@@ -20,6 +21,8 @@ def test_write_mmtf_bp():
2021

2122
os.remove("test.mmtf")
2223

24+
25+
@pytest.mark.skip(reason="PDB No longer serves MMTF files.")
2326
def test_write_mmtf():
2427
PDB_CODES = ["4hhb", "3eiy", "1t48", "1ehz", "4ggb", "1bxa", "1cbn", "1rcf"]
2528
for pdb in PDB_CODES:

0 commit comments

Comments
 (0)