<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi Gang,<br>
      <br>
      We found the same number of variations using the SQL query, API
      calls (and also the Ensembl Transcript web pages, which uses the
      API).<br>
      Which methods did you use for your perl script ?<br>
      To test the data, I used the script below:<br>
      <br>
      use strict;<br>
      use warnings;<br>
      use Bio::EnsEMBL::Registry;<br>
      <br>
      my $registry = 'Bio::EnsEMBL::Registry';<br>
      $registry->load_registry_from_db(<br>
          -host => 'ensembldb.ensembl.org',<br>
          -user => 'anonymous'<br>
      );<br>
      <br>
      my $so_term = 'insertion';<br>
      my $t_adaptor  = $registry->get_adaptor('human', 'core',
      'transcript');<br>
      my $tv_adaptor = $registry->get_adaptor('human', 'variation',
      'transcriptvariation');<br>
      <br>
      my @transcripts;<br>
      foreach my $t
      ('ENST00000419234','ENST00000327551','ENST00000547043','ENST00000539060')
      {<br>
        push @transcripts, $t_adaptor->fetch_by_stable_id($t);<br>
      }<br>
      <br>
      my %variations;<br>
      foreach my $tv
      (@{$tv_adaptor->fetch_all_by_Transcripts(\@transcripts)}) {<br>
        if ($tv->variation_feature->class_SO_term eq $so_term) {<br>
            $variations{$tv->variation_feature->variation_name} =
      1;<br>
          }<br>
      }<br>
      print "Count: ". scalar (keys %variations)."\n";<br>
      <br>
      Cheers,<br>
      <pre class="moz-signature" cols="72">Laurent
Ensembl Variation

</pre>
      On 14/08/2012 10:17, 陈岗 wrote:<br>
    </div>
    <blockquote
cite="mid:CABjKtWZNFTUi=TLP+GEuzTdsMSs-kDP0B42S1XizmRdifMJoew@mail.gmail.com"
      type="cite">Hi All
      <div><br>
      </div>
      <div>I got variation IDs with SQL sentences, but their numbers are
        inconsistent with the result from API.</div>
      <div><br>
      </div>
      <div>For example, my SQL counts gene ENSG00000089234 has 38
        insertions, 45 deletions, 5 indels, 0 substitution. However,
        Ensembl API read out 30 insertions, 40 deletions 1
        substitutions.</div>
      <div><br>
      </div>
      <div>If anyone know the reason that causes the difference, please
        tell me.  Thanks</div>
      <div><br>
      </div>
      <div>My SQL  for insertion:</div>
      <div><br>
      </div>
      <div>( SELECT att.value,vf.variation_name</div>
      <div>FROM transcript_variation tv</div>
      <div>LEFT JOIN variation_feature vf ON ( vf.variation_feature_id =
        tv.variation_feature_id ) </div>
      <div>LEFT JOIN attrib att ON ( att.attrib_id = vf.class_attrib_id
        ) </div>
      <div>WHERE tv.feature_stable_id = 'ENST00000419234'</div>
      <div>     AND att.value = 'insertion' )</div>
      <div><br>
      </div>
      <div>union</div>
      <div><br>
      </div>
      <div>
        <div>( SELECT att.value,vf.variation_name</div>
        <div>FROM transcript_variation tv</div>
        <div>LEFT JOIN variation_feature vf ON ( vf.variation_feature_id
          = tv.variation_feature_id ) </div>
        <div>LEFT JOIN attrib att ON ( att.attrib_id =
          vf.class_attrib_id ) </div>
        <div>WHERE tv.feature_stable_id = 'ENST00000327551'</div>
        <div>     AND att.value = 'insertion' )</div>
      </div>
      <div><br>
      </div>
      <div>
        <div>
          union</div>
        <div><br>
        </div>
        <div>
          <div>( SELECT att.value,vf.variation_name</div>
          <div>FROM transcript_variation tv</div>
          <div>LEFT JOIN variation_feature vf ON (
            vf.variation_feature_id = tv.variation_feature_id ) </div>
          <div>
            LEFT JOIN attrib att ON ( att.attrib_id = vf.class_attrib_id
            ) </div>
          <div>WHERE tv.feature_stable_id = 'ENST00000547043'</div>
          <div>     AND att.value = 'insertion' )</div>
        </div>
        <div><br>
        </div>
        <div>
          <div>union</div>
          <div><br>
          </div>
          <div>
            <div>( SELECT att.value,vf.variation_name</div>
            <div>FROM transcript_variation tv</div>
            <div>LEFT JOIN variation_feature vf ON (
              vf.variation_feature_id = tv.variation_feature_id ) </div>
            <div>LEFT JOIN attrib att ON ( att.attrib_id =
              vf.class_attrib_id ) </div>
            <div>WHERE tv.feature_stable_id = 'ENST00000539060'</div>
            <div>     AND att.value = 'insertion' )</div>
          </div>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        -- <br>
        <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>
      <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>
  </body>
</html>