MICommunity / psimi

Automatically exported from code.google.com/p/psimi
Creative Commons Attribution 4.0 International
5 stars 3 forks source link

psidev.psi.mi.tab.PsimiTabReader fails to parse MITAB lines without values in column 13 and 14 #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a MITAB line where column 13 (source db) and/or 14 (interaction
ids) are empty, i.e. represented by a "-"
2. Try to parse this String with the PsimiTabReader

What is the expected output? What do you see instead?

I would except to get a representation of the MITAB line as a Collection of
BinaryInteractions. Instead the parser fails with a
java.lang.UnsupportedOperationException (see attached error log). 

An example MITAB obtained from the BioGRID PSICQUIC server that does not
have an interaction id and can thus not be parsed:
entrez gene/locuslink:3069  entrez gene/locuslink:11260 entrez
gene/locuslink:HDLBP    entrez gene/locuslink:XPOT  entrez
gene/locuslink:FLJ16432|entrez gene/locuslink:HBP|entrez
gene/locuslink:PRO2900|entrez gene/locuslink:VGL    entrez
gene/locuslink:XPO3 psi-mi:"MI:0401"(biochemical)   Kruse C (2000)
pubmed:10657246 taxid:9606  taxid:9606  psi-mi:"MI:0914"(association)
psi-mi:"MI:0463"(GRID)  -   -

Replacing the "-" in the 14th column with, for instance, "db:id" makes the
line valid.

What version of the product are you using? On what operating system?
Win XP Pro SP3, PSI-MI maven dependency
<dependency>
<groupId>psidev.psi.mi</groupId>
<artifactId>psimitab-search</artifactId>
<version>1.7.7-SNAPSHOT</version>
</dependency>

Please provide any additional information below.
This is probably not a bug but an intended behavior. If these two fields
are supposed to be mandatory in the sense that a "-" value is not allowed
here, I think it should be mentioned somewhere more clearly. However, in my
opinion not all interactions can be attributed to a database and not all
interaction databases provide clear identifiers for their interactions. 

Original issue reported on code.google.com by hagen.bl...@googlemail.com on 6 Oct 2009 at 9:00

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by brunoaranda on 6 Oct 2009 at 10:50

GoogleCodeExporter commented 9 years ago

Original comment by brunoaranda on 6 Oct 2009 at 10:53

GoogleCodeExporter commented 9 years ago
This has been fixed in the 1.7.7-SNAPSHOT. The problem happened when invoking 
the
method CrossReference.getText() for a NullCrossReference instance. It was 
throwing an
UnsupportedOperationException. The behaviour of the class has been changed and 
now
the method getText() will return null and the method hasText() will return 
false.

Original comment by brunoaranda on 6 Oct 2009 at 11:59

GoogleCodeExporter commented 9 years ago

Original comment by brunoaranda on 7 Oct 2009 at 9:08