[ensembl-dev] Variations without LD and warnings of deprecated method call (Ensembl API v84)

Johanne Håøy Horn johannhh at ifi.uio.no
Wed Mar 16 07:44:50 GMT 2016

Dear Ensembl dev team,

If I use the script below, I get this warning:
Deprecated method call in file /Users/Johanne/src/ensembl-variation/modules/Bio/EnsEMBL/Variation/LDFeatureContainer.pm line 505.
Method Bio::EnsEMBL::Slice::get_all_VariationFeatures is deprecated.
get_all_VariationFeatures is deprecated and will be removed in e88. Please use Bio::EnsEMBL::Variation::DBSQL::VariationFeatureAdaptor::fetch_all_by_Slice_SO_terms instead.
Ensembl API version = 84

SCRIPT, where $variation_name is in {rs145155926, rs111309268, rs150384273, rs137966595, rs7675152, rs116998215, rs184066894, rs149535525, rs186235844}:

my $variation_adaptor = $registry->get_adaptor('homo_sapiens', 'variation', 'variation');
my $ldfc_adaptor = $registry->get_adaptor('homo_sapiens', 'variation', 'ldfeaturecontainer');
my $pop_adaptor = $registry->get_adaptor('homo_sapiens', 'variation', 'population');

my $variation = $variation_adaptor->fetch_by_name($variation_name);
my @var_features;

if ($variation) {
@var_features = @{ $variation->get_all_VariationFeatures() };
} else {
print 'failing variation name: ', $variation_name, "\n";

foreach my $vf (@var_features) {
if ($vf->slice->is_reference) {

my $rsid = $vf->name;
print $rsid, "\n";
my $start = $vf->start;
my $region = $vf->seq_region_name;
my $ldfc = $ldfc_adaptor->fetch_by_VariationFeature($vf, $ld_population);
my @ld_values = @{ $ldfc->get_all_ld_values() };
        foreach my $ld_hash (@ld_values) {
         my $r2 = $ld_hash->{r2};
    my $variation_name1 = $ld_hash->{variation_name1};
    my $variation_name2 = $ld_hash->{variation_name2};
    my $pos1 = $ld_hash->{variation1}->seq_region_name();
    my $pos2 = $ld_hash->{variation2}->seq_region_name();
    my $start1 = $ld_hash->{variation1}->start;
    my $start2 = $ld_hash->{variation2}->start;

    if ($variation_name1 eq $rsid) {
    print OUT "$pos2\t$start2\t$start2\t$variation_name2\t$rsid\t$r2\n";
    } else {
    print OUT "$pos1\t$start1\t$start1\t$variation_name1\t$rsid\t$r2\n";
      } else {
      print "Failed to get, not a reference allele: ", $vf->name;

The issue seems to be related to get_all_ld_values(). If I use get_all_ld_values(1), no warning occurs. I also tried get_all_ld_values(0), but with the same warning of deprecated method call appeared.

I am trying to expand variations with their variations in LD. However, quite a few rsids seem to have no LD. A list of these is included in this email. Could you help me with why they get no LD variations? Is it because they do not have any? Or is it a technical limitation that cause this?

Johanne Håøy Horn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20160316/840e16be/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: unaccounted_old.txt
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20160316/840e16be/attachment.txt>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20160316/840e16be/attachment.htm>

More information about the Dev mailing list