-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
set namespace as experimental feature
- Loading branch information
Evgeny Metelkin
committed
Nov 14, 2019
1 parent
820353e
commit ae79404
Showing
12 changed files
with
269 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
|
||
pmid @ReferenceDefinition { | ||
prefix: "https://pubmed.org", | ||
suffix: / | ||
}; | ||
|
||
pow @FunctionDefinition { | ||
args: [x, y], | ||
expr: x^y | ||
}; | ||
|
||
kDa @UnitDefinition {components: [ | ||
{kind: g, multiplier: 1e3, exponent: 1}, | ||
{kind: mole, exponent: -1} | ||
]}; | ||
|
||
avogadro @Const { | ||
num: 6e23, | ||
free: false | ||
}; | ||
|
||
x @Record { | ||
title: "This is x title", | ||
units: items/mole, | ||
boundary: true, | ||
assignments: { | ||
start_: 1 | ||
} | ||
}; | ||
|
||
s @Species { | ||
units: mM, | ||
isAmount: false, | ||
boundary: false, | ||
assignments: { | ||
start_: 0 | ||
}, | ||
compartment: comp1 | ||
}; | ||
comp1 @Compartment { | ||
units: L, | ||
assignments: { | ||
start_: 5.3 | ||
} | ||
}; | ||
r1 @Reaction { | ||
units: mmole/min | ||
assignments: { | ||
ode_: k1*comp1*s | ||
} | ||
actors: 'a=>', | ||
modifiers: ['b'] | ||
}; | ||
|
||
// simulations | ||
|
||
simple_task1 @SimpleTask { | ||
model: sp1, // reference to space | ||
subtasks: [ | ||
{saveat: [1,2,3], output_ids: [A, B, C]} | ||
{saveat: [4,5,6], output_ids: [C]} | ||
], | ||
type: simulation, | ||
reassign: { // update constant values | ||
const1: 3, | ||
const2: 4.4 | ||
}, | ||
tspan: [0, 120], // time range | ||
solver: { | ||
alg: Rosenbrock23, | ||
reltol: 1e-6, | ||
abstol: 1e-12, | ||
maxiters: 1e7, | ||
dtmax: 0.1, | ||
tstops: [] // force calculation in time points | ||
}, | ||
data: {}, | ||
reduce: {} | ||
}; | ||
|
||
simple_task2 @SimpleTask { | ||
model: sp1, | ||
subtasks: [ | ||
{saveat: [4,5,6]} | ||
] | ||
}; | ||
|
||
multi_task1 @MultiTask { // unscoped | ||
task_vec: [simple_task1, simple_task2], | ||
sizes: {k1: 1, k2: 2} | ||
}; | ||
|
||
// === fitting === | ||
dts1 @SimpleData { | ||
output_ids: [A, B, C], // depDataMarkers | ||
indepData: ['t'], // indepDataMarker | ||
t: [1, 2, 3], // indepData | ||
val: [ // depData | ||
[1, 1, 1], | ||
[1, 1, 1], | ||
[1, 1, 1] | ||
], | ||
evid: [0, 0, 0] | ||
} | ||
|
||
l1 @SimpleTask { | ||
model: sp1, | ||
sizes: {} | ||
subtasks: [{ | ||
data: dts1 | ||
reduce: ln_loss2 | ||
}], | ||
reduce: sum | ||
}; | ||
l2 @SimpleTask { | ||
model: sp1, | ||
sizes: {dose: 1} | ||
subtasks: [{ | ||
data: dts2 | ||
reduce: ln_loss2 | ||
}], | ||
reduce: sum | ||
}; | ||
|
||
likelihood_sum @MultiTask { | ||
tasks: [l1, l2], | ||
reduce: sum | ||
}; | ||
|
||
fitting_task1 @FittingTask { | ||
inter_task: likelihood_sum, | ||
fit_sizes: [k1, k2, k3], | ||
fitter_opt: { | ||
alg: LN_NELDERMEAD | ||
} | ||
}; | ||
|
||
dts1 @Observation { | ||
kind: KineticsObservation, | ||
indepDataMarker: t, | ||
indepData: [0.1, 0.2, 0.3, 0.4, 0.5], | ||
depDataMarkers: [x, y, z, s], | ||
depData: [ | ||
[0, 0, 0, 0], | ||
[0, 0, 0, 0], | ||
[0, 0, 0, 0], | ||
[0, 0, 0, 0], | ||
[0, 0, 0, 0] | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
// base syntax | ||
|
||
ns1::var1 @Type1 'some title' { key1: string value, key2: 1.2, key3: true }; | ||
|
||
// Component updates | ||
|
||
// created component | ||
mod1::A @Species { compartment: comp1 }; | ||
// can be updated with the following code | ||
mod1::A { compartment: comp2, isAmount: true }; | ||
|
||
// Namespaces | ||
|
||
mod1::A @Species { compartment: comp1 }; | ||
mod2::A @Record .= 1.1; | ||
|
||
// Syntax sugar | ||
|
||
one::c1 @Compartment; | ||
one::c1 .= 10; // set initial value to 10 | ||
one::c1 := x*y; // calculates its value at each time point | ||
one::c1 [sw1]= 4; // change its value to 4 after sw1 event | ||
|
||
// blocks | ||
|
||
namespace mod1 begin | ||
A @Species { compartment: comp1 }; | ||
B @Species { compartment: comp1 }; | ||
end; | ||
|
||
// comments | ||
|
||
// Line comments | ||
/* Multiline | ||
comment */ | ||
|
||
// import | ||
|
||
#import { source: module1.heta, type: heta }; |
Oops, something went wrong.