本文整理汇总了Python中CompuCell.getPyAttrib方法的典型用法代码示例。如果您正苦于以下问题:Python CompuCell.getPyAttrib方法的具体用法?Python CompuCell.getPyAttrib怎么用?Python CompuCell.getPyAttrib使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CompuCell
的用法示例。
在下文中一共展示了CompuCell.getPyAttrib方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: step
# 需要导入模块: import CompuCell [as 别名]
# 或者: from CompuCell import getPyAttrib [as 别名]
def step(self,mcs):
## count down through initial phase offset for each GZ cell
cells_to_grow=[] # list of cells to evaluate for growth
if mcs <= self.T_double:
for cell in self.cellList:
if cell.type==3: # GZ cells
cellDict=CompuCell.getPyAttrib(cell)
if cellDict["phaseCountdown"]==0: # if cell has reached or surpassed its initial phase offset
cells_to_grow.append(cell) # add cell to list of cells to evaluate for growth
else:
cellDict["phaseCountdown"]-=1 # count down phase offset
else:
for cell in self.cellList:
if cell.type==3: # GZ cells
cells_to_grow.append(cell)
## Grow each cell that meets criteria for growth by increasing target volume and surface parameters:
count=0
if self.pixPerMCS:
for cell in cells_to_grow:
cell.targetVolume+=self.pixPerMCS
cell.targetSurface=int(4*sqrt(cell.volume)+0.5)
count+=1
else:
count_timer=0
for cell in cells_to_grow:
cellDict=CompuCell.getPyAttrib(cell)
if cellDict["growth_timer"] < self.mcsPerPix: # if cell has not reached time to grow
cellDict["growth_timer"] += 1 # add to growth timer
count_timer+=1
else: # if cell has reached time to grow, increase target volume and surface
cell.targetVolume+=1
cell.targetSurface=int(4*sqrt(cell.volume)+0.5)
cellDict["growth_timer"] = 0
count+=1
示例2: updateAttributes
# 需要导入模块: import CompuCell [as 别名]
# 或者: from CompuCell import getPyAttrib [as 别名]
def updateAttributes(self):
'''
UpdateAttributes is inherited from MitosisSteppableBase
and is called automatically by the divideCell() function.
It sets the attributes of the parent and daughter cells
'''
parent_cell = self.mitosisSteppable.parentCell
child_cell = self.mitosisSteppable.childCell
child_cell.targetVolume = child_cell.volume
child_cell.lambdaVolume = parent_cell.lambdaVolume
child_cell.targetSurface = child_cell.surface
child_cell.lambdaSurface = parent_cell.lambdaSurface
parent_cell.targetVolume = parent_cell.volume
parent_cell.targetSurface = parent_cell.surface
child_cell.type = parent_cell.type
parent_dict = CompuCell.getPyAttrib(parent_cell)
child_dict = CompuCell.getPyAttrib(child_cell)
parent_dict.get('mitosis_times',[]).append(self.mcs - parent_dict.get('last_division_mcs',self.mcs))
parent_dict['last_division_mcs'] = self.mcs
# Make a copy of the parent cell's dictionary and attach to child cell
for key, item in parent_dict.iteritems():
child_dict[key] = deepcopy(item)
child_dict['mitosis_times'] = []
示例3: updateAttributes
# 需要导入模块: import CompuCell [as 别名]
# 或者: from CompuCell import getPyAttrib [as 别名]
def updateAttributes(self):
# self.mitosisSteppable holds important dat from the mitosis
parentCell = self.mitosisSteppable.parentCell
childCell = self.mitosisSteppable.childCell
parentCell.targetVolume/=2.0
#child inherits parent properties
childCell.targetVolume = parentCell.targetVolume
childCell.lambdaVolume = parentCell.lambdaVolume
# randomly select one of the cells to be a different type
if random()<0.5:
childCell.type = parentCell.type
else:
childCell.type = self.DIFFERENTIATEDCONDENSING
# get parent cell lists
parentDict = CompuCell.getPyAttrib(parentCell)
childDict = CompuCell.getPyAttrib(childCell)
mcs=self.simulator.getStep()
data = MitosisData(mcs, parentCell.id, parentCell.type, childCell.id, childCell.type)
childDict['relatives'] = [data]
parentDict['relatives'].append(data)
示例4: step
# 需要导入模块: import CompuCell [as 别名]
# 或者: from CompuCell import getPyAttrib [as 别名]
def step(self,mcs):
## find y-position of poster-most GZ cell and center of growth zone
y_post=0
x_min=999
x_max=0
for cell in self.cellList:
if cell.type==3: # GZ cell
yCM=cell.yCM/float(cell.volume)
xCM=cell.xCM/float(cell.volume)
if yCM>y_post:
y_post=yCM
if xCM>x_max:
x_max=xCM
elif xCM<x_min:
x_min=xCM
x_center=x_min + (x_max-x_min)/2.
## count down through initial phase offset for each GZ cell and evaluate for y-position
cells_to_grow=[] # list of cells to evaluate for growth
if mcs <= self.T_double:
for cell in self.cellList:
if cell.type==3: # GZ cells
cellDict=CompuCell.getPyAttrib(cell)
if cellDict["phaseCountdown"]==0: # if cell has reached or surpassed its initial phase offset
yCM = cell.yCM/float(cell.volume)
xCM = cell.xCM/float(cell.volume)
d = sqrt((xCM - x_center)**2 + (yCM - y_post)**2)
if d < self.d_sig:
cells_to_grow.append(cell) # add cell to list of cells to evaluate for growth
else:
cellDict["phaseCountdown"]-=1 # count down phase offset
else:
for cell in self.cellList:
if cell.type==3: # GZ cells
yCM=cell.yCM/float(cell.volume)
xCM=cell.xCM/float(cell.volume)
d = sqrt((xCM - x_center)**2 + (yCM - y_post)**2)
if d < self.d_sig:
cells_to_grow.append(cell)
## Grow each cell that meets criteria for growth by increasing target volume and surface parameters:
count=0
if self.pixPerMCS:
for cell in cells_to_grow:
cell.targetVolume+=self.pixPerMCS
cell.targetSurface=int(4*sqrt(cell.volume)+0.5)
count+=1
else:
count_timer=0
for cell in cells_to_grow:
cellDict=CompuCell.getPyAttrib(cell)
if cellDict["growth_timer"] < self.mcsPerPix: # if cell has not reached time to grow
cellDict["growth_timer"] += 1 # add to growth timer
count_timer+=1
else: # if cell has reached time to grow, increase target volume and surface
cell.targetVolume+=1
cell.targetSurface=int(4*sqrt(cell.volume)+0.5)
cellDict["growth_timer"] = 0
count+=1
示例5: updateAttributes
# 需要导入模块: import CompuCell [as 别名]
# 或者: from CompuCell import getPyAttrib [as 别名]
def updateAttributes(self):
childCell = self.mitosisSteppable.childCell
parentCell = self.mitosisSteppable.parentCell
childCell.type = parentCell.type
parentCell.targetVolume = tVol
childCell.targetVolume = tVol
childCell.lambdaVolume = parentCell.lambdaVolume;
# inherite properties from parent cells
self.copySBMLs(_fromCell=parentCell,_toCell=childCell)
childCellDict=CompuCell.getPyAttrib(childCell)
parentCellDict=CompuCell.getPyAttrib(parentCell)
childCellDict["D"]=random.uniform(0.9,1.0)*parentCellDict["D"]
childCellDict["N"]=random.uniform(0.9,1.0)*parentCellDict["N"]
childCellDict["B"]=random.uniform(0.9,1.0)*parentCellDict["B"]
childCellDict["R"]=random.uniform(0.9,1.0)*parentCellDict["R"]
示例6: mitosis_visualization_countdown
# 需要导入模块: import CompuCell [as 别名]
# 或者: from CompuCell import getPyAttrib [as 别名]
def mitosis_visualization_countdown(self):
for cell in self.cellListByType(4): # Mitosis cell
cellDict = CompuCell.getPyAttrib(cell)
if cellDict['mitosisVisualizationTimer'] <= 0:
cell.type = cellDict['returnToCellType']
else:
cellDict['mitosisVisualizationTimer'] -= 1
示例7: start
# 需要导入模块: import CompuCell [as 别名]
# 或者: from CompuCell import getPyAttrib [as 别名]
def start(self):
for cell in self.cellList:
vasculo_attributes=CompuCell.getPyAttrib(cell)
if cell.type==1:
vasculo_attributes['cell.receptor.VEGFR1']=100
vasculo_attributes['cell.receptor.VEGFR2']=1000
示例8: step
# 需要导入模块: import CompuCell [as 别名]
# 或者: from CompuCell import getPyAttrib [as 别名]
def step(self,mcs):
for cell in self.cellList:
mitDataList=CompuCell.getPyAttrib(cell)
if len(mitDataList) > 0:
print "MITOSIS DATA FOR CELL ID",cell.id
for mitData in mitDataList:
print mitData
示例9: start
# 需要导入模块: import CompuCell [as 别名]
# 或者: from CompuCell import getPyAttrib [as 别名]
def start(self):
#Loading model
Name = 'DeltaNotch'
Key = 'DN'
simulationDir=os.path.dirname (os.path.abspath( __file__ ))
Path= os.path.join(simulationDir,'DN_Collier.sbml')
Path=os.path.abspath(Path) # normalizing path
IntegrationStep = 0.2
bionetAPI.loadSBMLModel(Name, Path, Key, IntegrationStep)
bionetAPI.addSBMLModelToTemplateLibrary(Name,'TypeA')
bionetAPI.initializeBionetworks()
#Initial conditions
import random
state={} #dictionary to store state veriables of the SBML model
for cell in self.cellList:
if (cell):
state['D'] = random.uniform(0.9,1.0)
state['N'] = random.uniform(0.9,1.0)
bionetAPI.setBionetworkState(cell.id,'DeltaNotch',state)
cellDict=CompuCell.getPyAttrib(cell)
cellDict['D']=state['D']
cellDict['N']=state['N']
示例10: finish
# 需要导入模块: import CompuCell [as 别名]
# 或者: from CompuCell import getPyAttrib [as 别名]
def finish(self):
for cell in self.cellList:
dataList = CompuCell.getPyAttrib(cell)
if len(dataList['relatives'])>0:
print "MITOTIC DATA FOR CELL ID:",cell.id
for data in dataList['relatives']:
print data
示例11: step
# 需要导入模块: import CompuCell [as 别名]
# 或者: from CompuCell import getPyAttrib [as 别名]
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 )
示例12: step
# 需要导入模块: import CompuCell [as 别名]
# 或者: from CompuCell import getPyAttrib [as 别名]
def step(self,mcs):
self.scalarFieldG.clear()
for cell in self.cellList:
if cell:
cellDict=CompuCell.getPyAttrib(cell)
self.scalarFieldG[cell] = cellDict['GTPase']
示例13: find_GB_division_count
# 需要导入模块: import CompuCell [as 别名]
# 或者: from CompuCell import getPyAttrib [as 别名]
def find_GB_division_count(self):
division_count = 0
for cell in self.cellList:
if cell:
cellDict = CompuCell.getPyAttrib(cell)
division_count += cellDict['divided']
cellDict['divided'] = 0
return division_count
示例14: setStepSizeForCell
# 需要导入模块: import CompuCell [as 别名]
# 或者: from CompuCell import getPyAttrib [as 别名]
def setStepSizeForCell(self, _modelName='',_cell=None,_stepSize=1.0):
import CompuCell
dict_attrib = CompuCell.getPyAttrib(_cell)
try:
sbmlSolver=dict_attrib['SBMLSolver'][_modelName]
except LookupError,e:
return
示例15: deleteSBMLFromCell
# 需要导入模块: import CompuCell [as 别名]
# 或者: from CompuCell import getPyAttrib [as 别名]
def deleteSBMLFromCell(self,_modelName='',_cell=None):
import CompuCell
dict_attrib=CompuCell.getPyAttrib(_cell)
try:
sbmlDict=dict_attrib['SBMLSolver']
del sbmlDict[_modelName]
except LookupError,e:
pass