Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check file compatibility #77

Closed
1 task
stellaprins opened this issue Nov 6, 2024 · 4 comments
Closed
1 task

check file compatibility #77

stellaprins opened this issue Nov 6, 2024 · 4 comments

Comments

@stellaprins
Copy link
Collaborator

stellaprins commented Nov 6, 2024

Filed in this pyNeuroML issue and fixed in this PR.

  • use pyNeuroML confirm_file_type for file compatibility processing

When I made the BIOMD0000000001 table (see issue #57) I noticed that the SBML and SED-ML files are not recognized as such with the current check_file_compatibility_test function.

(?) Improve compatibility processing to recognize SBML / SED-ML files in ways other than the file names or extensions. (see comments on issue #31)

(?) Figure out how to recognise other formats (e.g. NeuroML, LEMS, SBML-qual, BNGL, RBApy etc)

Issue will be addressed here: NeuroML/pyNeuroML#435

@sanjayankur31
Copy link

sanjayankur31 commented Nov 6, 2024

Hrm, they really shouldn't be using xml as the file extension BIOMD0000000001_url.xml -> that's just too vague.

The only "correct" way of checking files is to actually read them and parse them to see if they include the required XML tags. In this case, we'll have to read the file to see that the "root" tag is <sbml>. We were hoping to avoid this because reading each file to detect its type can be quite resource intensive if the files are large (NeuroML cell files can be tens of thousands of lines). I guess we could come up with some way in which we only read the first and last N lines of the file to check for a tag :thinking. This won't be perfect either because it'll fail for badly formatted files that have comments/garbage in these lines..

Edit: perhaps we try the file extension first, and if that doesn't work because it's "xml", we read the first/last N files to match for tags.

@sanjayankur31
Copy link

Filed: NeuroML/pyNeuroML#435

Will try to fix it in the next couple of days

@stellaprins
Copy link
Collaborator Author

I believe that in the SBML test_suite (sementic) all SBML and SED-ML files have the .xml file extension. As work around I use the extensions and filenames to determine whether a given file is an SBML file (.xml file extension + sbml but not sedml in filename) or a SED-ML file (.xml file extension + sbml and sedml in filename).

I had a quick look at Biomodels and there SBML files appear to have.xml file extensions and SED-ML files appear to have .sedml extensions.

@pgleeson
Copy link
Member

pgleeson commented Feb 3, 2025

I beleive this is fixed now...

@pgleeson pgleeson closed this as completed Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

3 participants