RNApolis 0.10.7__tar.gz → 0.11.0__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.
- {rnapolis-0.10.7/src/RNApolis.egg-info → rnapolis-0.11.0}/PKG-INFO +1 -1
- {rnapolis-0.10.7 → rnapolis-0.11.0}/setup.py +1 -1
- {rnapolis-0.10.7 → rnapolis-0.11.0/src/RNApolis.egg-info}/PKG-INFO +1 -1
- {rnapolis-0.10.7 → rnapolis-0.11.0}/src/rnapolis/adapter.py +1 -1
- {rnapolis-0.10.7 → rnapolis-0.11.0}/src/rnapolis/molecule_filter.py +47 -12
- {rnapolis-0.10.7 → rnapolis-0.11.0}/LICENSE +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/README.md +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/pyproject.toml +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/setup.cfg +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/src/RNApolis.egg-info/SOURCES.txt +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/src/RNApolis.egg-info/dependency_links.txt +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/src/RNApolis.egg-info/entry_points.txt +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/src/RNApolis.egg-info/requires.txt +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/src/RNApolis.egg-info/top_level.txt +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/src/rnapolis/aligner.py +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/src/rnapolis/annotator.py +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/src/rnapolis/clashfinder.py +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/src/rnapolis/common.py +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/src/rnapolis/component_A.csv +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/src/rnapolis/component_C.csv +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/src/rnapolis/component_G.csv +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/src/rnapolis/component_U.csv +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/src/rnapolis/distiller.py +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/src/rnapolis/metareader.py +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/src/rnapolis/mmcif_pdbx_v50.dic +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/src/rnapolis/motif_extractor.py +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/src/rnapolis/parser.py +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/src/rnapolis/parser_v2.py +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/src/rnapolis/py.typed +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/src/rnapolis/rfam_folder.py +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/src/rnapolis/splitter.py +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/src/rnapolis/tertiary.py +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/src/rnapolis/tertiary_v2.py +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/src/rnapolis/transformer.py +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/src/rnapolis/unifier.py +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/src/rnapolis/util.py +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/tests/test_adapter.py +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/tests/test_annotator.py +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/tests/test_bugfixes.py +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/tests/test_common.py +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/tests/test_metareader.py +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/tests/test_molecule_filter.py +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/tests/test_parser.py +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/tests/test_quadruplexes.py +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/tests/test_rfam_folder.py +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/tests/test_tertiary.py +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/tests/test_transformer.py +0 -0
- {rnapolis-0.10.7 → rnapolis-0.11.0}/tests/test_v2.py +0 -0
|
@@ -247,7 +247,7 @@ def match_dssr_name_to_residue(
|
|
|
247
247
|
nt_id = nt_id.split(":")[-1]
|
|
248
248
|
for residue in structure3d.residues:
|
|
249
249
|
if residue.full_name == nt_id:
|
|
250
|
-
return residue
|
|
250
|
+
return Residue(residue.label, residue.auth)
|
|
251
251
|
logging.warning(f"Failed to find residue {nt_id}")
|
|
252
252
|
return None
|
|
253
253
|
|
|
@@ -8,6 +8,7 @@ from typing import Iterable, List, Set, Tuple
|
|
|
8
8
|
from mmcif.io.IoAdapterPy import IoAdapterPy
|
|
9
9
|
from mmcif.io.PdbxReader import DataCategory, DataContainer
|
|
10
10
|
|
|
11
|
+
from rnapolis.parser_v2 import parse_cif_atoms, write_pdb
|
|
11
12
|
from rnapolis.util import handle_input_file
|
|
12
13
|
|
|
13
14
|
# Source: https://mmcif.wwpdb.org/dictionaries/mmcif_pdbx_v50.dic/Items/_entity_poly.type.html
|
|
@@ -160,6 +161,20 @@ def filter_by_poly_types(
|
|
|
160
161
|
return filter_cif(data, entity_ids, asym_ids, auth_asym_ids, retain_categories)
|
|
161
162
|
|
|
162
163
|
|
|
164
|
+
def filter_by_entity_ids(
|
|
165
|
+
file_content: str,
|
|
166
|
+
entity_ids: Iterable[str],
|
|
167
|
+
retain_categories: Iterable[str] = ["chem_comp"],
|
|
168
|
+
) -> str:
|
|
169
|
+
data = read_cif(file_content)
|
|
170
|
+
entity_ids = set(entity_ids)
|
|
171
|
+
asym_ids = select_ids(data, "struct_asym", "id", "entity_id", entity_ids)
|
|
172
|
+
auth_asym_ids = select_ids(
|
|
173
|
+
data, "atom_site", "auth_asym_id", "label_asym_id", asym_ids
|
|
174
|
+
)
|
|
175
|
+
return filter_cif(data, entity_ids, asym_ids, auth_asym_ids, retain_categories)
|
|
176
|
+
|
|
177
|
+
|
|
163
178
|
def filter_by_chains(
|
|
164
179
|
file_content: str,
|
|
165
180
|
chains: Iterable[str],
|
|
@@ -189,6 +204,12 @@ def main():
|
|
|
189
204
|
action="append",
|
|
190
205
|
default=[],
|
|
191
206
|
)
|
|
207
|
+
parser.add_argument(
|
|
208
|
+
"--filter-by-entity-ids",
|
|
209
|
+
help="filter by entity IDs, e.g. 1, 2, 3",
|
|
210
|
+
action="append",
|
|
211
|
+
default=[],
|
|
212
|
+
)
|
|
192
213
|
parser.add_argument(
|
|
193
214
|
"--filter-by-chains",
|
|
194
215
|
help="filter by chain IDs (label_asym_id), e.g. A, B, C",
|
|
@@ -201,29 +222,43 @@ def main():
|
|
|
201
222
|
action="append",
|
|
202
223
|
default=["chem_comp"],
|
|
203
224
|
)
|
|
225
|
+
parser.add_argument(
|
|
226
|
+
"--pdb", help="change output format to PDB", action="store_true"
|
|
227
|
+
)
|
|
204
228
|
parser.add_argument("path", help="path to a PDBx/mmCIF file")
|
|
205
229
|
args = parser.parse_args()
|
|
206
230
|
|
|
207
231
|
file = handle_input_file(args.path)
|
|
232
|
+
content = None
|
|
233
|
+
|
|
208
234
|
if args.filter_by_poly_types:
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
235
|
+
content = filter_by_poly_types(
|
|
236
|
+
file.read(),
|
|
237
|
+
entity_poly_types=args.filter_by_poly_types,
|
|
238
|
+
retain_categories=args.retain_categories,
|
|
239
|
+
)
|
|
240
|
+
elif args.filter_by_entity_ids:
|
|
241
|
+
content = filter_by_entity_ids(
|
|
242
|
+
file.read(),
|
|
243
|
+
entity_ids=args.filter_by_entity_ids,
|
|
244
|
+
retain_categories=args.retain_categories,
|
|
215
245
|
)
|
|
216
246
|
elif args.filter_by_chains:
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
retain_categories=args.retain_categories,
|
|
222
|
-
)
|
|
247
|
+
content = filter_by_chains(
|
|
248
|
+
file.read(),
|
|
249
|
+
chains=args.filter_by_chains,
|
|
250
|
+
retain_categories=args.retain_categories,
|
|
223
251
|
)
|
|
224
252
|
else:
|
|
225
253
|
parser.print_help()
|
|
226
254
|
|
|
255
|
+
if content:
|
|
256
|
+
if args.pdb:
|
|
257
|
+
df = parse_cif_atoms(content)
|
|
258
|
+
print(write_pdb(df))
|
|
259
|
+
else:
|
|
260
|
+
print(content)
|
|
261
|
+
|
|
227
262
|
|
|
228
263
|
if __name__ == "__main__":
|
|
229
264
|
main()
|
|
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
|
|
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
|