Skip to content

Commit fdec6c4

Browse files
committed
Fixed failing tests
Tests were failing due to absence of simulation path parent, meaning lightdock was looking for receptor and ligand pdbs in the root /
1 parent fc77b2d commit fdec6c4

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/bin/lightdock-rust.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,21 @@ fn simulate(simulation_path: &str, setup: &SetupFile, swarm_filename: &str, step
143143
println!("Reading starting positions from {:?}", swarm_filename);
144144
let positions = parse_input_coordinates(swarm_filename);
145145

146+
let receptor_filename = if simulation_path == "" {
147+
format!("{}{}", DEFAULT_LIGHTDOCK_PREFIX, setup.receptor_pdb)
148+
} else {
149+
format!("{}/{}{}", simulation_path, DEFAULT_LIGHTDOCK_PREFIX, setup.receptor_pdb)
150+
};
146151
// Parse receptor input PDB structure
147-
let receptor_filename: String = format!("{}/{}{}", simulation_path, DEFAULT_LIGHTDOCK_PREFIX, setup.receptor_pdb);
148152
println!("Reading receptor input structure: {}", receptor_filename);
149153
let (receptor, _errors) = pdbtbx::open(&receptor_filename, pdbtbx::StrictnessLevel::Medium).unwrap();
150154

155+
let ligand_filename = if simulation_path == "" {
156+
format!("{}{}", DEFAULT_LIGHTDOCK_PREFIX, setup.ligand_pdb)
157+
} else {
158+
format!("{}/{}{}", simulation_path, DEFAULT_LIGHTDOCK_PREFIX, setup.ligand_pdb)
159+
};
151160
// Parse ligand input PDB structure
152-
let ligand_filename: String = format!("{}/{}{}", simulation_path, DEFAULT_LIGHTDOCK_PREFIX, setup.ligand_pdb);
153161
println!("Reading ligand input structure: {}", ligand_filename);
154162
let (ligand, _errors) = pdbtbx::open(&ligand_filename, pdbtbx::StrictnessLevel::Medium).unwrap();
155163

0 commit comments

Comments
 (0)