UofS-Pulse-Binfo / nd_genotypes

Drupal/Tripal: Tripal interface for Chado Natural Diversity Genotypic data.
https://nd-genotypes.readthedocs.io/en/latest/index.html
GNU General Public License v2.0
4 stars 1 forks source link

error when filtering by Polymorphic Variants between two stocks #32

Closed songtaogui closed 4 years ago

songtaogui commented 5 years ago

Hi, @laceysanderson

I have tried to browse the genotypes using ND_genotypes.

The chose and add stocks and filter by Genome Range function works fine, but the Polymorphic Variants between A and B and Step3 Filter: VariantNames VariantType ... encountered errors on my site:

Polymorphic Variants between A and B:

PDOException: SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "mview_ndg_zea_calls" does not exist LINE 1: ...all=b.allele_call as monomorphic FROM mviewndg... ^: SELECT v.*, cf.entity_id FROM chado.mview_ndg_zea_variants v LEFT JOIN public.chado_bio_data_18 cf ON cf.record_id=v.variant_id LEFT JOIN ( SELECT a.variant_id, a.allele_call=b.allele_call as monomorphic FROM mview_ndg_zea_calls a, mview_ndg_zea_calls b WHERE a.variant_id=b.variant_id AND a.germplasm_id=:poly1 AND b.germplasm_id=:poly2 ) p ON p.variant_id=v.variant_id WHERE ROW(v.srcfeature_name, v.fmin) BETWEEN ROW(:sbackbone, :sfmin) AND ROW(:ebackbone,:efmin) AND p.monomorphic IS FALSE AND EXISTS ( SELECT true FROM chado.mview_ndg_zea_calls call WHERE germplasm_id IN (:germplasm_ids_0, :germplasm_ids_1, :germplasm_ids_2, :germplasm_ids_3) AND call.variant_id=v.variant_id ) ORDER BY srcfeature_name ASC, fmin ASC LIMIT 100; Array ( [:sbackbone] => 1 [:sfmin] => 9999 [:ebackbone] => 1 [:efmin] => 19999 [:poly1] => 3 [:poly2] => 5 [:germplasm_ids_0] => 3 [:germplasm_ids_1] => 5 [:germplasm_ids_2] => 9 [:germplasm_ids_3] => 705 ) in chado_query() (line 1715 of /var/www/html/drupal-7.64/sites/all/modules/tripal/tripal_chado/api/tripal_chado.query.api.inc).

Step3 Filter by VariantNames:

PDOException: SQLSTATE[42883]: Undefined function: 7 ERROR: operator does not exist: json = unknown LINE 4: WHERE (l.list = '["chr1.s_16124"]') ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.: SELECT l.list_id AS list_id FROM {ndg_matrix_variant_user_lists} l WHERE (l.list = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => ["chr1.s_16124"] ) in nd_genotypes_matrix_filter_form_submit() (line 320 of /var/www/html/drupal-

Do you have any suggestions?

And the stats of the result genotype table information were always counting even if there are only few records: image

Thank you,

Best wishes,

Songtao Gui

laceysanderson commented 4 years ago

Hi @songtaogui, I'm finally able to reproduce your errors. I've tried multiple times since you filed this issue and it turns out the errors are only reproducible when a specific combination of filter criteria are used. I'm working on a fix right now -thank you for your report!

laceysanderson commented 4 years ago

Fixed in the linked PR! I also added automated testing to catch all the filter criteria combinations.