CSBiology / OBO.NET

An OBO file format parser, written in F#.
MIT License
3 stars 1 forks source link

[BUG] Synonyms not correctly written to lines #27

Closed Freymaurer closed 10 months ago

Freymaurer commented 10 months ago

I read the ncbitaxon ontology, filter out terms and write it again.

The source looks like this:

[Term]
id: NCBITaxon:562
name: Escherichia coli
namespace: ncbi_taxonomy
alt_id: NCBITaxon:1637691
alt_id: NCBITaxon:1806490
alt_id: NCBITaxon:469598
alt_id: NCBITaxon:662101
alt_id: NCBITaxon:662104
synonym: "Bacillus coli" RELATED synonym []
synonym: "Bacterium coli" RELATED synonym []
synonym: "Bacterium coli commune" RELATED synonym []
synonym: "E. coli" EXACT common_name []
synonym: "Enterococcus coli" RELATED synonym []
synonym: "Escherichia/Shigella coli" EXACT equivalent_name []
xref: GC_ID:11
xref: PMID:10319482
is_a: NCBITaxon:561 ! Escherichia
property_value: has_rank NCBITaxon:species

This is the output:

[Term]
id: NCBITaxon:562
name: Escherichia coli
alt_id: NCBITaxon:1637691
alt_id: NCBITaxon:1806490
alt_id: NCBITaxon:469598
alt_id: NCBITaxon:662101
alt_id: NCBITaxon:662104
synonym: { Text = ""Bacillus coli""
  Scope = Related
  TypeName = "synonym"
  DBXrefs = [] }
synonym: { Text = ""Bacterium coli""
  Scope = Related
  TypeName = "synonym"
  DBXrefs = [] }
synonym: { Text = ""Bacterium coli commune""
  Scope = Related
  TypeName = "synonym"
  DBXrefs = [] }
synonym: { Text = ""E. coli""
  Scope = Exact
  TypeName = "common_name"
  DBXrefs = [] }
synonym: { Text = ""Enterococcus coli""
  Scope = Related
  TypeName = "synonym"
  DBXrefs = [] }
synonym: { Text = ""Escherichia/Shigella coli""
  Scope = Exact
  TypeName = "equivalent_name"
  DBXrefs = [] }
xref: GC_ID:11
xref: PMID:10319482
property_value: has_rank NCBITaxon:species
is_a: OBI:0100026 ! organism

Obviously the ToString method is not for TermSynonym is not overwritten which produces this error, here:

https://github.com/CSBiology/OBO.NET/blob/d4b6434bed77c96ad4c808effa87e20c4eabd18d/src/OBO.NET/OboTerm.fs#L499

I will try to do a PR tomorrow, is it possible to release this asap after review?

@omaus @kMutagene