Skip to content

Commit

Permalink
updated benchmark scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
mgiulini committed Mar 23, 2024
1 parent 6dea3ea commit 74c58ff
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions benchmark/create_benchmark_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ def write_output_file(

def main():
parser = argparse.ArgumentParser()
parser.add_argument("input_file")
parser.add_argument("output_file")
parser.add_argument("input_file", help="BM5 Excel file.")
parser.add_argument("output_file", help="Output BM5 benchmark CSV file")
args = parser.parse_args()

bm5_input_file = args.input_file
Expand Down
18 changes: 12 additions & 6 deletions benchmark/execute_arctic_bm5.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def search_interfaces(interfaces, uniprot_id):
return found, sth_else


def cycle_run(arctic_io):
def cycle_run(arctic_io, threshold):
"""run arctic for the set of pdb files."""
stats = {
# number of times arctic does something
Expand Down Expand Up @@ -145,7 +145,7 @@ def cycle_run(arctic_io):
cmd = (
"arctic3d"
f" {self_uni} --full"
f" --run_dir={arctic_folder} {pdb_string}"
f" --run_dir={arctic_folder} {pdb_string} --threshold={threshold}"
)
if Path(arctic_folder).exists():
logging.info(f"folder {arctic_folder} already exists")
Expand All @@ -170,7 +170,7 @@ def cycle_run(arctic_io):
"arctic3d"
f" {self_uni} --full"
f" --out_partner={paired_uni}"
f" --run_dir=excl{paired_uni}-arctic3d-{self_uni}"
f" --run_dir=excl{paired_uni}-arctic3d-{self_uni} --threshold={threshold}"
)
output = run_arctic(cmd)
else:
Expand All @@ -195,22 +195,28 @@ def main():
# monitoring time
start_time = time.time()
parser = argparse.ArgumentParser()
parser.add_argument("input_file")
parser.add_argument("input_file", help="Input BM5 benchmark CSV file")
parser.add_argument(
"output_folder"
"output_folder",
help="Output folder where the benchmark will be built"
) # directory where the benchmark must be built
parser.add_argument(
"threshold",
help="Clustering threshold",
) # clustering threshold
args = parser.parse_args()

bm5_input_file = args.input_file
output_folder = args.output_folder
threshold = float(args.threshold)
if not os.path.exists(output_folder):
raise Exception("output folder does not exist")

output_file = Path(args.output_folder, "bm5_arctic_output.txt")

arctic_io = get_arctic_io(bm5_input_file)
os.chdir(output_folder)
cycle_run(arctic_io)
cycle_run(arctic_io, threshold)
write_output_file(arctic_io, output_file)

elap_time = time.time() - start_time
Expand Down

0 comments on commit 74c58ff

Please sign in to comment.