pyaragorn 0.1.0__pp39-pypy39_pp73-win_amd64.whl → 0.2.0__pp39-pypy39_pp73-win_amd64.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.

Potentially problematic release.


This version of pyaragorn might be problematic. Click here for more details.

pyaragorn/lib.pyi ADDED
@@ -0,0 +1,89 @@
1
+ import typing
2
+ from typing import Literal, Union, Generic
3
+ from typing_extensions import Buffer
4
+
5
+ __version__: str
6
+
7
+ ARAGORN_VERSION: str
8
+ TRANSLATION_TABLES: typing.Set[int]
9
+
10
+ class Gene:
11
+ @property
12
+ def type(self) -> str: ...
13
+ @property
14
+ def begin(self) -> int: ...
15
+ @property
16
+ def end(self) -> int: ...
17
+ @property
18
+ def length(self) -> int: ...
19
+ @property
20
+ def strand(self) -> Literal[1, -1]: ...
21
+ @property
22
+ def energy(self) -> float: ...
23
+ def sequence(self) -> str: ...
24
+
25
+ class TRNAGene(Gene):
26
+ @property
27
+ def type(self) -> Literal["tRNA"]: ...
28
+ @property
29
+ def amino_acid(self) -> str: ...
30
+ @property
31
+ def amino_acids(self) -> Union[Tuple[str], Tuple[str, str]]: ...
32
+ @property
33
+ def anticodon(self) -> str: ...
34
+ @property
35
+ def anticodon_offset(self) -> int: ...
36
+ @property
37
+ def anticodon_length(self) -> Literal[2, 3, 4]: ...
38
+
39
+ class TMRNAGene(Gene):
40
+ @property
41
+ def type(self) -> Literal["tmRNA"]: ...
42
+ @property
43
+ def permuted(self) -> bool: ...
44
+ @property
45
+ def orf_offset(self) -> int: ...
46
+ @property
47
+ def orf_length(self) -> int: ...
48
+ def orf(self, include_stop: bool = True) -> str: ...
49
+ def peptide(self, include_stop: bool = True) -> str: ...
50
+
51
+
52
+ class Cursor:
53
+ def __init__(self, obj: Union[str, bytes, bytearray, Buffer]) -> None: ...
54
+
55
+
56
+ G = typing.TypeVar("G", bound=Gene)
57
+
58
+ class RNAFinder(Generic[G]):
59
+ @typing.overload
60
+ def __init__(
61
+ self: RNAFinder[TRNAGene],
62
+ translation_table: int = 1,
63
+ *,
64
+ tmrna: Literal[False],
65
+ trna: Literal[True] = True,
66
+ linear: bool = False,
67
+ ) -> None: ...
68
+ @typing.overload
69
+ def __init__(
70
+ self: RNAFinder[TMRNAGene],
71
+ translation_table: int = 1,
72
+ *,
73
+ trna: Literal[False],
74
+ tmrna: Literal[True] = True,
75
+ linear: bool = False,
76
+ ) -> None: ...
77
+ @typing.overload
78
+ def __init__(
79
+ self: RNAFinder[Union[TRNAGene, TMRNAGene]],
80
+ translation_table: int = 1,
81
+ *,
82
+ trna: bool = True,
83
+ tmrna: bool = True,
84
+ linear: bool = False,
85
+ ) -> None: ...
86
+ def find_rna(
87
+ self,
88
+ sequence: Union[str, bytes, bytearray, Buffer],
89
+ ) -> List[G]: ...
Binary file
pyaragorn/lib.pyx CHANGED
@@ -204,12 +204,29 @@ cdef class TRNAGene(Gene):
204
204
 
205
205
  @property
206
206
  def amino_acid(self):
207
- """`str` or (`str`, `str`): The 3-letter amino-acid(s) for this gene.
207
+ """`str`: The 3-letter amino-acid(s) for this gene.
208
208
 
209
209
  Hint:
210
- A single string is given if the anticodon loop was identified
211
- with exactly 3 nucleotides. Otherwise, this property stores
212
- a pair of amino-acids.
210
+ If the anticodon loop contains 6 or 8 bases, ``???`` is
211
+ returned.
212
+
213
+ """
214
+ cdef csw sw
215
+ cdef int* s = self._gene.seq + self._gene.anticodon
216
+ (<int*> &sw.geneticcode)[0] = self._genetic_code
217
+ if self._gene.cloop == 6 or self._gene.cloop == 8:
218
+ return "???"
219
+ else:
220
+ return aragorn.aa(s, &sw).decode('ascii')
221
+
222
+ @property
223
+ def amino_acids(self):
224
+ """`tuple` of `str`: All possible 3-letter amino-acids for this gene.
225
+
226
+ Hint:
227
+ If the anticodon loop contains 6 or 8 bases, a tuple of two
228
+ amino-acid is returned, otherwise a tuple with a single element
229
+ is returned.
213
230
 
214
231
  """
215
232
  cdef csw sw
@@ -277,14 +294,20 @@ cdef class TMRNAGene(Gene):
277
294
  """
278
295
 
279
296
  @property
280
- def cds_offset(self):
281
- """`int`: The offset in the gene at which the coding sequence starts.
297
+ def permuted(self):
298
+ """`bool`: Whether this tmRNA gene is a permuted gene.
299
+ """
300
+ return self._gene.asst != 0
301
+
302
+ @property
303
+ def orf_offset(self):
304
+ """`int`: The offset in the gene at which the open-reading frame starts.
282
305
  """
283
306
  return self._gene.tps + 1
284
307
 
285
308
  @property
286
- def cds_length(self):
287
- """`int`: The length of the coding sequence (in nucleotides).
309
+ def orf_length(self):
310
+ """`int`: The length of the open-reading frame (in nucleotides).
288
311
  """
289
312
  cdef int tpe = self._gene.tpe
290
313
  cdef int* se = (self._gene.eseq + tpe) + 1
@@ -300,8 +323,8 @@ cdef class TMRNAGene(Gene):
300
323
 
301
324
  return tpe - self._gene.tps
302
325
 
303
- def cds(self, include_stop=True):
304
- """Retrieve the coding sequence of the mRNA-like region.
326
+ def orf(self, include_stop=True):
327
+ """Retrieve the open-reading frame of the mRNA-like region.
305
328
 
306
329
  Arguments:
307
330
  include_stop (`bool`): Whether or not to include the STOP codons
@@ -481,7 +504,7 @@ cdef class RNAFinder:
481
504
 
482
505
  Returns:
483
506
  `list` of `~pyaragorn.Gene`: A list of `~pyaragorn.Gene` (either
484
- `~pyaragorn.TRNAGene` or `~pyaragorn.TMRNAGene`) corresponding
507
+ `~pyaragorn.TRNAGene` or `~pyaragorn.TMRNAGene`) corresponding
485
508
  to RNA genes detected in the sequence according to the `RNAFinder`
486
509
  parameters.
487
510
 
pyaragorn/py.typed ADDED
File without changes
@@ -46,11 +46,11 @@ class TestRNAFinder(unittest.TestCase):
46
46
  self.assertEqual(gene.sequence().lower(), seq)
47
47
  elif gene.type == "tmRNA":
48
48
  matched = _TMRNA_RX.match(result)
49
- _, complement, begin, end, energy, cds_start, cds_end, peptide = matched.groups()
49
+ _, complement, begin, end, energy, orf_start, orf_end, peptide = matched.groups()
50
50
  self.assertEqual(gene.begin, int(begin))
51
51
  self.assertEqual(gene.end, int(end))
52
- self.assertEqual(gene.cds_offset, int(cds_start))
53
- self.assertEqual(gene.cds_offset + gene.cds_length, int(cds_end))
52
+ self.assertEqual(gene.orf_offset, int(orf_start))
53
+ self.assertEqual(gene.orf_offset + gene.orf_length, int(orf_end))
54
54
  self.assertEqual(gene.peptide(), peptide)
55
55
  self.assertEqual(gene.strand, -1 if complement == "c" else +1)
56
56
  self.assertAlmostEqual(gene.energy, float(energy), places=1)
@@ -66,4 +66,4 @@ class TestRNAFinder(unittest.TestCase):
66
66
  record = data.load_record("CP001621.fna.gz")
67
67
  finder = RNAFinder(translation_table=11, tmrna=True, trna=False)
68
68
  for gene in finder.find_rna(str(record.seq)):
69
- self.assertIsInstance(gene, TMRNAGene)
69
+ self.assertIsInstance(gene, TMRNAGene)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pyaragorn
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: Cython bindings and Python interface to ARAGORN, a tRNA and mtRNA detection software.
5
5
  Keywords: bioinformatics,gene,transfer,messenger,RNA
6
6
  Author-Email: Martin Larralde <martin.larralde@embl.de>
@@ -697,6 +697,7 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
697
697
  Classifier: Programming Language :: Python :: Implementation :: PyPy
698
698
  Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
699
699
  Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
700
+ Classifier: Typing :: Typed
700
701
  Project-URL: Documentation, https://pyaragorn.readthedocs.io/en/stable/
701
702
  Project-URL: Bug Tracker, https://github.com/althonos/pyaragorn/issues
702
703
  Project-URL: Changelog, https://github.com/althonos/pyaragorn/blob/master/CHANGELOG.md
@@ -1,7 +1,9 @@
1
1
  pyaragorn/__init__.py,sha256=yk11uoNKEEy1QI8XtudgwKJh7mAUdC-SH6RXUh0-x3A,872
2
2
  pyaragorn/CMakeLists.txt,sha256=Kv6Kqg594zByfDsm_usgax9nTlF6PtciSTtUcUe2QHs,35
3
- pyaragorn/lib.pypy39-pp73-win_amd64.pyd,sha256=F50-SdYfc5j4uw9rWKKO_lrQYJROYhdDGIa1wi02xKg,462848
4
- pyaragorn/lib.pyx,sha256=-J2T0SXAz_2hNVSg5QUt5JxC1-52iSSEoYuzVn0bFy4,24060
3
+ pyaragorn/lib.pyi,sha256=ylr2aKYkmrA3emLY6EVdn2fLmTogKbOkkgRUY3WHHpc,2331
4
+ pyaragorn/lib.pypy39-pp73-win_amd64.pyd,sha256=SCDRJCDnjfaKR7AiHQQVBQeqAw6VCFbY4lMeOa1aaiI,463872
5
+ pyaragorn/lib.pyx,sha256=dO5cTTcBhFEffDQhg3Nw5QeRnyaW8vGvgAvo86RsJwA,24742
6
+ pyaragorn/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
7
  pyaragorn/tests/__init__.py,sha256=A_IoY00uMA3HQ7Qjorm5Pr2Tg7n3J2lnCzJyiCAW4lY,242
6
8
  pyaragorn/tests/data/__init__.py,sha256=JnSWGIo3ThkKlbZLTFxP-fVBxSTN4Yw5YAzQqa_IpXM,705
7
9
  pyaragorn/tests/data/CP001621.default.txt,sha256=40AQzlXhPr9mXrryFw0Nc67REf3MLZ2BNHG-7CRQvAU,6874
@@ -9,8 +11,8 @@ pyaragorn/tests/data/CP001621.fna.gz,sha256=dSAI3T64jSevuR4p0JXBNaTmMlCRsbbY6bCC
9
11
  pyaragorn/tests/fasta.py,sha256=Ocgd_9WusRLFVBxt9ZViNNhT9yr8S5-BlVJi5GkSUuQ,2826
10
12
  pyaragorn/tests/requirements.txt,sha256=uy1xEQvsQwXz38J-DhiHWzGmgxiJMlbNuz_M2jvifDI,46
11
13
  pyaragorn/tests/test_doctest.py,sha256=TMtD6iAGDRbaRJFSsTlLAxm-FR02FAfVFFCsOR_7hao,3235
12
- pyaragorn/tests/test_rna_finder.py,sha256=9lLCfAv9FmxFTC06Wb7RP-2h-1TP_utxm2oqUINNu5Y,3283
13
- pyaragorn-0.1.0.dist-info/METADATA,sha256=wbtQTwEEy23vYJQEVezQIaEB6Z405rxwf-cDW8DGzpg,51735
14
- pyaragorn-0.1.0.dist-info/WHEEL,sha256=kmyLEt6PTDdepfBWae_IEheSXQSU1loiwfrmHYbmDtI,111
15
- pyaragorn-0.1.0.dist-info/licenses/COPYING,sha256=lE9DJUN_D0B-V6xgf_SX0xjldzX1TGs1xKyMvBdnWCM,35822
16
- pyaragorn-0.1.0.dist-info/RECORD,,
14
+ pyaragorn/tests/test_rna_finder.py,sha256=SnEJw_4mc1Nv2RvT34PIcMeN-qDRQRw2IraChy-HEZ0,3285
15
+ pyaragorn-0.2.0.dist-info/METADATA,sha256=TpQ3g48XDRhyyQl37Cs6_IQ2AIyJB9bEMOLuvq5RIT4,51763
16
+ pyaragorn-0.2.0.dist-info/WHEEL,sha256=F_HDvWacHASfq-j7PPZd4zU82nzVm_VIZzDXcalXAG0,111
17
+ pyaragorn-0.2.0.dist-info/licenses/COPYING,sha256=lE9DJUN_D0B-V6xgf_SX0xjldzX1TGs1xKyMvBdnWCM,35822
18
+ pyaragorn-0.2.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: scikit-build-core 0.11.3
2
+ Generator: scikit-build-core 0.11.4
3
3
  Root-Is-Purelib: false
4
4
  Tag: pp39-pypy39_pp73-win_amd64
5
5