[Biojava-l] MergeAnnotation question

Matthew Pocock matthew_pocock at yahoo.co.uk
Thu Feb 20 02:32:08 EST 2003


Hi Lagesen,

This is strange. We do use the merging annotation stuff extensively 
inside biojava, so I'm not quite sure what is going on here. Could you 
send a small program (or your complete program if you can't be bothered 
to cut it down) so that we can sort this out?

Matthew

Karin Lagesen wrote:
> I try to use a MergeAnnotation object to merge the annotation of two
> features. This I do like this:
> 
>    MergeAnnotation mergeAnn = new MergeAnnotation();
>    mergeAnn.addAnnotation(before.getAnnotation());
>    mergeAnn.addAnnotation(after.getAnnotation());
> 
> This mergeAnn object is then used in a SequenceFactory to make a
> feature of the sequence in between two sequences.
> 
> I have however come across a curious problem. When I try to list all
> the features in this MergeAnnotation like this:
> 
>    Annotation seqAn = f.getAnnotation();
>    for (Iterator it = seqAn.keys().iterator(); it.hasNext();) {
>       Object key = it.next();
>       Object value = seqAn.getProperty(key);
>       annotation += (key.toString() + ": " + value.toString());
>    }       
> 
> I get this error message:
> 
> Exception in thread "main" java.util.NoSuchElementException: Can't
> find property [description_line, description] 
> at org.biojava.bio.MergeAnnotation.getProperty(MergeAnnotation.java:110)
> at no.uio.labmed.intergene.ProcessFiles.process(Unknown Source)
> at no.uio.labmed.InterGene.main(Unknown Source)
> 
> When I do a tostring on the key, I get this:
> 
> Key [description_line, description]
> 
> 
> It seems like in a MergeAnnotation object the key becomes composed
> of both the key and the property of that key. Is this how it is
> supposed to be, am I misunderstanding things, or is this a bug?
> 
> TIA,
> 
> 
> Karin


-- 
BioJava Consulting LTD - Support and training for BioJava
http://www.biojava.co.uk

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com



More information about the Biojava-l mailing list