sosnicklab / upside2-md

Other
18 stars 4 forks source link

Format of tension file #1

Closed aminsagar closed 2 years ago

aminsagar commented 2 years ago

Hello. Thanks for making this available. I would like to run some constant force pulling simulations like in https://doi.org/10.1016/j.bpj.2019.09.011 but without any membrane. Could you please explain the format of the tension file to be supplied. The supplementary information of the paper says that the file should specify the pulling residue and the pulling force. But, how do I specify the direction of pulling and which residue to anchor? I would be really grateful for your help. Best, Amin.

nffaruk commented 2 years ago

Hi Amin, here is py/advanced_config.py's help text for the --tension argument:

Table of linear tensions. Each line must contain 4 fields and the first line must contain "residue tension_x tension_y tension_z". The residue will be pulled in the direction (tension_x,tension_y,tension_z) by its CA atom. The magnitude of the tension vector sets the force. Units are kT/Angstrom.

To get an idea for how you could call advanced_config.py in your workflow to add tension to your config, I recommend doing the constant velocity AFM pulling example (example/06.PullingSimulation/). Using the tension option would be similar.

To fix a certain residue while applying tension, you'd also have to use the --nail-spring option of advanced_config.py (i.e. you cannot use the tension table to specify a fixed residue).

aminsagar commented 2 years ago

Thanks. I read the example scripts and the help contents and they are very helpful. I am able to run the example pulling simulation. But, when I try to run a constant force simulation, I get an error.

ERROR: No node type found for name 'tension'

The commands I issued are as follows.

$UPSIDE_HOME/py/PDB_to_initial_structure.py WT-protein.pdb WT-SMD

$UPSIDE_HOME/py/upside_config.py --output WT-SMD1.up --fasta WT-SMD.fasta \
--initial-structure WT-SMD.initial.npy \
--hbond-energy $UPSIDE_HOME/parameters/ff_2.1/hbond.h5 \
--dynamic-rotamer-1body --rotamer-placement $UPSIDE_HOME/parameters/ff_2.1/sidechain.h5 \
--rotamer-interaction $UPSIDE_HOME/parameters/ff_2.1/sidechain.h5 \
--environment-potential $UPSIDE_HOME/parameters/ff_2.1/environment.h5 \
--bb-environment-potential $UPSIDE_HOME/parameters/ff_2.1/bb_env.dat \
--rama-library $UPSIDE_HOME/parameters/common/rama.dat \
--rama-sheet-mixing-energy $UPSIDE_HOME/parameters/ff_2.1/sheet \
--reference-state-rama $UPSIDE_HOME/parameters/common/rama_reference.pkl

$UPSIDE_HOME/py/advanced_config.py --config=./WT-SMD1.up --tension=tension.txt --nail-spring=fixed.txt
$UPSIDE_HOME/obj/upside --duration 5000 --frame-interval 10 --temperature 0.9 --seed 1 --disable-recentering WT-SMD1.up

The content of my tension.txt and fixed.txt files is as follows

residue tension_x tension_y tension_z
101 0 0 0.1
residue spring_const xyz
0 1

Can you see anything wrong with my commands or files. I am really grateful for your help.

aminsagar commented 2 years ago

Update .. It seems tension.cpp is not included in the CMakeLists.txt. After including it and recompiling, the program runs without giving any error.

nffaruk commented 2 years ago

Thanks for finding the bug! I will push a fix later and put you down as coauthor for the commit.

Can you confirm if running with tension is giving expected behavior?

aminsagar commented 2 years ago

Great!! Yes, I ran a quick test with a large value of force and I get the expected pulling in the correct direction.

nffaruk commented 2 years ago

Hi @aminsagar , can you send me your github associated email address so that I can include you in the commit? Edit: nvm, I found your no-reply email and pushed the fix.

aminsagar commented 2 years ago

Great!! Thanks.