Skip to content

Commit

Permalink
feat: add "others" as a variant
Browse files Browse the repository at this point in the history
Resolves #316

Treating "others" as a variant allows:
 -  to remove unnecessary computation from web app - the data for "others" is immutable, should be precomputed in advance and be stored along with other variant data
 - to have a checkbox which allows toggling it on the plots
  • Loading branch information
ivan-aksamentov committed Aug 9, 2022
1 parent d473600 commit d5d72e9
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 15 deletions.
16 changes: 14 additions & 2 deletions scripts/clusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@
},

"22D": { #BA.2.75
"snps": [3927, 26275, 3796], #TGT = C3927T, A26275G, C3796T
"snps": [3927, 26275, 3796], #TGT = C3927T, A26275G, C3796T
"snps_with_base": ["3927T", "26275G", "3796T"],
"cluster_data": [],
"nextstrain_build": True,
Expand Down Expand Up @@ -1362,7 +1362,7 @@
},
},

# C.37
# C.37
"21GLambda": {
"snps": [7424, 23031, 24138], # ORF1a 2387 (7424G) #S 490 (23031C) 859 (24138A)
"snps_with_base": ["7424G", "23031C", "24138A"],
Expand Down Expand Up @@ -2509,4 +2509,16 @@
# "ORFTEN30": {'snps': [29644], 'exclude_snps': [22226], 'cluster_data': [], "build_name": "ORF10.V30", "display_name": "ORF10:V30"}
# "N220re": {'snps': [28931,29644], 'exclude_snps': [22226], 'cluster_data': [], "build_name": "N.A220Vre", "display_name": "N:A220Vre"}
# "B1139" {'snps': [28486,28867], 'exclude_snps': [], 'cluster_data': [], "build_name": "B1139", "display_name": "B1139"}

"others": {
"build_name": "others",
"cluster_data": [],
"col": "#222222",
"snps": [],
"display_name": "others",
"graphing": False,
"important": False,
"nextstrain_build": False,
"type": "variant"
}
}
14 changes: 13 additions & 1 deletion web/data/clusters.json
Original file line number Diff line number Diff line change
Expand Up @@ -8592,6 +8592,18 @@
23277
],
"type": "do_not_display"
},
{
"build_name": "others",
"cluster_data": [],
"snps": [],
"col": "#222222",
"country_info": [],
"display_name": "others",
"graphing": false,
"important": false,
"nextstrain_build": false,
"type": "variant"
}
]
}
}
3 changes: 2 additions & 1 deletion web/data/perCountryDataCaseCounts.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"22C (Omicron)",
"22D (Omicron)",
"S:677H.Robin1",
"S:677P.Pelican"
"S:677P.Pelican",
"others"
],
"distributions": [
{
Expand Down
12 changes: 1 addition & 11 deletions web/src/components/Cases/CasesPlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import ReactResizeDetector from 'react-resize-detector'

import type { PerCountryCasesDistributionDatum } from 'src/io/getPerCountryCasesData'
import { ticks, timeDomain } from 'src/io/getParams'
import { CLUSTER_NAME_OTHERS, getClusterColor } from 'src/io/getClusters'
import { getClusterColor } from 'src/io/getClusters'
import { formatDateHumanely } from 'src/helpers/format'
import { adjustTicks } from 'src/helpers/adjustTicks'
import { PlotPlaceholder } from 'src/components/Common/PlotPlaceholder'
Expand Down Expand Up @@ -90,16 +90,6 @@ export function CasesPlotComponent({ cluster_names, distribution }: CasesPlotPro
/>
))}

<Area
type="monotone"
dataKey={CLUSTER_NAME_OTHERS}
stackId="1"
stroke="none"
fill={theme.clusters.color.others}
fillOpacity={1}
isAnimationActive={false}
/>

<CartesianGrid stroke={theme.plot.cartesianGrid.stroke} />

<Tooltip
Expand Down

0 comments on commit d5d72e9

Please sign in to comment.