[basedb-devel] setting annotation values programmatically

2008-04-11 Thread Micha Bayer
Hi all,

I am in the final throes of adding the custom interface to the tab2mage
importer plugin but I have one more thing to do before it all works as
specified, and that is to set values for the experimental factors on
each of the raw bioassays added to the experiment so they can all be
displayed in the experiment's detail view (at the moment I am just
getting an empty list). 

I have been looking through the API and the dev docu for this but to no
avail. Can anyone point me in the right direction here? 

I think the raw bioassays should probably be inheriting these values
from the Sample objects they are linked to but I figure out how to a)
add an annotation to a sample or any other item for that matter, and b)
how to let the bioassay inherit this programmatically.

Cheers

Micha

==
Dr Micha M Bayer
Bioinformatics Specialist
Genetics Programme
The Scottish Crop Research Institute
Invergowrie
Dundee
DD2 5DA
Scotland, UK
Telephone +44(0)1382 562731 ext. 2309
Fax +44(0)1382 562426
http://www.scri.ac.uk/staff/michabayer
==
 

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

SCRI, Invergowrie, Dundee, DD2 5DA.  
The Scottish Crop Research Institute is a charitable company limited by 
guarantee. 
Registered in Scotland No: SC 29367.
Recognised by the Inland Revenue as a Scottish Charity No: SC 006662.


DISCLAIMER:

This email is from the Scottish Crop Research Institute, but the views 
expressed by the sender are not necessarily the views of SCRI and its 
subsidiaries.  This email and any files transmitted with it are confidential 
to the intended recipient at the e-mail address to which it has been 
addressed.  It may not be disclosed or used by any other than that addressee.
If you are not the intended recipient you are requested to preserve this 
confidentiality and you must not use, disclose, copy, print or rely on this 
e-mail in any way. Please notify [EMAIL PROTECTED] quoting the 
name of the sender and delete the email from your system.

Although SCRI has taken reasonable precautions to ensure no viruses are 
present in this email, neither the Institute nor the sender accepts any 
responsibility for any viruses, and it is your responsibility to scan the email 
and the attachments (if any).


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
basedb-devel mailing list
basedb-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/basedb-devel


Re: [basedb-devel] setting annotation values programmatically

2008-04-11 Thread Nicklas Nordborg
Micha Bayer wrote:
 Hi all,
 
 I am in the final throes of adding the custom interface to the tab2mage
 importer plugin but I have one more thing to do before it all works as
 specified, and that is to set values for the experimental factors on
 each of the raw bioassays added to the experiment so they can all be
 displayed in the experiment's detail view (at the moment I am just
 getting an empty list). 
 
 I have been looking through the API and the dev docu for this but to no
 avail. Can anyone point me in the right direction here? 
 
 I think the raw bioassays should probably be inheriting these values
 from the Sample objects they are linked to but I figure out how to a)
  add an annotation to a sample or any other item

Annotatable item = ...
AnnotationType at = ...
Annotation a = item.getAnnotationSet().getAnnotation(at);

// For a single annotation value
a.setValue(...);

// if it is multiple values
a.setValues(...);

 b) how to let the bioassay inherit this programmatically.

Annotatable child = ...
Annotatable parent = ...
AnnotationType at = ...
Annotation a = parent.getAnnotationSet().getAnnotation(at);

// To inherit a single annotation
child.getAnnotationSet().inheritAnnotation(a);

// To inherit all annotations
child.getAnnotationSet().inheritAnnotationSet(parent.getAnnotationSet());

/Nicklas

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
basedb-devel mailing list
basedb-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/basedb-devel