Today's Posts (ON) | Unanswered Posts (OFF)

| Forum: jsbml-development |
|---|
| Topic: http://jsbml.sourceforge.net/ updated |
|---|
Posts: 307
Location: Cambridge UK
Registered: February 2005
|
|
Re: http://jsbml.sourceforge.net/ updated
|
03 Aug '10 01:42
|
 |
|
On 08/02/2010 12:53 PM, Andreas Dräger wrote:
> Hi Nico,
>
> Thanks for creating the first draft of the JSBML homepage. It looks very
> nice. However, it seems that when clicking on any one of the links in
> the left frame, only the left frame is replaced by the link target. This
> is probably not intended.
>
Well spotted, I tend to always open link in new tabs so had not notice that.
Should be fine now.
Cheers,
Nico
____________________________________________________________
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
|
|
| | Topic: New abstract class for rules? |
|---|
Posts: 273
Registered: June 2006
|
|
New abstract class for rules?
|
05 Aug '10 07:01
|
 |
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Dear all,
on the tracker list someone posted that it is not handy enough to deal
with rules in JSBML because in contrast to libSBML we do not have a
variable field in algebraic rules. Hence, one cannot do things like
Rule r = new RateRule;
r.getVariable();
or
if (r.isSetVariable()) {
...
}
However, this is for a reason. Algebraic rules do not have an explicit
variable, they only implicitely define which element acts as variable.
Hence, it is correct not to put the methods getVariable() etc. into the
abstract class Rule.
To simplify working with rules, we now have two options.
1. We can introduce a new common super class for rate rules and
assignment rules, e.g., ExpliciteRule, that contains methods for
setting, getting and questioning for the variable element.
2. We can use our bipartite matching algorithm that is already
implemented to identify the variable element in algebraic rules and also
provide a getVariable() and getVariableInstance() method there. However,
we cannot provide a method setVariable(...) there. The method
isSetVariable() in AlgebraicRule could check whether it is possible to
uniquely identify the variable element for this rule. Once the variable
for an algebraic rule has been identified, a direct link to it should be
saved as a private field variable in the class. But when changing the
structure of the model, it may happen that we have to remove this direct
link. Hence, am I right that in this case an AssignmentRule would have
to implement the SBaseListener interface for the model, and all of its
reactions and rules. This would then introduce a lot of additional
complexity but would definitely increase the usability of our library.
Still the abstract data type ExpliciteRule would make sense to provide
set methods for variables.
What do you guys think?
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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJMWsQ8AAoJEGvTRw2gArT9CQ4H/0nycBHbTQNJxN3Dbq8NZfnU
lj3tdyEcd0s4eNEpnSToTpq2o8a6tRkMI6M3P2JANm6+KhAWvisKE9jNC+rl5nSl
d16HUAd5EDu4JsbEh431qWdh86kx9wBh2avuJsRgt+7ZYdeZkIUn9eREy/jbZ39Z
YfDAWUEltnveOTpcEUTVBFM9B3lBynFrMkqy71lMj9mJVsXMzbAxRlIibE2vs7KS
8oK5MTB3KtfScAhB8zfsifGL/lNt90t4ghmwfjfyHYI883YUHcq14Y4X9LHUqS/L
z8oH3EOZzNQTcVZ6nC0C66d0Hx0IEM3y9gWA0yQlttUW8qwsDL45fn4CouARhA8=
=KLre
-----END PGP SIGNATURE-----
____________________________________________________________
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
|
|
|
Posts: 307
Location: Cambridge UK
Registered: February 2005
|
|
Re: New abstract class for rules?
|
05 Aug '10 07:32
|
 |
|
On 08/05/2010 03:01 PM, Andreas Draeger wrote:
> Dear all,
>
> on the tracker list someone posted that it is not handy enough to deal
> with rules in JSBML because in contrast to libSBML we do not have a
> variable field in algebraic rules. Hence, one cannot do things like
>
> Rule r = new RateRule;
> r.getVariable();
>
> or
>
> if (r.isSetVariable()) {
> ...
> }
>
> However, this is for a reason. Algebraic rules do not have an explicit
> variable, they only implicitely define which element acts as variable.
> Hence, it is correct not to put the methods getVariable() etc. into the
> abstract class Rule.
>
> To simplify working with rules, we now have two options.
>
> 1. We can introduce a new common super class for rate rules and
> assignment rules, e.g., ExpliciteRule, that contains methods for
> setting, getting and questioning for the variable element.
>
> 2. We can use our bipartite matching algorithm that is already
> implemented to identify the variable element in algebraic rules and also
> provide a getVariable() and getVariableInstance() method there. However,
> we cannot provide a method setVariable(...) there. The method
> isSetVariable() in AlgebraicRule could check whether it is possible to
> uniquely identify the variable element for this rule. Once the variable
> for an algebraic rule has been identified, a direct link to it should be
> saved as a private field variable in the class. But when changing the
> structure of the model, it may happen that we have to remove this direct
> link. Hence, am I right that in this case an AssignmentRule would have
> to implement the SBaseListener interface for the model, and all of its
> reactions and rules. This would then introduce a lot of additional
> complexity but would definitely increase the usability of our library.
> Still the abstract data type ExpliciteRule would make sense to provide
> set methods for variables.
>
> What do you guys think?
>
I would go for option 1 to have something easy.
We could still modify the AlgebraicRule class but may be with some
different function names, like getGuessedVariable() for example.
And if we do not store the variable identified but recalculate it each
time, we could avoid adding to much complexity with the listeners. There
is not so many AlgebraicRule, at least on Biomodels DB and if we put in
the javadoc that it is re-calculated at each call, it should be fine for
the users ?
Nico
____________________________________________________________
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
|
|
|
Posts: 273
Registered: June 2006
|
|
Re: New abstract class for rules?
|
05 Aug '10 13:05
|
 |
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Dear all,
Ok, we now have a new abstract data type ExplicitRule for RateRules and
AssignmentRules. For AlgebraicRules, I will also implement a method to
easily access the actual variable using the bipartite matching algorithm.
However, while restructering everything, I had a look into diverse SBML
specifications. We still maintain these boolean functions for isScalar,
isParameter... for Level 1 compatibility. This is totally correct and
should be treated as it is. However, what I noticed is that in Level 1
we didn't have RateRules. We only had AssignmentRules, where RateRules
are actually a special type of AssignmentRules because they do not
modify a scalar but the derivative of a scalar. Hence, it is very
similar and probably the reason why SBML evolved as it did.
In any case, the unit attribute applies to those AssignmentRules that
modify Parameters, irrespective of whether their variable represents a
scalar or its derivative. This means that the unit attribute should not
be assigned to the AssignmentRule class. It belongs to the abstract type
ExplicitRule, because it may be used for a RateRule as well. At the same
time, we have to ensure that the unit attribute can only be set if the
Rate/AssignmentRule's variable is a Parameter or - the other way around
- - we can only assign an instance of Parameter as its variable if a unit
is set, I mean, if a unit is set already, we must not allow users to
assign any other instance of Variable but Parameters.
If you agree, I'll implement these changes.
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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJMWxmXAAoJEGvTRw2gArT9djEH/3RvU6QaZxFsPjmlaPqZ/BD0
kFtLbthYhrw93RuKSivjz0Q/iUwa1/2XmDOVhxIsgAlYHCX4ksmabllCVaEXMoeN
Srmd2JExDBeoEqPByMwRFWiJvIXcWWzayMJ7yiJrCtIKXCMqiqRl+7KGgvFedJU/
ayi1pKwVvS+D51GWFYZ5mt9nBsSGd5qSzSxxFKulT6dSG6vy9EikIF4irHjJMtia
6Ana+FBXfejGCgyWpUMrCbwr7ItIQB3ajCOcGbAgep0aJynUzFaIRfofPQ2LafEO
XSPqUdz8mym8ol79dEKSjVWrAea2t+gG1+kTwnZ6UczRmjCEA3eYaperoUuw+Bs=
=L7tu
-----END PGP SIGNATURE-----
____________________________________________________________
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
|
|
|
Posts: 307
Location: Cambridge UK
Registered: February 2005
|
|
Re: New abstract class for rules?
|
06 Aug '10 02:46
|
 |
|
On 08/05/2010 09:05 PM, Andreas Draeger wrote:
> Ok, we now have a new abstract data type ExplicitRule for RateRules and
> AssignmentRules. For AlgebraicRules, I will also implement a method to
> easily access the actual variable using the bipartite matching algorithm.
>
Thanks for that.
> However, while restructering everything, I had a look into diverse SBML
> specifications. We still maintain these boolean functions for isScalar,
> isParameter... for Level 1 compatibility. This is totally correct and
> should be treated as it is. However, what I noticed is that in Level 1
> we didn't have RateRules. We only had AssignmentRules, where RateRules
> are actually a special type of AssignmentRules because they do not
> modify a scalar but the derivative of a scalar. Hence, it is very
> similar and probably the reason why SBML evolved as it did.
>
> In any case, the unit attribute applies to those AssignmentRules that
> modify Parameters, irrespective of whether their variable represents a
> scalar or its derivative. This means that the unit attribute should not
> be assigned to the AssignmentRule class. It belongs to the abstract type
> ExplicitRule, because it may be used for a RateRule as well. At the same
> time, we have to ensure that the unit attribute can only be set if the
> Rate/AssignmentRule's variable is a Parameter or - the other way around
> - - we can only assign an instance of Parameter as its variable if a unit
> is set, I mean, if a unit is set already, we must not allow users to
> assign any other instance of Variable but Parameters.
>
> If you agree, I'll implement these changes.
>
We could create classes ParameterAssignmentRule and ParameterRateRule
that extend AssignmentRule and RateRule ?
Then we can put there the units variable and functions as it is not
needed any where else. We still need to check that it is created only
with a parameter.
Not sure if it will be better than making the checks in the actual
classes but one or the other way, I agree that we need to implement
these changes.
Also, by the absence of the type attribute in the AssigmentRule class,
we assume that the parser is creating a RateRule if it encounter a level
1 AssignmentRule with the type=rate. Did you check that it is doing that
? Or should I check ?
Nico
____________________________________________________________
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
|
|
|
Posts: 273
Registered: June 2006
|
|
Re: New abstract class for rules?
|
06 Aug '10 04:07
|
 |
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Dear all,
>> Ok, we now have a new abstract data type ExplicitRule for RateRules and
>> AssignmentRules. For AlgebraicRules, I will also implement a method to
>> easily access the actual variable using the bipartite matching algorithm.
Ok, this will be done soon.
> We could create classes ParameterAssignmentRule and ParameterRateRule
> that extend AssignmentRule and RateRule ?
> Then we can put there the units variable and functions as it is not
> needed any where else. We still need to check that it is created only
> with a parameter.
This wouldn't solve the problem, because then we would have to make sure
that the super types accept everything but Parameters as variables and
hence would require a new interface, making everything more complicated.
Otherwise, one could still create RateRules and AssignmentRules with
Parameters as variables and would not be able to set their unit. In
addition, we would implement the functionality to manipulate the units
of the rules twice.
> Not sure if it will be better than making the checks in the actual
> classes but one or the other way, I agree that we need to implement
> these changes.
Sorry, but the solution with new data types is much more complicated
than simply creating some if/else checks and throwing some exceptions.
If possible, I'd like to implement this next week.
> Also, by the absence of the type attribute in the AssigmentRule class,
> we assume that the parser is creating a RateRule if it encounter a level
> 1 AssignmentRule with the type=rate. Did you check that it is doing that
> ? Or should I check ?
I didn't check the parsers because I still use libSBML for reading/writing.
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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJMW+0NAAoJEGvTRw2gArT9XPsIAJe7+Oo/xVCT+fma3hfmF2lj
GJ4yUoS2NnveqRiE0giNScL4QD/i09M8tpy7XRy49pytIHjbIT84m3Nkmmb/IS4W
uvJNWczNp+mS4XFJLUlu3IJo6l6v6ReJ3dui4Bzwc/RbM2FnHg0L/eN6hPwYxYVo
CqluevkoAJtTXCxHxqPjkDFw2/eMo+CozJ4tak1LHfEofMph4dGM15ndnt7YgEKc
Jdrv6633WaSH3N813DVFSAEJoJmtVy5bROGgwJzWSbf4N2qrkebi5wqchrrvGKxT
cBF6U08u5FjS91iykNWttZLdnReTbVO1ve8eVaQU3mURXc90A8eT++U+r3qb7/Q=
=aToR
-----END PGP SIGNATURE-----
____________________________________________________________
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
|
|
|
Posts: 307
Location: Cambridge UK
Registered: February 2005
|
|
Re: New abstract class for rules?
|
06 Aug '10 06:03
|
 |
|
On 08/06/2010 12:07 PM, Andreas Draeger wrote:
>> We could create classes ParameterAssignmentRule and ParameterRateRule
>> that extend AssignmentRule and RateRule ?
>> Then we can put there the units variable and functions as it is not
>> needed any where else. We still need to check that it is created only
>> with a parameter.
> This wouldn't solve the problem, because then we would have to make sure
> that the super types accept everything but Parameters as variables and
> hence would require a new interface, making everything more complicated.
> Otherwise, one could still create RateRules and AssignmentRules with
> Parameters as variables and would not be able to set their unit. In
> addition, we would implement the functionality to manipulate the units
> of the rules twice.
>
Just to be sure, you can only set a units on level 1
>> Not sure if it will be better than making the checks in the actual
>> classes but one or the other way, I agree that we need to implement
>> these changes.
> Sorry, but the solution with new data types is much more complicated
> than simply creating some if/else checks and throwing some exceptions.
> If possible, I'd like to implement this next week.
>
Fine with me. We should document how to create level 1 rules then, if we
do not have the ParameterRule, SpeciesConcentrationRule and
CompartmentVolumeRule classes.
>> Also, by the absence of the type attribute in the AssigmentRule class,
>> we assume that the parser is creating a RateRule if it encounter a level
>> 1 AssignmentRule with the type=rate. Did you check that it is doing that
>> ? Or should I check ?
> I didn't check the parsers because I still use libSBML for reading/writing.
So I will check the stax parser but you should check that on the libsbml
parser you create properly AssigmentRule or RateRule depending of the
value of the type attribute.
Cheers,
Nico
____________________________________________________________
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
|
|
|
Posts: 273
Registered: June 2006
|
|
Re: New abstract class for rules?
|
06 Aug '10 15:44
|
 |
|
Thanks Nicolas,
> Just to be sure, you can only set a units on level 1
Of course, I know.
>>> Not sure if it will be better than making the checks in the actual
>>> classes but one or the other way, I agree that we need to implement
>>> these changes.
>> Sorry, but the solution with new data types is much more complicated
>> than simply creating some if/else checks and throwing some exceptions.
>> If possible, I'd like to implement this next week.
>>
> Fine with me. We should document how to create level 1 rules then, if we
> do not have the ParameterRule, SpeciesConcentrationRule and
> CompartmentVolumeRule classes.
I'm not sure. I mean, we could create two new classes for level 1 only:
ParameterAssignmentRule and ParameterRateRule both extending a common
type that extends ExplicitRule. This would cause three more types and it
would be for use of Level 1 only. Should we do so much effort for the
more or less deprecated Level 1? If the majority decides yes, we should,
but I think it is sufficient not to provide these special classes, but
to cover everything with the classes present at the moment.
>>> Also, by the absence of the type attribute in the AssigmentRule class,
>>> we assume that the parser is creating a RateRule if it encounter a level
>>> 1 AssignmentRule with the type=rate. Did you check that it is doing that
>>> ? Or should I check ?
>> I didn't check the parsers because I still use libSBML for reading/writing.
> So I will check the stax parser but you should check that on the libsbml
> parser you create properly AssigmentRule or RateRule depending of the
> value of the type attribute.
Thank you! I want to switch to JSBML parsers step by step. But a the
moment it is still nice to compare what libSBML creates when reading a
model and then to see the data structures in contrast to what we do.
Maybe we should compare the results when reading with both methods.
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
|
|
|
Posts: 307
Location: Cambridge UK
Registered: February 2005
|
|
Re: New abstract class for rules?
|
09 Aug '10 01:52
|
 |
|
On 08/06/2010 11:44 PM, Andreas Dräger wrote:
> Thanks Nicolas,
>> Just to be sure, you can only set a units on level 1
> Of course, I know.
>
>>>> Not sure if it will be better than making the checks in the actual
>>>> classes but one or the other way, I agree that we need to implement
>>>> these changes.
>>> Sorry, but the solution with new data types is much more complicated
>>> than simply creating some if/else checks and throwing some exceptions.
>>> If possible, I'd like to implement this next week.
>>>
>> Fine with me. We should document how to create level 1 rules then, if we
>> do not have the ParameterRule, SpeciesConcentrationRule and
>> CompartmentVolumeRule classes.
> I'm not sure. I mean, we could create two new classes for level 1 only:
> ParameterAssignmentRule and ParameterRateRule both extending a common
> type that extends ExplicitRule. This would cause three more types and it
> would be for use of Level 1 only. Should we do so much effort for the
> more or less deprecated Level 1? If the majority decides yes, we should,
> but I think it is sufficient not to provide these special classes, but
> to cover everything with the classes present at the moment.
>
I agree we should not add other classes at the moment. We just need to
explain at some point to somebody reading the level 1 specs
and wanting to create a level 1 model how to create the Rules with
JSBML, that he has to use AssignmentRule or Rate Rule depending of the
type of level 1 "assignmentRule" he want.
Nico
____________________________________________________________
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
|
|
| | Topic: initDefaults |
|---|
Posts: 273
Registered: June 2006
|
|
initDefaults
|
10 Aug '10 06:23
|
 |
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Dear all,
I just noticed that we have different opinions about what the method
initDefaults() in some classes should do. My opinion is that it always
knows what to do depending on the level and version properties. If, for
instance, neither level nor version are set, initDefaults will perform
the correct operations to set some elements to null and some isSet*
fields to false. If, however, level and/or version are set,
initDefaults() will also know how to initialize all fields of the
respective element for the given L/V combination.
In case of reactions I noticed that suddenly the empty constructor does
not call the initDefaults() method anymore, irrespective of that we
already agreed that ListOf* objects should always be initialized to
avoid the following source of unnecessary NullPointerExceptions:
Reaction r = new Reaction();
r.getListOfModifiers().size();
will throw a NullPointerException instead of returning 0.
InitDefaults() should be used to decide what to do if neither level nor
version is set. Instead of the current implementation
public void initDefaults() {
if (isSetLevel() && isSetVersion()) {
if (level < 3) {
reversible = new Boolean(true);
fast = new Boolean(false);
} else {
reversible = fast = null;
}
initReactantList();
initProductList();
initModifierList();
}
}
it should read
public void initDefaults() {
initReactantList();
initProductList();
initModifierList();
if (isSetLevel() && isSetVersion()) {
if (level < 3) {
reversible = new Boolean(true);
fast = new Boolean(false);
} else {
reversible = fast = null;
}
} else {
reversible = fast = null;
isSetReversible = isSetFast = false;
}
}
It should be totally secure to always call initDefaults(), which will
reset the object to the correct values for the given L/V combination. It
is particularly important to have this method because we have so many
differen constructors and can sometimes not call one constructor from
another one.
For instance,
public Reaction(int level, int version) {
super(level, version);
initDefaults();
}
and
public Reaction() {
super();
// Cannot call initDefaults() until the level and version is set
// initDefaults();
}
- -> Actually, the first constructor should call the second one before
calling the super constructor, but we cannot do this. Hence, we need
initDefaults to initialize all objects.
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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJMYVLTAAoJEGvTRw2gArT9FkMH/jUOu8jAbtuIaCc2MNZNV82Z
cltkTKjqIGjmDjfkY8pQaDkNFvW6QKUYrbn812eA1fuJxuHh1FRfc9BjaAy+Y0dE
w1WHDwfpdcieDpogWGU8FWGKrkYfqyd/inOxO8uAiMcm/yu56s9jk8xun97Ri82N
XVJBEDPV5UCiAxQZ7eFQlSYpONnxBDCiHZW/8J/qI48444ay4T8xSWSH5By3Y8gq
hrkOEOUdGzGY1QRRwTKMkwJA1IvUtMhbEZwqsQOokIMdUnEvDHEgnhmUuHVguD8X
gK1YMIw2dlLKSi+Gqvxroc4jTZZ8jsVeyMQZv//FUFYJIhFTEtTQhOKgdixZDWY=
=/bZm
-----END PGP SIGNATURE-----
____________________________________________________________
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
|
|
| | Topic: ASTNode.setName setType both in libsbml and jsbml |
|---|
Posts: 307
Location: Cambridge UK
Registered: February 2005
|
|
ASTNode.setName setType both in libsbml and jsbml
|
11 Aug '10 08:50
|
 |
|
Hi,
Few remarks about libsbml and jsbml implementation of ASTNode
Checking libsbml code there :
http://sbml.svn.sourceforge.net/viewvc/sbml/trunk/libsbml/src/math/ASTNode.cpp?revision=11634&view=markup
The libsbml documentation of the method isName() is wrong, the delay
symbol is not checked. May be we should checked for avogadro also.
Plus the javadoc mention L2 and not L3, should probably just put MathML.
The jsbml has the same wrong documentation and check for AST_NAME or
AST_FUNCTION ! I changed the implementation to check only for AST_NAME_*
types.
The libsbml documentation of the method setType() does not says anything
about some values being reset depending of the type passed.
The jsbml documentation of the method setType() or setName() is also
wrong, the code does not do what the doc says. On top of that I had to
correct setName() to work correctly with csymbol, we should probably use
some of the utilities functions isXX instead of the current
((!type.toString().startsWith("NAME")) && type != Type.FUNCTION)
I am a little picky will libsbml but after Sarah and/or Mike will
complain is I mention the problems after the release :-)
Nico
____________________________________________________________
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
|
|
|
Posts: 417
Registered: May 2004
|
|
Re: ASTNode.setName setType both in libsbml and jsbml
|
16 Aug '10 05:24
|
 |
|
Hi Nico
We generate our docs from the header files. Mike has in the last week
done an overhaul of the ASTNode stuff - but only in the .h files- the
.cpp files are very likely to be wrong.
Sarah
Nicolas Rodriguez wrote:
> Hi,
>
> Few remarks about libsbml and jsbml implementation of ASTNode
>
> Checking libsbml code there :
> http://sbml.svn.sourceforge.net/viewvc/sbml/trunk/libsbml/src/math/ASTNode.cpp?revision=11634&view=markup
>
> The libsbml documentation of the method isName() is wrong, the delay
> symbol is not checked. May be we should checked for avogadro also.
> Plus the javadoc mention L2 and not L3, should probably just put MathML.
>
> The jsbml has the same wrong documentation and check for AST_NAME or
> AST_FUNCTION ! I changed the implementation to check only for AST_NAME_*
> types.
>
> The libsbml documentation of the method setType() does not says anything
> about some values being reset depending of the type passed.
>
> The jsbml documentation of the method setType() or setName() is also
> wrong, the code does not do what the doc says. On top of that I had to
> correct setName() to work correctly with csymbol, we should probably use
> some of the utilities functions isXX instead of the current
> ((!type.toString().startsWith("NAME")) && type != Type.FUNCTION)
>
> I am a little picky will libsbml but after Sarah and/or Mike will
> complain is I mention the problems after the release :-)
>
> Nico
>
>
>
____________________________________________________________
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
|
|
| | Topic: References to variables and symbols |
|---|
Posts: 273
Registered: June 2006
|
|
References to variables and symbols
|
24 Aug '10 02:03
|
 |
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Dear all,
Alexander and I just noticed that setting references in JSBML is not
treated equally in all classes that deal with these references.
Sometimes we check whether the model is already existing and then do
some other checks before assigning a reference, sometimes we just set
the ID to the new value.
Imagine for instance the following situation: The user creates a
Variable such as a Species. Then the user creates an instance of
ExplicitRule such as RateRule. Then the user sets the variable field of
the RateRule to the Species created just before. Afterwards the user
adds both elements to a newly created model. Currently, the set method
in ExplicitRule will check if the model already exists and will try to
avoid setting identifiers of Variables that do not yet exist.
In other elements such as EventAssignments, we do not perform such a check.
However, the problem here is that we must decide whether or not to allow
to set arbitrary strings as identifiers in case of not yet defined
models. Should we throw exceptions in case of invalid arguments? Should
we force our users to first create models and assign all elements in the
hierarchical way top down? Or should we allow for arbitrary identifiers
to be assigned leading to greater flexibility but providing a potential
source of error?
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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJMc4rNAAoJEGvTRw2gArT9XBoIALPVANVNtsKp8SZ2HxMa0i4J
mc1eURkGbi5zEX4M73X/ACE4TJpyTC5vOtUdF6v0b7TqoHAxs/jH9+EoDbXiU27x
iqHPGvfd4c2/1ahhmiexDzcJVZldYKuvgb/05u56eoLOfYTr3gyw724hwpTHfZk5
FD6fvuuFwXLcXDhBMesAEkjFYj10dfJPPq42i8NJdZklJ6faA+MKfrNU2+HKJ4Vq
gQCSq9GYi0/xUNePW5e/Y+8db1jssJ1C6zhqIo5BXx/Yj2KY+xHlo17duE0Py6+r
+Eitad936KDOLloiPl8LMgKo8PkGCH8JEtvIRznYfeXurm65+3CaVXpNPW46Jpk=
=XSDw
-----END PGP SIGNATURE-----
____________________________________________________________
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
|
|
|
Posts: 307
Location: Cambridge UK
Registered: February 2005
|
|
Re: References to variables and symbols
|
24 Aug '10 03:48
|
 |
|
On 08/24/2010 10:03 AM, Andreas Draeger wrote:
> Dear all,
>
> Alexander and I just noticed that setting references in JSBML is not
> treated equally in all classes that deal with these references.
> Sometimes we check whether the model is already existing and then do
> some other checks before assigning a reference, sometimes we just set
> the ID to the new value.
>
> Imagine for instance the following situation: The user creates a
> Variable such as a Species. Then the user creates an instance of
> ExplicitRule such as RateRule. Then the user sets the variable field of
> the RateRule to the Species created just before. Afterwards the user
> adds both elements to a newly created model. Currently, the set method
> in ExplicitRule will check if the model already exists and will try to
> avoid setting identifiers of Variables that do not yet exist.
>
> In other elements such as EventAssignments, we do not perform such a check.
>
> However, the problem here is that we must decide whether or not to allow
> to set arbitrary strings as identifiers in case of not yet defined
> models. Should we throw exceptions in case of invalid arguments? Should
> we force our users to first create models and assign all elements in the
> hierarchical way top down? Or should we allow for arbitrary identifiers
> to be assigned leading to greater flexibility but providing a potential
> source of error?
>
It is kind a mandatory to be able to set arbitrary string (meaning, you
cannot check immediately in the model to see if the id is valid).
This is also why we are storing only the id String in all the class and
not the Object. For level 3, the order of the listOfXXX in the model element
will not be mandatory so when we parse, we can only store the id. It is
only when the model is completely read that you should be able to
validate the model
and see if any ids are invalid.
Nico
____________________________________________________________
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
|
|
| | Topic: Survey for selecting JSBML logo |
|---|
Posts: 967
Registered: October 2003
|
|
Survey for selecting JSBML logo
|
17 Sep '10 08:37
|
 |
|
Hello SBML enthusiasts and developers,
The JSBML project has been trying to choose a logo. It is
time to get more opinions and put things to a vote. Here's
a survey for this purpose:
http://www.surveymonkey.com/s/choosing-jsbml-logo
The deadline is midnight, Sep. 22 (in your timezone).
Please help the project by rating the different logo
options. You can give them values from 1 to 10, with 10
being the highest/best score. You do not have to rate every
one, and you do not have to use a rating only once. (So,
for example, if you like 2 choices equally, you can give
them the same rating.)
The winning logo will be the one that gets the highest mean
rating from among all the votes cast.
Thanks for your help,
MH (on behalf of JSBML)
____________________________________________________________
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
|
|
| | Topic: Default UnitDefinition modifications (rev 315) |
|---|
Posts: 307
Location: Cambridge UK
Registered: February 2005
|
|
|
Posts: 273
Registered: June 2006
|
|
Re: Default UnitDefinition modifications (rev 315)
|
22 Sep '10 00:32
|
 |
|
Hi all,
To be consistent with the SBML specification, we should not use the term
"default" for these units, but call it "pre-defined". The earlier term
was "built-in", which has been rejected as far as I know. Nico, can you
please rename all methods and variable names from "...default..." to
"...predefined..."?
Thank you
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
|
|
|
Posts: 307
Location: Cambridge UK
Registered: February 2005
|
|
Re: Default UnitDefinition modifications (rev 315)
|
22 Sep '10 01:33
|
 |
|
On 09/22/2010 08:32 AM, Andreas Draeger wrote:
> Hi all,
>
> To be consistent with the SBML specification, we should not use the term
> "default" for these units, but call it "pre-defined". The earlier term
> was "built-in", which has been rejected as far as I know. Nico, can you
> please rename all methods and variable names from "...default..." to
> "...predefined..."?
>
Yes, I can do that, no problem.
Cheers,
Nico
____________________________________________________________
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
|
|
|
Posts: 967
Registered: October 2003
|
|
Re: Default UnitDefinition modifications (rev 315)
|
22 Sep '10 10:36
|
 |
|
On Wed, 22 Sep 2010 09:32:11 +0200, Andreas Draeger wrote:
> To be consistent with the SBML specification, we should not use the term
> "default" for these units, but call it "pre-defined". The earlier term
> was "built-in", which has been rejected as far as I know.
That's true. The problem was that "default" had been used in multiple ways in the specification: default values, and predefined unit names. This was confusing, so in later iterations of the spec, we tried to avoid it.
(Unfortunately, this leads to a new confusion: the way that the old documents refer to the same things is different from how the new documents do. Oh well.)
MH
____________________________________________________________
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
|
|
| | Topic: Errors when trying to use jsbml in place of libsbml |
|---|
Posts: 3
Registered: July 2006
|
|
Errors when trying to use jsbml in place of libsbml
|
09 Oct '10 09:00
|
 |
|
Hi Nico,
I tried to drop jsbml in place of libsbml in our tool, iBioSim, and found
several problems:
1) SBMLWriter and SBMLReader are in the org.sbml.jsbml.xml.stax package
and need to be in the org.sbml.jsbml package. Also, they do not have
readSBML() or writeSBML() methods.
2) Consistency checking is located in the SBMLValidator and needs to be
in the SBMLDocument, e.g. SBMLDocument.checkConsistency() and
SBMLDocument.getError().
3) Missing methods:
Reaction.createKineticLaw()
InitialAssignment.setSymbol()
Unit.isAvogadro()
Unit.getExponentAsDouble()
FunctionDefinition.getNumArguments()
FunctionDefinition.getArgument()
FunctionDefinition.getBody()
Rule.getVariable() - you mentioned a subclass of Rule that both
AssignmentRule and RateRule implement that have the getVariable() method.
4) KineticLaw.addParameter() requires a LocalParameter instead of
Parameter. addParameter has been overloaded in libsbml to accept a
Parameter and automatically changes it into a LocalParameter.
5) SBMLDocument.createModel() requires an id string in jsbml but does
not in libsbml.
6) New SBML Level 3 Event semantics are missing, e.g.
Trigger.setPersistent(boolean), Trigger.setInitialValue(boolean),
Event.createPriority(), etc.
These are the major issues that I was able to identify. If I find more
problems, I'll let you know.
Thanks,
Curtis
____________________________________________________________
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
|
|
|
Posts: 273
Registered: June 2006
|
|
Re: Errors when trying to use jsbml in place of libsbml
|
13 Oct '10 06:19
|
 |
|
Hi Curtis,
> I tried to drop jsbml in place of libsbml in our tool, iBioSim, and found
> several problems:
Thanks for this experiment.
> 1) SBMLWriter and SBMLReader are in the org.sbml.jsbml.xml.stax package
> and need to be in the org.sbml.jsbml package. Also, they do not have
> readSBML() or writeSBML() methods.
All methods in this class are static and also the name has been
simplified to just "read" or "write", because what else should an
SBMLReader/Writer read or write. But, of course, we can easily add these
additional methods that would basically simply call the static methods.
> 2) Consistency checking is located in the SBMLValidator and needs to be
> in the SBMLDocument, e.g. SBMLDocument.checkConsistency() and
> SBMLDocument.getError().
I think this can also be implemented easily.
> 3) Missing methods:
>
> Reaction.createKineticLaw()
Thanks for pointing this out. We'll add this method.
> InitialAssignment.setSymbol()
Unfortunately, we cannot support this method. This seems to be
confusing. However, JSBML is implemented with respect to SBML Level 3,
even though we currently can only guarantee to fully support Level 2.
However, in L3, InitialAssignments may also be applied to instances of
SpeciesReference. Symbols are, however, only Compartments, Species, and
Parameters. JSBML applies the term Variable as the name of an interface
covering these three Symbols and also SpeciesReferences. You can
therefore find the method setVariable(v).
> Unit.isAvogadro()
Thanks.
> Unit.getExponentAsDouble()
Actually, this method is not needed because the getExponent() method in
JSBML's Unit object always returns double values. We could add this
method for consistency with libSBML but it will be redundant and we
should then mark it as deprectated. Do we really need it?
> FunctionDefinition.getNumArguments()
Thanks.
> FunctionDefinition.getArgument()
Here you mean get the argument with a certain index, right? If yes, we
should add it as well.
> FunctionDefinition.getBody()
I this really missing? Surprise. Thanks.
> Rule.getVariable() - you mentioned a subclass of Rule that both
> AssignmentRule and RateRule implement that have the getVariable() method.
This method cannot be supported by JSBML because a Rule does in general
not have a Variable. In JSBML we introduced the abstract class
ExplicitRule as a super class for AssignmentRule and RateRule.
ExplicitRules do have a get/setVariable() method, but not Rules, because
AssignmentRules only may have a derived variable. There is for
convenience such a method.
> 4) KineticLaw.addParameter() requires a LocalParameter instead of
> Parameter. addParameter has been overloaded in libsbml to accept a
> Parameter and automatically changes it into a LocalParameter.
Hm. Hard decision if this should be supported. Actually, the class
LocalParameter in JSBML has a constructor that accepts instances of
Parameter as arguments. You can therefore call
myLaw.addParameter(new LocalParameter(myGlobalParameter));
and you'll be fine. However, from my perspective it makes sense to let
KineticLaws only accept LocalParameters. Maybe we should discuss this.
We could, for instance have a function such as
public void addParameter(Parameter p) {
addParameter(new LocalParameter(pI);
}
What do other people say?
> 5) SBMLDocument.createModel() requires an id string in jsbml but does
> not in libsbml.
Yeah, that's right. Originally, we once intended to have constructors
that require all necessary arguments and could therefore only support
such a createModel(id) method. However, since parsing may be much
simpler when providing empty constructors and also it enables us to let
all constructs be serializable, we have to maintain empty constructors
for all classes now. Hence, we could also have such a method
createModel(). However, as in all cases these empty constructors bare
the danger to create invalid SBML objects.
> 6) New SBML Level 3 Event semantics are missing, e.g.
> Trigger.setPersistent(boolean), Trigger.setInitialValue(boolean),
> Event.createPriority(), etc.
Right. This will be added next.
Thanks again for testing. I think these are all not big issues and we'll
have them in the project pretty soon.
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
|
|
|
Posts: 307
Location: Cambridge UK
Registered: February 2005
|
|
Re: Errors when trying to use jsbml in place of libsbml
|
13 Oct '10 06:55
|
 |
|
On 10/13/2010 02:19 PM, Andreas Dräger wrote:
> Hi Curtis,
>
>> I tried to drop jsbml in place of libsbml in our tool, iBioSim, and found
>> several problems:
>> InitialAssignment.setSymbol()
> Unfortunately, we cannot support this method. This seems to be
> confusing. However, JSBML is implemented with respect to SBML Level 3,
> even though we currently can only guarantee to fully support Level 2.
> However, in L3, InitialAssignments may also be applied to instances of
> SpeciesReference. Symbols are, however, only Compartments, Species, and
> Parameters. JSBML applies the term Variable as the name of an interface
> covering these three Symbols and also SpeciesReferences. You can
> therefore find the method setVariable(v).
I would disagree here. The SBML specifications define the attribute as
symbol, so
it is only logical to have a set/getSymbol in the InitialAssignment class.
The user would be confuse if there was not this method, plus libSBML
does not have the setVariable
methods and it would be introducing an incompatibility for nothing (both
to the SBML specs and libSBML).
And it is hard to make an easy distinction like the one you propose, as
in level 2, the symbol on InitialAssignment represent only
Compartments, Species, and Parameters but in level 3, the same symbol
represent also SpeciesReferences.
>
>> Unit.getExponentAsDouble()
> Actually, this method is not needed because the getExponent() method in
> JSBML's Unit object always returns double values. We could add this
> method for consistency with libSBML but it will be redundant and we
> should then mark it as deprectated. Do we really need it?
I think, again, it does not hurt much to have this method for
compatibility with libSBML.
I would not mark it as deprecated but put in the javadoc that it is only
calling the getExponent that already return a double
and is there only for libSBML compatibility
>> Rule.getVariable() - you mentioned a subclass of Rule that both
>> AssignmentRule and RateRule implement that have the getVariable() method.
> This method cannot be supported by JSBML because a Rule does in general
> not have a Variable. In JSBML we introduced the abstract class
> ExplicitRule as a super class for AssignmentRule and RateRule.
> ExplicitRules do have a get/setVariable() method, but not Rules, because
> AssignmentRules only may have a derived variable. There is for
> convenience such a method.
>
In the last sentence, you were speaking of AlgebraicRule that have a
derived variable.
In this case, I agree that we should not break our inheritance tree as
libSBML
is not respecting the SBML specs there.
We have to wrote a more complete documentation to explain how to change
the current code
using libSBML though.
>> 4) KineticLaw.addParameter() requires a LocalParameter instead of
>> Parameter. addParameter has been overloaded in libsbml to accept a
>> Parameter and automatically changes it into a LocalParameter.
> Hm. Hard decision if this should be supported. Actually, the class
> LocalParameter in JSBML has a constructor that accepts instances of
> Parameter as arguments. You can therefore call
>
> myLaw.addParameter(new LocalParameter(myGlobalParameter));
>
> and you'll be fine. However, from my perspective it makes sense to let
> KineticLaws only accept LocalParameters. Maybe we should discuss this.
> We could, for instance have a function such as
>
> public void addParameter(Parameter p) {
> addParameter(new LocalParameter(pI);
> }
>
> What do other people say?
Yes, I agree that we should have a function like that.
>> 5) SBMLDocument.createModel() requires an id string in jsbml but does
>> not in libsbml.
> Yeah, that's right. Originally, we once intended to have constructors
> that require all necessary arguments and could therefore only support
> such a createModel(id) method. However, since parsing may be much
> simpler when providing empty constructors and also it enables us to let
> all constructs be serializable, we have to maintain empty constructors
> for all classes now. Hence, we could also have such a method
> createModel(). However, as in all cases these empty constructors bare
> the danger to create invalid SBML objects.
>
>> 6) New SBML Level 3 Event semantics are missing, e.g.
>> Trigger.setPersistent(boolean), Trigger.setInitialValue(boolean),
>> Event.createPriority(), etc.
> Right. This will be added next.
>
> Thanks again for testing. I think these are all not big issues and we'll
> have them in the project pretty soon.
>
Yes, it should be.
Thanks,
Nico
____________________________________________________________
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
|
|
|
Posts: 273
Registered: June 2006
|
|
Re: Errors when trying to use jsbml in place of libsbml
|
14 Oct '10 04:06
|
 |
|
Dear all,
There is currently a discussion going on in the JSBML development that
goes beyond the actual development of this particular library (see
below). While checking the specification of SBML L3 again, I noticed
that there is probably a problem in the specification that requires some
discussion.
The elements InitialAssignment, EventAssignment, RateRule, and
AssignmentRule can be used to change the values of the elements
SpeciesReference, Species, Compartment, and Parameter. To this end, the
elements EventAssignment, RateRule, and AssignmentRule declare an
attribute "variable" to refer to the identifier of the element, whose
value is to be changed. Before L3, only Species, Compartments, and
Parameters could be referenced here because the StoichiometryMath
element allowed similar effects and a reference to SpeciesReferences was
not necessary.
In contrast to EventAssignments, RateRules, and AssignmentRules, the
element InitialAssignment declares a field "symbol" to refer to the same
four elements whose values can be changed. When going through the SBML
specification, one notices that the term "symbol" is used very
frequently, often in different contexts. I first believed this term
refers to the elements Species, Compartment, and Parameter. But this
seems not to be true. Sometimes this term is used to describe characters
or elements of a MathML expression. On the other hand, on page 8 of SBML
L3 the specification states that initial assignments may be used to
change the value of some "variable". The specification argues that the
term "symbol" has been used there for the purpose to make clear that
InitialAssignments can change the value of elements that will stay
constant during a simulation. However, it still refers to the same
elements as the other three elements using the term "variable".
It would be very nice to have a look into the type hierarchy of JSBML
before replying to this e-mail, just because we already spent a lot of
effort to reflect the hierarchical properties of the SBML elements in
this hierarchy. You can find a graphical representation of this
hierarchy here:
http://jsbml.svn.sourceforge.net/viewvc/jsbml/trunk/files/FullTypeHierarchy.png?revision=371&pathrev=371
Our type hierarchy intends that only allowable elements can be passed to
dedicated methods, for instance, the method setVariable() takes as
argument an instance of the interface Variable. In case of
InitialAssignments we now would have to provide a method
setSymbol(Variable v) to reflect the specification, where we already
introduced the abstract super class Symbol for Compartments, Species,
and Parameters. Furthermore, the usage of the word "symbol" should be
checked within the whole document because depending on the context the
meaning is often different.
Also the term "variable" is sometimes a bit confusing in the SBML
specification. It is sometimes used to distinguish between constant and
variable elements, sometimes as "super class" for SpeciesReference,
Species, Compartment, Parameter (often referred to as "model variables")
and it is also used instead of the word "argument" in the context of the
math element of FunctionDefinitions. I think it would be very nice to
simplify the specification and to more clearly state what is a symbol
and what is a variable and to use the term argument when describing
functions.
Best wishes
Andreas
>>> I tried to drop jsbml in place of libsbml in our tool, iBioSim, and found
>>> several problems:
>>> InitialAssignment.setSymbol()
>> Unfortunately, we cannot support this method. This seems to be
>> confusing. However, JSBML is implemented with respect to SBML Level 3,
>> even though we currently can only guarantee to fully support Level 2.
>> However, in L3, InitialAssignments may also be applied to instances of
>> SpeciesReference. Symbols are, however, only Compartments, Species, and
>> Parameters. JSBML applies the term Variable as the name of an interface
>> covering these three Symbols and also SpeciesReferences. You can
>> therefore find the method setVariable(v).
> I would disagree here. The SBML specifications define the attribute as
> symbol, so
> it is only logical to have a set/getSymbol in the InitialAssignment class.
>
> The user would be confuse if there was not this method, plus libSBML
> does not have the setVariable
> methods and it would be introducing an incompatibility for nothing (both
> to the SBML specs and libSBML).
>
> And it is hard to make an easy distinction like the one you propose, as
> in level 2, the symbol on InitialAssignment represent only
> Compartments, Species, and Parameters but in level 3, the same symbol
> represent also SpeciesReferences.
>
--
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
|
|
|
Posts: 273
Registered: June 2006
|
|
Re: [jsbml-development] Errors when trying to use jsbml in place of libsbml
|
14 Oct '10 04:06
|
 |
|
Dear all,
There is currently a discussion going on in the JSBML development that
goes beyond the actual development of this particular library (see
below). While checking the specification of SBML L3 again, I noticed
that there is probably a problem in the specification that requires some
discussion.
The elements InitialAssignment, EventAssignment, RateRule, and
AssignmentRule can be used to change the values of the elements
SpeciesReference, Species, Compartment, and Parameter. To this end, the
elements EventAssignment, RateRule, and AssignmentRule declare an
attribute "variable" to refer to the identifier of the element, whose
value is to be changed. Before L3, only Species, Compartments, and
Parameters could be referenced here because the StoichiometryMath
element allowed similar effects and a reference to SpeciesReferences was
not necessary.
In contrast to EventAssignments, RateRules, and AssignmentRules, the
element InitialAssignment declares a field "symbol" to refer to the same
four elements whose values can be changed. When going through the SBML
specification, one notices that the term "symbol" is used very
frequently, often in different contexts. I first believed this term
refers to the elements Species, Compartment, and Parameter. But this
seems not to be true. Sometimes this term is used to describe characters
or elements of a MathML expression. On the other hand, on page 8 of SBML
L3 the specification states that initial assignments may be used to
change the value of some "variable". The specification argues that the
term "symbol" has been used there for the purpose to make clear that
InitialAssignments can change the value of elements that will stay
constant during a simulation. However, it still refers to the same
elements as the other three elements using the term "variable".
It would be very nice to have a look into the type hierarchy of JSBML
before replying to this e-mail, just because we already spent a lot of
effort to reflect the hierarchical properties of the SBML elements in
this hierarchy. You can find a graphical representation of this
hierarchy here:
http://jsbml.svn.sourceforge.net/viewvc/jsbml/trunk/files/FullTypeHierarchy.png?revision=371&pathrev=371
Our type hierarchy intends that only allowable elements can be passed to
dedicated methods, for instance, the method setVariable() takes as
argument an instance of the interface Variable. In case of
InitialAssignments we now would have to provide a method
setSymbol(Variable v) to reflect the specification, where we already
introduced the abstract super class Symbol for Compartments, Species,
and Parameters. Furthermore, the usage of the word "symbol" should be
checked within the whole document because depending on the context the
meaning is often different.
Also the term "variable" is sometimes a bit confusing in the SBML
specification. It is sometimes used to distinguish between constant and
variable elements, sometimes as "super class" for SpeciesReference,
Species, Compartment, Parameter (often referred to as "model variables")
and it is also used instead of the word "argument" in the context of the
math element of FunctionDefinitions. I think it would be very nice to
simplify the specification and to more clearly state what is a symbol
and what is a variable and to use the term argument when describing
functions.
Best wishes
Andreas
>>> I tried to drop jsbml in place of libsbml in our tool, iBioSim, and found
>>> several problems:
>>> InitialAssignment.setSymbol()
>> Unfortunately, we cannot support this method. This seems to be
>> confusing. However, JSBML is implemented with respect to SBML Level 3,
>> even though we currently can only guarantee to fully support Level 2.
>> However, in L3, InitialAssignments may also be applied to instances of
>> SpeciesReference. Symbols are, however, only Compartments, Species, and
>> Parameters. JSBML applies the term Variable as the name of an interface
>> covering these three Symbols and also SpeciesReferences. You can
>> therefore find the method setVariable(v).
> I would disagree here. The SBML specifications define the attribute as
> symbol, so
> it is only logical to have a set/getSymbol in the InitialAssignment class.
>
> The user would be confuse if there was not this method, plus libSBML
> does not have the setVariable
> methods and it would be introducing an incompatibility for nothing (both
> to the SBML specs and libSBML).
>
> And it is hard to make an easy distinction like the one you propose, as
> in level 2, the symbol on InitialAssignment represent only
> Compartments, Species, and Parameters but in level 3, the same symbol
> represent also SpeciesReferences.
>
--
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 sbml-discuss list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/sbml-discuss
For a web interface to the sbml-discuss mailing list, visit
http://sbml.org/Forums/
For questions or feedback about the sbml-discuss list,
contact sbml-team@caltech.edu
|
|
|
Posts: 307
Location: Cambridge UK
Registered: February 2005
|
|
Re: Errors when trying to use jsbml in place of libsbml
|
15 Oct '10 09:02
|
 |
|
On 10/14/2010 12:06 PM, Andreas Dräger wrote:
> Dear all,
>
> There is currently a discussion going on in the JSBML development that
> goes beyond the actual development of this particular library (see
> below). While checking the specification of SBML L3 again, I noticed
> that there is probably a problem in the specification that requires some
> discussion.
>
> The elements InitialAssignment, EventAssignment, RateRule, and
> AssignmentRule can be used to change the values of the elements
> SpeciesReference, Species, Compartment, and Parameter. To this end, the
> elements EventAssignment, RateRule, and AssignmentRule declare an
> attribute "variable" to refer to the identifier of the element, whose
> value is to be changed. Before L3, only Species, Compartments, and
> Parameters could be referenced here because the StoichiometryMath
> element allowed similar effects and a reference to SpeciesReferences was
> not necessary.
>
> In contrast to EventAssignments, RateRules, and AssignmentRules, the
> element InitialAssignment declares a field "symbol" to refer to the same
> four elements whose values can be changed. When going through the SBML
> specification, one notices that the term "symbol" is used very
> frequently, often in different contexts. I first believed this term
> refers to the elements Species, Compartment, and Parameter. But this
> seems not to be true. Sometimes this term is used to describe characters
> or elements of a MathML expression. On the other hand, on page 8 of SBML
> L3 the specification states that initial assignments may be used to
> change the value of some "variable". The specification argues that the
> term "symbol" has been used there for the purpose to make clear that
> InitialAssignments can change the value of elements that will stay
> constant during a simulation. However, it still refers to the same
> elements as the other three elements using the term "variable".
>
> It would be very nice to have a look into the type hierarchy of JSBML
> before replying to this e-mail, just because we already spent a lot of
> effort to reflect the hierarchical properties of the SBML elements in
> this hierarchy. You can find a graphical representation of this
> hierarchy here:
> http://jsbml.svn.sourceforge.net/viewvc/jsbml/trunk/files/FullTypeHierarchy.png?revision=371&pathrev=371
>
> Our type hierarchy intends that only allowable elements can be passed to
> dedicated methods, for instance, the method setVariable() takes as
> argument an instance of the interface Variable. In case of
> InitialAssignments we now would have to provide a method
> setSymbol(Variable v) to reflect the specification, where we already
> introduced the abstract super class Symbol for Compartments, Species,
> and Parameters. Furthermore, the usage of the word "symbol" should be
> checked within the whole document because depending on the context the
> meaning is often different.
>
In the jsbml type hierarchy, the distinction between Variable and Symbol
seems to me that only Symbol
has a defined unit (can be defined by the user). For SpeciesReference,
the element/class is a bit in between as
in level 3, it has a defined unit which is dimensionless and in level 2,
it can have a derived unit if stoichiometryMath is defined.
I don't think it is really a problem to have a
setSymbol(Variable v)
It is a bit confusing because Symbol and Variable have a different
meaning in jsbml but really
has you notted in the specs the term symbol has been specifically chosen
to avoid using variable which some people fund confusing (as the element
affected can be marked constant for the rest of the simulation).
So it is a mix of confusion that is hard to remove for everybody :-)
Furthermore, we really only need a method setSymbol(String SIdRef), the
method with the object can be there as well but is not
mandatory in our case.
One important additional point that I noticed in the type hierarchy that
is missing is that Reaction should probably inherit from Quantity.
Because I think in the ASTNode and/or ASTNodeValue, you are storing a
Variable object but we should store a Quantity and manipulated Quantity
as a Reaction can be in almost any Math now.
Nico
> Also the term "variable" is sometimes a bit confusing in the SBML
> specification. It is sometimes used to distinguish between constant and
> variable elements, sometimes as "super class" for SpeciesReference,
> Species, Compartment, Parameter (often referred to as "model variables")
> and it is also used instead of the word "argument" in the context of the
> math element of FunctionDefinitions. I think it would be very nice to
> simplify the specification and to more clearly state what is a symbol
> and what is a variable and to use the term argument when describing
> functions.
>
> Best wishes
> Andreas
>
>>>> I tried to drop jsbml in place of libsbml in our tool, iBioSim, and found
>>>> several problems:
>>>> InitialAssignment.setSymbol()
>>> Unfortunately, we cannot support this method. This seems to be
>>> confusing. However, JSBML is implemented with respect to SBML Level 3,
>>> even though we currently can only guarantee to fully support Level 2.
>>> However, in L3, InitialAssignments may also be applied to instances of
>>> SpeciesReference. Symbols are, however, only Compartments, Species, and
>>> Parameters. JSBML applies the term Variable as the name of an interface
>>> covering these three Symbols and also SpeciesReferences. You can
>>> therefore find the method setVariable(v).
>> I would disagree here. The SBML specifications define the attribute as
>> symbol, so
>> it is only logical to have a set/getSymbol in the InitialAssignment class.
>>
>> The user would be confuse if there was not this method, plus libSBML
>> does not have the setVariable
>> methods and it would be introducing an incompatibility for nothing (both
>> to the SBML specs and libSBML).
>>
>> And it is hard to make an easy distinction like the one you propose, as
>> in level 2, the symbol on InitialAssignment represent only
>> Compartments, Species, and Parameters but in level 3, the same symbol
>> represent also SpeciesReferences.
>>
____________________________________________________________
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
|
|
|
Posts: 273
Registered: June 2006
|
|
Re: Errors when trying to use jsbml in place of libsbml
|
15 Oct '10 10:11
|
 |
|
Hi Nicolas and all,
> In the jsbml type hierarchy, the distinction between Variable and Symbol
> seems to me that only Symbol
> has a defined unit (can be defined by the user). For SpeciesReference,
> the element/class is a bit in between as
> in level 3, it has a defined unit which is dimensionless and in level 2,
> it can have a derived unit if stoichiometryMath is defined.
Yes, our Symbol is actually something like
AbstractQuantityWithDerivedUnit, but the name Symbol is more handy
because it is shorter. Maybe we should rename it to something different
to avoid confusion.
> I don't think it is really a problem to have a
> setSymbol(Variable v)
We should introduce this method, definitely yes, because it is required
by the current spec.
> It is a bit confusing because Symbol and Variable have a different
> meaning in jsbml but really
> has you notted in the specs the term symbol has been specifically chosen
> to avoid using variable which some people fund confusing (as the element
> affected can be marked constant for the rest of the simulation).
> So it is a mix of confusion that is hard to remove for everybody :-)
Actually, by using the attribute "symbol" instead of "variable" the
InitialAssignment encodes the identical semantic information twice. The
prefix "Initial" makes clear that this type of assignment will change
the value of the referenced element only once. Hence, from the
perspective of an InitialAssignment it is completely irrelevant if the
referenced element is constant or not. By not consistently naming things
in the SBML specification implementation becomes more complicated. But
it is, of course, not a big issue. However, at least the statement on
page 8 is missleading.
> Furthermore, we really only need a method setSymbol(String SIdRef), the
> method with the object can be there as well but is not
> mandatory in our case.
Yes, in this way it would be better. setSymbol(someString) and
setVariable(Variable v). This makes sense to me.
>
> One important additional point that I noticed in the type hierarchy that
> is missing is that Reaction should probably inherit from Quantity.
>
> Because I think in the ASTNode and/or ASTNodeValue, you are storing a
> Variable object but we should store a Quantity and manipulated Quantity
> as a Reaction can be in almost any Math now.
>
Sorry, but in this point you are not right. We introduced the interface
NamedSBaseWithDerivedUnit only for the purpose to be the common super
class of Reaction, Quantity, and FunctionDefinition. Instances of all
these three elements can be referenced in ASTNodes etc. Please have a
look into the code. It was already in April that we made this change.
Hence, we can access Reactions, FunctionDefinitions, LocalParameters,
Compartments, Species, Parameters, and SpeciesReferences from our
ASTNode objects. That's fine and should stay as it is.
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
|
|
|
Posts: 967
Registered: October 2003
|
|
Re: [sbml-discuss] Errors when trying to use jsbml in place of libsbml
|
15 Oct '10 12:11
|
 |
|
On Thu, 14 Oct 2010 12:06:22 +0100, Andreas Dräger wrote:
> The elements InitialAssignment, EventAssignment, RateRule, and
> AssignmentRule can be used to change the values of the elements
> SpeciesReference, Species, Compartment, and Parameter. To this end, the
> elements EventAssignment, RateRule, and AssignmentRule declare an
> attribute "variable" to refer to the identifier of the element, whose
> value is to be changed. Before L3, only Species, Compartments, and
> Parameters could be referenced here because the StoichiometryMath
> element allowed similar effects and a reference to SpeciesReferences was
> not necessary.
>
> In contrast to EventAssignments, RateRules, and AssignmentRules, the
> element InitialAssignment declares a field "symbol" to refer to the same
> four elements whose values can be changed. When going through the SBML
> specification, one notices that the term "symbol" is used very
> frequently, often in different contexts. I first believed this term
> refers to the elements Species, Compartment, and Parameter. But this
> seems not to be true. Sometimes this term is used to describe characters
> or elements of a MathML expression. On the other hand, on page 8 of SBML
> L3 the specification states that initial assignments may be used to
> change the value of some "variable". The specification argues that the
> term "symbol" has been used there for the purpose to make clear that
> InitialAssignments can change the value of elements that will stay
> constant during a simulation. However, it still refers to the same
> elements as the other three elements using the term "variable".
>
> [...]
>
> Also the term "variable" is sometimes a bit confusing in the SBML
> specification. It is sometimes used to distinguish between constant and
> variable elements, sometimes as "super class" for SpeciesReference,
> Species, Compartment, Parameter (often referred to as "model variables")
> and it is also used instead of the word "argument" in the context of the
> math element of FunctionDefinitions. I think it would be very nice to
> simplify the specification and to more clearly state what is a symbol
> and what is a variable and to use the term argument when describing
> functions.
Hi Andreas,
The variable vs symbol business is a legacy from earlier levels of SBML, where it might have been used somewhat more consistently than in the L3 spec today. I'm sure you're right that the current text is inconsistent in places. I agree it should be fixed, perhaps in a Release 2 of the specification.
Best regards,
MH
____________________________________________________________
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
|
|
|
Posts: 967
Registered: October 2003
|
|
Re: [jsbml-development] Errors when trying to use jsbml in place of libsbml
|
15 Oct '10 12:11
|
 |
|
On Thu, 14 Oct 2010 12:06:22 +0100, Andreas Dräger wrote:
> The elements InitialAssignment, EventAssignment, RateRule, and
> AssignmentRule can be used to change the values of the elements
> SpeciesReference, Species, Compartment, and Parameter. To this end, the
> elements EventAssignment, RateRule, and AssignmentRule declare an
> attribute "variable" to refer to the identifier of the element, whose
> value is to be changed. Before L3, only Species, Compartments, and
> Parameters could be referenced here because the StoichiometryMath
> element allowed similar effects and a reference to SpeciesReferences was
> not necessary.
>
> In contrast to EventAssignments, RateRules, and AssignmentRules, the
> element InitialAssignment declares a field "symbol" to refer to the same
> four elements whose values can be changed. When going through the SBML
> specification, one notices that the term "symbol" is used very
> frequently, often in different contexts. I first believed this term
> refers to the elements Species, Compartment, and Parameter. But this
> seems not to be true. Sometimes this term is used to describe characters
> or elements of a MathML expression. On the other hand, on page 8 of SBML
> L3 the specification states that initial assignments may be used to
> change the value of some "variable". The specification argues that the
> term "symbol" has been used there for the purpose to make clear that
> InitialAssignments can change the value of elements that will stay
> constant during a simulation. However, it still refers to the same
> elements as the other three elements using the term "variable".
>
> [...]
>
> Also the term "variable" is sometimes a bit confusing in the SBML
> specification. It is sometimes used to distinguish between constant and
> variable elements, sometimes as "super class" for SpeciesReference,
> Species, Compartment, Parameter (often referred to as "model variables")
> and it is also used instead of the word "argument" in the context of the
> math element of FunctionDefinitions. I think it would be very nice to
> simplify the specification and to more clearly state what is a symbol
> and what is a variable and to use the term argument when describing
> functions.
Hi Andreas,
The variable vs symbol business is a legacy from earlier levels of SBML, where it might have been used somewhat more consistently than in the L3 spec today. I'm sure you're right that the current text is inconsistent in places. I agree it should be fixed, perhaps in a Release 2 of the specification.
Best regards,
MH
____________________________________________________________
To manage your sbml-discuss list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/sbml-discuss
For a web interface to the sbml-discuss mailing list, visit
http://sbml.org/Forums/
For questions or feedback about the sbml-discuss list,
contact sbml-team@caltech.edu
|
|
|
Posts: 273
Registered: June 2006
|
|
Re: Errors when trying to use jsbml in place of libsbml
|
21 Oct '10 03:15
|
 |
|
Hi Curtis,
almost everything is implemented now. The methods to check the
SBMLDocument are now throwing exceptions because these are not
implemented. Everything else should work now. Can you please check
again? Thank you and
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
|
|
| | Topic: Yet another abstract super class |
|---|
Posts: 273
Registered: June 2006
|
|
Yet another abstract super class
|
21 Oct '10 03:20
|
 |
|
Dear all,
When starting the JSBML project it was one of our goals to introduce
common super types whenever elements share some common properties. Just
now we noticed that InitialAssignment, EventAssignment, and ExplicitRule
share a pointer to some variable field. I would therefore like to
introduce a new abstract data type Assignment as super type for all
these elements. However, as ExplicitRule has already an abstract class
as super type, the class Rule should become an interface. To make sure,
Rule is a MathContainer, we should therefore also introduce a new
abstract class AbstractMathContainer and change MathContainer to an
interface as the supertype of Rule. Assignment would then also extend
AbstractMathContainer and would serve as super type for all those
elements that assign the result of a mathematical expression to some
variable. What do you think?
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
|
|
| | Topic: SBMLError |
|---|
Posts: 273
Registered: June 2006
|
|
SBMLError
|
29 Oct '10 08:15
|
 |
|
Hello everybody,
I noticed that SBMLError does not extend java.lang.Error and does also
not extend a class called XMLError as one would expect when coming from
libSBML. I tried to mimic this behavior, but it seems to cause problems
because the getMessage() method in Throwable must return a String but
here it returns a Message object. Hence this all is incompatible with
the usual Java API and also with libSBML. It would be very nice if we
could find a way to make sure that Errors are Errors in a Java meaning
and that we also get closer to libSBML.
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
|
|
|
Posts: 307
Location: Cambridge UK
Registered: February 2005
|
|
Re: SBMLError
|
02 Nov '10 06:23
|
 |
|
On 10/29/2010 04:15 PM, Andreas Draeger wrote:
> Hello everybody,
>
> I noticed that SBMLError does not extend java.lang.Error and does also
> not extend a class called XMLError as one would expect when coming from
> libSBML. I tried to mimic this behavior, but it seems to cause problems
> because the getMessage() method in Throwable must return a String but
> here it returns a Message object. Hence this all is incompatible with
> the usual Java API and also with libSBML. It would be very nice if we
> could find a way to make sure that Errors are Errors in a Java meaning
> and that we also get closer to libSBML.
>
We can check if we can do it but if not, that is not a big problem, I
think. SBMLError could be java Error but it is
not adding much to us.
And seeing this mail, I just notice what was this Message class that you
were talking about :-)
I implemented it in fact, quite quickly to parse and store the result
from the sbml validator,
see http://sbml.org/Facilities/Validator/Validator_Web_API
I am not sure of what is the libSBML API about the getMessage() and if
we need to care at all about the lang attribute of the message but
we should definitively check that, I will try to write a bit of
documentation about these classes that are use by the SBMLValidator.
Thanks,
Nico
____________________________________________________________
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
|
|
| | Topic: Interoperability with libSBML |
|---|
Posts: 28
Registered: January 2008
|
|
Interoperability with libSBML
|
29 Oct '10 08:27
|
 |
|
Dear JSBML developers,
I have an application which uses both libSBML and one of the ancestor of
JSBML. I would like to switch to JSBML while still using libSBML at the
same time.
So I am in a situation where I have some org.sbml.jsbml.SBMLDocument and
some org.sbml.libsbml.SBMLDocument objects, and these are not interoperable.
I found a (hidden) class
http://jsbml.svn.sourceforge.net/viewvc/jsbml/modules/libSBMLio/src/org/sbml/jsbml/xml/libsbml/LibSBMLReader.java
which seems to be able to convert a org.sbml.libsbml.Model into a
org.sbml.jsbml.Model object.
This triggers the following questions:
- Is there any plan to support the conversion of SBMLDocument objects as
well?
- Will these features be part of the standard JSBML distribution (I'm
not sure to understand the reason behind putting this class in a
'module' folder and not part of the trunk)?
Thank you.
--
Camille Laibe
BioModels.net Coordinator
European Bioinformatics Institute, Cambridge (UK)
____________________________________________________________
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
|
|
|
Posts: 273
Registered: June 2006
|
|
Re: Interoperability with libSBML
|
29 Oct '10 13:39
|
 |
|
Dear Camillie,
First of all thanks for being interested in JSBML. One of our goals is
that people can use both; JSBML and libSBML in their project. For
instance, one could consider first to load libSBML and if this fails for
some reason then one could simply use JSBML. We decided to have optional
modules to be able to support different needs. For instance, if one
application uses JSBML only, there is no need to import Converters for
libSBML classes (then we would have to include libSBML Java bindings in
the whole project to avoid getting error messages all the time). By
having a module structure, we can develope the "core" JSBML independent
from libSBML. The LibSBMLReader/Writer classes are actually intendet to
convert all objects from one library to objects of the other one. Did we
forget something? There is no method to convert SBMLDocuments, only
Models? In this case, we have to add one. Sorry, seems to be forgotten.
It might also not yet support the new Priority class, but we'll add a
function for this as well. What these Reader/Writer classes do is
basically to create a new Instance of SBase from the opposit library and
then setting all the properties equivalently. There are also
Reader/Writer classes for CellDesigner plugin data structures. This
means, once you switched your application to JSBML you can easily turn
it into a CellDesigner plugin.
Please don't hesitate to contact us if you miss any feature in JSBML.
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
|
|
|
Posts: 273
Registered: June 2006
|
|
Re: Interoperability with libSBML
|
05 Nov '10 04:16
|
 |
|
Dear Camile and all others,
Just now, I improved the JSBMLio module. There is now a method to read
SBMLDocument objects directly from LibSBML. Furthermore, the new
Priority element is supported and also the new attributes in Trigger.
Can you please test it and tell me if you are happy with these changes?
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
|
|
|
Posts: 28
Registered: January 2008
|
|
Re: Interoperability with libSBML
|
08 Nov '10 03:36
|
 |
|
Hi Andreas,
> Just now, I improved the JSBMLio module. There is now a method to read
> SBMLDocument objects directly from LibSBML. Furthermore, the new
> Priority element is supported and also the new attributes in Trigger.
Thanks for the quick update on this feature.
> Can you please test it and tell me if you are happy with these changes?
I'll try it as soon as I can and let you know if I encounter any issue.
Cheers.
--
Camille Laibe
BioModels.net Coordinator
European Bioinformatics Institute, Cambridge (UK)
____________________________________________________________
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
|
|
| | Topic: Re: problem loading SBML input with current version from trunk |
|---|
Posts: 307
Location: Cambridge UK
Registered: February 2005
|
|
Re: problem loading SBML input with current version from trunk
|
15 Nov '10 04:51
|
 |
|
Hi Paulo,
On 11/12/2010 04:54 PM, Paulo Maia wrote:
> Hi Nicolas,
>
> I was unsure wether to submit a bug report for this or not...
>
> I was trying to create an SBML loader for OptFlux using your current
> implementation of JSBML since, to my knowledge, MathML support is now
> available.
>
Yes, it is.
> The problem I'm having is still before the actual xml parsing begins:
>
> Exception in thread "main" java.lang.NullPointerException
> at java.util.Properties.loadFromXML(Properties.java:851)
> at
> org.sbml.jsbml.xml.stax.SBMLReader.initializePackageParserNamespaces(SBMLReader.java:242)
> at
> org.sbml.jsbml.xml.stax.SBMLReader.getInitializedPackageParsers(SBMLReader.java:145)
> at
> org.sbml.jsbml.xml.stax.SBMLReader.readSBMLFromStream(SBMLReader.java:412)
> at org.sbml.jsbml.xml.stax.SBMLReader.readSBML(SBMLReader.java:329)
> at org.sbml.jsbml.xml.stax.SBMLReader.readSBMLFile(SBMLReader.java:358)
> at org.sbml.jsbml.xml.stax.SBMLReader.readSBML(SBMLReader.java:343)
> at org.sbml.jsbml.JSBML.readSBMLFromFile(JSBML.java:265)
> at
> metabolic.io.readers.OptFluxJSBMLReader.getContainer(OptFluxJSBMLReader.java:51)
> at test.OptFluxJSBMLReaderTest.main(OptFluxJSBMLReaderTest.java:16)
>
>
> When analyzing the code, I found out that the
> org.sbml.jsbml.xml.stax.SBMLReader.initializePackageParserNamespaces
> method was trying to access a
> "org/sbml/jsbml/resources/cfg/PackageParserNamespaces.xml file. This
> file does not exist in that location and the process dies immediately
> with the a nullpointer exception...
>
> public static void initializePackageParserNamespaces() {
> Properties p = new Properties();
> try {
> p.loadFromXML(Resource.getInstance()
> .getStreamFromResourceLocation("org/sbml/jsbml/resources/cfg/PackageParserNamespaces.xml"));
>
>
> I am not sure if am using the correct method to load the SBML file,
> thus this e-mail... I am using the JSBML.readSBMLFromFile() method to
> give me the SBMLDocument instance...
>
> Is this correct or am I missing something?
>
Do you used ant to create the jsbml jar file ? Or are you trying to run
it directly from a JDE ?
The problem is that you probably did not add the resources folder to
your CLASSPATH, this is there that the different configuration files are.
I guess this is one more point that we need to add in our future
documentation.
Let me know if it solve your problem,
Thanks,
Nico
____________________________________________________________
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
|
|
| | Topic: Creation of invalid SBML |
|---|
Posts: 273
Registered: June 2006
|
|
Creation of invalid SBML
|
17 Nov '10 01:42
|
 |
|
Dear all,
The following line of code leads to an invalid SBML output:
trigger.setMath(ASTNode.geq(new ASTNode(ASTNode.Type.NAME_TIME),new
ASTNode(10)));
-> This creates the equation "time >= 10".
The libSBML online validator will state:
%%Validation error: (SBML Validation Rule #10205) In SBML Level 2, the
only values permitted for 'definitionURL' on a <csymbol> element are
"http://www.sbml.org/sbml/symbols/time" and
"http://www.sbml.org/sbml/symbols/delay". SBML Level 3 added
"http://www.sbml.org/sbml/symbols/avogadro". Reference: L2V4 Section 3.4.6
%%generated xml: "<csymbol encoding="text" definitionURL=""> time
</csymbol>"
%%and when i put in the xml file manually
definitionURL="http://www.sbml.org/sbml/symbols/time" for the url, its
valid.
The reason is for that is that when writing MathML the
MathMLXMLStreamCompiler asks the ASTNodes for their definition URL and
encoding property:
writer.writeAttribute("encoding", astNode.getEncoding() != null ?
astNode.getEncoding() : "text");
writer.writeAttribute("definitionURL", astNode.getDefinitionURL() !=
null ? astNode.getDefinitionURL() : "");
If this is not set, we end up with invalid SBML. However, this makes
working with JSBML a bit tricky. The simple code from above is not
applicable in this way. To correcly work with JSBML here, we would have
to create the ASTNodes one after another and set the encoding and the
definitionURL in addition to the type. However, it is already clearly
defined in the SBML specification which definition URL and encoding
syntax tree nodes must have that refer to the time symbol or to
Avogadro's number and so on. Therefore, we don't really need to check
this from the actual node in the MathMLXMLStreamCompiler at this
position. Or, at least, we could provide the default values if encoding
and definitionURL are not set.
Actually, I am thinking that the information "encoding",
"definitionURL", and "style" is only needed to translate ASTNodes into
MathML. However, every node contains three String variables for this
purpose although in most cases these are not needed. Particularly, as
far as I understand, "encoding" and "definitionURL" are only needed for
certain NAME type nodes, such as time and Avogadro. Do we really need to
equip every single node with these field values? Or could the
MathMLStreamCompiler simply set the required information? If people use
JSBML only as an internal data structure for numerical computation in
their programs, these field values are not needed.
Summarizing, I would like to ask if we can remove these fields or if we
can at least simplify working with nodes that require these fields by
setting appropriate default values when writing MathML?
Best regards
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
|
|
|
Posts: 307
Location: Cambridge UK
Registered: February 2005
|
|
Re: Creation of invalid SBML
|
17 Nov '10 03:20
|
 |
|
On 11/17/2010 10:41 AM, Andreas Dräger wrote:
> Dear all,
>
> The following line of code leads to an invalid SBML output:
>
> trigger.setMath(ASTNode.geq(new ASTNode(ASTNode.Type.NAME_TIME),new
> ASTNode(10)));
>
> -> This creates the equation "time>= 10".
>
> The libSBML online validator will state:
>
> %%Validation error: (SBML Validation Rule #10205) In SBML Level 2, the
> only values permitted for 'definitionURL' on a<csymbol> element are
> "http://www.sbml.org/sbml/symbols/time" and
> "http://www.sbml.org/sbml/symbols/delay". SBML Level 3 added
> "http://www.sbml.org/sbml/symbols/avogadro". Reference: L2V4 Section 3.4.6
> %%generated xml: "<csymbol encoding="text" definitionURL=""> time
> </csymbol>"
> %%and when i put in the xml file manually
> definitionURL="http://www.sbml.org/sbml/symbols/time" for the url, its
> valid.
>
> The reason is for that is that when writing MathML the
> MathMLXMLStreamCompiler asks the ASTNodes for their definition URL and
> encoding property:
>
> writer.writeAttribute("encoding", astNode.getEncoding() != null ?
> astNode.getEncoding() : "text");
> writer.writeAttribute("definitionURL", astNode.getDefinitionURL() !=
> null ? astNode.getDefinitionURL() : "");
We can for sure, put a check there to have the correct definitionURL all
the time.
I guess I mostly tested everything from mathML and not writing directly
ASTNode.
By the way, we have to check that the formula to ASTNode parser set
properly the csymbol element if it find time, delay or avogadro.
>
>
> If this is not set, we end up with invalid SBML. However, this makes
> working with JSBML a bit tricky. The simple code from above is not
> applicable in this way. To correcly work with JSBML here, we would have
> to create the ASTNodes one after another and set the encoding and the
> definitionURL in addition to the type. However, it is already clearly
> defined in the SBML specification which definition URL and encoding
> syntax tree nodes must have that refer to the time symbol or to
> Avogadro's number and so on. Therefore, we don't really need to check
> this from the actual node in the MathMLXMLStreamCompiler at this
> position. Or, at least, we could provide the default values if encoding
> and definitionURL are not set.
>
> Actually, I am thinking that the information "encoding",
> "definitionURL", and "style" is only needed to translate ASTNodes into
> MathML. However, every node contains three String variables for this
> purpose although in most cases these are not needed. Particularly, as
> far as I understand, "encoding" and "definitionURL" are only needed for
> certain NAME type nodes, such as time and Avogadro. Do we really need to
> equip every single node with these field values? Or could the
> MathMLStreamCompiler simply set the required information? If people use
> JSBML only as an internal data structure for numerical computation in
> their programs, these field values are not needed.
As most of other fields in ASTNode. I thing we could do without these
two field but I would like
to minimize the unnecessary changes before the first release.
We could open a tracker item for that and take care of it later.
Nico
____________________________________________________________
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
|
|
| | Topic: Inconvenient use of MIRIAM annotations |
|---|
Posts: 273
Registered: June 2006
|
|
Inconvenient use of MIRIAM annotations
|
16 Nov '10 10:22
|
 |
|
Hi all,
creating MIRIAM annotated models in JSBML is currently a bit tricky.
Please see the following piece of code that generates a model with an
annotated Species:
SBMLDocument doc = new SBMLDocument(2, 4);
doc.addChangeListener(this);
Model model = doc.createModel("model_test");
Species s1 = model.createSpecies("s1", model.createCompartment("c1"));
s1.setMetaId("meta_" + s1.getId());
s1.getAnnotation().addRDFAnnotationNamespace("bqbiol", "",
"http://biomodels.net/biology-qualifiers/");
s1.addCVTerm(new CVTerm(CVTerm.Type.BIOLOGICAL_QUALIFIER,
CVTerm.Qualifier.BQB_HAS_PART, "urn:miriam:obo.chebi:CHEBI:15422"));
System.out.println("==================================");
SBMLWriter.write(doc, System.out);
It works nicely, however, I dislike that we have to add this line:
s1.getAnnotation().addRDFAnnotationNamespace("bqbiol", "",
"http://biomodels.net/biology-qualifiers/");
Without this line, the output will not contain the MIRIAM annotation.
Hence, we currently require users to manually add all the needed name
spaces manually. In libSBML this is, as far as I know, done
automatically. I suggest to create a configuration file containing all
these name space strings, just like it is done for the
PackageParserNamespaces.xml file. Then we should load all required name
spaces similarly.
While trying this, I also noticed that we didn't set the about field
automatically. I just added an if-clause that checks whether it is set
or not and just in case it is missing, it performs
annotation.setAbout("#" + sbase.getMetaId());
Furthermore, as far as I remember, libSBML does not write RDF
annotations if the metaId is not set. I therefore also added this
condition. Should we actually make the set/get methods for the about
field private? I mean, I don't see why users should be able to change
this. Maybe I'm wrong, but some explanation would be very nice.
The same holds for the name spaces. Was there a reason why not loading
all required name spaces automatically?
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
|
|
|
Pages (197):
[ 6 ]
|