[AMBER] how to remove/delete bonds w/ cpptraj or parmed in pytraj ??

From: Thomas C. Bishop via AMBER <amber.ambermd.org>
Date: Mon, 10 Jul 2023 14:35:09 -0500

Dear Amber,
I want to delete bonds in my topology file and then run some analysis
using pytraj but can't figure out how to do it.

Can you help me?
See below
Thanks
Tom


This  CPPTRAJ script works!

cpptraj sys.parm7
change removebonds :358.O3' :1.P
change removebonds :716.O3' :359.P
parmwrite out new.sys.parm7
quit


BUT trying to do something similar in pytraj does not work

nano 195% python3
Python 3.6.15 (default, Sep 23 2021, 15:41:43) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> import pytraj as pt
>>> import pandas as pd
>>> import glob
>>> ######################
... top = pt.load_topology('sys.parm7')
>>> top
<Topology: 54271 atoms, 2664 residues, 18 mols, non-PBC>
>>> cpptrajtext = '''
... change removebonds :358.O3' :1.P
... change removebonds :716.O3' :359.P
... '''
>>> pt.io.load(cpptrajtext)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python3.6/site-packages/pytraj/io.py", line 124, in load
    traj = load_traj(filename, top, stride=stride)
  File "/usr/lib64/python3.6/site-packages/pytraj/io.py", line 242, in
load_traj
    top = load_topology(filename)
  File "/usr/lib64/python3.6/site-packages/pytraj/io.py", line 527, in
load_topology
    'n_atoms = 0: make sure to load correct Topology filename '
RuntimeError: n_atoms = 0: make sure to load correct Topology filename
or load supported topology (pdb, amber parm, psf, ...)
>>> parmedtext='''
... deleteBond :716.O3' :359.P
... deleteBond :358.O3' :1.P
... '''
>>> pt.io.load_parmed(parmedtext)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File
"/usr/lib64/python3.6/site-packages/pytraj/externals/load_other_packages.py",
line 22, in load_parmed
    from parmed.amber import AmberParm
  File "/usr/lib64/python3.6/site-packages/parmed/__init__.py", line 21,
in <module>
    from . import unit, utils
  File "/usr/lib64/python3.6/site-packages/parmed/utils/__init__.py",
line 4, in <module>
    from ..topologyobjects import Atom
  File "/usr/lib64/python3.6/site-packages/parmed/topologyobjects.py",
line 9, in <module>
    from functools import cached_property
ImportError: cannot import name 'cached_property'
>>>

_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Mon Jul 10 2023 - 13:00:02 PDT
Custom Search