<jupyter_start><jupyter_text>Using LigandSwap to Calculate Relative Binding Free EnergiesLigandSwap is distributed as part of Sire. The program is found in the `$SIRE/bin` directory, assuming that `$SIRE` has been set to the directory in which Sire is installed. This notebook relies on the ligandswap that comes with version 2018.1 or later of Sire. You can check that the version by running the below command...<jupyter_code>! $SIRE/bin/ligandswap --version<jupyter_output><empty_output><jupyter_text>Assuming everything is fine you should see something similar to this printed```Starting /opt/conda/bin/ligandswap: number of threads equals 2ligandswap version 1.0 implemented usingSire 2018.1.0 [devel|cd98482, clean]```  Understanding the inputLigandswap calculates the relative binding free energy of two ligands, A and B, to the same protein. As input it needs;* An amber-format topology file and coordinate file for the protein bound to ligand A, in a cubic periodic box of water.* An amber-format topology file and coordinate file containing ligand B. The file should contain the ligand equilibrated in a periodoc box (e.g. bound to the protein or free in water). Only the coordinates and parameters of ligand B will be taken from this file. However, it is useful to use the ligand bound to the desired protein, as this ensures that ligand B is in a conformation that resembles the equilibrated binding mode.* Optionally A configuration file that overrides the default parameters for the ligandswap calculation.The ligandswap directory that comes with this notebook contains all of the files that are needed to calculate the relative free energy of the ligands FMC and CTI to the protein nicotinic amide receptor.The files in this directory that are needed for ligandswap are;* An amber-format topology (rec_fmc.top) and coordinate file (fmc.30.crd) of FMC bound to nicotinic amide receptor. This is a pentameric protein with 5 binding sites, and so contains 5 bound FMC ligands. One of the ligands has been renamed to “FM1” so that it can be identified and swapped during the ligandswap simulation. The complex is in a cubic periodic box of TIP3P water, and has already been equilibrated for 30 nanoseconds using molecular dynamics.* An amber-format topology (rec_cti.top) and coordinate file (cti.30.crd) of CTI also bound to nicotinic amide receptor.You can see these files by listing the contents of this directory...<jupyter_code>! ls<jupyter_output><empty_output><jupyter_text>The input files are currently compressed to save space. We need to uncompress them before we can run any calculations.<jupyter_code>! bunzip2 -k *.crd.bz2 *.top.bz2; ls<jupyter_output><empty_output><jupyter_text>The input files describe a pentameric protein that is binding five FMC ligands (one of which is called FM1). You can view the molecules using the "viewMolecules" function that comes from [BioSimSpace](https://biosimspace.org). We are viewing molecules 0-10 as the first five molecules are protein, and the next five are ligand.Use the "representations" tab to change the protein to a cartoon representation and to view the ligands ("FMC") as licorice. Show the FMC ligand that will be swapped (called "FM1") as spacefill. Can you see it in the structure. Is it similar to the other ligands?<jupyter_code>import BioSimSpace as BSS
v = BSS.viewMolecules(["rec_fmc.top", "fmc.30.crd"], range(0,10))<jupyter_output><empty_output><jupyter_text>Running a LigandSwap CalculationThe general way to run a ligandswap calculation is by typing;```$SIRE/bin/ligandswap -t0 complex_a.top -c0 complex_a.crd -l0 NAME_A -t1 lig_b.top -c1 lig_b.crd -l1 NAME_B -C config```where* complex_a.top is the name of the topology file containing the protein bound to ligand A in a periodic cubic box of water* complex_a.crd is the corresponding coordinate file to complex_a.top* NAME_A is the residue name of one of the residues in ligand A. Note that only one molecule in complex_a.top should have this name, as ligandswap can only swap one ligand at a time.* lig_b.top is the name of the topology file containing ligand B* lig_b.crd is the corresponding coordinate file to lig_b.crd* NAME_B is the residue name of one of the residues in ligand B. Again, note that only one molecule in lig_b.top should have this name.* config is the name of the (optional) config file to control ligandswap.In our case, we could run a ligandswap calculation using the following command;<jupyter_code>! $SIRE/bin/ligandswap -t0 rec_fmc.top -c0 fmc.30.crd -l0 FM1 -t1 rec_cti.top -c1 cti.30.crd -l1 CTI<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.05641472446090177, 'fraction_numerical': 0.01285123066869963, 'mean_word_length': 4.963636363636364, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '228586', 'license': 'MIT', 'n_tokens_mistral': 1372, 'n_tokens_neox': 1250, 'n_words': 660, 'path': 'ligandswap/01_running_ligandswap.ipynb', 'repo_name': 'CCPBioSim/xswaps', 'size': '4591'}