[Biojava-l] RE: [BioSQL-l] location in features

Richard HOLLAND hollandr at gis.a-star.edu.sg
Thu Apr 28 05:52:22 EDT 2005


OK. 

I ran your code against biojava-live and my Oracle db and got the same
errors as you report. On further analysis I found that, as your feature
should have no location (Location.empty), if you look in the database it
doesn't have any there either, which is correct. However the code that
extracts features from BioSQL expects all features to have locations and
throws the exception that you are seeing if it can't find at least one
per feature.

I altered org.biojava.bio.seq.db.biosql.FeaturesSQL so that if it could
not find a location for a feature at read-time, it would set the feature
object location to Location.empty. I have committed this change to
biojava-live, so you will need to use CVS to check out a copy of
biojava-live to see if this has solved your problem. For the copy of
your code which I have here, it works fine.

cheers,
Richard


Richard Holland
Bioinformatics Specialist
GIS extension 8199
---------------------------------------------
This email is confidential and may be privileged. If you are not the
intended recipient, please delete it and notify us immediately. Please
do not copy or use it for any purpose, or disclose its content to any
other person. Thank you.
---------------------------------------------


> -----Original Message-----
> From: Martina [mailto:boehme at mpiib-berlin.mpg.de] 
> Sent: Thursday, April 28, 2005 5:04 PM
> To: Richard HOLLAND
> Cc: BioJava; Mark Schreiber
> Subject: Re: [BioSQL-l] location in features
> 
> 
> I'm using MySQL, biojava-1.4pre1, biosql,v 1.40
> 
> Richard HOLLAND wrote:
> 
> > Hullo Martina.
> > 
> > I must admit I am confused. I have been using BioJava+BioSQL to load
> > Genbank records with features with no trouble, they always come out
> > again with no exceptions raised and none missing. I am 
> using Oracle, but
> > this shouldn't make a difference as the SQL code that looks 
> for features
> > is the same for all database types at present.
> > 
> > Can I ask what database type you are using (MySQL, Oracle 
> etc.), and the
> > versions of BioJava and BioSQL you have?
> > 
> > I'd also suggest downloading biojava-live from CVS, if you 
> haven't done
> > so already, and trying that to see if someone has already fixed your
> > problem.
> > 
> > cheers,
> > Richard
> > 
> > Richard Holland
> > Bioinformatics Specialist
> > GIS extension 8199
> > ---------------------------------------------
> > This email is confidential and may be privileged. If you are not the
> > intended recipient, please delete it and notify us 
> immediately. Please
> > do not copy or use it for any purpose, or disclose its 
> content to any
> > other person. Thank you.
> > ---------------------------------------------
> > 
> > 
> > 
> >>-----Original Message-----
> >>From: Hilmar Lapp [mailto:hlapp at gnf.org] 
> >>Sent: Thursday, April 28, 2005 2:51 AM
> >>To: Martina
> >>Cc: OBDA BioSQL; BioJava; Richard HOLLAND; Mark Schreiber
> >>Subject: Re: [BioSQL-l] location in features
> >>
> >>
> >>Hi Martina, people on the biojava mailing list will probably 
> >>be better 
> >>able to help you out. Also, Richard and Mark have been working on 
> >>getting Biojava interoperate better with the standard 
> biosql schema. 
> >>They may know better where your issue is coming from.
> >>
> >>	-hilmar
> >>
> >>On Apr 27, 2005, at 8:27 AM, Martina wrote:
> >>
> >>
> >>>Hi,
> >>>I can't get rid of this exception:
> >>>org.biojava.bio.BioRuntimeException: BioSQL SeqFeature 
> doesn't have 
> >>>any associated location spans. seqfeature_id=148
> >>>
> >>>Can anybody help me?
> >>>
> >>>put the sequence in:
> >>>
> >>>Sequence seq = DNATools.createDNASequence(sequence, "AF100928");
> >>>Feature.Template templSeq = new Feature.Template();
> >>>		templSeq.source = "ncbi";
> >>>		templSeq.type = "gen";
> >>>		templSeq.location = Location.empty;
> >>>		seq.createFeature(templSeq);
> >>>db.addSequence(seq);
> >>>
> >>>get it out:
> >>>seq = db.getSequence("AF100928");
> >>>System.out.println(seq.getName() + " contains " + 
> >>
> >>seq.countFeatures()
> >>
> >>>					+ " features");	
> >>>
> >>>seq.getName() works fine, but the seq doesn't have any 
> >>
> >>features, but I 
> >>
> >>>can see them in the db.
> >>>
> >>>What am I missing here?
> >>>
> >>>Martina
> >>>
> >>>_______________________________________________
> >>>BioSQL-l mailing list
> >>>BioSQL-l at open-bio.org
> >>>http://open-bio.org/mailman/listinfo/biosql-l
> >>>
> >>
> >>-- 
> >>-------------------------------------------------------------
> >>Hilmar Lapp                            email: lapp at gnf.org
> >>GNF, San Diego, Ca. 92121              phone: +1-858-812-1757
> >>-------------------------------------------------------------
> >>
> > 
> > 
> 



More information about the Biojava-l mailing list