[InterMine Dev] errors using perl API

Alex Kalderimis alex at intermine.org
Mon Aug 12 16:02:31 BST 2013


The cause for this in the Perl library code has been found, and a
patched version has been released to CPAN (the version number is
1.0401). 

The reason for this was a previously unencountered incompatibility in
server configurations, where the server expects only the path
information to be sent with the HTTP request; many servers handle the
full URI. This change is a point release, being only a bug fix, with
no backwards incompatible changes.

Alex.

On Fri, Aug 09, 2013 at 05:31:33PM +0100, Alex Kalderimis wrote:
> Thanks for this report. I can confirm this is a bug in the Perl client
> library. I will get this fixed as soon as possible, and send a reply
> to this thread when the fixed version is released (I expect this to
> be around the beginning of next week).
> 
> You can follow progress on this bug here:
>   https://github.com/intermine/intermine/issues/418
> 
> All best,
> 
> Alex Kalderimis
> 
> On Thu, Aug 08, 2013 at 08:49:15PM +0000, Givan, Scott A. wrote:
> > Hi,
> > 
> > I've created a short Gene list on the mousemine website and I'm trying to access it locally via the perl API. I adapted the perl script from the "Get Code" pull-down menu:
> > 
> > #!/usr/bin/env perl
> > 
> > use 5.010; # Require at least Perl version 5.8
> > use strict;
> > use autodie;
> > use Getopt::Long; # use GetOptions function to for CL args
> > use Webservice::InterMine;
> > 
> > # Set the output field separator as tab
> > $, = "\t";
> > # Print unicode to standard out
> > binmode(STDOUT, 'utf8');
> > # Silence warnings when printing null fields
> > no warnings ('uninitialized');
> > 
> > # The following import statement sets MouseMine as your default
> > # You must also supply your login details here to access this query
> > use Webservice::InterMine 0.9904 'http://www.mousemine.org/mousemine', 'M1R4W0S5Yfk6y7913eW1';
> > 
> > my $query = new_query(class => 'Gene');
> > 
> > # The view specifies the output columns
> > $query->add_view(qw/
> > primaryIdentifier
> > symbol
> > name
> > sequenceOntologyTerm.name
> > chromosome.primaryIdentifier
> > chromosomeLocation.id
> > description
> > /);
> > 
> > $query->add_constraint(
> > path => 'Gene',
> > op => 'IN',
> > value => '25genes',
> > code => 'A',
> > );
> > 
> > ## Use an iterator to avoid having all rows in memory at once.
> > #my $it = $query->iterator();
> > #while (my $row = <$it>) {
> > # print $row->{'primaryIdentifier'}, $row->{'symbol'}, $row->{'name'},
> > # $row->{'sequenceOntologyTerm.name'}, $row->{'chromosome.primaryIdentifier'},
> > # $row->{'chromosomeLocation.id'}, $row->{'description'}, "\n";
> > #}
> > 
> > my $results = $query->results(as => 'arrayrefs');
> > 
> > for my $row (@$results) {
> > say $row->[0];
> > }
> > 
> > 
> > I get the following error:
> > 
> > Bad Request (400): Incomplete result set received at constructor Webservice::InterMine::ResultIterator::new (defined at /opt/perl/lib/site_perl/5.14.2/Webservice/InterMine/ResultIterator.pm line 535) line 177.
> > at /opt/perl/lib/site_perl/5.14.2/Webservice/InterMine/ResultIterator.pm line 408, <GEN2> line 49.
> > Webservice::InterMine::ResultIterator::get_all('Webservice::InterMine::ResultIterator=HASH(0x7a36cd0)') called at /opt/perl/lib/site_perl/5.14.2/Webservice/InterMine/ResultIterator.pm line 321
> > eval {...} called at /opt/perl/lib/site_perl/5.14.2/Webservice/InterMine/ResultIterator.pm line 321
> > Webservice::InterMine::ResultIterator::_find_real_error_message('Webservice::InterMine::ResultIterator=HASH(0x7a36cd0)') called at /opt/perl/lib/site_perl/5.14.2/Webservice/InterMine/ResultIterator.pm line 314
> > Webservice::InterMine::ResultIterator::set_headers('Webservice::InterMine::ResultIterator=HASH(0x7a36cd0)') called at /opt/perl/lib/site_perl/5.14.2/Webservice/InterMine/ResultIterator.pm line 27
> > Webservice::InterMine::ResultIterator::BUILD('Webservice::InterMine::ResultIterator=HASH(0x7a36cd0)', 'HASH(0x5733b78)') called at constructor Webservice::InterMine::ResultIterator::new (defined at /opt/perl/lib/site_perl/5.14.2/Webservice/InterMine/ResultIterator.pm line 535) line 177
> > Webservice::InterMine::ResultIterator::new('Webservice::InterMine::ResultIterator', 'url', 'URI::http=SCALAR(0x5143de0)', 'parameters', 'HASH(0x50910e8)', 'row_parser', 'Webservice::InterMine::Parser::JSON::ArrayRefs=HASH(0x7a45398)', 'authorization', undef, ...) called at /opt/perl/lib/site_perl/5.14.2/Webservice/InterMine/Service.pm line 770
> > Webservice::InterMine::Service::get_results_iterator('Webservice::InterMine::Service=HASH(0x44526e0)', 'URI::http=SCALAR(0x5143de0)', 'HASH(0x50910e8)', 'ARRAY(0x480f8a0)', 'arrayrefs', 'perl', undef) called at /opt/perl/lib/site_perl/5.14.2/Webservice/InterMine/Query/Roles/Runnable.pm line 196
> > Webservice::InterMine::Query::Roles::Runnable::results_iterator('Webservice::InterMine::Query=HASH(0x4a87ab8)', 'as', 'arrayrefs') called at /opt/perl/lib/site_perl/5.14.2/Webservice/InterMine/Query/Roles/Runnable.pm line 275
> > Webservice::InterMine::Query::Roles::Runnable::results('Webservice::InterMine::Query=HASH(0x4a87ab8)', 'as', 'arrayrefs') called at /home/sgivan/projects/RNAseq/bin/cuffdiff_InterMine.pl line 48
> > at /opt/perl/lib/site_perl/5.14.2/Webservice/InterMine/Service.pm line 777, <GEN2> line 49.
> > Webservice::InterMine::Service::get_results_iterator('Webservice::InterMine::Service=HASH(0x44526e0)', 'URI::http=SCALAR(0x5143de0)', 'HASH(0x50910e8)', 'ARRAY(0x480f8a0)', 'arrayrefs', 'perl', undef) called at /opt/perl/lib/site_perl/5.14.2/Webservice/InterMine/Query/Roles/Runnable.pm line 196
> > Webservice::InterMine::Query::Roles::Runnable::results_iterator('Webservice::InterMine::Query=HASH(0x4a87ab8)', 'as', 'arrayrefs') called at /opt/perl/lib/site_perl/5.14.2/Webservice/InterMine/Query/Roles/Runnable.pm line 275
> > Webservice::InterMine::Query::Roles::Runnable::results('Webservice::InterMine::Query=HASH(0x4a87ab8)', 'as', 'arrayrefs') called at /home/sgivan/projects/RNAseq/bin/cuffdiff_InterMine.pl line 48
> > 
> > Neither the iterator or arrayrefs for results works. Can you see if this script works on your end?
> > 
> > Scott A. Givan
> > Associate Director
> > Informatics Research Core Facility
> > 240e Bond Life Sciences Center
> > Research Assistant Professor
> > Molecular Microbiology and Immunology
> > University of Missouri, Columbia
> > 
> > TEL 573-882-2948
> > FAX 573-884-9676
> > @sgivan
> 
> > _______________________________________________
> > dev mailing list
> > dev at intermine.org
> > http://mail.intermine.org/cgi-bin/mailman/listinfo/dev
> 
> 
> _______________________________________________
> dev mailing list
> dev at intermine.org
> http://mail.intermine.org/cgi-bin/mailman/listinfo/dev



More information about the dev mailing list