Acellera / htmd

HTMD: Programming Environment for Molecular Discovery
https://software.acellera.com/docs/latest/htmd/index.html
Other
261 stars 59 forks source link

amber.build issues #1051

Closed shozebhaider closed 1 year ago

shozebhaider commented 1 year ago

Hi

I think the cap=None is not being recognised in amber.build. in htmd 2.2.1 When I use the command molbuilt = amber.build(smol, ff=ffs, outdir='./build', ionize=True, caps=None) It should not add any caps and yet caps are being added. I believe the caps=None is being overridden by the default of adding caps,

The error message is as follows:
---------------------------------------------------------------------------
BuildError                                Traceback (most recent call last)

----> 1 molbuilt = amber.build(smol, ff=ffs, outdir='./build', ionize=True, caps=None)

File ~/miniconda3/envs/htmd/lib/python3.10/site-packages/htmd/builder/amber.py:568, in build(mol, ff, topo, param, prefix, outdir, caps, ionize, saltconc, saltanion, saltcation, disulfide, teleap, teleapimports, execute, atomtypes, offlibraries, gbsa, igb)
    565 _detect_cofactors_ncaa_ptm(mol, param, topo)
    567 if ionize:
--> 568     molbuilt = _build(
    569         mol,
    570         ff=ff,
    571         topo=topo,
    572         param=param,
    573         prefix=prefix,
    574         outdir=outdir,
    575         disulfide=disulfide,
    576         teleap=teleap,
    577         teleapimports=teleapimports,
    578         execute=execute,
    579         atomtypes=atomtypes,
    580         offlibraries=offlibraries,
    581         gbsa=gbsa,
    582         igb=igb,
    583     )
    584     shutil.move(
    585         os.path.join(outdir, "structure.crd"),
    586         os.path.join(outdir, "structure.noions.crd"),
    587     )
    588     shutil.move(
    589         os.path.join(outdir, "structure.prmtop"),
    590         os.path.join(outdir, "structure.noions.prmtop"),
    591     )

File ~/miniconda3/envs/htmd/lib/python3.10/site-packages/htmd/builder/amber.py:799, in _build(mol, ff, topo, param, prefix, outdir, disulfide, teleap, teleapimports, execute, atomtypes, offlibraries, gbsa, igb)
    797 os.chdir(currdir)
    798 if errors:
--> 799     raise BuildError(
    800         errors
    801         + [f"Check {logpath} for further information on errors in building."],
    802         errors,
    803     )
    804 logger.info("Finished building.")
    806 if (
    807     os.path.exists(os.path.join(outdir, "structure.crd"))
    808     and os.path.getsize(os.path.join(outdir, "structure.crd")) != 0
    809     and os.path.getsize(os.path.join(outdir, "structure.prmtop")) != 0
    810 ):

BuildError: MissingAtomTypeError("Missing atom type for ['.R<NME 267>.A<C 7>']", ['.R<NME 267>.A<C 7>'])
Check /home/shozeb/KPC/0_parm_adaptive/build/log.txt for further information on errors in building.
stefdoerr commented 1 year ago

Yes as the documentation says:

caps (dict) – A dictionary with keys segids and values lists of strings describing the caps for a particular protein segment. e.g. caps[‘P’] = [‘ACE’, ‘NME’] or caps[‘P’] = [‘none’, ‘none’]. Default: will apply ACE and NME caps to every protein segment.

To disable the caps you need to create a dict and for each segment set the caps to [‘none’, ‘none’]

shozebhaider commented 1 year ago

Many thanks @stefdoerr. Got it.