### Week 3- Journal/Code/- PKD Paper, PKD.py lines 70-end

54
views
0
3 months ago by
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

configureSimulation(sim,Lx,Ly,Lz,Temp,Time,NOrder,CNOrder,CINOrder,debugFreq)​