another imbedding bug, I think

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

another imbedding bug, I think

Benjamin Hitz-2
For Alex -
This one is rather minor although quite puzzling.  The bug is in getConstraints()  found from using IMBedding.makeQueryXML

if I have:
        constraints: [
            { path: "Gene.goAnnotation.qualifier", op: "IS NULL", code: "A"},
            { path: "Gene.goAnnotation.qualifier", op: "!=", value: "NOT", code: "B"},
            { path: "Gene.goAnnotation.ontologyTerm.parents", type:"GOSlimTerm"},
            { path: "Gene.secondaryIdentifier", op: "ONE OF", values: genes, code: "C"}
        ]

It works fine...
e.g.:
<query model="genomic" view="Gene.secondaryIdentifier Gene.goAnnotation.qualifier Gene.goAnnotation.ontologyTerm.parents.identifier Gene.goAnnotation.ontologyTerm.parents.name Gene.goAnnotation.ontologyTerm.parents.namespace Gene.goAnnotation.qualifier" constraintLogic="C and (A or B)" ><constraint path="Gene.goAnnotation.qualifier" op="IS NULL" code="A" /><constraint path="Gene.goAnnotation.qualifier" op="!=" value="NOT" code="B" /><constraint path="Gene.goAnnotation.ontologyTerm.parents" type="GOSlimTerm" /><constraint path="Gene.secondaryIdentifier" op="ONE OF" code="C" ><value>YML125C</value><value>YOL065C</value><value>YMR029C</value><value>YML048W</value><value>YML067C</value><value>YDR518W</value><value>YCR034W</value><value>YHR176W</value><value>YMR299C</value>><value>YBL021C</value><value>YBR024W</value><value>YBR082C</value><value>YCL045C</value><value>YNL008C</value><value>YOR037W</value><value>YOR191W</value><value>YOR039W</value><value>YOR123C</value><value>YNL159C</value><value>YHR107C</value><value>YHR007C</value><value>YNL136W</value></constraint></query>

But the LAST constraint, "ONE OF"... values:  seems to have to be the last entry in the constraints array, no further constraints were added!

        constraints: [
            { path: "Gene.goAnnotation.qualifier", op: "IS NULL", code: "A"},
            { path: "Gene.secondaryIdentifier", op: "ONE OF", values: genes, code: "C"},
            { path: "Gene.goAnnotation.qualifier", op: "!=", value: "NOT", code: "B"},
            { path: "Gene.goAnnotation.ontologyTerm.parents", type:"GOSlimTerm"}
        ]

Gives a query XML with only 2 constraints, not 4!

<query model="genomic" view="Gene.secondaryIdentifier Gene.goAnnotation.qualifier Gene.goAnnotation.ontologyTerm.parents.identifier Gene.goAnnotation.ontologyTerm.parents.name Gene.goAnnotation.ontologyTerm.parents.namespace Gene.goAnnotation.qualifier" constraintLogic="C and (A or B)" ><constraint path="Gene.goAnnotation.qualifier" op="IS NULL" code="A" /><constraint path="Gene.secondaryIdentifier" op="ONE OF" code="C" ><value>YLR273C</value><value>YGR188C</value><value>YML103C</value><value>YOR141C</value><value>YPL180W</value><value>YKL001C</value><value>YCL005W-A</value><value>YBR092C</value><value>YDL215C</value><value>YLR248W</value><value>YIL095W</value><value>YHL007C</value><value>YOR393W</value><value>YNL025C</value><value>YGL122C</value><value>YDL017W</value><value>YDR217C</value><value>YNR034W</value><value>YAR014C</value><value>YKL093W</value><value>YOR178C</value><value>YLR258W</value></constraint></query>

(These aren't exactly the same query, but close enough).

Also, I was having trouble chaining ajax calls, so I had drop down to $.ajax instead of loadQuery helper method.  For very large URLs you have to use POST as well.  Perhaps (and there is no hurry on this) there is a way to pass other options through to $.ajax or $.getJSON.... like type: "POST" or "failure: function()" or "complete: function".  Since you added IMBedding.makeQueryXML() I am happy to use the lower level functions.

Ben
--
Ben Hitz
Senior Scientific Programmer ** Saccharomyces Genome Database ** GO Consortium
Stanford University ** [hidden email]




_______________________________________________
dev mailing list
[hidden email]
http://mail.intermine.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: another imbedding bug, I think

Alex Kalderimis
A fix has been made but not released for other, unrelated technical issues.

For the interested, the problem is the fact that javascript does not have block scope, only global and function scope. This lead me to clobber one iteration variable with another, resulting in the bug you experienced. This has been resolved, and I will endeavour to ensure no further scope issues arise.

Alex.

-----
sent from my phone - please excuse any brevity

----- Reply message -----
From: "Benjamin Hitz" <[hidden email]>
To: "dev" <[hidden email]>
Subject: [InterMine Dev] another imbedding bug, I think
Date: Tue, Jun 21, 2011 21:30


For Alex -
This one is rather minor although quite puzzling.  The bug is in getConstraints()  found from using IMBedding.makeQueryXML

if I have:
constraints: [
   { path: "Gene.goAnnotation.qualifier", op: "IS NULL", code: "A"},
   { path: "Gene.goAnnotation.qualifier", op: "!=", value: "NOT", code: "B"},
   { path: "Gene.goAnnotation.ontologyTerm.parents", type:"GOSlimTerm"},
   { path: "Gene.secondaryIdentifier", op: "ONE OF", values: genes, code: "C"}
]

It works fine...
e.g.:
<query model="genomic" view="Gene.secondaryIdentifier Gene.goAnnotation.qualifier Gene.goAnnotation.ontologyTerm.parents.identifier Gene.goAnnotation.ontologyTerm.parents.name Gene.goAnnotation.ontologyTerm.parents.namespace Gene.goAnnotation.qualifier" constraintLogic="C and (A or B)" ><constraint path="Gene.goAnnotation.qualifier" op="IS NULL" code="A" /><constraint path="Gene.goAnnotation.qualifier" op="!=" value="NOT" code="B" /><constraint path="Gene.goAnnotation.ontologyTerm.parents" type="GOSlimTerm" /><constraint path="Gene.secondaryIdentifier" op="ONE OF" code="C" ><value>YML125C</value><value>YOL065C</value><value>YMR029C</value><value>YML048W</value><value>YML067C</value><value>YDR518W</value><value>YCR034W</value><value>YHR176W</value><value>YMR299C</value>><value>YBL021C</value><value>YBR024W</value><value>YBR082C</value><value>YCL045C</value><value>YNL008C</value><value>YOR037W</value><value>YOR191W</value><value>YOR039W</value><value>YOR123C</value><value>YNL159C</value><value>YHR107C</value><value>YHR007C</value><value>YNL136W</value></constraint></query>

But the LAST constraint, "ONE OF"... values:  seems to have to be the last entry in the constraints array, no further constraints were added!

constraints: [
   { path: "Gene.goAnnotation.qualifier", op: "IS NULL", code: "A"},
   { path: "Gene.secondaryIdentifier", op: "ONE OF", values: genes, code: "C"},
   { path: "Gene.goAnnotation.qualifier", op: "!=", value: "NOT", code: "B"},
   { path: "Gene.goAnnotation.ontologyTerm.parents", type:"GOSlimTerm"}
]

Gives a query XML with only 2 constraints, not 4!

<query model="genomic" view="Gene.secondaryIdentifier Gene.goAnnotation.qualifier Gene.goAnnotation.ontologyTerm.parents.identifier Gene.goAnnotation.ontologyTerm.parents.name Gene.goAnnotation.ontologyTerm.parents.namespace Gene.goAnnotation.qualifier" constraintLogic="C and (A or B)" ><constraint path="Gene.goAnnotation.qualifier" op="IS NULL" code="A" /><constraint path="Gene.secondaryIdentifier" op="ONE OF" code="C" ><value>YLR273C</value><value>YGR188C</value><value>YML103C</value><value>YOR141C</value><value>YPL180W</value><value>YKL001C</value><value>YCL005W-A</value><value>YBR092C</value><value>YDL215C</value><value>YLR248W</value><value>YIL095W</value><value>YHL007C</value><value>YOR393W</value><value>YNL025C</value><value>YGL122C</value><value>YDL017W</value><value>YDR217C</value><value>YNR034W</value><value>YAR014C</value><value>YKL093W</value><value>YOR178C</value><value>YLR258W</value></constraint></query>

(These aren't exactly the same query, but close enough).

Also, I was having trouble chaining ajax calls, so I had drop down to $.ajax instead of loadQuery helper method.  For very large URLs you have to use POST as well.  Perhaps (and there is no hurry on this) there is a way to pass other options through to $.ajax or $.getJSON.... like type: "POST" or "failure: function()" or "complete: function".  Since you added IMBedding.makeQueryXML() I am happy to use the lower level functions.

Ben
--
Ben Hitz
Senior Scientific Programmer ** Saccharomyces Genome Database ** GO Consortium
Stanford University ** [hidden email]




_______________________________________________
dev mailing list
[hidden email]
http://mail.intermine.org/cgi-bin/mailman/listinfo/dev

_______________________________________________
dev mailing list
[hidden email]
http://mail.intermine.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: another imbedding bug, I think

Benjamin Hitz-2
Ha, I think I spent a couple hours today and yesterday on similar scope issues.

On Jun 21, 2011, at 3:16 PM, Alex Kalderimis wrote:

> For the interested, the problem is the fact that javascript does not have block scope, only global and function scope. This lead me to clobber one iteration variable with another, resulting in the bug you experienced. This has been resolved, and I will endeavour to ensure no further scope issues arise.

--
Ben Hitz
Senior Scientific Programmer ** Saccharomyces Genome Database ** GO Consortium
Stanford University ** [hidden email]




_______________________________________________
dev mailing list
[hidden email]
http://mail.intermine.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: another imbedding bug, I think

Alex Kalderimis-2
In reply to this post by Benjamin Hitz-2
On Tue, Jun 21, 2011 at 01:30:44PM -0700, Benjamin Hitz wrote:
>
> Also, I was having trouble chaining ajax calls, so I had drop down to $.ajax instead of loadQuery helper method.  For very large URLs you have to use POST as well.  Perhaps (and there is no hurry on this) there is a way to pass other options through to $.ajax or $.getJSON.... like type: "POST" or "failure: function()" or "complete: function".  Since you added IMBedding.makeQueryXML() I am happy to use the lower level functions.
>

Having POST makes sense, as long as people are in your situation of working
on the same host, and can of course be provided. When list functions
are available, that should also help reduce the size of the queries to
keep within the GET character limit by first creating lists and then
using those in queries.

Please feel free to pass on more details of what you are trying to do
with the chained calls - it may just be a case of explicitly loading
all the libraries instead of getting IMBedding to do it for you.

Alex

> Ben
> --
> Ben Hitz
> Senior Scientific Programmer ** Saccharomyces Genome Database ** GO Consortium
> Stanford University ** [hidden email]
>
>
>
>
> _______________________________________________
> dev mailing list
> [hidden email]
> http://mail.intermine.org/cgi-bin/mailman/listinfo/dev

_______________________________________________
dev mailing list
[hidden email]
http://mail.intermine.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: another imbedding bug, I think

Alex Kalderimis-2
In reply to this post by Benjamin Hitz-2
The bug fix for this is now live at intermine.org/lib/imbedding/0.2,
and has been pretty thoroughly tested with a range of contraint
groups.

Alex.

On Tue, Jun 21, 2011 at 03:18:59PM -0700, Benjamin Hitz wrote:

> Ha, I think I spent a couple hours today and yesterday on similar scope issues.
>
> On Jun 21, 2011, at 3:16 PM, Alex Kalderimis wrote:
>
> > For the interested, the problem is the fact that javascript does not have block scope, only global and function scope. This lead me to clobber one iteration variable with another, resulting in the bug you experienced. This has been resolved, and I will endeavour to ensure no further scope issues arise.
>
> --
> Ben Hitz
> Senior Scientific Programmer ** Saccharomyces Genome Database ** GO Consortium
> Stanford University ** [hidden email]
>
>
>

_______________________________________________
dev mailing list
[hidden email]
http://mail.intermine.org/cgi-bin/mailman/listinfo/dev