[ensembl-dev] error API
Nathalie Conte
nconte at ebi.ac.uk
Tue Jun 9 12:17:08 BST 2015
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
More information about the Dev
mailing list