bioexcel / biobb_amber

Biobb_amber is a BioBB category for AMBER MD package.
https://mmb.irbbarcelona.org/biobb/
Apache License 2.0
8 stars 3 forks source link

Extend leap_gen_top to parameterize cofactors from database #10

Open PabloNA97 opened 2 weeks ago

PabloNA97 commented 2 weeks ago

Hi! It's me again :)

To simulate cofactors one can use the manchester university database of parameter modifications. For example to simulate PDB 2FDV, one can extract the heteroatom pdb entries and use tleap -f leap.in with the following leap.in:

# Load protein ff
source leaprc.protein.ff14SB

# Load cofactor parameters
loadamberparams HEM.frcmod
loadamberprep HEM.prep

# Load PDB coordinates
mol = loadpdb HEM.pdb 

savepdb mol HEM_parameterized.pdb 

saveamberparm mol HEM.prmtop HEM.inpcrd
quit 

The file HEM.prep is used to understand the new residue (HEM) and atom types. See File formats. Unfortunately, this cannot be done from biobb_amber.leap.leap_gen_top. The only thing missing is to include "input_prep_path" as an input file completely analogous to "input_frcmod_path" but paired to the "loadamberprep" directive in leap.in instead of the "loadamberparams" one. See below:

In file _biobb_amber/leap/leap_gentop.py, after including the corresponding input file, line 159:

        ligands_prep_list = []
        if self.io_dict['in']['input_prep_path'] is not None:
            if self.io_dict['in']['input_prep_path'].endswith('.zip'):
                ligands_prep_list = fu.unzip_list(self.stage_io_dict['in']['input_prep_path'], dest_dir=self.tmp_folder, out_log=self.out_log)
            else:
                ligands_prep_list.append(self.stage_io_dict['in']['input_prep_path'])

Then in line 203:

            for amber_prep in ligands_prep_list:
                leapin.write("loadamberprep " + amber_prep + "\n")

Version:

biobb_amber 4.2.0 (I believe this is not available in 5.0.0 either)

PabloNA97 commented 2 weeks ago

Additionally, the new format and input file has to be added to _biobbamber/leap/common.py