Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: update tx segment element with updated cool-seq-tool structure changes #314

Merged
merged 19 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
fa8c93c
feat!: update tx segment element with updated cool-seq-tool structure…
katiestahl Aug 12, 2024
9a6281d
fix: tx segment element bugs
katiestahl Aug 12, 2024
fbe0a83
update response models
katiestahl Aug 12, 2024
b2c6787
feat: update variable names with cool-seq-tool updates
katiestahl Aug 20, 2024
053843e
feat: update calls to fusor and cool-seq-tool with updated params
katiestahl Aug 21, 2024
f314306
Merge branch 'staging' into cool-seq-tool-tx-updates
katiestahl Aug 21, 2024
b58a5b7
update fusor version
katiestahl Aug 21, 2024
726d7e6
updating fusor version
katiestahl Aug 22, 2024
6c672bd
wip: fixing tests from cool-seq-tool and fusor updates
katiestahl Aug 22, 2024
d56bff0
tests: updating tests with fusor changes
katiestahl Aug 22, 2024
7191723
fixing test examples and adding checks for correct start/end on seque…
katiestahl Aug 22, 2024
09e10bd
update reqs
korikuzma Aug 23, 2024
7f56752
fix: bug where chromosome field was not editable
katiestahl Aug 23, 2024
f26dd9f
Merge branch 'cool-seq-tool-tx-updates' of https://github.com/cancerv…
katiestahl Aug 23, 2024
a8833e4
removing editable field for now since it's not working as designed, w…
katiestahl Aug 23, 2024
c3d093c
changing validation for tx segment elemetn since they only require ei…
katiestahl Aug 23, 2024
b611f84
refactor: remove ability to change strand, since it's auto populated
katiestahl Aug 26, 2024
e5545eb
removing strand switch
katiestahl Aug 27, 2024
09183e1
fix: ability to change strand for templated sequence
katiestahl Aug 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,7 @@ const TxSegmentCompInput: React.FC<TxSegmentElementInputProps> = ({
txAc,
txChrom,
txStartingGenomic,
txEndingGenomic,
txStrand
txEndingGenomic
).then((txSegmentResponse) => {
if (
txSegmentResponse.warnings &&
Expand Down
2 changes: 0 additions & 2 deletions client/src/components/Pages/Summary/Main/Summary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ export const Summary: React.FC<Props> = ({ setVisibleTab }) => {
setFormattedFusion(formattedFusion);
}, [fusion]);

console.log(formattedFusion);

return (
<>
{(!validationErrors || validationErrors.length === 0) &&
Expand Down
48 changes: 29 additions & 19 deletions client/src/components/Utilities/GetCoordinates/GetCoordinates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,12 @@ const GetCoordinates: React.FC = () => {
exonEndOffset
).then((coordsResponse) => handleResponse(coordsResponse));
} else if (inputType == "genomic_coords_gene") {
getExonCoords(chromosome, start, end, strand, gene).then(
(coordsResponse) => handleResponse(coordsResponse)
getExonCoords(chromosome, start, end, gene).then((coordsResponse) =>
handleResponse(coordsResponse)
);
} else if (inputType == "genomic_coords_tx") {
getExonCoords(chromosome, start, end, strand, "", txAc).then(
(coordsResponse) => handleResponse(coordsResponse)
getExonCoords(chromosome, start, end, "", txAc).then((coordsResponse) =>
handleResponse(coordsResponse)
);
}
};
Expand All @@ -215,25 +215,38 @@ const GetCoordinates: React.FC = () => {
const renderResults = (): React.ReactFragment => {
if (inputValid) {
if (results) {
const txSegStart = results.seg_start;
const txSegEnd = results.seg_end;

const genomicStart =
txSegStart?.genomic_location.start ||
txSegStart?.genomic_location.end;
const genomicEnd =
txSegEnd?.genomic_location.start || txSegEnd?.genomic_location.end;

return (
<Table>
{renderRow("Gene", results.gene)}
{renderRow("Chromosome", results.chr)}
{results.start ? renderRow("Genomic start", results.start) : null}
{results.end ? renderRow("Genomic end", results.end) : null}
{renderRow("Chromosome", results.genomic_ac)}
{genomicStart != null
? renderRow("Genomic start", genomicStart)
: null}
{genomicEnd != null ? renderRow("Genomic end", genomicEnd) : null}
{results.strand
? renderRow("Strand", results.strand === 1 ? "+" : "-")
: null}
{renderRow("Transcript", results.transcript)}
{results.exon_start
? renderRow("Exon start", results.exon_start)
{renderRow("Transcript", results.tx_ac)}
{txSegStart?.exon_ord != null
? renderRow("Exon start", txSegStart.exon_ord)
: null}
{txSegStart?.offset != null
? renderRow("Exon start offset", txSegStart.offset)
: null}
{results.exon_start_offset
? renderRow("Exon start offset", results.exon_start_offset)
{txSegEnd?.exon_ord != null
? renderRow("Exon end", txSegEnd.exon_ord)
: null}
{results.exon_end ? renderRow("Exon end", results.exon_end) : null}
{results.exon_end_offset
? renderRow("Exon end offset", results.exon_end_offset)
{txSegEnd?.offset != null
? renderRow("Exon end offset", txSegEnd.offset)
: null}
</Table>
);
Expand All @@ -250,10 +263,7 @@ const GetCoordinates: React.FC = () => {
const genomicCoordinateInfo = (
<>
<Box display="flex" justifyContent="space-between" width="100%">
<ChromosomeField
fieldValue={chromosome}
errorText={chromosomeText}
/>
<ChromosomeField fieldValue={chromosome} errorText={chromosomeText} />
<Box mt="18px">
<Box className={classes.strand} width="125px">
<StrandSwitch
Expand Down
70 changes: 57 additions & 13 deletions client/src/services/ResponseModels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -638,22 +638,66 @@ export interface ClientStructuralElement {
*/
export interface CoordsUtilsResponse {
warnings?: string[] | null;
coordinates_data: GenomicData | null;
coordinates_data: GenomicTxSegService | null;
}
/**
* Model containing genomic and transcript exon data.
* Service model for genomic and transcript data.
*/
export interface GenomicData {
gene: string;
chr: string;
start?: number | null;
end?: number | null;
exon_start?: number | null;
exon_start_offset?: number | null;
exon_end?: number | null;
exon_end_offset?: number | null;
transcript: string;
strand: Strand;
export interface GenomicTxSegService {
/**
* HGNC gene symbol.
*/
gene?: string | null;
/**
* RefSeq genomic accession.
*/
genomic_ac?: string | null;
/**
* RefSeq transcript accession.
*/
tx_ac?: string | null;
/**
* Start transcript segment.
*/
seg_start?: TxSegment | null;
/**
* End transcript segment.
*/
seg_end?: TxSegment | null;
/**
* Error messages.
*/
errors?: string[];
/**
* Service metadata.
*/
service_meta: ServiceMeta;
}
/**
* Model for representing transcript segment data.
*/
export interface TxSegment {
/**
* Exon number. 0-based.
*/
exon_ord: number;
/**
* The value added to or subtracted from the `genomic_location` to find the start or end of an exon.
*/
offset?: number;
/**
* The genomic position of a transcript segment.
*/
genomic_location: SequenceLocation;
}
/**
* Metadata for cool_seq_tool service
*/
export interface ServiceMeta {
name?: "cool_seq_tool";
version: string;
response_datetime: string;
url?: "https://github.com/GenomicMedLab/cool-seq-tool";
}
/**
* Response model for demo fusion object retrieval endpoints.
Expand Down
6 changes: 1 addition & 5 deletions client/src/services/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,11 @@ export const getTxSegmentElementGCT = async (
transcript: string,
chromosome: string,
start: string,
end: string,
strand: string
end: string
): Promise<TxSegmentElementResponse> => {
const params: Array<string> = [
`transcript=${transcript}`,
`chromosome=${chromosome}`,
`strand=${strand === "+" ? "%2B" : "-"}`,
];
if (start !== "") params.push(`start=${start}`);
if (end !== "") params.push(`end=${end}`);
Expand Down Expand Up @@ -251,13 +249,11 @@ export const getExonCoords = async (
chromosome: string,
start: string,
end: string,
strand: string,
gene?: string,
txAc?: string
): Promise<CoordsUtilsResponse> => {
const argsArray = [
`chromosome=${chromosome}`,
`strand=${strand === "+" ? "%2B" : "-"}`,
gene && gene !== "" ? `gene=${gene}` : "",
txAc && txAc !== "" ? `transcript=${txAc}` : "",
start && start !== "" ? `start=${start}` : "",
Expand Down
123 changes: 50 additions & 73 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,89 +1,66 @@
aiofiles==23.1.0
anyio==3.7.1
appdirs==1.4.4
appnope==0.1.3
asttokens==2.2.1
asyncpg==0.28.0
attrs==23.1.0
backcall==0.2.0
beautifulsoup4==4.12.2
biocommons.seqrepo==0.6.5
agct==0.1.0.dev2
aiofiles==24.1.0
annotated-types==0.7.0
anyio==4.4.0
asttokens==2.4.1
async-timeout==4.0.3
asyncpg==0.29.0
attrs==24.2.0
biocommons.seqrepo==0.6.9
bioutils==0.5.8.post1
boto3==1.28.11
botocore==1.31.11
bs4==0.0.1
boto3==1.35.4
botocore==1.35.4
canonicaljson==2.0.0
certifi==2023.7.22
charset-normalizer==3.2.0
click==8.1.6
certifi==2024.7.4
charset-normalizer==3.3.2
click==8.1.7
coloredlogs==15.0.1
configparser==6.0.0
cool-seq-tool==0.5.1
cssselect==1.2.0
Cython==3.0.0
configparser==7.1.0
cool_seq_tool==0.7.0
decorator==5.1.1
executing==1.2.0
fake-useragent==1.1.3
fastapi==0.100.0
fusor==0.2.0
executing==2.0.1
fastapi==0.112.1
fusor==0.4.1
ga4gh.vrs==2.0.0a10
gene-normalizer==0.4.0
h11==0.14.0
hgvs==1.5.4
humanfriendly==10.0
idna==3.4
importlib-metadata==6.8.0
inflection==0.5.1
ipython==8.14.0
jedi==0.18.2
Jinja2==3.1.2
idna==3.7
importlib_metadata==8.4.0
ipython==8.26.0
jedi==0.19.1
Jinja2==3.1.4
jmespath==1.0.1
jsonschema==3.2.0
lxml==4.9.3
Markdown==3.4.4
MarkupSafe==2.1.3
matplotlib-inline==0.1.6
numpy==1.25.1
pandas==2.0.3
parse==1.19.1
MarkupSafe==2.1.5
matplotlib-inline==0.1.7
Parsley==1.3
parso==0.8.3
pexpect==4.8.0
pickleshare==0.7.5
prompt-toolkit==3.0.39
psycopg2==2.9.6
parso==0.8.4
pexpect==4.9.0
polars==1.5.0
prompt_toolkit==3.0.47
psycopg2==2.9.9
ptyprocess==0.7.0
pure-eval==0.2.2
pure_eval==0.2.3
pydantic==2.4.2
pyee==8.2.2
Pygments==2.15.1
pyliftover==0.4
pyppeteer==1.0.2
pyquery==2.0.0
pyrsistent==0.19.3
pysam==0.21.0
python-dateutil==2.8.2
python-jsonschema-objects==0.4.2
pytz==2023.3
PyYAML==6.0.1
requests==2.31.0
requests-html==0.10.0
s3transfer==0.6.1
pydantic_core==2.10.1
Pygments==2.18.0
pysam==0.22.1
python-dateutil==2.9.0.post0
requests==2.32.3
s3transfer==0.10.2
six==1.16.0
sniffio==1.3.0
soupsieve==2.4.1
sqlparse==0.4.4
stack-data==0.6.2
starlette==0.27.0
sniffio==1.3.1
sqlparse==0.5.1
stack-data==0.6.3
starlette==0.38.2
tabulate==0.9.0
tqdm==4.65.0
traitlets==5.9.0
typing_extensions==4.7.1
tzdata==2023.3
urllib3==1.26.16
uvicorn==0.23.1
w3lib==2.1.1
wcwidth==0.2.6
websockets==10.4
tqdm==4.66.5
traitlets==5.14.3
typing_extensions==4.12.2
urllib3==1.26.19
uvicorn==0.30.6
wags_tails==0.1.4
wcwidth==0.2.13
yoyo-migrations==8.2.0
zipp==3.16.2
zipp==3.20.0
4 changes: 2 additions & 2 deletions server/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ dependencies = [
"click",
"boto3",
"botocore",
"fusor ~= 0.3.0",
"cool-seq-tool ~= 0.5.1",
"fusor ~= 0.4.1",
"cool-seq-tool ~= 0.7.0",
"pydantic == 2.4.2",
"gene-normalizer ~= 0.4.0",
]
Expand Down
Loading