[ensembl-dev] Failed SNPs

Duarte Molha duartemolha at gmail.com
Mon Oct 8 11:01:23 BST 2018


Dear Developers

I created a script to query the database and retrieve details of some SNPs
( taking as input the RS id of those SNPS)

I wanted to change it so that I could also obtain information for Failed
SNPS.

the script is really simple the gist being :

use strict;
use warnings;
use Bio::EnsEMBL::Registry;
my $registry = 'Bio::EnsEMBL::Registry';
$registry->load_registry_from_db( -host => 'ensembldb.ensembl.org', -user
=> 'anonymous' );

foreach my $id (@rsids){
chomp $id;
if ($id =~ /^rs/i){
my $variation = $variation_adaptor->fetch_by_name($id);
if ($variation){
foreach my $vf (@{$vf_adaptor->fetch_all_by_Variation($variation)}){
my $varClass= $vf->class_SO_term();
my $start = $vf->seq_region_start()-1;
my $end = $vf->seq_region_end();
if($varClass eq "insertion"){
$end++;
}
my $allele_string = $vf->allele_string;

if ($vf->strand eq "-1"){
my $strand ="-";
my $allele_string = $vf->allele_string;
$allele_string =~ tr/ATGCatgc/TACGtacg/;
print "chr".$vf->seq_region_name, $start, $end,
$vf->variation_name().";".$varClass.";".$allele_string,"0", $strand."\n";
}else{
my $strand ="+";
print "chr".$vf->seq_region_name, $start, $end,
$vf->variation_name().";".$varClass.";".$allele_string,"0", $strand."\n";
}
}
}else{
$progress->message("FAILED: $id\n");
}
}
}

I looked at the documentation and you indicate I should use  something like:

$vf_adaptor->db->include_failed_variations(1);


But for a failed variation

this part of the code:
my $variation = $variation_adaptor->fetch_by_name($id);


would return undef therefore I would not reach the vf adaptor in my code

I also tried

$variation_adaptor->db->include_failed_variations(1);

But this does not seem to work as well.
What I am missing?

Thanks

Duarte
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20181008/e95869b1/attachment.html>


More information about the Dev mailing list