RNApolis 0.8.2__py3-none-any.whl → 0.8.3__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/tertiary_v2.py CHANGED
@@ -121,7 +121,9 @@ class Structure:
121
121
  groupby_cols.append("pdbx_PDB_ins_code")
122
122
 
123
123
  # Group atoms by residue
124
- grouped = self.atoms.groupby(groupby_cols, dropna=False, observed=False)
124
+ grouped = self.atoms.groupby(
125
+ groupby_cols, dropna=False, observed=False, sort=False
126
+ )
125
127
 
126
128
  else:
127
129
  # For unknown formats, return an empty list
@@ -495,6 +497,37 @@ class Residue:
495
497
  return Atom(atoms_df.iloc[0], self.format)
496
498
  return None
497
499
 
500
+ @cached_property
501
+ def is_nucleotide(self) -> bool:
502
+ """
503
+ Check if this residue is a nucleotide.
504
+
505
+ A nucleotide is identified by the presence of specific atoms:
506
+ - Sugar atoms: C1', C2', C3', C4', O4'
507
+ - Base atoms: N1, C2, N3, C4, C5, C6
508
+
509
+ Returns:
510
+ --------
511
+ bool
512
+ True if the residue is a nucleotide, False otherwise
513
+ """
514
+ # Early check: if less than 11 atoms, can't be a nucleotide
515
+ if len(self.atoms) < 11:
516
+ return False
517
+
518
+ # Required sugar atoms
519
+ sugar_atoms = ["C1'", "C2'", "C3'", "C4'", "O4'"]
520
+
521
+ # Required base atoms
522
+ base_atoms = ["N1", "C2", "N3", "C4", "C5", "C6"]
523
+
524
+ # Check for all required atoms
525
+ for atom_name in sugar_atoms + base_atoms:
526
+ if self.find_atom(atom_name) is None:
527
+ return False
528
+
529
+ return True
530
+
498
531
  def is_connected(self, next_residue_candidate: "Residue") -> bool:
499
532
  """
500
533
  Check if this residue is connected to the next residue candidate.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: RNApolis
3
- Version: 0.8.2
3
+ Version: 0.8.3
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
@@ -16,13 +16,13 @@ rnapolis/parser_v2.py,sha256=qG6CO3or7zmuJu368g9Nzokiqdeip4yjD14F163uH6w,40618
16
16
  rnapolis/rfam_folder.py,sha256=SjiiyML_T1__saruFwSMJEoQ7Y55GIU8ktS8ZUn5-fw,11111
17
17
  rnapolis/splitter.py,sha256=x-Zn21mkiMgvYPptUFD9BbdNIvoaM6b8GzGf6uYXEwE,4052
18
18
  rnapolis/tertiary.py,sha256=mTVpz8rz5Q9s5_QVSMdEMXSooCce0rAD5RQMh00bHm4,39200
19
- rnapolis/tertiary_v2.py,sha256=I1uyHWIUePNGO5m-suoL4ibtz02qAJUMvYm0BUKUygY,22480
19
+ rnapolis/tertiary_v2.py,sha256=y7Rh43Jzt9QU6wCa1wAHIcO3BcNQY83PbbWNTmqI8zM,23424
20
20
  rnapolis/transformer.py,sha256=aC0nBmHHJf5TyLvBIV57Jj3tlwpvHbPo347opfAOlQA,3844
21
21
  rnapolis/unifier.py,sha256=2ge7IB9FdRgzSAiVD39U_ciwtdDJ2fGzf8mUIudbrqY,5820
22
22
  rnapolis/util.py,sha256=IdquFO3PV1_KDqodjupzm0Rqvgy0CeSzxGHaGEHYXVU,543
23
- rnapolis-0.8.2.dist-info/licenses/LICENSE,sha256=ZGRu12MzCgbYA-Lt8MyBlmjvPZh7xfiD5u5wBx0enq4,1066
24
- rnapolis-0.8.2.dist-info/METADATA,sha256=1_ITZKV6JF324k9MawJIQCYH1VI8fQffIp9IRquKwnE,54537
25
- rnapolis-0.8.2.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
26
- rnapolis-0.8.2.dist-info/entry_points.txt,sha256=H00KoN54wU3dFOofAu3H_3PADmZOBTB1hXf5TUU2uzo,438
27
- rnapolis-0.8.2.dist-info/top_level.txt,sha256=LcO18koxZcWoJ21KDRRRo_tyIbmXL5z61dPitZpy8yc,9
28
- rnapolis-0.8.2.dist-info/RECORD,,
23
+ rnapolis-0.8.3.dist-info/licenses/LICENSE,sha256=ZGRu12MzCgbYA-Lt8MyBlmjvPZh7xfiD5u5wBx0enq4,1066
24
+ rnapolis-0.8.3.dist-info/METADATA,sha256=qdVlCdQ9zj6-qb8EXVVnhbCD7TJEUtF51LZN7VIx658,54537
25
+ rnapolis-0.8.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
26
+ rnapolis-0.8.3.dist-info/entry_points.txt,sha256=H00KoN54wU3dFOofAu3H_3PADmZOBTB1hXf5TUU2uzo,438
27
+ rnapolis-0.8.3.dist-info/top_level.txt,sha256=LcO18koxZcWoJ21KDRRRo_tyIbmXL5z61dPitZpy8yc,9
28
+ rnapolis-0.8.3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.1.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5