tomnewport / alchex

Phospholipid Biosynthetic Proteins Project
1 stars 0 forks source link

Build combined topology files #15

Closed tomnewport closed 8 years ago

tomnewport commented 8 years ago

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:

This defines atoms. Fields are:

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.