euba / BacArena

agent based modelling
GNU General Public License v3.0
25 stars 10 forks source link

Can't add my own model readMATmod #166

Open JessicaSingh1997 opened 3 years ago

JessicaSingh1997 commented 3 years ago

Error in readMATmod("testLBba.mat") : object 'mod.gpr' not found

I'm trying to upload my own models, and grRules is very well present in my .mat file but I can't figure out why this error is showing up :/

JessicaSingh1997 commented 3 years ago

I also have the xml files available, if there is an easier way to upload those instead.

jotech commented 3 years ago

hi @JessicaSingh1997 can you provide the file testLBba.mat then I can try to have a look what's going wrong?

JessicaSingh1997 commented 3 years ago

Hi Jo, Thanks for your response. I tried to use the function with all these .mat files and got the same error. These are metabolic models of S.thermophilis and L.bulgaricus Mat_files.zip

JessicaSingh1997 commented 3 years ago

Hi @jotech can I try adding SMBL models to BacArena?

jotech commented 3 years ago

Of course, sbml is even the default way to import models into BacArena :)

library(BacArena)
library(sybilSBML)
mod <- readSBMLmod("model.xml")
bac <- Bac(mod)
arena <- Arena(n=10,m=10)
arena <- addOrg(arena, bac, 5)
arena <- addDefaultMed(arena, bac)
sim <- simEnv(arena, time=3,sec_obj='mtf')
plotGrowthCurve(sim)
plotSubCurve(sim)[1]
JessicaSingh1997 commented 3 years ago

HI @jotech again, I tried getting the packages for making it work this way but it was a dead end. I went though the .mat you used in the example and my .mat files and there are no differences, except maybe a few fields but those are not important to the readMATmod function.

I'm still getting object 'mod.gpr' not found as an error even through grRules is a cell in the .mat file. Can you help me out please, its urgent :(