iVis-at-Bilkent / newt

A web application to visualize and edit pathway models
http://newteditor.org
GNU Lesser General Public License v3.0
52 stars 27 forks source link

Refine/fix import/export operations #712

Open hasanbalci opened 3 weeks ago

hasanbalci commented 3 weeks ago

Current export menu is implemented for exporting SBGNML maps to other formats such as SBML, SIF etc. and they should be working well. However, when we added other formats, SIF and SBML, we didn't put any restrictions for users to use export functionality for these types and this currently leads to wrong export operations. For example, user is able to export SBML file to SBGNML but not in the proper way. The output file of this conversion leads to an SBGNML file with map type SBML which is inconvenient. As a solution we need to add support for possible conversions and disable the rest with a warning message.

Minerva converter that we are currently using for some format conversions supports conversion of SBML to SBGN, GPML and CellDesigner. So we can add support for these three conversions (For SBML -> SBGN conversion, we need to check to which SBGNML version Minerva converts). I think, SBML to SIF conversion can be implemented manually.

Other conversions, SIF to all other formats and if there is any from SBML, we need to show a warning to the user that the export is not currently possible.

ugurdogrusoz commented 3 weeks ago

To properly understand the current situation, I prepared some tables here and proposed handling of invalid situations. @hasanbalci Please check.

hasanbalci commented 1 week ago

One problem I noticed is the following: Before SBML support, when we try to export SBGN maps as SBML, we were using MINERVA service. After the SBML support, we have write functionality for SBML maps and current 'Export as SBML' button uses that functionality. However, when an SBGN map is open in the canvas and if we try to export the map SBML, the app behaves like the current map is SBML and tries to write it with the write functionality provided with SBML support. Instead it should use Minerva converter instead to convert the current SBGN map to SBML.

ugurdogrusoz commented 1 week ago

After having discussed all varying combinations, here is what needs to change according to this document (same numbering used in the document):

okg21 commented 2 days ago

For item 2, I encountered two types of problem when using minerva service for PD to SBML conversion.

  1. For some PD samples sbgnml to sbml minerva conversion returns an xml with this note inside:

    [Complex:glyph15]   Unknown extension: extraInfo
    [Complex:glyph11]   Unknown extension: extraInfo
    [glyph32_0:state]   Invalid structural state
    [Complex:glyph14]   Unknown extension: extraInfo
    [Complex:glyph12]   Unknown extension: extraInfo
    [Complex:glyph13]   Unknown extension: extraInfo
    [Complex:glyph18]   Unknown extension: extraInfo
    [Complex:glyph16]   Unknown extension: extraInfo</p>
  2. For some PD samples Minerva returns an Internal Server Error. For instance, when I try to export the PD sample Drosophila Cell Cycle as SBML, I get the following error:

    error: "Internal server error."
    error-id: "0a5fb699-3739-42cf-a5f9-a5779b367de1"
    reason: "[Complex 89360553-bab4-532a-c6c7-624272c4e43b]\tProblem with exporting bioEntity"

    I did some further investigation regarding this, and this happens when elements inside the complex are not linked to reactions in the model. Here is an example: the first image throws the above error with Minerva API, but the second one is exported with no issues. Screenshot 2024-07-03 at 14 49 09 Screenshot 2024-07-03 at 14 38 48

okg21 commented 1 day ago

Regarding item 3, I pushed some fixes to sbgnviz for the SBML map to .sbml export. https://github.com/iVis-at-Bilkent/sbgnviz.js/commit/2cc6ec68b6a865d0172ed0099d2d19185a40abac Below are the pre-fix and post-fix exports for the SBML mapped Pharmacokinetics sample. Before fix: Screenshot 2024-07-04 at 17 10 52 After fix: Screenshot 2024-07-04 at 17 07 46

okg21 commented 13 hours ago

As of now, items 1, 3 and 6 should be working properly.

ugurdogrusoz commented 7 hours ago

1: is OK now 3: SBML -export-to-> SBML: still missing layout info, SBML -export-to-> CellDesigner: conversion service is not available 6: is OK now