Skip to content

Add basic FROG report generation for FBA models - #102

Open
dyrpsf wants to merge 2 commits into
draeger-lab:masterfrom
dyrpsf:support-fba-frog-analysis-49
Open

Add basic FROG report generation for FBA models#102
dyrpsf wants to merge 2 commits into
draeger-lab:masterfrom
dyrpsf:support-fba-frog-analysis-49

Conversation

@dyrpsf

@dyrpsf dyrpsf commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

This PR adds initial support for generating FROG reference files for FBA models and addresses #49.

New functionality

  • Introduces org.simulator.fba.FrogReport with a static method

    FrogReport.writeFrogReport(File modelFile, File outputFile)

which:

  • reads an SBML FBC model,

  • runs FluxBalanceAnalysis,

  • collects the active objective id and objective value,

  • builds a FROG JSON report following the FROG schema v1 (https://github.com/matthiaskoenig/fbc_curation),

  • and writes the JSON file.

  • The generated FROG report currently includes:

    • metadata: model location, MD5 hash, software/solver/environment info.
    • objectives: a single entry for the active objective with status (optimal/infeasible) and value.
    • fva, reaction_deletions, gene_deletions: present as empty lists as placeholders
    • for future extensions (FVA and deletion analyses are not yet implemented in SBSCL).

Tests

  • Adds FrogReportTest in src/test/java/org/simulator/fba/FrogReportTest.java:

    • uses the existing e_coli_core.xml FBC test model,
    • calls FrogReport.writeFrogReport(...),
    • checks that the FROG JSON file is created and contains the main schema sections
    • (metadata, objectives, fva, reaction_deletions, gene_deletions).

This provides a first step towards FROG support so that SBSCL can produce standardized
reference files for FBA models which can be used together with fbc_curation / runfrog
to check reproducibility across solvers.

@draeger draeger linked an issue Mar 9, 2026 that may be closed by this pull request
@draeger draeger added enhancement sbml-fbc SBML models with FBC extension labels Mar 9, 2026

@draeger draeger left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good! Thanks for implementing this feature in the first version. I agree it should be included, but we should not write JSON code "by hand" as it is done now. Instead, let's include a lightweight JSON library and remove JSON string processing from our code.

Comment thread src/main/java/org/simulator/fba/FrogReport.java
Comment thread src/main/java/org/simulator/fba/FrogReport.java Outdated
Comment thread src/main/java/org/simulator/fba/FrogReport.java Outdated
@dyrpsf

dyrpsf commented Mar 10, 2026

Copy link
Copy Markdown
Contributor Author

I’ve pushed an update that:

  • Adds org.json as a lightweight JSON dependency and refactors FrogReport to build the
    FROG report via JSONObject/JSONArray.
  • Introduces writeFrogReport(SBMLDocument, File) as the main API while keeping
    writeFrogReport(File, File) as a convenience wrapper.
  • Exposes the LP solver from FluxBalanceAnalysis and uses its class name in the FROG metadata.

mvn -DskipTests compile and mvn test both pass locally.

@draeger
draeger self-requested a review March 10, 2026 21:20

@draeger draeger left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work!

@draeger
draeger requested a review from tyzerrr March 10, 2026 21:24
@dyrpsf

dyrpsf commented Mar 11, 2026

Copy link
Copy Markdown
Contributor Author

Excellent work!

Thank you for the review and feedback! Glad I could contribute. Looking forward to working on more improvements in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement sbml-fbc SBML models with FBC extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for FBA FROG analysis

2 participants