[BioSQL-l] Re: update seqfeature

Martina boehme at mpiib-berlin.mpg.de
Wed Jun 22 09:05:44 EDT 2005


Hi Simon,

sorry, I might haven't made that clear enough:
The problem only exists with changing a feature source (or type, but I 
didn't try that) because of the composite unique index in biosql 
seqfeature table, it doesn't check if the location is the same or not, 
but the combination of type, source, bioentry id and rank has to be 
unique. So if I insert a new feature, the rank gets increased by 
BioJava somehow and all is well, but if I update an existing features 
source and hit by accident the same combination as anothers fetures 
type, source, .. I get the exception and the source doesn't change.
At least that is what I suppose is happening.

My question was how to handle this situation?

Martina


Simon Foote wrote:

> Hi Martina,
> 
> Biojava should handle that correctly.  I haven't done it by changing a 
> feature source, but I have with changing a feature's location and 
> strand.  For changing a location:
> 
> // Get the Feature you wish to edit
> StrandedFeature sf = ex. use a feature filter to grab the feature by 
> it's ID
> Location loc = new Location(100, 1100);
> sf.setLocation(loc);
> 
> Since you have already retrieved the feature to edit, biojava will 
> automatically do this as an update and not an insert.  Or it should in 
> all cases where you are modifying a pre-existing feature.
> 



More information about the BioSQL-l mailing list