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

From: Thomas C Bishop via AMBER <amber.ambermd.org>
Date: Wed, 12 Jul 2023 09:35:57 -0500

That's the work around I'm using. thanks.

It side steps the root of the problem though which may be a bug/feature
in NAStruc.

My problem is getting NAStruc to recognize/deal w/ circular DNA.
The bonds being deleted were originally added to B-DNA to make it
circular DNA.

NAStruct complains there is no beginning/end if the DNA is circular. so
does CPPTRAJ unless I delete the bonds
The recent updates to NAStruct on github that allow use to specify bases
may address this issue.
I'll make  a simple model of circ. DNA to check all.

The remaining issue also pops up... for circular DNA of length NBP there
are NBP steps not NBP-1 as is the case for linear DNA.
again maybe the recent updates will address this issue.

In general I guess should allow user to over/under count as much as they
like :-)

We'll see.

THANKS ya'll!

TOm



On 7/12/23 08:57, Hai Nguyen via AMBER wrote:
> On Wed, Jul 12, 2023 at 9:41 AM Daniel Roe via AMBER <amber.ambermd.org>
> wrote:
>
>> Hi,
>>
>> If you need to stay in the python universe, maybe you could use parmed
>> to write out the modified topology and then load that into pytraj? I
>> put the 'change' command into cpptraj mostly for my own convenience -
>> I'm not sure how well that functionality is supported in pytraj.
>>
> I don’t think pytraj support that yet.
> But I agree parmed is the way.
>
> Hai
>
>> -Dan
>>
>> On Mon, Jul 10, 2023 at 3:35 PM Thomas C. Bishop via AMBER
>> <amber.ambermd.org> wrote:
>>> Dear Amber,
>>> I want to delete bonds in my topology file and then run some analysis
>>> using pytraj but can't figure out how tosdo 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
>> _______________________________________________
>> AMBER mailing list
>> AMBER.ambermd.org
>> http://lists.ambermd.org/mailman/listinfo/amber
>>
> _______________________________________________
> AMBER mailing list
> AMBER.ambermd.org
> http://lists.ambermd.org/mailman/listinfo/amber

_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Wed Jul 12 2023 - 08:00:03 PDT
Custom Search