Skip to content

Commit

Permalink
feat: relax requirements on minimum information model components for … (
Browse files Browse the repository at this point in the history
#264)

* feat: relax requirements on minimum information model components for nomenclature generation

* feat: relaxing requirements on minimum information model components

* feat: relaxing requirements on minimum information model for nomenclature generation, updating fusor version to accomodate
  • Loading branch information
katiestahl authored Oct 3, 2023
1 parent 3f1f9f7 commit b4be59a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 85 deletions.
81 changes: 0 additions & 81 deletions client/src/components/Pages/Summary/Invalid/Invalid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,63 +98,6 @@ export const Invalid: React.FC<Props> = ({
</ListItemText>
);

const noEventError = (
<ListItemText>
The causative event is not specified.{" "}
<Link href="#" onClick={() => setVisibleTab(2)}>
Declare the event type
</Link>{" "}
to resolve.
</ListItemText>
);

const noAssayError = (
<ListItemText>
No assay metadata is provided. You must{" "}
<Link href="#" onClick={() => setVisibleTab(3)}>
identify the assay, detection method, and methodology that was used to
uncover the fusion
</Link>{" "}
in order to resolve.
</ListItemText>
);

const assayIdCurieError = (
<ListItemText>
The provided assay ID is not a valid{" "}
<Link
href="https://www.w3.org/TR/2010/NOTE-curie-20101216/"
target="_blank"
rel="noopener noreferrer"
>
W3 CURIE
</Link>
.{" "}
<Link href="#" onClick={() => setVisibleTab(3)}>
Update the assay ID
</Link>{" "}
to resolve.
</ListItemText>
);

const assayMethodUriCurieError = (
<ListItemText>
The provided assay method URI is not a valid{" "}
<Link
href="https://www.w3.org/TR/2010/NOTE-curie-20101216/"
target="_blank"
rel="noopener noreferrer"
>
W3 CURIE
</Link>
.{" "}
<Link href="#" onClick={() => setVisibleTab(3)}>
Update the method URI
</Link>{" "}
to resolve.
</ListItemText>
);

const unknownError = (
<>
<ListItemText>
Expand All @@ -164,8 +107,6 @@ export const Invalid: React.FC<Props> = ({
</>
);

const CURIE_PATTERN = /^\w[^:]*:.+$/;

const geneElements = fusion.structural_elements.filter(el => el.type === "GeneElement").map(el => { return el.nomenclature })
const findDuplicates = arr => arr.filter((item, index) => arr.indexOf(item) !== index)
const duplicateGenes = findDuplicates(geneElements)
Expand Down Expand Up @@ -193,28 +134,6 @@ export const Invalid: React.FC<Props> = ({
if (duplicateGenes.length > 0) {
errorElements.push(duplicateGeneError(duplicateGenes))
}
if (fusion.type == "AssayedFusion") {
if (
!(
fusion.assay &&
fusion.assay.assay_name &&
fusion.assay.assay_id &&
fusion.assay.method_uri
)
) {
errorElements.push(noAssayError);
} else {
if (!fusion.assay.assay_id.match(CURIE_PATTERN)) {
errorElements.push(assayIdCurieError);
}
if (!fusion.assay.method_uri.match(CURIE_PATTERN)) {
errorElements.push(assayMethodUriCurieError);
}
}
if (!fusion.causative_event) {
errorElements.push(noEventError);
}
}
if (errorElements.length == 0) {
errorElements.push(
<>
Expand Down
7 changes: 5 additions & 2 deletions client/src/components/Pages/Summary/Readable/Readable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ export const Readable: React.FC<Props> = ({ validatedFusion }) => {
);
}, [validatedFusion]);

const assayName = fusion.assay?.assay_name ? fusion.assay.assay_name : ""
const assayId = fusion.assay?.assay_id ? `(${fusion.assay.assay_id})` : ""

/**
* Render rows specific to assayed fusion fields
* @returns React component containing table rows
Expand All @@ -43,7 +46,7 @@ export const Readable: React.FC<Props> = ({ validatedFusion }) => {
</TableCell>
<TableCell align="right">
<Typography>
{eventDisplayMap[fusion.causative_event.event_type] || ""}
{eventDisplayMap[fusion.causative_event?.event_type] || ""}
</Typography>
</TableCell>
</TableRow>
Expand All @@ -52,7 +55,7 @@ export const Readable: React.FC<Props> = ({ validatedFusion }) => {
<Typography className="row-name">Assay</Typography>
</TableCell>
<TableCell align="right">
<Typography>{`${fusion.assay.assay_name} (${fusion.assay.assay_id})`}</Typography>
<Typography>{fusion.assay ? `${assayName} ${assayId}` : ""}</Typography>
</TableCell>
</TableRow>
</>
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ decorator==5.1.1
executing==1.2.0
fake-useragent==1.1.3
fastapi==0.100.0
fusor==0.0.28.dev0
fusor==0.0.30.dev1
ga4gh.vrs==0.8.4
ga4gh.vrsatile.pydantic==0.0.13
gene-normalizer==0.1.39
Expand Down
2 changes: 1 addition & 1 deletion server/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ install_requires =
fastapi >= 0.72.0
aiofiles
asyncpg
fusor ~= 0.0.28-dev0
fusor ~= 0.0.30-dev1
sqlparse >= 0.4.2
urllib3 >= 1.26.5
click
Expand Down

0 comments on commit b4be59a

Please sign in to comment.