Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build combined topology files #15

Closed
tomnewport opened this issue Jan 27, 2016 · 0 comments
Closed

Build combined topology files #15

tomnewport opened this issue Jan 27, 2016 · 0 comments

Comments

@tomnewport
Copy link
Owner

A topology file defines a number of molecules:

[ molecules ]
Protein 1
POPG 229
POPC 117
W 7601
NA+ 440
CL- 213

These are usually included in .itp files. Grompp can produce a preprocessed output using the -pp flag. I would like to propose the following steps:

  1. Collect: input.mdp, input.top, input.gro, moltype_name
  2. Grompp inputs to produce a combined.top for the topology
  3. Create a blank combined.itp file with a moltype specification for moltype_name
  4. For each moltype in the molecules section of combined.top:
    1. Find the moltype definition in combined.top
    2. Renumber all atoms in all tables
    3. Add all tables to tables in combined.itp
  5. Add combined.itp as an #include in combined.top

Tables

.itp files can contain a number of tables. The following are the only ones which will be considered:

Thanks to GromacsWrapper.

[ moleculetype ]

This creates a new subsection within the file and defines a new moltype. Fields are:

  • name - name of the molecule
  • nrexcl - bond-based exclusions

[ atoms ]

This defines atoms. Fields are:

  • id - atom id within the moltype
  • type - atom type (from atomtypes table)
  • resnr - residue number
  • residu - residue name
  • atom - atom name
  • cgnr - charge group number
  • charge - coulomb charge on atom

[ bonds ]

  • ai - from atom id
  • aj - to atom id
  • funct - bond function
  • c0 - bond length
  • c1 - force constant

[ angles ]

ai aj ak funct c0 c1

[ dihedrals ]

ai aj ak al funct c0 c1 c2

[ pairs ]

ai aj funct c0 c1

Adding to a single moleculegroup

  1. Fetch uncommented parts of lines
    1. if ; is in the line:
      1. Take the bit of the line before the ;
    2. strip whitespace
    3. If line != "":
      1. split line on whitespace
      2. if that produces the expected number of parts
      3. resolve any atom references (a[ijkl])
    4. add greatest existing atom_id to all the atom ids
    5. add greatest existing cgnr to all the atom cgnrs

It would also be nice to be able to do a pass over the table to check the .gro and .itp match up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant