<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi Nathalie,<br>
<br>
I won't recommand to use the "fetch_all" method, as it can be very
slow and you will pick up Gene, QTL and structural variations as
well.<br>
<br>
If you want to retrieve all the variants with phenotype
association, you should use the <a
href="http://www.ensembl.org/info/docs/Doxygen/variation-api/classBio_1_1EnsEMBL_1_1Variation_1_1VariationSet.html">VariationSet</a>
object, as we have a dedicated variation set for the
<meta http-equiv="content-type" content="text/html;
charset=windows-1252">
phenotype-associated variants ("All phenotype-associated
variants"), e.g.:<br>
<pre class="fragment">my $vs_adaptor = $registry->->get_adaptor('human','variation','variationset');
my $vs = $vs_adaptor->fetch_by_name('All phenotype-associated variants');
my $iterator = $vs->get_Variation_Iterator();
while ($iterator->has_next()) {
# Print the name of the variation
my $var = $iterator->next();
print "Variant: ".$var->name()."\n";
}
</pre>
Here is the list of variation set available: <a
href="http://www.ensembl.org/info/genome/variation/data_description.html#variation_sets">http://www.ensembl.org/info/genome/variation/data_description.html#variation_sets</a><br>
The example in the Ensembl Variation API tutorial will help you to
retrieve the variant names (as described in the example above) and
their associated phenotypes:<br>
<a
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>
(i.e. the 3rd block of code of the section "Variation sets").<br>
<a
href="http://www.ensembl.org/info/genome/variation/data_description.html#variation_sets"></a><br>
For your last question, the variant ID is stored into the method "<a
href="http://www.ensembl.org/info/docs/Doxygen/variation-api/classBio_1_1EnsEMBL_1_1Variation_1_1PhenotypeFeature.html#a888f8f444e6dab333724be8a5bcd5676">object_id</a>"
in the PhenotypeFeature object. However you can get the Variation
object from PhenotypeFeature, using the method "<a
href="http://www.ensembl.org/info/docs/Doxygen/variation-api/classBio_1_1EnsEMBL_1_1Variation_1_1PhenotypeFeature.html#a0fc55eb66ad71bbd5f647b225310dca1">variation</a>".<br>
<br>
Best regards,<br>
<pre class="moz-signature" cols="72">Laurent</pre>
On 09/10/2014 12:13, Nathalie Conte wrote:<br>
</div>
<blockquote
cite="mid:683D5499-F619-47D0-8614-0EE66E160134@ebi.ac.uk"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
hi Laurent
<div>Thanks for this -</div>
<div>I want all SNP associated with a phenotype,not one in
particular, I used diabetes as an example .</div>
<div>is fetch_all the one to use?</div>
<table class="memname" style="font-family: 'Lucida Grande',
Verdana, Geneva, Arial, sans-serif; font-size: 12px; color:
black; white-space: nowrap; font-weight: bold; margin-left: 6px;
position: static; z-index: auto; ">
<tbody>
<tr style="vertical-align: top;">
<td class="memname" style="font-size: 1em; text-align: left;
border: 0px; color: rgb(51, 51, 51); margin-left: 6px; ">public
List
Bio::EnsEMBL::Variation::DBSQL::PhenotypeFeatureAdaptor::fetch_all<br>
<br>
</td>
</tr>
</tbody>
</table>
Another question, how do you get the SNPs IDs associated with
those phenotypes?
<div>Thanks</div>
<div>Nathalie</div>
<div><br>
<div>
<div>On 9 Oct 2014, at 11:44, Laurent Gil <<a
moz-do-not-send="true" href="mailto:lgil@ebi.ac.uk">lgil@ebi.ac.uk</a>>
wrote:</div>
<div>
<div><br class="Apple-interchange-newline">
<blockquote type="cite">
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
<div bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi Nathalie,<br>
<br>
The database schema is not easy to decipher. We
built the following documentation to help to
understand the tables/columns:<br>
<a moz-do-not-send="true"
href="http://www.ensembl.org/info/docs/api/variation/variation_schema.html">http://www.ensembl.org/info/docs/api/variation/variation_schema.html</a><br>
At the moment, the variation_attrib table is only
used by our colleagues in Ensembl Genomes, so you
don't need to use this table to link the variations
to the phenotype.<br>
<br>
However, I warmly recommand to use the Variation
API: there is a method in the
PhenotypeFeatureAdaptor object to retrieve all the
data associated with a phenotype: "
<meta http-equiv="content-type" content="text/html;
charset=windows-1252">
<a moz-do-not-send="true" class="el"
href="http://www.ensembl.org/info/docs/Doxygen/variation-api/classBio_1_1EnsEMBL_1_1Variation_1_1DBSQL_1_1PhenotypeFeatureAdaptor.html#a5692dfaa03010ea9eec3e4a279421496">fetch_all_by_phenotype_description_source_name</a>"
(the source name parameter is optional). And from
the PhenotypeFeature objects, you can retrieve the
variations.<br>
<br>
Best regards,<br>
<pre class="moz-signature" cols="72">Laurent</pre>
On 09/10/2014 11:27, Nathalie Conte wrote:<br>
</div>
<blockquote
cite="mid:20141009102718.2CAB9132A89_4366306B@hx-mx2.ebi.ac.uk"
type="cite">
<pre wrap="">HI,
I am trying to build a sql query in order to select all SNPs (germline and somatic, ie rs1223) associated with a phenotype.(ie diabetes) using sql command.
I started building a sql query connecting different tables in homo_sapiens_variation_77_38 database in order to connect the variation table (variation_id, rs1223)and the phenotype table where the description of the phenotype is (ie diabetes).
Looking at the schema <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.ensembl.org/info/docs/api/variation/variation-database-schema.pdf">http://www.ensembl.org/info/docs/api/variation/variation-database-schema.pdf</a> , I am linking variation table through variation, variation_attrib, phenotype_feature_attrib, feanotype_feature, and phenotype.
It seems that variation_attri table is empty, so I cannot link the data
mysql -<a moz-do-not-send="true" href="http://hensembldb.ensembl.org">hensembldb.ensembl.org</a> -uanonymous -e"SELECT * FROM variation_attrib LIMIT 10;" homo_sapiens_variation_77_38 command will return no result.
Could you please help me forward suggestion another path to link variation.variation_id to phenotype.description, or suggest directly a sql command?
Thanks in advance
Nathalie
_______________________________________________
Dev mailing list <a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Dev@ensembl.org">Dev@ensembl.org</a>
Posting guidelines and subscribe/unsubscribe info: <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.ensembl.org/mailman/listinfo/dev">http://lists.ensembl.org/mailman/listinfo/dev</a>
Ensembl Blog: <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.ensembl.info/">http://www.ensembl.info/</a>
</pre>
</blockquote>
<br>
</div>
_______________________________________________<br>
Dev mailing list <a moz-do-not-send="true"
href="mailto:Dev@ensembl.org">Dev@ensembl.org</a><br>
Posting guidelines and subscribe/unsubscribe info: <a
moz-do-not-send="true"
href="http://lists.ensembl.org/mailman/listinfo/dev">http://lists.ensembl.org/mailman/listinfo/dev</a><br>
Ensembl Blog: <a moz-do-not-send="true"
href="http://www.ensembl.info/">http://www.ensembl.info/</a><br>
</blockquote>
</div>
<br>
</div>
</div>
</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>