Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some clean-up stuff #5

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Files created by OS
.DS_Store
desktop.ini
.directory

# Things visual studio code creates
.vscode

# Some editors create a yourfile.name~ file as a backup file
.py~
.ivy~
.sm~
.prism~
.csl~
.xml~
.bak

# Python distribution files
.Python
__pycache__/
.pyc
File renamed without changes.
File renamed without changes.
Binary file removed scripts/__pycache__/depgraph.cpython-310.pyc
Binary file not shown.
Binary file removed scripts/__pycache__/depgraph.cpython-39.pyc
Binary file not shown.
Binary file removed scripts/__pycache__/prefix_parser.cpython-310.pyc
Binary file not shown.
Binary file removed scripts/__pycache__/prefix_parser.cpython-39.pyc
Binary file not shown.
Binary file removed scripts/__pycache__/reactions_v5.cpython-310.pyc
Binary file not shown.
Binary file removed scripts/__pycache__/reactions_v5.cpython-39.pyc
Binary file not shown.
49 changes: 35 additions & 14 deletions scripts/admin.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,35 @@
cp ../models/SingleSpecies/2reaction.ragtimer ../model.ragtimer
cp ../models/SingleSpecies/model.sm ../model.sm
cp ../models/SingleSpecies/model.csl ../model.csl
/usr/bin/time -o ../results/ragtimer/2reaction_50000time.txt python3 main.py 50000 loose &> ../results/ragtimer/2reaction_50000.txt

cp ../models/KuwaharaEnzyme/6reaction.ragtimer ../model.ragtimer
cp ../models/KuwaharaEnzyme/model.sm ../model.sm
cp ../models/KuwaharaEnzyme/model.csl ../model.csl
/usr/bin/time -o ../results/ragtimer/6reaction_50000time.txt python3 main.py 50000 loose &> ../results/ragtimer/6reaction_50000.txt

cp ../models/DonovanYeastPolarization/8reaction_input_adding.txt ../model.ragtimer
cp ../models/DonovanYeastPolarization/model.sm ../model.sm
cp ../models/DonovanYeastPolarization/model.csl ../model.csl
/usr/bin/time -o ../results/ragtimer/8reaction_50000time.txt python3 main.py 50000 &> ../results/ragtimer/8reaction_50000.txt
#!/bin/sh

# Rather than having four shell scripts with basically the same thing in them, you could just pass
# in the model size via a parameter

set -e

ragrun() {
export MODEL_SIZE=$1
echo "Running Ragtimer for model size ${MODEL_SIZE}.."

echo -n "Testing on the Single-species models..."
cp ../models/SingleSpecies/2reaction.ragtimer ../model.ragtimer
cp ../models/SingleSpecies/model.sm ../model.sm
cp ../models/SingleSpecies/model.csl ../model.csl
/usr/bin/time -o "../results/ragtimer/2reaction_${MODEL_SIZE}time.txt" python3 main.py $MODEL_SIZE loose &> "../results/ragtimer/2reaction_${MODEL_SIZE}.txt"
echo "done."

echo -n "Testing on the Kuwahara Enzyme models..."
cp ../models/KuwaharaEnzyme/6reaction.ragtimer ../model.ragtimer
cp ../models/KuwaharaEnzyme/model.sm ../model.sm
cp ../models/KuwaharaEnzyme/model.csl ../model.csl
/usr/bin/time -o "../results/ragtimer/6reaction_${MODEL_SIZE}time.txt" python3 main.py ${MODEL_SIZE} loose &> "../results/ragtimer/6reaction_${MODEL_SIZE}.txt"
echo "done."

echo -n "Testing on Donovan Yeast Polarization models..."
cp ../models/DonovanYeastPolarization/8reaction_input_adding.txt ../model.ragtimer
cp ../models/DonovanYeastPolarization/model.sm ../model.sm
cp ../models/DonovanYeastPolarization/model.csl ../model.csl
/usr/bin/time -o "../results/ragtimer/8reaction_${MODEL_SIZE}time.txt" python3 main.py ${MODEL_SIZE} &> "../results/ragtimer/8reaction_${MODEL_SIZE}.txt"
echo "done."

}

ragrun $1
14 changes: 0 additions & 14 deletions scripts/admin150k.sh

This file was deleted.

14 changes: 0 additions & 14 deletions scripts/admin250k.sh

This file was deleted.

14 changes: 0 additions & 14 deletions scripts/admin500k.sh

This file was deleted.

51 changes: 24 additions & 27 deletions scripts/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

PRINTING = False

print()
print(80*"=")
print("Expect to see a message claiming an error: assertion failure.")
print("This message indicates correct functionality.")
print(80*"=")
print()
print(f"""
{80*"="}
Expect to see a message claiming an error: assertion failure.
This message indicates correct functionality.
{80*"="}
""")

i = sys.argv[1]
each = False
Expand All @@ -29,7 +29,7 @@
loose = True

reactions1 = depgraph.makeDepGraph(reactions_v5.Options.infile, printing=PRINTING)

# with open("trace_list.txt", "w") as t:
# t.write("")

Expand All @@ -38,10 +38,10 @@
for r in reactions1:
# print(r)
if (r.tier == 0):
depgraph.printPrefixes("trace_list.txt", "", r, paths)
depgraph.printPrefixes("textfiles/trace_list.txt", "", r, paths)

# NEED TO HANDLE CASE WHERE THEY MAKE EQUIV. TRACES???

# extraEnabled = 0
# for dr in range(len(r.dependCount)):
# if r.dependCount[dr] > 0:
Expand All @@ -52,13 +52,13 @@
# # print(paths)
# # input("newpaths")

with open("trace_list.txt", "w") as trace_list:
with open("textfiles/trace_list.txt", "w") as trace_list:
for path in paths:
trace_list.write("_PREFIX_\t" + path + "\n")

# print(paths)
# quit()

o = subprocess.check_output(["make", "test"],universal_newlines=True)
prefix = prefix_parser.parsePrefix(o)

Expand All @@ -82,7 +82,7 @@
if s2 not in enabledReacts:
enabledReacts.append(s2)
# print("enabledReacts",enabledReacts)
# invalid trace at line 1 at 0 with transition r6
# invalid trace at line 1 at 0 with transition r6
pathnumber = int(lines[line].split(" trace at line ")[1].split(" ")[0]) - 1
# print(pathnumber)
rempath = paths[pathnumber]
Expand All @@ -100,14 +100,14 @@
break
# print("new1", paths)

with open("trace_list.txt", "w") as trace_list:
with open("textfiles/trace_list.txt", "w") as trace_list:
for path in paths:
# print("PREFIX PATH: ", paths)
trace_list.write("_PREFIX_\t" + path + "\n")

o = subprocess.check_output(["make", "test"],universal_newlines=True)
prefix = prefix_parser.parsePrefix(o)


# reactionname = line.split("with transition ")[1].strip()
# for r in reactions1:
Expand All @@ -124,7 +124,7 @@
# prefix = prefix_parser.parsePrefix(o)
# input("===")


# print(prefix)

j = len(prefix.values)
Expand All @@ -138,9 +138,9 @@
prob = float(0.0)

for a in range(len(paths)):
print(50*"-")
print(paths[a])
print(50*"-")
print(f"""{50*"-"}
{paths[a]}
{50*"-"}""")
reactions_v5.randTest(iters, reactions1, prefix, a, loose=loose, printing=PRINTING)

# os.system("make test")
Expand All @@ -150,11 +150,8 @@
if "Total" in line:
prob += float(line.split(": ")[1])

print()
print(80*"=")
print("Total Sum of Unique Path Probabilities:", prob)
print(80*"=")
print()
print()
print()
print()
print(f"""
{80*"="}
Total Sum of Unique Path Probabilities: {prob}
{80*"="}
""")
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.