def step(self, mcs):
     
     # ######### Update all bionetwork integrator(s) ###########
     bionetAPI.timestepBionetworks()
     
     bionetAPI.printBionetworkState(1)
     
     # ######## Implement cell growth by increasing target volume ##########
     for cell in self.cellList:
         dictionaryAttrib = CompuCell.getPyAttrib( cell )
         cell.targetVolume = cell.volume + 0.1*dictionaryAttrib["InitialVolume"]
     
     
     # ###### Retrieve delta values and set cell bionetwork template libraries according to delta concentration ########
     for cell in self.cellList:
         currentDelta = bionetAPI.getBionetworkValue( "DN_di", cell.id )
         if( currentDelta > 0.5 ):
             if self.cellTypeMap[cell.type] == "LowDelta":
                 bionetAPI.setBionetworkValue( "TemplateLibrary", "HighDelta", cell.id )
         else:
             if self.cellTypeMap[cell.type] == "HighDelta":
                 bionetAPI.setBionetworkValue( "TemplateLibrary", "LowDelta", cell.id )
     
     
     # ####### Set all cell dbari values as a function of neighbor delta values #########
     for cell in self.cellList:
         weightedSumOfNeighborDeltaValues = 0.0
         neighborContactAreas = bionetAPI.getNeighborContactAreas( cell.id )
         neighborDeltaValues = bionetAPI.getNeighborProperty( "DN_di", cell.id )
         
         for neighborID in neighborContactAreas.keys():
             weightedSumOfNeighborDeltaValues += (neighborContactAreas[neighborID] * neighborDeltaValues[neighborID])
         
         bionetAPI.setBionetworkValue( "DN_dbari", weightedSumOfNeighborDeltaValues/cell.surface, cell.id )
Beispiel #2
0
    def step(self, mcs):

        # ######### Update bionetwork integrator(s) for all cells ###########
        bionetAPI.timestepBionetworks()

        # ######## Implement cell growth by increasing target volume ##########
        for cell in self.cellList:
            if cell.id > self.initialNumberOfCells:
                ## All new cells are assigned a target volume of 0 to force cell death
                cell.targetVolume = 0.
                cell.lambdaVolume = 2.
                cell.targetSurface = 0.
                cell.lambdaSurface = 2.
            else:
                dictionaryAttrib = CompuCell.getPyAttrib(cell)
                cell.targetVolume = cell.volume + 0.15 * dictionaryAttrib[
                    "InitialVolume"]

        # ###### Retrieve delta values and set cell type according to delta concentration ########
        for cell in self.cellList:
            currentDeltaValue = bionetAPI.getBionetworkValue("DN_di", cell.id)
            if (currentDeltaValue > 0.5):
                if (self.cellTypeMap[cell.type] == "LowDelta"):
                    print "ID of cell to undergo type change %s" % cell.id
                    print "Type of cell to undergo type change %s" % bionetAPI.getBionetworkValue(
                        "TemplateLibrary", cell.id)
                    bionetAPI.setBionetworkValue("TemplateLibrary",
                                                 "HighDelta", cell.id)
            else:
                if (self.cellTypeMap[cell.type] == "HighDelta"):
                    bionetAPI.setBionetworkValue("TemplateLibrary", "LowDelta",
                                                 cell.id)

        # ####### Set all cell dbari values as a function of neighbor delta values #########
        for cell in self.cellList:
            weightedSumOfNeighborDeltaValues = 0.0
            neighborContactAreas = bionetAPI.getNeighborContactAreas(cell.id)
            neighborDeltaValues = bionetAPI.getNeighborProperty(
                "DN_di", cell.id)

            for neighborID in neighborContactAreas.keys():
                weightedSumOfNeighborDeltaValues += (
                    neighborContactAreas[neighborID] *
                    neighborDeltaValues[neighborID])

            bionetAPI.setBionetworkValue(
                "DN_dbari", weightedSumOfNeighborDeltaValues / cell.surface,
                cell.id)
Beispiel #3
0
    def step(self, mcs):

        # ######### Update all bionetwork integrator(s) ###########
        bionetAPI.timestepBionetworks()

        bionetAPI.printBionetworkState(1)

        # ######## Implement cell growth by increasing target volume ##########
        for cell in self.cellList:
            dictionaryAttrib = CompuCell.getPyAttrib(cell)
            cell.targetVolume = cell.volume + 0.1 * dictionaryAttrib[
                "InitialVolume"]

        # ###### Retrieve delta values and set cell bionetwork template libraries according to delta concentration ########
        for cell in self.cellList:
            currentDelta = bionetAPI.getBionetworkValue("DN_di", cell.id)
            if (currentDelta > 0.5):
                if self.cellTypeMap[cell.type] == "LowDelta":
                    bionetAPI.setBionetworkValue("TemplateLibrary",
                                                 "HighDelta", cell.id)
            else:
                if self.cellTypeMap[cell.type] == "HighDelta":
                    bionetAPI.setBionetworkValue("TemplateLibrary", "LowDelta",
                                                 cell.id)

        # ####### Set all cell dbari values as a function of neighbor delta values #########
        for cell in self.cellList:
            weightedSumOfNeighborDeltaValues = 0.0
            neighborContactAreas = bionetAPI.getNeighborContactAreas(cell.id)
            neighborDeltaValues = bionetAPI.getNeighborProperty(
                "DN_di", cell.id)

            for neighborID in neighborContactAreas.keys():
                weightedSumOfNeighborDeltaValues += (
                    neighborContactAreas[neighborID] *
                    neighborDeltaValues[neighborID])

            bionetAPI.setBionetworkValue(
                "DN_dbari", weightedSumOfNeighborDeltaValues / cell.surface,
                cell.id)
 def step(self, mcs):
     
     # ######### Update bionetwork integrator(s) for all cells ###########
     bionetAPI.timestepBionetworks()
     
     # ######## Implement cell growth by increasing target volume ##########
     for cell in self.cellList:
         if cell.id > self.initialNumberOfCells:
             ## All new cells are assigned a target volume of 0 to force cell death
             cell.targetVolume = 0.
             cell.lambdaVolume = 2.
             cell.targetSurface = 0.
             cell.lambdaSurface = 2.
         else:
             dictionaryAttrib = CompuCell.getPyAttrib( cell )
             cell.targetVolume = cell.volume + 0.15*dictionaryAttrib["InitialVolume"]
             
     # ###### Retrieve delta values and set cell type according to delta concentration ########
     for cell in self.cellList:
         currentDeltaValue = bionetAPI.getBionetworkValue( "DN_di", cell.id )
         if( currentDeltaValue > 0.5 ):
             if( self.cellTypeMap[cell.type] == "LowDelta" ):
                 print "ID of cell to undergo type change %s" % cell.id
                 print "Type of cell to undergo type change %s" % bionetAPI.getBionetworkValue( "TemplateLibrary", cell.id )
                 bionetAPI.setBionetworkValue( "TemplateLibrary", "HighDelta", cell.id )
         else:
             if( self.cellTypeMap[cell.type] == "HighDelta" ):
                 bionetAPI.setBionetworkValue( "TemplateLibrary", "LowDelta", cell.id )
     
     # ####### Set all cell dbari values as a function of neighbor delta values #########
     for cell in self.cellList:
         weightedSumOfNeighborDeltaValues = 0.0
         neighborContactAreas = bionetAPI.getNeighborContactAreas( cell.id )
         neighborDeltaValues = bionetAPI.getNeighborProperty( "DN_di", cell.id )
         
         for neighborID in neighborContactAreas.keys():
             weightedSumOfNeighborDeltaValues += (neighborContactAreas[neighborID] * neighborDeltaValues[neighborID])
             
         bionetAPI.setBionetworkValue( "DN_dbari", weightedSumOfNeighborDeltaValues/cell.surface, cell.id )