Attachment 'CC3D AllAnswered archive.html'
DownloadPosts from the Compucell3D AllAnswered Forum.
Created: April 2019 jps
Q1: Which operating system CompuCell3D users use?
id: qewr | creation_date: Sept. 12, 2017, 1:52 p.m. | author: Anwar | type: Poll |
parent: qewr | lastedit_date: Sept. 12, 2017, 2:02 p.m. | lastedit_user: Anwar |
content:
We would like to know about operating system CompuCell3D users use. This will allow us to support and development CompuCell3D more efficiently.
Answer:
id: xmzm | creation_date: Sept. 12, 2017, 1:53 p.m. | author: Anwar | type: Answer |
parent: qewr | lastedit_date: Sept. 12, 2017, 2:02 p.m. | lastedit_user: Anwar |
content:
Microsoft Windows
(Includes Windows 10, Windows 7 all Microsoft platforms)
Answer:
id: rbvl | creation_date: Sept. 12, 2017, 2 p.m. | author: Anwar | type: Answer |
parent: qewr | lastedit_date: Sept. 12, 2017, 2:02 p.m. | lastedit_user: Anwar |
content:
Apple MacOS
( All Apple products)
Answer:
id: gpbg | creation_date: Sept. 12, 2017, 2:01 p.m. | author: Anwar | type: Answer |
parent: qewr | lastedit_date: Sept. 12, 2017, 2:02 p.m. | lastedit_user: Anwar |
content:
Linux
( All Linux platforms and flavors e.g. Ubuntu, RedHat, Mint)
Q2: What is CompuCell3D?
id: lgkx | creation_date: Sept. 12, 2017, 1:39 p.m. | author: Anwar | type: Note |
parent: lgkx | lastedit_date: Sept. 13, 2017, 2:24 p.m. | lastedit_user: Anwar |
content:
CompuCell3D is an open-source simulation environment for multi-cell, single-cell-based modeling of tissues, organs and organisms.
It uses Cellular Potts Model to model cell behavior. For technical details about modeling please refer Multi-Scale Modeling of Tissues Using CompuCell3D paper.
For more information and tutorials please visit CompuCell3D website.
This project is funded by the NIH and EPA.
Q3: How to use this forum?
id: bbax | creation_date: Sept. 12, 2017, 1:48 p.m. | author: Anwar | type: Note |
parent: bbax | lastedit_date: Sept. 13, 2017, 2:27 p.m. | lastedit_user: Anwar |
content:
This CompuCell3D forum should only be used for following purposes-
- Asking solution for an issue
- Suggesting or discussing a new feature
If you came across an issue while building or running model with CompuCell3D feel free to ask for solution here. Please write in detail about the problem. If relevant insert the code snippet in your question. Mention details about your environment e.g. operating system, version, CompuCell3D version etc. Share error log if available. In case you came across any UI issue take a screenshot and insert it in your question.
2. Suggesting or discussing a new feature
We will be very happy to hear about how we can make CompuCell3D better. You have any idea or feature in your mind that will make CompuCell3D more useful, let us know. Please mention the feature in detail and specify how that would be useful for you and others.
Q4: How can I know the total count of cells for specific cell type?
id: jrnvv | creation_date: Oct. 2, 2017, 1:40 a.m. | author: dali Zan | type: Question |
parent: | lastedit_date: Oct. 2, 2017, 12:44 p.m. | lastedit_user: Anwar |
content:
system: Windows 7
CC3D Version: 3.7.5
Answer:
id: eqemr | creation_date: Oct. 2, 2017, 10:50 a.m. | author: Maciek Swat | type: Answer |
parent: jrnvv | lastedit_date: Oct. 2, 2017, 12:44 p.m. | lastedit_user: Maciek Swat |
content:
Assuming you have two cell types - Condensing and NonCondensing you could do the following:
def step(self, mcs):
print 'num condensing=', len(self.cellListByType(self.CONDENSING))
print 'num noncondensing=', len(self.cellListByType(self.NONCONDENSING))
Alternatively, instead of using self.CONDENSING and self.NONCONDENSING you may use cell type ids directly (I assume Condensing has cell type id =1 and NonCondensing has cell type id =2):
def step(self, mcs):
print 'num condensing=', len(self.cellListByType(1))
print 'num noncondensing=', len(self.cellListByType(2))
Q5: How can set a layer of cells that get together like a thin film?
id: omxzp | creation_date: Oct. 4, 2017, 1:31 a.m. | author: dali Zan | type: Question |
parent: | lastedit_date: Oct. 6, 2017, 1:35 a.m. | lastedit_user: dali Zan |
content:
I want to use some cells set a thin film but when model starts running those cells won't stay together and disperse. I know "Cell Type" plugin that has a function named "freeze". But the "Freeze" function will not let cells to be altered by pixel copies. I wonder if there are some other methods which can keep cells stay together like a film during simulation.
Answer:
id: beeoa | creation_date: Oct. 4, 2017, 2:55 p.m. | author: Matt Thompson | type: Answer |
parent: omxzp | lastedit_date: Oct. 4, 2017, 4:20 p.m. | lastedit_user: Matt Thompson |
content:
"Playing" with the contact energy may help. If the contact energy between cells of the same type is decreased, affinity is increased, so dispersion is less likely, though they may clump together instead. For a layer of cells (L) sitting on top of another group of cells (S), you want the contact energies to be S-S < S-L < L-L < L-medium I believe.
Answer:
id: gggrv | creation_date: Oct. 4, 2017, 4:27 p.m. | author: James Sluka | type: Answer |
parent: omxzp | lastedit_date: Oct. 4, 2017, 4:27 p.m. | lastedit_user: James Sluka |
content:
There are a couple ways to make cells form a layer.
1. You can have the cells stick to the wall of the bounding box (but then you can only access one face of the cell layer).
2. You could make a curved cell layer ala the cell sorting demos where your cell layer is actually spherical (the "noncondensing" cells in the cell sort demos).
3. You can use compartmentalized cells that have basal, apical and lateral faces defined.
4. You can add distance constraints between cells using "Elasticity Plugin" or "FocalPointPlasticity Plugin". Constraints on contact neighbors keep the sheet intact. If the distance constraints go beyond first neighbors then the constraint will tend to keep the sheet flat.
You might take a look at Biofilms in 2D https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2547990/ SIMULATION OF SINGLE-SPECIES BACTERIAL-BIOFILM GROWTH USING THE GLAZIER-GRANER-HOGEWEG MODEL AND THE COMPUCELL3D MODELING ENVIRONMENT
Are you working in 2D or 3D?
Comment:
id: jrrna | creation_date: Oct. 4, 2017, 7:45 p.m. | author: Maciek Swat | type: Comment |
parent: gggrv | lastedit_date: Oct. 4, 2017, 7:45 p.m. | lastedit_user: Maciek Swat |
content:
I agree with Jim's 4. suggestion. This would be the most robust way to have cells stay together. Relying purely on contact energy may not be sufficient. It would help us if you could post the geometry of the tissue you are trying to model.
Comment:
id: avvlb | creation_date: Oct. 5, 2017, 3:31 a.m. | author: dali Zan | type: Comment |
parent: jrrna | lastedit_date: Oct. 5, 2017, 3:31 a.m. | lastedit_user: dali Zan |
content:
i just want to make cells form a layer to simulate a rectangular hydrogel film,so that i can simulate the mechanical properties of hydrogel in simulation。
Answer:
id: qvvwb | creation_date: Oct. 5, 2017, 4:38 p.m. | author: James Sluka | type: Answer |
parent: omxzp | lastedit_date: Oct. 5, 2017, 4:43 p.m. | lastedit_user: James Sluka |
content:
Attached is a zip file with a CC3D model of a layer of cells in 2D (basically a line of cells). The line is maintained using focal point plasticity links. The sim first creates the line of cells, it then displaces the central cell upwards and the end cells downward showing the sheet stays intact (though holes open transiently). It then pulls the ends together into a circle.
It should be possible to convert into a 3D model.
CC3D files: File attached: CellsInLayer_FPP.zip (1.05 MB)
An animation of the output: File attached: output_ObCKSA.mp4 (141.98 KB)
attachments(redirected):
.\CC3D_allanswered_linked_files\CellsInLayer_FPP.zip
.\CC3D_allanswered_linked_files\output_ObCKSA.mp4
Comment:
id: reerj | creation_date: Oct. 5, 2017, 4:56 p.m. | author: Maciek Swat | type: Comment |
parent: avvlb | lastedit_date: Oct. 5, 2017, 4:56 p.m. | lastedit_user: Maciek Swat |
content:
If the hydrogel is coating some object (e.g. tissue) then all you need to do is to create a blob of tissue, cover it with gel and choose appropriate adhesion (ContactPlugin) coefficients
Hydrogel.xml
<CompuCell3D Revision="20170429" Version="3.7.6">
<Potts>
<Dimensions x="100" y="100" z="1"/>
<Steps>10000</Steps>
<Temperature>20.0</Temperature>
<NeighborOrder>1</NeighborOrder>
</Potts>
<Plugin Name="CellType">
<CellType TypeId="0" TypeName="Medium"/>
<CellType TypeId="1" TypeName="Gel"/>
<CellType TypeId="2" TypeName="Tissue"/>
</Plugin>
<Plugin Name="Volume"/>
<Plugin Name="CenterOfMass"/>
<Plugin Name="Contact">
<Energy Type1="Medium" Type2="Medium">10.0</Energy>
<Energy Type1="Medium" Type2="Gel">25.0</Energy>
<Energy Type1="Medium" Type2="Tissue">25.0</Energy>
<Energy Type1="Gel" Type2="Gel">12.0</Energy>
<Energy Type1="Tissue" Type2="Tissue">5.0</Energy>
<Energy Type1="Gel" Type2="Tissue">10.0</Energy>
<NeighborOrder>3</NeighborOrder>
</Plugin>
</CompuCell3D>
Hydrogel.py:
import sys
from os import environ
from os import getcwd
import string
sys.path.append(environ["PYTHON_MODULE_PATH"])
import CompuCellSetup
sim,simthread = CompuCellSetup.getCoreSimulationObjects()
# add extra attributes here
CompuCellSetup.initializeSimulationObjects(sim,simthread)
# Definitions of additional Python-managed fields go here
#Add Python steppables here
steppableRegistry=CompuCellSetup.getSteppableRegistry()
from HydrogelSteppables import HydrogelSteppable
steppableInstance=HydrogelSteppable(sim,_frequency=1)
steppableRegistry.registerSteppable(steppableInstance)
CompuCellSetup.mainLoop(sim,simthread,steppableRegistry)
HydrogelSteppables.py
from PySteppables import *
import CompuCell
import sys
class HydrogelSteppable(SteppableBasePy):
def __init__(self,_simulator,_frequency=1):
SteppableBasePy.__init__(self, _simulator, _frequency)
def start(self):
cell_size = 5
rows = 10
cols = 10
blob_pos_vec = [20, 20, 0]
for r in range(rows):
for c in range(cols):
new_cell = self.newCell(self.TISSUE)
x_pos = r*cell_size + blob_pos_vec[0]
y_pos = c*cell_size + blob_pos_vec[1]
self.cellField[x_pos:x_pos+cell_size, y_pos:y_pos+cell_size, 0] = new_cell
if r==0 or c==0 or r==rows-1 or c==cols-1:
new_cell.type = self.GEL
#setting up volume constraint
for cell in self. cellList:
cell.targetVolume = 25
cell.lambdaVolume = 2.0
if cell.type == self.GEL:
cell.targetVolume = 30
cell.lambdaVolume = 2.0
def step(self,mcs):
pass
Let me know if this helps. If you are looking for a different initial geometry let us know but the idea will be similar. If you want to avoid blob-like shape but prefer a flat layer of cells. then you might need to use PeriodicBoundary Conditions for Cell Lattice along x-direction (assuming that your layer will be spread along x direction)
Comment:
id: nqqxe | creation_date: Oct. 6, 2017, 1:24 a.m. | author: dali Zan | type: Comment |
parent: reerj | lastedit_date: Oct. 6, 2017, 1:24 a.m. | lastedit_user: dali Zan |
content:
Deeply thanks for your help,and sorry for my unclear expression. The tissue is not coated by hydrogel but cultured on hydrogel. Assuming a simulation has 2 units of z axis, one unit is a layer of hydrogel and another unit is a 2d tissue cultured on that hydrogel. Can this be achieved in cc3d?
Comment:
id: pggoj | creation_date: Oct. 6, 2017, 1:26 a.m. | author: dali Zan | type: Comment |
parent: beeoa | lastedit_date: Oct. 6, 2017, 1:26 a.m. | lastedit_user: dali Zan |
content:
thanks for your help
Comment:
id: zppxr | creation_date: Oct. 6, 2017, 1:35 a.m. | author: dali Zan | type: Comment |
parent: qvvwb | lastedit_date: Oct. 6, 2017, 1:35 a.m. | lastedit_user: dali Zan |
content:
Thanks for your help,my previous expression is not clear. The supplementary explanation is under Maciek Swat’s comment.
Q6: In a 3D model - How can I let cells grow along a wall?
id: loomz | creation_date: Oct. 12, 2017, 12:33 p.m. | author: dali Zan | type: Question |
parent: | lastedit_date: Oct. 20, 2017, 1:24 a.m. | lastedit_user: dali Zan |
content:
In my model, I set a wall and let cells grow on it. If I don't set specific condition, cell will growing to a lump. I tried to use plugin 'Focal Point Plasticity' to restrain cell growth along the wall but it's not effective enough. I wonder whether I should use this plugin according with in vitro anchorage-dependent cell growth status?
Answer:
id: wllxx | creation_date: Oct. 12, 2017, 6:55 p.m. | author: James Sluka | type: Answer |
parent: loomz | lastedit_date: Oct. 12, 2017, 6:55 p.m. | lastedit_user: James Sluka |
content:
FPP will do it but you might first try:
1. Have the cells sticker to the wall than to themselves. Use low stickyness to medium, with medium-wall being the least sticky of all. The magnitudes will need to be adjusted differently in 2D vs. 3D.
(assuming wall is fixed so wall-wall adhesion doesn't matter)
-3 wall-cell
-2 cell-cell
0 cell-medium
2 wall-medium
0 medium-medium
Note that the adhesion energy will tend to flatten the cells out. We can take advantage of that in the next suggestion.
2. When dividing cells divide along the major axis. This will usually keep both the parent and daughter cells in contact with the surface. Search for "major axis" in the documentation, it is one of the options for the mitosis plugin and steppable.
Answer:
id: eqqma | creation_date: Oct. 12, 2017, 6:57 p.m. | author: James Sluka | type: Answer |
parent: loomz | lastedit_date: Oct. 12, 2017, 6:57 p.m. | lastedit_user: James Sluka |
content:
If you are still having problems we should be able to come up with a demo of using FPP to help keep cells sticking to a wall or surface.
Comment:
id: avvgo | creation_date: Oct. 13, 2017, 4:29 a.m. | author: dali Zan | type: Comment |
parent: wllxx | lastedit_date: Oct. 13, 2017, 4:29 a.m. | lastedit_user: dali Zan |
content:
I used FPP and the method above together to help cells stick to wall. It seems to have worked, but I found that cell is fragmented after a few steps even if I used Connectivity Plugins.
Answer:
id: loogz | creation_date: Oct. 15, 2017, 4:22 p.m. | author: Maciek Swat | type: Answer |
parent: loomz | lastedit_date: Oct. 15, 2017, 4:22 p.m. | lastedit_user: Maciek Swat |
content:
I am not sure if this feature already exist in CC3D but ideally what you should be able to do is to use elongation plugin - it elongates cells AND specify the direction of elongation - i.e. a vector of a major axis of the cell. There is a plugin called "OrientedGrowth" which probably does what you want. We do not have examples of how to use this plugin in our demo suite but I can reach out to a person who contributed this plugin and find out.
Another option to explore is to use compartmentalized cells (i.e. your biological cell is a collection of CompuCell3D cells - compartments) and then you could use Focal Point Plasticity to connect the compartments together. Of course the compartments would still remain "blobs" but you could get elongated cells this way.
Comment:
id: beebr | creation_date: Oct. 15, 2017, 4:23 p.m. | author: Maciek Swat | type: Comment |
parent: avvgo | lastedit_date: Oct. 15, 2017, 4:23 p.m. | lastedit_user: Maciek Swat |
content:
Could you post your simulation showing how connectivity plugin leads to fragmentation? This should not happen so we would like to investigate the cause
Answer:
id: qvvee | creation_date: Oct. 15, 2017, 4:41 p.m. | author: Maciek Swat | type: Answer |
parent: loomz | lastedit_date: Oct. 15, 2017, 4:41 p.m. | lastedit_user: Maciek Swat |
content:
This demo was contributed by Jeremy Fisher (https://cc3dadvancedtuts.wordpress.com/) who also coded up the OrientedGrowth plugin. Take a looks and see if this looks closer to what you are looking for
File attached: OrientedGrowth.zip (2 KB)
attachments(redirected):
.\CC3D_allanswered_linked_files\OrientedGrowth.zip
Answer:
id: omaao | creation_date: Oct. 16, 2017, 11:43 p.m. | author: Jeremy Fisher | type: Answer |
parent: loomz | lastedit_date: Oct. 16, 2017, 11:43 p.m. | lastedit_user: Jeremy Fisher |
content:
Oriented growth should impose an arbitrarily large energy penalty on growth perpendicular to the wall, which I believe this would address the issue. However, it only supports 2D simulations as of the moment.
It wouldn't be too difficult to add support for 3D simulations. Is this an approach you would be interested in?
Comment:
id: rervb | creation_date: Oct. 17, 2017, 10:07 a.m. | author: dali Zan | type: Comment |
parent: beebr | lastedit_date: Oct. 17, 2017, 10:07 a.m. | lastedit_user: dali Zan |
content:
the problem of fragmentation is fixed, Connectivity Plugin's invalid maybe because of I set the value of Penalty is out of threshold. Now the model is basically achieved expectations. But when cells grow to relatively high density, it's hard to avoid cell overlap and some cells will tend to growing away from wall. So I wonder how can i know the cell neighbor's cell type that can help me to eliminate cells which do not contact the wall. The CompuCell3D 3.7.4 Reference Manual only tell us how to get cell neighbor' id but not their type.
Comment:
id: wlrea | creation_date: Oct. 17, 2017, 2:28 p.m. | author: James Sluka | type: Comment |
parent: rervb | lastedit_date: Oct. 17, 2017, 2:28 p.m. | lastedit_user: James Sluka |
content:
You can visit all cells of a particular type and then check the contact area for that cells neighbors of particular types with something like;
for cell in self.cellListByType(self.CULTUREDCELLS): ### list of cell types (capitalized)
cell_neighbors = self.getCellNeighborDataList(cell) ### list of this cell’s neighbors
neighbor_count_by_type = cell_neighbors.neighborCountByType()
### neighbor_count_by_type is a hash indexed by cell type IDs,
### so neighbor_count_by_type{1} gives the number of neighbors of cell type 1
### if no neighbors of a particular type you could do something here
if (cell_neighbors.commonSurfaceAreaWithCellTypes([self.HYDROGEL]) < (cellWidth**2/4.)):
# this cell has very little contact with hydrogel so kill it
cell.targetVolume = 0.
cell.targetSurface = 0.
cell.lambdaVolume = 0.01 # small lambda's so the cell shrinks slowly
cell.lambdaSurface = 0.01
print("KILL {}: {}, tv={} ts={} v={} s={}".format(cell.id,cell.type,cell.targetVolume,cell.targetSurface,cell.volume,cell.surface))
In the main xml you need;
<Plugin Name="NeighborTracker">
<!-- Module tracking neighboring cells of each cell -->
</Plugin>
Comment:
id: avwrw | creation_date: Oct. 20, 2017, 1:24 a.m. | author: dali Zan | type: Comment |
parent: wlrea | lastedit_date: Oct. 20, 2017, 1:24 a.m. | lastedit_user: dali Zan |
content:
It works, truely thanks for your help.
Q7: Can there be two different cell types simultaneously residing in the same pixel?
id: qvwxm | creation_date: Oct. 19, 2017, 8:56 p.m. | author: Yen Nguyen Edalgo | type: Question |
parent: | lastedit_date: Oct. 20, 2017, 1:34 p.m. | lastedit_user: Maciek Swat |
content:
Hi,
So what I observed from the movement of CC3D generalized cells is that they all move around each other, and not over each other. Is is possible to implement, say the phenomena where tumor cell moves along collagen fibers in the extracellular matrix? From my current knowledge of CompuCell3D, in order for this phenomenon to be possible, two different cell types must be on the same pixel at the same simulation step. Is this possible in CompuCell3D simulation? Also, in my simulation, I treat fibers as discrete generalized cells (I also freeze them) instead of chemical field.
Sincerely,
Answer:
id: beamw | creation_date: Oct. 20, 2017, 10:53 a.m. | author: James Sluka | type: Answer |
parent: qvwxm | lastedit_date: Oct. 20, 2017, 10:53 a.m. | lastedit_user: James Sluka |
content:
CC3D can't have the same pixel as part of two cells, indeed biology and physics don't allow that either. The only time you would need that is if you model a 3D system (e.g., real life) in 2D (not real life). So, if you do your model in 3D there isn't any problem of overlapping cells and one cell can crawl along another cell (or pseudo cell).
If you really want 2D (perhaps because of the much faster calculation speed) then you can;
1. Have a cell crawl along one side of the fiber (easy), cells can't cross the fiber and you'll be limited to a simple fiber topology (what does the cell do when it reaches a point where two fibers cross?).
2. With a fair amount of fiddling get it to cross over the fiber by basically taking control of the identity of individual pixels (you can arbitrarily assign any pixel to any cell in Python).
3. You could treat the crawling cell as two separate cells, one on each side of the fiber, then link the two across the fiber with a focal point plasticity (or a spring) link.
4. If you really want 2D and a complex fiber topology with things like fibers crossing, then treating the fiber as a field is probably the way to go. There are two ways to do this;
4a. As a CC3D field, you can define a field that doesn't diffuse (set the diffusion constant to zero) and you can directly poke values into a field from python so you can generate an arbitrarily complex layout of fibers. This will work but even with the diffusion constant set to zero I believe the diffusion calculations will still be done and that might slow things down somewhat.
4b. Create a python (or numpy) 2D array with the same dimensions as the CC3D model and keep the fiber network in that array. No diffusion calculations are done. You can then use python to have that array interact with your cells by having the cell movement being a function of the interaction between the CC3D cell pixels and the separate matrix mapping the fibers.
In 3D things would be more straight forward, but also much slower.
Think about how you want to do things and let us know if you need help.
Answer:
id: avwpw | creation_date: Oct. 20, 2017, 1:34 p.m. | author: Maciek Swat | type: Answer |
parent: qvwxm | lastedit_date: Oct. 20, 2017, 1:34 p.m. | lastedit_user: Maciek Swat |
content:
In principle we could implement this feature but it would take a bit of code refactoring. Modeling ECM is somewhat challenging because the granularity of fibers is much finer than the way we represent cells on a fairly coarse lattice. I think that modelling ECM using external module where we model fibers as a e.g. vector field could be a better approach. You could "translate" deformation in the cell field into forces acting on fibers and vice-versa, translate stresses in the ECM fields into forces acting on cells ( in the the CC3D cell field). The "integration" of the ECM model with the cell-based model could fairly easily be done in Python . The advantage of such approach is that you would not have to modify existing CCC3D code but rather add external ECM modeling module that could be more sophisticated than anything you could currently mimic in CC3D
Q8: Page 11, Section 3.2 of Compucell 3D Manual and Tutorial, Version 3.6.0
id: lokzp | creation_date: Oct. 24, 2017, 1:47 p.m. | author: Scott H | type: Question |
parent: | lastedit_date: Oct. 26, 2017, 1:54 p.m. | lastedit_user: Scott H |
content:
On page 11, Section 3.2 of Compucell 3D Manual and Tutorial, Version 3.6.0, in the first paragraph, it is written:
"During each index-copy attempt, we select a target pixel, i, randomly from the cell lattice, and then randomly select one of its neighboring pixels, i, as a source pixel."
Should the second "i" be a j?
-Scott
Answer:
id: qvwza | creation_date: Oct. 24, 2017, 2:01 p.m. | author: James Sluka | type: Answer |
parent: lokzp | lastedit_date: Oct. 24, 2017, 2:01 p.m. | lastedit_user: James Sluka |
content:
Yes :)
I wonder how many version of the manual this error traces back in?
Answer:
id: xnzow | creation_date: Oct. 24, 2017, 2:14 p.m. | author: Anwar | type: Answer |
parent: lokzp | lastedit_date: Oct. 24, 2017, 2:14 p.m. | lastedit_user: Anwar |
content:
Actually, the mentioned neighboring pixel is not $i$i it's $i'$i' ( i-prime or I-dash). Snippet from the manual-
Unfortunately, it's little confusing given vector bar above . Let's see if we can use $j$j instead $i'$i' in next version of manual. Thank you Scott for pointing it out.
attachments(redirected):
.\CC3D_allanswered_linked_files\Screen Shot 2017-10-24 at 2.04.12 PM.png
Answer:
id: jrenb | creation_date: Oct. 26, 2017, 1:54 p.m. | author: Scott H | type: Answer |
parent: lokzp | lastedit_date: Oct. 26, 2017, 1:54 p.m. | lastedit_user: Scott H |
content:
Thank you, Anwar, that makes more sense.
I see the latest version is 3.7.4 on the CC3D website.
Q9: Open VTK files for visualization in other software
id: pgnqw | creation_date: Oct. 29, 2017, 8:08 p.m. | author: JJ Yeo | type: Question |
parent: | lastedit_date: Oct. 30, 2017, 5:08 p.m. | lastedit_user: JJ Yeo |
content:
Dear CC3D users,
Are there any other visualization software that can be used to visualize the trajectory output from CC3D and make fancy movies? I've tried VMD to open the .vtk files and it seems to be work but probably some tweaks need to be done to get the correct visuals. Anyone has experience with that?
Answer:
id: mbopb | creation_date: Oct. 30, 2017, 2:34 p.m. | author: James Sluka | type: Answer |
parent: pgnqw | lastedit_date: Oct. 30, 2017, 2:34 p.m. | lastedit_user: James Sluka |
content:
VTK is kind of a difficult format. Besides VMD there are also (at least);
- Paraview http://www.paraview.org
- VisIt https://wci.llnl.gov/simulation/computer-codes/visit/
- VTKDesigner https://sourceforge.net/projects/vtkdesigner/
I find it easier to have CC3D export screen shots of any displays that I want to make a movie out of. You can open multiple windows in CC3D for things like the cell types, fields, ... and then click the little camera icon to have CC3D save the screenshots at the frequency defined in Player's [Tools] [Configuration] menu. Every window in the simulation will get its own folder for screen shots. I then animate the images with, MovieMaker, Gimp, VLC Media Player, ImageMagick ...
Comment:
id: eqjlj | creation_date: Oct. 30, 2017, 4:04 p.m. | author: JJ Yeo | type: Comment |
parent: mbopb | lastedit_date: Oct. 30, 2017, 4:31 p.m. | lastedit_user: JJ Yeo |
content:
Thank you very much for the advice! I'm testing out Paraview together with output from the cellsort_3D demo. I immediately ran into a problem when I tried to visualize by celltype, I get the error of
ERROR: In /Users/kitware/dashboards/buildbot-slave/8275bd07/build/superbuild/paraview/src/VTK/Rendering/Volume/vtkGPUVolumeRayCastMapper.cxx, line 353
vtkOpenGLGPUVolumeRayCastMapper (0x7ff64c9b5480): scalar of type VTK_CHAR is not supported because this type is platform dependent. Use VTK_SIGNED_CHAR or VTK_UNSIGNED_CHAR instead.
CellId and ClusterID visualizes just fine. May I know how I can somehow convert the celltypes to VTK_SIGNED_CHAR or VTK_UNSIGNED_CHAR or is there a trick to getting Paraview to visualize by celltype?
EDIT:
I realised a simple solution was to change celltypes in each file to unsigned_char
find . -type f -name 'cellsort_3D_cc3d_*' -exec sed -i 's/char/unsigned_char/g' {} \;
Answer:
id: bezmg | creation_date: Oct. 30, 2017, 5:04 p.m. | author: James Sluka | type: Answer |
parent: pgnqw | lastedit_date: Oct. 30, 2017, 5:04 p.m. | lastedit_user: James Sluka |
content:
Yes, manually changing the celltype data type in the VTK file(s) appears to work, for example;
What version of ParaView are you using (and what platform)? I tried version 3.98.0 and 5.4.1 on a 64-bit windows 7 computer and didn't get the "char" data type error.
I'm not sure why CC3D would be using that data type anyway, it really is just unsigned integer data and not character data. Perhaps we should change this in the next CC3D release?
Comment:
id: qvbpk | creation_date: Oct. 30, 2017, 5:08 p.m. | author: JJ Yeo | type: Comment |
parent: bezmg | lastedit_date: Oct. 30, 2017, 5:08 p.m. | lastedit_user: JJ Yeo |
content:
I'm using the latest version of Paraview 5.4.1 on MacOSX Sierra.
Q10: Import CompuCell3D 3.3.1 into CompuCell3D 3.7.6
id: eqxeq | creation_date: Nov. 6, 2017, 8:19 a.m. | author: nicolalandro | type: Question |
parent: | lastedit_date: Nov. 7, 2017, 2:43 p.m. | lastedit_user: nicolalandro |
content:
Hi, I'm a student and I want to import the code of the aticle: http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0007190 into new CompuCell3D, but in this code base there is not a .cc3d file. How can I do?
Answer:
id: vnwnb | creation_date: Nov. 6, 2017, 1:50 p.m. | author: Anwar | type: Answer |
parent: eqxeq | lastedit_date: Nov. 6, 2017, 1:50 p.m. | lastedit_user: Anwar |
content:
Basically .cc3d is a XML file enlisting all related files and resources for the simulation. I believe you can generate a .cc3d file manually referring to demos in CompuCell3D 3.7.6.
Please let us know if you need further help with that.
Answer:
id: klela | creation_date: Nov. 6, 2017, 2:38 p.m. | author: priyomadhyapok | type: Answer |
parent: eqxeq | lastedit_date: Nov. 6, 2017, 2:38 p.m. | lastedit_user: priyomadhyapok |
content:
Typically this is what a .cc3d file looks like
<Simulation version="version number">
<XMLScript Type="XMLScript">XML_File_Name</XMLScript>
<PythonScript Type="PythonScript">Python_File_Name</PythonScript>
<Resource Type="Python">Python_Steppable_File_Name</Resource>
</Simulation>
You might need to add additional location information in the file names if they are in different directories.
Answer:
id: avjvm | creation_date: Nov. 6, 2017, 3:10 p.m. | author: James Sluka | type: Answer |
parent: eqxeq | lastedit_date: Nov. 6, 2017, 3:10 p.m. | lastedit_user: James Sluka |
content:
The easiest thing to do is to just create a new model in Twedit++ (basically just pick a few items at random), then cut and paste the XML and python from the published model into the appropriate files in your newly created model.
Comment:
id: qvnww | creation_date: Nov. 7, 2017, 3:08 a.m. | author: nicolalandro | type: Comment |
parent: klela | lastedit_date: Nov. 7, 2017, 3:08 a.m. | lastedit_user: nicolalandro |
content:
Hi, I try but do not work, the error in console is:
FILE NAME= Traceback (most recent call last):
File "/usr/lib/compucell3d/Twedit++/Plugins/PluginCCDProject.py", line 2443, in __openCC3DProject
self.showOpenProjectDialogAndLoad(currentFilePath)
File "/usr/lib/compucell3d/Twedit++/Plugins/PluginCCDProject.py", line 2430, in showOpenProjectDialogAndLoad
print "FILE NAME=",fileName
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe0' in position 34: ordinal not in range(128)
The folder Hierarchy is:/CompucellProject
/CompucellProject.cc3d
/script
/angio_growth_plugins.py
/angio_growth.py
/angio_growth_steppables.py
/TumorVasc3D_180x180x180.txt
/XML_Template_TumorVasc3D_Movie.xml
CompucellProject.cc3d
<Simulation version="3.6.2">
<XMLScript Type="XMLScript">Simulation/XML_Template_TumorVasc3D_Movie.xml</XMLScript>
<PythonScript Type="PythonScript">Simulation/angio_growth.py</PythonScript>
<Resource Type="Python">Simulation/angio_growth_steppables.py</Resource>
<Resource Type="Python">Simulation/angio_growth_plugins.py</Resource>
</Simulation>
Comment:
id: reqrq | creation_date: Nov. 7, 2017, 4:26 a.m. | author: nicolalandro | type: Comment |
parent: avjvm | lastedit_date: Nov. 7, 2017, 4:26 a.m. | lastedit_user: nicolalandro |
content:
I try with this method and I have this error in console:
projectFullPath= /home/nic/CompucellAutomaticProject/CompucellAutomaticProject.cc3dNEW SIMULATION reply=NEWSIMULATION/home/nic/CompucellAutomaticProject/CompucellAutomaticProject.cc3d starting CC3D READING RESPONSE CC3D SENDER self.socket.bytesAvailable()= 168 self.nextBlockSize= 166 self.socket.bytesAvailable()= 166 messageType= NEWSIMULATION self.errorConsole.playerMainWidget= <Plugins.ViewManagerPlugins.SimpleTabView.SimpleTabView object at 0x7f6c1b500770>
In the code base of article theris also a file .txt how can import it in compucell?
Comment:
id: bejze | creation_date: Nov. 7, 2017, 2:13 p.m. | author: Anwar | type: Comment |
parent: qvnww | lastedit_date: Nov. 7, 2017, 2:13 p.m. | lastedit_user: Anwar |
content:
I believe this error is due to encoding mismatch with value in string 'fileName'. I suspect this occurred due to the .cc3d file is not saved with UTF-8 encoding.
Can you try after saving it with UTF-8 encoding? Google how to save it in UTF-8 encoding with whichever text editor you are using. Instructions for notepad++ are here.
Comment:
id: xnlkk | creation_date: Nov. 7, 2017, 2:43 p.m. | author: nicolalandro | type: Comment |
parent: avjvm | lastedit_date: Nov. 7, 2017, 2:43 p.m. | lastedit_user: nicolalandro |
content:
Hi, I have solved some prolems, but now I have this:
messageType= NEWSIMULATION
self.errorConsole.playerMainWidget= <Plugins.ViewManagerPlugins.SimpleTabView.SimpleTabView object at 0x7f62a0e80a68>
processIncommingSimulation = /home/mint/compuCellWorkspace/NewSimulation/NewSimulation.cc3d _stopCurrentSim= True
GOT NEW SIMULATION /home/mint/compuCellWorkspace/NewSimulation/NewSimulation.cc3d
NEWSIMULATIONRECEIVED SIMULATION NAME SENT SUCCESFULLY
In compucell3D seams run, but I do not see nothing. What is the problem?
Q11: what is the meaning of contact energy's Positive value and Negative value
id: pglwk | creation_date: Nov. 6, 2017, 10:55 a.m. | author: dali Zan | type: Question |
parent: | lastedit_date: Nov. 15, 2017, 12:22 p.m. | lastedit_user: James Sluka |
content:
Assume there are two cells are contacted,and set contact energy J to a negative value. Does it means those two cells will definitely stay together , if set J to a positive value does it means those two cells possible to separate and its probability is decided by the value of J.
Answer:
id: pglgk | creation_date: Nov. 6, 2017, 3:36 p.m. | author: James Sluka | type: Answer |
parent: pglwk | lastedit_date: Nov. 6, 2017, 3:40 p.m. | lastedit_user: James Sluka |
content:
Usually, besides the j value between a pair of cell types you also need to take into account the j values for the two cell types with medium.
Besides that, you always need to take into account all possible interactions. So even if a particular pair of cells has a j value of -10 and a large contact area (contact energy is J*contact_area) that contact could still be displaced if either of the two cells has a higher affinity (more negative J) for some other cell type and/or the other cell type is more flexible and can acquire a larger contact surface area.
So, in general, you need to take into account all possible pairs of interactions; for N cell types (and assuming Medium is one of those N types) there are N^2/2 + N/2 = (N/2)(N+1) possible interactions. For 3 cell types there are 6 interaction, for 4 cell types there are 10 interactions, ...
Beyond the J values the actual interaction energy will also be dependent on how stiff the surface of the cells is. With a very low LambdaSurface and/or large target surface area, cells can create extra surface in order to reap the reward of a large contact surface if that lowers contact energy.
Finally, you need to remember that movement of a CC3D configuration to a lower energy configuration can only occur if a suitable pathway exists. In other words, it is possible to trap a CC3D system in an energetically unfavorable state if there is no reasonably low energy pathway to a lower energy state. (That is also true of biology, biological systems are trapped in high energy states (life) since a low energy pathway to lower energy states (death) isn't always readily available.)
Comment:
id: omeav | creation_date: Nov. 7, 2017, 1:36 p.m. | author: dali Zan | type: Comment |
parent: pglgk | lastedit_date: Nov. 7, 2017, 1:36 p.m. | lastedit_user: dali Zan |
content:
Regardless of other conditions,does it means the relationship of contact strength is J=-10>J=-5>J=0>J=5>J=10?
And the meaning of J=0 is confused for me.
Comment:
id: bejqb | creation_date: Nov. 13, 2017, 12:53 p.m. | author: James Sluka | type: Comment |
parent: omeav | lastedit_date: Nov. 15, 2017, 12:22 p.m. | lastedit_user: James Sluka |
content:
Yes, that is correct the j=-10 interaction is stronger than the j=10 one. A j of zero just means there is no contribution to the systems total energy due to that particular interaction. If all your j's are either (for example) +10 or zero then the system will try to get all the contacts to be of the zero type. If all your j's are -10 and zero then the system will try to get all the contacts to be of the -10 type.
Comment:
id: eqxam | creation_date: Nov. 15, 2017, 8:52 a.m. | author: Yuan | type: Comment |
parent: pglwk | lastedit_date: Nov. 15, 2017, 8:52 a.m. | lastedit_user: Yuan |
content:
Hi, I am new in CC3D, can we have a communication in Chinese? My QQ is 1775755174
Q12: Drawing 3D structures in CellDraw
id: ggogl | creation_date: Nov. 6, 2017, 12:52 p.m. | author: JJ Yeo | type: Question |
parent: | lastedit_date: Dec. 8, 2017, 12:07 p.m. | lastedit_user: Scott H |
content:
Dear Admins,
I took a look at the CellDraw manual and pottered around the buttons in CellDraw itself, but I could not figure out how to draw 3D regions. Is this specified by the "cell size" column in the cell type table?
Also, I am trying to simulate simple cell movement on a solid substrate, is there an easy way to specify a smoothly increasing contact adhesion energy of the cells with the substrate, say increasing adhesion energy from left-most to right-most region of the substrate?
Answer:
id: nqwqv | creation_date: Nov. 6, 2017, 3:21 p.m. | author: James Sluka | type: Answer |
parent: ggogl | lastedit_date: Nov. 6, 2017, 3:21 p.m. | lastedit_user: James Sluka |
content:
For your second question; one approach would be to subdivide the substrate into pseudo-cells and then assign individual adhesion energies to each substrate cell based on their position. The AdhesionFlex plugin allows you to assign individual adhesivities to particular cells. Check in your CC3D demos folder for
C:\CompuCell3D-64bit\Demos\PluginDemos\AdhesionFlexPython\
as an example.
Since your substrate pseudo-cellos probably should not move you can set all cells of that type to "frozen".
Answer:
id: wlggz | creation_date: Dec. 6, 2017, 11:13 a.m. | author: Scott H | type: Answer |
parent: ggogl | lastedit_date: Dec. 6, 2017, 11:13 a.m. | lastedit_user: Scott H |
content:
Is that the same thing as Piff Generator? I found a Piff drawing program for windows, but I can't recall the name. I'll check once I get access to my Windows laptop.
Comment:
id: avkpr | creation_date: Dec. 8, 2017, 12:07 p.m. | author: Scott H | type: Comment |
parent: wlggz | lastedit_date: Dec. 8, 2017, 12:07 p.m. | lastedit_user: Scott H |
content:
How do you install Celldraw? I have the CC3D_3.7.7 binary downloaded. I have the Celldraw 1.6 from GitHub.
scottholmes src $ ./CellDraw_standalone.command
====> CellDraw working directory: /Users/scottholmes/CC3D_3.7.7/CellDraw/1.6.0/src
====> PYTHONLIB26: /System/Library/Frameworks/Python.framework/Versions/2.6
====> DYLD_LIBRARY_PATH: /Users/scottholmes/CC3D_3.7.7/CellDraw/1.6.0/src/../Frameworks
====> PYTHONPATH directory: /Users/scottholmes/CC3D_3.7.7/CellDraw/1.6.0/src/../Resources/site-packages:
====> PATH: /System/Library/Frameworks/Python.framework/Versions/2.6/bin:
====> PREFIX_CC3D: /Applications/CC3D_3.6.0_MacOSX106
./CellDraw_standalone.command: line 37: /usr/bin/pythonw2.6: No such file or directory
====> CellDraw 1.6.0 now starting from Python.
./CellDraw_standalone.command: line 41: /usr/bin/pythonw2.6: No such file or directory
Q13: Compilation instructions for CC3D on multi-core and GPU processors
id: ggbez | creation_date: Nov. 3, 2017, 5:13 p.m. | author: JJ Yeo | type: Question |
parent: | lastedit_date: Feb. 12, 2019, 4:35 p.m. | lastedit_user: Richard Spencer |
content:
May I know whether there are specific instructions on how to compile parallel CC3D with nVidia GPUs on Ubuntu or any other Linux-based clusters?
Also, can the pre-compiled binaries for both Mac OSX and Ubuntu be run on multiple cores? I do not seem to be able to find an option to do that.
Answer:
id: mbogk | creation_date: Nov. 3, 2017, 6:49 p.m. | author: Anwar | type: Answer |
parent: ggbez | lastedit_date: Nov. 7, 2017, 2:17 p.m. | lastedit_user: Anwar |
content:
Yes. In order to avoid user intervention by default CompuCell3D take advantage of all available cores on the machines. It uses openMP library for parallelization. Most time consuming operations i.e. pixel copy and energy calculations are done in parallel utilizing all cores for better performance.
Are there are specific instructions to compile parallel CC3D with nVidia GPUs on Ubuntu or any other Linux-based clusters?
OpenMP library does provide some specific instructions for GPU compilation. @Maciek Swat would be the best person to answer this question.
Hope it helps. Thanks.
Answer:
id: xnkpe | creation_date: Nov. 5, 2017, 11:05 a.m. | author: Maciek Swat | type: Answer |
parent: ggbez | lastedit_date: Nov. 7, 2017, 2:17 p.m. | lastedit_user: Maciek Swat |
content:
Can the pre-compiled binaries for both Mac OSX and Ubuntu be run on multiple cores?
Actually CC3D needs to be instructed to use multiple cores it is quite simple all you need to do is to to include <Metadata> tag with specification of how many CPU's you want to use
<CompuCell3D>
<Metadata>
<NumberOfProcessors>4</NumberOfProcessors>
<DebugOutputFrequency>100</DebugOutputFrequency>
</Metadata>
<Potts>
<Dimensions x="200" y="200" z="1"/>
<Anneal>10</Anneal>
<Steps>10000</Steps>
<Temperature>10</Temperature>
<Flip2DimRatio>1</Flip2DimRatio>
<NeighborOrder>2</NeighborOrder>
</Potts>
...
</CompuCell3D>
Are there are specific instructions to compile parallel CC3D with nVidia GPUs on Ubuntu or any other Linux-based clusters?
One thing to remember about GPU execution that it applies only to PDE solvers. The core Potts algorithm and all your Python Steppables will still run on CPU. So the bottom line is that your entire simulation will be limited by the slowest component. Now, if you are running a lot of PDE solvers than using GPU's makes sense.
I have not tried compiling GPU modules on linux (did that for OSX and Windows only) but it really should be straightforward. All you need to do is to make sure that OpenCL is installed on your linux cluster and the CMake script will automatically detect the settings. If you look at the CMake configuration dialog below the two settings that decide if the CC3D will have GPU modules are "NO_OPENCL" option (make sure it is unchecked if you wan GPU modules) and the path to OPENCL library
Let me know if you need more help
attachments(redirected):
.\CC3D_allanswered_linked_files\cmake_cc3d.png
Answer:
id: ggbal | creation_date: Nov. 5, 2017, 11:06 a.m. | author: Maciek Swat | type: Answer |
parent: ggbez | lastedit_date: Nov. 7, 2017, 2:17 p.m. | lastedit_user: Maciek Swat |
content:
The compilation steps you should follow on Ubuntu are outlined on
http://www.compucell3d.org/SrcBin/LinuxCompile
More compilation tutorial can be found on
http://www.compucell3d.org/DeveloperZone
Answer:
id: reqek | creation_date: Nov. 6, 2017, 12:37 p.m. | author: JJ Yeo | type: Answer |
parent: ggbez | lastedit_date: Nov. 7, 2017, 2:17 p.m. | lastedit_user: JJ Yeo |
content:
Thanks for the answers! I will try it out and let you guys know if I run into issues.
Comment:
id: gnjln | creation_date: Sept. 7, 2018, 10:26 a.m. | author: Mukti C | type: Comment |
parent: xnkpe | lastedit_date: Sept. 7, 2018, 10:26 a.m. | lastedit_user: Mukti C |
content:
How many solvers do you mean by "a lot of PDE solvers"? I am running 5 PDE solvers - would it be better if I use GPUs?
Answer:
id: oazoo | creation_date: Sept. 7, 2018, 12:08 p.m. | author: Maciek Swat | type: Answer |
parent: ggbez | lastedit_date: Sept. 7, 2018, 12:08 p.m. | lastedit_user: Maciek Swat |
content:
you would be better off trying GPU solvers but for that you would need to install OpenCL drivers on your machine, provided your machine has a decent GPU . And to see nice speedups you need a decent GPU. Regular PDE solvers are actually quite fast. Another option to consider it to use external PDE-solver suite but this is more involved technically
Comment:
id: wrzqa | creation_date: Sept. 7, 2018, 12:11 p.m. | author: Mukti C | type: Comment |
parent: oazoo | lastedit_date: Sept. 7, 2018, 12:11 p.m. | lastedit_user: Mukti C |
content:
Okay, thank you for your response! I'll try using GPUs.
Answer:
id: bzgne | creation_date: Feb. 12, 2019, 4:35 p.m. | author: Richard Spencer | type: Answer |
parent: ggbez | lastedit_date: Feb. 12, 2019, 4:35 p.m. | lastedit_user: Richard Spencer |
content:
I successfully built 3.7.4 on Red Hat Enterprise with OpenCL on a system with 4 Nvidia Tesla V100s. I have confirmed that increasing the NumberOfProcessors greater than 1 with OpenMP alone will yield blank results, but will work only by using OpenCL as well. I ran benchmarks with 1, 8, 16, and 32 processors and DiffusionSolver_OpenCL, while faster than 1 processor alone by only 2.14 times, seems to be the bottleneck rather than the rest of the OpenMP processes, since 32 processors are only 4.4 times faster than 1 with the GPU. So I am asking, given that I have a high end GPU, and CC3D knows nothing about my cell sizes relative to the block sizes it chooses, are there parameters I can change to make the diffusion solver work harder and faster on the GPU? My test grid is 600x600x60, but will go larger in practice.
I also wonder if 3.7.9 has significant performance enhancements. An important command parameter was removed from runScript since 3.7.4 that I need, and I run many simultaneous batch simulations headless on a large compute server with VTK/OSMesa doing the software rendering.
Richard, USEPA
Q14: Segmentation fault
id: omenv | creation_date: Nov. 8, 2017, 3:57 a.m. | author: nicolalandro | type: Question |
parent: | lastedit_date: Nov. 9, 2017, 4:38 a.m. | lastedit_user: nicolalandro |
content:
File attached: NewSimulation.zip (814.89 KB)
In the project attached, if I open it in Twedit++ and click on CC3D Project>Open In Player, Compucell3D close itself and get a segmentation fault error.
(In the zip there is the complete error log in file "ERROE: SEGMENTATION FAULT.txt")
(I'm on linux.)
attachments(redirected):
.\CC3D_allanswered_linked_files\NewSimulation.zip
Comment:
id: zpnnv | creation_date: Nov. 8, 2017, 4:27 p.m. | author: Anwar | type: Comment |
parent: omenv | lastedit_date: Nov. 8, 2017, 4:27 p.m. | lastedit_user: Anwar |
content:
Yes. I am able to reproduce the same error on my machine with the given simulation. But not sure yet what exactly causing this error. I will try to find some time to debug this.
Answer:
id: omeev | creation_date: Nov. 8, 2017, 5:14 p.m. | author: Maciek Swat | type: Answer |
parent: omenv | lastedit_date: Nov. 8, 2017, 5:14 p.m. | lastedit_user: Maciek Swat |
content:
Are you by any chance using Linux installed under VirtualBox?
Answer:
id: wleen | creation_date: Nov. 8, 2017, 8:48 p.m. | author: Maciek Swat | type: Answer |
parent: omenv | lastedit_date: Nov. 8, 2017, 8:48 p.m. | lastedit_user: Maciek Swat |
content:
Ok so the problem with this simulation is mitosis plugin that has been deprecated for many years, as it had many drawbacks. These days the mitosis is handled more efficiently in the Python Steppable . Anyway, I am attaching two simulations - the original one that was posted above under NewSimulation.zip (VascularTumorOrig.zip) but without Mitosis and the simulation that follows new CompuCell3D API that implements model that is similar to the original one but not quite exactly (E599Lecture12AbbasPaperCancerSimulationforUpload.zip)
The original simulation witohut the mitosis plugin opens and you can run it but it will not produce anything interesting because cells will not divide. The updated simulation runs but we have not full tested if it yields the same results as the original simulation that was published. In any case the second simultion woudl be a great starting point for further explorations
Take a look at those simulations and see if indeed they open up and run on your machine
File attached: VascularTumorOrig.zip (815.27 KB)
File attached: E599Lecture12AbbasPaperCancerSimulationforUpload.zip (273.22 KB)
attachments(redirected):
.\CC3D_allanswered_linked_files\VascularTumorOrig.zip
.\CC3D_allanswered_linked_files\E599Lecture12AbbasPaperCancerSimulationforUpload.zip
Comment:
id: qvngw | creation_date: Nov. 9, 2017, 4:38 a.m. | author: nicolalandro | type: Comment |
parent: wleen | lastedit_date: Nov. 9, 2017, 4:38 a.m. | lastedit_user: nicolalandro |
content:
It seems not work correctly, but start. Now I try to work about it, thanks!
Q15: Non-informative error when an SBML file doesn't exist
id: avjap | creation_date: Nov. 9, 2017, 4:31 p.m. | author: James Sluka | type: Idea |
parent: avjap | lastedit_date: Nov. 9, 2017, 4:31 p.m. | lastedit_user: James Sluka |
content:
If an SBML model file isn’t found the error message doesn’t say that, instead it says "NameError: global name 'os' is not defined". (CC3D version 3.7.5)Traceback (most recent call last):
File "C:\CompuCell3D-64bit\pythonSetupScripts\CompuCellPythonSimulationNewPlayer.py", line 351, in <module>
execfile(CompuCellSetup.simulationPaths.simulationPythonScriptName)
File "C:\Users\James Sluka\Desktop\Small Code Projects\Multi_simple_liver\Liver_I_paper_model\cc3dCode\Simulation\PBPK
_SBML_MULTI.py", line 272, in <module>
CompuCellSetup.mainLoop(sim,simthread,steppableRegistry)
File "C:\CompuCell3D-64bit\pythonSetupScripts\CompuCellSetup.py", line 1761, in mainLoop
return mainLoopNewPlayer(sim, simthread, steppableRegistry, _screenUpdateFrequency )
File "C:\CompuCell3D-64bit\pythonSetupScripts\CompuCellSetup.py", line 1498, in mainLoopNewPlayer
steppableRegistry.start()
File "C:\CompuCell3D-64bit\pythonSetupScripts\PySteppables.py", line 1460, in start
steppable.start()
File "C:\Users\James Sluka\Desktop\Small Code Projects\Multi_simple_liver\Liver_I_paper_model\cc3dCode\Simulation\PBPK
_SBML_MULTISteppables.py", line 777, in start
self.addFreeFloatingSBML(_modelFile=modelFile,_modelName='PBPKWambaugh_cS',_stepSize=self.timeStepOfIntegration4,_in
itialConditions=initialConditions)
File "C:\CompuCell3D-64bit\pythonSetupScripts\SBMLSolverHelper.py", line 184, in addFreeFloatingSBML
modelPathNormalized=os.path.abspath(os.path.join(self.simulator.getBasePath(),modelPathNormalized))
NameError: global name 'os' is not defined
Q16: How can I simulate the mitosis of a sphere cell?
id: mbmrx | creation_date: Nov. 15, 2017, 8:24 a.m. | author: Yuan | type: Question |
parent: | lastedit_date: Nov. 16, 2017, 10:30 p.m. | lastedit_user: Yuan |
content:
Hi, I want to simulate the mitosis process of a sphere cell on a substrate. How can I set the initial sphere shape with square or hexagonal lattice? Thank you~
Answer:
id: ggojg | creation_date: Nov. 15, 2017, 10:14 a.m. | author: priyomadhyapok | type: Answer |
parent: mbmrx | lastedit_date: Nov. 15, 2017, 10:15 a.m. | lastedit_user: priyomadhyapok |
content:
To generate spherical cells, use the function self.cellField whose arguments are coordinates in the lattice space. If your radius is r, and center of the sphere at say (x0,y0,z0) the coordinates (x0-r,x0+r),(y0-r,y0+r) and (z0-r,z0+r) will span a bigger cube. Then the value of r can be used as a distance cutoff to determine which voxels will lie inside the boundary of the sphere. Example code:
#generate cell
cella=self.newCell(some cell type);
#set up the center of sphere say (x0,y0,z0)
#set up the boundaries of the bigger cube
xi = x0 - r
xf = x0 + r
yi = y0-r
yf = y0+r
zi=z0-r
zf=z0+r
#loop over the points to determine boundaries of the circle
for xr in range(xi, xf):
for yr in range(yi, yf):
for zr in range(zi,zf):
rd = sqrt((xr - x0) ** 2 + (yr - y0) ** 2+(zr-z0)**2)
if (rd < r):
self.cellField[xr, yr, zr] = cella
Comment:
id: pglxq | creation_date: Nov. 15, 2017, 9:24 p.m. | author: Yuan | type: Comment |
parent: ggojg | lastedit_date: Nov. 15, 2017, 9:24 p.m. | lastedit_user: Yuan |
content:
Thank you so much, I can set up the sphere shape in this way. But how to let the shape of the daughter cells keep sphere after the mitosis. I am going to simulate many times of mitosis.
Comment:
id: eqzrg | creation_date: Nov. 16, 2017, 2:32 p.m. | author: James Sluka | type: Comment |
parent: pglxq | lastedit_date: Nov. 16, 2017, 2:32 p.m. | lastedit_user: James Sluka |
content:
Your daughter cells will tend to stay spherical if they have the proper target surface for their current and target volumes. So periodically change individual cell's target surface to;
import math
cell.targetSurface=((cell.targetVolume)**(1./3.))**2*4./3.*math.pi
The above is just a starting point for what you want to do. The surface of a "sphere" in a lattice representation is often a fair bit bigger than in a non-lattice situation. Often though if the target surface is too small that will tend to make the cell as spherical as possible. You then have to worry about the lambda for surface and volume and make sure that when you want to grow the cell's volume that lambdaVolume is big enough to overwhelm lambdaSurface amd you'll need to periodically increase the targetSurface.
You might want to make the target surface a bit bigger than it should be to give the cells some flexibility.
Comment:
id: omjnb | creation_date: Nov. 16, 2017, 10:30 p.m. | author: Yuan | type: Comment |
parent: eqzrg | lastedit_date: Nov. 16, 2017, 10:30 p.m. | lastedit_user: Yuan |
content:
Yeah,I have tried this method. In my try, the results is good when the cell is large enough. When the cell is small, tens of lattices long for example, the cell tends to be polyhedron. If I simulate the process that one cell divides several times into hundreds of daughter cells, the cost will be expensive.How to realize that? Thank you~
Q17: Why does field rendering crash CC3D on Mac OS X?
id: pglzq | creation_date: Nov. 15, 2017, 1:04 p.m. | author: Richard Spencer | type: Question |
parent: | lastedit_date: April 11, 2018, 10:13 p.m. | lastedit_user: Maciek Swat |
content:
I just installed the 3.7.7 binaries for Mac on a new iMac but with El Capitan. But for the past two or three Mac binaries, field concentration rendering has crashed CC3D (now) or done nothing. Cell types run OK. I am just curious how the other Mac users listed in another post have been able to run it normally. Thanks
Answer:
id: klewv | creation_date: Nov. 15, 2017, 6:59 p.m. | author: Maciek Swat | type: Answer |
parent: pglzq | lastedit_date: Nov. 15, 2017, 6:59 p.m. | lastedit_user: Maciek Swat |
content:
Hi Richard
Could you post a toy version of your simulation so that we can take a look at it? Does it happen on ElCapitan only or also on other OSX versions?
Answer:
id: baera | creation_date: April 11, 2018, 5:57 p.m. | author: Yen Nguyen Edalgo | type: Answer |
parent: pglzq | lastedit_date: April 11, 2018, 5:57 p.m. | lastedit_user: Yen Nguyen Edalgo |
content:
This is not an answer by the way. I just want to add that I am using CC3D on Mac and also have the same problem. The simulation would crash whenever I switch from Cell to Chemical field, even on a very simple and basic CC3D simulation involving a chemical field. Chemical field seems to work when I draw my own cells using CellDraw rather than the built-in cells.
Answer:
id: qwvrb | creation_date: April 11, 2018, 6:08 p.m. | author: Yen Nguyen Edalgo | type: Answer |
parent: pglzq | lastedit_date: April 11, 2018, 6:08 p.m. | lastedit_user: Yen Nguyen Edalgo |
content:
How can I attach a whole folder of all the .cc3d, .xml, and .py files in the post (in case that might help)? The post only allows me to attach one file at a time when clicking on the '+' symbol.
Answer:
id: xznpl | creation_date: April 11, 2018, 6:15 p.m. | author: Yen Nguyen Edalgo | type: Answer |
parent: pglzq | lastedit_date: April 11, 2018, 6:15 p.m. | lastedit_user: Yen Nguyen Edalgo |
content:
I change the LatticeType from Hexagonal to Square and it worked.
Comment:
id: nxqbe | creation_date: April 11, 2018, 10:13 p.m. | author: Maciek Swat | type: Comment |
parent: qwvrb | lastedit_date: April 11, 2018, 10:13 p.m. | lastedit_user: Maciek Swat |
content:
simply zip the folder that contains .cc3d, .xml, and .py files and then in the allanswered editor click "+" button (next to "B", "I") buttons and choose "upload image/file"
Q18: control surface and volume simulateously to set up the shape
id: xnlmm | creation_date: Nov. 16, 2017, 3:28 a.m. | author: Yuan | type: Question |
parent: | lastedit_date: Nov. 22, 2017, 8:09 a.m. | lastedit_user: Yuan |
content:
In my simulation, I try to control the target surface and target volume to set up the shape of the cell. However, the area of the surface is never changed, though the value of lambda is set very high.
attachments(redirected):
.\CC3D_allanswered_linked_files\222.png
Comment:
id: begxm | creation_date: Nov. 22, 2017, 12:23 a.m. | author: priyomadhyapok | type: Comment |
parent: xnlmm | lastedit_date: Nov. 22, 2017, 12:23 a.m. | lastedit_user: priyomadhyapok |
content:
Could you share more details of the simulation- How are you changing the targetSurface in every mcs and where are you printing it?
Answer:
id: mbjlm | creation_date: Nov. 22, 2017, 7:57 a.m. | author: Yuan | type: Answer |
parent: xnlmm | lastedit_date: Nov. 22, 2017, 7:57 a.m. | lastedit_user: Yuan |
content:
attachments(redirected):
.\CC3D_allanswered_linked_files\1.png
.\CC3D_allanswered_linked_files\2.png
Comment:
id: wlwnw | creation_date: Nov. 22, 2017, 8:06 a.m. | author: Yuan | type: Comment |
parent: begxm | lastedit_date: Nov. 22, 2017, 8:09 a.m. | lastedit_user: Yuan |
content:
The details are shown in the following pictures. I specify the value of area, "S=pow((3.0*cell.targetVolume)/(4.0*math.pi),2.0/3)*4.0*math.pi ", to guarantee that the cell is sphere during the process. For convenience, there is only one cell at first.
Q19: CompuCell to Model Osmotic Engine
id: rejna | creation_date: Nov. 20, 2017, 4:10 a.m. | author: Elliot Djokic | type: Question |
parent: | lastedit_date: Nov. 30, 2017, 11:52 p.m. | lastedit_user: priyomadhyapok |
content:
I am a 4th year undergraduate student at Colorado State University studying chemical & biological engineering and biomedical engineering. Currently, I'm in a group working on a class project that requires us to learn a new software package and apply it to a transport phenomena problem. We are working on modeling cancer cells as an osmotic engine in CompuCell. Based on the research we've done so far on the osmotic engine, we are thinking the chemotaxis module would suit our needs. The principle behind the osmotic engine is that a cancer cell can polarize itself in order to move independent of actin and myosin filaments, absorbing water at the leading edge and expelling water out the back, thereby creating movement. Our ultimate goal is to model cancer cell movement as well as volume (and other properties) of cancer cells when exposed to different osmotic environments. Might anyone have any suggestions on how to go about this? We are all very new to using CompuCell, and have been able to create very simple models (i.e. case where water is attracted to cancer cells) but are not sure how to proceed in terms of getting the cancer cells to move in response to the presence of water. We also had emailed Dr. Swat who recommended we look into using compartmentalized cells as well as using toy-mechanism to apply force to cells and thereby simulate movement, depending on the cell's environment. In any case, any advice would be much appreciated.
Thanks,
Elliot
Answer:
id: eqzvp | creation_date: Nov. 22, 2017, 12:03 a.m. | author: priyomadhyapok | type: Answer |
parent: rejna | lastedit_date: Nov. 22, 2017, 12:03 a.m. | lastedit_user: priyomadhyapok |
content:
How are you planning to model water in this case? If you are considering a `field' like approach, where there are low and high concentrations of water you can probably use one of the diffusion solvers in CC3D. You can specify diffusion rates etc depending on your osmosis. Since the arguments of the field are coordinates in the lattice space, you can use it to specify any form of initial conditions. Now you can attach chemotaxis like attributes to your cell towards this field and you can simulate motion. To measure polarization in response to the chemotaxis you can use the moment of inertia plugin which will give you a major and minor axis indicating how the cell might have changed shape.
Comment:
id: vnjvk | creation_date: Nov. 28, 2017, 2:10 a.m. | author: Elliot Djokic | type: Comment |
parent: eqzvp | lastedit_date: Nov. 28, 2017, 2:10 a.m. | lastedit_user: Elliot Djokic |
content:
Yes, we were planning on modeling water as a field. This is probably a really rudimentary question, but is specifying the initial conditions of a field similar to specifying that of a cell? In the xml file, it looks like you can import a txt file that would have the information for the initial concentration field, but I'm not sure what the contents of that txt file would be. Thanks!
Comment:
id: qvklg | creation_date: Nov. 28, 2017, 12:20 p.m. | author: priyomadhyapok | type: Comment |
parent: vnjvk | lastedit_date: Nov. 28, 2017, 12:20 p.m. | lastedit_user: priyomadhyapok |
content:
So the format of the text file is (x_coordinate,y_coordinate,z_coordinate,value). The x,y,z are coordinates between the minimum and maximum positions in your lattice. An example has been provided in the manual. If however you have initial conditions that could be created easily (like don't have to be read from a file) you can specify them in the start function of any class in the python steppable file as well. Something like:
def __init__(self,_simulator,_frequency):
SteppableBasePy.__init__(self,_simulator,_frequency)
self.somefield=self.getConcentrationField("field")
def start(self):
for x in range(0,self.dim.x):
for y in range(0,self.dim.y):
self.somefield[x,y,0]=some_value
Comment:
id: jrjba | creation_date: Nov. 30, 2017, 8:55 p.m. | author: Elliot Djokic | type: Comment |
parent: qvklg | lastedit_date: Nov. 30, 2017, 8:55 p.m. | lastedit_user: Elliot Djokic |
content:
We have been able to get the basic layout we want setup, however I was wondering how we would get about adding chemotaxis like attributes to the cell. Currently, we are using the chemotaxis plugin, however that is the chemotaxis of water towards our cancer cells, and we would like it to be the other way around. It seems there's not a way to reverse this within the plugin, so we will likely need to make changes elsewhere. Might you have any advice on what plugins/parameters we would need to modify. Thank you very much for all your help.
Comment:
id: pgrmj | creation_date: Nov. 30, 2017, 11:52 p.m. | author: priyomadhyapok | type: Comment |
parent: jrjba | lastedit_date: Nov. 30, 2017, 11:52 p.m. | lastedit_user: priyomadhyapok |
content:
So water has the form of a field and you have cancer cells in the simulation. Does something like this not work? This would be the cancer cell responding to water 'concentration' and moving towards or away from it depending on the sign for value.
def start(self):
for cell in self.cellListByType(self.CANCERCELL):
cd = self.chemotaxisPlugin.addChemotaxisData(cell, "WATERFIELD")
cd.setLambda(value)
Q20: How about the units in CC3D?
id: rejwa | creation_date: Nov. 21, 2017, 3:16 a.m. | author: Yuan | type: Question |
parent: | lastedit_date: Nov. 21, 2017, 11:47 p.m. | lastedit_user: priyomadhyapok |
content:
Hi, I wonder what is the unit in a CC3D simulation? Is it dimensionless? How to make the simulation agree with the experiment?
Answer:
id: lojxa | creation_date: Nov. 21, 2017, 12:11 p.m. | author: priyomadhyapok | type: Answer |
parent: rejwa | lastedit_date: Nov. 21, 2017, 12:11 p.m. | lastedit_user: priyomadhyapok |
content:
The lattice in CC3D represents a coordinate space in which you can measure positions. or measurements in length (in voxels). The other thing you can visualize from your simulation are measurements in time (in mcs) by observing how your configuration is changing. These length or time values are only a representation . For example, I could have a cell which measures 15 microns in diameter. To represent it I can construct a cell in CC3D with a diameter of 15 voxels and now my scale would be 1 voxel=1 micron. I could also pick a smaller or larger simulation diameter and scale accordingly.
Similarly I could have a problem in which my cell grows, reaches twice its volume and divides. If I know experimentally that the cell division time is 100 minutes, I would from my simulation check how long it takes for its growth and division and relate that mcs value to 100 minutes.
Comment:
id: avaqv | creation_date: Nov. 21, 2017, 8:21 p.m. | author: Yuan | type: Comment |
parent: lojxa | lastedit_date: Nov. 21, 2017, 8:21 p.m. | lastedit_user: Yuan |
content:
Thank you, I understand that. I still have a question. Can I use the boundary energy to resemble the adhesion between cells? How to make the J(energy) agree with the strength of adhesion i.e. the amount of E-cadherin?
Comment:
id: wlwzw | creation_date: Nov. 21, 2017, 11:47 p.m. | author: priyomadhyapok | type: Comment |
parent: avaqv | lastedit_date: Nov. 21, 2017, 11:47 p.m. | lastedit_user: priyomadhyapok |
content:
So what you can use for this is the adhesion flex plugin (for more details please see the manual). This plugin allows you to specify the adhesion molecule density for each cell (in terms of E-cadherin etc) and writes the resultant surface energy in terms of products of different adhesion molecule concentrations in all the cells. It also allows you to specify the strength of interactions between these surface molecules.
Q21: How to build a circular wall?
id: rekex | creation_date: Nov. 24, 2017, 3:07 a.m. | author: Yuan | type: Question |
parent: | lastedit_date: Nov. 26, 2017, 10:01 p.m. | lastedit_user: Yuan |
content:
Hi, I try to build a circular wall to restrict the scope of cell motility. The codes are as follows. The results are surprisingly interesting. Not only the cell types are different, the keyword, "FREEZE", is also out of use.
attachments(redirected):
.\CC3D_allanswered_linked_files\03.png
.\CC3D_allanswered_linked_files\02.png
.\CC3D_allanswered_linked_files\01.png
Answer:
id: ggvne | creation_date: Nov. 24, 2017, 1:11 p.m. | author: priyomadhyapok | type: Answer |
parent: rekex | lastedit_date: Nov. 24, 2017, 1:13 p.m. | lastedit_user: priyomadhyapok |
content:
File attached: image (285.65 KB)
I tried the same code and I have been able to construct the wall with a single cell type. So there could be an issue while you are initializing the other two cell types and something got overwritten. In this code, Freeze seems to work but if you want an alternate way you could set the volume constraint to be very large (cella.lambdaVolume=1000000) and that should essentially do the same thing.
attachments(redirected):
.\CC3D_allanswered_linked_files\image
.\CC3D_allanswered_linked_files\image
Comment:
id: vnjmk | creation_date: Nov. 26, 2017, 8:56 p.m. | author: Yuan | type: Comment |
parent: ggvne | lastedit_date: Nov. 26, 2017, 8:56 p.m. | lastedit_user: Yuan |
content:
It seems that the mitosis steppable is the cause. When the volume of the cell satisfies the dividing condition, the interesting phenomenon takes place. Does it mean that the "Freeze" is useless for mitosis? The codes are as follows.
class MitosisSteppable(MitosisSteppableBase):
def __init__(self,_simulator,_frequency=1):
MitosisSteppableBase.__init__(self,_simulator, _frequency)
# 0 - parent child position will be randomized between mitosis event
# negative integer - parent appears on the 'left' of the child
# positive integer - parent appears on the 'right' of the child
self.setParentChildPositionFlag(-1)
def step(self,mcs):
# print "INSIDE MITOSIS STEPPABLE"
cells_to_divide=[]
for cell in self.cellList:
if cell.volume>500:
cells_to_divide.append(cell)
for cell in cells_to_divide:
# to change mitosis mode leave one of the below lines uncommented
self.divideCellRandomOrientation(cell)
# self.divideCellOrientationVectorBased(cell,1,0,0) # this is a valid option
# self.divideCellAlongMajorAxis(cell) # this is a valid option
# self.divideCellAlongMinorAxis(cell) # this is a valid option
def updateAttributes(self):
self.parentCell.targetVolume /= 2.0 # reducing parent target volume
self.cloneParent2Child()
if self.parentCell.type==self.CONDENSING:
self.childCell.type=self.NONCONDENSING
else:
self.childCell.type=self.CONDENSING
Comment:
id: avoaq | creation_date: Nov. 26, 2017, 9:54 p.m. | author: priyomadhyapok | type: Comment |
parent: vnjmk | lastedit_date: Nov. 26, 2017, 9:54 p.m. | lastedit_user: priyomadhyapok |
content:
Do you want to divide your wall cell as well? Or is it an error? If you meant only condensing and noncondensing should divide, you can change your line for collecting cell types in the division array to
for cell in self.cellListByType(self.CONDENSING,self.NONCONDENSING):
if(cell.volume>500):
cells_to_divide.append(cell)
Then only these two types of cells will have updated Attributes. I don't know what kind of output you are getting for the wall cells now but could only be a conflict of current wall target volumes that you are reducing to half.
Comment:
id: pgram | creation_date: Nov. 26, 2017, 10:01 p.m. | author: Yuan | type: Comment |
parent: avoaq | lastedit_date: Nov. 26, 2017, 10:01 p.m. | lastedit_user: Yuan |
content:
Yeah, thank you so much. It is an error since I misunderstand the function of "Freeze".
Q22: How to simulate an elastic ring in 2D or an elastic hollow sphere in 3D?
id: avove | creation_date: Nov. 24, 2017, 4:17 a.m. | author: Yuan | type: Question |
parent: | lastedit_date: Jan. 9, 2018, 3:01 a.m. | lastedit_user: Yuan |
content:
I want to simulate an elastic ring in 2D or an elastic hollow sphere in 3D. There are cells dividing in the ring/sphere. When the ring is full of cells, it will exert a contraction force on the cells. How to achieve? Thank you!
Answer:
id: gglmn | creation_date: Dec. 8, 2017, 11:47 p.m. | author: Maciek Swat | type: Answer |
parent: avove | lastedit_date: Dec. 8, 2017, 11:47 p.m. | lastedit_user: Maciek Swat |
content:
I would use FocalPointPlasticity Plugin (FPP). FPP will connect centers of mass of nearby cells with elastic link. However when your cells are dividing then you woudl need to manually break the links and reestablish then after the division happens. The reason for that is that you want links for form a "chain" where one segment of the "chain" connects nearby cells. What you do not want is to have a chain where a segment of a chain "skips" new cell that appeared as a result of the mitosis
.
Answer:
id: omono | creation_date: Dec. 18, 2017, 2:36 p.m. | author: James Sluka | type: Answer |
parent: avove | lastedit_date: Dec. 18, 2017, 2:36 p.m. | lastedit_user: James Sluka |
content:
To actually generate the circle or sphere check out the code snipets and CC3D project file at https://www.allanswered.com/post/pgrnm/i-am-trying-to-mimic-the-segment-patterning-in-fruit-flies-through-a-cc3d-model-can-anyone-help-me-as-to-how-to-draw-out-a-3d-paraboloid-piff-file-with-different-cell-types-along-the-surface/
You would then add focal point plasticities to keep the circle/sphere layout.
Comment:
id: eqnjz | creation_date: Jan. 9, 2018, 2:59 a.m. | author: Yuan | type: Comment |
parent: gglmn | lastedit_date: Jan. 9, 2018, 2:59 a.m. | lastedit_user: Yuan |
content:
Actually, the background is that a non-living elastic ring exerts a tension on the cells inside the ring. I want to study the influence of the elastic ring for the division of cells. Besides, I am trying to mimic the phenomenon when the ring is snipped. When I use the FPP plugin, the cells constituting the ring are easy to separate from each other. How to avoid it?
Comment:
id: loanv | creation_date: Jan. 9, 2018, 3:01 a.m. | author: Yuan | type: Comment |
parent: omono | lastedit_date: Jan. 9, 2018, 3:01 a.m. | lastedit_user: Yuan |
content:
Actually, the background is that a non-living elastic ring exerts a tension on the cells inside the ring. I want to study the influence of the elastic ring for the division of cells. Besides, I am trying to mimic the phenomenon when the ring is snipped. When I use the FPP plugin, the cells constituting the ring are easy to separate from each other. How to avoid it?
Q23: VTK output problem when running AdhesionFlexPython
id: eqpqp | creation_date: Nov. 23, 2017, 10:27 p.m. | author: JJ Yeo | type: Question |
parent: | lastedit_date: Jan. 4, 2018, 7:14 p.m. | lastedit_user: JJ Yeo |
content:
Dear Admins,
I tried running the AdhesionFlexPython demo on both CC3D 3.7.7 and 3.7.6 in Mac OSX High Sierra. I encountered a strange problem where the moment the adhesions are changed by the AdhesionFlexSteppables.py script, the VTK outputs all zeroes for all entries (such as CellID, CellType, ClusterID).
I verified this by changing the original script to
# Same as demo until this point....
if mcs==100:
for cell in self.cellList:
print "CELL ID=",cell.id, " CELL TYPE=",cell.type
if cell.type==1:
# accessing adhesion molecule density using its name
print "NCad=", self.adhesionFlexPlugin.getAdhesionMoleculeDensity(cell,"NCad")
# accessing adhesion molecule density using its index -
# molecules are indexed in the sdame order they are listed in the xml file
print "Int=", self.adhesionFlexPlugin.getAdhesionMoleculeDensityByIndex(cell,1)
# And so on....
Once the MCS reaches 100 and changes the adhesions, the VTK outputs become matrices of zeroes. Also, the adhesions do not change at all if I change the condition to# Same as demo until this point....
if mcs==101:
for cell in self.cellList:
print "CELL ID=",cell.id, " CELL TYPE=",cell.type
if cell.type==1:
# accessing adhesion molecule density using its name
print "NCad=", self.adhesionFlexPlugin.getAdhesionMoleculeDensity(cell,"NCad")
# accessing adhesion molecule density using its index -
# molecules are indexed in the sdame order they are listed in the xml file
print "Int=", self.adhesionFlexPlugin.getAdhesionMoleculeDensityByIndex(cell,1)
# And so on....
Am I missing something here or something has to be changed in the settings? I am running the demo using the command
runScript.command -i $working_dir/$working_script -f 100 --currentDir $working_dir -o $working_dir/movies --exitWhenDone
Here's a video of the default run, I don't understand what's happening here, why are all the cells becoming type 0 (medium)?
File attached: AdhesionFlex.mpg (2.61 MB)
attachments(redirected):
.\CC3D_allanswered_linked_files\AdhesionFlex.mpg
Comment:
id: klrab | creation_date: Nov. 28, 2017, 1:48 p.m. | author: JJ Yeo | type: Comment |
parent: eqpqp | lastedit_date: Nov. 28, 2017, 1:48 p.m. | lastedit_user: JJ Yeo |
content:
Did anyone else see this problem or it's only an issue with my simulations? Any response is greatly appreciated so that I can troubleshoot the problem.
Answer:
id: klmbe | creation_date: Dec. 8, 2017, 11:50 p.m. | author: Maciek Swat | type: Answer |
parent: eqpqp | lastedit_date: Dec. 8, 2017, 11:50 p.m. | lastedit_user: Maciek Swat |
content:
I ran the AdhesionFlex Simulation with the VTK output but could not reproduce the problem. Could you post the exact simulation that you ran?
Comment:
id: wlgax | creation_date: Dec. 9, 2017, 3:35 p.m. | author: JJ Yeo | type: Comment |
parent: klmbe | lastedit_date: Dec. 9, 2017, 3:35 p.m. | lastedit_user: JJ Yeo |
content:
I ran the default AdhesionFlexPython demo on both Mac OSX High Sierra and Ubuntu 14.04 with CC3D 3.7.7. The CC3D on Ubuntu was compiled by myself. Both these cases showed the same result of Type 1 disappearing slowly.
I have attached the .zip file of the demo that I ran just to be sure:
https://mega.nz/#!5AoCSDwB!Jw9SXf2yDz3wV0hNIQKInEtLqN_yGnCa6NvJS7v0rw8
Answer:
id: mbpko | creation_date: Jan. 4, 2018, 5:49 p.m. | author: JJ Yeo | type: Answer |
parent: eqpqp | lastedit_date: Jan. 4, 2018, 7:11 p.m. | lastedit_user: JJ Yeo |
content:
Any ideas what might be the issue or any ways of troubleshooting? Here's some sample outputs from running:
File attached: LatticeData.zip (459.2 KB)
attachments(redirected):
.\CC3D_allanswered_linked_files\LatticeData.zip
Answer:
id: eqlkz | creation_date: Jan. 4, 2018, 7:14 p.m. | author: JJ Yeo | type: Answer |
parent: eqpqp | lastedit_date: Jan. 4, 2018, 7:14 p.m. | lastedit_user: JJ Yeo |
content:
After tweaking things about, the only way that I can get the simulation to have a logical VTK output is if the medium has no adhesion molecules whatsoever. I have attached the sample scripts and outputs here:
File attached: output.zip (3.55 MB)
Any comments about why this is so will be greatly appreciated.
attachments(redirected):
.\CC3D_allanswered_linked_files\output.zip
Q24: I am trying to mimic the segment patterning in fruit flies through a CC3D model. Can anyone help me as to how to draw out a 3D paraboloid PIFF file with different cell types along the surface?
id: pgrnm | creation_date: Nov. 26, 2017, 5:21 a.m. | author: Abhishek Das | type: Question |
parent: | lastedit_date: Dec. 18, 2017, 2:37 p.m. | lastedit_user: James Sluka |
content:
Currently, I see no options to draw a 3D PIF in Cell Draw. The objective is to show segment width of different cell types (coloured differently) with variable values of the contractility term aka Young's modulus. Also, the environment needs to be bounded, meaning the boundary conditions should be fixed or periodic but can't be open.
Comment:
id: klrjo | creation_date: Nov. 26, 2017, 9:05 p.m. | author: Yuan | type: Comment |
parent: pgrnm | lastedit_date: Nov. 26, 2017, 9:05 p.m. | lastedit_user: Yuan |
content:
Hi, as far as I am concerned, the contractility term is a little different from Young's modulus. What's your contractility term, the lambda volume or surface?
Comment:
id: pgrkz | creation_date: Nov. 29, 2017, 2:43 p.m. | author: priyomadhyapok | type: Comment |
parent: pgrnm | lastedit_date: Nov. 29, 2017, 2:43 p.m. | lastedit_user: priyomadhyapok |
content:
Not very familiar with Cell Draw. But you can use a separate CC3D simulation to generate a PIF file with your initial conditions first and later on export it for other simulations. (CC3D Gui -> Tools-> Generate a PIF from current snapshot) . Advantage is you can attach your Young's modulus to each cell and adjust it's constraints to describe your system. (Note to construct cells of arbitrary lengths you can use self.cellField)
Comment:
id: lowaz | creation_date: Dec. 8, 2017, 6:57 p.m. | author: Abhishek Das | type: Comment |
parent: klrjo | lastedit_date: Dec. 8, 2017, 6:57 p.m. | lastedit_user: Abhishek Das |
content:
The contractility term is Lambda surface
Comment:
id: bekpr | creation_date: Dec. 8, 2017, 9:29 p.m. | author: Yuan | type: Comment |
parent: lowaz | lastedit_date: Dec. 8, 2017, 9:29 p.m. | lastedit_user: Yuan |
content:
Yes, when I use the Lambda surface, the cells often tend to be rectangle or so, which is not analogous to the condition of cells. Have you ever meet such things?
Comment:
id: qvxqe | creation_date: Dec. 11, 2017, 9:26 a.m. | author: Abhishek Das | type: Comment |
parent: bekpr | lastedit_date: Dec. 11, 2017, 9:26 a.m. | lastedit_user: Abhishek Das |
content:
Yes, in a realistic embryo system of a developing fly the cell shapes are more of polygonal nature with pentagons and hexagons visible but with CC3D if I initialize the system with square cells, ideally the cells will try to get to a circular shape over time due to energy minimisation principle. The catch point is the regional geometrical constraints play a role (i.e. if you dont want your cells to divide and play with a constant number of cells).
Although I must say, even though visibly they look rectangular or squarish from the sim output, performing a Voronoi analysis (after extracting the center of mass of the cells) showed a distribution of polygonal shapes at steady state!
Answer:
id: pgpnr | creation_date: Dec. 18, 2017, 2:23 p.m. | author: James Sluka | type: Answer |
parent: pgrnm | lastedit_date: Dec. 18, 2017, 2:37 p.m. | lastedit_user: James Sluka |
content:
Expanding on priyomadhyapok’s answer; Sometimes the easiest way to generate a cell layout (2D or 3D) is to just do it directly in CC3D. If you can write the equations for the geometry you can have python place the individual cells exactly where you want them.
The key commands are;
Iterate over all pixels in the model (in the python steppables file);
for x in range (0,self.dim.x): # x, y and z width of the bounding box
for y in range (0,self.dim.y):
for z in range (0,self.dim.z):
print x,y,z
Create a new cell at a particular location (in the python steppables file);
newcell=self.newCell(self.MYCELL)
# MYCELL is the all-uppercase name of the cell type you want
SIZE=5.
self.cellField[x:int(x+SIZE-1),y:int(y+SIZE-1),z:int(z+SIZE-1)]=newcell
# the size of cell will be SIZExSIZExSIZE
# if you want to have the new cell centered at the3 pixel you will need something like;
# [int(x-SIZE/2.:int(x+SIZE/2. -1), ...
Write a piff file (goes in the project’s XML file)
<Steppable Frequency="100" Type="PIFDumper">
<!-- Periodically stores cell layout configuration in a piff format -->
<PIFName>SphereOfCells</PIFName>
<PIFFileExtension>piff</PIFFileExtension>
</Steppable>
Note: the piff file (SphereOfCells.piff) is written in the CC3D directory (e.g., C:\CompuCell3D) and not in the project’s directory like it should!
I have attached a zipped CC3D project called SphereOfCells that uses CC3D/Python to create a hollow sphere of cells and saves it as a piff file.
File attached: SphereOfCells.zip (262.91 KB)
attachments(redirected):
.\CC3D_allanswered_linked_files\SphereOfCells.zip
.\CC3D_allanswered_linked_files\sphereofcells.png
Q25: if I changed some parameter during the simulation running, will the result be affected?
id: eqppx | creation_date: Nov. 27, 2017, 8:27 a.m. | author: dali Zan | type: Question |
parent: | lastedit_date: Nov. 27, 2017, 12:33 p.m. | lastedit_user: Anwar |
content:
Answer:
id: belll | creation_date: Nov. 27, 2017, 8:41 a.m. | author: Yuan | type: Answer |
parent: eqppx | lastedit_date: Nov. 27, 2017, 8:41 a.m. | lastedit_user: Yuan |
content:
In my experience, no. If you stop the simulation and restart, the parameters changed in the XML will work. Why don't you have a try? Then you can confirm it.
Answer:
id: omrbm | creation_date: Nov. 27, 2017, 12:31 p.m. | author: Anwar | type: Answer |
parent: eqppx | lastedit_date: Nov. 27, 2017, 12:33 p.m. | lastedit_user: Anwar |
content:
Yes. If you change parameter in the Model Editor window it does affect the running simulation. For instance if you change temperature in the model editor new value of the temperature will be used in subsequent MCS.
Model Editor-
attachments(redirected):
.\CC3D_allanswered_linked_files\Screen Shot 2017-11-27 at 12.29.45 PM.png
Q26: How to control the shape of a cluster of cells?
id: qvkmg | creation_date: Nov. 29, 2017, 7:27 a.m. | author: Yuan | type: Question |
parent: | lastedit_date: May 15, 2018, 3:36 a.m. | lastedit_user: Jing Wei Qiu |
content:
Hi, everyone. In my simulation, there is a cluster of cells undergoing cell division. I wonder if I can get the perimeter L of them and add an energy term, $\frac{1}{2}k\left(L-L_0\right)^2$12 k(L−L0)2 .
I want to simulate the intercellular actin cable et al. in this way.
Answer:
id: zpkrw | creation_date: Nov. 29, 2017, 3:02 p.m. | author: priyomadhyapok | type: Answer |
parent: qvkmg | lastedit_date: Nov. 29, 2017, 3:03 p.m. | lastedit_user: priyomadhyapok |
content:
That looks like the surface area plugin with $\lambda_{surface}=\frac{k}{2}$λsurƒ ace=k2 . (In 2d, it generalizes to a perimeter. Should help control `pixel' distribution at the periphery)
Comment:
id: eqpvr | creation_date: Nov. 29, 2017, 9:19 p.m. | author: Yuan | type: Comment |
parent: zpkrw | lastedit_date: Nov. 29, 2017, 9:19 p.m. | lastedit_user: Yuan |
content:
Can the plugin be used for a cluster of cells (i.e. control the total surface area of these cells not for each cell)?
Comment:
id: lovzn | creation_date: Nov. 30, 2017, 12:37 a.m. | author: priyomadhyapok | type: Comment |
parent: eqpvr | lastedit_date: Nov. 30, 2017, 12:37 a.m. | lastedit_user: priyomadhyapok |
content:
I might have misunderstood your original question. By `perimeter' you are referring to the resulting shape at the boundary the cluster is forming (are your cells in a ring?) I don't believe you should directly try adding a term that signifies the target length arising from a group of single cells. Best case scenario would probably be using focal point plasticity links(similar to your equation form) between neighboring cell pairs in the cluster in order to control L0,like breaking up L0 into smaller pieces.
Comment:
id: qvkzg | creation_date: Nov. 30, 2017, 2:46 a.m. | author: Yuan | type: Comment |
parent: lovzn | lastedit_date: Nov. 30, 2017, 8:30 p.m. | lastedit_user: Yuan |
content:
Actually, the shape is a disc or other polygons, not only a ring. I want to apply the constraint, $\frac{1}{2}k\left(L-L_0\right)^2$12 k(L−L0)2 , on the outermost ring of cells. The biological background is, the outermost cells contract to exert a force on the inners. Both the outer and inner cells are of the same type and they are under mitosis. Is it possible to simulate this in CC3D?
Besides, what's the meaning of volume and surface in 2D simulation? I do not see the description in the CC3D tutorial. For example, a cell is made up of 2*2 pixels in 2D, then the surface is 8 and the volume is 4?
Thank you.
Comment:
id: nqkae | creation_date: Nov. 30, 2017, 11:36 p.m. | author: priyomadhyapok | type: Comment |
parent: qvkzg | lastedit_date: Nov. 30, 2017, 11:36 p.m. | lastedit_user: priyomadhyapok |
content:
So the point I was trying to make was you can only break your constraint length into smaller lengths and control it using FPP. The Hamiltonian in CC3D is a sum over individual cell components and their interactions.
In 2d, cell volume would generalize to the total number of pixels for the cell. So if you have a 'squarish' cell of 3 by 3, the total number of pixels in this case is 9 which is the volume. Cell surface is given by how the cell is in contact with the boundary, in this case 3*4=12.
Comment:
id: nqlqe | creation_date: Dec. 2, 2017, 9:39 p.m. | author: Yuan | type: Comment |
parent: nqkae | lastedit_date: Dec. 2, 2017, 9:39 p.m. | lastedit_user: Yuan |
content:
Yeah, I will have a try. Thank you so much.
Comment:
id: awjnm | creation_date: May 6, 2018, 10:05 p.m. | author: Jing Wei Qiu | type: Comment |
parent: nqlqe | lastedit_date: May 6, 2018, 10:05 p.m. | lastedit_user: Jing Wei Qiu |
content:
Hello, Yuan
My name is Jingwei Qiu, I am an artist now basic between Beijing and SFO. I am working on a project that need somebody familiar this model , but is hard to find programer who have the knowledge both in bio-cell and computing, so let me know can I ask the help from you, we can discuss the treatment。 Thank you
Comment:
id: vxwlj | creation_date: May 7, 2018, 9:25 a.m. | author: Yuan | type: Comment |
parent: awjnm | lastedit_date: May 7, 2018, 9:26 a.m. | lastedit_user: Yuan |
content:
Hello Jingwei,
I am not sure whether I can meet your requirements. So what do you want to do specifically?
Comment:
id: vxmvw | creation_date: May 11, 2018, 2:43 a.m. | author: Jing Wei Qiu | type: Comment |
parent: vxwlj | lastedit_date: May 11, 2018, 2:43 a.m. | lastedit_user: Jing Wei Qiu |
content:
Thank you so much for your reply! can we add a qq or wechat? So that I can share more detail with you.
my QQ:1071787728 Thank you!
Comment:
id: kgjmj | creation_date: May 11, 2018, 2:47 a.m. | author: Jing Wei Qiu | type: Comment |
parent: vxwlj | lastedit_date: May 11, 2018, 2:47 a.m. | lastedit_user: Jing Wei Qiu |
content:
This program is barely used by people,its very professional.All my programmer friend can only understand few function in it.
Comment:
id: gnkjp | creation_date: May 15, 2018, 3:36 a.m. | author: Jing Wei Qiu | type: Comment |
parent: vxwlj | lastedit_date: May 15, 2018, 3:36 a.m. | lastedit_user: Jing Wei Qiu |
content:
Hey, Yuan
Do you normally use QQ? I would love to go further in that topic with you,Let me know how you think)
Q27: Would SteadyStateDiffusionSolver2D be appropriate to be used with Chemotaxis
id: zpzqr | creation_date: Dec. 1, 2017, 3:11 p.m. | author: Mahua Roy | type: Question |
parent: | lastedit_date: Dec. 8, 2017, 11:43 p.m. | lastedit_user: Maciek Swat |
content:
I have my model based on the paper "Emergent Stratification in Solid Tumors Selects for Reduced Cohesion of Tumor Cells: A Multi-Cell, Virtual-Tissue Model of Tumor Evolution Using CompuCell3D" for tumor growth. However, I would like to have my cells to move towards higher glucose and additionally oxygen. Both these nutrients would have high diffusion constants. Using "DiffusionSolverFE" is making my simulations very slow as has been mentioned in the tutorials. Hence, I was wondering if I use SteadyStateDiffusionSolver as has been used in the above paper, would chemotaxis be appropriate?
Comment:
id: xngnl | creation_date: Dec. 2, 2017, 3:20 a.m. | author: priyomadhyapok | type: Comment |
parent: zpzqr | lastedit_date: Dec. 2, 2017, 3:20 a.m. | lastedit_user: priyomadhyapok |
content:
You should be able to use any module for solving your field and use that for chemotaxis. When you change the diffusion solver, also update the ChemicalField Source under the Chemotaxis plugin.
Answer:
id: repne | creation_date: Dec. 8, 2017, 11:43 p.m. | author: Maciek Swat | type: Answer |
parent: zpzqr | lastedit_date: Dec. 8, 2017, 11:43 p.m. | lastedit_user: Maciek Swat |
content:
Any solver can be used with chemotaxis but for large diffusion constants we typically use SteadyState solver that essentially solves Helmholtz equation in Cartesian coordinates
(d/dx)(du/dx) + (d/dy)(du/dy) + lambda*u = f(x,y).
As you can see there is no dependence on time here and this is the limiting case for the diffusion equation when d/dt term is zero because the field stopped evolving (i.e. at large t.) Clearly this is an approximation so you have to be aware of it and double check if this approximation is appropriate for your problem. However using the field from SteadyState solvers in Chemotaxis plugin is fine
Q28: fail to generate PIF file from current snapshot
id: pgqgj | creation_date: Dec. 2, 2017, 9:44 p.m. | author: Yuan | type: Question |
parent: | lastedit_date: Dec. 10, 2017, 12:14 a.m. | lastedit_user: Yuan |
content:
Hi, everyone, I am trying to generate the PIF file and use it in the following simulation. I get a "fail to respond " error, just as the picture.
attachments(redirected):
.\CC3D_allanswered_linked_files\123.png
Comment:
id: zpzpr | creation_date: Dec. 2, 2017, 10:10 p.m. | author: priyomadhyapok | type: Comment |
parent: pgqgj | lastedit_date: Dec. 2, 2017, 10:10 p.m. | lastedit_user: priyomadhyapok |
content:
So the screen becomes unresponsive once you click on 'Generate PIF file from current snapshot'? I used to have an issue when the command can't be selected at all. The way I solved it is instead of running the simulation by hitting play initially, I would hit step on the first mcs and then click on play later (Does that help in any way? ). That seemed to work with the command being available after that. Though this problem is fixed in the newer cc3d versions.
Comment:
id: ombmz | creation_date: Dec. 2, 2017, 11:49 p.m. | author: Yuan | type: Comment |
parent: zpzpr | lastedit_date: Dec. 2, 2017, 11:49 p.m. | lastedit_user: Yuan |
content:
Yeah, once I click on 'Generate PIF file from current snapshot' it becomes unresponsive. If I hit the step on only and then click to generate PIF, the same result is got.
Comment:
id: mbebl | creation_date: Dec. 3, 2017, 12:15 a.m. | author: priyomadhyapok | type: Comment |
parent: ombmz | lastedit_date: Dec. 3, 2017, 12:15 a.m. | lastedit_user: priyomadhyapok |
content:
There is also an option for PIF Dumper Steppable (Its in the manual) which you can add to the main python file. This way you don't have to use the player. Does that work for you?
Comment:
id: wlglp | creation_date: Dec. 3, 2017, 1:12 a.m. | author: Yuan | type: Comment |
parent: mbebl | lastedit_date: Dec. 3, 2017, 1:12 a.m. | lastedit_user: Yuan |
content:
Yes, this is an effective way. Thanks sincerely.
Answer:
id: vnvpe | creation_date: Dec. 8, 2017, 11:47 p.m. | author: Maciek Swat | type: Answer |
parent: pgqgj | lastedit_date: Dec. 8, 2017, 11:47 p.m. | lastedit_user: Maciek Swat |
content:
Does the solution work?
Comment:
id: bekqr | creation_date: Dec. 10, 2017, 12:14 a.m. | author: Yuan | type: Comment |
parent: vnvpe | lastedit_date: Dec. 10, 2017, 12:14 a.m. | lastedit_user: Yuan |
content:
Yes, I succeed to generate the PIF using the PIF Dumper Steppable.
Q29: Can I simulate the lumen formation in tissues?
id: reppv | creation_date: Dec. 6, 2017, 1:08 a.m. | author: Yuan | type: Question |
parent: | lastedit_date: Dec. 11, 2017, 9:06 a.m. | lastedit_user: Scott H |
content:
Hi everyone, I try to simulate the formation and fusion of lumens in the tissue. The sketch is as follows. The black hole is the lumen. Each lumen is between two cells.
I wonder if you could give me some advice, how can I simulate the initial lumen in CC3D? In my scenario, the lumen may exert a pressure on the surrounding cells so that it can extend. Besides the cells need to contract by themselves. Thank you!
attachments(redirected):
.\CC3D_allanswered_linked_files\lumen.png
Answer:
id: mbeer | creation_date: Dec. 6, 2017, 11:11 a.m. | author: Scott H | type: Answer |
parent: reppv | lastedit_date: Dec. 6, 2017, 11:11 a.m. | lastedit_user: Scott H |
content:
I am curious about this as well. What type of tissue is this? If in 2D, you could initialize a cell type for the lumen "space"
Answer:
id: qvxpv | creation_date: Dec. 6, 2017, 3:57 p.m. | author: James Sluka | type: Answer |
parent: reppv | lastedit_date: Dec. 6, 2017, 3:57 p.m. | lastedit_user: James Sluka |
content:
Yes, the best way to model a lumen is probably as "cells". Basically, blobs of water (or blood, or ...)
Answer:
id: klmke | creation_date: Dec. 10, 2017, 11:27 a.m. | author: Maciek Swat | type: Answer |
parent: reppv | lastedit_date: Dec. 10, 2017, 11:27 a.m. | lastedit_user: Maciek Swat |
content:
See this paper for details https://www.ncbi.nlm.nih.gov/pubmed/27193300
Comment:
id: bekwr | creation_date: Dec. 11, 2017, 9:06 a.m. | author: Scott H | type: Comment |
parent: klmke | lastedit_date: Dec. 11, 2017, 9:06 a.m. | lastedit_user: Scott H |
content:
The paper is very detailed and a good source- thank you for the suggestion! We need a Journal Club on the forum!
Q30: An error happens when I try to open the model in player
id: ombok | creation_date: Dec. 7, 2017, 9:31 p.m. | author: Yuan | type: Question |
parent: | lastedit_date: Dec. 10, 2017, 9:01 p.m. | lastedit_user: Yuan |
content:
File attached: model.rar (18.01 KB)
Actually, I have installed the numpy, just as the following snapshot. It seems that there are relatively more errors in Windows compared to others. Is this true? By the way, there are more or less errors for me while using the newer version such as 3.7.5~3.7.7. Now I am using a no gpu version of 3.7.4 in Windows 7 64 bit OS. There was no error at first, but now ......
attachments(redirected):
.\CC3D_allanswered_linked_files\QQ截图20171208095803.png
.\CC3D_allanswered_linked_files\QQ截图20171208102236.png
.\CC3D_allanswered_linked_files\model.rar
Answer:
id: mbepr | creation_date: Dec. 7, 2017, 10:37 p.m. | author: Maciek Swat | type: Answer |
parent: ombok | lastedit_date: Dec. 7, 2017, 10:37 p.m. | lastedit_user: Maciek Swat |
content:
could you post the example you are trying to run. i n general I would stick to newer versions of CC3D as they ship with complete Python distribution. BTW the above error happens because you have not imported random in Python. If you type
import random
random.rand()
it should work
However , depending on your simulation you may want to explore numpy's random utilities in that cas you woudl type
import numpy.random as nr
# now you can type
nr.rand(3,2)
# and this is what you will get
# array([[ 0.14022471, 0.96360618], #random
# [ 0.37601032, 0.25528411], #random
# [ 0.49313049, 0.94909878]]) #random
see https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.random.rand.html#numpy.random.rand
Comment:
id: eqwlo | creation_date: Dec. 7, 2017, 11:23 p.m. | author: Yuan | type: Comment |
parent: mbepr | lastedit_date: Dec. 8, 2017, 4:05 a.m. | lastedit_user: Yuan |
content:
Thank you. The model is attached now. I don't even use the function in Numpy. So I think the error may due to other reasons. BTW is there a no gpu version for 3.7.7 or 3.7.6 ?
Comment:
id: gglzo | creation_date: Dec. 8, 2017, 8:25 a.m. | author: Yuan | type: Comment |
parent: mbepr | lastedit_date: Dec. 8, 2017, 8:25 a.m. | lastedit_user: Yuan |
content:
In addition to that, there are still two problems for 3.7.7.
1. It seems that there is no CellDraw in 3.7.7
2. If I click the Compucell3D immediately, it will crash in splash screen.
Answer:
id: qvxle | creation_date: Dec. 8, 2017, 11:29 p.m. | author: Maciek Swat | type: Answer |
parent: ombok | lastedit_date: Dec. 8, 2017, 11:29 p.m. | lastedit_user: Maciek Swat |
content:
Thanks for reporting the startup crash issue. We have fixed it.And you are right there is no cell draw in 3.7.7.
Answer:
id: xngab | creation_date: Dec. 8, 2017, 11:35 p.m. | author: Maciek Swat | type: Answer |
parent: ombok | lastedit_date: Dec. 8, 2017, 11:35 p.m. | lastedit_user: Maciek Swat |
content:
The issue with your code was not the model itself but the cc3d file
This is how it looked like:
<Simulation version="3.6.2">
<XMLScript Type="XMLScript">Simulation/lumen.xml</XMLScript>
<PythonScript Type="PythonScript">Simulation/lumen.py</PythonScript>
<Resource Type="Python">Simulation/lumenSteppables.py</Resource>
<PIFFile>C:\CompuCell3D-64bit\(u'D:\cc3d\lumen\lumen.piff', u'All Files (*)')</PIFFile>
</Simulation>
and this is how it should look like:
<Simulation version="3.6.2">
<XMLScript Type="XMLScript">Simulation/lumen.xml</XMLScript>
<PythonScript Type="PythonScript">Simulation/lumen.py</PythonScript>
<Resource Type="Python">Simulation/lumenSteppables.py</Resource>
</Simulation>
Simply you have specified a path of the PIFFile that did not point to anything and thi sis the reason you have seen the crash
If you want to specify PIFFile path in the .cc3d file you could do the following:
<Simulation version="3.6.2">
<XMLScript Type="XMLScript">Simulation/lumen.xml</XMLScript>
<PythonScript Type="PythonScript">Simulation/lumen.py</PythonScript>
<Resource Type="Python">Simulation/lumenSteppables.py</Resource>
<PIFFile>Simulation/lumen5.piff</PIFFile>
</Simulation>
File attached: model_yuan_fixed.zip (20.91 KB)
Let us know if this simulation runs on your machine. I have tested it on windows with 3.7.7. binary
attachments(redirected):
.\CC3D_allanswered_linked_files\model_yuan_fixed.zip
Comment:
id: lowqz | creation_date: Dec. 10, 2017, 12:09 a.m. | author: Yuan | type: Comment |
parent: qvxle | lastedit_date: Dec. 10, 2017, 12:09 a.m. | lastedit_user: Yuan |
content:
So do I have to install an older version if I want to use CellDraw?
Answer:
id: gglxn | creation_date: Dec. 10, 2017, 11:22 a.m. | author: Maciek Swat | type: Answer |
parent: ombok | lastedit_date: Dec. 10, 2017, 11:22 a.m. | lastedit_user: Maciek Swat |
content:
For the time being, yes. How complicated is the geometry you are creating?
Comment:
id: avkmo | creation_date: Dec. 10, 2017, 8:50 p.m. | author: Yuan | type: Comment |
parent: xngab | lastedit_date: Dec. 10, 2017, 8:50 p.m. | lastedit_user: Yuan |
content:
Yes, the model runs normally now. Thanks sincerely.
Comment:
id: nqlel | creation_date: Dec. 10, 2017, 8:56 p.m. | author: Yuan | type: Comment |
parent: gglxn | lastedit_date: Dec. 10, 2017, 9:01 p.m. | lastedit_user: Yuan |
content:
Just as the following picture:
attachments(redirected):
.\CC3D_allanswered_linked_files\QQ截图20171211100024.png
Q31: How can I obtain the velocity of a cell during the simulation?
id: jrxax | creation_date: Dec. 8, 2017, 10:06 a.m. | author: Thomas | type: Question |
parent: | lastedit_date: Dec. 28, 2017, 3:43 p.m. | lastedit_user: Kim Kanigel Winner |
content:
Hello everyone. I simulate the migration of a cell over a substrate and I would like to obtain the velocity of this cell and the time of each iteration. Do you know if there is a way to know them?
Thank you!
Answer:
id: mbeaw | creation_date: Dec. 8, 2017, 2:08 p.m. | author: priyomadhyapok | type: Answer |
parent: jrxax | lastedit_date: Dec. 8, 2017, 2:08 p.m. | lastedit_user: priyomadhyapok |
content:
You can find a velocity measure by tracking positions of center of masses of cells and the time taken to attain the difference. So if the center of mass of the cell has shifted from x1 to x2 in t mcs, the velocity would be (x2-x1)/t
Answer:
id: vnvke | creation_date: Dec. 10, 2017, 11:25 a.m. | author: Maciek Swat | type: Answer |
parent: jrxax | lastedit_date: Dec. 10, 2017, 11:25 a.m. | lastedit_user: Maciek Swat |
content:
One thing to remember though is to be aware that is t=1 MCS (Monte Carlo Step) you will get a very noisy estimate of the velocity so it is best to use longer time periods. the optimal interval to use may depend of the actual simulation you run so you may need to play a bit with different values
Answer:
id: omblg | creation_date: Dec. 11, 2017, 5:08 a.m. | author: Thomas | type: Answer |
parent: jrxax | lastedit_date: Dec. 11, 2017, 5:08 a.m. | lastedit_user: Thomas |
content:
Thank you for the answer. Do you know where I can find data such as the position of the center of mass of the cell during the simulation (because I try to use the plugin "CenterOfMass" but I can't find the data for post-processing)?
Answer:
id: klmoe | creation_date: Dec. 11, 2017, 11:14 a.m. | author: James Sluka | type: Answer |
parent: jrxax | lastedit_date: Dec. 11, 2017, 11:14 a.m. | lastedit_user: James Sluka |
content:
If you use twedit++ there is a code snipet at <CC3D Python><Cell Attributes><Center of Mass>, which inserts the code below.
# Make sure CenterOfMass plugin is loaded
# READ ONLY ACCESS
xCOM=cell.xCOM
yCOM=cell.yCOM
zCOM=cell.zCOM
Answer:
id: nqpeq | creation_date: Dec. 28, 2017, 3:42 p.m. | author: Kim Kanigel Winner | type: Answer |
parent: jrxax | lastedit_date: Dec. 28, 2017, 3:43 p.m. | lastedit_user: Kim Kanigel Winner |
content:
This is a little embarrassing, but I have used a ruler on screenshots taken at simulation start and end points to measure # of pixels/voxels traveled by a clump of cells to get their tissue-invasive velocity. The simulation was of several hours' movement, so this was basically a long, running average, as mentioned above. Whether I did it on the screen or printed on paper I can't remember, but either is fine -- though you have a record if you keep the paper. The traveling cells stayed visible in one plane of a 3-D sim, coincidentally. Not to discourage tracking it computationally -- you could just as easily get a start and end point and do the same calculation -- just another way it has been done.
Q32: A question from the paper.
id: nqkjb | creation_date: Nov. 26, 2017, 9:54 p.m. | author: Yuan | type: Question |
parent: | lastedit_date: Dec. 10, 2017, 11:17 a.m. | lastedit_user: Maciek Swat |
content:
Hi, the paper "Multi-Scale Modeling of Tissues Using CompuCell3D" says, "The fixed discretization makes explicit modeling of fibers or membranes expensive, since the lattice constant must be set to the smallest scale to be explicitly represented. Cell membrane fluctuations are also caricatured as a result of the fixed spatial resolution. However, the latest versions of CC3D support a layer of finite-element links which have length but zero diameter. These can be used to represent fibers or membranes, allowing a simulation to combine the advantages of both methods at the cost of increased model complexity."
How to realize it?
Answer:
id: repxe | creation_date: Dec. 10, 2017, 11:17 a.m. | author: Maciek Swat | type: Answer |
parent: nqkjb | lastedit_date: Dec. 10, 2017, 11:17 a.m. | lastedit_user: Maciek Swat |
content:
The layer fo finite-element-like links is essentially Focal Point Plasticity. It places a constraint on the distance between two centers of masses of the two cells. For example you can have a compartmentalized cell composed of many compartments and you can connect "outermost" compartments with a series of focal point plasticity links. This could provide contractile force, of similar type as membrane would exert.
Q33: what's the meaning of neighborAddress?
id: zpzlj | creation_date: Dec. 11, 2017, 3:52 a.m. | author: Yuan | type: Question |
parent: | lastedit_date: Dec. 16, 2017, 12:21 p.m. | lastedit_user: Maciek Swat |
content:
Hi, everyone. I am just reading the CC3D code in Ph.D. thesis 'Modeling interactions between a tumor cell and its host epithelium', Eline Boghaert, Princeton University (2014).
There are some puzzles for me in the following code, what're the properties of neighborAddress ?
diameters?
#for each LEP calculate the number of cells that are 2.5 cell diameters away (2nd order neighbors)
class ApoptosisSteppable(SteppableBasePy):
def __init__(self,_simulator,_frequency=1):
SteppableBasePy.__init__(self,_simulator,_frequency)
def step(self,mcs):
if mcs>10:
cell_apoptosis=[]
for cell in self.cellListByType(1):
neighbors=[]
a=cell.id
id=[cell.id]
cellNeighborList=self.getCellNeighbors(cell)
for neighbor in cellNeighborList:
if neighbor.neighborAddress and neighbor.neighborAddress.type==1:
neighbors.append(neighbor.neighborAddress)
id.append(neighbor.neighborAddress.id)
for cell in neighbors:
cellNeighborList=self.getCellNeighbors(cell)
for neighbor in cellNeighborList:
if neighbor.neighborAddress and neighbor.neighborAddress.type==1:
if neighbor.neighborAddress.id in id:
pass
else:
id.append(neighbor.neighborAddress.id)
#if there are more than 10 cells within a 2.5 cell diameter radius the LEP undergoes apoptosis with a given probability
#the randint function is used to specify this probability
if len(id)>10 and randint(1,1000)<=10:
cell_apoptosis.append(a)
for cell in self.cellListByType(1):
if cell.id in cell_apoptosis:
cell.targetVolume=0
cell.lambdaVolume=1000
Answer:
id: xngrb | creation_date: Dec. 11, 2017, 9:59 a.m. | author: Maciek Swat | type: Answer |
parent: zpzlj | lastedit_date: Dec. 11, 2017, 9:59 a.m. | lastedit_user: Maciek Swat |
content:
strictly speaking neighborAddress is a C++ address of the neighbor cell object. In Python neighborAddress is simply a neighbor cell so if you type:
neighborAddress.id
you will get id of th neighbor cell
if you type
neighborAddress.volume
you will get volume of the neighbor cell
etc..
One thing to keep in mind is that Medium can be a neighbor too and Medium is a zero pointer in C++ so the neighbor address of it will be 0 and you cannot as for id or volume of the Medium. This is why you often see the if statement that checks if neighbor address is NULL or not
Also , the new examples in 3.7.6 + use somewhat cleaner terminology w.r.t. iteration over neghbors
Comment:
id: bekxr | creation_date: Dec. 13, 2017, 8:41 a.m. | author: Yuan | type: Comment |
parent: xngrb | lastedit_date: Dec. 15, 2017, 1:24 a.m. | lastedit_user: Yuan |
content:
Oh,I see, thank you. I still have a puzzle, when I meet some commands which don't appear in the manuals, how can I know its usage and function, in addition to asking in the community?
Answer:
id: eqwkb | creation_date: Dec. 14, 2017, 11:41 a.m. | author: Scott H | type: Answer |
parent: zpzlj | lastedit_date: Dec. 14, 2017, 11:41 a.m. | lastedit_user: Scott H |
content:
I found the new Python Scripting Manual helpful in this particular case http://pythonscriptingmanual.readthedocs.io/en/latest/SteppableBasePy_class.html .
Most of the simulation is done on self.cellList, and I was able to understand the Python scripting more once I knew more about the basic class.
I like the particular example you posted. I am also doing simulations involving logic based on cell neighbors.
Comment:
id: klpgg | creation_date: Dec. 16, 2017, 12:21 p.m. | author: Maciek Swat | type: Comment |
parent: bekxr | lastedit_date: Dec. 16, 2017, 12:21 p.m. | lastedit_user: Maciek Swat |
content:
Usually the best thing is to ask people in this forum. We are working to fix the documentation but sometimes code development cycle is ahead of the documentation cycle. Any questions you post here will get incorporated into the manuals. It also help us understand what aspects of CC3D are most confusing to people
Q34: Conversion factors
id: qvxme | creation_date: Dec. 11, 2017, 8 p.m. | author: Mahua Roy | type: Question |
parent: | lastedit_date: Feb. 1, 2018, 10:45 p.m. | lastedit_user: Abbas Shirinifard |
content:
For the paper "Emergent Stratification in Solid tumors ..." there is a conversion factor from fmol/cell to fmol/voxel (0.1fmol/cell/s to 2.25fmol/voxel/MCS). I can get the conversion from MCS to sec. However, what is the factor used for conversion of per cell to per voxel. The paper mentions using a scaling factor to convert 5mM to 0.32fmol/voxel.
Similar conversion factors are also used in "Multiscale Modeling of Tissues " , the book chapter.
I would highly appreciate any help.
Answer:
id: mbpba | creation_date: Dec. 15, 2017, 11:50 p.m. | author: Maciek Swat | type: Answer |
parent: qvxme | lastedit_date: Dec. 15, 2017, 11:50 p.m. | lastedit_user: Maciek Swat |
content:
I think in this simulation we used steady state diffusion solver that for a given initial and boundary condition outputs concentration numbers for each pixel. All we are saying in the paper is that whatever the solver outputs will be interpreted in such a way that when the solver outputs 0.32 fmol we interpret it as 5mM of real concentration. Simply put I can rescale concentration in any way I want i.e. when i keep diffusion constant fixed and rescale initial concentration by a factor F the field will evolve in the same way as the field that was not scaled. the only difference will be scale.
Comment:
id: ggxkp | creation_date: Jan. 31, 2018, 3:47 p.m. | author: Mahua Roy | type: Comment |
parent: mbpba | lastedit_date: Feb. 1, 2018, 2:50 p.m. | lastedit_user: Mahua Roy |
content:
For the same paper would you be able to explain how the secretion rate of glucose from stromal cells was calculated in the absence of the tumor. And also the threshold of 102.0 was assumed based on the cell being exposed to zero glucose concentration for 24 hours (240 MCS). I would highly appreciate if you could kindly shed some light on the calculation steps to reach that value. Thanks so much.
Answer:
id: klkmx | creation_date: Feb. 1, 2018, 10:45 p.m. | author: Abbas Shirinifard | type: Answer |
parent: qvxme | lastedit_date: Feb. 1, 2018, 10:45 p.m. | lastedit_user: Abbas Shirinifard |
content:
given we set voxel area to 16 um^2, voxel volume will be 64um^3:
5mM= 5e-3 mole * (1/L) * (64um^3/voxel) = 0.32e-15 mole/voxel
0.1 fmol/cell/s = 0.1 fmol * (1/cell) * (cell/(16 voxels)) * (1/s) * (360 s/MCS)=2.25 fmol/voxel/mcs
Q35: Fail to run the model from CC3D web
id: repae | creation_date: Dec. 11, 2017, 9:51 p.m. | author: Yuan | type: Question |
parent: | lastedit_date: Dec. 16, 2017, 12:02 a.m. | lastedit_user: Maciek Swat |
content:
I have just run the model code of the PKD paper( http://www.compucell3d.org/Models/PKD).
There seem to be some problems,
1. when I click the 'Open in Player', the CC3D player doesn't work (both of the isoCyst and tubule model).
2. it seems that the Graphs.py is lost in the tubule folder,
<version 3.7.7, Windows 7, 64-bit.>
<Simulation version="3.7.3">
<PythonScript Type="PythonScript">PKD.py</PythonScript>
<Resource Type="Python">PKDSteppables.py</Resource>
<Resource Type="Python">Graphs.py</Resource>
</Simulation>
Answer:
id: eqlqb | creation_date: Dec. 16, 2017, 12:02 a.m. | author: Maciek Swat | type: Answer |
parent: repae | lastedit_date: Dec. 16, 2017, 12:02 a.m. | lastedit_user: Maciek Swat |
content:
We fixed it
here is the link
http://www.compucell3d.org/Models/PKD
If it does not work I am attaching it here as well
File attached: PKD_paper_codes_fixed.zip (40.93 KB)
attachments(redirected):
.\CC3D_allanswered_linked_files\PKD_paper_codes_fixed.zip
Q36: Python keeps crashing and compucell3D fails to open.
id: mberw | creation_date: Dec. 12, 2017, 9:43 a.m. | author: d g | type: Question |
parent: | lastedit_date: Dec. 17, 2017, 3:49 a.m. | lastedit_user: Yuan |
content:
Hi All,
I have been using compucell3D for over a year without a problem, but Since downloading the latest version, Compucell3D player fails to open unless via tweddit, and then python keeps crashing at random times during the simulation. This is not an error in the code I have checked this for sure. But even when I uninstall the latest version and reinstall an older version of compucell3D I am having this problem. has anyone else had this issue or knows what I could do.
Thanks,
Daniel
Answer:
id: eqwaa | creation_date: Dec. 12, 2017, 11:13 a.m. | author: Maciek Swat | type: Answer |
parent: mberw | lastedit_date: Dec. 12, 2017, 11:13 a.m. | lastedit_user: Maciek Swat |
content:
If this happens on Windows you may need to reinstall CC3D. Preferably you may need to manually remove the entire CC3D installation directory prior to installation. Let us know if this continues to be the case
Comment:
id: ggljn | creation_date: Dec. 12, 2017, 12:28 p.m. | author: d g | type: Comment |
parent: eqwaa | lastedit_date: Dec. 12, 2017, 12:28 p.m. | lastedit_user: d g |
content:
Thank you, I did this and reinstalled version 3.7.5 and it is now working I shall try again with version 3.7.7 later.
Comment:
id: pgpgr | creation_date: Dec. 15, 2017, 8:29 p.m. | author: Yuan | type: Comment |
parent: ggljn | lastedit_date: Dec. 15, 2017, 8:29 p.m. | lastedit_user: Yuan |
content:
I have the similar problem with the CC3D player for 3.7.7 and 3.7.6, so I just open it via twedit. The 3.7.5 no GPU version is normally running for me.
Answer:
id: zpmpz | creation_date: Dec. 15, 2017, 11:15 p.m. | author: Maciek Swat | type: Answer |
parent: mberw | lastedit_date: Dec. 15, 2017, 11:15 p.m. | lastedit_user: Maciek Swat |
content:
See the solution above - manually removing the CC3D installation folder on Windows Prior to installation of C3D 3.7.7 will solve the problem
Comment:
id: avrwj | creation_date: Dec. 17, 2017, 3:49 a.m. | author: Yuan | type: Comment |
parent: zpmpz | lastedit_date: Dec. 17, 2017, 3:49 a.m. | lastedit_user: Yuan |
content:
It seems useless for the CC3D player, however, open it via twedit is okay.
Q37: The execution sequence of the plugins and steppables
id: avrlj | creation_date: Dec. 15, 2017, 4:15 a.m. | author: Yuan | type: Question |
parent: | lastedit_date: Dec. 17, 2017, 4:07 a.m. | lastedit_user: Yuan |
content:
The following is the pseudo-code of CC3D. My question is what is the execution sequences of the plugins and steppables? Are the sequences impacting on the results? What should I do if I want to make the steppables run in my sequence?
attachments(redirected):
.\CC3D_allanswered_linked_files\QQ截图20171215170902.png
Answer:
id: qvpoz | creation_date: Dec. 15, 2017, 11:59 a.m. | author: James Sluka | type: Answer |
parent: avrlj | lastedit_date: Dec. 15, 2017, 11:59 a.m. | lastedit_user: James Sluka |
content:
One way to enforce a particular ordering of steppables would be to simply include them all in a single steppable. You then have complete flow control in python.
Comment:
id: nqpqj | creation_date: Dec. 15, 2017, 8:23 p.m. | author: Yuan | type: Comment |
parent: qvpoz | lastedit_date: Dec. 15, 2017, 8:23 p.m. | lastedit_user: Yuan |
content:
Yeah, a good idea! Thank you so much!
Answer:
id: vnbxn | creation_date: Dec. 16, 2017, 12:18 p.m. | author: Maciek Swat | type: Answer |
parent: avrlj | lastedit_date: Dec. 16, 2017, 12:18 p.m. | lastedit_user: Maciek Swat |
content:
Steppables are executed in the same order in which they are aded to steppableRegistry. So in your main python file you typically see the following
from scientificHistBarPlotsSteppables import HistPlotSteppable
histPlotSteppable=HistPlotSteppable(_simulator=sim,_frequency=1)
steppableRegistry.registerSteppable(histPlotSteppable)
from scientificHistBarPlotsSteppables import BarPlotSteppable
barPlotSteppable=BarPlotSteppable(_simulator=sim,_frequency=1)
steppableRegistry.registerSteppable(barPlotSteppable)
CompuCellSetup.mainLoop(sim,simthread,steppableRegistry)
which means that barPlotSteppable will be executer AFTER histPlotSteppable because it was added to steppebleRegistry later in the code. And Yes, in certain situations the order of steppables may impact your results so you need to keep an eye on that
Comment:
id: nqpxj | creation_date: Dec. 17, 2017, 4:07 a.m. | author: Yuan | type: Comment |
parent: vnbxn | lastedit_date: Dec. 17, 2017, 4:07 a.m. | lastedit_user: Yuan |
content:
BTW, what about the order of plugins?
Q38: Disappearing cells
id: qvpwz | creation_date: Dec. 18, 2017, 5:22 a.m. | author: Pauli Tikka | type: Question |
parent: | lastedit_date: Dec. 20, 2017, 1:01 p.m. | lastedit_user: Pauli Tikka |
content:
Dear reader,
I loose the record of some cells at the end of my simulation, what could be the cause for it?
An example file extraction:
cell_no,time_mcs,x_position_(px),y_position_(px)
...
428,966,22.6896551724,14.8965517241
429,966,22.56,36.12
428,967,22.6153846154,15.1923076923
429,967,22.7083333333,35.9166666667
428,968,22.7037037037,14.851851
STOPS?? :)
There should be 999 entries? What to do/how to fix?
Best regards,
Pauli
:)
Answer:
id: nqpoj | creation_date: Dec. 18, 2017, 12:42 p.m. | author: priyomadhyapok | type: Answer |
parent: qvpwz | lastedit_date: Dec. 18, 2017, 12:42 p.m. | lastedit_user: priyomadhyapok |
content:
Could you post the part of your code that is printing to the file? A possible reason could be if you are not `flushing' after printing (eg print>>some_fileHandle, results ; some_fileHandle.flush() ) but this is just a guess.
Answer:
id: zpmgz | creation_date: Dec. 18, 2017, 2:30 p.m. | author: James Sluka | type: Answer |
parent: qvpwz | lastedit_date: Dec. 18, 2017, 2:30 p.m. | lastedit_user: James Sluka |
content:
Are you sure the missing lines aren't actually in the file somewhere other than at the end? Depending on your data structure Python might not be printing things in the order you expect. Dictionaries in particular can print with odd ordering.
Answer:
id: remvb | creation_date: Dec. 19, 2017, 6:31 a.m. | author: Pauli Tikka | type: Answer |
parent: qvpwz | lastedit_date: Dec. 19, 2017, 6:31 a.m. | lastedit_user: Pauli Tikka |
content:
Hi,
Thank you for your comments!
Here is the steppables.py file almost as it is:
from PySteppables import *
import CompuCell
import sys
import random
from math import *
from XMLUtils import dictionaryToMapStrStr as d2mss
from PySteppablesExamples import MitosisSteppableBase
class ConstraintInitializerSteppable(SteppableBasePy):
def __init__(self,_simulator,_frequency=1):
SteppableBasePy.__init__(self,_simulator,_frequency)
def start(self):
for cell in self.cellList:
cell.targetVolume=30
cell.lambdaVolume=1.0
class peittoSteppable(SteppableBasePy):
def __init__(self,_simulator,_frequency=1):
SteppableBasePy.__init__(self,_simulator,_frequency)
self.cellA=None
self.cellB=None
def start(self):
self.pW = self.addNewPlotWindow(_title='Tracking', _xAxisTitle='Y',
_yAxisTitle='Variables', _xScaleType='linear', _yScaleType='linear')
for cell in self.cellListByType(self.NPCELLS):
c = random.choice(['green','yellow','red','blue']) #,'yellow','red','blue'
self.pW.addPlot(str(cell.id), _style='Lines', _color='green', _size=5)
for cell in self.cellListByType(self.ACELLS):
c = random.choice(['green','yellow','red','blue']) #,'yellow','red','blue'
self.pW.addPlot(str(cell.id), _style='Lines', _color='blue', _size=5)
FileName = "C:/CompuCell3D-64bit/pauli/movements/m16/okok/heihou99.txt"
FileName2 = "C:/CompuCell3D-64bit/pauli/movements/m16/okok/tt2.txt"
self.File = open(FileName,"w")
self.File2 = open(FileName2,"w")
self.File.write("cell_no, time_mcs,x_position_(px),y_position_(px)\n")
self.File2.write("cell_no, distances, time_mcs,x_position_(px),y_position_(px)\n")
def step(self,mcs):
for cell in self.cellList:
self.File2.write(str(cell.id)+","+str(mcs)+","+str(self.distanceBetweenCells(self.attemptFetchingCellById(15),self.attemptFetchingCellById(cell.id)))+","+str(cell.xCOM)+","+str(cell.yCOM)+"\n")
for cell in self.cellListByType(self.NPCELLS):
self.pW.addDataPoint(str(cell.id), cell.xCOM, cell.yCOM)
self.File.write(str(cell.id)+","+str(mcs)+","+str(cell.xCOM)+","+str(cell.yCOM)+"\n")
for cell in self.cellListByType(self.ACELLS):
self.pW.addDataPoint(str(cell.id), cell.xCOM, cell.yCOM)
self.File.write(str(cell.id)+","+str(mcs)+","+str(cell.xCOM)+","+str(cell.yCOM)+"\n")
def finish(self):
# Finish Function gets called after the last MCS
pass
-Pauli
:)
Answer:
id: omojr | creation_date: Dec. 20, 2017, 11:56 a.m. | author: priyomadhyapok | type: Answer |
parent: qvpwz | lastedit_date: Dec. 20, 2017, 11:56 a.m. | lastedit_user: priyomadhyapok |
content:
Try self.File.flush() and self.File2.flush() after the write statements. I tried a version of your code and it works for me
Answer:
id: mbpje | creation_date: Dec. 20, 2017, 11:58 a.m. | author: James Sluka | type: Answer |
parent: qvpwz | lastedit_date: Dec. 20, 2017, noon | lastedit_user: James Sluka |
content:
Instead of the the flush commands you might just need to explicitly close your output files. Closing will flush the write buffer. I believe this will do it;
def finish(self):
# Finish Function gets called after the last MCS
self.File.close()
self.File2.close()
Answer:
id: eqlzn | creation_date: Dec. 20, 2017, 12:20 p.m. | author: James Sluka | type: Answer |
parent: qvpwz | lastedit_date: Dec. 20, 2017, 12:20 p.m. | lastedit_user: James Sluka |
content:
Another way to flush the writes is to open your output file(s) with a zero size buffer;self.File=open(FileName,"w",0)
The zero is the output buffer size. This flushes the output after every write command.
If you don't write to the file too often then the zero size output buffer wont slow things down.
Answer:
id: bemgw | creation_date: Dec. 20, 2017, 12:59 p.m. | author: Pauli Tikka | type: Answer |
parent: qvpwz | lastedit_date: Dec. 20, 2017, 1 p.m. | lastedit_user: Pauli Tikka |
content:
Thank you for your help!
I see that these code lines should solve the issue. I test tomorrow and report if still any related problems.
Comment:
id: qvpgm | creation_date: Dec. 20, 2017, 1:01 p.m. | author: Pauli Tikka | type: Comment |
parent: omojr | lastedit_date: Dec. 20, 2017, 1:01 p.m. | lastedit_user: Pauli Tikka |
content:
Thank you for your help!
I see that these code lines, yours and James', should solve the issue. I test tomorrow and report if still any related problems.
Comment:
id: xnxeq | creation_date: Dec. 20, 2017, 1:01 p.m. | author: Pauli Tikka | type: Comment |
parent: mbpje | lastedit_date: Dec. 20, 2017, 1:01 p.m. | lastedit_user: Pauli Tikka |
content:
thank you for the code, should be ok
Q39: Some questions about the commands
id: mbpme | creation_date: Dec. 19, 2017, 9:59 p.m. | author: Yuan | type: Question |
parent: | lastedit_date: Dec. 21, 2017, 9:35 a.m. | lastedit_user: Scott H |
content:
Dear all, I have some questions on the following codes from the PKD paper.
def dePixelating(self,cell):
L=[]; compList=self.inventory.getClusterCells(cell.clusterId)
for cell2 in compList:
if (cell2.id != cell.id):
pixelList=self.getCellPixelList(cell)
for pixel in pixelList:
L.append(pixel.pixel)
for pixel in L:
self.cellField.set(pixel,cell)
cell.targetVolume+=len(L)
1. what's the function of self.cellField.set(pixel,cell)? To make the pixel belong to the cell?
2. should the command "pixelList=self.getCellPixelList(cell)" be "pixelList=self.getCellPixelList(cell2)"?
3.what 's the function of this function?
Answer:
id: lopvq | creation_date: Dec. 21, 2017, 9:35 a.m. | author: Scott H | type: Answer |
parent: mbpme | lastedit_date: Dec. 21, 2017, 9:35 a.m. | lastedit_user: Scott H |
content:
As I understand it, this is a function under the Mitosis Steppable Class, for the Tubule Python code. Cell2 is an index going through the compList. The function is called using (self, cell), so I assume we are interested in the pixels of cell and not cell2.
I think this is related to mitosis or dividing of clustered cells, as opposed to non-clustered cells. See pg 79-81 of the 3.7.2 Reference Manual. The general 3 steps to that includes getting the set of all pixels contained by the clustered cell. Then pixels are assigned to either the parent or child cell.
Q40: SteadyStateDiffusionSolver2D Equation
id: klpbn | creation_date: Dec. 26, 2017, 3:03 p.m. | author: Francisco Marques | type: Question |
parent: | lastedit_date: Jan. 2, 2018, 10:43 a.m. | lastedit_user: Francisco Marques |
content:
Hello everyone!
I am working on a project using CompuCell3D, and I am using the PDE Solver "SteadyStateDiffusionSolver2D" to manage the diffusion processes of Oxygen.
However, I can't make sense of the results in the simulation. I have tried to solve the equation given in the documentation (Helmholtz equation) numerically, using Matlab, and the solution is very different.
For instance, in CompuCell3D, there are negative values, which I find unreasonable since I have no cells consuming the substance (there is a single cell diffusing oxygen in the centre of the simulation lattice).
Moreover, I couldn't find any information online regarding the use of the Helmholtz equation (in the form provided in the documentation) for diffusion processes.
Could you please clarify me about this issue or provide me with any documentation that details the methods used in this solver?
Thank you for your time!
Comment:
id: nqpro | creation_date: Dec. 27, 2017, 7:43 p.m. | author: priyomadhyapok | type: Comment |
parent: klpbn | lastedit_date: Dec. 27, 2017, 7:43 p.m. | lastedit_user: priyomadhyapok |
content:
This from the manual: Moreover the secretion constant needs to have negative value if we want to secrete positive amount of substance - this weird requirements comes from the fact that we re using 3 rd party solver which inverts signs of the secretion constants.
Does inverting the sign for the secretion solve the problem for negative values?
Comment:
id: lopqp | creation_date: Dec. 28, 2017, 5:10 a.m. | author: Francisco Marques | type: Comment |
parent: nqpro | lastedit_date: Dec. 28, 2017, 5:10 a.m. | lastedit_user: Francisco Marques |
content:
Thank you for your suggestion! However, I believe that condition does not apply to my case. I am managing secretion in the XML file and, from what I understood from the Reference Manual, that specification refers only to secretion controlled in Python. In fact, the "SteadyStateDiffusionSolver" Demo that manages secretion in the XML file also has positive values for secretory cells.
Answer:
id: avrnl | creation_date: Dec. 30, 2017, 8:30 p.m. | author: Maciek Swat | type: Answer |
parent: klpbn | lastedit_date: Dec. 30, 2017, 8:30 p.m. | lastedit_user: Maciek Swat |
content:
Could you post a simplified version of your simulation?
Answer:
id: qvpma | creation_date: Dec. 31, 2017, 11:05 a.m. | author: Francisco Marques | type: Answer |
parent: klpbn | lastedit_date: Dec. 31, 2017, 11:05 a.m. | lastedit_user: Francisco Marques |
content:
This is the code I am using in my simplified version of the simulation (with only one cell in the centre of the lattice):
<Potts>
<Dimensions x="500" y="300" z="1"/>
<Steps>1000</Steps>
<Temperature>10.0</Temperature>
<NeighborOrder>2</NeighborOrder>
</Potts>
<Plugin Name="CellType">
<CellType Freeze="" TypeId="0" TypeName="Medium"/>
<CellType Freeze="" TypeId="1" TypeName="Produtor"/>
</Plugin>
<Steppable Type="SteadyStateDiffusionSolver2D">
<!-- Specification of PDE solvers -->
<DiffusionField Name="O2">
<DiffusionData>
<FieldName>O2</FieldName>
<DiffusionConstant>2500</DiffusionConstant>
<DecayConstant>0</DecayConstant>
</DiffusionData>
<SecretionData>
<Secretion Type="Produtor">1</Secretion>
</SecretionData>
<BoundaryConditions>
<Plane Axis="Y">
<ConstantDerivative PlanePosition="Max" Value="0.0"/>
<ConstantDerivative PlanePosition="Min" Value="0.0"/>
</Plane>
<Plane Axis="X">
<Periodic/>
</Plane>
</BoundaryConditions>
</DiffusionField>
</Steppable>
(Besides this portion, there's the PIF Initializer)
I am running tests with the Decay Constant as 0 or as 0.39.
When it is is 0, this is the result: Max = 0.0260 and Min = -0.0038
On the other hand, in the Matlab simulation (solving the equation with finite differences and applying Jacobi Method), this is the result: Max = 0.0258 and Min = 0
There are no negative values, although there is a small hole in the centre.
In the simulation with the Decay Constant as 0.39, both graphs have only positive values, but the shapes follow the same pattern as above (peak in CC3D vs cone in Matlab simulation) and the maximum values still differ.
My goal is to understand how the values entered in the XML file evolve during the simulation so that I can determine a realistic set of constants for my actual project.
Thank you!
attachments(redirected):
.\CC3D_allanswered_linked_files\Plot-2500-0-1.png
.\CC3D_allanswered_linked_files\Plot-2500-0-1.png
Answer:
id: remww | creation_date: Dec. 31, 2017, 5:03 p.m. | author: Maciek Swat | type: Answer |
parent: klpbn | lastedit_date: Dec. 31, 2017, 5:03 p.m. | lastedit_user: Maciek Swat |
content:
When you run Matlab code are you solving Helmholtz equation or are you solving the diffusion equation and run it for a long time to determine the steady state of the solution?
File attached: diffusion_steady_state_ext_potential.zip (7.37 KB)
I am attaching mine example that is very similar to yours. I noticed that that when decay constant is 0 the solver does get unstable. From what I remember with steady state solvers the decay constant had to be different than 0.0. So when I used decay constant of 0.4 the solution looks reasonable.
As a matter of fact the comments in the code for steady state solver state that when decay constant is 0.0 the solution may not exist:
/* elmbda */
/* the constant lambda in the helmholtz equation. if */
/* lambda .gt. 0, a solution may not exist. however, hwscrt will */
/* attempt to find a solution. */
I am also attaching original code of th steady state solver for 2D case. Take a look at the comment section in the biginning portion of the code (line 86 and on)
File attached: HWSCRT.c (81.7 KB)
So in summary , SteadyState solver is an approximation of the diffusion problem for large diffusion constants. There might be some numerical issues when lambda is very small compared to diffusion constants. As far as comparison with Matlab we have not done this. We benchmarked the code agains FEMLAB.
We would love to add more sophisticated PDE solver quite to CC3D at some point because Steady-State solvers are just an approximations and I wonder if the discrepancy you see between CC#D code and Matlab is because of the slightly different formulation of the problem (i.e. diffusion equation vs Helmholtz equation)
Let me know if this is helpful
attachments(redirected):
.\CC3D_allanswered_linked_files\diffusion_steady_state_ext_potential.zip
.\CC3D_allanswered_linked_files\HWSCRT.c
Comment:
id: omove | creation_date: Jan. 2, 2018, 10:43 a.m. | author: Francisco Marques | type: Comment |
parent: remww | lastedit_date: Jan. 2, 2018, 10:43 a.m. | lastedit_user: Francisco Marques |
content:
Thank you for your reply! It helped me to understand the problem better!
I see the difference between those two possibilities. I believe my tests rely on the second option: I am solving the equation D(d2u/dx2 + d2u/dy2) - k * u = F(x,y) for a long time to determine the steady state of the solution.
(it is the equation in the Reference Manual but with the Diffusion Constant in the Laplacian, as it did not converge otherwise).
Still, I have two questions:
- In the code of the original solver, it states that "if lambda greater than 0, a solution may not exist", right? (from what I found, ".gt." stands for "greater than") So, shouldn't it still work with lambda = 0? (isn't it Poisson's Equation?)
If lambda <= 0, I understand the equation in the CC3D Reference Manual:(d2u/dx2 + d2u/dy2) - k * u = F(x,y). The minus sign confused me because in every other source there was a plus sign. Now I realise that diffusion processes require a negative sign in the equation.
- Also, there's a difference in the lambda parameter. In many sources, it is squared (for instance 1, 2). However, as seen above, the k parameter in the equation of the Reference Manual (and in the solver comments) is not squared.
That is to say, regarding the meaning of this constant, that when I use 0.39 in my simulation, is it the square of the decay constant that I intend to use? And, therefore, I should input 0.39^2 instead, as it expects the squared value?
Thank you!
Q41: Can you set axis limits when adding plot windows from steppables.py?
id: pgpbo | creation_date: Dec. 28, 2017, 5:20 p.m. | author: Kim Kanigel Winner | type: Question |
parent: | lastedit_date: Dec. 30, 2017, 8:23 p.m. | lastedit_user: Maciek Swat |
content:
the python manual says that you can change some attributes of the plotting windows in the Player, such as log vs. linear axes; however, there doesn't seem to be a way to set axis limits? I tried _ylim(0,1000), but, no luck, and I thought I should stop fishing around and just ask.
Thanks!!!
Answer:
id: jrpvb | creation_date: Dec. 30, 2017, 8:23 p.m. | author: Maciek Swat | type: Answer |
parent: pgpbo | lastedit_date: Dec. 30, 2017, 8:23 p.m. | lastedit_user: Maciek Swat |
content:
Hi Kim, as of now this would be quite hard to accomplish from steppable level but we could add this option to the plotting API. We always assumed that plotting in CC3D provides just bare-bone tools but having the ability to specify axes limits should be added. I added a ticket on our github page
Q42: Week 1-Journal/Code Club- PKD Paper
id: avrel | creation_date: Jan. 4, 2018, 3:18 p.m. | author: Scott H | type: Note |
parent: avrel | lastedit_date: Jan. 5, 2018, 4:35 a.m. | lastedit_user: Yuan |
content:
Hey I wanted to do a weekly journal/code club on the PKD paper since Yuan also had questions on it, and it's the new year!
Week 1-
- Paper: Virtual-Tissue Computer Simulations Define the Roles of Cell Adhesion and Proliferation in the Onset of Kidney Cystic Disease
- Code
Discussion on Code/Basics-Focusing on Tubule code
- The code from the paper is split into 3 folders: IsoCyst, Measure, and tubule.
- Tubule- creates a kidney tubule with domains and sub cellular parts
- PKD.py- This imports models and is where you change and input parameters that feed to the Steppables
- Lines 1-8: Parameters of interest.
-
#PARAMETERS: cd=12 #Typical cell diameter Lx=10*cd #Size of lattice - x Ly=10*cd #Size of lattice - y Lz=15*cd #Size of lattice - z Trelax=400 #Time for cells to relax boundaries debugFreq=100
- These parameters are the cell diameter and lattice spacing. I believe they correspond to table S3, since this code is making preformed tubules.
- Line 10-13
-
#POTTS PARAMETERS: Temp=50 #Potts temperature Time=1+20000 #Total number of MCS NOrder=4 #NeighborOrder
- Temp or Tm is in the Potts formula Eq 2
-
- T is from the Ising model, which is physics based. More Tm means more interactions I believe, "To mimic cell motility the method iteratively attempts to move the interfaces between adjacent cells, depending on the amplitude of active membrane fluctuations (expressed as a “cellular temperature” [ μ(τ)) and on a force balance of the active forces the cells exert on their environment (e.g. due to chemotaxis or random motility) and the reactive adhesive, cohesive and cellular compression forces. " Source
- Norder is the number of voxel neighbors that contact energy is calculated over
- Similar to lines 15- 17
-
#CONTACT PARAMETERS: CNOrder=4 #Distance of interaction CINOrder=4 #Internal Distance of interaction
-
-
- Temp or Tm is in the Potts formula Eq 2
-
- Lines 19-20
-
#VOLUYME PARAMETERS LamV=4 #Lambda Volume targV=cd*cd*cd #Target Volume
- so target is the Vt parameter here in the volume constraint part of the GGH equation.
-
- Lines 31-37
-
#CONTACT INHIBITION: gFactor=0.8 #Growth factor hillCoef=20 #Hill coeficient critAlpha=0.35 #Critical alpha gFactorSick =gFactor hillCoefSick =hillCoef critAlphaSick=critAlpha
- See the cell contact fraction, under contact inhibition, in the paper for the parameters, and table S4.
- here K= gfactor which is the max growth rate of the cells (only 1 cell type in this model with 3 sub cellular compartments),ac=critAlpha which is the critical fractional area of cell-cell contact for growth inhibition , n=hillCoefSick. I don't know why critAlphSick and critAlpha are defined separately. The "Sick" is a cell type?
-
- Lines 39-41
-
#LUMEN GROWTH: Kl=1 ApArea=6.*cd*cd*.2 # ApArea=1/Kr
- Lumen growth, which the tubule module creates in the other stoppable code. Table s2 has info. The growth rate is in volume/time, so voxel/mcs or um3/min. This could be a way to relate experimental results to simulation results. I think they use this paper from Engelberg as a start for the lumen growth rates (I am trying to figure out which reference Engelberg uses in turn for lumen growth rates).
-
- PKDSteppables.py
attachments(redirected):
.\CC3D_allanswered_linked_files\Screen Shot 2018-01-04 at 2.48.31 PM.png
.\CC3D_allanswered_linked_files\Screen Shot 2018-01-04 at 2.59.37 PM.png
Comment:
id: jrpbz | creation_date: Jan. 5, 2018, 4:35 a.m. | author: Yuan | type: Comment |
parent: avrel | lastedit_date: Jan. 5, 2018, 4:35 a.m. | lastedit_user: Yuan |
content:
Good job! I have benefited a lot especially for the source of the reference.
Q43: Editing the chemotaxis plugin
id: nqmqa | creation_date: Jan. 7, 2018, 11:05 a.m. | author: Tarqwin | type: Question |
parent: | lastedit_date: Jan. 12, 2018, 3:47 a.m. | lastedit_user: Tarqwin |
content:
I recently read an article which described how cell were first attracted to a chemoattractant, but were later repulsed by the same chemoattractant if the gradient of the field was too steep.
It seemed to me that this could be easily modeled by adding an if-statement in the chemotaxis plugin, which would make the lambda in the chemotaxis module negative if the gradient was steep enough.
But the xml language doesn't use if-statements and I have trouble finding out how to edit the python code of the chemotaxis plugin.
Does anyone know how to edit the chemotaxis plugin or if there is another way of first attracting and then repulsing cells?
Answer:
id: pgenw | creation_date: Jan. 8, 2018, 6:09 p.m. | author: James Sluka | type: Answer |
parent: nqmqa | lastedit_date: Jan. 8, 2018, 6:27 p.m. | lastedit_user: James Sluka |
content:
I don't think editing the plugin is the way to go.
Instead, I would make two cell types, one that chemotaxes up the gradient and another that chemotaxis down the gradient. When the gradient exceeds a limit you switch from one cell type to another. Attached is a quick CC3D project with a fixed cell that is the source of a gradient ("hormone") and a moving cell that switches between going up and down the gradient based on the steepness of the gradient. To calculate the gradient I used the difference between the minimum and maximum gradient values along the moving cell's perimeter. (There might be a more efficient way to do this.) If the gradient is above a threshold the cell switches to going down the gradient, when the gradient is below a threshold the cell switches to going up the gradient. (I takes a while before the cell starts to move since the field has to build up.)
You could also switch the direction based on the field value at (for example) the center of the cell, instead of the field gradient across the cell as I did here.
File attached: InvertChemoract.zip (10.01 KB)
File attached: InvertChemotract.mov (296.64 KB)
Left: Colored by cell type, green is moving up the gradient and blue is moving down the gradient. Right: The "hormone" field created by the fixed cell in the upper right corner. Click the attached .mov to see the animation.
attachments(redirected):
.\CC3D_allanswered_linked_files\InvertChemoract.zip
.\CC3D_allanswered_linked_files\output_movie.png
.\CC3D_allanswered_linked_files\InvertChemotract.mov
.\CC3D_allanswered_linked_files\InvertChemotract.mov
Comment:
id: eqnwj | creation_date: Jan. 12, 2018, 3:47 a.m. | author: Tarqwin | type: Comment |
parent: pgenw | lastedit_date: Jan. 12, 2018, 3:47 a.m. | lastedit_user: Tarqwin |
content:
Thank you very much for your answer!
I will look into it.
Q44: Smooth Surface of a Cell
id: zpjxp | creation_date: Jan. 8, 2018, 1:57 a.m. | author: Thorsten Mueller | type: Question |
parent: | lastedit_date: Jan. 10, 2018, 3:57 a.m. | lastedit_user: Thorsten Mueller |
content:
Hi,
I'm trying do create a 3D morphogenesis Simulation of the urothelium. I'm draw more or less spehrish cells like this:
for xr in range(xStart, xEnd):
for yr in range(yStart, yEnd):
for zr in range(zStart, zEnd):
rd = sqrt((xr - x0) ** 2 + (yr - y0) ** 2 + (zr - z0) ** 2)
if (rd <= radiusPx):
steppable.cellField[xr, yr, zr] = cell
With this function I'm able to get some sperish cells, but without a smooth surface (see first picture).
Furthermore, during the growth of a cell, they have sometimes pixels outside of the cell (see second picture). I place the cells just somewhere in the lattice, in the second picture, to see more details of the growth process.
Since, I want to create sperish cells I use formulas of a sphere to calculate the TargetVolume and the TargetSurface (the TargetSurface is doubled, so that the cell will growth). I use the following lambda values: LambdaVolume = 1.0 and LambdaSurface = 2.0
Do you know any tips or tricks about how to get a smooth surface on a cell?
Thank you
attachments(redirected):
.\CC3D_allanswered_linked_files\points outside of a cell.png
.\CC3D_allanswered_linked_files\Screenshot at 2018-01-08 07-56-38.png
Answer:
id: jragz | creation_date: Jan. 8, 2018, 12:33 p.m. | author: James Sluka | type: Answer |
parent: zpjxp | lastedit_date: Jan. 8, 2018, 12:33 p.m. | lastedit_user: James Sluka |
content:
A couple suggestions;
* In the Potts section, set the NeighborOrder to 5 to reduce pinning to the lattice.
* The rough surface of the cells is probably caused by the targetSurface being 2X bigger than it should be for the current cell target volume. Try increasing both the target surface and target volume properly for the increasing radius. (Or, if you are changing the volume, recalculate the surface every time.) Instead of setting the targetSurface much too big simply reduce the lambdaSurface significantly.
if cell.targetVolume <= cell.volume:
cell.targetVolume += 1
radius = (3./4./3.14159*cell.targetVolume)**(1./3.)
cell.targetSurface = 4.*3.14159*radius**2 * 1.1 # 10% extra surface
Comment:
id: ggzbx | creation_date: Jan. 9, 2018, 5:28 a.m. | author: Thorsten Mueller | type: Comment |
parent: jragz | lastedit_date: Jan. 9, 2018, 5:28 a.m. | lastedit_user: Thorsten Mueller |
content:
Thanks,
the drawn cells look way better.
Since it is not possible to provide another picture in the comment I use the answer function to show them!
Answer:
id: vngeq | creation_date: Jan. 9, 2018, 5:29 a.m. | author: Thorsten Mueller | type: Answer |
parent: zpjxp | lastedit_date: Jan. 9, 2018, 5:29 a.m. | lastedit_user: Thorsten Mueller |
content:
One problem I still have is that during the simulation become cubic again. I just checked the volume - TargetVolume and the surface - TargetSurface values and saw that the Surface is way to large regarding the volume value (see second picture, at the console the line at the cursor position).
Every MCS the TargetVolume and the TargetSurface, regarding TargetVolume, are calculated, with the provided formula.
I tried to simulate with LambdaVolume=1.0 and LambdaSurface=0.2 and 0.05 (the pictures are of the second simulation with LambdaSurface=0.05).
Since there is no way to set the surface value of a cell, are there other possibilities to influence these values of a cell than to calculate the TargetSurface and set the LambdaSurface? Where could those large surface values come from?
attachments(redirected):
.\CC3D_allanswered_linked_files\Screenshot at 2018-01-09 11-02-48.png
.\CC3D_allanswered_linked_files\Screenshot at 2018-01-09 11-03-49.png
Answer:
id: wljee | creation_date: Jan. 9, 2018, 2:16 p.m. | author: James Sluka | type: Answer |
parent: zpjxp | lastedit_date: Jan. 9, 2018, 2:16 p.m. | lastedit_user: James Sluka |
content:
It might be due to your adhesion energies. For example, if the cell's surface is at the target surface value and then the cell grows by a pixel (or voxel) then you often add 2 (in 2D, 4 in 3D) to the surface and that number of values of the cell to medium adhesion. So adhesion energy will play into the surface and volume behavior of a cell.
Another thing that makes getting spherical cells tricky is that the surface on a square lattice is always greater than for a real sphere. You need to have a somewhat larger targetSurface than the simple volume vs. surface equations for a sphere.
One thing you might consider is doing a parameter scan to find the set of parameters that works best for your size cells. I would scan targetVolume, lambdaVolume, LamdaSurface, the adhesion j values and a parameter/function that converts targetVolume into a suitable targetSurface, perhaps also the Potts temperature.
Comment:
id: xnjlj | creation_date: Jan. 10, 2018, 3:57 a.m. | author: Thorsten Mueller | type: Comment |
parent: wljee | lastedit_date: Jan. 10, 2018, 3:57 a.m. | lastedit_user: Thorsten Mueller |
content:
Thanks, these are valuable facts.
Your right with the second point. I have to find a value where the TargetSurface of cell is not too larger, as it was with the initial problem, and not too small.
I tried different adhesion values but in a range of 0 to 50, for every adhesionValue in the energy Matrix it did not change the behavior of the cells, as they still become cubes sooner or later.
I wonder how the initial Volume and Surface is calculated:
The cells are drawn with a radius of 4px:
Therefore the Volume of the cube around the cell is 512vx3 and the surface are 384vx2
Whereas the Volume of the drawn sphere should be 268vx3 and the surface 201vx2
CC3D calculates a Volume of around 255(vx3 - should be the right unit) and a surface of around 283vx2 -> The given values vary a bit with +-2
Why can the given surface value already be larger than the volume? Moreover the surface value is not near the surface value of the cubic neither the surface, how does this happen?
Q45: How to specify the values of the parameters in GGH model?
id: mbpxj | creation_date: Dec. 27, 2017, 10:26 p.m. | author: Yuan | type: Question |
parent: | lastedit_date: Jan. 9, 2018, 2:30 p.m. | lastedit_user: James Sluka |
content:
Dear all, there are some puzzles for GGH model.
1. How to specify the values of parameters in the model? For example, adhesion energy J, elastic constants K. Can I set them according to the experiments? How to realize?
2. As for the time, the Monto Carol Step(MCS) is determined by the real-time. However, the values of the parameters in simulation based on the relationship of MCS and real-time and the values have an impact on the total MCSs, i.e. they are coupled. How to solve this?
3. How to specify the relative values of the parameters?
Thank you~
Answer:
id: klpbw | creation_date: Dec. 28, 2017, 10:01 a.m. | author: d g | type: Answer |
parent: mbpxj | lastedit_date: Dec. 28, 2017, 10:01 a.m. | lastedit_user: d g |
content:
Hi Yuan,
If I understand the question correctly, the way I map MCS to real time is to look at the average square displacement of cells in experiments and simulations and then use this to directly map MCS to real time.
Mapping adhesion energy to experiments is more complicated, unless you can extract real values or find values in literature, it is very difficult, one possible way is to use ratios depending on the minimization or maximization of cell boundary interfaces, i.e if two cells in a non confluent environment in contact increase their shared contact area they more adhesive than cells that decrease their contact area.
best,
Daniel
Comment:
id: vnbqz | creation_date: Jan. 1, 2018, 9:12 a.m. | author: Yuan | type: Comment |
parent: klpbw | lastedit_date: Jan. 1, 2018, 9:12 a.m. | lastedit_user: Yuan |
content:
Hi Daniel,
Thanks for your answer. I still have two questions:
1. The MCS and real-time relationship can only be obtained after the simulation and experiment?
2. How to specify the relative size of the parameters?
Thank you~
Yuan
Answer:
id: eqnxz | creation_date: Jan. 9, 2018, 2:30 p.m. | author: James Sluka | type: Answer |
parent: mbpxj | lastedit_date: Jan. 9, 2018, 2:30 p.m. | lastedit_user: James Sluka |
content:
The mcs to time relationship can often be determined simply by inspecting your problem. How fast do things happen? Are cells moving and/or dividing? How long does it take to move or divide? You mcs to time relationship is typically set so that an mcs represents a small portion of your time domain. If it takes 2 hours for a cell to divide then a 1 second/mcs time scale might be OK since that means there are 7200 mcs over the course of the process, which is likely to be sufficient.
Alternatively, you can scan the mcs to time relationship. Compare the results of simulations with 1 mcs= 1 hour, 1 minute, 1 second, 1 millisecond, ... Usually there will be a range of time scales where the simulation output changes with the time scale and another range of time scales where the output doesn't change. You want your simulation to be running in the time step size independent domain.
Q46: Week 2- Journal/Code Club- PKD Paper
id: pgerx | creation_date: Jan. 11, 2018, 3:41 p.m. | author: Scott H | type: Note |
parent: pgerx | lastedit_date: Jan. 11, 2018, 3:41 p.m. | lastedit_user: Scott H |
content:
Week 2-
Paper: Virtual-Tissue Computer Simulations Define the Roles of Cell Adhesion and Proliferation in the Onset of Kidney Cystic Disease
Code- http://www.compucell3d.org/Models
Discussion on Code/Basics-Focusing on Tubule code
The code from the paper is split into 3 folders: IsoCyst, Measure, and tubule.
- Tubule- creates a kidney tubule with domains and sub cellular parts
- PKD.py- This imports models and is where you change and input parameters that feed to the Steppables
- Continuing from Line 42
-
def configureSimulation(sim,Lx,Ly,Lz,Temp,Time,NOrder,CNOrder,CINOrder,debugFreq):
- This defines the class configureSimulation. This class is used to import XML type info and parameters for the model. It is called called later in the same script on line 169, see below:
-
configureSimulation(sim,Lx,Ly,Lz,Temp,Time,NOrder,CNOrder,CINOrder,debugFreq))
-
- This defines the class configureSimulation. This class is used to import XML type info and parameters for the model. It is called called later in the same script on line 169, see below:
- Lines 44-45
-
import CompuCellSetup from XMLUtils import ElementCC3D
- This imports the utilities so the XML import can work
-
- Line 47
-
CompuCell3DElement=ElementCC3D("CompuCell3D",{"Version":"3.7.3"})
- This creates a CC3D element or a CC3D kernel, which is the way you do XML import. Specifically, it creates a top level element, or a root element, using the function Elementcc3d() from XMLUtils. See chapter 17 of the 3.7.6 version of Python Scripting manual
-
- Lines 49-55
-
#POTTS CONDITIONS potts=CompuCell3DElement.ElementCC3D("Potts") potts.ElementCC3D("Dimensions",{"x":Lx,"y":Ly,"z":Lz}) potts.ElementCC3D("Temperature",{},Temp) potts.ElementCC3D("Steps",{},Time) potts.ElementCC3D("NeighborOrder",{},NOrder) potts.ElementCC3D("DebugOutputFrequency",{},debugFreq) #Setting periodic boundary conditions to all directions potts.ElementCC3D("Boundary_x",{},"Periodic") potts.ElementCC3D("Boundary_y",{},"Periodic") potts.ElementCC3D("Boundary_z",{},"Periodic")
- These lines import XML to the CC3D kernel created before. Specifically, Line 47 created a high level element, and now we are attaching child elements to it (here it is the Potts child element). Potts itself has child elements, so we attach child elements to Potts element
-
- Lines 62-70
-
#CELL TYPES -> Lumen, Cyto, Apical, Basal, Lateral1, Lumen and Lateral2 cellType=CompuCell3DElement.ElementCC3D("Plugin",{"Name":"CellType"}) cellType.ElementCC3D("CellType",{"TypeName":"Medium","TypeId":0}) cellType.ElementCC3D("CellType",{"TypeName":"Cyto","TypeId":1}) cellType.ElementCC3D("CellType",{"TypeName":"Apical","TypeId":2}) cellType.ElementCC3D("CellType",{"TypeName":"Basal","TypeId":3}) cellType.ElementCC3D("CellType",{"TypeName":"Lateral","TypeId":4}) cellType.ElementCC3D("CellType",{"TypeName":"Lumen","TypeId":5}) cellType.ElementCC3D("CellType",{"TypeName":"Lateral2","TypeId":6})
- We are importing more XML. Here it is the Celltype plugin. I am trying to figure out what the two Lateral cell types are for.
-
- PKD.py- This imports models and is where you change and input parameters that feed to the Steppables
Q47: Cell compression by plates.
id: zpjzb | creation_date: Jan. 15, 2018, 4:25 a.m. | author: Yuan | type: Question |
parent: | lastedit_date: Jan. 18, 2018, 4:35 p.m. | lastedit_user: James Sluka |
content:
Dear all,
I am trying to reproduce the process of cell compression, as shown below(picture and PP110 in PDF). There is only one big cell for simplicity. An energy term $E=\frac{1}{2}k\left(z-z_0\right)^2$E=12 k(z−z0)2 is introduced to represent the effect of the plates. $z$z is the vertical position, $z_0$z0 the 0 energy position of the plate interface and $k$k the stiffness of plate.
I manipulate the energy term in python referring to the manual,
https://cc3dadvancedtuts.wordpress.com/2015/08/01/manipulating-the-energy-term-for-a-pixel-flip-attempt-in-python/
I am meeting some difficulties in realizing the algorithm.
First, the vertical position $z$z is obtained by calculating the average value of the outmost layer pixels of the plates. I try to use the boundary tracker plugin, but I am not sure whether it can be used in the python plugin.
What's more, the changed energy is $\bigtriangleup E=\frac{1}{2}k\left(z_{n+1}-z_0\right)^2-\frac{1}{2}k\left(z_n-z_0\right)^2=k\left(\frac{z_{n+1}+z_n}{2}-z_0\right)\left(z_{n+1}-z_n\right)$△E=12 k(zn+1−z0)2−12 k(zn−z0)2=k(zn+1+zn2 −z0)(zn+1−zn) . It seems that the changed energy is related to the vertical position before and after the pixel flip. How to realize it ?
I have a try and the outcome seems not positive, the imperfect model is attached.
Thank you!
Yuan
File attached: version_finale.pdf (6.24 MB)
File attached: compressionCell.rar (10.01 KB)
attachments(redirected):
.\CC3D_allanswered_linked_files\QQ截图20180115161521.png
.\CC3D_allanswered_linked_files\compressionCell.rar
.\CC3D_allanswered_linked_files\version_finale.pdf
Answer:
id: loaal | creation_date: Jan. 16, 2018, 1:59 p.m. | author: James Sluka | type: Answer |
parent: zpjzb | lastedit_date: Jan. 16, 2018, 1:59 p.m. | lastedit_user: James Sluka |
content:
In the figure (labeled 5.7) it doesn't appear that the plates are deformed, only the cell deforms. Do you really want the plates to deform or just the cell?
Looking at your CC3D, there are a couple things if you want the plates to be deformable;
1. You need to define the plates as cells with target volumes and probably target surfaces.
2. When you move the plates (or enlarge the plates) you need to run enough MCS to let the system relax between movements.
If you really want deformable plates you might be able to implement a finite element mesh in CC3D for the plates. The plates would be a set of small cells coupled by springs to their neighbors using focal point plasticity links.
Comment:
id: reoom | creation_date: Jan. 16, 2018, 11:51 p.m. | author: Yuan | type: Comment |
parent: loaal | lastedit_date: Jan. 16, 2018, 11:51 p.m. | lastedit_user: Yuan |
content:
Actually,in the figure the deformation is small, but I think it's okay to neglect the deformation of plates since they are much stiffer than cells.
My question is, are there other methods to move the plates as rigid bodies?
Comment:
id: bepvz | creation_date: Jan. 18, 2018, 4:33 p.m. | author: James Sluka | type: Comment |
parent: reoom | lastedit_date: Jan. 18, 2018, 4:35 p.m. | lastedit_user: James Sluka |
content:
You can define the plates as fixed cells then add a row of pixels to those fixed cells in python, then relax the system for some number of MCS, then add another row of pixels, ...
In twedit++ use the shortcut at;
CC3D Python -- Visit -- All Lattice Pixels
for how to access all the lattices pixels
You can assign a particular pixel to a cell ("cellA") with;
pt.x=4; pt.y=6; pt.z=0
self.cellField.set(pt,cellA)
or
self.cellField.set((x,y,z),cellA)
The pixels might have been medium or your cell being squashed. That is why you'll need to run some number of MCS to relax things once you've enlarged the wall.
Q48: Periodic boundary condition for a hexagon
id: avprg | creation_date: Jan. 16, 2018, 3:41 a.m. | author: Yuan | type: Question |
parent: | lastedit_date: Jan. 19, 2018, 4:15 a.m. | lastedit_user: Yuan |
content:
Dear all,
In a CPM simulation of Drosophila retina cells, the authors apply a periodic boundary condition for hexagons. As shown below, the cells marked with the same symbol are treated as part of the same cell. Can I realize this using CC3D? Thank you!
Best,
Yuan
attachments(redirected):
.\CC3D_allanswered_linked_files\QQ截图20180116163449.png
Answer:
id: qvljn | creation_date: Jan. 18, 2018, 4:44 p.m. | author: James Sluka | type: Answer |
parent: avprg | lastedit_date: Jan. 18, 2018, 4:44 p.m. | lastedit_user: James Sluka |
content:
I believe CC3D will only do periodic boundaries on a rectangular bounding box.
Comment:
id: jraol | creation_date: Jan. 19, 2018, 4:15 a.m. | author: Yuan | type: Comment |
parent: qvljn | lastedit_date: Jan. 19, 2018, 4:15 a.m. | lastedit_user: Yuan |
content:
So, is it convenient to make changes in the source code or do I have to program by myself?
Q49: Some puzzles on concepts.
id: xnjjg | creation_date: Jan. 16, 2018, 10:12 p.m. | author: Yuan | type: Question |
parent: | lastedit_date: Jan. 24, 2018, 12:25 a.m. | lastedit_user: Maciek Swat |
content:
Dear all,
I meet some puzzles on some concepts in different papers.
1. the "source"(expanding) cell and "destination" (being overwritten) cell in CPM described in the reference manual and the pixel-copy-source and pixel-copy-destination pixel.
Are the positions of source and destination opposite for cells and pixels? That's to say, the pixel-copy-source pixel belongs to the "destination"(old) cell and the pixel-copy-destination pixel belongs to the "source"(new) cell? For pixels, do the "source" and "destination" in the manual have the same meaning of the "source" and "target" in the following color picture from other paper?
Thank you~
Yuan
attachments(redirected):
.\CC3D_allanswered_linked_files\图片1.png
.\CC3D_allanswered_linked_files\QQ截图20180117105653.png
.\CC3D_allanswered_linked_files\QQ截图20180117105623.png
.\CC3D_allanswered_linked_files\QQ截图20180117105623.png
.\CC3D_allanswered_linked_files\QQ截图20180117111049.png
Answer:
id: ggmzb | creation_date: Jan. 23, 2018, 9:22 p.m. | author: Maciek Swat | type: Answer |
parent: xnjjg | lastedit_date: Jan. 23, 2018, 9:22 p.m. | lastedit_user: Maciek Swat |
content:
Actually this is the correct way of associating source destination old and new:
the pixel-copy-source pixel belongs to the "source"(new) cell and the pixel-copy-destination pixel belongs to the "destination"(old) cell?
Q: For pixels, do the "source" and "destination" in the manual have the same meaning of the "source" and "target" in the following color picture from other paper?
A: It appears that the answer is no. To me source is the pixel of that belongs to a cell (new cell) that will try to overwrite destination (old cell) . This is how things are coded in CC3D
Does this make sense?
Comment:
id: klbaj | creation_date: Jan. 23, 2018, 11:36 p.m. | author: Yuan | type: Comment |
parent: ggmzb | lastedit_date: Jan. 23, 2018, 11:52 p.m. | lastedit_user: Yuan |
content:
Yeah, I see. There are some differences though both of them are CPM models. Besides, is there a manual explaining the implementation of the CC3D code?
Answer:
id: avbpk | creation_date: Jan. 24, 2018, 12:25 a.m. | author: Maciek Swat | type: Answer |
parent: xnjjg | lastedit_date: Jan. 24, 2018, 12:25 a.m. | lastedit_user: Maciek Swat |
content:
Yes, it is for older version 3.4.1, however. Still the core concepts are there and architecture of plugins and steppables has not changed much - in particular w.r.t what is new(source ) cell and what is old(destination) cell
http://www.compucell3d.org/BinDoc/cc3d_binaries/Manuals/Developers_Documentation_v3.4.1.pdf
Take a look at it
Q50: Parameter scan for parameters in a python file
id: wljbo | creation_date: Jan. 18, 2018, 3:22 p.m. | author: Mahua Roy | type: Question |
parent: | lastedit_date: Jan. 18, 2018, 5:17 p.m. | lastedit_user: Mahua Roy |
content:
I would like to run parameter scan from parameters listed in the .py file of the Main Python Script. However, I am unable to open the editor when I click on the parameters to be changed. I guess then I will have to input it manually in the xml file. I would highly appreciate if I can avail a template for the same.
Answer:
id: eqnaq | creation_date: Jan. 18, 2018, 4:22 p.m. | author: James Sluka | type: Answer |
parent: wljbo | lastedit_date: Jan. 18, 2018, 4:22 p.m. | lastedit_user: James Sluka |
content:
Can you move the parameters into your steppables python file instead of your main python file? The parameter scan is, I believe, specific to regular python files and to the CC3D XML file.
See also: http://pythonscriptingmanual.readthedocs.io/en/latest/parameter_scans.html
Comment:
id: loaxk | creation_date: Jan. 18, 2018, 4:24 p.m. | author: Mahua Roy | type: Comment |
parent: eqnaq | lastedit_date: Jan. 18, 2018, 4:24 p.m. | lastedit_user: Mahua Roy |
content:
Do I have to make them global as well as mentioned here?
from PySteppables import *
import CompuCell
import sys
MYVAR = 10
MYVAR1 = 'new str'
class CellSortingSteppable(SteppableBasePy):
def __init__(self, _simulator, _frequency=1):
SteppableBasePy.__init__(self, _simulator, _frequency)
def step(self, mcs):
global MYVAR
print 'MYVAR=', MYVAR
for cell in self.cellList:
if cell.type == self.DARK:
cell.lambdaVecX = -0.5
Answer:
id: xnjqe | creation_date: Jan. 18, 2018, 4:51 p.m. | author: James Sluka | type: Answer |
parent: wljbo | lastedit_date: Jan. 18, 2018, 4:51 p.m. | lastedit_user: James Sluka |
content:
I believe they need to be in the top level namespace (hence "global"). In the little demo snippet the "global MYVAR" line isn't needed if the CellSortingSteppable class is only reading, and not writing, the variable. All of your classes will have direct access to any variable defined outside the classes.
You can first try it without making the variables global (e.g., a variable in a class), it might work.
Q51: Order of parameters in parameter scan
id: vnglb | creation_date: Jan. 18, 2018, 7:22 p.m. | author: Mahua Roy | type: Question |
parent: | lastedit_date: Jan. 19, 2018, 1:59 p.m. | lastedit_user: James Sluka |
content:
I am confused about what is the order in the which the parameters are chosen from the list of parameter scan. Are all parameters varied at the same time randomly or is there a sequence for the variation. I have 8 parameters to be varied and I chose 5 values for each. If I am thinking right, I should get 0 , 1 , 2, 3 ,4 and 5 directories in the output folder. However, how would I be able to know the results correspond to which values of parameters ?
Answer:
id: qvlrn | creation_date: Jan. 19, 2018, 1:59 p.m. | author: James Sluka | type: Answer |
parent: vnglb | lastedit_date: Jan. 19, 2018, 1:59 p.m. | lastedit_user: James Sluka |
content:
The parameter scan task exhaustively enumerates all possible combination of your parameters. 8 parameters with 5 values each is equivalent to an 8-digit base 5 number so there are 5^8=390,625 simulations. If it takes 10 minutes per simulation, then it will take 2,712 days to do them all. As you can see, parameter scanning can rapidly spin up into an intractable number of simulations.
The order of simulation is the same as outlined in the scan xml file. If you have 3 parameters (A,B,C) and are doing 2 values (1,2) each, the sequence (top to bottom in the xml file) will be;
A1B1C1
A2B1C1
A1B2C1
A2B2C1
A1B1C2
A2B1C2
A1B2C2
A2B2C2
And there are 2^3=8 total simulations.
CC3D doesn’t do anything in particular to help you tract the results. All the output files are created, and each set is in its own numbered directory. You can examine each of the directories and see what values were used and what the results are but that isn’t very easy.
A better approach is to add code to your model to log all the simulation results into a single output file. You would log the parameters used for a particular run along with one or more results. Can you define a few numeric metrics for a simulation? Perhaps the number of cells at the end of the run, or the number of cells that died during the run. Or, if you are fitting experimental data, a residual error or chi-squared type metric describing how well the particular run reproduced the experimental data. To actually log that data, and preferable to have all the simulation log into the same file, you can add code to a “finish” block of one of your steppables to write the file at the end of the run. Below is sample code to give you an idea how to do it.
def finish(self): # part of one of your python steppables
# Finish Function gets called after the last MCS
#
# Write a small summary of parameter scanning to a file.
# Since we want all the simulaltions writing to the same file we
# need it in an obvious and unambigous place. Here we assume we can just write
# to the Windows’ root directory of c:\
# Buld up a tab-delimited stirng with the scan paramters actually used in this run plus
# some measures of the simulation’s results
# myParam1,myParam2, ... are the variables being scanned and are probably global
# myOutput are the result of some calculation, the number of cells, whatever you want to log
outLine = str(myParam1)+"\t"+str(myParam2)+"\t"
outLine += str(myParam3)+"\t"+str(myParam4)+"\t"
outLine += str(myOutput1)+"\t"+str(myOutput1) # add as many items as you need
outline += "\n" # need a trailing line break!
#open a file for append, write the string and close the file
logfile = open(“C:\\ParmaterScan_log”,'a+') # the ‘a+’ means create if it doesn’t exist,
logfile.write(outLine) # append to it otherwise
logfile.close()
I’ll leave it to the reader to figure out how to include on the output line the simulation number, that is, the name (which is a number) of the directly where the output corresponding to this particular line in the logfile is stored. You might be able to use the Twedit++ shortcut to get the name of the output directory and just include that on the log file line.
CC3D Python – Python Utilities – Get Full Path of Current File
Q52: Linear Gradient
id: wlaln | creation_date: Jan. 21, 2018, 12:08 p.m. | author: Tarqwin | type: Question |
parent: | lastedit_date: Feb. 22, 2018, 3:26 p.m. | lastedit_user: Kim Kanigel Winner |
content:
I was wondering if there is any way to create a linear gradient for chemotaxis.
So far I have tried using a second cell type to secrete a chemoattractant and I managed to make the edges of the window secrete by giving the boundary conditions in the diffusion solver steppable code a value.
But this produces a gradient which is steeper at the sides than in the middle
.
Does anyone know a way to make the gradient linear?
attachments(redirected):
.\CC3D_allanswered_linked_files\Gradient.png
Comment:
id: klbgm | creation_date: Jan. 21, 2018, 2:05 p.m. | author: Kim Kanigel Winner | type: Comment |
parent: wlaln | lastedit_date: Jan. 21, 2018, 2:06 p.m. | lastedit_user: Kim Kanigel Winner |
content:
Hi Tarqwin! You should be able to do this by making the boundary conditions not constant, but a zero derivative (zero change at each point along the boundary, so each pixel-length of boundary will stay at the same value as the pixel next to it). The code below is the chunk for a complete field inside of your diffusion solver of choice (I am using DiffusionSolverFE). The constant boundaries portion is commented out. I assume you will not need the z-dimension boundaries, either....
Hope this works for you!
<DiffusionField Name='Chemical'>
<DoNotScaleSecretion/>
<DiffusionData>
<GlobalDiffusionConstant>1.0</GlobalDiffusionConstant>
<GlobalDecayConstant>0</GlobalDecayConstant>
</DiffusionData>
<SecretionData>
<ConstantConcentration Type="Cell">0.0</ConstantConcentration>
</SecretionData>
<BoundaryConditions>
<!-- CONSTANT BOUNDARIES -->
<!-- <Plane Axis="X"> -->
<!-- <ConstantValue PlanePosition="Min" Value="0"/> -->
<!-- <ConstantValue PlanePosition="Max" Value="0"/> -->
<!-- </Plane> -->
<!-- <Plane Axis="Y"> -->
<!-- <ConstantValue PlanePosition="Min" Value="0"/> -->
<!-- <ConstantValue PlanePosition="Max" Value="0"/> -->
<!-- </Plane> -->
<!-- <Plane Axis="Z"> -->
<!-- <ConstantValue PlanePosition="Min" Value="0"/> -->
<!-- <ConstantValue PlanePosition="Max" Value="0"/> -->
<!-- </Plane> -->
<!-- <Plane Axis="X"> ></Plane> <Plane Axis="Y"><Periodic/> </Plane> -->
<!-- CONSTANT DERIVATIVE BOUNDARIES -->
<Plane Axis="X">
<ConstantDerivative PlanePosition="Min" Value="0"/>
<ConstantDerivative PlanePosition="Max" Value="0"/>
</Plane>
<Plane Axis="Y">
<ConstantDerivative PlanePosition="Min" Value="0"/>
<ConstantDerivative PlanePosition="Max" Value="0"/>
</Plane>
<Plane Axis="Z">
<ConstantDerivative PlanePosition="Min" Value="0"/>
<ConstantDerivative PlanePosition="Max" Value="0"/>
</Plane>
</BoundaryConditions>
</DiffusionField>
Answer:
id: loqjb | creation_date: Jan. 22, 2018, 12:29 p.m. | author: James Glazier | type: Answer |
parent: wlaln | lastedit_date: Jan. 22, 2018, 12:29 p.m. | lastedit_user: James Glazier |
content:
Do you want a static chemical gradient or a changing one? If you want a static gradient, you can set the initial condition to be, e.g. x* constant, and then set the diffusion constant and decay constants to zero.
e.g.
<Steppable Type="DiffusionSolverFE">
<DiffusionField Name="Oxygen">
<DiffusionData>
<FieldName>Oxygen</FieldName>
<DiffusionConstant>0.0</DiffusionConstant>
<DecayConstant>0.0</DecayConstant>
<InitialConcentrationExpression>x*CONSTANT</InitialConcentrationExpression>
</DiffusionData>
</DiffusionField>
</Steppable>
If you don't want the gradient to be static, because you will do something else to it later, you can use fixed boundary conditions along the X=0 and x=x_max edges and periodic boundaries along the other sides.
<Steppable Type="DiffusionSolverFE">
<DiffusionField Name="Oxygen">
<DiffusionData>
<FieldName>Oxygen</FieldName>
<DiffusionConstant>5.0</DiffusionConstant>
<DecayConstant>0.001</DecayConstant>
<InitialConcentrationExpression>x*10/x_dim</InitialConcentrationExpression>
</DiffusionData>
<BoundaryConditions>
<Plane Axis="Y">
<ConstantValue PlanePosition="Min" Value="0.0"/>
<ConstantValue PlanePosition="Max" Value="10.0"/>
</Plane>
<Plane Axis="X">
<Periodic/>
</Plane>
</BoundaryConditions>
</DiffusionField>
</Steppable>
I don't have CC3D running on this computer, so check that I haven;'t reversed X and Y!
Comment:
id: renor | creation_date: Jan. 23, 2018, 9:17 p.m. | author: Maciek Swat | type: Comment |
parent: loqjb | lastedit_date: Jan. 23, 2018, 9:17 p.m. | lastedit_user: Maciek Swat |
content:
This is the way to do it. You may also set concentration directly in Python but the solution that James presented should do the trick
Comment:
id: qvjpe | creation_date: Feb. 22, 2018, 2:03 p.m. | author: Scott H | type: Comment |
parent: renor | lastedit_date: Feb. 22, 2018, 2:03 p.m. | lastedit_user: Scott H |
content:
Can you specify a gradient in specific regions on a lattice? For example, paper-discs with antibiotic on a petri dish? I imagine it would involve specifying boundary conditions in specific regions.
Answer:
id: xnqjb | creation_date: Feb. 22, 2018, 2:32 p.m. | author: Kim Kanigel Winner | type: Answer |
parent: wlaln | lastedit_date: Feb. 22, 2018, 3:13 p.m. | lastedit_user: Kim Kanigel Winner |
content:
I would add it as a new cell type and then add a diffusing chemical to that cell type. You would initialize your "disc" cell, perhaps with BlobInitializer. Then, assuming reduction in the available antibiotic diffusing from the disc is negligible compared to the length of the simulation, you would set a constant concentration of "antibiotic" for your "disc" cell type in your diffusion solver above. No need to change boundary conditions from what James said above (sorry I missed putting in the constant boundary for your previous question).
Comment:
id: loxaz | creation_date: Feb. 22, 2018, 3:13 p.m. | author: Scott H | type: Comment |
parent: xnqjb | lastedit_date: Feb. 22, 2018, 3:13 p.m. | lastedit_user: Scott H |
content:
Ah ok, that makes sense. I will try that. I have cell layers, so that will work if I put the source underneath at z=0 and put the cell layers at z>1, for a 2D model at least.
Comment:
id: xnqab | creation_date: Feb. 22, 2018, 3:25 p.m. | author: Kim Kanigel Winner | type: Comment |
parent: loxaz | lastedit_date: Feb. 22, 2018, 3:26 p.m. | lastedit_user: Kim Kanigel Winner |
content:
yes, that might work if you embed the source into the z=0 boundary, using the boundary definitions. I'm not sure if you can put cells (in this case the disc) into the boundary level; I also have never tried defining a small area of a boundary as constant -- you might also have to define the rest of the plane as 0, or something like that. If you don't want to play with defining constant conditions for all of the z boundary, and instead add the disc cell type, I think it will take up that space in your 2-D domain, and cells will not crawl on top.... however, if your disc is small, I doubt that it would change the result of your simulation (and it would be easier to implement, most likely!).
Q53: Counting Cell Cycles
id: mbxlx | creation_date: Jan. 26, 2018, 9:20 p.m. | author: Rolando Ruiz | type: Question |
parent: | lastedit_date: Jan. 30, 2018, 4:39 p.m. | lastedit_user: Rolando Ruiz |
content:
System: macOS Sierra v 10.12.6
CC3D version: 3.7.6
I have a simulation where I have two cell types: dividing and non dividing.
<Plugin Name="CellType">
<CellType TypeId="0" TypeName="Medium"/>
<CellType TypeId="1" TypeName="dividing"/>
<CellType TypeId="2" TypeName="nondividing"/>
</Plugin>
I am also using the Growth and Mitosis steppables. The simulation starts off with a dividing cell that will grow to a certain size and then have a certain probability of the daughter cells remaining as dividing cells or become non dividing cells. This will repeat for how ever many MCS I chose.
My goal is to try to determine how many times a cell divides before it becomes a nondividing cell. I thought about using the cell.dict like the manual suggested but I haven't had success. How can I get a dictionary (or a list or something similar) containing cell ids and the number of times it divided?
from PySteppables import *
import CompuCell
import sys
import random
import numpy as np
from PySteppablesExamples import MitosisSteppableBase
class ConstraintInitializerSteppable(SteppableBasePy):
def __init__(self,_simulator,_frequency=1):
SteppableBasePy.__init__(self,_simulator,_frequency)
def start(self):
cellcell = self.newCell(self.DIVIDING)
self.cellField[100:105, 100:105, 0] = cellcell
cellcell.targetVolume=36
cellcell.lambdaVolume=2.0
class GrowthSteppable(SteppableBasePy):
def __init__(self,_simulator,_frequency=1):
SteppableBasePy.__init__(self,_simulator,_frequency)
def step(self,mcs):
for cell in self.cellListByType(self.DIVIDING):
cell.targetVolume+=0.1
class MitosisSteppable(MitosisSteppableBase):
def __init__(self,_simulator,_frequency=1):
MitosisSteppableBase.__init__(self,_simulator, _frequency)
def step(self,mcs):
cells_to_divide=[]
for cell in self.cellList:
if cell.volume > 72:
cells_to_divide.append(cell)
for cell in cells_to_divide:
self.divideCellRandomOrientation(cell)
def updateAttributes(self):
roll_dice = random.random()
self.parentCell.targetVolume /= 2
self.cloneParent2Child()
for cell in self.cellList:
if roll_dice > 0.3 :
self.childCell.type = self.DIVIDING
self.parentCell.type = self.DIVIDING
else:
self.childCell.type = self.NONDIVIDING
self.parentCell.type = self.NONDIVIDING
Answer:
id: avmvz | creation_date: Jan. 29, 2018, 12:34 p.m. | author: James Sluka | type: Answer |
parent: mbxlx | lastedit_date: Jan. 29, 2018, 12:34 p.m. | lastedit_user: James Sluka |
content:
As you suspected the dictionary is one way to do it. When you create a cell at the start of the simulation and every time the cell divides you can increment a counter in a dictionary associated with the cell. When you create the cell (the last line is the dictionary entry);
def start(self):
cellcell = self.newCell(self.DIVIDING)
self.cellField[100:105, 100:105, 0] = cellcell
cellcell.targetVolume=36
cellcell.lambdaVolume=2.0
cellcell.targetSurface=24
cellcell.lambdaSurface=2.0
cellcell.dict['age'] = 1 ### The "age" of the cell, increment every time the cell divides
When the cell divides;
def updateAttributes(self):
roll_dice = random.random()
self.parentCell.targetVolume /= 2
self.cloneParent2Child()
for cell in self.cellList:
if roll_dice > 0.3 :
self.childCell.type = self.DIVIDING
self.parentCell.type = self.DIVIDING
else:
self.childCell.type = self.NONDIVIDING
self.parentCell.type = self.NONDIVIDING
self.childCell.dict['age'] += 1 ### The "age" of the cell, increment everytime the cell divides
self.parentCell.dict['age'] += 1 ### The "age" of the cell, increment everytime the cell divides
Note that the cell’s age always increments on a divide regardless of if it is going to be a DIVIDING or NONDIVIDING. But if it is NONDIVIDING it’ll never divide again, and the counter will never get incremented.
You can periodically print out the list of cells of the two types and their ages;
if self.mcs % 100 == 0: ### only report every 100 mcs
type1=0; type2=0 ###
print "\nmcs=",mcs ###
for cell in self.cellList: ###
if cell.type == 1: ###
type1 +=1 ###
if cell.type == 2: ###
type2 +=1 ###
print "cell id,type,age",cell.id,cell.type,cell.dict['age'] ###
print "Type1=",type1," Type2=",type2,"\n" ###
Attached is a zipped CC3D project that implements the above and graphs the count of each cell type versus mcs. (I’ve highlighted the key lines with “###”.)
File attached: divide_nondivide_track.zip (10.39 KB)
attachments(redirected):
.\CC3D_allanswered_linked_files\divide_nodivide_track.png
.\CC3D_allanswered_linked_files\divide_nondivide_track.zip
Comment:
id: klkel | creation_date: Jan. 30, 2018, 4:39 p.m. | author: Rolando Ruiz | type: Comment |
parent: avmvz | lastedit_date: Jan. 30, 2018, 4:39 p.m. | lastedit_user: Rolando Ruiz |
content:
Thank you! This did the trick.
Q54: 3D Cell Shapes
id: beqrx | creation_date: Jan. 27, 2018, 10:29 a.m. | author: Thorsten Mueller | type: Question |
parent: | lastedit_date: Jan. 29, 2018, 12:50 p.m. | lastedit_user: James Sluka |
content:
Hi,
I wonder if it is possible not only to draw 3D shapes but also keep them during growth and mitosis events?
Does lay around every cell a rectangular box or is it possible to select a different shape for a 3D simulation?
Thank you,
Thorsten
Answer:
id: qvarr | creation_date: Jan. 27, 2018, 11:18 a.m. | author: Maciek Swat | type: Answer |
parent: beqrx | lastedit_date: Jan. 27, 2018, 11:18 a.m. | lastedit_user: Maciek Swat |
content:
your best bet if you want to have control over cell shape is to use compartmentalized cells.
See
http://www.compucell3d.org/BinDoc/cc3d_binaries/Manuals/CompuCell3D_Reference_Manual_v.3.7.4.pdf
page 27
and check chapter of length constraint plugin that follows.
As far as mitosis this should help you get started:
http://pythonscriptingmanual.readthedocs.io/en/latest/dividing_clusters.html
Comment:
id: xnapm | creation_date: Jan. 27, 2018, 11:24 a.m. | author: Maciek Swat | type: Comment |
parent: qvarr | lastedit_date: Jan. 27, 2018, 11:24 a.m. | lastedit_user: Maciek Swat |
content:
To add more to my previous answer. The shape of a single cell could be controlled by choosing properly contact energy (NeighborOrder parameter in the Contact plugins plays actually and important role so make sure it is not 1 but bigger to avoid rectangular lattice-related artifacts). Additionally you would control contact energy coefficients and also you may include surface and volume constraints. You may also play with Length constraints. I would suggest that when doing 3D simulation, to start with a single cell and get the parameters right first. Then slowly keep adding components to your simulation and see how things behave. For example you could study what happens at the mitosis stage starting with just one cell. Also to mak simulation run faster start with smaller lattice and increase the size as you add more components. this way you will not waste time by probing the lattice regions that have no cells. Let me know if this answers your questions
Comment:
id: omgpw | creation_date: Jan. 28, 2018, 8:29 a.m. | author: Thorsten Mueller | type: Comment |
parent: xnapm | lastedit_date: Jan. 28, 2018, 8:29 a.m. | lastedit_user: Thorsten Mueller |
content:
Thanks for the extensive answer. It definitely helped.
I'm still wondering how the volume and surface of each single cell is calculated?
Is it the calculation for a cuboid, since in 3D we have voxels to display, or is more deeply and than the amount of lattices sites within each cell?
Comment:
id: nqeqw | creation_date: Jan. 29, 2018, 12:46 p.m. | author: James Sluka | type: Comment |
parent: omgpw | lastedit_date: Jan. 29, 2018, 12:50 p.m. | lastedit_user: James Sluka |
content:
In a 2D CC3D model the "cell surface" is actually a length and the "cell volume" is actually an area. The units are pixels and pixels^2, respectively.
In a 3D CC3D model the "cell surface" is a true area and the "cell volume" is a true volume. The units are pixels^2 and pixels^3, respectively.
Area and volume, in both 2D and 3D, are always integers.
In both 2D and 3D the measurement is over the actual set of pixels (or voxels) and no smoothing or interpolation of the surface is done. As a result, the surfaces tend to be larger than they would be on a smooth surface since the lattice based surface "staircases".
Q55: How to show the time(MCSs) on the screen?
id: vnkmr | creation_date: Jan. 31, 2018, 2:44 a.m. | author: Yuan | type: Question |
parent: | lastedit_date: Jan. 31, 2018, 12:20 p.m. | lastedit_user: James Sluka |
content:
Dear all,
I want to show the simulation time (MCSs) on the screen. How to realize this?
Thank you~
Yuan
Answer:
id: rexjg | creation_date: Jan. 31, 2018, 12:20 p.m. | author: James Sluka | type: Answer |
parent: vnkmr | lastedit_date: Jan. 31, 2018, 12:20 p.m. | lastedit_user: James Sluka |
content:
The MC Step is already shown in the bottom left corner of the CC3D window. Do you want the MC step displayed in the sub-window that has the cell display? As far as I know there isn't a way to do that. If you want to create an animation of a CC3D simulation (from the saved screen shots from CC3D) you can use ImageMagick to add the MC step to the images as they are added to the animation.
Q56: How to simulate the inner force of a cell?
id: mbwjp | creation_date: Jan. 31, 2018, 9:11 a.m. | author: Yuan | type: Question |
parent: | lastedit_date: Jan. 31, 2018, 11:15 p.m. | lastedit_user: Maciek Swat |
content:
Hi, everyone
I wonder if I can simulate the inner force of a cell, for example, the movement of the spindle body elongates the cell in a certain direction, i.e. the cell grows along a certain direction.
Thank you.
Yuan
Answer:
id: mbwnn | creation_date: Jan. 31, 2018, 11:15 p.m. | author: Maciek Swat | type: Answer |
parent: mbwjp | lastedit_date: Jan. 31, 2018, 11:15 p.m. | lastedit_user: Maciek Swat |
content:
I would say that anything that requires more control of the subcellular structures, mechanisms etc should be handled via compartmentalized cells.
Having said this, you could explore LengthConstraint plugin that does precisely what you want - elongates cells. One thing to keep in mind is to make sure you include ConnectivityGlobal plugin. This plugin has been updated in 3.7.7 to run much faster than previous version (especially in 3D) so make sure you are using the latest CC3D if you want to go down that route.
I would check elongation demos in the Demo folder of CC3D install and also there is a contributed module called OrientedGrowth (the corresponding demo is OrientedGrowthDemo) so check them out
Q57: The simulation of cell vibration
id: wlmwj | creation_date: Jan. 31, 2018, 9:15 a.m. | author: Yuan | type: Question |
parent: | lastedit_date: Feb. 23, 2018, 10:17 p.m. | lastedit_user: Maciek Swat |
content:
Dear all,
I am trying to simulate the process of cell vibration, i.e. the cell's shape size changes in a certain period. What should I do? Thank you!
Answer:
id: bevxv | creation_date: Feb. 23, 2018, 10:17 p.m. | author: Maciek Swat | type: Answer |
parent: wlmwj | lastedit_date: Feb. 23, 2018, 10:17 p.m. | lastedit_user: Maciek Swat |
content:
You can keep changing and sorface and volume constraints from the pythn steppable . say at mcs=0
targetVolume=25
at mcs10
targetVolume=26
at mcs20
targetVolume=27
...
at mcs 200
targetVolume=20
...
Not sure if this is what you are after but this gives you an idea how to simulate what you want
Q58: Week 3- Journal/Code/- PKD Paper, PKD.py lines 70-end
id: klkrl | creation_date: Jan. 31, 2018, 4:03 p.m. | author: Scott H | type: Question |
parent: | lastedit_date: Jan. 31, 2018, 4:03 p.m. | lastedit_user: Scott H |
content:
Week 3- Picking up from last week at line 70 of PKD.py
Paper: Virtual-Tissue Computer Simulations Define the Roles of Cell Adhesion and Proliferation in the Onset of Kidney Cystic Disease
Code- http://www.compucell3d.org/Models
Discussion on Code/Basics-Focusing on Tubule code
The code from the paper is split into 3 folders: IsoCyst, Measure, and tubule.
Tubule- creates a kidney tubule with domains and sub cellular partsPKD.py- This imports models and is where you change and input parameters that feed to the SteppablesContinuing from Line 42
- PKD.py-
- lines 72-82
-
#CELL COLORS cellColor=CompuCell3DElement.ElementCC3D("Plugin",{"Name":"PlayerSettings"}) cellColor.ElementCC3D("Cell",{"Type":0,"Color":"#000000"}) # Black -> Medium cellColor.ElementCC3D("Cell",{"Type":1,"Color":"#FFFF99"}) # Light yellow -> Cyto cellColor.ElementCC3D("Cell",{"Type":2,"Color":"#009900"}) # Dark Green -> Apical cellColor.ElementCC3D("Cell",{"Type":3,"Color":"#990000"}) # Dark red -> Basal cellColor.ElementCC3D("Cell",{"Type":4,"Color":"#FF0000"}) # Red -> Lateral1 cellColor.ElementCC3D("Cell",{"Type":5,"Color":"#00E6E6"}) # Light blue -> Lumen cellColor.ElementCC3D("Cell",{"Type":6,"Color":"#0000FF"}) # Blue -> Lateral2 cellColor.ElementCC3D("TypesInvisibleIn3D",{"Types":"0,1,4,5"}) # Don't show Medium,Cyto, Lateral1 and Lumen cellColor.ElementCC3D("VisualControl",{"ScreenshotFrequency":250,"ScreenUpdateFrequency":10})
- The first line, line 73, creates a compucell element for the "Playersetting" plugin. The element is a root element object, so we can add the child elements for each color later on. See Chapter 17 pg 56 in the 3.7.6 Python Scripting Manual on the CC3D website for more info.
- Lines 74-80
- These lines assign colors to display in the program for each cell type. They are assigned by using the Type number
- Line 81-82
-
cellColor.ElementCC3D("TypesInvisibleIn3D",{"Types":"0,1,4,5"}) # Don't show Medium,Cyto, Lateral1 and Lumen cellColor.ElementCC3D("VisualControl",{"ScreenshotFrequency":250,"ScreenUpdateFrequency":10})
- These lines adjust visibility so Medium, Cato, Laterall and Lumen aren't visible on the display. When I run the program I see the Lumen and Medium, so I am not sure if this is overwritten elsewhere.
-
- Line 86
contact=CompuCell3DElement.ElementCC3D("Plugin",{"Name":"Contact"})
- This creates a room element object for the Contact Energy plugin
- Lines 88-93
contact.ElementCC3D("Energy",{"Type1":"Medium","Type2":"Medium"},0) contact.ElementCC3D("Energy",{"Type1":"Medium","Type2":"Cyto"},60) contact.ElementCC3D("Energy",{"Type1":"Medium","Type2":"Apical"},60) contact.ElementCC3D("Energy",{"Type1":"Medium","Type2":"Basal"},3) contact.ElementCC3D("Energy",{"Type1":"Medium","Type2":"Lateral"},8) contact.ElementCC3D("Energy",{"Type1":"Medium","Type2":"Lateral2"},8)
- These lines assign contact energies for the cells to the medium. This is the J term in the GGH model equation. There are J's for each cell-cell pair possible, including the medium. The other J's are in code that follows.
- Lines 95-100
#Cyto contact.ElementCC3D("Energy",{"Type1":"Cyto","Type2":"Cyto"},60) contact.ElementCC3D("Energy",{"Type1":"Cyto","Type2":"Apical"},60) contact.ElementCC3D("Energy",{"Type1":"Cyto","Type2":"Basal"},60) contact.ElementCC3D("Energy",{"Type1":"Cyto","Type2":"Lateral"},60) contact.ElementCC3D("Energy",{"Type1":"Cyto","Type2":"Lateral2"},60)
- The J terms for cell-cyto pairs. Note they all are the same. This means the contact energy between cells to the cyto cell compartments is the same, or no preference.
- Lines 101-105
#Apical contact.ElementCC3D("Energy",{"Type1":"Apical","Type2":"Apical"},15) contact.ElementCC3D("Energy",{"Type1":"Apical","Type2":"Basal"},20) contact.ElementCC3D("Energy",{"Type1":"Apical","Type2":"Lateral"},20) contact.ElementCC3D("Energy",{"Type1":"Apical","Type2":"Lateral2"},20)
- For apical-apical, there is a J of 15. compare this to 20 for the apical/basal or apical lateral. So the model energy will be lower and preferred for the apical/apical versus other pairs.
- Lines 106-109
#Basal contact.ElementCC3D("Energy",{"Type1":"Basal","Type2":"Basal"},20) contact.ElementCC3D("Energy",{"Type1":"Basal","Type2":"Lateral"},20) contact.ElementCC3D("Energy",{"Type1":"Basal","Type2":"Lateral2"},20)
- Here the J terms are similar for the pairings.
- Lines 110-113
#Lateral(2) contact.ElementCC3D("Energy",{"Type1":"Lateral","Type2":"Lateral"},4) contact.ElementCC3D("Energy",{"Type1":"Lateral2","Type2":"Lateral2"},4) contact.ElementCC3D("Energy",{"Type1":"Lateral2","Type2":"Lateral"},4)
- Here the J terms are similar. Compare to the other J terms. This seems to be a cell type that will associate mainly with the lateral or lateral2 (self), and are closer to the lumen (see the lumen J terms).
- Lines 114-121
#Lumen contact.ElementCC3D("Energy",{"Type1":"Lumen","Type2":"Lumen"},0) contact.ElementCC3D("Energy",{"Type1":"Lumen","Type2":"Medium"},60) contact.ElementCC3D("Energy",{"Type1":"Lumen","Type2":"Cyto"},60) contact.ElementCC3D("Energy",{"Type1":"Lumen","Type2":"Apical"},15) contact.ElementCC3D("Energy",{"Type1":"Lumen","Type2":"Basal"},20) contact.ElementCC3D("Energy",{"Type1":"Lumen","Type2":"Lateral"},20) contact.ElementCC3D("Energy",{"Type1":"Lumen","Type2":"Lateral2"},20)
- Here we see J terms for cells close to the lumen Apical, lateral), versus the ones farther away( Basal, cyto). This makes sense since the kidney tubule is contacting the apical parts of the epithelial cells lining the lumen.
- Lines 122-123
#Neighbor order contact.ElementCC3D("NeighborOrder",{},CNOrder)
- Per the 3.4.1 manual, this is the range over which source pixels are selected for index-copy attempts (pg 17). The default is 1. In the context of Contact Energies, it is the interaction range of the boundary energy, so a pixel on a cell boundary will interact with the pixels around it (8-neighbor) if default is 1.
- Lines 125-126
INTERNAL CONTACT ENERGIES: cInternal=CompuCell3DElement.ElementCC3D("Plugin",{"Name":"ContactInternal"})
- This creates a root object element for the "ContactInternal" plugin
- Lines 128-141
#Cyto cInternal.ElementCC3D("Energy",{"Type1":"Cyto","Type2":"Apical"},0) cInternal.ElementCC3D("Energy",{"Type1":"Cyto","Type2":"Basal"},0) cInternal.ElementCC3D("Energy",{"Type1":"Cyto","Type2":"Lateral"},0) cInternal.ElementCC3D("Energy",{"Type1":"Cyto","Type2":"Lateral2"},0) #Apical cInternal.ElementCC3D("Energy",{"Type1":"Apical","Type2":"Basal"},2) cInternal.ElementCC3D("Energy",{"Type1":"Apical","Type2":"Lateral"},0) cInternal.ElementCC3D("Energy",{"Type1":"Apical","Type2":"Lateral2"},0) #Basal cInternal.ElementCC3D("Energy",{"Type1":"Basal","Type2":"Lateral"},0) cInternal.ElementCC3D("Energy",{"Type1":"Basal","Type2":"Lateral2"},0) #Lateral(2) cInternal.ElementCC3D("Energy",{"Type1":"Lateral","Type2":"Lateral"},0) cInternal.ElementCC3D("Energy",{"Type1":"Lateral2","Type2":"Lateral2"},0)
- For all cell-cell interactions, except for Apical-Basal, the J term is 0. For Apical-Basal, it is 2. These J terms are for the internal cell compartments (Apical, Basal, Cyto). Which are different than the generalized cell types,
- Lines 142-143
#Neighbor order cInternal.ElementCC3D("NeighborOrder",{},CINOrder)
- Assigning default neighbor order again. See Contact Energy code some paragraphs above.
- Lines 146-150
pTracker=CompuCell3DElement.ElementCC3D("Plugin",{"Name":"PixelTracker"}) boundaryPTracker=CompuCell3DElement.ElementCC3D("Plugin",{"Name":"BoundaryPixelTracker"}) vlFlex=CompuCell3DElement.ElementCC3D("Plugin",{"Name":"VolumeLocalFlex"}) coMass=CompuCell3DElement.ElementCC3D("Plugin",{"Name":"CenterOfMass"}) neighborTracker=CompuCell3DElement.ElementCC3D("Plugin",{"Name":"NeighborTracker"})
- Here, other object elements are created for other plugins. The usual ones like Volume, Pixel Tracker, etc. I do not think they are used later.
- Line 163
CompuCellSetup.setSimulationXMLDescription(CompuCell3DElement)
- This line passes the root element of the CC3DML to the CC3D core code for initialization (pg 57 of manual 3.7.6). So passing this one element covered all the XML thus far. This is the last line of the configureSimulation function, so later on we will call the function to get the XML and pass it into the other parts and scripts.
- Lines 165-169
import CompuCellSetup import CompuCell sim,simThread = CompuCellSetup.getCoreSimulationObjects() configureSimulation(sim,Lx,Ly,Lz,Temp,Time,NOrder,CNOrder,CINOrder,debugFreq)
- Now we can get all the XML by calling the configureSimulation. Notice the inputs to the function.
- The getCoreSimulationObjects initializes the core CC3D modules.
Q59: Cell growth on a sphere cell
id: avmnv | creation_date: Feb. 6, 2018, 8:29 a.m. | author: Thorsten Mueller | type: Question |
parent: | lastedit_date: Feb. 6, 2018, 3:41 p.m. | lastedit_user: James Sluka |
content:
Hi,
are there parameters which influence the shape of a single cell in a 3D lattice beside the target volume/surface and the lambda multiplier?
Since the real volume of a sphere is almost identical with the surface out of voxels and the surface of the voxel sphere is by a factor 1.5 larger than the realistic surface, it is possible to calculate the realistic volume and surface and multiply this surface by 1.5 for the growth of a cell. With the algorithm to draw the cell it is possible to read out the volume and surface values out of CC3D. Then the factor between the real sphere surface and the voxel sphere surface can be calculated.
The algorithm to draw the cell consider the corner length of a voxel as steplength. With this approach it is checked if the center of the voxel is inside the sphere or not.
for xr in xrange(xStart, xEnd):
for yr in xrange(yStart, yEnd):
for zr in xrange(zStart, zEnd):
rd = sqrt(
((xr+(((xr+stepLength) - xr)/2.)) - x0) ** 2 +
((yr+(((yr+stepLength) - yr)/2.)) - y0) ** 2 +
((zr+(((zr+stepLength) - zr)/2.)) - z0) ** 2)
if (rd <= radiusPx):
steppable.cellField[xr, yr, zr] = cell
The following cell is drawn with an radius of 10 voxel
During the simulation the cell looses the desired structure and become a cube again. Even the volume and surface values as well as the target volume and target surface values match the values of the drawn voxel spheres
The cell after 500 MCS
Since this is not a perfect smooth cube and in other simulations there were more edges and peaks, I can imagine that this cell meets also the volume and surface values.
Are there any techniques to keep the shape of the sphere during the simulation?
Is it maybe not possible because for a given volume and surface there are infinite possible 3D objects?
Thank you,
Thorsten
attachments(redirected):
.\CC3D_allanswered_linked_files\CellDiameter10.png
.\CC3D_allanswered_linked_files\CellDiameter10-MCS500.png
Answer:
id: xnwra | creation_date: Feb. 6, 2018, 3:39 p.m. | author: James Sluka | type: Answer |
parent: avmnv | lastedit_date: Feb. 6, 2018, 3:41 p.m. | lastedit_user: James Sluka |
content:
In addition to the volume and surface constraints the adhesion energies will also affect the sphericity of a cell. Is the system trying to not only maintain the cell's target volume and surface but also trying to avoid adhesion energy penalties? In general all of these will affect the sphericity of a cell;
- target and lambda volume
- target and lambda surface
- adhesion energies (e.g., cell to medium)
- neighbor order in pixel copy
- neighbor order in adhesion
- square vs. hexagonal lattice
- Potts temperature (which controls how quickly the surface fluctuates)
This would be an interesting question to explore with a parameter scan.
Usually though, cells aren't spherical anyway since they are in contact with each other and those contacts are generally flat faces.
Q60: Can I manipulate or change the Gamma_S parameter (coefficient of the area term) in the Hamiltonian expression of the CoMpuCell3D Potts model?
id: avmxe | creation_date: Feb. 8, 2018, 5:50 a.m. | author: Abhishek Das | type: Question |
parent: | lastedit_date: Feb. 23, 2018, 10:14 p.m. | lastedit_user: Maciek Swat |
content:
Instead of a linear constant Gamma_S, I would like to have an expression of Gamma_S term.
For example, Gamma_S = Gamma_S1*(1-Gamma_S2*GammaS1)
Is it possible in CompuCell3D? if so how to do it?
Answer:
id: loxzr | creation_date: Feb. 23, 2018, 10:14 p.m. | author: Maciek Swat | type: Answer |
parent: avmxe | lastedit_date: Feb. 23, 2018, 10:14 p.m. | lastedit_user: Maciek Swat |
content:
which plugin / CC3D module are you referring to? Could you post your simulation and tell us which parameter you want to modify via an arithmetic expression?
Q61: How can I restart a simulation from the last time step ?
id: ggxpe | creation_date: Feb. 8, 2018, 2:23 p.m. | author: Mahua Roy | type: Question |
parent: | lastedit_date: June 18, 2018, 3:03 p.m. | lastedit_user: Mahua Roy |
content:
Is there a way to write a restart file so that the next simulation starts from the last time step. As for example the total MCS that I have to run is 24000. However, with the resource allocation, I can only run approximately 5000 steps continuously. How can I write a restart file so I can start from where I last ended the simulation. What needs to be changed in the number of steps ?
EDIT: How would I do it without the GUI just through the terminal? I was able to write restart file but am not sure how to specify to read from that particular directory when restarting the next stage of simulation. More specifically ,
./runScript.sh -i < input.cc3d> -o < Output directory > ...... < restart directory > ?
Answer:
id: wlbza | creation_date: Feb. 23, 2018, 9:25 p.m. | author: Maciek Swat | type: Answer |
parent: ggxpe | lastedit_date: Feb. 23, 2018, 9:25 p.m. | lastedit_user: Maciek Swat |
content:
Have you tried following the manual?
http://pythonscriptingmanual.readthedocs.io/en/latest/restarting_simulations.html?highlight=restart
If you want to restart it make sure that you remove serialization line from the .cc3d file - you can do it as shown in the manual or simply edit .ccd file so that
<Simulation version="3.6.1">
<XMLScript Type="XMLScript">Simulation/cellsort_2D.xml</XMLScript>
<SerializeSimulation AllowMultipleRestartDirectories="False" FileFormat="text" OutputFrequency="100"/>
<RestartSimulation RestartDirectory="restart"/>
</Simulation>
goes to
<Simulation version="3.6.1">
<XMLScript Type="XMLScript">Simulation/cellsort_2D.xml</XMLScript>
<RestartSimulation RestartDirectory="restart"/>
</Simulation>
when you remove the serialization line.And if you want to run from command line you type
./runScript.command -i /Users/m/CC3DProjects/restart_01600/cellsort_2D.cc3d --noOutput
See attached file. Unpack it and change /Users/m/CC3DProjects/restart_01600/cellsort_2D.cc3d to the path where you unpacked the attached file. It has complete restart snapshot and it runs both from GUI and command line
File attached: restart_01600.zip (14.76 KB)
attachments(redirected):
.\CC3D_allanswered_linked_files\restart_01600.zip
Comment:
id: qvelo | creation_date: March 23, 2018, 11:06 a.m. | author: Mahua Roy | type: Comment |
parent: wlbza | lastedit_date: March 23, 2018, 11:06 a.m. | lastedit_user: Mahua Roy |
content:
Thank you for the detailed description.
Answer:
id: kgpbg | creation_date: June 8, 2018, 7:07 p.m. | author: Mahua Roy | type: Answer |
parent: ggxpe | lastedit_date: June 8, 2018, 7:07 p.m. | lastedit_user: Mahua Roy |
content:
File attached: Run2.zip (68.93 KB)
There has been a constant error with the restart file being not found even though it is present there. I looked at the way the serializer is specified in the restart_01600 and it is the same in Run2. I am not sure why I am still getting the same error. Any help from your side would be very helpful.
Thanks and regards,
Mahua
attachments(redirected):
.\CC3D_allanswered_linked_files\Run2.zip
Answer:
id: awrbj | creation_date: June 8, 2018, 11:18 p.m. | author: Maciek Swat | type: Answer |
parent: ggxpe | lastedit_date: June 8, 2018, 11:18 p.m. | lastedit_user: Maciek Swat |
content:
What error are you getting? Could you post it here?
Your restart folder is empty. But I also noticed that you are not using scipy in your simulation but still importing it. On my machine it caused problems so I commented out any references to scipy
Answer:
id: awrmj | creation_date: June 9, 2018, 9:04 p.m. | author: Mahua Roy | type: Answer |
parent: ggxpe | lastedit_date: June 9, 2018, 9:04 p.m. | lastedit_user: Mahua Roy |
content:
I apologise for the empty file. Please find the attached restart file
File attached: restart_10000.zip (1.49 MB)
The error is attached here as well. It complains of the file not being there, when it is present
[Error: IOError: loadSBMLError Wrong constructed path: RoadRunnerPy could not find /Volumes/CompuCell/Pancreatic-cancer-CC3D/Tumor_growth_simulation2/Run1/Result_atpD_032/restart_10000/ in the filesystem
Traceback (most recent call last):
File: /Users/roym/Downloads/CC3D_3.7.6/pythonSetupScripts/CompuCellPythonSimulationNewPlayer.py
Line: 351 Col: 0 execfile(CompuCellSetup.simulationPaths.simulationPythonScriptName)
execfile(CompuCellSetup.simulationPaths.simulationPythonScriptName)
File: /Volumes/CompuCell/Pancreatic-cancer-CC3D/Tumor_growth_simulation2/Run1/Result_atpD_032/restart_10000/Simulation/TumorGrowth.py
Line: 83 Col: 0 CompuCellSetup.mainLoop(sim,simthread,steppableRegistry)
CompuCellSetup.mainLoop(sim,simthread,steppableRegistry)
File: /Users/roym/Downloads/CC3D_3.7.6/pythonSetupScripts/CompuCellSetup.py
Line: 1980 Col: 0 return mainLoopNewPlayer(sim, simthread, steppableRegistry, _screenUpdateFrequency)
return mainLoopNewPlayer(sim, simthread, steppableRegistry, _screenUpdateFrequency)
File: /Users/roym/Downloads/CC3D_3.7.6/pythonSetupScripts/CompuCellSetup.py
Line: 1595 Col: 0 restartManager.loadRestartFiles()
restartManager.loadRestartFiles()
File: /Users/roym/Downloads/CC3D_3.7.6/pythonSetupScripts/RestartManager.py
Line: 340 Col: 0 self.loadSBMLSolvers()
self.loadSBMLSolvers()
File: /Users/roym/Downloads/CC3D_3.7.6/pythonSetupScripts/RestartManager.py
Line: 644 Col: 0 sbmlSolver.loadSBML(_externalPath=self.sim.getBasePath()) # this call fully initializes SBML Solver by loading sbmlMode ( relative path stored in sbmlSolver.path and root dir is passed using self.sim.getBasePath())
sbmlSolver.loadSBML(_externalPath=self.sim.getBasePath()) # this call fully initializes SBML Solver by loading sbmlMode ( relative path stored in sbmlSolver.path and root dir is passed using self.sim.getBasePath())
File: /Users/roym/Downloads/CC3D_3.7.6/pythonSetupScripts/RoadRunnerPy.py
Line: 109 Col: 0 'loadSBMLError Wrong constructed path: RoadRunnerPy could not find ' + self.absPath + ' in the filesystem')
'loadSBMLError Wrong constructed path: RoadRunnerPy could not find ' + self.absPath + ' in the filesystem')]
attachments(redirected):
.\CC3D_allanswered_linked_files\restart_10000.zip
Answer:
id: rrmxb | creation_date: June 10, 2018, noon | author: Maciek Swat | type: Answer |
parent: ggxpe | lastedit_date: June 10, 2018, noon | lastedit_user: Maciek Swat |
content:
I saw that too. and in this case it cannot find your sbml model mile (I believe in your case it might have xml extension). The serializer does not copy the sbml to the restart directory so you need to do it by hand. Simply place the sbml file in one of the restart folders you are attempting to run (in the same hierarchical location as in the original simulation i.e. inside Simulation subfolder)
Let me know if this works
Answer:
id: gnqer | creation_date: June 10, 2018, 12:36 p.m. | author: Mahua Roy | type: Answer |
parent: ggxpe | lastedit_date: June 10, 2018, 12:36 p.m. | lastedit_user: Mahua Roy |
content:
I tried copying it all locations but still the error remains the same.
'loadSBMLError Wrong constructed path: RoadRunnerPy could not find ' + self.absPath + ' in the filesystem')
IOError: loadSBMLError Wrong constructed path: RoadRunnerPy could not find /Users/roym/Downloads/restart_10000/ in the filesystem
I never received the error during the initial simulation.
Answer:
id: mqple | creation_date: June 13, 2018, 1:50 a.m. | author: Maciek Swat | type: Answer |
parent: ggxpe | lastedit_date: June 13, 2018, 1:50 a.m. | lastedit_user: Maciek Swat |
content:
so it looks like a bug. I will rerun some other simulations with SBML serializations and see what's going on. Essentially many cells that have SBML solver attached are missing the path to the sbml model. This is strange. Maybe those ar ethe new cells that got created . I will need to check that
Answer:
id: wrqnq | creation_date: June 13, 2018, 1:51 a.m. | author: Maciek Swat | type: Answer |
parent: ggxpe | lastedit_date: June 13, 2018, 1:51 a.m. | lastedit_user: Maciek Swat |
content:
BTW is there any chance you could try the same with CC3D 3.7.7. I know we have fixed few bugs related to copying SBML solvers during Mitosis and I wonder if this is one of those bugs that we are seeing now
Answer:
id: kgpxn | creation_date: June 13, 2018, 1:21 p.m. | author: Mahua Roy | type: Answer |
parent: ggxpe | lastedit_date: June 13, 2018, 1:21 p.m. | lastedit_user: Mahua Roy |
content:
Thanks so much for looking into it. I really appreciate your help. I tried with 3.7.7 version as you suggested. However, it seems to be the same error. I paste it below :
**********
File "/staging/mr2/mahuaroy/CC3D_3.7.7_RHEL/player5/CompuCellPythonSimulationCML.py", line 363, in <module>
execfile(CompuCellSetup.simulationPaths.simulationPythonScriptName)
File "/staging/mr2/mahuaroy/Tumor_growth_simulation2/test/restart_10000/Simulation/TumorGrowth.py", line 83, in <module>
CompuCellSetup.mainLoop(sim,simthread,steppableRegistry)
File "/staging/mr2/mahuaroy/CC3D_3.7.7_RHEL/pythonSetupScripts/CompuCellSetup.py", line 2072, in mainLoop
return mainLoopCML(sim, simthread, steppableRegistry, _screenUpdateFrequency)
File "/staging/mr2/mahuaroy/CC3D_3.7.7_RHEL/pythonSetupScripts/CompuCellSetup.py", line 1860, in mainLoopCML
restartManager.loadRestartFiles()
File "/staging/mr2/mahuaroy/CC3D_3.7.7_RHEL/pythonSetupScripts/RestartManager.py", line 340, in loadRestartFiles
self.loadSBMLSolvers()
File "/staging/mr2/mahuaroy/CC3D_3.7.7_RHEL/pythonSetupScripts/RestartManager.py", line 644, in loadSBMLSolvers
sbmlSolver.loadSBML(_externalPath=self.sim.getBasePath()) # this call fully initializes SBML Solver by loading sbmlMode ( relative path stored in sbmlSolver.path and root dir is passed using self.sim.getBasePath())
File "/staging/mr2/mahuaroy/CC3D_3.7.7_RHEL/pythonSetupScripts/RoadRunnerPy.py", line 109, in loadSBML
'loadSBMLError Wrong constructed path: RoadRunnerPy could not find ' + self.absPath + ' in the filesystem')
IOError: loadSBMLError Wrong constructed path: RoadRunnerPy could not find /staging/mr2/mahuaroy/Tumor_growth_simulation2/test/restart_10000/ in the filesystem
/staging/mr2/mahuaroy/CC3D_3.7.7_RHEL/runScript.sh: line 39: 49004 Segmentation fault ${PYTHON_EXEC} ${PREFIX_CC3D}/player5/CompuCellPythonSimulationCML.py $* --currentDir=${current_directory}
Answer:
id: jgpbr | creation_date: June 13, 2018, 1:22 p.m. | author: Mahua Roy | type: Answer |
parent: ggxpe | lastedit_date: June 13, 2018, 1:22 p.m. | lastedit_user: Mahua Roy |
content:
I placed the SBML (xml) file in the same location as specified in the Steppables file - in the Simulation folder.
Answer:
id: vxgxa | creation_date: June 17, 2018, 5:33 p.m. | author: Maciek Swat | type: Answer |
parent: ggxpe | lastedit_date: June 17, 2018, 5:33 p.m. | lastedit_user: Maciek Swat |
content:
The problem was not in the restart function but in the copySBML's function that you used in the Mitosis Steppeble (your Mitosis code was correct BTW). I fixed that along with addSBMLtoCell function and now the serialization works.
Few things though:
1. The way you initialized FPP links is not entirely correct because you end up with infinity values for lambda D after few very few MCS - you keep multiplying previous value of lambdaD by 20 each MCS. As you can tell this will led to inf values - I fixed it see lines 125-130 of your Steppables file (here is your new simulation File attached: TumorGrowth_restart.tar.gz (32.97 KB))
2. The restart file after 1000 MCS is here File attached: TumorGrowth_restart_1000.tar.gz (1.11 MB)
3. Finally to get your code working you need to patch the installation of CD3D . All you need to do is to copy the attached SBMLHelper.py (File attached: SBMLSolverHelper.py (28.46 KB)
) to <your cc3d installation directory>/pythonSetupScripts , replacing old version of SBMLHelper.py
We will be releasing new version of CC3D soon and this bug fix will be included but for now you need to do this manual step.
Let us know if you have any questions
attachments(redirected):
.\CC3D_allanswered_linked_files\TumorGrowth_restart.tar.gz
.\CC3D_allanswered_linked_files\TumorGrowth_restart_1000.tar.gz
.\CC3D_allanswered_linked_files\SBMLSolverHelper.py
Answer:
id: rrovz | creation_date: June 18, 2018, 3:03 p.m. | author: Mahua Roy | type: Answer |
parent: ggxpe | lastedit_date: June 18, 2018, 3:03 p.m. | lastedit_user: Mahua Roy |
content:
Thank so much for your time to look into the script and fix the issue. I copied the SBMLSolverHelper.py into the installation directory. Currently the restart files work. I will run on the Linux version of the CompuCell and will update you if there are any issues.
Thanks so much again.
Q62: Restart error
id: nqvqn | creation_date: Feb. 9, 2018, 2:56 p.m. | author: Mahua Roy | type: Question |
parent: | lastedit_date: Feb. 23, 2018, 9:02 p.m. | lastedit_user: Maciek Swat |
content:
For restarting a simulation from the last restart file written , I rename the folder and moved it to the main location where the .cc3d file is. However, this is error that is thrown out. I am not sure if there are any lines that need to be modified for the FocalPointPalsticity. Any help would be highly appreciated.
attachments(redirected):
.\CC3D_allanswered_linked_files\Screen Shot 2018-02-09 at 11.13.23 AM.png
Answer:
id: mbrza | creation_date: Feb. 23, 2018, 9:02 p.m. | author: Maciek Swat | type: Answer |
parent: nqvqn | lastedit_date: Feb. 23, 2018, 9:02 p.m. | lastedit_user: Maciek Swat |
content:
Could you post the "toy version" of the simulation that has the problem? We could take a look at it and see where the problem is
Q63: Modeling nucleus and cytoplasm
id: lorwn | creation_date: Feb. 14, 2018, 4:58 a.m. | author: Thomas | type: Question |
parent: | lastedit_date: June 4, 2018, 9:09 a.m. | lastedit_user: dali Zan |
content:
Hello. I would like to model a cell by its cytoplasm and its nucleus. I have already tried to model each component and their interactions with internal contact and connectivity but when I tried to simulate it, I had my nucleus fragmented inside the cytoplasm, or gone out of the cytoplasm. Do you have any ideas to prevent these from happening? Thank you.
Answer:
id: omvzo | creation_date: Feb. 23, 2018, 9 p.m. | author: Maciek Swat | type: Answer |
parent: lorwn | lastedit_date: Feb. 23, 2018, 9 p.m. | lastedit_user: Maciek Swat |
content:
Could you post your simulation here? Cell fragmentation could be prevented by imposing surface and volume constraints. In any case if you could share your code we could try helping you out otherwise it is hard to give you specific advice without seeing all the parameters you have in your model
Answer:
id: qwpbv | creation_date: June 4, 2018, 9:09 a.m. | author: dali Zan | type: Answer |
parent: lorwn | lastedit_date: June 4, 2018, 9:09 a.m. | lastedit_user: dali Zan |
content:
I guess you set J(nucleus,medium)=0,that may cause the situation you said. Try to set a large positive value to J(nucleus,medium).
Q64: How to change a cc3d windows title?
id: klomb | creation_date: Feb. 14, 2018, 9:20 a.m. | author: Pauli Tikka | type: Question |
parent: | lastedit_date: Feb. 23, 2018, 8:39 p.m. | lastedit_user: Maciek Swat |
content:
Hi,
Help needed.
Instead of the word 'graphics' (as seen in the figure), I would like have word like 'Cells' or 'Cell field' etc. How to accomplish this task? I tried to modify the python (steppable) code, but I guess it could be done also in the program itself?
Thanks in advance!
B.r., Pauli
attachments(redirected):
.\CC3D_allanswered_linked_files\cc3d_title of the window_tikka.png
Answer:
id: nqgzj | creation_date: Feb. 23, 2018, 8:39 p.m. | author: Maciek Swat | type: Answer |
parent: klomb | lastedit_date: Feb. 23, 2018, 8:39 p.m. | lastedit_user: Maciek Swat |
content:
I dont think this is possible but I will add it to the TODO list
Q65: Does my simulation code crash the twedit++ when parameter scan is added for the first time?
id: klopb | creation_date: Feb. 15, 2018, 9:08 a.m. | author: Pauli Tikka | type: Question |
parent: | lastedit_date: July 13, 2018, 1:17 p.m. | lastedit_user: James Sluka |
content:
Dear reader,
I have a problem regarding crashing of twedit++ when I try to add parameter scan (see the image; question mark indicates the chrash event).
What do, how to solve? The demo cc3d codes seem to work, play, and add all the parameter scans in the world. The only solution that I can think of at the moment is to do my code again and/or reinstall the compucell3d&twedit.
Yours,
Pauli
attachments(redirected):
.\CC3D_allanswered_linked_files\parameter scan chrashes the simulation_why what to do.png
Answer:
id: benqj | creation_date: Feb. 16, 2018, 5:45 a.m. | author: Pauli Tikka | type: Answer |
parent: klopb | lastedit_date: Feb. 16, 2018, 5:45 a.m. | lastedit_user: Pauli Tikka |
content:
Hi,
I changed the folder of my simulation to compucell...\Book_ChapterDemos etc. , and it I got the scan working! Splendid! I wonder how I can give rights to other folders for cc3d sim runs?
B.r.,
Pauli
me
Europe
Answer:
id: bevao | creation_date: Feb. 20, 2018, 1:14 p.m. | author: James Sluka | type: Answer |
parent: klopb | lastedit_date: Feb. 20, 2018, 1:14 p.m. | lastedit_user: James Sluka |
content:
What platform are you running on? Windows, Mac, linux, ...? It sounds like the parameter scan task is trying to write to a directory you didn't have access to.
I've also noticed crashes when you try to save the file after defining the parameter scans. In my case though the files are written correctly and can be re-loaded into twedit, or run from the command line.
Comment:
id: qvjqe | creation_date: Feb. 23, 2018, 9:37 a.m. | author: Pauli Tikka | type: Comment |
parent: bevao | lastedit_date: Feb. 23, 2018, 9:37 a.m. | lastedit_user: Pauli Tikka |
content:
Windows. I use the same directory where my compucell3d is. I have still experienced problems in starting to run the simulation code in my new directory inside this folder. The program does not crash, but it does not play the simulation code. I have attached the run file.
processCommandLineOptions
opts= []
args= []
FILE LIST= []
pixmap= <PyQt5.QtGui.QPixmap object at 0x0000000005586278>
INIT SYNC self.modifiedPluginsDataStringList= []
pluginModules= ['PluginCCDCPPHelper', 'PluginCCDMLHelper', 'PluginCCDProject', 'PluginCCDPythonHelper', 'PluginCompuCell3D']
plugin name= PluginCCDCPPHelper
##################loading source for C:\CompuCell3D-64bit\Twedit++5\Plugins\PluginCCDCPPHelper.py
plugin name= PluginCCDMLHelper
##################loading source for C:\CompuCell3D-64bit\Twedit++5\Plugins\PluginCCDMLHelper.py
['C:\\CompuCell3D-64bit\\lib\\PythonDeps', 'C:\\CompuCell3D-64bit\\Twedit++5', 'C:\\CompuCell3D-64bit\\Twedit++5\\Plugins', 'C:\\CompuCell3D-64bit\\Python27\\python27.zip', 'C:\\CompuCell3D-64bit\\Python27\\DLLs', 'C:\\CompuCell3D-64bit\\Python27\\lib', 'C:\\CompuCell3D-64bit\\Python27\\lib\\plat-win', 'C:\\CompuCell3D-64bit\\Python27\\lib\\lib-tk', 'C:\\CompuCell3D-64bit\\Python27', 'C:\\CompuCell3D-64bit\\Python27\\lib\\site-packages', 'C:\\CompuCell3D-64bit\\Python27\\lib\\site-packages\\win32', 'C:\\CompuCell3D-64bit\\Python27\\lib\\site-packages\\win32\\lib', 'C:\\CompuCell3D-64bit\\Python27\\lib\\site-packages\\Pythonwin', 'C:\\CompuCell3D-64bit\\lib\\python', 'C:\\CompuCell3D-64bit\\pythonSetupScripts']
plugin name= PluginCCDProject
##################loading source for C:\CompuCell3D-64bit\Twedit++5\Plugins\PluginCCDProject.py
plugin name= PluginCCDPythonHelper
##################loading source for C:\CompuCell3D-64bit\Twedit++5\Plugins\PluginCCDPythonHelper.py
plugin name= PluginCompuCell3D
##################loading source for C:\CompuCell3D-64bit\Twedit++5\Plugins\PluginCompuCell3D.py
************PLUGIN NAME= PluginCompuCell3D
name=PluginCompuCell3D
fileName=C:\CompuCell3D-64bit\Twedit++5\Plugins\PluginCompuCell3D.py
author=Maciej Swat
autoactivate=True
deactivateable=False
version=0.9.0
className=CC3DApp
packageName=__core__
shortDescription=PLugin linking Twedit++5 with CompuCell3D
longDescription=This plugin provides functionality to link Twedit with CompuCell3D
LOADING PluginCompuCell3D from C:\CompuCell3D-64bit\Twedit++5\Plugins\PluginCompuCell3D.py
loading source for C:\CompuCell3D-64bit\Twedit++5\Plugins\PluginCompuCell3D.py
version= 0.9.0 className= CC3DApp pluginClass= <class 'PluginCompuCell3D.CC3DApp'>
PORT= -1
__initActions
CC3D CONSTRUCTOR
WILL TRY TO ACTIVATE <PluginCompuCell3D.CC3DApp object at 0x0000000005921678>
ACTIVATED
************PLUGIN NAME= PluginCCDProject
name=PluginCCDProject
fileName=C:\CompuCell3D-64bit\Twedit++5\Plugins\PluginCCDProject.py
author=Maciej Swat
autoactivate=True
deactivateable=False
version=0.9.0
className=CC3DProject
packageName=__core__
shortDescription=Plugin to manage CC3D Projects
longDescription=This plugin provides functionality that allows users to manage *.cc3d projects
LOADING PluginCCDProject from C:\CompuCell3D-64bit\Twedit++5\Plugins\PluginCCDProject.py
loading source for C:\CompuCell3D-64bit\Twedit++5\Plugins\PluginCCDProject.py
version= 0.9.0 className= CC3DProject pluginClass= <class 'PluginCCDProject.CC3DProject'>
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
WILL TRY TO ACTIVATE <PluginCCDProject.CC3DProject object at 0x0000000005921D38>
ACTIVATED
************PLUGIN NAME= PluginCCDPythonHelper
name=PluginCCDPythonHelper
fileName=C:\CompuCell3D-64bit\Twedit++5\Plugins\PluginCCDPythonHelper.py
author=Maciej Swat
autoactivate=True
deactivateable=True
version=0.9.0
className=CC3DPythonHelper
packageName=__core__
shortDescription=Plugin which assists with CC3D Python scripting
longDescription=This plugin provides provides users with CC3D Python code snippets - making Python scripting in CC3D more convenient.
LOADING PluginCCDPythonHelper from C:\CompuCell3D-64bit\Twedit++5\Plugins\PluginCCDPythonHelper.py
loading source for C:\CompuCell3D-64bit\Twedit++5\Plugins\PluginCCDPythonHelper.py
version= 0.9.0 className= CC3DPythonHelper pluginClass= <class 'PluginCCDPythonHelper.CC3DPythonHelper'>
WILL TRY TO ACTIVATE <PluginCCDPythonHelper.CC3DPythonHelper object at 0x0000000005921438>
menuName= Adhesion Flex
menuName= Cell Attributes
menuName= Cell Constraints
menuName= Cell Manipulation
menuName= Chemical Field Manipulation
menuName= Chemotaxis
menuName= Distances, Vectors, Transformations
menuName= Elasticity
menuName= Extra Fields
menuName= Extra Fields Automatic Tracking
menuName= Focal Point Placticity
menuName= Inertia Tensor
menuName= Mitosis
menuName= Parameter Scan Command Line
menuName= Python Utilities
menuName= SBML Solver
menuName= Scientific Plots
menuName= Scientific Plots Histograms
menuName= Secretion / Uptake
menuName= Simulation
menuName= Visit
************PLUGIN NAME= PluginCCDCPPHelper
name=PluginCCDCPPHelper
fileName=C:\CompuCell3D-64bit\Twedit++5\Plugins\PluginCCDCPPHelper.py
author=Maciej Swat
autoactivate=True
deactivateable=True
version=0.9.0
className=CC3DCPPHelper
packageName=__core__
shortDescription=Plugin assists with CC3D C++ module development scripting
longDescription=This plugin provides provides users with CC3D C++ code generator and code snippets - making CC3D C++ plugin and steppable development more convenient.
LOADING PluginCCDCPPHelper from C:\CompuCell3D-64bit\Twedit++5\Plugins\PluginCCDCPPHelper.py
loading source for C:\CompuCell3D-64bit\Twedit++5\Plugins\PluginCCDCPPHelper.py
version= 0.9.0 className= CC3DCPPHelper pluginClass= <class 'PluginCCDCPPHelper.CC3DCPPHelper'>
WILL TRY TO ACTIVATE <PluginCCDCPPHelper.CC3DCPPHelper object at 0x000000000588B558>
menuName= Cell Attributes
menuName= Include
menuName= Module Setup
menuName= Visit
menuName= XML Utils
ACTIVATED
************PLUGIN NAME= PluginCCDMLHelper
name=PluginCCDMLHelper
fileName=C:\CompuCell3D-64bit\Twedit++5\Plugins\PluginCCDMLHelper.py
author=Maciej Swat
autoactivate=True
deactivateable=True
version=0.9.0
className=CC3DMLHelper
packageName=__core__
shortDescription=Plugin which assists with CC3D Python scripting
longDescription=This plugin provides provides users with CC3D Python code snippets - making Python scripting in CC3D more convenient.
LOADING PluginCCDMLHelper from C:\CompuCell3D-64bit\Twedit++5\Plugins\PluginCCDMLHelper.py
loading source for C:\CompuCell3D-64bit\Twedit++5\Plugins\PluginCCDMLHelper.py
version= 0.9.0 className= CC3DMLHelper pluginClass= <class 'PluginCCDMLHelper.CC3DMLHelper'>
WILL TRY TO ACTIVATE <PluginCCDMLHelper.CC3DMLHelper object at 0x000000000588B798>
ACTIVATED
_settingName= RecentProjects
recentItems= [u'C:\\CompuCell3D-64bit\\pauli\\aggregation\\PKD_paper_codes\\isoCyst\\isoCyst.cc3d', u'C:\\CompuCell3D-64bit\\Demos\\BookChapterDemos_ComputationalMethodsInCellBiology\\VascularTumor\\VascularTumor.cc3d', u'C:\\CompuCell3D-64bit\\pauli\\aggregation\\PKD_paper_codes\\tubule\\PKD.cc3d', u'C:\\CompuCell3D-64bit\\pauli\\movements\\m19\\okok\\peitto.cc3d', u'C:\\CompuCell3D-64bit\\pauli\\aggregation\\PTAtoRV-STANDARD\\aggregration\\aggregration.cc3d', u'C:\\CompuCell3D-64bit\\Demos\\BookChapterDemos_ComputationalMethodsInCellBiology\\okok\\peitto.cc3d', u'C:\\CompuCell3D-64bit\\Demos\\BookChapterDemos_ComputationalMethodsInCellBiology\\cellsorting2\\cellsorting.cc3d', u'C:\\CompuCell3D-64bit\\Demos\\BookChapterDemos_ComputationalMethodsInCellBiology\\cellsorting\\cellsorting.cc3d']
__loadRecentProject
GOT SUSTOM SETTINGS : C:\CompuCell3D-64bit\Demos\BookChapterDemos_ComputationalMethodsInCellBiology\okok\Simulation\_settings.sqlite
projParent= peitto.cc3d
__openXMLPythonInEditor pdh.cc3dSimulationData.xmlScript= C:\CompuCell3D-64bit\Demos\BookChapterDemos_ComputationalMethodsInCellBiology\okok\Simulation\peitto.xml
__openXMLPythonInEditor pdh.cc3dSimulationData.xmlScriptResource.path= C:\CompuCell3D-64bit\Demos\BookChapterDemos_ComputationalMethodsInCellBiology\okok\Simulation\peitto.xml
opening file C:\CompuCell3D-64bit\Demos\BookChapterDemos_ComputationalMethodsInCellBiology\okok\Simulation\peitto.xml
DONE READING: file C:\CompuCell3D-64bit\Demos\BookChapterDemos_ComputationalMethodsInCellBiology\okok\Simulation\peitto.xml
opening file C:\CompuCell3D-64bit\Demos\BookChapterDemos_ComputationalMethodsInCellBiology\okok\Simulation\peitto.py
DONE READING: file C:\CompuCell3D-64bit\Demos\BookChapterDemos_ComputationalMethodsInCellBiology\okok\Simulation\peitto.py
opening file C:\CompuCell3D-64bit\Demos\BookChapterDemos_ComputationalMethodsInCellBiology\okok\Simulation\peittoSteppables.py
DONE READING: file C:\CompuCell3D-64bit\Demos\BookChapterDemos_ComputationalMethodsInCellBiology\okok\Simulation\peittoSteppables.py
projParent= peitto.cc3d
RESOURCENAME
projParent= peitto.cc3d
CurrentItem= peitto.cc3d parent= None
getFullPath= projParent= peitto.cc3d
projectFullPath= C:\CompuCell3D-64bit\Demos\BookChapterDemos_ComputationalMethodsInCellBiology\okok\peitto.cc3d
TRY TO FIGURE OUT PORT
CHECKING PORT= 47406
CHECKING PORT= 47407
established empty port= 47407
self.cc3dPath= C:\CompuCell3D-64bit\compucell3d.bat
Executing Popen command with following arguments= ['C:\\CompuCell3D-64bit\\compucell3d.bat', '--port=47407', '-i', u'C:\\CompuCell3D-64bit\\Demos\\BookChapterDemos_ComputationalMethodsInCellBiology\\okok\\peitto.cc3d']
starting CC3D
['C:\\CompuCell3D-64bit\\player5', 'C:\\CompuCell3D-64bit\\lib\\python', 'C:\\CompuCell3D-64bit\\Python27\\python27.zip', 'C:\\CompuCell3D-64bit\\Python27\\DLLs', 'C:\\CompuCell3D-64bit\\Python27\\lib', 'C:\\CompuCell3D-64bit\\Python27\\lib\\plat-win', 'C:\\CompuCell3D-64bit\\Python27\\lib\\lib-tk', 'C:\\CompuCell3D-64bit\\Python27', 'C:\\CompuCell3D-64bit\\Python27\\lib\\site-packages', 'C:\\CompuCell3D-64bit\\Python27\\lib\\site-packages\\win32', 'C:\\CompuCell3D-64bit\\Python27\\lib\\site-packages\\win32\\lib', 'C:\\CompuCell3D-64bit\\Python27\\lib\\site-packages\\Pythonwin']
compucell3d.pyw: type(argv)= <type 'list'>
compucell3d.pyw: argv= ['--port=47407', '-i', 'C:\\CompuCell3D-64bit\\Demos\\BookChapterDemos_ComputationalMethodsInCellBiology\\okok\\peitto.cc3d', '--currentDir=C:\\CompuCell3D-64bit']
CONSOLE PARENT= <UI.UserInterface.DockWidget object at 0x000000000AF34678>
self.baseFont.fixedPitch()= True
TWEDIT socket.socketDescriptor()= <sip.voidptr object at 0x000000000AF2E850>
TRY TO FIGURE OUT PORT
CHECKING PORT= 47406
CHECKING PORT= 47407
CHECKING PORT= 47408
established empty port= 47408
CALL establishConnection
self.__fileName= C:\CompuCell3D-64bit\Demos\BookChapterDemos_ComputationalMethodsInCellBiology\okok\peitto.cc3d
GOT SUSTOM SETTINGS : C:\CompuCell3D-64bit\Demos\BookChapterDemos_ComputationalMethodsInCellBiology\okok\Simulation\_settings.sqlite
currentIteration= [3]
multiplicativeFactors= [1]
iterationId= 3
Error Parsing Parameter scan file
Traceback (most recent call last):
File "C:\CompuCell3D-64bit\player5\compucell3d.pyw", line 258, in <module>
error_code = main(sys.argv[1:])
File "C:\CompuCell3D-64bit\player5\compucell3d.pyw", line 239, in main
mainWindow.viewmanager.processCommandLineOptions(cml_args)
File "C:\CompuCell3D-64bit\player5\Plugins\ViewManagerPlugins\SimpleTabView.py", line 687, in processCommandLineOptions
self.__runSim()
File "C:\CompuCell3D-64bit\player5\Plugins\ViewManagerPlugins\SimpleTabView.py", line 1815, in __runSim
self.prepareSimulation()
File "C:\CompuCell3D-64bit\player5\Plugins\ViewManagerPlugins\SimpleTabView.py", line 1775, in prepareSimulation
self.__loadSim(file)
File "C:\CompuCell3D-64bit\player5\Plugins\ViewManagerPlugins\SimpleTabView.py", line 1015, in __loadSim
self.__loadCC3DFile(fileName)
File "C:\CompuCell3D-64bit\player5\Plugins\ViewManagerPlugins\SimpleTabView.py", line 1169, in __loadCC3DFile
psu.replaceValuesInSimulationFiles(_pScanFileName=pScanFilePath, _simulationDir=customOutputPath)
File "C:\CompuCell3D-64bit\pythonSetupScripts\ParameterScanUtils.py", line 757, in replaceValuesInSimulationFiles
self.replaceValuesInXMLFile(_parameterScanDataMap = parameterScanDataMap , _xmlFile=fullFilePath)
File "C:\CompuCell3D-64bit\pythonSetupScripts\ParameterScanUtils.py", line 674, in replaceValuesInXMLFile
elem=self.getXMLElementFromAccessPath(root_element,accessPathList)
File "C:\CompuCell3D-64bit\pythonSetupScripts\ParameterScanUtils.py", line 629, in getXMLElementFromAccessPath
tmpElement=tmpElement.getFirstElement(arg[0],attrDict) if attrDict is not None else tmpElement.getFirstElement(arg[0])
AttributeError: 'NoneType' object has no attribute 'getFirstElement'
CLOSING LOCAL SOCKET
"SIMULATION FINISHED"
Answer:
id: mbzoe | creation_date: Feb. 26, 2018, 11:19 p.m. | author: Maciek Swat | type: Answer |
parent: klopb | lastedit_date: Feb. 26, 2018, 11:19 p.m. | lastedit_user: Maciek Swat |
content:
Could you post s short version of your simulation where the problem occurs?
Answer:
id: ggjka | creation_date: Feb. 28, 2018, 3:18 a.m. | author: Pauli Tikka | type: Answer |
parent: klopb | lastedit_date: Feb. 28, 2018, 3:23 a.m. | lastedit_user: Pauli Tikka |
content:
Hi,
Here is a short video about the crash (that occurs around 56s in the video) when I start to add the parameter scan to my cc3d model in twedit++5.
So the player goes on, but the twedit++5 crashes after attempting to add the scan.
Best,
Pauli
File attached: adding parameter scan results to crash.mp4 (2.12 MB)
attachments(redirected):
.\CC3D_allanswered_linked_files\adding parameter scan results to crash.mp4
Answer:
id: ggaml | creation_date: March 15, 2018, 10:35 a.m. | author: Pauli Tikka | type: Answer |
parent: klopb | lastedit_date: March 15, 2018, 10:38 a.m. | lastedit_user: Pauli Tikka |
content:
What to do, here is what I also get?:
attachments(redirected):
.\CC3D_allanswered_linked_files\cpp_error.png
Answer:
id: jrmll | creation_date: March 15, 2018, 11:39 a.m. | author: James Sluka | type: Answer |
parent: klopb | lastedit_date: March 15, 2018, 11:47 a.m. | lastedit_user: James Sluka |
content:
The path to the .piff file is odd, there is a single slash whereas all the other directory delimiters are back slashes. Check your code for a bad path to the piff file. Also, take a look in the the .cc3d file and see if the piff file is listed there and make sure the path has the correct delimiters. It looks like you are on a Windows system and Windows is "supposed" to be able to handle slashes or backslashes in paths, but that could still be the problem.
If you are using a .piff file you can include it in the .cc3d file by importing into the project in Twedit++. Use "Add resource", tell it the file is a piff, then browse to the file. If the file is already in the Simulation directory Twedit++ will complain that it can't copy the file. Regardless, you just need to make sure there is a copy in the Simulation folder and that that is included in the project's .cc3d file. That way when the various files are all copied for the parameter scan the .piff file goes with them. So, in general, the .piff file should be in the Simulation folder for the CC3D project.
Answer:
id: avxgm | creation_date: March 16, 2018, 11:24 a.m. | author: Pauli Tikka | type: Answer |
parent: klopb | lastedit_date: March 16, 2018, 11:51 a.m. | lastedit_user: Pauli Tikka |
content:
Hi,
Thank you for your answer!
I did what you recommended (see peitto.cc3d), and inserted the piff file to .cc3d file separately.
I encountered some problems (see below), but was able to add the parameter scan, and modify it manually line-by-line. So I now have parameter scan, but If I want to add new elements to scan, I need to write them directly to the xml code myself.
Next question would be, how to save the result file in the parameter_scan subfolder (and not a folder, so that the previous results would not wipe the one iteration round older file/s)?
E.g. what to do in steppables.py file to lines like(?):
FileName = "C:/pyintro/positions.csv" # you can add some specific facts to the file if needed
self.File = open(FileName,"w",0) # the 0 is for initial memory 'flush', needed for total print of the file
self.File.write("cell_no,time_mcs,x_position_(px),y_position_(px),z_position_(px)\n")
Best,
Pauli
File attached: peitto.cc3d (407 Bytes)
File attached: errorlog_param_tikka16318.txt (3.22 KB)
attachments(redirected):
.\CC3D_allanswered_linked_files\cpp_error2.png
Comment:
id: nqbgv | creation_date: March 16, 2018, 11:34 a.m. | author: James Sluka | type: Comment |
parent: avxgm | lastedit_date: March 16, 2018, 11:36 a.m. | lastedit_user: James Sluka |
content:
That is the message the parameter scan process gives when the scan is complete. If you have old folders in the directory structure then when the scan tries to create the folder for a new scan it fails. The scan process can't differentiate between old and unneeded scan folders and new folders created during the current scan process.
You just need to delete all those old numbered folders before restarting a scan.
If you restart a scan you also have to edit the scan xml file and set the pointers back to zero.
For example, from one of my scan files;
<Parameter CurrentIteration="3" Name="pbpk_kGutabs" Type="PYTHON_GLOBAL" ValueType="float">
CurrentIteration needs to be reset back to zero.
Comment:
id: vnarj | creation_date: March 19, 2018, 12:13 p.m. | author: Pauli Tikka | type: Comment |
parent: nqbgv | lastedit_date: March 19, 2018, 12:14 p.m. | lastedit_user: Pauli Tikka |
content:
Hi,
Thanks! I got it now.
In addition, I can save the different iteration files under different names to the same scan folder.
Regards,
Pauli
Comment:
id: jrbrp | creation_date: March 20, 2018, 9:15 a.m. | author: Pauli Tikka | type: Comment |
parent: vnarj | lastedit_date: March 20, 2018, 9:15 a.m. | lastedit_user: Pauli Tikka |
content:
Ah no!! The crashing problem reoccurred, but in a different place and context. I still wanted to scan parameters automatically via scan editor, but the twetedit program crashes immediately when I push ok after inserting the values in the 'scannable parameters' window. What to do, continue with manual approach or rewrite the whole code in other folder etc.?
Comment:
id: avevp | creation_date: March 20, 2018, 9:29 a.m. | author: Pauli Tikka | type: Comment |
parent: jrbrp | lastedit_date: March 20, 2018, 9:29 a.m. | lastedit_user: Pauli Tikka |
content:
Oo! I think I now got it all finally. I changed the folder, and deleted all extra files from simulation folder (+chekced the .cc3d file again), and now I can do the scans normally with the editor. Thanks!
Answer:
id: awbpm | creation_date: July 10, 2018, 6:42 a.m. | author: Pauli Tikka | type: Answer |
parent: klopb | lastedit_date: July 10, 2018, 6:42 a.m. | lastedit_user: Pauli Tikka |
content:
The diffusion constant scan was not working properly, here it how it should be modified, please correct it for the automatic version!
The first scan is ok:
<ParameterScan version="3.7.0">
<OutputDirectory>NewSimulation_ParameterScan</OutputDirectory>
<ParameterList Resource="Simulation/NewSimulation.xml">
<Parameter CurrentIteration="0" Name="GlobalDiffusionConstant" Type="XML_CDATA" ValueType="float">
[['CompuCell3D','Revision','20180621','Version','3.7.8'],['Steppable','Type','DiffusionSolverFE'],['DiffusionField','Name','Wnt9b'],['GlobalDiffusionConstant']]
<Values>0,1,3,4,6</Values>
</Parameter>
<!-- <Parameter CurrentIteration="0" Name="GlobalDiffusionConstant" Type="XML_CDATA" ValueType="float"> -->
<!-- [['CompuCell3D','Revision','20180621','Version','3.7.8'],['Steppable','Type','DiffusionSolverFE'],['DiffusionField','Name','Wnt9b'],['DiffusionData'],['GlobalDiffusionConstant']] --> WRONG! do not know why, but does not work with diffusion data field
<!-- <Values>0.5,1.625,2.75,3.875,5.0</Values> -->
<!-- </Parameter> -->
</ParameterList>
</ParameterScan>
Comment:
id: povek | creation_date: July 10, 2018, 8:29 a.m. | author: Pauli Tikka | type: Comment |
parent: awbpm | lastedit_date: July 10, 2018, 8:29 a.m. | lastedit_user: Pauli Tikka |
content:
oh no, I checked the param scan xml files, and it had not changed the D values... aaa
Answer:
id: wraxn | creation_date: July 12, 2018, 10:50 a.m. | author: Pauli Tikka | type: Answer |
parent: klopb | lastedit_date: July 12, 2018, 10:50 a.m. | lastedit_user: Pauli Tikka |
content:
I reinstalled the newest compucell3d (21618 version), and the problem did not disappear with a test simulation.
Good things:
The cellsorting param demo works (but it does not have D or gamma values),
and also the test simulation, if I modify the param scan specification code excluding diffusion data -field:
<ParameterScan version="3.7.0">
...
<Parameter CurrentIteration="0" Name="GlobalDiffusionConstant" Type="XML_CDATA" ValueType="float">
[['CompuCell3D','Revision','20180621','Version','3.7.8'],['Steppable','Type','DiffusionSolverFE'],['DiffusionField','Name','wnt'], (???)['GlobalDiffusionConstant']]
<Values>...
However, then the (D) values are always the ones at the beginning, e.g. 1,1,...x amount of scans
Have you tested that parameter scan for diffusionsolverFE/DE etc. elements work in the latest cc3d?
You do not necessarily need to drive my simulation, any would do.
Thanks.
Answer:
id: zxarv | creation_date: July 13, 2018, midnight | author: Maciek Swat | type: Answer |
parent: klopb | lastedit_date: July 13, 2018, midnight | lastedit_user: Maciek Swat |
content:
I am attaching ParameterScanUtils.py file
File attached: ParameterScanUtils.py (31.01 KB)
that you may drop in place of the existing one. this file should fix the bug that you saw. to make the patch simply put ParameterScanUtils.py in <CC3D_install_dir>/pythonSetupScripts
We will be releasing 3.7.8 very soona dnthis patch will be included. this is a temporary solution to get you going. Please let me know if it works
attachments(redirected):
.\CC3D_allanswered_linked_files\ParameterScanUtils.py
Answer:
id: xzaok | creation_date: July 13, 2018, 1:17 p.m. | author: James Sluka | type: Answer |
parent: klopb | lastedit_date: July 13, 2018, 1:17 p.m. | lastedit_user: James Sluka |
content:
I tried Maciek's fix.
A PScan of GlobalDiffusionConstant in C:\CompuCell3D-64bit\Demos\SteppableDemos\DiffusionSolverFE\DiffusionSolverFE now works. (It didn't before)
I also tried Pauli's simulation and it also works now. I even scanned two of the diffusion parameters simultaneously.
A minor annoyance. Before doing a pscan you should open CC3D separately from Twedit++ and set the [Tools][Configuration][Project location] and [output] directories correctly for your project. Otherwise CC3D is likely to try to write pscan output to some other directory, which may already have pscan output.
Q66: How does the external potential plugin work
id: lorqn | creation_date: Feb. 16, 2018, 5:43 a.m. | author: Horizon2020 | type: Question |
parent: | lastedit_date: Feb. 23, 2018, 8:36 p.m. | lastedit_user: Maciek Swat |
content:
Hi,
I have been working with the ExternalPotential plugin. I couldn't find the model equations for this plugin in the manuals. After going through the source code, I came to the conclusion that this could be the underlying model equation,
$\Delta H_{force}=\lambda\sum_{pixels}\left(\vec{i'}-\vec{i}\right)$ΔHƒ orce=λ∑pixels(→i'−→i) for the pixelbased calculations and $\Delta H=\lambda\left(\vec{i_{com}'}+\vec{i_{com}}\right)$ΔH=λ(→icom'+→icom) for the center of mass based calculations.
Is my understanding correct? What changes should I make to the equations? Why is the center of mass based equation additive in terms of energy?
Thanks.
Answer:
id: avgqj | creation_date: Feb. 23, 2018, 8:36 p.m. | author: Maciek Swat | type: Answer |
parent: lorqn | lastedit_date: Feb. 23, 2018, 8:36 p.m. | lastedit_user: Maciek Swat |
content:
Yes, your understanding is close to being correct. For the COM based algorithm it computes a displacement vector that would result if the pixel copy is accepted and takes a scalar product of this vector with the vector whose components in the in XML are specified using:
<ExternalPotentialParameters CellType="NonCondensing" x="-10" y="0" z="0"/>
For pixel based algorithm we use similar logic except the first vector (displacement) is specified as a vector difference between target pixel and source pixel. The mechanism of the plugin, though, remains the same
Q67: Cyst formation paper (Belmonte 2016) reproduction problems for reuse in my model
id: loxmz | creation_date: Feb. 23, 2018, 8:48 a.m. | author: Pauli Tikka | type: Question |
parent: | lastedit_date: March 5, 2018, 3:24 p.m. | lastedit_user: James Sluka |
content:
Dear Reader,
I try to reproduce your PKD model code in my modelling process (pretubular aggregate to renal vesicle, including MET) by changing the parameters so that the model output similar as I do have. However, I cannot open the codes (from http://compucell3d.org/Models @PKD_paper_codes) in my compucell3d (see attachement).
For instance, transferring these files (including *.ccds) to my computer's (cc3d) modelling file and making new simulation files.
Thanks for all possible help.
Best regards,
Pauli
File attached: isoCyst_error.txt (434.04 KB)
attachments(redirected):
.\CC3D_allanswered_linked_files\isoCyst_error.txt
Answer:
id: bexnp | creation_date: March 5, 2018, 3:22 p.m. | author: James Sluka | type: Answer |
parent: loxmz | lastedit_date: March 5, 2018, 3:24 p.m. | lastedit_user: James Sluka |
content:
Looking at your log file it looks like you had a succesfull run followed by a different (?) run that failed with the error;
self.errorConsole.playerMainWidget= <Plugins.ViewManagerPlugins.SimpleTabView.SimpleTabView object at 0x000000000756DEE8>
I'm not 100% sure what is wrong but I would start with deleting any files like ".DS_Store" or "_settings.sqlite", or any other file that starts with an underscore character. Those files are used to store player configurations such as where the sub-windows are located, and that info often doesn't transfer well to another computer or operating system. Those files can also cause problems when the are created in one version of CC3D but then executed in another.
p.s. check for the underscore files in both the top level directory where your .cc3d file is located and in the Simulations folder which should be in the same places as the .cc3d file.
Q68: Makefile Problem in CompuCelle3D 3.7.7 Installation
id: vnlzn | creation_date: Feb. 23, 2018, 5:13 p.m. | author: Darth_Malloc | type: Question |
parent: | lastedit_date: Feb. 23, 2018, 10:12 p.m. | lastedit_user: Maciek Swat |
content:
I am in the process of trying to install CompuCell 3D 3.7.7 on a machine that runs Linux Mint 18.
I set up the makefile according to the instructions provided, but when I tried to do the compile step, I got the following error:
core/pyinterface/CC3DXML/CMakeFiles/_CC3DXML.dir/flags.make:10: *** missing separator. Stop.
CMakeFiles/Makefile2:5407: recipe for target 'core/pyinterface/CC3DXML/CMakeFiles/_CC3DXML.dir/all' failed
make[1]: *** [core/pyinterface/CC3DXML/CMakeFiles/_CC3DXML.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
I would greatly appreciate if anyone is able to advise me on how to address this problem.
Answer:
id: klqzg | creation_date: Feb. 23, 2018, 5:22 p.m. | author: Anwar | type: Answer |
parent: vnlzn | lastedit_date: Feb. 23, 2018, 5:22 p.m. | lastedit_user: Anwar |
content:
The problem you have mentioned is very generic. there many libraries that CompuCell3D depends on it is possible that there is some library mismatch. Could you please download try pre-complied linux package available for CompuCell3D from here. Please let me know whether it worked for you or not.
Answer:
id: eqavb | creation_date: Feb. 23, 2018, 10:12 p.m. | author: Maciek Swat | type: Answer |
parent: vnlzn | lastedit_date: Feb. 23, 2018, 10:12 p.m. | lastedit_user: Maciek Swat |
content:
Additional thing that helps us debug is the output of the make command that is executed as follows:
make VERBOSE=1
The verbose argument makes CMake-generated Makefile display full compilation output. So go ahead and run the make command as shown and send us the full output
Q69: How to create a cell sheet consisting of hexagonal cells?
id: vnzma | creation_date: Feb. 28, 2018, 4:09 a.m. | author: Yuan | type: Question |
parent: | lastedit_date: March 5, 2018, 2:31 p.m. | lastedit_user: James Sluka |
content:
Dear all,
I am trying to create a hexagonal cell sheet, as shown below. Each cell is hexagonal and made up of hexagonal pixels. What should I do?
Many thanks.
cell sheet:
each cell:
attachments(redirected):
.\CC3D_allanswered_linked_files\QQ截图20180228170631.png
.\CC3D_allanswered_linked_files\QQ截图20180228165632.png
Answer:
id: mbzpj | creation_date: March 2, 2018, 1:26 p.m. | author: James Sluka | type: Answer |
parent: vnzma | lastedit_date: March 2, 2018, 1:26 p.m. | lastedit_user: James Sluka |
content:
You can specify that CC3D should use a hexagonal lattice with;
<LatticeType>Hexagonal</LatticeType>
in the Potts section of the project's XML file.
Also, take a look at the hexagonal lattice demo in;
C:\CompuCell3D\Demos\SimulationSettings\HexLattice
Finally, for the mathematical details of a hexagonal lattice see;
http://www.compucell3d.org/BinDoc/cc3d_binaries/Manuals/HexagonalLattice.pdf
Comment:
id: zpejg | creation_date: March 2, 2018, 10:08 p.m. | author: Yuan | type: Comment |
parent: mbzpj | lastedit_date: March 2, 2018, 10:08 p.m. | lastedit_user: Yuan |
content:
What should I do if I want to make each cell hexagonal using hexagonal lattice? As shown in the second picture.
Answer:
id: nqzvq | creation_date: March 5, 2018, 2:31 p.m. | author: James Sluka | type: Answer |
parent: vnzma | lastedit_date: March 5, 2018, 2:31 p.m. | lastedit_user: James Sluka |
content:
I've created an extended example of hexagonal cells on a hexagonal lattice.
Here is a zip file of the CC3D code -- File attached: Hexcells2b.zip (7.91 KB)
This uses the blob initializer, which doesn't know about the hex lattice so it will take 10K or more MCS to get the cells to relax into hexagons.
Note that if you want the cells to move then they can not always be perfect hexagons. If you want perfect hexagons then the cells will have to be frozen and wont be able to move.
attachments(redirected):
.\CC3D_allanswered_linked_files\screenshot.png
.\CC3D_allanswered_linked_files\Hexcells2b.zip
Q70: How to degrade ECM pixels?
id: rezpz | creation_date: March 2, 2018, 3:32 a.m. | author: silvana | type: Question |
parent: | lastedit_date: March 3, 2018, 1:37 a.m. | lastedit_user: silvana |
content:
Dear all,
In my simulation once the cancer cell comes in to contact with ECM, starts to secrete MMP and once the MMP concentration in ECM lattice sites reach a threshold, they switches their type from ECM to medium or they die. but my code doesnt work.(ECM is frozen)
Sincerely,
attachments(redirected):
.\CC3D_allanswered_linked_files\Capture.png
Answer:
id: pgzpl | creation_date: March 2, 2018, 12:43 p.m. | author: James Sluka | type: Answer |
parent: rezpz | lastedit_date: March 2, 2018, 12:43 p.m. | lastedit_user: James Sluka |
content:
You can't set the volume and surface qualities for MEDIUM or for a single pixel. You should be able to just set the cell type of the pixel to MEDIUM (cell.type=0).
So try just
px.type=0
and remove the px.target... and px.lambda... commands
If that simple approach doesn't work try
self.cellField.set(px,CompuCell.getMediumCell())
Comment:
id: mbzaj | creation_date: March 3, 2018, 1:24 a.m. | author: silvana | type: Comment |
parent: pgzpl | lastedit_date: March 3, 2018, 1:37 a.m. | lastedit_user: silvana |
content:
Yeah target volume was just an assupmtion and was uncommented and in fact i had used px.type=0 but it didnt work. thank you very much for your help, self.cellField.set(px,CompuCell.getMediumCell()) solved the issue.
Answer:
id: kvnav | creation_date: Oct. 21, 2018, 9:47 a.m. | author: sandeep13712 | type: Answer |
parent: rezpz | lastedit_date: Oct. 21, 2018, 9:47 a.m. | lastedit_user: sandeep13712 |
content:
We have implemented the MMP-dependent ECM degradation in the following paper:
https://www.nature.com/articles/srep19905
If you want to do something like this, I can share the code.
Answer:
id: kvnbl | creation_date: Oct. 22, 2018, 11:06 a.m. | author: James Sluka | type: Answer |
parent: rezpz | lastedit_date: Oct. 22, 2018, 11:06 a.m. | lastedit_user: James Sluka |
content:
Sandeep that is very nice work. If you don't mind sharing the code we would like to add it to the models listed at http://www.compucell3d.org/Models. You can email the files to me at jsluka@indiana.edu.
thanks!
Answer:
id: kvnol | creation_date: Oct. 24, 2018, 11:11 a.m. | author: sandeep13712 | type: Answer |
parent: rezpz | lastedit_date: Oct. 24, 2018, 11:11 a.m. | lastedit_user: sandeep13712 |
content:
@James: Sent the CC3D files to your email.
Sandeep
Q71: Celldraw in CompuCell3D 3.7.7
id: omzwe | creation_date: March 3, 2018, 12:32 a.m. | author: Darth_Malloc | type: Question |
parent: | lastedit_date: March 9, 2018, 6:30 p.m. | lastedit_user: Darth_Malloc |
content:
I am running CompuCell3D 3.7.7 on Linux Mint 17.1. I followed the instructions to compile and install from the source, and for the project I am doing, I need to use Celldraw. However, the celldraw.sh file is missing. Is there some way that I can get it, or if not, is there another way that I can run Celldraw?
Answer:
id: wlzxv | creation_date: March 5, 2018, 2:51 p.m. | author: James Sluka | type: Answer |
parent: omzwe | lastedit_date: March 5, 2018, 3:06 p.m. | lastedit_user: James Sluka |
content:
Did you check the previous versions of CC3D (e.g. 3.6.x) to see if they have the celldraw.sh file? There shouldn't be any difference in celldraw across the last couple of CC3D versions.
If that doesn't work, I have a rough python/CC3D script that will read an image file and convert it to a cc3d cell field. The image file is typically just created in something like MSPaint. If you need something like that let me know.
Answer:
id: omzve | creation_date: March 5, 2018, 10:08 p.m. | author: Maciek Swat | type: Answer |
parent: omzwe | lastedit_date: March 5, 2018, 10:08 p.m. | lastedit_user: Maciek Swat |
content:
We have changed the Qt version and as a result we do not have Cell Draw in CC3D 3.7.7 because this part of code was not ported but as Jim mentioned if you install 3.7.5 you will get CellDraw. So what you need to do is to install PyQt4 and then you do not even have to compile CC3D but rather CellDraw folder to a directory and run directly from there. If you need help with this let us know and we can assist you
Answer:
id: mbzrj | creation_date: March 5, 2018, 11:32 p.m. | author: Maciek Swat | type: Answer |
parent: omzwe | lastedit_date: March 5, 2018, 11:32 p.m. | lastedit_user: Maciek Swat |
content:
Here are instructions on how to run CellDraw with newer versions of CC3D
http://www.compucell3d.org/SrcBin/CellDrawPyQt4
Comment:
id: eqojj | creation_date: March 9, 2018, 6:30 p.m. | author: Darth_Malloc | type: Comment |
parent: mbzrj | lastedit_date: March 9, 2018, 6:30 p.m. | lastedit_user: Darth_Malloc |
content:
Thank you very much for your help. I have managed to get Celldraw to work.
Q72: Total time of SBML run between each MCS
id: loebv | creation_date: March 8, 2018, 1:48 p.m. | author: Mahua Roy | type: Question |
parent: | lastedit_date: March 9, 2018, 1:44 p.m. | lastedit_user: Mahua Roy |
content:
If I have an SBML file being updated every MCS, where 1MCS = 6 min and I have a step size of 0.2 in my CC3D code, how can I be sure that the final state given out by SBML at the end of 6 min is the same as running the SBML model in COPASI for 6 minutes with the same step size. Currently, the numbers do not match. OR am I wrong in assuming that time in CC3D translates as a same time in COPASI.
To be more clear, I have 1 MCS = 6 min. I update the state of the cell every MCS. Does that mean the total time for SBML model is 6 min with the same step size , 0.2 = 1.2 min ? So should the states at the end of 6 min for COPASI match the state of the cell given out by CompuCell at the end of MCS ?
Answer:
id: qvrop | creation_date: March 8, 2018, 4:36 p.m. | author: James Sluka | type: Answer |
parent: loebv | lastedit_date: March 8, 2018, 4:36 p.m. | lastedit_user: James Sluka |
content:
Is the difference a little or a lot?
How have you set the time step for the SBML in the CC3D code and what is the time step specified in the SBML?
A well done SBML file should include a time unit such as second or hour.
<unitDefinition id="time" name="minute">
When you load the SBML in CC3D you specify the time step for the SBML in the units the SBML file has.
If you are using 1 MCS = 6 minutes in CC3D, and you are updating the SBML every MCS, and the time unit in the SBML is minutes, then when you load the SBML you need to tell it _stepSize=6;
self.addFreeFloatingSBML(_modelFile=modelFile1,_modelName='modNAME',_stepSize=6)
However, if you want time steps of 6 minutes but the SBML file time unit is hour then you’ll need;
self.addFreeFloatingSBML(_modelFile=modelFile1,_modelName='modNAME', _stepSize=0.1)
Every time you step the SBML with self.timestepSBML() the SBML will move forward in time by _stepSize*<whatever the SBML files internal time unit is>
You can also call the SBML more or less often than every MCS and adjust the setting to account for that. Often in a CC3D model the time scale represented by the spin flips is much faster than you need to run the SBML. So, you might only update the SBML every 10 MCS and you set the "_stepSize” to match that.
In your case though, if 1 MCS is 6 minutes then the SBML time scale is probably faster than the spin flip time scale and updating only once every 6 minutes might not be enough.
If you are sure of your time units and stepping, then the next possibility is that the time is off between CC3D and the SBML. It is possible that the time is off by one time step. I've played around with the SBML simple demo SBMLSolver (C:\CompuCell3D\Demos\SBMLSolverExamples folder) and it looks to me like that is the case; CC3D is one time step ahead of the SBML.
Comment:
id: vnorq | creation_date: March 8, 2018, 5:19 p.m. | author: Mahua Roy | type: Comment |
parent: qvrop | lastedit_date: March 8, 2018, 5:19 p.m. | lastedit_user: Mahua Roy |
content:
I changed the step size to 6 in CC3D code since my time unit is in minutes. You are right, the concentration that I am getting after 1 MCS (6 min) is actually exactly equal to the concentration after 12 min in COPASI.
In that case, If I am right should I have my step size in cc3D code as 3 so as to give out concentrations every six minutes(in real time)
Comment:
id: avxlx | creation_date: March 8, 2018, 7:09 p.m. | author: James Sluka | type: Comment |
parent: vnorq | lastedit_date: March 8, 2018, 7:09 p.m. | lastedit_user: James Sluka |
content:
If you change the the time step to 3 you'll be scaling all time by 50%. I think the problem is a constant offset of 1 MCS between the two. So if 3 doesn't work try something like;
if mcs > 1:
<time step the SBML> # skips the first sbml time step
or, to shift one time step the other way;
if mcs == 1;
<time step the SBML> # an extra time step at startup
<time step the SBML>
Comment:
id: mblqo | creation_date: March 9, 2018, 1:44 p.m. | author: Mahua Roy | type: Comment |
parent: avxlx | lastedit_date: March 9, 2018, 1:44 p.m. | lastedit_user: Mahua Roy |
content:
Yes, skipping the first step works. Thank you.
Q73: Change in Energy as Ouput
id: jrbgp | creation_date: March 20, 2018, 5:25 p.m. | author: James | type: Question |
parent: | lastedit_date: March 22, 2018, 2:34 p.m. | lastedit_user: James |
content:
Hi all,
I am wondering if it is possible to access the change in energy calculation output in python so it can be plotted it later on or even analyzed.
I know that the energy change appears in the cmd output per MCS, but I would like to save it as an output for analysis.
Is this possible and if so, how?
Thank you!
Answer:
id: aveak | creation_date: March 22, 2018, 7:50 a.m. | author: James Sluka | type: Answer |
parent: jrbgp | lastedit_date: March 22, 2018, 7:50 a.m. | lastedit_user: James Sluka |
content:
You can access the current energy with;
self.potts.getEnergy()
To get the delta energy you'll need to save the energy from step to step.
Answer:
id: rebpr | creation_date: March 22, 2018, 2:34 p.m. | author: James | type: Answer |
parent: jrbgp | lastedit_date: March 22, 2018, 2:34 p.m. | lastedit_user: James |
content:
Thanks for the help!
Q74: Steady state diffusion with hexagonal lattice
id: ggppp | creation_date: March 28, 2018, 3:30 p.m. | author: Todd Zurlinden | type: Question |
parent: | lastedit_date: April 2, 2018, 10:08 p.m. | lastedit_user: Maciek Swat |
content:
Is it possible to use a hexagonal lattice with SteadyStateDiffusionSolver2D? I'm able to create my steady state field with the square lattice, but changing to hexagonal causes CC3D to crash.
As outlined in the manual, adding the "AutoscaleDiffusion" tag to FlexibleDiffusionSolverFE allows you to use the hexagonal lattice. Is there a similar tag or trick that can be used for SteadyStateDiffusionSolver2D?
Thanks!
Answer:
id: kgnmx | creation_date: April 2, 2018, 10:08 p.m. | author: Maciek Swat | type: Answer |
parent: ggppp | lastedit_date: April 2, 2018, 10:08 p.m. | lastedit_user: Maciek Swat |
content:
I think this would not work actually. We used off-the-shelf code for steady state solver and it was written for Cartesian Lattice. It was one of the reasons why in our paper we had to stick to Cartesian Lattice
http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0127972
Q75: How can I know the number of cells in a certain volume interval
id: xznml | creation_date: April 12, 2018, 7:15 a.m. | author: dali Zan | type: Question |
parent: | lastedit_date: April 12, 2018, 2:31 p.m. | lastedit_user: James Sluka |
content:
I want to know the volume distribution of cells in the model.
Comment:
id: erqko | creation_date: April 12, 2018, 12:27 p.m. | author: priyomadhyapok | type: Comment |
parent: xznml | lastedit_date: April 12, 2018, 12:27 p.m. | lastedit_user: priyomadhyapok |
content:
Probably easy way would be to check whether (cell.xCOM,cell.yCOM,cell.zCOM) lies within your interval (some min_x:some max_x,some min_y: some max_y, some min_z:some max_z), then quantifying how many cells do? If you wanted something fancier could find out the location of the boundary pixels and impose a stricter constraint maybe
Comment:
id: lkogg | creation_date: April 12, 2018, 1:14 p.m. | author: dali Zan | type: Comment |
parent: erqko | lastedit_date: April 12, 2018, 1:14 p.m. | lastedit_user: dali Zan |
content:
It may not be possible to indirectly represent the volume of cells by limiting the intervals of each axis, because the shape of the cells is irregular and the length gap is very large on each axis. Can't it be retrieved directly through the cell specific volume value?
Answer:
id: xzzbz | creation_date: April 12, 2018, 2:31 p.m. | author: James Sluka | type: Answer |
parent: xznml | lastedit_date: April 12, 2018, 2:31 p.m. | lastedit_user: James Sluka |
content:
Attached is a zip file with one approach. The space is divided up into cubes of a fixed size, then the number of cells of each type that have their center of mass in a particular cube is counted.
Scroll down to the bottom of the steppables file for the code. I've used ### to comment the counting routine.
The output looks like this;
80 60 0 Type=1 #= 7 Type=2 #= 5 Type=3 #= 0
80 80 0 Type=1 #= 8 Type=2 #= 8 Type=3 #= 0
80 100 0 Type=1 #= 10 Type=2 #= 7 Type=3 #= 0
80 120 0 Type=1 #= 6 Type=2 #= 8 Type=3 #= 0
The first three columns are the x,y,z coordinates for the pixel nearest the origin in a box. 80,100,0 means a box 20 pixels in each direction (except Z since this is a 2D model) with 80=<x<100 and 100<=y<120. The model has three cells types, 1,2,3, and the counts of each cell type in each cube is given. So the first line says that for the cube 80<=x<100, 60<=y<80, z=0 there are 7 cells of type 1, 5 of type 2 and none of type 3.
The size of the cube is defined by "cubeEdge" in the steppables file.
File attached: CountCellsInVolume_cellsort_2D_growing_cells_mitosis_using_steppable.zip (11.19 KB)
attachments(redirected):
.\CC3D_allanswered_linked_files\CountCellsInVolume_cellsort_2D_growing_cells_mitosis_using_steppable.zip
Q76: How can I access and modify diffusion data (such as the decay constant) in Python?
id: gnnjr | creation_date: April 19, 2018, 3:08 p.m. | author: Yen Nguyen Edalgo | type: Question |
parent: | lastedit_date: April 22, 2018, 4:15 p.m. | lastedit_user: Maciek Swat |
content:
Hi,
Say I want to add a steppable in Python to vary the values of the diffusion constant and decay constant from the diffusion data specified in XML for one of the chemical fields involved in the system. Basically, I want to have the values of these constants varied in certain conditions. So I know how to access the concentration field from the Python Scripting Manual, but not sure how to access and monitor the diffusion data in Python.
Thank you in advance,
Answer:
id: nxonj | creation_date: April 22, 2018, 4:15 p.m. | author: Maciek Swat | type: Answer |
parent: gnnjr | lastedit_date: April 22, 2018, 4:15 p.m. | lastedit_user: Maciek Swat |
content:
This is called steering and you can do it from Python. Here is the tutorial/instruction you would follow to have it set up.
http://pythonscriptingmanual.readthedocs.io/en/latest/steering_changing_cc3dml_parameters_on-the-fly.html?highlight=steering
Please scroll down and take a look at the "Simplifying steering - XML access path" section. It has instructions for how to implement steering using simpler API
If you have any questions or problems please let us know . If something is unclear in the manual let us know and we will fix the text
Q77: get deltaH from every plugin
id: gnnar | creation_date: April 20, 2018, 5:18 a.m. | author: Tahir | type: Question |
parent: | lastedit_date: May 7, 2018, 11:14 p.m. | lastedit_user: Maciek Swat |
content:
Is there a way to save the change in the energy from every plugin ( VolumeLocalFlex, contact, ContactInternal and FocalPointPlasticity plugins) from Python or XML? I would like to plot all these different sources of deltaH together with the overall change in energy of the system.
I see that overall system current energy can be found using self.potts.getEnergy() and then save this term for every Step to calculate deltaH. But how would i obtain similar energy from every plugin?
Another thing I would like to know is that, can we calculate the change in energy from plugins and over all system in a certain part of the grid to observe local variations?
Any help will be highly appreciated. Thanks.
Answer:
id: ponwr | creation_date: April 22, 2018, 4:21 p.m. | author: Maciek Swat | type: Answer |
parent: gnnar | lastedit_date: April 22, 2018, 4:21 p.m. | lastedit_user: Maciek Swat |
content:
Yes, there is with one limitation. It can only be used when you are using single CPU.
Take a look at demos in Demos/SimulationSettings/SimulationStatistics/. there are 3 demos there. One saves output for every pixel copy attempt and at lease one saves cumulative delt H for each plugin during entire MCS.
You may also read pages 3-8 in the CC3D reference Manual. Some information there might be outdated but it will give you an idea how to set up detailed statistical output of the energy terms at each MCS
http://www.compucell3d.org/BinDoc/cc3d_binaries/Manuals/CompuCell3D_Reference_Manual_v.3.7.4.pdf
Answer:
id: gnowk | creation_date: May 7, 2018, 8:32 a.m. | author: Tahir | type: Answer |
parent: gnnar | lastedit_date: May 7, 2018, 8:32 a.m. | lastedit_user: Tahir |
content:
Dear Maciek,
Thank you for your reply. I followed your suggestion and used the following commands in the XML code to extract cumulative delta H for each plugin.
<EnergyFunctionCalculator Type="Statistics">
<OutputFileName Frequency="10">statData_1.txt</OutputFileName>
</EnergyFunctionCalculator>
It saved output for every plugin but every plugin has 3 columns (Accpted, rejected and Total). Moreover, There are three more additional columns denoted as NAcc, NRej and NTot. Is this NTot is the cumulative delta H of the whole system? In my case, this value is positive and very high number 25,000+ throughout the simulation, however, if this is change in energy, I would expect it to be negative due to energy minimisation? Another thing I noticed is that, the NTot is too high whereas the data from every plugin (Total columns) is on a very small scale (between 0-40 but still positive numbers). In principal, when I add up energies from all the plugins, I should get the total energy of the system. Is that right?
Can you please guide me further as soon as possible. Thanks a lot in advance.
Comment:
id: nxwgr | creation_date: May 7, 2018, 10:33 a.m. | author: Tahir | type: Comment |
parent: ponwr | lastedit_date: May 7, 2018, 10:33 a.m. | lastedit_user: Tahir |
content:
Hi Maciek, Thanks for your suggestion, I tried it but still having some issues with it. Can you please have a look at my detailed comment on this post below. Thanks
Answer:
id: lkleb | creation_date: May 7, 2018, 11:14 p.m. | author: Maciek Swat | type: Answer |
parent: gnnar | lastedit_date: May 7, 2018, 11:14 p.m. | lastedit_user: Maciek Swat |
content:
Ntot is the number of total pixel copy attempts that resulted in evaluation of delta H. NRej - number of rejected pixel copy attempts NAcc - number of accepted copy attempts.
Ntot=NAcc + NRej
So the 25000 + corresponds to the total number of attempted pixel copies for which CC3D evaluated delta H. The reason it is different from step to step is that for some some of the attempts CC3D does not evaluate energy because source and destination pixel belong to the same cell.
The energies are listed in Subsequent columns. Yes, when you add delta H listed in each column multiplied by NAcc for each plugin you will get a number that is roughly equal to the overall change of energy reported on the main screen.
What is reported in the columns of of the statData_1.txt is the average and std dev of delta H for each plugin per pixel copy attempt. I know this might sound confusing so let me explain more. During each MCS there will be many evaluations of delta H from each plugin. CC3D keeps track of every single delta H due to a single pixel copy attempt. At the end of MCS it will compute the average delta H (hence delta H per pixel copy attempt) and the standard dev.
I hop this makes sense but if it is unclear let me know
Q78: Cell Specific Plugin Energy
id: zxgno | creation_date: April 24, 2018, 12:53 p.m. | author: Calvin | type: Question |
parent: | lastedit_date: April 30, 2018, 1:08 p.m. | lastedit_user: Calvin |
content:
Dear all,
I saw the post below for deltaH and am wondering its it's possible to extract a specific plugin energy for a specific cell. For example, if neighbor order is set to 2 and we have cell 1 surrounded by other cells, is it possible to extract the total contact energy cell 1 shares with its environment? Ideally, I would like to do this in python if possible.
Also forgot to include, as long as the lattice is relatively larger than the cpu, will these extracted plugin energies be "accurate" if I run CC3D in parallel? By accurate I mean the energy is effectively not modified twice in the same MCS by 2 or more cpus. My sim conditions are: 10-16 cpus on a 100x100x100 lattice with default flip to dim ratio, which I believe is 1).
Sorry for the long paragraph and thanks!
Answer:
id: lknlq | creation_date: April 24, 2018, 2:48 p.m. | author: James Sluka | type: Answer |
parent: zxgno | lastedit_date: April 24, 2018, 2:48 p.m. | lastedit_user: James Sluka |
content:
I don't think the per-cell data is available (Maciek would know for sure). If you are only doing a few cells, and only occasionally, you might be able to re-calculate the energies of interest in python.
What are you trying to do? If you want to modify the adhesion properties of a cell based on its adhesion partners I think you could do that more efficiently by just using the contact surface area to modify the adhesion constant or to modify the expression level of the adhesion molecules.
Regarding the use of multiple CPUs, I think the only time the energies would be inaccurate would be if you were tracking them on a per spin flip attempt basis. Normally you would access the energy at the end of an MCS so all the cpu's will have completed their work for that step.
Comment:
id: rrvqz | creation_date: April 24, 2018, 3:36 p.m. | author: Calvin | type: Comment |
parent: lknlq | lastedit_date: April 24, 2018, 4:30 p.m. | lastedit_user: Calvin |
content:
Thanks for the help. This is mainly a parameter issue for me at this point.
I am trying to access the per cell data as a way to calibrate temperature in cellular potts.
I have been using the modified contact surface area method but I still need to choose a number like 100 for the maximum possible temperature for any cell. Therefore, cells will have temperature between ~0-100.
Essentially I am trying to avoid the use of the arbitrary baseline temperature parameter.
Thanks again!
Answer:
id: bazwp | creation_date: April 28, 2018, 8:02 p.m. | author: Maciek Swat | type: Answer |
parent: zxgno | lastedit_date: April 28, 2018, 8:02 p.m. | lastedit_user: Maciek Swat |
content:
So this type of information would require some C++ coding. As of now you cannot see every energy term that CC3D handles in the C++ code. Another issue is that we actually do not calculate "absolute" energy but rather a change in energy due to a pixel copy attempt.
The demos that output detailed "energy statistics" (see Demo/SimulationSettings/SimulationStatistics) do require that you run on a single CPU. In fact before you start runing CC3D on multiple CPU's it is best to make sure your simulation works fine on 1 CPU.
So in summary, if you really need that detailed level of output you would need to compile CC3D from source and modify e.g. contact plugin to output this information. It is not difficult to do but exposing such capability to Python has not been done.
Hope it helps
Answer:
id: qwbqa | creation_date: April 28, 2018, 9:07 p.m. | author: Maciek Swat | type: Answer |
parent: zxgno | lastedit_date: April 28, 2018, 9:07 p.m. | lastedit_user: Maciek Swat |
content:
the following demo
Demo/SimulationSettings/SimulationStatistics/spin_flip_stats
will output detailed data for change in energy at ever pixel copy attempt. It does not however output which cell it a given pixel belongs to. This is however something we could add to the code
when you add the following code to the Potts section
<EnergyFunctionCalculator Type="Statistics">
<OutputFileName Frequency="10">cellsort_2D_statistics_spin_flip_statData.txt</OutputFileName>
<OutputCoreFileNameSpinFlips Frequency="1" GatherResults="" OutputAccepted="" OutputRejected="" OutputTotal="">statDataSingleFlip</OutputCoreFileNameSpinFlips>
</EnergyFunctionCalculator>
CC3D will output 3 files (they will be stored in the directory from which you execute CC3D Player - most likely <CC3D installation dir>/player5 - thi sia a bit of an inconvenience - we will fix it though)statDataSingleFlip.accepted.txt
statDataSingleFlip.rejected.txt
statDataSingleFlip.total.txt
Those files have information about what happened at ever pixel copy.
we could add more information there to make it more usefu.l What type of information would you like to have included in addition to the one that we output currently?
Comment:
id: bazxk | creation_date: April 30, 2018, 1:08 p.m. | author: Calvin | type: Comment |
parent: qwbqa | lastedit_date: April 30, 2018, 1:08 p.m. | lastedit_user: Calvin |
content:
Hi
Regarding the SimulationStatistics, the information given there already works great for me. I do have one more question about using multiple CPUS. I'm able to still get energy output despite using multiple CPUS if I use the change number of worknodes code in python. Is the energy output there still "accurate", so long as the cell in general is much larger than the number of CPUS used? I've tested both single and multi CPU but I can't detect if the difference is just due to fluctuations or the actual CPUS.
Thanks you both for all the help! It is much appreciated.
Q79: how to model cell neucleus, cytoplasm and membrance?
id: wrkwq | creation_date: April 25, 2018, 2:34 a.m. | author: silvana | type: Question |
parent: | lastedit_date: May 7, 2018, 11:21 p.m. | lastedit_user: Maciek Swat |
content:
Dear all,
I wonder if i could model cell nucleus, cytoplasm and membrance according to attached paper. i dont know how to estimate proper values of target surface and target volume especially for membrance so that it dosnt get fragmented(for membrance, target surface gets biger than target volume!!! is that the reason of fragmentation?).
Another issue is that when subcellular adhesions got negative the membrance pixels start to come into cytoplasm area.
At the end, have i chosen FocalPointPlasticity parameters values properly?
sincerely,
Silvana
paper:
https://www.sciencedirect.com/science/article/pii/S0010482515001274
File attached: CancerCell.cc3d (267 Bytes)
attachments(redirected):
.\CC3D_allanswered_linked_files\CancerCell.cc3d
Answer:
id: wrkmv | creation_date: April 28, 2018, 11:58 a.m. | author: Maciek Swat | type: Answer |
parent: wrkwq | lastedit_date: April 28, 2018, 11:58 a.m. | lastedit_user: Maciek Swat |
content:
Marco and Luigi published another paper (they used CC3D for their simulations) where they give you parameter values
https://epubs.siam.org/doi/abs/10.1137/100812951
Take a look at it and this should give you some hints.
Regarding negative contact energies:
If you use them you have to use surface constraint plugin ("Surface"). Here is the reason: CC3D minimizes energy and if one of your contact energy coefficients is negative one way to accomplish this is to create as many cell-cell interfaces with negative coefficients as possible . And this is exactly what you see. In order to prevent this you need to add surface constraint for any cell (except Medium) that has negative contact energy coefficient
Comment:
id: poljk | creation_date: May 7, 2018, 4:58 a.m. | author: silvana | type: Comment |
parent: wrkmv | lastedit_date: May 7, 2018, 5:33 a.m. | lastedit_user: silvana |
content:
the paper was helpfull, thank you very much.
I had considered surface constraint for all cell types but the membrance fluctuates. but my question is that when you calculate the target shape constranits for some thin objects(here, cell membrance), can the target perimeter gets higher than target surface? i think in this case the outer pixels start to fluctuate.
Answer:
id: bajre | creation_date: May 7, 2018, 11:21 p.m. | author: Maciek Swat | type: Answer |
parent: wrkwq | lastedit_date: May 7, 2018, 11:21 p.m. | lastedit_user: Maciek Swat |
content:
So here is the explanation of what we mean by surface /volume in 2 and 3 dimensions
in 2D
volume is numerically equal to the surface area of the shape (because our cells have hight of 1 pixel)
Surface is numerically equal to the perimeter of the the shape
in 3D
volume is "true" 3D volume
surface is the surface of the 3D cell
Coming back to your question - when you increase target surface in surface constraint C#D will try to accommodate your request and will start creating single pixels (because isolated pixel brings 4 units of surface in 2D and 6 units in 3D).
to prevent this behavior you have two choices:
1. Use Connectivity constraint - not a bad idea and it will keep your cell connected . The downside is it slows your simulation to some extent
2. Use compartmentalized cells -this is a bit more sophisticated solutions but you can create big variety of cellular shapes shapes.
Let me know if this helps
Q80: Terminology clarification: what exactly are the difference between chemotaxis on a "type-by-type" basis and "cell-by-cell" basis?
id: polbk | creation_date: May 5, 2018, 11:24 p.m. | author: Yen Nguyen Edalgo | type: Question |
parent: | lastedit_date: May 6, 2018, 12:06 a.m. | lastedit_user: priyomadhyapok |
content:
The python codes are introduced for chemotaxis on a cell-by-cell basis at http://pythonscriptingmanual.readthedocs.io/en/latest/chemotaxis_on_a_cell-by-cell_basis.html
Say without the "break" instruction at the end of the first loop, what would be the significance difference occur in the simulation between chemotaxis on a "type-by-type" basis and one on a "cell-by-cell" basis?
Or what would the python codes for chemotaxis on a type-by-type basis might look like compared to ones for cell-by-cell?
Thank you,
Answer:
id: zxnle | creation_date: May 5, 2018, 11:43 p.m. | author: priyomadhyapok | type: Answer |
parent: polbk | lastedit_date: May 5, 2018, 11:43 p.m. | lastedit_user: priyomadhyapok |
content:
Can't seem to access the page you have the link to but this is what the answer is based on what I understood from the question - a type-by-type chemotaxis property will allow you to specify chemotaxis properties for the entire group of cells belonging to a particular type. Something like {for all cells of type A -> add some chemotaxis properties}. In this case all cells of type A will possess the same chemotaxis attribute.
You can also specify properties at the level of an individual cell. For example if you have a particular cell of type A with id i that you want to add chemotaxis properties to and not to the rest you can assign attributes on a cell-by-cell basis {cell_i = some_cell_with_id_i -> add chemotaxis to cell_i}
Comment:
id: oaelq | creation_date: May 5, 2018, 11:55 p.m. | author: Yen Nguyen Edalgo | type: Comment |
parent: zxnle | lastedit_date: May 5, 2018, 11:57 p.m. | lastedit_user: Yen Nguyen Edalgo |
content:
I am sorry, here is the active link:
http://pythonscriptingmanual.readthedocs.io/en/latest/chemotaxis_on_a_cell-by-cell_basis.html
Thank you for sharing your thought. if you take a look at the python codes, I am just wondering, if the "break" instruction is being removed, the "for" loop will eventually go through all the cells and assign the chemotaxis properties to each. Then what might possibly be the difference between doing this loop through all cells than assign the chemotaxis property to the whole type using the chemotaxis plugin in XML?
Comment:
id: mqmwk | creation_date: May 6, 2018, 12:06 a.m. | author: priyomadhyapok | type: Comment |
parent: oaelq | lastedit_date: May 6, 2018, 12:06 a.m. | lastedit_user: priyomadhyapok |
content:
Right. If you remove the break statement all cells of type Macrophage will be assigned the same property and effectively will be the same as defining the property in XML. The idea here was to demonstrate that it is possible to define chemotaxis for a single cell;in this case the first cell from the list of Macrophages and so the break statement came in handy. But it could be any cell (eg a cell with id 100, the last cell from the macrophage list) and the chemotaxis property can be added separately.
cell = self.attemptFetchingCellById(100)
cd = self.chemotaxisPlugin.addChemotaxisData(cell, "ATTR")
cd.setLambda(30.0)
cd.assignChemotactTowardsVectorTypes([self.MEDIUM, self.BACTERIUM])
Q81: Need a good explaination on how to create PIF files with Python
id: wrwxm | creation_date: May 13, 2018, 1:58 p.m. | author: Arthur M | type: Question |
parent: | lastedit_date: May 24, 2018, 3:23 p.m. | lastedit_user: Arthur M |
content:
Hello everyone! I am a student who is trying to do a foam-coarsening simulation. So I have been following the instructions on the quick start manual, but I did not figure out exactly what I must type and where, to generate PIF files with Python... So it would be really kind that someone explain it to me as it is really important for what I am trying to do!
Answer:
id: poakq | creation_date: May 14, 2018, 11:35 a.m. | author: James Sluka | type: Answer |
parent: wrwxm | lastedit_date: May 14, 2018, 11:37 a.m. | lastedit_user: James Sluka |
content:
If you are working through the foam example in the quick start guide I believe there is a pif file already created for that, look for the file “foaminit2D.piff” in the folder “C:\CompuCell3D\Demos\CompuCellPythonTutorial\scientificHistBarPlots\Simulation”.
If you want to create your own piff file, either by hand or using Python, the format is pretty simple. Each line of a pif file has the same format:
Cell_id Cell_type x_low x_high y_low y_high z_low z_high
Where Cell_id is a unique cell index (integer). A PIF may have multiple, possibly non-adjacent, lines starting with the same Cell_id; all lines with the same Cell_id define pixels of the same generalized cell. Cell_type is the name of the type of cell being described. The values x_low, x_high, y_low, y_high, z_low and z_high define rectangles (parallelepipeds in 3D) of pixels belonging to the cell. In the case of overlapping pixels, a later line overwrites pixels defined by earlier lines. The following line describes a 6 x 6-pixel square cell with cell index 0 and type Amoeba:
0 Amoeba 10 15 10 15 0 0
The above could also be done with multiple lines, even one line per pixel, for example;
0 Amoeba 10 10 10 10 0 0
0 Amoeba 10 10 10 11 0 0
0 Amoeba 10 10 10 12 0 0
0 Amoeba 10 10 10 13 0 0
0 Amoeba 10 10 10 14 0 0
0 Amoeba 10 10 10 15 0 0
0 Amoeba 10 11 10 10 0 0
0 Amoeba 10 11 10 11 0 0
0 Amoeba 10 11 10 12 0 0
etc.
Note that the reference point for the lattice is (0,0,0) so in the line “0 Amoeba 10 10 10 10 0 0” the pixel is the eleventh from the origin on both the X and Y axis.
In the file “foaminit2D.piff” the first lines are;
0 Foam 0 13 0 5 0 0
1 Foam 13 25 0 5 0 0
2 Foam 25 39 0 5 0 0
3 Foam 39 46 0 5 0 0
4 Foam 46 57 0 5 0 0
These five lines define five separate cells (cell_id 0 through 4), all of cell_type “Foam”. The first cell is 14 pixels wide and 6 pixels tall and has one corner at the origin (0,0,0).
Comment:
id: lkvva | creation_date: May 19, 2018, 4:31 p.m. | author: Arthur M | type: Comment |
parent: poakq | lastedit_date: May 19, 2018, 4:31 p.m. | lastedit_user: Arthur M |
content:
Thanks you so much for you reply, I discovered in /Simulation thanks to you a file named "Foam coarsening" who works really well. However, my real question was how do you generate PIF files with Python, it is merely written in the quick start guide that the script needs to take several arguments "./FoamInit.py -r -i -o -z -m. "but it is not really explained in simple words for me how it has to be written. Do you have any Python script to create PIF files so I could keep it but change the arguments?
Answer:
id: erpnp | creation_date: May 21, 2018, 11:31 a.m. | author: James Sluka | type: Answer |
parent: wrwxm | lastedit_date: May 21, 2018, 11:31 a.m. | lastedit_user: James Sluka |
content:
What exactly are you trying to do? Are you trying to create your own pif file to use as input to CC3D? If that is the case the file format is as described above and you can use python or any other programming language to create the file. You can even create the file by hand in a text editor.
Once you've created a pif file you should put it in the Simulation folder for your project. To load the pif add the lines below to the cc3d porject's xml file;
<Steppable Type="PIFInitializer">
<PIFName>Simulation/test.piff</PIFName>
</Steppable>
(Change your file name from "test" to something more informative.)
Comment:
id: balpm | creation_date: May 21, 2018, noon | author: Arthur M | type: Comment |
parent: erpnp | lastedit_date: May 21, 2018, noon | lastedit_user: Arthur M |
content:
Yes I am trying to create my own PIF files: one to simulate a polydisperse foam and the other to simulate a monodisperse foam. I want to use Python to create the file, but I do not know what I must code exactly. I am not a Python expert especially to create files. That is why I was asking to you if you had any example of Python script to generate this file so I could change the parameters as I want.
Answer:
id: mqnxm | creation_date: May 21, 2018, 5:04 p.m. | author: James Sluka | type: Answer |
parent: wrwxm | lastedit_date: May 21, 2018, 5:04 p.m. | lastedit_user: James Sluka |
content:
Here is a simple python file to write to a pif. You'll need to change the path to fit your machine. You'll will need to write your own code to decide where the cells actually go.### Script to write a CC3D PIFF file
J. Sluka
path="C:/Users/James Sluka/Desktop/Jims compucell/Piff and other python scripts"
pifname="simple.piff"
pifFileName = path + "/" + pifname
print "pifFileName: " + pifFileName
pifFile= open(pifFileName,'w')
pifFile.write("0 red 0 10 0 10 0 0 \n") # cell id 1 is of type "red"
pifFile.write("1 small 20 30 5 15 0 0 \n") # cell id 2 is of type "small"
print "done"
pifFile.close()
Comment:
id: erpgp | creation_date: May 21, 2018, 5:27 p.m. | author: Arthur M | type: Comment |
parent: mqnxm | lastedit_date: May 21, 2018, 5:27 p.m. | lastedit_user: Arthur M |
content:
Thank you very much, I will now try to set up a loop on your script so I could generate enough bubbles (I need approximately 120 bubbles in order to compare with my experiences made in laboratory) but this time I may do it by my own, you already helped me a lot!
Answer:
id: jgxgo | creation_date: May 24, 2018, 2:48 p.m. | author: James Sluka | type: Answer |
parent: wrwxm | lastedit_date: May 24, 2018, 2:48 p.m. | lastedit_user: James Sluka |
content:
If you can draw the layout you want in a program like MS Paint (or any program that can export a bit mapped image), I have a Python file that will convert that drawing into a PIFF file. You just draw all cells of one type the same color and outline all cells with a black lines. In the attached file the left image was drawn in a drawing program. It has tiny red cells, middle sized green cells and large blue cells, with individual cells outlined in black. My script converted the image to a PIFF. The results in CC3D is shown in the right hand image.
attachments(redirected):
.\CC3D_allanswered_linked_files\Untitled.png
Comment:
id: nxlxb | creation_date: May 24, 2018, 3:12 p.m. | author: Arthur M | type: Comment |
parent: jgxgo | lastedit_date: May 24, 2018, 3:12 p.m. | lastedit_user: Arthur M |
content:
I finally managed to make my own monodisperse foam with the help of your Python script, but I have been struggling to make a really polydisperse foam.I know there is already a PIFF file (foaminit2D.piff) but it may be not enough polydisperse to compare his evolution with the evolution of the monodisperse foam (I want to highlight there are some kind of stages when the number of bubbles in a monodisperse foam decreases ), so your Python file would be very useful, thank you so much for your help!
Comment:
id: mqeov | creation_date: May 24, 2018, 3:23 p.m. | author: Arthur M | type: Comment |
parent: jgxgo | lastedit_date: May 24, 2018, 3:23 p.m. | lastedit_user: Arthur M |
content:
I think I have finally found a idea to write a Python script generating the polydisperse foam that I want, so I do not need your Python script working with MSPaint, but thank you a lot for your help!
Q82: I got a problem adding a steppable which for every bubble will output bubble id, volume, surface and number of neighbors.
id: erwlr | creation_date: May 28, 2018, noon | author: Arthur M | type: Question |
parent: | lastedit_date: June 4, 2018, 11:36 a.m. | lastedit_user: James Sluka |
content:
Dear all,
I am trying to follow the instructions in the quick start guide on how to add a steppable which for every bubble id will output several parameters (page 19), but it does not work, here is what it is displayed:
attachments(redirected):
.\CC3D_allanswered_linked_files\Capture d’écran 2018-05-28 à 17.50.33.png
Answer:
id: mqepl | creation_date: May 29, 2018, 11:40 a.m. | author: James Sluka | type: Answer |
parent: erwlr | lastedit_date: May 29, 2018, 11:41 a.m. | lastedit_user: James Sluka |
content:
To add a new steppable:
In your python steppables file (e.g., MyProjectsteppables.py) make the new steppable, something like;class MyNewSteppable(SteppableBasePy):
def __init__(self,_simulator,_frequency=1):
SteppableBasePy.__init__(self,_simulator,_frequency)
def start(self):
# stuff to do at the start of the simulation
pass
def step(self,mcs):
# stuff to do every time the steppable is called
pass
def finish(self):
# Finish Function gets called after the last MCS
pass
To register this new python class, you need to add it to the main python file e.g., MyProject.py. At the bottom of this python, file after;#Add Python steppables here
Add;from InsertNameOfYourSteppablesPythonFile import MyNewSteppable
# NOTE THE CHANGE IN CASE OF FIRST LETTER IN THE 2 LINES BELOW
myNewSteppable = MyNewSteppable(sim,_frequency=1)
steppableRegistry.registerSteppable(myNewSteppable)
You should remove any reference to your new steppable from the CC3D .xml project file.
Answer:
id: wrgqp | creation_date: May 29, 2018, 12:24 p.m. | author: Arthur M | type: Answer |
parent: erwlr | lastedit_date: May 29, 2018, 12:24 p.m. | lastedit_user: Arthur M |
content:
So if I understood well: In def start(self) I will code something to create and open a new file
But in def step(self,mcs) how do I access the data in mcs, is it like a PIFF file?
Is this really the only solution to output the data from the foam coarsening?
Answer:
id: erwne | creation_date: May 29, 2018, 1:40 p.m. | author: James Sluka | type: Answer |
parent: erwlr | lastedit_date: May 29, 2018, 1:40 p.m. | lastedit_user: James Sluka |
content:
What data do you want to output? If you want screen shots of the simulation you can tell Player to do that.
<Tools><Configuration><Output> check "Save images every Nth MCS"
Otherwise, if you want to do things like output the number of cells, volume/cell, average volume etc. then you'll need to do that in Python and output to a file.
In the start you can use;
# create a plain text file in the output directory
import os
reportFileName="Simulation_report.txt"
self.reportFileHandle,fullFileName=self.openFileInSimulationOutputDirectory(reportFileName,"w")
In the step you use;
self.reportFileHandle.write("Some interesting stuff\n")
And in the finish you use;
self.reportFileHandle.close()
If you can post what kind of data you would like to save I might be able to help more.
Answer:
id: bakpa | creation_date: May 29, 2018, 1:57 p.m. | author: Arthur M | type: Answer |
parent: erwlr | lastedit_date: May 29, 2018, 1:57 p.m. | lastedit_user: Arthur M |
content:
I want to output for each cell: his cell ID, his surface, his volume and number of neighbors.
Answer:
id: kgmap | creation_date: May 29, 2018, 3:27 p.m. | author: James Sluka | type: Answer |
parent: erwlr | lastedit_date: May 29, 2018, 3:30 p.m. | lastedit_user: James Sluka |
content:
def step(self,mcs):
for cell in self.cellList:
nneigh=0
for neighbor, commonSurfaceArea in self.getCellNeighborDataList(cell):
if neighbor: # don't count neighbors that are medium
nneigh+=1
self.reportFileHandle.write(str(mcs)+"\t"+str(cell.id)+"\t"+str(cell.surface)+ \
"\t"+str(cell.volume)+"\t"+str(nneigh)+"\n")
You might want to add a header line to the file in the start method; self.reportFileHandle.write("mcs\tid\tsurf\tvol\tnneigh\n")
The output file should be in the project directory but if isn't there check C:\Users\YOURUSERNAME\CC3DWorkspace\
You probably don't want to log the data every mcs.
Comment:
id: nxpnm | creation_date: June 2, 2018, 6:23 a.m. | author: Arthur M | type: Comment |
parent: kgmap | lastedit_date: June 2, 2018, 6:23 a.m. | lastedit_user: Arthur M |
content:
Thank you so much, it worked very well! Indeed, I wanted to ask to you how do you change the frequency as I don't want to log the data every mcs?
Answer:
id: zxmql | creation_date: June 2, 2018, 7:18 a.m. | author: Arthur M | type: Answer |
parent: erwlr | lastedit_date: June 2, 2018, 7:18 a.m. | lastedit_user: Arthur M |
content:
I also got a problem getting screenshots of the simulation, I found no screenshots after the simulation ended. Here is what I put in the parameters.
attachments(redirected):
.\CC3D_allanswered_linked_files\Capture d’écran 2018-06-02 à 13.13.34.png
.\CC3D_allanswered_linked_files\Capture d’écran 2018-06-02 à 13.13.14.png
Answer:
id: lkpnz | creation_date: June 4, 2018, 11:20 a.m. | author: James Sluka | type: Answer |
parent: erwlr | lastedit_date: June 4, 2018, 11:20 a.m. | lastedit_user: James Sluka |
content:
There are a couple ways to change the frequency of a steppable, but I find it easiest (though perhaps not the fastest) to simply do it directly in the step. For example; change
def step(self,mcs):
for cell in self.cellList:
to;
def step(self,mcs):
if mcs % 100 == 0:
for cell in self.cellList:
"%" is the python modulo operator and the if statement above will cause the lines below to execute only when the mcs step is evenly divisible by 100. In other words, every 100 steps you'll get output.
Answer:
id: qwpbe | creation_date: June 4, 2018, 11:35 a.m. | author: James Sluka | type: Answer |
parent: erwlr | lastedit_date: June 4, 2018, 11:36 a.m. | lastedit_user: James Sluka |
content:
Concerning the output screen shots. You need to find the folder that CC3D is using for output. It should be named something like <jobname>_cc3d_06_04_2018_11_25_42 where the string of numbers is the time you started the CC3D job (June 4, 2018 at 11:25:42 in this case). Your screenshots will be in that folder.
CC3D sometimes gets confused and puts the output in your default CC3D output folder, which on a PC is C:\Users\YOURUSERNAME\CC3DWorkspace\. Check that folder to see if your job files are there. You can tell CC3D to put the output files under the same directory as your source code by checking the box next to "=Project".
Q83: Some problem with Steppable ‘’FlexibleDiffusionSolverFE‘’ in xml
id: rrpwj | creation_date: May 31, 2018, 8:59 a.m. | author: dali Zan | type: Question |
parent: | lastedit_date: June 17, 2018, 4:40 p.m. | lastedit_user: Maciek Swat |
content:
In the model Steppable ‘’FlexibleDiffusionSolverFE‘’ has been added in XML file. But when I run the model, "Exception in C++ code: Stepper'FlexibleDiffusionSolverFE' not found!" this line of words appeared. This situation has never happened before. Hope to be answered,thanks!
Answer:
id: kgmop | creation_date: May 31, 2018, 9:53 a.m. | author: James Sluka | type: Answer |
parent: rrpwj | lastedit_date: May 31, 2018, 9:53 a.m. | lastedit_user: James Sluka |
content:
What version of CC3D are you using? I just tried it with 3.7.7 and it seems to work correctly.
Comment:
id: jgxqa | creation_date: May 31, 2018, 10:02 a.m. | author: dali Zan | type: Comment |
parent: kgmop | lastedit_date: May 31, 2018, 10:02 a.m. | lastedit_user: dali Zan |
content:
Version is 3.7.5. In the previous model I used this steppable several times and never had this problem. This time I don't know why.
Answer:
id: nxlve | creation_date: May 31, 2018, 10:52 a.m. | author: James Sluka | type: Answer |
parent: rrpwj | lastedit_date: May 31, 2018, 10:54 a.m. | lastedit_user: James Sluka |
content:
Try commenting out all the xml for the FlexibleDiffusionSolverFE and see what happens, maybe it is just bad nesting of xml.
If I purposely misspell the plugin's name I get the error window shown below. Is that the exact same error you get (except for the Plugin name)?
attachments(redirected):
.\CC3D_allanswered_linked_files\FDSFE_Err.png
Comment:
id: zxzvr | creation_date: May 31, 2018, 11:23 a.m. | author: dali Zan | type: Comment |
parent: nxlve | lastedit_date: May 31, 2018, 11:23 a.m. | lastedit_user: dali Zan |
content:
I used an undefined cell type in Uptake Type, that is the cause of this problem. I thought it may caused by function import error in the first time :)thanks for your help anyway.
Answer:
id: gnzna | creation_date: June 17, 2018, 4:40 p.m. | author: Maciek Swat | type: Answer |
parent: rrpwj | lastedit_date: June 17, 2018, 4:40 p.m. | lastedit_user: Maciek Swat |
content:
Also you shold stop using FlexibleDiffusionSolver use DiffusionSolverFE - much better and way faster
Q84: 13th CompuCell3D Training Workshop, August 5th - 11th 2018
id: nxpll | creation_date: June 6, 2018, 1:44 p.m. | author: Anwar | type: News |
parent: nxpll | lastedit_date: June 7, 2018, 10:12 a.m. | lastedit_user: Scott H |
content:
For more information click here
attachments(redirected):
.\CC3D_allanswered_linked_files\CompuCell3D_Workshop_Poster_2018.png
Comment:
id: vxbbe | creation_date: June 7, 2018, 10:12 a.m. | author: Scott H | type: Comment |
parent: nxpll | lastedit_date: June 7, 2018, 10:12 a.m. | lastedit_user: Scott H |
content:
I hope to see you there! Should we make a separate post for travel arrangements?
Also are you going to post any materials before the conference? The hour ride from the airport would be perfect for reading.
Q85: Questions about programming statements
id: bamzo | creation_date: June 4, 2018, 9:04 a.m. | author: dali Zan | type: Question |
parent: | lastedit_date: June 13, 2018, 10:15 a.m. | lastedit_user: Maciek Swat |
content:
pt.x=int(round(cell.xCOM))
pt.y=int(round(cell.yCOM))
pt.z=int(round(cell.zCOM))
I don't understand the effect of this statement in python.
Answer:
id: erlja | creation_date: June 4, 2018, 11:14 a.m. | author: James Sluka | type: Answer |
parent: bamzo | lastedit_date: June 4, 2018, 11:14 a.m. | lastedit_user: James Sluka |
content:
A Compucell3D point is an integer triple and pt.x refers to the x-coordinate of that point. The center of mass (COM) coordinates (e.g., cell.xCOM) are floating point numbers since, in general, even with integer coordinates the COM will not consist of integers.
The command "int(round(cell.xCOM))" firsts rounds the COM coordinate to the nearest integer (but the data type is still a float), it then converts the type to integer so the value is compatible with the integer definition of a CC3D pt.
I am not sure if I understand your second question. Do you want the first cell to migrate towards the second cell or do you want to make the first cell part of the second?
To migrate the first cell towards the second you can use focal point plasticity links (FPP). In general though, it is likely that both cells will move towards each other. If you want to keep one cell from moving you can use an additional FPP link between the cell you don't want to move and its initial COM. See the demos of FPP in the folder; C:\CompuCell3D\Demos\PluginDemos Demos/FocalPointPlasticity
Comment:
id: bamnv | creation_date: June 11, 2018, 9:46 a.m. | author: dali Zan | type: Comment |
parent: erlja | lastedit_date: June 11, 2018, 9:46 a.m. | lastedit_user: dali Zan |
content:
I used focal point plasticity plugin and the statement format used are the same as in the demos. But A type cells does not move to B type cells. Is it because the initial distance is too far, or the 3D model needs additional statements?
Comment:
id: xzxpq | creation_date: June 13, 2018, 10:15 a.m. | author: Maciek Swat | type: Comment |
parent: bamnv | lastedit_date: June 13, 2018, 10:15 a.m. | lastedit_user: Maciek Swat |
content:
If you do not use int(round(x)) you will often create biases in the simulation that will manifest themselves after few hundreds / thousands of MCS and they would be bad because in some cases they can effectively mimic an external force that is not there. So yes each time you ned to pick pixel that is closest to center of mass you need to use int(round())
Q86: How to let type B cells move actively to type C cells
id: wrqza | creation_date: June 12, 2018, 11:08 a.m. | author: dali Zan | type: Question |
parent: | lastedit_date: June 12, 2018, 11:31 a.m. | lastedit_user: priyomadhyapok |
content:
In a 3D model,at first, there were two types of cells, A and C, and A cells became B cells after a period of time. I want B cells move actively to type C cells. I already use focal point plasticity plugin like this:
<Plugin Name="FocalPointPlasticity">
<Parameters Type1="B" Type2="C">
<Lambda>20</Lambda>
<ActivationEnergy>-50</ActivationEnergy>
<TargetDistance>5</TargetDistance>
<MaxDistance>10</MaxDistance>
<MaxNumberOfJunctions>2</MaxNumberOfJunctions>
</Parameters>
</Plugin>
But after A cells became B cells, B cells does not move to C cells. B and C cells are about 40 pixel apart
Answer:
id: erlvb | creation_date: June 12, 2018, 11:31 a.m. | author: priyomadhyapok | type: Answer |
parent: wrqza | lastedit_date: June 12, 2018, 11:31 a.m. | lastedit_user: priyomadhyapok |
content:
The maximum distance sets the 'max' distance over which links will exist. If they are 40 pixels apart, a link won't form automatically cause it is limited by 10 here. This is an example of how I could set up a link between two arbitrary cells-
#Main python file, could be xml script
#Have commented lambda,target and max distance so can modify them later
PluginElmnt_3=CompuCell3DElmnt.ElementCC3D("Plugin",{"Name":"FocalPointPlasticity"})
ParametersElmnt_1=PluginElmnt_3.ElementCC3D("Parameters",{"Type1":"cellb","Type2":"cellc"})
#ParametersElmnt_1.ElementCC3D("Lambda",{},"20")
ParametersElmnt_1.ElementCC3D("ActivationEnergy",{},"-150")
#ParametersElmnt_1.ElementCC3D("TargetDistance",{},"5")
#ParametersElmnt_1.ElementCC3D("MaxDistance",{},"10")
ParametersElmnt_1.ElementCC3D("MaxNumberOfJunctions",{"NeighborOrder":"6"},"1")
#########################################################################
#Steppable file
#create cellc and cellb arbitrary
#form links
dist=sqrt((cellb.xCOM-cellc.xCOM)**2+(cellb.yCOM-cellc.yCOM)**2)
self.Lam=20
self.focalPointPlasticityPlugin.createFocalPointPlasticityLink(cellb,cellc, self.Lam,dist,self.dim.y)#max target length determines the max limit of the link
Q87: How to measure the diffusion constant for cells in aggregate in a CC3D simulation?
id: nxpbj | creation_date: June 13, 2018, 1:18 a.m. | author: Yen Nguyen Edalgo | type: Question |
parent: | lastedit_date: June 13, 2018, 2:12 p.m. | lastedit_user: James Sluka |
content:
Hi,
In the paper "Multi-Scale Modeling of Tissues Using CompuCell3D" by Swat et al., on page 5, the author(s) mentioned that one can measure the diffusion constant of cells in aggregates in the simulation. So I am asking for suggestions on how to do so in CC3D.
Thank you,
Answer:
id: gnqaa | creation_date: June 13, 2018, 1:13 p.m. | author: James Sluka | type: Answer |
parent: nxpbj | lastedit_date: June 13, 2018, 1:14 p.m. | lastedit_user: James Sluka |
content:
I believe you can use the equation;
(deltaX)^2/(deltaT) = 2D
Where deltaX is the displacement of a single cell along the x-axis in time period deltaT and D is the diffusion constant
One way to track the cell's position is to add a dictionary to the cell and save the cell's X, Y and Z position every (some number of) mcs. Every (some number of) mcs you calculate the X (or Y or Z) displacement, square that and divide by the (some number of) mcs. Since the simulation is stochastic the D will fluctuate from interval to interval so you'll need to average over a number of intervals.The units of D will be pixel^2/mcs, which is distance^2/unit time.
Answer:
id: awrew | creation_date: June 13, 2018, 2:12 p.m. | author: James Sluka | type: Answer |
parent: nxpbj | lastedit_date: June 13, 2018, 2:12 p.m. | lastedit_user: James Sluka |
content:
With Priyom's help, I've found some much better resources for this.
See slides 51-59 in;
http://www.compucell3d.org/BinDoc/cc3d_binaries/Tutorials/PASI2013/MultiScaleModelingWithCC3D-SBML.pdf
The diffusion measurement demo can be downloaded from;
http://www.compucell3d.org/BinDoc/cc3d_binaries/Tutorials/PASI2013/DiffusionCalculator.zip
This is an excellent example of a python only CC3D model. The code is pretty old though and to use it you need to add a couple lines to the file "DiffusionCalculator.py". After line #64 add;
contact.ElementCC3D("Energy", {"Type1":"Medium", "Type2": "Wall"},10)
contact.ElementCC3D("Energy", {"Type1":"Cells", "Type2": "Wall"},10)
contact.ElementCC3D("Energy", {"Type1":"Wall", "Type2": "Wall"},10)
Note that the plot in CC3D is only drawn at the end of the simulation. Also, a log of all the displacements is written to a text file.
Q88: How to control the secretion
id: lkabq | creation_date: June 14, 2018, 10:51 p.m. | author: dali Zan | type: Question |
parent: | lastedit_date: June 15, 2018, 1:59 p.m. | lastedit_user: James Sluka |
content:
In a diffusion field, we can set out which cells secrete chemicals. And this chemical is usually secreted at the very beginning of the model. I want to ask how to impose restrictions on secretions and don't let cells secrete chemicals at the beginning, but secrete under certain conditions. For instance, when the cells come into contact or reach a certain number of mcs steps.
Answer:
id: jgagr | creation_date: June 15, 2018, 1:59 p.m. | author: James Sluka | type: Answer |
parent: lkabq | lastedit_date: June 15, 2018, 1:59 p.m. | lastedit_user: James Sluka |
content:
Attached is a CC3D project based on the bacterium-macrophage demo. The bacterium doesn't start to secrete until MCS 100. It'll take several thousand MCS before the macrophage starts to move. This should give you an idea how to change secretion based on MCS or any other characteristic that you can come up with to identify the particular cell that should be secreting. (Maciek might have a better solution.) File attached: secrete_at_mcs.zip (3.07 KB)
attachments(redirected):
.\CC3D_allanswered_linked_files\secrete_at_mcs.zip
Q89: CC3D Player Crashes on Mac after Update
id: wrjlq | creation_date: June 15, 2018, 7:47 a.m. | author: Izzy | type: Question |
parent: | lastedit_date: June 18, 2018, 10:09 a.m. | lastedit_user: Izzy |
content:
I recently tried updating to 3.7.7 on my Mac, and everytime I try to run certain Demo simulations in the CC3D player, it crashes. I deleted all of my old CC3D files on my computer, as well as the updated version, and tried re-installing with still no luck. The demo simulations that keep crashing the player are the ones involving diffusion (diffusion_steady_state_2D, SimpleDiffusion, etc.). When the player crashes, I get an error window from Mac saying "python quit unexpectedly."
Does anyone have any troubleshooting suggestions or solutions?
Answer:
id: kgagn | creation_date: June 15, 2018, 1:22 p.m. | author: James Sluka | type: Answer |
parent: wrjlq | lastedit_date: June 15, 2018, 1:22 p.m. | lastedit_user: James Sluka |
content:
I can confirm that both CC3D 3.7.7 and 3.7.6 crashes on a Mac when running
.../Demos/SteppableDemos/ReactionDiffusionSolverFE_OpenCL_Implicit/SimpleDiffusion
I tried the same demo on a PC (Windows 7) and it also crashes with the error message;
attachments(redirected):
.\CC3D_allanswered_linked_files\Untitled.png
Answer:
id: oawar | creation_date: June 16, 2018, 3:42 p.m. | author: Maciek Swat | type: Answer |
parent: wrjlq | lastedit_date: June 16, 2018, 3:42 p.m. | lastedit_user: Maciek Swat |
content:
Do those simulations involve by any chance hex lattice? If so there is a visualization bug in the player (already fixed in the source code on github) that was causing the problem. I have just tried diffusion_stead_state_2D.cc3d on OSX High Sierra and it works. If you could send me exact name of the demo you are running and the versio nof your OSX I can start debugging it more.
Comment:
id: wrjkq | creation_date: June 18, 2018, 10:09 a.m. | author: Izzy | type: Comment |
parent: oawar | lastedit_date: June 18, 2018, 10:09 a.m. | lastedit_user: Izzy |
content:
They do not involve hex lattice. I can confirm that diffusion_steady_state works for me. So far, the demos I've tried that cause the crash are:
SimpleDiffusion.cc3d
DiffusionSolverFE_OpenCL.cc3d
Others, like diffusion_2D and diffusion_2D_kernel, do not crash the program, but do not render at all in the player.
Obviously this list is not exhaustive as I haven't tried to run every demo. I hav macOS High Sierra 10.13.4. Thank you!
Q90: Child cell after Mitosis
id: xzjew | creation_date: June 20, 2018, 2:22 a.m. | author: safiye | type: Question |
parent: | lastedit_date: June 26, 2018, 3:42 a.m. | lastedit_user: safiye |
content:
I would like to ask if I can simulate parent cell as A dividing to child cell as A and B (two different cell types) ?
Thank you in advance.
Answer:
id: zxjkg | creation_date: June 20, 2018, 10:41 a.m. | author: priyomadhyapok | type: Answer |
parent: xzjew | lastedit_date: June 20, 2018, 10:41 a.m. | lastedit_user: priyomadhyapok |
content:
When A divides into one, one of them will have attributes as 'parentCell' and the other 'childCell'. You can do something like parentChild.type=self.A and childCell.type=self.B (assuming you have initialized your celltypes as A and B)
Answer:
id: baplp | creation_date: June 21, 2018, 3:03 a.m. | author: safiye | type: Answer |
parent: xzjew | lastedit_date: June 21, 2018, 3:03 a.m. | lastedit_user: safiye |
content:
Thank you, but I wanted to ask if I can simulate parent cell A divide to 2 cells which is child cell A and child cell B.
Comment:
id: wrjqv | creation_date: June 21, 2018, 4:30 p.m. | author: James Sluka | type: Comment |
parent: baplp | lastedit_date: June 21, 2018, 4:30 p.m. | lastedit_user: James Sluka |
content:
That sounds like a normal cell division. You start with "parent cell A" and get "child cell A" and "child cell B". As Priyom posted, you can assign any cell type you want to each of the child cells. The "parent/child" relationship really isn't meant to be biological (though you could make it so). In CC3D, "parent" just means one of the two cells has the same cell.id as the original cell. The "child" cell will have a newly created cell.id.
Answer:
id: kgaqq | creation_date: June 26, 2018, 3:42 a.m. | author: safiye | type: Answer |
parent: xzjew | lastedit_date: June 26, 2018, 3:42 a.m. | lastedit_user: safiye |
content:
Thank you, I will work on it.
Q91: Making an iterative parameter scan
id: oawre | creation_date: June 20, 2018, 11:05 a.m. | author: Pauli Tikka | type: Question |
parent: | lastedit_date: June 28, 2018, 10:33 a.m. | lastedit_user: Scott H |
content:
Dear reader,
I would like to make a series of simulations that change some of the parameters in the xml file depending on the result of previous simulation, e.g. general diffusion constant. This series would stop when the model solution value is close enough to the experimental value, e.g. distance of certain cells to other cells in a given region.
If I just run regular parameter scans, I can give a string of predefined values, but I would need that this value changes after each simulation run, according to e.g. Newton's method, towards the solution. Is this possible? This would come to my article's chapter called 'parameter estimation'.
Thank you once again for all possible help!
Best regards,
Pauli
Answer:
id: mqanj | creation_date: June 20, 2018, 1:49 p.m. | author: Scott H | type: Answer |
parent: oawre | lastedit_date: June 20, 2018, 1:49 p.m. | lastedit_user: Scott H |
content:
I would like to know more also. This would help since I want to use the iteration number in naming the output files. How do I access the CurrentIteration value in the ParameterScan xml from the .py steppables?
Answer:
id: qwlmp | creation_date: June 25, 2018, 12:50 p.m. | author: James Sluka | type: Answer |
parent: oawre | lastedit_date: June 25, 2018, 12:50 p.m. | lastedit_user: James Sluka |
content:
I'm not sure if it is practical to modify and/or intervene in the parameter sweep scripts. I think a better approach would be to write a python script specifically for the optimization and fitting task.
I have a Particle Swarm script that wraps around a CC3D project that will attempt to locate an optimal set of parameters. For complex systems the swarm approach is more likely to find a global minimum than are gradient based methods. Swarms parallelize extremely well (unlike gradient methods) so if you have access to a cluster the process can be fast and efficient. If you are interested in this development code let me know and I'll tell you what is needed. If the project isn't too big, we can use our 64-cpu cluster for the optimization.
Comment:
id: jgamz | creation_date: June 27, 2018, 9:50 a.m. | author: Pauli Tikka | type: Comment |
parent: qwlmp | lastedit_date: June 27, 2018, 9:50 a.m. | lastedit_user: Pauli Tikka |
content:
Hi,
I would be interested in this 'particle swarm' script, and would like to know what is needed. However, at the moment I do not have an access to cluster computing, but I do have a good computer, but possibly get an access to cluster quite soon.
Comment:
id: mqxvb | creation_date: June 28, 2018, 10:33 a.m. | author: Scott H | type: Comment |
parent: jgamz | lastedit_date: June 28, 2018, 10:33 a.m. | lastedit_user: Scott H |
content:
I am also interested in the particle swarm script.
Q92: Unable to export PIF file from CellDraw corresponding to Potts generation
id: lkaxv | creation_date: June 25, 2018, 5:46 p.m. | author: Ravit Anand | type: Question |
parent: | lastedit_date: June 29, 2018, 1:42 p.m. | lastedit_user: James Sluka |
content:
I am using CellDraw to generate a PIF file. After drawing the configuration when I export the PIF file using Potts generation the CellDraw interface goes to non-responding mode.
Answer:
id: ernvz | creation_date: June 26, 2018, 10:13 a.m. | author: James Sluka | type: Answer |
parent: lkaxv | lastedit_date: June 26, 2018, 10:13 a.m. | lastedit_user: James Sluka |
content:
What operating system are you using; Windows, Linux, MacOS...?
Comment:
id: ernkj | creation_date: June 27, 2018, 3:06 p.m. | author: Ravit Anand | type: Comment |
parent: ernvz | lastedit_date: June 27, 2018, 3:06 p.m. | lastedit_user: Ravit Anand |
content:
I am using Windows 10.
Answer:
id: gnmgz | creation_date: June 29, 2018, 1:41 p.m. | author: James Sluka | type: Answer |
parent: lkaxv | lastedit_date: June 29, 2018, 1:42 p.m. | lastedit_user: James Sluka |
content:
Check this previous answer;
https://www.allanswered.com/post/omzwe/#wlzxv
and this page
http://www.compucell3d.org/SrcBin/CellDrawPyQt4
Basically, CellDraw is getting old and may not run correctly in the newest releases. If the links above don't help, or if it is really too much work, we have a tool that can convert any bitmap image into a pif file. So make your layout in a drawing program (object oriented programs work better than do programs like MS Paint), save the file as a bitmap (bmp, other file formats work also such as png) and we'll convert it for you. Or, if you prefer we can send you the python code (2.7) to do the conversion.
Q93: CVODE error with SBML
id: lkagl | creation_date: June 27, 2018, 4:39 p.m. | author: Mahua Roy | type: Question |
parent: | lastedit_date: June 29, 2018, 5:21 p.m. | lastedit_user: Mahua Roy |
content:
I am getting this error while copying SBMLs during mitosis:
Error: CVODE Error: CV_CONV_FAILURE, Module: CVODE, Function: CVode, Message: At t = 0 and h = 7.85582e-10, the corrector convergence test failed repeatedly or with |h| = hmin.
Error: rr::IntegratorException::IntegratorException(const std::string &, const std::string &)what: CVODE Error: CV_CONV_FAILURE: Convergence test failures occurred too many times (= MXNCF = 10) during one internal timestep or occurred with |h| = hmin., where: virtual double rr::CVODEIntegrator::integrate(double, double)
This is only happening when I tried to assign different Initial conditions to each cell ID initially. However, I do have copy SBMLs from parent cell to Child Cell.
self.copySBMLs(_fromCell= parentCell, _toCell=childCell) # Copy the SBML to the child Cell
The way I am adding SBML initially is this ( I start with an initial 9 cells )
self.addSBMLToCellIds(_modelFile=modelFile, _modelName='PC_ODE', _ids=[1], _stepSize=stepSize,_initialConditions=IC1)
self.addSBMLToCellIds(_modelFile=modelFile, _modelName='PC_ODE', _ids=[2], _stepSize=stepSize,_initialConditions=IC2)
self.addSBMLToCellIds(_modelFile=modelFile, _modelName='PC_ODE', _ids=[3], _stepSize=stepSize,_initialConditions=IC3)
self.addSBMLToCellIds(_modelFile=modelFile, _modelName='PC_ODE', _ids=[4], _stepSize=stepSize,_initialConditions=IC4)
self.addSBMLToCellIds(_modelFile=modelFile, _modelName='PC_ODE', _ids=[5], _stepSize=stepSize,_initialConditions=IC5)
self.addSBMLToCellIds(_modelFile=modelFile, _modelName='PC_ODE', _ids=[6], _stepSize=stepSize,_initialConditions=IC6)
self.addSBMLToCellIds(_modelFile=modelFile, _modelName='PC_ODE', _ids=[7], _stepSize=stepSize,_initialConditions=IC7)
self.addSBMLToCellIds(_modelFile=modelFile, _modelName='PC_ODE', _ids=[8], _stepSize=stepSize,_initialConditions=IC8)
self.addSBMLToCellIds(_modelFile=modelFile, _modelName='PC_ODE', _ids=[9], _stepSize=stepSize,_initialConditions=IC9)
Where each IC # is a dictionary of values.
I would highly appreciate your help.
Kind regards,
Mahua
Answer:
id: xzabg | creation_date: June 28, 2018, 7:25 p.m. | author: Maciek Swat | type: Answer |
parent: lkagl | lastedit_date: June 28, 2018, 7:25 p.m. | lastedit_user: Maciek Swat |
content:
Could you post your SBML model here? It might happen that for some "edge cases" in terms of parameter choice of the SBML model you might end up with this type of warning.
Answer:
id: rrnem | creation_date: June 29, 2018, 1:34 p.m. | author: James Sluka | type: Answer |
parent: lkagl | lastedit_date: June 29, 2018, 1:34 p.m. | lastedit_user: James Sluka |
content:
I suspect one of more of your parameter sets is giving the SBML solver problems. You can try a dedicated SBML solver (Like COPASI or CellDesigner) to see if they also have problems with particular parameter sets.
In CC3D, you can try to narrow down which set is the problem by commenting out all the SBML initialization but one and hunting down the problematic set.
Also, have python print you IC# texts just to make sure they exist and their syntax is correct.
Answer:
id: vxpnp | creation_date: June 29, 2018, 1:44 p.m. | author: Mahua Roy | type: Answer |
parent: lkagl | lastedit_date: June 29, 2018, 1:44 p.m. | lastedit_user: Mahua Roy |
content:
I fixed the issue with having multiple SBML with initial conditions specified for each within the SBML, since I needed to assign different initial conditions to each cell ID while the overall model remains the same.
The CVODE error was occurring only when the mitosis was about to happen. I suspect that would be because I could not figure out how to specify initial conditions as the last state of the cell and pass it on to the child cell. The zero initial conditions in the parent SBML could be the problem.
However, I am still confused if I am doing the right thing by giving the same model name to all the SBMLs. Since the model is not changing nor the parameters, but only the initial conditions, I thought it only needs to be specified at the beginning. Here is the snippets of my code as well as the SBML as attached.
****
modelFile1 = './Simulation/S3_diffusion10.xml'
modelFile2 = './Simulation/S3_diffusion11.xml'
modelFile3 = './Simulation/S3_diffusion12.xml'
modelFile4 = './Simulation/S3_diffusion13.xml'
self.addSBMLToCellIds(_modelFile=modelFile1, _modelName='PC_ODE', _ids=[1], _stepSize=stepSize)
self.addSBMLToCellIds(_modelFile=modelFile2, _modelName='PC_ODE', _ids=[2], _stepSize=stepSize)
self.addSBMLToCellIds(_modelFile=modelFile3, _modelName='PC_ODE', _ids=[3], _stepSize=stepSize)
self.addSBMLToCellIds(_modelFile=modelFile4, _modelName='PC_ODE', _ids=[4], _stepSize=stepSize)
for cell in self.cellListByType(self.PCANCER, self.QCANCER, self.PSTEM, self.QSTEM):
self.setSBMLValue(_modelName='PC_ODE', _valueName='Glu_out', _value=Glu_out,
_cell=cell) # This is glucose out
self.setSBMLValue(_modelName='PC_ODE', _valueName='Glutamine_out', _value=Glutamine_out,
_cell=cell) # This is glutamine out
*** This is during the mitosis steppable :
State_parentcell=self.getSBMLState(_modelName='PC_ODE',_cell=parentCell) # Get all the states
self.copySBMLs(_fromCell= parentCell, _toCell=childCell) # Copy the SBML to the child Cell
self.setSBMLState(_modelName='PC_ODE', _cell=childCell, _state=State_parentcell)
At this point I just set the state of the child cell to be equal to that of the parent cell. However, Since the SBML had zero initial conditions, I think that is where the error was being generated.
File attached: S3_diffusion.xml (418.43 KB)
Am I right in giving the same name with the models with different initial conditions for different cell ID?
attachments(redirected):
.\CC3D_allanswered_linked_files\S3_diffusion.xml
Answer:
id: nxrqz | creation_date: June 29, 2018, 5:19 p.m. | author: James Sluka | type: Answer |
parent: lkagl | lastedit_date: June 29, 2018, 5:19 p.m. | lastedit_user: James Sluka |
content:
"Am I right in giving the same name with the models with different initial conditions for different cell ID?"
Yes, the _modelName is specific for the particular cell so there is no confusion (to CC3D) that the same name refers to different SBML for different cells.
"At this point I just set the state of the child cell to be equal to that of the parent cell."
Be careful here. Make sure you know exactly what units the SBML file is using. SBML by default uses mass (grams, moles, ...), tools like COPASI convert things to concentration units (gram/liter, molarity, ...). So if your SBML units are grams (so CC3D uses it as grams/cell) and you divide the cell and then assign the same amount to both parent and daughter you will have doubled the amount of stuff. If your SBML is actually using concentration then you are OK since the amount/cell is the concentration times the cell's volume.
Answer:
id: povgx | creation_date: June 29, 2018, 5:21 p.m. | author: Mahua Roy | type: Answer |
parent: lkagl | lastedit_date: June 29, 2018, 5:21 p.m. | lastedit_user: Mahua Roy |
content:
Thank you Dr. Sluka. Yes, my model uses concentration.
Q94: Initializing a configuration
id: vxgap | creation_date: June 28, 2018, 1:06 a.m. | author: Ravit Anand | type: Question |
parent: | lastedit_date: June 29, 2018, 1:05 p.m. | lastedit_user: Juliano Ferrari Gianlupi |
content:
Hello,
I am trying to get an initial 3D configuration of cells as follows:
There are two types of cells, and their arrangement is into concentric spheres of some radii. So, the inner spherical region contains cells of Type 1 and the outer spherical region contains Type 2 cells.
How should I go about to initialise this configuration?
Thank you.
Answer:
id: wraor | creation_date: June 28, 2018, 2:42 p.m. | author: Juliano Ferrari Gianlupi | type: Answer |
parent: vxgap | lastedit_date: June 29, 2018, 1:05 p.m. | lastedit_user: Juliano Ferrari Gianlupi |
content:
You could use two regions in blob initializer. First, you create the outer sphere filling it completely. Then you create another region for the inner sphere, overriding that portion of the sphere. As so:
<!-- outer sphere region -->
<Steppable Type="BlobInitializer">
<!-- Outer sphere region -->
<Region>
<!-- center it wherever is apropriate -->
<Center x="500" y="500" z="500"/>
<!-- give it the apropriate size -->
<Radius>100</Radius>
<Gap>0</Gap>
<Width>25</Width>
<Types>TypeB</Types>
</Region>
<!-- inner sphere region -->
<!-- Initial layout of cells in the form of spherical (circular in 2D) blob -->
<Region>
<!-- center it wherever is apropriate -->
<Center x="500" y="500" z="500"/>
<!-- give it the apropriate size -->
<Radius>50</Radius>
<Gap>0</Gap>
<Width>25</Width>
<Types>TypeA</Types>
</Region>
</Steppable>
Comment:
id: jglnq | creation_date: June 29, 2018, 5:31 a.m. | author: Ravit Anand | type: Comment |
parent: wraor | lastedit_date: June 29, 2018, 5:31 a.m. | lastedit_user: Ravit Anand |
content:
I tried exactly the same as you suggested and the result I got is that the whole region is only filled with TypeB cells.
There was no effect of the second initialisation.
Comment:
id: baqeg | creation_date: June 29, 2018, 1:02 p.m. | author: Juliano Ferrari Gianlupi | type: Comment |
parent: jglnq | lastedit_date: June 29, 2018, 1:02 p.m. | lastedit_user: Juliano Ferrari Gianlupi |
content:
Sorry, my mistake. The two regions should be in one steppable call. I'll edit my original response.
Comment:
id: xzang | creation_date: June 29, 2018, 1:04 p.m. | author: Ravit Anand | type: Comment |
parent: baqeg | lastedit_date: June 29, 2018, 1:04 p.m. | lastedit_user: Ravit Anand |
content:
Yeah, thankyou I got. It worked.
Q95: Medium Adhesion
id: baqog | creation_date: June 28, 2018, 5:32 p.m. | author: Calvin | type: Question |
parent: | lastedit_date: June 29, 2018, 1:03 p.m. | lastedit_user: Calvin |
content:
Hi all,
I'm wondering if I understand adhesion energy correctly for the adhesion contact plugin. So far, my understanding is that the energy hierarchy dictates behaviour.
For example, in the cell sorting demonstration, if cell type A is highly adhesive to self, one would set the energies hierarchy as A-A=1, A-M (medium) 10, and M-M 0, something like this. Roughly, as long as the hierarchy is correct, the sorting should be robust.
However, I have tested energies where A-M<A-A which should be that cell type A favors binding to medium rather than itself. I would expect cells to disperse into the medium.
Instead, I observe cells still adhering and forming a spheroid under these conditions. There appears to be a fine number for A-M where if A-M<A-A by slightly, cells will still adhere to one another rather than disperse.
The plugins I am using are volume, surface area, contact energy, center of mass ,neighbor tracker, and moment of inertia. I suspect that it is the volume and surface plugins, as they are the only possible energy terms in the probability distribution function.
Example energy for the 3D cell sorting demo.
<Plugin Name="Contact">
<Energy Type1="Medium" Type2="Medium">0</Energy>
<Energy Type1="NonCondensing" Type2="NonCondensing">14</Energy>
<Energy Type1="Condensing" Type2="Condensing">14</Energy>
<Energy Type1="NonCondensing" Type2="Condensing">14</Energy>
<Energy Type1="NonCondensing" Type2="Medium">10</Energy>
<Energy Type1="Condensing" Type2="Medium">10</Energy>
<NeighborOrder>3</NeighborOrder>
</Plugin>
I have run simulations to 30k steps without significant dispersion. All neighbor order is 3.
Have I missed something obvious? Any help would be much appreciated. Thanks!
Answer:
id: qwaok | creation_date: June 28, 2018, 7:23 p.m. | author: Maciek Swat | type: Answer |
parent: baqog | lastedit_date: June 28, 2018, 7:23 p.m. | lastedit_user: Maciek Swat |
content:
Here is the rule of thumb you should apply:
if you want cells to stick to each other - make sure they have low (in relative terms) adhesion coefficient, if you want them to avoid each other make sure they have high adhesion coefficient (in relative terms). Another rule of thumb: avoid mixing positive and negative energy coefficients .
I think your overall understanding of adhesion energy coefficients is correct but in this particular case you may want to lower cell-medium adhesion
<Energy Type1="NonCondensing" Type2="Medium">2</Energy>
<Energy Type1="Condensing" Type2="Medium">2</Energy>
also it depends what temperature you have used in the system
Also medium-medium energy does not really matter
For completness I am attaching a simulation where dispersion does happen . All I had to do was to drop cell-medium adhesion coefficient
File attached: sorting_all_answered.zip (7.39 KB)
attachments(redirected):
.\CC3D_allanswered_linked_files\sorting_all_answered.zip
Answer:
id: rrnlm | creation_date: June 28, 2018, 7:35 p.m. | author: Calvin | type: Answer |
parent: baqog | lastedit_date: June 28, 2018, 7:39 p.m. | lastedit_user: Calvin |
content:
Thanks for the reply. I understand that the energies can be set very high/different from one another to get desired dispersion/adherence.
My question is why can I break the cell adhesion hierarchy, established in the plos somitogenesis paper, which states that the order of energy is most important to yield desired behaviour.
A Multi-cell, Multi-scale Model of Vertebrate Segmentation and Somite Formation
A-M=10 and A-A=14 yields adherence when theoretically, it should yield dispersion. I have tried this at T=10 and T=40. If I increase temperature, dispersion is more favored (due to unfavorable interactions being even more probable) but even at T=10 or 40, cells should disperse over time based solely on A-M=10 and A-A=14. I'm wondering if there's some unaccounted energy term that is also used in calculating the probability, which causes cohesion, aside from the volume and surface constraints used.
Hope that clear it up, thanks!
Comment:
id: awblg | creation_date: June 29, 2018, 6:35 a.m. | author: dali Zan | type: Comment |
parent: qwaok | lastedit_date: June 29, 2018, 6:35 a.m. | lastedit_user: dali Zan |
content:
‘avoid mixing positive and negative energy coefficients.’
Does this mean that all coefficients in contact plugin must be all positive or all negative?
Answer:
id: wralr | creation_date: June 29, 2018, 11:35 a.m. | author: Maciek Swat | type: Answer |
parent: baqog | lastedit_date: June 29, 2018, 11:35 a.m. | lastedit_user: Maciek Swat |
content:
So your thinking is not entirely correct regarding theory. Here is explanation:
Imagine you have two cells: 1, and 2
--------------
| | |
| 1 | 2 |
--------------
When they touch each other and the neighbor order is 1 the the contact energy associated with the interface between them is (per your simulation ) 14
Now, when you separate the two you are creating 2 interfaces (medium-cell1 and medium-cell2)
------- -------
| | | |
| 1 | | 2 |
------- ------
and each interface will "cost you" 10 units of energy so now you hav a choice - keep one interface and have energy associated with it 14/unit length or have 2 interfaces and have energy associated with the two 10+10=20/unit length
This is why if you want cell dispersion you need to lower then energy between cells and medium to around 7
Let me know if this makes sense
Answer:
id: ergqj | creation_date: June 29, 2018, 12:02 p.m. | author: James Sluka | type: Answer |
parent: baqog | lastedit_date: June 29, 2018, 12:02 p.m. | lastedit_user: James Sluka |
content:
"based solely on A-M=10 and A-A=14"
I think that might be where your thinking is off by a bit. The real situation would be;
2(A-M)=20 versus A-A=14
When A-A separates it creates two A-M interfaces, each with the same length (or surface) as the single A-A interface length (or surface).
Answer:
id: qwavk | creation_date: June 29, 2018, 1:03 p.m. | author: Calvin | type: Answer |
parent: baqog | lastedit_date: June 29, 2018, 1:03 p.m. | lastedit_user: Calvin |
content:
That makes perfect sense. I knew I missed something obvious. Thank you both very much for the help!
Q96: question about bionetAPI
id: vxpxp | creation_date: July 2, 2018, 3:13 a.m. | author: dali Zan | type: Question |
parent: | lastedit_date: July 2, 2018, 1:43 p.m. | lastedit_user: Maciek Swat |
content:
When I read some paper about bionet, the python part of it often import a plugin named bionetAPI, but when I import bionetAPI in my file, it will shows 'no module named bionetAPI'. Is it not included in the default library?
Answer:
id: jgleq | creation_date: July 2, 2018, 12:33 p.m. | author: Maciek Swat | type: Answer |
parent: vxpxp | lastedit_date: July 2, 2018, 12:33 p.m. | lastedit_user: Maciek Swat |
content:
BionetSolver has been phased out and was replaced by SBMLSolver (much better library)
Comment:
id: awbzg | creation_date: July 2, 2018, 12:46 p.m. | author: dali Zan | type: Comment |
parent: jgleq | lastedit_date: July 2, 2018, 12:46 p.m. | lastedit_user: dali Zan |
content:
thanks for told me that, but I wonder it not possible to call the bionetAPI function library in Python now? Or the name of the library is changed? My CC3D version is 3.7.7 .
Answer:
id: nxroz | creation_date: July 2, 2018, 12:52 p.m. | author: Maciek Swat | type: Answer |
parent: vxpxp | lastedit_date: July 2, 2018, 12:52 p.m. | lastedit_user: Maciek Swat |
content:
Ar you trying to run some old code that uses BionetSolver? If so then you may pick an older version of CC3D and run it there but you really should switch to SBMLSolver it is much easier to use interface. If you need help with porting your code from BionetSolver to SBMLSolver please let us know
Comment:
id: povnx | creation_date: July 2, 2018, 1:06 p.m. | author: dali Zan | type: Comment |
parent: nxroz | lastedit_date: July 2, 2018, 1:06 p.m. | lastedit_user: dali Zan |
content:
Yes, I'm learning how to use BionetSolver using the code in some previous papers. I will download an old version of CC3D to try to run BionetSolver, and then try to learn the new SBMLSolver. I'll ask if there's a problem with the transition, thank you.
Answer:
id: zxagb | creation_date: July 2, 2018, 1:43 p.m. | author: Maciek Swat | type: Answer |
parent: vxpxp | lastedit_date: July 2, 2018, 1:43 p.m. | lastedit_user: Maciek Swat |
content:
I would start with SBMLSolver
Comment:
id: babag | creation_date: Sept. 28, 2018, 9:12 a.m. | author: 昊 杨 | type: Comment |
parent: jgleq | lastedit_date: Sept. 28, 2018, 9:12 a.m. | lastedit_user: 昊 杨 |
content:
How to port BionetSolver code to SBMLSolver?
Q97: modify clusterId
id: vxpgb | creation_date: July 9, 2018, 11:33 p.m. | author: levenazhang | type: Question |
parent: | lastedit_date: July 10, 2018, 12:32 p.m. | lastedit_user: James Sluka |
content:
I have a kidney cystic disease simulation now.
This is a part of my codes.
for compartmentList in self.clusterList:
clusterId=0
clusterVolume=0
for cell in CompartmentList(compartmentList):
clusterVolume+=cell.volume
clusterId=cell.clusterId
if mcs==100:
mitosisClusterIdList.append(clusterId) #At this part, I only want to make the cluster5 mitosis, so how can I do it?
for clusterId in mitosisClusterIdList:
Answer:
id: awbbm | creation_date: July 10, 2018, 12:28 p.m. | author: James Sluka | type: Answer |
parent: vxpgb | lastedit_date: July 10, 2018, 12:32 p.m. | lastedit_user: James Sluka |
content:
It is hard to interpret the code snippet, it will help if you format it as "code" using the {;} option in the editor.for compartmentList in self.clusterList:
clusterId=0
clusterVolume=0
for cell in CompartmentList(compartmentList):
clusterVolume+=cell.volume
clusterId=cell.clusterId
if mcs==100:
mitosisClusterIdList.append(clusterId) #At this part, I only want to make the cluster5 mitosis, so how can I do it?
for clusterId in mitosisClusterIdList:
If you know the ID of the cluster of interest is 5 then it should just be;mitosisClusterIdList.append(5) #At this part, I only want to make the cluster5 mitosis, so how can I do it?
Or, if your code is supposed to be;
Then change the
for compartmentList in self.clusterList:
clusterId=0
clusterVolume=0
for cell in CompartmentList(compartmentList):
clusterVolume+=cell.volume
clusterId=cell.clusterId
if mcs==100:
mitosisClusterIdList.append(clusterId) #At this part, I only want to make the cluster5 mitosis, so how can I do it?
for clusterId in mitosisClusterIdList:
to
if mcs==100:
if mcs==100 and clusterId==5:
Q98: Tips for making 2D simulations as computationally light as possible?
id: jglal | creation_date: July 10, 2018, 6:23 a.m. | author: Thomas Achee | type: Question |
parent: | lastedit_date: July 12, 2018, 10:49 a.m. | lastedit_user: James Sluka |
content:
This isn't for research, simply playing with the shapes and textures for some potential artistic works.
Questions for you brilliant scientists:
-What are your tips for making these simulations run as quickly as possible?
-Potential avenues to try?
Is GPU acceleration/ and or parallelization implementation even remotely feesable?
Any ideas or potential pitfalls would be greatly appreciated, before I go off and try something crazy and overly complicated.
I'm pretty adept with python and motivated to learn
Answer:
id: jglll | creation_date: July 10, 2018, 12:18 p.m. | author: James Sluka | type: Answer |
parent: jglal | lastedit_date: July 10, 2018, 12:18 p.m. | lastedit_user: James Sluka |
content:
CC3D already has parallelization built in and often works pretty well. You can also gain speed by limiting how much text is written to the console. The debug frequency in particular can slow down a simulation significantly.
To do both these things, add the lines below to your project's xml file (after the end of the <Potts> block);
<Metadata>
<DebugOutputFrequency>100</DebugOutputFrequency>
<NumberOfProcessors> 4</NumberOfProcessors>
</Metadata>
The above tells CC3D to only output the step info every 100 MCS and that it should try to use 4 CPUs (or threads, or cores). If your python script also writes to the terminal (with print statements) then remove or reduce how often that is done.
If a surface constraint isn't needed you can also remove that from the simulation, which helps speed. Check your xml for a chunk like;<Plugin Name="Surface">
<SurfaceEnergyParameters CellType="typeA" LambdaSurface="2.0" TargetSurface="79"/>
<SurfaceEnergyParameters CellType="typeB" LambdaSurface="2.0" TargetSurface="79"/>
</Plugin>
and either comment it out or delete it. Also remove any reference in your python file to cells' surface parameters (targetSurface, lambdaSurface).
For artistic results you might consider using periodic boundary conditions, which will wrap the simulation around and removes the effects of the border on the simulation. If a cell drifts off the right side of the simulation box it reappears on the left. Cells on one side of the box interact with cells on the other via the wrapping. This will help to generate repetitive patterns. In the <Potts> section of the xml file add; <Boundary_x>Periodic</Boundary_x>
<Boundary_y>Periodic</Boundary_y>
(You can also add an additional line if you want the Z-axis to be periodic as well.)
You can also explore removing an unneeded (for your simulation) Plugins. In your xml file look for things like <Plugin Name="CenterOfMass"> and remove them if they aren't needed.
One more thing to try is a hexagonal (instead of square) lattice. That probably won't help speed but a hexagonal lattice might give more interesting patterns since the symmetry goes from 4 to 6. In the <Potts> block of the xml file add; <LatticeType>Hexagonal</LatticeType>
There are a couple changes in the player that can also speed things up;
1. [visualization tab][cell borders] turn off if you don't need the cell borders. In large simulations (particularly in 3D) drawing cell borders takes a lot of time.
2. [Tools tab][Configuration...][output tab];
a. increase the "update screen every Nth MCS" to a larger value so the screen isn't rewritten so often.
b. uncheck the "save image every Nth MCS" or set to a large value
c. uncheck the "Save lattice every Nth MCS"
3. [Tools tab][Configuration...][Axes'n'Decor tab];
a. uncheck everything.
I hope these ideas help.
Answer:
id: baqne | creation_date: July 12, 2018, 5:08 a.m. | author: Thomas Achee | type: Answer |
parent: jglal | lastedit_date: July 12, 2018, 5:08 a.m. | lastedit_user: Thomas Achee |
content:
Wow, what an incredibly in depth answer! Thank you so much, Dr.Sulka!
Comment:
id: mqxgz | creation_date: July 12, 2018, 10:49 a.m. | author: James Sluka | type: Comment |
parent: baqne | lastedit_date: July 12, 2018, 10:49 a.m. | lastedit_user: James Sluka |
content:
Your welcome. Feel free to post any interesting or pleasing results you get with CC3D to this forum.
Q99: Error: Could not import roadrunner
id: gnmjk | creation_date: July 13, 2018, 2:44 p.m. | author: Jairaj Mathur | type: Question |
parent: | lastedit_date: July 18, 2018, 8:21 a.m. | lastedit_user: Maciek Swat |
content:
Hi all
I am trying to install compucell3D on ubuntu 16.04 LTS. I followed the steps mentioned on the tutorial page (http://www.compucell3d.org/SrcBin/LinuxCompile). Everything went smoothly, except for the last step, where I run compucell3D using ./compucell3d.sh, ad it gives the following error:
./compucell3d.sh: 10: ./compucell3d.sh: Bad substitution
CompuCell3D - version 3.7.7
['/home/jairaj/cc3D_install/player5', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/home/jairaj/.local/lib/python2.7/site-packages', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages']
Could not import roadrunner
Segmentation fault (core dumped)
Can someone let me know what is going on? Here are the specs for my machine:
RAM: 32 GB
Processor: Intel® Xeon(R) CPU E5-2687W v3 @ 3.10GHz × 20
graphics: NVS 310/PCIe/SSE2
Thanks a lot!
Answer:
id: jgvnj | creation_date: July 18, 2018, 8:21 a.m. | author: Maciek Swat | type: Answer |
parent: gnmjk | lastedit_date: July 18, 2018, 8:21 a.m. | lastedit_user: Maciek Swat |
content:
how did you install libroadrunner? Are you on physical machine or running inside virtual machine?
another option is to use conda to install cc3d:
Here is a link:
http://www.compucell3d.org/SrcBin/CompilingOnLinux2017
One of the prerequisites here is that you install miniconda before trying this way of installing CC3D
Here is a link
https://conda.io/miniconda.html
Q100: How to let cells die after a certain number of steps
id: ergvk | creation_date: July 14, 2018, 9:07 a.m. | author: dali Zan | type: Question |
parent: | lastedit_date: Aug. 17, 2018, 3:08 p.m. | lastedit_user: Juliano Ferrari Gianlupi |
content:
How can I attach a timer to a cell , let it die after a certain number of steps. This kind of cell does not exist at the beginning, it will appear at a certain condition of the model running.
Answer:
id: gnmpk | creation_date: July 16, 2018, 12:49 p.m. | author: James Sluka | type: Answer |
parent: ergvk | lastedit_date: July 16, 2018, 12:49 p.m. | lastedit_user: James Sluka |
content:
You can attach a python dictionary to a cell when it is created, so you can log the mcs step that the cell was created at. When you create the cell of this particular type;
cellDict=CompuCell.getPyAttrib(cell) # attach a dictionary to this cell
cellDict["createdMCS"] = mcs # add a dictionary item for the step the cell was created.
print "CellID=", cell.id," dictionary element createdMCS=",cellDict["createdMCS"]
Elsewhere you have another chunk of python code that determines how old a cell is and kills it if it is too old;
for cell in self.cellList:
if cell.type == "The type of cell that you want to track and kill":
cellDict=CompuCell.getPyAttrib(cell) # get the dictionary for this cell
if (mcs - cellDict["createdMCS"]) > 100 : # kill if the cell is > 100 mcs old
cell.targetVolume=0
Comment:
id: vxlxg | creation_date: Aug. 17, 2018, 3:08 p.m. | author: Juliano Ferrari Gianlupi | type: Comment |
parent: gnmpk | lastedit_date: Aug. 17, 2018, 3:08 p.m. | lastedit_user: Juliano Ferrari Gianlupi |
content:
You don't need to do
cellDict=CompuCell.getPyAttrib(cell)
cellDict["createdMCS"] = mcs
You can just do
cell.dict["attribute"] = attribute
Q101: Installation issues with the older and the newest cc3d linux versions
id: nxemk | creation_date: July 26, 2018, 12:26 p.m. | author: Pauli Tikka | type: Question |
parent: | lastedit_date: Aug. 16, 2018, 9:09 a.m. | lastedit_user: Pauli Tikka |
content:
Dear reader,
I have encountered some installation issues with the older, and also the newest cc3d linux version(/s) [using win ubuntu 18].
Some additional info below:
File attached: installation_25718.txt (3.33 KB)
I wonder if somebody could (please):
a) post the newest cc3d linux binary and installation guide to internet (here or some other place, https://sourceforge.net/projects/cc3d/?), or
b) send (here/the other cc3d internet site) completely installed&dependency free linux version's files/folder,
which would presumably work as such when run on (win app) ubuntu file system (../compucell3d.sh +enter)?
c) have any other ideas, what(?)
Thanks!
Best regards,
Pauli
attachments(redirected):
.\CC3D_allanswered_linked_files\installation_25718.txt
Answer:
id: bawvn | creation_date: July 31, 2018, 1:31 p.m. | author: Pauli Tikka | type: Answer |
parent: nxemk | lastedit_date: July 31, 2018, 1:31 p.m. | lastedit_user: Pauli Tikka |
content:
Hi,
I got the installation binary files, but still have some issues, namely:
I tried to run the program after cygwin (1) and ubuntu 18 (win) (2) installations, but...
(1)
pauli@Kansallinen ~/CC3D_v377
$ ./compucell3d.sh
CompuCell3D - version 3.7.7
./compucell3d.sh: rivi 40: /home/pauli/CC3D_v377/Python27/bin/python: cannot execute binary file: Exec format error
(2)
(fyi)
pauli@Kansallinen:~/CC3D_v377$ ls -l
total 20
...
-rwxr-xr-x 1 1481910 3007 1473 Feb 1 00:52 compucell3d.sh
...
-rwxr-xr-x 1 1481910 3007 846 Feb 5 18:30 optimization.sh
-rwxr-xr-x 1 1481910 3007 1477 Feb 5 18:29 paramScan.sh
drwxr-sr-x 1 1481910 3007 512 Feb 5 23:07 player5
...
-rwxr-xr-x 1 1481910 3007 1510 Feb 5 23:19 runScript.sh
-rwxr-xr-x 1 1481910 3007 618 Feb 1 00:53 twedit++.sh
THEN:
pauli@Kansallinen:~/CC3D_v377$ ./compucell3d.sh
./compucell3d.sh: 10: ./compucell3d.sh: Bad substitution
CompuCell3D - version 3.7.7
['/home/pauli/CC3D_v377/player5', '/home/pauli/CC3D_v377/Python27/lib/python27.zip', '/home/pauli/CC3D_v377/Python27/lib/python2.7', '/home/pauli/CC3D_v377/Python27/lib/python2.7/plat-linux2', '/home/pauli/CC3D_v377/Python27/lib/python2.7/lib-tk', '/home/pauli/CC3D_v377/Python27/lib/python2.7/lib-old', '/home/pauli/CC3D_v377/Python27/lib/python2.7/lib-dynload', '/home/pauli/.local/lib/python2.7/site-packages', '/home/pauli/CC3D_v377/Python27/lib/python2.7/site-packages']
QXcbConnection: Could not connect to display
Aborted (core dumped)
tried several pages for the display issue, but does not seem to work...
/e.g. https://superuser.com/questions/1075659/open-ubuntu-bashs-gui-applications-on-windows-10
Any ideas/suggestions how to solve?
Answer:
id: lkmgm | creation_date: Aug. 2, 2018, 5:23 p.m. | author: Maciek Swat | type: Answer |
parent: nxemk | lastedit_date: Aug. 2, 2018, 5:23 p.m. | lastedit_user: Maciek Swat |
content:
I will build binaries for kubuntu 18.04 64 bit later soon. In the mean time you may want to check easy-to-follow conda-based installation instructions
http://www.compucell3d.org/SrcBin/CompilingOnLinux2017
This could get you running on many types of linuxes really fast . Regardless we will post binaries for 18.04
Answer:
id: xzwmo | creation_date: Aug. 3, 2018, 2:50 a.m. | author: Maciek Swat | type: Answer |
parent: nxemk | lastedit_date: Aug. 3, 2018, 2:50 a.m. | lastedit_user: Maciek Swat |
content:
We uploaded ubuntu 18_04_64 binaries to the sourceforge website:
https://sourceforge.net/projects/cc3d/files/3.7.8/linux/ubuntu_18_04_64/
Take a look and see if they work for you. We tested them on clean install of ubuntu 18_04 64bit and they seem to work fine
Answer:
id: wrxog | creation_date: Aug. 3, 2018, 8:26 a.m. | author: Pauli Tikka | type: Answer |
parent: nxemk | lastedit_date: Aug. 3, 2018, 8:26 a.m. | lastedit_user: Pauli Tikka |
content:
Hi,
Thank you for your answer! Should there be any issues I’ll let you know!
BR,
Pauli
Comment:
id: kgozo | creation_date: Aug. 14, 2018, 10:11 a.m. | author: Pauli Tikka | type: Comment |
parent: xzwmo | lastedit_date: Aug. 14, 2018, 10:11 a.m. | lastedit_user: Pauli Tikka |
content:
Hi,
Thanks for the binaries again. So now
I experienced the same problem with the screen/gui, when opening the compucell3d.sh:
ptikka@Kansallinen:~/CC3D_GIT/378_auto$ ./compucell3d.sh -x
./compucell3d.sh: 10: ./compucell3d.sh: Bad substitution
CompuCell3D - version 3.7.6
['/home/ptikka/CC3D_GIT/378_auto/player5', '/home/ptikka/CC3D_GIT/378_auto/Python27/lib/python27.zip', '/home/ptikka/CC3D_GIT/378_auto/Python27/lib/python2.7', '/home/ptikka/CC3D_GIT/378_auto/Python27/lib/python2.7/plat-linux2', '/home/ptikka/CC3D_GIT/378_auto/Python27/lib/python2.7/lib-tk', '/home/ptikka/CC3D_GIT/378_auto/Python27/lib/python2.7/lib-old', '/home/ptikka/CC3D_GIT/378_auto/Python27/lib/python2.7/lib-dynload', '/home/ptikka/CC3D_GIT/378_auto/Python27/lib/python2.7/site-packages']
QXcbConnection: Could not connect to display 127.0.0.1:10.0
The best self-help that I found was here (below), but it did not work for me (see above):
https://stackoverflow.com/questions/44720732/php-ubuntu-qxcbconnection-could-not-connect-to-display-aborted
Aborted (core dumped)
Any Ideas how to solve this?
Next I test the conda_based installation.
BR.
Pauli
Comment:
id: nxvzb | creation_date: Aug. 15, 2018, midnight | author: Maciek Swat | type: Comment |
parent: kgozo | lastedit_date: Aug. 15, 2018, midnight | lastedit_user: Maciek Swat |
content:
At this point I really think you should try compiling the code yourself. Part of a challenge here is that we are dealing with non-standard configuration. Are you on cluster of some sort or do you have root access to the machine you are trying to install too?
If you are in charge of the machine I would recommend using ubuntu 18_04_64 bit.
Another task you can perform now is to try running any of the pyqt5 demos . for example try downloading and running https://github.com/baoboa/pyqt5/tree/master/examples/mainwindows/mdi
For this to work you need to have functional copy of pyqt5 which is easy to install via conda , simply type
conda install pyqt
Let me know if you can run any pyqt5 application. If , yes than we should try figuring out how to compile CC3D on your system. The conda-based installer should work
Comment:
id: rrwgo | creation_date: Aug. 15, 2018, 10:03 a.m. | author: Pauli Tikka | type: Comment |
parent: nxvzb | lastedit_date: Aug. 15, 2018, 10:24 a.m. | lastedit_user: Pauli Tikka |
content:
Hi,
Thanks!
I tried both of the solutions:
1) ...In the mean time you may want to check easy-to-follow conda-based installation instructions
(http://www.compucell3d.org/SrcBin/CompilingOnLinux2017)
2) ...installed pyqt with: conda install -c conda-forge pyqt ,
and tried the compiling cc3d in my system; which is at the moment just my win PC with ubuntu 18.04 application from MSstore.
The idea was to later run my model simulations as a part of a swarm parameter estimation code of J. Sluka with my/his cluster computers that have linux cc3d paramscan.sh available.
---
But the results were (for 1,2):
1)
USING SYSTEM
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ptikka/cc3d_376_build
[ 5%] Built target muParserShared
[ 6%] Built target BasicUtilsShared
[ 9%] Built target cleaver
[ 11%] Built target AutomatonShared
[ 11%] Swig source
[ 12%] Swig source
:1: Error: Unable to find 'swig.swg'
:3: Error: Unable to find 'python.swg'
/home/ptikka/CC3D_GIT3/CompuCell3D/core/pyinterface/CC3DXML/CC3DXML.i:32: Error: Unable to find 'std_string.i'
/home/ptikka/CC3D_GIT3/CompuCell3D/core/pyinterface/CC3DXML/CC3DXML.i:35: Error: Unable to find 'std_map.i'
/home/ptikka/CC3D_GIT3/CompuCell3D/core/pyinterface/CC3DXML/CC3DXML.i:38: Error: Unable to find 'std_vector.i'
/home/ptikka/CC3D_GIT3/CompuCell3D/core/pyinterface/CC3DXML/CC3DXML.i:41: Error: Unable to find 'std_list.i'
core/pyinterface/CC3DXML/CMakeFiles/CC3DXML_swig_compilation.dir/build.make:61: recipe for target 'core/pyinterface/CC3DXML/CMakeFiles/_CC3DXML.dir/CC3DXMLPYTHON.stamp' failed
make[2]: *** [core/pyinterface/CC3DXML/CMakeFiles/_CC3DXML.dir/CC3DXMLPYTHON.stamp] Error 1
:make[2]: *** Deleting file 'core/pyinterface/CC3DXML/CMakeFiles/_CC3DXML.dir/CC3DXMLPYTHON.stamp'
1CMakeFiles/Makefile2:5451: recipe for target 'core/pyinterface/CC3DXML/CMakeFiles/CC3DXML_swig_compilation.dir/all' failed
:make[1]: *** [core/pyinterface/CC3DXML/CMakeFiles/CC3DXML_swig_compilation.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Error: Unable to find 'swig.swg'
:3: Error: Unable to find 'python.swg'
/home/ptikka/CC3D_GIT3/CompuCell3D/core/pyinterface/CompuCellPython/CompuCell.i:16: Error: Unable to find 'typemaps.i'
/home/ptikka/CC3D_GIT3/CompuCell3D/core/pyinterface/CompuCellPython/CompuCell.i:54: Error: Unable to find 'windows.i'
/home/ptikka/CC3D_GIT3/CompuCell3D/core/pyinterface/CompuCellPython/CompuCell.i:124: Error: Unable to find 'stl.i'
/home/ptikka/CC3D_GIT3/CompuCell3D/core/pyinterface/CompuCellPython/CompuCell.i:129: Error: Unable to find 'std_string.i'
/home/ptikka/CC3D_GIT3/CompuCell3D/core/pyinterface/CompuCellPython/CompuCell.i:132: Error: Unable to find 'std_map.i'
/home/ptikka/CC3D_GIT3/CompuCell3D/core/pyinterface/CompuCellPython/CompuCell.i:135: Error: Unable to find 'std_set.i'
/home/ptikka/CC3D_GIT3/CompuCell3D/core/pyinterface/CompuCellPython/CompuCell.i:138: Error: Unable to find 'std_vector.i'
/home/ptikka/CC3D_GIT3/CompuCell3D/core/pyinterface/CompuCellPython/CompuCell.i:140: Error: Unable to find 'stl.i'
/home/ptikka/CC3D_GIT3/CompuCell3D/core/pyinterface/CompuCellPython/CompuCell.i:143: Error: Unable to find 'exception.i'
/home/ptikka/CC3D_GIT3/CompuCell3D/core/pyinterface/CompuCellPython/CompuCellExtraDeclarations.i:29: Error: Unable to find 'std_string.i'
/home/ptikka/CC3D_GIT3/CompuCell3D/core/pyinterface/CompuCellPython/CompuCellExtraDeclarations.i:32: Error: Unable to find 'std_map.i'
/home/ptikka/CC3D_GIT3/CompuCell3D/core/pyinterface/CompuCellPython/CompuCellExtraDeclarations.i:35: Error: Unable to find 'std_set.i'
/home/ptikka/CC3D_GIT3/CompuCell3D/core/pyinterface/CompuCellPython/CompuCellExtraDeclarations.i:40: Error: Unable to find 'std_vector.i'
core/pyinterface/CompuCellPython/CMakeFiles/CompuCell_swig_compilation.dir/build.make:61: recipe for target 'core/pyinterface/CompuCellPython/CMakeFiles/_CompuCell.dir/CompuCellPYTHON.stamp' failed
make[2]: *** [core/pyinterface/CompuCellPython/CMakeFiles/_CompuCell.dir/CompuCellPYTHON.stamp] Error 1
make[2]: *** Deleting file 'core/pyinterface/CompuCellPython/CMakeFiles/_CompuCell.dir/CompuCellPYTHON.stamp'
CMakeFiles/Makefile2:5502: recipe for target 'core/pyinterface/CompuCellPython/CMakeFiles/CompuCell_swig_compilation.dir/all' failed
make[1]: *** [core/pyinterface/CompuCellPython/CMakeFiles/CompuCell_swig_compilation.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
2) 'in conda'
(my_env22) ptikka@Kansallinen:~$ python mdi.py
QXcbConnection: Could not connect to display :0
Aborted (core dumped)
Ideas to solve?
BR,
Pauli
Comment:
id: gneam | creation_date: Aug. 15, 2018, 10:06 a.m. | author: Pauli Tikka | type: Comment |
parent: rrwgo | lastedit_date: Aug. 15, 2018, 10:06 a.m. | lastedit_user: Pauli Tikka |
content:
PS
the other thing that I tried was (the installation guide solution as in your cc3d homepage for ubuntu 18.04):
(my_env22) ptikka@Kansallinen:~$ sudo apt-get install g++ swig cmake-gui python-numpy python-pyqt5 python-pyqt5.qsci python-pyqt5.qtopengl python-pyqt5.qtsvg libvtk6-dev python-vtk6 python-dev libxml2-dev build-essential git
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'cmake-qt-gui' instead of 'cmake-gui'
build-essential is already the newest version (12.4ubuntu1).
g++ is already the newest version (4:7.3.0-3ubuntu2).
python-dev is already the newest version (2.7.15~rc1-1).
python-numpy is already the newest version (1:1.13.3-2ubuntu1).
cmake-qt-gui is already the newest version (3.10.2-1ubuntu2).
libvtk6-dev is already the newest version (6.3.0+dfsg1-11build1).
python-pyqt5 is already the newest version (5.10.1+dfsg-1ubuntu2).
python-pyqt5.qsci is already the newest version (2.10.2+dfsg-4).
python-pyqt5.qtopengl is already the newest version (5.10.1+dfsg-1ubuntu2).
python-pyqt5.qtsvg is already the newest version (5.10.1+dfsg-1ubuntu2).
python-vtk6 is already the newest version (6.3.0+dfsg1-11build1).
swig is already the newest version (3.0.12-1).
git is already the newest version (1:2.17.1-1ubuntu0.1).
The following additional packages will be installed:
libxml2
The following packages will be upgraded:
libxml2 libxml2-dev
2 upgraded, 0 newly installed, 0 to remove and 121 not upgraded.
Need to get 1420 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libxml2-dev amd64 2.9.4+dfsg1-6.1ubuntu1.2 [757 kB]
Get:2 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libxml2 amd64 2.9.4+dfsg1-6.1ubuntu1.2 [663 kB]
Fetched 1420 kB in 1s (1211 kB/s)
(Reading database ... 103749 files and directories currently installed.)
Preparing to unpack .../libxml2-dev_2.9.4+dfsg1-6.1ubuntu1.2_amd64.deb ...
Unpacking libxml2-dev:amd64 (2.9.4+dfsg1-6.1ubuntu1.2) over (2.9.4+dfsg1-6.1ubuntu1) ...
Preparing to unpack .../libxml2_2.9.4+dfsg1-6.1ubuntu1.2_amd64.deb ...
Unpacking libxml2:amd64 (2.9.4+dfsg1-6.1ubuntu1.2) over (2.9.4+dfsg1-6.1ubuntu1) ...
Setting up libxml2:amd64 (2.9.4+dfsg1-6.1ubuntu1.2) ...
Setting up libxml2-dev:amd64 (2.9.4+dfsg1-6.1ubuntu1.2) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Processing triggers for man-db (2.8.3-2) ...
(my_env22) ptikka@Kansallinen:~$ pip install pyqtgraph
Collecting pyqtgraph
Downloading https://files.pythonhosted.org/packages/cd/ad/307e0280df5c19986c4206d138ec3a8954afc722cea991f4adb4a16337d9/pyqtgraph-0.10.0.tar.gz (1.5MB)
100% |████████████████████████████████| 1.6MB 1.6MB/s
Collecting numpy (from pyqtgraph)
Downloading https://files.pythonhosted.org/packages/85/51/ba4564ded90e093dbb6adfc3e21f99ae953d9ad56477e1b0d4a93bacf7d3/numpy-1.15.0-cp27-cp27mu-manylinux1_x86_64.whl (13.8MB)
100% |████████████████████████████████| 13.8MB 1.3MB/s
Building wheels for collected packages: pyqtgraph
Running setup.py bdist_wheel for pyqtgraph ... done
Stored in directory: /home/ptikka/.cache/pip/wheels/93/a2/de/184ecdefdb91d760706d02389015dfa3b96e927eb1c42ace37
Successfully built pyqtgraph
Installing collected packages: numpy, pyqtgraph
Successfully installed numpy-1.15.0 pyqtgraph-0.10.0
You are using pip version 10.0.1, however version 18.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(my_env22) ptikka@Kansallinen:~$ cd /home/m/CC3D_GIT4
-bash: cd: /home/m/CC3D_GIT4: No such file or directory
(my_env22) ptikka@Kansallinen:~$ cd /CC3D_GIT4
-bash: cd: /CC3D_GIT4: No such file or directory
(my_env22) ptikka@Kansallinen:~$ cd ~/CC3D_GIT4
(my_env22) ptikka@Kansallinen:~/CC3D_GIT4$ ls
(my_env22) ptikka@Kansallinen:~/CC3D_GIT4$ git clone https://github.com/CompuCell3D/CompuCell3D.git .
Cloning into '.'...
remote: Counting objects: 22653, done.
remote: Compressing objects: 100% (34/34), done.
remote: Total 22653 (delta 12), reused 26 (delta 9), pack-reused 22610
Receiving objects: 100% (22653/22653), 52.68 MiB | 3.28 MiB/s, done.
Resolving deltas: 100% (14719/14719), done.
Checking out files: 100% (9965/9965), done.
(my_env22) ptikka@Kansallinen:~/CC3D_GIT4$ cmake-gui
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-ptikka'
qt.qpa.screen: QXcbConnection: Could not connect to display :0
Could not connect to any X display.
Comment:
id: awnxq | creation_date: Aug. 16, 2018, 12:07 a.m. | author: Maciek Swat | type: Comment |
parent: rrwgo | lastedit_date: Aug. 16, 2018, 12:07 a.m. | lastedit_user: Maciek Swat |
content:
So the issue is with swig that ships with conda. On ubuntu 18.04 swig struggles finding its core include files. The solution is to remove swig executable from conda environment created and install swig manually from sources.
So remove swig executable from <xxx>/miniconda2/envs/<your env>/swig
install swig from source (www.swig.org)
and add swig (compiled manually) to your path:
export PATH=<PATH TO SWIG>/bin:$PATH
Comment:
id: nxvbb | creation_date: Aug. 16, 2018, 12:11 a.m. | author: Maciek Swat | type: Comment |
parent: gneam | lastedit_date: Aug. 16, 2018, 12:11 a.m. | lastedit_user: Maciek Swat |
content:
So this is actually very important. Your system, for whatever reason, fails to open any qt application (cmake-gui is a qt application). If you are running on your personal machine you should instal ubuntu from https://www.ubuntu.com/download/desktop, not from MS Store. If this is a cluster you need to tell administrator to locate the problem that prevents you from running qt-based applications that are part of the operating system (such as cmake-gui). Let me know how this goes
Comment:
id: vxqak | creation_date: Aug. 16, 2018, 9 a.m. | author: Pauli Tikka | type: Comment |
parent: nxvbb | lastedit_date: Aug. 16, 2018, 9:09 a.m. | lastedit_user: Pauli Tikka |
content:
Hi,
I got the cc3d installation working with binaries (but not with the compiling method) by correcting my ubuntu 18.04 win app version as mentioned in:
https://tech-ish.com/2018/05/10/how-to-install-ubuntu-desktop-on-windows-10/
Example drive (see the photos):
ptikka@Kansallinen:~/CC3D_GIT/378_auto$ ./compucell3d.sh
./compucell3d.sh: 10: ./compucell3d.sh: Bad substitution
CompuCell3D - version 3.7.6
['/home/ptikka/CC3D_GIT/378_auto/player5', '/home/ptikka/CC3D_GIT/378_auto/P...
The compiled installation still produces:
ptikka@Kansallinen:~/CC3D_install$ ./compucell3d.sh
./compucell3d.sh: 10: ./compucell3d.sh: Bad substitution
CompuCell3D - version 3.7.7
['/home/ptikka/CC3D_install/player5', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/gtk-2.0']
Could not import roadrunner
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-ptikka'
compucell3d.pyw: type(argv)= <type 'list'>
compucell3d.pyw: argv= ['--currentDir=/home/ptikka/CC3D_install']
Could not create PLotManager. resorting to PLotManagerBase - plots will not work properly. Here is the exception:
No module named pyqtgraph
could not import pyqtgraph
/home/ptikka/CC3D_install/player5/Plugins/ViewManagerPlugins/PlotWindowInterface.py:16: RuntimeWarning: Could not find webcolors. Run "pip install webcolors" to fix this
warnings.warn('Could not find webcolors. Run "pip install webcolors" to fix this', RuntimeWarning)
Traceback (most recent call last):
File "/home/ptikka/CC3D_install/player5/compucell3d.pyw", line 258, in <module>
error_code = main(sys.argv[1:])
File "/home/ptikka/CC3D_install/player5/compucell3d.pyw", line 232, in main
mainWindow = UserInterface()
File "/home/ptikka/CC3D_install/player5/UI/UserInterface.py", line 93, in __init__
self.__createViewManager()
File "/home/ptikka/CC3D_install/player5/UI/UserInterface.py", line 483, in __createViewManager
self.viewmanager = SimpleTabView(self) # ViewManager.factory(self, self)
File "/home/ptikka/CC3D_install/player5/Plugins/ViewManagerPlugins/SimpleTabView.py", line 124, in __init__
from WidgetManager import WidgetManager
File "/home/ptikka/CC3D_install/player5/Plugins/ViewManagerPlugins/WidgetManager.py", line 2, in <module>
from PlotWindowInterface import PlotWindowInterface
File "/home/ptikka/CC3D_install/player5/Plugins/ViewManagerPlugins/PlotWindowInterface.py", line 18, in <module>
import pyqtgraph as pg
ImportError: No module named pyqtgraph
(I have installed pyqtgraph and the depencies as: http://www.compucell3d.org/SrcBin/LinuxCompile)
Anyway, so far so good. Thank you for your help!
BR, Pauli
attachments(redirected):
.\CC3D_allanswered_linked_files\binaries-installation is ok-tikka16818.png
.\CC3D_allanswered_linked_files\binaries-installation is ok2-tikka16818.png
Q102: SteadyStateDiffusionSolver in a 3D model
id: awneq | creation_date: Aug. 16, 2018, 9:44 a.m. | author: Mukti C | type: Question |
parent: | lastedit_date: Aug. 29, 2018, 9:44 a.m. | lastedit_user: Mukti C |
content:
Hello,
I am working on a project using CompuCell3D, and I am using the "SteadyStateDiffusionSolver" to manage chemical diffusion in a 3D model. I am running the simulations on a Windows machine. I cannot seem to get the solver to diffuse in the z-direction, even though I have specified all the required fields. The chemical concentrations in voxels other than those in the z=0 plane are zero. Furthermore, the SteadyStateDiffusionSolver demo models provided with CompuCell3D displayed similar behavior. Can you please help me figure out what might be going wrong with the diffusion solver? The XML file is as below:
<CompuCell3D Revision="20171121" Version="3.7.7">
<Potts>
<!-- Basic properties of CPM (GGH) algorithm -->
<Dimensions x="100" y="100" z="100"/>
<Steps>100</Steps>
<Temperature>35</Temperature>
<NeighborOrder>1</NeighborOrder>
</Potts>
<Plugin Name="CellType">
<!-- Listing all cell types in the simulation -->
<CellType TypeId="0" TypeName="Medium"/>
<CellType TypeId="1" TypeName="Condensing"/>
<CellType TypeId="2" TypeName="NonCondensing"/>
</Plugin>
<Steppable Type="SteadyStateDiffusionSolver">
<DiffusionField Name="TestChemical">
<DiffusionData>
<FieldName>TestChemical</FieldName>
<DiffusionConstant>1000</DiffusionConstant>
<DecayConstant>2e-12</DecayConstant>
<DoNotDecayIn>Medium</DoNotDecayIn>
</DiffusionData>
<SecretionData>
<Uptake Type="Condensing" MaxUptake="0.02" RelativeUptakeRate="0.99"/>
<Uptake Type="NonCondensing" MaxUptake="0.03" RelativeUptakeRate="0.99"/>
</SecretionData>
<BoundaryConditions>
<Plane Axis="X">
<ConstantDerivative PlanePosition="Min" Value="0.0"/>
<ConstantDerivative PlanePosition="Max" Value="0.0"/>
</Plane>
<Plane Axis="Y">
<ConstantValue PlanePosition="Min" Value="0"/>
<ConstantValue PlanePosition="Max" Value="70"/>
</Plane>
<Plane Axis="Z">
<ConstantDerivative PlanePosition="Min" Value="0.0"/>
<ConstantDerivative PlanePosition="Max" Value="0.0"/>
</Plane>
</BoundaryConditions>
</DiffusionField>
</CompuCell3D>
Thank you for your time.
Answer:
id: zxrqq | creation_date: Aug. 16, 2018, 2:45 p.m. | author: Juliano Ferrari Gianlupi | type: Answer |
parent: awneq | lastedit_date: Aug. 16, 2018, 2:45 p.m. | lastedit_user: Juliano Ferrari Gianlupi |
content:
Hi,
If you're using CC3D 3.7.7 you should upgrade to 3.7.8 as it fixed many bugs.
The XML I used (just with the fixed tag):
<CompuCell3D Revision="20180722" Version="3.7.8">
<Potts>
<!-- Basic properties of CPM (GGH) algorithm -->
<Dimensions x="100" y="100" z="100"/>
<Steps>1000</Steps>
<Temperature>10.0</Temperature>
<NeighborOrder>1</NeighborOrder>
</Potts>
<Plugin Name="CellType">
<!-- Listing all cell types in the simulation -->
<CellType TypeId="0" TypeName="Medium"/>
<CellType TypeId="1" TypeName="Condensing"/>
<CellType TypeId="2" TypeName="NonCondensing"/>
</Plugin>
<Steppable Type="SteadyStateDiffusionSolver2D">
<DiffusionField Name="TestChemical">
<DiffusionData>
<FieldName>TestChemical</FieldName>
<DiffusionConstant>1000</DiffusionConstant>
<DecayConstant>2e-12</DecayConstant>
<DoNotDecayIn>Medium</DoNotDecayIn>
</DiffusionData>
<SecretionData>
<Uptake Type="Condensing" MaxUptake="0.02" RelativeUptakeRate="0.99"/>
<Uptake Type="NonCondensing" MaxUptake="0.03" RelativeUptakeRate="0.99"/>
</SecretionData>
<BoundaryConditions>
<Plane Axis="X">
<ConstantDerivative PlanePosition="Min" Value="0.0"/>
<ConstantDerivative PlanePosition="Max" Value="0.0"/>
</Plane>
<Plane Axis="Y">
<ConstantValue PlanePosition="Min" Value="0"/>
<ConstantValue PlanePosition="Max" Value="70"/>
</Plane>
<Plane Axis="Z">
<ConstantDerivative PlanePosition="Min" Value="0.0"/>
<ConstantDerivative PlanePosition="Max" Value="0.0"/>
</Plane>
</BoundaryConditions>
</DiffusionField>
</Steppable>
</CompuCell3D>
attachments(redirected):
.\CC3D_allanswered_linked_files\Capture.png
Comment:
id: oavxm | creation_date: Aug. 16, 2018, 3:51 p.m. | author: Mukti C | type: Comment |
parent: zxrqq | lastedit_date: Aug. 17, 2018, 3:03 p.m. | lastedit_user: Mukti C |
content:
Hi,
Thank you very much! Updating from 3.7.7 to 3.7.8 worked.
Answer:
id: rrarp | creation_date: Aug. 17, 2018, 3:02 p.m. | author: James Sluka | type: Answer |
parent: awneq | lastedit_date: Aug. 17, 2018, 3:02 p.m. | lastedit_user: James Sluka |
content:
Checking for this kind of XML error can be a challenge. You can use an online XML validator such as https://www.w3schools.com/xml/xml_validator.asp . If you paste the original XML into the first text box on this page and click on the "Check XML" button you get;
attachments(redirected):
.\CC3D_allanswered_linked_files\Untitled.png
Comment:
id: gnwnq | creation_date: Aug. 17, 2018, 3:04 p.m. | author: Mukti C | type: Comment |
parent: rrarp | lastedit_date: Aug. 17, 2018, 3:04 p.m. | lastedit_user: Mukti C |
content:
Thank you for the tip!
Answer:
id: mqrov | creation_date: Aug. 18, 2018, midnight | author: Maciek Swat | type: Answer |
parent: awneq | lastedit_date: Aug. 18, 2018, midnight | lastedit_user: Maciek Swat |
content:
I think this has to do with your boundary conditions . You are putting constant value conditions along y axis and no flux along z and x axes. With those arrangement of conditions if for a given y concentration across xz plane is constant (but changes as you change y coordinate) but if you look at e.g. y, z plane you see the diffusive pattern:
Are you seeing the same behavior on Windows? I ran my test on OSX
attachments(redirected):
.\CC3D_allanswered_linked_files\Screen Shot 2018-08-17 at 9.58.01 PM.png
Comment:
id: vxllm | creation_date: Aug. 29, 2018, 9:44 a.m. | author: Mukti C | type: Comment |
parent: mqrov | lastedit_date: Aug. 29, 2018, 9:44 a.m. | lastedit_user: Mukti C |
content:
Hi, thank you for your response. Yes, I see the same behavior on Windows now.
Q103: (How) can I use the BoundaryWalker Metropolis Algorithm
id: bavjj | creation_date: Aug. 19, 2018, 10:58 a.m. | author: margrietpalm | type: Question |
parent: | lastedit_date: Aug. 22, 2018, 12:05 a.m. | lastedit_user: Maciek Swat |
content:
After a long time of not using CC3D, I'm trying to run some simulations. The simulation is a simple 2D model that involves a single cell migrating towards a field. I want to use a quite big resolution (target volume 8000), and this results in a rather slow simulation (500 MCS takes about 1 minute). As most pixels in this model are not at the boundary, it seems that all the unsuccessful copy attempts create a massive overhead. I remember there was an option to use an alternative metropolis algorithm that only considered pixels at the boundaries, and after some digging in the docs I found that this was the BoundaryWalker. However, it comes with this warming: "BoundaryWalkerAlgorithm does not really work with OpenMP version of CC3D which includes all versions starting with 3.6.0.". When I use this option, 500 MCS only take about 2 seconds, but the cells seems to fall apart into single pixels.
The simulations I intend to run take about 25000 MCS, so I really need to speed of the BoundaryWalker algorithm. So, is there any way that I could still use the BoundaryWalker? As I'm not interested on running simulations on multiple cores, compiling CC3D without OpenMP would be an option for me. FYI, I've compiled the latest version from github on ubuntu.
Answer:
id: bavgj | creation_date: Aug. 20, 2018, 1:34 p.m. | author: James Sluka | type: Answer |
parent: bavjj | lastedit_date: Aug. 20, 2018, 1:34 p.m. | lastedit_user: James Sluka |
content:
1. Reduce the amount of output player generates and try to use multiple threads. In the XML file after the <Potts> section add;
<Metadata>
<NumberOfProcessors>4</NumberOfProcessors>
<DebugOutputFrequency>100</DebugOutputFrequency>
</Metadata>
2. Reduce how often Player updates the screen and reduce or remove any saving of simulation screen shots.
- In Player; <Tools><Configuration><Output tab>"Update Screen" 10 or 100 or more.
- "Save image every Nth MCS" turned off or set to a large number like 500 or 1000.
- Make sure "Save Lattice" is off.
- If you only have one cell then you don't need to display the cell border; <Visualization>"Cell Borders" off.
4. If you are doing any file I/O try to reduce how often you do it. I/O is slow.
5. Make sure you are using the most recent CC3D, currently that is 3.7.8.
That's all I can think of that doesn't use the boundary walker. Perhaps Maciej has thoughts on getting the boundary walker to work in your setup. As a crude fix, you could install a CC3D version from before 3.6.0 but this is not recommended.
Answer:
id: xzqvv | creation_date: Aug. 21, 2018, 11:56 p.m. | author: Maciek Swat | type: Answer |
parent: bavjj | lastedit_date: Aug. 21, 2018, 11:56 p.m. | lastedit_user: Maciek Swat |
content:
Hi Margriet
We would have to look at the implementation of the BoundaryWalker algorithm inside Potts3D. Indeed it will not run on multiple cores but I could be implemented to run in such a mode. If you are on a a single core one quick check would be to compare old CC3D implementations with recent ones. As far as I recalled there was not much effort (perhaps not at all) put into porting Boundary walker to new OpenMP enabled versions. I can certainly help you getting this functionality working in the CC3D. If you have a benchmark simulation that you can share with me (either here or email) that would help us a lot
Answer:
id: rrakp | creation_date: Aug. 22, 2018, 12:05 a.m. | author: Maciek Swat | type: Answer |
parent: bavjj | lastedit_date: Aug. 22, 2018, 12:05 a.m. | lastedit_user: Maciek Swat |
content:
So I checked the code and it looks like we did port BoundaryWalker to the latest versions of CC3D
I have just ran the following demo:
Demos/PluginDemos/GlobalBoundaryPixelTracker/Simulation/cellsort_2D_boundary.xml
that uses BouldaryWalker algorithm and it worked fine. Perhaps we could take a closer look at your simulation and understand why you see this strange behavior
Q104: Error in running CompuCell3D 3.7.8
id: zxrrl | creation_date: Aug. 29, 2018, 2:18 p.m. | author: Mukti C | type: Question |
parent: | lastedit_date: Aug. 29, 2018, 5:25 p.m. | lastedit_user: Mukti C |
content:
Hi,
I updated to CompuCell3D 3.7.8 on my machine, and every time I try to run a simulation, I get this error message:
Do you know what the error might be, and how to fix it?
Thank you for your help!
attachments(redirected):
.\CC3D_allanswered_linked_files\error2.png
Answer:
id: eraao | creation_date: Aug. 29, 2018, 3:42 p.m. | author: Maciek Swat | type: Answer |
parent: zxrrl | lastedit_date: Aug. 29, 2018, 3:42 p.m. | lastedit_user: Maciek Swat |
content:
You installed GPU version and either do not have GPU or are missing OpenCL drivers. Best thing is to reinstall non-gpu version
Comment:
id: lkxxg | creation_date: Aug. 29, 2018, 5:25 p.m. | author: Mukti C | type: Comment |
parent: eraao | lastedit_date: Aug. 29, 2018, 5:25 p.m. | lastedit_user: Mukti C |
content:
Thanks. This fixed the issue.
Q105: adjusting the outputted screenshots
id: baxoo | creation_date: Sept. 2, 2018, 2:58 p.m. | author: Thomas Achee | type: Question |
parent: | lastedit_date: Sept. 4, 2018, 11:59 a.m. | lastedit_user: James Sluka |
content:
So what i'm trying to do:
given a simulation of arbitrary size m by n, have the outputted screenshots from CC3d fill the entire image with no border space.
I noticed in the console output there was this line:
from settings windowsLayout = {0: {'sceneName': 'Cell_Field', 'is3D': False, 'planePosition': 0, 'cameraViewUp': (0.0, 1.0, 0.0), 'winPosition': PyQt5.QtCore.QPoint(), 'planeName': 'XY', 'winType': 'Graphics', 'cameraClippingRange': (1566.79845139, 1606.36406885), 'winSize': PyQt5.QtCore.QSize(1463, 780), 'sceneType': 'CellField', 'cameraFocalPoint': (661.848138864, 378.783508443, 0.0), 'cameraPosition': (661.848138864, 378.783508443, 1582.62469837)}}
CREATING SCREENSHOT WINDOW
ADDITIONAL SCREENSHOT WINDOW SIZE= (1936, 1119)
how do I adjust settings windowsLayout?
Answer:
id: kgzge | creation_date: Sept. 4, 2018, 11:57 a.m. | author: James Sluka | type: Answer |
parent: baxoo | lastedit_date: Sept. 4, 2018, 11:59 a.m. | lastedit_user: James Sluka |
content:
In CC3D Player you can control the size and frequency that screenshots are saved. Go to the Tools tab then "Configuration" then select the Output tab. On this tab you can set how often images are saved ("Save images every Nth MCS") and the size of the screen shot. By default only the main CC3D window is saved. If your simulation has more than just that one window you can save those shots as well by clicking on the camera icon in each individual window. The saved images don't include a window frame or anything outside the graphics window. If you save more than the default window then each additional window's images are in a separate folder.
Player remembers the scaling of you individual windows. So if you turn off the axis display (Tools, Configuration Axes'n'Decor tab), and zoom the image (and/or translate as well) you can fill up the graphics window as much as you want. Every image will be saved with that zoom setting. If you change the zoom part way through a simulation the subsequent images will have the new zoom.
Since player remembers zoom and scaling it can be tricky to get it to save the setup you want. The easiest way is to start the simulation in player and do one or two mcs (single step Player). Create the windows you want and scale/zoom/translate as you want. Click on the camera icon for each window. Do a couple more MCS and then close Player. You should also double check where Player is writing the files (Tools - Configuration - Output "Project Location" and "Output"). The next time you run that simulation it should remember the windows, scaling etc.
Player makes PNG files. You can animate those images with something like Imagemagick.
Q106: Parameter Scan Crash Upon Running Simulation
id: mqzvr | creation_date: Sept. 3, 2018, 1:41 p.m. | author: Elijah Basile | type: Question |
parent: | lastedit_date: Sept. 3, 2018, 8:59 p.m. | lastedit_user: Maciek Swat |
content:
I received the following error when adding parameter scan values in my simulation. The compucell3d player would open but then immediately would close after starting the first iteration (creating the first iterative directory). Any idea on why this crash is happening? Thanks in advance.
attachments(redirected):
.\CC3D_allanswered_linked_files\ParamScanError.png
Answer:
id: xzonz | creation_date: Sept. 3, 2018, 8:59 p.m. | author: Maciek Swat | type: Answer |
parent: mqzvr | lastedit_date: Sept. 3, 2018, 8:59 p.m. | lastedit_user: Maciek Swat |
content:
What version of CC3D are you running and what is your operating system? If this is not too much trouble, could you post a toy version of a parameter scan you are trying to run? (remove any code you do not want to share publicly but make sure that the error happens )
Comment:
id: rvqpn | creation_date: Jan. 26, 2019, 9:36 p.m. | author: Elijah Basile | type: Comment |
parent: xzonz | lastedit_date: Jan. 26, 2019, 9:36 p.m. | lastedit_user: Elijah Basile |
content:
I apologize, I forgot to respond to your comment, I managed to solve the issue. It was because of an issue with my personal computer.
Thank you.
Q107: how to change a cell type associated with any pixel?
id: oazng | creation_date: Sept. 5, 2018, 6:14 a.m. | author: DrjyPrk | type: Question |
parent: | lastedit_date: Sept. 6, 2018, 8:36 a.m. | lastedit_user: DrjyPrk |
content:
I want to monitor chemical concentration at pixels and change the cell type associated with it to other cell type (not medium) in python.
Answer:
id: rrzqe | creation_date: Sept. 5, 2018, 9:04 a.m. | author: Mukti C | type: Answer |
parent: oazng | lastedit_date: Sept. 5, 2018, 9:04 a.m. | lastedit_user: Mukti C |
content:
This code snippet will help you get the cell at a pixel, and then change its type:
cell = self.cellField[x, y, z] #x, y, z are the pixel coordinates
cell.type = self.NEW_TYPE
Comment:
id: vxzme | creation_date: Sept. 6, 2018, 8:36 a.m. | author: DrjyPrk | type: Comment |
parent: rrzqe | lastedit_date: Sept. 6, 2018, 8:36 a.m. | lastedit_user: DrjyPrk |
content:
that worked, but I wanted a little more specific cell.type change of pixel. Using your code snippet gives changes the cell type of all the pixel of the same cell. now, is it possible to change the pixels of a specific region of cell? say, I have 100 pixels are assigned to a single cell of a specific cell type, I want to change 50 of them to another cell type upon some condition.
Answer:
id: jegja | creation_date: Nov. 27, 2018, 12:36 p.m. | author: James Sluka | type: Answer |
parent: oazng | lastedit_date: Nov. 27, 2018, 12:36 p.m. | lastedit_user: James Sluka |
content:
Here is code that changes half the pixels in each cell of one type to new cells of a different type. In the XML you need to plugins;
<Plugin Name="CenterOfMass"/> <!-- needed for this demo -->
<Plugin Name="PixelTracker"/> <!-- needed for this demo -->
In the Python steppables file (in a steppable's step function):
# change half the pixels of all the CellTypeA cells to new CellTypeB cells
for cell in self.cellListByType(self.CELLTYPEA): # visit all cells of CellTypeA
newCell=self.potts.createCell() # create a new CellTypeB cell for the pixels
newCell.type=self.CELLTYPEB # assign a type to the new cell
pixelList = self.getCellPixelList(cell) # get list of pixels in original cell
for pXYZ in pixelList: # iterate over the pixels in the original cell
# if the pixel is in the right half of the cell (of CellTYpeA) then
# reassign it to newCell (of CellTypeB)
if pXYZ.pixel.x > cell.xCOM: # pixel is in right half of cell
# assign the pixel from the old cell to the new cell
self.cellField[pXYZ.pixel.x,pXYZ.pixel.y,pXYZ.pixel.z]=newCell
If you are using localflex for cell volume and surface you may have to assign volume, lambdaVolume, surface and lambdaSurface to the new cell.
Q108: Applying force to cells
id: xzovb | creation_date: Sept. 7, 2018, 5:46 a.m. | author: dali Zan | type: Question |
parent: | lastedit_date: Sept. 8, 2018, 1:48 a.m. | lastedit_user: dali Zan |
content:
Recently, I tried to exert an external force on cells.But I found the action point of force seems to be only the barycenter of the cell when I checked PythonScriptingManual. I wonder if I can apply a force on the periphery of the cell. Thanks.
Answer:
id: mqzpa | creation_date: Sept. 7, 2018, 12:10 p.m. | author: Maciek Swat | type: Answer |
parent: xzovb | lastedit_date: Sept. 7, 2018, 12:10 p.m. | lastedit_user: Maciek Swat |
content:
Can you post a toy script showing what you have done. it would help us make sure we are on the same page
Comment:
id: gnjzr | creation_date: Sept. 8, 2018, 1:48 a.m. | author: dali Zan | type: Comment |
parent: mqzpa | lastedit_date: Sept. 8, 2018, 1:48 a.m. | lastedit_user: dali Zan |
content:
I built a tumor cluster consisting of a group of cells. And I want to use the following sample statement to exert a force on the tumor cluster.
class CellMotilitySteppable(SteppableBasePy):
def __init__(self,_simulator,_frequency=5):
SteppableBasePy.__init__(self,_simulator,_frequency)
def start(self):
for cell in self.cellList:
break
cell.lambdaVecX=10.1*uniform(-0.5,0.5)
cell.lambdaVecY=10.1*uniform(-0.5,0.5)
cell.lambdaVecZ=0
def step(self,mcs):
for cell in self.cellList:
cell.lambdaVecX=10.1*uniform(-0.5,0.5)
cell.lambdaVecY=10.1*uniform(-0.5,0.5)
I found that the example statement seems apply force acting on a single cell's barycenter, similar to the force exerted on the cell as a whole. I wonder if I can put a force on a point in the cell membrane or on the periphery of a cell cluster.
Q109: Haptotaxis in CC3D
id: xzpaj | creation_date: Sept. 19, 2018, 3:28 p.m. | author: Mukti C | type: Question |
parent: | lastedit_date: Sept. 19, 2018, 3:28 p.m. | lastedit_user: Mukti C |
content:
How can I implement haptotaxis in CC3D? I can't figure out how to model haptotaxis using the existing plugins/features like applying forces to cells, etc. Any help would be appreciated! Thanks.
Answer:
id: rrgnn | creation_date: Sept. 19, 2018, 4:31 p.m. | author: James Sluka | type: Answer |
parent: xzpaj | lastedit_date: Sept. 19, 2018, 4:31 p.m. | lastedit_user: James Sluka |
content:
Just spitballing here but ...
You can create a stationary field to mimic the ECM. First you create a CC3D field and set the diffusion and decay constants to zero (so the field doesn't change with time). You then iterate over every pixel in the lattice and assign a concentration to each pixel based on some algebraic/geometric pattern that represents the ECM. You then use the chemotaxis module in CC3D to have the cells chemo/haptotax to that stationary field.
You might take a look at this paper for another approach;
https://www.nature.com/articles/srep19905
Comment:
id: kgwkq | creation_date: Sept. 20, 2018, 4:20 p.m. | author: Mukti C | type: Comment |
parent: rrgnn | lastedit_date: Sept. 20, 2018, 4:20 p.m. | lastedit_user: Mukti C |
content:
Thank you! I'll try that.
Answer:
id: jgmvz | creation_date: Sept. 20, 2018, 4:44 p.m. | author: James Sluka | type: Answer |
parent: xzpaj | lastedit_date: Sept. 20, 2018, 4:44 p.m. | lastedit_user: James Sluka |
content:
Attached is a demo of using a stationary field and chemotax (File attached: Haptotaxis_test.zip (9.09 KB)) The bottom left plot below shows the position history of the one cell (red) in the simulation.
is to mimic haptotaxis.
attachments(redirected):
.\CC3D_allanswered_linked_files\Haptotaxis_test.zip
.\CC3D_allanswered_linked_files\screenShot.png
Comment:
id: zxwvp | creation_date: Sept. 20, 2018, 8:38 p.m. | author: Mukti C | type: Comment |
parent: jgmvz | lastedit_date: Sept. 20, 2018, 8:38 p.m. | lastedit_user: Mukti C |
content:
Thank you very much! I tried this with my model, and it worked!
One question though - if I use cells to represent "ECM", will the Chemotaxis plugin not work? That is, will the cell not move through the "ECM" cells?
Answer:
id: xzprj | creation_date: Sept. 21, 2018, 11:41 a.m. | author: James Sluka | type: Answer |
parent: xzpaj | lastedit_date: Sept. 21, 2018, 11:41 a.m. | lastedit_user: James Sluka |
content:
If you use cells as the ECM you can "freeze" them so they don't move. You could then have them secrete a field that the regular cells chemotax to. If you set the decay rate of the field high it will be localized to just the vicinity of the ECM cells. You are correct though that in 2D the moving cells wont be able to cross over the stationary ECM cells (well, actually, if the ECM cells are small, and the neighbor order is big enough, it would be possible to cross over but not very likely.) However, if you model in 3D then the moving cells can move past/around the stationary ECM cells without any problem.
If you want the cells to haptotax in a particular direction you could have the ECM cells secrete at different rates.
I thought it might be possible to use the AdhesionFlex plugin in CC3D to assign different adhesiveness between ECM cells (frozen) and the moving cell. I wanted to be able to have the ECM have a gradient of adhesion so the cell migrates in a particular direction. But apparently I don't understand the AdhesionFlex setup well enough to get it to work. I've attached the code since it shows how to create the ECM cells (each ECM cell is a single pixel) in python and that might help you get started on a secretion/chemotaxis version of the haptotaxis model. File attached: Haptotaxis_test_cell_ecm.zip (10.75 KB)
attachments(redirected):
.\CC3D_allanswered_linked_files\Haptotaxis_test_cell_ecm.zip
.\CC3D_allanswered_linked_files\screenShot.png
Comment:
id: lkgol | creation_date: Sept. 27, 2018, 9:48 a.m. | author: Mukti C | type: Comment |
parent: xzprj | lastedit_date: Sept. 27, 2018, 9:48 a.m. | lastedit_user: Mukti C |
content:
Thank you very much!
Q110: Maximum cell types in CC3D
id: jenaw | creation_date: Oct. 21, 2018, 9:51 a.m. | author: sandeep13712 | type: Question |
parent: | lastedit_date: Oct. 21, 2018, 9:51 a.m. | lastedit_user: sandeep13712 |
content:
Hi CC3Ders,
Has someone used CC3D to perform a simulation where there are more than 128 cell types (1 medium and 127 normal cell types)? I am not able to run a simulation with 128+ cell types.
Sandeep
http://individual.utoronto.ca/sandeepkumar/
Answer:
id: verpr | creation_date: Oct. 22, 2018, 10:56 a.m. | author: James Sluka | type: Answer |
parent: jenaw | lastedit_date: Oct. 22, 2018, 10:56 a.m. | lastedit_user: James Sluka |
content:
I don't know if CC3D is limited to 128 cell types but are you sure you need that many?
What characteristics differentiate the cell types?
You could use a dictionary attached to each cell to track the cell's type and since a dictionary can contain any Python variable type it would be essentially unlimited. Since you can assign target volumes and surfaces to cells individually you can do that based on the type defined in the dictionary (or directly save the target and lambda values in the dictionary). You should also be able to change things like adhesion and motility on a per cell basis. Individual cells could also have different growth rates, dividing volumes, death attributes etc. Counts of each cell type can be generated by examining each cell's dictionary value.
You could even color the cells by type by creating a scalar field containing the cell's dictionary type.
Comment:
id: azlbz | creation_date: Oct. 22, 2018, 1:41 p.m. | author: sandeep13712 | type: Comment |
parent: verpr | lastedit_date: Oct. 22, 2018, 1:41 p.m. | lastedit_user: sandeep13712 |
content:
Hi James,
Thanks for your email.
Actually, I want to have an energy term which depends on the cell-pair. Two different cell-pairs have different energy.
I know having those many cell types is a bit non-standard approach. But, after due thought process and analysis, it seems to be me that this is the only solution for now. I may find a better way (through custom plugin) to implement this later on.
Sandeep
http://individual.utoronto.ca/sandeepkumar/
Answer:
id: pnwva | creation_date: Oct. 22, 2018, 3:27 p.m. | author: James Sluka | type: Answer |
parent: jenaw | lastedit_date: Oct. 22, 2018, 3:27 p.m. | lastedit_user: James Sluka |
content:
One approach to using a dictionary to generate energy terms would be to use focal point plasticity (FPP) links between cells. (Basically you attach the cells' center with a spring.) The cell type is stored in the dictionary and you create FPP links between the various cells, based on their type, perhaps when the cells get closer than some threshold distance. This gives you forces that affect the Potts energy. The forces can be attractive or repulsive.
Q111: Extracting cell surface pixels from simulation
id: pnwza | creation_date: Oct. 26, 2018, 9:41 a.m. | author: Claire Walsh | type: Question |
parent: | lastedit_date: Oct. 26, 2018, 9:41 a.m. | lastedit_user: Claire Walsh |
content:
Hi All
So I have a very simple model to investigate changes in cell morphology based on contact parameters in 3D. The model itself is a 500,500,500 space with around 10,000 cells in it (target volume ~4000) (all very simple). The issue is, that I am wanting to use the output from the compucell model in further simulations to do with MRI imaging. What I need for the MRI simulations is just the boundary or (cell membrane) of every cell (preferably as a mesh but voxels is fine too). So far I have been saving lattice data files trying to read these into python and extract cell boundaries via a marching cubes algorithm. This seems like a lot of work given that CC3D must know the boundary pixels for each cell. Is there a way to get at just this information instead?
Thanks
C
Answer:
id: noxje | creation_date: Nov. 26, 2018, 6:13 p.m. | author: James Sluka | type: Answer |
parent: pnwza | lastedit_date: Nov. 26, 2018, 6:13 p.m. | lastedit_user: James Sluka |
content:
Yes, CC3D does keep track of the surface pixels. For an XML + Python simulation;
1. To the XML add the needed plugin;
<Plugin Name="BoundaryPixelTracker">
<!-- Module tracking boundary pixels of each cell -->
<NeighborOrder>1</NeighborOrder>
</Plugin>
2. To list all the surface pixels in the Python file use something like this in a steppable:
for cell in self.cellList:
pixelList=self.getCellBoundaryPixelList(cell)
print "\nCell ID=",cell.id," volume=",cell.volume,
print " # Surface Pix=",pixelList.numberOfPixels()
for boundaryPixelTrackerData in pixelList:
print boundaryPixelTrackerData.pixel
Which generates this:
Cell ID= 4 volume= 63 # Surface Pix= 55
(41,47,40)
(41,47,41)
(41,47,42)
...
(44,50,41)
(44,50,42)
(44,50,43)
You can extract the x, y, and z using;px=boundaryPixelTrackerData.pixel.x
py=boundaryPixelTrackerData.pixel.y
pz=boundaryPixelTrackerData.pixel.z
It should be straightforward to output the pixel coordinates to a fileThere is a demo of the BoundaryPixelTracker at;
C:\CompuCell3D-64bit\Demos\PluginDemos\BoundaryPixelTrackerExample\
Q112: how to keep the compartments consistent after cluster mitosis?
id: zgpqn | creation_date: Oct. 29, 2018, 10:43 a.m. | author: DrjyPrk | type: Question |
parent: | lastedit_date: Oct. 29, 2018, 10:43 a.m. | lastedit_user: DrjyPrk |
content:
for a simulation, I want asymmetric growth of different compartments of a cluster cell. while under mitosis, the cluster divides but the child cell is having one/many missing compartments. I want the cells to have all the compartments throughout the simulation. can anyone help me with it?
Answer:
id: bzama | creation_date: Nov. 28, 2018, 11:47 p.m. | author: Maciek Swat | type: Answer |
parent: zgpqn | lastedit_date: Nov. 28, 2018, 11:47 p.m. | lastedit_user: Maciek Swat |
content:
could you post a simple version of your simulation demonstrating the problem?
Q113: How to distinguish between primary cells and divided cells in the same type of cells
id: kvlrz | creation_date: Nov. 4, 2018, 9:40 a.m. | author: 昊 杨 | type: Question |
parent: | lastedit_date: Nov. 4, 2018, 9:40 a.m. | lastedit_user: 昊 杨 |
content:
Assume that only a few cells with cell type A are split. How do you distinguish between the original type A cells and the split type A daughter cells? Thanks in advance
Answer:
id: jegka | creation_date: Nov. 26, 2018, 5:24 p.m. | author: James Sluka | type: Answer |
parent: kvlrz | lastedit_date: Nov. 28, 2018, 12:06 p.m. | lastedit_user: James Sluka |
content:
There are a couple ways to do this. One is to simply keep track of the cell IDs. The daughter cell will always have a cell ID greater than the parent. (CC3D never reuses Cell IDs.) So you might start your simulation and save all the original cell IDs in a list. Later in the simulation as the cells divide you can keep another list of the new cell IDs. To get fancy you can also store the daughter cell's parent cell ID in the second list.
A second way is to attach a dictionary to each cell. You can then have a dictionary item like "daughterOfCellId". At startup all the cells present are daughters of cell ID "0", this marks the cells as being present at the start. When cells divide one of the cells has "daughterOfCellId" set to the cellID of the parent, the parent cell's dictionary doesn't get changed.
Q114: Inserting New Equations into CC3D
id: pnolz | creation_date: Nov. 25, 2018, 2:57 p.m. | author: Soham | type: Question |
parent: | lastedit_date: Nov. 25, 2018, 2:57 p.m. | lastedit_user: Soham |
content:
If I want to transfer a multivariable equation defining growth of two cell types from MATLAB to CC3D how would I go about doing it? Is there a defined cell type for fibroblasts and cancer cells? Also, what would be a general definition of the movement given that the two cell populations are symbiotic and the growth depends on a combination of nutrients and other species? Any help would be appreciated! Thank you.
Answer:
id: pnoaj | creation_date: Nov. 26, 2018, 6:38 p.m. | author: James Sluka | type: Answer |
parent: pnolz | lastedit_date: Nov. 26, 2018, 6:38 p.m. | lastedit_user: James Sluka |
content:
In CC3D you can use any calculable function to drive cell growth and proliferation, so it should be straightforward to transfer the equation from MATLAB to CC3D Python. Each cell type, or even each individual cell, can have its own growth function. The growth function can respond to an external field (e.g., nutrient concentration), contact with neighbors of particular types, etc.
CC3D doesn't include any defined cell types. You build your cell types based on their behaviors and the goals of the simulation.
You can define diffusible fields (perhaps sourced by particular cell types) to which your cells respond by chemotaxis, proliferation, necrosis etc.
You might take a look at (that is, load it into Twedit++ then launch to CC3D) the amoeba demo;
C:\CompuCell3D-64bit\Demos\Models\bacterium_macrophage\bacterium_macrophage.cc3d
The two cell types each secrete their own chemical field and the cells chemotax (positive or negative) to those fields.
Comment:
id: ejrpe | creation_date: Nov. 26, 2018, 9:53 p.m. | author: Soham | type: Comment |
parent: pnoaj | lastedit_date: Nov. 26, 2018, 9:53 p.m. | lastedit_user: Soham |
content:
Thank you for your help.
Q115: test
id: zgxor | creation_date: Nov. 26, 2018, 6:44 p.m. | author: James Sluka | type: Question |
parent: | lastedit_date: Nov. 26, 2018, 6:44 p.m. | lastedit_user: James Sluka |
content:
test jps
Answer:
id: azwob | creation_date: Nov. 27, 2018, 12:41 p.m. | author: James Sluka | type: Answer |
parent: zgxor | lastedit_date: Nov. 27, 2018, 12:41 p.m. | lastedit_user: James Sluka |
content:
AllAnswered doesn't appear to be sending email notifications like it should.
Q116: Steppable issue since v3.7.8
id: kvvje | creation_date: Dec. 17, 2018, 2:30 p.m. | author: Thomas | type: Question |
parent: | lastedit_date: Dec. 17, 2018, 2:30 p.m. | lastedit_user: Thomas |
content:
Hello. I am studying the cell behavior on Compucell3D by tracking the cell position to obtain its velocity. To do so, I am using a python code to obtain the position of the cell at each 10 MCS:
-----------------------------------------------------------------------------------------------------------------------------
from PySteppables import *
import CompuCell
import sys
from XMLUtils import dictionaryToMapStrStr as d2mss
from XMLUtils import CC3DXMLListPy
class SurfaceSteering(SteppablePy):
def __init__(self,_simulator,_frequency=1):
SteppablePy.__init__(self,_frequency)
self.simulator=_simulator
self.nTrackerPlugin=CompuCell.getNeighborTrackerPlugin()
self.inventory=self.simulator.getPotts().getCellInventory()
self.cellList=CellList(self.inventory)
def start(self):
pass
def step(self, mcs):
for cell in self.cellList:
if cell.type==1:
xCOM = cell.xCOM
yCOM = cell.yCOM
----------------------------------------------------------------------------------
This code worked normally on v3.7.7 but since v3.7.8, each time I launch the simulation, I have the following message :
" SurfaceSteering instance has no attribute 'add_steering_panel' "
I don’t understand because I did not ask my code to create a steering panel. Do you have an idea about this issue ? Thank you.
Answer:
id: pnnap | creation_date: Dec. 17, 2018, 5:18 p.m. | author: James Sluka | type: Answer |
parent: kvvje | lastedit_date: Dec. 17, 2018, 5:20 p.m. | lastedit_user: James Sluka |
content:
Try this,
change
class SurfaceSteering(SteppablePy)
to
class SurfaceSteering(SteppableBasePy)
change
SteppablePy.__init__(self,_frequency)
to
SteppableBasePy.__init__(self,_simulator,_frequency)
omit
self.simulator=_simulator
If that doesn't work, can you zip the entire project up and send it to me? In Twedit++ there is a zip command under the "CC3D Project" menu.
Answer:
id: mooja | creation_date: Dec. 17, 2018, 5:59 p.m. | author: Thomas | type: Answer |
parent: kvvje | lastedit_date: Dec. 17, 2018, 5:59 p.m. | lastedit_user: Thomas |
content:
Thank you very much. It works now.
However now, I have another problem. I put in my steppable a variable « REPETITION » (associate to nothing) that I defined as a parameter scan to repeat my simulation a specific number of time (to reduce the variability). However, after 2 iterations (corresponding to two differents values of REPETITION), the program stops with this message :
« Error: RuntimeError: bad allocation»
I don’t understand because I did not have this error on the previous version (I zip my project )
File attached: modele.zip (195.18 KB)
attachments(redirected):
.\CC3D_allanswered_linked_files\modele.zip
Comment:
id: wkkva | creation_date: Dec. 18, 2018, 3:26 p.m. | author: James Sluka | type: Comment |
parent: mooja | lastedit_date: Dec. 18, 2018, 3:29 p.m. | lastedit_user: James Sluka |
content:
Looking through your model files there are a couple things that might be causing the problem;
1. Make sure there is a complete set of adhesion pairs, currently there are several missing;
<Plugin Name="Contact">
<Energy Type1="Medium" Type2="Medium">0</Energy>
<Energy Type1="B-TEC" Type2="Medium">20</Energy>
<Energy Type1="B-TEC" Type2="B-TEC">10</Energy>
<Energy Type1="B-TEC" Type2="SubstrateLisse">5</Energy>
<Energy Type1="B-TEC" Type2="SubstrateRug">1</Energy>
<Energy Type1="SubstrateLisse" Type2="Medium">10</Energy> <!-- jps: added missing contact pairs -->
<Energy Type1="SubstrateLisse" Type2="SubstrateLisse">10</Energy>
<Energy Type1="SubstrateLisse" Type2="SubstrateRug">10</Energy>
<Energy Type1="SubstrateRug" Type2="Medium">10</Energy>
<Energy Type1="SubstrateRug" Type2="SubstrateRug">10</Energy>
<NeighborOrder>2</NeighborOrder>
</Plugin>
2. In the UniformInitializer you have the cell width set to 1 pixel but the target volume for all the cells is much bigger than that. Use a larger width in UniformInitializer to avoid creating a very large number of 1-pixel cells.
4. I would be more explicit in the external potential command, i.e.,
<Plugin Name="ExternalPotential">
<Algorithm>CenterOfMassBased</Algorithm> <!-- Algorithm options are: PixelBased, CenterOfMassBased -->
<ExternalPotentialParameters CellType="B-TEC" x="-50." y="0.0" z="0.0"/>
</Plugin>
-50 is a pretty big force and I think you want to point it the other direction, i.e., +5.
3. In the steppables file, in the block that prints to the file, it looks like the indentation is incorrect.
I made these changes and with CC3D 3.7.9 the parameter scan ran to completion.
Comment:
id: bzzlv | creation_date: Dec. 18, 2018, 6:29 p.m. | author: Thomas | type: Comment |
parent: wkkva | lastedit_date: Dec. 18, 2018, 6:30 p.m. | lastedit_user: Thomas |
content:
Thank you. I did all the modifications (except for the external potential that I kept negative because otherwise, the cell went to the decreasing x) and run the code on CC3D 3.7.9. However, if for 5 values of parameter scan, the iterations work, it doesn't work for 10 iterations (stop at 7). I run one of the examples of the parameter scan and it ran to completion (over 100 iterations). So, I wonder if it could be the simulation of the cell because when I put the cell at x=50, CC3D refuses to model it.
Comment:
id: wkkga | creation_date: Dec. 19, 2018, 12:13 p.m. | author: James Sluka | type: Comment |
parent: bzzlv | lastedit_date: Dec. 19, 2018, 12:13 p.m. | lastedit_user: James Sluka |
content:
Yep, I am seeing random crashes as well. We'll need to investigate more.
Comment:
id: jeepe | creation_date: Dec. 19, 2018, 4:51 p.m. | author: James Sluka | type: Comment |
parent: bzzlv | lastedit_date: Dec. 19, 2018, 4:51 p.m. | lastedit_user: James Sluka |
content:
As a short-term fix-- You can restart a parameter scan that crashes simply be relaunching it from Twedit++. The sweep script keeps track of which simulations have been done and will pick up after the simulation that crashed.
It appears that the crashes have something to do with CC3D exiting after a job is finished and all the CC3D output is intact. The crash returns an error code to the parameter sweep routine which is causing it to stop. So simply restarting will eventually work its way through all the simulations.
Comment:
id: noopj | creation_date: Dec. 19, 2018, 5:17 p.m. | author: Thomas | type: Comment |
parent: jeepe | lastedit_date: Dec. 19, 2018, 5:17 p.m. | lastedit_user: Thomas |
content:
Ok and thank you for the help. This is clear. I have 2 last questions:
1) I am unable to obtain screenshot of the simulation every 100 MCS whereas the option is checked in the CC3D preferences. Do you have an idea why it doesn't work?
2) My cell is modeled by a blob with a radius of 10 and and width of 20 (to have only one cell). However, if I displace the initial position of the cell (for example from x=48 to x=50), CC3D refuse to model it. I have the same problem when I try to model a cell with a radius of 15 and a width of 30. CC3D refuse to model it too. Maybe I did not understand something but I don't know why it doesn't work.
Answer:
id: kvvbg | creation_date: Dec. 20, 2018, 3:06 p.m. | author: James Sluka | type: Answer |
parent: kvvje | lastedit_date: Dec. 20, 2018, 3:06 p.m. | lastedit_user: James Sluka |
content:
I am not sure why the saving of screenshots doesn't work like it used to. It looks like now you must, at least once, click on the camera icon in the display CC3D window. Once you do that it is saved in the configuration file for the project and doesn't need to be done again.
As to problems with moving the cell around by a few pixels causing a crash; I think the problem is that the cell ID's and locations are clashing between the blob and uniform init and the .piff file. the piff defines cell ID 3, the blob defines cell ID 1, but the uniform defines many cells that will start with ID 2 and overlap the 3 used in the piff.
Since your B-TEC and SubstrateLasse cell definitions are so simple they might as well be defined in the piff file.
Attached is a zip file with my version of your project. It includes the new piff file and removes the other cell inits. It also is a bit more efficient in the file IO since the file isn't opened and closed every time it is written to. You'll need to edit the file name to your particular file path in the steppables file.
I also commented out a couple lines in the SurfaceSteering __init__ that aren't needed.
The screenshot saving might work since that should be saved in the _settings.sqlite file, but I would start the simulation, then double check the paths and click the camera icon again just to be sure.
File attached: modele_2b.zip (372.18 KB)
attachments(redirected):
.\CC3D_allanswered_linked_files\modele_2b.zip
Comment:
id: bzzww | creation_date: Dec. 26, 2018, 11:10 a.m. | author: Thomas | type: Comment |
parent: kvvbg | lastedit_date: Dec. 26, 2018, 11:10 a.m. | lastedit_user: Thomas |
content:
I did some tests on the model you gave me and I don't have the issue with the parameter scan anymore. Thank you for the help.
Q117: cellListByType function Inquiry
id: gbogw | creation_date: Jan. 14, 2019, 1:51 p.m. | author: Elijah Basile | type: Question |
parent: | lastedit_date: Feb. 11, 2019, 2:39 p.m. | lastedit_user: Elijah Basile |
content:
Hi,
I was wondering, when you trigger the self.cellListByType(exampleCellType), does it run through the entire list linearly through each cell, testing for its type (O(n)) or does it run in a tree like structure (O(log((n)) or less)?
I am just wondering because in the model we are working on, I am curious to see if we can increase simulation speed by placing all of the cells we are testing (and drawing values from) in a single cellList loop with a switch statement for multiple cells instead of several individual cellListByType(cellType) loops.
Hope this explains my issue.
Thanks
Answer:
id: gbkqk | creation_date: Feb. 11, 2019, 2:32 p.m. | author: James Sluka | type: Answer |
parent: gbogw | lastedit_date: Feb. 11, 2019, 2:32 p.m. | lastedit_user: James Sluka |
content:
Only Maciej can answer this one for certain. I would expect though that it is (O(n)) since the cell list is basically unstructured. As cells are created and destroyed, and as cell's potentially change cell types, keeping a tree type list would be more complex than it is worth. I think the cellListByType(cellType) is coded in C++ so it should be pretty fast. I wouldn't expect you to be able to do it much faster by maintaining your own lists of cells by type since that is going to be done in Python.
Having said that though, the only way to know for sure is to try it out. There may be some cases where the cells lists rarely change, the lists are large, and you are only interested in iterating over a small subset of the cells, where maintaining lists by type would be beneficial.
Comment:
id: jekpp | creation_date: Feb. 11, 2019, 2:39 p.m. | author: Elijah Basile | type: Comment |
parent: gbkqk | lastedit_date: Feb. 11, 2019, 2:39 p.m. | lastedit_user: Elijah Basile |
content:
Thank you.
Q118: Cell-Specific Border Color
id: bzjkk | creation_date: Jan. 26, 2019, 5:11 p.m. | author: Elijah Basile | type: Question |
parent: | lastedit_date: Feb. 11, 2019, 2:27 p.m. | lastedit_user: Elijah Basile |
content:
Hello,
I was wondering if it is possible to have cell border color in the player to be cell specific instead of it applying to all cells. I am specifically referring to 'Cell border color' on the right hand side. Thanks.
attachments(redirected):
.\CC3D_allanswered_linked_files\compucell_color.png
Answer:
id: xkexk | creation_date: Feb. 11, 2019, 2:24 p.m. | author: James Sluka | type: Answer |
parent: bzjkk | lastedit_date: Feb. 11, 2019, 2:24 p.m. | lastedit_user: James Sluka |
content:
Sorry, but I don't think there is any easy way to do that.
If you REALLY need to do this, you can create a user-managed pixel based field and assign the pixel colors to whatever you want. Basically you would assign every pixel to be the color of its cell type unless the pixel is also a cell boarder pixel. In the later case you assign a different color. It is going to be slow since you need to iterate over every pixel/voxel in the model.
Comment:
id: rvjmq | creation_date: Feb. 11, 2019, 2:27 p.m. | author: Elijah Basile | type: Comment |
parent: xkexk | lastedit_date: Feb. 11, 2019, 2:27 p.m. | lastedit_user: Elijah Basile |
content:
Thank you!
That answers my question. I'm glad All Answered is sending emails out again.
Q119: run simulation without running the CC3D player
id: vewgq | creation_date: Feb. 1, 2019, 11:57 a.m. | author: Jairaj Mathur | type: Question |
parent: | lastedit_date: Feb. 11, 2019, 2:49 p.m. | lastedit_user: Jairaj Mathur |
content:
Hi all
I am running CC3D on ubuntu 16, and I have observed that when I run the cell sort 3D demo, the simulation completes quicker if I close the CC3D visualizer, ie, without the cells and pixels being displayed in real time. My question is, can I first run and save the simulation, and then visualize it in the player or paraview AFTER the entire simulation has completed?
Answer:
id: qbgpw | creation_date: Feb. 11, 2019, 2:19 p.m. | author: James Sluka | type: Answer |
parent: vewgq | lastedit_date: Feb. 11, 2019, 2:19 p.m. | lastedit_user: James Sluka |
content:
Yes, you can save VTK shots even if the player window isn't visible.
<tools><configuration> check the "save lattice every Nth MCS" box. This creates a set of VTK files for the simulation that you can reload into player at a latter time.
In general though, if refreshing the screen is slowing things down, it is often easier to just reduce how often the screen is updated. Updating is slow, especially in 3D. Use <tools><configuration>"Update screen every Nth MCS" and set it to say 50 or 100. Also, for a 3D model rendering in 3D (as opposed to 2D slices) is slow and rendering cell boundaries in 3D is really slow. You can turn of the cell boundary rendering with <Visualization>uncheck "Cell Borders".
Comment:
id: pnapb | creation_date: Feb. 11, 2019, 2:49 p.m. | author: Jairaj Mathur | type: Comment |
parent: qbgpw | lastedit_date: Feb. 11, 2019, 2:49 p.m. | lastedit_user: Jairaj Mathur |
content:
Thanks a lot!
Q120: Issue in running CompuCell3D using command line interface
id: gbomx | creation_date: Feb. 2, 2019, 12:49 p.m. | author: Mukti C | type: Question |
parent: | lastedit_date: March 20, 2019, 12:35 p.m. | lastedit_user: Maciek Swat |
content:
Hi,
I am trying to run CompuCell3D through the command line on a remote server. I executed this command:
./runScript.sh -i ../Test1_0202.cc3d -f 100 -o ../Results/Test1_0202/
The output was as follows:
./runScript.sh: line 6: warning: setlocale: LC_NUMERIC: cannot change locale (C.UTF-8): No such file or directory
./runScript.sh: line 6: warning: setlocale: LC_NUMERIC: cannot change locale (C.UTF-8)
CompuCell3D - version 3.7.6
CompuCell3D Version: 3.7.8 Revision: 20180908
Platform: linux2
Did not find dl module, will try manual dl initialization...
steppablePath=/data/home/mchowkw1/3.7.8/lib/CompuCell3DSteppables
pluginPath=/data/home/mchowkw1/3.7.8/lib/CompuCell3DPlugins
THIS IS JUST BEFORE LOADING LIBRARIES
AFTER LOAD LIBRARIES
------- CompuCellSetup.py: screenshotDirectoryName= /data/home/mchowkw1/Results/Test1_0202
After this, there was no output at all in the terminal and there weren't any screenshots saved in the provided directory. I don't seem to understand what the issue might be. I'd appreciate any help on this, thank you!
Answer:
id: lnjpb | creation_date: Feb. 11, 2019, 2:12 p.m. | author: James Sluka | type: Answer |
parent: gbomx | lastedit_date: Feb. 11, 2019, 2:12 p.m. | lastedit_user: James Sluka |
content:
Two things to try;
1. instead of ./runScript.sh, just use runScript.sh (run from the directory that contains runScript.sh)
2. Try with full paths to both the runScript and input and output files;
<full path to CC3D dir>/runScript.sh <full path to your job dir>/Test1_0202.cc3d \
-f 100 \
<full path to your job dir>/Results/Test1_0202/
Comment:
id: onjov | creation_date: Feb. 11, 2019, 8:10 p.m. | author: Mukti C | type: Comment |
parent: lnjpb | lastedit_date: Feb. 11, 2019, 8:10 p.m. | lastedit_user: Mukti C |
content:
Hi,
Thank you for your response! However, neither of these methods worked - I'm still seeing the same issue. I'm running the simulation on a cluster. Could that perhaps cause this issue? Also, is there any different configuration required for running remotely on a cluster?
Comment:
id: mojwz | creation_date: Feb. 12, 2019, 10:35 a.m. | author: James Sluka | type: Comment |
parent: onjov | lastedit_date: Feb. 12, 2019, 10:35 a.m. | lastedit_user: James Sluka |
content:
What is the cluster's operating system?
Comment:
id: ejzbk | creation_date: Feb. 12, 2019, 2:44 p.m. | author: Mukti C | type: Comment |
parent: mojwz | lastedit_date: Feb. 12, 2019, 2:44 p.m. | lastedit_user: Mukti C |
content:
CentOS Linux 7. I checked with the system administrator and he confirmed that CompuCell3D was installed on all the nodes, so it's not an issue related to that I think.
Answer:
id: lnjrb | creation_date: Feb. 12, 2019, 4:08 p.m. | author: James Sluka | type: Answer |
parent: gbomx | lastedit_date: Feb. 12, 2019, 4:08 p.m. | lastedit_user: James Sluka |
content:
Hmmm, it looks like you have CC3D 3.7.8 and I don't see any reason for the script not to run, or at least to give an error message. Let me see what the code guru says.
Comment:
id: xkerk | creation_date: Feb. 12, 2019, 7:37 p.m. | author: Mukti C | type: Comment |
parent: lnjrb | lastedit_date: Feb. 12, 2019, 7:37 p.m. | lastedit_user: Mukti C |
content:
Okay, thank you very much!
Answer:
id: rvklr | creation_date: Feb. 14, 2019, 1:32 p.m. | author: Maciek Swat | type: Answer |
parent: gbomx | lastedit_date: Feb. 14, 2019, 1:32 p.m. | lastedit_user: Maciek Swat |
content:
What happens if you tun without "-o" option and put --noOutput instead? Does anything run from the command line?
Comment:
id: gbvrb | creation_date: Feb. 14, 2019, 4:13 p.m. | author: Mukti C | type: Comment |
parent: rvklr | lastedit_date: Feb. 14, 2019, 4:13 p.m. | lastedit_user: Mukti C |
content:
Hi,
The same problem occurs if I run the command with "--noOutput" and without "-o".
Answer:
id: bzlax | creation_date: Feb. 15, 2019, 5:48 p.m. | author: Maciek Swat | type: Answer |
parent: gbomx | lastedit_date: Feb. 15, 2019, 5:48 p.m. | lastedit_user: Maciek Swat |
content:
how did you install cc3d on linux? Can you get player to open or are you able to run any simulation at all?
Comment:
id: nokkk | creation_date: Feb. 18, 2019, 8:56 a.m. | author: Mukti C | type: Comment |
parent: bzlax | lastedit_date: Feb. 18, 2019, 8:56 a.m. | lastedit_user: Mukti C |
content:
I installed CC3D on Linux by just downloading the binary distribution package and extracting the files from the tar file. As it is on a cluster, I have to run it in GUI-less mode and so the player doesn't open. I haven't been able to run any simulation at all either.
Comment:
id: nolxx | creation_date: March 18, 2019, 10:32 a.m. | author: Mukti C | type: Comment |
parent: bzlax | lastedit_date: March 18, 2019, 10:32 a.m. | lastedit_user: Mukti C |
content:
Hi Dr. Swat, I'm still stuck on this issue. Any help will be much appreciated. Thanks!
Answer:
id: xkgza | creation_date: March 19, 2019, 12:21 a.m. | author: Maciek Swat | type: Answer |
parent: gbomx | lastedit_date: March 19, 2019, 12:21 a.m. | lastedit_user: Maciek Swat |
content:
Can you share the content of the runScript.sh? If you try running
./runScript -i Demos/Models/cellsort/cellsort_2D/cellsort_2d.cc3d
do you get any output?screenshotDirectoryName= /data/home/mchowkw1/Results/Test1_0202
that you saw earlier means that the simulation output folder which is same as screennshotDirectoryName
So you run the script and then does anything happen at all or CompuCell3D crashes?
Can you try compiling CC3D on your system? I wonder if the issue has to do with the fact that you are on Centos 7.1 and you are trying to run binaries for RHEL 7.5 . What I could do is to try building binaries on Centos 7.1 and give it to you but a better solution would be to create docker container. Any of those solutions would require effort and we definitely have plans to release docker images of CC3D . But I wonder if you could try compiling it yourself or perhaps sys admin can help you with it. We have several tutorial on how to compile CC3D on clusters. What do you think?
Comment:
id: gblne | creation_date: March 19, 2019, 10:04 a.m. | author: Mukti C | type: Comment |
parent: xkgza | lastedit_date: March 19, 2019, 10:04 a.m. | lastedit_user: Mukti C |
content:
Hi Dr. Swat,
Thank you for your response! When I run the first command, I still get:
[mchowkw1 3.7.8]$ ./runScript.sh -i Demos/Models/cellsort/cellsort_2D/cellsort_2D.cc3d
./runScript.sh: line 6: warning: setlocale: LC_NUMERIC: cannot change locale (C.UTF-8): No such file or directory
./runScript.sh: line 6: warning: setlocale: LC_NUMERIC: cannot change locale (C.UTF-8)
CompuCell3D - version 3.7.6
CompuCell3D Version: 3.7.8 Revision: 20180908
Platform: linux2
Did not find dl module, will try manual dl initialization...
steppablePath=/data/home/mchowkw1/3.7.8/lib/CompuCell3DSteppables
pluginPath=/data/home/mchowkw1/3.7.8/lib/CompuCell3DPlugins
THIS IS JUST BEFORE LOADING LIBRARIES
AFTER LOAD LIBRARIES
The runscript.sh file is the same that I got with the download. It is as follows:
#!/bin/sh
current_directory=$(pwd)
# necessary to enforce standard convention for numeric values specification on non-English OS
export LC_NUMERIC="C.UTF-8"
# export PREFIX_CC3D=/home/m/install_projects/3.7.6
export PREFIX_CC3D="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export PYTHON_EXEC=${PREFIX_CC3D}/Python27/bin/python
export MAX_NUMBER_OF_CONSECUTIVE_RUNS=50
cd $PREFIX_CC3D
#export LD_LIBRARY_PATH=:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=${PREFIX_CC3D}/lib/:$LD_LIBRARY_PATH
export COMPUCELL3D_PLUGIN_PATH=${PREFIX_CC3D}/lib/CompuCell3DPlugins
export COMPUCELL3D_STEPPABLE_PATH=${PREFIX_CC3D}/lib/CompuCell3DSteppables
export LD_LIBRARY_PATH=${PREFIX_CC3D}/lib/python:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=${COMPUCELL3D_PLUGIN_PATH}:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=${COMPUCELL3D_STEPPABLE_PATH}:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=:$LD_LIBRARY_PATH
export SWIG_LIB_INSTALL_DIR=${PREFIX_CC3D}/lib/python
export PYTHON_MODULE_PATH=${PREFIX_CC3D}/pythonSetupScripts
export PYTHONPATH=${PREFIX_CC3D}/pythonSetupScripts
export COMPUCELL3D_MAJOR_VERSION=3
export COMPUCELL3D_MINOR_VERSION=7
export COMPUCELL3D_BUILD_VERSION=6
export SOSLIB_PATH=${PREFIX_CC3D}/examplesSoslib
echo "CompuCell3D - version $COMPUCELL3D_MAJOR_VERSION.$COMPUCELL3D_MINOR_VERSION.$COMPUCELL3D_BUILD_VERSION"
export exit_code=0
${PYTHON_EXEC} ${PREFIX_CC3D}/player5/CompuCellPythonSimulationCML.py $* --currentDir=${current_directory}
exit_code=$?
cd ${current_directory}
exit ${exit_code}
I'll try to create a docker container. But could you possibly try building binaries on Centos 7.1 too? Also, I found several tutorials that could be used for installing CC3D on Linux, but nothing specifically for a cluster. Could you please point me in the right direction? Thanks!
Answer:
id: jexgm | creation_date: March 20, 2019, 12:35 p.m. | author: Maciek Swat | type: Answer |
parent: gbomx | lastedit_date: March 20, 2019, 12:35 p.m. | lastedit_user: Maciek Swat |
content:
The problem with CC3D binaries on any cluster is that those systems are often not your standard linux distribution. They are often (not always) customized and standard tools might struggle linking CC3D to correct libraries. But if this is standard CentOS 7.1 then I would suggest
http://www.compucell3d.org/SrcBin/CompilingOnLinux2017
or (if the above does not work)
http://www.compucell3d.org/SrcBin/LinuxCompileRedHat6
The first link has already specific pointers for RedHat, CentOS and I verified it. If you try it (you may install CentOS in a Virtual Machine) it should work. If you run into problems let me know and I will help out
Q121: How to create a plane boundary condition
id: vewpq | creation_date: Feb. 2, 2019, 1:17 p.m. | author: Jairaj Mathur | type: Question |
parent: | lastedit_date: Feb. 11, 2019, 4:12 p.m. | lastedit_user: James Sluka |
content:
Hi all
I wanted to create a plane, which the cells can not cross. How do I approach doing that? Basically, the energy cost should be so high to copy pixels there, that it never happens.
Thanks a lot!
Answer:
id: ejzwk | creation_date: Feb. 11, 2019, 2:04 p.m. | author: James Sluka | type: Answer |
parent: vewpq | lastedit_date: Feb. 11, 2019, 2:04 p.m. | lastedit_user: James Sluka |
content:
One way to do this would be to create a long skinny cell at that plane location. If you freeze this cell and make the lambda volume very large then it should not be possible for a pixel from another cell to occupy that space, therefore the other cells cannot cross the barrier.
If you are using neighbor orders >1 then the frozen cell might need to be more than one pixel wide.
A second way to do it would be to track the position of each cell. If any pixel crosses the (imaginary) barrier you apply a an external force to move it back. Once all pixels are back in the allowed region you turn off the force.
Comment:
id: nojpr | creation_date: Feb. 11, 2019, 2:46 p.m. | author: Jairaj Mathur | type: Comment |
parent: ejzwk | lastedit_date: Feb. 11, 2019, 2:46 p.m. | lastedit_user: Jairaj Mathur |
content:
I feel the second way would be easier. Is there any tutorial/example on applying forces in that way that I could refer to?
Thanks a lot for your reply!
Answer:
id: zgomv | creation_date: Feb. 11, 2019, 4:12 p.m. | author: James Sluka | type: Answer |
parent: vewpq | lastedit_date: Feb. 11, 2019, 4:12 p.m. | lastedit_user: James Sluka |
content:
File attached: no_cross_barrier.zip (8.92 KB)
I've attached a demo CC3D project. It uses forces to keep all the cells above the y=40 line. The simulation starts with cells spread all over, then forces them all to the top part of the window. Cells that are in the top of the window have no force, only those in the lower part. (Notice that cells tend to stick to the bottom wall and take a while to get released.)
Once you get the syntax right adding/removing forces is pretty straightforward.
attachments(redirected):
.\CC3D_allanswered_linked_files\no_cross_barrier.zip
Q122: Screenshot with Multiple Outputs
id: bzjbg | creation_date: Feb. 7, 2019, 10:44 a.m. | author: Meredith Proctor | type: Question |
parent: | lastedit_date: Feb. 11, 2019, 1:58 p.m. | lastedit_user: James Sluka |
content:
Hi,
I was curious to how I would go about taking a screenshot with multiple variables/outputs. I am using CompuCell3D version 3.7.5. So far, even if I have multiple graphics shown, it will only take a screenshot of one graphic. Any help would be much appreciated. Thank you!
Answer:
id: wkwgn | creation_date: Feb. 11, 2019, 1:58 p.m. | author: James Sluka | type: Answer |
parent: bzjbg | lastedit_date: Feb. 11, 2019, 1:58 p.m. | lastedit_user: James Sluka |
content:
You should be able to open and save multiple windows in CC3D. To get all of the individual windows to save you need to click the little camera icon in each window you want save. Also, in <tools><configuration> make sure the "save image every nth MCS" is checked. If everything is setup correctly you'll get a separate folder of images in the output directory for each of your windows.
Q123: how to access .xml file parameter values of in _steppables.py file?
id: rvqbm | creation_date: Feb. 8, 2019, 12:34 a.m. | author: DrjyPrk | type: Question |
parent: | lastedit_date: Feb. 11, 2019, 1:50 p.m. | lastedit_user: James Sluka |
content:
for example, in _steppables.py file, if I want to access a contact energy value from the .xml file and want to use it within a function as a variable for some stoppable, is there a way?
Answer:
id: mojez | creation_date: Feb. 11, 2019, 1:49 p.m. | author: James Sluka | type: Answer |
parent: rvqbm | lastedit_date: Feb. 11, 2019, 1:50 p.m. | lastedit_user: James Sluka |
content:
Here is how to get the value for an adhesion pair (and change it if you want) from python in an xml+python simulation. You'll need to include the line;
from XMLUtils import dictionaryToMapStrStr as d2mss
at the top of your python steppables file.
# need "from XMLUtils import dictionaryToMapStrStr as d2mss" in this file's import list
# get the contact energy between cells of type "acell" and "bcell"
contactXMLData=self.simulator.getCC3DModuleData("Plugin","Contact")
energyTypeATypeB=contactXMLData.getFirstElement("Energy", \
d2mss({"Type1":"acell","Type2":"bcell"}))
thevalue=float(energyTypeATypeB.getText())
print "\n thevalue=",thevalue
# change the value
newJ = thevalue - 3.
energyTypeATypeB.updateElementValue(str(newJ))
# update the atual model
self.simulator.updateCC3DModule(contactXMLData)
# double check that things actually got updated!
# get the contact energy between cells of type "acell" and "bcell"
contactXMLData=self.simulator.getCC3DModuleData("Plugin","Contact")
energyTypeATypeB=contactXMLData.getFirstElement("Energy", \
d2mss({"Type1":"acell","Type2":"bcell"}))
thevalue=float(energyTypeATypeB.getText())
print " NEW thevalue=",thevalue,"\n"
Another option would be to convert your xml+python simulation into all python. That way you have much more direct access to all of the plugin parameters. Twedit++ can convert a xml+python model into all python. Load the xml+python into Twedit++, right click the xml file in the file list and select "convert XML to python".
Q124: AllAnswered Compucell3D Forum Ending
id: kvjpm | creation_date: Feb. 11, 2019, 2:38 p.m. | author: James Sluka | type: News |
parent: | lastedit_date: Feb. 11, 2019, 2:38 p.m. | lastedit_user: James Sluka |
content:
Unfortunately, AllAnswered has decided to discontinue this free forum hosting service. The CompuCell3D group is currently seeking a replacement forum that we can use.
If anyone has suggestions on other possible forums please let us know.
Our currently plan is to continue here on AllAnswered until the end of February 2019. We will then migrate to another platform. We hope to be able to migrate all of the old posts on this forum to the new platform.
We are sorry for the inconvenience and hope to have the new forum up with minimal disruptions.
Q125: Change range of min-max values on the color bar in player window output
id: qbkqj | creation_date: Feb. 21, 2019, 2:35 p.m. | author: Jairaj Mathur | type: Question |
parent: | lastedit_date: March 1, 2019, 6:58 p.m. | lastedit_user: Jairaj Mathur |
content:
Hi All
I am running the amoeba_2D example, and when I switch to the "FGF" view in the player, I just see the color bar showing 0 to 1 for blue to red, even thought the values for the field
range from 0 to 3000. How can I change these values and colors?
Thanks a lot!
Answer:
id: azoxv | creation_date: Feb. 26, 2019, 5:29 p.m. | author: James Sluka | type: Answer |
parent: qbkqj | lastedit_date: Feb. 26, 2019, 5:29 p.m. | lastedit_user: James Sluka |
content:
In Player go to <Tools><Settings>, then the <Field> tab. In the "Field Name" drop down select the field of interest then uses the boxes below that to set min and max values. If neither of the "Fixed" boxes is checked then the color bar will auto scale throughout the simulation. Sounds like you might want to set the Min to be fixed at zero and the Max fixed at 3000.
These settings should be remembered the next time you start the same simulation in Player.
Answer:
id: wkvng | creation_date: March 1, 2019, 6:58 p.m. | author: Jairaj Mathur | type: Answer |
parent: qbkqj | lastedit_date: March 1, 2019, 6:58 p.m. | lastedit_user: Jairaj Mathur |
content:
Thank you so much. It worked!
Q126: How to modify chemical fields
id: jejmn | creation_date: Feb. 26, 2019, 12:35 p.m. | author: Jairaj Mathur | type: Question |
parent: | lastedit_date: March 1, 2019, 7 p.m. | lastedit_user: Jairaj Mathur |
content:
Hi all
How can I change the chemical field concentration at any pixel individually? In general, how do I access chemical fields at any given point?
Answer:
id: nokbx | creation_date: Feb. 26, 2019, 6:25 p.m. | author: James Sluka | type: Answer |
parent: jejmn | lastedit_date: Feb. 26, 2019, 6:25 p.m. | lastedit_user: James Sluka |
content:
There are helpers in Twedit++ to help you peek and poke into fields;
<CC3D Python> <Chemical Field Manipulation>
Get Field Reference
Get Field Value
Set Field Value
See if that does what you want.
Comment:
id: ejpol | creation_date: March 1, 2019, 7 p.m. | author: Jairaj Mathur | type: Comment |
parent: nokbx | lastedit_date: March 1, 2019, 7 p.m. | lastedit_user: Jairaj Mathur |
content:
Thank you for the response, I will check it out.
Q127: Python scripting manual: Automatic Tracking of Cells’ Attributes
id: lnvea | creation_date: March 1, 2019, 7:26 p.m. | author: Jairaj Mathur | type: Question |
parent: | lastedit_date: March 6, 2019, 4:21 p.m. | lastedit_user: Jairaj Mathur |
content:
Hi All
In the python scripting guide, if I want to evaluate sin(y_com/x_com), why can I not do that by writing the following in the "step" section-
from math import *
cell.dict['ratio'] = sin (cell.xCOM / cell.yCOM)
Just like the ExtraField example?
Thanks!
Answer:
id: bzlrq | creation_date: March 4, 2019, 12:11 p.m. | author: James Sluka | type: Answer |
parent: lnvea | lastedit_date: March 4, 2019, 12:11 p.m. | lastedit_user: James Sluka |
content:
What happen when you use your code? Remember that cell.xCOM and cell.yCOM are integers so you have an integer divide there.
Comment:
id: xkvpr | creation_date: March 4, 2019, 5:02 p.m. | author: Jairaj Mathur | type: Comment |
parent: bzlrq | lastedit_date: March 4, 2019, 5:02 p.m. | lastedit_user: Jairaj Mathur |
content:
I havent tried it, so dont know what will happen. But you are right, the integer divide could pose a problem. Is there no way to do a floating divide with them?
Comment:
id: rvkga | creation_date: March 5, 2019, 10:28 a.m. | author: James Sluka | type: Comment |
parent: xkvpr | lastedit_date: March 5, 2019, 10:28 a.m. | lastedit_user: James Sluka |
content:
You would just need to float one of the two numbers;
cell.dict['ratio'] = sin (float(cell.xCOM) / cell.yCOM)
The dictionary should be able to hold any type of data so putting a floating point number into it shouldn't be a problem.
Comment:
id: gbvaj | creation_date: March 6, 2019, 4:21 p.m. | author: Jairaj Mathur | type: Comment |
parent: rvkga | lastedit_date: March 6, 2019, 4:21 p.m. | lastedit_user: Jairaj Mathur |
content:
Nice one! Thanks!
Q128: How to add just the uptake python steppable
id: ejwjp | creation_date: March 21, 2019, 1:19 p.m. | author: Jairaj Mathur | type: Question |
parent: | lastedit_date: March 21, 2019, 1:38 p.m. | lastedit_user: Jairaj Mathur |
content:
Hi All
I am having some basic difficulties. I want cells to only do uptake, using the python functions like
attrSecretor.secreteInsideCell(cell,300)
attrSecretor.secreteInsideCellAtBoundary(cell,300)
attrSecretor.secreteOutsideCellAtBoundary(cell,500)
attrSecretor.secreteInsideCellAtCOM(cell,300)
To be a bit more specific, I want to use the function:
secreteOutsideCellAtBoundaryOnContactwith
What I dont understand is, do I have to add the secretion pluggin in the XML as well? I am currently using both xml and python. If I do have to, what parameter do I give inside the pluggin? Appreciate all the help so far!
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.