def calcForce(positions, numberOfCells, numberOfdead, Origin, oriConc, cellConc, Diff, t, kd, highBC, DisplacementScaleByConc, searchingRange, marker, auto_factor, state, ConcByCell, odes, step_size, shape_factor): ''' [Parameter Description] positions: position of cells from pdb file numberOfCells: total number of cells (num of cells in 1st half + num of cells in 2nd half) Origin: the origin of chemoattractant source oriConc: the max concentration released from the source of chemoattractant cellConc: the max concentration released by cells (determining the degree of intercellular communication) Diff: the diffusion rate of chemoattractant t: time kd: constant associated with Hills coefficient for autocrinic release highBC: [max X, max Y, max Z] DisplacementScaleByConc: Displacement Scale searchingRange: searching range around the cell marker: a list of marker for resting and activated cells auto_factor: a list of autocrinic factors based on the state of cells state: the characteristics of diffusion of chemoattractant: steady, error, or linear ConcByCell: the concentration accumulated by the attractant released from each individual cell shape_factor: = 1 for square > 1 for slab ''' # Do some magic here that will return substrate field-related force acting on each particle n = 0 m = 0 dummy_coord = np.zeros([numberOfCells, 2]) # since it's 2D for i in enumerate(positions): if n > numberOfdead: dummy_coord[m][0] = i[1][0].value_in_unit(nanometers) dummy_coord[m][1] = i[1][1].value_in_unit(nanometers) #dummy_coord[m][2] = i[1][2].value_in_unit(nanometers)*0 m += 1 n += 1 recordedPositions = dummy_coord # Done DistCelltoOrigin = conc.DistCelltoOrigin(recordedPositions, Origin, shape_factor, state) # Done DistCelltoCell = conc.DistCelltoCell(recordedPositions) # Done ConcByOrigin = conc.ConcByOrigin(DistCelltoOrigin, t, Diff, oriConc, state, Origin) # Done ConcbyCell, HC = conc.ConcByCell(ConcByOrigin, ConcByCell, DistCelltoCell, t, Diff, kd, auto_factor, cellConc) fvX, fvY, fvZ, odesnew = conc.forceGen(ConcbyCell, Origin, shape_factor, recordedPositions, t, Diff, HC, searchingRange, highBC, DisplacementScaleByConc, cellConc, oriConc, state, odes, step_size) return fvX, fvY, fvZ, ConcbyCell, odesnew
def calcForce(positions, numberOfCells, Origin, SourceOfOrigin, oriConc, cellConc, Diff, t, kd, highBC, DisplacementScaleByConc, searchingRange, marker, auto_factor, state, ConcByCell): ''' [Parameter Description] positions: position of cells from pdb file numberOfCells: total number of cells (num of cells in 1st half + num of cells in 2nd half) Origin: the origin of chemoattractant source SourceOfOrigin: None = One end of simulation box in x axis, Center = the center of simulation box oriConc: the max concentration released from the source of chemoattractant cellConc: the max concentration released by cells (determining the degree of intercellular communication) Diff: the diffusion rate of chemoattractant t: time kd: constant associated with Hills coefficient for autocrinic release highBC: [max X, max Y, max Z] DisplacementScaleByConc: Displacement Scale searchingRange: searching range around the cell marker: a list of marker for resting and activated cells auto_factor: a list of autocrinic factors based on the state of cells state: the characteristics of diffusion of chemoattractant: steady, error, or linear ConcByCell: the concentration accumulated by the attractant released from each individual cell ''' # Do some magic here that will return substrate field-related force acting on each particle n = 0 dummy_coord = np.zeros([3, numberOfCells]) #ConcByCell = np.zeros(numberOfCells) + 1e-14 for i in enumerate(positions): dummy_coord[0][n] = i[1][0].value_in_unit(nanometers) dummy_coord[1][n] = i[1][1].value_in_unit(nanometers) dummy_coord[2][n] = i[1][2].value_in_unit(nanometers) * 0 n += 1 recordedPositions = dummy_coord DistCelltoOrigin = conc.DistCelltoOrigin(recordedPositions, Origin, SourceOfOrigin, state) DistCelltoCell = conc.DistCelltoCell(recordedPositions) ConcByOrigin = conc.ConcByOrigin(DistCelltoOrigin, t, Diff, oriConc, state, Origin) ConcbyCell, HC = conc.ConcByCell(ConcByOrigin, ConcByCell, DistCelltoCell, t, Diff, kd, auto_factor, cellConc) fvX, fvY, fvZ = conc.forceGen(ConcbyCell, Origin, SourceOfOrigin, recordedPositions, t, Diff, HC, searchingRange, highBC, DisplacementScaleByConc, cellConc, oriConc, state) return fvX, fvY, fvZ, ConcbyCell