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

Add intersection parameter to /lineage-mutations #60

Open
flaneuse opened this issue Dec 2, 2022 · 0 comments
Open

Add intersection parameter to /lineage-mutations #60

flaneuse opened this issue Dec 2, 2022 · 0 comments
Labels

Comments

@flaneuse
Copy link
Contributor

flaneuse commented Dec 2, 2022

Current behavior:

https://api.outbreak.info/genomics/lineage-mutations?pangolin_lineage=B.1,B.3&frequency=0.9 performs multiple queries, to return any mutations within B.1 with a prevalence >= 0.9, and then any mutations within B.3 with a prevalence >= 0.9:

(irrelevant fields not shown for clarity)

{
'B.1': 
[{'mutation': 'orf8:s84l',
   'lineage': 'B.1',
   'prevalence': 0.9953091104120138,
   ... },
  {'mutation': 's:d614g',
   'lineage': 'B.1',
   'prevalence': 0.9929476557559457,
   ...},
  {'mutation': 'orf1b:p314l',
   'lineage': 'B.1',
   'prevalence': 0.9799956773372397,
   ...}],

 'B.3':
 [{'mutation': 'orf8:s84l',
   'lineage': 'B.3',
   'prevalence': 1.0,
   ...},
  {'mutation': 'orf1a:g392d',
   'lineage': 'B.3',
   'prevalence': 0.9836488812392427,
   ...}]
}

Desired behavior:

  • intersection=false should be the default behavior, and should be the current behavior, as shown above.
  • With the parameter intersection=true, the prevalence of all mutations which are prevalent at >= frequency should be calculated.
  • For instance, https://api.outbreak.info/genomics/lineage-mutations?pangolin_lineage=B.1,B.3&frequency=0.9&intersection=true, this should also include:
    • The prevalence of s:d614g in B.3 (0.0008605851979345956)
    • The prevalence of orf1b:p314l in B.3 (0.0008605851979345956)
    • The prevalence of orf1a:g392d in B.1 (0.00007206110781943087)
  • Structure of the returned object should be the same, just with an extra object in 'B.1 and two extra objects in 'B.3'
@flaneuse flaneuse added the guru label Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant