From 9153ef3c9f7190ae27e39275cc7022ddc7b6253c Mon Sep 17 00:00:00 2001 From: Micky Byrnes <68259544+BenX00@users.noreply.github.com> Date: Mon, 19 Apr 2021 15:20:47 -0500 Subject: [PATCH] DEV-586: Hide beta analysis features w/ flags. (#2977) Co-authored-by: Tori --- .../components/analysis/availableAnalysis.js | 628 +++++++++--------- src/packages/@ncigdc/utils/constants.js | 8 + 2 files changed, 324 insertions(+), 312 deletions(-) diff --git a/src/packages/@ncigdc/components/analysis/availableAnalysis.js b/src/packages/@ncigdc/components/analysis/availableAnalysis.js index 336f769dc..59904327c 100644 --- a/src/packages/@ncigdc/components/analysis/availableAnalysis.js +++ b/src/packages/@ncigdc/components/analysis/availableAnalysis.js @@ -16,6 +16,7 @@ import Demo from './Demo'; import SetOperations from './SetOperations'; import defaultVariables from './defaultCDAVEvariables'; import { validateGeneExpressionAvailability } from './geneExpression/helpers'; +import { DISPLAY_SCRNA_SEQ, DISPLAY_GENE_EXPRESSION } from '@ncigdc/utils/constants'; export type TSelectedSets = { [TSetTypes]: any, @@ -150,12 +151,12 @@ const availableAnalysis: [TAnalysis] = [ {...props} getFillColor={(d, i) => ( d.op === 5 - ? 'rgba(38, 166, 166, 0.65)' - : d.op === 6 - ? 'rgba(235, 233, 46, 0.79)' - : d.op === 7 - ? 'rgba(175, 58, 215, 0.8)' - : 'rgba(0,0,0,0)' + ? 'rgba(38, 166, 166, 0.65)' + : d.op === 6 + ? 'rgba(235, 233, 46, 0.79)' + : d.op === 7 + ? 'rgba(175, 58, 215, 0.8)' + : 'rgba(0,0,0,0)' )} numCircles={3} ops={[ @@ -172,7 +173,7 @@ const availableAnalysis: [TAnalysis] = [ width: 80, ...style, }} - /> + /> ), label: 'Set Operations', ResultComponent: props => { @@ -190,7 +191,7 @@ const availableAnalysis: [TAnalysis] = [ message={props.message} sets={props.sets[type]} type={type} - /> + /> ) : ( @@ -199,7 +200,7 @@ const availableAnalysis: [TAnalysis] = [ message={props.message} sets={props.sets[type]} type={type} - /> + /> ); }, setDisabledMessage: ({ sets, type }) => ( @@ -210,10 +211,9 @@ const availableAnalysis: [TAnalysis] = [ ].filter(t => t !== type).some(t => sets[t]) ? 'Please choose only one type' : Object.keys(sets[type] || {}).length >= 3 - ? `Please select two or three ${ - type === 'ssm' ? 'mutation' : type + ? `Please select two or three ${type === 'ssm' ? 'mutation' : type } sets` - : null), + : null), setInstructions: 'Select 2 or 3 of the same set type', setTypes: [ 'case', @@ -295,7 +295,7 @@ const availableAnalysis: [TAnalysis] = [ height="80px" style={style} width="80px" - /> + /> )), label: 'Cohort Comparison', @@ -310,8 +310,8 @@ const availableAnalysis: [TAnalysis] = [ ) ), setDisabledMessage: ({ sets, type }) => (!['case'].includes(type) - ? 'This analysis can\'t be run with this type' - : Object.keys(sets[type] || {}).length >= 2 + ? 'This analysis can\'t be run with this type' + : Object.keys(sets[type] || {}).length >= 2 ? `You can only select two ${type === 'ssm' ? 'mutation' : type} set` : null), setInstructions: 'Select 2 case sets', @@ -355,7 +355,7 @@ const availableAnalysis: [TAnalysis] = [ height: 80, ...style, }} - /> + /> )), label: 'Clinical Data Analysis', @@ -369,7 +369,7 @@ const availableAnalysis: [TAnalysis] = [ + /> ) ), setTypes: ['case'], @@ -378,275 +378,276 @@ const availableAnalysis: [TAnalysis] = [ ['case'].every((t: any) => Object.keys(sets[t] || {}).length === 1), }, // Gene Expression - { - demoData: { - filters: { - 'tcga-tgct--all-cases--test2': { - content: [ - { - content: { - field: 'cases.project.project_id', - value: ['TCGA-TGCT'], + ...DISPLAY_GENE_EXPRESSION && [ + { + demoData: { + filters: { + 'tcga-tgct--all-cases--test2': { + content: [ + { + content: { + field: 'cases.project.project_id', + value: ['TCGA-TGCT'], + }, + op: 'in', }, - op: 'in', - }, - ], - op: 'and', - }, - 'tcga-tgct--top-50-pc-genes--test2': { - content: [ - { - content: { - field: 'genes.gene_id', - value: [ - 'ENSG00000181449', - 'ENSG00000007350', - 'ENSG00000132972', - 'ENSG00000204644', - 'ENSG00000125207', - 'ENSG00000133063', - 'ENSG00000118137', - 'ENSG00000139219', - 'ENSG00000149948', - 'ENSG00000176566', - 'ENSG00000153707', - 'ENSG00000101443', - 'ENSG00000185792', - 'ENSG00000242950', - 'ENSG00000147257', - 'ENSG00000187556', - 'ENSG00000241186', - 'ENSG00000187690', - 'ENSG00000143320', - 'ENSG00000175928', - 'ENSG00000101076', - 'ENSG00000076716', - 'ENSG00000205358', - 'ENSG00000142182', - 'ENSG00000185686', - 'ENSG00000124839', - 'ENSG00000160224', - 'ENSG00000159224', - 'ENSG00000185559', - 'ENSG00000106483', - 'ENSG00000117215', - 'ENSG00000110900', - 'ENSG00000143850', - 'ENSG00000157399', - 'ENSG00000255192', - 'ENSG00000156959', - 'ENSG00000169851', - 'ENSG00000120949', - 'ENSG00000100721', - 'ENSG00000137077', - 'ENSG00000163347', - 'ENSG00000143995', - 'ENSG00000125398', - 'ENSG00000189334', - 'ENSG00000102021', - 'ENSG00000171388', - 'ENSG00000011677', - 'ENSG00000183117', - 'ENSG00000204538', - 'ENSG00000262406', - 'ENSG00000143452', - 'ENSG00000166482', - 'ENSG00000143768', - 'ENSG00000130513', - 'ENSG00000161249', - 'ENSG00000169594', - 'ENSG00000139263', - 'ENSG00000141448', - 'ENSG00000099399', - 'ENSG00000183098', - 'ENSG00000163283', - 'ENSG00000214575', - 'ENSG00000167244', - 'ENSG00000159251', - 'ENSG00000237541', - 'ENSG00000133169', - 'ENSG00000171345', - 'ENSG00000145113', - 'ENSG00000013297', - 'ENSG00000138622', - 'ENSG00000175084', - 'ENSG00000105370', - 'ENSG00000151892', - 'ENSG00000262655', - 'ENSG00000113083', - 'ENSG00000152137', - 'ENSG00000111319', - 'ENSG00000196350', - 'ENSG00000138829', - 'ENSG00000075673', - 'ENSG00000139351', - 'ENSG00000189184', - 'ENSG00000243709', - 'ENSG00000197380', - 'ENSG00000105664', - 'ENSG00000133048', - 'ENSG00000163239', - 'ENSG00000142677', - 'ENSG00000180340', - 'ENSG00000203907', - 'ENSG00000101871', - 'ENSG00000114315', - 'ENSG00000168505', - 'ENSG00000156049', - 'ENSG00000163431', - 'ENSG00000135253', - 'ENSG00000166426', - 'ENSG00000163530', - 'ENSG00000104332', - 'ENSG00000197565', - 'ENSG00000107105', - 'ENSG00000196878', - 'ENSG00000049540', - 'ENSG00000138685', - 'ENSG00000123096', - 'ENSG00000126016', - 'ENSG00000149294', - 'ENSG00000113739', - 'ENSG00000130182', - 'ENSG00000100842', - 'ENSG00000064886', - 'ENSG00000163508', - 'ENSG00000112183', - 'ENSG00000166450', - 'ENSG00000157851', - 'ENSG00000086548', - 'ENSG00000197653', - 'ENSG00000185070', - 'ENSG00000189143', - 'ENSG00000111799', - 'ENSG00000123094', - 'ENSG00000198729', - 'ENSG00000004776', - 'ENSG00000106571', - 'ENSG00000182111', - 'ENSG00000006283', - 'ENSG00000170748', - 'ENSG00000244486', - 'ENSG00000145147', - 'ENSG00000154027', - 'ENSG00000166527', - 'ENSG00000232629', - 'ENSG00000112273', - 'ENSG00000162949', - 'ENSG00000115963', - 'ENSG00000091513', - 'ENSG00000203909', - 'ENSG00000113430', - 'ENSG00000046653', - 'ENSG00000221890', - 'ENSG00000131096', - 'ENSG00000147596', - 'ENSG00000114251', - 'ENSG00000160963', - 'ENSG00000144857', - 'ENSG00000150893', - 'ENSG00000172572', - 'ENSG00000121753', - 'ENSG00000155816', - 'ENSG00000118777', - ], + ], + op: 'and', + }, + 'tcga-tgct--top-50-pc-genes--test2': { + content: [ + { + content: { + field: 'genes.gene_id', + value: [ + 'ENSG00000181449', + 'ENSG00000007350', + 'ENSG00000132972', + 'ENSG00000204644', + 'ENSG00000125207', + 'ENSG00000133063', + 'ENSG00000118137', + 'ENSG00000139219', + 'ENSG00000149948', + 'ENSG00000176566', + 'ENSG00000153707', + 'ENSG00000101443', + 'ENSG00000185792', + 'ENSG00000242950', + 'ENSG00000147257', + 'ENSG00000187556', + 'ENSG00000241186', + 'ENSG00000187690', + 'ENSG00000143320', + 'ENSG00000175928', + 'ENSG00000101076', + 'ENSG00000076716', + 'ENSG00000205358', + 'ENSG00000142182', + 'ENSG00000185686', + 'ENSG00000124839', + 'ENSG00000160224', + 'ENSG00000159224', + 'ENSG00000185559', + 'ENSG00000106483', + 'ENSG00000117215', + 'ENSG00000110900', + 'ENSG00000143850', + 'ENSG00000157399', + 'ENSG00000255192', + 'ENSG00000156959', + 'ENSG00000169851', + 'ENSG00000120949', + 'ENSG00000100721', + 'ENSG00000137077', + 'ENSG00000163347', + 'ENSG00000143995', + 'ENSG00000125398', + 'ENSG00000189334', + 'ENSG00000102021', + 'ENSG00000171388', + 'ENSG00000011677', + 'ENSG00000183117', + 'ENSG00000204538', + 'ENSG00000262406', + 'ENSG00000143452', + 'ENSG00000166482', + 'ENSG00000143768', + 'ENSG00000130513', + 'ENSG00000161249', + 'ENSG00000169594', + 'ENSG00000139263', + 'ENSG00000141448', + 'ENSG00000099399', + 'ENSG00000183098', + 'ENSG00000163283', + 'ENSG00000214575', + 'ENSG00000167244', + 'ENSG00000159251', + 'ENSG00000237541', + 'ENSG00000133169', + 'ENSG00000171345', + 'ENSG00000145113', + 'ENSG00000013297', + 'ENSG00000138622', + 'ENSG00000175084', + 'ENSG00000105370', + 'ENSG00000151892', + 'ENSG00000262655', + 'ENSG00000113083', + 'ENSG00000152137', + 'ENSG00000111319', + 'ENSG00000196350', + 'ENSG00000138829', + 'ENSG00000075673', + 'ENSG00000139351', + 'ENSG00000189184', + 'ENSG00000243709', + 'ENSG00000197380', + 'ENSG00000105664', + 'ENSG00000133048', + 'ENSG00000163239', + 'ENSG00000142677', + 'ENSG00000180340', + 'ENSG00000203907', + 'ENSG00000101871', + 'ENSG00000114315', + 'ENSG00000168505', + 'ENSG00000156049', + 'ENSG00000163431', + 'ENSG00000135253', + 'ENSG00000166426', + 'ENSG00000163530', + 'ENSG00000104332', + 'ENSG00000197565', + 'ENSG00000107105', + 'ENSG00000196878', + 'ENSG00000049540', + 'ENSG00000138685', + 'ENSG00000123096', + 'ENSG00000126016', + 'ENSG00000149294', + 'ENSG00000113739', + 'ENSG00000130182', + 'ENSG00000100842', + 'ENSG00000064886', + 'ENSG00000163508', + 'ENSG00000112183', + 'ENSG00000166450', + 'ENSG00000157851', + 'ENSG00000086548', + 'ENSG00000197653', + 'ENSG00000185070', + 'ENSG00000189143', + 'ENSG00000111799', + 'ENSG00000123094', + 'ENSG00000198729', + 'ENSG00000004776', + 'ENSG00000106571', + 'ENSG00000182111', + 'ENSG00000006283', + 'ENSG00000170748', + 'ENSG00000244486', + 'ENSG00000145147', + 'ENSG00000154027', + 'ENSG00000166527', + 'ENSG00000232629', + 'ENSG00000112273', + 'ENSG00000162949', + 'ENSG00000115963', + 'ENSG00000091513', + 'ENSG00000203909', + 'ENSG00000113430', + 'ENSG00000046653', + 'ENSG00000221890', + 'ENSG00000131096', + 'ENSG00000147596', + 'ENSG00000114251', + 'ENSG00000160963', + 'ENSG00000144857', + 'ENSG00000150893', + 'ENSG00000172572', + 'ENSG00000121753', + 'ENSG00000155816', + 'ENSG00000118777', + ], + }, + op: 'in', }, - op: 'in', - }, - ], - op: 'and', - }, - }, - message: 'Demo showing the gene expression heatmap derived from 150 TCGA-TGCT cases and the 150 most variably-expressed protein-coding genes in the cohort.', - name: 'Demo Gene Expression', - sets: { - case: { - 'tcga-tgct--all-cases--test2': 'TCGA-TGCT', + ], + op: 'and', + }, }, - gene: { - 'tcga-tgct--top-50-pc-genes--test2': 'Top 150 Most Variably-Expressed Genes', + message: 'Demo showing the gene expression heatmap derived from 150 TCGA-TGCT cases and the 150 most variably-expressed protein-coding genes in the cohort.', + name: 'Demo Gene Expression', + sets: { + case: { + 'tcga-tgct--all-cases--test2': 'TCGA-TGCT', + }, + gene: { + 'tcga-tgct--top-50-pc-genes--test2': 'Top 150 Most Variably-Expressed Genes', + }, }, + type: 'gene_expression', }, - type: 'gene_expression', - }, - description: 'Display the gene expression heatmap for sets of cases and genes of your choice.', - Icon: withTheme(({ style }) => ( -
- ( +
+ -
- )), - introText: ( - -

- Try out the beta release of our new tool for gene expression analysis. - Display the gene expression heatmap for sets of cases and genes of your choice. +

+ )), + introText: ( + +

+ Try out the beta release of our new tool for gene expression analysis. + Display the gene expression heatmap for sets of cases and genes of your choice.

-

- COMING SOON: - {' '} +

+ COMING SOON: + {' '} Filter genes by expression level, and select genes that are highly variable.

-

- Please send us your feedback at: +

+ Please send us your feedback at: {' '} - support@nci-gdc.datacommons.io -

-
- ), - isBeta: true, - label: 'Gene Expression', - ResultComponent: props => (props.id.includes('demo-') - ? ( - + support@nci-gdc.datacommons.io +

+ + ), + isBeta: true, + label: 'Gene Expression', + ResultComponent: props => (props.id.includes('demo-') + ? ( + + + + ) + : ( -
- ) - : ( - - ) - ), - setInstructions: { - gene: ( -

- {'The '} + ) + ), + setInstructions: { + gene: ( +

+ {'The '} - - Molecular Signatures Database (MSigDB) + Molecular Signatures Database (MSigDB) , a collection of annotated gene sets, can help you search for gene sets relevant to your analyses. MSigDB allows you to export these gene sets, which you can then upload to the GDC Portal for gene expression analysis. -

- ), - }, - setTypes: ['case', 'gene'], - type: 'gene_expression', - validationInstructions: ( - -

+ ), + }, + setTypes: ['case', 'gene'], + type: 'gene_expression', + validationInstructions: ( + +

- Step 3: Check available data + Step 3: Check available data

-

- Check if your input sets have gene expression data available before running the analysis. +

+ Check if your input sets have gene expression data available before running the analysis.

-
- ), - validateSets: { - availability: sets => ( + + ), + validateSets: { + availability: sets => ( Object.keys(sets).length ? fetchApi( 'gene_expression/availability', @@ -665,61 +666,64 @@ const availableAnalysis: [TAnalysis] = [ console.error('Gene Expression Availability error', error); }) : sets - ), - quantity: sets => sets && + ), + quantity: sets => sets && ['case', 'gene'].every((t: any) => Object.keys(sets[t] || {}).length === 1), + }, }, - }, + ], // Single Cell RNA Sequencing - { - demoData: { - filters: { - 'demo-pancreas': { - content: [ - { - content: { - field: 'cases.primary_site', - value: ['Pancreas'], + ...DISPLAY_SCRNA_SEQ && [ + { + demoData: { + filters: { + 'demo-pancreas': { + content: [ + { + content: { + field: 'cases.primary_site', + value: ['Pancreas'], + }, + op: 'in', }, - op: 'in', - }, - ], - op: 'and', + ], + op: 'and', + }, }, - }, - message: 'Demo showing UMAP, t-SNE, PCA plots generated from single cell RNA sequencing data for a sample case.', - name: 'Demo SCRNA-SEQ', - sets: { - case: { - 'demo-pancreas': 'Pancreas', + message: 'Demo showing UMAP, t-SNE, PCA plots generated from single cell RNA sequencing data for a sample case.', + name: 'Demo SCRNA-SEQ', + sets: { + case: { + 'demo-pancreas': 'Pancreas', + }, }, + type: 'scrna_seq', }, - type: 'scrna_seq', - }, - description: 'Display a demo of different clustering visualizations for single cell RNA sequencing data.', - Icon: withTheme(({ style }) => ( -
- ( +
+ -
- )), - isBeta: true, - label: 'Single Cell RNA Sequencing', - ResultComponent: props => ( - + )), + isBeta: true, + label: 'Single Cell RNA Sequencing', + ResultComponent: props => ( + - ), - setTypes: ['case'], - type: 'scrna_seq', - validateSets: sets => sets && - ['case'].every((t: any) => Object.keys(sets[t] || {}).length === 1), - }, + ), + setTypes: ['case'], + type: 'scrna_seq', + validateSets: sets => sets && + ['case'].every((t: any) => Object.keys(sets[t] || {}).length === 1), + }, + ] ]; export default availableAnalysis; diff --git a/src/packages/@ncigdc/utils/constants.js b/src/packages/@ncigdc/utils/constants.js index 7867eb165..23d0716ed 100644 --- a/src/packages/@ncigdc/utils/constants.js +++ b/src/packages/@ncigdc/utils/constants.js @@ -937,3 +937,11 @@ export const DISPLAY_DAVE_CA = localStorage.REACT_APP_DISPLAY_DAVE_CA || export const MOCK_SCRNA_DATA = localStorage.REACT_APP_MOCK_SCRNA_DATA || process.env.REACT_APP_MOCK_SCRNA_DATA || false; + +export const DISPLAY_SCRNA_SEQ = localStorage.REACT_APP_DISPLAY_SCRNA_SEQ || + process.env.REACT_APP_DISPLAY_SCRNA_SEQ || + false; + +export const DISPLAY_GENE_EXPRESSION = localStorage.REACT_APP_DISPLAY_GENE_EXPRESSION || + process.env.REACT_APP_DISPLAY_GENE_EXPRESSION || + false;