[ensembl-dev] Trouble querying for reference allele

Andy Yates ayates at ebi.ac.uk
Mon Dec 12 16:26:57 GMT 2011


Hi Mark,

Can you check the version of the API you are using please? Any kind of error involving species & the registry normally suggests an API error. You can do this from the command line with:

perl -MBio::EnsEMBL::ApiVersion -e 'warn software_version()'

Another possible error is if you've taken the latest API release from CVS & downloaded it using the *nix shells you have to quote the URL e.g.

wget 'http://cvs.sanger.ac.uk/cgi-bin/viewvc.cgi/ensembl.tar.gz?root=ensembl&only_with_tag=branch-ensembl-65&view=tar'

All the best,

Andy

On 12 Dec 2011, at 16:02, Mark Aquino wrote:

> Hi,
> 
> I am trying to query an ensembl database for the reference allele at certain positions but I'm getting a strange error:
> Homo_sapiens is not a valid species name for this instance
> Use of uninitialized value $species in hash element at /users/maquino/src/ensembl/modules/Bio/EnsEMBL/Registry.pm line 958, <INFILE> line 2.
> Use of uninitialized value $species in hash element at /users/maquino/src/ensembl/modules/Bio/EnsEMBL/Registry.pm line 969, <INFILE> line 2.
> Can't call method "fetch_by_region" on an undefined value at createMasterCondelSingleBase.pl line 104, <INFILE> line 2.
> 
> I tried changing the species name to Human but that doesn't seem to help.  I'm using this bit of code to do the querying:
> 
> ....
> 
> if ($i == 0){
>                $slice_adaptor = Bio::EnsEMBL::Registry->get_adaptor ( 'Homo_sapiens', 'Core', 'slice');
>                $slice = $slice_adaptor->fetch_by_region('Chromosome',$chr,$true_start,$true_end);
>                $sa = Bio::EnsEMBL::Registry->get_adaptor('Homo_sapiens', 'Core', 'Sequence');
>        }
>        if ($chr != $lastchr){
>                $slice_adaptor = Bio::EnsEMBL::Registry->get_adaptor ( 'Homo_sapiens', 'Core', 'slice');
>                $slice = $slice_adaptor->fetch_by_region('Chromosome',$chr,$true_start,$true_end);
>                $sa = Bio::EnsEMBL::Registry->get_adaptor('Homo_sapiens', 'Core', 'Sequence');
>        }
> 
>        for(;$true_start <= $true_end; $true_start++){
>        #       print "$slice, $true_start, $true_end, $strand\n";
>                my $dna = ${ $sa->fetch_by_Slice_start_end_strand($slice, $true_start, $true_start, $strand) };
>                foreach $base (@bases){
>                        if ($_ ne $dna && $dna ne 'N'){
>                        print OUTFILE "$chr\t$true_start\t$id\t$dna\t$base\n";
>                        }
>                }
>                $lastchr = $chr;
>        }
>        $i++;
> }
> 
> Is there any problem with the code I'm using that I am overlooking? (note: this worked in the past, but I'm seeing it now after installing the latest version of ensembl database)
> 
> 
> _______________________________________________
> Dev mailing list    Dev at ensembl.org
> List admin (including subscribe/unsubscribe): http://lists.ensembl.org/mailman/listinfo/dev
> Ensembl Blog: http://www.ensembl.info/

---
Andrew Yates                   Ensembl Core Software Project Leader
EMBL-EBI                       Tel: +44-(0)1223-492538
Wellcome Trust Genome Campus   Fax: +44-(0)1223-494468
Cambridge CB10 1SD, UK         http://www.ensembl.org/





More information about the Dev mailing list