Skip to content

Instantly share code, notes, and snippets.

This file has been truncated, but you can view the full file.
# Created by BioNetGen 2.7.0
begin parameters
1 Lig_tot 6000 # Constant
2 Rec_tot 400 # Constant
3 Lyn_tot 28 # Constant
4 Syk_tot 400 # Constant
5 kp1 1.328452377888242e-6 # Constant
6 km1 0 # Constant
7 kp2 2.5e-1 # Constant
8 km2 0 # Constant
@isaacsas
isaacsas / bcr_jac_tests.jl
Created April 20, 2019 14:12
BCR with sparse and dense Jacobian
# NEEDS DiffEqBiological master as of 4/20/19
using DiffEqBase, DiffEqBiological, OrdinaryDiffEq, Sundials, LinearAlgebra, SparseArrays
using ReactionNetworkImporters
using TimerOutputs
# parameters
const networkname = "testbcrbng"
const tf = 10000.
# finite difference
using DiffEqBiological, Plots
rn = @reaction_network begin
k1, 0 --> Y
k2p, Y --> 0
k2pp*P, Y --> 0
mm(1-P,(k3p+k3pp*A),J3), 0 --> P
mmr(P,k4*m/J4,J4), Y + P --> Y
end k1 k2p k2pp k3p k3pp A J3 k4 m J4
p = [0.04,0.04,1.,1.,10.0,0.,0.04,35.,.1,.04]
@isaacsas
isaacsas / cell-cycle-bif.jl
Last active March 3, 2019 20:38
cell cycle bifurcation plot
using DiffEqBiological, SteadyStateDiffEq
rn = @reaction_network begin
k1, 0 --> Y
k2p, Y --> 0
k2pp*P, Y --> 0
mmr(Po,(k3p+k3pp*A)/J3,J3), Po-->P
mmr(P,k4*m/J4,J4), Y + P --> Y + Po
end k1 k2p k2pp k3p k3pp A J3 k4 m J4
p = [0.04,0.04,1.,1.,10.0,0.,0.04,35.,.1,.04]
@isaacsas
isaacsas / ek-cell-cycle.png
Created March 3, 2019 19:43
cell cycle bifurcation plot figure
This will have an image of the desired bifurcation plot
@isaacsas
isaacsas / BCR_pop.txt
Created February 16, 2019 00:06
B cell network files
S1 = 30000
S2 = 30000
S3 = 30000
S4 = 30000
S5 = 30000
S6 = 30000
S7 = 0
S8 = 0
S9 = 0
S10 = 0
@isaacsas
isaacsas / BCR-network.net
Created February 4, 2019 15:15
BCR signaling model
This file has been truncated, but you can view the full file.
# Created by BioNetGen 2.3.1
begin parameters
1 p1 3.0e5 # Constant
2 p2 10.0 # Constant
3 p3 3.0e-4 # Constant
4 p4 3.0e-7 # Constant
5 p5 30.0 # Constant
6 p6 3.0e-5 # Constant
7 p7 0.3 # Constant
8 p8 0.1 # Constant
@isaacsas
isaacsas / nonlinear-rx-ex.jl
Created April 7, 2018 23:55
MassActionJump example
using DiffEqBase, DiffEqJump
using Plots; plotlyjs()
tf = .01
u0 = [200, 100, 150]
# MODEL SETUP
# DiffEqBiological Version:
using DiffEqBiological
@isaacsas
isaacsas / directma.jl
Created April 4, 2018 01:18
Generic Mass Action Direct Method
mutable struct DirectMAJumpAggregation{T,S,F1,F2,V} <: AbstractSSAJumpAggregator
next_jump_time::T # required field for SSAs, stores time of next jump
next_jump::Int64 # required field for SSAs, stores index of next jump
end_time::T # required field for SSAs, stores time to stop simulation
cur_rates::Vector{T} # mass action rates followed by constant_jump rates
sum_rate::T
ma_jumps::S
rates::F1
affects!::F2
save_positions::Tuple{Bool,Bool} # required field for SSAs, determines saving of output
@isaacsas
isaacsas / massaction.jl
Created April 3, 2018 20:21
Mass action direct method (supports constant jumps too)
mutable struct DirectMAJumpAggregation{T,S,F1,F2} <: AbstractJumpAggregator
next_jump_time::T
next_jump::Int64
end_time::T
cur_rates::Vector{T} # mass action rates followed by constant_jump rates
sum_rate::T
ma_jumps::S
rates::F1
affects!::F2
save_positions::Tuple{Bool,Bool}