Exercise 14 of 17

Mutation profile distance

Fixed training server

Count the sequences whose S gene is within 2 amino acid differences of a profile that has Y at position 501 and R at position 452.

The output should have this shape:

count
-----
1234

Write a query and run it. The result is compared with the reference answer without considering row order.

Loading query editor…
Explanation

Filter the table with aminoAcidMutationProfile to keep S sequences within two differences of the specified symbols at positions 501 and 452. Then, use group with the empty set of grouping columns to count the remaining rows.

Reference answer
data
  .filter(aminoAcidMutationProfile(distance:=2, sequenceName:='S', mutations:={
    {position:=501, symbol:='Y'},
    {position:=452, symbol:='R'}
  }))
  .group(by:={}, aggs:={count:=count()})