Skip to content

Commit

Permalink
Add usage for VDW
Browse files Browse the repository at this point in the history
  • Loading branch information
wukevin committed Oct 22, 2023
1 parent 88bdb63 commit c5dc66c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions foldingdiff/vdw_clashes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- https://www.pnas.org/doi/10.1073/pnas.072665799
Usage:
python vdw_clashes.py <pdb file1> <pdb file2> ...
"""
import warnings
from typing import Collection, Dict
Expand Down Expand Up @@ -73,12 +73,13 @@ def count_clashes_parallel(
) -> Dict[str, int]:
"""Parallelized calculation of clashes for a collection of pdb files."""
with mp.Pool(nthreads) as pool:
n_clashes = pool.map(count_clashes, tqdm(filenames), chunksize=10)
n_clashes = pool.map(count_clashes, filenames, chunksize=10)
retval = dict(zip(filenames, n_clashes))
return retval


if __name__ == "__main__":
import sys

count_clashes_parallel(sys.argv[1:])
clashes_counts = count_clashes_parallel(sys.argv[1:])
print(np.mean(list(clashes_counts.values())))

0 comments on commit c5dc66c

Please sign in to comment.