sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
218ff7cea709f872313beb1ae6a238a63de5bd4aa3ea9339b86065567a4f3172
JavaScript
200,486
22
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may n...
52d969710d4f00859cb46b03248e7b54b0d580f0eb1ccd5f34915e0849297222
Julia
53
2
function plot_variable end function plot_discrete end
2d7909a4f8a476ce350fd323a81f3b14f8377ff9136c4a1139bf3721d5a00310
Julia
55
4
using SynapseElife using Test include("simplerun.jl")
a484e97a5387c81db417592b50df3dcce3aab5a297f28834fd172d07a5e09964
Julia
252
8
module PlotsExt using Plots, SynapseElife, DocStringExtensions import SynapseElife: plot_discrete, plot_variable, get_names, statistics_jumps include("plot.jl") end
9002dd47e1eb0c3925a2e2b5dbbc9dbb666cf94a30dce8f210aadee1b16f8261
Julia
361
19
using Datamonger using CodecBzip2 using CodecZlib using DataFrames using Dates using HTTP using JSON3 using SHA using SparseArrays using Test include("test_canonical.jl") include("test_decoders.jl") include("test_native.jl") include("test_registry.jl") include("test_api.jl") include("test_preprocessing.jl") include("t...
0c6a6311911387aa53d4be8b8b3bb0d5f8fb5058862dab8ad1939d9d20364804
Julia
384
12
using PiecewiseDeterministicMarkovProcesses, Random const PDMP = PiecewiseDeterministicMarkovProcesses jp = PDMP.Jump(PDMP.Delta_dummy) jp = PDMP.Jump(rand(Int64,2,2)) PDMP.finalize_dummy(1, 1, 1, 1, 1) PDMP.PDMPResult(rand(2), rand(2), rand(2)) PDMP.PDMPResult(rand(2), rand(2), rand(2), rand(2), (false, false)) xc0 ...
106aade9eb478426561e24971520019c856a3eabde093f778158bbdf80bce93f
Julia
464
9
"""Independent pre-migration Julia decoder and encoder; never loaded by the client.""" module Reference using CodecBzip2, CodecZlib, DataFrames, SHA, SparseArrays, TranscodingStreams using Datamonger: DatamongerError, DecodeError, UnsupportedDecoderError, DecodedIntegrityError, LogicalComponent, LogicalVector, Logi...
97aeebacb20779b8baa8a5847a3dd3c46db37f52602f9a946596feb46c8fce9d
Julia
479
21
struct mlParams v_Na::Float64 g_Na::Float64 v_K::Float64 g_K::Float64 v_L::Float64 g_L::Float64 I_app::Float64 gamma_na::Float64 k_na::Float64 beta_na::Float64 gamma_k::Float64 k_k::Float64 beta_k::Float64 M::Float64 N::Float64 end function ml(p) return mlParams(p["v_Na"] , p["g_Na"] , ...
32d70e9c1fb7cf16684e88df803ecabf9f98a762e276a1a3db5a72ebd97b39be
Julia
487
21
using Documenter, SynapseElife using Pkg # pkg"dev Plots" ENV["JULIA_DEBUG"]=Documenter makedocs(doctest = false, sitename = "Model of excitatory synapse in Julia", format = Documenter.HTML(collapselevel = 1), pages = Any[ "Home" => "index.md", "Simple example" => "tutorials.md", "...
99de33c89de0259a2d1afbc623398f188c0e243c51f78c197df62c8717336949
Julia
654
20
using Documenter using RNAForecaster makedocs( sitename = "RNAForecaster", format = Documenter.HTML(), pages = ["Home" => "index.md", "Training and Forecasting" => "training.md", "Predictions from Splicing Data" => "splicedData.md", "Metabolic Labeling for Forecasts" ...
fa04666a78141c8ae865c70a93a8c05ea9d9dddc7809f892123f9d88904730ea
Julia
772
27
using Pkg cd(@__DIR__) pkg" activate ." pkg" dev LSODA Sundials" using Documenter, PiecewiseDeterministicMarkovProcesses makedocs(modules = [PiecewiseDeterministicMarkovProcesses], authors = "Romain Veltz", doctest = false, pagesonly = true, # this is on Documenter#master, do not compile what is not in pages = ...
db717d9552222bf0e563e327522015da153dd7d2638c5ae382260af57c80bb4f
Julia
827
30
module RNAForecaster using DiffEqFlux, DifferentialEquations using Flux.Data: DataLoader using Flux: mse using Random, Statistics, StatsBase, LinearRegression using HypothesisTests using DataFrames, CategoricalArrays using Distances using Distributed using Base.Iterators: partition using CUDA using JLD2 using Flux: lo...
3f50f46aee64b691e261d364e0ca50d10a9250220670f81f481fe80599eeb7a7
Julia
970
39
# using Revise using LinearAlgebra, Random, Sundials import PiecewiseDeterministicMarkovProcesses as PDMP import OrdinaryDiffEq as ODE using OrdinaryDiffEqBDF function R_sir!(rate,xc,xd,parms,t, issum::Bool) (S,I,R,~) = xd (beta,mu) = parms infection = beta*S*I recovery = mu*I rate_display = 0.01 if issum == fal...
c611009447b52745f5004418dd6cab716dadf083da11071ac232f30abc99b809
Julia
1,001
23
# Build the checkout's native library and install it as a Julia artifact. using Pkg.Artifacts using Libdl root = dirname(@__DIR__) manifest = joinpath(root, "crates", "datamonger-ffi", "Cargo.toml") cargo = get(ENV, "DM_CORE_CARGO", "cargo") command = `$cargo build --locked --release --manifest-path $manifest` if hask...
37e0461ff59c19307b88fc043dd3be5fd6a1ac425c7e339486454ae52c798696
Julia
1,017
20
# # Code to get PiecewiseDeterministicMarkovProcesses working with ForwardDiff # # Makes use of the trick in http://docs.juliadiffeq.org/latest/basics/faq.html#Are-the-native-Julia-solvers-compatible-with-autodifferentiation?-1 # # https://diffeq.sciml.ai/stable/basics/faq/ # using ForwardDiff # # struct DiffCache{T<:A...
0f805a61ab93a4f25475a7b97db6aaa6cbd86a63fe8ac7bd988e19d4986ecbe4
Julia
1,023
36
abstract type AbstractJump end # Dummy Jump function function Delta_dummy(xc, xd, parms, t, ind_reaction) return nothing end struct Jump{Td, Tnu <: AbstractArray{Td}, TD} <: AbstractJump nu::Tnu # implements jumps on the discrete variable with a matrix Delta::TD # function to implement the jumps (optional...
da4488c7fb075f89f44185bae0b71fee78b90bf0173f69752120448eddd3adc4
Julia
1,065
40
# using Revise, Plots using Test using SynapseElife using PiecewiseDeterministicMarkovProcesses, Sundials # this holds the spine parameters param_synapse = SynapseParams(t_end = 1000.) # initial conditions for the spine xc0 = initial_conditions_continuous_temp(param_synapse) # initial conditions deterministic vars xd...
a44c954eb7bdc295cd7f073b368bade8b1fe8a26110c5113ee4b2940850c4639
Julia
1,079
37
using PiecewiseDeterministicMarkovProcesses, LinearAlgebra, Random function R_sir_rej!(rate,xc,xd,parms,t,issum::Bool) (S,I,R,~) = xd (beta,mu) = parms infection = beta*S*I recovery = mu*I rate_display = parms[1] if issum == false rate[1] = infection rate[2] = recovery rate[3] = rate_display return 0., r...
2376e08785798824d834a248de5e62f50657c8a3e1eff9520996578a0310dece
Julia
1,082
36
module PiecewiseDeterministicMarkovProcesses using Random, LinearAlgebra, SparseArrays#, Parameters import LSODA, Sundials import RecursiveArrayTools as RAT import JumpProcesses as JP import SciMLBase import SciMLBase: solve import PreallocationTools: dualcache, get_tmp abstract type AbstractPDMPAlgorithm end ...
2e579e08262620388789e71667a7edf4b9672d4802eae55772d33e2d6d6ea28d
Julia
1,089
32
module SynapseElife using Parameters, Distributions, SparseArrays, DataFrames, ProgressMeter using DocStringExtensions using Catalyst using Printf using LazySets # for using ∈ plasticity region using StaticArrays # for using LazySets in efficient way using PiecewiseDeterministicMarkovProcesses, LinearAlgebra, ...
f3ba8b4ea980286f28f9ed492eb69b10b0dc0cbef9a13553dbb3a4d1462665c1
Julia
1,112
35
# using Revise using PiecewiseDeterministicMarkovProcesses, LinearAlgebra, Random, OrdinaryDiffEq, Sundials const PDMP = PiecewiseDeterministicMarkovProcesses using JumpProcesses rate = (u,p,t) -> .1 + u[1] affect! = (integrator) -> (integrator.u[1] = integrator.u[1]/2; integrator.u[2] +=1) jump = JumpProcesses.Variab...
dd084a3ca605cc458629ddeb42bb56113692cfe9948bc0e702a47596f3de6d38
Julia
1,185
34
using Datamonger using JSON3 repository_root = normpath(joinpath(@__DIR__, "..", "..", "..")) release = isempty(ARGS) ? "candidate-0002" : only(ARGS) release_root = joinpath(repository_root, "registry", "releases", release) selector_document = JSON3.read( read(joinpath(release_root, "selector.json")), Dict{Str...
cadacf2fb5f40d51adac79b543192f1913d1b7a5e8ece8508192d9b722ed59fa
Julia
1,413
72
module Datamonger using CodecZlib using DataFrames using Dates using FileWatching using HTTP using JSON3 using Libdl using Pkg.Artifacts: artifact_exists, artifact_hash, artifact_path using SHA using SparseArrays using TranscodingStreams include("errors.jl") include("models.jl") include("native.jl") include("canonica...
9af12204782f3e9eb29a209485700752d1a73026391cf5114e6ee8c549e4becb
Julia
1,509
62
# Example of neural network # using Revise using PiecewiseDeterministicMarkovProcesses, LinearAlgebra, Random, SparseArrays const PDMP = PiecewiseDeterministicMarkovProcesses const N = 100 function f(x) return x^8 end function Phi(out::Array{Float64,2}, xc, xd, parms, t::Array{Float64}) # vector field used for the...
1f49b5172a6e190971e2ee3822e483d3d46500ed410a4a89b09067c8298c5dc8
Julia
1,534
54
function makesmallparameters(;h₂=nothing, E = 2.65 * 10^3) ℓ_min = 1.5 * 10^(-6) h₀_min = 0.04 * 10^(-6) t_min = 2 * 10^(-6) w_min = 10 * 10^(-6) ε₀ = 7.0 / 18.0 η = 0.693 * 10^(-4) ν = 0.5 h₂ = isnothing(h₂) ? 0.02 * 10^(-6) : h₂ baseparams = ComponentArray(t=t_min, h₀=h₀_min, h...
aeb5f5dd6381599150dce8f09625bf9b6dac672f3468681324889ea84bdccf41
Julia
1,581
52
const FIXTURES = joinpath(@__DIR__, "fixtures") read_json(path...) = JSON3.read( read(joinpath(FIXTURES, path...)), Dict{String,Any}, ) function seed_conformance_cache(cache_dir) selector = read_json("registry", "selector.json") index = read_json("registry", "index.json") registry_dir = joinpath(c...
4ed43a186ecdd9b8bc8a123f677c0f83c85cc5ff3e498f320c3940a03905b1da
Julia
1,609
67
using PiecewiseDeterministicMarkovProcesses, Random, OrdinaryDiffEq const PDMP = PiecewiseDeterministicMarkovProcesses function F_tcp!(ẋ, xc, xd, parms, t) if mod(xd[1],2)==0 ẋ[1] = 1.0 ẋ[2] = -1.0 * xc[2] else ẋ[1] = -1.0 * xc[1] ẋ[2] = 1.0 end nothing end R(x) = x function R_tcp!(rate, xc, xd, pa...
4de119e9d7164709f20ceba80241c4b7b3560551453e6cd8641c3d33dff7f928
Julia
1,641
41
abstract type DatamongerError <: Exception end abstract type RegistryError <: DatamongerError end abstract type RetrievalError <: DatamongerError end macro define_error(name, parent) quote struct $(esc(name)) <: $(esc(parent)) message::String end Base.showerror(io::IO, error::$(...
32d7d566b2fc9f6abc746be580e0444a51b66c450fb807ed3f0ad0b7882283eb
Julia
1,646
30
@testset "preprocessing metadata contract" begin cache_dir = mktempdir() seeded = seed_conformance_cache(cache_dir) baseline = fetch_data("conformance:mixed_csv@1"; registry=seeded.selector, cache_dir, offline=true, return_info=true) for case in read_json("conformance", "preprocessing.json")["ca...
cf7c14f90ef907c5318613fa3565db1684d53d45c933e0539a423a5cd2057a05
Julia
1,759
82
using Plots, Plots.PlotMeasures using ComponentArrays using LaTeXStrings #include("../src/prebent_Anneline_model.jl") include("../src/funnel_endfeet_model.jl") include("../src/makeparametersets.jl") include("../src/plotfunctions.jl") LuYoungs = 0.5 * 1e3 small_parameters_verysoft = makesmallparameters(E=LuYoungs) larg...
53973ad278cca0db4ba9fa65a1b2a00f4719f0171c923be25e38a159ab2a4f48
Julia
1,838
53
_kind(::LogicalVector) = "vector" _kind(::LogicalDenseMatrix) = "dense_matrix" _kind(::LogicalSparseMatrix) = "sparse_matrix" _logical_type(component::Union{LogicalVector,LogicalDenseMatrix}) = component.logical_type _logical_type(::LogicalSparseMatrix) = "float64" function component_from_descriptor(descriptor::Abstra...
7f4d5b709d4f3a08f2364c761e32c6da39bc7409d5c5d89acb3648097909c5d1
Julia
1,861
48
using JSON, PiecewiseDeterministicMarkovProcesses, LinearAlgebra, Random const p0 = convert(Dict{AbstractString,Float64}, JSON.parsefile("../examples/ml.json")["type II"]) const p1 = ( JSON.parsefile("../examples/ml.json")) include("morris_lecar_variables.jl") const p_ml = ml(p0) function F_ml!(xcdot, xc, xd, parms...
c008343c5a979a8c782a4e0be3bc243def0319de8a43b9d656f000d9cdb3fb89
Julia
1,879
50
""" $(SIGNATURES) Plotting function # Arguments - `tt` times - `xc` continuous variable - `xd` discrete variable - `s::Symbol = :ampa` which variable to plot. Must be `:ampa, :nmda, :vgcc_t, :vgcc_r, :vgcc_l` or `:Vsp,:Vdend,:Vsoma,:λ,:ImbufCa,:Ca,:Dye,:CaM0,:CaM2C,:CaM2N,:CaM4,:mCaN,:CaN4,:mKCaM,:KCaM0,:KCaM2N,:KCaM...
0bcb442ecfba6969bc5a4dd137b35807204d9c8d2ce30e53cef978325347d8ac
Julia
1,890
79
using PiecewiseDeterministicMarkovProcesses, Test, LinearAlgebra, Random, OrdinaryDiffEq macro testS(label, args...) :(@testset $label begin @test $(args...); end) end include("simpleTests.jl") @testset "Example TCP" begin include("../examples/tcp.jl") @test norm(errors[6:end], Inf64) < 1e-4 end @testset "Exampl...
e0c4144e4080c2e89cee1e662fdcdc0e9706abc056b75c5ab0231be6b69e6d6f
Julia
1,906
86
# using Revise using PiecewiseDeterministicMarkovProcesses, LinearAlgebra, Random, OrdinaryDiffEq, Sundials const r = 10. function AnalyticalSample(xc0,xd0,ti,nj::Int64) xch = [xc0[1]] xdh = [xd0[1]] th = [ti] list_rng = Float64[] t = ti while length(th)<nj xc = xch[end] xd = xdh[end] push!(list_rng, rand...
c61f309dca16f8f5829699604e46e2c07b23ff0ec773dc33a9e5db3386d6a7af
Julia
1,964
70
# using Revise using OrdinaryDiffEq, LinearAlgebra, Random import PiecewiseDeterministicMarkovProcesses as PDMP function F_eva!(xcdot, xc, xd, parms::Vector{Float64}, t::Float64) # vector field used for the continuous variable xcdot[1] = -(xc[1] - 1.5) nothing end function R(x) return x^4 end functio...
e7a293e41297e27fc01b258dbed4833b8c34657aa5b019d2be40694308806b10
Julia
1,966
50
function calcDegradationRates(labeledData::Matrix{Float32}, totalData::Matrix{Float32}, labelingTime::AbstractVector) #get slope for each gene's new to total RNA for each time group labelingTimeCat = CategoricalArray(labelingTime) slopes = Array{Float32}(undef, size(labeledData)[1], length(levels(label...
4787e346c446e6a32d17a54e8f8a631a9ab7444b6dfa092d18ac969a7ff42805
Julia
2,109
97
using Revise using PiecewiseDeterministicMarkovProcesses, LinearAlgebra, Random, OrdinaryDiffEq, Sundials, OrdinaryDiffEqSDIRK, OrdinaryDiffEqRosenbrock, OrdinaryDiffEqBDF # LSODA const PDMP = PiecewiseDeterministicMarkovProcesses function AnalyticalSampleCHV(xc0, xd0, ti, nj::Int64) xch = [xc0[1]] ...
f8612acd5f23dbbc9e9243260c511308e24f1ffbd05343ee2a57ce110ffa49c1
Julia
2,512
94
# using Revise using PiecewiseDeterministicMarkovProcesses, LinearAlgebra, Random, OrdinaryDiffEq, Sundials, OrdinaryDiffEqRosenbrock const PDMP = PiecewiseDeterministicMarkovProcesses function AnalyticalSample(xc0, xd0, ti, nj::Int64) xch = [xc0[1]] xdh = [xd0[1]] th = [ti] t = ti while length(th)<nj xc = xch...
bceb4b829c956014b297725806fe382aa6e3c8124bd256a502856840d29aef15
Julia
2,539
63
include("helpers.jl") @testset "canonical form" begin document = read_json("conformance", "canonical", "cases.json") @test document["schema_version"] == 1 @test document["canonical_form"] == 1 for case in document["cases"] component = Datamonger.component_from_descriptor(case["component"]) ...
ead4fe359aeee136716dcdfeb1ff101b01a126b789c5c64e7cb437dbecaa9eba
Julia
2,549
79
""" Finalising function. It is called at the end of each computed jump for the user to alter the saving, plotting... procedure. """ finalize_dummy(rate, xc, xd, p, t) = nothing """ Function to pre-allocate arrays contening the result. """ function allocate_arrays(ti ,xc0, xd0, n_max; rejection = false, ind_save_c=-1:1...
8cdfcf93576284c633e2236df07a1f88461dd2acf09478bbce26636ca6690230
Julia
2,584
56
using Test @unpack ( parameters_small_stiff, parameters_small_mean, parameters_small_soft, parameters_large_stiff, parameters_large_mean, parameters_large_soft, ) = makesoftstifflargesmallparametersets() @testset "Δp₀" begin @test 83.753086 ≈ calcΔp₀(parameters_small_mean) end @testset "...
416ee5d70121fb5dc56f58a10d618605e219c15424ec0e4bf234e72e7e96902c
Julia
2,752
66
using Revise, PiecewiseDeterministicMarkovProcesses, LinearAlgebra, Random, OrdinaryDiffEq, Sundials const PDMP = PiecewiseDeterministicMarkovProcesses function F_fd!(ẋ, xc, xd, parms, t) # vector field used for the continuous variable if mod(xd[1], 2) == 0 ẋ[1] = 1 + xd[1] else ẋ[1] = -xc[1] end nothing end ...
2555944a45d9e7a3ebd886b393e18c4b02d3d70cf12b2b7b9a822d735068c1c3
Julia
2,778
53
function _preprocessing_metadata(dataset) haskey(dataset, "preprocessing") || return nothing fail(message) = throw(UnsupportedRegistryError(message)) function nonempty(value, field) text = _require_string(value, field) isempty(text) && fail("$field must not be empty") return text ...
5f9e463fe6cc04dd8e653acd2829272a2dc0ee80c466af02ba68f5e89d872761
Julia
2,913
69
abstract type AbstractRate end # These are different structs introduced to deal with the case where the rate function is constant in between jumps: this are defined through the following type `ConstantRate`. This leads us to treat the case where the user can provide two rate functions, the first one being a `ConstantR...
653996946ee89bd57976159791f4370851feeb2b2f631ac5d726ca41638946b4
Julia
2,943
53
_split_component_name(split, component) = join( (replace(s, "~" => "~0", "/" => "~1") for s in (split, component)), "/") function _split_recipes(representation) fail(message) = throw(UnsupportedDecoderError(message)) get(representation, "decoder_version", nothing) === 1 || fail("unsupported named-splits ve...
9bfb2dfb0efc08d94c810d03731c33276f6b113c5160db1a15c1fa94fd19a080
Julia
3,015
92
@testset "registry selection" begin digest = repeat("a", 64) selected = Registry("candidate-0002", digest, "https://example.com/index.json") @test selected.schema_version == 1 @test_throws RegistryIntegrityError Registry( "candidate", "ABC", "https://example.com/index.json", ...
ba81f6a74b6518c34ed3046a0cfdfd89a80f04f15f19f40f0255d6979c46ff78
Julia
3,034
105
""" $(SIGNATURES) The reactions described in this function were taken from Chang et al. 2019. The tag simpler refers to the simplest implementation proposed by Chang. Note also that Calcineurin is added to reactions below. """ ChangCaMKII_simpler = @reaction_network begin @parameters kf_2C kb_2C kf_2N kb_2N kf_CaM0 ...
867280116476363331feb063d71fbecb87e5279a8679868f5e987a3611756cf4
Julia
3,250
73
using JumpProcesses: AbstractAggregatorAlgorithm, NullAggregator PDMPProblem(prob,jumps::JP.ConstantRateJump;kwargs...) = PDMPProblem(prob,JumpSet(jumps);kwargs...) PDMPProblem(prob,jumps::JP.VariableRateJump;kwargs...) = PDMPProblem(prob,JumpSet(jumps);kwargs...) PDMPProblem(prob,jumps::JP.RegularJump;kwargs...) = PD...
c8cfb46147aa38335042c8484b53b57b7d60c20a37bf45af725e9ab653e56b62
Julia
3,284
142
######### jumps matrix function stp_build_transition_matrix() matrix_list = [Matrix{Int64}(I,1,1), STP_matrix()] return jump_matrix(matrix_list) end # Catalyst uses transposed transition matrix since version > 8.3 get_stoichmatrix(model) = transpose(Catalyst.netstoichmat(model)) |> Matrix jump_matrix(matrix_list) = ...
253571cbe5e4f5e616b2781692032031b7f02cdd3e8c493f57c3a3cdeb9fe60d
Julia
3,379
116
# nspeedfactor = 1, speed up Kdr channel rates @inline alpha_n(V, nspeedfactor = 1) = nspeedfactor * exp(-0.11 * (V - 13) ) @inline beta_n(V, nspeedfactor = 1) = nspeedfactor * exp(-0.08 * (V - 13) ) @inline alpha_m(V) = 0.4 * (V + 30) / (1 - exp(-(V + 30)/7.2)) @inline beta_m(V) = 0.124 * (V + 30) / (exp((V + 30)/...
72620f87790dc39db9c72536b862c22b7a9c755caac66530f88b6f5762b3dc56
Julia
3,721
137
using Plots, Plots.PlotMeasures using ComponentArrays using LaTeXStrings include("../src/funnel_endfeet_model.jl") include("../src/makeparametersets.jl") include("../src/plotfunctions.jl") @unpack ( parameters_small_stiff, parameters_small_mean, parameters_small_soft, parameters_large_stiff, parame...
052770786401dda9a552259371a72bd510e2248fd74d0f93c416899deba06fb6
Julia
3,736
100
cd(@__DIR__) using Pkg pkg"activate synapse" using Revise, SynapseElife, Random, Plots, PiecewiseDeterministicMarkovProcesses, ColorSchemes, Sundials ############# Initials ################################################## data_protocol = dataProtocol("TigaretMellor16") colorss = ColorSchemes.coolwar...
236985fc61334d1c9f580c0c762e6e3e0b5352bcb1e0d3fd75fc9dc12eb9ed31
Julia
3,772
97
using Revise, SynapseElife, Random, Plots, PiecewiseDeterministicMarkovProcesses, ColorSchemes, Sundials ############# Initials ################################################## function makeFigure2(;detailed::Bool = true) # extract protocols data_protocol = dataProtocol("TigaretMellor16") # make plot layou...
a53a845d7455257bb1669a1eefac8b36c4935f7ddb93ef8231b8831723cd9926
Julia
3,981
83
function _citation_metadata(dataset) provenance = _require_object(get(dataset, "provenance", Dict{String,Any}()), "provenance") haskey(provenance, "citation") && haskey(provenance, "citations") && throw(UnsupportedRegistryError("provenance cannot contain citation and citations")) if get(dataset, "sc...
6d5607ec066f0f6fa94a75d98c3a61eccfcbeccf1566d3d532338e9a71b54af7
Julia
4,017
151
using Plots#, Plots.PlotMeasures using ComponentArrays, Parameters using QuadGK function Delta_p_zero(parameters; varargs...) parameters = ComponentArray(parameters; varargs...) @unpack t, ℓ, h₀, w, η, ν, E, prebent_ratio = parameters return E * t^2 * h₀ / (2 * (1 - ν^2) * ℓ^3) end function K_factor(Δp; ...
ddd3d57f54f1613b3d84562f910c30c02583011eb8985f3eb29961f97d74664b
Julia
4,045
134
# using Revise, Test using PiecewiseDeterministicMarkovProcesses, LinearAlgebra, Random, OrdinaryDiffEq const PDMP = PiecewiseDeterministicMarkovProcesses function F!(ẋ, xc, xd, parms, t) if mod(xd[1], 2) == 0 ẋ[1] = 10xc[1] else ẋ[1] = -3xc[1]^2 end end R(x) = 10.0 + x function R!(rate, xc, xd, parms, t, iss...
777a381f3092e467a07fb18ff19eb40f7a41bc1b034b94fb727f203189b8b00a
Julia
4,065
139
using Plots, Plots.PlotMeasures using ComponentArrays, Parameters using LaTeXStrings include("../src/plotfunctions.jl") include("../src/funnel_endfeet_model.jl") include("../src/makeparametersets.jl") include("testfunnelmodel.jl") @unpack ( parameters_small_stiff, parameters_small_mean, parameters_small_so...
5539f4a8f8a1ab656f8556e1eed28aff4bf0b128eaab00ea29018b1c885f7115
Julia
4,100
116
struct RejectionExact <: AbstractRejectionExact end function solve(problem::PDMPProblem, Flow::Function; verbose::Bool = false, save_rejected = false, ind_save_d = -1:1, ind_save_c = -1:1, n_jumps = Inf64, save_positions = (false, true), save_rate = false, finalizer = finalize_dummy) verbose && println("#"^30) verbo...
24837dcb17d7509f088414a39ff1c3ab25d00988b87e25d1dd49d69d957fe829
Julia
4,444
141
### WARNING This is an old ODE solver which is not based on an iterator implementation. We keep it until LSODA has an iterator implementation """ Same as the `solve` for `CHV(::DiffEqBase.DEAlgorithm)` but for `CHV(::Symbol)`. This is an old implementation of the CHV algorithm which can be used with `:lsoda`. For all ...
ea15f612772d0f805f2d42ca161ca41950d5fd73ecdef117fcbc1ffa95728e07
Julia
4,546
87
function seed_split_case(case, cache_dir, compression="none") dataset = deepcopy(case["manifest"]) directory = joinpath(cache_dir, "objects", "sha256") mkpath(directory) for artifact in dataset["artifacts"] bytes = read(joinpath(FIXTURES, "conformance", case["artifact_paths"][artifact["name"]]))...
cc07b0a7c3b62f4b84ba91b72c471e640a9cb49ad3833029094f08706fda2202
Julia
4,591
138
#utility functions for RNAForecaster #filtering expression count matrices """ `filterByZeroProp(t0Counts::Matrix{Float32}, t1Counts::Matrix{Float32}, zeroProp::Float32)` Filter by zero proportion for both genes and cells. Very high sparsity prevents the neural network from achieving a stable solution. # Required...
a54fb23d3d77fa60d3e05713718b9218f59be1d33c06bdc9ef174497ddc8aa89
Julia
4,767
143
# using Revise using PiecewiseDeterministicMarkovProcesses, LinearAlgebra, Random, OrdinaryDiffEq, Sundials, OrdinaryDiffEqBDF const PDMP = PiecewiseDeterministicMarkovProcesses function F_tcp!(ẋ, xc, xd, parms, t) # vector field used for the continuous variable if mod(xd[1],2) == 0 ẋ[1] = 1.0 else ẋ[1] = -10...
2b3d245769353afbc7b444722f99ea5bec5cb16bb2d42a4bfaeef19cb4bb55a0
Julia
4,864
192
using Plots#, Plots.PlotMeasures using ComponentArrays, Parameters using QuadGK function calcΔp₀(parameters) @unpack E, t, h₀, ℓ, ν = parameters return E * t^2 * h₀ / (2 * (1 - ν^2) * ℓ^3) end function calcε(parameters) @unpack ℓ, h₀, t = parameters return ℓ * h₀ / t^2 end function calcθ(Δp; paramete...
82f11f2d36ef8edcd105055c2993fd280493a03e59c3320f21450faba4411394
Julia
5,162
167
using LSODA using PiecewiseDeterministicMarkovProcesses, Plots, LinearAlgebra, Random function n∞(v,v₃,v₄) ξ=(v-v₃)/v₄ (1+tanh(ξ))/2 end function τ(v,v₃,v₄,ϕ) ξ=(v-v₃)/v₄ 1/(ϕ*cosh(ξ/2)) end; function m∞(v,v₁,v₂) (1+tanh((v-v₁)/v₂))/2 end function α(v,v₃,v₄,ϕ) ξ=(v-v₃)/v₄ ϕ*cosh(ξ/2)/(1+exp(-2*ξ))...
e7532ab3647a8bc8deb2ed7a7984bbc38e1a56e317a2746c33a8289bd48243e2
Julia
5,246
182
function makeflowplot( Δp_line_Pa, parameters, parameters_soft, parameters_stiff; color=1, label="", varargs..., ) Pa_per_mmHg = 133 normQ = maximum(calcQ.(Δp_line_Pa; parameters)) flowplot = plot( Δp_line_Pa ./ Pa_per_mmHg, calcQ.(Δp_line_Pa; parameters=parame...
98883d6fb6e6f1d4a9a3ec4a5c6ad42413b09d53d60f40ed9ea78f903df29e86
Julia
5,546
127
# Package native libraries and assemble a release's supported-platform manifest. using Pkg.Artifacts using Base.BinaryPlatforms using Libdl using TOML const JULIA_PLATFORMS = Set([ "x86_64-linux-gnu", "aarch64-linux-gnu", "x86_64-apple-darwin", "aarch64-apple-darwin", "x86_64-w64-mingw32", ]) function pack_na...
fe9b2d9419dab894de55d87f6f4c3c0cb5ca1ae0bac39571c2300e7fd7ce17f0
Julia
6,181
191
# using Revise, Test using PiecewiseDeterministicMarkovProcesses, LinearAlgebra, Random, OrdinaryDiffEq const PDMP = PiecewiseDeterministicMarkovProcesses function F!(ẋ, xc, xd, parms, t) if mod(xd[1], 2) == 0 ẋ[1] = 10xc[1] else ẋ[1] = -3xc[1]^2 end end R(x) = 10.0 + x function R!(rate, xc, xd, parms, t, is...
aefad40b6cae052ce3367621bfbab1b94838672dea92ed8b674bf16360b5a31b
Julia
6,223
197
"""A release location and strong selector for one immutable registry index.""" struct Registry release::String index_sha256::String index_url::String schema_version::Int function Registry(release, index_sha256, index_url, schema_version=1) release isa AbstractString && index_sha256 isa Abst...
fabe95e8e15585f0d65737aadf3137670e0fd2a8a569171f97a426be20275925
Julia
7,066
184
struct Rejection{Tode} <: AbstractCHVIterator ode::Tode # ODE solver to use for the flow in between jumps end function (rej::Rejection{Tode})(xdot, x, prob::Tpb, t) where {Tode, Tpb <: PDMPCaracteristics} prob.F(xdot, x, prob.xd, prob.parms, t) return nothing end ####################################################...
00d70bea56a0370ea5e3a3ace76aecf704ac7d58c288ace2f0956c8d1f0043a6
Julia
7,219
190
const _KIND_TAGS = Dict("vector" => 0x01, "sparse_matrix" => 0x02, "dense_matrix" => 0x03) const _TYPE_TAGS = Dict("float64" => 0x01, "int64" => 0x02, "string" => 0x03, "bool" => 0x04) _kind(::LogicalVector) = "vector" _kind(::LogicalDenseMatrix) = "dense_matrix" _kind(::LogicalSparseMatrix) = "sparse_matrix" _logical...
adacbcff091eeecf7c6eeea5c79e75855e3edb0b023b05dd4176f1585f46caa2
Julia
7,519
141
function _validate_delimited_options(options::AbstractDict) required = Set(["encoding", "delimiter", "header", "quote", "escape", "row_order", "columns"]) allowed = union(required, Set(["missing_values"])) keys_set = Set(String.(keys(options))) issubset(required, keys_set) && issubset(keys_set, allowed)...
c6ab5e33929afdc39d0329cf7788744b4ceed0632ed91019800f9d908a699450
Julia
7,560
191
@testset "shared decoder conformance" begin document = read_json("conformance", "cases.json") @test document["schema_version"] == 1 @test document["canonical_form"] == 1 for case in document["cases"] recipe = case["recipe"] decoded = if case["decoder"] == "delimited-text" Dat...
05e72cb54b0d3d012b9ab8c13927663066768382f73669fa757a17f9ae981395
Julia
7,577
241
# using Revise using PiecewiseDeterministicMarkovProcesses, LinearAlgebra, Random, OrdinaryDiffEq, Test const PDMP = PiecewiseDeterministicMarkovProcesses function AnalyticalSampleCHV(xc0, xd0, ti, nj::Int64) xch = [xc0[1]] xdh = [xd0[1]] th = [ti] t = ti while length(th)<nj xc = xch[end] xd = xdh[end] S =...
d8d9b2162b2b525aba201b62a73dca0726ae77bbec6c040a83a04bcce1dd5add
Julia
7,913
193
using SparseArrays, PreallocationTools # Dummy functions to allow not specifying these characteristics function F_dummy(ẋ, xc, xd, parms, t) fill!(ẋ, 0) nothing end # Dummy flow to be used in rejection algorithm function Phi_dummy(out, xc, xd, parms, t) # vector field used for the continuous variable # trivial dy...
a5adb13377be64d908134a4c780bb342dafb1ae910f3342bdd9d645b1bff4ffe
Julia
8,189
250
@testset "cache inventory and cleaning" begin cache_dir = mktempdir() directory = joinpath(cache_dir, "objects", "sha256") mkpath(directory) bytes = Vector{UInt8}(codeunits("artifact")) digest = bytes2hex(sha256(bytes)) write(joinpath(directory, digest), bytes) corrupt_digest = bytes2hex(sha...
4c417622889025f5ea1a45e360241eef86f5ec8d2d37d252750382ee70312814
Julia
8,409
225
""" $(SIGNATURES) Calcium-dependent sigmoid for the vesicle release test. # Arguments - `Ca_pre` phenomenological presynaptic calcium - `nhill` steepness of the sigmoid - `K` h-activation value """ @inline function releaseProbaSTP(Ca_pre, nhill, K) return Ca_pre^nhill / (Ca_pre^nhill + K^nhill) end """ $(SIGNATURE...
5e6805832649bf25f5c2e5ccdbb2240531fcbe9c4ff52b2a738351d38b89b4a7
Julia
9,257
227
# These isbits layouts mirror C ABI 1 in datamonger.h. All input buffers are # rooted through each call, and every result is copied before its Rust owner dies. struct _NativeBytes data::Ptr{UInt8} len::Csize_t end _NativeBytes(value::Union{String,Vector{UInt8}}) = _NativeBytes(pointer(value), sizeof(value)) con...
6dca7d1d08c18867ab6dc81ec3ee5368d47c8189ed8def21ae16cfc4d6e5817b
Julia
9,484
213
""" `predictCellFutures(trainedNetwork, expressionData::Matrix{Float32}, tSteps::Int; perturbGenes::Vector{String} = Vector{String}(undef,0), geneNames::Vector{String} = Vector{String}(undef,0), perturbationLevels::Vector{Float32} = Vector{Float32}(undef,0), enforceMaxPred::Bool = true, maxPrediction::Fl...
0651df5d6623d86ce442ea1d76ffa0999d7e6c247c9fa25840a75666b460899e
Julia
9,704
250
################################################################################################### struct CHV{Tode} <: AbstractCHVIterator ode::Tode # ODE solver to use for the flow in between jumps end function (chv::CHV)(xdot, x, caract::PDMPCaracteristics, t) tau = x[end] rate = get_tmp(caract.ratecache, x) sr...
43bbe7e02e5cad6d0a087d46f487de3fa73c5868c6eb31069513bd9df9862969
Julia
11,117
268
""" `perturbEffectPredictions(trainedNetwork, splicedData::Matrix{Float32}, nCells::Int; perturbGenes::Vector{String} = Vector{String}(undef, 0), geneNames::Vector{String} = Vector{String}(undef,0), seed::Int=123)` Based on spliced/unspliced counts, predict the immediate transcriptomic effect of any or all s...
2c01e01e3ea4924e29e971204f389c7e86f7dd3b20928d60ab253cb3e45ef06d
Julia
11,135
254
const _IDENTIFIER_PATTERN = r"^[a-z0-9][a-z0-9._-]*$" const _VERSION_PATTERN = r"^[A-Za-z0-9][A-Za-z0-9._+-]*$" const _RELEASE_PATTERN = _IDENTIFIER_PATTERN const DEFAULT_CATALOG_URL = "https://raw.githubusercontent.com/jolars/datamonger/main/registry/catalog.json" function _is_http_url(value; https_only=false) ...
c998f8f64501d63087c2548c0b49525d7471d010c2a1e8694fe59adaa1cba792
Julia
11,521
298
@testset "dataset references" begin cache_dir = mktempdir() seeded = seed_conformance_cache(cache_dir) selections = [ ("mixed_csv", (; source="conformance")), ("conformance:mixed_csv", (;)), ("conformance:mixed_csv", (; version="1")), ("conformance:mixed_csv@1", (;)), ] ...
746a42c2069f08eb61704728d516603b520bacdf58dc601ddca52020a91b1c34
Julia
12,162
250
include("reference/Reference.jl") function compare_components(actual, expected) @test length(actual) == length(expected) for (a, e) in zip(actual, expected) @test typeof(a) == typeof(e) @test a.name == e.name # Broadcasting over an empty Any[] leaves the old internal string # bu...
34674c6494a813c3f879fdd0b870cb03791b3fb09f94f848d8ca14fe8c0c1715
Julia
14,346
339
const _FLOAT_PATTERN = r"^-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)?$" const _SVM_FLOAT_PATTERN = r"^[+-]?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)?$" const _INT_PATTERN = r"^-?(0|[1-9][0-9]*)$" const _SVM_INT_PATTERN = r"^[+-]?(0|[1-9][0-9]*)$" const _INDEX_PATTERN = r"^(0|[1-9][0-9]*)$" function _decompressed_...
833a820d584f0e8ba932e7425fc41398524bbbd5da89521e54335423f3d5f307
Julia
14,395
336
using Revise, SynapseElife, Random, Plots, PiecewiseDeterministicMarkovProcesses, ColorSchemes, Sundials ############# Initials ################################################## data_protocol = dataProtocol("TigaretMellor16") ############################ Simulation 1 - panel b ################################ k ...
1df30579efe8520d68f6eaa0aeaa86116bdfffe6ce77e43841fd5361af52d926
Julia
16,677
367
function minZero(num::AbstractArray{<:Number}) num[findall(x->x < 0, num)] .= 0 num end #function to check model prediction stability for each gene function checkModelStability(model, initialConditions::Matrix{Float32}, iterToCheck::Int, expressionThreshold::Float32, useGPU::Bool, batchsize::Int) pri...
48b0e98e851200039e0d162e00796079e3be7724ea115dcfb6ced5c036a31999
Julia
18,234
405
function _require_object(value, field) value isa AbstractDict || throw(UnsupportedRegistryError("$field must be an object")) return value end function _require_array(value, field) value isa AbstractVector || throw(UnsupportedRegistryError("$field must be an array")) return value end function _require_...
d162c6a6b308b321d4aeb8b51aab5c208b58266fd06025422d46fc437295c23e
Julia
19,976
551
const _CACHE_NAMESPACES = Set(["objects", "registries"]) const _SHA256_PATTERN = r"^[0-9a-f]{64}$" const _DATASET_ID_PATTERN = r"^[a-z0-9][a-z0-9._-]*:[a-z0-9][a-z0-9._-]*@[A-Za-z0-9][A-Za-z0-9._+-]*$" const _LOCK_SH = 1 const _LOCK_EX = 2 const _LOCK_NB = 4 const _LOCK_UN = 8 mutable struct CacheLease handle:...
f010f35039b9f82b17356accf1f373ed8c2891eb2b80b32088ae3c8719239a2f
Julia
22,607
572
# New synapse model (cian, started 23/03/2018) that replaces NMDA model with fully state-based one from Jahr and Stevens, plus three types of VGCCs (R-type, T-type and L-type), from Magee and Johhston (1995). function F_synapse(xdot, pop_c, discrete_var, p_synapse::SynapseParams, t, events...
8c5d6135f8148d5b27ba7b3e9d2a0e1bd2447441b711e1ea3a21de6c8d67cca3
Julia
24,709
391
""" $(TYPEDEF) # Presynaptic parameters * Firing events are processed separately from the main simulation (at `src/OnlyStp.jl`) it takes the firing structure as input from the function [`firingPattern`](@ref). * Using the presynaptic stimulation times, the vesicle depletion and AP induced by EPSP are estimated, howev...
ce8c51f406a7d2562fb40db5eb2be39c7b2fba2d26a063ef56e972b6a41b0ff9
Julia
52,976
1,324
""" Returns the number of jumps for each component and `t ∈ stpan`. Usefull to determine who jumps the most. The syntax is as follows $(SIGNATURES) where `t` is time, `xd` the discrete component and `It` is an inferior bound on `t`. You can use it like statistics_jumps(t, out[:ampa]) """ function statistics_jumps(...
1a17397b752a10da13fe4ff648712ce2eeb48faec2baf7f9c76fa242dbaa7232
Jupyter
183
10
# %% import anndata as ad # %% #single cell peak matrix used to generate the training dataset. peak_matrix = ad.read_h5ad("./data/pbmc_data/adata_peak_matrix.h5") peak_matrix # %%
4aaca7582a5ab2c68e77b06ce8b8498981655cc60ed8640ee99a5dd346a68945
Jupyter
302
14
# %% from protfarm.workspace import Workspace as ws from protfarm.workspace import Metadata as metadata # %% EXPERIMENT_NAME = "demo" # %% ws.set_experiment(EXPERIMENT_NAME) # %% brain_samples = metadata.get_samples({"Tissue Type": "Brain"}) for sample_name in brain_samples: print(sample_name)
b65b42deb4daaffacee1c208cbe0633ed8b4475d05b1cb30fd93d4b854cd7e0a
Jupyter
435
22
# %% [markdown] # # Load model # %% import tensorflow as tf tf.enable_eager_execution() from model import DepthEstimate model = DepthEstimate() checkpoint_path = "training_1/cp.ckpt" model.load_weights(checkpoint_path) print('Model weights loaded.') # %% [markdown] # # Load and evalute on Eigen's test data # %% fr...
af31713bb6c1dcde12ecf11087e7fe3f802c15a2d8ef31be590a259d95928de9
Jupyter
465
19
# %% import numpy as np import pandas as pd import scanpy as sc import pybiomart import csv # %% annot = sc.queries.biomart_annotations( "mmusculus", ["ensembl_gene_id", "external_gene_name"], ).set_index("ensembl_gene_id") adata = sc.read("INDEX.inex.txt") adata = adata.T adata.var[annot.column...
9634ef89444fe97f59e1a2d94a2c21ef8a97b8c3a35ffd1a3f3e03c52ca05252
Jupyter
528
28
# %% [markdown] # # Find the radius of the sphere that fits inside the head model # The sphere center is at the origin # %% import trimesh import trimesh.sample import trimesh.viewer.windowed from mayavi import mlab from megsimutils.viz import _plot_anatomy, _load_anatomy, _plot_sphere # %% anat = _load_anatomy() ...
738c9e67e381c175fda0797dd6bf59a5496ad48faf2f4f44fe2e19eac2f4f9fa
Jupyter
539
23
# %% [markdown] # # Review of patientes # # Check the number of patientes with T45, TSPIDER or both. # %% import pandas as pd import numpy as np df = pd.read_excel('/srv/datos/REVISION_PACIENTES_TORTUOSIDAD.xlsx', skiprows=0, sheet_name='Hoja1') # %% df.rename(columns={'ID PACIENTE':'IdPaciente', 'T 45+SPIDER':'T45+...
027331aaf9a6eba9076f4472943350e0af96481885f5d615eb72c907572ce50f
Jupyter
561
32
# %% import numpy as np import pandas as pd import sys #https://github.com/jiaxx/ccg_jitter from ccg_jxx import get_ccgjitter import matplotlib.pyplot as plt plt.style.use('default') %matplotlib inline # %% import random def simulate_spikes(dim): # dim: [neuron, ori, rep, time] # binarized X = np.random....
7ae2291e6ef3ab764faa7224d0204ce9b08e6d5703e774849ac182c0e3928ce2
Jupyter
751
26
# %% [markdown] # <a href="https://colab.research.google.com/github/ialhashim/DenseDepth/blob/master/DenseDepth.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # %% !git clone https://github.com/ialhashim/DenseDepth.git # %% !wget https://s3-eu-wes...