Hi all,
I updated my cvs and when I launch apollo, I got the following SQL error:
ERROR: SQLException running
SELECT leafFeat.uniquename, leafFeatLoc.fmin AS query_fmin,
leafFeatLoc.fmax AS query_fmax, leafFeatLoc.strand AS query_strand,
tgtFeat.feature_id AS target_id, tgtFeat.uniquename AS targetName,
tgtFeat.organism_id AS tgtOrganismId, tgtFeatLoc.fmin AS target_fmin,
tgtFeatLoc.fmax AS target_fmax, tgtFeatLoc.strand AS target_strand,
a.analysis_id, a.program, a.sourcename, a.programversion, af.rawscore,
af.normscore, af.significance, af.identity, leafFeatLoc.residue_info AS
query_residue_info, (SELECT value FROM featureprop WHERE type_id=30128
and feature_id=tgtFeat.feature_id and rank=0) as
tgtDescription,leafFeat.type_id as featureTypeId,
length(tgtFeat.residues) as tgtSeqLength,tgtFeatLoc.residue_info AS
target_residue_info , leafToParent.object_id AS parent_id
FROM featureloc leafFeatLoc, feature leafFeat, analysisfeature af,
analysis a, featureloc tgtFeatLoc, feature tgtFeat
WHERE leafFeatLoc.srcfeature_id = 15670 AND leafFeatLoc.feature_id =
leafFeat.feature_id AND leafFeatLoc.feature_id = af.feature_id AND
af.analysis_id = a.analysis_id AND leafFeat.feature_id =
tgtFeatLoc.feature_id AND tgtFeatLoc.srcfeature_id != 15670 AND
tgtFeatLoc.srcfeature_id = tgtFeat.feature_id AND (a.program like
'%sim4%' OR a.program like '%blastx%') AND leafFeatLoc.fmax BETWEEN 0
AND 30000 AND leafFeatLoc.fmin BETWEEN 0 AND 30000 AND leafFeatLoc.fmin
< 10000 AND leafFeatLoc.fmax > 0
ORDER BY a.program, a.programversion, a.sourcename, tgtFeat.organism_id
, tgtFeat.uniquename , leafFeatLoc.strand , leafToParent.object_id
org.postgresql.util.PSQLException: ERROR: missing FROM-clause entry for
table "leaftoparent"
I fixed this bug by editing the last JdbcChadoAdapter (Revision: 1.205 $
$Date: 2009/02/24 16:58:44).
I created 2 variables (selectToFeatLocParent and orderToFeatLocParent ),
that are initialized only if the condition
'(getChadoInstance().searchHitsHaveFeatLocs())' is true and add this
variables in the sql statement
The patch to fix this issue is provided here :
2012a2013,2014
> String selectToFeatLocParent = "";
> String orderToFeatLocParent = "";
2029a2032,2033
> selectToFeatLocParent = ", leafToParent.object_id AS parent_id";
> orderToFeatLocParent = ", leafToParent.object_id";
2058,2059c2062,2063
< (joinWithFeatureProp ? ", fp." + pvalCol + " AS feature_prop " : "") +
", " +
< "leafToParent.object_id AS parent_id" +
---
> (joinWithFeatureProp ? ", fp." + pvalCol + " AS feature_prop " : "") +
> selectToFeatLocParent + // "" if no parent feat locs
2088,2089c2092,2093
< + ", leafFeatLoc.strand "
< + ", leafToParent.object_id";
---
> + ", leafFeatLoc.strand " +
> orderToFeatLocParent;
2098a2103
> long parentId = 0;
2131c2136,2137
< long parentId = rs.getLong("parent_id");
---
> if (getChadoInstance().searchHitsHaveFeatLocs())
> parentId = rs.getLong("parent_id");
But now, I wonder why this condition is false because when I have edited
manually this query, I have some results.
Any idea?
Thanks in advance
Cheers
Gaetan
--
Gaëtan Droc
CIRAD-BIOS
UMR Développement et Amélioration des Plantes
Equipe "Intégration des données"
Avenue Agropolis - TA A 96/03 (B‚t. 3, Bur. 14)
34398 Montpellier CEDEX 5, France
Tel : +33 4 67 61 58 00 ext. 54 45
Fax : +33 4 67 61 56 05
_______________________________________________
apollo mailing list
[email protected]
http://mail.fruitfly.org/mailman/listinfo/apollo