[ensembl-dev] Losing connection to MySQL for large queries

Chris Raistrick chris.raistrick at bristol.ac.uk
Tue Oct 4 09:20:49 BST 2011


Dear all,

Getting an error when trying to retrieve a complete list of variant
IDs via the ensembl variation database:

[example std out]
name = 'rs79594517', source = 'dbSNP', chr = '3'
name = 'rs78223957', source = 'dbSNP', chr = '3'
name = 'rs112696692', source = 'dbSNP', chr = '3'
name = 'rs9761692', source = 'dbSNP', chr = '3'
Chromosome 4
        Connected to the Ensembl Registry
        Slice adaptor generated
DBD::mysql::st execute failed: Lost connection to MySQL server during
query at .../ensembl/modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm line
287.
DBD::mysql::st execute failed: Lost connection to MySQL server during
query at .../ensembl/modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm line
287.

Each time I start a new chromosome using this code:

		print "Chromosome $chr\n";

		# connect to Ensembl registry	
		my $registry = 'Bio::EnsEMBL::Registry';
		$registry->load_registry_from_db(
		    -host => 'ensembldb.ensembl.org',
		    -user => 'anonymous'
		);

		# get slice for chromosome
		my $slice_adaptor = $registry->get_adaptor('homo_sapiens', 'core', 'slice');
		my $slice = $slice_adaptor->fetch_by_region('chromosome',$chr);

		# get variations by slice
		my $vf_adaptor = $registry->get_adaptor('homo_sapiens', 'variation',
'variationfeature');
		my $vfs = $vf_adaptor->fetch_all_by_Slice($slice);

		foreach my $vf (@{$vfs}){
				my $var_id = $vf->variation_name;
				..

I read the last few messages I could find related on here and they
said this fix would be in by release 64 (I downloaded the modules last
week, so assume I'm on 64).

Please help, I've never had this problem using the Ensembl API (in 4 years).

Chris




More information about the Dev mailing list