Skip to content

Commit

Permalink
Use 1-indexing for exon numbers in convert coordinates (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
jarbesfeld authored and korikuzma committed Oct 7, 2024
1 parent 1eef358 commit e56bbb3
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 21 deletions.
59 changes: 40 additions & 19 deletions client/src/components/Utilities/GetCoordinates/GetCoordinates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { HelpPopover } from "../../main/shared/HelpPopover/HelpPopover";
import ChromosomeField from "../../main/shared/ChromosomeField/ChromosomeField";
import TranscriptField from "../../main/shared/TranscriptField/TranscriptField";
import LoadingMessage from "../../main/shared/LoadingMessage/LoadingMessage";
import HelpTooltip from "../../main/shared/HelpTooltip/HelpTooltip";

const GetCoordinates: React.FC = () => {
const useStyles = makeStyles(() => ({
Expand Down Expand Up @@ -254,13 +255,13 @@ const GetCoordinates: React.FC = () => {
{genomicEnd != null ? renderRow("Genomic end", genomicEnd) : null}
{renderRow("Transcript", results.tx_ac)}
{txSegStart?.exon_ord != null
? renderRow("Exon start", txSegStart.exon_ord)
? renderRow("Exon start", txSegStart.exon_ord + 1)
: null}
{txSegStart?.offset != null
? renderRow("Exon start offset", txSegStart.offset)
: null}
{txSegEnd?.exon_ord != null
? renderRow("Exon end", txSegEnd.exon_ord)
? renderRow("Exon end", txSegEnd.exon_ord + 1)
: null}
{txSegEnd?.offset != null
? renderRow("Exon end offset", txSegEnd.offset)
Expand Down Expand Up @@ -356,19 +357,39 @@ const GetCoordinates: React.FC = () => {
</Box>
{genomicCoordinateInfo}
<Box className={classes.fieldsPair}>
<TextField
margin="dense"
label="Genomic Start"
value={start}
onChange={(event) => setStart(event.target.value)}
helperText={start ? startText : ""}
/>
<TextField
margin="dense"
label="Genomic End"
value={end}
onChange={(event) => setEnd(event.target.value)}
/>
<HelpTooltip
placement="bottom"
title={
<Typography>
The starting genomic position (inter-residue) of the
transcript segment.
</Typography>
}
>
<TextField
margin="dense"
label="Genomic Start"
value={start}
onChange={(event) => setStart(event.target.value)}
helperText={start ? startText : ""}
/>
</HelpTooltip>
<HelpTooltip
placement="bottom"
title={
<Typography>
The ending genomic position (inter-residue) of the
transcript segment.
</Typography>
}
>
<TextField
margin="dense"
label="Genomic End"
value={end}
onChange={(event) => setEnd(event.target.value)}
/>
</HelpTooltip>
</Box>
</>
);
Expand All @@ -379,8 +400,8 @@ const GetCoordinates: React.FC = () => {
<Box className={classes.fieldsPair}>
<TextField
margin="dense"
style={{ minWidth: 125 }}
label="Starting Exon"
style={{ minWidth: 200 }}
label="Starting Exon (1-indexed)"
value={exonStart}
onChange={(event) => setExonStart(event.target.value)}
error={exonStart === "" && exonStartText !== ""}
Expand All @@ -397,8 +418,8 @@ const GetCoordinates: React.FC = () => {
<Box className={classes.fieldsPair}>
<TextField
margin="dense"
style={{ minWidth: 125 }}
label="Ending Exon"
style={{ minWidth: 200 }}
label="Ending Exon (1-indexed)"
value={exonEnd}
onChange={(event) => setExonEnd(event.target.value)}
error={exonEnd !== "" && exonEndText !== ""}
Expand Down
4 changes: 2 additions & 2 deletions server/src/curfu/routers/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ async def get_genome_coords(
FUSOR and UTA-associated tools.
:param gene: gene symbol/ID on which exons lie
:param transcript: transcript accession ID
:param exon_start: starting exon number
:param exon_end: ending exon number
:param exon_start: starting exon number. 1-indexed
:param exon_end: ending exon number. 1-indexed
:param exon_start_offset: base offset count from starting exon
:param exon_end_offset: base offset count from end exon
:return: CoordsUtilsResponse containing relevant data or warnings if unsuccesful
Expand Down

0 comments on commit e56bbb3

Please sign in to comment.