[ensembl-dev] error API

Kieron Taylor ktaylor at ebi.ac.uk
Tue Jun 9 13:54:47 BST 2015


Hi Nathalie,

Thank you for the report, I think you’ve uncovered a combination of issues. The rsID you mention resolves to chromosome 13 on release 79 (and not 17? Perhaps you looked it up on the website to check), and can be seen to be in a massive region of N’s. The code limits its search radius, doesn’t find anything and rather too optimistically assumes it will succeed. I will fix it so that get_nearest_Gene stops dying if there is nothing to be found.

In the mean time, you could trap the error with Try::Tiny or an eval{} block, so that your code survives this variant. With that much empty space around it, I don’t think the nearest gene has useful meaning.


Regards,

Kieron


Kieron Taylor PhD.
Ensembl Core senior software developer

EMBL, European Bioinformatics Institute





> On 9 Jun 2015, at 12:17, Nathalie Conte <nconte at ebi.ac.uk> wrote:
> 
> 
> Dear Dev team,
> 
> I am running a script to get various annotation from Variation IDs I fetch from ensembl.
> I am running this for every chromosome and it works for all but  chromosome 17 where it stops  throwing this error message where I am trying to use get_nearest_Gene function from the variation feature.
> Can't use an undefined value as an ARRAY reference at home/Bio/EnsEMBL/Feature.pm line 1452.
> 
> 
> while (<INFILE>){ #file where variation ID are captured
> my @data =split /\t/;
> 
>    my $variation_human = $data[2]; #rsID
>    next if (!$variation_human) ;
>    my $human_query_variation = $v_adaptor->fetch_by_name($variation_human); 
> 
>    if (!$human_query_variation){ next; 
>    } else {
> my $mvfs  = $vf_adaptor->fetch_all_by_Variation($human_query_variation);
> 
> 	foreach my $vf (@{$mvfs}){
> 	    if ($vf->coord_system_name eq "chromosome"){
> 		
> 		my $type=$vf->is_somatic;
> 		if ($type==0){$type='germline';} else {$type='somatic';};
> 
> 		
> 		my $nearest_genes = $vf->get_nearest_Gene;
> 		
> if ($nearest_genes){
> my $gene_name=defined($nearest_genes->external_name) ? $nearest_genes->external_name : 'no_ext_gene_name';
> my $ENS_ID= defined($nearest_genes->stable_id) ? $nearest_genes->stable_id : 'no_stableID';							
> 
> print OUTFILE2 $variation_human, "\t",'nearestgene is'.$nearest_genes->external_name, "\t", $gene_name, "\t",$ENS_ID, "\n";
> }
> }
> 
> 
> The very same script works for all other chromosomes  and I cannot understand what is the issue here.
> This is the last SNP ID which will be printed: COSM460246. The following one: rs398123092 will cause an error.
> I am using ensembl_v79
> Bio::EnsEMBL::Registry->load_registry_from_db(
>    -host=>  'mysql-ensembl-mirror.ebi.ac.uk', -user=>'anonymous',
>    -port=>'4240', 'db_version' => 79,);
> 
> Thanks for any tips,
> Nathalie
> 
> 
> 
> _______________________________________________
> Dev mailing list    Dev at ensembl.org
> Posting guidelines and subscribe/unsubscribe info: http://lists.ensembl.org/mailman/listinfo/dev
> Ensembl Blog: http://www.ensembl.info/





More information about the Dev mailing list