diff --git a/package-lock.json b/package-lock.json index 5ff415fa3..30b2934f1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "covidcg", - "version": "2.2.2", + "version": "2.2.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index e973deae7..37d09bf41 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "covidcg", - "version": "2.2.2", + "version": "2.2.3", "description": "", "engines": { "node": ">=8", diff --git a/src/components/GroupReport/GroupStructuralViewer.js b/src/components/GroupReport/GroupStructuralViewer.js index 6b648ad79..e37e7c3aa 100644 --- a/src/components/GroupReport/GroupStructuralViewer.js +++ b/src/components/GroupReport/GroupStructuralViewer.js @@ -8,6 +8,7 @@ import { colorHeatmap, getMoleculeAssemblies } from '../LiteMol/litemolutils'; import { reds } from '../../constants/colors'; import { hexToRgb } from '../../utils/color'; import { getAllProteins } from '../../utils/gene_protein'; +import defaultStructures from '../../../static_data/default_structures.json'; import EmptyPlot from '../Common/EmptyPlot'; import DownloadPymolScriptModal from '../Modals/DownloadPymolScriptModal'; @@ -64,11 +65,24 @@ const StructuralViewer = observer(() => { }; const onChangeReportStructureActiveProtein = (event) => { const newProtein = event.target.value; + + if (newProtein === state.activeProtein) { + return; + } + setState({ ...state, activeProtein: newProtein, activeProteinChanged: newProtein != plotSettingsStore.reportStructureActiveProtein, + // Clear PDB ID when protein changes + pdbId: Object.keys(defaultStructures).includes(newProtein) + ? defaultStructures[newProtein] + : '', + validPdbId: Object.keys(defaultStructures).includes(newProtein) + ? true + : false, + pdbIdChanged: true, }); }; const onChangePdbId = (event) => { @@ -300,17 +314,6 @@ const StructuralViewer = observer(() => { Download Data - - - + + +
Download PyMOL Script diff --git a/src/components/Pages/GroupReportTab.js b/src/components/Pages/GroupReportTab.js index 8df894677..7e99548db 100644 --- a/src/components/Pages/GroupReportTab.js +++ b/src/components/Pages/GroupReportTab.js @@ -100,6 +100,12 @@ const GroupReportTab = observer(() => { compatibility, so it is possible to, for example, erroneously map nsp12 SNVs onto a Spike structure. +
  • + More structures available at the{' '} + + RCSB COVID-19 resource page + +
  • } > diff --git a/src/components/Vega/SurveillancePlot.js b/src/components/Vega/SurveillancePlot.js index e3b7d7031..ebf3282ae 100644 --- a/src/components/Vega/SurveillancePlot.js +++ b/src/components/Vega/SurveillancePlot.js @@ -36,6 +36,7 @@ import { LegendItemContainer, LegendItemName, LegendItemCounts, + CollapseButton, } from './SurveillancePlot.styles'; const maxCharsPerLine = 10; @@ -198,8 +199,16 @@ const SurveillancePlot = observer(({ width }) => { }, signalListeners: {}, legendItems: [], + showSettings: false, }); + const onToggleShowSettings = () => { + setState({ + ...state, + showSettings: !state.showSettings, + }); + }; + const onDismissWarning = () => { setState({ ...state, @@ -349,127 +358,140 @@ const SurveillancePlot = observer(({ width }) => { {' '} - Sort by{' '} - - - - - - - - - Displayed {groupName} - To improve readability, ${groupName} which do not meet these conditions in any of the six continents are removed from the plots. For example, if one ${groupName} fails these conditions in 5 continents but passes in the last one, it will still be shown. If one ${groupName} fails these conditions in all 6 continents, it will be excluded.

    Min Counts is defined as the minimum number of sequences with this ${groupName} in a given continent on a given week

    Min Percent is defined as the minimum percent of sequences with this ${groupName} in a given continent on a given week

    `} - data-html="true" - data-place="right" - data-for="main-tooltip" - style={{ marginRight: 8 }} + + {state.showSettings ? 'Hide' : 'Show'} Settings{' '} + + +
    + - - - - - -
    - - Highlighted {groupName} - Choose ${groupName} to highlight and display in the legend. ${groupName} which pass these conditions in at least one of six continents will be highlighted. Non-highlighted ${groupName} are still displayed but not colored.

    Min Counts is defined as the minimum number of sequences with this ${groupName} in a given continent on a given week

    Min Percent is defined as the minimum percent of sequences with this ${groupName} in a given continent on a given week

    Min Correlation is defined as the minimum Pearson correlation of the % sequences of this ${groupName}. For the correlation calculations, the last ${config.surv_end_date_days_ago} days from today are omitted, to reduce noise in this metric.

    `} - data-html="true" - data-place="right" - data-for="main-tooltip" - style={{ marginRight: 8 }} - /> - - - - - - - - + + + +
    + + Highlighted {groupName} + Choose ${groupName} to highlight and display in the legend. ${groupName} which pass these conditions in at least one of six continents will be highlighted. Non-highlighted ${groupName} are still displayed but not colored.

    Min Counts is defined as the minimum number of sequences with this ${groupName} in a given continent on a given week

    Min Percent is defined as the minimum percent of sequences with this ${groupName} in a given continent on a given week

    Min Correlation is defined as the minimum Pearson correlation of the % sequences of this ${groupName}. For the correlation calculations, the last ${config.surv_end_date_days_ago} days from today are omitted, to reduce noise in this metric.

    `} + data-html="true" + data-place="right" + data-for="main-tooltip" + style={{ marginRight: 8 }} /> - - -
    + + + + + + + + + + + + )} - -
    -