Note: The following code can be run in google colab or jupyter notebook. This google colab provides with the full AF-MI protocol, i.e software installation, CALVADOS, PLUMED input preparation, running AF-MI, and analysis. Lets break it down and explain each part.

Software installation

The code below needs to run in colab. We first install condacolab which is essential in running conda google colab. This step is not necessary if one runs just in a jupyter-notebook locally.

#Install collab
!pip install -q condacolab
import condacolab
condacolab.install()

The code below installs various necessary packages such as PLUMED, mpi, OPENMM, pandas, gromacs, biopython, pulchra. Moreover it builds the OPENMM-PLUMED-MPI patch which is necessary for running metainference in OPENMM.

import os
home=os.getcwd()
os.chdir(home)

#Download OpenMM-Plumed-MPI patch
!conda install -y -c conda-forge mpich mpi4py openmm=8.0 plumed=2.8.2=mpi_mpich_h7ded119_0 py-plumed cmake swig pandas mdtraj biopython matplotlib gromacs
!conda install -y -c anaconda ipykernel
!conda install -y -c bioconda pulchra

!git clone https://github.com/vendruscolo-lab/OpenMM-Plumed-MPI

os.chdir(home+'/OpenMM-Plumed-MPI')

#Build openmm-plumed-mpi
!mkdir build install openmm -p plumed/include -p plumed/lib
!unzip openmm.zip -d openmm
!unzip plumed_lib.zip -d plumed/lib
!unzip plumed_include.zip -d plumed/include
os.chdir(os.getcwd()+'/build')
!cmake ..
!make
!make install
!make PythonInstall
os.chdir(os.getcwd()+'/../install/lib')
!cp -r * /usr/local/lib/

Run Alpha-Fold distance map prediction

For this example (TDP-43 WtoA):

The AF distance map has already been calculated and it is loaded below. We here show the AF prediction for the a) Inter-residue distances, b)PLDDT score and c)PAE per residue pair.

Alt text Alt text Alt text
a) Inter-residue distances, b)PLDDT score and c)PAE per residue pair.

For arbitrary protein sequences:

Setup protein system in CALVADOS2 and OPENMM

os.chdir(home)
!git clone https://github.com/vendruscolo-lab/AlphaFold-IDP
os.chdir(home+'/AlphaFold-IDP/prep_run')

In the following step we need to define python fasta_sequence, pH, temp, ionic, PAE_cut, NR, ordered_domains, disordered_domains, pdb_af,json_af,npy_af, mean_af. These variables respectively stand for the protein sequence to be simulated in AF-MI, the simulation pH, the simulation temperature (in K), the ionic strength of the solution, the highest AF predicted alighment error the considered inter-residue distances will have (residue distances with higher PAE are not considered in restraints), the number of replicas, the regions of the ordered domains (regions of more than 3 residues with PLDDT>0.75) where RMSD walls wil be used, the disordered regions (usually regions of more than 3 residues with PLDDT<0.75), AF predicted pdb file, AF predicted json containing the PAE per residue pair file, per residue pair probability distribution AF prediction file, mean AF inter-residue distance map prediction file

import shutil
import csv
dir=os.getcwd()
###################### The entries below need to be adapted in each simulation ######################
#TDP-43 sequence
fasta_sequence="MSEYIRVTEDENDEPIEIPSEDDGTVLLSTVTAQFPGACGLRYRNPVSQCMRGVRLVEGILHAPDAGAGNLVYVVNYPKDNKRKMDETDASSAVKVKRAVQKTSDLIVLGLPAKTTEQDLKEYFSTFGEVLMVQVKKDLKTGHSKGFGFVRFTEYETQVKVMSQRHMIDGRACDCKLPNSKQSQDEPLRSRKVFVGRCTEDMTEDELREFFSQYGDVMDVFIPKPFRAFAFVTFADDQIAQSLCGEDLIIKGISVHISNAEPKHNSNRQLERSGRFGGNPGGFGNQGGFGNSRGGGAGLGNNQGSNMGGGMNFGAFSINPAMMAAAQAALQSSAGMMGMLASQQNQSGPSGNNQNQGNMQREPNQAFGSGNNSYSGSNSGAAIGAGSASNAGSGSGFNGGFGSSMDSKSSGAGM"
#Conditions
pH=7.4
temp=298
ionic=0.2
PAE_cut=5
NR=2
#Decide the plddt based ordered (od) and disordered (dd) regions
ordered_domains = {'od1': [3, 79], 'od2': [104,178],'od3':[191,260]}
disordered_domains={'dd1': [1,2],'dd2':[80,103],'dd3':[179,190],'dd4':[261,414]}

#AF input created in AF-distance map prediction and used in AF-MI
pdb_af='tdp43_WtoA_bf4cc_unrelaxed_rank_001_alphafold2_ptm_model_3_seed_000.pdb'
json_af='tdp43_WtoA_bf4cc_predicted_aligned_error_v1.json'
npy_af='alphafold2_ptm_model_3_seed_000_prob_distributions.npy'
mean_af='alphafold2_ptm_model_3_seed_000_mean.csv'
#Copy AF data
shutil.copy2(dir+"/../AF_DATA/"+pdb_af, dir+"/pdb_af.pdb")
shutil.copy2(dir+"/../AF_DATA/"+json_af, dir+"/pae.json")
shutil.copy2(dir+"/../AF_DATA/tdp43_WtoA_bf4cc_distmat/"+mean_af, dir+"/mean_af.csv")
shutil.copy2(dir+"/../AF_DATA/tdp43_WtoA_bf4cc_distmat/"+npy_af, dir+"/prob.npy")
####################################################################################################

In the following step we create the OPENMM CALVADOS2 .xml files

f = open("sequence.dat", "w")
f.write(fasta_sequence)
f.close()
#Write the csv files
with open('ordered_domains.csv', 'w') as f:  # You will need 'wb' mode in Python 2.x
    w = csv.DictWriter(f, ordered_domains.keys())
    w.writeheader()
    w.writerow(ordered_domains)
with open('disordered_domains.csv', 'w') as f:  # You will need 'wb' mode in Python 2.x
    w = csv.DictWriter(f, disordered_domains.keys())
    w.writeheader()
    w.writerow(disordered_domains)

#Copy OPENMM calvados forcefield files
shutil.copy2(dir+"/../scripts_prep/gen_xml_and_constraints.py", dir)
shutil.copy2(dir+"/../scripts_prep/residues.csv", dir)

path_gen_xml = dir+'/gen_xml_and_constraints.py sequence.dat '+str(pH)+' '+str(temp)+' '+str(ionic)
print(path_gen_xml)
os.system(f'python {path_gen_xml}')

Make the AF-MI PLUMED plumed.dat input file

#Make plumed files.
#Copy and run the prep script that makes the plumed file.
#The Collective variables (CVs) in these case are chosen to be the torsion angles between structured domains.
import subprocess
shutil.copy2(dir+"/../scripts_prep/make_plumed_distmat.py", dir)
subprocess.run(['python', str(dir)+'/make_plumed_distmat.py', 'sequence.dat',str(PAE_cut), '0.2'], capture_output=True, text=True)

The plumed.dat file can be seen below. The distance_rest_domains are the af-distances do be restrained. For TDP-43 WtoA, the three ordered domains are RMSD restrained with RMSD1,RMSD2,RMSD3. Note the FILL entries the user should specify for the specific system at hand. This includes the CV definition, biasfactor, sigma, number of bins in the grid for saving the FES along the PB MetaD simulation. More info on PB-MetaD can be found here. A usual rule of thumb for the biasfactor value is 10*sqrt(number of biased CVs).

Click on the labels of the actions for more information on what each action computes
tested onv2.9
tested onmaster
tested on master
MOLINFOThis command is used to provide information on the molecules that are present in your system. More details MOLTYPE what kind of molecule is contained in the pdb file - usually not needed since protein/RNA/DNA are compatible=protein STRUCTUREa file in pdb format containing a reference structure=input_af.pdb
WHOLEMOLECULESThis action is used to rebuild molecules that can become split by the periodic boundary conditions. More details ENTITY0the atoms that make up a molecule that you wish to align=1-414
    
distance_rest_domains:  CONTACTMAPCalculate the distances between a number of pairs of atoms and transform each distance by a switching function. More details ...
ATOMS1the atoms involved in each of the contacts you wish to calculate=1,4
ATOMS2the atoms involved in each of the contacts you wish to calculate=2,5
ATOMS3the atoms involved in each of the contacts you wish to calculate=2,20
ATOMS4the atoms involved in each of the contacts you wish to calculate=28,79
ATOMS5the atoms involved in each of the contacts you wish to calculate=31,79
ATOMS6the atoms involved in each of the contacts you wish to calculate=35,79
ATOMS7the atoms involved in each of the contacts you wish to calculate=37,79
ATOMS8the atoms involved in each of the contacts you wish to calculate=38,79
ATOMS9the atoms involved in each of the contacts you wish to calculate=39,79
ATOMS10the atoms involved in each of the contacts you wish to calculate=40,79
ATOMS11the atoms involved in each of the contacts you wish to calculate=41,79
ATOMS12the atoms involved in each of the contacts you wish to calculate=42,79
ATOMS13the atoms involved in each of the contacts you wish to calculate=74,79
ATOMS14the atoms involved in each of the contacts you wish to calculate=75,79
ATOMS15the atoms involved in each of the contacts you wish to calculate=76,79
ATOMS16the atoms involved in each of the contacts you wish to calculate=102,105
ATOMS17the atoms involved in each of the contacts you wish to calculate=102,106
ATOMS18the atoms involved in each of the contacts you wish to calculate=102,150
ATOMS19the atoms involved in each of the contacts you wish to calculate=102,151
ATOMS20the atoms involved in each of the contacts you wish to calculate=102,152
ATOMS21the atoms involved in each of the contacts you wish to calculate=102,155
ATOMS22the atoms involved in each of the contacts you wish to calculate=102,158
ATOMS23the atoms involved in each of the contacts you wish to calculate=102,159
ATOMS24the atoms involved in each of the contacts you wish to calculate=102,161
ATOMS25the atoms involved in each of the contacts you wish to calculate=103,106
ATOMS26the atoms involved in each of the contacts you wish to calculate=103,107
ATOMS27the atoms involved in each of the contacts you wish to calculate=103,108
ATOMS28the atoms involved in each of the contacts you wish to calculate=103,120
ATOMS29the atoms involved in each of the contacts you wish to calculate=103,121
ATOMS30the atoms involved in each of the contacts you wish to calculate=103,124
ATOMS31the atoms involved in each of the contacts you wish to calculate=103,130
ATOMS32the atoms involved in each of the contacts you wish to calculate=103,131
ATOMS33the atoms involved in each of the contacts you wish to calculate=103,132
ATOMS34the atoms involved in each of the contacts you wish to calculate=103,133
ATOMS35the atoms involved in each of the contacts you wish to calculate=103,134
ATOMS36the atoms involved in each of the contacts you wish to calculate=103,135
ATOMS37the atoms involved in each of the contacts you wish to calculate=103,147
ATOMS38the atoms involved in each of the contacts you wish to calculate=103,148
ATOMS39the atoms involved in each of the contacts you wish to calculate=103,149
ATOMS40the atoms involved in each of the contacts you wish to calculate=103,150
ATOMS41the atoms involved in each of the contacts you wish to calculate=103,151
ATOMS42the atoms involved in each of the contacts you wish to calculate=103,152
ATOMS43the atoms involved in each of the contacts you wish to calculate=103,153
ATOMS44the atoms involved in each of the contacts you wish to calculate=103,154
ATOMS45the atoms involved in each of the contacts you wish to calculate=103,155
ATOMS46the atoms involved in each of the contacts you wish to calculate=103,156
ATOMS47the atoms involved in each of the contacts you wish to calculate=103,157
ATOMS48the atoms involved in each of the contacts you wish to calculate=103,158
ATOMS49the atoms involved in each of the contacts you wish to calculate=103,159
ATOMS50the atoms involved in each of the contacts you wish to calculate=103,160
ATOMS51the atoms involved in each of the contacts you wish to calculate=103,161
ATOMS52the atoms involved in each of the contacts you wish to calculate=103,162
ATOMS53the atoms involved in each of the contacts you wish to calculate=103,175
ATOMS54the atoms involved in each of the contacts you wish to calculate=103,176
ATOMS55the atoms involved in each of the contacts you wish to calculate=103,177
ATOMS56the atoms involved in each of the contacts you wish to calculate=103,178
ATOMS57the atoms involved in each of the contacts you wish to calculate=104,178
ATOMS58the atoms involved in each of the contacts you wish to calculate=105,178
ATOMS59the atoms involved in each of the contacts you wish to calculate=105,179
ATOMS60the atoms involved in each of the contacts you wish to calculate=106,178
ATOMS61the atoms involved in each of the contacts you wish to calculate=106,179
ATOMS62the atoms involved in each of the contacts you wish to calculate=107,178
ATOMS63the atoms involved in each of the contacts you wish to calculate=107,179
ATOMS64the atoms involved in each of the contacts you wish to calculate=108,178
ATOMS65the atoms involved in each of the contacts you wish to calculate=108,179
ATOMS66the atoms involved in each of the contacts you wish to calculate=109,178
ATOMS67the atoms involved in each of the contacts you wish to calculate=109,179
ATOMS68the atoms involved in each of the contacts you wish to calculate=110,178
ATOMS69the atoms involved in each of the contacts you wish to calculate=111,178
ATOMS70the atoms involved in each of the contacts you wish to calculate=120,178
ATOMS71the atoms involved in each of the contacts you wish to calculate=124,178
ATOMS72the atoms involved in each of the contacts you wish to calculate=131,178
ATOMS73the atoms involved in each of the contacts you wish to calculate=132,178
ATOMS74the atoms involved in each of the contacts you wish to calculate=133,178
ATOMS75the atoms involved in each of the contacts you wish to calculate=134,178
ATOMS76the atoms involved in each of the contacts you wish to calculate=135,178
ATOMS77the atoms involved in each of the contacts you wish to calculate=136,178
ATOMS78the atoms involved in each of the contacts you wish to calculate=137,178
ATOMS79the atoms involved in each of the contacts you wish to calculate=145,178
ATOMS80the atoms involved in each of the contacts you wish to calculate=146,178
ATOMS81the atoms involved in each of the contacts you wish to calculate=147,178
ATOMS82the atoms involved in each of the contacts you wish to calculate=147,179
ATOMS83the atoms involved in each of the contacts you wish to calculate=148,178
ATOMS84the atoms involved in each of the contacts you wish to calculate=148,179
ATOMS85the atoms involved in each of the contacts you wish to calculate=149,178
ATOMS86the atoms involved in each of the contacts you wish to calculate=149,179
ATOMS87the atoms involved in each of the contacts you wish to calculate=150,178
ATOMS88the atoms involved in each of the contacts you wish to calculate=150,179
ATOMS89the atoms involved in each of the contacts you wish to calculate=151,178
ATOMS90the atoms involved in each of the contacts you wish to calculate=151,179
ATOMS91the atoms involved in each of the contacts you wish to calculate=152,178
ATOMS92the atoms involved in each of the contacts you wish to calculate=155,178
ATOMS93the atoms involved in each of the contacts you wish to calculate=158,178
ATOMS94the atoms involved in each of the contacts you wish to calculate=159,178
ATOMS95the atoms involved in each of the contacts you wish to calculate=159,179
ATOMS96the atoms involved in each of the contacts you wish to calculate=161,178
ATOMS97the atoms involved in each of the contacts you wish to calculate=161,179
ATOMS98the atoms involved in each of the contacts you wish to calculate=162,178
ATOMS99the atoms involved in each of the contacts you wish to calculate=162,179
ATOMS100the atoms involved in each of the contacts you wish to calculate=163,178
ATOMS101the atoms involved in each of the contacts you wish to calculate=164,178
ATOMS102the atoms involved in each of the contacts you wish to calculate=165,178
ATOMS103the atoms involved in each of the contacts you wish to calculate=166,178
ATOMS104the atoms involved in each of the contacts you wish to calculate=173,178
ATOMS105the atoms involved in each of the contacts you wish to calculate=174,178
ATOMS106the atoms involved in each of the contacts you wish to calculate=174,179
ATOMS107the atoms involved in each of the contacts you wish to calculate=175,178
ATOMS108the atoms involved in each of the contacts you wish to calculate=175,179
ATOMS109the atoms involved in each of the contacts you wish to calculate=176,179
ATOMS110the atoms involved in each of the contacts you wish to calculate=189,192
ATOMS111the atoms involved in each of the contacts you wish to calculate=189,233
ATOMS112the atoms involved in each of the contacts you wish to calculate=189,240
ATOMS113the atoms involved in each of the contacts you wish to calculate=190,193
ATOMS114the atoms involved in each of the contacts you wish to calculate=190,194
ATOMS115the atoms involved in each of the contacts you wish to calculate=190,195
ATOMS116the atoms involved in each of the contacts you wish to calculate=190,209
ATOMS117the atoms involved in each of the contacts you wish to calculate=190,210
ATOMS118the atoms involved in each of the contacts you wish to calculate=190,211
ATOMS119the atoms involved in each of the contacts you wish to calculate=190,212
ATOMS120the atoms involved in each of the contacts you wish to calculate=190,213
ATOMS121the atoms involved in each of the contacts you wish to calculate=190,214
ATOMS122the atoms involved in each of the contacts you wish to calculate=190,216
ATOMS123the atoms involved in each of the contacts you wish to calculate=190,217
ATOMS124the atoms involved in each of the contacts you wish to calculate=190,218
ATOMS125the atoms involved in each of the contacts you wish to calculate=190,219
ATOMS126the atoms involved in each of the contacts you wish to calculate=190,220
ATOMS127the atoms involved in each of the contacts you wish to calculate=190,230
ATOMS128the atoms involved in each of the contacts you wish to calculate=190,231
ATOMS129the atoms involved in each of the contacts you wish to calculate=190,232
ATOMS130the atoms involved in each of the contacts you wish to calculate=190,233
ATOMS131the atoms involved in each of the contacts you wish to calculate=190,234
ATOMS132the atoms involved in each of the contacts you wish to calculate=190,235
ATOMS133the atoms involved in each of the contacts you wish to calculate=190,236
ATOMS134the atoms involved in each of the contacts you wish to calculate=190,237
ATOMS135the atoms involved in each of the contacts you wish to calculate=190,238
ATOMS136the atoms involved in each of the contacts you wish to calculate=190,239
ATOMS137the atoms involved in each of the contacts you wish to calculate=190,240
ATOMS138the atoms involved in each of the contacts you wish to calculate=190,241
ATOMS139the atoms involved in each of the contacts you wish to calculate=190,242
ATOMS140the atoms involved in each of the contacts you wish to calculate=190,243
ATOMS141the atoms involved in each of the contacts you wish to calculate=190,244
ATOMS142the atoms involved in each of the contacts you wish to calculate=190,257
ATOMS143the atoms involved in each of the contacts you wish to calculate=190,258
ATOMS144the atoms involved in each of the contacts you wish to calculate=191,260
ATOMS145the atoms involved in each of the contacts you wish to calculate=192,260
ATOMS146the atoms involved in each of the contacts you wish to calculate=192,261
ATOMS147the atoms involved in each of the contacts you wish to calculate=193,260
ATOMS148the atoms involved in each of the contacts you wish to calculate=193,261
ATOMS149the atoms involved in each of the contacts you wish to calculate=193,262
ATOMS150the atoms involved in each of the contacts you wish to calculate=194,260
ATOMS151the atoms involved in each of the contacts you wish to calculate=194,261
ATOMS152the atoms involved in each of the contacts you wish to calculate=194,262
ATOMS153the atoms involved in each of the contacts you wish to calculate=195,260
ATOMS154the atoms involved in each of the contacts you wish to calculate=195,261
ATOMS155the atoms involved in each of the contacts you wish to calculate=196,260
ATOMS156the atoms involved in each of the contacts you wish to calculate=197,260
ATOMS157the atoms involved in each of the contacts you wish to calculate=211,260
ATOMS158the atoms involved in each of the contacts you wish to calculate=219,260
ATOMS159the atoms involved in each of the contacts you wish to calculate=221,260
ATOMS160the atoms involved in each of the contacts you wish to calculate=222,260
ATOMS161the atoms involved in each of the contacts you wish to calculate=223,260
ATOMS162the atoms involved in each of the contacts you wish to calculate=229,260
ATOMS163the atoms involved in each of the contacts you wish to calculate=229,261
ATOMS164the atoms involved in each of the contacts you wish to calculate=230,260
ATOMS165the atoms involved in each of the contacts you wish to calculate=230,261
ATOMS166the atoms involved in each of the contacts you wish to calculate=231,260
ATOMS167the atoms involved in each of the contacts you wish to calculate=231,261
ATOMS168the atoms involved in each of the contacts you wish to calculate=232,260
ATOMS169the atoms involved in each of the contacts you wish to calculate=232,261
ATOMS170the atoms involved in each of the contacts you wish to calculate=233,260
ATOMS171the atoms involved in each of the contacts you wish to calculate=234,260
ATOMS172the atoms involved in each of the contacts you wish to calculate=234,261
ATOMS173the atoms involved in each of the contacts you wish to calculate=236,260
ATOMS174the atoms involved in each of the contacts you wish to calculate=237,260
ATOMS175the atoms involved in each of the contacts you wish to calculate=238,260
ATOMS176the atoms involved in each of the contacts you wish to calculate=239,260
ATOMS177the atoms involved in each of the contacts you wish to calculate=240,260
ATOMS178the atoms involved in each of the contacts you wish to calculate=241,260
ATOMS179the atoms involved in each of the contacts you wish to calculate=241,261
ATOMS180the atoms involved in each of the contacts you wish to calculate=242,260
ATOMS181the atoms involved in each of the contacts you wish to calculate=243,260
ATOMS182the atoms involved in each of the contacts you wish to calculate=243,261
ATOMS183the atoms involved in each of the contacts you wish to calculate=244,260
ATOMS184the atoms involved in each of the contacts you wish to calculate=245,260
ATOMS185the atoms involved in each of the contacts you wish to calculate=246,260
ATOMS186the atoms involved in each of the contacts you wish to calculate=247,260
ATOMS187the atoms involved in each of the contacts you wish to calculate=248,260
ATOMS188the atoms involved in each of the contacts you wish to calculate=255,260
ATOMS189the atoms involved in each of the contacts you wish to calculate=256,260
ATOMS190the atoms involved in each of the contacts you wish to calculate=256,261
ATOMS191the atoms involved in each of the contacts you wish to calculate=257,260
ATOMS192the atoms involved in each of the contacts you wish to calculate=257,261
ATOMS193the atoms involved in each of the contacts you wish to calculate=258,261
ATOMS194the atoms involved in each of the contacts you wish to calculate=258,262
ATOMS195the atoms involved in each of the contacts you wish to calculate=259,262
ATOMS196the atoms involved in each of the contacts you wish to calculate=298,301
ATOMS197the atoms involved in each of the contacts you wish to calculate=300,303
ATOMS198the atoms involved in each of the contacts you wish to calculate=304,307
ATOMS199the atoms involved in each of the contacts you wish to calculate=318,321
ATOMS200the atoms involved in each of the contacts you wish to calculate=321,324
ATOMS201the atoms involved in each of the contacts you wish to calculate=321,325
ATOMS202the atoms involved in each of the contacts you wish to calculate=321,326
ATOMS203the atoms involved in each of the contacts you wish to calculate=322,325
ATOMS204the atoms involved in each of the contacts you wish to calculate=322,326
ATOMS205the atoms involved in each of the contacts you wish to calculate=323,326
ATOMS206the atoms involved in each of the contacts you wish to calculate=323,327
ATOMS207the atoms involved in each of the contacts you wish to calculate=324,327
ATOMS208the atoms involved in each of the contacts you wish to calculate=325,328
ATOMS209the atoms involved in each of the contacts you wish to calculate=326,329
ATOMS210the atoms involved in each of the contacts you wish to calculate=348,351
ATOMS211the atoms involved in each of the contacts you wish to calculate=350,353
ATOMS212the atoms involved in each of the contacts you wish to calculate=351,354
ATOMS213the atoms involved in each of the contacts you wish to calculate=352,355
ATOMS214the atoms involved in each of the contacts you wish to calculate=357,360
ATOMS215the atoms involved in each of the contacts you wish to calculate=360,363
ATOMS216the atoms involved in each of the contacts you wish to calculate=371,374
ATOMS217the atoms involved in each of the contacts you wish to calculate=376,379
ATOMS218the atoms involved in each of the contacts you wish to calculate=386,389
ATOMS219the atoms involved in each of the contacts you wish to calculate=392,395
ATOMS220the atoms involved in each of the contacts you wish to calculate=394,397
ATOMS221the atoms involved in each of the contacts you wish to calculate=396,399
ATOMS222the atoms involved in each of the contacts you wish to calculate=399,402
ATOMS223the atoms involved in each of the contacts you wish to calculate=400,403
ATOMS224the atoms involved in each of the contacts you wish to calculate=402,405
ATOMS225the atoms involved in each of the contacts you wish to calculate=402,406
ATOMS226the atoms involved in each of the contacts you wish to calculate=407,411
ATOMS227the atoms involved in each of the contacts you wish to calculate=408,411
SWITCHThe switching functions to use for each of the contacts in your map. Options for this keyword are explained in the documentation for LESS_THAN.={CUSTOM FUNC=x R_0=1}
...

af_dist_rest: CONSTANTCreate a constant value that can be passed to actions More details VALUESthe numbers that are in your constant value=1.0032847926020623,1.0311901761218905,0.7455537494271994,1.7088723132386805,1.713635583035648,1.5095473634079102,1.1722138326615095,1.2549746362492442,0.9444370301440359,1.2123430594801905,1.5226123476400972,1.3369803665205837,1.4350552991032601,1.271596952714026,0.8981292195618154,1.084396699629724,1.2897209025919436,1.5121250515803697,1.0559752460569143,1.0836912801489234,0.707867799885571,0.9799594385549426,1.2259459158405663,1.5500808618962765,0.9052655544131994,1.3762398231774569,1.5152623694390062,1.68192987870425,1.6158358810469509,1.3273277390748264,1.1055688032880424,0.7953455133363603,1.0522321155294776,1.3843332368880512,1.5040866650640965,1.9200282409787175,1.9061048422008757,1.6269824001938105,1.2354281768202782,1.0676583984866739,0.6573523612692953,0.6149551127105952,0.7450687747448683,0.7618590366095304,0.5613296514376999,1.0004315715283156,0.8841317959129811,0.5908093221485615,0.9980626434087752,1.263882938399911,1.1281702172011137,1.1415027465671301,1.3193011650815607,1.4435925820842384,1.1070262966677549,1.31037020906806,0.8523610839620233,0.6740215603262186,1.1396584818139672,0.7467208079993726,1.1898928672075273,0.4552792670205237,0.8395836766809226,1.017876618169248,1.3974865483120085,1.0051763331517576,1.1795675404369834,1.4049736192449929,1.459107712842524,1.5650913815945389,1.59471937045455,1.5574198851361871,1.3527641544118525,1.4486837401986123,1.1706370314583183,1.4376086220145226,1.1653784492984414,1.7256552413105966,1.4055226838216186,1.427379228360951,0.9732663879171014,1.2228183863684539,0.9791120953857901,1.3816555082798005,0.7472525445744396,1.2260105818510056,1.0942220810800791,1.5762166528031232,1.1099413389340045,1.5934589028358461,1.434581000171602,1.630307266302407,1.2566113555803897,1.5485478518530726,1.81100521478802,1.3977122131735087,1.7663343697786331,1.162875016592443,1.430508084408939,1.6525550663471222,1.7831156572327018,1.785999870300293,1.6451806398108602,1.4654783833771945,1.2249537132680417,1.3939366523176433,1.0378110969439147,1.3681153113022448,0.9096965923905374,1.0000388860702516,1.2344506287947297,0.8380141992121936,0.8398237504065037,1.0381346080452205,1.4053251046687365,2.167353528179228,1.9828473469242454,1.528205112926662,1.8880876734852792,2.016520819067955,1.5591710267588497,1.5430319080129267,1.4479076098650694,1.236793963611126,1.3141041703522205,1.5537533987313508,1.5692297449335457,1.121472422592342,1.1581335106864572,0.91726502366364,0.9532682375982404,1.2505696462467313,1.1205617936328052,0.6651569686830044,1.0967526400461791,1.140981236472726,0.6660797173157335,0.8100334141403437,1.2571399945765735,1.1800085892900825,0.9563456442207099,1.2749242424964906,1.1340990519151093,0.9276029605418444,0.5047679111361504,0.9407211143523457,0.6309511506929995,1.074688763730228,1.2769522689282895,0.5026340553537011,0.7528656773269176,1.0695354964584112,0.9779949204996229,1.300148520246148,1.1204699540510774,1.5327852481976152,1.4124552657827738,1.2289950992912055,1.0769147641956807,1.4084996918216348,1.2656738823279738,1.0495817463845016,1.1779037110507489,1.095422700792551,1.3921284958720208,0.6597456347197295,1.0181769583374263,0.9364564327523113,1.3884215405210854,0.9055566122755409,1.1202643141150477,1.596531630679965,1.518569000810385,1.201885962113738,1.5418776268139482,1.3921274995431305,0.8939561096951366,1.1407407995313406,1.4240611214190722,1.4680646168068052,1.164111346192658,1.5423512058332562,0.9587342431768777,1.234714117459953,1.4588959828019143,1.6841880340129138,1.6086150078102948,1.4471713358536364,1.2795427026227117,1.444847053103149,1.002940315194428,1.3102364122867585,0.9022639036178589,1.2806951073929669,0.989768156595528,0.9441032137721775,0.9244450947269796,0.9194099459797145,0.9374097302556038,0.7403792202472688,0.8557088484987617,1.1484702169895173,0.7273479776456953,0.8502402873709798,0.6981262018904091,0.8579837949946523,0.7507739521563054,0.7508660649880767,0.7793322708457708,0.9225482998415828,0.9773600473999976,0.9583356784656645,0.9616499662399293,0.9474486894905567,1.0015693807974457,0.9874830450862646,0.9377102639526129,0.9753739142790437,0.9764441156759859,0.973571441695094,0.950638056918979,0.9416109262034296,0.9724794756621122,0.966675561480224,1.2231912130489944,1.235738294199109,0.9654571769759062 NODERIV af_dist2: CONSTANTCreate a constant value that can be passed to actions More details VALUESthe numbers that are in your constant value=0 NODERIV Rg: GYRATIONCalculate the radius of gyration, or other properties related to it. More details TYPE The type of calculation relative to the Gyration Tensor you want to perform=RADIUS ATOMSthe group of atoms that you are calculating the Gyration Tensor for=1-414 RMSD1: RMSDCalculate the RMSD with respect to a reference structure. More details REFERENCEa file in pdb format containing the reference structure and the atoms involved in the CV=struct1.pdb TYPE the manner in which RMSD alignment is performed=OPTIMAL RMSD2: RMSDCalculate the RMSD with respect to a reference structure. More details REFERENCEa file in pdb format containing the reference structure and the atoms involved in the CV=struct2.pdb TYPE the manner in which RMSD alignment is performed=OPTIMAL RMSD3: RMSDCalculate the RMSD with respect to a reference structure. More details REFERENCEa file in pdb format containing the reference structure and the atoms involved in the CV=struct3.pdb TYPE the manner in which RMSD alignment is performed=OPTIMAL uwall: UPPER_WALLSDefines a wall for the value of one or more collective variables, More details ARGthe arguments on which the bias is acting=RMSD1,RMSD2,RMSD3 ATthe positions of the wall=0.02,0.02,0.02 KAPPAthe force constant for the wall=100000,100000,100000 EXP the powers for the walls=2,2,2 EPS the values for s_i in the expression for a wall=1,1,1 OFFSET the offset for the start of the wall=0,0,0 PRINTPrint quantities to a file. More details FILEthe name of the file on which to output these quantities=DISTANCE_MAP_REST ARGthe labels of the values that you would like to print to the file=distance_rest_domains.* STRIDE the frequency with which the quantities of interest should be output=200 PRINTPrint quantities to a file. More details FILEthe name of the file on which to output these quantities=COLVAR ARGthe labels of the values that you would like to print to the file=__FILL__ STRIDE the frequency with which the quantities of interest should be output=200 PBMETADUsed to performed Parallel Bias metadynamics. More details ... LABELa label for the action so that its output can be referenced in the input to other actions=pb ARGthe labels of the scalars on which the bias will act=__FILL__ SIGMAthe widths of the Gaussian hills=__FILL__ SIGMA_MINthe lower bounds for the sigmas (in CV units) when using adaptive hills=__FILL__ SIGMA_MAXthe upper bounds for the sigmas (in CV units) when using adaptive hills=__FILL__ ADAPTIVEuse a geometric (=GEOM) or diffusion (=DIFF) based hills width scheme=DIFF HEIGHTthe height of the Gaussian hills, one for all biases=__FILL__ PACEthe frequency for hill addition, one for all biases=200 BIASFACTORuse well tempered metadynamics with this bias factor, one for all biases=__FILL__ GRID_MINthe lower bounds for the grid=__FILL__ GRID_MAXthe upper bounds for the grid=__FILL__ GRID_WSTRIDEfrequency for dumping the grid=__FILL__ WALKERS_MPI Switch on MPI version of multiple walkers - not compatible with WALKERS_* options other than WALKERS_DIR TEMPthe system temperature - this is only needed if you are doing well-tempered metadynamics=__FILL__ ... PBMETAD METAINFERENCECalculates the Metainference energy for a set of experimental data. More details ... ARGthe labels of the scalars on which the bias will act=(distance_rest_domains.*),pb.bias REWEIGHT simple REWEIGHT using the latest ARG as energy PARARGreference values for the experimental data, these can be provided as arguments without derivatives=(af_dist_rest.*) SIGMA_MEAN0starting value for the uncertainty in the mean estimate=1 NOISETYPE functional form of the noise (GAUSS,MGAUSS,OUTLIERS,MOUTLIERS,GENERIC)=MGAUSS OPTSIGMAMEAN Set to NONE/SEM to manually set sigma mean, or to estimate it on the fly=SEM AVERAGINGStride for calculation of averaged weights and sigma_mean=200 SIGMA0 initial value of the uncertainty parameter=10.0 SIGMA_MIN minimum value of the uncertainty parameter=0.0001 SIGMA_MAX maximum value of the uncertainty parameter=10.0 DSIGMAmaximum MC move of the uncertainty parameter=0.1 MC_STEPSnumber of MC steps=10 MC_CHUNKSIZEMC chunksize=23 WRITE_STRIDE write the status to a file every N steps, this can be used for restart/continuation=10000 TEMPthe system temperature - this is only needed if code doesn't pass the temperature to plumed=__FILL__ LABELa label for the action so that its output can be referenced in the input to other actions=af_mi_rest_domains ... METAINFERENCE FLUSHThis command instructs plumed to flush all the open files with a user specified frequency. More details STRIDEthe frequency with which all the open files should be flushed=200 PRINTPrint quantities to a file. More details FILEthe name of the file on which to output these quantities=ENERGY ARGthe labels of the values that you would like to print to the file=pb.bias STRIDE the frequency with which the quantities of interest should be output=200 PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=af_mi_rest_domains.* STRIDE the frequency with which the quantities of interest should be output=200 FILEthe name of the file on which to output these quantities=BAYES_rest_domains ENDPLUMEDTerminate plumed input. More details

Make the PLUMED analysis file python plumed_analysis.dat

#Make the plumed_analysis.dat file
shutil.copy2(dir+"/../scripts_prep/make_plumed_analysis.py", dir)
path_gen_analysis = dir+'/make_plumed_analysis.py sequence.dat'
os.system(f'python {path_gen_analysis}')

Similarly the plumed_analysis file is used to calculate the weights using the Torrie valeau weights as done here. For TDP-43 WtoA, the plumed_analysis.dat can be found here

Note: This tutorial assumes that you know Parallel Bias Metadynamics and Metainference theory and practice.

In case you are running the TDP-43 WtoA example:

You can directly use the PBMetaD and Metainference parameters just as copied below by executing the next shell. Otherwise you need to define your system specific parameters.

shutil.copy2(dir+"/../scripts_prep/plumed_TDP-43.dat", dir+'/plumed.dat')
shutil.copy2(dir+"/../scripts_prep/plumed_analysis_TDP-43.dat", dir+'/plumed_analysis.dat')

Short energy minimization using OPENMM and CALVADOS2

shutil.copy2(dir+"/../scripts_prep/simulate_em.py", dir)
simulate_em = dir+'/simulate_em.py '+str(pH)+' '+str(temp)
os.system(f'python {simulate_em}')

Run AF-MI

shutil.copy2(dir+"/../scripts_prep/simulate.py", dir)
!mpirun -np {NR} python simulate.py {pH} {temp}
Back to AlphaFold-Metainference home