Acellera / htmd

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

how to cap peptides? #1034

Closed wowfee closed 1 year ago

wowfee commented 1 year ago

Hello, I have a peptide pdb (pep.pdb), and i want to cap terminal with ACE and NME, i used the followed code but failed:

from htmd.ui import *
pep = Molecule('pep.pdb')
cap = amber.build(pep,caps['P']=['ACE','NME'],outdir='./',ionze=False)

it not work.. how could i to do this? thank you!

stefdoerr commented 1 year ago
caps['P']=['ACE','NME']

this is a dictionary assignment statement. you cannot pass to a function an assignment

bmol = amber.build(pep,caps={'P': ['ACE','NME']},outdir='./',ionize=False)

this is the correct syntax. or this:

caps = {}
caps['P']=['ACE','NME']
bmol = amber.build(pep,caps=caps,outdir='./',ionize=False)

I guess the documentation is a bit confusing on that aspect.

wowfee commented 1 year ago

thank you, the P in caps['P'] is the chain name? it return that not segment P in molecular, my pep.pdb is only one chain M.

stefdoerr commented 1 year ago

it's the segment name. print(mol.segid) to see what the segment ID is

wowfee commented 1 year ago

thank you so much ,it worked now!

stefdoerr commented 1 year ago

Great!