cool-seq-tool 0.8.0__py3-none-any.whl → 0.9.0__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.
@@ -1169,14 +1169,32 @@ class ExonGenomicCoordsMapper:
1169
1169
  :param end: Genomic coordinate of breakpoint
1170
1170
  :return: Exon number corresponding to adjacent exon. Will be 0-based
1171
1171
  """
1172
- for i in range(len(tx_exons_genomic_coords) - 1):
1172
+ # If a transcript has only one exon, return 0
1173
+ if len(tx_exons_genomic_coords) == 1:
1174
+ return 0
1175
+
1176
+ # Check if a breakpoint occurs before/after the transcript boundaries
1177
+ bp = start if start else end
1178
+ exon_list_len = len(tx_exons_genomic_coords) - 1
1179
+
1180
+ if strand == Strand.POSITIVE:
1181
+ if bp < tx_exons_genomic_coords[0].alt_start_i:
1182
+ return 0
1183
+ if bp > tx_exons_genomic_coords[exon_list_len].alt_end_i:
1184
+ return exon_list_len
1185
+ if strand == Strand.NEGATIVE:
1186
+ if bp > tx_exons_genomic_coords[0].alt_end_i:
1187
+ return 0
1188
+ if bp < tx_exons_genomic_coords[exon_list_len].alt_start_i:
1189
+ return exon_list_len
1190
+
1191
+ for i in range(exon_list_len):
1173
1192
  exon = tx_exons_genomic_coords[i]
1174
1193
  if start == exon.alt_start_i:
1175
1194
  break
1176
1195
  if end == exon.alt_end_i:
1177
1196
  break
1178
1197
  next_exon = tx_exons_genomic_coords[i + 1]
1179
- bp = start if start else end
1180
1198
  if strand == Strand.POSITIVE:
1181
1199
  lte_exon = exon
1182
1200
  gte_exon = next_exon
@@ -1185,6 +1203,7 @@ class ExonGenomicCoordsMapper:
1185
1203
  gte_exon = exon
1186
1204
  if bp >= lte_exon.alt_end_i and bp <= gte_exon.alt_start_i:
1187
1205
  break
1206
+
1188
1207
  # Return current exon if end position is provided, next exon if start position
1189
1208
  # is provided.
1190
1209
  return exon.ord if end else exon.ord + 1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cool_seq_tool
3
- Version: 0.8.0
3
+ Version: 0.9.0
4
4
  Summary: Common Operation on Lots of Sequences Tool
5
5
  Author: Kori Kuzma, James Stevenson, Katie Stahl, Alex Wagner
6
6
  License: MIT License
@@ -47,39 +47,39 @@ License-File: LICENSE
47
47
  Requires-Dist: asyncpg
48
48
  Requires-Dist: aiofiles
49
49
  Requires-Dist: boto3
50
- Requires-Dist: agct >=0.1.0-dev1
51
- Requires-Dist: polars ~=1.0
50
+ Requires-Dist: agct>=0.1.0-dev1
51
+ Requires-Dist: polars~=1.0
52
52
  Requires-Dist: hgvs
53
53
  Requires-Dist: biocommons.seqrepo
54
- Requires-Dist: pydantic ==2.*
55
- Requires-Dist: ga4gh.vrs ~=2.0.0a10
56
- Requires-Dist: wags-tails ~=0.1.3
54
+ Requires-Dist: pydantic==2.*
55
+ Requires-Dist: ga4gh.vrs~=2.0.0a10
56
+ Requires-Dist: wags-tails~=0.2.2
57
57
  Requires-Dist: bioutils
58
58
  Provides-Extra: dev
59
- Requires-Dist: pre-commit >=3.7.1 ; extra == 'dev'
60
- Requires-Dist: ipython ; extra == 'dev'
61
- Requires-Dist: ipykernel ; extra == 'dev'
62
- Requires-Dist: psycopg2-binary ; extra == 'dev'
63
- Requires-Dist: ruff ==0.5.0 ; extra == 'dev'
59
+ Requires-Dist: pre-commit>=3.7.1; extra == "dev"
60
+ Requires-Dist: ipython; extra == "dev"
61
+ Requires-Dist: ipykernel; extra == "dev"
62
+ Requires-Dist: psycopg2-binary; extra == "dev"
63
+ Requires-Dist: ruff==0.5.0; extra == "dev"
64
+ Provides-Extra: tests
65
+ Requires-Dist: pytest; extra == "tests"
66
+ Requires-Dist: pytest-cov; extra == "tests"
67
+ Requires-Dist: pytest-asyncio==0.18.3; extra == "tests"
68
+ Requires-Dist: mock; extra == "tests"
64
69
  Provides-Extra: docs
65
- Requires-Dist: sphinx ==6.1.3 ; extra == 'docs'
66
- Requires-Dist: sphinx-autodoc-typehints ==1.22.0 ; extra == 'docs'
67
- Requires-Dist: sphinx-autobuild ==2021.3.14 ; extra == 'docs'
68
- Requires-Dist: sphinx-copybutton ==0.5.2 ; extra == 'docs'
69
- Requires-Dist: sphinxext-opengraph ==0.8.2 ; extra == 'docs'
70
- Requires-Dist: furo ==2023.3.27 ; extra == 'docs'
71
- Requires-Dist: sphinx-github-changelog ==1.2.1 ; extra == 'docs'
72
- Provides-Extra: test
73
- Requires-Dist: pytest ; extra == 'test'
74
- Requires-Dist: pytest-cov ; extra == 'test'
75
- Requires-Dist: pytest-asyncio ==0.18.3 ; extra == 'test'
76
- Requires-Dist: mock ; extra == 'test'
70
+ Requires-Dist: sphinx==6.1.3; extra == "docs"
71
+ Requires-Dist: sphinx-autodoc-typehints==1.22.0; extra == "docs"
72
+ Requires-Dist: sphinx-autobuild==2021.3.14; extra == "docs"
73
+ Requires-Dist: sphinx-copybutton==0.5.2; extra == "docs"
74
+ Requires-Dist: sphinxext-opengraph==0.8.2; extra == "docs"
75
+ Requires-Dist: furo==2023.3.27; extra == "docs"
76
+ Requires-Dist: sphinx-github-changelog==1.2.1; extra == "docs"
77
77
 
78
78
  <h1 align="center">
79
- CoolSeqTool
79
+ Cool-Seq-Tool
80
80
  </h1>
81
81
 
82
- [![image](https://img.shields.io/pypi/v/cool-seq-tool.svg)](https://pypi.python.org/pypi/cool-seq-tool) [![image](https://img.shields.io/pypi/l/cool-seq-tool.svg)](https://pypi.python.org/pypi/cool-seq-tool) [![image](https://img.shields.io/pypi/pyversions/cool-seq-tool.svg)](https://pypi.python.org/pypi/cool-seq-tool) [![Actions status](https://github.com/genomicmedlab/cool-seq-tool/actions/workflows/checks.yaml/badge.svg)](https://github.com/genomicmedlab/cool-seq-tool/actions/checks.yaml)
82
+ [![image](https://img.shields.io/pypi/v/cool-seq-tool.svg)](https://pypi.python.org/pypi/cool-seq-tool) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.14007783.svg)](https://doi.org/10.5281/zenodo.14007783) [![image](https://img.shields.io/pypi/l/cool-seq-tool.svg)](https://pypi.python.org/pypi/cool-seq-tool) [![image](https://img.shields.io/pypi/pyversions/cool-seq-tool.svg)](https://pypi.python.org/pypi/cool-seq-tool) [![Actions status](https://github.com/genomicmedlab/cool-seq-tool/actions/workflows/checks.yaml/badge.svg)](https://github.com/genomicmedlab/cool-seq-tool/actions/checks.yaml)
83
83
 
84
84
  ---
85
85
 
@@ -90,18 +90,18 @@ CoolSeqTool
90
90
  ## Overview
91
91
 
92
92
  <!-- description -->
93
- The **CoolSeqTool** provides:
93
+ The Common Operations On Lots-Of Sequences Tool, **Cool-Seq-Tool**, provides:
94
94
 
95
- - 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)
96
- - Augmented access to the [SeqRepo](https://github.com/biocommons/biocommons.seqrepo) database, including multiple additional methods and tools
97
- - Mapping tools that combine the above to support translation between references sequences, annotation layers, and MANE transcripts
95
+ - 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 transcript alignment data from the [Universal Transcript Archive](https://github.com/biocommons/uta)
96
+ - Augmented access to the [SeqRepo](https://github.com/biocommons/biocommons.seqrepo) database, including multiple additional methods and tools
97
+ - Mapping tools, including a transcript selection algorithm for selecting a representative transcript defined [here](https://coolseqtool.readthedocs.io/stable/transcript_selection.html), that combine the above to support translation between references sequences, annotation layers, and transcripts
98
98
  <!-- /description -->
99
99
 
100
100
  ---
101
101
 
102
102
  ## Install
103
103
 
104
- CoolSeqTool is available on [PyPI](https://pypi.org/project/cool-seq-tool)
104
+ Cool-Seq-Tool is available on [PyPI](https://pypi.org/project/cool-seq-tool)
105
105
 
106
106
  ```shell
107
107
  python3 -m pip install cool-seq-tool
@@ -113,7 +113,7 @@ See the [installation instructions](https://coolseqtool.readthedocs.io/stable/in
113
113
 
114
114
  ## Usage
115
115
 
116
- All CoolSeqTool resources can be initialized by way of a top-level class instance:
116
+ All Cool-Seq-Tool resources can be initialized by way of a top-level class instance:
117
117
 
118
118
  ```pycon
119
119
  >>> from cool_seq_tool import CoolSeqTool
@@ -6,7 +6,7 @@ cool_seq_tool/handlers/__init__.py,sha256=KalQ46vX1MO4SJz2SlspKoIRy1n3c3Vp1t4Y2p
6
6
  cool_seq_tool/handlers/seqrepo_access.py,sha256=Jd19jbdUvPRPn_XWozL67ph-nSIxpb4_UUimapDrsm4,9162
7
7
  cool_seq_tool/mappers/__init__.py,sha256=O0JRxNFk8nWxD4v5ij47xelhvfVLdEXS43l2tzRuiUE,305
8
8
  cool_seq_tool/mappers/alignment.py,sha256=nV6PS3mhkQ2MD1GcpNBujBOqd3AKxYSYA9BCusFOa1o,9636
9
- cool_seq_tool/mappers/exon_genomic_coords.py,sha256=XoG60ha1JDoAI-vlc-0rh3tFSyKx61u49hVyeBpjPME,48836
9
+ cool_seq_tool/mappers/exon_genomic_coords.py,sha256=XYHWYHL9PcBIKHB_EsN1YKwmhP-KLrGyZv8yH_7huuo,49533
10
10
  cool_seq_tool/mappers/liftover.py,sha256=lltx9zxfkrb5PHtJlKp3a39JCwPP4e0Zft-mQc1jXL8,3367
11
11
  cool_seq_tool/mappers/mane_transcript.py,sha256=nirxlf3EGVInFYG4fsAqiEmDdTc_h1XuPyX2ul-a7Rk,54368
12
12
  cool_seq_tool/resources/__init__.py,sha256=VwUC8YaucTS6SmRirToulZTF6CuvuLQRSxFfSfAovCc,77
@@ -17,8 +17,8 @@ cool_seq_tool/sources/__init__.py,sha256=51QiymeptF7AeVGgV-tW_9f4pIUr0xtYbyzpvHO
17
17
  cool_seq_tool/sources/mane_transcript_mappings.py,sha256=Q6J57O2lLWXlgKT0zq3BIwkwFawySnORHOX-UxzfyDE,5399
18
18
  cool_seq_tool/sources/transcript_mappings.py,sha256=903RKTMBO2rbKh6iTQ1BEWnY4C7saBFMPw2_4ATuudg,10054
19
19
  cool_seq_tool/sources/uta_database.py,sha256=gc5wsKOIhvzhwFmPmqOY0hhaVfRkRSzYNa9tpBt81_U,35017
20
- cool_seq_tool-0.8.0.dist-info/LICENSE,sha256=IpqC9A-tZW7XXXvCS8c4AVINqkmpxiVA-34Qe3CZSjo,1072
21
- cool_seq_tool-0.8.0.dist-info/METADATA,sha256=moL8cCRR-wPQh3t9kJviAVRuvAapZJ40-8Ea8pjIRic,6226
22
- cool_seq_tool-0.8.0.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
23
- cool_seq_tool-0.8.0.dist-info/top_level.txt,sha256=cGuxdN6p3y16jQf6hCwWhE4OptwUeZPm_PNJlPb3b0k,14
24
- cool_seq_tool-0.8.0.dist-info/RECORD,,
20
+ cool_seq_tool-0.9.0.dist-info/LICENSE,sha256=IpqC9A-tZW7XXXvCS8c4AVINqkmpxiVA-34Qe3CZSjo,1072
21
+ cool_seq_tool-0.9.0.dist-info/METADATA,sha256=GgGZqNTW98YoV49Reizkz2UnPq1MqJOR4jjDHlcWTDQ,6556
22
+ cool_seq_tool-0.9.0.dist-info/WHEEL,sha256=A3WOREP4zgxI0fKrHUG8DC8013e3dK3n7a6HDbcEIwE,91
23
+ cool_seq_tool-0.9.0.dist-info/top_level.txt,sha256=cGuxdN6p3y16jQf6hCwWhE4OptwUeZPm_PNJlPb3b0k,14
24
+ cool_seq_tool-0.9.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.3.0)
2
+ Generator: setuptools (75.7.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5