Exercise 13 of 17

Amino acid mutations grouped by target

Fixed training server

Among sequences from Switzerland, take the amino acid mutations on the S gene that occur in at least 10% of sequences, then count how many of those mutations lead to each resulting symbol (mutationTo). Most frequent first.

The output should have this shape:

mutationTo | count
---------- | -----
Y          | 12
G          | 8

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 to sequences from Switzerland. Use aminoAcidMutations to get changes on the S protein with a minimum proportion of 10%, then use groupBy to count the mutation rows for each resulting symbol. Order the rows by their counts.

Reference answer
default
  .filter(country = 'Switzerland')
  .aminoAcidMutations(minProportion:=0.1, sequenceNames:={S})
  .groupBy({count:=count()}, {mutationTo})
  .orderBy({count.desc()})