diff --git a/tests/0024_GRNCoopSW8_001/README.md b/tests/0024_GRNCoopSW8_001/README.md new file mode 100644 index 0000000..94c19af --- /dev/null +++ b/tests/0024_GRNCoopSW8_001/README.md @@ -0,0 +1,16 @@ +# 0024_GRNCoopSW8_001 + +a gene regulatory network of 100 genes connected according to a small-world topology, from the AGN suite + +## tests + +- 1D, 100 units, network, GRN +- cps file reads well +- network file reads well +- named output file + +- checks the regulated_by_1 rate law was created +- checks that there are exactly 3 species +- checks that noise worked +- checks no compartments created +- checks that there are three synthesis reactions diff --git a/tests/0024_GRNCoopSW8_001/run.sh b/tests/0024_GRNCoopSW8_001/run.sh new file mode 100755 index 0000000..3c5a7ca --- /dev/null +++ b/tests/0024_GRNCoopSW8_001/run.sh @@ -0,0 +1,67 @@ +#!/bin/bash + +# work out our folder name +test=${PWD##*/} # to assign to a variable +test=${test:-/} # to correct for the case where PWD=/ + +# run sbmodelr +../../sbmodelr -g G --cn 2 uni --grn-a -1 --grn-h 8 --grn-V 2 -n ../sources/CoopSW8_001.dot -o CoopSW8_001.cps --ignore-compartments ../sources/GeneExpressionUnit.cps 100 > output + +fail=0 + +# compare output and target +difference=$(diff output target_stdout) +if [[ $difference ]]; then + printf 'FAIL %s\n' "${test}" + fail=1 +fi + +# create model summary +../model_report.py CoopSW8_001.cps >/dev/null +if ! [[ $? = 0 ]]; then + printf 'FAIL %s\n' "${test}" + exit -1 +fi + +# check that there is one rate law for regulation by 2 +if ! grep -Pq "^regulated_by_2\s+V \* \( \( 1 \+ \( 1 \+ a1 \) \* M1 \^ h1 \) \/ \( 1 \+ M1 \^ h1 \) \) \* \( \( 1 \+ \( 1 \+ a2 \) \* M2 \^ h2 \) \/ \( 1 \+ M2 \^ h2 \) \)" CoopSW8_001.summary.txt; then + printf 'FAIL %s\n' "${test}" + let "fail = $fail + 2" +fi + +# check that there are 100 species +n=$(grep -Pc "^G_\d+\s+reactions\s+\d+\.\d+" CoopSW8_001.summary.txt) +if ((n != 100)); then + printf 'FAIL %s\n' "${test}" + let "fail = $fail + 4" +fi + +exit $fail + +# check that min and max of initial concentrations are different (meaning noise worked!) +n=$(grep -Po "^G_[123]\s+reactions\s+([0-9]+\.[0-9]+\s)" repressilator.summary.txt | awk '(NR==1){Min=$3;Max=$3};(NR>=2){if(Min>$3) Min=$3;if(Max<$3) Max=$3} END {if(Min \1\;\s+G_[123]\s+regulated_by_1" repressilator.summary.txt) +if ((n != 3)) ; then + printf 'FAIL %s\n' "${test}" + let "fail = $fail + 32" +fi + +if [ "$fail" = 0 ] ; then + printf 'PASS %s\n' "${test}" + rm repressilator.summary.txt output *.cps +fi + +exit $fail diff --git a/tests/0024_GRNCoopSW8_001/target_stdout b/tests/0024_GRNCoopSW8_001/target_stdout new file mode 100644 index 0000000..cca054f --- /dev/null +++ b/tests/0024_GRNCoopSW8_001/target_stdout @@ -0,0 +1,9 @@ +Processing ../sources/GeneExpressionUnit.cps + Reactions: 2 + Species: 1 (Reactions: 1, Fixed: 0, Assignment: 0, ODE: 0) + Compartments: 1 (Fixed: 1, Assignment: 0, ODE: 0) + Global quantities: 0 (Fixed: 0, Assignment: 0, ODE: 0) + Events: 0 (Only time-dependent: 0, variable-dependent: 0) + Network: directed (Nodes: 100, Edges: 200) +created new model CoopSW8_001.cps with a set of 100 replicas of ../sources/GeneExpressionUnit.cps +