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

Error Populating the expression_feature MView #401

Open spficklin opened 2 years ago

spficklin commented 2 years ago

When populating the expression_feature MView I get the following error message:

WD tripal_mviews: PDOException: SQLSTATE[22001]: String data, right truncated: 7 ERROR:  value too long for type [error]
character varying(255): INSERT INTO chado.expression_feature (SELECT DISTINCT(F.feature_id) AS feature_id,  
O.organism_id AS organism_id,   F.uniquename AS feature_uniquename,   O.common_name AS organism_common_name,   ( 
   SELECT string_agg(DXR.accession, ',') AS accession FROM feature_cvterm FC       INNER JOIN cvterm CVT ON
CVT.cvterm_id = FC.cvterm_id       INNER JOIN dbxref DXR ON DXR.dbxref_id = CVT.dbxref_id       WHERE
F.feature_id = FC.feature_id   ) AS accession   FROM feature F   INNER JOIN organism O ON F.organism_id =
O.organism_id   INNER JOIN element E ON E.feature_id = F.feature_id   INNER JOIN elementresult ER ON
ER.element_id = E.element_id   INNER JOIN quantification Q ON Q.quantification_id = ER.quantification_id   INNER
JOIN acquisition AC ON AC.acquisition_id = Q.acquisition_id   INNER JOIN assay A ON A.assay_id = AC.assay_id  
INNER JOIN assay_biomaterial AB ON AB.assay_id = A.assay_id   INNER JOIN biomaterial B ON B.biomaterial_id =
AB.biomaterial_id); Array
(
)

The problem is this part of the SQL that populates the table:

  (
    SELECT string_agg(DXR.accession, ',') AS accession FROM feature_cvterm FC
      INNER JOIN cvterm CVT ON CVT.cvterm_id = FC.cvterm_id
      INNER JOIN dbxref DXR ON DXR.dbxref_id = CVT.dbxref_id
      WHERE F.feature_id = FC.feature_id
  ) AS accession

It's combining all of accession for the feature CVterms into a single list that can't exceed 225 characters. This should really be a textfield. Some of my features have a lot of annotations and this exceeds the limit.