-
Notifications
You must be signed in to change notification settings - Fork 2
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
Concordance of resistance predictions with Illumina #75
Comments
A sub-question is - can you do better at this than mykrobe |
Working through the implementation of this, here is my first-pass process. For each sample, we take the Illumina predictions (true) and the Nanopore predictions (test) and produce a CSV with classifications for each drug. ClassificationTP: Illumina says resistant and Nanopore says resistant ExampleExample output from this process
One main question I have is how to deal with minor resistant calls ("r" as opposed to "R")? Currently, I am treating them as "R". Not sure if we should deal with them differently? |
This looks right to me. Mykrobe doesn't make r calls for nanopore, but it does for illumina, so they might be there in the truth. I'd treat them as R |
Sensitivity and specificity for mykrobe concordance |
This looks to me like the biggest problem for mykrobe is lots of FNs, which i find believable. Mykrobe needs a lot of coverage |
I'm not sure if it makes sense to aggregate these metrics/counts over drugs though? |
So the above plots and tables are for mykrobe with default settings (with I reran mykrobe and changed the expected error rate to 0.08 (from 0.15) and I get the following results tl;dr: we lost some specificity (i.e. more FPs; very slight decrease), but massively gain sensitivity (i.e. less FNs)
Again, somewhat counter-intuitively, coverage seems to have a slight detrimental effect on performance. I'm guessing this is related to Mykrobe-tools/mykrobe#121 This is probably most clearly illustrated with Apologies for all the different plots. I'm still trying to figure out the best way to summarise this info/relationship. |
Wow, that is a huge improvement in sensitivity by changing the error rate, congratulations and thanks for trying that |
I agree best not to aggregate across drugs |
First glimpse at
|
drug | tool | NPV | PPV | sensitivity | specificity | ME/FP | VME/FN | TP | TN | |
---|---|---|---|---|---|---|---|---|---|---|
0 | Amikacin | drprg | 0.92 | 0 | 0 | 1 | 0 | 12 | 0 | 138 |
1 | Amikacin | mykrobe | 1 | 0.857143 | 1 | 0.985507 | 2 | 0 | 12 | 136 |
2 | Capreomycin | drprg | 0.92 | 0 | 0 | 1 | 0 | 12 | 0 | 138 |
3 | Capreomycin | mykrobe | 1 | 0.857143 | 1 | 0.985507 | 2 | 0 | 12 | 136 |
4 | Ciprofloxacin | drprg | 0.886667 | 0 | 0 | 1 | 0 | 17 | 0 | 133 |
5 | Ciprofloxacin | mykrobe | 0.992537 | 1 | 0.941176 | 1 | 0 | 1 | 16 | 133 |
6 | Ethambutol | drprg | 0.740157 | 1 | 0.410714 | 1 | 0 | 33 | 23 | 94 |
7 | Ethambutol | mykrobe | 0.979167 | 1 | 0.964286 | 1 | 0 | 2 | 54 | 94 |
8 | Isoniazid | drprg | 0.907895 | 0.986486 | 0.9125 | 0.985714 | 1 | 7 | 73 | 69 |
9 | Isoniazid | mykrobe | 1 | 0.91954 | 1 | 0.9 | 7 | 0 | 80 | 63 |
10 | Kanamycin | drprg | 0.919463 | 1 | 0.0769231 | 1 | 0 | 12 | 1 | 137 |
11 | Kanamycin | mykrobe | 1 | 0.866667 | 1 | 0.985401 | 2 | 0 | 13 | 135 |
12 | Moxifloxacin | drprg | 0.886667 | 0 | 0 | 1 | 0 | 17 | 0 | 133 |
13 | Moxifloxacin | mykrobe | 0.992537 | 1 | 0.941176 | 1 | 0 | 1 | 16 | 133 |
14 | Ofloxacin | drprg | 0.886667 | 0 | 0 | 1 | 0 | 17 | 0 | 133 |
15 | Ofloxacin | mykrobe | 1 | 1 | 1 | 1 | 0 | 0 | 17 | 133 |
16 | Pyrazinamide | drprg | 0.793333 | 0 | 0 | 1 | 0 | 31 | 0 | 119 |
17 | Pyrazinamide | mykrobe | 0.991667 | 1 | 0.967742 | 1 | 0 | 1 | 30 | 119 |
18 | Rifampicin | drprg | 0.48 | 0 | 0 | 1 | 0 | 78 | 0 | 72 |
19 | Rifampicin | mykrobe | 1 | 1 | 1 | 1 | 0 | 0 | 78 | 72 |
20 | Streptomycin | drprg | 0.87395 | 1 | 0.673913 | 1 | 0 | 15 | 31 | 104 |
21 | Streptomycin | mykrobe | 0.980769 | 0.956522 | 0.956522 | 0.980769 | 2 | 2 | 44 | 102 |
I've spent all of today manually looking at (drprg) FNs for a few samples and the overwhelming reason for most of them is the FRS filter. If we were to remove that filter, about 95% of the FNs I looked at would become TPs as we made the correct calls, but the FRS filter was applied so we ignored the R call when producing the output JSON. The reason the FRS filter is not suited to this situation is probably best illustrated with the following (drprg/pandora) VCF record
This shows us that this variant covers rrs_A1401X and rrs_C1402X and is deemed 'R' for rrs_A1401X (which agrees with mykrobe Illumina result). The alt alleles that actually describe rrs_A1401X are 4, 5, and 6. So whilst we would expect/hope that only one of those would get coverage, in reality we get coverage on all three, which ends up skewing the FRS quite considerably. I will test out removing the FRS filter and see what impact that has on the results. |
So, we actually genotype correctly, but frs is triggered? I see we genotype as 5, that's right, right? Is the problem that our implementation of frs is wrong, our conception of it is wrong for complex sites, or something else? |
Sorry, I get it now. Looks to me like noise on wrong alleles is triggering frs? |
I guess quite a lot of random snp errors in genes will look like X alleles |
What I mean is, is it a problem that some if the wrong DNA alleles happen to trigger the same, correct, amino allele? |
Yes and yes
I think it is a combination of
|
But at the DNA level there's nothing wrong with the model? And frs acts at that level? I'm confused. I can see how we might need to drop frs threshold die to nanopore error rate, but I don't get what cod9ns have to do with it. |
Everything I've talked about so far is at the DNA level... Not sure I get what you're asking...
I'm not convinced it's the ONT error rate that is the reason for needing to drop FRS. The site in this example is pretty "clean" in the bcftools VCF but we get (quite a bit of) coverage on all of the alleles in pandora.
Just substitute "codons" with "SNPs" then - it doesn't really matter - I'm just trying to say two panel variants in the same pandora VCF record. |
Results after removing FRS filterSo that gets rid of a lot of FNs. I'll manually look into the remaining FNs in the coming days, but it looks like they're probably just the frame shifts we didn't add in. I'll also start digging into the FPs. One small win is we have slightly more sensitivity/recall for Streptomycin than mykrobe.
|
I have look at every single FP and FN to get an idea of where we are making mistakes (considering mykrobe as the truth). I won't like the results of every investigation here, but will try to summarise general themes FNs
FPsThere were 13 in total. Quite a few of them seem to solvable by raising the GT CONF filter to 15 for ONT and 30 for Illumina. However, 5 / 13 have a phenotype of 'R', meaning it is actually a FN for mykrobe and a TP for us. |
Adding in the GT CONF filter is a bit of a mixed bag
we improve on FPs for Isoniazid, but do worse for FNs in Pyrazinamide and Rifampicin |
So you can recover 20/29 FNs out of the box by fixing catalog and background mutations , is good news. Still absorbing FP info |
Table 2 Comparison of Nanopore drug resistance predictions with Illumina predictionsFor this comparison, we assume the mykrobe resistance prediction from Illumina data is correct and evaluate the Nanopore prediction accordingly. FN=false negative; R=number of resistant samples; FP=false positive; S=number of susceptible samples; FNR=false negative rate; FPR=false positive rate; PPV=positive predictive value; NPV=negative predictive value; CI=Wilson score confidence interval
One thing I have changed from the mykrobe papers is the use of FNR/FPR instead of VME/ME. I find VME and ME confusing. Happy to change it back though if this is an issue |
Final table that will be used in the paper (pending major issues)
|
Based on #80, we will not use mykrobe minor resistance calls. @iqbal-lab should we consider minor resistant calls susceptible or ignore drug predictions for this samples (or drugs)? |
Susceptible |
Where there is discordance with Illumina, what kind of errors do we see? Missing resistance or false resistance? Are any particular SNPs repeatedly wrong?
Table showing Very Major Error (missed resistance), Major Error (missed susceptible), PPV (what % of R calls are R) and NPV (what % of S calls are S) for each tool.
The text was updated successfully, but these errors were encountered: