rki-mf1 / covsonar

A database-driven system for handling genomic sequences of SARS-CoV-2 and screening genomic profiles.
GNU General Public License v3.0
6 stars 0 forks source link

Exact match for ANY character in match condtion. #26

Closed silenus092 closed 2 years ago

silenus092 commented 2 years ago

In GitLab by @kunaphas.kon on Mar 11, 2022, 23:14

Paul:

sonar.py match --db rki.db -i S:A222X --debug

query: SELECT * FROM essence WHERE aa_profile LIKE '% S:A222R %' OR aa_profile LIKE '% S:A222Φ %' OR aa_profile LIKE '% S:A222E %' OR aa_profile LIKE '% S:A222H %' OR aa_profile LIKE '% S:A222M %' OR aa_profile LIKE '% S:A222N %' OR aa_profile LIKE '% S:A222+ %' OR aa_profile LIKE '% S:A222T %' OR aa_profile LIKE '% S:A222O %' OR aa_profile LIKE '% S:A222ζ %' OR aa_profile LIKE '% S:A222A %' OR aa_profile LIKE '% S:A222W %' OR aa_profile LIKE '% S:A222V %' OR aa_profile LIKE '% S:A222C %' OR aa_profile LIKE '% S:A222K %' OR aa_profile LIKE '% S:A222F %' OR aa_profile LIKE '% S:A222Q %' OR aa_profile LIKE '% S:A222I %' OR aa_profile LIKE '% S:A222Ψ %' OR aa_profile LIKE '% S:A222S %' OR aa_profile LIKE '% S:A222Z %' OR aa_profile LIKE '% S:A222J %' OR aa_profile LIKE '% S:A222P %' OR aa_profile LIKE '% S:A222π %' OR aa_profile LIKE '% S:A222D %' OR aa_profile LIKE '% S:A222Y %' OR aa_profile LIKE '% S:A222L %' OR aa_profile LIKE '% S:A222G %' OR aa_profile LIKE '% S:A222X %' OR aa_profile LIKE '% S:A222Ω %' OR aa_profile LIKE '% S:A222B %' OR aa_profile LIKE '% S:A222U %' OR aa_profile LIKE '% S:A222- %';

So if I search for the unknown amino acid, every single amino acid shows up in the query. What should I do when I want to search for the samples which have exactly 'S:A222X' in their aa_profile, like IMSSC2-91-2021-00130?

I think currently alternative workaround, we can use sonar.py match --db rki.db --include S:A222X --exclude S:A222R S:A222Φ S:A222E S:A222H S:A222M S:A222N S:A222+ S:A222T S:A222O S:A222ζ S:A222A S:A222W S:A222V S:A222C S:A222K S:A222F S:A222Q S:A222I S:A222Ψ S:A222S S:A222Z S:A222J S:A222P S:A222π S:A222D S:A222Y S:A222L S:A222G S:A222Ω S:A222B S:A222U S:A222-

However, it could be nice if we have the option tag (e.g. --exact or --force) to search for an exact match for the 'X' condition like Paul said.

not only support for AA but also NT.

silenus092 commented 2 years ago

This feature was added in covSonar V.2 solved in #68