cool-seq-tool 0.4.0.dev3__py3-none-any.whl → 0.5.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.
Files changed (34) hide show
  1. cool_seq_tool/__init__.py +7 -11
  2. cool_seq_tool/app.py +44 -24
  3. cool_seq_tool/handlers/__init__.py +1 -0
  4. cool_seq_tool/handlers/seqrepo_access.py +27 -25
  5. cool_seq_tool/mappers/__init__.py +3 -1
  6. cool_seq_tool/mappers/alignment.py +5 -6
  7. cool_seq_tool/mappers/exon_genomic_coords.py +139 -124
  8. cool_seq_tool/mappers/liftover.py +90 -0
  9. cool_seq_tool/mappers/mane_transcript.py +208 -113
  10. cool_seq_tool/resources/__init__.py +1 -0
  11. cool_seq_tool/resources/data_files.py +93 -0
  12. cool_seq_tool/resources/status.py +153 -0
  13. cool_seq_tool/schemas.py +92 -54
  14. cool_seq_tool/sources/__init__.py +1 -0
  15. cool_seq_tool/sources/mane_transcript_mappings.py +16 -9
  16. cool_seq_tool/sources/transcript_mappings.py +41 -32
  17. cool_seq_tool/sources/uta_database.py +96 -249
  18. cool_seq_tool/utils.py +44 -4
  19. {cool_seq_tool-0.4.0.dev3.dist-info → cool_seq_tool-0.5.0.dist-info}/LICENSE +1 -1
  20. {cool_seq_tool-0.4.0.dev3.dist-info → cool_seq_tool-0.5.0.dist-info}/METADATA +16 -11
  21. cool_seq_tool-0.5.0.dist-info/RECORD +24 -0
  22. {cool_seq_tool-0.4.0.dev3.dist-info → cool_seq_tool-0.5.0.dist-info}/WHEEL +1 -1
  23. cool_seq_tool/api.py +0 -42
  24. cool_seq_tool/data/__init__.py +0 -2
  25. cool_seq_tool/data/data_downloads.py +0 -89
  26. cool_seq_tool/paths.py +0 -28
  27. cool_seq_tool/routers/__init__.py +0 -16
  28. cool_seq_tool/routers/default.py +0 -125
  29. cool_seq_tool/routers/mane.py +0 -98
  30. cool_seq_tool/routers/mappings.py +0 -155
  31. cool_seq_tool/version.py +0 -2
  32. cool_seq_tool-0.4.0.dev3.dist-info/RECORD +0 -29
  33. /cool_seq_tool/{data → resources}/transcript_mapping.tsv +0 -0
  34. {cool_seq_tool-0.4.0.dev3.dist-info → cool_seq_tool-0.5.0.dist-info}/top_level.txt +0 -0
@@ -1,155 +0,0 @@
1
- """Module containing routes related to alignment mapping"""
2
- import logging
3
- from typing import Optional
4
-
5
- from fastapi import APIRouter, Query
6
-
7
- from cool_seq_tool.routers import RESP_DESCR, SERVICE_NAME, Tags, cool_seq_tool
8
- from cool_seq_tool.schemas import Assembly, ResidueMode, ToCdnaService, ToGenomicService
9
- from cool_seq_tool.utils import service_meta
10
-
11
- logger = logging.getLogger("cool_seq_tool")
12
-
13
- router = APIRouter(prefix=f"/{SERVICE_NAME}/alignment_mapper")
14
-
15
-
16
- @router.get(
17
- "/p_to_c",
18
- summary="Translate protein representation to cDNA representation",
19
- response_description=RESP_DESCR,
20
- description="Given protein accession and positions, return associated cDNA "
21
- "accession and positions to codon(s)",
22
- response_model=ToCdnaService,
23
- tags=[Tags.ALIGNMENT_MAPPER],
24
- )
25
- async def p_to_c(
26
- p_ac: str = Query(..., description="Protein RefSeq accession"),
27
- p_start_pos: int = Query(..., description="Protein start position"),
28
- p_end_pos: int = Query(..., description="Protein end position"),
29
- residue_mode: ResidueMode = Query(
30
- ResidueMode.RESIDUE,
31
- description="Residue mode for `p_start_pos` and `p_end_pos`",
32
- ),
33
- ) -> ToCdnaService:
34
- """Translate protein representation to cDNA representation
35
-
36
- :param str p_ac: Protein RefSeq accession
37
- :param int p_start_pos: Protein start position
38
- :param int p_end_pos: Protein end position
39
- :param ResidueMode residue_mode: Residue mode for `p_start_pos` and `p_end_pos`.
40
- :return: ToCdnaService containing cDNA representation, warnings, and
41
- service meta
42
- """
43
- try:
44
- c_data, w = await cool_seq_tool.alignment_mapper.p_to_c(
45
- p_ac, p_start_pos, p_end_pos, residue_mode
46
- )
47
- except Exception as e:
48
- logger.error("Unhandled exception: %s", str(e))
49
- w = "Unhandled exception. See logs for more information."
50
- c_data = None
51
- return ToCdnaService(
52
- c_data=c_data, warnings=[w] if w else [], service_meta=service_meta()
53
- )
54
-
55
-
56
- @router.get(
57
- "/c_to_g",
58
- summary="Translate cDNA representation to genomic representation",
59
- response_description=RESP_DESCR,
60
- description="Given cDNA accession and positions for codon(s), return associated genomic"
61
- " accession and positions for a given target genome assembly",
62
- response_model=ToGenomicService,
63
- tags=[Tags.ALIGNMENT_MAPPER],
64
- )
65
- async def c_to_g(
66
- c_ac: str = Query(..., description="cDNA RefSeq accession"),
67
- c_start_pos: int = Query(..., description="cDNA start position for codon"),
68
- c_end_pos: int = Query(..., description="cDNA end position for codon"),
69
- cds_start: Optional[int] = Query(
70
- None, description="CDS start site. If not provided, this will be computed."
71
- ),
72
- residue_mode: ResidueMode = Query(
73
- ResidueMode.RESIDUE,
74
- description="Residue mode for `c_start_pos` and `c_end_pos`",
75
- ),
76
- target_genome_assembly: Assembly = Query(
77
- Assembly.GRCH38, description="Genomic assembly to map to"
78
- ),
79
- ) -> ToGenomicService:
80
- """Translate cDNA representation to genomic representation
81
-
82
- :param str c_ac: cDNA RefSeq accession
83
- :param int c_start_pos: cDNA start position for codon
84
- :param int c_end_pos: cDNA end position for codon
85
- :param Optional[int] cds_start: CDS start site. If not provided, this will be
86
- computed.
87
- :param ResidueMode residue_mode: Residue mode for `c_start_pos` and `c_end_pos`.
88
- :param Assembly target_genome_assembly: Genome assembly to get genomic data for
89
- :return: ToGenomicService containing genomic representation, warnings, and
90
- service meta
91
- """
92
- try:
93
- g_data, w = await cool_seq_tool.alignment_mapper.c_to_g(
94
- c_ac,
95
- c_start_pos,
96
- c_end_pos,
97
- cds_start=cds_start,
98
- residue_mode=residue_mode,
99
- target_genome_assembly=target_genome_assembly,
100
- )
101
- except Exception as e:
102
- logger.error("Unhandled exception: %s", str(e))
103
- w = "Unhandled exception. See logs for more information."
104
- g_data = None
105
- return ToGenomicService(
106
- g_data=g_data, warnings=[w] if w else [], service_meta=service_meta()
107
- )
108
-
109
-
110
- @router.get(
111
- "/p_to_g",
112
- summary="Translate protein representation to genomic representation",
113
- response_description=RESP_DESCR,
114
- description="Given protein accession and positions, return associated genomic "
115
- "accession and positions for a given target genome assembly",
116
- response_model=ToGenomicService,
117
- tags=[Tags.ALIGNMENT_MAPPER],
118
- )
119
- async def p_to_g(
120
- p_ac: str = Query(..., description="Protein RefSeq accession"),
121
- p_start_pos: int = Query(..., description="Protein start position"),
122
- p_end_pos: int = Query(..., description="Protein end position"),
123
- residue_mode: ResidueMode = Query(
124
- ResidueMode.RESIDUE,
125
- description="Residue mode for `p_start_pos` and `p_end_pos`",
126
- ),
127
- target_genome_assembly: Assembly = Query(
128
- Assembly.GRCH38, description="Genomic assembly to map to"
129
- ),
130
- ) -> ToGenomicService:
131
- """Translate protein representation to genomic representation
132
-
133
- :param str p_ac: Protein RefSeq accession
134
- :param int p_start_pos: Protein start position
135
- :param int p_end_pos: Protein end position
136
- :param ResidueMode residue_mode: Residue mode for `p_start_pos` and `p_end_pos`.
137
- :param Assembly target_genome_assembly: Genome assembly to get genomic data for
138
- :return: ToGenomicService containing genomic representation, warnings, and
139
- service meta
140
- """
141
- try:
142
- g_data, w = await cool_seq_tool.alignment_mapper.p_to_g(
143
- p_ac,
144
- p_start_pos,
145
- p_end_pos,
146
- residue_mode=residue_mode,
147
- target_genome_assembly=target_genome_assembly,
148
- )
149
- except Exception as e:
150
- logger.error("Unhandled exception: %s", str(e))
151
- w = "Unhandled exception. See logs for more information."
152
- g_data = None
153
- return ToGenomicService(
154
- g_data=g_data, warnings=[w] if w else [], service_meta=service_meta()
155
- )
cool_seq_tool/version.py DELETED
@@ -1,2 +0,0 @@
1
- """Define package version."""
2
- __version__ = "0.4.0-dev3"
@@ -1,29 +0,0 @@
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=MpOImt0cE1g_Y1B3DS18AYffUtHF0JucTTqQuhUPibg,3846
4
- cool_seq_tool/paths.py,sha256=7EA21Vmf9hvct0z_V4oK0WTWOA2FKY2Tavh4nAUXunk,889
5
- cool_seq_tool/schemas.py,sha256=Uw5OkC0dPM_RC8ZHNn1wLZBZK_kWAkkQQRrh-zOsJjg,15922
6
- cool_seq_tool/utils.py,sha256=26y_25V029l-ra3We3z-KQFfgRlcvfl2dQ8XJ1t6yfM,1625
7
- cool_seq_tool/version.py,sha256=RYDQDTkCd_6WYwrUWOOwYuNLV_rVTLqCFz1unXLvp34,57
8
- cool_seq_tool/data/__init__.py,sha256=pOdws59_iPOP0V4xqx55PdxCUxHSA5N_Eo5L0oZsafs,63
9
- cool_seq_tool/data/data_downloads.py,sha256=WaTxeCnifBuif89_lo6hFrmTu2gu8Jy8ndB9crcqvFQ,3869
10
- cool_seq_tool/data/transcript_mapping.tsv,sha256=AO3luYQAbFiCoRgiiPXotakb5pAwx1jDCeXpvGdIuac,24138769
11
- cool_seq_tool/handlers/__init__.py,sha256=xDQ84N4ImrUBKwGmrg64yGUMh0ArW-DwjJuTkKrIJL4,77
12
- cool_seq_tool/handlers/seqrepo_access.py,sha256=XUS4zjguXB7OfLZLnQatWwiYVspu87rk50v1WzENvXE,9029
13
- cool_seq_tool/mappers/__init__.py,sha256=5aE6IRTG8SwOofFR19QHmK-1n2PaKwEPzFGNE0_HS3s,261
14
- cool_seq_tool/mappers/alignment.py,sha256=htGb9rJab8dAKcMR62NF0uGc5l4KROrMcMAKfSQhva0,9620
15
- cool_seq_tool/mappers/exon_genomic_coords.py,sha256=usTOYkXt7HIS1mLtNXms6bqStPJR4GO0R1G47X5xZ8c,38638
16
- cool_seq_tool/mappers/mane_transcript.py,sha256=XB51pcR5TCtteXS525NgP2S7aRU1gnBtB2ZrSltxM1A,49364
17
- cool_seq_tool/routers/__init__.py,sha256=x00Dq0LzqYoBPbipmyexLbAMUb7Udx8DozfwT-mJo1E,436
18
- cool_seq_tool/routers/default.py,sha256=nMDcAAdo-QZugs6k43HnYJCzhorg9nFt0TsdXTckVZU,3927
19
- cool_seq_tool/routers/mane.py,sha256=fASm7wo4ZjYB5l8G5cu4zqObwf811SxLVCJhbeqC_cY,3544
20
- cool_seq_tool/routers/mappings.py,sha256=I9hxriBlkv9vQp1l_17L-VxQSUJ9-IyLyqwXGue4axg,6091
21
- cool_seq_tool/sources/__init__.py,sha256=lERBM8cOqlJhYqz_DwOMV5FsWvMvQMbU1KQBxx_cz6M,303
22
- cool_seq_tool/sources/mane_transcript_mappings.py,sha256=Oyq7cdUJ2j0isROCkHW-rgtU7LtyFon3DJz6hrEl5cU,3750
23
- cool_seq_tool/sources/transcript_mappings.py,sha256=_CV71tyge24rr7Kb_rJJQTr9uG1lSU_O-HcC9hIc5OQ,9731
24
- cool_seq_tool/sources/uta_database.py,sha256=6w1_Dy4aEvRv-4cKBqN9HJqoU1fcpnLNO38a0HEYVuo,44717
25
- cool_seq_tool-0.4.0.dev3.dist-info/LICENSE,sha256=1jbnPcw_qmlDZyD_E_ebjWwjIvBgOD-1biodvBtSl1U,1072
26
- cool_seq_tool-0.4.0.dev3.dist-info/METADATA,sha256=GoKAAwPZjiZFcSzGn-Pwk0RnWPwLr5R9wvOre9HunMQ,5720
27
- cool_seq_tool-0.4.0.dev3.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
28
- cool_seq_tool-0.4.0.dev3.dist-info/top_level.txt,sha256=cGuxdN6p3y16jQf6hCwWhE4OptwUeZPm_PNJlPb3b0k,14
29
- cool_seq_tool-0.4.0.dev3.dist-info/RECORD,,