Forums

F.A.Q. F.A.Q.    Register Register    Login Login    Home Home
Search Search
SBML Discussions » jsbml-development » SBO parsing and biojava
Show: Today's Posts  :: Message Navigator
| Subscribe to topic 
Return to the default flat view Create a new topic Submit Reply
AuthorTopic
Andreas Dräger


Posts: 273
Registered:
June 2006
Re: SBO parsing and biojava 09 Dec '10 09:58 Go to previous messageGo to previous message

Hi guys,

I don't think it is necessary to develop yet another parser. The BioJava
parser works perfectly.

> An example :
>
> What we have in the Term object :
>
> Term : SBO:0000368 is_a SBO:0000161
> Term name : SBO:0000368 is_a SBO:0000161
> Term Desc : is_a-relationship
> Term Synonyms : 0
> Term Synonyms : [Ljava.lang.Object;@eb1c260
> Tern Annotation keys : []
> Tern Annotation size : 0

I bet, to create this example you simply used the toString() method in
the Term object.

> What is on the SBO OBO file :
>
> [Term]
> id: SBO:0000368
> name: reverse non-integral order rate constant\, continuous case
> def: "Numerical parameter that quantifies the reverse velocity of a
> chemical reaction where products have non-integral orders. This
> parameter encompasses all the contributions to the velocity except the
> quantity of the products. It is to be used in a reaction modelled using
> a continuous framework. " [src_code:NR]
> is_a: SBO:0000161 ! reverse non-integral order rate constant

It is a little more sophisticated to obtain this information again from
the Term object, but it works. Please try the following code:

import org.biojava.bio.Annotation;
import org.biojava.ontology.Term;
import org.sbml.jsbml.SBO;

/**
* @author Andreas Dräger
*
*/
public class SBOTest {

/**
* @param args an SBO term identifier, e.g., "368".
*/
public static void main(String[] args) {
int id = Integer.parseInt(args[0]);
Term term = SBO.getTerm(id);
Annotation annotation;
Object definition;
String description, def;
if (term != null) {
annotation = term.getAnnotation();
definition = annotation != null ? annotation.getProperty("def")
: null;
def = definition != null ? definition.toString() : "";
def = def.replace("\\n", " ").replace("\\", "");
if (def.startsWith("\"")) {
def = def.substring(1, def.lastIndexOf('"'));
}
def = def.trim();
description = term.getDescription().replace("\\n", " ").replace(
"\\,", ",").trim();
System.out.printf("[Term]\nid:\t%s:%s\n", SBO.getOntology()
.getName(), SBO.sboNumberString(id));
System.out.printf("name:\t%s\n", description);
System.out.printf("def:\t%s\n", def);
}
}

}


And you will obtain:

[Term]
id: SBO:0000368
name: reverse non-integral order rate constant, continuous case
def: Numerical parameter that quantifies the reverse velocity of a
chemical reaction where products have non-integral orders. This
parameter encompasses all the contributions to the velocity except the
quantity of the products. It is to be used in a reaction modelled using
a continuous framework.


for the example above. Nice, isn't it?

Cheers
Andreas


--
Dipl.-Bioinform. Andreas Dräger
Eberhard Karls University Tübingen
Center for Bioinformatics (ZBIT)
Sand 1
72076 Tübingen
Germany

Phone: +49-7071-29-70436
Fax: +49-7071-29-5091
____________________________________________________________
To manage your jsbml-development list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/jsbml-development

For a web interface to the jsbml-development mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the jsbml-development list,
contact sbml-team@caltech.edu

      

SubjectPosterDate
Read Message   SBO parsing and biojava rodrigue09 Dec '10 08:23
Read Message   Re: SBO parsing and biojava rodrigue09 Dec '10 08:35
Read Message   Re: SBO parsing and biojava Camille Laibe09 Dec '10 08:44
Read Message   Re: SBO parsing and biojava Andreas Dräger09 Dec '10 08:59
Read Message   Re: SBO parsing and biojava rodrigue09 Dec '10 09:04
Read Message   Re: SBO parsing and biojava  Andreas Dräger09 Dec '10 09:58
Read Message   Re: SBO parsing and biojava rodrigue10 Dec '10 01:54
Read Message   Re: SBO parsing and biojava Andreas Dräger10 Dec '10 01:59
Read Message   Re: SBO parsing and biojava rodrigue10 Dec '10 02:25
Read Message   Re: SBO parsing and biojava Andreas Dräger10 Dec '10 02:39
Read Message   Re: SBO parsing and biojava Sarah Keating11 Dec '10 07:36
Read Message   Re: SBO parsing and biojava rodrigue13 Dec '10 01:57
Read Message   Re: SBO parsing and biojava rodrigue13 Dec '10 06:43
Read Message   Re: SBO parsing and biojava Andreas Dräger13 Dec '10 08:06
Read Message   Re: SBO parsing and biojava rodrigue13 Dec '10 08:33
Read Message   Re: SBO parsing and biojava Mike Hucka14 Dec '10 13:36
Read Message   Re: SBO parsing and biojava Andreas Dräger15 Dec '10 00:11
Read Message   Re: SBO parsing and biojava rodrigue15 Dec '10 02:05
Read Message   Re: SBO parsing and biojava Mike Hucka15 Dec '10 08:52
Read Message   Re: SBO parsing and biojava Camille Laibe09 Dec '10 09:14
Read Message   Re: SBO parsing and biojava rodrigue09 Dec '10 09:22
Read Message   Re: SBO parsing and biojava Andreas Dräger09 Dec '10 08:38
Read Message   Re: SBO parsing and biojava rodrigue09 Dec '10 08:56
Previous Topic:Summary of open problems
Next Topic:Yet another abstract data type
Go to forum:
-=] Back to Top [=-

Powered by FUDforum. (Copyright Advanced Internet Designs Inc.)

Please use our issue tracking system for any questions or suggestions about this website.