From d091a9c19a40baa1cc146768bf87a2e8658d995a Mon Sep 17 00:00:00 2001 From: Scott Cain Date: Fri, 9 Feb 2024 10:55:44 -0800 Subject: [PATCH 01/72] first shot at linking to JB2 instead of JB1 --- src/containers/genePage/genomeFeatureWrapper.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/containers/genePage/genomeFeatureWrapper.js b/src/containers/genePage/genomeFeatureWrapper.js index a329f749e..e30b1488b 100644 --- a/src/containers/genePage/genomeFeatureWrapper.js +++ b/src/containers/genePage/genomeFeatureWrapper.js @@ -91,8 +91,12 @@ class GenomeFeatureWrapper extends Component { } generateJBrowseLink(chr, start, end) { - const geneSymbolUrl = '&lookupSymbol=' + this.props.geneSymbol; - const externalJBrowsePrefix = '/jbrowse/?data=data%2F' + encodeURIComponent(getSpecies(this.props.species).jBrowseName); + //const geneSymbolUrl = '&lookupSymbol=' + this.props.geneSymbol; + // maybe will use this ^^^ haven't decided + const assembly = (getSpecies(this.props.species).jBrowseName).replace(" ","_"); + + // this vvv will obviously have to be replaced with a proxied agr url + const externalJBrowsePrefix = 'https://stage.dgaayxgqoarxf.amplifyapp.com/?assembly=' + assembly; const linkLength = end - start; let bufferedMin = Math.round(start - (linkLength * LINK_BUFFER / 2.0)); bufferedMin = bufferedMin < 0 ? 0 : bufferedMin; @@ -102,10 +106,9 @@ class GenomeFeatureWrapper extends Component { } const externalLocationString = chr + ':' + bufferedMin + '..' + bufferedMax; // TODO: handle bufferedMax exceeding chromosome length, though I think it has a good default. - const tracks = ['Variants', 'All Genes','Multiple-Variant Alleles', 'High Throughput Variants']; + const tracks = [assembly+'_variants', assembly+'_all_genes', assembly+'_ht_variants']; return externalJBrowsePrefix + - '&tracks=' + encodeURIComponent(tracks.join(',')) + - '&highlight=' + geneSymbolUrl + + '&tracks=' + tracks.join(',') + '&loc=' + encodeURIComponent(externalLocationString); } From a915be2b4d6e14f5694dd2d73b5d0f648deac0ea Mon Sep 17 00:00:00 2001 From: Scott Cain Date: Tue, 27 Feb 2024 16:27:20 -0800 Subject: [PATCH 02/72] making generated JB2 links use only trackIds for tracks that actually exist (at the expense of an added config option in constants.js) --- src/constants.js | 10 ++++++++++ src/containers/genePage/genomeFeatureWrapper.js | 8 ++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/constants.js b/src/constants.js index e96a731da..2080b7182 100644 --- a/src/constants.js +++ b/src/constants.js @@ -260,6 +260,7 @@ export const SPECIES = [ jBrowsenclistbaseurl: `https://s3.amazonaws.com/agrjbrowse/docker/${RELEASE}/human/`, jBrowseurltemplate: 'tracks/All_Genes/{refseq}/trackData.jsonz', jBrowsefastaurl: 'https://s3.amazonaws.com/agrjbrowse/fasta/GCF_000001405.40_GRCh38.p14_genomic.fna.gz', + jBrowsetracks: '_all_genes,_ht_variants', vertebrate: true, enableSingleCellExpressionAtlasLink: true, enableOrthologComparison: true, @@ -274,6 +275,7 @@ export const SPECIES = [ jBrowsenclistbaseurl: `https://s3.amazonaws.com/agrjbrowse/docker/${RELEASE}/MGI/mouse/`, jBrowseurltemplate: 'tracks/All_Genes/{refseq}/trackData.jsonz', jBrowsefastaurl: 'https://s3.amazonaws.com/agrjbrowse/fasta/GCF_000001635.27_GRCm39_genomic.fna.gz', + jBrowsetracks: '_all_genes,_ht_variants,_variants,_multiple-variant_alleles', vertebrate: true, enableSingleCellExpressionAtlasLink: true, enableOrthologComparison: true, @@ -288,6 +290,7 @@ export const SPECIES = [ jBrowsenclistbaseurl: `https://s3.amazonaws.com/agrjbrowse/docker/${RELEASE}/RGD/rat/`, jBrowseurltemplate: 'tracks/All_Genes/{refseq}/trackData.jsonz', jBrowsefastaurl: 'https://s3.amazonaws.com/agrjbrowse/fasta/GCF_015227675.2_mRatBN7.2_genomic.fna.gz', + jBrowsetracks: '_all_genes,_ht_variants,_variants', vertebrate: true, enableSingleCellExpressionAtlasLink: true, enableOrthologComparison: true, @@ -302,6 +305,7 @@ export const SPECIES = [ jBrowsenclistbaseurl: `https://s3.amazonaws.com/agrjbrowse/docker/${RELEASE}/XenBase/x_laevis/`, jBrowseurltemplate: 'tracks/All_Genes/{refseq}/trackData.jsonz', jBrowsefastaurl: 'https://s3.amazonaws.com/agrjbrowse/fasta/XENLA_9.2_genome.fa.gz', + jBrowsetracks: '_all_genes', vertebrate: true, enableSingleCellExpressionAtlasLink: false, enableOrthologComparison: true, @@ -316,6 +320,7 @@ export const SPECIES = [ jBrowsenclistbaseurl: `https://s3.amazonaws.com/agrjbrowse/docker/${RELEASE}/XenBase/x_tropicalis/`, jBrowseurltemplate: 'tracks/All_Genes/{refseq}/trackData.jsonz', jBrowsefastaurl: 'https://s3.amazonaws.com/agrjbrowse/fasta/XENTR_9.1_genome.fa.gz', + jBrowsetracks: '_all_genes', vertebrate: true, enableSingleCellExpressionAtlasLink: false, enableOrthologComparison: true, @@ -330,6 +335,7 @@ export const SPECIES = [ jBrowsenclistbaseurl: `https://s3.amazonaws.com/agrjbrowse/docker/${RELEASE}/zfin/zebrafish-11/`, jBrowseurltemplate: 'tracks/All_Genes/{refseq}/trackData.jsonz', jBrowsefastaurl: 'https://s3.amazonaws.com/agrjbrowse/fasta/GCF_000002035.6_GRCz11_genomic.fna.gz', + jBrowsetracks: '_all_genes,_ht_variants,_variants', vertebrate: true, enableSingleCellExpressionAtlasLink: true, enableOrthologComparison: true, @@ -344,6 +350,7 @@ export const SPECIES = [ jBrowsenclistbaseurl: `https://s3.amazonaws.com/agrjbrowse/docker/${RELEASE}/FlyBase/fruitfly/`, jBrowseurltemplate: 'tracks/All_Genes/{refseq}/trackData.jsonz', jBrowsefastaurl: 'https://s3.amazonaws.com/agrjbrowse/fasta/GCF_000001215.4_Release_6_plus_ISO1_MT_genomic.fna.gz', + jBrowsetracks: '_all_genes,_ht_variants,_variants,_multiple-variant_alleles', vertebrate: false, enableSingleCellExpressionAtlasLink: true, enableOrthologComparison: true, @@ -358,6 +365,7 @@ export const SPECIES = [ jBrowsenclistbaseurl: `https://s3.amazonaws.com/agrjbrowse/docker/${RELEASE}/WormBase/c_elegans_PRJNA13758/`, jBrowseurltemplate: 'tracks/All_Genes/{refseq}/trackData.jsonz', jBrowsefastaurl: 'https://s3.amazonaws.com/agrjbrowse/fasta/GCF_000002985.6_WBcel235_genomic.fna.gz', + jBrowsetracks: '_all_genes,_ht_variants,_variants', vertebrate: false, enableSingleCellExpressionAtlasLink: true, enableOrthologComparison: true, @@ -372,6 +380,7 @@ export const SPECIES = [ jBrowsenclistbaseurl: `https://s3.amazonaws.com/agrjbrowse/docker/${RELEASE}/SGD/yeast/`, jBrowseurltemplate: 'tracks/All_Genes/{refseq}/trackData.jsonz', jBrowsefastaurl: 'https://s3.amazonaws.com/agrjbrowse/fasta/GCF_000146045.2_R64_genomic.fna.gz', + jBrowsetracks: '_all_genes,_ht_variants', vertebrate: false, enableSingleCellExpressionAtlasLink: true, enableOrthologComparison: true, @@ -386,6 +395,7 @@ export const SPECIES = [ jBrowsenclistbaseurl: `https://s3.amazonaws.com/agrjbrowse/docker/3.2.0/SARS-CoV-2/`, jBrowseurltemplate: 'tracks/All Genes/{refseq}/trackData.jsonz', jBrowsefastaurl: 'https://s3.amazonaws.com/agrjbrowse/fasta/GCF_000001405.40_GRCh38.p14_genomic.fna.gz', + jBrowsetracks: '_all_genes', suppressFlatten: true, vertebrate: false, enableSingleCellExpressionAtlasLink: false, diff --git a/src/containers/genePage/genomeFeatureWrapper.js b/src/containers/genePage/genomeFeatureWrapper.js index e30b1488b..75e6b1d83 100644 --- a/src/containers/genePage/genomeFeatureWrapper.js +++ b/src/containers/genePage/genomeFeatureWrapper.js @@ -96,7 +96,7 @@ class GenomeFeatureWrapper extends Component { const assembly = (getSpecies(this.props.species).jBrowseName).replace(" ","_"); // this vvv will obviously have to be replaced with a proxied agr url - const externalJBrowsePrefix = 'https://stage.dgaayxgqoarxf.amplifyapp.com/?assembly=' + assembly; + const externalJBrowsePrefix = 'https://stage.dgaayxgqoarxf.amplifyapp.com/?tracklist=true&assembly=' + assembly; const linkLength = end - start; let bufferedMin = Math.round(start - (linkLength * LINK_BUFFER / 2.0)); bufferedMin = bufferedMin < 0 ? 0 : bufferedMin; @@ -106,7 +106,11 @@ class GenomeFeatureWrapper extends Component { } const externalLocationString = chr + ':' + bufferedMin + '..' + bufferedMax; // TODO: handle bufferedMax exceeding chromosome length, though I think it has a good default. - const tracks = [assembly+'_variants', assembly+'_all_genes', assembly+'_ht_variants']; + const tracks = []; + const trackList = getSpecies(this.props.species).jBrowsetracks.split(','); + for (const track of trackList) { + tracks.push( assembly + track ); + } return externalJBrowsePrefix + '&tracks=' + tracks.join(',') + '&loc=' + encodeURIComponent(externalLocationString); From cb8b72e8da476ce319f433e6f250354c16454cf6 Mon Sep 17 00:00:00 2001 From: Scott Cain Date: Wed, 28 Feb 2024 12:15:11 -0800 Subject: [PATCH 03/72] fair chance I got the proxy settings for jbrowse2 right --- cdk/amplify-stage-stack.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cdk/amplify-stage-stack.ts b/cdk/amplify-stage-stack.ts index 8c157aac7..6c79b3bf4 100644 --- a/cdk/amplify-stage-stack.ts +++ b/cdk/amplify-stage-stack.ts @@ -17,6 +17,9 @@ export class AmplifyStageStack extends cdk.Stack { const stage_paths = [ { source: '/api/<*>', target: 'https://stage-api.alliancegenome.org/api/<*>', status: amplify.RedirectStatus.REWRITE }, + { source: '/jbrowse2', target: 'https://stage.alliancegenome.org/jbrowse2/', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, + { source: '/jbrowse2/', target: 'https://stage.dgaayxgqoarxf.amplifyapp.com/', status: amplify.RedirectStatus.REWRITE }, + { source: '/jbrowse2/<*>', target: 'https://stage.dgaayxgqoarxf.amplifyapp.com/<*>', status: amplify.RedirectStatus.REWRITE }, { source: '/jbrowse/worms/protein', target: 'https://stage.alliancegenome.org/jbrowse/worms/protein/', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, { source: '/jbrowse/worms/protein/', target: 'https://staging.djgvd7iswt7yy.amplifyapp.com/', status: amplify.RedirectStatus.REWRITE }, { source: '/jbrowse/worms/protein/<*>', target: 'https://staging.djgvd7iswt7yy.amplifyapp.com/<*>', status: amplify.RedirectStatus.REWRITE }, From 0609c8ad2ce37185a47cb96d20092298e2723344 Mon Sep 17 00:00:00 2001 From: Scott Cain Date: Wed, 28 Feb 2024 14:17:56 -0800 Subject: [PATCH 04/72] making the variant jbrowse link generation point at jbrowse2 required adding taxonid as a parameter (which means that the species string could be removed) --- src/components/variant/VariantJBrowseLink.js | 36 ++++++++++++++++--- .../GeneAlleleDetailsTable.js | 1 + .../allelePage/AlleleToVariantTable.js | 2 ++ .../allelePage/VariantEffectDetails.js | 1 + src/containers/allelePage/VariantSummary.js | 3 +- src/containers/genePage/alleleTable.js | 2 +- .../genePage/genomeFeatureWrapper.js | 2 +- 7 files changed, 39 insertions(+), 8 deletions(-) diff --git a/src/components/variant/VariantJBrowseLink.js b/src/components/variant/VariantJBrowseLink.js index eabb97788..0d26f51f7 100644 --- a/src/components/variant/VariantJBrowseLink.js +++ b/src/components/variant/VariantJBrowseLink.js @@ -2,7 +2,11 @@ import React from 'react'; import PropTypes from 'prop-types'; import {stringify as stringifyQuery} from 'qs'; import ExternalLink from '../ExternalLink'; +import { + getSpecies +} from '../../lib/utils'; +// this will return when the get parameter 'highlight' is added to JB2 const calculateHighlight = (location, type) => { switch(type){ case 'insertion': @@ -16,16 +20,37 @@ const calculateHighlight = (location, type) => { } }; -const VariantJBrowseLink = ({children, location, type, geneSymbol, geneLocation, species}) => { + + +const buildTrackList = (taxonid) => { + const tracks = []; + const trackList = getSpecies(taxonid).jBrowsetracks.split(','); + const assembly = buildAssembly(taxonid); + for (const track of trackList) { + tracks.push( assembly + track ); + } + return tracks.join(','); +}; + +const buildAssembly = (taxonid) => { + return getSpecies(taxonid).jBrowseName.replace(' ', '_'); +} + + +const VariantJBrowseLink = ({children, location, type, geneSymbol, geneLocation, species, taxonid}) => { return ( location ? @@ -48,7 +73,8 @@ VariantJBrowseLink.propTypes = { chromosome: PropTypes.string, }), species: PropTypes.string.isRequired, - type: PropTypes.string + type: PropTypes.string, + taxonid: PropTypes.string }; export default VariantJBrowseLink; diff --git a/src/containers/GeneAlleleDetailsPage/GeneAlleleDetailsTable.js b/src/containers/GeneAlleleDetailsPage/GeneAlleleDetailsTable.js index 5807bda66..a460cf4bc 100644 --- a/src/containers/GeneAlleleDetailsPage/GeneAlleleDetailsTable.js +++ b/src/containers/GeneAlleleDetailsPage/GeneAlleleDetailsTable.js @@ -120,6 +120,7 @@ const GeneAlleleDetailsTable = ({ isLoadingGene, gene, geneId }) => { location={variant.location} species={gene.species && gene.species.name} type={variant.variantType && variant.variantType.name} + taxonid={gene.species && gene.species.taxonId} >{variant.displayName} ) : null, diff --git a/src/containers/allelePage/AlleleToVariantTable.js b/src/containers/allelePage/AlleleToVariantTable.js index 669d9fd25..e313f962e 100644 --- a/src/containers/allelePage/AlleleToVariantTable.js +++ b/src/containers/allelePage/AlleleToVariantTable.js @@ -32,6 +32,7 @@ const AlleleToVariantTable = ({allele = {}, alleleId}) => { location={location} species={species.name} type={type.name} + taxonid={species.taxonId} > {name} @@ -94,6 +95,7 @@ AlleleToVariantTable.propTypes = { }), species: PropTypes.shape({ name: PropTypes.string, + taxonid: PropTypes.string }) }), alleleId: PropTypes.any, diff --git a/src/containers/allelePage/VariantEffectDetails.js b/src/containers/allelePage/VariantEffectDetails.js index afb3d532f..4e6de8c03 100644 --- a/src/containers/allelePage/VariantEffectDetails.js +++ b/src/containers/allelePage/VariantEffectDetails.js @@ -63,6 +63,7 @@ const VariantEffectDetails = ({ location={variant.location} species={variant.species && variant.species.name} type={variant.variantType && variant.variantType.name} + taxonid={variant.species && variant.species.taxonId} > {variant.id} on {transcript.name} diff --git a/src/containers/allelePage/VariantSummary.js b/src/containers/allelePage/VariantSummary.js index 0759cc7f3..70197e483 100644 --- a/src/containers/allelePage/VariantSummary.js +++ b/src/containers/allelePage/VariantSummary.js @@ -39,7 +39,7 @@ const VariantSummary = ({variant}) => { } = variant || {}; const genomeLocation = getVariantGenomeLocation(variant); - + console.log(species); return ( <> Symbol @@ -51,6 +51,7 @@ const VariantSummary = ({variant}) => { location={location} species={species && species.name} type={type && type.name} + taxonid={species && species.taxonId} > {symbol || displayName || variantId} diff --git a/src/containers/genePage/alleleTable.js b/src/containers/genePage/alleleTable.js index 40b716eef..2fa14d7f3 100644 --- a/src/containers/genePage/alleleTable.js +++ b/src/containers/genePage/alleleTable.js @@ -19,7 +19,6 @@ import useDataTableQuery from '../../hooks/useDataTableQuery'; import useAllVariants from '../../hooks/useAllVariants'; const AlleleTable = ({ isLoadingGene, gene, geneId}) => { - const geneLocation = getSingleGenomeLocation(gene.genomeLocations); const tableProps = useDataTableQuery(`/api/gene/${geneId}/alleles`); @@ -170,6 +169,7 @@ const AlleleTable = ({ isLoadingGene, gene, geneId}) => { location={location} species={gene.species && gene.species.name} type={type.name} + taxonid={gene.species && gene.species.taxonId} >{id} } diff --git a/src/containers/genePage/genomeFeatureWrapper.js b/src/containers/genePage/genomeFeatureWrapper.js index 75e6b1d83..f691b6d2c 100644 --- a/src/containers/genePage/genomeFeatureWrapper.js +++ b/src/containers/genePage/genomeFeatureWrapper.js @@ -96,7 +96,7 @@ class GenomeFeatureWrapper extends Component { const assembly = (getSpecies(this.props.species).jBrowseName).replace(" ","_"); // this vvv will obviously have to be replaced with a proxied agr url - const externalJBrowsePrefix = 'https://stage.dgaayxgqoarxf.amplifyapp.com/?tracklist=true&assembly=' + assembly; + const externalJBrowsePrefix = '/jbrowse2?tracklist=true&assembly=' + assembly; const linkLength = end - start; let bufferedMin = Math.round(start - (linkLength * LINK_BUFFER / 2.0)); bufferedMin = bufferedMin < 0 ? 0 : bufferedMin; From 12e820e640e86d069e601f9b473c48ff473c2da0 Mon Sep 17 00:00:00 2001 From: Scott Cain Date: Wed, 28 Feb 2024 14:47:40 -0800 Subject: [PATCH 05/72] removing species as an arg since taxonid is required. --- src/components/variant/VariantJBrowseLink.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/variant/VariantJBrowseLink.js b/src/components/variant/VariantJBrowseLink.js index 0d26f51f7..6a1351225 100644 --- a/src/components/variant/VariantJBrowseLink.js +++ b/src/components/variant/VariantJBrowseLink.js @@ -37,7 +37,7 @@ const buildAssembly = (taxonid) => { } -const VariantJBrowseLink = ({children, location, type, geneSymbol, geneLocation, species, taxonid}) => { +const VariantJBrowseLink = ({children, location, type, geneSymbol, geneLocation, taxonid}) => { return ( location ? Date: Wed, 28 Feb 2024 17:29:25 -0800 Subject: [PATCH 06/72] adding jbrowse orthology track templates to constants --- src/constants.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/constants.js b/src/constants.js index 2080b7182..c873ac929 100644 --- a/src/constants.js +++ b/src/constants.js @@ -261,6 +261,7 @@ export const SPECIES = [ jBrowseurltemplate: 'tracks/All_Genes/{refseq}/trackData.jsonz', jBrowsefastaurl: 'https://s3.amazonaws.com/agrjbrowse/fasta/GCF_000001405.40_GRCh38.p14_genomic.fna.gz', jBrowsetracks: '_all_genes,_ht_variants', + jBrowseOrthologyTracks: 'human2fly.filter.anchors,human2mouse.filter.anchors,human2rat.filter.anchors,human2worm.filter.anchors,human2xenopuslaevis.filter.anchors,human2xenopustropicalis.filter.anchors,human2yeast.filter.anchors,human2zebrafish.filter.anchors', vertebrate: true, enableSingleCellExpressionAtlasLink: true, enableOrthologComparison: true, @@ -276,6 +277,7 @@ export const SPECIES = [ jBrowseurltemplate: 'tracks/All_Genes/{refseq}/trackData.jsonz', jBrowsefastaurl: 'https://s3.amazonaws.com/agrjbrowse/fasta/GCF_000001635.27_GRCm39_genomic.fna.gz', jBrowsetracks: '_all_genes,_ht_variants,_variants,_multiple-variant_alleles', + jBrowseOrthologyTracks:'human2mouse.filter.anchors,mouse2fly.filter.anchors,mouse2worm.filter.anchors,mouse2xenopustropicalis.filter.anchors,mouse2yeast.filter.anchors,mouse2zebrafish.filter.anchors,rat2mouse.filter.anchors', vertebrate: true, enableSingleCellExpressionAtlasLink: true, enableOrthologComparison: true, @@ -291,6 +293,7 @@ export const SPECIES = [ jBrowseurltemplate: 'tracks/All_Genes/{refseq}/trackData.jsonz', jBrowsefastaurl: 'https://s3.amazonaws.com/agrjbrowse/fasta/GCF_015227675.2_mRatBN7.2_genomic.fna.gz', jBrowsetracks: '_all_genes,_ht_variants,_variants', + jBrowseOrthologyTracks:'human2rat.filter.anchors,rat2fly.filter.anchors,rat2mouse.filter.anchors,rat2worm.filter.anchors,rat2xenopustropicalis.filter.anchors,rat2yeast.filter.anchors,rat2zebrafish.filter.anchors', vertebrate: true, enableSingleCellExpressionAtlasLink: true, enableOrthologComparison: true, @@ -306,6 +309,7 @@ export const SPECIES = [ jBrowseurltemplate: 'tracks/All_Genes/{refseq}/trackData.jsonz', jBrowsefastaurl: 'https://s3.amazonaws.com/agrjbrowse/fasta/XENLA_9.2_genome.fa.gz', jBrowsetracks: '_all_genes', + jBrowseOrthologyTracks:'human2xenopuslaevis.filter.anchors,xenopuslaevis2xenopustropicalis.filter.anchors', vertebrate: true, enableSingleCellExpressionAtlasLink: false, enableOrthologComparison: true, @@ -321,6 +325,7 @@ export const SPECIES = [ jBrowseurltemplate: 'tracks/All_Genes/{refseq}/trackData.jsonz', jBrowsefastaurl: 'https://s3.amazonaws.com/agrjbrowse/fasta/XENTR_9.1_genome.fa.gz', jBrowsetracks: '_all_genes', + jBrowseOrthologyTracks:'human2xenopustropicalis.filter.anchors,mouse2xenopustropicalis.filter.anchors,rat2xenopustropicalis.filter.anchors,xenopuslaevis2xenopustropicalis.filter.anchors,xenopustropicalis2fly.filter.anchors,xenopustropicalis2worm.filter.anchors,xenopustropicalis2yeast.filter.anchors,zebrafish2xenopustropicalis.filter.anchors', vertebrate: true, enableSingleCellExpressionAtlasLink: false, enableOrthologComparison: true, @@ -336,6 +341,7 @@ export const SPECIES = [ jBrowseurltemplate: 'tracks/All_Genes/{refseq}/trackData.jsonz', jBrowsefastaurl: 'https://s3.amazonaws.com/agrjbrowse/fasta/GCF_000002035.6_GRCz11_genomic.fna.gz', jBrowsetracks: '_all_genes,_ht_variants,_variants', + jBrowseOrthologyTracks:'human2zebrafish.filter.anchors,mouse2zebrafish.filter.anchors,rat2zebrafish.filter.anchors,zebrafish2fly.filter.anchors,zebrafish2worm.filter.anchors,zebrafish2xenopustropicalis.filter.anchors,zebrafish2yeast.filter.anchors', vertebrate: true, enableSingleCellExpressionAtlasLink: true, enableOrthologComparison: true, @@ -351,6 +357,7 @@ export const SPECIES = [ jBrowseurltemplate: 'tracks/All_Genes/{refseq}/trackData.jsonz', jBrowsefastaurl: 'https://s3.amazonaws.com/agrjbrowse/fasta/GCF_000001215.4_Release_6_plus_ISO1_MT_genomic.fna.gz', jBrowsetracks: '_all_genes,_ht_variants,_variants,_multiple-variant_alleles', + jBrowseOrthologyTracks:'fly2yeast.filter.anchors,human2fly.filter.anchors,mouse2fly.filter.anchors,rat2fly.filter.anchors,worm2fly.filter.anchors,xenopustropicalis2fly.filter.anchors,zebrafish2fly.filter.anchors', vertebrate: false, enableSingleCellExpressionAtlasLink: true, enableOrthologComparison: true, @@ -366,6 +373,7 @@ export const SPECIES = [ jBrowseurltemplate: 'tracks/All_Genes/{refseq}/trackData.jsonz', jBrowsefastaurl: 'https://s3.amazonaws.com/agrjbrowse/fasta/GCF_000002985.6_WBcel235_genomic.fna.gz', jBrowsetracks: '_all_genes,_ht_variants,_variants', + jBrowseOrthologyTracks:'human2worm.filter.anchors,mouse2worm.filter.anchors,rat2worm.filter.anchors,worm2fly.filter.anchors,worm2yeast.filter.anchors,xenopustropicalis2worm.filter.anchors,zebrafish2worm.filter.anchors', vertebrate: false, enableSingleCellExpressionAtlasLink: true, enableOrthologComparison: true, @@ -381,6 +389,7 @@ export const SPECIES = [ jBrowseurltemplate: 'tracks/All_Genes/{refseq}/trackData.jsonz', jBrowsefastaurl: 'https://s3.amazonaws.com/agrjbrowse/fasta/GCF_000146045.2_R64_genomic.fna.gz', jBrowsetracks: '_all_genes,_ht_variants', + jBrowseOrthologyTracks:'fly2yeast.filter.anchors,human2yeast.filter.anchors,mouse2yeast.filter.anchors,rat2yeast.filter.anchors,worm2yeast.filter.anchors,xenopustropicalis2yeast.filter.anchors,zebrafish2yeast.filter.anchors', vertebrate: false, enableSingleCellExpressionAtlasLink: true, enableOrthologComparison: true, From 99c0c79b61240cae4548c702081ccf5b31056eda Mon Sep 17 00:00:00 2001 From: dustine32 Date: Thu, 29 Feb 2024 10:19:09 -0800 Subject: [PATCH 07/72] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9233b2bc0..07f78b57f 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "@fortawesome/free-solid-svg-icons": "^6.4.2", "@fortawesome/react-fontawesome": "^0.2.0", "@geneontology/curie-util-es5": "^1.2.4", - "@geneontology/wc-gocam-viz": "0.0.51", + "@geneontology/wc-gocam-viz": "1.0.0", "@geneontology/wc-ribbon-strips": "0.0.37", "@geneontology/wc-ribbon-table": "0.0.57", "@testing-library/jest-dom": "^5.16.1", From a7327d4d7d98ac5db9e1126c09840a133411c625 Mon Sep 17 00:00:00 2001 From: Scott Cain Date: Thu, 29 Feb 2024 12:56:29 -0800 Subject: [PATCH 08/72] added error checking for unlocalized genes and cleaned up presentation a little bit --- src/components/orthology/index.js | 4 ++ .../orthology/orthologyJBrowseLink.js | 57 +++++++++++++++++++ .../orthology/orthologyJBrowseLinkPanel.js | 57 +++++++++++++++++++ src/constants.js | 18 +++--- src/containers/genePage/index.js | 11 +++- 5 files changed, 137 insertions(+), 10 deletions(-) create mode 100644 src/components/orthology/orthologyJBrowseLink.js create mode 100644 src/components/orthology/orthologyJBrowseLinkPanel.js diff --git a/src/components/orthology/index.js b/src/components/orthology/index.js index 52e834d71..ea5eb54b0 100644 --- a/src/components/orthology/index.js +++ b/src/components/orthology/index.js @@ -3,6 +3,8 @@ import OrthologyFilteredTable from './orthologyFilteredTable'; import HomologyUserGuide from '../homology/homologyUserGuide'; import OrthologyBasicInfo from './orthologyBasicInfo'; import StringencySelection from '../homology/stringencySelection'; +import OrthologyJBrowseLink from './orthologyJBrowseLink'; +import OrthologyJBrowseLinkPanel from './orthologyJBrowseLinkPanel'; export { OrthologyBasicInfo, @@ -10,6 +12,8 @@ export { OrthologyFilteredTable, HomologyUserGuide, StringencySelection, + OrthologyJBrowseLink, + OrthologyJBrowseLinkPanel }; export * from '../homology/utils'; diff --git a/src/components/orthology/orthologyJBrowseLink.js b/src/components/orthology/orthologyJBrowseLink.js new file mode 100644 index 000000000..c1805a364 --- /dev/null +++ b/src/components/orthology/orthologyJBrowseLink.js @@ -0,0 +1,57 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import {stringify as stringifyQuery} from 'qs'; +import ExternalLink from '../ExternalLink'; +import { + getSpecies +} from '../../lib/utils'; + +const buildTrackList = (taxonid,filterlevel) => { + const trackList = getSpecies(taxonid).jBrowseOrthologyTracks.replace(/filter/g, filterlevel); + return trackList; +}; + +const buildAssembly = (taxonid) => { + return getSpecies(taxonid).jBrowseName.replace(' ', '_'); +} + +const buildLocation = (geneLocation, taxonid) => { + const chrom = (taxonid === 'NCBITaxon:559292' || (taxonid === 'NCBITaxon:8355' && !(geneLocation.chromosome.startsWith('Scaffold')) ) ) + ? 'chr' + geneLocation.chromosome : geneLocation.chromosome; + return chrom + ':' + geneLocation.start + '..' + geneLocation.end; +} + +const buildAnchor = (filterlevel) => { + return filterlevel === 'none' ? 'No filter' + : filterlevel === 'best' ? 'Best and Best Reverse' + : filterlevel === 'moderate' ? 'Moderate' + : filterlevel === 'stringent' ? 'Stringent' : ''; +} + +const OrthologyJBrowseLink = ({filterlevel, geneLocation, taxonid}) => { + return ( + + {buildAnchor(filterlevel)} + + ); +}; + +OrthologyJBrowseLink.propTypes = { + children: PropTypes.node, + geneLocation: PropTypes.shape({ + start: PropTypes.number, + end: PropTypes.number, + chromosome: PropTypes.string, + }), + taxonid: PropTypes.string.isRequired, + filterlevel: PropTypes.string.isRequired +}; + +export default OrthologyJBrowseLink; diff --git a/src/components/orthology/orthologyJBrowseLinkPanel.js b/src/components/orthology/orthologyJBrowseLinkPanel.js new file mode 100644 index 000000000..f794eff43 --- /dev/null +++ b/src/components/orthology/orthologyJBrowseLinkPanel.js @@ -0,0 +1,57 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import OrthologyJBrowseLink from './orthologyJBrowseLink'; + +const geneLocationIsInvalid = (geneLocation) => { + if (typeof geneLocation.chromosome === 'undefined') { + return true; + } else if (typeof geneLocation.start === 'undefined') { + return true; + } else if (typeof geneLocation.end === 'undefined') { + return true; + } + return false; +} + +const OrthologyJBrowseLinkPanel = ({geneLocation, taxonid}) => { + return ( + geneLocationIsInvalid(geneLocation) ? null : +
+ Links to orthology data in JBrowse by filter level: + + ,   + + ,   + + ,   + +
+ ); +}; + +OrthologyJBrowseLinkPanel.propTypes = { + geneLocation: PropTypes.shape({ + start: PropTypes.number, + end: PropTypes.number, + chromosome: PropTypes.string, + }), + taxonid: PropTypes.string.isRequired +}; + +export default OrthologyJBrowseLinkPanel; diff --git a/src/constants.js b/src/constants.js index c873ac929..7f58afff0 100644 --- a/src/constants.js +++ b/src/constants.js @@ -261,7 +261,7 @@ export const SPECIES = [ jBrowseurltemplate: 'tracks/All_Genes/{refseq}/trackData.jsonz', jBrowsefastaurl: 'https://s3.amazonaws.com/agrjbrowse/fasta/GCF_000001405.40_GRCh38.p14_genomic.fna.gz', jBrowsetracks: '_all_genes,_ht_variants', - jBrowseOrthologyTracks: 'human2fly.filter.anchors,human2mouse.filter.anchors,human2rat.filter.anchors,human2worm.filter.anchors,human2xenopuslaevis.filter.anchors,human2xenopustropicalis.filter.anchors,human2yeast.filter.anchors,human2zebrafish.filter.anchors', + jBrowseOrthologyTracks: 'Homo_sapiens_all_genes,human2fly.filter.anchors,human2mouse.filter.anchors,human2rat.filter.anchors,human2worm.filter.anchors,human2xenopuslaevis.filter.anchors,human2xenopustropicalis.filter.anchors,human2yeast.filter.anchors,human2zebrafish.filter.anchors', vertebrate: true, enableSingleCellExpressionAtlasLink: true, enableOrthologComparison: true, @@ -277,7 +277,7 @@ export const SPECIES = [ jBrowseurltemplate: 'tracks/All_Genes/{refseq}/trackData.jsonz', jBrowsefastaurl: 'https://s3.amazonaws.com/agrjbrowse/fasta/GCF_000001635.27_GRCm39_genomic.fna.gz', jBrowsetracks: '_all_genes,_ht_variants,_variants,_multiple-variant_alleles', - jBrowseOrthologyTracks:'human2mouse.filter.anchors,mouse2fly.filter.anchors,mouse2worm.filter.anchors,mouse2xenopustropicalis.filter.anchors,mouse2yeast.filter.anchors,mouse2zebrafish.filter.anchors,rat2mouse.filter.anchors', + jBrowseOrthologyTracks:'Mus_musculus_all_genes,human2mouse.filter.anchors,mouse2fly.filter.anchors,mouse2worm.filter.anchors,mouse2xenopustropicalis.filter.anchors,mouse2yeast.filter.anchors,mouse2zebrafish.filter.anchors,rat2mouse.filter.anchors', vertebrate: true, enableSingleCellExpressionAtlasLink: true, enableOrthologComparison: true, @@ -293,7 +293,7 @@ export const SPECIES = [ jBrowseurltemplate: 'tracks/All_Genes/{refseq}/trackData.jsonz', jBrowsefastaurl: 'https://s3.amazonaws.com/agrjbrowse/fasta/GCF_015227675.2_mRatBN7.2_genomic.fna.gz', jBrowsetracks: '_all_genes,_ht_variants,_variants', - jBrowseOrthologyTracks:'human2rat.filter.anchors,rat2fly.filter.anchors,rat2mouse.filter.anchors,rat2worm.filter.anchors,rat2xenopustropicalis.filter.anchors,rat2yeast.filter.anchors,rat2zebrafish.filter.anchors', + jBrowseOrthologyTracks:'Rattus_norvegicus_all_genes,human2rat.filter.anchors,rat2fly.filter.anchors,rat2mouse.filter.anchors,rat2worm.filter.anchors,rat2xenopustropicalis.filter.anchors,rat2yeast.filter.anchors,rat2zebrafish.filter.anchors', vertebrate: true, enableSingleCellExpressionAtlasLink: true, enableOrthologComparison: true, @@ -309,7 +309,7 @@ export const SPECIES = [ jBrowseurltemplate: 'tracks/All_Genes/{refseq}/trackData.jsonz', jBrowsefastaurl: 'https://s3.amazonaws.com/agrjbrowse/fasta/XENLA_9.2_genome.fa.gz', jBrowsetracks: '_all_genes', - jBrowseOrthologyTracks:'human2xenopuslaevis.filter.anchors,xenopuslaevis2xenopustropicalis.filter.anchors', + jBrowseOrthologyTracks:'Xenopus_laevis_all_genes,human2xenopuslaevis.filter.anchors,xenopuslaevis2xenopustropicalis.filter.anchors', vertebrate: true, enableSingleCellExpressionAtlasLink: false, enableOrthologComparison: true, @@ -325,7 +325,7 @@ export const SPECIES = [ jBrowseurltemplate: 'tracks/All_Genes/{refseq}/trackData.jsonz', jBrowsefastaurl: 'https://s3.amazonaws.com/agrjbrowse/fasta/XENTR_9.1_genome.fa.gz', jBrowsetracks: '_all_genes', - jBrowseOrthologyTracks:'human2xenopustropicalis.filter.anchors,mouse2xenopustropicalis.filter.anchors,rat2xenopustropicalis.filter.anchors,xenopuslaevis2xenopustropicalis.filter.anchors,xenopustropicalis2fly.filter.anchors,xenopustropicalis2worm.filter.anchors,xenopustropicalis2yeast.filter.anchors,zebrafish2xenopustropicalis.filter.anchors', + jBrowseOrthologyTracks:'Xenopus_tropicalis_all_genes,human2xenopustropicalis.filter.anchors,mouse2xenopustropicalis.filter.anchors,rat2xenopustropicalis.filter.anchors,xenopuslaevis2xenopustropicalis.filter.anchors,xenopustropicalis2fly.filter.anchors,xenopustropicalis2worm.filter.anchors,xenopustropicalis2yeast.filter.anchors,zebrafish2xenopustropicalis.filter.anchors', vertebrate: true, enableSingleCellExpressionAtlasLink: false, enableOrthologComparison: true, @@ -341,7 +341,7 @@ export const SPECIES = [ jBrowseurltemplate: 'tracks/All_Genes/{refseq}/trackData.jsonz', jBrowsefastaurl: 'https://s3.amazonaws.com/agrjbrowse/fasta/GCF_000002035.6_GRCz11_genomic.fna.gz', jBrowsetracks: '_all_genes,_ht_variants,_variants', - jBrowseOrthologyTracks:'human2zebrafish.filter.anchors,mouse2zebrafish.filter.anchors,rat2zebrafish.filter.anchors,zebrafish2fly.filter.anchors,zebrafish2worm.filter.anchors,zebrafish2xenopustropicalis.filter.anchors,zebrafish2yeast.filter.anchors', + jBrowseOrthologyTracks:'Danio_rerio_all_genes,human2zebrafish.filter.anchors,mouse2zebrafish.filter.anchors,rat2zebrafish.filter.anchors,zebrafish2fly.filter.anchors,zebrafish2worm.filter.anchors,zebrafish2xenopustropicalis.filter.anchors,zebrafish2yeast.filter.anchors', vertebrate: true, enableSingleCellExpressionAtlasLink: true, enableOrthologComparison: true, @@ -357,7 +357,7 @@ export const SPECIES = [ jBrowseurltemplate: 'tracks/All_Genes/{refseq}/trackData.jsonz', jBrowsefastaurl: 'https://s3.amazonaws.com/agrjbrowse/fasta/GCF_000001215.4_Release_6_plus_ISO1_MT_genomic.fna.gz', jBrowsetracks: '_all_genes,_ht_variants,_variants,_multiple-variant_alleles', - jBrowseOrthologyTracks:'fly2yeast.filter.anchors,human2fly.filter.anchors,mouse2fly.filter.anchors,rat2fly.filter.anchors,worm2fly.filter.anchors,xenopustropicalis2fly.filter.anchors,zebrafish2fly.filter.anchors', + jBrowseOrthologyTracks:'Drosophila_melanogaster_all_genes,fly2yeast.filter.anchors,human2fly.filter.anchors,mouse2fly.filter.anchors,rat2fly.filter.anchors,worm2fly.filter.anchors,xenopustropicalis2fly.filter.anchors,zebrafish2fly.filter.anchors', vertebrate: false, enableSingleCellExpressionAtlasLink: true, enableOrthologComparison: true, @@ -373,7 +373,7 @@ export const SPECIES = [ jBrowseurltemplate: 'tracks/All_Genes/{refseq}/trackData.jsonz', jBrowsefastaurl: 'https://s3.amazonaws.com/agrjbrowse/fasta/GCF_000002985.6_WBcel235_genomic.fna.gz', jBrowsetracks: '_all_genes,_ht_variants,_variants', - jBrowseOrthologyTracks:'human2worm.filter.anchors,mouse2worm.filter.anchors,rat2worm.filter.anchors,worm2fly.filter.anchors,worm2yeast.filter.anchors,xenopustropicalis2worm.filter.anchors,zebrafish2worm.filter.anchors', + jBrowseOrthologyTracks:'Caenorhabditis_elegans_all_genes,human2worm.filter.anchors,mouse2worm.filter.anchors,rat2worm.filter.anchors,worm2fly.filter.anchors,worm2yeast.filter.anchors,xenopustropicalis2worm.filter.anchors,zebrafish2worm.filter.anchors', vertebrate: false, enableSingleCellExpressionAtlasLink: true, enableOrthologComparison: true, @@ -389,7 +389,7 @@ export const SPECIES = [ jBrowseurltemplate: 'tracks/All_Genes/{refseq}/trackData.jsonz', jBrowsefastaurl: 'https://s3.amazonaws.com/agrjbrowse/fasta/GCF_000146045.2_R64_genomic.fna.gz', jBrowsetracks: '_all_genes,_ht_variants', - jBrowseOrthologyTracks:'fly2yeast.filter.anchors,human2yeast.filter.anchors,mouse2yeast.filter.anchors,rat2yeast.filter.anchors,worm2yeast.filter.anchors,xenopustropicalis2yeast.filter.anchors,zebrafish2yeast.filter.anchors', + jBrowseOrthologyTracks:'Saccharomyces_cerevisiae_all_genes,fly2yeast.filter.anchors,human2yeast.filter.anchors,mouse2yeast.filter.anchors,rat2yeast.filter.anchors,worm2yeast.filter.anchors,xenopustropicalis2yeast.filter.anchors,zebrafish2yeast.filter.anchors', vertebrate: false, enableSingleCellExpressionAtlasLink: true, enableOrthologComparison: true, diff --git a/src/containers/genePage/index.js b/src/containers/genePage/index.js index f4876d16b..549ded6da 100644 --- a/src/containers/genePage/index.js +++ b/src/containers/genePage/index.js @@ -2,7 +2,12 @@ import React from 'react'; import PropTypes from 'prop-types'; import { DataPage, PageNav, PageData, PageHeader } from '../../components/dataPage'; import BasicGeneInfo from './basicGeneInfo'; -import { OrthologyFilteredTable, HomologyUserGuide, OrthologyBasicInfo } from '../../components/orthology'; +import { + OrthologyFilteredTable, + HomologyUserGuide, + OrthologyBasicInfo, + OrthologyJBrowseLinkPanel +} from '../../components/orthology'; import ParalogyTable from '../../components/paralogy/paralogyTable' import ParalogyUserGuide from '../../components/paralogy/paralogyUserGuide' import GoUserGuide from '../../components/geneOntologyRibbon/goUserGuide'; @@ -135,6 +140,10 @@ const GenePage = ({geneId}) => { } title={ORTHOLOGY}> + } title={PARALOGY}> From 9a93049fbe2b9862953bb4fea1d64935f31ebc0e Mon Sep 17 00:00:00 2001 From: Scott Cain Date: Thu, 29 Feb 2024 13:00:22 -0800 Subject: [PATCH 09/72] forgot the '2' on the jbrowse2 link --- src/components/orthology/orthologyJBrowseLink.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/orthology/orthologyJBrowseLink.js b/src/components/orthology/orthologyJBrowseLink.js index c1805a364..ac1e1cd29 100644 --- a/src/components/orthology/orthologyJBrowseLink.js +++ b/src/components/orthology/orthologyJBrowseLink.js @@ -31,7 +31,7 @@ const buildAnchor = (filterlevel) => { const OrthologyJBrowseLink = ({filterlevel, geneLocation, taxonid}) => { return ( Date: Thu, 29 Feb 2024 17:10:04 -0800 Subject: [PATCH 10/72] Added the default styles for gocam-viz --- src/style.scss | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/src/style.scss b/src/style.scss index bb549479e..8ba9902ed 100644 --- a/src/style.scss +++ b/src/style.scss @@ -124,4 +124,48 @@ wc-ribbon-cell.ribbon__subject--cell--no-annotation { --gocam-panel-process-font-weight: 400; --gocam-panel-h1-color: #2598C5; --gocam-panel-h1-weight: 400; +} + +wc-gocam-viz { + --activity-background-active: #af732a; + --activity-color-active: #fff; + --button-background: #DDD; + --button-color: #000; + --button-background-hover: #BBB; + --button-border-width: 1px; + --button-border-color: #ccc; + + // Panel + --panel-header-background: #ececec; + --panel-border-color: #AAA; + + // Process + --process-label-background: #7a548d; + --process-label-color: #fff; + + --process-label-padding: 0.5rem; + --activity-padding: 0.5rem; + --gene-product-padding: 0 0 0.5rem 0; + --function-label-padding: 0 0 0.5rem 0; + + --graph-padding: 8px; + +--panel-header-padding: 8px; + +--panel-border-color: #CCC; + +--panel-border-width: 1px; +--process-border-width: 1px; + + +//Legend +--legend-padding: 8px; +--legend-header-padding: 8px; + +} + + +.gocam-viz-legend-container { + padding: 0 1.2rem; + width: 800px; } \ No newline at end of file From 5af317245b42dba865c4e9fe5b13394a81dad4b6 Mon Sep 17 00:00:00 2001 From: Tremayne Date: Thu, 29 Feb 2024 17:13:14 -0800 Subject: [PATCH 11/72] updated the gocam-viz to display current legend --- src/components/pathway/pathwayWidget.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/components/pathway/pathwayWidget.js b/src/components/pathway/pathwayWidget.js index a3c8018fb..03fa96f77 100644 --- a/src/components/pathway/pathwayWidget.js +++ b/src/components/pathway/pathwayWidget.js @@ -482,18 +482,10 @@ class PathwayWidget extends Component {
- + show-legend="true" + style={{ "maxWidth": "1280px" }}> +
:
From 5c9203af3187fba16927f907d0db996ac91b7c6d Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Wed, 21 Feb 2024 09:38:49 -0600 Subject: [PATCH 12/72] SCRUM-2025 update DiseaseToGeneTable for PG DAs --- .../diseasePage/DiseaseToGeneTable.js | 147 ++++++++---------- 1 file changed, 63 insertions(+), 84 deletions(-) diff --git a/src/containers/diseasePage/DiseaseToGeneTable.js b/src/containers/diseasePage/DiseaseToGeneTable.js index 72fbfee68..155bac446 100644 --- a/src/containers/diseasePage/DiseaseToGeneTable.js +++ b/src/containers/diseasePage/DiseaseToGeneTable.js @@ -1,26 +1,23 @@ import React from 'react'; import PropTypes from 'prop-types'; import { - EvidenceCodesCell, - GeneCell, - ReferenceCell, - SpeciesCell, + BasedOnGeneCellCuration, DataTable, - BasedOnGeneCell + EvidenceCodesCellCuration, + GeneCellCuration, + ReferencesCellCuration, } from '../../components/dataTable'; -import { - compareByFixedOrder, -} from '../../lib/utils'; -import AnnotatedEntitiesPopup - from '../../components/dataTable/AnnotatedEntitiesPopup'; -import DiseaseLink from '../../components/disease/DiseaseLink'; -import {getDistinctFieldValue} from '../../components/dataTable/utils'; -import {SPECIES_NAME_ORDER} from '../../constants'; -import ProvidersCell from '../../components/dataTable/ProvidersCell'; + +import ProvidersCellCuration from '../../components/dataTable/ProvidersCellCuration'; import useDataTableQuery from '../../hooks/useDataTableQuery'; -import SpeciesName from '../../components/SpeciesName'; import AssociationType from '../../components/AssociationType'; +import { buildProvidersWithUrl } from '../../components/dataTable/utils'; +import SpeciesCell from '../../components/dataTable/SpeciesCell'; +import DiseaseLinkCuration from '../../components/disease/DiseaseLinkCuration'; +import DiseaseQualifiersColumn from '../../components/dataTable/DiseaseQualifiersColumn'; +//TODO: once tickets SCRUM-3647, SCRUM-3648, and SCRUM-3649 are complete, refactor this and the diseaseAnnotationTable component +//if needed const DiseaseToGeneTable = ({id}) => { const { data: results, @@ -28,112 +25,94 @@ const DiseaseToGeneTable = ({id}) => { ...tableProps } = useDataTableQuery(`/api/disease/${id}/genes`, undefined, { sizePerPage: 10, }, {}, 60000); - const columns = [ + let columns = [ { - dataField: 'gene', + dataField: 'subject.taxon', + text: 'Species', + headerStyle: {width: '100px'}, + formatter: species => , + }, + { + dataField: 'subject.curie', text: 'Gene', - formatter: (gene, row) => ( + formatter: (curie, row) => ( -
{GeneCell(gene)}
- - - Annotation details - - +
{GeneCellCuration(row.subject)}
), - filterable: true, - filterName: 'geneName', - headerStyle: {width: '120px'}, - }, - { - dataField: 'species', - text: 'Species', - formatter: species => , - filterable: getDistinctFieldValue(resolvedData, 'species').sort(compareByFixedOrder(SPECIES_NAME_ORDER)), - filterFormatter: speciesName => {speciesName}, - headerStyle: {width: '105px'}, + headerStyle: {width: '75px'}, }, { - dataField: 'associationType', + dataField: 'generatedRelationString', text: 'Association', + helpPopupProps: { + id: 'disease-page--gene-disease-associations-table--association-help', + children:
+

"Is Implicated in" means that some variant of the gene is shown to function in causing or modifying a disease (for human) or a disease model state.

+

"Is a marker for" is used when there is evidence of an association but insufficient evidence to establish causality and does not necessarily imply that the existence of, or change in the biomarker is causal for the disease, but rather may result from it.

+
, + }, formatter: type => , - filterable: getDistinctFieldValue(resolvedData, 'associationType'), - filterFormatter: type => , - headerStyle: {width: '110px'}, + headerStyle: {width: '120px'}, }, { - dataField: 'disease', + dataField: 'diseaseQualifiers', + text: 'Disease Qualifier', + headerStyle: {width: '100px'}, + formatter: diseaseQualifiers => , + }, + { + dataField: 'object.curie', text: 'Disease', - formatter: disease => , - filterable: true, headerStyle: {width: '150px'}, + formatter: (curie, row) => , }, { dataField: 'evidenceCodes', text: 'Evidence', - formatter: codes => , - filterable: true, - filterName: 'evidenceCode', - headerStyle: {width: '95px'}, - }, - { - dataField: 'orthologyGenes', - text: 'Based On', - formatter: BasedOnGeneCell, - filterable: true, - filterName: 'basedOnGeneSymbol', - headerStyle: {width: '120px'}, + helpPopupProps: { + id: 'disease-page--gene-disease-associations-table--evidence-help', + children: Mouse-over to decipher the evidence code. The Alliance uses these evidence codes to justify DO annotations., + }, + headerStyle: {width: '100px'}, + formatter: codes => , }, { dataField: 'providers', text: 'Source', - formatter: providers => providers && - , - filterable: true, - headerStyle: {width: '85px'}, - filterName: 'provider', + formatter: providers => providers && , + headerStyle: {width: '100px'}, }, { - dataField: 'publications', + dataField: 'basedOnGenes', + text: 'Based On', + helpPopupProps: { + id: 'disease-page--gene-disease-associations-table--based-on-help', + children: SGD uses orthology to human genes to associate yeast genes with the disease. + }, + headerStyle: {width: '100px'}, + formatter: BasedOnGeneCellCuration, + }, + { + dataField: 'references', text: 'References', - formatter: ReferenceCell, - filterable: true, - filterName: 'reference', headerStyle: {width: '150px'}, - }, + formatter: ReferencesCellCuration, + } ]; - // need to pull out species in a separate field because we can't have - // two columns based on the gene field const rows = results.map(association => ({ - species: association.gene.species, + species: association.subject.taxon, + providers: buildProvidersWithUrl(association.primaryAnnotations), ...association, })); - const sortOptions = [ - { - value: 'disease', - label: 'Disease', - }, - { - value: 'gene', - label: 'Gene', - }, - { - value: 'species', - label: 'Species', - }, - ]; - return ( ); }; From 47991a3db5df80415936a602f699109be202b5a6 Mon Sep 17 00:00:00 2001 From: Olin Blodgett Date: Thu, 22 Feb 2024 14:33:43 -0500 Subject: [PATCH 13/72] Added dockerfile for ui build --- Dockerfile | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..941267f56 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +ARG DOCKER_PULL_TAG=latest +ARG REG=100225593120.dkr.ecr.us-east-1.amazonaws.com +FROM ${REG}/agr_base_linux_env:${DOCKER_PULL_TAG} as build-stage + +WORKDIR /workdir/agr_ui + +ADD . . + +RUN mkdir /workdir/agr_ui/build + +ARG NODE_ENV=production +ENV NODE_ENV ${NODE_ENV} + +RUN /bin/bash -c 'PS1=x && . /root/.profile && nvm install && nvm use && npm install --legacy-peer-deps' + +#FROM nginx + +#WORKDIR /workdir/agr_ui/build + +#COPY --from=build-stage /workdir/agr_ui/build /workdir/agr_ui/build +#COPY --from=build-stage /workdir/agr_ui/nginx.conf /etc/nginx/conf.d/default.conf + +#EXPOSE 3000 From b2c2bb43d974783722fff1ab2bcc6b3a1810fd0e Mon Sep 17 00:00:00 2001 From: Olin Blodgett Date: Thu, 22 Feb 2024 14:42:48 -0500 Subject: [PATCH 14/72] Reverted deleted files --- .dockerignore | 4 ++++ .editorconfig | 13 +++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 .dockerignore create mode 100644 .editorconfig diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..e50316821 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +node_modules +npm-debug.log +.git +dist diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..6e87a003d --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +# Editor configuration, see http://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +max_line_length = off +trim_trailing_whitespace = false From a785af1116a9231da62e5b9131a31445c97936c8 Mon Sep 17 00:00:00 2001 From: Olin Blodgett Date: Thu, 22 Feb 2024 14:43:08 -0500 Subject: [PATCH 15/72] Reverted deleted files --- .dockerignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.dockerignore b/.dockerignore index e50316821..0f61a1a1b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,3 +2,4 @@ node_modules npm-debug.log .git dist +package-lock.json From 626628732c3e72c0cf4de64a963d5781bc8039fd Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Thu, 22 Feb 2024 14:37:16 -0600 Subject: [PATCH 16/72] update package.json and Dockerfile --- Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 941267f56..1490f5497 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,13 +11,13 @@ RUN mkdir /workdir/agr_ui/build ARG NODE_ENV=production ENV NODE_ENV ${NODE_ENV} -RUN /bin/bash -c 'PS1=x && . /root/.profile && nvm install && nvm use && npm install --legacy-peer-deps' +RUN /bin/bash -c 'PS1=x && . /root/.profile && nvm install && nvm use && npm install --legacy-peer-deps && npm run build' -#FROM nginx +FROM nginx -#WORKDIR /workdir/agr_ui/build +WORKDIR /workdir/agr_ui/build -#COPY --from=build-stage /workdir/agr_ui/build /workdir/agr_ui/build -#COPY --from=build-stage /workdir/agr_ui/nginx.conf /etc/nginx/conf.d/default.conf +COPY --from=build-stage /workdir/agr_ui/build /workdir/agr_ui/build +COPY --from=build-stage /workdir/agr_ui/nginx.conf /etc/nginx/conf.d/default.conf -#EXPOSE 3000 +EXPOSE 3000 From 7d331856a0759b79f247df9d1ca6c6da91a57f87 Mon Sep 17 00:00:00 2001 From: Olin Blodgett Date: Thu, 22 Feb 2024 15:51:56 -0500 Subject: [PATCH 17/72] Added back nginx conf file --- nginx.conf | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 nginx.conf diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 000000000..a4a9fe2de --- /dev/null +++ b/nginx.conf @@ -0,0 +1,7 @@ +server { + listen 3000; + root /workdir/agr_ui/build; + index index.html; + + error_page 404 =200 /index.html; +} From eb0bd629a1642b21865b344fa2c561e0918778f1 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Wed, 28 Feb 2024 14:04:28 -0600 Subject: [PATCH 18/72] SCRUM-3647 add AnnotatedEntitiesPopupCuration to DiseaseToGeneTable --- src/containers/diseasePage/DiseaseToGeneTable.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/containers/diseasePage/DiseaseToGeneTable.js b/src/containers/diseasePage/DiseaseToGeneTable.js index 155bac446..63294316f 100644 --- a/src/containers/diseasePage/DiseaseToGeneTable.js +++ b/src/containers/diseasePage/DiseaseToGeneTable.js @@ -15,6 +15,7 @@ import { buildProvidersWithUrl } from '../../components/dataTable/utils'; import SpeciesCell from '../../components/dataTable/SpeciesCell'; import DiseaseLinkCuration from '../../components/disease/DiseaseLinkCuration'; import DiseaseQualifiersColumn from '../../components/dataTable/DiseaseQualifiersColumn'; +import AnnotatedEntitiesPopupCuration from '../../components/dataTable/AnnotatedEntitiesPopupCuration'; //TODO: once tickets SCRUM-3647, SCRUM-3648, and SCRUM-3649 are complete, refactor this and the diseaseAnnotationTable component //if needed @@ -25,7 +26,7 @@ const DiseaseToGeneTable = ({id}) => { ...tableProps } = useDataTableQuery(`/api/disease/${id}/genes`, undefined, { sizePerPage: 10, }, {}, 60000); - let columns = [ + const columns = [ { dataField: 'subject.taxon', text: 'Species', @@ -38,6 +39,11 @@ const DiseaseToGeneTable = ({id}) => { formatter: (curie, row) => (
{GeneCellCuration(row.subject)}
+ + + Annotation details + +
), headerStyle: {width: '75px'}, From 78cc317ecc327ca347a6323e5d7a86888c340802 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Fri, 1 Mar 2024 13:36:22 -0600 Subject: [PATCH 19/72] SCRUM-3647 switched column order --- .../diseasePage/DiseaseToGeneTable.js | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/containers/diseasePage/DiseaseToGeneTable.js b/src/containers/diseasePage/DiseaseToGeneTable.js index 63294316f..4f9fe754f 100644 --- a/src/containers/diseasePage/DiseaseToGeneTable.js +++ b/src/containers/diseasePage/DiseaseToGeneTable.js @@ -27,12 +27,6 @@ const DiseaseToGeneTable = ({id}) => { } = useDataTableQuery(`/api/disease/${id}/genes`, undefined, { sizePerPage: 10, }, {}, 60000); const columns = [ - { - dataField: 'subject.taxon', - text: 'Species', - headerStyle: {width: '100px'}, - formatter: species => , - }, { dataField: 'subject.curie', text: 'Gene', @@ -48,6 +42,12 @@ const DiseaseToGeneTable = ({id}) => { ), headerStyle: {width: '75px'}, }, + { + dataField: 'subject.taxon', + text: 'Species', + headerStyle: {width: '100px'}, + formatter: species => , + }, { dataField: 'generatedRelationString', text: 'Association', @@ -83,12 +83,6 @@ const DiseaseToGeneTable = ({id}) => { headerStyle: {width: '100px'}, formatter: codes => , }, - { - dataField: 'providers', - text: 'Source', - formatter: providers => providers && , - headerStyle: {width: '100px'}, - }, { dataField: 'basedOnGenes', text: 'Based On', @@ -99,6 +93,12 @@ const DiseaseToGeneTable = ({id}) => { headerStyle: {width: '100px'}, formatter: BasedOnGeneCellCuration, }, + { + dataField: 'providers', + text: 'Source', + formatter: providers => providers && , + headerStyle: {width: '100px'}, + }, { dataField: 'references', text: 'References', From a4129207f0511a1a7bf89810526ee64dc310ce66 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Fri, 1 Mar 2024 14:13:38 -0600 Subject: [PATCH 20/72] SCRUM-3647 add additional details columns --- src/components/dataTable/AnnotatedEntitiesPopupCuration.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/dataTable/AnnotatedEntitiesPopupCuration.js b/src/components/dataTable/AnnotatedEntitiesPopupCuration.js index f09ca7fe1..3c80e4ee6 100644 --- a/src/components/dataTable/AnnotatedEntitiesPopupCuration.js +++ b/src/components/dataTable/AnnotatedEntitiesPopupCuration.js @@ -68,11 +68,11 @@ function AnnotatedEntitiesPopupCuration(props) { Name Type Association - { parentPage === 'gene' ? Additional implicated genes : <> } + { parentPage === 'gene' || 'disease' ? Additional implicated genes : <> } Experimental condition Genetic Modifiers - { parentPage === 'gene' ? Strain Background : <> } + { parentPage === 'gene' || 'disease' ? Strain Background : <> } Genetic Sex Notes Annotation type From 173bfea55e06cbe49460148cf3b519f0a12ba3c0 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Fri, 1 Mar 2024 15:03:06 -0600 Subject: [PATCH 21/72] SCRUM-3647 suppress annotation details if via orthology --- .../diseasePage/DiseaseToGeneTable.js | 49 +++++++++++-------- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/src/containers/diseasePage/DiseaseToGeneTable.js b/src/containers/diseasePage/DiseaseToGeneTable.js index 4f9fe754f..df131d467 100644 --- a/src/containers/diseasePage/DiseaseToGeneTable.js +++ b/src/containers/diseasePage/DiseaseToGeneTable.js @@ -19,33 +19,42 @@ import AnnotatedEntitiesPopupCuration from '../../components/dataTable/Annotated //TODO: once tickets SCRUM-3647, SCRUM-3648, and SCRUM-3649 are complete, refactor this and the diseaseAnnotationTable component //if needed -const DiseaseToGeneTable = ({id}) => { +const DiseaseToGeneTable = ({ id }) => { const { data: results, resolvedData, ...tableProps } = useDataTableQuery(`/api/disease/${id}/genes`, undefined, { sizePerPage: 10, }, {}, 60000); + const getIsViaOrthology = (annotation) => { + return annotation.generatedRelationString.includes("orthology"); + }; + const columns = [ { dataField: 'subject.curie', text: 'Gene', - formatter: (curie, row) => ( - -
{GeneCellCuration(row.subject)}
- - - Annotation details - - -
- ), - headerStyle: {width: '75px'}, + formatter: (curie, row) => { + const isViaOrthology = getIsViaOrthology(row); + return ( + +
{GeneCellCuration(row.subject)}
+ {!isViaOrthology && ( + + + Annotation details + + + )} +
+ ); + }, + headerStyle: { width: '75px' }, }, { dataField: 'subject.taxon', text: 'Species', - headerStyle: {width: '100px'}, + headerStyle: { width: '100px' }, formatter: species => , }, { @@ -59,18 +68,18 @@ const DiseaseToGeneTable = ({id}) => {
, }, formatter: type => , - headerStyle: {width: '120px'}, + headerStyle: { width: '120px' }, }, { dataField: 'diseaseQualifiers', text: 'Disease Qualifier', - headerStyle: {width: '100px'}, + headerStyle: { width: '100px' }, formatter: diseaseQualifiers => , }, { dataField: 'object.curie', text: 'Disease', - headerStyle: {width: '150px'}, + headerStyle: { width: '150px' }, formatter: (curie, row) => , }, { @@ -80,7 +89,7 @@ const DiseaseToGeneTable = ({id}) => { id: 'disease-page--gene-disease-associations-table--evidence-help', children: Mouse-over to decipher the evidence code. The Alliance uses these evidence codes to justify DO annotations., }, - headerStyle: {width: '100px'}, + headerStyle: { width: '100px' }, formatter: codes => , }, { @@ -90,19 +99,19 @@ const DiseaseToGeneTable = ({id}) => { id: 'disease-page--gene-disease-associations-table--based-on-help', children: SGD uses orthology to human genes to associate yeast genes with the disease. }, - headerStyle: {width: '100px'}, + headerStyle: { width: '100px' }, formatter: BasedOnGeneCellCuration, }, { dataField: 'providers', text: 'Source', formatter: providers => providers && , - headerStyle: {width: '100px'}, + headerStyle: { width: '100px' }, }, { dataField: 'references', text: 'References', - headerStyle: {width: '150px'}, + headerStyle: { width: '150px' }, formatter: ReferencesCellCuration, } ]; From a5087a2ecda3482c36d9d8b02d09b318bc98104b Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Mon, 4 Mar 2024 09:27:03 -0600 Subject: [PATCH 22/72] SCRUM-3647 add reference link for via-orthology annotations --- .../dataTable/ReferencesCellViaOrthologyCuration.js | 13 +++++++++++++ src/components/dataTable/utils.js | 4 ++++ src/containers/diseasePage/DiseaseToGeneTable.js | 10 ++++++++-- 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 src/components/dataTable/ReferencesCellViaOrthologyCuration.js diff --git a/src/components/dataTable/ReferencesCellViaOrthologyCuration.js b/src/components/dataTable/ReferencesCellViaOrthologyCuration.js new file mode 100644 index 000000000..0ff4808e8 --- /dev/null +++ b/src/components/dataTable/ReferencesCellViaOrthologyCuration.js @@ -0,0 +1,13 @@ +import React from 'react'; + +import ExternalLink from '../ExternalLink'; + +const ReferenceCellViaOrthologyCuration = () => { + const curie = "MGI:6194238"; + const url = `http://www.informatics.jax.org/accession/${curie}`; + return ( + {curie} + ); +}; + +export default ReferenceCellViaOrthologyCuration; diff --git a/src/components/dataTable/utils.js b/src/components/dataTable/utils.js index 884066775..1797843b7 100644 --- a/src/components/dataTable/utils.js +++ b/src/components/dataTable/utils.js @@ -18,6 +18,10 @@ export const getDistinctFieldValue = (response, field) => { )); }; +export const getIsViaOrthology = (annotation) => { + return annotation.generatedRelationString.includes("orthology"); +}; + export function getRefStrings(referenceItems) { if (!referenceItems) return; diff --git a/src/containers/diseasePage/DiseaseToGeneTable.js b/src/containers/diseasePage/DiseaseToGeneTable.js index df131d467..7b040e957 100644 --- a/src/containers/diseasePage/DiseaseToGeneTable.js +++ b/src/containers/diseasePage/DiseaseToGeneTable.js @@ -11,11 +11,13 @@ import { import ProvidersCellCuration from '../../components/dataTable/ProvidersCellCuration'; import useDataTableQuery from '../../hooks/useDataTableQuery'; import AssociationType from '../../components/AssociationType'; -import { buildProvidersWithUrl } from '../../components/dataTable/utils'; +import { buildProvidersWithUrl, getIsViaOrthology } from '../../components/dataTable/utils'; import SpeciesCell from '../../components/dataTable/SpeciesCell'; import DiseaseLinkCuration from '../../components/disease/DiseaseLinkCuration'; import DiseaseQualifiersColumn from '../../components/dataTable/DiseaseQualifiersColumn'; import AnnotatedEntitiesPopupCuration from '../../components/dataTable/AnnotatedEntitiesPopupCuration'; +import ReferenceCellViaOrthologyCuration from '../../components/dataTable/ReferencesCellViaOrthologyCuration'; +import EvidenceCodeViaOrthologyCuration from '../../components/dataTable/EvidenceCodeViaOrthologyCuration'; //TODO: once tickets SCRUM-3647, SCRUM-3648, and SCRUM-3649 are complete, refactor this and the diseaseAnnotationTable component //if needed @@ -112,7 +114,11 @@ const DiseaseToGeneTable = ({ id }) => { dataField: 'references', text: 'References', headerStyle: { width: '150px' }, - formatter: ReferencesCellCuration, + formatter: (references, row) => { + const isViaOrthology = getIsViaOrthology(row); + if(!isViaOrthology) return ReferencesCellCuration(references); + return + } } ]; From fef563786ef94a2ead57a3b0714ae4e23898d88e Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Mon, 4 Mar 2024 12:58:30 -0600 Subject: [PATCH 23/72] SCRUM-3647 add evidence code for via-orthology annotations --- .../dataTable/EvidenceCodeViaOrthologyCuration.js | 15 +++++++++++++++ src/containers/diseasePage/DiseaseToGeneTable.js | 10 ++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 src/components/dataTable/EvidenceCodeViaOrthologyCuration.js diff --git a/src/components/dataTable/EvidenceCodeViaOrthologyCuration.js b/src/components/dataTable/EvidenceCodeViaOrthologyCuration.js new file mode 100644 index 000000000..b599133e2 --- /dev/null +++ b/src/components/dataTable/EvidenceCodeViaOrthologyCuration.js @@ -0,0 +1,15 @@ +import EvidenceCodeCuration from "./EvidenceCodeCuration"; + +const EvidenceCodeViaOrthologyCuration = () => { + const evidenceCode = { + abbreviation: "IEA", + name: "evidence used in automatic assertion", + curie: "ECO:0000501" + }; + + return ( + + ); +}; + +export default EvidenceCodeViaOrthologyCuration; \ No newline at end of file diff --git a/src/containers/diseasePage/DiseaseToGeneTable.js b/src/containers/diseasePage/DiseaseToGeneTable.js index 7b040e957..1fcbb76d2 100644 --- a/src/containers/diseasePage/DiseaseToGeneTable.js +++ b/src/containers/diseasePage/DiseaseToGeneTable.js @@ -28,9 +28,7 @@ const DiseaseToGeneTable = ({ id }) => { ...tableProps } = useDataTableQuery(`/api/disease/${id}/genes`, undefined, { sizePerPage: 10, }, {}, 60000); - const getIsViaOrthology = (annotation) => { - return annotation.generatedRelationString.includes("orthology"); - }; + const columns = [ { @@ -92,7 +90,11 @@ const DiseaseToGeneTable = ({ id }) => { children: Mouse-over to decipher the evidence code. The Alliance uses these evidence codes to justify DO annotations., }, headerStyle: { width: '100px' }, - formatter: codes => , + formatter: (codes, row) => { + const isViaOrthology = getIsViaOrthology(row); + if(!isViaOrthology) return ; + return + } }, { dataField: 'basedOnGenes', From 0551bcb76eccdc33c518d9fac86f6eaf263dc6d9 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Mon, 4 Mar 2024 15:29:36 -0600 Subject: [PATCH 24/72] SCRUM-3647 fix column error --- src/components/dataTable/AnnotatedEntitiesPopupCuration.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/dataTable/AnnotatedEntitiesPopupCuration.js b/src/components/dataTable/AnnotatedEntitiesPopupCuration.js index 3c80e4ee6..10ede072f 100644 --- a/src/components/dataTable/AnnotatedEntitiesPopupCuration.js +++ b/src/components/dataTable/AnnotatedEntitiesPopupCuration.js @@ -42,8 +42,7 @@ function renderLink(entity) { } } -function AnnotatedEntitiesPopupCuration(props) { - const {children, entities, parentPage, mainRowCurie } = props; +function AnnotatedEntitiesPopupCuration({ children, entities, parentPage, mainRowCurie }) { if (!entities || !entities.length) { return null; @@ -90,11 +89,11 @@ function AnnotatedEntitiesPopupCuration(props) { {renderLink(entity)} - { parentPage === 'gene' ? : <>} + { parentPage === 'gene' || 'disease' ? : <>} - { parentPage === 'gene' ? : <> } + { parentPage === 'gene' || 'disease' ? : <> } From 4b28407095221a9758cc75cc508b69632c42c3d7 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Mon, 4 Mar 2024 15:46:33 -0600 Subject: [PATCH 25/72] SCRUM-3647 make assertedGenes link internal --- src/components/dataTable/AssertedGenes.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/dataTable/AssertedGenes.js b/src/components/dataTable/AssertedGenes.js index f287f1524..4d210cdc6 100644 --- a/src/components/dataTable/AssertedGenes.js +++ b/src/components/dataTable/AssertedGenes.js @@ -1,11 +1,11 @@ import CollapsibleList from '../collapsibleList/collapsibleList'; -import ExternalLink from '../ExternalLink'; +import { Link } from 'react-router-dom'; function makeAssertedGeneLink(curie, geneSymbol) { if(curie) { const symbol = ; - return {symbol}; + return {symbol}; } return null; } @@ -15,7 +15,7 @@ function AssertedGenes({assertedGenes, mainRowCurie}) { if(assertedGenes && assertedGenes.length > 1) { return ( - {filteredAssertedGenes.map(gene => makeAssertedGeneLink(gene.curie, gene.geneSymbol.displayText))} + {filteredAssertedGenes.map(gene => makeAssertedGeneLink(gene.curie, gene.geneSymbol.displayText))} ); } From 627c9e7897aa425ab8c53aa049b1ef82e084ba85 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Mon, 4 Mar 2024 14:29:23 -0600 Subject: [PATCH 26/72] SCRUM-3648 add filter code to columns --- .../diseasePage/DiseaseToGeneTable.js | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/src/containers/diseasePage/DiseaseToGeneTable.js b/src/containers/diseasePage/DiseaseToGeneTable.js index 1fcbb76d2..15fe08873 100644 --- a/src/containers/diseasePage/DiseaseToGeneTable.js +++ b/src/containers/diseasePage/DiseaseToGeneTable.js @@ -11,8 +11,11 @@ import { import ProvidersCellCuration from '../../components/dataTable/ProvidersCellCuration'; import useDataTableQuery from '../../hooks/useDataTableQuery'; import AssociationType from '../../components/AssociationType'; -import { buildProvidersWithUrl, getIsViaOrthology } from '../../components/dataTable/utils'; +import { buildProvidersWithUrl, getIsViaOrthology, getDistinctFieldValue } from '../../components/dataTable/utils'; +import { compareByFixedOrder } from '../../lib/utils'; +import { SPECIES_NAME_ORDER } from '../../constants'; import SpeciesCell from '../../components/dataTable/SpeciesCell'; +import SpeciesName from '../../components/SpeciesName'; import DiseaseLinkCuration from '../../components/disease/DiseaseLinkCuration'; import DiseaseQualifiersColumn from '../../components/dataTable/DiseaseQualifiersColumn'; import AnnotatedEntitiesPopupCuration from '../../components/dataTable/AnnotatedEntitiesPopupCuration'; @@ -50,12 +53,18 @@ const DiseaseToGeneTable = ({ id }) => { ); }, headerStyle: { width: '75px' }, + filterable: true, + filterName: 'subject.symbol', }, { dataField: 'subject.taxon', text: 'Species', headerStyle: { width: '100px' }, formatter: species => , + filterName: 'species', + filterable: getDistinctFieldValue(resolvedData, 'species').sort(compareByFixedOrder(SPECIES_NAME_ORDER)), + filterFormatter: speciesName => {speciesName}, + filterType: 'checkbox', }, { dataField: 'generatedRelationString', @@ -69,18 +78,26 @@ const DiseaseToGeneTable = ({ id }) => { }, formatter: type => , headerStyle: { width: '120px' }, + filterName: 'associationType', + filterable: getDistinctFieldValue(resolvedData, 'associationType'), + filterFormatter: type => , + filterType: 'checkbox', }, { dataField: 'diseaseQualifiers', text: 'Disease Qualifier', headerStyle: { width: '100px' }, formatter: diseaseQualifiers => , + filterable: getDistinctFieldValue(resolvedData, 'diseaseQualifiers'), + filterName: 'diseaseQualifier', + filterType: 'checkbox', }, { dataField: 'object.curie', text: 'Disease', headerStyle: { width: '150px' }, formatter: (curie, row) => , + filterable: true, }, { dataField: 'evidenceCodes', @@ -94,7 +111,9 @@ const DiseaseToGeneTable = ({ id }) => { const isViaOrthology = getIsViaOrthology(row); if(!isViaOrthology) return ; return - } + }, + filterable: true, + filterName: 'evidenceCode', }, { dataField: 'basedOnGenes', @@ -105,12 +124,16 @@ const DiseaseToGeneTable = ({ id }) => { }, headerStyle: { width: '100px' }, formatter: BasedOnGeneCellCuration, + filterable: true, + filterName: 'basedOnGeneSymbol', }, { dataField: 'providers', text: 'Source', formatter: providers => providers && , headerStyle: { width: '100px' }, + filterable: true, + filterName: 'dataProvider', }, { dataField: 'references', @@ -120,7 +143,9 @@ const DiseaseToGeneTable = ({ id }) => { const isViaOrthology = getIsViaOrthology(row); if(!isViaOrthology) return ReferencesCellCuration(references); return - } + }, + filterable: true, + filterName: 'reference', } ]; From 31c0eed6dfc58aa6b2c9d3a93fb78bb56c7a38cb Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Mon, 4 Mar 2024 14:30:48 -0600 Subject: [PATCH 27/72] SCRUM-3648 add sortOptions --- src/containers/diseasePage/DiseaseToGeneTable.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/containers/diseasePage/DiseaseToGeneTable.js b/src/containers/diseasePage/DiseaseToGeneTable.js index 15fe08873..9bae4c2cd 100644 --- a/src/containers/diseasePage/DiseaseToGeneTable.js +++ b/src/containers/diseasePage/DiseaseToGeneTable.js @@ -155,12 +155,28 @@ const DiseaseToGeneTable = ({ id }) => { ...association, })); + const sortOptions = [ + { + value: 'disease', + label: 'Disease', + }, + { + value: 'gene', + label: 'Gene', + }, + { + value: 'species', + label: 'Species', + }, + ]; + return ( ); }; From 8a9af291bedd37fd91939d02fe069cba1f76ccb6 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Wed, 6 Mar 2024 15:27:12 -0600 Subject: [PATCH 28/72] SCRUM-3648 remove hardcoding for evidence code --- .../dataTable/EvidenceCodeViaOrthologyCuration.js | 15 --------------- src/containers/diseasePage/DiseaseToGeneTable.js | 7 +------ 2 files changed, 1 insertion(+), 21 deletions(-) delete mode 100644 src/components/dataTable/EvidenceCodeViaOrthologyCuration.js diff --git a/src/components/dataTable/EvidenceCodeViaOrthologyCuration.js b/src/components/dataTable/EvidenceCodeViaOrthologyCuration.js deleted file mode 100644 index b599133e2..000000000 --- a/src/components/dataTable/EvidenceCodeViaOrthologyCuration.js +++ /dev/null @@ -1,15 +0,0 @@ -import EvidenceCodeCuration from "./EvidenceCodeCuration"; - -const EvidenceCodeViaOrthologyCuration = () => { - const evidenceCode = { - abbreviation: "IEA", - name: "evidence used in automatic assertion", - curie: "ECO:0000501" - }; - - return ( - - ); -}; - -export default EvidenceCodeViaOrthologyCuration; \ No newline at end of file diff --git a/src/containers/diseasePage/DiseaseToGeneTable.js b/src/containers/diseasePage/DiseaseToGeneTable.js index 9bae4c2cd..c74534229 100644 --- a/src/containers/diseasePage/DiseaseToGeneTable.js +++ b/src/containers/diseasePage/DiseaseToGeneTable.js @@ -20,7 +20,6 @@ import DiseaseLinkCuration from '../../components/disease/DiseaseLinkCuration'; import DiseaseQualifiersColumn from '../../components/dataTable/DiseaseQualifiersColumn'; import AnnotatedEntitiesPopupCuration from '../../components/dataTable/AnnotatedEntitiesPopupCuration'; import ReferenceCellViaOrthologyCuration from '../../components/dataTable/ReferencesCellViaOrthologyCuration'; -import EvidenceCodeViaOrthologyCuration from '../../components/dataTable/EvidenceCodeViaOrthologyCuration'; //TODO: once tickets SCRUM-3647, SCRUM-3648, and SCRUM-3649 are complete, refactor this and the diseaseAnnotationTable component //if needed @@ -107,11 +106,7 @@ const DiseaseToGeneTable = ({ id }) => { children: Mouse-over to decipher the evidence code. The Alliance uses these evidence codes to justify DO annotations., }, headerStyle: { width: '100px' }, - formatter: (codes, row) => { - const isViaOrthology = getIsViaOrthology(row); - if(!isViaOrthology) return ; - return - }, + formatter: (codes) => , filterable: true, filterName: 'evidenceCode', }, From 594ad0e5e66dbacd106b41969e7bf7eed4bc846e Mon Sep 17 00:00:00 2001 From: Scott Cain Date: Wed, 6 Mar 2024 17:18:24 -0800 Subject: [PATCH 29/72] adding a few proxy lines to allow fetching RGD and XenBase data --- cdk/amplify-stage-stack.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cdk/amplify-stage-stack.ts b/cdk/amplify-stage-stack.ts index 6c79b3bf4..5b329b4ad 100644 --- a/cdk/amplify-stage-stack.ts +++ b/cdk/amplify-stage-stack.ts @@ -18,8 +18,12 @@ export class AmplifyStageStack extends cdk.Stack { const stage_paths = [ { source: '/api/<*>', target: 'https://stage-api.alliancegenome.org/api/<*>', status: amplify.RedirectStatus.REWRITE }, { source: '/jbrowse2', target: 'https://stage.alliancegenome.org/jbrowse2/', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, - { source: '/jbrowse2/', target: 'https://stage.dgaayxgqoarxf.amplifyapp.com/', status: amplify.RedirectStatus.REWRITE }, - { source: '/jbrowse2/<*>', target: 'https://stage.dgaayxgqoarxf.amplifyapp.com/<*>', status: amplify.RedirectStatus.REWRITE }, + { source: '/jbrowse2/', target: 'https://stage.dgaayxgqoarxf.amplifyapp.com/', status: amplify.RedirectStatus.REWRITE }, + { source: '/jbrowse2/<*>', target: 'https://stage.dgaayxgqoarxf.amplifyapp.com/<*>', status: amplify.RedirectStatus.REWRITE }, + { source: '/jbrowsedata/XenBaseXTJBrowse/<*>', target: 'https://jbrowse.xenbase.org/XenJBrowse/data/xt9_1/<*>', status: amplify.RedirectStatus.REWRITE }, + { source: '/jbrowsedata/XenBaseXLJBrowse/<*>', target: 'https://jbrowse.xenbase.org/XenJBrowse/data/xl9_2/<*>', status: amplify.RedirectStatus.REWRITE }, + { source: '/jbrowsedata/XenBaseData/<*>', target: 'https://jbrowse.xenbase.org/XenJBrowse/<*>', status: amplify.RedirectStatus.REWRITE }, + { source: '/jbrowsedata/RGDJBrowse/<*>', target: 'https://rgd.mcw.edu/jbrowse2/<*>', status: amplify.RedirectStatus.REWRITE }, { source: '/jbrowse/worms/protein', target: 'https://stage.alliancegenome.org/jbrowse/worms/protein/', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, { source: '/jbrowse/worms/protein/', target: 'https://staging.djgvd7iswt7yy.amplifyapp.com/', status: amplify.RedirectStatus.REWRITE }, { source: '/jbrowse/worms/protein/<*>', target: 'https://staging.djgvd7iswt7yy.amplifyapp.com/<*>', status: amplify.RedirectStatus.REWRITE }, From fa58a7cba6a2bf33f71a08b0b85bb2a2f0456e0b Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Thu, 7 Mar 2024 08:06:12 -0600 Subject: [PATCH 30/72] SCRUM-3649 add back download button --- src/containers/diseasePage/DiseaseToGeneTable.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/containers/diseasePage/DiseaseToGeneTable.js b/src/containers/diseasePage/DiseaseToGeneTable.js index c74534229..0419a1098 100644 --- a/src/containers/diseasePage/DiseaseToGeneTable.js +++ b/src/containers/diseasePage/DiseaseToGeneTable.js @@ -170,6 +170,7 @@ const DiseaseToGeneTable = ({ id }) => { {...tableProps} columns={columns} data={rows} + downloadUrl={`/api/disease/${id}/genes/download`} keyField='primaryKey' sortOptions={sortOptions} /> From 67bd1a2efc73be9531e7289400ae9f49a9dc36f3 Mon Sep 17 00:00:00 2001 From: Christian Pich Date: Thu, 7 Mar 2024 16:14:34 +0100 Subject: [PATCH 31/72] rename filter for disease column --- src/containers/diseasePage/DiseaseToGeneTable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/containers/diseasePage/DiseaseToGeneTable.js b/src/containers/diseasePage/DiseaseToGeneTable.js index 0419a1098..5cf36191d 100644 --- a/src/containers/diseasePage/DiseaseToGeneTable.js +++ b/src/containers/diseasePage/DiseaseToGeneTable.js @@ -92,7 +92,7 @@ const DiseaseToGeneTable = ({ id }) => { filterType: 'checkbox', }, { - dataField: 'object.curie', + dataField: 'disease', text: 'Disease', headerStyle: { width: '150px' }, formatter: (curie, row) => , From a04239df25010c726a52e10243bd21c7be8fc77d Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Thu, 7 Mar 2024 11:27:20 -0600 Subject: [PATCH 32/72] update disease filter --- src/components/disease/diseaseAnnotationTable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/disease/diseaseAnnotationTable.js b/src/components/disease/diseaseAnnotationTable.js index 36a6d112e..6ea2040af 100644 --- a/src/components/disease/diseaseAnnotationTable.js +++ b/src/components/disease/diseaseAnnotationTable.js @@ -103,7 +103,7 @@ const DiseaseAnnotationTable = ({ formatter: diseaseQualifiers => , }, { - dataField: 'object.curie', + dataField: 'disease', text: 'Disease', filterable: true, headerStyle: {width: '150px'}, From 5a6705c8b4a1aeb8ce5d0f0ef61d70e0e1d629ea Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Thu, 7 Mar 2024 13:05:38 -0600 Subject: [PATCH 33/72] SCRUM-3648 update basedOn column help text --- src/containers/diseasePage/DiseaseToGeneTable.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/containers/diseasePage/DiseaseToGeneTable.js b/src/containers/diseasePage/DiseaseToGeneTable.js index 5cf36191d..f36733cac 100644 --- a/src/containers/diseasePage/DiseaseToGeneTable.js +++ b/src/containers/diseasePage/DiseaseToGeneTable.js @@ -115,7 +115,9 @@ const DiseaseToGeneTable = ({ id }) => { text: 'Based On', helpPopupProps: { id: 'disease-page--gene-disease-associations-table--based-on-help', - children: SGD uses orthology to human genes to associate yeast genes with the disease. + children: SGD uses orthology to human genes to associate yeast genes with the disease. + The Based On column is also used for inferred via-orthology disease annotations to indicate the gene that was directly (experimentally) annotated to the disease + }, headerStyle: { width: '100px' }, formatter: BasedOnGeneCellCuration, From 220704769c1b42b5a84d599cb5b248107928ec86 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Thu, 7 Mar 2024 13:46:35 -0600 Subject: [PATCH 34/72] SCRUM-3648 update gene filter name --- src/containers/diseasePage/DiseaseToGeneTable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/containers/diseasePage/DiseaseToGeneTable.js b/src/containers/diseasePage/DiseaseToGeneTable.js index f36733cac..77de0cc06 100644 --- a/src/containers/diseasePage/DiseaseToGeneTable.js +++ b/src/containers/diseasePage/DiseaseToGeneTable.js @@ -53,7 +53,7 @@ const DiseaseToGeneTable = ({ id }) => { }, headerStyle: { width: '75px' }, filterable: true, - filterName: 'subject.symbol', + filterName: 'geneName', }, { dataField: 'subject.taxon', From e8ebe6cff3c81c784e971e6db8bb63627244ddcc Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Tue, 12 Mar 2024 12:38:02 -0500 Subject: [PATCH 35/72] update gene diseaseAnnotationTable reference column to use pumModIds --- .../dataTable/referencesCellCuration.js | 18 +++++++++--------- src/components/dataTable/utils.js | 9 +++++++-- .../disease/diseaseAnnotationTable.js | 4 ++-- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/components/dataTable/referencesCellCuration.js b/src/components/dataTable/referencesCellCuration.js index d1b918615..ad39d25bc 100644 --- a/src/components/dataTable/referencesCellCuration.js +++ b/src/components/dataTable/referencesCellCuration.js @@ -2,26 +2,26 @@ import React from 'react'; import ExternalLink from '../ExternalLink'; import { CollapsibleList } from '../collapsibleList'; -import { getMultipleReferencesCuriesAndUrls } from "./utils"; +import { getMultipleReferencesUrls } from "./utils"; const removeDuplicates = (refs) => { - const newArray = refs.map((ref) => [ref.curie, ref]); + const newArray = refs.map((ref) => [ref.pubModId, ref]); const newMap = new Map(newArray); const iterator = newMap.values(); const uniqueRefs = [...iterator]; return uniqueRefs; -} +}; -const ReferencesCellCuration = (refs) => { - const refStringsAndUrls = getMultipleReferencesCuriesAndUrls(refs); - const uniqueRefs = removeDuplicates(refStringsAndUrls); +const ReferencesCellCuration = ({ pubModIds }) => { + const refStringsAndUrls = getMultipleReferencesUrls(pubModIds); + const uniqueRefs = removeDuplicates(refStringsAndUrls); - return refs && + return pubModIds && { - uniqueRefs.map(({ curie, url }) => { - return {curie}; + uniqueRefs.map(({ pubModId, url }) => { + return {pubModId}; }) } ; diff --git a/src/components/dataTable/utils.js b/src/components/dataTable/utils.js index 1797843b7..cda6aa2aa 100644 --- a/src/components/dataTable/utils.js +++ b/src/components/dataTable/utils.js @@ -79,8 +79,13 @@ export const getSingleReferenceCurieAndUrl = (reference) => { return {curie, url}; } -export const getMultipleReferencesCuriesAndUrls = (references) => { - return references.map((reference) => getSingleReferenceCurieAndUrl(reference)); +export const getSingleReferenceUrl = (pubModId) => { + const url = getResourceUrl(pubModId); + return {pubModId, url}; +} + +export const getMultipleReferencesUrls = (pubModIds) => { + return pubModIds.map((pubModId) => getSingleReferenceUrl(pubModId)); } const buildProvider = (annotation) => { diff --git a/src/components/disease/diseaseAnnotationTable.js b/src/components/disease/diseaseAnnotationTable.js index 6ea2040af..aca1bc0d1 100644 --- a/src/components/disease/diseaseAnnotationTable.js +++ b/src/components/disease/diseaseAnnotationTable.js @@ -142,12 +142,12 @@ const DiseaseAnnotationTable = ({ formatter: BasedOnGeneCellCuration, }, { - dataField: 'references', + dataField: 'pubmedPubModIDs', text: 'References', filterable: true, filterName: 'reference', headerStyle: {width: '150px'}, - formatter: ReferencesCellCuration, + formatter: (pubModIds) => , } ]; From d4178b23efd3aa55f9b4fa170b7ae125975d91f9 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Thu, 14 Mar 2024 14:38:32 -0500 Subject: [PATCH 36/72] upate diseasePage associated genes table to use pubmedPubModIDs --- src/containers/diseasePage/DiseaseToGeneTable.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/containers/diseasePage/DiseaseToGeneTable.js b/src/containers/diseasePage/DiseaseToGeneTable.js index 77de0cc06..4668fe73c 100644 --- a/src/containers/diseasePage/DiseaseToGeneTable.js +++ b/src/containers/diseasePage/DiseaseToGeneTable.js @@ -133,12 +133,12 @@ const DiseaseToGeneTable = ({ id }) => { filterName: 'dataProvider', }, { - dataField: 'references', + dataField: 'pubmedPubModIDs', text: 'References', headerStyle: { width: '150px' }, - formatter: (references, row) => { + formatter: (pubModIds, row) => { const isViaOrthology = getIsViaOrthology(row); - if(!isViaOrthology) return ReferencesCellCuration(references); + if(!isViaOrthology) return return }, filterable: true, From bd45a702b3eed987494fb5584ddb55ee54cadbf7 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Thu, 14 Mar 2024 14:50:19 -0500 Subject: [PATCH 37/72] update allelePage disease assocations table to use pubmedPubModIDs --- src/containers/allelePage/AlleleToDiseaseTable.js | 4 ++-- src/containers/diseasePage/DiseaseToGeneTable.js | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/containers/allelePage/AlleleToDiseaseTable.js b/src/containers/allelePage/AlleleToDiseaseTable.js index 274893283..70c90b0c1 100644 --- a/src/containers/allelePage/AlleleToDiseaseTable.js +++ b/src/containers/allelePage/AlleleToDiseaseTable.js @@ -71,9 +71,9 @@ const AlleleToDiseaseTable = ({alleleId}) => { filterName: 'dataProvider', }, { - dataField: 'references', + dataField: 'pubmedPubModIDs', text: 'References', - formatter: references => ReferencesCellCuration(references), + formatter: (pubModIds) => , headerStyle: {width: '150px'}, filterable: true, filterName: 'reference', diff --git a/src/containers/diseasePage/DiseaseToGeneTable.js b/src/containers/diseasePage/DiseaseToGeneTable.js index 4668fe73c..0d5561cdf 100644 --- a/src/containers/diseasePage/DiseaseToGeneTable.js +++ b/src/containers/diseasePage/DiseaseToGeneTable.js @@ -21,8 +21,6 @@ import DiseaseQualifiersColumn from '../../components/dataTable/DiseaseQualifier import AnnotatedEntitiesPopupCuration from '../../components/dataTable/AnnotatedEntitiesPopupCuration'; import ReferenceCellViaOrthologyCuration from '../../components/dataTable/ReferencesCellViaOrthologyCuration'; -//TODO: once tickets SCRUM-3647, SCRUM-3648, and SCRUM-3649 are complete, refactor this and the diseaseAnnotationTable component -//if needed const DiseaseToGeneTable = ({ id }) => { const { data: results, From 220ae661ec0b7bcf26894337f44f5d6c05d11355 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Thu, 14 Mar 2024 15:18:39 -0500 Subject: [PATCH 38/72] remove getRefStrings --- src/components/dataTable/utils.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/components/dataTable/utils.js b/src/components/dataTable/utils.js index cda6aa2aa..db946342d 100644 --- a/src/components/dataTable/utils.js +++ b/src/components/dataTable/utils.js @@ -22,15 +22,6 @@ export const getIsViaOrthology = (annotation) => { return annotation.generatedRelationString.includes("orthology"); }; -export function getRefStrings(referenceItems) { - if (!referenceItems) - return; - - let refStrings = referenceItems.map((referenceItem) => getRefString(referenceItem)); - - return refStrings.sort(); -} - export function getRefString(referenceItem) { if (!referenceItem) return; @@ -85,7 +76,7 @@ export const getSingleReferenceUrl = (pubModId) => { } export const getMultipleReferencesUrls = (pubModIds) => { - return pubModIds.map((pubModId) => getSingleReferenceUrl(pubModId)); + return pubModIds.sort().map((pubModId) => getSingleReferenceUrl(pubModId)); } const buildProvider = (annotation) => { From 5e6c0cc4214a5216722848a8d4db96a023419e63 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Fri, 15 Mar 2024 12:00:14 -0500 Subject: [PATCH 39/72] update AnnotatedEntitiesPopupCuration to use pubModIds --- .../AnnotatedEntitiesPopupCuration.js | 8 ++++--- .../dataTable/singleReferenceCellCuration.js | 21 ++++++++++++------- .../disease/diseaseAnnotationTable.js | 7 ++++++- .../allelePage/AlleleToDiseaseTable.js | 2 +- .../diseasePage/DiseaseToGeneTable.js | 7 ++++++- 5 files changed, 31 insertions(+), 14 deletions(-) diff --git a/src/components/dataTable/AnnotatedEntitiesPopupCuration.js b/src/components/dataTable/AnnotatedEntitiesPopupCuration.js index 10ede072f..2a4bb64b9 100644 --- a/src/components/dataTable/AnnotatedEntitiesPopupCuration.js +++ b/src/components/dataTable/AnnotatedEntitiesPopupCuration.js @@ -38,11 +38,13 @@ function renderLink(entity) { return {inner}; } else { const inner = ; - return {inner}; + return {inner}; } } -function AnnotatedEntitiesPopupCuration({ children, entities, parentPage, mainRowCurie }) { + + +function AnnotatedEntitiesPopupCuration({ children, entities, parentPage, mainRowCurie, pubModIds }) { if (!entities || !entities.length) { return null; @@ -99,7 +101,7 @@ function AnnotatedEntitiesPopupCuration({ children, entities, parentPage, mainRo - + ) }) diff --git a/src/components/dataTable/singleReferenceCellCuration.js b/src/components/dataTable/singleReferenceCellCuration.js index 4dd47e21c..84fe2f7f0 100644 --- a/src/components/dataTable/singleReferenceCellCuration.js +++ b/src/components/dataTable/singleReferenceCellCuration.js @@ -1,14 +1,19 @@ import React from 'react'; import ExternalLink from '../ExternalLink'; -import { getSingleReferenceCurieAndUrl } from "./utils"; - -const SingleReferenceCellCuration = ({singleReference}) => { - if (singleReference) { - const { curie, url } = getSingleReferenceCurieAndUrl(singleReference); - return {curie}; - } - return <>; +import { getSingleReferenceUrl } from "./utils"; + +const SingleReferenceCellCuration = ({ singleReference, pubModIds }) => { + if (!singleReference) return <>; + const pubModId = getSingleReferencePubModId(singleReference, pubModIds); + const { url } = getSingleReferenceUrl(pubModId); + return {pubModId}; +}; + +const getSingleReferencePubModId = (reference, pubModIds) => { + return reference.crossReferences + .filter(crossRef => pubModIds.includes(crossRef.referencedCurie)) + .map(crossRef => crossRef.referencedCurie)[0]; }; diff --git a/src/components/disease/diseaseAnnotationTable.js b/src/components/disease/diseaseAnnotationTable.js index aca1bc0d1..045782b4a 100644 --- a/src/components/disease/diseaseAnnotationTable.js +++ b/src/components/disease/diseaseAnnotationTable.js @@ -67,7 +67,12 @@ const DiseaseAnnotationTable = ({
{GeneCellCuration(row.subject)}
- + Annotation details diff --git a/src/containers/allelePage/AlleleToDiseaseTable.js b/src/containers/allelePage/AlleleToDiseaseTable.js index 70c90b0c1..45bf1f014 100644 --- a/src/containers/allelePage/AlleleToDiseaseTable.js +++ b/src/containers/allelePage/AlleleToDiseaseTable.js @@ -53,7 +53,7 @@ const AlleleToDiseaseTable = ({alleleId}) => { { dataField: 'primaryAnnotations', text: 'Annotation details', - formatter: entities => , + formatter: (entities, row) => , headerStyle: {width: '90px'}, }, { diff --git a/src/containers/diseasePage/DiseaseToGeneTable.js b/src/containers/diseasePage/DiseaseToGeneTable.js index 0d5561cdf..488e81aa1 100644 --- a/src/containers/diseasePage/DiseaseToGeneTable.js +++ b/src/containers/diseasePage/DiseaseToGeneTable.js @@ -41,7 +41,12 @@ const DiseaseToGeneTable = ({ id }) => {
{GeneCellCuration(row.subject)}
{!isViaOrthology && ( - + Annotation details From e43fd77099c9ce046436cdf6064015253cb55778 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Fri, 15 Mar 2024 12:02:14 -0500 Subject: [PATCH 40/72] remove getRefString --- src/components/dataTable/utils.js | 48 ------------------------------- 1 file changed, 48 deletions(-) diff --git a/src/components/dataTable/utils.js b/src/components/dataTable/utils.js index db946342d..57f1d1e24 100644 --- a/src/components/dataTable/utils.js +++ b/src/components/dataTable/utils.js @@ -22,54 +22,6 @@ export const getIsViaOrthology = (annotation) => { return annotation.generatedRelationString.includes("orthology"); }; -export function getRefString(referenceItem) { - if (!referenceItem) - return; - - if (!referenceItem.cross_references && !referenceItem.crossReferences){ - return referenceItem.curie - } - let xrefCuries = referenceItem.crossReferences.map((crossReference) => crossReference.referencedCurie); - let primaryXrefCurie = ''; - - if (indexWithPrefix(xrefCuries, 'PMID:') > -1) { - [primaryXrefCurie] = xrefCuries.splice(indexWithPrefix(xrefCuries, 'PMID:'), 1); - } else if (indexWithPrefix(xrefCuries, 'FB:') > -1) { - [primaryXrefCurie] = xrefCuries.splice(indexWithPrefix(xrefCuries, 'FB:'), 1); - } else if (indexWithPrefix(xrefCuries, 'MGI:') > -1) { - [primaryXrefCurie] = xrefCuries.splice(indexWithPrefix(xrefCuries, 'MGI:'), 1); - } else if (indexWithPrefix(xrefCuries, 'RGD:') > -1) { - [primaryXrefCurie] = xrefCuries.splice(indexWithPrefix(xrefCuries, 'RGD:'), 1); - } else if (indexWithPrefix(xrefCuries, 'SGD:') > -1) { - [primaryXrefCurie] = xrefCuries.splice(indexWithPrefix(xrefCuries, 'SGD:'), 1); - } else if (indexWithPrefix(xrefCuries, 'WB:') > -1) { - [primaryXrefCurie] = xrefCuries.splice(indexWithPrefix(xrefCuries, 'WB:'), 1); - } else if (indexWithPrefix(xrefCuries, 'ZFIN:') > -1) { - [primaryXrefCurie] = xrefCuries.splice(indexWithPrefix(xrefCuries, 'ZFIN:'), 1); - } else { - [primaryXrefCurie] = xrefCuries.splice(0, 1); - } - - return primaryXrefCurie; -} - - -function indexWithPrefix(array, prefix) { - - for (let i = 0; i < array.length; i++) { - if (array[i].startsWith(prefix)) { - return i; - } - } - return -1; -} - -export const getSingleReferenceCurieAndUrl = (reference) => { - const curie = getRefString(reference); - const url = getResourceUrl(curie); - return {curie, url}; -} - export const getSingleReferenceUrl = (pubModId) => { const url = getResourceUrl(pubModId); return {pubModId, url}; From 9332de413df97d352c3699d4c8f2178c4361a9d6 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Fri, 15 Mar 2024 12:18:08 -0500 Subject: [PATCH 41/72] remove underscores in disease qualifiers --- src/components/dataTable/DiseaseQualifiersColumn.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/dataTable/DiseaseQualifiersColumn.js b/src/components/dataTable/DiseaseQualifiersColumn.js index 7703a5886..33c7856ba 100644 --- a/src/components/dataTable/DiseaseQualifiersColumn.js +++ b/src/components/dataTable/DiseaseQualifiersColumn.js @@ -7,10 +7,10 @@ const DiseaseQualifiersColumn = ({qualifiers}) => { if (!qualifiers || !qualifiers.length) { return null; } - + return ( - {qualifiers.map(qualifier => qualifier)} + {qualifiers.map(qualifier => qualifier.replaceAll("_", " "))} ); }; From d0b65f28ee50f372da83515d6fda4090204a9d00 Mon Sep 17 00:00:00 2001 From: Scott Cain Date: Mon, 25 Mar 2024 19:52:15 -0700 Subject: [PATCH 42/72] bumping seqpanel version to give explicit warning about inferred sequences --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 07f78b57f..d75a28090 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "custom-event-polyfill": "^1.0.6", "d3-selection": "2.0.0", "document-register-element": "1.13.1", - "generic-sequence-panel": "^1.4.0", + "generic-sequence-panel": "^1.4.1", "html-react-parser": "^0.10.0", "immutable": "^3.8.1", "lodash.clone": "^4.5.0", From 4bb010cc6748d61c661892a521dfb91adfa31dd3 Mon Sep 17 00:00:00 2001 From: Howie Motenko Date: Thu, 28 Mar 2024 13:03:15 -0400 Subject: [PATCH 43/72] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fd7cd50df..b8a40de7b 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ nvm use Install dependencies after first cloning the repository or after pulling in new changes to `package.json`: ```bash -npm install +npm install --legacy-peer-deps ``` _Note: the command uses **npm**, not nvm. NPM deals with package dependencies._ From 7bb69098ade6ab02be39b39beffcc544233fee32 Mon Sep 17 00:00:00 2001 From: Scott Cain Date: Tue, 2 Apr 2024 14:30:49 -0700 Subject: [PATCH 44/72] adding region highlighting for variants linked out to JBrowse --- src/containers/allelePage/AlleleSequenceView.js | 11 ++++++++++- src/containers/genePage/genomeFeatureWrapper.js | 16 +++++++++++----- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/containers/allelePage/AlleleSequenceView.js b/src/containers/allelePage/AlleleSequenceView.js index 06526553f..48194bc6c 100644 --- a/src/containers/allelePage/AlleleSequenceView.js +++ b/src/containers/allelePage/AlleleSequenceView.js @@ -22,6 +22,13 @@ function findFminFmax(genomeLocation, variants) { return { fmin, fmax }; } +function findAlleleStart(variants) { + if (variants && variants.data.results) { +//just get the start of the first variant + return variants[0].data.results.location.start; + } +} + const AlleleSequenceView = ({ allele }) => { const variants = useAllAlleleVariants(allele.id); const visibleTranscripts = useDataTableQuery(`/api/allele/${allele.id}/variants`); @@ -41,8 +48,9 @@ const AlleleSequenceView = ({ allele }) => { isoformFilter = visibleTranscripts.data[0].transcriptList.map(a => a.id.split(':').pop()); } - const { fmin, fmax } = findFminFmax(genomeLocation, variants); + //highjacking the htpVaraint to send the start of the variant itself + const htpVariant = findAlleleStart(variants); return ( { displayType='ISOFORM_AND_VARIANT' fmax={fmax} fmin={fmin} + htpVariant={htpVariant} geneSymbol={allele.symbol} genomeLocationList={genomeLocations} height='200px' diff --git a/src/containers/genePage/genomeFeatureWrapper.js b/src/containers/genePage/genomeFeatureWrapper.js index f691b6d2c..085c47010 100644 --- a/src/containers/genePage/genomeFeatureWrapper.js +++ b/src/containers/genePage/genomeFeatureWrapper.js @@ -90,13 +90,18 @@ class GenomeFeatureWrapper extends Component { this.gfc.closeModal(); } - generateJBrowseLink(chr, start, end) { + generateJBrowseLink(chr, start, end, htpVariant) { //const geneSymbolUrl = '&lookupSymbol=' + this.props.geneSymbol; // maybe will use this ^^^ haven't decided const assembly = (getSpecies(this.props.species).jBrowseName).replace(" ","_"); + var externalJBrowsePrefix = '/jbrowse2?tracklist=true&assembly=' + assembly; + + // htpVariant is a loc string of the format 'chr:start' for a variant + if (htpVariant) { + const pieces = htpVariant.split(':'); + externalJBrowsePrefix = externalJBrowsePrefix + '&highlight=' + pieces[0] + ':' + pieces[1] + '-' + pieces[1]; + } - // this vvv will obviously have to be replaced with a proxied agr url - const externalJBrowsePrefix = '/jbrowse2?tracklist=true&assembly=' + assembly; const linkLength = end - start; let bufferedMin = Math.round(start - (linkLength * LINK_BUFFER / 2.0)); bufferedMin = bufferedMin < 0 ? 0 : bufferedMin; @@ -220,13 +225,14 @@ class GenomeFeatureWrapper extends Component { } render() { - const {assembly, id, displayType,genomeLocationList} = this.props; + const {assembly, id, displayType,genomeLocationList,htpVariant} = this.props; const genomeLocation = getSingleGenomeLocation(genomeLocationList); const coordinates = genomeLocationList.map(location => { + //htpVariant contains location of variant info; can use that to set hightlight return( - + {location.chromosome.toLowerCase().startsWith('chr') || location.chromosome.toLowerCase().startsWith('scaffold') ? location.chromosome : 'Chr' + location.chromosome}:{location.start}...{location.end} {location.strand} ({numeral((location.end - location.start) / 1000.0).format('0,0.00')} kb) From 0ebdcb1e830645191679bfb0b946edae0ae99ea3 Mon Sep 17 00:00:00 2001 From: Scott Cain Date: Wed, 3 Apr 2024 09:53:00 -0700 Subject: [PATCH 45/72] updating jbrowse menu link to point at JB2 --- src/constants.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/constants.js b/src/constants.js index 7f58afff0..c56360137 100644 --- a/src/constants.js +++ b/src/constants.js @@ -101,8 +101,8 @@ export const NAV_MENU = [ external: true, }, { - label: 'JBrowse', - route: '/jbrowse/?data=data%2FHomo%20sapiens', + label: 'JBrowse 2', + route: '/jbrowse2/', external: true, } ] From fea5a7d812a243bc7e275bdea9092a7d02215185 Mon Sep 17 00:00:00 2001 From: Scott Cain Date: Wed, 3 Apr 2024 14:32:08 -0700 Subject: [PATCH 46/72] improving the buffer around genes when highlighting a variant --- src/components/variant/VariantJBrowseLink.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/components/variant/VariantJBrowseLink.js b/src/components/variant/VariantJBrowseLink.js index 6a1351225..cee8a2e10 100644 --- a/src/components/variant/VariantJBrowseLink.js +++ b/src/components/variant/VariantJBrowseLink.js @@ -20,7 +20,7 @@ const calculateHighlight = (location, type) => { } }; - +const LINK_BUFFER = 1.2; const buildTrackList = (taxonid) => { const tracks = []; @@ -36,20 +36,25 @@ const buildAssembly = (taxonid) => { return getSpecies(taxonid).jBrowseName.replace(' ', '_'); } +const buildLoc = (location) => { + const start = location.start || 0; + const end = location.end || 0 + const linkLength = end - start; + if (linkLength === 0 ) { return; } + let bufferedMin = Math.round(start - (linkLength * LINK_BUFFER / 2.5)); + bufferedMin = bufferedMin < 0 ? 0 : bufferedMin; + const bufferedMax = Math.round(end + (linkLength * LINK_BUFFER )); + return location.chromosome + ':' + bufferedMin + '..' + bufferedMax ; +} const VariantJBrowseLink = ({children, location, type, geneSymbol, geneLocation, taxonid}) => { return ( location ? Date: Thu, 4 Apr 2024 17:53:03 -0500 Subject: [PATCH 47/72] Made changes to columns according to new API Response --- src/components/dataTable/utils.js | 14 +++ .../diseasePage/DiseaseToAlleleTable.js | 97 +++++++++---------- 2 files changed, 62 insertions(+), 49 deletions(-) diff --git a/src/components/dataTable/utils.js b/src/components/dataTable/utils.js index 57f1d1e24..6f88cda25 100644 --- a/src/components/dataTable/utils.js +++ b/src/components/dataTable/utils.js @@ -22,6 +22,20 @@ export const getIsViaOrthology = (annotation) => { return annotation.generatedRelationString.includes("orthology"); }; +export const getIdentifier = (subject) => { + if(!subject) return; + return subject.curie?subject.curie:(subject.modEntityId?subject.modEntityId:subject.modInternalId); +} + +export const getAlleleObject = (subject) => { + if(!subject) return; + const allele = { + id: getIdentifier(subject), + symbol: subject.alleleSymbol?.displayText, + } + return allele; +} + export const getSingleReferenceUrl = (pubModId) => { const url = getResourceUrl(pubModId); return {pubModId, url}; diff --git a/src/containers/diseasePage/DiseaseToAlleleTable.js b/src/containers/diseasePage/DiseaseToAlleleTable.js index 8e5c0d1b5..80a1973a3 100644 --- a/src/containers/diseasePage/DiseaseToAlleleTable.js +++ b/src/containers/diseasePage/DiseaseToAlleleTable.js @@ -3,19 +3,20 @@ import PropTypes from 'prop-types'; import { AlleleCell, DataTable, - EvidenceCodesCell, - ReferenceCell, + EvidenceCodesCellCuration, + ReferencesCellCuration, SpeciesCell } from '../../components/dataTable'; -import AnnotatedEntitiesPopup - from '../../components/dataTable/AnnotatedEntitiesPopup'; +import ProvidersCellCuration from '../../components/dataTable/ProvidersCellCuration'; import DiseaseLink from '../../components/disease/DiseaseLink'; -import {getDistinctFieldValue} from '../../components/dataTable/utils'; +import {getDistinctFieldValue, getAlleleSymbol, getIdentifier} from '../../components/dataTable/utils'; import {compareByFixedOrder} from '../../lib/utils'; import {SPECIES_NAME_ORDER} from '../../constants'; import useDataTableQuery from '../../hooks/useDataTableQuery'; import SpeciesName from '../../components/SpeciesName'; import AssociationType from '../../components/AssociationType'; +import DiseaseQualifiersColumn from '../../components/dataTable/DiseaseQualifiersColumn'; +import { getAlleleObject, buildProvidersWithUrl } from '../../components/dataTable/utils'; const DiseaseToAlleleTable = ({id}) => { const { @@ -24,39 +25,32 @@ const DiseaseToAlleleTable = ({id}) => { ...tableProps } = useDataTableQuery(`/api/disease/${id}/alleles`, undefined, { sizePerPage: 10, }, {}, 60000); - const data = results.map(association => ({ - ...association, - species: association.allele.species, - })); - const columns = [ { - dataField: 'allele', + dataField: 'subject', text: 'Allele', - formatter: (allele, row) => ( + formatter: (subject) => { + const allele = getAlleleObject(subject); + return( -
- - - Annotation details - - -
- ), - headerStyle: {width: '185px'}, + +
+ ) + }, + headerStyle: { width: '75px' }, filterable: true, filterName: 'alleleName', }, { - dataField: 'species', + dataField: 'subject.taxon', text: 'Species', formatter: species => , filterable: getDistinctFieldValue(resolvedData, 'species').sort(compareByFixedOrder(SPECIES_NAME_ORDER)), filterFormatter: speciesName => {speciesName}, - headerStyle: {width: '105px'}, + headerStyle: {width: '100px'}, }, { - dataField: 'associationType', + dataField: 'generatedRelationString', text: 'Association', formatter: type => , headerStyle: {width: '110px'}, @@ -64,60 +58,65 @@ const DiseaseToAlleleTable = ({id}) => { filterFormatter: type => , }, { - dataField: 'disease', + dataField: 'diseaseQualifiers', + text: 'Disease Qualifier', + headerStyle: { width: '110px' }, + formatter: diseaseQualifiers => , + filterable: getDistinctFieldValue(resolvedData, 'diseaseQualifiers'), + filterName: 'diseaseQualifier', + filterType: 'checkbox', + }, + { + dataField: 'object', text: 'Disease', - formatter: disease => , - headerStyle: {width: '150px'}, + formatter: object => + , + headerStyle: {width: '120px'}, filterable: true, }, { dataField: 'evidenceCodes', text: 'Evidence', - formatter: codes => , + helpPopupProps: { + id: 'disease-page--gene-disease-associations-table--evidence-help', + children: Mouse-over to decipher the evidence code. The Alliance uses these evidence codes to justify DO annotations., + }, + formatter: codes => , headerStyle: {width: '100px'}, filterable: true, filterName: 'evidenceCode', }, { - dataField: 'source', + dataField: 'providers', text: 'Source', - formatter: source => source.name, + formatter: providers => providers && , headerStyle: {width: '100px'}, filterable: true, }, { - dataField: 'publications', + dataField: 'pubmedPubModIDs', text: 'References', - formatter: ReferenceCell, + formatter: (pubmedPubModIDs) => { + return + }, headerStyle: {width: '150px'}, filterable: true, filterName: 'reference', } ]; - const sortOptions = [ - { - value: 'disease', - label: 'Disease', - }, - { - value: 'allele', - label: 'Allele', - }, - { - value: 'species', - label: 'Species', - }, - ]; + const rows = results.map(association => ({ + species: association.subject.taxon, + providers: buildProvidersWithUrl(association.primaryAnnotations), + ...association, + })); return ( ); }; From 8da7bb01e7f7ca866b0996f5c683263270631197 Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Fri, 5 Apr 2024 09:41:56 -0500 Subject: [PATCH 48/72] Indentation --- .../diseasePage/DiseaseToAlleleTable.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/containers/diseasePage/DiseaseToAlleleTable.js b/src/containers/diseasePage/DiseaseToAlleleTable.js index 80a1973a3..71ba5edf9 100644 --- a/src/containers/diseasePage/DiseaseToAlleleTable.js +++ b/src/containers/diseasePage/DiseaseToAlleleTable.js @@ -30,12 +30,12 @@ const DiseaseToAlleleTable = ({id}) => { dataField: 'subject', text: 'Allele', formatter: (subject) => { - const allele = getAlleleObject(subject); - return( - - - - ) + const allele = getAlleleObject(subject); + return( + + + + ) }, headerStyle: { width: '75px' }, filterable: true, @@ -69,8 +69,7 @@ const DiseaseToAlleleTable = ({id}) => { { dataField: 'object', text: 'Disease', - formatter: object => - , + formatter: object => , headerStyle: {width: '120px'}, filterable: true, }, @@ -78,7 +77,7 @@ const DiseaseToAlleleTable = ({id}) => { dataField: 'evidenceCodes', text: 'Evidence', helpPopupProps: { - id: 'disease-page--gene-disease-associations-table--evidence-help', + id: 'disease-page--allele-disease-associations-table--evidence-help', children: Mouse-over to decipher the evidence code. The Alliance uses these evidence codes to justify DO annotations., }, formatter: codes => , From 9d3fe075810140924eb2acf92584d657eef23eb4 Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Fri, 5 Apr 2024 10:38:15 -0500 Subject: [PATCH 49/72] Changed the disease link rendering component --- src/containers/diseasePage/DiseaseToAlleleTable.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/containers/diseasePage/DiseaseToAlleleTable.js b/src/containers/diseasePage/DiseaseToAlleleTable.js index 71ba5edf9..1567426fc 100644 --- a/src/containers/diseasePage/DiseaseToAlleleTable.js +++ b/src/containers/diseasePage/DiseaseToAlleleTable.js @@ -8,8 +8,8 @@ import { SpeciesCell } from '../../components/dataTable'; import ProvidersCellCuration from '../../components/dataTable/ProvidersCellCuration'; -import DiseaseLink from '../../components/disease/DiseaseLink'; -import {getDistinctFieldValue, getAlleleSymbol, getIdentifier} from '../../components/dataTable/utils'; +import DiseaseLinkCuration from '../../components/disease/DiseaseLinkCuration'; +import {getDistinctFieldValue} from '../../components/dataTable/utils'; import {compareByFixedOrder} from '../../lib/utils'; import {SPECIES_NAME_ORDER} from '../../constants'; import useDataTableQuery from '../../hooks/useDataTableQuery'; @@ -69,7 +69,7 @@ const DiseaseToAlleleTable = ({id}) => { { dataField: 'object', text: 'Disease', - formatter: object => , + formatter: object => , headerStyle: {width: '120px'}, filterable: true, }, From c4c06f34db8049470aeeffb9d3c976837d8d9d4a Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Fri, 5 Apr 2024 14:13:26 -0500 Subject: [PATCH 50/72] Added filter names --- src/containers/diseasePage/DiseaseToAlleleTable.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/containers/diseasePage/DiseaseToAlleleTable.js b/src/containers/diseasePage/DiseaseToAlleleTable.js index 1567426fc..f4f9248c3 100644 --- a/src/containers/diseasePage/DiseaseToAlleleTable.js +++ b/src/containers/diseasePage/DiseaseToAlleleTable.js @@ -45,8 +45,10 @@ const DiseaseToAlleleTable = ({id}) => { dataField: 'subject.taxon', text: 'Species', formatter: species => , + filterName: 'species', filterable: getDistinctFieldValue(resolvedData, 'species').sort(compareByFixedOrder(SPECIES_NAME_ORDER)), filterFormatter: speciesName => {speciesName}, + filterType: 'checkbox', headerStyle: {width: '100px'}, }, { @@ -54,8 +56,10 @@ const DiseaseToAlleleTable = ({id}) => { text: 'Association', formatter: type => , headerStyle: {width: '110px'}, + filterName: 'associationType', filterable: getDistinctFieldValue(resolvedData, 'associationType'), filterFormatter: type => , + filterType: 'checkbox', }, { dataField: 'diseaseQualifiers', @@ -71,6 +75,7 @@ const DiseaseToAlleleTable = ({id}) => { text: 'Disease', formatter: object => , headerStyle: {width: '120px'}, + filterName: 'disease', filterable: true, }, { @@ -91,6 +96,7 @@ const DiseaseToAlleleTable = ({id}) => { formatter: providers => providers && , headerStyle: {width: '100px'}, filterable: true, + filterName: 'dataProvider', }, { dataField: 'pubmedPubModIDs', From 522856041c48b16d863960db7f134d45845eda2a Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Mon, 8 Apr 2024 13:47:27 -0500 Subject: [PATCH 51/72] Changes to Gene Table in Disease Page --- .../dataTable/AnnotatedEntitiesPopupCuration.js | 17 +++++++++-------- src/components/dataTable/utils.js | 9 +++++++++ .../diseasePage/DiseaseToGeneTable.js | 11 ++++++----- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/src/components/dataTable/AnnotatedEntitiesPopupCuration.js b/src/components/dataTable/AnnotatedEntitiesPopupCuration.js index 2a4bb64b9..cc32513cc 100644 --- a/src/components/dataTable/AnnotatedEntitiesPopupCuration.js +++ b/src/components/dataTable/AnnotatedEntitiesPopupCuration.js @@ -22,22 +22,23 @@ import AnnotationType from './AnnotationType'; import AssociationCellCuration from './AssociationCellCuration'; import AssertedGenes from './AssertedGenes'; import GeneticModifiersCellCuration from './GeneticModifiersCellCuration'; -import { buildProviderWithUrl } from './utils'; +import { buildProviderWithUrl, getIdentifier } from './utils'; import StrainBackground from './StrainBackground'; function renderLink(entity) { - const url = getResourceUrl(entity.subject.curie, entity.subject.type, entity.subject.subtype) + const curie = getIdentifier(entity.diseaseAnnotationSubject); + const url = getResourceUrl(curie, entity.diseaseAnnotationSubject.type, entity.diseaseAnnotationSubject.subtype) if (entity.type === 'AlleleDiseaseAnnotation') { - const innerText = entity.subject.alleleSymbol ? entity.subject.alleleSymbol.displayText : entity.subject.name; + const innerText = entity.diseaseAnnotationSubject.alleleSymbol ? entity.diseaseAnnotationSubject.alleleSymbol.displayText : entity.diseaseAnnotationSubject.name; const inner = ; - return {inner}; + return {inner}; } else if(entity.type === 'GeneDiseaseAnnotation'){ - const innerText = entity.subject.geneSymbol ? entity.subject.geneSymbol.displayText : entity.subject.name; + const innerText = entity.diseaseAnnotationSubject.geneSymbol ? entity.diseaseAnnotationSubject.geneSymbol.displayText : entity.diseaseAnnotationSubject.name; const inner = ; - return {inner}; + return {inner}; } else { - const inner = ; + const inner = ; return {inner}; } } @@ -89,7 +90,7 @@ function AnnotatedEntitiesPopupCuration({ children, entities, parentPage, mainRo return ( {renderLink(entity)} - + { parentPage === 'gene' || 'disease' ? : <>} diff --git a/src/components/dataTable/utils.js b/src/components/dataTable/utils.js index 6f88cda25..6761bafea 100644 --- a/src/components/dataTable/utils.js +++ b/src/components/dataTable/utils.js @@ -36,6 +36,15 @@ export const getAlleleObject = (subject) => { return allele; } +export const getGeneObject = (subject) => { + if(!subject) return; + const gene = { + curie: getIdentifier(subject), + geneSymbol: subject.geneSymbol, + } + return gene; +} + export const getSingleReferenceUrl = (pubModId) => { const url = getResourceUrl(pubModId); return {pubModId, url}; diff --git a/src/containers/diseasePage/DiseaseToGeneTable.js b/src/containers/diseasePage/DiseaseToGeneTable.js index 488e81aa1..ecd2345a7 100644 --- a/src/containers/diseasePage/DiseaseToGeneTable.js +++ b/src/containers/diseasePage/DiseaseToGeneTable.js @@ -11,7 +11,7 @@ import { import ProvidersCellCuration from '../../components/dataTable/ProvidersCellCuration'; import useDataTableQuery from '../../hooks/useDataTableQuery'; import AssociationType from '../../components/AssociationType'; -import { buildProvidersWithUrl, getIsViaOrthology, getDistinctFieldValue } from '../../components/dataTable/utils'; +import { getGeneObject,buildProvidersWithUrl, getIsViaOrthology, getDistinctFieldValue } from '../../components/dataTable/utils'; import { compareByFixedOrder } from '../../lib/utils'; import { SPECIES_NAME_ORDER } from '../../constants'; import SpeciesCell from '../../components/dataTable/SpeciesCell'; @@ -32,19 +32,20 @@ const DiseaseToGeneTable = ({ id }) => { const columns = [ { - dataField: 'subject.curie', + dataField: 'subject', text: 'Gene', - formatter: (curie, row) => { + formatter: (subject, row) => { const isViaOrthology = getIsViaOrthology(row); + const gene = getGeneObject(subject); return ( -
{GeneCellCuration(row.subject)}
+
{GeneCellCuration(gene)}
{!isViaOrthology && ( Annotation details From 9efb2b60aafaa6077686833d64e647e4dadf0ef1 Mon Sep 17 00:00:00 2001 From: Varun Reddy <90427085+VarunReddy1111@users.noreply.github.com> Date: Mon, 8 Apr 2024 14:48:36 -0500 Subject: [PATCH 52/72] Revert "SCRUM-3743 UI work to display disease page associated alleles from persistent store" --- .../AnnotatedEntitiesPopupCuration.js | 17 ++- src/components/dataTable/utils.js | 23 ---- .../diseasePage/DiseaseToAlleleTable.js | 104 +++++++++--------- .../diseasePage/DiseaseToGeneTable.js | 11 +- 4 files changed, 63 insertions(+), 92 deletions(-) diff --git a/src/components/dataTable/AnnotatedEntitiesPopupCuration.js b/src/components/dataTable/AnnotatedEntitiesPopupCuration.js index cc32513cc..2a4bb64b9 100644 --- a/src/components/dataTable/AnnotatedEntitiesPopupCuration.js +++ b/src/components/dataTable/AnnotatedEntitiesPopupCuration.js @@ -22,23 +22,22 @@ import AnnotationType from './AnnotationType'; import AssociationCellCuration from './AssociationCellCuration'; import AssertedGenes from './AssertedGenes'; import GeneticModifiersCellCuration from './GeneticModifiersCellCuration'; -import { buildProviderWithUrl, getIdentifier } from './utils'; +import { buildProviderWithUrl } from './utils'; import StrainBackground from './StrainBackground'; function renderLink(entity) { - const curie = getIdentifier(entity.diseaseAnnotationSubject); - const url = getResourceUrl(curie, entity.diseaseAnnotationSubject.type, entity.diseaseAnnotationSubject.subtype) + const url = getResourceUrl(entity.subject.curie, entity.subject.type, entity.subject.subtype) if (entity.type === 'AlleleDiseaseAnnotation') { - const innerText = entity.diseaseAnnotationSubject.alleleSymbol ? entity.diseaseAnnotationSubject.alleleSymbol.displayText : entity.diseaseAnnotationSubject.name; + const innerText = entity.subject.alleleSymbol ? entity.subject.alleleSymbol.displayText : entity.subject.name; const inner = ; - return {inner}; + return {inner}; } else if(entity.type === 'GeneDiseaseAnnotation'){ - const innerText = entity.diseaseAnnotationSubject.geneSymbol ? entity.diseaseAnnotationSubject.geneSymbol.displayText : entity.diseaseAnnotationSubject.name; + const innerText = entity.subject.geneSymbol ? entity.subject.geneSymbol.displayText : entity.subject.name; const inner = ; - return {inner}; + return {inner}; } else { - const inner = ; + const inner = ; return {inner}; } } @@ -90,7 +89,7 @@ function AnnotatedEntitiesPopupCuration({ children, entities, parentPage, mainRo return ( {renderLink(entity)} - + { parentPage === 'gene' || 'disease' ? : <>} diff --git a/src/components/dataTable/utils.js b/src/components/dataTable/utils.js index 6761bafea..57f1d1e24 100644 --- a/src/components/dataTable/utils.js +++ b/src/components/dataTable/utils.js @@ -22,29 +22,6 @@ export const getIsViaOrthology = (annotation) => { return annotation.generatedRelationString.includes("orthology"); }; -export const getIdentifier = (subject) => { - if(!subject) return; - return subject.curie?subject.curie:(subject.modEntityId?subject.modEntityId:subject.modInternalId); -} - -export const getAlleleObject = (subject) => { - if(!subject) return; - const allele = { - id: getIdentifier(subject), - symbol: subject.alleleSymbol?.displayText, - } - return allele; -} - -export const getGeneObject = (subject) => { - if(!subject) return; - const gene = { - curie: getIdentifier(subject), - geneSymbol: subject.geneSymbol, - } - return gene; -} - export const getSingleReferenceUrl = (pubModId) => { const url = getResourceUrl(pubModId); return {pubModId, url}; diff --git a/src/containers/diseasePage/DiseaseToAlleleTable.js b/src/containers/diseasePage/DiseaseToAlleleTable.js index f4f9248c3..8e5c0d1b5 100644 --- a/src/containers/diseasePage/DiseaseToAlleleTable.js +++ b/src/containers/diseasePage/DiseaseToAlleleTable.js @@ -3,20 +3,19 @@ import PropTypes from 'prop-types'; import { AlleleCell, DataTable, - EvidenceCodesCellCuration, - ReferencesCellCuration, + EvidenceCodesCell, + ReferenceCell, SpeciesCell } from '../../components/dataTable'; -import ProvidersCellCuration from '../../components/dataTable/ProvidersCellCuration'; -import DiseaseLinkCuration from '../../components/disease/DiseaseLinkCuration'; +import AnnotatedEntitiesPopup + from '../../components/dataTable/AnnotatedEntitiesPopup'; +import DiseaseLink from '../../components/disease/DiseaseLink'; import {getDistinctFieldValue} from '../../components/dataTable/utils'; import {compareByFixedOrder} from '../../lib/utils'; import {SPECIES_NAME_ORDER} from '../../constants'; import useDataTableQuery from '../../hooks/useDataTableQuery'; import SpeciesName from '../../components/SpeciesName'; import AssociationType from '../../components/AssociationType'; -import DiseaseQualifiersColumn from '../../components/dataTable/DiseaseQualifiersColumn'; -import { getAlleleObject, buildProvidersWithUrl } from '../../components/dataTable/utils'; const DiseaseToAlleleTable = ({id}) => { const { @@ -25,103 +24,100 @@ const DiseaseToAlleleTable = ({id}) => { ...tableProps } = useDataTableQuery(`/api/disease/${id}/alleles`, undefined, { sizePerPage: 10, }, {}, 60000); + const data = results.map(association => ({ + ...association, + species: association.allele.species, + })); + const columns = [ { - dataField: 'subject', + dataField: 'allele', text: 'Allele', - formatter: (subject) => { - const allele = getAlleleObject(subject); - return( - - - - ) - }, - headerStyle: { width: '75px' }, + formatter: (allele, row) => ( + +
+ + + Annotation details + + +
+ ), + headerStyle: {width: '185px'}, filterable: true, filterName: 'alleleName', }, { - dataField: 'subject.taxon', + dataField: 'species', text: 'Species', formatter: species => , - filterName: 'species', filterable: getDistinctFieldValue(resolvedData, 'species').sort(compareByFixedOrder(SPECIES_NAME_ORDER)), filterFormatter: speciesName => {speciesName}, - filterType: 'checkbox', - headerStyle: {width: '100px'}, + headerStyle: {width: '105px'}, }, { - dataField: 'generatedRelationString', + dataField: 'associationType', text: 'Association', formatter: type => , headerStyle: {width: '110px'}, - filterName: 'associationType', filterable: getDistinctFieldValue(resolvedData, 'associationType'), filterFormatter: type => , - filterType: 'checkbox', }, { - dataField: 'diseaseQualifiers', - text: 'Disease Qualifier', - headerStyle: { width: '110px' }, - formatter: diseaseQualifiers => , - filterable: getDistinctFieldValue(resolvedData, 'diseaseQualifiers'), - filterName: 'diseaseQualifier', - filterType: 'checkbox', - }, - { - dataField: 'object', + dataField: 'disease', text: 'Disease', - formatter: object => , - headerStyle: {width: '120px'}, - filterName: 'disease', + formatter: disease => , + headerStyle: {width: '150px'}, filterable: true, }, { dataField: 'evidenceCodes', text: 'Evidence', - helpPopupProps: { - id: 'disease-page--allele-disease-associations-table--evidence-help', - children: Mouse-over to decipher the evidence code. The Alliance uses these evidence codes to justify DO annotations., - }, - formatter: codes => , + formatter: codes => , headerStyle: {width: '100px'}, filterable: true, filterName: 'evidenceCode', }, { - dataField: 'providers', + dataField: 'source', text: 'Source', - formatter: providers => providers && , + formatter: source => source.name, headerStyle: {width: '100px'}, filterable: true, - filterName: 'dataProvider', }, { - dataField: 'pubmedPubModIDs', + dataField: 'publications', text: 'References', - formatter: (pubmedPubModIDs) => { - return - }, + formatter: ReferenceCell, headerStyle: {width: '150px'}, filterable: true, filterName: 'reference', } ]; - const rows = results.map(association => ({ - species: association.subject.taxon, - providers: buildProvidersWithUrl(association.primaryAnnotations), - ...association, - })); + const sortOptions = [ + { + value: 'disease', + label: 'Disease', + }, + { + value: 'allele', + label: 'Allele', + }, + { + value: 'species', + label: 'Species', + }, + ]; return ( ); }; diff --git a/src/containers/diseasePage/DiseaseToGeneTable.js b/src/containers/diseasePage/DiseaseToGeneTable.js index ecd2345a7..488e81aa1 100644 --- a/src/containers/diseasePage/DiseaseToGeneTable.js +++ b/src/containers/diseasePage/DiseaseToGeneTable.js @@ -11,7 +11,7 @@ import { import ProvidersCellCuration from '../../components/dataTable/ProvidersCellCuration'; import useDataTableQuery from '../../hooks/useDataTableQuery'; import AssociationType from '../../components/AssociationType'; -import { getGeneObject,buildProvidersWithUrl, getIsViaOrthology, getDistinctFieldValue } from '../../components/dataTable/utils'; +import { buildProvidersWithUrl, getIsViaOrthology, getDistinctFieldValue } from '../../components/dataTable/utils'; import { compareByFixedOrder } from '../../lib/utils'; import { SPECIES_NAME_ORDER } from '../../constants'; import SpeciesCell from '../../components/dataTable/SpeciesCell'; @@ -32,20 +32,19 @@ const DiseaseToGeneTable = ({ id }) => { const columns = [ { - dataField: 'subject', + dataField: 'subject.curie', text: 'Gene', - formatter: (subject, row) => { + formatter: (curie, row) => { const isViaOrthology = getIsViaOrthology(row); - const gene = getGeneObject(subject); return ( -
{GeneCellCuration(gene)}
+
{GeneCellCuration(row.subject)}
{!isViaOrthology && ( Annotation details From 82e4d03977db44a0d64748f9de3392df80acc90c Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Tue, 9 Apr 2024 10:26:54 -0500 Subject: [PATCH 53/72] Fixed gene table in disease page according to API fields --- .../dataTable/AnnotatedEntitiesPopupCuration.js | 17 +++++++++-------- src/components/dataTable/utils.js | 13 +++++++++++++ .../diseasePage/DiseaseToGeneTable.js | 11 ++++++----- 3 files changed, 28 insertions(+), 13 deletions(-) diff --git a/src/components/dataTable/AnnotatedEntitiesPopupCuration.js b/src/components/dataTable/AnnotatedEntitiesPopupCuration.js index 2a4bb64b9..cc32513cc 100644 --- a/src/components/dataTable/AnnotatedEntitiesPopupCuration.js +++ b/src/components/dataTable/AnnotatedEntitiesPopupCuration.js @@ -22,22 +22,23 @@ import AnnotationType from './AnnotationType'; import AssociationCellCuration from './AssociationCellCuration'; import AssertedGenes from './AssertedGenes'; import GeneticModifiersCellCuration from './GeneticModifiersCellCuration'; -import { buildProviderWithUrl } from './utils'; +import { buildProviderWithUrl, getIdentifier } from './utils'; import StrainBackground from './StrainBackground'; function renderLink(entity) { - const url = getResourceUrl(entity.subject.curie, entity.subject.type, entity.subject.subtype) + const curie = getIdentifier(entity.diseaseAnnotationSubject); + const url = getResourceUrl(curie, entity.diseaseAnnotationSubject.type, entity.diseaseAnnotationSubject.subtype) if (entity.type === 'AlleleDiseaseAnnotation') { - const innerText = entity.subject.alleleSymbol ? entity.subject.alleleSymbol.displayText : entity.subject.name; + const innerText = entity.diseaseAnnotationSubject.alleleSymbol ? entity.diseaseAnnotationSubject.alleleSymbol.displayText : entity.diseaseAnnotationSubject.name; const inner = ; - return {inner}; + return {inner}; } else if(entity.type === 'GeneDiseaseAnnotation'){ - const innerText = entity.subject.geneSymbol ? entity.subject.geneSymbol.displayText : entity.subject.name; + const innerText = entity.diseaseAnnotationSubject.geneSymbol ? entity.diseaseAnnotationSubject.geneSymbol.displayText : entity.diseaseAnnotationSubject.name; const inner = ; - return {inner}; + return {inner}; } else { - const inner = ; + const inner = ; return {inner}; } } @@ -89,7 +90,7 @@ function AnnotatedEntitiesPopupCuration({ children, entities, parentPage, mainRo return ( {renderLink(entity)} - + { parentPage === 'gene' || 'disease' ? : <>} diff --git a/src/components/dataTable/utils.js b/src/components/dataTable/utils.js index 57f1d1e24..61df6ac11 100644 --- a/src/components/dataTable/utils.js +++ b/src/components/dataTable/utils.js @@ -17,6 +17,19 @@ export const getDistinctFieldValue = (response, field) => { value && value.trim() )); }; +export const getIdentifier = (subject) => { + if(!subject) return; + return subject.curie?subject.curie:(subject.modEntityId?subject.modEntityId:subject.modInternalId); +} + +export const getGeneObject = (subject) => { + if(!subject) return; + const gene = { + curie: getIdentifier(subject), + geneSymbol: subject.geneSymbol, + } + return gene; +} export const getIsViaOrthology = (annotation) => { return annotation.generatedRelationString.includes("orthology"); diff --git a/src/containers/diseasePage/DiseaseToGeneTable.js b/src/containers/diseasePage/DiseaseToGeneTable.js index 488e81aa1..ecd2345a7 100644 --- a/src/containers/diseasePage/DiseaseToGeneTable.js +++ b/src/containers/diseasePage/DiseaseToGeneTable.js @@ -11,7 +11,7 @@ import { import ProvidersCellCuration from '../../components/dataTable/ProvidersCellCuration'; import useDataTableQuery from '../../hooks/useDataTableQuery'; import AssociationType from '../../components/AssociationType'; -import { buildProvidersWithUrl, getIsViaOrthology, getDistinctFieldValue } from '../../components/dataTable/utils'; +import { getGeneObject,buildProvidersWithUrl, getIsViaOrthology, getDistinctFieldValue } from '../../components/dataTable/utils'; import { compareByFixedOrder } from '../../lib/utils'; import { SPECIES_NAME_ORDER } from '../../constants'; import SpeciesCell from '../../components/dataTable/SpeciesCell'; @@ -32,19 +32,20 @@ const DiseaseToGeneTable = ({ id }) => { const columns = [ { - dataField: 'subject.curie', + dataField: 'subject', text: 'Gene', - formatter: (curie, row) => { + formatter: (subject, row) => { const isViaOrthology = getIsViaOrthology(row); + const gene = getGeneObject(subject); return ( -
{GeneCellCuration(row.subject)}
+
{GeneCellCuration(gene)}
{!isViaOrthology && ( Annotation details From b70e72544ef084bba7c4644bc3427dee02df97a7 Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Tue, 9 Apr 2024 10:51:22 -0500 Subject: [PATCH 54/72] better spacing --- src/components/dataTable/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/dataTable/utils.js b/src/components/dataTable/utils.js index 61df6ac11..42902eb96 100644 --- a/src/components/dataTable/utils.js +++ b/src/components/dataTable/utils.js @@ -19,7 +19,7 @@ export const getDistinctFieldValue = (response, field) => { }; export const getIdentifier = (subject) => { if(!subject) return; - return subject.curie?subject.curie:(subject.modEntityId?subject.modEntityId:subject.modInternalId); + return subject.curie ? subject.curie : (subject.modEntityId ? subject.modEntityId : subject.modInternalId); } export const getGeneObject = (subject) => { From 3faee95455b3ba2873cd8ffb7a689bc78aa68412 Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Tue, 9 Apr 2024 11:24:59 -0500 Subject: [PATCH 55/72] Removed the method getGeneObject --- src/components/dataTable/utils.js | 10 +--------- src/containers/diseasePage/DiseaseToGeneTable.js | 9 +++++---- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/components/dataTable/utils.js b/src/components/dataTable/utils.js index 42902eb96..23ddaab65 100644 --- a/src/components/dataTable/utils.js +++ b/src/components/dataTable/utils.js @@ -17,20 +17,12 @@ export const getDistinctFieldValue = (response, field) => { value && value.trim() )); }; + export const getIdentifier = (subject) => { if(!subject) return; return subject.curie ? subject.curie : (subject.modEntityId ? subject.modEntityId : subject.modInternalId); } -export const getGeneObject = (subject) => { - if(!subject) return; - const gene = { - curie: getIdentifier(subject), - geneSymbol: subject.geneSymbol, - } - return gene; -} - export const getIsViaOrthology = (annotation) => { return annotation.generatedRelationString.includes("orthology"); }; diff --git a/src/containers/diseasePage/DiseaseToGeneTable.js b/src/containers/diseasePage/DiseaseToGeneTable.js index ecd2345a7..3c982f387 100644 --- a/src/containers/diseasePage/DiseaseToGeneTable.js +++ b/src/containers/diseasePage/DiseaseToGeneTable.js @@ -11,7 +11,7 @@ import { import ProvidersCellCuration from '../../components/dataTable/ProvidersCellCuration'; import useDataTableQuery from '../../hooks/useDataTableQuery'; import AssociationType from '../../components/AssociationType'; -import { getGeneObject,buildProvidersWithUrl, getIsViaOrthology, getDistinctFieldValue } from '../../components/dataTable/utils'; +import { buildProvidersWithUrl, getIsViaOrthology, getDistinctFieldValue, getIdentifier } from '../../components/dataTable/utils'; import { compareByFixedOrder } from '../../lib/utils'; import { SPECIES_NAME_ORDER } from '../../constants'; import SpeciesCell from '../../components/dataTable/SpeciesCell'; @@ -36,16 +36,17 @@ const DiseaseToGeneTable = ({ id }) => { text: 'Gene', formatter: (subject, row) => { const isViaOrthology = getIsViaOrthology(row); - const gene = getGeneObject(subject); return ( -
{GeneCellCuration(gene)}
+
+ +
{!isViaOrthology && ( Annotation details From 13f059a62bc72e7793db38b0acbe368173cb9d9a Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Wed, 17 Apr 2024 11:17:40 -0500 Subject: [PATCH 56/72] Fixing gene hyperlink --- src/components/disease/diseaseAnnotationTable.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/disease/diseaseAnnotationTable.js b/src/components/disease/diseaseAnnotationTable.js index 045782b4a..befa51752 100644 --- a/src/components/disease/diseaseAnnotationTable.js +++ b/src/components/disease/diseaseAnnotationTable.js @@ -9,7 +9,7 @@ import { SpeciesCell, } from '../dataTable'; import AnnotatedEntitiesPopupCuration from '../dataTable/AnnotatedEntitiesPopupCuration'; -import { getDistinctFieldValue, buildProvidersWithUrl } from '../dataTable/utils'; +import { getIdentifier, getDistinctFieldValue, buildProvidersWithUrl } from '../dataTable/utils'; import {compareByFixedOrder} from '../../lib/utils'; import {SPECIES_NAME_ORDER} from '../../constants'; import ProvidersCellCuration from '../dataTable/ProvidersCellCuration'; @@ -61,16 +61,16 @@ const DiseaseAnnotationTable = ({ hidden: !orthologGenes || !orthologGenes.length }, { - dataField: 'subject.curie', + dataField: 'subject', text: 'Gene', - formatter: (curie, row) => ( + formatter: (subject, row) => ( -
{GeneCellCuration(row.subject)}
+ Annotation details From c19e14159c150e024254aba1be293c2984f2241b Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Wed, 17 Apr 2024 13:41:23 -0500 Subject: [PATCH 57/72] Disabling downloads for data tables larger than 90000 rows --- src/components/dataTable/DataTable.js | 16 +++++++++++++--- src/components/dataTable/downloadButton.js | 3 ++- src/constants.js | 1 + 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/components/dataTable/DataTable.js b/src/components/dataTable/DataTable.js index 645a66c36..e96c6d4ba 100644 --- a/src/components/dataTable/DataTable.js +++ b/src/components/dataTable/DataTable.js @@ -1,4 +1,4 @@ -import React, { useRef } from 'react'; +import React, { useRef, useState } from 'react'; import BootstrapTable from 'react-bootstrap-table-next'; import { Form, Input, Label } from 'reactstrap'; import paginationFactory, { @@ -25,6 +25,7 @@ import HorizontalScroll from '../horizontalScroll'; import { buildTableQueryString } from '../../lib/utils'; import LoadingSpinner from '../loadingSpinner'; import DropdownNoDataFilter from './DropdownNoDataFilter'; +import {ROW_THRESHOLD} from '../../constants'; const DataTable = ({ className, @@ -61,6 +62,11 @@ const DataTable = ({ return filters; }; + let disabled = false; + const setDisabled = (value) => { + disabled = value; + return true; + }; const scrollIntoView = () => { containerRef.current.scrollIntoView({ behavior: 'smooth', @@ -221,12 +227,16 @@ const DataTable = ({ ) } - {downloadUrl && + {downloadUrl && (paginationObj.options?.totalSize < ROW_THRESHOLD? setDisabled(false) : setDisabled(true)) && } - + { + disabled &&
The table above cannot be downloaded because there are too many rows in the unfiltered table. Please apply filter(s) to limit the number of rows to less than {ROW_THRESHOLD} to enable the Download button or visit our to download the entire disease annotation set.
+ } + ); }; diff --git a/src/components/dataTable/downloadButton.js b/src/components/dataTable/downloadButton.js index 8071b59de..562562fa1 100644 --- a/src/components/dataTable/downloadButton.js +++ b/src/components/dataTable/downloadButton.js @@ -1,11 +1,12 @@ import React from 'react'; import PropTypes from 'prop-types'; -const DownloadButton = ({downloadUrl, text}) => { +const DownloadButton = ({downloadUrl, text, disabled = false}) => { return( diff --git a/src/constants.js b/src/constants.js index c56360137..f88a29ee0 100644 --- a/src/constants.js +++ b/src/constants.js @@ -431,3 +431,4 @@ export const GA_EVENT_ACTION = { SET_PAGE_SIZE: 'Set page size' }; +export const ROW_THRESHOLD = 90000; From f05e86846c430ae60395e375742cc83befd3d544 Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Wed, 17 Apr 2024 13:57:46 -0500 Subject: [PATCH 58/72] Added downloads page link --- src/components/dataTable/DataTable.js | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/components/dataTable/DataTable.js b/src/components/dataTable/DataTable.js index e96c6d4ba..0b4f17638 100644 --- a/src/components/dataTable/DataTable.js +++ b/src/components/dataTable/DataTable.js @@ -26,6 +26,7 @@ import { buildTableQueryString } from '../../lib/utils'; import LoadingSpinner from '../loadingSpinner'; import DropdownNoDataFilter from './DropdownNoDataFilter'; import {ROW_THRESHOLD} from '../../constants'; +import { Link } from 'react-router-dom'; const DataTable = ({ className, @@ -227,16 +228,23 @@ const DataTable = ({ ) } - {downloadUrl && (paginationObj.options?.totalSize < ROW_THRESHOLD? setDisabled(false) : setDisabled(true)) && - + { + downloadUrl && (paginationObj.options?.totalSize < ROW_THRESHOLD ? setDisabled(false) : setDisabled(true)) && + + } + { + disabled && +
+ The table above cannot be downloaded because there are too many rows in the unfiltered table. + Please apply filter(s) to limit the number of rows to less than {ROW_THRESHOLD} to enable the Download button or visit our + Downloads page + to download the entire disease annotation set. +
} - { - disabled &&
The table above cannot be downloaded because there are too many rows in the unfiltered table. Please apply filter(s) to limit the number of rows to less than {ROW_THRESHOLD} to enable the Download button or visit our to download the entire disease annotation set.
- } - + ); }; From 7950217d55953917976d8d1737c36ec6eddbbbbb Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Wed, 17 Apr 2024 14:00:15 -0500 Subject: [PATCH 59/72] indentation fix --- src/components/dataTable/DataTable.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/dataTable/DataTable.js b/src/components/dataTable/DataTable.js index 0b4f17638..cafa6f6a7 100644 --- a/src/components/dataTable/DataTable.js +++ b/src/components/dataTable/DataTable.js @@ -64,10 +64,12 @@ const DataTable = ({ }; let disabled = false; + const setDisabled = (value) => { disabled = value; return true; }; + const scrollIntoView = () => { containerRef.current.scrollIntoView({ behavior: 'smooth', From b9245044e604196fa64b8541a46ad06cf4d81dc0 Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Wed, 17 Apr 2024 14:06:49 -0500 Subject: [PATCH 60/72] Removed unsued useState import --- src/components/dataTable/DataTable.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/dataTable/DataTable.js b/src/components/dataTable/DataTable.js index cafa6f6a7..25cec3045 100644 --- a/src/components/dataTable/DataTable.js +++ b/src/components/dataTable/DataTable.js @@ -1,4 +1,4 @@ -import React, { useRef, useState } from 'react'; +import React, { useRef } from 'react'; import BootstrapTable from 'react-bootstrap-table-next'; import { Form, Input, Label } from 'reactstrap'; import paginationFactory, { @@ -64,7 +64,7 @@ const DataTable = ({ }; let disabled = false; - + const setDisabled = (value) => { disabled = value; return true; From 11522253c729e4b6feaa543563043ee71812f46d Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Wed, 17 Apr 2024 16:05:45 -0500 Subject: [PATCH 61/72] Removed setDisabled function --- src/components/dataTable/DataTable.js | 15 +++++---------- src/constants.js | 2 +- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/components/dataTable/DataTable.js b/src/components/dataTable/DataTable.js index 25cec3045..c87843a42 100644 --- a/src/components/dataTable/DataTable.js +++ b/src/components/dataTable/DataTable.js @@ -25,7 +25,7 @@ import HorizontalScroll from '../horizontalScroll'; import { buildTableQueryString } from '../../lib/utils'; import LoadingSpinner from '../loadingSpinner'; import DropdownNoDataFilter from './DropdownNoDataFilter'; -import {ROW_THRESHOLD} from '../../constants'; +import {DATA_TABLE_MAX_ROWS} from '../../constants'; import { Link } from 'react-router-dom'; const DataTable = ({ @@ -63,13 +63,6 @@ const DataTable = ({ return filters; }; - let disabled = false; - - const setDisabled = (value) => { - disabled = value; - return true; - }; - const scrollIntoView = () => { containerRef.current.scrollIntoView({ behavior: 'smooth', @@ -129,6 +122,8 @@ const DataTable = ({ onSizePerPageChange: scrollIntoView }); + let disabled = paginationObj.options?.totalSize > DATA_TABLE_MAX_ROWS; + columns.forEach(column => { const filterField = column.filterName || column.dataField; const columnFilter = filters && @@ -231,7 +226,7 @@ const DataTable = ({ } { - downloadUrl && (paginationObj.options?.totalSize < ROW_THRESHOLD ? setDisabled(false) : setDisabled(true)) && + downloadUrl && The table above cannot be downloaded because there are too many rows in the unfiltered table. - Please apply filter(s) to limit the number of rows to less than {ROW_THRESHOLD} to enable the Download button or visit our + Please apply filter(s) to limit the number of rows to less than {DATA_TABLE_MAX_ROWS} to enable the Download button or visit our Downloads page to download the entire disease annotation set. diff --git a/src/constants.js b/src/constants.js index f88a29ee0..00b6799cf 100644 --- a/src/constants.js +++ b/src/constants.js @@ -431,4 +431,4 @@ export const GA_EVENT_ACTION = { SET_PAGE_SIZE: 'Set page size' }; -export const ROW_THRESHOLD = 90000; +export const DATA_TABLE_MAX_ROWS = 90000; From 803c50fe46937af8eaf316bf863c0f635b99817f Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Thu, 18 Apr 2024 09:24:36 -0500 Subject: [PATCH 62/72] Changed the constant name to DOWNLOAD_BUTTON_THRESHOLD --- src/components/dataTable/DataTable.js | 8 ++++---- src/constants.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/dataTable/DataTable.js b/src/components/dataTable/DataTable.js index c87843a42..83579f99b 100644 --- a/src/components/dataTable/DataTable.js +++ b/src/components/dataTable/DataTable.js @@ -25,7 +25,7 @@ import HorizontalScroll from '../horizontalScroll'; import { buildTableQueryString } from '../../lib/utils'; import LoadingSpinner from '../loadingSpinner'; import DropdownNoDataFilter from './DropdownNoDataFilter'; -import {DATA_TABLE_MAX_ROWS} from '../../constants'; +import {DOWNLOAD_BUTTON_THRESHOLD} from '../../constants'; import { Link } from 'react-router-dom'; const DataTable = ({ @@ -122,7 +122,7 @@ const DataTable = ({ onSizePerPageChange: scrollIntoView }); - let disabled = paginationObj.options?.totalSize > DATA_TABLE_MAX_ROWS; + let disabled = paginationObj.options?.totalSize > DOWNLOAD_BUTTON_THRESHOLD; columns.forEach(column => { const filterField = column.filterName || column.dataField; @@ -236,9 +236,9 @@ const DataTable = ({ disabled &&
The table above cannot be downloaded because there are too many rows in the unfiltered table. - Please apply filter(s) to limit the number of rows to less than {DATA_TABLE_MAX_ROWS} to enable the Download button or visit our + Please apply filter(s) to limit the number of rows to less than {DOWNLOAD_BUTTON_THRESHOLD} to enable the Download button or visit our Downloads page - to download the entire disease annotation set. + to download the entire data set.
} diff --git a/src/constants.js b/src/constants.js index 00b6799cf..3e3e673e8 100644 --- a/src/constants.js +++ b/src/constants.js @@ -431,4 +431,4 @@ export const GA_EVENT_ACTION = { SET_PAGE_SIZE: 'Set page size' }; -export const DATA_TABLE_MAX_ROWS = 90000; +export const DOWNLOAD_BUTTON_THRESHOLD = 90000; From ade3c70bbb8b4fcacddd094b2654ab8932894b8b Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Thu, 18 Apr 2024 14:22:22 -0500 Subject: [PATCH 63/72] Change to fix allele page disease associations table to not display Additional implicated genes and Strain Background --- src/components/dataTable/AnnotatedEntitiesPopupCuration.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/dataTable/AnnotatedEntitiesPopupCuration.js b/src/components/dataTable/AnnotatedEntitiesPopupCuration.js index cc32513cc..5da3e023f 100644 --- a/src/components/dataTable/AnnotatedEntitiesPopupCuration.js +++ b/src/components/dataTable/AnnotatedEntitiesPopupCuration.js @@ -70,11 +70,11 @@ function AnnotatedEntitiesPopupCuration({ children, entities, parentPage, mainRo Name Type Association - { parentPage === 'gene' || 'disease' ? Additional implicated genes : <> } + { parentPage === 'gene' || parentPage === 'disease' ? Additional implicated genes : <> } Experimental condition Genetic Modifiers - { parentPage === 'gene' || 'disease' ? Strain Background : <> } + { parentPage === 'gene' || parentPage === 'disease' ? Strain Background : <> } Genetic Sex Notes Annotation type From 48fcaccebc75b2c4e362190f23c4e2a11944771e Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Fri, 19 Apr 2024 10:47:15 -0500 Subject: [PATCH 64/72] Change to display the additional implicated genes in annotation pop details --- src/components/dataTable/AssertedGenes.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/dataTable/AssertedGenes.js b/src/components/dataTable/AssertedGenes.js index 4d210cdc6..d403449ee 100644 --- a/src/components/dataTable/AssertedGenes.js +++ b/src/components/dataTable/AssertedGenes.js @@ -1,5 +1,6 @@ import CollapsibleList from '../collapsibleList/collapsibleList'; import { Link } from 'react-router-dom'; +import { getIdentifier } from './utils'; function makeAssertedGeneLink(curie, geneSymbol) { @@ -11,11 +12,11 @@ function makeAssertedGeneLink(curie, geneSymbol) { } function AssertedGenes({assertedGenes, mainRowCurie}) { - const filteredAssertedGenes = assertedGenes?.filter(gene => gene.curie !== mainRowCurie); + const filteredAssertedGenes = assertedGenes?.filter(gene => getIdentifier(gene) !== mainRowCurie); if(assertedGenes && assertedGenes.length > 1) { return ( - {filteredAssertedGenes.map(gene => makeAssertedGeneLink(gene.curie, gene.geneSymbol.displayText))} + {filteredAssertedGenes.map(gene => makeAssertedGeneLink(getIdentifier(gene), gene.geneSymbol.displayText))} ); } From 690445af169c0eddff8c219407f34a3c00bd46b4 Mon Sep 17 00:00:00 2001 From: Scott Cain Date: Fri, 19 Apr 2024 09:27:50 -0700 Subject: [PATCH 65/72] adding proxy entries for JB2 for test and production --- cdk/amplify-production-stack.ts | 9 ++++++++- cdk/amplify-test-stack.ts | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/cdk/amplify-production-stack.ts b/cdk/amplify-production-stack.ts index cc1487575..88fd3b705 100644 --- a/cdk/amplify-production-stack.ts +++ b/cdk/amplify-production-stack.ts @@ -21,7 +21,14 @@ export class AmplifyProductionStack extends cdk.Stack { { source: 'https://alliancegenome.org', target: 'https://www.alliancegenome.org', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, { source: '/api/<*>', target: 'https://prod-alb.alliancegenome.org/api/<*>', status: amplify.RedirectStatus.REWRITE }, - + + { source: '/jbrowse2', target: 'https://www.alliancegenome.org/jbrowse2/', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, + { source: '/jbrowse2/', target: 'https://main.dgaayxgqoarxf.amplifyapp.com/', status: amplify.RedirectStatus.REWRITE }, + { source: '/jbrowse2/<*>', target: 'https://main.dgaayxgqoarxf.amplifyapp.com/<*>', status: amplify.RedirectStatus.REWRITE }, + { source: '/jbrowsedata/XenBaseXTJBrowse/<*>', target: 'https://jbrowse.xenbase.org/XenJBrowse/data/xt9_1/<*>', status: amplify.RedirectStatus.REWRITE }, + { source: '/jbrowsedata/XenBaseXLJBrowse/<*>', target: 'https://jbrowse.xenbase.org/XenJBrowse/data/xl9_2/<*>', status: amplify.RedirectStatus.REWRITE }, + { source: '/jbrowsedata/XenBaseData/<*>', target: 'https://jbrowse.xenbase.org/XenJBrowse/<*>', status: amplify.RedirectStatus.REWRITE }, + { source: '/jbrowsedata/RGDJBrowse/<*>', target: 'https://rgd.mcw.edu/jbrowse2/<*>', status: amplify.RedirectStatus.REWRITE }, { source: '/jbrowse/worms/protein', target: 'https://www.alliancegenome.org/jbrowse/worms/protein/', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, { source: '/jbrowse/worms/protein/', target: 'https://main.djgvd7iswt7yy.amplifyapp.com/', status: amplify.RedirectStatus.REWRITE }, { source: '/jbrowse/worms/protein/<*>', target: 'https://main.djgvd7iswt7yy.amplifyapp.com/<*>', status: amplify.RedirectStatus.REWRITE }, diff --git a/cdk/amplify-test-stack.ts b/cdk/amplify-test-stack.ts index 28675c139..7b02d2f41 100644 --- a/cdk/amplify-test-stack.ts +++ b/cdk/amplify-test-stack.ts @@ -18,6 +18,13 @@ export class AmplifyTestStack extends cdk.Stack { const test_paths = [ { source: '/api/<*>', target: 'https://test-alb.alliancegenome.org/api/<*>', status: amplify.RedirectStatus.REWRITE }, + { source: '/jbrowse2', target: 'https://test.alliancegenome.org/jbrowse2/', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, + { source: '/jbrowse2/', target: 'https://stage.dgaayxgqoarxf.amplifyapp.com/', status: amplify.RedirectStatus.REWRITE }, + { source: '/jbrowse2/<*>', target: 'https://stage.dgaayxgqoarxf.amplifyapp.com/<*>', status: amplify.RedirectStatus.REWRITE }, + { source: '/jbrowsedata/XenBaseXTJBrowse/<*>', target: 'https://jbrowse.xenbase.org/XenJBrowse/data/xt9_1/<*>', status: amplify.RedirectStatus.REWRITE }, + { source: '/jbrowsedata/XenBaseXLJBrowse/<*>', target: 'https://jbrowse.xenbase.org/XenJBrowse/data/xl9_2/<*>', status: amplify.RedirectStatus.REWRITE }, + { source: '/jbrowsedata/XenBaseData/<*>', target: 'https://jbrowse.xenbase.org/XenJBrowse/<*>', status: amplify.RedirectStatus.REWRITE }, + { source: '/jbrowsedata/RGDJBrowse/<*>', target: 'https://rgd.mcw.edu/jbrowse2/<*>', status: amplify.RedirectStatus.REWRITE }, { source: '/jbrowse/worms/protein', target: 'https://test.alliancegenome.org/jbrowse/worms/protein/', status: amplify.RedirectStatus.PERMANENT_REDIRECT }, { source: '/jbrowse/worms/protein/', target: 'https://main.djgvd7iswt7yy.amplifyapp.com/', status: amplify.RedirectStatus.REWRITE }, { source: '/jbrowse/worms/protein/<*>', target: 'https://main.djgvd7iswt7yy.amplifyapp.com/<*>', status: amplify.RedirectStatus.REWRITE }, From 4f99f6f008c4fbc1ca7523146da03a2308f24d79 Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Fri, 19 Apr 2024 12:06:44 -0500 Subject: [PATCH 66/72] Change in annotation details pop --- src/components/dataTable/AnnotatedEntitiesPopupCuration.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/dataTable/AnnotatedEntitiesPopupCuration.js b/src/components/dataTable/AnnotatedEntitiesPopupCuration.js index 5da3e023f..3558ccf9c 100644 --- a/src/components/dataTable/AnnotatedEntitiesPopupCuration.js +++ b/src/components/dataTable/AnnotatedEntitiesPopupCuration.js @@ -92,11 +92,11 @@ function AnnotatedEntitiesPopupCuration({ children, entities, parentPage, mainRo {renderLink(entity)} - { parentPage === 'gene' || 'disease' ? : <>} + { parentPage === 'gene' || parentPage === 'disease' ? : <>} - { parentPage === 'gene' || 'disease' ? : <> } + { parentPage === 'gene' || parentPage === 'disease' ? : <> } From 66d03f7aff421028deeffecc6d9cb760ce36146e Mon Sep 17 00:00:00 2001 From: Olin Blodgett Date: Fri, 26 Apr 2024 08:46:29 -0400 Subject: [PATCH 67/72] Update release to the snapshot date --- src/containers/layout/ReleaseBanner.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/containers/layout/ReleaseBanner.js b/src/containers/layout/ReleaseBanner.js index dd0202306..d429578b7 100644 --- a/src/containers/layout/ReleaseBanner.js +++ b/src/containers/layout/ReleaseBanner.js @@ -10,13 +10,13 @@ const ReleaseBanner = () => { isError, } = useRelease(); - const { releaseVersion, releaseDate } = releaseInfo || {}; + const { releaseVersion, releaseDate, snapShotDate } = releaseInfo || {}; return isLoading ? : ( Version: {isError ? 'Unknown' : releaseVersion}
- Date: { isError ? 'Unknown' : new Date(releaseDate).toDateString()} + Date: { isError ? 'Unknown' : new Date(snapShotDate).toDateString()}
); }; From b0e24ecbfb930e5f77253c858e090c4bf63c02f7 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Fri, 26 Apr 2024 11:18:37 -0500 Subject: [PATCH 68/72] SCRUM-3985 update basedOn and GeneticModifiersCellCuration identifiers --- .../dataTable/GeneticModifiersCellCuration.js | 8 +++++--- .../dataTable/basedOnGeneCellCuration.js | 19 ++++++++++--------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/components/dataTable/GeneticModifiersCellCuration.js b/src/components/dataTable/GeneticModifiersCellCuration.js index fc969aa93..80923132b 100644 --- a/src/components/dataTable/GeneticModifiersCellCuration.js +++ b/src/components/dataTable/GeneticModifiersCellCuration.js @@ -3,14 +3,16 @@ import { CollapsibleList } from '../collapsibleList'; import ExternalLink from '../ExternalLink'; import { getResourceUrl } from './getResourceUrl'; import { Link } from 'react-router-dom'; +import { getIdentifier } from './utils'; function GeneticModifierLink(modifier) { + const identifier = getIdentifier(modifier); switch(modifier?.type) { case 'Gene': if (modifier.geneSymbol) { return ( - + ); } @@ -18,13 +20,13 @@ function GeneticModifierLink(modifier) { case 'Allele': if (modifier.alleleSymbol) { return ( - + ); } break; case 'AffectedGenomicModel': - let url = getResourceUrl(modifier.curie, modifier.type, modifier.subtype); + let url = getResourceUrl(identifier, modifier.type, modifier.subtype); if (url && modifier.name) { return ( diff --git a/src/components/dataTable/basedOnGeneCellCuration.js b/src/components/dataTable/basedOnGeneCellCuration.js index 7b5314997..96b33ff04 100644 --- a/src/components/dataTable/basedOnGeneCellCuration.js +++ b/src/components/dataTable/basedOnGeneCellCuration.js @@ -1,21 +1,22 @@ import { Link } from 'react-router-dom'; import { shortSpeciesName } from '../../lib/utils'; import { CollapsibleList } from '../../components/collapsibleList'; -import { removeDuplicates } from './utils'; +import { getIdentifier, removeDuplicates } from './utils'; import GeneSymbolCuration from '../GeneSymbolCuration'; +const GeneLink = ({ gene }) => { + const identifier = getIdentifier(gene); + return ( + + ({shortSpeciesName(gene.taxon.curie)}) + ); +}; const BasedOnGeneCellCuration = (genes) => { - if (!genes) { - return null; - } + if (!genes) return null; const uniqueGenes = removeDuplicates(genes, (gene) => gene.geneSymbol.displayText); return ( - {uniqueGenes.map(gene => ( - - ({shortSpeciesName(gene.taxon.curie)}) - - ))} + {uniqueGenes.map(gene => )} ); }; From f5966ebaf2f8a1196020d4adf910a2f281faf4c4 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Fri, 26 Apr 2024 11:24:53 -0500 Subject: [PATCH 69/72] remove unused release data variable --- src/containers/layout/ReleaseBanner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/containers/layout/ReleaseBanner.js b/src/containers/layout/ReleaseBanner.js index d429578b7..786ec36ec 100644 --- a/src/containers/layout/ReleaseBanner.js +++ b/src/containers/layout/ReleaseBanner.js @@ -10,7 +10,7 @@ const ReleaseBanner = () => { isError, } = useRelease(); - const { releaseVersion, releaseDate, snapShotDate } = releaseInfo || {}; + const { releaseVersion, snapShotDate } = releaseInfo || {}; return isLoading ? : ( From fbd317cbe79526b57d5b87b3d6473d69fb0c938c Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Mon, 29 Apr 2024 10:14:03 -0500 Subject: [PATCH 70/72] SCRUM-3986 update StrainBackground identifier --- src/components/dataTable/StrainBackground.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/components/dataTable/StrainBackground.js b/src/components/dataTable/StrainBackground.js index f090b10cd..9854832b7 100644 --- a/src/components/dataTable/StrainBackground.js +++ b/src/components/dataTable/StrainBackground.js @@ -1,13 +1,16 @@ import ExternalLink from '../ExternalLink'; +import { getIdentifier } from './utils'; function StrainBackground({strainBackground}) { - if(strainBackground?.curie && strainBackground?.name) { - const strainName = ; - const strain = strainBackground.curie.slice('SGD:'.length); - return {strainName}; - } - return <>; + const indentifier = getIdentifier(strainBackground); + + if(!indentifier || !strainBackground?.name) return null; + + const strainName = ; + const strain = indentifier.slice('SGD:'.length); + + return {strainName}; } export default StrainBackground; From 96047c44f8f02283ae6f2784c7fddb659ecb6b6b Mon Sep 17 00:00:00 2001 From: Olin Blodgett Date: Wed, 1 May 2024 12:18:07 -0400 Subject: [PATCH 71/72] Updated test API server --- cdk/cdk-app.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cdk/cdk-app.ts b/cdk/cdk-app.ts index ecc6b5326..cb97223dd 100644 --- a/cdk/cdk-app.ts +++ b/cdk/cdk-app.ts @@ -20,7 +20,7 @@ new AmplifyALBStack(app, 'stage-alb-stack', { new AmplifyALBStack(app, 'test-alb-stack', { stackName: 'test-alb-stack', dnsName: 'test', - targetInstanceId: 'i-003fafec7d050fd97', + targetInstanceId: 'i-0ccfdcd8c43104be5', env: { region: process.env.CDK_DEFAULT_REGION, account: process.env.CDK_DEFAULT_ACCOUNT, From bee3bcb3e97be71f75d3f92be7fea04844cf08a2 Mon Sep 17 00:00:00 2001 From: Olin Blodgett Date: Wed, 1 May 2024 12:22:27 -0400 Subject: [PATCH 72/72] Updated test API server --- cdk/cdk-app.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cdk/cdk-app.ts b/cdk/cdk-app.ts index cb97223dd..75d33045f 100644 --- a/cdk/cdk-app.ts +++ b/cdk/cdk-app.ts @@ -30,7 +30,7 @@ new AmplifyALBStack(app, 'test-alb-stack', { new AmplifyALBStack(app, 'prod-alb-stack', { stackName: 'prod-alb-stack', dnsName: 'prod', - targetInstanceId: 'i-003fafec7d050fd97', + targetInstanceId: 'i-0ccfdcd8c43104be5', env: { region: process.env.CDK_DEFAULT_REGION, account: process.env.CDK_DEFAULT_ACCOUNT,