<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    <font face="Helvetica, Arial, sans-serif">$chr = '1'; instead of </font><font
      face="Helvetica, Arial, sans-serif">$chr = "'1'";</font> might
    help, I think<br>
    <br>
    Daniel<br>
    <br>
    <br>
    On 27/04/2011 14:13, Damian wrote:
    <blockquote cite="mid:4DB8166E.5020708@umich.edu" type="cite">
      <meta http-equiv="content-type" content="text/html;
        charset=ISO-8859-1">
      <font face="Helvetica, Arial, sans-serif">Hello.<br>
        <br>
        Down below I've pasted a snippet of a script I've written to
        retrieve regions of the genome.<br>
        The first call to slice_adaptor works as expected. This call
        uses the hard coded coordinates.<br>
        The second version of the call to slice_adaptor fails to work,
        throwing the error: <br>
        Can't call method "seq" on an undefined value at getSeqs.pl line
        23.<br>
        <br>
        The only difference between the two calls to slice_adaptor is
        that the second version uses perl variables ($chr, $start, $end)
        instead of the hard coded values.</font><font face="Helvetica,
        Arial, sans-serif"><br>
        Is this a bug or am I doing something wrong?</font><br>
      <font face="Helvetica, Arial, sans-serif">I'm using Ensembl Perl
        API version 62 with the Human database installed
        (homo_sapiens_core_62_37g).<br>
        <br>
        Thanks in advance for any and all help.<br>
        Damian<br>
        <br>
        <br>
        #!/usr/bin/perl -w<br>
        <br>
        use Bio::EnsEMBL::Registry;<br>
        use Bio::EnsEMBL::Slice;<br>
        <br>
        my $registry = 'Bio::EnsEMBL::Registry';<br>
        $registry->load_registry_from_db(<br>
            -host => '127.0.0.1',<br>
            -user => 'jonDoe'<br>
        );<br>
        <br>
        $slice_adaptor = $registry->get_adaptor('Human', 'Core',
        'Slice');<br>
         <br>
        $slice = $slice_adaptor->fetch_by_region( 'chromosome', '1',
        724572, 724726 );<br>
        $x = $slice->seq;<br>
        print "\n## 1 ###\n$x\n\n";<br>
        <br>
        ## this version does NOT work<br>
        $chr = "'1'";<br>
        $start = 724572;<br>
        $end = 724726;<br>
        $slice = $slice_adaptor->fetch_by_region( 'chromosome', $chr,
        $start, $end );<br>
        $x = $slice->seq;<br>
        print "\n## 2 ###\n$x\n\n";<br>
        <br>
        exit;<br>
        <br>
      </font>
      <pre class="moz-signature" cols="72">-- 
------------------------------------------------------------------------------
Damian Fermin, Ph.D.
Pathology Department
University of Michigan
4237 Medical Science I
1301 Catherine
Ann Arbor, MI 48109-0602
734.615.0302

"There is No Gene for the Human Spirit"
        -- GATTACA
------------------------------------------------------------------------------
</pre>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
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>