rdmenezes / ontowiz

Automatically exported from code.google.com/p/ontowiz
0 stars 0 forks source link

Divergence between OntoPerl and ontoWiz should be verified #1

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Discovered possible bug in Onto-Perl. Required ability inserting empty
values in char-list, i.e. change of the requirements. Consider
updating Onto-Perl, given below discussion:

From file sample_data/SBO_OBO.obo:
{{
!----------------------------------
[Term]
id: SBO:0000051
name: new term name
def: "" [src_code:NR]
is_obsolete: true
!----------------------------------
}}

* We observe that the defenition may not have it's text set. For the 
obo-export-function int Onto-Perl we have:
--------------------------------------------------------------------------------
-------------------------
{{
#
# def
#
my $term_def = $term->def();
if (defined $term_def->text()) {
    print $output_file_handle "\t\t<def>\n";
    print $output_file_handle "\t\t\t<def_text>",
&__char_hex_http($term_def->text()), "</def_text>\n";
    for my $ref ($term_def->dbxref_set()->get_set()) {
        print $output_file_handle "\t\t\t<dbxref xref=\"", $ref->name(),
"\">\n";
        print $output_file_handle "\t\t\t\t<acc>", $ref->acc(),"</acc>\n";
        print $output_file_handle "\t\t\t\t<dbname>", $ref->db(),"</dbname>\n";
        print $output_file_handle "\t\t\t</dbxref>\n";
   }
   print $output_file_handle "\t\t</def>\n";
}
}}
--------------------------------------------------------------------------------
* This implies that an ontology (with missing text-label) which is first 
imported, then exported before importing it again, would cause an information 
loss.

What steps will reproduce the problem?
1. Load the ontology "sample_data/SBO_OBO.obo".
2. Export it.
3. Observe that "def: "" [src_code:NR]" is not printed.

Original issue reported on code.google.com by oeks...@gmail.com on 28 Feb 2013 at 10:51

GoogleCodeExporter commented 9 years ago
I added the following test to check this issue:

to alpha.obo

[Term]
id: MYO:1000008
name: term without a definition
def: "" [src_code:NR]
is_obsolete: true

then to Ontology.t

my $ole = $alpha_onto->get_term_by_id('MYO:1000008');
ok ($ole->def_as_string() eq '"" [src_code:NR]');

which actually works.

Original comment by erick.an...@gmail.com on 4 Mar 2013 at 7:29

GoogleCodeExporter commented 9 years ago
Indeed; what you do works, but none of the lines in your example exports the 
data (see point "2" in "What steps...." above). I have here provided two files:
(1) The sample script to produce the bogus file ("erick.pl"), and
(2) the bogus file ("export.obo"):  
--------export.obo who was expected to be a lossless back-transformation of 
SOB_OBO.obo-----------
{{
[Term]
id: SBO:0000051
name: new term name
is_obsolete: true
}}

Hope this helps in the writing of your internal tests.

Original comment by oeks...@gmail.com on 4 Mar 2013 at 9:09

Attachments: