cool-seq-tool 0.3.0.dev0__py3-none-any.whl → 0.4.0.dev0__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.
cool_seq_tool/utils.py CHANGED
@@ -1,7 +1,7 @@
1
- """Module for common utilities used throughout the app"""
1
+ """Provide a small set of general helper functions."""
2
2
  import logging
3
3
  from datetime import datetime
4
- from typing import Optional, Tuple
4
+ from typing import Tuple
5
5
 
6
6
  from cool_seq_tool.schemas import ResidueMode, ServiceMeta
7
7
  from cool_seq_tool.version import __version__
@@ -10,38 +10,36 @@ logger = logging.getLogger(__name__)
10
10
 
11
11
 
12
12
  def get_inter_residue_pos(
13
- start_pos: int, residue_mode: ResidueMode, end_pos: Optional[int] = None
14
- ) -> Tuple[Optional[Tuple[int, int]], Optional[str]]:
15
- """Return inter-residue position
13
+ start_pos: int, end_pos: int, residue_mode: ResidueMode
14
+ ) -> Tuple[int, int]:
15
+ """Return equivalent inter-residue position.
16
+
17
+ Generally, we prefer to work with inter-residue coordinates where possible. Our
18
+ rationale is detailed in an appendix to the
19
+ `VRS docs <https://vrs.ga4gh.org/en/stable/appendices/design_decisions.html#inter-residue-coordinates>`_.
20
+ This function is used internally to shift user-provided coordinates accordingly.
21
+
22
+ >>> from cool_seq_tool.utils import get_inter_residue_pos
23
+ >>> from cool_seq_tool.schemas import ResidueMode
24
+ >>> get_inter_residue_pos(10, ResidueMode.RESIDUE)
25
+ ((9, 9), None)
16
26
 
17
27
  :param start_pos: Start position
28
+ :param end_pos: End position
18
29
  :param residue_mode: Residue mode for `start_pos` and `end_pos`
19
- :param end_pos: End position. If `None` assumes both `start` and `end` have same
20
- values.
21
- :return: Inter-residue coordinates, warning
30
+ :return: Inter-residue coordinates
22
31
  """
23
32
  if residue_mode == ResidueMode.RESIDUE:
24
33
  start_pos -= 1
25
- if end_pos is None:
26
- end_pos = start_pos
27
- else:
28
- end_pos -= 1
29
- elif residue_mode == ResidueMode.INTER_RESIDUE:
30
- if end_pos is None:
31
- end_pos = start_pos
32
- else:
33
- msg = (
34
- f"residue_mode must be either `residue` or `inter-residue`,"
35
- f" not `{residue_mode}`"
36
- )
37
- logger.warning(msg)
38
- return None, msg
39
- return (start_pos, end_pos), None
34
+ elif residue_mode == ResidueMode.ZERO:
35
+ end_pos += 1
36
+ return start_pos, end_pos
40
37
 
41
38
 
42
39
  @staticmethod
43
40
  def service_meta() -> ServiceMeta:
44
- """Return ServiceMeta for cool_seq_tool
41
+ """Return description of request and service, including parameters like software
42
+ version for reproducibility.
45
43
 
46
44
  :return: ServiceMeta object
47
45
  """
cool_seq_tool/version.py CHANGED
@@ -1,2 +1,2 @@
1
1
  """Define package version."""
2
- __version__ = "0.3.0-dev0"
2
+ __version__ = "0.4.0-dev0"
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2021 VICC
3
+ Copyright (c) 2021-2023 Wagner Lab
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -0,0 +1,130 @@
1
+ Metadata-Version: 2.1
2
+ Name: cool_seq_tool
3
+ Version: 0.4.0.dev0
4
+ Summary: Common Operation on Lots of Sequences Tool
5
+ Author: Kori Kuzma, James Stevenson, Katie Stahl, Alex Wagner
6
+ License: MIT License
7
+
8
+ Copyright (c) 2021-2023 Wagner Lab
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/genomicmedlab/cool-seq-tool
29
+ Project-URL: Documentation, https://coolseqtool.readthedocs.io/en/latest/index.html
30
+ Project-URL: Changelog, https://github.com/genomicmedlab/cool-seq-tool/releases
31
+ Project-URL: Source, https://github.com/genomicmedlab/cool-seq-tool
32
+ Project-URL: Bug Tracker, https://github.com/genomicmedlab/cool-seq-tool/issues
33
+ Classifier: Development Status :: 3 - Alpha
34
+ Classifier: Framework :: FastAPI
35
+ Classifier: Framework :: Pydantic
36
+ Classifier: Framework :: Pydantic :: 2
37
+ Classifier: Intended Audience :: Science/Research
38
+ Classifier: Intended Audience :: Developers
39
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
40
+ Classifier: License :: OSI Approved :: MIT License
41
+ Classifier: Programming Language :: Python :: 3
42
+ Classifier: Programming Language :: Python :: 3.8
43
+ Classifier: Programming Language :: Python :: 3.9
44
+ Classifier: Programming Language :: Python :: 3.10
45
+ Classifier: Programming Language :: Python :: 3.11
46
+ Requires-Python: >=3.8
47
+ Description-Content-Type: text/markdown
48
+ License-File: LICENSE
49
+ Requires-Dist: asyncpg
50
+ Requires-Dist: aiofiles
51
+ Requires-Dist: boto3
52
+ Requires-Dist: pyliftover
53
+ Requires-Dist: polars
54
+ Requires-Dist: hgvs
55
+ Requires-Dist: biocommons.seqrepo
56
+ Requires-Dist: pydantic ==2.*
57
+ Requires-Dist: uvicorn
58
+ Requires-Dist: fastapi
59
+ Requires-Dist: ga4gh.vrs
60
+ Provides-Extra: dev
61
+ Requires-Dist: pre-commit ; extra == 'dev'
62
+ Requires-Dist: ipython ; extra == 'dev'
63
+ Requires-Dist: ipykernel ; extra == 'dev'
64
+ Requires-Dist: psycopg2-binary ; extra == 'dev'
65
+ Requires-Dist: ruff ; extra == 'dev'
66
+ Provides-Extra: docs
67
+ Requires-Dist: sphinx ==6.1.3 ; extra == 'docs'
68
+ Requires-Dist: sphinx-autodoc-typehints ==1.22.0 ; extra == 'docs'
69
+ Requires-Dist: sphinx-autobuild ==2021.3.14 ; extra == 'docs'
70
+ Requires-Dist: sphinx-copybutton ==0.5.2 ; extra == 'docs'
71
+ Requires-Dist: sphinxext-opengraph ==0.8.2 ; extra == 'docs'
72
+ Requires-Dist: furo ==2023.3.27 ; extra == 'docs'
73
+ Provides-Extra: tests
74
+ Requires-Dist: pytest ; extra == 'tests'
75
+ Requires-Dist: pytest-cov ; extra == 'tests'
76
+ Requires-Dist: pytest-asyncio ==0.18.3 ; extra == 'tests'
77
+ Requires-Dist: mock ; extra == 'tests'
78
+
79
+ <h1 align="center">
80
+ CoolSeqTool
81
+ </h1>
82
+
83
+ **[Documentation](https://coolseqtool.readthedocs.io/en/latest/)** · [Installation](https://coolseqtool.readthedocs.io/en/latest/install.html) · [Usage](https://coolseqtool.readthedocs.io/en/latest/usage.html) · [API reference](https://coolseqtool.readthedocs.io/en/latest/reference/index.html)
84
+
85
+ ## Overview
86
+
87
+ <!-- description -->
88
+ The **CoolSeqTool** provides:
89
+
90
+ - A Pythonic API on top of sequence data of interest to tertiary analysis tools, including mappings between gene names and transcripts, [MANE transcript](https://www.ncbi.nlm.nih.gov/refseq/MANE/) descriptions, and the [Universal Transcript Archive](https://github.com/biocommons/uta)
91
+ - Augmented access to the [SeqRepo](https://github.com/biocommons/biocommons.seqrepo) database, including multiple additional methods and tools
92
+ - Mapping tools that combine the above to support translation between references sequences, annotation layers, and MANE transcripts
93
+ <!-- /description -->
94
+
95
+ ---
96
+
97
+ ## Install
98
+
99
+ CoolSeqTool is available on [PyPI](https://pypi.org/project/cool-seq-tool)
100
+
101
+ ```shell
102
+ python3 -m pip install cool-seq-tool
103
+ ```
104
+
105
+ See the [installation instructions](https://coolseqtool.readthedocs.io/en/latest/install.html) in the documentation for a description of dependency setup requirements.
106
+
107
+ ---
108
+
109
+ ## Usage
110
+
111
+ All CoolSeqTool resources can be initialized by way of a top-level class instance:
112
+
113
+ ```pycon
114
+ >>> from cool_seq_tool.app import CoolSeqTool
115
+ >>> cst = CoolSeqTool()
116
+ >>> result = await cst.mane_transcript.get_mane_transcript(
117
+ ... "NP_004324.2",
118
+ ... 599,
119
+ ... AnnotationLayer.PROTEIN,
120
+ ... residue_mode=ResidueMode.INTER_RESIDUE,
121
+ ... )
122
+ >>> result.gene, result.refseq, result.status
123
+ ('EGFR', 'NM_005228.5', <TranscriptPriority.MANE_SELECT: 'mane_select'>)
124
+ ```
125
+
126
+ ---
127
+
128
+ ## Feedback and contributing
129
+
130
+ We welcome bug reports, feature requests, and code contributions from users and interested collaborators. The [documentation](https://coolseqtool.readthedocs.io/en/latest/contributing.html) contains guidance for submitting feedback and contributing new code.
@@ -0,0 +1,28 @@
1
+ cool_seq_tool/__init__.py,sha256=eBycAZIAJBCf51xQLQYHzvUep1i21LMrzBdRLqfe-Fc,352
2
+ cool_seq_tool/api.py,sha256=3Pc0j0pHMZ_3skTkjDlQpcu_MM6kyNPmBrwm_LrH-rw,1234
3
+ cool_seq_tool/app.py,sha256=3r2hlajW6xjf3u_Uf9WlqMfBEK-LnB74sG2UpJlj2bY,3757
4
+ cool_seq_tool/paths.py,sha256=7EA21Vmf9hvct0z_V4oK0WTWOA2FKY2Tavh4nAUXunk,889
5
+ cool_seq_tool/schemas.py,sha256=miroNMyC1i6I4OuMZwJ0WQq3dBhtvuYPsMevahWQI5k,15697
6
+ cool_seq_tool/utils.py,sha256=EkDFKh6allYu_BaODuosALECm8z64JiovXC8yHd2kHY,1583
7
+ cool_seq_tool/version.py,sha256=oK55nJ9D6xds7DToZvO-yJpELmtJeKT4qzifJctV4_w,57
8
+ cool_seq_tool/data/__init__.py,sha256=EAk0f_xeq1JAkRosLMiWWhEXku6lYfMZ63HR_6QxSqs,77
9
+ cool_seq_tool/data/data_downloads.py,sha256=Jlt9YYxkJdUuDwXmuRheZ7D4deArlYLQUNsr4CQwYNE,3747
10
+ cool_seq_tool/handlers/__init__.py,sha256=xDQ84N4ImrUBKwGmrg64yGUMh0ArW-DwjJuTkKrIJL4,77
11
+ cool_seq_tool/handlers/seqrepo_access.py,sha256=JVkfMnRMiNtsZOqsXZYgGT6XhtXTti6qw7MINj3Rwmc,9065
12
+ cool_seq_tool/mappers/__init__.py,sha256=5aE6IRTG8SwOofFR19QHmK-1n2PaKwEPzFGNE0_HS3s,261
13
+ cool_seq_tool/mappers/alignment.py,sha256=htGb9rJab8dAKcMR62NF0uGc5l4KROrMcMAKfSQhva0,9620
14
+ cool_seq_tool/mappers/exon_genomic_coords.py,sha256=BH3BIEUOrccjtqVxlkl-LQt5f8BXCvFmCJfVfb5qgYI,30863
15
+ cool_seq_tool/mappers/mane_transcript.py,sha256=h7J4ip9HPhVvADqvWp5ZGT9257xymVkSJ3vj3YRzIws,49359
16
+ cool_seq_tool/routers/__init__.py,sha256=x00Dq0LzqYoBPbipmyexLbAMUb7Udx8DozfwT-mJo1E,436
17
+ cool_seq_tool/routers/default.py,sha256=F9NDKv7oiEz7Yk9BKAqhJxTBELpYLDhOqB8keRVtYkU,3937
18
+ cool_seq_tool/routers/mane.py,sha256=CKXAwIQOyfEhEiRCVMqzDesbijkUIFnvxx8mKPyxDXk,3547
19
+ cool_seq_tool/routers/mappings.py,sha256=I9hxriBlkv9vQp1l_17L-VxQSUJ9-IyLyqwXGue4axg,6091
20
+ cool_seq_tool/sources/__init__.py,sha256=lERBM8cOqlJhYqz_DwOMV5FsWvMvQMbU1KQBxx_cz6M,303
21
+ cool_seq_tool/sources/mane_transcript_mappings.py,sha256=Bah16WhfBk3Def3ehYvccR13lO90f8Bib8rj8zbszVs,3753
22
+ cool_seq_tool/sources/transcript_mappings.py,sha256=Gz1PCf54RDApY5QfZqP8vm4iHCHLv-Ar4cy5Dj4cAe4,9797
23
+ cool_seq_tool/sources/uta_database.py,sha256=DYAH0oxxURyRbeRLlD3AQOi4BiTIlZbzsI05Lt6x68Y,44007
24
+ cool_seq_tool-0.4.0.dev0.dist-info/LICENSE,sha256=1jbnPcw_qmlDZyD_E_ebjWwjIvBgOD-1biodvBtSl1U,1072
25
+ cool_seq_tool-0.4.0.dev0.dist-info/METADATA,sha256=EmJa1j_SQphcINJpnnnEzftokXx9Py_F8L6cnGI6cwY,5658
26
+ cool_seq_tool-0.4.0.dev0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
27
+ cool_seq_tool-0.4.0.dev0.dist-info/top_level.txt,sha256=cGuxdN6p3y16jQf6hCwWhE4OptwUeZPm_PNJlPb3b0k,14
28
+ cool_seq_tool-0.4.0.dev0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.41.2)
2
+ Generator: bdist_wheel (0.42.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5