<div dir="ltr">Hi Mark,<div><br></div><div>You could use either a MySQL query on the variation database (<a href="http://homo_sapiens_variation_84_38@ensembldb.ensembl.org:3306">homo_sapiens_variation_84_38@ensembldb.ensembl.org:3306</a>):</div><div><br></div><div><div>SELECT pf.*, pfa.value AS associated_gene</div><div>FROM phenotype_feature pf, phenotype p, phenotype_feature_attrib pfa, attrib_type a</div><div>WHERE pf.phenotype_id = p.phenotype_id</div><div>AND pf.phenotype_feature_id = pfa.phenotype_feature_id</div><div>AND pfa.attrib_type_id = a.attrib_type_id</div><div>AND a.code = 'associated_gene'</div><div>AND p.description = 'DIABETES MELLITUS, TYPE 2';</div></div><div><br></div><div>or the perl API; you'd need to fetch a phenotype object and then all associated phenotype features, filtering that list down to those with associated genes. Here's some links with a tutorial and the relevant class documentation:</div><div><br></div><div><a href="http://www.ensembl.org/info/docs/api/variation/variation_tutorial.html#phenotype">http://www.ensembl.org/info/docs/api/variation/variation_tutorial.html#phenotype</a><br></div><div><a href="http://www.ensembl.org/info/docs/Doxygen/variation-api/classBio_1_1EnsEMBL_1_1Variation_1_1DBSQL_1_1PhenotypeAdaptor.html">http://www.ensembl.org/info/docs/Doxygen/variation-api/classBio_1_1EnsEMBL_1_1Variation_1_1DBSQL_1_1PhenotypeAdaptor.html</a><br></div><div><a href="http://www.ensembl.org/info/docs/Doxygen/variation-api/classBio_1_1EnsEMBL_1_1Variation_1_1DBSQL_1_1PhenotypeFeatureAdaptor.html">http://www.ensembl.org/info/docs/Doxygen/variation-api/classBio_1_1EnsEMBL_1_1Variation_1_1DBSQL_1_1PhenotypeFeatureAdaptor.html</a><br></div><div><br></div><div>Regards</div><div><br></div><div>Will McLaren</div><div>Ensembl Variation</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 21 April 2016 at 22:00, William Spooner <span dir="ltr"><<a href="mailto:william.spooner@eaglegenomics.com" target="_blank">william.spooner@eaglegenomics.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Mark,<br>
<br>
Ensembl only explicitly associates a gene with a variant when it is<br>
within 5kb upstream/downstream. Your SNP is outside this range. You<br>
can query for SNPs that are outside this range by calculating the<br>
location and using BioMart or the Ensembl Perl API. Direct SQL is not<br>
guaranteed to work.<br>
<br>
Best,<br>
<br>
Will<br>
<div><div class="h5"><br>
On Thu, Apr 21, 2016 at 8:36 PM, Mark Miller <<a href="mailto:Mark.Miller@instem.com">Mark.Miller@instem.com</a>> wrote:<br>
> How can I programmatically retrieve variants that are associated with a<br>
> phenotype and ASSOCIATED with a gene, even if the variant is not strictly<br>
> within a gene’s boundaries?<br>
><br>
><br>
><br>
> If you visit<br>
> <a href="http://useast.ensembl.org/Homo_sapiens/Gene/Phenotype?db=core;g=ENSG00000073756;r=1:186671791-186680427#ALL_tablePanel" rel="noreferrer" target="_blank">http://useast.ensembl.org/Homo_sapiens/Gene/Phenotype?db=core;g=ENSG00000073756;r=1:186671791-186680427#ALL_tablePanel</a>,<br>
> under “ALL associated variants” you will see rs10489403 associated with<br>
> hematocrit phenotypes.<br>
><br>
><br>
><br>
> If I query biomart for variants and phenotypes associated with<br>
> ENSG00000073756, rs10489403 is not listed.<br>
><br>
>         <Dataset name = "hsapiens_snp" interface = "default" ><br>
><br>
>                <Filter name = "ensembl_gene" value = "ENSG00000073756"/><br>
><br>
>                <Attribute name = "refsnp_id" /><br>
><br>
>                <Attribute name = "ensembl_gene_stable_id" /><br>
><br>
>                <Attribute name = "associated_gene" /><br>
><br>
>         </Dataset><br>
><br>
><br>
><br>
> If I look for rs10489403 in the web interface or biomart, I see that it is<br>
> intergenic between PGTS2 and PLA2G4A.<br>
><br>
>         <Dataset name = "hsapiens_snp" interface = "default" ><br>
><br>
>                <Filter name = "snp_filter" value = "rs10489403"/><br>
><br>
>                <Attribute name = "refsnp_id" /><br>
><br>
>                <Attribute name = "ensembl_gene_stable_id" /><br>
><br>
>                <Attribute name = "associated_gene" /><br>
><br>
>         </Dataset><br>
><br>
><br>
><br>
> It doesn’t seem like associated_gene  is a filterable field.  How can I<br>
> query biomart, or MySQL directly,  with ENSG00000073756 as my gene of<br>
> interest and retrieve rs10489403 as a variant which has PTGS2/<br>
> ENSG00000073756 as an associated gene?<br>
><br>
><br>
><br>
> Thanks,<br>
><br>
> Mark<br>
><br>
><br>
><br>
> The contents of this e-mail message, including any attachments, are intended<br>
> solely for the use of the person or entity to which the e-mail was<br>
> addressed. If you are not the intended recipient of this message, be advised<br>
> that any dissemination, distribution, or use of the contents of this message<br>
> is strictly prohibited. If you received this e-mail message in error, please<br>
> e-mail <a href="mailto:is@instem.com">is@instem.com</a> and contact the sender by reply e-mail. Please also<br>
> permanently delete all copies of the original e-mail and any attached<br>
> documentation. Thank you. Copyright 2016 Instem Group of Companies. For any<br>
> other correspondence please write to Instem plc. a company registered in<br>
> England and Wales, number 07148099, with registered office at Diamond Way,<br>
> Stone Business Park, Stone, Staffordshire, ST15 0SD England.<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> Dev mailing list    <a href="mailto:Dev@ensembl.org">Dev@ensembl.org</a><br>
> Posting guidelines and subscribe/unsubscribe info:<br>
> <a href="http://lists.ensembl.org/mailman/listinfo/dev" rel="noreferrer" target="_blank">http://lists.ensembl.org/mailman/listinfo/dev</a><br>
> Ensembl Blog: <a href="http://www.ensembl.info/" rel="noreferrer" target="_blank">http://www.ensembl.info/</a><br>
><br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
--<br>
William Spooner<br>
Chief Science Officer<br>
M: <a href="tel:%2B44%20%280%297779663045" value="+447779663045">+44 (0)7779663045</a> | T: @wspoonr | L: linkedin<br>
Eagle Genomics Ltd | <a href="http://www.eaglegenomics.com" rel="noreferrer" target="_blank">http://www.eaglegenomics.com</a><br>
eaglediscover: Winner of Bio-IT World 2016 Best of Show, knowledge management<br>
<br>
_______________________________________________<br>
Dev mailing list    <a href="mailto:Dev@ensembl.org">Dev@ensembl.org</a><br>
Posting guidelines and subscribe/unsubscribe info: <a href="http://lists.ensembl.org/mailman/listinfo/dev" rel="noreferrer" target="_blank">http://lists.ensembl.org/mailman/listinfo/dev</a><br>
Ensembl Blog: <a href="http://www.ensembl.info/" rel="noreferrer" target="_blank">http://www.ensembl.info/</a><br>
</font></span></blockquote></div><br></div>