RNApolis 0.6.0__py3-none-any.whl → 0.6.2__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/aligner.py CHANGED
@@ -43,22 +43,38 @@ def main():
43
43
  elif line.startswith("pdb2"):
44
44
  pdb2_aligned.append(line.split()[1])
45
45
 
46
- pdb1_aligned = " ".join(pdb1_aligned)
47
- pdb2_aligned = " ".join(pdb2_aligned)
46
+ pdb1_aligned = "".join(pdb1_aligned)
47
+ pdb2_aligned = "".join(pdb2_aligned)
48
48
  residues_to_remove = {"pdb1": [], "pdb2": []}
49
49
 
50
- for i, (c1, c2) in enumerate(zip(pdb1_aligned, pdb2_aligned)):
50
+ i, j = 0, 0
51
+ for c1, c2 in zip(pdb1_aligned, pdb2_aligned):
52
+ if c1 == c2 == "-":
53
+ continue # Should not happen to have gap aligned to gap, but just in case
54
+
51
55
  if c1 == c2:
56
+ i += 1
57
+ j += 1
52
58
  continue
59
+
53
60
  if c1 == "-":
54
- residues_to_remove["pdb2"].append(i)
55
- elif c2 == "-":
61
+ residues_to_remove["pdb2"].append(j)
62
+ j += 1
63
+ continue
64
+
65
+ if c2 == "-":
56
66
  residues_to_remove["pdb1"].append(i)
57
- elif c1 != c2:
67
+ i += 1
68
+ continue
69
+
70
+ if c1 != c2:
58
71
  residues_to_remove["pdb1"].append(i)
59
- residues_to_remove["pdb2"].append(i)
60
- else:
61
- raise ValueError("This should not happen!")
72
+ residues_to_remove["pdb2"].append(j)
73
+ i += 1
74
+ j += 1
75
+ continue
76
+
77
+ raise ValueError("This should not happen!")
62
78
 
63
79
  if not residues_to_remove["pdb1"] and not residues_to_remove["pdb2"]:
64
80
  print("Structures are already aligned")
rnapolis/unifier.py CHANGED
@@ -73,6 +73,7 @@ def main():
73
73
 
74
74
  structures.append((path, residues))
75
75
 
76
+ residues_to_remove = set()
76
77
  for path, residues in structures:
77
78
  ref_path, ref_residues = structures[0]
78
79
 
@@ -92,7 +93,6 @@ def main():
92
93
  sys.exit(1)
93
94
 
94
95
  # Find residues with different number of atoms
95
- residues_to_remove = set()
96
96
  for i, (residue, ref_residue) in enumerate(zip(residues, ref_residues)):
97
97
  if len(residue.atoms) != len(ref_residue.atoms):
98
98
  print(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: RNApolis
3
- Version: 0.6.0
3
+ Version: 0.6.2
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
@@ -1,4 +1,4 @@
1
- rnapolis/aligner.py,sha256=oJ81FrjlEEzqJcYJdZUE1PrPjabIOT7j0idwAHXVQMI,3156
1
+ rnapolis/aligner.py,sha256=o7rQyjAZ3n4VXcnSPY3HVB8nLNRkVbl552O3NVh0mfg,3429
2
2
  rnapolis/annotator.py,sha256=hRRzRmneYxbg2tvwVHMWLfzmJb4szV0JL_6EOC09Gwg,22101
3
3
  rnapolis/clashfinder.py,sha256=AC9_tIx7QIk57sELq_aKfU1u3UMOXbgcccQeGHhMR6c,8517
4
4
  rnapolis/common.py,sha256=LY6Uz96Br8ki_gA8LpfatgtvVbt9jOTkwgagayqTgf8,31251
@@ -16,11 +16,11 @@ rnapolis/rfam_folder.py,sha256=SjiiyML_T1__saruFwSMJEoQ7Y55GIU8ktS8ZUn5-fw,11111
16
16
  rnapolis/tertiary.py,sha256=6t9ZB4w33-5n_M3sns1RoFXCOTgVAgGH4WDNG5OG9Kg,23426
17
17
  rnapolis/tertiary_v2.py,sha256=I1uyHWIUePNGO5m-suoL4ibtz02qAJUMvYm0BUKUygY,22480
18
18
  rnapolis/transformer.py,sha256=aC0nBmHHJf5TyLvBIV57Jj3tlwpvHbPo347opfAOlQA,3844
19
- rnapolis/unifier.py,sha256=bXscX3lxeSxT4K1fm2UEURcU9_0JA0HdTbd8ZoHZFAY,5442
19
+ rnapolis/unifier.py,sha256=DR1_IllgaAYT9_FUE6XC9B-2wgqbBHs2D1MjyZT2j2g,5438
20
20
  rnapolis/util.py,sha256=IdquFO3PV1_KDqodjupzm0Rqvgy0CeSzxGHaGEHYXVU,543
21
- rnapolis-0.6.0.dist-info/licenses/LICENSE,sha256=ZGRu12MzCgbYA-Lt8MyBlmjvPZh7xfiD5u5wBx0enq4,1066
22
- rnapolis-0.6.0.dist-info/METADATA,sha256=TcGmjLlYH8jPvWJr48a2ce-UhIIl_dAO_wygm4ZPrKY,54537
23
- rnapolis-0.6.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
24
- rnapolis-0.6.0.dist-info/entry_points.txt,sha256=kS_Ji3_6UaomxkOaYpGHh4aZKaIh9CAfzoexbaS3y50,372
25
- rnapolis-0.6.0.dist-info/top_level.txt,sha256=LcO18koxZcWoJ21KDRRRo_tyIbmXL5z61dPitZpy8yc,9
26
- rnapolis-0.6.0.dist-info/RECORD,,
21
+ rnapolis-0.6.2.dist-info/licenses/LICENSE,sha256=ZGRu12MzCgbYA-Lt8MyBlmjvPZh7xfiD5u5wBx0enq4,1066
22
+ rnapolis-0.6.2.dist-info/METADATA,sha256=2epFKLVBOoNmJHGZSSSF4bNEdOq2eB_KpWKmannB7rY,54537
23
+ rnapolis-0.6.2.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
24
+ rnapolis-0.6.2.dist-info/entry_points.txt,sha256=kS_Ji3_6UaomxkOaYpGHh4aZKaIh9CAfzoexbaS3y50,372
25
+ rnapolis-0.6.2.dist-info/top_level.txt,sha256=LcO18koxZcWoJ21KDRRRo_tyIbmXL5z61dPitZpy8yc,9
26
+ rnapolis-0.6.2.dist-info/RECORD,,