[ensembl-dev] Transitory problems on Biomart server

Paolo Cozzi paolo.cozzi at itb.cnr.it
Wed Jun 1 12:02:10 BST 2016


Dear Thomas,

Thanks for your reply. Now I can create a local cache of registry data. 
I've raised the timeout parameter in line 91 of 
biomart-perl/lib/BioMart/Configuration/URLLocation.pm (before was 20 - I 
found this trick somewhere in SeqAnser but I don't remember the link)

my $ua = LWP::UserAgent->new;
     $ua->timeout(180); # default is 180 seconds
     $ua->proxy( ['http', 'https'], $self->proxy ) if defined $self->proxy;
     my $response = $ua->request($request);

Before it tooks many second to do a query like the file attached. Now It 
seems to me to work in a few seconds.

Thank you all for the support,

regards,

Paolo


Il 31/05/2016 12:32, Thomas Maurel ha scritto:
> I am afraid that we had some issues with our BioMart servers on 
> Thursday, could you please try again?
> If you still have issues, could you please share your BioMart Perl 
> script with me so that I can have a look.
> In Ensembl, we are still using biomart version 0.7 so I would stick to 
> this version when you are querying the Ensembl marts with the Biomart 
> Perl API.
> You can find the most recent updates of Biomart Perl API (biomart 0.9) 
> on the following page: http://www.biomart.org/download.html
>
> Hope this helps,
> Best Regards,
> Thomas

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20160601/40ca6587/attachment.html>
-------------- next part --------------
#! /usr/bin/env perl

# An example script demonstrating the use of BioMart API.
# This perl API representation is only available for configuration versions >=  0.5
use strict;
use BioMart::Initializer;
use BioMart::Query;
use BioMart::QueryRunner;

my $confFile = "/storage/software/biomart-0.7/biomart-perl/conf/myMartURLLocation.xml";
#
# NB: change action to 'clean' if you wish to start a fresh configuration
# and to 'cached' if you want to skip configuration step on subsequent runs from the same registry
#

my $action='cached';
my $initializer = BioMart::Initializer->new('registryFile'=>$confFile, 'action'=>$action);
my $registry = $initializer->getRegistry;

my $query = BioMart::Query->new('registry'=>$registry,'virtualSchemaName'=>'default');

# Set attributest and filters
$query->setDataset("btaurus_snp");
$query->addFilter("chromosomal_region", ["1:10100:10200:1"]);
$query->addAttribute("refsnp_id");
$query->addAttribute("refsnp_source");
$query->addAttribute("chr_name");
$query->addAttribute("chrom_start");
$query->addAttribute("allele");
$query->addAttribute("validated");
$query->addAttribute("mapweight");
$query->addAttribute("chrom_end");
$query->addAttribute("chrom_strand");
$query->addAttribute("refsnp_source_description");

# Set output
#$query->formatter("HTML");
$query->formatter("CSV");

my $query_runner = BioMart::QueryRunner->new();
############################## GET COUNT ############################
# $query->count(1);
# $query_runner->execute($query);
# print $query_runner->getCount();
#####################################################################


############################## GET RESULTS ##########################
# to obtain unique rows only
# $query_runner->uniqueRowsOnly(1);

$query_runner->execute($query);
$query_runner->printHeader();
$query_runner->printResults();
$query_runner->printFooter();
#####################################################################
-------------- next part --------------
A non-text attachment was scrubbed...
Name: myMartURLLocation.xml
Type: text/xml
Size: 1790 bytes
Desc: not available
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20160601/40ca6587/attachment.xml>


More information about the Dev mailing list