[Bioperl-l] Error retrieving sequence from BioSQL

Seth Johnson johnson.biotech at gmail.com
Sat Sep 30 22:38:11 UTC 2006


I use ActiveState Komodo and I put a break point right after the $dbseq is
returned.  That way I can look into the object in the 'local variable'
window with all of it's details.  The date is present here:
$dbseq->{_obj}->{_annotation}->{-obj}->{_annotation}->{date_changed}->{0}->{_obj}->{value}=17-OCT-2005
$dbseq->{_obj}->{_annotation}->{-obj}->{_annotation}->{date_changed}->{0}->{_obj}->{tagname}='date_changed'
~~~~~~~~~~~~~~~~~~~~~~~~~
Going back to your script.  The "$dbseq->get_dates()" returns an error
"Can't locate object method "get_dates" via package "Bio::Seq" at
c:/Perl/site/lib/Bio/DB/Persistent/PersistentObject.pm line 552."
~~~~~~~~~~~~~~~~~~~~~~~~~
The second script "$dbseq->get_Annotations()" does return '17-OCT-2005'
date.  It's the last value that it returns.
~~~~~~~~~~~~~~~~~~~~~~~~~
Third script:
     print "version: ",$dbseq->seq_version(),"\n";
I believe the correct function call is just "$dbseq->version()" returns:
"version: 3".  Interesting thing is that when I use EMBL format in the call

     my $out = Bio::SeqIO->newFh('-format' => 'EMBL');
     print $out $dbseq;

I do get the version number out.  'genbank' format, however, does not
display it.
~~~~~~~~~~~~~~~~~~~~~~~~~

Also, the GI number is missing from 'genbank' formatted output.  However,
the

     print "GI: ",$dbseq->primary_id(),"\n";

Does display  the "GI: 51870928".
~~~~~~~~~~~~~~~~~~~~~~~~~

What IS missing from the object, or at least I could not find it, is the
"division" value from the 'bioentry' table, 'PRI' in this case.  Also, the
header should say 'mRNA' instead of 'dna', assumming of course that it was
design output sequence the same way GenBank does.


On 9/29/06, Hilmar Lapp <hlapp at gmx.net> wrote:
>
> This is odd. So you are saying that the properties missing in the
> output are present in the object that is returned from the calling
> $adp->find_by_unique_key()?
>
> Oh wait - the date is not, but it is in the database? I.e., if you do
>
>         @dates = $dbseq->get_dates();
>         print "Have ",scalar(@dates)," dates\n";
>
> it prints 'Have 0 dates'? But it is a value of the
> bioentry_qualifier.value column, and the ontology term referenced by
> that row is 'date_changed'?
>
> If you dump out all annotation values from the returned sequence
> object, is it anywhere to be found? I.e., if you do
>
>         foreach ($dbseq->get_Annotations()) {
>                 print "got: ",$_->as_text(),"\n";
>         }
>
> you get a variety of stuff but not a line that says 'got: 17-OCT-2005'?
>
> The fact that it doesn't print the VERSION line is mysterious, except
> if the version is not defined in the object. If you say
>
>         print "version: ",$dbseq->seq_version(),"\n";
>
> does it not print a version number indeed?
>
> (BTW I don't know how comfortable you are in perl - the above things
> can be obtained easier with the perl debugger and/or Data::Dumper -
> feel free to use those for inspecting your object.)
>
>         -hilmar
>
> On Sep 28, 2006, at 2:48 PM, Seth Johnson wrote:
>
> > I have just updated both bioperl-live and bioperl-db prior to
> > running the code, so I assume that it's the latest cvs versions.
> > It appears that all of the information is present in the object
> > that's returned by "find_by_unique_key(...)" function with the
> > exception of the date.  Any suggestions???
> >
> > On 9/28/06, Chris Fields <cjfields at uiuc.edu> wrote: Seth,
> >
> > The organism issue is a bug and has been reported, though I thought
> > it was fixed.
> >
> > The lack of the date and the version is a bit odd, but there have
> > been a lot of changes lately to bioperl-live (core bioperl in CVS),
> > and a few to bioperl-db.  How old is your bioperl and bioperl-db
> > installation.  Hilmar, any additional thoughts?
> >
> > Chris
> >
> > On Sep 28, 2006, at 11:10 AM, Seth Johnson wrote:
> >
> > > Thank you.  That takes care of that, however, I do have another
> > > gripe.  When
> > > running my script, quoted before, with "my $out =
> > > Bio::SeqIO->newFh('-format' => 'genbank');", I have several key
> > > pieces of
> > > information missing.  The most important one is the version
> > > number.  There's
> > > also a date missing, and source organism name is corrupted.  Here's
> > > what I
> > > get:
> > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > > LOCUS       NM_014580               2145 bp    dna     linear   UNK
> > > DEFINITION  Homo sapiens solute carrier family 2, (facilitated
> > glucose
> > >             transporter) member 8 (SLC2A8), mRNA.
> > > ACCESSION   NM_014580
> > > SOURCE      sapiens.
> > >   ORGANISM  sapiens
> > >             Eukaryota; Fungi/Metazoa group; Metazoa; Eumetazoa;
> > > Bilateria;
> > >             Coelomata; Deuterostomia; Chordata; Craniata;
> > Vertebrata;
> > >             Gnathostomata; Teleostomi; Euteleostomi; Sarcopterygii;
> > > Tetrapoda;
> > >             Amniota; Mammalia; Theria; Eutheria; Euarchontoglires;
> > > Primates;
> > >             Haplorrhini; Simiiformes; Catarrhini; Hominoidea;
> > > Hominidae;
> > >             Homo/Pan/Gorilla group; Homo.
> > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > >
> > > All of the missing information is stored in BioSQL and
> > > theoretically should
> > > be in the outpu. Here's how NCBI genbank file looks:
> > >
> > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > >
> > > LOCUS       NM_014580               2145 bp    mRNA    linear   PRI
> > > 17-OCT-2005
> > > DEFINITION  Homo sapiens solute carrier family 2, (facilitated
> > glucose
> > >             transporter) member 8 (SLC2A8), mRNA.
> > > ACCESSION   NM_014580
> > > VERSION     NM_014580.3  GI:51870928
> > > KEYWORDS    .
> > > SOURCE      Homo sapiens (human)
> > >   ORGANISM  Homo sapiens
> > > <http://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=9606>
> > >             Eukaryota; Metazoa; Chordata; Craniata; Vertebrata;
> > > Euteleostomi;
> > >             Mammalia; Eutheria; Euarchontoglires; Primates;
> > > Haplorrhini;
> > >             Catarrhini; Hominidae; Homo.
> > >
> > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > >
> > >
> > > On 9/28/06, Chris Fields <cjfields at uiuc.edu> wrote:
> > >>
> > >> Those are from the excessively paranoid '-w' flag on the shebang
> > >> line.  If you remove the flag but add the 'use warnings' pragma the
> > >> 'subroutine x redefined' warnings go away.  This, BTW, is one of
> > the
> > >> quirks of the ActivePerl distribution; other OSs don't have the
> > same
> > >> problem.
> > >>
> > >> The 'solution' described on that page is actually a workaround,
> > not a
> > >> bugfix.  It causes problems with stack traces with error
> > handling but
> > >> seems harmless beyond that.  I haven't been able to find a
> > >> satisfactory fix which works on all OS's.
> > >>
> > >> Chris
> > >>
> > >>
> > >> On Sep 28, 2006, at 10:42 AM, Seth Johnson wrote:
> > >>
> > >>> This is under Windows, but using ActiveState Komodo 3.5 and their
> > >>> latest Perl for Windows and latest BioPerl & BioPerl-db from CVS.
> > >>>
> > >>> I actually just stumbled upon a solution.  It's described in the
> > >>> "Installing Bioperl on Windows" by adding a comma after $class: in
> > >>> Bio::Root::Root throw() subroutine.  Thanks for hinting me about
> > >>> what I run it on.
> > >>>
> > >>> The code works now, BUT it spews whole bunch of warnings about
> > >>> "Subroutine .... redefined":
> > >>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > >>> Subroutine new redefined at c:/Perl/site/lib/Bio\BioEntry
> > >>> .pm line 88.
> > >>> Subroutine object_id redefined at c:/Perl/site/lib/Bio\BioEntry.pm
> > >>> line 128.
> > >>> Subroutine version redefined at c:/Perl/site/lib/Bio\BioEntry.pm
> > >>> line 150.
> > >>> Subroutine authority redefined at c:/Perl/site/lib/Bio\BioEntry.pm
> > >>> line 171.
> > >>> Subroutine namespace redefined at c:/Perl/site/lib/Bio\BioEntry.pm
> > >>> line 192.
> > >>> Subroutine display_name redefined at c:/Perl/site/lib/Bio
> > >>> \BioEntry.pm line 217.
> > >>> Subroutine description redefined at c:/Perl/site/lib/Bio
> > >>> \BioEntry.pm line 241.
> > >>> Subroutine new redefined at c:/Perl/site/lib/Bio\Root\Root.pm line
> > >>> 201.
> > >>> Subroutine verbose redefined at c:/Perl/site/lib/Bio\Root\Root.pm
> > >>> line 234.
> > >>> Subroutine _register_for_cleanup redefined at c:/Perl/site/lib/Bio
> > >>> \Root\Root.pm line 246.
> > >>> Subroutine _unregister_for_cleanup redefined at c:/Perl/site/
> > lib/Bio
> > >>> \Root\Root.pm line 256.
> > >>> Subroutine _cleanup_methods redefined at c:/Perl/site/lib/Bio\Root
> > >>> \Root.pm line 263.
> > >>> Subroutine throw redefined at c:/Perl/site/lib/Bio\Root\Root.pm
> > >>> line 316.
> > >>> Subroutine debug redefined at c:/Perl/site/lib/Bio\Root\Root.pm
> > >>> line 379.
> > >>> Subroutine _load_module redefined at c:/Perl/site/lib/Bio\Root
> > >>> \Root.pm line 398.
> > >>> Subroutine DESTROY redefined at c:/Perl/site/lib/Bio\Root\Root.pm
> > >>> line 426.
> > >>> Subroutine new redefined at c:/Perl/site/lib/Bio\Root\RootI.pm
> > line
> > >>> 117.
> > >>> Subroutine _initialize redefined at c:/Perl/site/lib/Bio\Root
> > >>> \RootI.pm line 128.
> > >>> ...
> > >>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > >>>
> > >>>
> > >>> On 9/28/06, Chris Fields <cjfields at uiuc.edu> wrote: I had problems
> > >>> with bioperl-db on native WinXP (not cygwin), but I
> > >>> did manage to get it running in cygwin with some effort.  The
> > issue
> > >>> on native WinXP was related to Bio::Root::Root::throw(), though.
> > >>>
> > >>> There is a bug and workaround filed on Bugzilla, but I haven't
> > >>> worked
> > >>> on it in a while (and the workaround has some problems as
> > well).  I
> > >>> may try running it again to see what happens.
> > >>>
> > >>> http://bugzilla.open-bio.org/show_bug.cgi?id=1938
> > >>>
> > >>> Chris
> > >>>
> > >>> On Sep 28, 2006, at 9:04 AM, Hilmar Lapp wrote:
> > >>>
> > >>>> Very odd. This is under Windows, presumably using Cygwin?
> > >>>>
> > >>>> The method Bio::Root::Root::throw() clearly exists, and
> > >>>> PersistentObject inherits from it. The exception it was trying to
> > >>>> throw has nothing to do with failure or success to find the
> > >>>> database
> > >>>> row (actually it did succeed since otherwise it wouldn't
> > construct
> > >>>> the object) but with dynamically loading a class, presumably
> > >>>> Bio::DB::Persistent::Seq.
> > >>>>
> > >>>> Are you using the 1.5.x release of bioperl?
> > >>>>
> > >>>> Does anyone on the list have any experience with these sorts of
> > >>>> things on Windows?
> > >>>>
> > >>>> (Seth, I've moved this thread to the bioperl list, since this is
> > >>> what
> > >>>> the problem is about.)
> > >>>>
> > >>>>       -hilmar
> > >>>>
> > >>>> On Sep 27, 2006, at 1:39 PM, Seth Johnson wrote:
> > >>>>
> > >>>>> Hello guys,
> > >>>>>
> > >>>>> I successfully populated the biosql database, thanks to you.
> > Now,
> > >>>>> I'm
> > >>>>> trying to retrieve a sequence from it following the example from
> > >>>>> BOSC2003
> > >>>>> slides and ran into uninformative error (at least to me it
> > doesn't
> > >>>>> mean
> > >>>>> anyting).  I suspect that I'm missing something and hope you can
> > >>>>> point me in
> > >>>>> the right direction.  Here's my source code:
> > >>>>>
> > >>>
> > --------------------------------------------------------------------
> > >>> -
> > >>>>> -
> > >>>>> ---
> > >>>>> #!/usr/bin/perl -w
> > >>>>> use strict;
> > >>>>> use warnings;
> > >>>>>
> > >>>>> use Bio::Seq;
> > >>>>> use Bio::Seq::SeqFactory;
> > >>>>> use Bio::DB::SimpleDBContext;
> > >>>>> use Bio::DB::BioDB;
> > >>>>>
> > >>>>> my $dbc = Bio::DB::SimpleDBContext->new(
> > >>>>>     -driver => 'mysql',
> > >>>>>     -dbname => 'BioSQL_1',
> > >>>>>     -host => '192.168.1.3',
> > >>>>>     -user => 'xxxxx',
> > >>>>>     -pass => 'xxxxxx'
> > >>>>> );
> > >>>>>
> > >>>>> my $db = Bio::DB::BioDB->new(-database  => 'biosql',
> > >>>>>                             -dbcontext => $dbc);
> > >>>>>
> > >>>>> my $seq = Bio::Seq->new(-accession_number => 'NM_014580', -
> > >>>>> namespace =>
> > >>>>> 'refseq_H_sapiens');
> > >>>>> my $seqfact = Bio::Seq::SeqFactory->new(-type => 'Bio::Seq');
> > >>>>> my $adp = $db->get_object_adaptor($seq);
> > >>>>> my $dbseq = $adp->find_by_unique_key($seq, -obj_factory =>
> > >>> $seqfact);
> > >>>>>
> > >>>>> my $out = Bio::SeqIO->newFh('-format' => 'EMBL');
> > >>>>> print $out $dbseq;
> > >>>>>
> > >>>>> exit;
> > >>>>>
> > -----------------------------------------------------------------
> > >>>>>
> > >>>>> Just when the "find_by_unique_key" function is executed I get
> > the
> > >>>>> following
> > >>>>> error:
> > >>>>>
> > >>>>> ================================
> > >>>>> Undefined subroutine &Bio::Root::Root::throw called at
> > >>>>> c:/Perl/site/lib/Bio/DB/Persistent/PersistentObject.pm line 199.
> > >>>>> ================================
> > >>>>>
> > >>>>> The sequence does exist in the database. I checked that.  Any
> > >>>>> ideas???
> > >>>>>
> > >>>>> --
>



More information about the Bioperl-l mailing list