Line filtering in a fetched PDB in biobb gromacs tutorial

Hi,
in the output of the cell relative to the fetching of a PDB structure in the
biobb gromacs tutorial whose code is the following:

from biobb_io.api.pdb import pdb

Create properties dict and inputs/outputs

downloaded_pdb = pdbCode+‘.pdb’
prop = {
‘pdb_code’: pdbCode
}

#Create and launch bb
pdb( output_pdb_path = downloaded_pdb , properties = prop )

there is the following line:
…Filtering lines NOT starting with one of these words: [‘ATOM’, ‘MODEL’, ‘ENDMDL’].
It is possible to retain even the HETATM lines as these can contain informations relative to
important ions present in the structure in the case they are present?
If so how to modify the previous code lines?

Thanks.

Saverio

Hi Saverio,

yes, all the info you need (for all the building blocks) can be found in the BioBB API documentation. In particular, for the pdb building block, the documentation (here) says:

  • filter (str) - ([“ATOM”, “MODEL”, “ENDMDL”]) Array of groups to be kept. If value is None or False no filter will be applied. All the possible values are defined in the official PDB specification).

So to keep the HETATM groups, you can either include the HETATM group in the filter property or just define it as False or None to keep all the information from the PDB file.

Example:

from biobb_io.api.pdb import pdb
prop = {
    'pdb_code': '2VGB',
    'filter': ['ATOM', 'MODEL', 'ENDMDL', 'HETATM'],
    'api_id': 'pdbe'
}
pdb(output_pdb_path='/path/to/newStructure.pdb',
    properties=prop)

Hope it helps!

Ok,

Thanks for the help and the tutorial.

Saverio