From b9306e7ca5c0c913cf3ecd022fa4d2137e19be6c Mon Sep 17 00:00:00 2001 From: prabhat Date: Fri, 7 Jun 2024 10:54:04 +0100 Subject: [PATCH] fixed unnamed annotations; added no pocket and P-P texts --- src/styles/search/_ImpactSearchResults.scss | 10 +++ .../function/ResidueRegionTable.tsx | 89 ++++++++++--------- 2 files changed, 58 insertions(+), 41 deletions(-) diff --git a/src/styles/search/_ImpactSearchResults.scss b/src/styles/search/_ImpactSearchResults.scss index a47903aa..7658c411 100644 --- a/src/styles/search/_ImpactSearchResults.scss +++ b/src/styles/search/_ImpactSearchResults.scss @@ -813,4 +813,14 @@ border-style: solid; border-width: thin; border-color: #00709b; +} + +.struct-pred { + padding: 2px 10px 15px 10px; +} + +.pred-pocket-conf-dropdown { + div { + padding: 1px 3px 1px 3px; + } } \ No newline at end of file diff --git a/src/ui/components/function/ResidueRegionTable.tsx b/src/ui/components/function/ResidueRegionTable.tsx index 8b8402be..7f88efb3 100644 --- a/src/ui/components/function/ResidueRegionTable.tsx +++ b/src/ui/components/function/ResidueRegionTable.tsx @@ -1,12 +1,11 @@ import {useState, Fragment} from "react"; import {EmptyElement} from "../../../constants/ConstElement"; -import {FEATURES} from "../../../constants/Protein"; import AminoAcidModel from "./AminoAcidModel"; import Evidences from "./Evidences"; import {ReactComponent as ChevronDownIcon} from "../../../images/chevron-down.svg" import {v1 as uuidv1} from 'uuid'; import {StringVoidFun} from "../../../constants/CommonTypes"; -import {aminoAcid3to1Letter, formatRange, getKeyValue} from "../../../utills/Util"; +import {aminoAcid3to1Letter, formatRange} from "../../../utills/Util"; import {FunctionalResponse, Pocket, Foldx, P2PInteraction, ProteinFeature} from "../../../types/FunctionalResponse"; import {MappingRecord} from "../../../utills/Convertor"; import {Prediction, PUBMED_ID} from "./prediction/Prediction"; @@ -98,18 +97,23 @@ function getRegions(regions: Array, accession: string, pockets: } function getFeatureList(feature: ProteinFeature, key: string, expandedRowKey: string, toggleRow: StringVoidFun) { - let category = ''; + /*let category = ''; if (getKeyValue(feature.type)(FEATURES)) { category = getKeyValue(feature.type)(FEATURES); } if (feature.description) { category = category + '-' + feature.description; + }*/ + let featureDesc = feature.typeDescription ? feature.typeDescription + (feature.description ? '-' + feature.description : '') + : (feature.description ? feature.description : '') + if (!featureDesc) { + featureDesc = 'Unnamed' } return {getFeatureDetail(key, feature, expandedRowKey)} @@ -167,7 +171,6 @@ const getIcon = (score: number) => { const Pockets = (props: PocketsProps) => { const [itemsToShow, setItemsToShow] = useState(PAGE); const [filteredPockets, setFilteredPockets] = useState(props.pockets) - if (props.pockets.length === 0) return <>; const filterPockets = (op: any) => { setFilteredPockets(props.pockets.filter(p => { if (op === 0) return p.score > 900 @@ -184,17 +187,20 @@ const Pockets = (props: PocketsProps) => { {(key === props.expandedRowKey) && - <> -
-
Pocket confidence -
-
filterPockets(option.value)} + (props.pockets.length === 0 ? +
Variant not predicted to be in a pocket +
: +
+
+
Pocket confidence +
+
filterPockets(option.value)} /> +
-
{ // show all /*filteredPockets.map((pocket) => { @@ -204,7 +210,7 @@ const Pockets = (props: PocketsProps) => { // show more ShowMore_(filteredPockets, ShowPocket, itemsToShow, setItemsToShow, PAGE) } - +
) } } @@ -251,8 +257,6 @@ interface InterfacesProps { } const Interfaces = (props: InterfacesProps) => { - if (props.interactions.length === 0) return <>; - let key = 'interfaces-0' return {(key === props.expandedRowKey) && - <> - Proteins which are predicted to interact with {props.accession} where the variant is at the interface: -
-
Protein
- - pDockQ - -
- { - // show all - /*props.interactions.map((interaction, index) => { - return ShowInteraction(props.accession, interaction, index) - })*/ - } - { - // show more - ShowMore(props.interactions, ShowInteractionAcc(props.accession)) - } - The interacting structure can be visualised in the 3D structure tab. - + (props.interactions.length === 0 ? +
No P-P interaction predicted at variant position +
: +
+ Proteins which are predicted to interact with {props.accession} where the variant is at the interface: +
+
Protein
+ + pDockQ + +
+ { + // show all + props.interactions.map((interaction, index) => { + return ShowInteraction(props.accession, interaction, index) + }) + } + { + // show more + //ShowMore(props.interactions, ShowInteractionAcc(props.accession)) + } + The interacting structure can be visualised in the 3D structure tab. +
) }
} +/* function ShowInteractionAcc(acc: string) { return function(interaction: P2PInteraction, index: number) { return
@@ -292,15 +300,14 @@ function ShowInteractionAcc(acc: string) {
{interaction.pdockq.toFixed(3)}
} -} +}*/ -/* function ShowInteraction(accession: string, interaction: P2PInteraction, index: number) { return
{accession === interaction.a ? interaction.b : interaction.a}
{interaction.pdockq.toFixed(3)}
-}*/ +} function ShowMore(items:any[], showItem:any, page: number = PAGE) { const [itemsToShow, setItemsToShow] = useState(page);