<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi Henry,<br>
VariationSet is an object. You can get the set name by calling
$variation_set->name() and you can get all Variations stored in
a VariationSet by calling $variation_set->get_all_Variations().
But be careful here; sets can contain millions of variations.
Better to use an Iterator.<br>
You can find more in the documentation:<br>
<a class="moz-txt-link-freetext" href="http://www.ensembl.org/info/docs/Doxygen/variation-api/classBio_1_1EnsEMBL_1_1Variation_1_1VariationSet.html#a3aa51f756aaa0b662108cb52bffda055">http://www.ensembl.org/info/docs/Doxygen/variation-api/classBio_1_1EnsEMBL_1_1Variation_1_1VariationSet.html#a3aa51f756aaa0b662108cb52bffda055</a><br>
<a class="moz-txt-link-freetext" href="http://www.ensembl.org/info/docs/api/variation/variation_tutorial.html#variation_sets">http://www.ensembl.org/info/docs/api/variation/variation_tutorial.html#variation_sets</a><br>
<br>
So for your code:<br>
foreach my $tva(@{$tvas}) {<br>
my @vsets =
@{$vs_adaptor->fetch_all_by_Variation($tva->variation_feature->variation)};<br>
foreach my $vs (@vsets) {<br>
my $set_name = $vs->name();<br>
...<br>
}<br>
print<br>
$tva->variation_feature->display_id,"\t",join(",",
@vsets),"\n"; #variation sets<br>
}<br>
<br>
Kind regards,<br>
Anja<br>
<br>
<br>
On 22/07/2014 21:40, Gong, Henry wrote:<br>
</div>
<blockquote
cite="mid:3171BB1BB8CFE243921782339B599663845FA8@ex07.net.ucsf.edu"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
<div style="direction: ltr;font-family: Tahoma;color:
#000000;font-size: 10pt;">Hi EnsEMBL devs,<br>
<br>
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.<br>
<br>
Here's a script which reproduces the issue on my computer:<br>
#begin script<br>
use strict;<br>
use warnings;<br>
use Bio::EnsEMBL::Registry;<br>
<br>
my $registry = 'Bio::EnsEMBL::Registry';<br>
<br>
$registry->load_registry_from_db(<br>
-host => 'ensembldb.ensembl.org',<br>
-user => 'anonymous'<br>
);<br>
<br>
my $stable_id = "ENST00000392487"; #this is the stable_id of a
human transcript, as an example<br>
my $transcript_adaptor =
$registry->get_adaptor('homo_sapiens', 'core', 'transcript');
#get the adaptor to get the Transcript from the database<br>
my $transcript =
$transcript_adaptor->fetch_by_stable_id($stable_id); #get the
Transcript object<br>
my $tv_adaptor = $registry->get_adaptor('homo_sapiens',
'variation', 'transcriptvariation'); #get the adaptor to get
TranscriptVariation objects<br>
my $vs_adaptor = $registry->get_adaptor('human', 'variation',
'variationset'); # get variation set adaptor<br>
my $tvs =
$tv_adaptor->fetch_all_by_Transcripts([$transcript]); #get
ALL effects of Variations in the Transcript<br>
<br>
foreach my $tv (@{$tvs}) {<br>
my $tvas =
$tv->get_all_alternate_TranscriptVariationAlleles(); #These
alleles will be the lines of the output.<br>
<br>
foreach my $tva(@{$tvas}) {<br>
my @vsets =
@{$vs_adaptor->fetch_all_by_Variation($tva->variation_feature->variation)};<br>
print<br>
$tva->variation_feature->display_id,"\t",join(",",
@vsets),"\n"; #variation sets<br>
}<br>
}<br>
#end script<br>
<br>
And here's a couple lines of the output:<br>
rs374450378
Bio::EnsEMBL::Variation::VariationSet=HASH(0x6022f7778)<br>
rs369428195
Bio::EnsEMBL::Variation::VariationSet=HASH(0x601f7e868)<br>
rs146522403
Bio::EnsEMBL::Variation::VariationSet=HASH(0x6022f7550),Bio::EnsEMBL::Variation::VariationSet=HASH(0x6022f7778),Bio::EnsEMBL::Variation::VariationSet=HASH(0x6022f75f8)<br>
<br>
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.<br>
<br>
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.<br>
<br>
Thanks,<br>
Henry Gong<br>
Junior Specialist<br>
UCSF Dept of Neuro Surgery<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Dev mailing list <a class="moz-txt-link-abbreviated" href="mailto:Dev@ensembl.org">Dev@ensembl.org</a>
Posting guidelines and subscribe/unsubscribe info: <a class="moz-txt-link-freetext" href="http://lists.ensembl.org/mailman/listinfo/dev">http://lists.ensembl.org/mailman/listinfo/dev</a>
Ensembl Blog: <a class="moz-txt-link-freetext" href="http://www.ensembl.info/">http://www.ensembl.info/</a>
</pre>
</blockquote>
<br>
</body>
</html>