[ensembl-dev] Trouble querying for reference allele

Mark Aquino aquinom85 at me.com
Mon Dec 12 16:02:42 GMT 2011


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)





More information about the Dev mailing list