Skip to content

Commit

Permalink
fixed coordination number tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lmiq committed Dec 5, 2023
1 parent a6ee262 commit d2b34d4
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/tools/coordination_number.jl
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,17 @@ end
@test sum(R.solute_atom) sum(R.solvent_atom)
@test coordination_number(R, contributions(protein, R.solute_atom, select(atoms, "protein"))) == R.coordination_number

cn = coordination_number(protein, R.solute_atom, R, PDBTools.select(atoms, "residue 50"))
# Checked with vmd: same residue as (resname TMAO and within 3.0 of protein)
@test R.coordination_number[findfirst(>(3), R.d)] == 7.0
@test R.coordination_number[findfirst(>(5), R.d)] == 14.0

@test cn[findlast(<(5), R.d)] 0.24999999999999997 atol = 1e-10
# THR93 forms a hydrogen bond with TMAO in this frame
thr93 = select(atoms, "protein and residue 93")
@test last(coordination_number(R, contributions(protein, R.solute_atom, thr93))) == 1

pdb = readPDB("$test_dir/data/NAMD/Protein_in_Glycerol/system.pdb")
R = load("$test_dir/data/NAMD/Protein_in_Glycerol/protein_water.json"; legacy_warning=false)
# Consistency of a read-out result
pdb = readPDB("$(Testing.data_dir)/NAMD/Protein_in_Glycerol/system.pdb")
R = load("$(Testing.data_dir)/NAMD/Protein_in_Glycerol/protein_water.json"; legacy_warning=false)
group = PDBTools.select(pdb, "protein")
solute = Selection(group, nmols = 1)
cn = coordination_number(solute, R.solute_atom, R, group)
Expand Down

0 comments on commit d2b34d4

Please sign in to comment.