[ensembl-dev] Variation set: fetch_all_by_Variation() outputting hash values

Gong, Henry Henry.Gong at ucsf.edu
Tue Jul 22 21:40:40 BST 2014


Hi EnsEMBL devs,

I'm working on a script that essentially outputs much of the variation page for a given transcript, with some tweaks and additions. Right now I'm working with API version 75, and I'm running into issues with the variation sets.

Here's a script which reproduces the issue on my computer:
#begin script
use strict;
use warnings;
use Bio::EnsEMBL::Registry;

my $registry = 'Bio::EnsEMBL::Registry';

$registry->load_registry_from_db(
    -host => 'ensembldb.ensembl.org',
    -user => 'anonymous'
);

my $stable_id = "ENST00000392487"; #this is the stable_id of a human transcript, as an example
my $transcript_adaptor = $registry->get_adaptor('homo_sapiens', 'core', 'transcript'); #get the adaptor to get the Transcript from the database
my $transcript = $transcript_adaptor->fetch_by_stable_id($stable_id); #get the Transcript object
my $tv_adaptor = $registry->get_adaptor('homo_sapiens', 'variation', 'transcriptvariation'); #get the adaptor to get TranscriptVariation objects
my $vs_adaptor = $registry->get_adaptor('human', 'variation', 'variationset'); # get variation set adaptor
my $tvs = $tv_adaptor->fetch_all_by_Transcripts([$transcript]); #get ALL effects of Variations in the Transcript

foreach my $tv (@{$tvs}) {
    my $tvas = $tv->get_all_alternate_TranscriptVariationAlleles(); #These alleles will be the lines of the output.

    foreach my $tva(@{$tvas}) {
        my @vsets = @{$vs_adaptor->fetch_all_by_Variation($tva->variation_feature->variation)};
        print
            $tva->variation_feature->display_id,"\t",join(",", @vsets),"\n"; #variation sets
    }
}
#end script

And here's a couple lines of the output:
rs374450378    Bio::EnsEMBL::Variation::VariationSet=HASH(0x6022f7778)
rs369428195    Bio::EnsEMBL::Variation::VariationSet=HASH(0x601f7e868)
rs146522403    Bio::EnsEMBL::Variation::VariationSet=HASH(0x6022f7550),Bio::EnsEMBL::Variation::VariationSet=HASH(0x6022f7778),Bio::EnsEMBL::Variation::VariationSet=HASH(0x6022f75f8)

So in other words, the problem seems to lie in the adaptor pm's interpretation of the data from the function $vsa->fetch_all_by_Variation(); the program seems to correctly output some hash value(s) based on a variation as a key. That's a guess based on the fact that the output depends on the variant.

Would this be based on some issue with my syntax (which is based on the API tutorial), or with the pm itself? I'm new to perl, so I'm not really able to diagnose the pm.

Thanks,
Henry Gong
Junior Specialist
UCSF Dept of Neuro Surgery
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20140722/76dc6a14/attachment.html>


More information about the Dev mailing list