cool-seq-tool 0.4.0.dev3__py3-none-any.whl → 0.4.1__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/__init__.py +1 -3
- cool_seq_tool/api.py +1 -2
- cool_seq_tool/app.py +38 -23
- cool_seq_tool/handlers/__init__.py +1 -0
- cool_seq_tool/handlers/seqrepo_access.py +13 -15
- cool_seq_tool/mappers/__init__.py +1 -0
- cool_seq_tool/mappers/alignment.py +5 -6
- cool_seq_tool/mappers/exon_genomic_coords.py +75 -73
- cool_seq_tool/mappers/mane_transcript.py +84 -86
- cool_seq_tool/resources/__init__.py +1 -0
- cool_seq_tool/resources/data_files.py +93 -0
- cool_seq_tool/resources/status.py +151 -0
- cool_seq_tool/routers/__init__.py +1 -0
- cool_seq_tool/routers/default.py +1 -0
- cool_seq_tool/routers/mane.py +4 -4
- cool_seq_tool/routers/mappings.py +2 -2
- cool_seq_tool/schemas.py +83 -37
- cool_seq_tool/sources/__init__.py +1 -0
- cool_seq_tool/sources/mane_transcript_mappings.py +14 -7
- cool_seq_tool/sources/transcript_mappings.py +41 -32
- cool_seq_tool/sources/uta_database.py +91 -70
- cool_seq_tool/utils.py +2 -2
- cool_seq_tool/version.py +2 -1
- {cool_seq_tool-0.4.0.dev3.dist-info → cool_seq_tool-0.4.1.dist-info}/LICENSE +1 -1
- {cool_seq_tool-0.4.0.dev3.dist-info → cool_seq_tool-0.4.1.dist-info}/METADATA +15 -8
- cool_seq_tool-0.4.1.dist-info/RECORD +29 -0
- {cool_seq_tool-0.4.0.dev3.dist-info → cool_seq_tool-0.4.1.dist-info}/WHEEL +1 -1
- cool_seq_tool/data/__init__.py +0 -2
- cool_seq_tool/data/data_downloads.py +0 -89
- cool_seq_tool/paths.py +0 -28
- cool_seq_tool-0.4.0.dev3.dist-info/RECORD +0 -29
- /cool_seq_tool/{data → resources}/transcript_mapping.tsv +0 -0
- {cool_seq_tool-0.4.0.dev3.dist-info → cool_seq_tool-0.4.1.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
"""Module containing routes related to alignment mapping"""
|
2
|
+
|
2
3
|
import logging
|
3
|
-
from typing import Optional
|
4
4
|
|
5
5
|
from fastapi import APIRouter, Query
|
6
6
|
|
@@ -66,7 +66,7 @@ async def c_to_g(
|
|
66
66
|
c_ac: str = Query(..., description="cDNA RefSeq accession"),
|
67
67
|
c_start_pos: int = Query(..., description="cDNA start position for codon"),
|
68
68
|
c_end_pos: int = Query(..., description="cDNA end position for codon"),
|
69
|
-
cds_start:
|
69
|
+
cds_start: int | None = Query(
|
70
70
|
None, description="CDS start site. If not provided, this will be computed."
|
71
71
|
),
|
72
72
|
residue_mode: ResidueMode = Query(
|
cool_seq_tool/schemas.py
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
"""Defines attribute constants, useful object structures, and API response schemas."""
|
2
|
+
|
2
3
|
import datetime
|
3
4
|
import re
|
4
5
|
from enum import Enum, IntEnum
|
5
|
-
from typing import
|
6
|
+
from typing import Literal
|
6
7
|
|
7
8
|
from pydantic import (
|
8
9
|
BaseModel,
|
@@ -52,10 +53,55 @@ class TranscriptPriority(str, Enum):
|
|
52
53
|
class ResidueMode(str, Enum):
|
53
54
|
"""Create Enum for residue modes.
|
54
55
|
|
56
|
+
We typically prefer to operate in inter-residue coordinates, but users should be
|
57
|
+
careful to define the coordinate mode of their data when calling ``cool-seq-tool``
|
58
|
+
functions.
|
59
|
+
|
55
60
|
| | C | | T | | G | |
|
56
61
|
ZERO | | 0 | | 1 | | 2 | |
|
57
62
|
RESIDUE | | 1 | | 2 | | 3 | |
|
58
63
|
INTER_RESIDUE | 0 | | 1 | | 2 | | 3 |
|
64
|
+
|
65
|
+
.. tabularcolumns:: |L|C|C|C|C|C|C|C|
|
66
|
+
.. list-table::
|
67
|
+
:header-rows: 1
|
68
|
+
|
69
|
+
* -
|
70
|
+
-
|
71
|
+
- C
|
72
|
+
-
|
73
|
+
- T
|
74
|
+
-
|
75
|
+
- G
|
76
|
+
-
|
77
|
+
* - ``ZERO``
|
78
|
+
-
|
79
|
+
- 0
|
80
|
+
-
|
81
|
+
- 1
|
82
|
+
-
|
83
|
+
- 2
|
84
|
+
-
|
85
|
+
* - ``RESIDUE``
|
86
|
+
-
|
87
|
+
- 1
|
88
|
+
-
|
89
|
+
- 2
|
90
|
+
-
|
91
|
+
- 3
|
92
|
+
-
|
93
|
+
* - ``INTER_RESIDUE``
|
94
|
+
- 0
|
95
|
+
-
|
96
|
+
- 1
|
97
|
+
-
|
98
|
+
- 2
|
99
|
+
-
|
100
|
+
- 3
|
101
|
+
|
102
|
+
|
103
|
+
See "Conventions that promote reliable data sharing" and figure 3 within the
|
104
|
+
`Variation Representation Schema (VRS) paper <https://www.ncbi.nlm.nih.gov/pmc/articles/pmid/35311178/>`_ for further discussion.
|
59
105
|
"""
|
60
106
|
|
61
107
|
ZERO = "zero"
|
@@ -70,12 +116,12 @@ class BaseModelForbidExtra(BaseModel, extra="forbid"):
|
|
70
116
|
class GenomicRequestBody(BaseModelForbidExtra):
|
71
117
|
"""Define constraints for genomic to transcript exon coordinates request body"""
|
72
118
|
|
73
|
-
chromosome:
|
74
|
-
start:
|
75
|
-
end:
|
76
|
-
strand:
|
77
|
-
transcript:
|
78
|
-
gene:
|
119
|
+
chromosome: StrictStr | StrictInt
|
120
|
+
start: StrictInt | None = None
|
121
|
+
end: StrictInt | None = None
|
122
|
+
strand: Strand | None = None
|
123
|
+
transcript: StrictStr | None = None
|
124
|
+
gene: StrictStr | None = None
|
79
125
|
residue_mode: ResidueMode = ResidueMode.RESIDUE
|
80
126
|
|
81
127
|
@model_validator(mode="after")
|
@@ -106,11 +152,11 @@ class TranscriptRequestBody(BaseModelForbidExtra):
|
|
106
152
|
"""Define constraints for transcript exon to genomic coordinates request body"""
|
107
153
|
|
108
154
|
transcript: StrictStr
|
109
|
-
gene:
|
110
|
-
exon_start:
|
111
|
-
exon_start_offset:
|
112
|
-
exon_end:
|
113
|
-
exon_end_offset:
|
155
|
+
gene: StrictStr | None = None
|
156
|
+
exon_start: StrictInt | None = None
|
157
|
+
exon_start_offset: StrictInt | None = 0
|
158
|
+
exon_end: StrictInt | None = None
|
159
|
+
exon_end_offset: StrictInt | None = 0
|
114
160
|
|
115
161
|
@model_validator(mode="after")
|
116
162
|
def check_exon_start_and_exon_end(cls, values):
|
@@ -166,12 +212,12 @@ class GenomicData(BaseModelForbidExtra):
|
|
166
212
|
|
167
213
|
gene: StrictStr
|
168
214
|
chr: StrictStr
|
169
|
-
start:
|
170
|
-
end:
|
171
|
-
exon_start:
|
172
|
-
exon_start_offset:
|
173
|
-
exon_end:
|
174
|
-
exon_end_offset:
|
215
|
+
start: StrictInt | None = None # Genomic start position
|
216
|
+
end: StrictInt | None = None # Genomic end position
|
217
|
+
exon_start: StrictInt | None = None
|
218
|
+
exon_start_offset: StrictInt | None = 0
|
219
|
+
exon_end: StrictInt | None = None
|
220
|
+
exon_end_offset: StrictInt | None = 0
|
175
221
|
transcript: StrictStr
|
176
222
|
strand: Strand
|
177
223
|
|
@@ -226,9 +272,9 @@ class ServiceMeta(BaseModelForbidExtra):
|
|
226
272
|
name: Literal["cool_seq_tool"] = "cool_seq_tool"
|
227
273
|
version: StrictStr
|
228
274
|
response_datetime: datetime.datetime
|
229
|
-
url: Literal[
|
275
|
+
url: Literal["https://github.com/GenomicMedLab/cool-seq-tool"] = (
|
230
276
|
"https://github.com/GenomicMedLab/cool-seq-tool"
|
231
|
-
|
277
|
+
)
|
232
278
|
|
233
279
|
@field_validator("version")
|
234
280
|
def validate_version(cls, v):
|
@@ -256,8 +302,8 @@ class ServiceMeta(BaseModelForbidExtra):
|
|
256
302
|
class TranscriptExonDataResponse(BaseModelForbidExtra):
|
257
303
|
"""Response model for Transcript Exon Data"""
|
258
304
|
|
259
|
-
transcript_exon_data:
|
260
|
-
warnings:
|
305
|
+
transcript_exon_data: TranscriptExonData | None = None
|
306
|
+
warnings: list[StrictStr] = []
|
261
307
|
service_meta: ServiceMeta
|
262
308
|
|
263
309
|
model_config = ConfigDict(
|
@@ -287,8 +333,8 @@ class TranscriptExonDataResponse(BaseModelForbidExtra):
|
|
287
333
|
class GenomicDataResponse(BaseModelForbidExtra):
|
288
334
|
"""Response model for Genomic Data"""
|
289
335
|
|
290
|
-
genomic_data:
|
291
|
-
warnings:
|
336
|
+
genomic_data: GenomicData | None = None
|
337
|
+
warnings: list[StrictStr] = []
|
292
338
|
service_meta: ServiceMeta
|
293
339
|
|
294
340
|
model_config = ConfigDict(
|
@@ -323,7 +369,7 @@ class MappedManeData(BaseModel):
|
|
323
369
|
|
324
370
|
gene: StrictStr
|
325
371
|
refseq: StrictStr
|
326
|
-
ensembl:
|
372
|
+
ensembl: StrictStr | None = None
|
327
373
|
strand: Strand
|
328
374
|
status: TranscriptPriority
|
329
375
|
alt_ac: StrictStr
|
@@ -347,8 +393,8 @@ class MappedManeData(BaseModel):
|
|
347
393
|
class MappedManeDataService(BaseModelForbidExtra):
|
348
394
|
"""Service model response for mapped mane data"""
|
349
395
|
|
350
|
-
mapped_mane_data:
|
351
|
-
warnings:
|
396
|
+
mapped_mane_data: MappedManeData | None = None
|
397
|
+
warnings: list[StrictStr] = []
|
352
398
|
service_meta: ServiceMeta
|
353
399
|
|
354
400
|
model_config = ConfigDict(
|
@@ -378,10 +424,10 @@ class MappedManeDataService(BaseModelForbidExtra):
|
|
378
424
|
class ManeData(BaseModel):
|
379
425
|
"""Define mane data fields"""
|
380
426
|
|
381
|
-
gene:
|
382
|
-
refseq:
|
383
|
-
ensembl:
|
384
|
-
pos:
|
427
|
+
gene: StrictStr | None = None
|
428
|
+
refseq: StrictStr | None = None
|
429
|
+
ensembl: StrictStr | None = None
|
430
|
+
pos: tuple[int, int]
|
385
431
|
strand: Strand
|
386
432
|
status: TranscriptPriority
|
387
433
|
|
@@ -402,8 +448,8 @@ class ManeData(BaseModel):
|
|
402
448
|
class ManeDataService(BaseModelForbidExtra):
|
403
449
|
"""Service model response for getting mane data"""
|
404
450
|
|
405
|
-
mane_data:
|
406
|
-
warnings:
|
451
|
+
mane_data: ManeData | None = None
|
452
|
+
warnings: list[StrictStr] = []
|
407
453
|
service_meta: ServiceMeta
|
408
454
|
|
409
455
|
model_config = ConfigDict(
|
@@ -457,8 +503,8 @@ class CdnaRepresentation(BaseModelForbidExtra):
|
|
457
503
|
class ToCdnaService(BaseModelForbidExtra):
|
458
504
|
"""Service model response for protein -> cDNA"""
|
459
505
|
|
460
|
-
c_data:
|
461
|
-
warnings:
|
506
|
+
c_data: CdnaRepresentation | None = None
|
507
|
+
warnings: list[StrictStr] = []
|
462
508
|
service_meta: ServiceMeta
|
463
509
|
|
464
510
|
model_config = ConfigDict(
|
@@ -506,8 +552,8 @@ class GenomicRepresentation(BaseModelForbidExtra):
|
|
506
552
|
class ToGenomicService(BaseModelForbidExtra):
|
507
553
|
"""Service model response for cDNA -> genomic"""
|
508
554
|
|
509
|
-
g_data:
|
510
|
-
warnings:
|
555
|
+
g_data: GenomicRepresentation | None = None
|
556
|
+
warnings: list[StrictStr] = []
|
511
557
|
service_meta: ServiceMeta
|
512
558
|
|
513
559
|
model_config = ConfigDict(
|
@@ -1,13 +1,13 @@
|
|
1
1
|
"""Provide fast tabular access to MANE summary file. Enables retrieval of associated
|
2
2
|
MANE transcripts for gene symbols, genomic positions, or transcript accessions.
|
3
3
|
"""
|
4
|
+
|
4
5
|
import logging
|
5
6
|
from pathlib import Path
|
6
|
-
from typing import Dict, List
|
7
7
|
|
8
8
|
import polars as pl
|
9
9
|
|
10
|
-
from cool_seq_tool.
|
10
|
+
from cool_seq_tool.resources.data_files import DataFile, get_data_file
|
11
11
|
|
12
12
|
logger = logging.getLogger(__name__)
|
13
13
|
|
@@ -22,11 +22,18 @@ class ManeTranscriptMappings:
|
|
22
22
|
See the `NCBI MANE page <https://www.ncbi.nlm.nih.gov/refseq/MANE/>`_ for more information.
|
23
23
|
"""
|
24
24
|
|
25
|
-
def __init__(
|
25
|
+
def __init__(
|
26
|
+
self, mane_data_path: Path | None = None, from_local: bool = False
|
27
|
+
) -> None:
|
26
28
|
"""Initialize the MANE Transcript mappings class.
|
27
29
|
|
28
|
-
:param
|
30
|
+
:param mane_data_path: Path to RefSeq MANE summary data
|
31
|
+
:param from_local: if ``True``, don't check for or acquire latest version --
|
32
|
+
just provide most recent locally available file, if possible, and raise
|
33
|
+
error otherwise
|
29
34
|
"""
|
35
|
+
if not mane_data_path:
|
36
|
+
mane_data_path = get_data_file(DataFile.MANE_SUMMARY, from_local)
|
30
37
|
self.mane_data_path = mane_data_path
|
31
38
|
self.df = self._load_mane_transcript_data()
|
32
39
|
|
@@ -37,7 +44,7 @@ class ManeTranscriptMappings:
|
|
37
44
|
"""
|
38
45
|
return pl.read_csv(self.mane_data_path, separator="\t")
|
39
46
|
|
40
|
-
def get_gene_mane_data(self, gene_symbol: str) ->
|
47
|
+
def get_gene_mane_data(self, gene_symbol: str) -> list[dict]:
|
41
48
|
"""Return MANE Transcript data for a gene.
|
42
49
|
|
43
50
|
>>> from cool_seq_tool.sources import ManeTranscriptMappings
|
@@ -64,7 +71,7 @@ class ManeTranscriptMappings:
|
|
64
71
|
data = data.sort(by="MANE_status", descending=True)
|
65
72
|
return data.to_dicts()
|
66
73
|
|
67
|
-
def get_mane_from_transcripts(self, transcripts:
|
74
|
+
def get_mane_from_transcripts(self, transcripts: list[str]) -> list[dict]:
|
68
75
|
"""Get mane transcripts from a list of transcripts
|
69
76
|
|
70
77
|
:param List[str] transcripts: RefSeq transcripts on c. coordinate
|
@@ -77,7 +84,7 @@ class ManeTranscriptMappings:
|
|
77
84
|
|
78
85
|
def get_mane_data_from_chr_pos(
|
79
86
|
self, alt_ac: str, start: int, end: int
|
80
|
-
) ->
|
87
|
+
) -> list[dict]:
|
81
88
|
"""Get MANE data given a GRCh38 genomic position.
|
82
89
|
|
83
90
|
:param str alt_ac: NC Accession
|
@@ -1,15 +1,15 @@
|
|
1
1
|
"""Provide mappings between gene symbols and RefSeq + Ensembl transcript accessions."""
|
2
|
+
|
2
3
|
import csv
|
3
4
|
from pathlib import Path
|
4
|
-
from typing import Dict, List, Optional
|
5
5
|
|
6
|
-
from cool_seq_tool.
|
6
|
+
from cool_seq_tool.resources.data_files import DataFile, get_data_file
|
7
7
|
|
8
8
|
|
9
9
|
class TranscriptMappings:
|
10
10
|
"""Provide mappings between gene symbols and RefSeq + Ensembl transcript accessions.
|
11
11
|
|
12
|
-
Uses ``LRG_RefSeqGene`` and ``transcript_mappings.
|
12
|
+
Uses ``LRG_RefSeqGene`` and ``transcript_mappings.tsv``, which will automatically
|
13
13
|
be acquired if they aren't already available. See the
|
14
14
|
:ref:`configuration <configuration>` section in the documentation for information
|
15
15
|
about manual acquisition of data.
|
@@ -21,44 +21,53 @@ class TranscriptMappings:
|
|
21
21
|
|
22
22
|
def __init__(
|
23
23
|
self,
|
24
|
-
transcript_file_path: Path =
|
25
|
-
lrg_refseqgene_path: Path =
|
24
|
+
transcript_file_path: Path | None = None,
|
25
|
+
lrg_refseqgene_path: Path | None = None,
|
26
|
+
from_local: bool = False,
|
26
27
|
) -> None:
|
27
28
|
"""Initialize the transcript mappings class.
|
28
29
|
|
29
30
|
:param transcript_file_path: Path to transcript mappings file
|
30
31
|
:param lrg_refseqgene_path: Path to LRG RefSeqGene file
|
32
|
+
:param from_local: if ``True``, don't check for or acquire latest version --
|
33
|
+
just provide most recent locally available file, if possible, and raise
|
34
|
+
error otherwise
|
31
35
|
"""
|
32
36
|
# ENSP <-> Gene Symbol
|
33
|
-
self.ensembl_protein_version_for_gene_symbol:
|
34
|
-
self.ensembl_protein_version_to_gene_symbol:
|
35
|
-
self.ensembl_protein_for_gene_symbol:
|
36
|
-
self.ensembl_protein_to_gene_symbol:
|
37
|
+
self.ensembl_protein_version_for_gene_symbol: dict[str, list[str]] = {}
|
38
|
+
self.ensembl_protein_version_to_gene_symbol: dict[str, str] = {}
|
39
|
+
self.ensembl_protein_for_gene_symbol: dict[str, list[str]] = {}
|
40
|
+
self.ensembl_protein_to_gene_symbol: dict[str, str] = {}
|
37
41
|
|
38
42
|
# Gene Symbol <-> ENST
|
39
|
-
self.ensembl_transcript_version_for_gene_symbol:
|
40
|
-
self.ensembl_transcript_version_to_gene_symbol:
|
41
|
-
self.ensembl_transcript_for_gene_symbol:
|
42
|
-
self.ensembl_transcript_to_gene_symbol:
|
43
|
+
self.ensembl_transcript_version_for_gene_symbol: dict[str, list[str]] = {}
|
44
|
+
self.ensembl_transcript_version_to_gene_symbol: dict[str, str] = {}
|
45
|
+
self.ensembl_transcript_for_gene_symbol: dict[str, list[str]] = {}
|
46
|
+
self.ensembl_transcript_to_gene_symbol: dict[str, str] = {}
|
43
47
|
|
44
48
|
# NP_ <-> Gene Symbol
|
45
|
-
self.refseq_protein_for_gene_symbol:
|
46
|
-
self.refseq_protein_to_gene_symbol:
|
49
|
+
self.refseq_protein_for_gene_symbol: dict[str, list[str]] = {}
|
50
|
+
self.refseq_protein_to_gene_symbol: dict[str, str] = {}
|
47
51
|
|
48
52
|
# NM_ <-> Gene Symbol
|
49
|
-
self.refseq_rna_version_for_gene_symbol:
|
50
|
-
self.refseq_rna_version_to_gene_symbol:
|
51
|
-
self.refseq_rna_for_gene_symbol:
|
52
|
-
self.refseq_rna_to_gene_symbol:
|
53
|
+
self.refseq_rna_version_for_gene_symbol: dict[str, list[str]] = {}
|
54
|
+
self.refseq_rna_version_to_gene_symbol: dict[str, str] = {}
|
55
|
+
self.refseq_rna_for_gene_symbol: dict[str, list[str]] = {}
|
56
|
+
self.refseq_rna_to_gene_symbol: dict[str, str] = {}
|
53
57
|
|
54
58
|
# NP -> NM
|
55
|
-
self.np_to_nm:
|
59
|
+
self.np_to_nm: dict[str, str] = {}
|
56
60
|
|
57
61
|
# ENSP -> ENST
|
58
|
-
self.ensp_to_enst:
|
62
|
+
self.ensp_to_enst: dict[str, str] = {}
|
59
63
|
|
60
|
-
self._load_transcript_mappings_data(
|
61
|
-
|
64
|
+
self._load_transcript_mappings_data(
|
65
|
+
transcript_file_path
|
66
|
+
or get_data_file(DataFile.TRANSCRIPT_MAPPINGS, from_local)
|
67
|
+
)
|
68
|
+
self._load_refseq_gene_symbol_data(
|
69
|
+
lrg_refseqgene_path or get_data_file(DataFile.LRG_REFSEQGENE, from_local)
|
70
|
+
)
|
62
71
|
|
63
72
|
def _load_transcript_mappings_data(self, transcript_file_path: Path) -> None:
|
64
73
|
"""Load transcript mappings file to dictionaries.
|
@@ -99,9 +108,9 @@ class TranscriptMappings:
|
|
99
108
|
).append(transcript)
|
100
109
|
self.ensembl_transcript_to_gene_symbol[transcript] = gene
|
101
110
|
if versioned_transcript and versioned_protein_transcript:
|
102
|
-
self.ensp_to_enst[
|
103
|
-
|
104
|
-
|
111
|
+
self.ensp_to_enst[versioned_protein_transcript] = (
|
112
|
+
versioned_transcript
|
113
|
+
)
|
105
114
|
|
106
115
|
def _load_refseq_gene_symbol_data(self, lrg_refseqgene_path: Path) -> None:
|
107
116
|
"""Load data from RefSeq Gene Symbol file to dictionaries.
|
@@ -134,7 +143,7 @@ class TranscriptMappings:
|
|
134
143
|
if refseq_transcript and rna_transcript:
|
135
144
|
self.np_to_nm[refseq_transcript] = rna_transcript
|
136
145
|
|
137
|
-
def protein_transcripts(self, identifier: str) ->
|
146
|
+
def protein_transcripts(self, identifier: str) -> list[str]:
|
138
147
|
"""Return a list of protein transcripts for a gene symbol.
|
139
148
|
|
140
149
|
>>> from cool_seq_tool.sources import TranscriptMappings
|
@@ -154,7 +163,7 @@ class TranscriptMappings:
|
|
154
163
|
protein_transcripts += self.refseq_protein_for_gene_symbol.get(identifier, "")
|
155
164
|
return list(set(protein_transcripts))
|
156
165
|
|
157
|
-
def coding_dna_transcripts(self, identifier: str) ->
|
166
|
+
def coding_dna_transcripts(self, identifier: str) -> list[str]:
|
158
167
|
"""Return transcripts from a coding dna refseq for a gene symbol.
|
159
168
|
|
160
169
|
:param identifier: Gene identifier to find transcripts for
|
@@ -172,7 +181,7 @@ class TranscriptMappings:
|
|
172
181
|
)
|
173
182
|
return list(set(genomic_transcripts))
|
174
183
|
|
175
|
-
def get_gene_symbol_from_ensembl_protein(self, q: str) ->
|
184
|
+
def get_gene_symbol_from_ensembl_protein(self, q: str) -> str | None:
|
176
185
|
"""Return the gene symbol for a Ensembl Protein.
|
177
186
|
|
178
187
|
:param q: ensembl protein accession
|
@@ -184,7 +193,7 @@ class TranscriptMappings:
|
|
184
193
|
gene_symbol = self.ensembl_protein_to_gene_symbol.get(q)
|
185
194
|
return gene_symbol
|
186
195
|
|
187
|
-
def get_gene_symbol_from_refeq_protein(self, q: str) ->
|
196
|
+
def get_gene_symbol_from_refeq_protein(self, q: str) -> str | None:
|
188
197
|
"""Return the gene symbol for a Refseq Protein.
|
189
198
|
|
190
199
|
:param q: RefSeq protein accession
|
@@ -192,7 +201,7 @@ class TranscriptMappings:
|
|
192
201
|
"""
|
193
202
|
return self.refseq_protein_to_gene_symbol.get(q)
|
194
203
|
|
195
|
-
def get_gene_symbol_from_refseq_rna(self, q: str) ->
|
204
|
+
def get_gene_symbol_from_refseq_rna(self, q: str) -> str | None:
|
196
205
|
"""Return gene symbol for a Refseq RNA Transcript.
|
197
206
|
|
198
207
|
:param q: RefSeq RNA transcript accession
|
@@ -204,7 +213,7 @@ class TranscriptMappings:
|
|
204
213
|
gene_symbol = self.refseq_rna_to_gene_symbol.get(q)
|
205
214
|
return gene_symbol
|
206
215
|
|
207
|
-
def get_gene_symbol_from_ensembl_transcript(self, q: str) ->
|
216
|
+
def get_gene_symbol_from_ensembl_transcript(self, q: str) -> str | None:
|
208
217
|
"""Return gene symbol for an Ensembl Transcript.
|
209
218
|
|
210
219
|
:param q: Ensembl transcript accession
|