tripal / tripal_analysis_expression

Extension module for the Tripal toolset to show differential expression data. This module was made for Drupal 7, Tripal 3, and Chado 1.3.
GNU General Public License v2.0
4 stars 11 forks source link

local__expression_details field assumes feature_cvtermprop value is an integer #426

Closed dsenalik closed 2 years ago

dsenalik commented 2 years ago

local__expression_details.inc lines 128-129

  JOIN {feature_cvtermprop} p3 ON p3.feature_cvterm_id=fcvt.feature_cvterm_id AND p3.type_id=cv2.cvterm_id
  JOIN {analysis} a ON a.analysis_id=p3.value::INTEGER

value column in the feature_cvtermprop table is not always 'castable' to an integer

Sample error:

PDOException: SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for type integer: "related to": SELECT cv1.name as cvterm_name, cv1.cvterm_id as cvterm_id, p1.value as expression_relationship, p2.value as p_value, a.name as analysis_name, a.analysis_id as analysis_id FROM chado.feature_cvterm fcvt JOIN chado.cvterm cv1 ON cv1.cvterm_id=fcvt.cvterm_id JOIN chado.cvterm cv2 ON cv2.name='analysis' JOIN chado.feature_cvtermprop p1 ON p1.feature_cvterm_id=fcvt.feature_cvterm_id AND p1.type_id=:evidence_id JOIN chado.feature_cvtermprop p2 ON p2.feature_cvterm_id=fcvt.feature_cvterm_id AND p2.type_id=:pvalue_id JOIN chado.feature_cvtermprop p3 ON p3.feature_cvterm_id=fcvt.feature_cvterm_id AND p3.type_id=cv2.cvterm_id JOIN chado.analysis a ON a.analysis_id=p3.value::INTEGER WHERE fcvt.feature_id = :feature_id; Array ( [:feature_id] => 13603 [:evidence_id] => 57707 [:pvalue_id] => 58152 ) in chado_query() (line 1783 of .../sites/all/modules/tripal/tripal_chado/api/tripal_chado.query.api.inc).

spficklin commented 2 years ago

Issue resolved with PR. Thanks @dsenalik !