Acellera / htmd

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

Cannot control ionization #992

Closed phisanti closed 3 years ago

phisanti commented 3 years ago

Hi, I am trying to create 4 protein systems. They should correspond to pH 3 and 7 and salt level 0, 150 mM KCl. So I use propka for the protonation and then in the las step, charmm.build I define the ionisation state:


    # Set ionization
    ion = None
    ionize_p = True
    if kcl_x > 0:
        ion ='K'
        ionize_p = False

    print("writing" + out_path)
    print("\n...\n...\n...")

    molbuilt = charmm.build(smol, topo=topos, param=params, outdir=out_path, 
    saltconc=kcl_x, saltcation=ion, ionize=ionize_p
    )

So few things that I notice:

stefdoerr commented 3 years ago

The code you posted disables ionization when you give a concentration larger than 0. The concentration should be passed in M not mM. So it would correspond to values 0 and 0.150 Beyond that it always tries to neutralize the system. So it will first add a number of anions or cations to neutralize the system (if you have a large charge this could be quite a few) and then add the specified salt concentration you gave it. Maybe this is your issue? Also it doesn't remove or count already existing ions. So if you build a system which already has some salts it will add on top of that the concentration you asked for.

phisanti commented 3 years ago

You are right, I mistake the assignment of ionize_p. However, I think the variability in the number of ions might come from the neutralisation step.

stefdoerr commented 3 years ago

Yes if you are building systems with different molecules you will get different number of ions for neutralization

stefdoerr commented 3 years ago

Feel free to close the issue if you end up confirming it. Also the ionize function will print out in the console how many ions it added and why. It says something like: added X to neutralize and Y to reach the concentration