Closed ArtPoon closed 4 months ago
Looks like this problem is at the level of generating the timetree (visualizing timetree.nwk
below):
@GopiGugan I'm running some tests on Paphlagon
Using the following script to extract by_lineage.json
file from latest provision:
import covizu
from covizu.utils import gisaid_utils
from covizu.utils.progress_utils import Callback
from covizu.utils.batch_utils import *
import os
cb = Callback()
infile = "data/provision.2024-02-17T00:00:21.json.xz"
ref_file = os.path.join(covizu.__path__[0], "data/NC_045512.fa")
vcf_file = os.path.join(
covizu.__path__[0],
"data/ProblematicSites_SARS-CoV2/problematic_sites_sarsCov2.vcf")
loader = gisaid_utils.load_gisaid(infile, minlen=29000, mindate="2019-12-01",
debug=None) #100)
batcher = gisaid_utils.batch_fasta(loader, size=2000)
aligned = gisaid_utils.extract_features(
batcher, ref_file=ref_file, binpath="minimap2", nthread=16, minlen=29000)
filtered = gisaid_utils.filter_problematic(
aligned, vcf_file=vcf_file, cutoff=0.001, callback=cb.callback)
by_lineage = gisaid_utils.sort_by_lineage(filtered, callback=cb.callback)
with open("iss512.json", 'w') as outfile:
json.dump(by_lineage, outfile)
Reproduced the tree. Looks like this is not a backend problem.
Reproduced the tree. Looks like this is not a backend problem.
I'll take a look at the front end
I believe the issue is that we aren't scaling the nwk tree itself. Branch lengths are being assigned with the values in the nwk file:
I believe the issue is that we aren't scaling the nwk tree itself. Branch lengths are being assigned with the values in the nwk file:
I don't think this is the problem, the branch lengths in this tree are scaled in units of time (years), which is what we want to display. I think the problem is that we are not calculating the maximum tip to root distance in this tree correctly, which would be needed to scale to the horizontal dimension of this panel.
I suspect the problem is somewhere here: https://github.com/PoonLab/covizu/blob/10a40174019acf76ce417631a495dcba83da4908/js/drawtree.js#L122-L138
More problems:
I suspect the problem is somewhere here:
Yes, it looks like this was the issue. The domain was not set correctly. Working on a fix for this
- The box for a given lineage has incorrect horizontal coordinates relative to the timetree axis.
In this case the tree is being drawn correctly, however the earliest collection date that we have is in 2020-11-14. This is the earliest collection date for variants that are being displayed
An easy fix would be to change the label in the tooltip to read "Collection dates (displayed):", which would imply that we are showing the range of collection dates for the subset of variants in the beadplot.