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
Errors when adding containers to Spatial Structures in Mobi, references ignored #46
Comments
Hey @TakugoAmy, This is a very interesting question and it will take probably a few iterations until I manage to describe clearly what's going on. Also thanks for attaching a project to the issue, this will be very helpful. Why is MoBi showing parameters in the tree that do not exist?We could qualify this as a display bug indeed. (I have created Open-Systems-Pharmacology/MoBi#147). The Where are the global molecule parameters coming from?For each If we look at one of this parameter more closely, for example In short, for the Why are these parameters used then ?!?Let's look at for example the first of the 6 errors with the passive transport The definition of the process stipulates that the process should be created from ALL Now the very interesting feature is the list of molecules for which the process will be created. Here you have defined that the process will be created for ALL Molecules except Now I am not sure what make sense in your case, but you have different choices here:
Why does it work with other organs?Well This is just the beginning.... try to make sense of this information and let's continue our discussion after that....and do not hesitate to fire up more questions. I think this will be very helpful for everyone out there. |
Thanks @msevestre for the quick response! I'm down to only three errors now. This makes a lot of sense regarding the LigandEndo & LigandEndo_Complex molecules. Similarly, I can see how this could be a remedy for the similar issue with the “FcRn kinetics” molecules with the “PassiveDiffusion” transporters. (Out of curiosity what are these molecules anyway? Are they just dummy molecules to be used in the reactions Building block?) I am still slightly confused about how this issue does not appear in other neighborhoods though. For example, what lets “PassiveDiffusionPl2RBC” correctly ignore “LignadEndo” in other neighborhoods but require explicit exclusion in my tumor organ neighborhoods? Also how do some of these tags work? For example, for something tagged “Neighborhood: Plasma / BloodCells”, does this imply that the source is “Plasma” and the target is “BloodCells”? Or is “Neighborhood: Plasma / BloodCells” as one big tag? One of the errors states that the drug I am modeling cannot find "Partition coefficient Interstitial/Water" Which is fine, I can add the parameter to "MolecularProperties" and have it work, but why doesn't this parameter show up in the Spatial structure of other organs? For example, In my last simulation before attempting to add the tumor, the tree showed this in the simulation: However the Spatial Structure does not include it: The other two errors I am facing regarding the FcRn binding reaction. I assume that these errors exist because "FcRn binding endogenous Igg" is a reaction which is supposed to occur in the "Endogenous IgG" container, and "FcRn binding tissue Herceptin" isn't supposed to occur in the "BloodCells" and "Intracellular" containers. This would imply that there must be a way to exclude reactions from compartments (As in my tumor container isn't on the exclude list), but I can't seem to find the mechanism which does this. I know it’s a barrage of questions, but once again thanks so much! P.S. It appears the Rollback option in History will not rollback changes made to the exclude list in the passive transports building block. There shouldn't be many differences between the project file from before, but I added the exclusions to Ligand and FcRn kinetics to passive transports. |
Hi @TakugoAmy When it comes to adding new molecules or containers, it is important to keep the "Molecule Start Values" (MSV) building block (BB) up to date. This BB defines, among others, which molecules are present in which containers. This is a powerful concept to have control of processes, as a process (be it a passive or an active transport, or a reaction) is only created in containers where all molecules involved in this process are present. As a first step after adding new molecules/containers, you shoud update the MSV-BB by selecting the "Extend"-button: This forces new entries to be created. When extending the MSV-BB, all molecules are set as present in new containers (also all new molecules are set as present in all containers). However, this is no the desired behavior. What I do is going through all molecules (which can get very painful in large models...) and compare their "Is Present"-flag in the new compartment with the flag in compartments created by PK-Sim. Let's take a look on the molecules "LigandEndo" and "LigandEndo_Complex", which were causing some errors. Filter the table to only show these molecules. You can also combine this filter with "IsPresent"-Flag, as I did in the screenshot above. I selected to only show entries of "LigandEndo" and "LigandEndo_Complex" in compartments where they are present. Entries highlighted in green are the newly created ones - and these are the entries for your Tumor-organ. As you can see, "LigandEndo" and "LigandEndo_Complex" are not present in any default organ, but are present in the tumor. To be consistent with the model, you should exclude these molecules from the tumor. You can do it by multiselcting the green entries and selecting the "Mark selected as not present" - button: Now, "LigandEndo" and "LigandEndo_Complex" are only present in the "EndogenousIgG"-compartment. You can remove these molecules from the "Exclude"-list of the passive transport processes "PassiveDiffusionPl2RBC" and "PassiveDiffusionInt2Cell" now. You should repeat the above mentioned steps and also exclude the moleclues FcRn, FcRn kinetics endosome/interstitial/plasma from the tumor compratments. The Herceptin-FcRn_Complex should be present in Plasma, Interstitial, and Endosome compratments - you have to exclude it from the BloodCells and Intracellular compartments of the tumor. You could also be interested in updating the "Parameter Star Values"-BB and checking the new entries for the organ "Mechanistic_Tumor". Just filter the "Path Element 1"-column for the name of the organ. I guess, all parameres can be left as they are, but you can check the values of the "Relative expression"-parameters, if you want some proteins to be excpressed in tumor. At last, to make your model work, you have to manually add the parameter "Partition coefficient (interstitial/water)" to the neighborhood "Mechanistic_Tumor_int_Mechanistic_Tumor_cell". As you already mentioned, this parameter is somehow not present in the Spatial-Structure-BB but is present in the simulation. The reason for this is not clear (for me). The value of the parameter should be defined by a formula and not as a constant. You can check how the formula for this parameter looks like in other organs in the simulation: Be aware that the path to the parameter "K_int_pls" is not generic but is "hard coded" for the specific organ". The correct path for the tumore would be "Neighborhoods|Mechanistic_Tumor_pls_Mechanistic_Tumor_int|MOLECULE|Partition coefficient (interstitial/plasma)". I alse see that some of other parameters in the "Molecule Properties" of the tumor neighborhoods are set to constant values, such as "P_cell_int_factor". If you take a look at the same parameters in other organs, for example muscle, you will see that they are defined by formulas. You must change the parameters to the according formulas in order for the model to work properly. This goes for the parameter "Partition coefficient (interstitial/plasma)" in the neighborhood "Mechanistic_Tumor_pls_Mechanistic_Tumor_int". Also, some parameters in the "Mechanistic_Tumor" container are missing, like "Specific blood flow rate". How did you create the tumor organ? The best way is to save an existing organ as PKML and load it the into the stucture. This will ensure that all relevant parameters are present - you just have to adjust them accordingly to your need. I copied the parameters "Specific blood flow rate" and "Density (tissue)" from muscle. There is one last parameter missing - "Organ volume mouse", which is used for scaling the "Fluid recirculation flow rate" - a paramere used in the two-pores transport model. I really have no idea what value to choose here - it seems that the tumor-example was created with an older version of the software, where "Fluid recirculation flow rate" was a constant value and not calculated. I propose the following - select the value of "Organ volume mouse" to the same proportion of the tumor volume as it is for muscle: Organ volume mouse (muscle) / Volume (muscle) = 0.0002865368 I defined it by a formula so the proportion will hold if you change the volume of the tumor. I just hope that creation of new organs will be more easy in future version of OSPS. For now, I suggest you repeat all the steps described to understand what is done. I attached the project where simulation can be created. However, running the simulation results in ODE-solver error (it does work for e.g. 500 hours of simulation time). The first thing I would check is the consistency of the flows (blood flow, lymph flow etc) for the new compartment. I hope my answer is not too confusing. Adding new organs is one of the most advanced procedure in MoBi ;) I encourage you to go through the steps I described and ask new questions if you run into a problem. |
Sorry, here is the model: |
@TakugoAmy |
@PavelBal Great insight. Thanks a lot
Could you create an issue for that on the MoBi issue page?
Where do you see those tags? @ALL: Looking at this thread, there is a LOT of useful information that we could maybe try to split into smaller forum entries so that user could understand a bit more of what's happening under the hood? For example
|
Neighborhoods have these tags. I could not find a single process in the models where these tags are used. |
@PavelBal |
@PavelBal I had been tying to understand the function of "Molecular Start Values" and "Parameter Start Values" and this makes things very clear. I wanted to build the Organ from scratch such that I would be able to learn as much as possible of how everything was working behind the scenes, it's easy to add a .pkml file, but that wouldn't have taught me as much as it has now. Thanks again everybody |
Out of curiosity, how were you able to make "Specific blood flow rate" come out with a distribution? I don't see an option to make it that way so the best I could do was set it as a constant. |
Could you please create another question in the forum to ask this question as it is not related to the problem here. We are trying to have only one question per thread. This will help other people having the same issue in the future. |
Hi everyone,
I was wondering if anyone could shed light to an issue I'm having in Mobi.
I was attempting to create a tumor compartment in Spatial Structures based off of the mechanistic tumor provided in the examples. However I wished to modify it to be modeled like an organ and connect it to the Arterial and Venous blood along with adding BloodCell, Interstitial,Endosome, and Plasma sub-compartments.
However I get 8 errors when attempting to add the Spatial Structure containing my tumor compartment to the simulation which elude me.
6 of the errors pertaining to Passive transport which seem to state that references cannot be found.
However following the path in question reveals that they very much so exist...
I don't even really know where to begin to solve these since the object referenced appears to exist in the path, and presumably is working fine in the other organs. Is this a bug?
The other two involve FcRn binding, where my reaction does not seem to be able to find Kd and kass values in the tumor compartment.
I can manually add the items in question to the path and remedy this issue. However these do not seem to be visibly defined in the other organs, so then how are they being defined in the organs?
Does anyone have any ideas? Especially for the 6 errors.
I've added the project if anyone's interested in taking a look:
Tumor model.zip
Thanks in advance!
The text was updated successfully, but these errors were encountered: