From 10e2ecc09538bad06f453a044011d3cb2ff1caaf Mon Sep 17 00:00:00 2001 From: Wen Wei Tseng Date: Mon, 20 May 2024 21:04:02 +0800 Subject: [PATCH] Reduce deps (#8) * pkg * rm test * wip * pkg * reduce pkg --- Manifest.toml | 157 ++++------------------------------------ Project.toml | 3 +- docs/camkii_calwave.jl | 3 +- docs/camkii_catalyst.jl | 3 +- src/ecc_neonatal.jl | 110 +++++++++++++++++----------- src/isoproterenol.jl | 11 ++- src/istim.jl | 2 +- test.jl | 2 - 8 files changed, 100 insertions(+), 191 deletions(-) delete mode 100644 test.jl diff --git a/Manifest.toml b/Manifest.toml index fa0d503..1daf8c0 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -2,7 +2,7 @@ julia_version = "1.10.3" manifest_format = "2.0" -project_hash = "0a3868209e1e06fd4815a1a4d0fb70163c2c4609" +project_hash = "c31fe08d86ec107a97ce2f38a0768055cf0cb993" [[deps.ADTypes]] git-tree-sha1 = "016833eb52ba2d6bea9fcb50ca295980e728ee24" @@ -102,16 +102,6 @@ weakdeps = ["SparseArrays"] [[deps.Artifacts]] uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" -[[deps.BandedMatrices]] -deps = ["ArrayLayouts", "FillArrays", "LinearAlgebra", "PrecompileTools"] -git-tree-sha1 = "30b7ea34abc4fe816eb1a5f434a43da804836163" -uuid = "aae01518-5342-5314-be14-df237901396f" -version = "1.7.0" -weakdeps = ["SparseArrays"] - - [deps.BandedMatrices.extensions] - BandedMatricesSparseArraysExt = "SparseArrays" - [[deps.Base64]] uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" @@ -131,29 +121,12 @@ git-tree-sha1 = "0c5f81f47bbbcf4aea7b2959135713459170798b" uuid = "62783981-4cbd-42fc-bca8-16325de8dc4b" version = "0.1.5" -[[deps.BoundaryValueDiffEq]] -deps = ["ADTypes", "Adapt", "ArrayInterface", "BandedMatrices", "ConcreteStructs", "DiffEqBase", "FastAlmostBandedMatrices", "FastClosures", "ForwardDiff", "LinearAlgebra", "LinearSolve", "Logging", "NonlinearSolve", "OrdinaryDiffEq", "PreallocationTools", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "Setfield", "SparseArrays", "SparseDiffTools"] -git-tree-sha1 = "005b55fa2eebaa4d7bf3cfb8097807f47116175f" -uuid = "764a87c0-6b3e-53db-9096-fe964310641d" -version = "5.7.1" - - [deps.BoundaryValueDiffEq.extensions] - BoundaryValueDiffEqODEInterfaceExt = "ODEInterface" - - [deps.BoundaryValueDiffEq.weakdeps] - ODEInterface = "54ca160b-1b9f-5127-a996-1867f4bc2a2c" - [[deps.Bzip2_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] git-tree-sha1 = "9e2a6b69137e6969bab0152632dcb3bc108c8bdd" uuid = "6e34b625-4abd-537c-b88f-471c36dfa7a0" version = "1.0.8+1" -[[deps.CEnum]] -git-tree-sha1 = "389ad5c84de1ae7cf0e28e381131c98ea87d54fc" -uuid = "fa961155-64e5-5f13-b03f-caf6b980ea82" -version = "0.5.0" - [[deps.CPUSummary]] deps = ["CpuId", "IfElse", "PrecompileTools", "Static"] git-tree-sha1 = "585a387a490f1c4bd88be67eea15b93da5e85db7" @@ -337,12 +310,6 @@ version = "1.0.0" deps = ["Printf"] uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" -[[deps.DelayDiffEq]] -deps = ["ArrayInterface", "DataStructures", "DiffEqBase", "LinearAlgebra", "Logging", "OrdinaryDiffEq", "Printf", "RecursiveArrayTools", "Reexport", "SciMLBase", "SimpleNonlinearSolve", "SimpleUnPack"] -git-tree-sha1 = "5959ae76ebd198f70e9af81153644543da0cfaf2" -uuid = "bcd4f6db-9728-5f36-b5f7-82caef46ccdb" -version = "5.47.3" - [[deps.DelimitedFiles]] deps = ["Mmap"] git-tree-sha1 = "9e2f36d3c96a820c678f2f1f1782582fcf685bae" @@ -351,11 +318,12 @@ version = "1.9.1" [[deps.DiffEqBase]] deps = ["ArrayInterface", "ConcreteStructs", "DataStructures", "DocStringExtensions", "EnumX", "EnzymeCore", "FastBroadcast", "FastClosures", "ForwardDiff", "FunctionWrappers", "FunctionWrappersWrappers", "LinearAlgebra", "Logging", "Markdown", "MuladdMacro", "Parameters", "PreallocationTools", "PrecompileTools", "Printf", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "Setfield", "SparseArrays", "Static", "StaticArraysCore", "Statistics", "Tricks", "TruncatedStacktraces"] -git-tree-sha1 = "d520d3007de793f4fca16c77a25a9774ebe4ad6d" +git-tree-sha1 = "03b9555f4c3a7c2f530bb1ae13e85719c632f74e" uuid = "2b5f629d-d688-5b77-993f-72d75c75574e" -version = "6.150.0" +version = "6.151.1" [deps.DiffEqBase.extensions] + DiffEqBaseCUDAExt = "CUDA" DiffEqBaseChainRulesCoreExt = "ChainRulesCore" DiffEqBaseDistributionsExt = "Distributions" DiffEqBaseEnzymeExt = ["ChainRulesCore", "Enzyme"] @@ -368,6 +336,7 @@ version = "6.150.0" DiffEqBaseUnitfulExt = "Unitful" [deps.DiffEqBase.weakdeps] + CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9" @@ -384,19 +353,10 @@ deps = ["DataStructures", "DiffEqBase", "ForwardDiff", "Functors", "LinearAlgebr git-tree-sha1 = "c959cfd2657d16beada157a74d52269e8556500e" uuid = "459566f4-90b8-5000-8ac3-15dfb0a30def" version = "3.6.2" -weakdeps = ["OrdinaryDiffEq", "Sundials"] -[[deps.DiffEqNoiseProcess]] -deps = ["DiffEqBase", "Distributions", "GPUArraysCore", "LinearAlgebra", "Markdown", "Optim", "PoissonRandom", "QuadGK", "Random", "Random123", "RandomNumbers", "RecipesBase", "RecursiveArrayTools", "Requires", "ResettableStacks", "SciMLBase", "StaticArraysCore", "Statistics"] -git-tree-sha1 = "65cbbe1450ced323b4b17228ccd96349d96795a7" -uuid = "77a26b50-5914-5dd7-bc55-306e6241c503" -version = "5.21.0" - - [deps.DiffEqNoiseProcess.extensions] - DiffEqNoiseProcessReverseDiffExt = "ReverseDiff" - - [deps.DiffEqNoiseProcess.weakdeps] - ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" + [deps.DiffEqCallbacks.weakdeps] + OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" + Sundials = "c3572dad-4567-51f8-b174-8c6c989267f4" [[deps.DiffResults]] deps = ["StaticArraysCore"] @@ -410,23 +370,6 @@ git-tree-sha1 = "23163d55f885173722d1e4cf0f6110cdbaf7e272" uuid = "b552c78f-8df3-52c6-915a-8e097449b14b" version = "1.15.1" -[[deps.DifferentialEquations]] -deps = ["BoundaryValueDiffEq", "DelayDiffEq", "DiffEqBase", "DiffEqCallbacks", "DiffEqNoiseProcess", "JumpProcesses", "LinearAlgebra", "LinearSolve", "NonlinearSolve", "OrdinaryDiffEq", "Random", "RecursiveArrayTools", "Reexport", "SciMLBase", "SteadyStateDiffEq", "StochasticDiffEq", "Sundials"] -git-tree-sha1 = "81042254a307980b8ab5b67033aca26c2e157ebb" -uuid = "0c46a032-eb83-5123-abaf-570d42b7fbaa" -version = "7.13.0" - -[[deps.Distances]] -deps = ["LinearAlgebra", "Statistics", "StatsAPI"] -git-tree-sha1 = "66c4c81f259586e8f002eacebc177e1fb06363b0" -uuid = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7" -version = "0.10.11" -weakdeps = ["ChainRulesCore", "SparseArrays"] - - [deps.Distances.extensions] - DistancesChainRulesCoreExt = "ChainRulesCore" - DistancesSparseArraysExt = "SparseArrays" - [[deps.Distributed]] deps = ["Random", "Serialization", "Sockets"] uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" @@ -555,12 +498,6 @@ git-tree-sha1 = "466d45dc38e15794ec7d5d63ec03d776a9aff36e" uuid = "b22a6f82-2f65-5046-a5b2-351ab43fb4e5" version = "4.4.4+1" -[[deps.FastAlmostBandedMatrices]] -deps = ["ArrayInterface", "ArrayLayouts", "BandedMatrices", "ConcreteStructs", "LazyArrays", "LinearAlgebra", "MatrixFactorizations", "PrecompileTools", "Reexport"] -git-tree-sha1 = "9dc913faf8552fd09b92a0d7fcc25f1d5609d795" -uuid = "9d29842c-ecb8-4973-b1e9-a27b1157504e" -version = "0.1.1" - [[deps.FastBroadcast]] deps = ["ArrayInterface", "LinearAlgebra", "Polyester", "Static", "StaticArrayInterface", "StrideArraysCore"] git-tree-sha1 = "a6e756a880fc419c8b41592010aebe6a5ce09136" @@ -643,9 +580,9 @@ weakdeps = ["StaticArrays"] [[deps.FreeType2_jll]] deps = ["Artifacts", "Bzip2_jll", "JLLWrappers", "Libdl", "Zlib_jll"] -git-tree-sha1 = "d8db6a5a2fe1381c1ea4ef2cab7c69c2de7f9ea0" +git-tree-sha1 = "5c1d8ae0efc6c2e7b1fc502cbe25def8f661b7bc" uuid = "d7e528f0-a631-5988-bf34-fe36492bcfd7" -version = "2.13.1+0" +version = "2.13.2+0" [[deps.FriBidi_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] @@ -939,12 +876,6 @@ weakdeps = ["StaticArrays"] deps = ["Artifacts", "Pkg"] uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3" -[[deps.LevyArea]] -deps = ["LinearAlgebra", "Random", "SpecialFunctions"] -git-tree-sha1 = "56513a09b8e0ae6485f34401ea9e2f31357958ec" -uuid = "2d8b4e74-eb68-11e8-0fb9-d5eb67b50637" -version = "1.0.0" - [[deps.LibCURL]] deps = ["LibCURL_jll", "MozillaCACerts_jll"] uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" @@ -1207,12 +1138,6 @@ git-tree-sha1 = "a0b464d183da839699f4c79e7606d9d186ec172c" uuid = "d41bc354-129a-5804-8e4c-c37616107c6c" version = "7.8.3" -[[deps.NLsolve]] -deps = ["Distances", "LineSearches", "LinearAlgebra", "NLSolversBase", "Printf", "Reexport"] -git-tree-sha1 = "019f12e9a1a7880459d0173c182e6a99365d7ac1" -uuid = "2774e3e8-f4cf-5e23-947b-6d7e65073b56" -version = "4.5.1" - [[deps.NaNMath]] deps = ["OpenLibm_jll"] git-tree-sha1 = "0877504529a3e5c3343c6f8b4c0381e57e4387e4" @@ -1298,18 +1223,6 @@ git-tree-sha1 = "13652491f6856acfd2db29360e1bbcd4565d04f1" uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e" version = "0.5.5+0" -[[deps.Optim]] -deps = ["Compat", "FillArrays", "ForwardDiff", "LineSearches", "LinearAlgebra", "NLSolversBase", "NaNMath", "Parameters", "PositiveFactorizations", "Printf", "SparseArrays", "StatsBase"] -git-tree-sha1 = "d9b79c4eed437421ac4285148fcadf42e0700e89" -uuid = "429524aa-4258-5aef-a3af-852621145aeb" -version = "1.9.4" - - [deps.Optim.extensions] - OptimMOIExt = "MathOptInterface" - - [deps.Optim.weakdeps] - MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee" - [[deps.Opus_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] git-tree-sha1 = "51a08fb14ec28da2ec7a927c4337e4332c2a4720" @@ -1323,9 +1236,9 @@ version = "1.6.3" [[deps.OrdinaryDiffEq]] deps = ["ADTypes", "Adapt", "ArrayInterface", "DataStructures", "DiffEqBase", "DocStringExtensions", "ExponentialUtilities", "FastBroadcast", "FastClosures", "FillArrays", "FiniteDiff", "ForwardDiff", "FunctionWrappersWrappers", "IfElse", "InteractiveUtils", "LineSearches", "LinearAlgebra", "LinearSolve", "Logging", "MacroTools", "MuladdMacro", "NonlinearSolve", "Polyester", "PreallocationTools", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "SciMLStructures", "SimpleNonlinearSolve", "SimpleUnPack", "SparseArrays", "SparseDiffTools", "StaticArrayInterface", "StaticArrays", "TruncatedStacktraces"] -git-tree-sha1 = "4cf03bfe9c6159f66b57cda85f169cd0eff0818d" +git-tree-sha1 = "a6ef55f6ce8a64e2d3c804d1c56fdafdd1528f86" uuid = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" -version = "6.76.0" +version = "6.77.1" [[deps.PCRE2_jll]] deps = ["Artifacts", "Libdl"] @@ -1422,12 +1335,6 @@ git-tree-sha1 = "240d7170f5ffdb285f9427b92333c3463bf65bf6" uuid = "1d0040c9-8b98-4ee7-8388-3f51789ca0ad" version = "0.2.1" -[[deps.PositiveFactorizations]] -deps = ["LinearAlgebra"] -git-tree-sha1 = "17275485f373e6673f7e7f97051f703ed5b15b20" -uuid = "85a6dd25-e78a-55b7-8502-1745935b8125" -version = "0.2.4" - [[deps.PreallocationTools]] deps = ["Adapt", "ArrayInterface", "ForwardDiff"] git-tree-sha1 = "a660e9daab5db07adf3dedfe09b435cc530d855e" @@ -1481,12 +1388,6 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" deps = ["SHA"] uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" -[[deps.Random123]] -deps = ["Random", "RandomNumbers"] -git-tree-sha1 = "4743b43e5a9c4a2ede372de7061eed81795b12e7" -uuid = "74087812-796a-5b5d-8853-05524746bad3" -version = "1.7.0" - [[deps.RandomNumbers]] deps = ["Random", "Requires"] git-tree-sha1 = "043da614cc7e95c703498a491e2c21f58a2b8111" @@ -1552,12 +1453,6 @@ git-tree-sha1 = "838a3a4188e2ded87a4f9f184b4b0d78a1e91cb7" uuid = "ae029012-a4dd-5104-9daa-d747884805df" version = "1.3.0" -[[deps.ResettableStacks]] -deps = ["StaticArrays"] -git-tree-sha1 = "256eeeec186fa7f26f2801732774ccf277f05db9" -uuid = "ae5879a3-cd67-5da8-be7f-38c6eb64a37b" -version = "1.1.1" - [[deps.Rmath]] deps = ["Random", "Rmath_jll"] git-tree-sha1 = "f65dcb5fa46aee0cf9ed6274ccbd597adc49aa7b" @@ -1801,18 +1696,6 @@ weakdeps = ["ChainRulesCore", "InverseFunctions"] StatsFunsChainRulesCoreExt = "ChainRulesCore" StatsFunsInverseFunctionsExt = "InverseFunctions" -[[deps.SteadyStateDiffEq]] -deps = ["ConcreteStructs", "DiffEqBase", "DiffEqCallbacks", "LinearAlgebra", "Reexport", "SciMLBase"] -git-tree-sha1 = "1158cfdf0da5b0eacdfcfba7c16b174a37bdf6c7" -uuid = "9672c7b4-1e72-59bd-8a11-6ac3964bc41f" -version = "2.2.0" - -[[deps.StochasticDiffEq]] -deps = ["Adapt", "ArrayInterface", "DataStructures", "DiffEqBase", "DiffEqNoiseProcess", "DocStringExtensions", "FiniteDiff", "ForwardDiff", "JumpProcesses", "LevyArea", "LinearAlgebra", "Logging", "MuladdMacro", "NLsolve", "OrdinaryDiffEq", "Random", "RandomNumbers", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "SparseArrays", "SparseDiffTools", "StaticArrays", "UnPack"] -git-tree-sha1 = "97e5d0b7e5ec2e68eec6626af97c59e9f6b6c3d0" -uuid = "789caeaf-c7a9-5a7d-9973-96adeb23e2a0" -version = "6.65.1" - [[deps.StrideArraysCore]] deps = ["ArrayInterface", "CloseOpenIntervals", "IfElse", "LayoutPointers", "LinearAlgebra", "ManualMemory", "SIMDTypes", "Static", "StaticArrayInterface", "ThreadingUtilities"] git-tree-sha1 = "25349bf8f63aa36acbff5e3550a86e9f5b0ef682" @@ -1828,18 +1711,6 @@ deps = ["Artifacts", "Libdl", "libblastrampoline_jll"] uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c" version = "7.2.1+1" -[[deps.Sundials]] -deps = ["CEnum", "DataStructures", "DiffEqBase", "Libdl", "LinearAlgebra", "Logging", "PrecompileTools", "Reexport", "SciMLBase", "SparseArrays", "Sundials_jll"] -git-tree-sha1 = "e15f5a73f0d14b9079b807a9d1dac13e4302e997" -uuid = "c3572dad-4567-51f8-b174-8c6c989267f4" -version = "4.24.0" - -[[deps.Sundials_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "SuiteSparse_jll", "libblastrampoline_jll"] -git-tree-sha1 = "ba4d38faeb62de7ef47155ed321dce40a549c305" -uuid = "fb77eaff-e24c-56d4-86b1-d163f2edb164" -version = "5.2.2+0" - [[deps.SymbolicIndexingInterface]] deps = ["Accessors", "ArrayInterface", "RuntimeGeneratedFunctions", "StaticArraysCore"] git-tree-sha1 = "b479c7a16803f08779ac5b7f9844a42621baeeda" @@ -2039,9 +1910,9 @@ version = "1.31.0+0" [[deps.XML2_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Zlib_jll"] -git-tree-sha1 = "532e22cf7be8462035d092ff21fada7527e2c488" +git-tree-sha1 = "52ff2af32e591541550bd753c0da8b9bc92bb9d9" uuid = "02c8fc9c-b97f-50b9-bbe4-9be30ff0a78a" -version = "2.12.6+0" +version = "2.12.7+0" [[deps.XSLT_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Libgcrypt_jll", "Libgpg_error_jll", "Libiconv_jll", "Pkg", "XML2_jll", "Zlib_jll"] diff --git a/Project.toml b/Project.toml index c14e36d..d74cc59 100644 --- a/Project.toml +++ b/Project.toml @@ -4,7 +4,8 @@ authors = ["Wen-Wei Tseng "] version = "0.1.0" [deps] -DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa" +DiffEqCallbacks = "459566f4-90b8-5000-8ac3-15dfb0a30def" ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78" NaNMath = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3" +OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" diff --git a/docs/camkii_calwave.jl b/docs/camkii_calwave.jl index 8b69ef8..48e25f8 100644 --- a/docs/camkii_calwave.jl +++ b/docs/camkii_calwave.jl @@ -1,7 +1,8 @@ #=== # Smooth calcium wave ===# -using DifferentialEquations +using OrdinaryDiffEq +using DiffEqCallbacks using ModelingToolkit using Plots using CaMKIIModel: get_camkii_eqs, μM, nM, second diff --git a/docs/camkii_catalyst.jl b/docs/camkii_catalyst.jl index edaddf6..3fa5a4a 100644 --- a/docs/camkii_catalyst.jl +++ b/docs/camkii_catalyst.jl @@ -1,6 +1,7 @@ # # Isolated CaMKII response using ModelingToolkit -using DifferentialEquations +using OrdinaryDiffEq +using DiffEqCallbacks using Plots using CaMKIIModel: nM, μM, Hz, get_camkii_eqs diff --git a/src/ecc_neonatal.jl b/src/ecc_neonatal.jl index 59ac1e0..2cc6570 100644 --- a/src/ecc_neonatal.jl +++ b/src/ecc_neonatal.jl @@ -13,7 +13,6 @@ using NaNMath "Calcium buffered by troponin and calmodulin" function beta_cai(Ca; TnI_PKAp=0) - @parameters begin TrpnTotal=35μM CmdnTotal=50μM @@ -60,6 +59,73 @@ function get_ca_pde_eqs(; return eqs end +"Calcium flux scaled by phosphorylated LCC" +function get_ICa_scalep(LCCb_PKAp=0) + @parameters begin + ICa_scale = 0.95 # 5.25 + fracLCCbp0 = 0.250657 # Derived quantity - (LCCbp(baseline)/LCCbtot) + fracLCCbpISO = 0.525870 # Derived quantity - (LCCbp(ISO)/LCCbtot) + end + a_favail = (1.56 - 1) / (fracLCCbpISO / fracLCCbp0 - 1) # fracLCCbp ISO (x1.56 o.1 ISO) + favail = (1 - a_favail) + a_favail * (LCCb_PKAp / fracLCCbp0) # Test (max x2.52 100# phosph) + return ICa_scale * favail +end + +"Na-Ca exchanger" +function get_ncx_eqs(nai, cai, nao, cao, vm, LCCb_PKAp=0) + @parameters begin + fNaCa = 1 + kNaCa = 2.2680e-016 * μA / cm^2 / μM^4 + dNaCa = 1e-16 / μM^4 + gamma = 0.5 + end + @variables t INaCa(t) + return [ + INaCa ~ get_ICa_scalep(LCCb_PKAp) * kNaCa * ((exp(iVT * gamma * vm) * nai^3 * cao - exp(iVT * (gamma - 1) * vm) * cai * nao^3 * fNaCa) / (1 + dNaCa * (nao^3 * cai * fNaCa + nai^3 * cao))) + ] +end + +"L-type calcium current (LCC)" +function get_lcc_eqs(cai, cao, vm, LCCb_PKAp=0) + @parameters GCaL = 1.3125e-4 * 0.8 * 0.6 / ms + @variables begin + t + ICaL(t) + i_d(t) + i_f(t) + i_fca(t) + dinf(t) + taud(t) + finf(t) + tauf(t) + fcainf(t) + end + + ICa_scalep = get_ICa_scalep(LCCb_PKAp) + V = vm * Volt/mV # Convert voltage to mV + + alphad = 1.4 * expit((V + 35) / 13) + 0.25 + betad = 1.4 * expit(-(V + 5) / 5) + gammad = expit((V - 50) / 20) + alphafca = hilr(cai, 0.000325mM * 1.5, 8) + betafca = 0.1 * expit(-(cai - 0.0005mM) / 0.0001mM) + gammafca = 0.2 * expit(-(cai - 0.00075mM) / 0.0008mM) + taufca = 10ms + kfca = 1 - (fcainf > i_fca) * (V > -60) + + return [ + ICaL ~ ICa_scalep * i_d * i_f * i_fca * ghkVm(GCaL, vm, cai, 0.341 * cao, 2), + D(i_d) * taud ~ dinf - i_d, + D(i_f) * tauf ~ finf - i_f, + D(i_fca) * taufca ~ kfca * (fcainf - i_fca), + dinf ~ expit((V + 11.1) / 7.2), + taud ~ (alphad * betad + gammad) * ms, + finf ~ expit(-(V + 23.3) / 5.4), + tauf ~ (1125 * exp(-(V + 27)^2 / 240) + 165 * expit((V - 25) / 10) + 120) * ms, + fcainf ~ (alphafca + betafca + gammafca + 0.23) / 1.46, + ] +end + function build_neonatal_ecc_eqs(; LCCb_PKAp=0, # Fraction of LCC phosphorylated by PKAPLB_CKp PLBT17p=0, @@ -72,14 +138,6 @@ function build_neonatal_ecc_eqs(; Mg_i = 1000μM end - # PKA PHOSPHOREGULATION OF LCC AVAILABLILITY (beta subunit phosph) - ICa_scale = 0.95 # 5.25 - fracLCCbp0 = 0.250657 # Derived quantity - (LCCbp(baseline)/LCCbtot) - fracLCCbpISO = 0.525870 # Derived quantity - (LCCbp(ISO)/LCCbtot) - a_favail = (1.56 - 1) / (fracLCCbpISO / fracLCCbp0 - 1) # fracLCCbp ISO (x1.56 o.1 ISO) - favail = (1 - a_favail) + a_favail * (LCCb_PKAp / fracLCCbp0) # Test (max x2.52 100# phosph) - ICa_scalep = ICa_scale * favail - @variables begin t Na_i(t) @@ -94,33 +152,8 @@ function build_neonatal_ecc_eqs(; D = Differential(t) - # NCX - @parameters begin - fNaCa = 1 - kNaCa = 2.2680e-016 * μA / cm^2 / μM^4 - dNaCa = 1e-16 / μM^4 - gamma = 0.5 - end - @variables INaCa(t) - - # LCC - @parameters GCaL = 1.3125e-4 * 0.8 * 0.6 / ms - @variables ICaL(t) i_d(t) i_f(t) i_fca(t) - - # L-type calcium current (LCC) - dinf = expit((vm + 11.1mV) / 7.2mV) - alphad = 1.4 * expit((vm + 35mV) / 13mV) + 0.25 - betad = 1.4 * expit(-(vm + 5mV) / 5mV) - gammad = expit((vm - 50mV) / 20mV) - taud = (alphad * betad + gammad) * ms - finf = expit(-(vm + 23.3mV) / 5.4mV) - tauf = (1125 * exp(-(V + 27mV)^2 / 240mV^2) + 165 * expit((vm - 25mV) / 10mV) + 120) * ms - alphafca = hilr(Cai_sub_SL, 0.000325 * 1.5, 8) - betafca = 0.1 * expit(-(Cai_sub_SL - 0.0005mM) / 0.0001mM) - gammafca = 0.2 * expit(-(Cai_sub_SL - 0.00075mM) / 0.0008mM) - fcainf = (alphafca + betafca + gammafca + 0.23) / 1.46 - taufca = 10ms - kfca = 1 - (fcainf > i_fca) * (vm > -60mV) + ncxeqs = get_ncx_eqs(Na_i, Cai_sub_SL, Na_o, Ca_o, vm, LCCb_PKAp) + lcceqs = get_lcc_eqs(Cai_sub_SL, Ca_o, vm, LCCb_PKAp) # T-Type calcium current (TCC) @parameters gCaT = 0.2mS / cm^2 @@ -212,11 +245,6 @@ function build_neonatal_ecc_eqs(; E_Na ~ nernst(Na_o, Na_i), E_K ~ nernst(K_o, K_i), E_Ca ~ nernst(Ca_o, Cai_sub_SL, 2), - INaCa ~ ICa_scalep * kNaCa * ((exp(iVT * gamma * vm) * Na_i^3 * Ca_o - exp(iVT * (gamma - 1) * vm) * Cai_sub_SL * Na_o^3 * fNaCa) / (1 + dNaCa * (Na_o^3 * Cai_sub_SL * fNaCa + Na_i^3 * Ca_o))), - ICaL ~ ICa_scalep * i_d * i_f * i_fca * ghkVm(GCaL, vm, Cai_sub_SL, 0.341 * Ca_o, 2), - D(i_d) * taud ~ dinf - i_d, - D(i_f) * tauf ~ finf - i_f, - D(i_fca) * taufca ~ kfca * (fcainf - i_fca), ICaT ~ gCaT * i_b * i_g * (vm - E_Ca + 106.5mV), D(i_b) * taub ~ binf - i_b, D(i_g) * taug ~ ginf - i_g, diff --git a/src/isoproterenol.jl b/src/isoproterenol.jl index 2b0aa0a..cd430b8 100644 --- a/src/isoproterenol.jl +++ b/src/isoproterenol.jl @@ -133,6 +133,9 @@ function get_bar_eqs(ATP=5000μM, ISO=0μM,) LCCbp(t) = 0.01313μM KURn(t) ## conserved KURp(t) = 0.01794μM + # Phosphorylation proportions + LCCa_PKAp(t) + LCCb_PKAp(t) end D = Differential(t) @@ -205,6 +208,12 @@ function get_bar_eqs(ATP=5000μM, ISO=0μM,) KURn ~ IKurtot - KURp, ] + propeqs = [ + LCCa_PKAp ~ LCCap/LCCtot, + LCCb_PKAp ~ LCCbp/LCCtot, + ] + odeeqs = [D(x) ~ rates[x] for x in (LR, LRG, RG, GsaGTP, GsaGDP, Gsby, b1AR_S464, b1AR_S301, AC_GsaGTP, PDEp, cAMP, RCcAMP_I, RCcAMPcAMP_I, RcAMPcAMP_I, PKACI, PKACI_PKI, RCcAMP_II, RCcAMPcAMP_II, RcAMPcAMP_II, PKACII, PKACII_PKI, I1p, I1p_PP1, PLBp, PLMp, TnIp, LCCap, LCCbp, KURp)] - return [conservedeqs; odeeqs] + + return [conservedeqs; propeqs; odeeqs] end diff --git a/src/istim.jl b/src/istim.jl index 400dc5d..b401f3e 100644 --- a/src/istim.jl +++ b/src/istim.jl @@ -1,5 +1,5 @@ # Stimulation current -using DifferentialEquations +using DiffEqCallbacks function build_stim_events(starttime, endtime, period, duty, strength, sym; baseline=0, proposeddt=0.01) rise! = (integrator) -> begin diff --git a/test.jl b/test.jl deleted file mode 100644 index c2b873d..0000000 --- a/test.jl +++ /dev/null @@ -1,2 +0,0 @@ -using Catalyst -using ModelingToolkit