Skip to content

Commit

Permalink
Merge pull request #1453 from IgorRodchenkov/development
Browse files Browse the repository at this point in the history
Preparing this app-ui for new PC v14 and Validator backend
  • Loading branch information
IgorRodchenkov authored May 26, 2024
2 parents d913455 + 50523ae commit 0749d27
Show file tree
Hide file tree
Showing 33 changed files with 3,924 additions and 3,939 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ src/scripts/jsonld/*
src/*.gmt
downloads/*
public/img/pathways/*
!/**/.gitkeep
!/**/.gitkeep
debug.log
Empty file added entrypoint.sh
Empty file.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "app-ui",
"version": "3.8.0",
"version": "4.0.0",
"description": "App UI",
"repository": {
"type": "git",
Expand Down
20 changes: 10 additions & 10 deletions src/client/common/external-service-data.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
const { IDENTIFIERS_URL } = require('../../config');

let externalServiceData = [
{database:'Reactome', url:'http://identifiers.org/reactome/', search:''},
{database:'UniProt', url:'http://identifiers.org/uniprot/', search:''},
{database:'HGNC Symbol', url:'http://identifiers.org/hgnc.symbol/', search:''},
{database:'HGNC', url:'http://identifiers.org/hgnc/', search:''},
{database:'ChEBI', url:'http://identifiers.org/chebi/', search:''},
{database:'PubMed', url:'http://identifiers.org/pubmed/', search:''},
{database:'Ensembl', url:'http://identifiers.org/ensembl/', search:''},
{database:'NCBI Gene',url:'http://identifiers.org/ncbigene/',search:''},
{database:'Gene Cards',url:'http://identifiers.org/genecards/',search:''}
{database:'Reactome', url:'http://bioregistry.io/reactome:', search:''},
{database:'UniProt', url:'http://bioregistry.io/uniprot:', search:''},
{database:'HGNC Symbol', url:'http://bioregistry.io/hgnc.symbol:', search:''},
{database:'HGNC', url:'http://bioregistry.io/hgnc:', search:''},
{database:'ChEBI', url:'http://bioregistry.io/chebi:', search:''},
{database:'PubMed', url:'http://bioregistry.io/pubmed:', search:''},
{database:'Ensembl', url:'http://bioregistry.io/ensembl:', search:''},
{database:'NCBI Gene',url:'http://bioregistry.io/ncbigene:',search:''},
{database:'Gene Cards',url:'http://bioregistry.io/genecards:',search:''}
];

let generateIdentifiersUrl = ( db, id ) => `${IDENTIFIERS_URL}/${db}/${id}`;
let generateIdentifiersUrl = ( db, id ) => `${IDENTIFIERS_URL}/${db}:${id}`;

module.exports = {
externalServiceData,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class InteractionsEdgeTooltip extends React.Component {
let publicationList = publications.map( publication => {
let { id, title, firstAuthor, date, source } = publication;
return h('div.cy-overflow-content', [
h('a.plain-link', { href: 'http://identifiers.org/pubmed/' + id, target: '_blank' }, title),
h('a.plain-link', { href: 'http://bioregistry.io/pubmed:' + id, target: '_blank' }, title),
h('div', firstAuthor + ' et al. | ' + source + ' - ' + new Date(date).getFullYear().toString())
]);
});
Expand Down
44 changes: 22 additions & 22 deletions src/client/features/paint/demo-pathway-results.json
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@
"ensembl": [
"ENST00000244741"
],
"hgnc symbol": [
"hgnc.symbol": [
"CDKN1A"
],
"reactome": [
Expand Down Expand Up @@ -368,7 +368,7 @@
"ensembl": [
"ENST00000244741"
],
"hgnc symbol": [
"hgnc.symbol": [
"CDKN1A"
],
"reactome": [
Expand Down Expand Up @@ -418,13 +418,13 @@
"REPLACED http://www.reactome.org/biopax/64/48887#Protein10458"
],
"databaseIds": {
"hgnc symbol": [
"hgnc.symbol": [
"PCBP4"
],
"reactome": [
"R-HSA-6803382"
],
"uniprot knowledgebase": [
"uniprot": [
"P57723"
]
},
Expand Down Expand Up @@ -471,13 +471,13 @@
"REPLACED http://www.reactome.org/biopax/64/48887#Protein10458"
],
"databaseIds": {
"hgnc symbol": [
"hgnc.symbol": [
"PCBP4"
],
"reactome": [
"R-HSA-6803382"
],
"uniprot knowledgebase": [
"uniprot": [
"P57723"
]
},
Expand Down Expand Up @@ -648,13 +648,13 @@
"REPLACED http://www.reactome.org/biopax/64/48887#Protein10457"
],
"databaseIds": {
"hgnc symbol": [
"hgnc.symbol": [
"ZNF385A"
],
"reactome": [
"R-HSA-6803421"
],
"uniprot knowledgebase": [
"uniprot": [
"Q96PM9"
]
},
Expand Down Expand Up @@ -728,13 +728,13 @@
"Reactome DB_ID: 69683"
],
"databaseIds": {
"hgnc symbol": [
"hgnc.symbol": [
"TP53"
],
"reactome": [
"R-HSA-69683"
],
"uniprot knowledgebase": [
"uniprot": [
"P04637"
]
},
Expand Down Expand Up @@ -801,7 +801,7 @@
"ensembl": [
"ENSG00000124762"
],
"hgnc symbol": [
"hgnc.symbol": [
"CDKN1A"
],
"reactome": [
Expand Down Expand Up @@ -860,13 +860,13 @@
"REPLACED http://www.reactome.org/biopax/64/48887#Protein1393"
],
"databaseIds": {
"hgnc symbol": [
"hgnc.symbol": [
"CDKN1A"
],
"reactome": [
"R-HSA-182585"
],
"uniprot knowledgebase": [
"uniprot": [
"P38936"
]
},
Expand Down Expand Up @@ -954,13 +954,13 @@
"Reactome DB_ID: 69683"
],
"databaseIds": {
"hgnc symbol": [
"hgnc.symbol": [
"TP53"
],
"reactome": [
"R-HSA-69683"
],
"uniprot knowledgebase": [
"uniprot": [
"P04637"
]
},
Expand Down Expand Up @@ -1024,13 +1024,13 @@
"REPLACED http://www.reactome.org/biopax/64/48887#Protein10457"
],
"databaseIds": {
"hgnc symbol": [
"hgnc.symbol": [
"ZNF385A"
],
"reactome": [
"R-HSA-6803421"
],
"uniprot knowledgebase": [
"uniprot": [
"Q96PM9"
]
},
Expand Down Expand Up @@ -1104,13 +1104,13 @@
"Reactome DB_ID: 69683"
],
"databaseIds": {
"hgnc symbol": [
"hgnc.symbol": [
"TP53"
],
"reactome": [
"R-HSA-69683"
],
"uniprot knowledgebase": [
"uniprot": [
"P04637"
]
},
Expand Down Expand Up @@ -1177,7 +1177,7 @@
"ensembl": [
"ENSG00000124762"
],
"hgnc symbol": [
"hgnc.symbol": [
"CDKN1A"
],
"reactome": [
Expand Down Expand Up @@ -1236,13 +1236,13 @@
"REPLACED http://www.reactome.org/biopax/64/48887#Protein10457"
],
"databaseIds": {
"hgnc symbol": [
"hgnc.symbol": [
"ZNF385A"
],
"reactome": [
"R-HSA-6803421"
],
"uniprot knowledgebase": [
"uniprot": [
"Q96PM9"
]
},
Expand Down
2 changes: 1 addition & 1 deletion src/client/features/paint/pathway-node-metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class PathwayNodeMetadataView extends React.Component {
let publicationEles = publications.map(publication => {
let { id, title, firstAuthor, date, source } = publication;
return h('div.cy-overflow-content', [
h('a.plain-link', { href: 'http://identifiers.org/pubmed/' + id, target: '_blank' }, title),
h('a.plain-link', { href: 'https://bioregistry.io/pubmed:' + id, target: '_blank' }, title),
h('div', firstAuthor + ' et al. | ' + source + ' - ' + new Date(date).getFullYear().toString())
]);
});
Expand Down
2 changes: 1 addition & 1 deletion src/client/features/pathways/pathway-node-metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class PathwayNodeMetadataView extends React.Component {
let publicationEles = publications.map(publication => {
let { id, title, firstAuthor, date, source } = publication;
return h('div.cy-overflow-content', [
h('a.plain-link', { href: 'http://identifiers.org/pubmed/' + id, target: '_blank' }, title),
h('a.plain-link', { href: 'http://bioregistry.io/pubmed:' + id, target: '_blank' }, title),
h('div', firstAuthor + ' et al. | ' + source + ' - ' + new Date(date).getFullYear().toString())
]);
});
Expand Down
4 changes: 1 addition & 3 deletions src/client/features/search/pathway-results-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ class PathwayResultsView extends React.Component {
render(){
let { searchHits: pathwayResults, controller, query , dataSources, hasFeature } = this.props;
const curDatasource = query.datasource;
const sources = dataSources.filter( source => query.type === 'Pathway' ?
!source.notPathwayData && source.numPathways :
!source.notPathwayData && source.numInteractions );
const sources = dataSources.filter( source => query.type === 'Pathway' ? source.numPathways : source.numInteractions );
const noPathwaysMsg = h( ErrorMessage, { title: 'Your search didn\'t match any pathways', footer: 'Try different keywords or gene names.'} );

if( pathwayResults === null ){
Expand Down
21 changes: 0 additions & 21 deletions src/client/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,27 +79,6 @@ module.exports = () => {
return h(Features.Search, props);
}
}
// {
// path: '/interactions',
// render: props => {
// return h(Features.Interactions, props);
// }
// },
// {
// path: '/enrichment',
// render: props => {
// return h(Features.Enrichment, props);
// }
// },
// {
// path: '/edit',
// render: props => {
// const editProps = _.assign({}, props, {
// admin: true
// });
// return h(Features.Edit, editProps);
// }
// }
].map( spec => h(Route, _.assign({ exact: true }, spec)) ))
]);
};
4 changes: 2 additions & 2 deletions src/client/services/server-api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ const ServerAPI = {

search(query){
const queryClone=_.assign({},query);
if (/^((uniprot|hgnc):\w+|ncbi:[0-9]+)$/i.test(queryClone.q)) {
queryClone.q=queryClone.q.replace(/^(uniprot|ncbi|hgnc):/i,"");
if (/^((uniprot|hgnc|hgnc.symbol):\w+|ncbi:[0-9]+)$/i.test(queryClone.q)) {
queryClone.q=queryClone.q.replace(/^(uniprot|ncbi|hgnc|hgnc.symbol):/i,"");
}
return fetch(`/api/search`, {
method: 'POST',
Expand Down
3 changes: 1 addition & 2 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ let defaults = {
PORT: 3000,
METADATA_CRON_SCHEDULE: '0 0 * * Monday', // update file from gprofiler etc. (Monday at midnight)
PC_URL: 'https://www.pathwaycommons.org/',
XREF_SERVICE_URL: 'https://biopax.baderlab.org/',
DOWNLOADS_FOLDER_NAME: 'downloads',
GPROFILER_URL: "https://biit.cs.ut.ee/gprofiler/",
GMT_ARCHIVE_URL: 'https://biit.cs.ut.ee/gprofiler/static/gprofiler_hsapiens.name.zip',
IDENTIFIERS_URL: 'https://identifiers.org',
IDENTIFIERS_URL: 'http://bioregistry.io',
NCBI_EUTILS_BASE_URL: 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils',
NCBI_API_KEY: 'b99e10ebe0f90d815a7a99f18403aab08008', // for dev testing only (baderlabsysmonitor ncbi key)
HGNC_BASE_URL: 'https://rest.genenames.org',
Expand Down
1 change: 0 additions & 1 deletion src/models/pathway/pathway-model.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const _ = require('lodash');

// basic pathway model to serve the needs of the pathways view
// TODO:
// - api to get entities,
// - compose each entity with entity metadata
// - get entity by id
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ async function imagesFromGmtFile( fpath, store, get, parse, convert ) {
}
}

// ambiguous: e.g. value[1] = 'name: t(4;14) translocations of FGFR3; datasource: reactome; organism: 9606; idtype: hgnc symbol'
// ambiguous: e.g. value[1] = 'name: t(4;14) translocations of FGFR3; datasource: reactome; organism: 9606; idtype: hgnc.symbol'
const parsePCGmtLine = line => {
const extractFields = str => str.match(/^name:\s(?<name>.*);\sdatasource:\s(?<source>.*);\sorganism:\s(?<organism>.*);\sidtype:\s(?<idtype>.*)$/);
const parseMeta = value => {
Expand Down
2 changes: 1 addition & 1 deletion src/server/external-services/hgnc.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const fetchBySymbol = symbol => {

const fetchBySymbols = symbols => Promise.all( symbols.map(fetchBySymbol) );

const createUri = ( namespace, localId ) => IDENTIFIERS_URL + '/' + namespace + '/' + localId;
const createUri = ( namespace, localId ) => IDENTIFIERS_URL + '/' + namespace + ':' + localId;

const getEntitySummary = async symbols => {

Expand Down
2 changes: 1 addition & 1 deletion src/server/external-services/ncbi.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const fetchByGeneIds = ( geneIds ) => {
);
};

const createUri = ( namespace, localId ) => IDENTIFIERS_URL + '/' + namespace + '/' + localId;
const createUri = ( namespace, localId ) => IDENTIFIERS_URL + '/' + namespace + ':' + localId;

const rawMakeSummary = (ent) => {
const xrefLinks = [];
Expand Down
Loading

0 comments on commit 0749d27

Please sign in to comment.