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

Fix and Add features - [merged] #41

Closed silenus092 closed 2 years ago

silenus092 commented 2 years ago

In GitLab by @kunaphas.kon on Nov 17, 2021, 13:19

Merges dev/features -> dev/v.1

1

this commit try to fix query order, and this commit might solve the #16 issue


I use --debug along with the command to see the query

query: SELECT COUNT(*) as count FROM essence WHERE aa_profile LIKE '% S:E484K %' AND (aa_profile LIKE '% S:E484K %' OR aa_profile LIKE '% S:N501Y %');
9027

query: SELECT COUNT(*) as count FROM essence WHERE aa_profile LIKE '% S:N501Y %' AND (aa_profile LIKE '% S:N501Y %' OR aa_profile LIKE '% S:E484K %');
151652

I saw we have two statements at where cause condition.

WHERE **aa_profile LIKE '% S:E484K %'** AND **(aa_profile LIKE '% S:E484K %' OR aa_profile LIKE '% S:N501Y %')**;

I think this is the cause that put the whole query return the wrong result. I think it should be only one

WHERE **aa_profile LIKE '% S:E484K %' OR aa_profile LIKE '% S:N501Y %'**;

After I edit the code at the include_profiles and exclude_profiles part , the number is now matched without concerning the order.


2

I also add a wildcard query to support #17. I use "%" percent sign to the query and you can use it on both including and excluding statement for example

./sonar.py  match  --db ../workdir_covsonar/mycacheV1/rki.db   --lineage ^B.1.1% %AY.4%   --debug --count

this will list all

['AY.4', 'AY.4.1', 'AY.4.2', 'AY.4.3', 'AY.4.4', 'AY.4.5', 'AY.40', 'AY.41', 'AY.42', 'AY.43', 'AY.44', 'AY.45', 'AY.46', 'AY.46.1', 'AY.46.2', 'AY.46.3', 'AY.46.4', 'AY.46.5', 'AY.46.6', 'AY.47', 'B.1.1', 'B.1.1.1', 'B.1.1.10', 'B.1.1.121', 'B.1.1.122', 'B.1.1.129', 'B.1.1.13', 'B.1.1.134', 'B.1.1.138', 'B.1.1.141', 'B.1.1.144', 'B.1.1.148', 'B.1.1.152', 'B.1.1.153', 'B.1.1.158', 'B.1.1.159', 'B.1.1.161', 'B.1.1.163', 'B.1.1.170', 'B.1.1.171', 'B.1.1.189', 'B.1.1.192', 'B.1.1.194', 'B.1.1.198', 'B.1.1.200', 'B.1.1.204', 'B.1.1.207', 'B.1.1.210', 'B.1.1.218', 'B.1.1.219', 'B.1.1.220', 'B.1.1.222', 'B.1.1.224', 'B.1.1.232', 'B.1.1.234', 'B.1.1.236', 'B.1.1.240', 'B.1.1.241', 'B.1.1.243', 'B.1.1.25', 'B.1.1.254', 'B.1.1.269', 'B.1.1.277', 'B.1.1.28', 'B.1.1.280', 'B.1.1.282', 'B.1.1.286', 'B.1.1.291', 'B.1.1.294', 'B.1.1.297', 'B.1.1.298', 'B.1.1.301', 'B.1.1.305', 'B.1.1.306', 'B.1.1.312', 'B.1.1.315', 'B.1.1.317', 'B.1.1.318', 'B.1.1.319', 'B.1.1.325', 'B.1.1.326', 'B.1.1.33', 'B.1.1.338', 'B.1.1.347', 'B.1.1.348', 'B.1.1.351', 'B.1.1.353', 'B.1.1.354', 'B.1.1.355', 'B.1.1.368', 'B.1.1.37', 'B.1.1.370', 'B.1.1.372', 'B.1.1.374', 'B.1.1.375', 'B.1.1.384', 'B.1.1.385', 'B.1.1.39', 'B.1.1.397', 'B.1.1.398', 'B.1.1.404', 'B.1.1.405', 'B.1.1.406', 'B.1.1.407', 'B.1.1.409', 'B.1.1.41', 'B.1.1.413', 'B.1.1.416', 'B.1.1.419', 'B.1.1.420', 'B.1.1.428', 'B.1.1.432', 'B.1.1.433', 'B.1.1.437', 'B.1.1.44', 'B.1.1.442', 'B.1.1.449', 'B.1.1.453', 'B.1.1.458', 'B.1.1.463', 'B.1.1.464', 'B.1.1.47', 'B.1.1.486', 'B.1.1.50', 'B.1.1.506', 'B.1.1.519', 'B.1.1.521', 'B.1.1.523', 'B.1.1.524', 'B.1.1.525', 'B.1.1.58', 'B.1.1.7', 'B.1.1.70', 'B.1.1.74', 'B.1.1.83', 'B.1.1.89', 'B.1.1.98', 'B.1.1.99', 'B.1.111', 'B.1.131', 'B.1.146', 'B.1.160', 'B.1.160.11', 'B.1.160.13', 'B.1.160.14', 'B.1.160.15', 'B.1.160.16', 'B.1.160.22', 'B.1.160.25', 'B.1.160.26', 'B.1.160.28', 'B.1.160.30', 'B.1.160.31', 'B.1.160.32', 'B.1.160.33', 'B.1.160.8', 'B.1.164', 'B.1.165', 'B.1.177', 'B.1.177.15', 'B.1.177.16', 'B.1.177.17', 'B.1.177.19', 'B.1.177.20', 'B.1.177.21', 'B.1.177.23', 'B.1.177.31', 'B.1.177.32', 'B.1.177.33', 'B.1.177.34', 'B.1.177.35', 'B.1.177.37', 'B.1.177.38', 'B.1.177.39', 'B.1.177.4', 'B.1.177.40', 'B.1.177.43', 'B.1.177.44', 'B.1.177.45', 'B.1.177.46', 'B.1.177.5', 'B.1.177.50', 'B.1.177.51', 'B.1.177.52', 'B.1.177.53', 'B.1.177.55', 'B.1.177.59', 'B.1.177.6', 'B.1.177.60', 'B.1.177.62', 'B.1.177.63', 'B.1.177.65', 'B.1.177.69', 'B.1.177.7', 'B.1.177.72', 'B.1.177.73', 'B.1.177.75', 'B.1.177.77', 'B.1.177.78', 'B.1.177.79', 'B.1.177.81', 'B.1.177.82', 'B.1.177.83', 'B.1.177.86', 'B.1.177.87', 'B.1.177.9', 'B.1.179', 'B.1.187']
84344
silenus092 commented 2 years ago

In GitLab by @kunaphas.kon on Nov 17, 2021, 13:19

requested review from @s.fuchs

silenus092 commented 2 years ago

In GitLab by @kunaphas.kon on Nov 17, 2021, 18:07

added 2 commits

Compare with previous version

silenus092 commented 2 years ago

In GitLab by @kunaphas.kon on Nov 17, 2021, 21:13

added 1 commit

Compare with previous version

silenus092 commented 2 years ago

In GitLab by @s.fuchs on Nov 18, 2021, 11:26

mentioned in commit d71f4c420bdec6c8d09411a53bdde04bd097bdd3