RNApolis 0.10.8__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.
Files changed (48) hide show
  1. {rnapolis-0.10.8/src/RNApolis.egg-info → rnapolis-0.11.0}/PKG-INFO +1 -1
  2. {rnapolis-0.10.8 → rnapolis-0.11.0}/setup.py +1 -1
  3. {rnapolis-0.10.8 → rnapolis-0.11.0/src/RNApolis.egg-info}/PKG-INFO +1 -1
  4. {rnapolis-0.10.8 → rnapolis-0.11.0}/src/rnapolis/molecule_filter.py +47 -12
  5. {rnapolis-0.10.8 → rnapolis-0.11.0}/LICENSE +0 -0
  6. {rnapolis-0.10.8 → rnapolis-0.11.0}/README.md +0 -0
  7. {rnapolis-0.10.8 → rnapolis-0.11.0}/pyproject.toml +0 -0
  8. {rnapolis-0.10.8 → rnapolis-0.11.0}/setup.cfg +0 -0
  9. {rnapolis-0.10.8 → rnapolis-0.11.0}/src/RNApolis.egg-info/SOURCES.txt +0 -0
  10. {rnapolis-0.10.8 → rnapolis-0.11.0}/src/RNApolis.egg-info/dependency_links.txt +0 -0
  11. {rnapolis-0.10.8 → rnapolis-0.11.0}/src/RNApolis.egg-info/entry_points.txt +0 -0
  12. {rnapolis-0.10.8 → rnapolis-0.11.0}/src/RNApolis.egg-info/requires.txt +0 -0
  13. {rnapolis-0.10.8 → rnapolis-0.11.0}/src/RNApolis.egg-info/top_level.txt +0 -0
  14. {rnapolis-0.10.8 → rnapolis-0.11.0}/src/rnapolis/adapter.py +0 -0
  15. {rnapolis-0.10.8 → rnapolis-0.11.0}/src/rnapolis/aligner.py +0 -0
  16. {rnapolis-0.10.8 → rnapolis-0.11.0}/src/rnapolis/annotator.py +0 -0
  17. {rnapolis-0.10.8 → rnapolis-0.11.0}/src/rnapolis/clashfinder.py +0 -0
  18. {rnapolis-0.10.8 → rnapolis-0.11.0}/src/rnapolis/common.py +0 -0
  19. {rnapolis-0.10.8 → rnapolis-0.11.0}/src/rnapolis/component_A.csv +0 -0
  20. {rnapolis-0.10.8 → rnapolis-0.11.0}/src/rnapolis/component_C.csv +0 -0
  21. {rnapolis-0.10.8 → rnapolis-0.11.0}/src/rnapolis/component_G.csv +0 -0
  22. {rnapolis-0.10.8 → rnapolis-0.11.0}/src/rnapolis/component_U.csv +0 -0
  23. {rnapolis-0.10.8 → rnapolis-0.11.0}/src/rnapolis/distiller.py +0 -0
  24. {rnapolis-0.10.8 → rnapolis-0.11.0}/src/rnapolis/metareader.py +0 -0
  25. {rnapolis-0.10.8 → rnapolis-0.11.0}/src/rnapolis/mmcif_pdbx_v50.dic +0 -0
  26. {rnapolis-0.10.8 → rnapolis-0.11.0}/src/rnapolis/motif_extractor.py +0 -0
  27. {rnapolis-0.10.8 → rnapolis-0.11.0}/src/rnapolis/parser.py +0 -0
  28. {rnapolis-0.10.8 → rnapolis-0.11.0}/src/rnapolis/parser_v2.py +0 -0
  29. {rnapolis-0.10.8 → rnapolis-0.11.0}/src/rnapolis/py.typed +0 -0
  30. {rnapolis-0.10.8 → rnapolis-0.11.0}/src/rnapolis/rfam_folder.py +0 -0
  31. {rnapolis-0.10.8 → rnapolis-0.11.0}/src/rnapolis/splitter.py +0 -0
  32. {rnapolis-0.10.8 → rnapolis-0.11.0}/src/rnapolis/tertiary.py +0 -0
  33. {rnapolis-0.10.8 → rnapolis-0.11.0}/src/rnapolis/tertiary_v2.py +0 -0
  34. {rnapolis-0.10.8 → rnapolis-0.11.0}/src/rnapolis/transformer.py +0 -0
  35. {rnapolis-0.10.8 → rnapolis-0.11.0}/src/rnapolis/unifier.py +0 -0
  36. {rnapolis-0.10.8 → rnapolis-0.11.0}/src/rnapolis/util.py +0 -0
  37. {rnapolis-0.10.8 → rnapolis-0.11.0}/tests/test_adapter.py +0 -0
  38. {rnapolis-0.10.8 → rnapolis-0.11.0}/tests/test_annotator.py +0 -0
  39. {rnapolis-0.10.8 → rnapolis-0.11.0}/tests/test_bugfixes.py +0 -0
  40. {rnapolis-0.10.8 → rnapolis-0.11.0}/tests/test_common.py +0 -0
  41. {rnapolis-0.10.8 → rnapolis-0.11.0}/tests/test_metareader.py +0 -0
  42. {rnapolis-0.10.8 → rnapolis-0.11.0}/tests/test_molecule_filter.py +0 -0
  43. {rnapolis-0.10.8 → rnapolis-0.11.0}/tests/test_parser.py +0 -0
  44. {rnapolis-0.10.8 → rnapolis-0.11.0}/tests/test_quadruplexes.py +0 -0
  45. {rnapolis-0.10.8 → rnapolis-0.11.0}/tests/test_rfam_folder.py +0 -0
  46. {rnapolis-0.10.8 → rnapolis-0.11.0}/tests/test_tertiary.py +0 -0
  47. {rnapolis-0.10.8 → rnapolis-0.11.0}/tests/test_transformer.py +0 -0
  48. {rnapolis-0.10.8 → rnapolis-0.11.0}/tests/test_v2.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: RNApolis
3
- Version: 0.10.8
3
+ Version: 0.11.0
4
4
  Summary: A Python library containing RNA-related bioinformatics functions and classes
5
5
  Home-page: https://github.com/tzok/rnapolis-py
6
6
  Author: Tomasz Zok
@@ -5,7 +5,7 @@ with open("README.md") as f:
5
5
 
6
6
  setup(
7
7
  name="RNApolis",
8
- version="0.10.8",
8
+ version="0.11.0",
9
9
  packages=["rnapolis"],
10
10
  package_dir={"": "src"},
11
11
  author="Tomasz Zok",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: RNApolis
3
- Version: 0.10.8
3
+ Version: 0.11.0
4
4
  Summary: A Python library containing RNA-related bioinformatics functions and classes
5
5
  Home-page: https://github.com/tzok/rnapolis-py
6
6
  Author: Tomasz Zok
@@ -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
- print(
210
- filter_by_poly_types(
211
- file.read(),
212
- entity_poly_types=args.filter_by_poly_types,
213
- retain_categories=args.retain_categories,
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
- print(
218
- filter_by_chains(
219
- file.read(),
220
- chains=args.filter_by_chains,
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