RNApolis 0.4.12__py3-none-any.whl → 0.4.14__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.
- {RNApolis-0.4.12.dist-info → RNApolis-0.4.14.dist-info}/METADATA +1 -1
- {RNApolis-0.4.12.dist-info → RNApolis-0.4.14.dist-info}/RECORD +7 -7
- rnapolis/molecule_filter.py +17 -2
- {RNApolis-0.4.12.dist-info → RNApolis-0.4.14.dist-info}/LICENSE +0 -0
- {RNApolis-0.4.12.dist-info → RNApolis-0.4.14.dist-info}/WHEEL +0 -0
- {RNApolis-0.4.12.dist-info → RNApolis-0.4.14.dist-info}/entry_points.txt +0 -0
- {RNApolis-0.4.12.dist-info → RNApolis-0.4.14.dist-info}/top_level.txt +0 -0
@@ -2,16 +2,16 @@ rnapolis/annotator.py,sha256=_hsSX2VHFvIQ47l_EA7lwGFXLiVLbhFPEsOQzBKbjRk,22100
|
|
2
2
|
rnapolis/clashfinder.py,sha256=i95kp0o6OWNqmJDBr-PbsZd7RY2iJtBDr7QqolJSuAQ,8513
|
3
3
|
rnapolis/common.py,sha256=LY6Uz96Br8ki_gA8LpfatgtvVbt9jOTkwgagayqTgf8,31251
|
4
4
|
rnapolis/metareader.py,sha256=I1-cXc2YNBPwa3zihAnMTjEsAo79tEKzSmWu5yvN1Pk,2071
|
5
|
-
rnapolis/molecule_filter.py,sha256=
|
5
|
+
rnapolis/molecule_filter.py,sha256=_7zrF-AH56vXI4vhFtfaU9wr-X7aeOL6DsXbX6_9vPQ,9497
|
6
6
|
rnapolis/motif_extractor.py,sha256=Lfn1iEkhkP9eZD3GPEWNAfy00QO7QPCc8wM_XS1ory8,1147
|
7
7
|
rnapolis/parser.py,sha256=lHI6LyFbEEPdHOzbged1-Ov0tl6MpSungIPacip0Py0,15838
|
8
8
|
rnapolis/rfam_folder.py,sha256=SjiiyML_T1__saruFwSMJEoQ7Y55GIU8ktS8ZUn5-fw,11111
|
9
9
|
rnapolis/tertiary.py,sha256=6t9ZB4w33-5n_M3sns1RoFXCOTgVAgGH4WDNG5OG9Kg,23426
|
10
10
|
rnapolis/transformer.py,sha256=aC0nBmHHJf5TyLvBIV57Jj3tlwpvHbPo347opfAOlQA,3844
|
11
11
|
rnapolis/util.py,sha256=IdquFO3PV1_KDqodjupzm0Rqvgy0CeSzxGHaGEHYXVU,543
|
12
|
-
RNApolis-0.4.
|
13
|
-
RNApolis-0.4.
|
14
|
-
RNApolis-0.4.
|
15
|
-
RNApolis-0.4.
|
16
|
-
RNApolis-0.4.
|
17
|
-
RNApolis-0.4.
|
12
|
+
RNApolis-0.4.14.dist-info/LICENSE,sha256=ZGRu12MzCgbYA-Lt8MyBlmjvPZh7xfiD5u5wBx0enq4,1066
|
13
|
+
RNApolis-0.4.14.dist-info/METADATA,sha256=MY6ulJgbaM4qJggOEswGUArvP0IsIMBX-zeoebjqjzk,54323
|
14
|
+
RNApolis-0.4.14.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
15
|
+
RNApolis-0.4.14.dist-info/entry_points.txt,sha256=foN2Pn5e-OzEz0fFmNoX6PnFSZFQntOlY8LbognP5F0,308
|
16
|
+
RNApolis-0.4.14.dist-info/top_level.txt,sha256=LcO18koxZcWoJ21KDRRRo_tyIbmXL5z61dPitZpy8yc,9
|
17
|
+
RNApolis-0.4.14.dist-info/RECORD,,
|
rnapolis/molecule_filter.py
CHANGED
@@ -21,6 +21,7 @@ ENTITY_POLY_TYPES = [
|
|
21
21
|
]
|
22
22
|
|
23
23
|
CATEGORIES_WITH_ENTITY_ID = [
|
24
|
+
("entity", "id"),
|
24
25
|
("atom_site", "label_entity_id"),
|
25
26
|
("entity_keywords", "entity_id"),
|
26
27
|
("entity_name_com", "entity_id"),
|
@@ -155,7 +156,9 @@ def select_category_by_id(
|
|
155
156
|
|
156
157
|
|
157
158
|
def filter_by_poly_types(
|
158
|
-
file_content: str,
|
159
|
+
file_content: str,
|
160
|
+
entity_poly_types: Iterable[str] = ["polyribonucleotide"],
|
161
|
+
retain_categories: Iterable[str] = [],
|
159
162
|
) -> str:
|
160
163
|
adapter = IoAdapterPy()
|
161
164
|
|
@@ -186,13 +189,20 @@ def filter_by_poly_types(
|
|
186
189
|
obj = DataCategory(category, attributes, rows)
|
187
190
|
output.append(obj)
|
188
191
|
|
192
|
+
for category in retain_categories:
|
193
|
+
obj = data[0].getObj(category)
|
194
|
+
if obj:
|
195
|
+
output.append(obj)
|
196
|
+
|
189
197
|
with tempfile.NamedTemporaryFile("rt+") as tmp:
|
190
198
|
adapter.writeFile(tmp.name, [output])
|
191
199
|
tmp.seek(0)
|
192
200
|
return tmp.read()
|
193
201
|
|
194
202
|
|
195
|
-
def filter_by_chains(
|
203
|
+
def filter_by_chains(
|
204
|
+
file_content: str, chains: Iterable[str], retain_categories: Iterable[str] = []
|
205
|
+
) -> str:
|
196
206
|
"""
|
197
207
|
Filter a PDBx/mmCIF file by chain IDs. The function returns a new PDBx/mmCIF file.
|
198
208
|
|
@@ -227,6 +237,11 @@ def filter_by_chains(file_content: str, chains: Iterable[str]) -> str:
|
|
227
237
|
obj = DataCategory(category, attributes, rows)
|
228
238
|
output.append(obj)
|
229
239
|
|
240
|
+
for category in retain_categories:
|
241
|
+
obj = data[0].getObj(category)
|
242
|
+
if obj:
|
243
|
+
output.append(obj)
|
244
|
+
|
230
245
|
with tempfile.NamedTemporaryFile("rt+") as tmp:
|
231
246
|
adapter.writeFile(tmp.name, [output])
|
232
247
|
tmp.seek(0)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|