From 6a9ac69d047bf18d91486666da0f6ce89ef438e0 Mon Sep 17 00:00:00 2001 From: Pedro Mendes Date: Thu, 23 May 2024 21:17:59 -0400 Subject: [PATCH] tests a 100 gene network --- tests/0024_GRNCoopSW8_001/README.md | 2 +- tests/0024_GRNCoopSW8_001/run.sh | 33 +++++++++++++++++++---------- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/tests/0024_GRNCoopSW8_001/README.md b/tests/0024_GRNCoopSW8_001/README.md index 94c19af..ab3fffd 100644 --- a/tests/0024_GRNCoopSW8_001/README.md +++ b/tests/0024_GRNCoopSW8_001/README.md @@ -8,8 +8,8 @@ a gene regulatory network of 100 genes connected according to a small-world topo - cps file reads well - network file reads well - named output file +- checks the regulated_by_2 rate law was created -- checks the regulated_by_1 rate law was created - checks that there are exactly 3 species - checks that noise worked - checks no compartments created diff --git a/tests/0024_GRNCoopSW8_001/run.sh b/tests/0024_GRNCoopSW8_001/run.sh index 3c5a7ca..0be6e32 100755 --- a/tests/0024_GRNCoopSW8_001/run.sh +++ b/tests/0024_GRNCoopSW8_001/run.sh @@ -36,32 +36,43 @@ if ((n != 100)); then 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=2){if(Min>$3) Min=$3;if(Max<$3) Max=$3} END {if(Min<-1.0 || Max>1.0) {print 1} else {print 0} }') if ((n != 0)) ; then printf 'FAIL %s\n' "${test}" let "fail = $fail + 8" fi -# check that no new compartments were created -n=$(grep -Pc "^cell_[123]\s+fixed" repressilator.summary.txt) -if ((n != 0)) ; then +# check that min and max of h_synth_G_i-j are within bounds +n=$(grep -Po "^h_synth_G_\d+-\d+\s+fixed\s+(.[0-9]+\.[0-9]+\s)" CoopSW8_001.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.0 || Max>10.0) {print 1} else {print 0} }') +if ((n != 0)) ; then printf 'FAIL %s\n' "${test}" let "fail = $fail + 16" fi -# checks that there are three synthesis reactions -n=$(grep -Pc "synthesis (G_[123])\s+-> \1\;\s+G_[123]\s+regulated_by_1" repressilator.summary.txt) -if ((n != 3)) ; then +# check that V_synth_G_i-j is positive +n=$(grep -Po "^V_synth_G_\d+\s+fixed\s+(.[0-9]+\.[0-9]+\s)" CoopSW8_001.summary.txt | awk '(NR==1){Min=$3};(NR>=2){if(Min>$3) Min=$3} END {if(Min<0.0) {print 1} else {print 0} }') +if ((n != 0)) ; then printf 'FAIL %s\n' "${test}" let "fail = $fail + 32" fi +# are there 300 reactions ? +if ! grep -Pq "Reactions\: 300 =" CoopSW8_001.summary.txt ; then + printf 'FAIL %s\n' "${test}" + let "fail = $fail + 64" +fi + +# check that no new compartments were created +n=$(grep -Pc "^cell_[123]\s+fixed" CoopSW8_001.summary.txt) +if ((n != 0)) ; then + printf 'FAIL %s\n' "${test}" + let "fail = $fail + 128" +fi + if [ "$fail" = 0 ] ; then printf 'PASS %s\n' "${test}" - rm repressilator.summary.txt output *.cps + rm CoopSW8_001.summary.txt output *.cps fi exit $fail