API reference
Public API
valentbind.polyfc(L0, KxStar, f, Rtot, LigC, Kav)
Solve the multivalent binding model for a single homogeneous ligand complex.
Computes bound ligand, bound receptor, and per-valency binding
statistics for a population of identical ligand complexes of valency
f, each assembled from a fixed mixture of monomer ligands
(LigC), binding a set of receptors (Rtot) with affinities
Kav.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
L0
|
float
|
Concentration of ligand complexes. |
required |
KxStar
|
float
|
Detailed-balance corrected cross-linking constant. |
required |
f
|
int | float
|
Valency of the ligand complex. |
required |
Rtot
|
ArrayLike
|
Total abundance of each receptor type on the cell. |
required |
LigC
|
ArrayLike
|
Relative composition of monomer ligands within the complex; renormalized to sum to one. |
required |
Kav
|
ArrayLike
|
Matrix of monomer ligand/receptor affinities (rows are ligands, columns are receptors). |
required |
Returns:
| Type | Description |
|---|---|
tuple[Array, Array, Array, Array]
|
A tuple |
Source code in valentbind/model.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | |
valentbind.polyc(L0, KxStar, Rtot, Cplx, Ctheta, Kav)
Solve the multivalent binding model for a mixture of heterogeneous ligand complexes.
Computes bound ligand, bound receptor, and free ligand statistics for
a population of ligand complexes that can differ in their monomer
composition (Cplx), binding a set of receptors (Rtot) with
affinities Kav.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
L0
|
float
|
Concentration of ligand complexes. |
required |
KxStar
|
float
|
Detailed-balance corrected cross-linking constant. |
required |
Rtot
|
ArrayLike
|
Total abundance of each receptor type on the cell. |
required |
Cplx
|
ArrayLike
|
Monomer ligand composition of each complex; rows are complexes, columns are monomer ligand types. |
required |
Ctheta
|
ArrayLike
|
Relative abundance of each complex; renormalized to sum to one. |
required |
Kav
|
ArrayLike
|
Matrix of monomer ligand/receptor affinities (rows are ligands, columns are receptors). |
required |
Returns:
| Type | Description |
|---|---|
tuple[Array, Array, Array]
|
A tuple |
Raises:
| Type | Description |
|---|---|
AssertionError
|
If the shapes of |
Source code in valentbind/model.py
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 | |
Internals
These are used internally by polyfc/polyc but are documented here
since they're useful when reading or extending the model.
valentbind.model.commonChecks(L0, Rtot, KxStar, Kav, Ctheta)
Validate and normalize the inputs shared by :func:polyfc and :func:polyc.
Converts Rtot, Kav, and Ctheta to jax arrays, checks
that their shapes are mutually consistent, and normalizes Ctheta so
it sums to one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
L0
|
float
|
Concentration of ligand complexes. |
required |
Rtot
|
ArrayLike
|
Total abundance of each receptor type on the cell. |
required |
KxStar
|
float
|
Detailed-balance corrected cross-linking constant. |
required |
Kav
|
ArrayLike
|
Matrix of monomer ligand/receptor affinities (rows are ligands, columns are receptors). |
required |
Ctheta
|
ArrayLike
|
Relative abundance of each ligand or complex; renormalized to sum to one. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float, Array, float, Array, Array]
|
The tuple |
Raises:
| Type | Description |
|---|---|
AssertionError
|
If the shapes of |
Source code in valentbind/model.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | |
valentbind.model.Req_polyfc(Phisum, args)
Mass balance residual for the homogeneous-ligand (polyfc) binding model.
This is the root-finding target passed to the solver in :func:polyfc;
it is zero when Phisum is the free-receptor-weighted binding
potential that is consistent with the mass balance for the total
receptor and free ligand concentrations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
Phisum
|
Array
|
Current guess for the binding potential (a scalar array, since the model reduces to a single scalar unknown). |
required |
args
|
tuple[Array, float, float, int | float, Array]
|
Tuple of |
required |
Returns:
| Type | Description |
|---|---|
Array
|
The residual |
Source code in valentbind/model.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | |
valentbind.model.Req_polyc(log_Req, args)
Mass balance residual in log-space for the heterogeneous-complex (polyc) binding model.
This is the root-finding target passed to the solver in :func:polyc;
it is zero when log_Req is the natural logarithm of free-receptor abundances
consistent with the mass balance for every receptor type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
log_Req
|
Array
|
Current guess for the log of free receptor abundance per receptor type. |
required |
args
|
tuple[Array, float, float, Array, Array, Array]
|
Tuple of |
required |
Returns:
| Type | Description |
|---|---|
Array
|
The log-ratio residual |
Source code in valentbind/model.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | |
valentbind.model.Req_solve(func, Rtot, L0, KxStar, Cplx, Ctheta, Kav)
Run Levenberg-Marquardt root finding in log-space to calculate the free receptor vector.
Initializes from an analytical 1:1 Langmuir binding approximation to ensure rapid and robust convergence.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
func
|
Callable[..., Array]
|
Residual function to find the root of in log space; called as
|
required |
Rtot
|
Array
|
Total abundance of each receptor type on the cell. |
required |
L0
|
float
|
Total ligand complex concentration. |
required |
KxStar
|
float
|
Detailed-balance corrected cross-linking constant. |
required |
Cplx
|
Array
|
Monomer ligand composition of each complex. |
required |
Ctheta
|
Array
|
Relative abundance of each complex. |
required |
Kav
|
Array
|
Matrix of monomer ligand/receptor affinities. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
The free receptor abundance vector |
Source code in valentbind/model.py
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | |