Hello -

We recently had some questions on the list about getting information out 
of a RichAnnotation. This would be one way to do it ...



RichAnnotation theAnnotation = (RichAnnotation)seq.getAnnotation();
Iterator notesIterator = theAnnotation.getNoteSet().iterator();
while (notesIterator.hasNext()) {
                   System.out.println();
                   Note note = (Note)notesIterator.next(); 
                   System.out.println(note);
}

All notes have a Term and a value. The value is a String and the Term is 
an ontology term.

Term term = note.getTerm();
String value = note.getValue();

The term has a name which is also a String

String name = term.getName();

So to get the name, value pair of a note you would do this:


String name = note.getTerm().getName();
String value = note.getValue();

Which is pretty much what the Note toString() method does.

- Mark


Mark Schreiber
Research Investigator (Bioinformatics)

Novartis Institute for Tropical Diseases (NITD)
10 Biopolis Road
#05-01 Chromos
Singapore 138670
www.nitd.novartis.com

phone +65 6722 2973
fax  +65 6722 2910

_______________________________________________
Biojava-l mailing list  -  Biojava-l@biojava.org
http://biojava.org/mailman/listinfo/biojava-l

Reply via email to