cdanielmachado / carveme

CarveMe: genome-scale metabolic model reconstruction
Other
153 stars 52 forks source link

#alternative-universes #75

Closed LeilaRze closed 4 years ago

LeilaRze commented 4 years ago

Dear Daniel, I would like to use a published SBML model as a universe_file. Based on the Alternative universes section in the documentation (https://carveme.readthedocs.io/en/latest/advanced.html#alternative-universes), it seems like I should be able to use the following commands: build_universe ... carve genome.faa --universe-file universe.xml I have faced an error, when I am tying this: $ wget https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/002/897/355/GCA_002897355.1_Aurantiochytrium_FCC1311_v1/GCA_002897355.1_Aurantiochytrium_FCC1311_v1_genomic.fna.gz -O target.fna.gz $ gunzip -d target.fna.gz $ wget https://static-content.springer.com/esm/art%3A10.1186%2Fs12864-015-2042-y/MediaObjects/12864_2015_2042_MOESM1_ESM.xml -O test.xml $ carve --dna GCA_002897355.1_Aurantiochytrium_FCC1311_v1_genomic.fna --universe-file 12864_2015_2042_MOESM1_ESM.xml -o test.xml
Traceback (most recent call last): File "/home/user/.local/bin/carve", line 364, in ref_score=args.reference_score File "/home/user/.local/bin/carve", line 125, in main universe_model = load_cbmodel(universe_file, flavor=config.get('sbml', 'default_flavor')) File "/home/user/.local/lib/python3.6/site-packages/framed/io/sbml.py", line 146, in load_cbmodel load_gprs=load_gprs, load_metadata=load_metadata) File "/home/user/.local/lib/python3.6/site-packages/framed/io/sbml.py", line 104, in load_sbml_model load_gprs=load_gprs, load_metadata=load_metadata) File "/home/user/.local/lib/python3.6/site-packages/framed/io/sbml.py", line 313, in _load_cbmodel _load_cobra_gpr(sbml_model, model) File "/home/user/.local/lib/python3.6/site-packages/framed/io/sbml.py", line 362, in _load_cobra_gpr gpr = parse_gprrule(rule, prefix='G') File "/home/user/.local/lib/python3.6/site-packages/framed/io/sbml.py", line 401, in parse_gpr_rule expr = parse_expr(rule) File "/home/user/.local/lib/python3.6/site-packages/sympy/parsing/sympy_parser.py", line 1003, in parse_expr code = stringify_expr(s, local_dict, global_dict, transformations) File "/home/user/.local/lib/python3.6/site-packages/sympy/parsing/sympy_parser.py", line 887, in stringifyexpr for toknum, tokval, , , in generate_tokens(input_code.readline): File "/usr/lib/python3.6/tokenize.py", line 602, in _tokenize raise TokenError("EOF in multi-line statement", (lnum, 0)) tokenize.TokenError: ('EOF in multi-line statement', (2, 0))

Do I first need to run build_universe?

Thanks in advance, Leila

cdanielmachado commented 4 years ago

Hi Leila,

Unfortunately, this model is not a valid SBML model.

You can test it here, and you will see what I mean:

http://sbml.org/Facilities/Validator

LeilaRze commented 4 years ago

Hi Daniel,

Thanks so much for your time.

Actually my main concern is to figure out is it possible to use a published SBML model as a universe_file during carving? Also, I would like to use Carveme for the reconstruction of a fungal-like organism. So, what is the current status of Carveme for eukaryotic models? Has there been any progress since the discussion in issue #44?

$ wget https://static-content.springer.com/esm/art%3A10.1186%2Fgb-2009-10-6- r69/MediaObjects/13059_2009_2219_MOESM4_ESM.xml $ wget https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/009/045/GCF_000009045.1_ASM904v1/GCF_000009045.1_ASM904v1_genomic.fna.gz -o target.fna.gz $ gunzip -d target.fna.gz $ carve --dna GCF_000009045.1_ASM904v1_genomic.fna -universe_file 13059_2009_2219_MOESM4_ESM.xml -o test.xml usage: carve [-h] [--dna | --egg | --refseq | --genbank] [--diamond-args DIAMOND_ARGS] [-r] [-o OUTPUT] [-u UNIVERSE | --universe-file UNIVERSE_FILE] [--cobra | --fbc2] [-n ENSEMBLE] [-g GAPFILL] [-i INIT] [--mediadb MEDIADB] [-v] [-d] [--soft SOFT] [--hard HARD] [--reference REFERENCE] INPUT [INPUT ...] carve: error: unrecognized arguments: 13059_2009_2219_MOESM4_ESM.xml

Thanks in advance.

Regards, Leila

cdanielmachado commented 4 years ago

Hi Leila,

I think you are missing one dash, it should be --universe-file. But I would not recommend using any model as a universe, because since the construction is top-down, the final result will always be a smaller model, you will never be able to include reactions that are not in your universe file.

In this case, it might make more sense to use the --reference option. This will still use our universe to get all the reactions from but will try to make the final model as similar as possible to the reference model, while still accounting for the gene annotations in the fasta file to decide which reactions to include.

Regarding a eukaryotic universe, unfortunately, there has still been no progress on that side.

Best regards, Daniel

LeilaRze commented 4 years ago

Hi Daniel,

Thanks a lot for your time. your comments were so helpful.

Regards, Leila