diff --git a/browser/src/GenePage/GenePage.tsx b/browser/src/GenePage/GenePage.tsx index 621c982a8..7acae6e37 100644 --- a/browser/src/GenePage/GenePage.tsx +++ b/browser/src/GenePage/GenePage.tsx @@ -2,7 +2,7 @@ import LeftArrow from '@fortawesome/fontawesome-free/svgs/solid/arrow-circle-left.svg' // @ts-expect-error TS(2307) FIXME: Cannot find module '@fortawesome/fontawesome-free/... Remove this comment to see the full error message import RightArrow from '@fortawesome/fontawesome-free/svgs/solid/arrow-circle-right.svg' -import React, { useState, Dispatch, SetStateAction, useEffect } from 'react' +import React, { useState, Dispatch, SetStateAction } from 'react' import styled from 'styled-components' // @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module '@gno... Remove this comment to see the full error message @@ -22,7 +22,6 @@ import { isExac, hasCopyNumberVariants, isV2, - getTopLevelDataset, } from '@gnomad/dataset-metadata/metadata' import ConstraintTable from '../ConstraintTable/ConstraintTable' import VariantCooccurrenceCountsTable, { @@ -73,7 +72,6 @@ import { } from '../ChartStyles' import { logButtonClick } from '../analytics' import { GtexTissueExpression } from './TranscriptsTissueExpression' -import { GTEX_TISSUES } from '../gtex' export type Strand = '+' | '-' diff --git a/browser/src/GenePage/GeneTranscriptsTrack.tsx b/browser/src/GenePage/GeneTranscriptsTrack.tsx index 33759636d..b4830231c 100644 --- a/browser/src/GenePage/GeneTranscriptsTrack.tsx +++ b/browser/src/GenePage/GeneTranscriptsTrack.tsx @@ -1,5 +1,5 @@ import { max, mean } from 'd3-array' -import React, { useEffect, useRef, useState } from 'react' +import React, { useRef, useState } from 'react' import styled from 'styled-components' // @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module '@gno... Remove this comment to see the full error message @@ -8,19 +8,14 @@ import { Track } from '@gnomad/region-viewer' import TranscriptsTrack from '@gnomad/track-transcripts' import { Button, Modal, TooltipAnchor } from '@gnomad/ui' -import { ALL_GTEX_TISSUES, GtexTissueName, GtexTissues, TissueDetail } from '../gtex' +import { ALL_GTEX_TISSUES, GtexTissueName } from '../gtex' import InfoButton from '../help/InfoButton' import Link from '../Link' import sortedTranscripts from './sortedTranscripts' import TranscriptsTissueExpression from './TranscriptsTissueExpression' import { Gene } from './GenePage' -import { - DatasetId, - getTopLevelDataset, - hasStructuralVariants, -} from '../../../dataset-metadata/metadata' +import { hasStructuralVariants } from '../../../dataset-metadata/metadata' import { GtexTissueDetail, TranscriptWithTissueExpression } from './TissueExpressionTrack' -import { Transcript } from '../TranscriptPage/TranscriptPage' const TranscriptsInfoWrapper = styled.div` display: flex; @@ -62,10 +57,10 @@ const GeneTranscriptsTrack = ({ const gtexTissues: Partial> = {} if (isTissueExpressionAvailable) { - const transcript = (gene.transcripts as TranscriptWithTissueExpression[]).find( + const preferredTranscript = (gene.transcripts as TranscriptWithTissueExpression[]).find( (transcript) => transcript.transcript_id === preferredTranscriptId ) - transcript!.gtex_tissue_expression.forEach((tissue) => { + preferredTranscript!.gtex_tissue_expression.forEach((tissue) => { gtexTissues[tissue.tissue as GtexTissueName] = { fullName: ALL_GTEX_TISSUES[tissue.tissue as GtexTissueName].fullName || tissue.tissue, color: ALL_GTEX_TISSUES[tissue.tissue as GtexTissueName].color || '#888888', diff --git a/browser/src/GenePage/TissueExpressionTrack.tsx b/browser/src/GenePage/TissueExpressionTrack.tsx index 8f63bd874..bcca8ca43 100644 --- a/browser/src/GenePage/TissueExpressionTrack.tsx +++ b/browser/src/GenePage/TissueExpressionTrack.tsx @@ -1,6 +1,6 @@ import { max, mean } from 'd3-array' import { scaleLinear } from 'd3-scale' -import React, { useEffect, useRef, useState } from 'react' +import React, { useRef, useState } from 'react' import styled from 'styled-components' // @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module '@gno... Remove this comment to see the full error message @@ -9,15 +9,13 @@ import { Track } from '@gnomad/region-viewer' import { RegionsPlot } from '@gnomad/track-regions' import { Badge, Button, Modal, SearchInput, Select, TooltipAnchor } from '@gnomad/ui' -import { ALL_GTEX_TISSUES, AllGtexTissues, GTEX_TISSUES, GtexTissueName } from '../gtex' +import { ALL_GTEX_TISSUES, AllGtexTissues, GtexTissueName } from '../gtex' import InfoButton from '../help/InfoButton' import { logButtonClick } from '../analytics' import TranscriptsTissueExpression, { GtexTissueExpression } from './TranscriptsTissueExpression' import { GeneTranscript } from './GenePage' -import { DatasetId, getTopLevelDataset } from '@gnomad/dataset-metadata/metadata' -import { ALL } from 'dns' const getPlotRegions = (expressionRegions: any, getValueForRegion: any) => { const roundedRegions = expressionRegions.map((region: any) => ({ @@ -375,7 +373,7 @@ const TissueExpressionTrack = ({ const gtexTissues: Partial> = {} transcripts .find((transcript) => transcript.transcript_id === preferredTranscriptId) - ?.gtex_tissue_expression.map((tissue) => { + ?.gtex_tissue_expression.forEach((tissue) => { gtexTissues[tissue.tissue as GtexTissueName] = { fullName: ALL_GTEX_TISSUES[tissue.tissue as GtexTissueName].fullName || tissue.tissue, color: ALL_GTEX_TISSUES[tissue.tissue as GtexTissueName].color || '#888888', @@ -418,7 +416,7 @@ const TissueExpressionTrack = ({ (transcript) => transcript.gtex_tissue_expression.find((tissue) => tissue.tissue === tissueId)?.value ) - .filter((value): value is number => value != undefined) + .filter((value): value is number => value !== undefined) ) return {