Skip to content

Commit

Permalink
tests a 100 gene network
Browse files Browse the repository at this point in the history
  • Loading branch information
pmendes committed May 24, 2024
1 parent a07ec53 commit 6a9ac69
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
2 changes: 1 addition & 1 deletion tests/0024_GRNCoopSW8_001/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
33 changes: 22 additions & 11 deletions tests/0024_GRNCoopSW8_001/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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<Max) {print 0} else {print 1}}')
# check that min and max of a_synth_G_i-j are within bounds
n=$(grep -Po "^a_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>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

0 comments on commit 6a9ac69

Please sign in to comment.