# HG changeset patch # User tduigou # Date 1680513502 0 # Node ID ceffb29b60c9efa1024bc7f0b8f4681b7d2613a6 # Parent 4797d0b36ff35608692a7d6bfa79ea7c255f7453 planemo upload commit 9c19f737cd6e2152151c8bf97a53ab1afe51a4a0 diff -r 4797d0b36ff3 -r ceffb29b60c9 LICENSE --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LICENSE Mon Apr 03 09:18:22 2023 +0000 @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2020 Jean-Loup Faulon's group & INRA +Copyright (c) 2020 University of Evry / Paris-Saclay + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff -r 4797d0b36ff3 -r ceffb29b60c9 README.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README.md Mon Apr 03 09:18:22 2023 +0000 @@ -0,0 +1,32 @@ +# get_sbml_model - Pick an SBML model among a list + +## How to run get_sbml_model wrapper tests + +In order to execute tests on get_sbml_model wrapper, you need to: + + - Connect to your galaxy instance in interactive mode: + + ```bash + docker exec -it -u root galaxy_galaxy_1 bash + ``` + - Copy all the contents of `test-data` folder into your own test-data directory which is located in your local galaxy instance : `/galaxy/test-data`. It contains all the input files and expected output files needed for the tests. + + - Install Planemo: + You can see here the documentation for Planemo Installation : https://planemo.readthedocs.io/en/latest/installation.html + Note that they recommand to install Planemo by setting up a virtual environment: + + ```bash + python3 -m venv planemo + . planemo/bin/activate + pip install -U planemo + ``` + + - run the tests: + + ```bash + planemo test tools/synbiocad-galaxy-wrappers/get_sbml_model/wrap.xml + ``` + + IMPORTANT: Maybe you will need to remove CONDA from your PATH for the command `planemo test` to run correctly. To do that, you can edit this file `~/.bashrc`, comment this line `PATH="/root/anaconda3/bin:$PATH"` and save changes. + + Planemo will output an html test summary `tool_test_output.html`. \ No newline at end of file diff -r 4797d0b36ff3 -r ceffb29b60c9 config/job_conf.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config/job_conf.xml Mon Apr 03 09:18:22 2023 +0000 @@ -0,0 +1,1 @@ + diff -r 4797d0b36ff3 -r ceffb29b60c9 config/tool_conf.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config/tool_conf.xml Mon Apr 03 09:18:22 2023 +0000 @@ -0,0 +1,3 @@ +
+ +
diff -r 4797d0b36ff3 -r ceffb29b60c9 get_infos.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/get_infos.py Mon Apr 03 09:18:22 2023 +0000 @@ -0,0 +1,44 @@ +from argparse import ArgumentParser +from libsbml import ( + readSBMLFromFile +) + + +def entry_point(): + parser = ArgumentParser('Returns cell informations') + parser.add_argument( + 'infile', + type=str, + help='SBML input file (xml)' + ) + parser.add_argument( + '--comp', + type=str, + help='Path to store cell compartments' + ) + parser.add_argument( + '--biomass', + type=str, + help='Path to store biomass reaction ID' + ) + params = parser.parse_args() + + sbml_doc = readSBMLFromFile(params.infile) + + if params.comp: + compartments = sbml_doc.getModel().getListOfCompartments() + with open(params.comp, 'w') as f: + f.write('#ID\tNAME\n') + for comp in compartments: + f.write(f'{comp.getId()}\t{comp.getName()}\n') + + if params.biomass: + reactions = sbml_doc.getModel().getListOfReactions() + with open(params.biomass, 'w') as f: + f.write('#ID\n') + for rxn in reactions: + if 'biomass' in rxn.getId().lower(): + f.write(f'{rxn.getId()}\n') + +if __name__ == "__main__": + entry_point() \ No newline at end of file diff -r 4797d0b36ff3 -r ceffb29b60c9 get_sbml_model.xml --- a/get_sbml_model.xml Tue Jan 11 16:17:26 2022 +0000 +++ b/get_sbml_model.xml Mon Apr 03 09:18:22 2023 +0000 @@ -1,12 +1,14 @@ - - Pick an SBML model among a list + + Get an SBML model (BiGG) curl gzip + python-libsbml '$sbml_model' + | gunzip > '$model'; + python '$__tool_directory__/'get_infos.py '$model' --comp '$compartments' --biomass '$biomass' ]]> @@ -60,13 +62,17 @@ - + + + - + + + `_ - - -Acknowledgments ---------------- - -* Kenza Bazi-Kabbaj - ]]> - \ No newline at end of file + + + +