[BioSQL-l] How to get a Seq object from Bio::DB::Persistent::Seq

Marc Logghe Marc.Logghe at devgen.com
Wed Jun 2 05:31:23 EDT 2004


Hi Daniel,

> Hi,
> I'm retrieving sequences out of a biosql db using Bio::DB::Query's...
> When calling the next_object function on the QueryResult, you get the
> persistence object for seq.
> I want to copy the object into a fresh seq object, to add new data and
> store it afterwarts as a new entry with a different namespace.
> The solution I´m using now is quite awkward...I copy it using SeqIO:(
> Is there a method to retrieve seq objects directly?

I don't know what will happen if you change the namespace of the persistent object and store it. Probably a lot of constraints ;-) (Not tested though !)
A route you could follow is to 
1. fetch the plain seq object
2. change the namespace and add some features
3. make it persistent and 
4. store it.

suppose you have your persistent seq in $pseq;
my $seq = $pseq->obj;
$seq->namespace('my_new_namespace')

# do some other stuff

my $new_pseq = $db->create_persistent($seq);
$new_pseq->create;

> 
> Additionally, I'm quite confused by the mapping of bioperl objects to
> biosql tables(e.g. for generating a Bio:Query with datacollections):
> connections like bioenty<->seqI are obvious, but the rest?
> Is there a something like a overview list of the object mapping?
Have a look at  perldoc -m Bio::DB::BioSQL::BaseDriver, more precisely at the %object_entity_map variable.
Examples of queries you might find in http://cvs.bioperl.org/cgi-bin/viewcvs/viewcvs.cgi/bioperl-db/t/query.t?rev=1.9&cvsroot=bioperl&content-type=text/vnd.viewcvs-markup
and also the presentation given at BOSC2003:
http://open-bio.org/bosc2003/slides/Persistent_Bioperl_BOSC03.pdf

HTH,
Marc

 



More information about the BioSQL-l mailing list