diff --git a/src/client/common/config.js b/src/client/common/config.js
index 4eeaab337..064bf09cc 100644
--- a/src/client/common/config.js
+++ b/src/client/common/config.js
@@ -21,7 +21,6 @@ const databases = [
['3DMET', 'http://identifiers.org/3dmet/', ''],
['Chemical Component Dictionary', 'http://identifiers.org/pdb-ccd/', ''],
['CAS', 'http://identifiers.org/cas/', ''],
- ['Pathway Commons','/view?uri=http://pathwaycommons.org/pc2/',''],
['HPRD',' http://identifiers.org/hprd/',''],
['RefSeq',' http://identifiers.org/refseq/',''],
['NCBI Gene','http://identifiers.org/ncbigene/',''],
diff --git a/src/client/common/cy/tooltips/format-content.js b/src/client/common/cy/tooltips/format-content.js
index b73092614..04c3c22a0 100644
--- a/src/client/common/cy/tooltips/format-content.js
+++ b/src/client/common/cy/tooltips/format-content.js
@@ -2,6 +2,7 @@ const h = require('hyperscript');
const classNames = require('classnames');
const _ = require('lodash');
const config = require('../../config');
+const queryString = require('query-string');
//Handle standard name related metadata fields
const standardNameHandler = (pair) => makeTooltipItem(pair[1], 'Name: ');
@@ -41,17 +42,17 @@ const databaseHandler = (pair, expansionFunction) => {
};
//Handle interaction/Detailed views related fields
-const interactionHandlerTrim =(pair, expansionFunction) => {
+const interactionHandlerTrim =(pair, expansionFunction, title) => {
let maxViews=8;
const expansionLink = pair[1].length>maxViews? h('div.more-link', { onclick: () => expansionFunction(pair[0]) }, 'more »'):'';
if (pair[1].length < 1) { return h('div.error'); }
- return generateDetailedViewList(sortByDatabaseId(pair[1]), pair[1].length>maxViews, expansionLink,maxViews);
+ return generateDetailedViewList(sortByDatabaseId(pair[1]), pair[1].length>maxViews, expansionLink,maxViews,title);
};
-const interactionHandler =(pair, expansionFunction) => {
+const interactionHandler =(pair, expansionFunction, title) => {
let maxViews=8;
const expansionLink = pair[1].length>maxViews? h('div.more-link', { onclick: () => expansionFunction(pair[0]) }, '« less'):'';
if (pair[1].length < 1) { return h('div.error'); }
- return generateDetailedViewList(sortByDatabaseId(pair[1]),false, expansionLink,maxViews);
+ return generateDetailedViewList(sortByDatabaseId(pair[1]),false, expansionLink,maxViews,title);
};
//Handle publication related fields
@@ -103,7 +104,7 @@ const metaDataKeyMap = new Map()
* Sample Input : parseMetadata(['Standard Name', 'TP53'])
* Sample Output :
*/
-function parseMetadata(pair, trim = true, expansionFunction) {
+function parseMetadata(pair, trim = true, expansionFunction, title) {
const doNotRender = ['Data Source', 'Data SourceTrim', 'Display Name'];
let key = pair[0];
@@ -114,7 +115,7 @@ function parseMetadata(pair, trim = true, expansionFunction) {
let handler = metaDataKeyMap.get(key);
if (handler) {
- return handler(pair, expansionFunction);
+ return handler(pair, expansionFunction, title);
}
else if (!(trim) && !doNotRender.includes(key)) {
return defaultHandler(pair);
@@ -294,7 +295,7 @@ function generateIdList(dbIdObject, trim) {
* Sample Input : generateDBLink('Reactome', 'R-HSA-59544', true)
* Sample Output :
*/
-function generateDBLink(dbName, dbId, isDbVisible, otherName) {
+function generateDBLink(dbName, dbId, isDbVisible) {
//Get base url for dbid
let db = config.databases;
let className = '';
@@ -307,7 +308,7 @@ function generateDBLink(dbName, dbId, isDbVisible, otherName) {
if (isDbVisible) {
className = '-single-ref';
}
- let label = otherName ? otherName :(isDbVisible ? dbName :dbId);
+ let label = isDbVisible ? dbName :dbId;
//Build reference url
if (link.length === 1 && link[0][1]) {
@@ -430,17 +431,22 @@ function generateDatabaseList(sortedArray, trim, expansionLink) {
//Generate list
let renderValue = sortedArray.map(item => [generateIdList(item, trim)], this);
- return formatRenderValue(sortedArray,renderValue,expansionLink,trim,true,'Links');
+ return formatRenderValue(sortedArray, renderValue, expansionLink, trim, true, 'Links');
}
-function generateDetailedViewList(sortedArray, trim, expansionLink,maxViews) {
- let name = sortedArray[0].database;
+function generateDetailedViewList(sortedArray, trim, expansionLink, maxViews, title) {
let list = sortedArray[0].ids;
if(trim){list=list.slice(0,maxViews);}
//Generate list
- let renderValue = list.map((data,index) => [generateDBLink(name, data, true,'Interaction '+(index+1))],this);
-
- return formatRenderValue(sortedArray,renderValue,expansionLink,trim,false,'Detailed Views');
+ let renderValue = list.map((data,index) => [h('div.fake-spacer',
+ h('a.db-link' ,{
+ href:'/view?',
+ search: queryString.stringify({uri:'http://pathwaycommons.org/pc2/'+data, title:title, removeInfoMenu:true}),
+ target: '_blank',
+ }, 'Interaction '+(index+1))
+ )]);
+
+ return formatRenderValue(sortedArray, renderValue, expansionLink, trim, false, 'Detailed Views');
}
function formatRenderValue(sortedArray, renderValue, expansionLink, trim, list,name){
diff --git a/src/client/common/cy/tooltips/index.js b/src/client/common/cy/tooltips/index.js
index a499cc6c1..9acf90039 100644
--- a/src/client/common/cy/tooltips/index.js
+++ b/src/client/common/cy/tooltips/index.js
@@ -84,7 +84,7 @@ class MetadataTip {
if (!(this.data)) { this.data = []; }
return h('div.tooltip-image', [
h('div.tooltip-heading', this.name),
- h('div.tooltip-internal', h('div', (data).map(item => formatContent.parseMetadata(item, true, expandFunction)), this))
+ h('div.tooltip-internal', h('div', (data).map(item => formatContent.parseMetadata(item, true, expandFunction, this.name)), this))
]);
}
@@ -111,7 +111,7 @@ class MetadataTip {
if (!(this.data)) { this.data = []; }
return h('div.tooltip-image', [
h('div.tooltip-heading', this.name),
- h('div.tooltip-internal', h('div', (data).map(item => formatContent.parseMetadata(item, !this.isExpanded(item[0]), getExpansionFunction(item)), this)))
+ h('div.tooltip-internal', h('div', (data).map(item => formatContent.parseMetadata(item, !this.isExpanded(item[0]), getExpansionFunction(item), this.name), this)))
]
);
}
diff --git a/src/client/features/interactions/filter-menu.js b/src/client/features/interactions/filter-menu.js
index a01d1e36d..6e4a419bc 100644
--- a/src/client/features/interactions/filter-menu.js
+++ b/src/client/features/interactions/filter-menu.js
@@ -15,7 +15,7 @@ class InteractionsFilterMenu extends React.Component {
[
h('div',{className:classNames(type,'interaction-filter-legend')}),
h('h3.button-label',type),
- h('i', {className: classNames('common-icon-button','material-icons',{ 'common-icon-button-active': !clicked})}, clicked ? 'close':'check')
+ h('i', {className: classNames('common-icon-button','material-icons','icon-cutoff',{ 'common-icon-button-active': !clicked})}, clicked ? 'close':'check')
]
));
return h('div',[
diff --git a/src/client/features/search/index.js b/src/client/features/search/index.js
index 206215e92..adb6e5e7a 100644
--- a/src/client/features/search/index.js
+++ b/src/client/features/search/index.js
@@ -67,7 +67,6 @@ class Search extends React.Component {
genes: state.query.q.trim(),
target: 'UNIPROT',
};
-
this.setState({
landingLoading: true
});
diff --git a/src/client/features/view/index.js b/src/client/features/view/index.js
index 3dd242aa8..20bbebaae 100644
--- a/src/client/features/view/index.js
+++ b/src/client/features/view/index.js
@@ -32,15 +32,20 @@ class View extends React.Component {
ServerAPI.getGraphAndLayout(query.uri, 'latest').then(networkJSON => {
const layoutConfig = getLayoutConfig(networkJSON.layout);
- const componentConfig = _.merge({}, BaseNetworkView.config, { useSearchBar: true});
+ if(query.removeInfoMenu){
+ BaseNetworkView.config.toolbarButtons.splice(
+ _.findIndex(BaseNetworkView.config.toolbarButtons, entry=>entry.id==='showInfo'),1
+ );
+ }
+ const componentConfig = _.merge({},BaseNetworkView.config, { useSearchBar: true});
this.setState({
componentConfig: componentConfig,
layoutConfig: layoutConfig,
networkJSON: networkJSON.graph,
networkMetadata: {
uri: query.uri,
- name: _.get(networkJSON, 'graph.pathwayMetadata.title.0', 'Unknown Network'),
+ name: query.title || _.get(networkJSON, 'graph.pathwayMetadata.title.0', 'Unknown Network'),
datasource: _.get(networkJSON, 'graph.pathwayMetadata.dataSource.0', 'Unknown Data Source'),
comments: networkJSON.graph.pathwayMetadata.comments,
organism: networkJSON.graph.pathwayMetadata.organism
diff --git a/src/client/services/server-api/index.js b/src/client/services/server-api/index.js
index dea7fb4c9..efd4e0271 100644
--- a/src/client/services/server-api/index.js
+++ b/src/client/services/server-api/index.js
@@ -32,10 +32,6 @@ const ServerAPI = {
return fetch(`/api/gene-query?${qs.stringify(query)}`, defaultFetchOpts).then(res => res.json());
},
- findUniprotId(query){
- return fetch(`/pc-client/uniprotIdSearch?${qs.stringify(query)}`, defaultFetchOpts).then(res => res.json());
- },
-
getProteinInformation(uniprotId){
return fetch(`https://www.ebi.ac.uk/proteins/api/proteins?offset=0&accession=${uniprotId}`,defaultFetchOpts).then(res => res.json());
},
diff --git a/src/server/enrichment-map/emap/generateGraphInfo.js b/src/server/enrichment-map/emap/generateGraphInfo.js
index ddf6f97ca..ce676d1dd 100644
--- a/src/server/enrichment-map/emap/generateGraphInfo.js
+++ b/src/server/enrichment-map/emap/generateGraphInfo.js
@@ -20,7 +20,30 @@ const _ = require('lodash');
// input ["GO:1902275", "GO:2001252", "GO:1905269", "GO:0051053"]
// returns a cytoscape object
-const generateGraphInfo = (pathwayIdList) => {
+const generateGraphInfo = (pathwayIdList, cutoff = 0.375, JCWeight, OCWeight) => {
+ if (cutoff < 0 || cutoff > 1) { throw new Error('ERROR: cutoff out of range [0, 1]');}
+ if (isNaN(Number(cutoff))) { throw new Error('ERROR: cutoff is not a number'); }
+
+ if (JCWeight < 0 || JCWeight > 1) {
+ throw new Error('ERROR: JCWeight out of range [0, 1]');
+ }
+ if (OCWeight < 0 || OCWeight > 1) {
+ throw new Error('ERROR: OCWeight out of range [0, 1]');
+ }
+ if (JCWeight != undefined && isNaN(Number(JCWeight))) {throw new Error('ERROR: JCWeight should be a number');}
+ if (OCWeight != undefined && isNaN(Number(OCWeight))) {throw new Error('ERROR: OCWeight should be a number');}
+ if (OCWeight != undefined && JCWeight != undefined && Number(OCWeight) + Number(JCWeight) != 1) {
+ throw new Error('ERROR: OCWeight + JCWeight should be 1');
+ }
+ if (JCWeight === undefined && OCWeight === undefined) {
+ JCWeight = 0.5;
+ OCWeight = 0.5;
+ } else if (JCWeight === undefined) {
+ JCWeight = 1 - OCWeight;
+ } else if (OCWeight === undefined) {
+ OCWeight = 1 - JCWeight;
+ }
+
// check unrecognized and duplicates, modify pathwayIdList
const unrecognized = [];
for (let i = 0; i < pathwayIdList.length; ++i) {
@@ -48,7 +71,7 @@ const generateGraphInfo = (pathwayIdList) => {
_.forEach(nodeInfo, node => {
elements.push({ data: { id: node.pathwayId } });
});
- const edgeInfo = generateEdgeInfo(pathwayIdList);
+ const edgeInfo = generateEdgeInfo(pathwayIdList, JCWeight, cutoff);
_.forEach(edgeInfo, edge => {
const sourceIndex = 0;
const targetIndex = 1;
@@ -71,8 +94,3 @@ const generateGraphInfo = (pathwayIdList) => {
module.exports = { generateGraphInfo };
-
-//simple testing
-//console.log(generateGraphInfo(["GO:1902275", "GO:2001252", "GO:1905269"]));
-// const result = generateGraphInfo(["GO:1902275", "GO:2001252", "GO:1905269"]);
-// console.log(JSON.stringify(result));
\ No newline at end of file
diff --git a/src/server/enrichment-map/emap/generateInfo.js b/src/server/enrichment-map/emap/generateInfo.js
index ba1de4626..2bce59c48 100644
--- a/src/server/enrichment-map/emap/generateInfo.js
+++ b/src/server/enrichment-map/emap/generateInfo.js
@@ -20,8 +20,8 @@ const fetchPathwayInfo = (pathwayList) => {
// {edgeId: "GO:1902275_GO:0051053", intersection: [gene1], similarity: 0.1},
// {edgeId: "GO:2001252_GO:0051053", intersection: [gene1], similarity: 0.1}]
// cutoff = 0.375 unless specified
-const generateEdgeInfo = (pathwayIdList, cutoff = 0.375) => {
- return filterEdges(pathwayListGraph(fetchPathwayInfo(pathwayIdList)), cutoff);
+const generateEdgeInfo = (pathwayIdList, JCWeight, cutoff = 0.375) => {
+ return filterEdges(pathwayListGraph(fetchPathwayInfo(pathwayIdList), JCWeight), cutoff);
};
diff --git a/src/server/enrichment-map/emap/intersect.js b/src/server/enrichment-map/emap/intersect.js
index 1737d8480..96c3e563a 100644
--- a/src/server/enrichment-map/emap/intersect.js
+++ b/src/server/enrichment-map/emap/intersect.js
@@ -8,7 +8,7 @@ const _ = require('lodash');
// JC/OC calculation
// output: JSON object
// {edgeId: pathwayxyz_pathwayabc, intersection: [gene1, gene3], similarity: 0.6}
-const pathwayPairGraph = (pathway1, pathway2) => {
+const pathwayPairGraph = (pathway1, pathway2, JCWeight) => {
let intersectionCount = 0;
const intersection = [];
_.forEach(pathway1.genes, gene => {
@@ -18,7 +18,7 @@ const pathwayPairGraph = (pathway1, pathway2) => {
}
});
// JC/OC calculation
- const similarity = 0.5*(intersectionCount/(pathway1.genes.length+pathway2.genes.length-intersectionCount))+0.5*(intersectionCount/Math.min(pathway1.genes.length, pathway2.genes.length));
+ const similarity = JCWeight*(intersectionCount/(pathway1.genes.length+pathway2.genes.length-intersectionCount))+(1-JCWeight)*(intersectionCount/Math.min(pathway1.genes.length, pathway2.genes.length));
return {edgeId: pathway1.pathwayId+'_'+pathway2.pathwayId, intersection: intersection, similarity: similarity};
};
@@ -35,11 +35,11 @@ const pathwayPairGraph = (pathway1, pathway2) => {
// {edgeId: "pathway2_pathway3", intersection: [], similarity: 0.1},
// {edgeId: "pathway2_pathway4", intersection: [], similarity: 0.1},
// {edgeId: "pathway3_pathway4", intersection: [gene1], similarity: 0.1}]
-const pathwayListGraph = (pathwayList) => {
+const pathwayListGraph = (pathwayList, JCWeight) => {
const ret = [];
for (let i = 0; i < pathwayList.length; ++i) {
for (let j = i + 1; j < pathwayList.length; ++j) {
- ret.push(pathwayPairGraph(pathwayList[i], pathwayList[j]));
+ ret.push(pathwayPairGraph(pathwayList[i], pathwayList[j], JCWeight));
}
}
return ret;
diff --git a/src/server/enrichment-map/enrichment/enrichment.js b/src/server/enrichment-map/enrichment/enrichment.js
index d91df05b1..26a4c6dfc 100644
--- a/src/server/enrichment-map/enrichment/enrichment.js
+++ b/src/server/enrichment-map/enrichment/enrichment.js
@@ -40,7 +40,6 @@ const defaultSetting = {
"threshold_algo": "fdr",
"domain_size_type": "annotated",
"custbg": [],
- "custbg_cb": 0,
"sf_GO:BP": 1,
"sf_REAC": 1,
};
@@ -55,24 +54,26 @@ const enrichment = (query, userSetting) => {
const minSetSizeVal = Number(formData.min_set_size);
const maxSetSizeVal = Number(formData.max_set_size);
const thresholdAlgoVal = formData.threshold_algo;
- const custbgCbVal = Number(formData.custbg_cb);
if (orderedQueryVal != 0 && orderedQueryVal != 1) {
- throw new Error('ERROR: orderedQuery should be 1 or 0');
+ reject(new Error('ERROR: orderedQuery should be 1 or 0'));
}
if (isNaN(userThrVal) || userThrVal > 1 || userThrVal < 0) {
- throw new Error('ERROR: userThrVal should be a number [0, 1]')
+ reject(new Error('ERROR: userThrVal should be a number [0, 1]'));
}
if (isNaN(minSetSizeVal)) {
- throw new Error('ERROR: minSetSize should be a number')
+ reject(new Error('ERROR: minSetSize should be a number'));
+ }
+ if (minSetSizeVal < 0) {
+ reject(new Error('ERROR: minSetSize should be >= 0'));
}
if (isNaN(maxSetSizeVal)) {
- throw new Error('ERROR: maxSetSize should be a number');
+ reject(new Error('ERROR: maxSetSize should be a number'));
}
- if (thresholdAlgoVal != 'analytical' && thresholdAlgoVal != 'bonferroni' && thresholdAlgoVal != 'fdr') {
- throw new Error('ERROR: thresholdAlgoVal should be one of analytical, bonferroni, fdr');
+ if (maxSetSizeVal < minSetSizeVal) {
+ reject(new Error('ERROR: maxSetSize should be >= minSetSize'));
}
- if (custbgCbVal != 0 && custbgCbVal != 1) {
- throw new Error('ERROR: custbgCb should be 1 or 0')
+ if (thresholdAlgoVal != 'analytical' && thresholdAlgoVal != 'bonferroni' && thresholdAlgoVal != 'fdr') {
+ reject(new Error('ERROR: thresholdAlgoVal should be one of analytical, bonferroni, fdr'));
}
request.post({ url: gProfilerURL, formData: formData }, (err, httpResponse, gProfilerResponse) => {
diff --git a/src/server/enrichment-map/gene-validator/index.js b/src/server/enrichment-map/gene-validator/index.js
index 519fcdc9a..69bb58fc0 100644
--- a/src/server/enrichment-map/gene-validator/index.js
+++ b/src/server/enrichment-map/gene-validator/index.js
@@ -40,7 +40,8 @@ const validatorGconvert = (query, userOptions) => {
const promise = new Promise((resolve, reject) => {
const formData = _.assign({}, defaultOptions, userOptions, { query: query });
formData.organism = formData.organism.toLowerCase();
- formData.target = convertGConvertNames(formData.target.toUpperCase());
+ const initialTarget = formData.target.toUpperCase();
+ formData.target = convertGConvertNames(initialTarget);
const invalidInfo = {invalidTarget: '', invalidOrganism: ''};
if (!validOrganism.includes(formData.organism)) {
invalidInfo.invalidOrganism = formData.organism;
@@ -79,7 +80,7 @@ const validatorGconvert = (query, userOptions) => {
}
});
- const ret = { options: {target: formData.target, organism: formData.organism}, unrecognized: unrecognized, duplicate: duplicate, geneInfo: geneInfo };
+ const ret = { options: {target: initialTarget, organism: formData.organism}, unrecognized: unrecognized, duplicate: duplicate, geneInfo: geneInfo };
resolve(ret);
});
});
diff --git a/src/server/enrichment-map/gene-validator/validityInfo.js b/src/server/enrichment-map/gene-validator/validityInfo.js
index 1e3af0ecb..9bfa2e93d 100644
--- a/src/server/enrichment-map/gene-validator/validityInfo.js
+++ b/src/server/enrichment-map/gene-validator/validityInfo.js
@@ -253,6 +253,6 @@ const validOrganism = ['aaegypti',
'vvinifera',
'zmays'];
-const validTarget = ['ENSG', 'HGNC', 'HGNC_ACC', 'UNIPROTSWISSPROT', 'ENTREZGENE', 'ENTREZGENE_ACC'];
+const validTarget = ['ENSG', 'HGNC', 'HGNC_ACC', 'UNIPROTSWISSPROT', 'ENTREZGENE_ACC'];
module.exports = {validOrganism, validTarget};
\ No newline at end of file
diff --git a/src/server/pathway-commons/index.js b/src/server/pathway-commons/index.js
index 6c1428539..877894b8b 100644
--- a/src/server/pathway-commons/index.js
+++ b/src/server/pathway-commons/index.js
@@ -77,7 +77,6 @@ const PathwayCommonsService = {
};
PathwayCommonsService.querySearch = _.memoize(search.querySearch, query => JSON.stringify(query));
-PathwayCommonsService.uniprotIdSearch = _.memoize(search.uniprotIdSearch, query => JSON.stringify(query));
PathwayCommonsService.datasources = _.memoize(datasources);
// expose core cpath2 client api
diff --git a/src/server/pathway-commons/search/index.js b/src/server/pathway-commons/search/index.js
index e3eb18eb0..1c5b96185 100644
--- a/src/server/pathway-commons/search/index.js
+++ b/src/server/pathway-commons/search/index.js
@@ -67,23 +67,4 @@ const querySearch = async (query) => {
return [];
};
-const uniprotIdSearch = async (query) => {
- const queries = await (processPhrase(sanitize(query.q.trim())));
- const filteredQueries = queries.filter(entry=>entry.includes('xrefid'));
- if(!_.isEmpty(filteredQueries)){
- const searchResult = await search()
- .query(query) //input query string
- .q(filteredQueries)
- .format('json')
- .fetch();
- const searchSuccess = searchResult != null
- if (searchSuccess && searchResult.searchHit.length > 0) {
- const filteredResults = searchResult.searchHit.filter(hit =>
- hit.uri.startsWith('http://identifiers.org/uniprot/')
- );
- return filteredResults.map(hit=>_.last(hit.uri.split('/'))); //Parses and returns the Uniprot id
- }
- }
- return [];
-};
-module.exports = {querySearch:querySearch,uniprotIdSearch:uniprotIdSearch};
\ No newline at end of file
+module.exports = {querySearch};
\ No newline at end of file
diff --git a/src/server/routes/pc.js b/src/server/routes/pc.js
index b233d1d6e..c64a58f6c 100644
--- a/src/server/routes/pc.js
+++ b/src/server/routes/pc.js
@@ -12,10 +12,6 @@ router.get('/querySearch', function (req, res) {
pc.querySearch(req.query).then(r => res.json(r));
});
-router.get('/uniprotIdSearch',function (req, res) {
- pc.uniprotIdSearch(req.query).then(r => res.json(r));
-});
-
router.get('/:path', function (req, res) {
res.redirect('http://www.pathwaycommons.org/pc2/' + req.params.path + '?' + qs.stringify(req.query));
});
diff --git a/src/server/routes/rest.js b/src/server/routes/rest.js
index 56cc89c23..79c45db6a 100644
--- a/src/server/routes/rest.js
+++ b/src/server/routes/rest.js
@@ -80,7 +80,7 @@ router.get('/gene-query', (req, res) => {
validatorGconvert(genes, userOptions).then(gconvertResult => {
res.json(gconvertResult);
}).catch((invalidInfoError) => {
- res.json({invalidTarget: invalidInfoError.invalidTarget, invalidOrganism: invalidInfoError.invalidOrganism});
+ res.status(400).send({invalidTarget: invalidInfoError.invalidTarget, invalidOrganism: invalidInfoError.invalidOrganism});
});
});
@@ -100,6 +100,8 @@ router.post('/gene-query', (req, res) => {
validatorGconvert(genes, userOptions).then(gconvertResult => {
res.json(gconvertResult);
+ }).catch((invalidInfoError) => {
+ res.status(400).send({invalidTarget: invalidInfoError.invalidTarget, invalidOrganism: invalidInfoError.invalidOrganism});
});
});
@@ -110,22 +112,12 @@ router.post('/gene-query', (req, res) => {
router.get('/enrichment', (req, res) => {
const genes = req.query.genes;
const tmpOptions = {};
- tmpOptions.output = req.query.output;
- tmpOptions.organism = req.query.organism;
- tmpOptions.significant = req.query.significant;
- tmpOptions.sortByStructure = req.query.sortByStructure;
- tmpOptions.orderedQuery = req.query.orderedQuery;
- tmpOptions.asRanges = req.query.asRanges;
- tmpOptions.noIea = req.query.noIea;
- tmpOptions.underrep = req.query.underrep;
- tmpOptions.hierfiltering = req.query.hierfiltering;
- tmpOptions.userThr = req.query.userThr;
- tmpOptions.minSetSize = req.query.minSetSize;
- tmpOptions.maxSetSize = req.query.maxSetSize;
- tmpOptions.thresholdAlgo = req.query.thresholdAlgo;
- tmpOptions.domainSizeType = req.query.domainSizeType;
+ tmpOptions.ordered_query = req.query.orderedQuery;
+ tmpOptions.user_thr = req.query.userThr;
+ tmpOptions.min_set_size = req.query.minSetSize;
+ tmpOptions.max_set_size = req.query.maxSetSize;
+ tmpOptions.threshold_algo = req.query.thresholdAlgo;
tmpOptions.custbg = req.query.custbg;
- tmpOptions.custbgCb = req.query.custbgCb;
const userOptions = {};
for (const key in tmpOptions) {
@@ -136,6 +128,8 @@ router.get('/enrichment', (req, res) => {
enrichment(genes, userOptions).then(enrichmentResult => {
res.json(enrichmentResult);
+ }).catch((err) => {
+ res.status(400).send(err.message);
});
});
@@ -145,22 +139,12 @@ router.get('/enrichment', (req, res) => {
router.post('/enrichment', (req, res) => {
const genes = req.body.genes;
const tmpOptions = {};
- tmpOptions.output = req.body.output;
- tmpOptions.organism = req.body.organism;
- tmpOptions.significant = req.body.significant;
- tmpOptions.sortByStructure = req.body.sortByStructure;
- tmpOptions.orderedQuery = req.body.orderedQuery;
- tmpOptions.asRanges = req.body.asRanges;
- tmpOptions.noIea = req.body.noIea;
- tmpOptions.underrep = req.body.underrep;
- tmpOptions.hierfiltering = req.body.hierfiltering;
- tmpOptions.userThr = req.body.userThr;
- tmpOptions.minSetSize = req.body.minSetSize;
- tmpOptions.maxSetSize = req.body.maxSetSize;
- tmpOptions.thresholdAlgo = req.body.thresholdAlgo;
- tmpOptions.domainSizeType = req.body.domainSizeType;
+ tmpOptions.ordered_query = req.body.orderedQuery;
+ tmpOptions.user_thr = req.body.userThr;
+ tmpOptions.min_set_size = req.body.minSetSize;
+ tmpOptions.max_set_size = req.body.maxSetSize;
+ tmpOptions.threshold_algo = req.body.thresholdAlgo;
tmpOptions.custbg = req.body.custbg;
- tmpOptions.custbgCb = req.body.custbgCb;
const userOptions = {};
for (const key in tmpOptions) {
@@ -171,6 +155,8 @@ router.post('/enrichment', (req, res) => {
enrichment(genes, userOptions).then(enrichmentResult => {
res.json(enrichmentResult);
+ }).catch((err) => {
+ res.status(400).send(err.message);
});
});
@@ -189,7 +175,11 @@ router.post('/emap', (req, res) => {
const cutoff = req.body.cutoff;
const JCWeight = req.body.JCWeight;
const OCWeight = req.body.OCWeight;
- res.json(generateGraphInfo(pathwayIdList, cutoff, JCWeight, OCWeight));
+ try {
+ res.json(generateGraphInfo(pathwayIdList, cutoff, JCWeight, OCWeight));
+ } catch (err) {
+ res.status(400).send(err.message);
+ }
});
// Expose a rest endpoint for controller.endSession
diff --git a/src/styles/features/view/sidebarMenus/interactionFilterMenu.css b/src/styles/features/view/sidebarMenus/interactionFilterMenu.css
index 69775c437..09e716224 100644
--- a/src/styles/features/view/sidebarMenus/interactionFilterMenu.css
+++ b/src/styles/features/view/sidebarMenus/interactionFilterMenu.css
@@ -8,7 +8,6 @@
display: flex;
justify-content: flex-start;
cursor: pointer;
-
border-style: solid;
border-color: var(--light-base-colour-dark);
border-width: 1px 1px 0px 1px;
@@ -39,14 +38,22 @@
padding-left: 2px;
display: inline-flex;
margin: 0px auto 0px 0px;
+ word-break:break-all;
}
.interaction-filter-legend{
height:50px;
width: 30px;
+ flex-shrink: 0;
display: inline-flex;
}
+@media screen and (max-width: 1010px) {
+ .icon-cutoff {
+ display:none;
+ }
+}
+
.Binding{
background-color:green;
}