gemmi-protools 0.1.5__py3-none-any.whl → 0.1.7__py3-none-any.whl
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.
Potentially problematic release.
This version of gemmi-protools might be problematic. Click here for more details.
- gemmi_protools/io/parser.py +7 -2
- gemmi_protools/io/pdb_opts.py +4 -2
- gemmi_protools/utils/fixer.py +15 -1
- {gemmi_protools-0.1.5.dist-info → gemmi_protools-0.1.7.dist-info}/METADATA +1 -1
- {gemmi_protools-0.1.5.dist-info → gemmi_protools-0.1.7.dist-info}/RECORD +8 -8
- {gemmi_protools-0.1.5.dist-info → gemmi_protools-0.1.7.dist-info}/WHEEL +1 -1
- {gemmi_protools-0.1.5.dist-info → gemmi_protools-0.1.7.dist-info}/licenses/LICENSE +0 -0
- {gemmi_protools-0.1.5.dist-info → gemmi_protools-0.1.7.dist-info}/top_level.txt +0 -0
gemmi_protools/io/parser.py
CHANGED
|
@@ -134,14 +134,19 @@ def pdb_parser(path: Union[str, pathlib.Path]):
|
|
|
134
134
|
block = struct.make_mmcif_block()
|
|
135
135
|
ent_t = _cif_entity_info(block)
|
|
136
136
|
rec = defaultdict(list)
|
|
137
|
+
|
|
137
138
|
for cn, middle_eid in ent_t.polymer2eid.items():
|
|
138
139
|
rec[middle_eid].append(cn)
|
|
139
140
|
|
|
140
141
|
_mapper = _assign_digital_entity_names(struct)
|
|
141
142
|
_mapper_n = dict()
|
|
143
|
+
|
|
142
144
|
for middle_eid, new_eid in _mapper.items():
|
|
143
|
-
|
|
144
|
-
|
|
145
|
+
if middle_eid in rec:
|
|
146
|
+
mid = rec[middle_eid]
|
|
147
|
+
mid.sort()
|
|
148
|
+
old_eid = str(",".join(mid))
|
|
149
|
+
_mapper_n[old_eid] = new_eid
|
|
145
150
|
|
|
146
151
|
if _mapper_n:
|
|
147
152
|
_update_entity_names(ent_0, _mapper_n)
|
gemmi_protools/io/pdb_opts.py
CHANGED
|
@@ -119,6 +119,8 @@ def _compound_source_string(entity: Entity) -> List[str]:
|
|
|
119
119
|
entity2polymer[v].append(k)
|
|
120
120
|
entity_labels = list(entity2polymer.keys())
|
|
121
121
|
entity_labels.sort()
|
|
122
|
+
for v in entity2polymer.values():
|
|
123
|
+
v.sort()
|
|
122
124
|
|
|
123
125
|
values = []
|
|
124
126
|
for i, el in enumerate(entity_labels):
|
|
@@ -136,9 +138,9 @@ def _compound_source_string(entity: Entity) -> List[str]:
|
|
|
136
138
|
compound_molecule = "COMPND {n_line:>3} MOLECULE: {molecule};"
|
|
137
139
|
compound_chain = "COMPND {n_line:>3} CHAIN: {chain};"
|
|
138
140
|
|
|
139
|
-
i =
|
|
141
|
+
i = 1
|
|
140
142
|
for val in values:
|
|
141
|
-
if i ==
|
|
143
|
+
if i == 1:
|
|
142
144
|
outputs.append(compound_mol0.format(**val))
|
|
143
145
|
i += 1
|
|
144
146
|
for c_str in [compound_molecule, compound_chain]:
|
gemmi_protools/utils/fixer.py
CHANGED
|
@@ -50,7 +50,9 @@ def clean_structure(input_file: Union[str, pathlib.Path],
|
|
|
50
50
|
add_missing_atoms: str = "heavy",
|
|
51
51
|
keep_heterogens: str = "all",
|
|
52
52
|
replace_nonstandard: bool = True,
|
|
53
|
-
ph: Union[float, int] = 7.0
|
|
53
|
+
ph: Union[float, int] = 7.0,
|
|
54
|
+
check_mode: bool = True,
|
|
55
|
+
threshold: float = 0.3,
|
|
54
56
|
):
|
|
55
57
|
"""
|
|
56
58
|
|
|
@@ -69,6 +71,9 @@ def clean_structure(input_file: Union[str, pathlib.Path],
|
|
|
69
71
|
none: remove all heterogens
|
|
70
72
|
:param replace_nonstandard: default True, replace all non-standard residues to standard ones
|
|
71
73
|
:param ph: default 7.0, ph values to add missing hydrogen atoms
|
|
74
|
+
:param check_mode: default True to check the ratio of residues with missing atoms
|
|
75
|
+
:param threshold: float, default 0.3, only use when check_mode=True
|
|
76
|
+
|
|
72
77
|
:return:
|
|
73
78
|
str, status message of fixing
|
|
74
79
|
if successful, return Finish, otherwise message of error
|
|
@@ -82,6 +87,15 @@ def clean_structure(input_file: Union[str, pathlib.Path],
|
|
|
82
87
|
######################################################
|
|
83
88
|
fixer = _load_by_pbdfixer(input_file)
|
|
84
89
|
|
|
90
|
+
######################################################
|
|
91
|
+
# check
|
|
92
|
+
######################################################
|
|
93
|
+
fixer.findMissingResidues()
|
|
94
|
+
fixer.findMissingAtoms()
|
|
95
|
+
ratio = len(fixer.missingAtoms) / fixer.topology.getNumResidues()
|
|
96
|
+
if ratio > threshold:
|
|
97
|
+
return dict(input=input_file, msg="Too many residues with missing atoms: %.2f" % ratio)
|
|
98
|
+
|
|
85
99
|
######################################################
|
|
86
100
|
# replace non-standard residues
|
|
87
101
|
######################################################
|
|
@@ -3,18 +3,18 @@ gemmi_protools/io/__init__.py,sha256=F6e1xNT_7lZAWQgNIneH06o2qtWYrHNr_xPUPTwwx5E
|
|
|
3
3
|
gemmi_protools/io/cif_opts.py,sha256=TKND91aRGB5hYNdTFElCKMGabCg4klLk_c1evC3WZuA,6368
|
|
4
4
|
gemmi_protools/io/convert.py,sha256=780sQcwhslUD4Hj5UZMVlQdbicniJ6jNjncTl_7jaMk,3841
|
|
5
5
|
gemmi_protools/io/parse_pdb_header.py,sha256=UOGMsE3-d3APhO7zaAEE0NT31n-iqt55VpDh_RPOicI,14223
|
|
6
|
-
gemmi_protools/io/parser.py,sha256=
|
|
7
|
-
gemmi_protools/io/pdb_opts.py,sha256=
|
|
6
|
+
gemmi_protools/io/parser.py,sha256=NCLc9IHH-tb2hIm0jZeKu2nVw2Isr-n-pH4l7JbKA5w,9130
|
|
7
|
+
gemmi_protools/io/pdb_opts.py,sha256=laUqxlecOe6goax12q8EJGZuZbHyIGsXVucMV3gVrgg,5741
|
|
8
8
|
gemmi_protools/io/peptide.py,sha256=a2wiEutJmvhl6gDCIzzqRCbmyknk2mwgy2FZ53lXclU,750
|
|
9
9
|
gemmi_protools/io/reader.py,sha256=oaJ5TTWLFCZ3tDq3R5dAyBqm4Q2sxmfl4D8cGvSOdl0,16060
|
|
10
10
|
gemmi_protools/io/struct_info.py,sha256=9nBj1Zer03S8_Wks7L7uRlc9PlbfCKzoaT32pKR58X8,2769
|
|
11
11
|
gemmi_protools/utils/__init__.py,sha256=F6e1xNT_7lZAWQgNIneH06o2qtWYrHNr_xPUPTwwx5E,29
|
|
12
12
|
gemmi_protools/utils/align.py,sha256=CZcrvjy-ZbX2u7OAn-YGblbxaj9YFUDX4CFZcpbpnB8,6959
|
|
13
13
|
gemmi_protools/utils/dockq.py,sha256=XmMwVEy-H4p6sH_HPcDWA3TP77OWdih0fE_BQJDr4pU,4189
|
|
14
|
-
gemmi_protools/utils/fixer.py,sha256=
|
|
14
|
+
gemmi_protools/utils/fixer.py,sha256=WUiIoK8dFPGUkXlK-wiiWyorYD8T71rN7WDE2psGSiE,9061
|
|
15
15
|
gemmi_protools/utils/ppi.py,sha256=VWYsdxWwQoS1xwEYj5KB96Zz3F8r5Eyuw6NT3ReD-wc,2330
|
|
16
|
-
gemmi_protools-0.1.
|
|
17
|
-
gemmi_protools-0.1.
|
|
18
|
-
gemmi_protools-0.1.
|
|
19
|
-
gemmi_protools-0.1.
|
|
20
|
-
gemmi_protools-0.1.
|
|
16
|
+
gemmi_protools-0.1.7.dist-info/licenses/LICENSE,sha256=JuQvKcgj6n11y5y6nXr9rABv3gJSswc4eTCd5WZBtSY,1062
|
|
17
|
+
gemmi_protools-0.1.7.dist-info/METADATA,sha256=tsp4fzE0T7lTsmPaRYK5UzgqS4OjrvOSfESFMqbkk0Y,567
|
|
18
|
+
gemmi_protools-0.1.7.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
|
|
19
|
+
gemmi_protools-0.1.7.dist-info/top_level.txt,sha256=P12mYJi5O5EKIn5u-RFaWxuix431CgLacSRD7rBid_U,15
|
|
20
|
+
gemmi_protools-0.1.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|