RNApolis 0.3.13__tar.gz → 0.3.15__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. {rnapolis-0.3.13/src/RNApolis.egg-info → rnapolis-0.3.15}/PKG-INFO +1 -1
  2. {rnapolis-0.3.13 → rnapolis-0.3.15}/setup.py +1 -1
  3. {rnapolis-0.3.13 → rnapolis-0.3.15/src/RNApolis.egg-info}/PKG-INFO +1 -1
  4. {rnapolis-0.3.13 → rnapolis-0.3.15}/src/rnapolis/common.py +27 -19
  5. {rnapolis-0.3.13 → rnapolis-0.3.15}/LICENSE +0 -0
  6. {rnapolis-0.3.13 → rnapolis-0.3.15}/README.md +0 -0
  7. {rnapolis-0.3.13 → rnapolis-0.3.15}/pyproject.toml +0 -0
  8. {rnapolis-0.3.13 → rnapolis-0.3.15}/setup.cfg +0 -0
  9. {rnapolis-0.3.13 → rnapolis-0.3.15}/src/RNApolis.egg-info/SOURCES.txt +0 -0
  10. {rnapolis-0.3.13 → rnapolis-0.3.15}/src/RNApolis.egg-info/dependency_links.txt +0 -0
  11. {rnapolis-0.3.13 → rnapolis-0.3.15}/src/RNApolis.egg-info/entry_points.txt +0 -0
  12. {rnapolis-0.3.13 → rnapolis-0.3.15}/src/RNApolis.egg-info/requires.txt +0 -0
  13. {rnapolis-0.3.13 → rnapolis-0.3.15}/src/RNApolis.egg-info/top_level.txt +0 -0
  14. {rnapolis-0.3.13 → rnapolis-0.3.15}/src/rnapolis/annotator.py +0 -0
  15. {rnapolis-0.3.13 → rnapolis-0.3.15}/src/rnapolis/clashfinder.py +0 -0
  16. {rnapolis-0.3.13 → rnapolis-0.3.15}/src/rnapolis/metareader.py +0 -0
  17. {rnapolis-0.3.13 → rnapolis-0.3.15}/src/rnapolis/molecule_filter.py +0 -0
  18. {rnapolis-0.3.13 → rnapolis-0.3.15}/src/rnapolis/motif_extractor.py +0 -0
  19. {rnapolis-0.3.13 → rnapolis-0.3.15}/src/rnapolis/parser.py +0 -0
  20. {rnapolis-0.3.13 → rnapolis-0.3.15}/src/rnapolis/rfam_folder.py +0 -0
  21. {rnapolis-0.3.13 → rnapolis-0.3.15}/src/rnapolis/tertiary.py +0 -0
  22. {rnapolis-0.3.13 → rnapolis-0.3.15}/src/rnapolis/transformer.py +0 -0
  23. {rnapolis-0.3.13 → rnapolis-0.3.15}/src/rnapolis/util.py +0 -0
  24. {rnapolis-0.3.13 → rnapolis-0.3.15}/tests/test_annotator.py +0 -0
  25. {rnapolis-0.3.13 → rnapolis-0.3.15}/tests/test_bugfixes.py +0 -0
  26. {rnapolis-0.3.13 → rnapolis-0.3.15}/tests/test_common.py +0 -0
  27. {rnapolis-0.3.13 → rnapolis-0.3.15}/tests/test_metareader.py +0 -0
  28. {rnapolis-0.3.13 → rnapolis-0.3.15}/tests/test_parser.py +0 -0
  29. {rnapolis-0.3.13 → rnapolis-0.3.15}/tests/test_quadruplexes.py +0 -0
  30. {rnapolis-0.3.13 → rnapolis-0.3.15}/tests/test_rfam_folder.py +0 -0
  31. {rnapolis-0.3.13 → rnapolis-0.3.15}/tests/test_tertiary.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: RNApolis
3
- Version: 0.3.13
3
+ Version: 0.3.15
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.3.13",
8
+ version="0.3.15",
9
9
  packages=["rnapolis"],
10
10
  package_dir={"": "src"},
11
11
  author="Tomasz Zok",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: RNApolis
3
- Version: 0.3.13
3
+ Version: 0.3.15
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
@@ -869,8 +869,12 @@ class BpSeq:
869
869
  graph[i].add(j)
870
870
  graph[j].add(i)
871
871
 
872
- # find all connected components
872
+ # early exit for non-pseudoknotted structures
873
873
  vertices = list(graph.keys())
874
+ if not vertices:
875
+ return [self.fcfs]
876
+
877
+ # find all connected components
874
878
  visited = {vertex: False for vertex in vertices}
875
879
  components = []
876
880
 
@@ -896,33 +900,37 @@ class BpSeq:
896
900
  else:
897
901
  stack.pop()
898
902
 
899
- # permute order of every component
900
- permutations = [
901
- list(itertools.permutations(component)) for component in components
902
- ]
903
- solutions = set()
903
+ # find unique orders for each component
904
+ unique = []
905
+ for component in components:
906
+ unique.append(set())
904
907
 
905
- for permutation in itertools.product(*permutations):
906
- orders = [0 for _ in range(len(regions))]
908
+ for permutation in itertools.permutations(component):
909
+ orders = {region: 0 for region in component}
907
910
 
908
- for component in permutation:
909
- for i in range(1, len(component)):
910
- region_i = component[i]
911
- available = [True for _ in range(len(graph))]
911
+ for i in range(1, len(permutation)):
912
+ available = [True for _ in range(len(component))]
912
913
 
913
914
  for j in range(i):
914
- region_j = component[j]
915
-
916
- if region_j in graph[region_i]:
917
- available[orders[region_j]] = False
915
+ if permutation[j] in graph[permutation[i]]:
916
+ available[orders[permutation[j]]] = False
918
917
 
919
918
  order = next(
920
- filter(lambda i: available[i] is True, range(len(available)))
919
+ filter(lambda k: available[k] is True, range(len(available)))
921
920
  )
922
- orders[region_i] = order
921
+ orders[permutation[i]] = order
922
+
923
+ unique[-1].add(frozenset(orders.items()))
924
+
925
+ # generate all possible dot-brackets
926
+ solutions = set()
927
+ for assignment in itertools.product(*unique):
928
+ orders = {region: 0 for region in range(len(regions))}
923
929
 
924
- solutions.add(self.__make_dot_bracket(regions, orders))
930
+ for order in assignment:
931
+ orders.update(order)
925
932
 
933
+ solutions.add(self.__make_dot_bracket(regions, orders))
926
934
  return list(solutions)
927
935
 
928
936
 
File without changes
File without changes
File without changes
File without changes