Skip to content

Commit

Permalink
Merge pull request #688 from ProteinsWebTeam/reorganization_interpro_…
Browse files Browse the repository at this point in the history
…scan

Reorganization of the InterPro Scan Search results section
  • Loading branch information
apolignano authored Feb 3, 2025
2 parents 6fc9a93 + 75357e8 commit f3bc74e
Show file tree
Hide file tree
Showing 9 changed files with 380 additions and 263 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/node_modules/@nightingale-elements/nightingale-interpro-track/src/InterproEntryLayout.ts b/node_modules/@nightingale-elements/nightingale-interpro-track/src/InterproEntryLayout.ts
index 8302fc6..ac45de6 100644
index 8302fc6..7f604b1 100644
--- a/node_modules/@nightingale-elements/nightingale-interpro-track/src/InterproEntryLayout.ts
+++ b/node_modules/@nightingale-elements/nightingale-interpro-track/src/InterproEntryLayout.ts
@@ -39,24 +39,30 @@ export default class InterproEntryLayout extends DefaultLayout {
Expand All @@ -11,7 +11,7 @@ index 8302fc6..ac45de6 100644
constructor({
expanded,
padding,
+ samesize,
+ samesize,
...otherOptions
- }: LayoutOptions & { expanded: boolean; padding: number }) {
+ }: LayoutOptions & { expanded: boolean; padding: number, samesize?: boolean }) {
Expand Down Expand Up @@ -77,7 +77,7 @@ index 8302fc6..ac45de6 100644
) {
+
+ let childHeight = this.samesize ? EXPANDED_HEIGHT : CHILD_HEIGHT
+
+
for (let i = 0; i < residues.length; i++) {
const resGroup = residues[i];
InterproEntryLayout.filterOutResidueFragmentsOutOfLocation(
Expand Down
1 change: 1 addition & 0 deletions src/components/IPScan/EntrySubPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const flatMatchesFromIPScanPayload = function* (
yield {
accession: match.signature.entry.accession,
name: match.signature.entry.description,
short_name: match.signature.entry.name,
source_database: 'InterPro',
matches: [
{
Expand Down
11 changes: 8 additions & 3 deletions src/components/IPScan/Summary/serializers.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import { NOT_MEMBER_DBS } from 'menuConfig';
import { iproscan2urlDB } from 'utils/url-patterns';
import {
proteinViewerReorganization,
sectionsReorganization,
} from 'components/Related/DomainsOnProtein';

const OTHER_FEATURES_DBS = ['funfam'];
const OTHER_RESIDUES_DBS = ['pirsr'];
const OTHER_FEATURES_DBS = [''];
const OTHER_RESIDUES_DBS = [''];

type IpScanEntry = {
accession: string;
Expand Down Expand Up @@ -54,7 +58,7 @@ const integrateSignature = (
const match2residues = (match: Iprscan5Match | IpScanMatch) => {
return match.locations
.map(({ sites }) =>
sites
sites?.length && sites?.length > 0
? {
accession: match?.signature?.accession || match?.accession,
locations: sites.map((site) => ({
Expand Down Expand Up @@ -176,6 +180,7 @@ export const mergeData = (
};

const residues = match2residues(match);

if (
residues.length > 0 &&
!OTHER_RESIDUES_DBS.includes(residues?.[0]?.source_database || '')
Expand Down
8 changes: 6 additions & 2 deletions src/components/Matches/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,9 @@ const Matches = ({
name: string,
{
accession,
short_name,
source_database: sourceDatabase,
}: { accession: string; source_database: string },
}: { short_name: string; accession: string; source_database: string },
) => (
<Link
to={
Expand All @@ -420,7 +421,10 @@ const Matches = ({
}
>
<HighlightedText
text={name}
// If name is != ∅, short_name in the counter was found (Protein page case)
// If name is ∅, it means that the short name from the counters was not found (InterProScan results page case), so display short_name from renderer
// If short_name from renderer is null, then leave the cell blank
text={name == '∅' ? (short_name ? short_name : '') : name}
textToHighlight={search?.search as string}
/>
</Link>
Expand Down
5 changes: 3 additions & 2 deletions src/components/ProteinViewer/Popup/Entry/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export type EntryDetail = {
type: string;
entry: string;
protein?: string;
parent?: { protein?: string };
parent?: { protein?: string; accession: string };
locations: Array<ProtVistaLocation>;
confidence?: string;
};
Expand Down Expand Up @@ -55,7 +55,8 @@ const ProtVistaEntryPopup = ({
confidence,
} = detail?.feature || {};
const isInterPro = sourceDatabase.toLowerCase() === 'interpro';
const integrated = detail.feature?.integrated;
const integrated =
detail.feature?.integrated || detail.feature?.parent?.accession;

// To include the type of fragment of the secondary structure
let type = originalType;
Expand Down
11 changes: 9 additions & 2 deletions src/components/ProteinViewer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ export const ProteinViewer = ({
{children}
</Options>
{protein.accession &&
!protein.accession.startsWith('iprscan') &&
mainTracks.length !== Object.entries(hideCategories).length && (
<ShowMoreTracks
showMore={showMore}
Expand Down Expand Up @@ -418,8 +417,16 @@ export const ProteinViewer = ({
const sectionName = typeNameToSectionName[type];

// Show only the main tracks unless button "Show more" is clicked

// TEMPORARY: The second condition in OR is for the special case of families in the Interpro Scan result section: hide the div
// insummary view because representative families are not available, so it'd be empty.
let hideDiv: string = '';
if (!showMore && !mainTracks.includes(type)) {
if (
(!showMore && !mainTracks.includes(type)) ||
(type === 'families' &&
!showMore &&
protein.accession.includes('iprscan'))
) {
hideDiv = 'none';
}

Expand Down
Loading

0 comments on commit f3bc74e

Please sign in to comment.