<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Dear Developers<div><br></div><div>I created a script to query the database and retrieve details of some SNPs ( taking as input the RS id of those SNPS)</div><div><br></div><div>I wanted to change it so that I could also obtain information for Failed SNPS. </div><div><br></div><div>the script is really simple the gist being :</div><div><br></div>use strict; </div><div dir="ltr">use warnings; </div><div dir="ltr">use Bio::EnsEMBL::Registry; </div><div dir="ltr">my $registry = 'Bio::EnsEMBL::Registry'; </div><div dir="ltr">$registry->load_registry_from_db( -host => '<a href="http://ensembldb.ensembl.org">ensembldb.ensembl.org</a>', -user => 'anonymous' );<div><br></div><div><div><div>foreach my $id (@rsids){</div><div><span style="white-space:pre">        </span>chomp $id;</div><div><span style="white-space:pre">    </span>if ($id =~ /^rs/i){</div><div><span style="white-space:pre">           </span>my $variation = $variation_adaptor->fetch_by_name($id);</div><div><span style="white-space:pre">            </span>if ($variation){</div><div><span style="white-space:pre">                              </span>foreach my $vf (@{$vf_adaptor->fetch_all_by_Variation($variation)}){</div><div><span style="white-space:pre">                                       </span>my $varClass= $vf->class_SO_term();</div><div><span style="white-space:pre">                                        </span>my $start = $vf->seq_region_start()-1;</div><div><span style="white-space:pre">                                     </span>my $end = $vf->seq_region_end();</div><div><span style="white-space:pre">                                   </span>if($varClass eq "insertion"){</div><div><span style="white-space:pre">                                               </span>$end++;</div><div><span style="white-space:pre">                                       </span>}</div><div><span style="white-space:pre">                                     </span>my $allele_string = $vf->allele_string;</div><div><br></div><div><span style="white-space:pre">                                   </span>if ($vf->strand eq "-1"){</div><div><span style="white-space:pre">                                                </span>my $strand ="-";</div><div><span style="white-space:pre">                                            </span>my $allele_string = $vf->allele_string;</div><div><span style="white-space:pre">                                            </span>$allele_string =~ tr/ATGCatgc/TACGtacg/;</div><div><span style="white-space:pre">                                              </span>print "chr".$vf->seq_region_name, $start, $end, $vf->variation_name().";".$varClass.";".$allele_string,"0", $strand."\n";</div><div><span style="white-space:pre">                                     </span>}else{</div><div><span style="white-space:pre">                                                </span>my $strand ="+";</div><div><span style="white-space:pre">                                            </span>print "chr".$vf->seq_region_name, $start, $end, $vf->variation_name().";".$varClass.";".$allele_string,"0", $strand."\n";</div><div><span style="white-space:pre">                                     </span>}</div><div><span style="white-space:pre">                             </span>}</div><div><span style="white-space:pre">             </span>}else{</div><div><span style="white-space:pre">                        </span>$progress->message("FAILED: $id\n");</div><div><span style="white-space:pre">             </span>}</div><div><span style="white-space:pre">     </span>}</div><div>}</div></div></div><div><br></div><div>I looked at the documentation and you indicate I should use  something like:</div><div><br></div><div><pre class="gmail-code gmail-sh_perl gmail-sh_sourceCode" style="font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;font-size:12.8px;margin-top:0px;margin-bottom:16px;border:1px solid rgb(204,204,204);background:rgb(250,250,250);overflow:auto;color:rgb(51,51,51);line-height:16px;padding:8px"><span class="gmail-sh_variable" style="font-size:1em;color:rgb(170,119,0)">$vf_adaptor</span><span class="gmail-sh_symbol" style="font-size:1em;color:rgb(127,0,85)">-></span><span class="gmail-sh_function" style="font-size:1em;color:rgb(255,20,147)">db</span><span class="gmail-sh_symbol" style="font-size:1em;color:rgb(127,0,85)">-></span><span class="gmail-sh_function" style="font-size:1em;color:rgb(255,20,147)">include_failed_variations</span><span class="gmail-sh_symbol" style="font-size:1em;color:rgb(127,0,85)">(</span><span class="gmail-sh_number" style="font-size:1em;color:rgb(13,163,68)">1</span><span class="gmail-sh_symbol" style="font-size:1em;color:rgb(127,0,85)">);</span>
</pre><br class="gmail-Apple-interchange-newline"></div><div>But for a failed variation </div><div><br></div><div>this part of the code:</div><div><div><span style="white-space:pre">               </span>my $variation = $variation_adaptor->fetch_by_name($id);</div><br class="gmail-Apple-interchange-newline"></div><div><br></div><div>would return undef therefore I would not reach the vf adaptor in my code</div><div><div><br></div><div>I also tried </div><div><br></div><div><div><span class="gmail-sh_variable" style="font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;font-size:1em;white-space:pre;color:rgb(170,119,0)">$</span>variation_adaptor<span class="gmail-sh_symbol" style="font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;font-size:1em;white-space:pre;color:rgb(127,0,85)">-></span><span class="gmail-sh_function" style="font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;font-size:1em;white-space:pre;color:rgb(255,20,147)">db</span><span class="gmail-sh_symbol" style="font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;font-size:1em;white-space:pre;color:rgb(127,0,85)">-></span><span class="gmail-sh_function" style="font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;font-size:1em;white-space:pre;color:rgb(255,20,147)">include_failed_variations</span><span class="gmail-sh_symbol" style="font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;font-size:1em;white-space:pre;color:rgb(127,0,85)">(</span><span class="gmail-sh_number" style="font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;font-size:1em;white-space:pre;color:rgb(13,163,68)">1</span><span class="gmail-sh_symbol" style="font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;font-size:1em;white-space:pre;color:rgb(127,0,85)">);</span></div><div><span style="font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;white-space:pre;background-color:rgb(250,250,250)"><br></span></div>But this does not seem to work as well.<br>What I am missing?<br><br>Thanks<br><br>Duarte</div><div><br></div><br class="gmail-Apple-interchange-newline"></div><div><br></div><div><br></div></div></div></div></div>