Skip to content

Commit

Permalink
more general top for convert xtc
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmkrieger committed Sep 17, 2024
1 parent 9639506 commit bc8943c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion prody/database/bioexcel.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,15 @@ def convertXtcToDcd(filepath, **kwargs):
else:
acc = basename(splitext(filepath)[0])

if not isfile(acc):
acc = fetchBioexcelTopology(acc, **kwargs)

try:
import mdtraj
except ImportError:
raise ImportError('Please install mdtraj to convert to dcd.')
else:
top = mdtraj.load_psf(fetchBioexcelTopology(acc, **kwargs))
top = mdtraj.load_topology(acc)
traj = mdtraj.load_xtc(filepath, top=top)
filepath = filepath.replace('xtc', 'dcd')
traj.save_dcd(filepath)
Expand Down

0 comments on commit bc8943c

Please sign in to comment.