Skip to content

Commit

Permalink
Revert warning statement, change tx_genomic_coords structure, edit do…
Browse files Browse the repository at this point in the history
…cstrings
  • Loading branch information
jarbesfeld committed Feb 27, 2024
1 parent 39369c9 commit 4e0208c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions src/cool_seq_tool/mappers/exon_genomic_coords.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,12 +554,11 @@ async def _genomic_to_transcript_exon_coordinate(
resp,
f"Could not find a transcript for {gene} on {alt_ac}",
)
tx_genomic_coords = await self.uta_db.get_tx_exons_genomic_coords(
tx_genomic_coords, w = await self.uta_db.get_tx_exons_genomic_coords(
tx_ac=transcript, alt_ac=alt_ac
)
tx_genomic_coords = tx_genomic_coords[0]
if not tx_genomic_coords:
return self._return_warnings(resp, tx_genomic_coords[1])
return self._return_warnings(resp, w)
# Check if breakpoint occurs on an exon.
# If not, determine the adjacent exon given the selected transcript
if not self._is_exonic_breakpoint(pos, tx_genomic_coords):
Expand Down Expand Up @@ -629,8 +628,8 @@ async def _genomic_to_transcript_exon_coordinate(
params["pos"] = pos
params["chr"] = alt_ac
warning = await self._set_genomic_data(params, strand, is_start)
if warning:
return self._return_warnings(resp, warning)
if warning:
return self._return_warnings(resp, warning)

resp.transcript_exon_data = TranscriptExonData(**params)
return resp
Expand Down Expand Up @@ -922,7 +921,10 @@ def _get_adjacent_exon(
:param: tx_exons_genomic_coords: List of tuples describing exons and genomic
coordinates for a transcript. Each tuple contains the transcript number
(0-indexed), the transcript coordinates for the exon, and the genomic
coordinates for the exon.
coordinates for the exon. Pos 0 in the tuple corresponds to the exon
number, pos 1 and pos 2 refer to the start and end transcript coordinates,
respectively, and pos 3 and 4 refer to the start and end genomic
coordinates, respectively.
:param strand: Strand
:param: start: Genomic coordinate of breakpoint
:param: end: Genomic coordinate of breakpoint
Expand Down
2 changes: 1 addition & 1 deletion src/cool_seq_tool/sources/uta_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ async def get_tx_exons_genomic_coords(
self,
tx_ac: str,
alt_ac: str,
) -> Optional[Tuple[int, int, int, int, int]]:
) -> Tuple[Optional[Tuple[int, int, int, int, int]], Optional[str]]:
"""Get exon number, transcript coordinates, and genomic coordinates
:param tx_ac: Transcript accession
Expand Down

0 comments on commit 4e0208c

Please sign in to comment.