-
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.
- Loading branch information
Showing
3 changed files
with
78 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# 0027_PulsedDrugNotes | ||
|
||
creates a set of 2 units of the PulsedDrug model | ||
|
||
## tests | ||
|
||
- 1D, 2 units, events, notes | ||
- cps file reads well | ||
- produces no warning or error | ||
- tests -o option to name output file | ||
- checks that compartment notes were copied | ||
- checks that species notes were copied | ||
- checks that global quantity notes were copied | ||
- validates the model with CopasiSE |
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,54 @@ | ||
#!/bin/bash | ||
|
||
# work out our folder name | ||
test=${PWD##*/} # to assign to a variable | ||
test=${test:-/} # to correct for the case where PWD=/ | ||
|
||
fail=0 | ||
|
||
# run sbmodelr | ||
../../sbmodelr -t drug --pn Drug_dose 0.5 uni -n ../sources/twins.gv -o PD2.cps ../sources/PulsedDrug.cps 2 > output | ||
|
||
# compare output and target | ||
difference=$(diff output target_stdout) | ||
if [[ $difference ]]; then | ||
printf 'FAIL %s\n' "${test}" | ||
fail=1 | ||
fi | ||
|
||
# poor man's way of checking existence of notes: grepping the cps file... | ||
|
||
# check that there are two notes for the compartment | ||
n=$(grep -c "a location within which every species is well mixed" PD2.cps) | ||
if ((n != 2)) ; then | ||
printf 'FAIL %s\n' "${test}" | ||
let "fail = $fail + 2" | ||
fi | ||
|
||
# check that there are two notes for the S species | ||
n=$(grep -c "fixed substrate" PD2.cps) | ||
if ((n != 2)) ; then | ||
printf 'FAIL %s\n' "${test}" | ||
let "fail = $fail + 4" | ||
fi | ||
|
||
# check that there are two notes for the Drug_dose global quantity | ||
n=$(grep -c "<p>the <i>amount</i> of drug added each time</p></body>" PD2.cps) | ||
if ((n != 2)) ; then | ||
printf 'FAIL %s\n' "${test}" | ||
let "fail = $fail + 8" | ||
fi | ||
|
||
# validate the model with CopasiSE | ||
../CopasiSE -c . --nologo --validate PD2.cps > /dev/null 2>&1 | ||
if ! [[ $? = 0 ]]; then | ||
printf 'FAIL %s\n' "${test}" | ||
let "fail = $fail + 16" | ||
fi | ||
|
||
if [ "$fail" = 0 ] ; then | ||
printf 'PASS %s\n' "${test}" | ||
rm PD2.cps output > /dev/null 2>&1 | ||
fi | ||
|
||
exit $fail |
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,10 @@ | ||
Processing ../sources/PulsedDrug.cps | ||
Reactions: 3 | ||
Species: 5 (Reactions: 3, Fixed: 2, Assignment: 0, ODE: 0) | ||
Compartments: 1 (Fixed: 1, Assignment: 0, ODE: 0) | ||
Global quantities: 5 (Fixed: 5, Assignment: 0, ODE: 0) | ||
Events: 2 (Only time-dependent: 0, variable-dependent: 2) | ||
Network: undirected (Nodes: 2, Edges: 1) | ||
|
||
created new model PD2.cps with a set of 2 replicas of ../sources/PulsedDrug.cps | ||
|