Open-Systems-Pharmacology / MoBi

MoBi® is a software tool for multiscale physiological modeling and simulation
Other
31 stars 10 forks source link

Loading a pkml simulation created in R software using OspsuitR in MOBI #1589

Closed rizwanahmad closed 3 days ago

rizwanahmad commented 5 days ago

Application: MoBi® 11.3.207

Object reference not set to an instance of an object.

Stack trace:

at MoBi.Core.Services.AmountToConcentrationConverter.Convert(Object objectToConvert)
   at MoBi.Core.Serialization.Services.PostSerializationStepsMaker.<PerformPostDeserializationFor>b__6_1[T](T o)
   at OSPSuite.Utility.Extensions.EnumerableExtensions.Each[T](IEnumerable`1 list, Action`1 action)
   at MoBi.Core.Serialization.Services.PostSerializationStepsMaker.PerformPostDeserializationFor[T](IReadOnlyList`1 deserializedObjects, Int32 originalFileVersion, Boolean resetIds)
   at MoBi.Presentation.Tasks.SerializationTask.LoadMany[T](String fileName, Boolean resetIds)
   at MoBi.Presentation.Tasks.SerializationTask.Load[T](String fileName, Boolean resetIds)
   at MoBi.Presentation.Tasks.ProjectTask.loadSimulationTransferFromFileUsingDimensionMode(String fileName, ReactionDimensionMode dimensionMode)
   at MoBi.Presentation.Tasks.ProjectTask.LoadSimulationTransferDataFromFile(String fileName)
   at MoBi.Presentation.Tasks.ProjectTask.<>c__DisplayClass15_0.<loadSimulationFromFileInProject>b__0()
   at OSPSuite.Presentation.Services.HeavyWorkManager.doWork()
   at OSPSuite.Presentation.Services.HeavyWorkManager.<.ctor>b__9_1(Object o, DoWorkEventArgs e)
   at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
   at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)
rwmcintosh commented 4 days ago

Are you able to share the project?

amdreaanampg commented 4 days ago

I have the same problem Today, Is it a bug?

Application: MoBi® 11.3.207

Object reference not set to an instance of an object.

Stack trace:

at MoBi.Presentation.MoBiApplicationController.CreatePresenterForSubject[TSubject](TSubject subject)
   at OSPSuite.Presentation.Core.ApplicationController.Open[TSubject](TSubject subject, ICommandCollector commandCollector)
   at MoBi.Presentation.MoBiApplicationController.Open[TSubject](TSubject subject, ICommandCollector commandCollector)
   at MoBi.Presentation.Tasks.Edit.EditTasksForBuildingBlock`1.editPresenterFor(T entity)
   at MoBi.Presentation.Tasks.Edit.EditTasksForBuildingBlock`1.editEntiy(T entity)
   at MoBi.Presentation.Tasks.Edit.EditTasksForBuildingBlock`1.Edit(T buildingBlock)
   at MoBi.Presentation.UICommand.EditCommandFor`1.PerformExecute()
   at OSPSuite.Presentation.UICommands.ObjectUICommand`1.Execute()
   at OSPSuite.Presentation.UICommands.UICommandExtensions.ExecuteWithinExceptionHandler(IUICommand uiCommand, IEventPublisher eventPublisher, IChangePropagator changePropagator)
rwmcintosh commented 4 days ago

This stack trace is different compared to what is reported above. Can you share a project to help me diagnose it?

amdreaanampg commented 4 days ago

I edited the reaction in MoBi and changed my enzymes, and now it would not let close or save my simulation

image

rwmcintosh commented 4 days ago

Ok, can you share it? It looks like you were trying to open the reactions. Was this after you saved and opened it?

amdreaanampg commented 4 days ago

I made a mistake in the reaction setup. Instead of adding a molecule as an enzyme, I mistakenly added it as a transporter. I removed the components from the reaction to correct it and add new enzymes, but now the system won't allow me to edit anything. I’m not sure what the problem is. Any advice on how to fix this?

amdreaanampg commented 4 days ago

I cannot save my project because it shows me this

Application: MoBi® 11.3.207

Value cannot be null. Parameter name: key

Stack trace:

at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at OSPSuite.Utility.Collections.Cache`2.Add(TKey key, TValue value)
   at OSPSuite.Core.Serialization.Xml.SerializationContext.IdForString(String stringToCache)
   at OSPSuite.Core.Serialization.Xml.FormulaUsablePathXmlSerializer.TypedSerialize(FormulaUsablePath objectPath, SerializationContext serializationContext)
   at OSPSuite.Serializer.Xml.XmlSerializer`2.Serialize(Object objectToSerialize, TContext context)
   at OSPSuite.Serializer.Xml.XmlEnumerationNodeMapper`3.childNodeFor(TProperty child, TContext context)
   at OSPSuite.Serializer.Xml.XmlEnumerationNodeMapper`3.<>c__DisplayClass13_0.<Serialize>b__0(TProperty child)
   at OSPSuite.Utility.Extensions.EnumerableExtensions.Each[T](IEnumerable`1 list, Action`1 action)
   at OSPSuite.Serializer.Xml.XmlEnumerationNodeMapper`3.Serialize(TObject objectToSerialize, TContext context)
   at OSPSuite.Serializer.Xml.XmlSerializer`2.TypedSerialize(TObject objectToSerialize, TContext context)
   at OSPSuite.Serializer.Xml.XmlSerializer`2.Serialize(Object objectToSerialize, TContext context)
   at OSPSuite.Serializer.Xml.XmlEnumerationNodeMapper`3.childNodeFor(TProperty child, TContext context)
   at OSPSuite.Serializer.Xml.XmlEnumerationNodeMapper`3.<>c__DisplayClass13_0.<Serialize>b__0(TProperty child)
   at OSPSuite.Utility.Extensions.EnumerableExtensions.Each[T](IEnumerable`1 list, Action`1 action)
   at OSPSuite.Serializer.Xml.XmlEnumerationNodeMapper`3.Serialize(TObject objectToSerialize, TContext context)
   at OSPSuite.Serializer.Xml.XmlSerializer`2.TypedSerialize(TObject objectToSerialize, TContext context)
   at OSPSuite.Core.Serialization.Xml.FormulaCacheXmlSerializer.TypedSerialize(FormulaCache formulaCache, SerializationContext serializationContext)
   at OSPSuite.Serializer.Xml.XmlSerializer`2.Serialize(Object objectToSerialize, TContext context)
   at OSPSuite.Core.Serialization.Xml.Extensions.XmlSerializerRepositoryExtensions.AddFormulaCacheElement(IXmlSerializerRepository`1 serializerRepository, XElement element, SerializationContext serializationContext)
   at OSPSuite.Core.Serialization.Xml.BuildingBlockXmlSerializer`1.TypedSerialize(TBuildingBlock bb, SerializationContext serializationContext)
   at OSPSuite.Serializer.Xml.XmlSerializer`2.Serialize(Object objectToSerialize, TContext context)
   at MoBi.Core.Serialization.Xml.Services.XmlSerializationService.SerializeModelPart[T](T entityToSerialize)
   at MoBi.Core.Serialization.Xml.Services.XmlSerializationService.SerializeAsBytes[T](T entityToSerialize)
   at MoBi.Core.Serialization.ORM.Mappers.ProjectToProjectMetaDataMapper.serializeContent[T](MetaDataWithContent`1 metaDataWithContent, Object entity)
   at MoBi.Core.Serialization.ORM.Mappers.ProjectToProjectMetaDataMapper.serialize(EntityMetaData entityMetaData, Object entity)
   at MoBi.Core.Serialization.ORM.Mappers.ProjectToProjectMetaDataMapper.mapFrom(IWithId entityWithId)
   at MoBi.Core.Serialization.ORM.Mappers.ProjectToProjectMetaDataMapper.<>c__DisplayClass2_0.<MapFrom>b__0(IBuildingBlock x)
   at OSPSuite.Utility.Extensions.EnumerableExtensions.Each[T](IEnumerable`1 list, Action`1 action)
   at MoBi.Core.Serialization.ORM.Mappers.ProjectToProjectMetaDataMapper.MapFrom(IMoBiProject project)
   at MoBi.Core.Serialization.ORM.ProjectPersistor.projectMetaDataFrom(IMoBiProject project)
   at MoBi.Core.Serialization.ORM.ProjectPersistor.Save(IMoBiProject project, IMoBiContext context)
   at MoBi.Core.Serialization.ORM.ContextPersistor.Save(IMoBiContext context)
   at MoBi.Presentation.Tasks.SerializationTask.SaveProject()
   at MoBi.Presentation.Tasks.ProjectTask.saveProject()
   at MoBi.Presentation.Tasks.ProjectTask.Save()
   at MoBi.Presentation.UICommand.SaveProjectCommand.Execute()
   at OSPSuite.Presentation.UICommands.UICommandExtensions.ExecuteWithinExceptionHandler(IUICommand uiCommand, IEventPublisher eventPublisher, IChangePropagator changePropagator)
rwmcintosh commented 4 days ago

Do you have a recent save? You can close and open it again and re-do the actions.

amdreaanampg commented 4 days ago

Yes, it worked! This has happened to me before, so I’ve been saving my simulation every hour just in case. It would still be better if there was a way to fix it when it happens, because sometimes you make a lot of progress without noticing the issue

rwmcintosh commented 4 days ago

I can try to reproduce with the description you gave about adding transporter by accident.

The best is if you can give step-by-step instructions as much as you can.

rizwanahmad commented 3 days ago

Are you able to share the project?

Hello This is Rizwan. How can I share the project. please guide me.

rizwanahmad commented 3 days ago

Are you able to share the project?

How can I share the project, please guide.

rizwanahmad commented 3 days ago

How can I share the project with you.

rwmcintosh commented 3 days ago

You can zip it and attach it to the issue. It will be publicly visible. Use this little paperclip to attach

image

rizwanahmad commented 3 days ago

But the project is a part of PK-SIM learning by Esqlabs ( https://learn.esqlabs.com) provided to me as an academic learner. I may not be able to share it to the public domain.

On Tue, Oct 22, 2024, 12:06 PM Robert McIntosh @.***> wrote:

You can zip it and attach it to the issue. It will be publicly visible. Use this little paperclip to attach

image.png (view on web) https://github.com/user-attachments/assets/58d50008-c003-41b7-bb5c-7ebac4edf72f

— Reply to this email directly, view it on GitHub https://github.com/Open-Systems-Pharmacology/MoBi/issues/1589#issuecomment-2428425364, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQTJEE6HL2VT42EPTFILQLZ4X2PVAVCNFSM6AAAAABQIRNC2CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMRYGQZDKMZWGQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

rwmcintosh commented 3 days ago

I invited you to a repository within esqLABS github org that you can use to share. Create an issue there and attach the project

rizwanahmad commented 3 days ago

I have attached the zipped folder.

rwmcintosh commented 3 days ago

I see the problem.

You need to use the latest version of OSPSuite to access these projects. The PKML has been created with Version 12 and you'll need to use the version 12 beta to open it.

https://github.com/Open-Systems-Pharmacology/Suite/releases/tag/v12.0_beta1

rwmcintosh commented 3 days ago

Closing this one in favour of #1592.

The original reported error has a solution, but the second issue is covered.