Exemplo n.º 1
0
 def testDuplicateSystemNames(self):
     """ Tests that Gromacs topologies never have duplicate moleculetypes """
     parm = load_file(get_fn('phenol.prmtop'))
     parm = parm * 20 + load_file(get_fn('biphenyl.prmtop')) * 20
     top = GromacsTopologyFile.from_structure(parm)
     self.assertEqual(top.combining_rule, 'lorentz')
     top.write(get_fn('phenol_biphenyl.top', written=True))
     top2 = GromacsTopologyFile(get_fn('phenol_biphenyl.top', written=True))
     self.assertEqual(len(top.residues), 40)
Exemplo n.º 2
0
    def _amber_to_gromacs(self):

        # Load prmtop and inpcrd as a Structure
        parmstruct = load_file(self.outprefix + ".prmtop",
                               xyz=self.outprefix + ".inpcrd",
                               structure=True)

        # Save .gro coordinate file
        GromacsGroFile.write(struct=parmstruct, dest=self.outprefix + ".gro")

        # Save .top topology and parameter file
        grotop = GromacsTopologyFile.from_structure(parmstruct, copy=False)
        grotop.write(dest=self.outprefix + ".top", parameters="inline")
Exemplo n.º 3
0
def to_parmed_GromacsTopologyFile(item, atom_indices='all', check=True):

    if check:

        digest_item(item, 'parmed.Structure')
        atom_indices = digest_atom_indices(atom_indices)

    from . import extract
    from parmed.gromacs import GromacsTopologyFile as GromacsTopologyFile

    tmp_item = extract(item,
                       atom_indices=atom_indices,
                       copy_if_all=False,
                       check=False)
    tmp_item = GromacsTopologyFile.from_structure(tmp_item)

    return tmp_item