Skip to content

Commit

Permalink
Remove qual and FBC SED-ML files.
Browse files Browse the repository at this point in the history
In theory, we could figure out what to use for them, but we haven't and need to publish, so don't do this.
  • Loading branch information
luciansmith committed Jul 25, 2024
1 parent 00b8fd9 commit 1d0d89d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fix-entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import remove_converted_files_for_non_kinetic_models
import remove_empty_containers_from_sedml_doc
import remove_non_sbml
import remove_qual_and_fbc_sedml
import remove_unused_sedml_elements
import remove_urn_sbml_files
import remove_initial_rdf_file
Expand Down Expand Up @@ -209,7 +210,10 @@ def fix_entry(id, convert_files=False, guess_file_name=None, validate_sbml=False
sbml_filenames.sort()

fix_sbml_validity.run(id, sbml_filenames)

sedml_filenames = glob.glob(os.path.join(temp_entry_dir, '**', '*.sedml'), recursive=True)
sedml_filenames.sort()

remove_qual_and_fbc_sedml(id, sedml_filenames, sbml_filenames)
sedml_filenames = glob.glob(os.path.join(temp_entry_dir, '**', '*.sedml'), recursive=True)
sedml_filenames.sort()

Expand Down
20 changes: 20 additions & 0 deletions remove_qual_and_fbc_sedml.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import os

# Don't use this list; figure it out on the fly (so we're future-proofed)
#qual_and_fbc_models = ["BIOMD0000000562", "BIOMD0000000592", "BIOMD0000000593", "BIOMD0000001046", "BIOMD0000001061", "BIOMD0000001062", "BIOMD0000001063", "BIOMD0000001064"]

def hasQualOrFBC(sbml_filenames):
for filename in sbml_filenames:
f = open(filename, "r")
for line in f:
if "qual:" in line:
return True
if "fbc:" in line:
return True
return False


def run(id, sedml_filenames, sbml_filenames):
if hasQualOrFBC(sbml_filenames):
for filename in sedml_filenames:
os.remove(filename)

0 comments on commit 1d0d89d

Please sign in to comment.