outbreak-info / R-outbreak-info

R package to access the genomics and epidemiology data and Research Library metadata compiled and standardized on outbreak.info.
https://outbreak-info.github.io/R-outbreak-info/
MIT License
19 stars 10 forks source link

Genomics API: getPrevalence() does not accept deletions #81

Open EmilyHaag opened 2 years ago

EmilyHaag commented 2 years ago

Submitted by user: I noticed a pretty significant limitation in the getPrevalence() function: the function does not accept deletions. This is the error message I’ve seen (using a deletion found in omicron, which is also the example from the outbreak.info site which shows how to format deletion mutation names):

In getGenomicData(query_url = "prevalence-by-location", pangolin_lineage = pangolin_lineage, : Mutations should be specified in the format gene:mutation, like "S:E484K". The following mutations are not in the specified format: S:DEL69/70

TKMarkCheng commented 1 year ago

Recent use of the getPrevalence function shows that searching S:DEL69/70 is possible, ONLY IF an accompanying lineage is searched for as well, this issue is recently raised in #104 .

Interestingly the mutation is presented differently in the getMutationDetails() Function:

> getMutationDetails(mutations=c("S:DEL69/70"))
Retrieving data... 
    mutation is_synonymous codon_num ref_codon absolute_coords gene   pos is_frameshift deletion_codon_coords     type
1 S:DEL69/70         False        68    CATGTC     21765:21770    S 21765         False        S:DEL68.2/70.1 deletion
Warning message:
In getGenomicData(query_url = "mutation-details", mutations = mutations) :
  Mutations should be specified in the format gene:mutation, like "S:E484K". The following mutations are not in the specified format: S:DEL69/70

This shows that it is able to recognise the DEL69/70 mutation, but perhaps the warning message should be changed.