Re: [AMBER] merging molecules

From: Jason Swails <jason.swails.gmail.com>
Date: Mon, 18 Feb 2019 15:50:21 -0500

On Sat, Feb 2, 2019 at 12:10 PM Stefano Guglielmo <
stefano.guglielmo.unito.it> wrote:

> Dear Amber users,
> is there a way to merge two systems (eg a protein and a ligand) starting
> from two distinct prmtop files? I have googled a bit, trying to focus on
> ParmEd utility and it seemed that the combineMolecules command could fit,
> but I couldn't find the command in the version I have installed (3.0.3).
> Does anyone have any suggestions?
>

combineMolecules doesn't do that -- it takes two distinct 'molecules' in
the system and hacks the topology file to make programs *think* they're
just one molecule. There aren't many good reasons to do this, though, so I
removed the command (it was never really used as far as I knew).

The "parmed" program itself can't do this. However, the ParmEd API does
have a convenient way to combine two systems -- via the + operator. But
you have to write a short script to do this in Python. Something like the
following could get you started:

#!/usr/bin/env python

import parmed as pmd

parm1 = pmd.load_file('first_system.parm7', 'first_system.rst7')
parm2 = pmd.load_file('second_system.parm7', 'second_system.rst7')
joined = parm1 + parm2
joined.save('new_system.parm7')
joined.save('new_system.rst7')

HTH,
Jason

-- 
Jason M. Swails
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Mon Feb 18 2019 - 13:00:02 PST
Custom Search