pxmeter 0.1.1__tar.gz → 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pxmeter-0.1.1/pxmeter.egg-info → pxmeter-0.1.2}/PKG-INFO +1 -1
- {pxmeter-0.1.1 → pxmeter-0.1.2}/pxmeter/cli.py +5 -2
- {pxmeter-0.1.1 → pxmeter-0.1.2}/pxmeter/configs/data_config.py +26 -8
- {pxmeter-0.1.1 → pxmeter-0.1.2}/pxmeter/data/ccd.py +2 -15
- {pxmeter-0.1.1 → pxmeter-0.1.2/pxmeter.egg-info}/PKG-INFO +1 -1
- {pxmeter-0.1.1 → pxmeter-0.1.2}/setup.py +1 -1
- {pxmeter-0.1.1 → pxmeter-0.1.2}/LICENSE +0 -0
- {pxmeter-0.1.1 → pxmeter-0.1.2}/MANIFEST.in +0 -0
- {pxmeter-0.1.1 → pxmeter-0.1.2}/README.md +0 -0
- {pxmeter-0.1.1 → pxmeter-0.1.2}/pxmeter/__init__.py +0 -0
- {pxmeter-0.1.1 → pxmeter-0.1.2}/pxmeter/calc_metric.py +0 -0
- {pxmeter-0.1.1 → pxmeter-0.1.2}/pxmeter/configs/__init__.py +0 -0
- {pxmeter-0.1.1 → pxmeter-0.1.2}/pxmeter/configs/run_config.py +0 -0
- {pxmeter-0.1.1 → pxmeter-0.1.2}/pxmeter/constants.py +0 -0
- {pxmeter-0.1.1 → pxmeter-0.1.2}/pxmeter/data/__init__.py +0 -0
- {pxmeter-0.1.1 → pxmeter-0.1.2}/pxmeter/data/parser.py +0 -0
- {pxmeter-0.1.1 → pxmeter-0.1.2}/pxmeter/data/struct.py +0 -0
- {pxmeter-0.1.1 → pxmeter-0.1.2}/pxmeter/data/utils.py +0 -0
- {pxmeter-0.1.1 → pxmeter-0.1.2}/pxmeter/data/writer.py +0 -0
- {pxmeter-0.1.1 → pxmeter-0.1.2}/pxmeter/eval.py +0 -0
- {pxmeter-0.1.1 → pxmeter-0.1.2}/pxmeter/mapping.py +0 -0
- {pxmeter-0.1.1 → pxmeter-0.1.2}/pxmeter/metrics/__init__.py +0 -0
- {pxmeter-0.1.1 → pxmeter-0.1.2}/pxmeter/metrics/lddt_metrics.py +0 -0
- {pxmeter-0.1.1 → pxmeter-0.1.2}/pxmeter/metrics/rmsd.py +0 -0
- {pxmeter-0.1.1 → pxmeter-0.1.2}/pxmeter/metrics/rmsd_metrics.py +0 -0
- {pxmeter-0.1.1 → pxmeter-0.1.2}/pxmeter/permutation/__init__.py +0 -0
- {pxmeter-0.1.1 → pxmeter-0.1.2}/pxmeter/permutation/atom.py +0 -0
- {pxmeter-0.1.1 → pxmeter-0.1.2}/pxmeter/permutation/chain.py +0 -0
- {pxmeter-0.1.1 → pxmeter-0.1.2}/pxmeter/utils.py +0 -0
- {pxmeter-0.1.1 → pxmeter-0.1.2}/pxmeter.egg-info/SOURCES.txt +0 -0
- {pxmeter-0.1.1 → pxmeter-0.1.2}/pxmeter.egg-info/dependency_links.txt +0 -0
- {pxmeter-0.1.1 → pxmeter-0.1.2}/pxmeter.egg-info/entry_points.txt +0 -0
- {pxmeter-0.1.1 → pxmeter-0.1.2}/pxmeter.egg-info/requires.txt +0 -0
- {pxmeter-0.1.1 → pxmeter-0.1.2}/pxmeter.egg-info/top_level.txt +0 -0
- {pxmeter-0.1.1 → pxmeter-0.1.2}/requirements.txt +0 -0
- {pxmeter-0.1.1 → pxmeter-0.1.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pxmeter
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: PXMeter is a comprehensive toolkit for evaluating the quality of structures generated by biomolecular structure prediction models.
|
|
5
5
|
Author: Bytedance Inc.
|
|
6
6
|
Author-email: ai4s-bio@bytedance.com
|
|
@@ -18,9 +18,10 @@ from pathlib import Path
|
|
|
18
18
|
import click
|
|
19
19
|
|
|
20
20
|
from pxmeter.configs.data_config import (
|
|
21
|
+
CCD_BLOCKS_JSON,
|
|
21
22
|
COMPONENTS_FILE,
|
|
22
23
|
download_ccd_cif,
|
|
23
|
-
|
|
24
|
+
make_precomputed_json_from_ccd,
|
|
24
25
|
ONE_LETTER_CODE_JSON,
|
|
25
26
|
)
|
|
26
27
|
from pxmeter.eval import evaluate, MetricResult
|
|
@@ -176,4 +177,6 @@ def update():
|
|
|
176
177
|
Update the CCD database.
|
|
177
178
|
"""
|
|
178
179
|
download_ccd_cif(output_path=COMPONENTS_FILE.parent)
|
|
179
|
-
|
|
180
|
+
make_precomputed_json_from_ccd(
|
|
181
|
+
COMPONENTS_FILE, CCD_BLOCKS_JSON, ONE_LETTER_CODE_JSON
|
|
182
|
+
)
|
|
@@ -55,7 +55,9 @@ def download_ccd_cif(output_path: Path):
|
|
|
55
55
|
logging.info("Download CCD CIF file successfully: %s", output_cif)
|
|
56
56
|
|
|
57
57
|
|
|
58
|
-
def
|
|
58
|
+
def make_precomputed_json_from_ccd(
|
|
59
|
+
components_file: Path, ccd_blocks_json: Path, one_letter_code_json: Path
|
|
60
|
+
):
|
|
59
61
|
"""
|
|
60
62
|
Make a one-letter code JSON file from the CCD CIF file.
|
|
61
63
|
|
|
@@ -65,17 +67,23 @@ def make_one_letter_code_json_from_ccd(components_file: Path, output_json: Path)
|
|
|
65
67
|
ccd_cif = gemmi.cif.read(str(components_file))
|
|
66
68
|
|
|
67
69
|
ccd_code_to_one_letter_code = {}
|
|
70
|
+
ccd_code_to_block = {}
|
|
68
71
|
for block in ccd_cif:
|
|
69
72
|
ccd_code = block.find_value("_chem_comp.id")
|
|
70
73
|
one_letter_code = block.find_value("_chem_comp.one_letter_code")
|
|
74
|
+
ccd_code_to_block[ccd_code] = block.as_string()
|
|
71
75
|
if one_letter_code is None or one_letter_code == "?":
|
|
72
76
|
continue
|
|
73
77
|
ccd_code_to_one_letter_code[ccd_code] = one_letter_code
|
|
74
78
|
|
|
75
|
-
with open(
|
|
76
|
-
json.dump(
|
|
79
|
+
with open(ccd_blocks_json, "w") as f:
|
|
80
|
+
json.dump(ccd_code_to_block, f, indent=4)
|
|
81
|
+
|
|
82
|
+
logging.info("Make CCD_BLOCKS_JSON successfully: %s", ccd_blocks_json)
|
|
77
83
|
|
|
78
|
-
|
|
84
|
+
with open(one_letter_code_json, "w") as f:
|
|
85
|
+
json.dump(ccd_code_to_one_letter_code, f, indent=4)
|
|
86
|
+
logging.info("Make ONE_LETTER_CODE_JSON successfully: %s", one_letter_code_json)
|
|
79
87
|
|
|
80
88
|
|
|
81
89
|
# default is <repo_dir>/ccd_cache/components.cif Your path for components file
|
|
@@ -84,20 +92,30 @@ def make_one_letter_code_json_from_ccd(components_file: Path, output_json: Path)
|
|
|
84
92
|
repo_dir = Path(__file__).absolute().parent.parent.parent
|
|
85
93
|
ccd_file_in_repo = repo_dir / "ccd_cache" / "components.cif"
|
|
86
94
|
COMPONENTS_FILE = Path(os.environ.get("PXM_CCD_FILE", ccd_file_in_repo))
|
|
87
|
-
|
|
95
|
+
|
|
96
|
+
CCD_BLOCKS_JSON = COMPONENTS_FILE.with_suffix(".json")
|
|
97
|
+
ONE_LETTER_CODE_JSON = COMPONENTS_FILE.parent / "one_letter_code.json"
|
|
88
98
|
|
|
89
99
|
if not COMPONENTS_FILE.exists():
|
|
90
100
|
logging.debug(
|
|
91
101
|
"CCD CIF file not found. Downloading CCD CIF file to %s", COMPONENTS_FILE.parent
|
|
92
102
|
)
|
|
93
103
|
download_ccd_cif(output_path=COMPONENTS_FILE.parent)
|
|
94
|
-
|
|
104
|
+
make_precomputed_json_from_ccd(
|
|
105
|
+
COMPONENTS_FILE, CCD_BLOCKS_JSON, ONE_LETTER_CODE_JSON
|
|
106
|
+
)
|
|
95
107
|
else:
|
|
96
108
|
logging.debug("Load CCD CIF file from: %s", COMPONENTS_FILE)
|
|
97
109
|
|
|
98
|
-
if not ONE_LETTER_CODE_JSON.exists():
|
|
99
|
-
|
|
110
|
+
if not ONE_LETTER_CODE_JSON.exists() or not CCD_BLOCKS_JSON.exists():
|
|
111
|
+
make_precomputed_json_from_ccd(
|
|
112
|
+
COMPONENTS_FILE, CCD_BLOCKS_JSON, ONE_LETTER_CODE_JSON
|
|
113
|
+
)
|
|
100
114
|
|
|
101
115
|
logging.debug("Load CCD one-letter code from: %s", ONE_LETTER_CODE_JSON)
|
|
102
116
|
with open(ONE_LETTER_CODE_JSON, "r") as f:
|
|
103
117
|
CCD_ONE_LETTER_CODE = json.load(f)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
with open(CCD_BLOCKS_JSON, "r") as f:
|
|
121
|
+
CCD_BLOCKS = json.load(f)
|
|
@@ -24,7 +24,7 @@ from pdbeccdutils.core import ccd_reader
|
|
|
24
24
|
from rdkit import Chem
|
|
25
25
|
from rdkit.Geometry import Point3D
|
|
26
26
|
|
|
27
|
-
from pxmeter.configs.data_config import
|
|
27
|
+
from pxmeter.configs.data_config import CCD_BLOCKS
|
|
28
28
|
from pxmeter.data.utils import (
|
|
29
29
|
get_inter_residue_bonds,
|
|
30
30
|
get_mol_graph_matches,
|
|
@@ -34,17 +34,6 @@ from pxmeter.data.utils import (
|
|
|
34
34
|
logging.getLogger("rdkit").setLevel(logging.ERROR)
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
@functools.lru_cache
|
|
38
|
-
def _gemmi_load_ccd_cif() -> gemmi.cif.Document:
|
|
39
|
-
"""
|
|
40
|
-
Load the CCD components file using the gemmi library.
|
|
41
|
-
|
|
42
|
-
Returns:
|
|
43
|
-
gemmi.cif.Document: gemmi ccd components file
|
|
44
|
-
"""
|
|
45
|
-
return gemmi.cif.read(str(COMPONENTS_FILE))
|
|
46
|
-
|
|
47
|
-
|
|
48
37
|
@functools.lru_cache
|
|
49
38
|
def get_ccd_mol_from_cif(ccd_code: str) -> Chem.Mol:
|
|
50
39
|
"""
|
|
@@ -57,10 +46,8 @@ def get_ccd_mol_from_cif(ccd_code: str) -> Chem.Mol:
|
|
|
57
46
|
mol (Chem.Mol): The RDKit molecule object corresponding to the given CCD code.
|
|
58
47
|
Returns None if the CCD code is not found.
|
|
59
48
|
"""
|
|
60
|
-
ccd_cif = _gemmi_load_ccd_cif()
|
|
61
|
-
|
|
62
49
|
try:
|
|
63
|
-
ccd_block =
|
|
50
|
+
ccd_block = gemmi.cif.read_string(CCD_BLOCKS[ccd_code])[0]
|
|
64
51
|
except KeyError:
|
|
65
52
|
return
|
|
66
53
|
ccd_reader_result = ccd_reader._parse_pdb_mmcif(ccd_block, sanitize=True)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pxmeter
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: PXMeter is a comprehensive toolkit for evaluating the quality of structures generated by biomolecular structure prediction models.
|
|
5
5
|
Author: Bytedance Inc.
|
|
6
6
|
Author-email: ai4s-bio@bytedance.com
|
|
@@ -20,7 +20,7 @@ with open("requirements.txt") as f:
|
|
|
20
20
|
setup(
|
|
21
21
|
name="pxmeter",
|
|
22
22
|
python_requires=">=3.11",
|
|
23
|
-
version="0.1.
|
|
23
|
+
version="0.1.2",
|
|
24
24
|
description="PXMeter is a comprehensive toolkit for evaluating the quality of \
|
|
25
25
|
structures generated by biomolecular structure prediction models.",
|
|
26
26
|
author="Bytedance Inc.",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|