<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi,<br>
I would recommend you to use the Perl API for all the information
you want to retrieve from Ensembl.<br>
It's quite easy to use and if there is a schema change, you will not
have to change all your SQL queries.<br>
Here is some documentation:<br>
<a
href="http://www.ensembl.org/info/docs/api/core/core_tutorial.html">http://www.ensembl.org/info/docs/api/core/core_tutorial.html</a><br>
<a
href="http://www.ensembl.org/info/docs/Doxygen/core-api/index.html">http://www.ensembl.org/info/docs/Doxygen/core-api/index.html</a><br>
<a href="http://www.ensembl.org/info/docs/api/index.html">http://www.ensembl.org/info/docs/api/index.html</a><br>
<br>
Here is some code for your query:<br>
<pre class="code">use Bio::EnsEMBL::Registry;
my $registry = 'Bio::EnsEMBL::Registry';
$registry->load_registry_from_db(
-host => 'ensembldb.ensembl.org', # alternatively 'useastdb.ensembl.org'
-user => 'anonymous'
);
my $gene_adaptor = $registry->get_adaptor( 'Human', 'Core', 'Gene' );
my $gene = $gene_adaptor->fetch_by_stable_id('ENSG00000089234');
foreach my $transcript (@{$gene->get_all_Transcripts()) {
print STDOUT 'Length of ', $transcript->display_id, ': ', $transcript->length, "\n";
}
</pre>
<p>Regards<br>
Thibaut<br>
</p>
<div class="moz-cite-prefix">On 31/07/12 12:49, Jay Humphrey wrote:<br>
</div>
<blockquote cite="mid:5017C664.5070905@ebi.ac.uk" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
Length is end - start + 1.<br>
1 2 3 [4 5 6 7 8] 9<br>
start = 4, end = 8<br>
8 - 4 = 4, actually there are 5 residues.<br>
<br>
On 31/07/2012 10:39, 陈岗 wrote:
<blockquote
cite="mid:CABjKtWY+XAxNouwZwDzpcQgsJScBDdA-6-7vy23xU5Pp1b7Nqw@mail.gmail.com"
type="cite"><span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">Hi
All </span>
<div><span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)"> </span>
<div> <span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">I
wondering how to calculate transcript length within
Ensembl database.</span><br
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">
<span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">I
try to sum exon's length:</span><br
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">
<span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)"><br>
</span></div>
<div><span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">SELECT
tp.stable_id, SUM( e.seq_region_end ) - SUM(
e.seq_region_start )</span><br
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">
<span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">FROM
gene g</span><br
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">
<span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">JOIN
transcript tp ON ( g.gene_id = tp.gene_id )</span><br
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">
<span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">JOIN
exon_transcript et ON ( et.transcript_id =
tp.transcript_id )</span><br
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">
<span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">JOIN
exon e ON ( e.exon_id = et.exon_id )</span><br
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">
<span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">WHERE
g.stable_id = 'ENSG00000089234'</span><br
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">
<span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">GROUP
BY tp.stable_id</span><br
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">
<span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)"><br>
</span></div>
<div><span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">But
the result is inconsistent with Ensembl official data:</span><br
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">
<span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">
</span><a moz-do-not-send="true"
href="http://asia.ensembl.org/Homo_sapiens/Gene/Summary?g=ENSG00000089234;r=12:112080797-112123790"
target="_blank"
style="color:rgb(17,85,204);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">http://asia.ensembl.org/Homo_sapiens/Gene/Summary?g=ENSG00000089234;r=12:112080797-112123790</a><br
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">
<span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)"><br>
</span></div>
<div><span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">If
you know how to dig out the datas of </span><span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">variation,orthologue,</span><span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">paralogue,regulation.
please also tell me.</span></div>
<div><span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)"><br>
</span></div>
<div><span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)"><br>
</span></div>
<div><span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">Thanks
million</span> <br clear="all">
<div>-- </div>
<div><font face="verdana, sans-serif" size="1">Gang Chen</font></div>
<div><font face="verdana, sans-serif" size="1">TILSI</font></div>
<div><font face="verdana, sans-serif" size="1"><span
style="background-color:rgb(255,255,255)">Taicang
Institute For Life Science Information</span><br
style="background-color:rgb(255,255,255)">
<span style="background-color:rgb(255,255,255)">Address:
A2/162, Renmin South Road, Taicang, 215400, Jiangsu
Province, P.R.China</span><br
style="background-color:rgb(255,255,255)">
<span style="background-color:rgb(255,255,255)">Phone:
(+86)512-82782588</span></font></div>
<br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Dev mailing list <a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Dev@ensembl.org">Dev@ensembl.org</a>
List admin (including subscribe/unsubscribe): <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>
<pre class="moz-signature" cols="72">--
Jay Humphrey Ensembl Genomes Web Developer
EMBL-EBI Tel: +44-(0)1223-492682
Wellcome Trust Genome Campus Fax: +44-(0)1223-494468
Cambridge CB10 1SD, UK <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.ensemblgenomes.org/">http://www.ensemblgenomes.org/</a> </pre>
<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>
List admin (including subscribe/unsubscribe): <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>
<br>
</body>
</html>