APML bug

12 views
Skip to first unread message

berend hoekman

unread,
Oct 27, 2010, 11:51:52 AM10/27/10
to Corra
Dear Mi-Youn,

I'm using the APML java-api provided in sourceforge to write and read
APML files. However i noticed that if i write the calendar date in the
APML file using the api I get an error when reading the file.

Normally I set the time like this:
DataProcessing dataProcessing = new DataProcessing();

dataProcessing.setProcessingDate(java.util.Calendar.getInstance()); //
Sets current Time!!
DataProcessing.Software software = new DataProcessing.Software();

Atm. I just leave the time from being set, which solved all problems
reading the file.

Regards,

Berend Hoekman

PS. I posted it here because the bug report things in sourceforge
looked quite unused.

Mi-Youn Brusniak

unread,
Nov 1, 2010, 3:36:29 PM11/1/10
to co...@googlegroups.com
Dear Berend,

Thank you for mentioning your usage.
It's NOT Bug rather than usage error.
I have an explanation and recommendation:

(1) Explanation of current APML parser
We are using javax.xml.namespace.QName class to parse the "processingDate
attribute" and set the data using XmlCalendar rather than
java.util.Calendar.

dataProcessingStartElement.getAttributeByName(new
QName("processingDate")).getValue();
dataProcessing.setProcessingDate(new XmlCalendar(processingDateString));

(2)Recommendation
As you see in the example codes in
org.systemsbiology.apmlparser.v2.APMLReader,
I recommend to use XmlCalendar in your APML writing code instead of
java.util.Calendar.

Then you don't have to skip the processing date attribute, which can be a
critical annotation of the data.

All the best,

Mi-Youn

Mi-Youn Brusniak, Ph.D.
Computational Biology
Seattle Proteome Center
mbru...@systemsbiology.org
Tel: (206) 732-1327

Dear Mi-Youn,

Regards,

Berend Hoekman

--
You received this message because you are subscribed to the Google Groups
"Corra" group.
To post to this group, send email to co...@googlegroups.com.
To unsubscribe from this group, send email to
corra+un...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/corra?hl=en.


berend hoekman

unread,
Nov 4, 2010, 11:19:37 AM11/4/10
to Corra
Dear Mi-Youn

For now I'm not using the time in the APML file. However I tried
following your advise by using the XmlCalendar to set the time (see
below), however the issue seems to persist. If I compare the time in
my APML files with one of the example APML-files i get the same kind
of date-time string, however both files result in processing errors
when reading. Probably I'm doing something wrong somewhere, thanks for
the advice/help.

My APML file:
<apml:dataProcessing processingDate="2010-11-04T15:50:57.767+01:00">

Example APML file: (under: APML/doc/APML/sample_peak_lists.apml)
<apml:dataProcessing processingDate="2007-12-18T15:00:23.424-08:00">

Setting processing time using XmlCalendar:

XmlCalendar xC = new XmlCalendar();
xC.setTime(java.util.Calendar.getInstance().getTime());
dataProcessing.setProcessingDate(xC);

I'm using the APML API from the sourceforge website (which was posted
300+ days ago).

Regards,

Berend

On Nov 1, 8:36 pm, "Mi-Youn Brusniak" <mbrusn...@systemsbiology.org>
wrote:
> Dear Berend,
>
> Thank you for mentioning your usage.
> It's NOT Bug rather than usage error.
> I have an explanation and recommendation:
>
> (1) Explanation of current APML parser
> We are using javax.xml.namespace.QName class to parse the "processingDate
> attribute" and set the data using XmlCalendar rather than
> java.util.Calendar.
>
> dataProcessingStartElement.getAttributeByName(new
> QName("processingDate")).getValue();
> dataProcessing.setProcessingDate(new XmlCalendar(processingDateString));
>
> (2)Recommendation
> As you see in the example codes in
> org.systemsbiology.apmlparser.v2.APMLReader,
> I recommend to use XmlCalendar in your APML writing code instead of
> java.util.Calendar.
>
> Then you don't have to skip the processing date attribute, which can be a
> critical annotation of the data.
>
> All the best,
>
> Mi-Youn
>
> Mi-Youn Brusniak, Ph.D.
> Computational Biology
> Seattle Proteome Center
> mbrusn...@systemsbiology.org

Mi-Youn Brusniak

unread,
Nov 4, 2010, 6:48:08 PM11/4/10
to co...@googlegroups.com
Dear Berend,

I just ran the APMLPaserReader using runAPMLParser.sh using example apml
files in Corrav3.1.tgz.
Corra3.1-APML2.1.jar is exactly the same code from Corra3.1.tgz. I just
extracted out from Corra, so bioinformaticians who is only interested in
APML could just download only the APML part. Please visit
https://sourceforge.net/projects/corra/ and download the new APML files and
script and try out.
I also removed old APML file that you have been using (2008 version). I
assumed users would get the newest one from Corrav3.0 but apparently not :-)
So I updated Corra-APML folder.
Please use update APML since I can't reproduce the problem you have.

Cheers,


Mi-Youn Brusniak, Ph.D.
Computational Biology
Seattle Proteome Center

mbru...@systemsbiology.org

Reply all
Reply to author
Forward
0 new messages