Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add "others" as a variant #342

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
}
Comment on lines +2513 to +2523
Copy link
Collaborator Author

@ivan-aksamentov ivan-aksamentov Aug 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the definition of the "others" variant in clusters.py. This object will be emitted into clusters.json along with other variants.

It should be the last object in the list to keep the display order of area segments on the plot the same. However you can play with the order to your liking.

}
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"
],
Comment on lines +33 to 35
Copy link
Collaborator Author

@ivan-aksamentov ivan-aksamentov Aug 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"others" needs to be added into the list of cluster_names in json data. Here I illustrate what the result should look like for cases data. This is a manual addition and is not enforced in code. Python scripts will need to be changed for that (for cases and other plots if applicable).

"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} />
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I remove the additional ad-hoc area segment from the cases plot. The same should be done for the other plot(s), when they get their own "others" data.


<Tooltip
Expand Down