diff --git a/browser/src/DatasetSelector.tsx b/browser/src/DatasetSelector.tsx index 6b3d6e7b3..deee7df3b 100644 --- a/browser/src/DatasetSelector.tsx +++ b/browser/src/DatasetSelector.tsx @@ -6,7 +6,6 @@ import queryString from 'query-string' import React, { Component } from 'react' import { Link, withRouter } from 'react-router-dom' import styled from 'styled-components' - import sampleCounts from '@gnomad/dataset-metadata/sampleCounts' import { @@ -16,6 +15,7 @@ import { referenceGenome, hasCopyNumberVariants, shortVariantDatasetId, + isV2, } from '@gnomad/dataset-metadata/metadata' const NavigationMenuWrapper = styled.ul` @@ -457,14 +457,14 @@ const DatasetSelector = withRouter(({ datasetOptions, history, selectedDataset } const shortVariantDatasets = [ { id: 'current_short_variant', - isActive: hasShortVariants(selectedDataset) && !hasCopyNumberVariants(selectedDataset), + isActive: hasShortVariants(selectedDataset), label: labelForDataset(topLevelShortVariantDataset), url: datasetLink(topLevelShortVariantDataset), childReferenceGenome: referenceGenome(topLevelShortVariantDataset), }, { id: 'other_short_variant', - isActive: hasShortVariants(selectedDataset) && !hasCopyNumberVariants(selectedDataset), + isActive: hasShortVariants(selectedDataset), label: 'More datasets', children: [] as ChildDataset[], }, @@ -589,17 +589,25 @@ const DatasetSelector = withRouter(({ datasetOptions, history, selectedDataset } } if (includeStructuralVariants || includeCopyNumberVariants) { - const topLevelStructuralVariantDataset = hasStructuralVariants(selectedDataset) - ? selectedDataset - : 'gnomad_sv_r2_1' + const topLevelStructuralVariantDataset: any = (() => { + if (isV2(selectedDataset)) { + return 'gnomad_sv_r2_1' + } + + if (hasStructuralVariants(selectedDataset)) { + return selectedDataset + } + + return 'gnomad_sv_r4' + })() const topLevelCopyNumberVariantDataset = hasCopyNumberVariants(selectedDataset) ? selectedDataset : 'gnomad_cnv_r4' - const currentDataset = hasStructuralVariants(selectedDataset) - ? topLevelStructuralVariantDataset - : topLevelCopyNumberVariantDataset + const currentDataset = hasCopyNumberVariants(selectedDataset) + ? topLevelCopyNumberVariantDataset + : topLevelStructuralVariantDataset datasets.push( { diff --git a/browser/src/GenePage/__snapshots__/GenePage.spec.tsx.snap b/browser/src/GenePage/__snapshots__/GenePage.spec.tsx.snap index 4cacb59b2..ba5d90f8e 100644 --- a/browser/src/GenePage/__snapshots__/GenePage.spec.tsx.snap +++ b/browser/src/GenePage/__snapshots__/GenePage.spec.tsx.snap @@ -7647,12 +7647,12 @@ exports[`GenePage with non-SV dataset "exac" has no unexpected changes 1`] = ` - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v2.1
  • - gnomAD CNVs v4.0 + gnomAD SVs v2.1
  • - gnomAD CNVs v4.0 + gnomAD SVs v2.1
  • - gnomAD CNVs v4.0 + gnomAD SVs v2.1
  • - gnomAD CNVs v4.0 + gnomAD SVs v2.1
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v2.1
  • - gnomAD CNVs v4.0 + gnomAD SVs v2.1
  • - gnomAD CNVs v4.0 + gnomAD SVs v2.1
  • - gnomAD CNVs v4.0 + gnomAD SVs v2.1
  • - gnomAD CNVs v4.0 + gnomAD SVs v2.1
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v2.1
  • - gnomAD CNVs v4.0 + gnomAD SVs v2.1
  • - gnomAD CNVs v4.0 + gnomAD SVs v2.1
  • - gnomAD CNVs v4.0 + gnomAD SVs v2.1
  • - gnomAD CNVs v4.0 + gnomAD SVs v2.1
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v2.1
  • - gnomAD CNVs v4.0 + gnomAD SVs v2.1
  • - gnomAD CNVs v4.0 + gnomAD SVs v2.1
  • - gnomAD CNVs v4.0 + gnomAD SVs v2.1
  • - gnomAD CNVs v4.0 + gnomAD SVs v2.1
  • - gnomAD CNVs v4.0 + gnomAD SVs v2.1
  • - gnomAD CNVs v4.0 + gnomAD SVs v2.1
  • - gnomAD CNVs v4.0 + gnomAD SVs v2.1
  • - gnomAD CNVs v4.0 + gnomAD SVs v2.1
  • - gnomAD CNVs v4.0 + gnomAD SVs v2.1
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0
  • - gnomAD CNVs v4.0 + gnomAD SVs v4.0