modify clusterId


76
views
0
10 weeks ago by
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:  

1 Answer


0
10 weeks ago by
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;
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:

Then change the
if mcs==100:
to
if mcs==100 and clusterId==5:

Please login to add an answer/comment or follow this question.

Similar posts:
Search »