LAPIS icon indicating copy to clipboard operation
LAPIS copied to clipboard

Is it intended that `,` in advanced queries behaves differently from `&`?

Open corneliusroemer opened this issue 1 year ago • 2 comments

Not thinking much, I used an advanced query G2782T , T111C.

Looking at the nucleotide mutations within things matched by that query, I noticed that T111C is only present in 20%.

So it seems that the notation G2782T , T111C means maybe(G2782T) AND maybe(T111C) whereas G2782T & T111C means G2782T AND T111C. Is that right? And is it intended?

https://cov-spectrum.org/explore/World/AllSamples/Past6M/variants?variantQuery=G2782T+%26+T111C&

https://cov-spectrum.org/explore/World/AllSamples/Past6M/variants?variantQuery=G2782T+%2C+T111C&

Brave Browser 2024-05-16 12 39 06 Brave Browser 2024-05-16 12 39 02

corneliusroemer avatar May 16 '24 10:05 corneliusroemer

Oh, that sounds like a bug! I wasn't aware that we , is allowed and don't know what it is doing.

chaoran-chen avatar May 16 '24 11:05 chaoran-chen

Looks like a bug in LAPIS 2. When switching to "Open", which still runs on LAPIS 1, you get a "malformed variant query": grafik

fengelniederhammer avatar May 16 '24 11:05 fengelniederhammer

@chaoran-chen Should we actually allow or forbid sending multiple variant queries in a single request?

  • Forbidding it would yield quite specific error messages
  • Multiple values would be treated as "and" (as for any other sequence filter). Allowing it would implicitly make , on CoV Spectrum be interpreted as &, since comma separated values in query strings are decoded as arrays.

fengelniederhammer avatar May 22 '24 09:05 fengelniederhammer

As discussed: If the variantQuery is set, we expect exactly one value.

Providing multiple values for other filters mean "or", which would be weird for variant queries.

fengelniederhammer avatar May 23 '24 11:05 fengelniederhammer