<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.docking.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Iamkaant</id>
	<title>DISI - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.docking.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Iamkaant"/>
	<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Special:Contributions/Iamkaant"/>
	<updated>2026-04-08T04:27:10Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.1</generator>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Create_ChemDraw_files_with_Python&amp;diff=17004</id>
		<title>Create ChemDraw files with Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Create_ChemDraw_files_with_Python&amp;diff=17004"/>
		<updated>2025-12-05T22:39:24Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: Created page with &amp;quot;== Complete Manual: Displaying Chemical Structures in ChemDraw Format Using pycdxml ==  === Overview ===  The pycdxml package enables platform-independent manipulation of ChemDraw files (CDX and CDXML formats) through Python. The CDXMLSlideGenerator module creates professional structure sheets by arranging molecules in grids with associated properties, outputting standard ChemDraw documents that can be further edited by users.  === Installation ===  Create a conda enviro...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Complete Manual: Displaying Chemical Structures in ChemDraw Format Using pycdxml ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
&lt;br /&gt;
The pycdxml package enables platform-independent manipulation of ChemDraw files (CDX and CDXML formats) through Python. The CDXMLSlideGenerator module creates professional structure sheets by arranging molecules in grids with associated properties, outputting standard ChemDraw documents that can be further edited by users.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
Create a conda environment with required dependencies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
name: pycdxml&lt;br /&gt;
channels:  &lt;br /&gt;
  - conda-forge &lt;br /&gt;
  - defaults   &lt;br /&gt;
dependencies:&lt;br /&gt;
  - python&amp;gt;=3.8  &lt;br /&gt;
  - rdkit&amp;gt;=2020.09.1 &lt;br /&gt;
  - numpy&lt;br /&gt;
  - pyyaml&lt;br /&gt;
  - lxml&lt;br /&gt;
  - fonttools&lt;br /&gt;
  - matplotlib&lt;br /&gt;
  - pip&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the environment and package:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
conda env create -f environment.yml&lt;br /&gt;
conda activate pycdxml&lt;br /&gt;
python -m pip install -e /path/to/PyCDXML&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Core Workflow for Structure Display ===&lt;br /&gt;
&lt;br /&gt;
The typical workflow consists of four main steps:&lt;br /&gt;
&lt;br /&gt;
# Read molecular structures from an SD file using RDKit&lt;br /&gt;
# Convert to CDXML format using the cdxml_converter module&lt;br /&gt;
# Extract properties from molecules to display alongside structures&lt;br /&gt;
# Generate slide using CDXMLSlideGenerator with customizable layout&lt;br /&gt;
&lt;br /&gt;
=== Detailed Implementation ===&lt;br /&gt;
&lt;br /&gt;
==== Step 1: Import Required Modules ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
from rdkit import Chem&lt;br /&gt;
from pycdxml import cdxml_slide_generator, cdxml_converter&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Step 2: Load Molecular Structures ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Read from command line or specify path directly&lt;br /&gt;
input_file = sys.argv[1]  # or use explicit path&lt;br /&gt;
suppl = Chem.SDMolSupplier(input_file)&lt;br /&gt;
molecules = [x for x in suppl]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important considerations:&#039;&#039;&#039;&lt;br /&gt;
* Works best with standard small molecules&lt;br /&gt;
* May have issues with organometallics, polymers, or complex structures&lt;br /&gt;
* Each molecule treated as a separate entity (similar to MOL file concept)&lt;br /&gt;
&lt;br /&gt;
==== Step 3: Convert Molecules to CDXML Format ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
cdxmls = []&lt;br /&gt;
for mol in molecules:    &lt;br /&gt;
    cdxml = cdxml_converter.mol_to_document(mol).to_cdxml()&lt;br /&gt;
    cdxmls.append(cdxml)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;mol_to_document()&amp;lt;/code&amp;gt; method creates a ChemDraw document object, and &amp;lt;code&amp;gt;to_cdxml()&amp;lt;/code&amp;gt; converts it to the CDXML XML string format.&lt;br /&gt;
&lt;br /&gt;
==== Step 4: Extract and Configure Properties ====&lt;br /&gt;
&lt;br /&gt;
Properties appear as text annotations below each structure. The &amp;lt;code&amp;gt;TextProperty&amp;lt;/code&amp;gt; class defines how each property displays:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
all_props = []&lt;br /&gt;
for mol in molecules:&lt;br /&gt;
    props = [&lt;br /&gt;
        cdxml_slide_generator.TextProperty(&#039;SOURCE_ID&#039;, &lt;br /&gt;
                                          mol.GetProp(&amp;quot;SOURCE_ID&amp;quot;), &lt;br /&gt;
                                          color=&#039;#3f6eba&#039;),&lt;br /&gt;
        cdxml_slide_generator.TextProperty(&#039;MG_ID&#039;, &lt;br /&gt;
                                          mol.GetProp(&amp;quot;MG_ID&amp;quot;))&lt;br /&gt;
    ]&lt;br /&gt;
    all_props.append(props)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TextProperty parameters:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039;: Property label (displayed if show_name=True)&lt;br /&gt;
* &#039;&#039;&#039;value&#039;&#039;&#039;: The actual property value from molecule data&lt;br /&gt;
* &#039;&#039;&#039;color&#039;&#039;&#039;: Hex color code (e.g., &#039;#3f6eba&#039; for blue)&lt;br /&gt;
* &#039;&#039;&#039;show_name&#039;&#039;&#039;: Boolean to display/hide the property name&lt;br /&gt;
&lt;br /&gt;
==== Step 5: Generate the Slide ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
sg = cdxml_slide_generator.CDXMLSlideGenerator(&lt;br /&gt;
    style=&amp;quot;ACS 1996&amp;quot;,           # ChemDraw style template&lt;br /&gt;
    number_of_properties=2,      # Properties per molecule&lt;br /&gt;
    columns=5,                   # Grid columns&lt;br /&gt;
    rows=10,                     # Grid rows&lt;br /&gt;
    slide_width=50,              # Page width (cm)&lt;br /&gt;
    slide_height=70              # Page height (cm)&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
slide = sg.generate_slide(cdxmls, all_props)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CDXMLSlideGenerator parameters:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;style&#039;&#039;&#039;: ChemDraw style name (e.g., &amp;quot;ACS 1996&amp;quot;) - determines bond length, font sizes, display preferences&lt;br /&gt;
* &#039;&#039;&#039;number_of_properties&#039;&#039;&#039;: Must match the number of TextProperty objects per molecule&lt;br /&gt;
* &#039;&#039;&#039;columns&#039;&#039;&#039; and &#039;&#039;&#039;rows&#039;&#039;&#039;: Grid layout (5×10 = 50 structures per page)&lt;br /&gt;
* &#039;&#039;&#039;slide_width&#039;&#039;&#039; and &#039;&#039;&#039;slide_height&#039;&#039;&#039;: Document dimensions in centimeters&lt;br /&gt;
&lt;br /&gt;
==== Step 6: Save Output File ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
output_file = sys.argv[2]  # or specify path&lt;br /&gt;
with open(output_file, &amp;quot;w&amp;quot;, encoding=&#039;UTF-8&#039;) as xf:&lt;br /&gt;
    xf.write(slide)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Critical encoding note:&#039;&#039;&#039; Always use &amp;lt;code&amp;gt;encoding=&#039;UTF-8&#039;&amp;lt;/code&amp;gt; to ensure proper character handling, especially for special characters in compound names or properties.&lt;br /&gt;
&lt;br /&gt;
=== Command-Line Usage ===&lt;br /&gt;
&lt;br /&gt;
Create a script (e.g., &amp;lt;code&amp;gt;generate_structures.py&amp;lt;/code&amp;gt;) and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
python generate_structures.py input_structures.sdf output_slide.cdxml&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Advanced Features ===&lt;br /&gt;
&lt;br /&gt;
==== Style Application ====&lt;br /&gt;
&lt;br /&gt;
Apply consistent ChemDraw styles across all structures. The styler module can convert existing CDXML files to a target style:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from pycdxml import cdxml_styler&lt;br /&gt;
&lt;br /&gt;
styler = cdxml_styler.CDXMLStyler(style_source=&amp;quot;/path/to/ACS 1996.cdxml&amp;quot;)&lt;br /&gt;
styler.apply_style_to_file(&#039;input.cdxml&#039;, outpath=&#039;output.cdxml&#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Style affects:&#039;&#039;&#039;&lt;br /&gt;
* Bond lengths and widths&lt;br /&gt;
* Atom label font sizes&lt;br /&gt;
* Hydrogen display (implicit vs explicit)&lt;br /&gt;
* Stereochemistry indicators&lt;br /&gt;
* Overall visual presentation&lt;br /&gt;
&lt;br /&gt;
==== Format Conversions ====&lt;br /&gt;
&lt;br /&gt;
Convert between CDXML (XML text) and CDX (binary) formats:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# CDX to CDXML&lt;br /&gt;
doc = cdxml_converter.read_cdx(&#039;/path/to/structure.cdx&#039;)    &lt;br /&gt;
cdxml_converter.write_cdxml_file(doc, &#039;/path/to/structure.cdxml&#039;)&lt;br /&gt;
&lt;br /&gt;
# CDXML to base64-encoded CDX&lt;br /&gt;
doc = cdxml_converter.read_cdxml(&#039;/path/to/structure.cdxml&#039;)&lt;br /&gt;
b64_cdx = cdxml_converter.to_b64_cdx(doc)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Property Annotations for SD File Export ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important feature:&#039;&#039;&#039; All visible properties are automatically annotated to the molecules in the CDXML file. If you open the generated CDXML in ChemDraw and save as an SD file, all displayed properties will be included in the SD file output.&lt;br /&gt;
&lt;br /&gt;
=== Practical Tips ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For Large Datasets:&#039;&#039;&#039;&lt;br /&gt;
* Process in batches if dealing with thousands of structures&lt;br /&gt;
* Calculate optimal rows/columns based on page size and readability&lt;br /&gt;
* Consider multiple pages rather than overcrowding single page&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Property Display:&#039;&#039;&#039;&lt;br /&gt;
* Limit to 2-4 properties per structure for readability&lt;br /&gt;
* Use color coding to highlight important values (e.g., red for high activity)&lt;br /&gt;
* Include units in property names when showing numerical values&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Layout Optimization:&#039;&#039;&#039;&lt;br /&gt;
* Standard 5×10 grid (50 structures) works well for A3/tabloid size printouts&lt;br /&gt;
* For presentations, consider 4×3 or 5×4 grids for better visibility&lt;br /&gt;
* Adjust slide_width and slide_height to match intended output format&lt;br /&gt;
&lt;br /&gt;
=== Output and Compatibility ===&lt;br /&gt;
&lt;br /&gt;
The generated CDXML file is a fully valid ChemDraw document that can be:&lt;br /&gt;
* Opened and edited in ChemDraw Desktop&lt;br /&gt;
* Converted to PDF, PNG, or other formats via ChemDraw&lt;br /&gt;
* Modified by end users (chemists) to adjust layouts, add annotations, or change styles&lt;br /&gt;
* Saved as SD files with all property annotations preserved&lt;br /&gt;
&lt;br /&gt;
=== Known Limitations ===&lt;br /&gt;
&lt;br /&gt;
* Very old CDX files (~ChemDraw 7 era) may fail to parse correctly&lt;br /&gt;
* Complex molecules (organometallics, polymers) may have conversion issues&lt;br /&gt;
* Package focuses on &amp;quot;file-level&amp;quot; operations, not chemical validation&lt;br /&gt;
* Style translation may not perfectly position additional drawing elements (brackets, arrows) relative to molecules&lt;br /&gt;
&lt;br /&gt;
=== Complete Example Script ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
Generate ChemDraw structure sheet from SD file&lt;br /&gt;
Usage: python script.py input.sdf output.cdxml&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
import sys&lt;br /&gt;
from rdkit import Chem&lt;br /&gt;
from pycdxml import cdxml_slide_generator, cdxml_converter&lt;br /&gt;
&lt;br /&gt;
# Read input file&lt;br /&gt;
input_sdf = sys.argv[1]&lt;br /&gt;
output_cdxml = sys.argv[2]&lt;br /&gt;
&lt;br /&gt;
# Load molecules&lt;br /&gt;
suppl = Chem.SDMolSupplier(input_sdf)&lt;br /&gt;
molecules = [mol for mol in suppl if mol is not None]&lt;br /&gt;
&lt;br /&gt;
# Convert to CDXML&lt;br /&gt;
cdxmls = []&lt;br /&gt;
for mol in molecules:    &lt;br /&gt;
    cdxml = cdxml_converter.mol_to_document(mol).to_cdxml()&lt;br /&gt;
    cdxmls.append(cdxml)&lt;br /&gt;
&lt;br /&gt;
# Extract properties&lt;br /&gt;
all_props = []&lt;br /&gt;
for mol in molecules:&lt;br /&gt;
    props = [&lt;br /&gt;
        cdxml_slide_generator.TextProperty(&#039;ID&#039;, &lt;br /&gt;
                                          mol.GetProp(&amp;quot;SOURCE_ID&amp;quot;), &lt;br /&gt;
                                          color=&#039;#3f6eba&#039;),&lt;br /&gt;
        cdxml_slide_generator.TextProperty(&#039;Activity&#039;, &lt;br /&gt;
                                          mol.GetProp(&amp;quot;ACTIVITY&amp;quot;), &lt;br /&gt;
                                          show_name=True)&lt;br /&gt;
    ]&lt;br /&gt;
    all_props.append(props)&lt;br /&gt;
&lt;br /&gt;
# Generate slide&lt;br /&gt;
generator = cdxml_slide_generator.CDXMLSlideGenerator(&lt;br /&gt;
    style=&amp;quot;ACS 1996&amp;quot;,&lt;br /&gt;
    number_of_properties=2,&lt;br /&gt;
    columns=5,&lt;br /&gt;
    rows=10,&lt;br /&gt;
    slide_width=50,&lt;br /&gt;
    slide_height=70&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
slide = generator.generate_slide(cdxmls, all_props)&lt;br /&gt;
&lt;br /&gt;
# Save output&lt;br /&gt;
with open(output_cdxml, &amp;quot;w&amp;quot;, encoding=&#039;UTF-8&#039;) as f:&lt;br /&gt;
    f.write(slide)&lt;br /&gt;
&lt;br /&gt;
print(f&amp;quot;Generated {output_cdxml} with {len(molecules)} structures&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
&lt;br /&gt;
* pycdxml GitHub repository: https://github.com/kienerj/pycdxml&lt;br /&gt;
* Official ChemDraw CDX format specification: https://www.cambridgesoft.com/services/documentation/sdk/chemdraw/cdx/IntroCDX.htm&lt;br /&gt;
* RDKit documentation: https://www.rdkit.org/docs/&lt;br /&gt;
&lt;br /&gt;
[[Category:Cheminformatics]]&lt;br /&gt;
[[Category:Python]]&lt;br /&gt;
[[Category:Molecular Visualization]]&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Juggler&amp;diff=16974</id>
		<title>Juggler</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Juggler&amp;diff=16974"/>
		<updated>2025-10-31T22:21:46Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: first draft&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Goal ==&lt;br /&gt;
To optimize your matching sphere (MS) setups getting faster docking and more high-scoring ligands with fewer spheres.&lt;br /&gt;
== Description ==&lt;br /&gt;
The program performs optimization of matching spheres by pruning and stochastic optimization. It selects spheres from two sets:&lt;br /&gt;
* heavy atoms of xtal-lig &lt;br /&gt;
* spheres prepared by SPHGEN program&lt;br /&gt;
Juggler generates an initial MS set consisting of 100 spheres (maximum in DOCK 3.8). This set is used for retrospective docking, and then KDTree algorithm is used to prune the set to the required number of spheres by discarding all spheres that were not used in generation of the poses of the known binders (“actives”). This procedure is repeated to account for any differences in matching produced by reducing the MS set.  &lt;br /&gt;
&lt;br /&gt;
After this, the resulting set is transferred to the stepwise optimization procedure which conducts random perturbations of the sphere sets. Retrospective docking is done for each set, and sets are ranked by the &lt;br /&gt;
&lt;br /&gt;
* enrichment (normalized logAUC, see [http://arxiv.org/abs/2210.10905 Ian&#039;s paper]),&lt;br /&gt;
* the average score of the top 1% of ligands.&lt;br /&gt;
&lt;br /&gt;
The program consists of two main modules:&lt;br /&gt;
* a Python script (&amp;lt;code&amp;gt;juggler.py&amp;lt;/code&amp;gt;) that performs MS generation, optimization, and ranking.&lt;br /&gt;
* a Bash script (&amp;lt;code&amp;gt;rundockd.sh&amp;lt;/code&amp;gt;), that watches created directory structure, runs docking and processes docking results&lt;br /&gt;
== Setup &amp;amp; Running ==&lt;br /&gt;
=== Setup ===&lt;br /&gt;
Dependencies: rdkit, [https://github.com/docking-org/pydock3 pydock], [https://github.com/docking-org/SUBDOCK subdock].&lt;br /&gt;
&lt;br /&gt;
=== Preparation ===&lt;br /&gt;
What you need to prepare:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; directory with any tools of your liking (blastermaster, dockopt etc).&lt;br /&gt;
* &amp;lt;code&amp;gt;rec.crg.pdb&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;xtal-lig.pdb&amp;lt;/code&amp;gt;:  To get RMSD of xtal-lig docked poses to the experimental pose, your xtal-lig.pdb must have correct bond orders and atom valences. You can edit it in Schrodinger and save as &amp;lt;code&amp;gt;xtal-lig.pdb&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ligands.names&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;decoys.names&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;sdi&amp;lt;/code&amp;gt; file with the paths to ligand .tgz files..&lt;br /&gt;
&lt;br /&gt;
Prepare &amp;lt;code&amp;gt;juggler_config.yml&amp;lt;/code&amp;gt; file. Put the config into an empty directory.&amp;lt;syntaxhighlight lang=&amp;quot;yaml&amp;quot;&amp;gt;&lt;br /&gt;
################################################&lt;br /&gt;
# Paths for your target&lt;br /&gt;
rec_crg_file_path: &amp;quot;/test/rec.crg.pdb&amp;quot;&lt;br /&gt;
xtal_lig_file_path: &amp;quot;/test/xtal-lig.pdb&amp;quot;&lt;br /&gt;
dock_files_dir_path: &amp;quot;/test/dockfiles&amp;quot;&lt;br /&gt;
lig_names_file_path: &amp;quot;/test/ligands.names&amp;quot;&lt;br /&gt;
dec_names_file_path: &amp;quot;/test/decoys.names&amp;quot;&lt;br /&gt;
sdi_file_path: &amp;quot;test/ligands_sdi&amp;quot;&lt;br /&gt;
&lt;br /&gt;
################################################&lt;br /&gt;
# Executables and running&lt;br /&gt;
dockbase: &amp;quot;/path/to/DOCK&amp;quot;&lt;br /&gt;
dock64_bin: &amp;quot;path/to/dock64&amp;quot; &lt;br /&gt;
subdock_bash_file_path: &amp;quot;/path/to/subdock.bash&amp;quot;&lt;br /&gt;
queue_type: &amp;quot;sge&amp;quot; # &amp;quot;slurm&amp;quot; or &amp;quot;sge&amp;quot;&lt;br /&gt;
&lt;br /&gt;
###############################################&lt;br /&gt;
# Max and min number of spheres&lt;br /&gt;
min_sph: 4 # min is 4&lt;br /&gt;
max_sph: 10 # max is 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;code&amp;gt;dock64_bin&amp;lt;/code&amp;gt; parameter is optional, if this parameter is absent, &amp;lt;code&amp;gt;{dockbase}/docking/DOCK/bin/dock64&amp;lt;/code&amp;gt; will be used.&lt;br /&gt;
&lt;br /&gt;
=== Running ===&lt;br /&gt;
You can either &lt;br /&gt;
&lt;br /&gt;
* Enter a screen environment so your run is not interrupted if you disconnect your SSH session, or&lt;br /&gt;
* run Juggler using a queuing system. See example files for the slurm and sge below.&lt;br /&gt;
&lt;br /&gt;
In both cases you need to launch Juggler and docking daemon simultaneously. &lt;br /&gt;
&lt;br /&gt;
==== In a screen ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source /path/to/python/env&lt;br /&gt;
# rundockd should run in the background to manage docking jobs&lt;br /&gt;
sh rundockd.sh 2&amp;gt;&amp;amp;1 &amp;gt; rundockd.log &amp;amp;&lt;br /&gt;
python juggler.py 2&amp;amp;&amp;gt;1 &amp;gt; juggler.log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Via a queue ====&lt;br /&gt;
&lt;br /&gt;
===== SGE (Wynton) =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#! /bin/bash&lt;br /&gt;
#$ -cwd&lt;br /&gt;
#$ -q long.q&lt;br /&gt;
#$ -o stdout_juggler&lt;br /&gt;
#$ -e stdout_juggler&lt;br /&gt;
#$ -l s_rt=72:58:00&lt;br /&gt;
#$ -l h_rt=73:00:00&lt;br /&gt;
#$ -l mem_free=10G&lt;br /&gt;
#$ -pe smp 2&lt;br /&gt;
source /wynton/group/bks/soft/python_envs/env.sh&lt;br /&gt;
sh /wynton/group/bks/work/ak87/UCSF/JUGGLER/SCRIPTS/RELEASE/rundockd.sh 2&amp;gt;&amp;amp;1 &amp;gt; rundockd.log &amp;amp; #/dev/null &amp;amp;&lt;br /&gt;
python /wynton/group/bks/work/ak87/UCSF/JUGGLER/SCRIPTS/RELEASE/juggler.py 2&amp;gt;&amp;amp;1 &amp;gt; juggler.log&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== SLURM (Gimel) =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#! /bin/bash&lt;br /&gt;
#$ -cwd&lt;br /&gt;
#$ -q long.q&lt;br /&gt;
#$ -o stdout_juggler&lt;br /&gt;
#$ -e stdout_juggler&lt;br /&gt;
#$ -l s_rt=23:58:00&lt;br /&gt;
#$ -l h_rt=24:00:00&lt;br /&gt;
#$ -l mem_free=10G&lt;br /&gt;
source /nfs/soft/ian/python3.8.5.sh&lt;br /&gt;
sh /mnt/nfs/exa/work/ak87/UCSF/JUGGLER/SCRIPTS/RELEASE/rundockd.sh 2&amp;gt;&amp;amp;1 &amp;gt; rundockd.log &amp;amp; #/dev/null &amp;amp;&lt;br /&gt;
python /mnt/nfs/exa/work/ak87/UCSF/JUGGLER/SCRIPTS/RELEASE/orbebb.py 2&amp;gt;&amp;amp;1 &amp;gt; juggler.log&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== UCSF clusters ===&lt;br /&gt;
The scripts and example config file are in&lt;br /&gt;
&lt;br /&gt;
Wynton&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/wynton/group/bks/work/ak87/UCSF/JUGGLER/SCRIPTS/RELEASE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gimel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/mnt/nfs/exa/work/ak87/UCSF/JUGGLER/SCRIPTS/RELEASE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Queue type is &amp;lt;code&amp;gt;sge&amp;lt;/code&amp;gt; for Wynton and &amp;lt;code&amp;gt;slurm&amp;lt;/code&amp;gt; for Gimel (newer machines, like gimel5/gimel2/n-1-XXX...). &lt;br /&gt;
&lt;br /&gt;
=== Processing results ===&lt;br /&gt;
At the end of a run you will get a message that convergence was reached. You will see the directory &amp;lt;code&amp;gt;best_set&amp;lt;/code&amp;gt; that contains &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; and docking results for the best matching sphere set found. This directory is updated at each step, so if the run fails or convergence is not reached, you can still access the optimal set.&lt;br /&gt;
&lt;br /&gt;
Other files are&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;stepwise_opt_best_sets.dat&amp;lt;/code&amp;gt; lists the IDs and the nlogAUC values for the best set in each stepwise optimization round&lt;br /&gt;
* &amp;lt;code&amp;gt;stepwise_opt_metrics.dat&amp;lt;/code&amp;gt; lists IDs, nlogAUC, RMSD and average scores for the top 1% ligands for all sets tested during the stepwise optimization&lt;br /&gt;
* &amp;lt;code&amp;gt;juggler.log&amp;lt;/code&amp;gt; contains all the data for the run.&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Interactive_Molecular_Structure_Alignment_App_for_QSAR&amp;diff=16942</id>
		<title>Interactive Molecular Structure Alignment App for QSAR</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Interactive_Molecular_Structure_Alignment_App_for_QSAR&amp;diff=16942"/>
		<updated>2025-10-06T22:30:36Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Interactive Molecular Structure Alignment Application =&lt;br /&gt;
&lt;br /&gt;
A PyQt5-based interactive tool for aligning and visualizing molecular analogs with customizable highlighting, transformations, and high-resolution export capabilities.&lt;br /&gt;
&lt;br /&gt;
== Table of Contents ==&lt;br /&gt;
&lt;br /&gt;
* [[#Installation|Installation]]&lt;br /&gt;
* [[#Quick Start|Quick Start]]&lt;br /&gt;
* [[#Features|Features]]&lt;br /&gt;
* [[#User Interface|User Interface]]&lt;br /&gt;
* [[#Workflows|Workflows]]&lt;br /&gt;
* [[#File Formats|File Formats]]&lt;br /&gt;
* [[#Troubleshooting|Troubleshooting]]&lt;br /&gt;
* [[#Tips and Best Practices|Tips and Best Practices]]&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
You can find the program in &amp;lt;code&amp;gt;/mnt/nfs/exa/work/ak87/UCSF/SCRIPTS/SHOW_STRUCTURES/align-2d-struct-highlight_interactive.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
&lt;br /&gt;
* Python 3.7 or higher&lt;br /&gt;
* RDKit (chemistry toolkit)&lt;br /&gt;
* PyQt5 (GUI framework)&lt;br /&gt;
* Pillow (image processing)&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Installation ===&lt;br /&gt;
&lt;br /&gt;
==== Using Conda (Recommended) ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Create a new conda environment&lt;br /&gt;
conda create -n mol_aligner python=3.9&lt;br /&gt;
&lt;br /&gt;
# Activate the environment&lt;br /&gt;
conda activate mol_aligner&lt;br /&gt;
&lt;br /&gt;
# Install RDKit from conda-forge&lt;br /&gt;
conda install -c conda-forge rdkit&lt;br /&gt;
&lt;br /&gt;
# Install PyQt5 and Pillow&lt;br /&gt;
conda install pyqt pillow&lt;br /&gt;
# Or using pip&lt;br /&gt;
pip install rdkit PyQt5 pillow&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Installing RDKit via pip can be challenging on some systems. Conda installation is strongly recommended.&lt;br /&gt;
&lt;br /&gt;
=== Platform-Specific Notes ===&lt;br /&gt;
&lt;br /&gt;
==== macOS ====&lt;br /&gt;
* No additional steps required&lt;br /&gt;
* Font rendering uses system fonts (Helvetica, Arial)&lt;br /&gt;
&lt;br /&gt;
==== Linux ====&lt;br /&gt;
* Install font packages for better rendering:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt-get install fonts-dejavu-core  # Ubuntu/Debian&lt;br /&gt;
sudo yum install dejavu-sans-fonts      # CentOS/RHEL&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Windows ====&lt;br /&gt;
* No additional steps required&lt;br /&gt;
* Arial font is used by default&lt;br /&gt;
&lt;br /&gt;
== Quick Start ==&lt;br /&gt;
&lt;br /&gt;
=== Launching the Application ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python mol_aligner_app.py&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Workflow ===&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Load molecules:&#039;&#039;&#039; Click &amp;quot;Browse File&amp;quot; and select your SDF or SMILES file&lt;br /&gt;
# &#039;&#039;&#039;Set reference:&#039;&#039;&#039; Enter the SMILES string of your reference/core structure&lt;br /&gt;
# &#039;&#039;&#039;Configure display:&#039;&#039;&#039; Set number of columns (default: 4) and font size (default: 24)&lt;br /&gt;
# &#039;&#039;&#039;Click &amp;quot;Load &amp;amp; Align&amp;quot;:&#039;&#039;&#039; Molecules will be aligned and displayed&lt;br /&gt;
# &#039;&#039;&#039;Edit as needed:&#039;&#039;&#039; Select molecules, toggle highlights, rotate/mirror structures&lt;br /&gt;
# &#039;&#039;&#039;Export:&#039;&#039;&#039; Click &amp;quot;💾 Export High-Res PNG&amp;quot; to save your grid&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
=== Core Features ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Molecular Alignment:&#039;&#039;&#039; Automatically aligns analogs based on Maximum Common Substructure (MCS)&lt;br /&gt;
* &#039;&#039;&#039;Interactive Highlighting:&#039;&#039;&#039; Click atoms to toggle highlights on/off&lt;br /&gt;
* &#039;&#039;&#039;Structure Transformations:&#039;&#039;&#039; Rotate (90°) and mirror structures while keeping atom labels readable&lt;br /&gt;
* &#039;&#039;&#039;Flexible Display:&#039;&#039;&#039; Adjustable grid columns (1-10) and font sizes (16-48pt)&lt;br /&gt;
* &#039;&#039;&#039;Property Display:&#039;&#039;&#039; Show any molecular property as label (Catalog ID, Price, MW, LogP, etc.)&lt;br /&gt;
* &#039;&#039;&#039;High-Resolution Export:&#039;&#039;&#039; Export publication-quality PNG at 300 DPI&lt;br /&gt;
&lt;br /&gt;
=== Supported File Formats ===&lt;br /&gt;
&lt;br /&gt;
==== Input Files ====&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SDF (Structure Data File):&#039;&#039;&#039; .sdf extension&lt;br /&gt;
* &#039;&#039;&#039;SMILES:&#039;&#039;&#039; .smi or .smiles extension&lt;br /&gt;
&lt;br /&gt;
==== SMILES File Format ====&lt;br /&gt;
&lt;br /&gt;
Tab or space-delimited format:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
SMILES_STRING    Catalog_ID    Property1    Property2&lt;br /&gt;
c1ccccc1         Benzene       10.50        150.2&lt;br /&gt;
CCO              Ethanol       5.00         78.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* First column: SMILES string (required)&lt;br /&gt;
* Second column: Catalog ID (optional, defaults to &amp;quot;Mol_N&amp;quot;)&lt;br /&gt;
* Additional columns: Any properties you want to display&lt;br /&gt;
&lt;br /&gt;
==== SDF Files ====&lt;br /&gt;
&lt;br /&gt;
Standard SDF format with properties embedded:&lt;br /&gt;
* Catalog ID&lt;br /&gt;
* Price, USD&lt;br /&gt;
* Molecular Weight&lt;br /&gt;
* LogP&lt;br /&gt;
* Any custom properties&lt;br /&gt;
&lt;br /&gt;
== User Interface ==&lt;br /&gt;
&lt;br /&gt;
=== Main Window Components ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Toolbar ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Button !! Function !! Shortcut&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;✏️ Edit Highlights Mode&#039;&#039;&#039; || Toggle between selection and atom editing modes || Click to toggle&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;📝 Atom List...&#039;&#039;&#039; || Open dialog with checkboxes for all atoms || -&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Reset Highlights&#039;&#039;&#039; || Restore original highlights (non-matching atoms) || -&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Clear All Highlights&#039;&#039;&#039; || Remove all highlights || -&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Rotate ↻ 90°&#039;&#039;&#039; || Rotate selected molecule 90° clockwise || -&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Rotate ↺ 90°&#039;&#039;&#039; || Rotate selected molecule 90° counter-clockwise || -&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Mirror Horizontal ↔&#039;&#039;&#039; || Flip selected molecule left-to-right || -&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Mirror Vertical ↕&#039;&#039;&#039; || Flip selected molecule top-to-bottom || -&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;💾 Export High-Res PNG&#039;&#039;&#039; || Save grid as high-resolution image || -&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Reset Selected&#039;&#039;&#039; || Reset all transformations for selected molecule || -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 2. Input Section ====&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;File:&#039;&#039;&#039; Path to SDF or SMILES file&lt;br /&gt;
* &#039;&#039;&#039;Browse File:&#039;&#039;&#039; Open file dialog&lt;br /&gt;
* &#039;&#039;&#039;Reference:&#039;&#039;&#039; SMILES string of reference structure&lt;br /&gt;
* &#039;&#039;&#039;Columns:&#039;&#039;&#039; Number of columns in grid (1-10)&lt;br /&gt;
* &#039;&#039;&#039;Load &amp;amp; Align:&#039;&#039;&#039; Process and display molecules&lt;br /&gt;
&lt;br /&gt;
==== 3. Label Settings ====&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Font Size:&#039;&#039;&#039; Dropdown with sizes 16-48pt&lt;br /&gt;
* &#039;&#039;&#039;Second Line:&#039;&#039;&#039; Dropdown to select which property to display&lt;br /&gt;
** &amp;quot;Catalog ID only&amp;quot; - single line label&lt;br /&gt;
** Any property from your file&lt;br /&gt;
&lt;br /&gt;
==== 4. Grid Display ====&lt;br /&gt;
&lt;br /&gt;
* Scrollable area showing aligned molecules&lt;br /&gt;
* Click molecule to select (blue border)&lt;br /&gt;
* In Edit Mode: Click atoms to toggle highlights&lt;br /&gt;
&lt;br /&gt;
==== 5. Status Bar ====&lt;br /&gt;
&lt;br /&gt;
* Shows current operation status&lt;br /&gt;
* Displays MCS statistics after loading&lt;br /&gt;
* Shows atom selection feedback&lt;br /&gt;
&lt;br /&gt;
=== Visual Feedback ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Selection:&#039;&#039;&#039; Blue border (3px) around selected molecule&lt;br /&gt;
* &#039;&#039;&#039;Default:&#039;&#039;&#039; Gray border (1px) around unselected molecules&lt;br /&gt;
* &#039;&#039;&#039;Edit Mode:&#039;&#039;&#039; Info banner turns blue, cursor becomes crosshair&lt;br /&gt;
* &#039;&#039;&#039;Selection Mode:&#039;&#039;&#039; Gray info banner, cursor is pointing hand&lt;br /&gt;
* &#039;&#039;&#039;Highlights:&#039;&#039;&#039; Light green circles around highlighted atoms&lt;br /&gt;
&lt;br /&gt;
== Workflows ==&lt;br /&gt;
&lt;br /&gt;
=== Workflow 1: Basic Structure Alignment ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Goal:&#039;&#039;&#039; Align a series of molecular analogs and highlight variable regions&lt;br /&gt;
&lt;br /&gt;
# Prepare your data:&lt;br /&gt;
#* SDF file with multiple analogs&lt;br /&gt;
#* Reference SMILES (the core scaffold)&lt;br /&gt;
# Launch the application&lt;br /&gt;
# Click &amp;quot;Browse File&amp;quot; and select your SDF&lt;br /&gt;
# Enter reference SMILES in &amp;quot;Reference&amp;quot; field&lt;br /&gt;
# Set &amp;quot;Columns&amp;quot; to desired value (e.g., 4 for 4×N grid)&lt;br /&gt;
# Click &amp;quot;Load &amp;amp; Align&amp;quot;&lt;br /&gt;
# Review alignment:&lt;br /&gt;
#* Status bar shows MCS statistics&lt;br /&gt;
#* Green highlights show atoms different from reference&lt;br /&gt;
# Export: Click &amp;quot;💾 Export High-Res PNG&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Workflow 2: Custom Highlight Editing ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Goal:&#039;&#039;&#039; Manually adjust which atoms are highlighted&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Method 1: Direct Atom Clicking&#039;&#039;&#039;&lt;br /&gt;
# Load and align molecules (see Workflow 1)&lt;br /&gt;
# Click &amp;quot;✏️ Edit Highlights Mode&amp;quot; button in toolbar&lt;br /&gt;
# Click directly on atoms to toggle highlights on/off&lt;br /&gt;
# Status bar confirms each atom toggle&lt;br /&gt;
# Click &amp;quot;✏️ Edit Highlights Mode&amp;quot; again to exit&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Method 2: Atom List Dialog&#039;&#039;&#039;&lt;br /&gt;
# Load and align molecules&lt;br /&gt;
# Click a molecule to select it&lt;br /&gt;
# Click &amp;quot;📝 Atom List...&amp;quot; in toolbar&lt;br /&gt;
# Check/uncheck atoms in the list&lt;br /&gt;
# Use &amp;quot;Select All&amp;quot;, &amp;quot;Select None&amp;quot;, or &amp;quot;Invert&amp;quot; buttons&lt;br /&gt;
# Click &amp;quot;OK&amp;quot; to apply&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Method 3: Bulk Operations&#039;&#039;&#039;&lt;br /&gt;
# Select a molecule&lt;br /&gt;
# Click &amp;quot;Reset Highlights&amp;quot; to restore original highlights&lt;br /&gt;
# Click &amp;quot;Clear All Highlights&amp;quot; to remove all highlights&lt;br /&gt;
&lt;br /&gt;
=== Workflow 3: Structure Transformations ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Goal:&#039;&#039;&#039; Adjust molecule orientation for better visual comparison&lt;br /&gt;
&lt;br /&gt;
# Load and align molecules&lt;br /&gt;
# Click a molecule to select it (blue border appears)&lt;br /&gt;
# Apply transformations:&lt;br /&gt;
#* &#039;&#039;&#039;Rotate:&#039;&#039;&#039; Click &amp;quot;Rotate ↻ 90°&amp;quot; or &amp;quot;Rotate ↺ 90°&amp;quot;&lt;br /&gt;
#* &#039;&#039;&#039;Mirror:&#039;&#039;&#039; Click &amp;quot;Mirror Horizontal ↔&amp;quot; or &amp;quot;Mirror Vertical ↕&amp;quot;&lt;br /&gt;
# Transformations can be combined:&lt;br /&gt;
#* Example: Rotate 90° + Mirror Horizontal&lt;br /&gt;
# &#039;&#039;&#039;Important:&#039;&#039;&#039; Atom labels remain upright and readable&lt;br /&gt;
# To undo: Click &amp;quot;Reset Selected&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Workflow 4: Customizing Labels ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Goal:&#039;&#039;&#039; Display specific molecular properties&lt;br /&gt;
&lt;br /&gt;
# Load molecules with properties&lt;br /&gt;
# After loading, check &amp;quot;Second Line&amp;quot; dropdown&lt;br /&gt;
#* It auto-populates with available properties&lt;br /&gt;
# Select desired property:&lt;br /&gt;
#* &amp;quot;Catalog ID only&amp;quot; - single line&lt;br /&gt;
#* &amp;quot;Price, USD&amp;quot; - shows price&lt;br /&gt;
#* &amp;quot;Molecular Weight&amp;quot; - shows MW&lt;br /&gt;
#* Any other property from your file&lt;br /&gt;
# Adjust &amp;quot;Font Size&amp;quot; for readability (try 32 or 36)&lt;br /&gt;
# Changes apply immediately to all molecules&lt;br /&gt;
# Export preserves your settings&lt;br /&gt;
&lt;br /&gt;
=== Workflow 5: Publication-Quality Export ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Goal:&#039;&#039;&#039; Create high-resolution image for papers/presentations&lt;br /&gt;
&lt;br /&gt;
# Complete your analysis (alignment, highlights, labels)&lt;br /&gt;
# Configure display:&lt;br /&gt;
#* Font Size: 32-40pt for publication&lt;br /&gt;
#* Second Line: Choose relevant property&lt;br /&gt;
#* Columns: Adjust for best layout&lt;br /&gt;
# Click &amp;quot;💾 Export High-Res PNG&amp;quot;&lt;br /&gt;
# Choose save location&lt;br /&gt;
# Result:&lt;br /&gt;
#* 700×700 pixels per molecule (2× display size)&lt;br /&gt;
#* 300 DPI resolution&lt;br /&gt;
#* Fonts scaled 2× for clarity&lt;br /&gt;
#* All transformations and highlights preserved&lt;br /&gt;
&lt;br /&gt;
== File Formats ==&lt;br /&gt;
&lt;br /&gt;
=== Creating SMILES Files ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Basic format:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
c1ccccc1         Benzene      10.50&lt;br /&gt;
c1ccc(O)cc1      Phenol       15.20&lt;br /&gt;
c1ccc(N)cc1      Aniline      18.00&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;With multiple properties:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
SMILES           ID           Price    MW      LogP&lt;br /&gt;
c1ccccc1         BEN-001      10.50    78.11   2.13&lt;br /&gt;
c1ccc(O)cc1      PHE-002      15.20    94.11   1.46&lt;br /&gt;
c1ccc(N)cc1      ANI-003      18.00    93.13   0.90&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Naming convention:&#039;&#039;&#039;&lt;br /&gt;
* Use .smi or .smiles extension&lt;br /&gt;
* Tab or space-delimited&lt;br /&gt;
* First column must be valid SMILES&lt;br /&gt;
* Comments: Lines starting with # are ignored&lt;br /&gt;
&lt;br /&gt;
=== SDF File Properties ===&lt;br /&gt;
&lt;br /&gt;
The application reads all properties from SDF files. Common properties:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Catalog ID&#039;&#039;&#039; - Molecule identifier&lt;br /&gt;
* &#039;&#039;&#039;Price, USD&#039;&#039;&#039; - Pricing information&lt;br /&gt;
* &#039;&#039;&#039;Molecular Weight&#039;&#039;&#039; - Calculated or experimental MW&lt;br /&gt;
* &#039;&#039;&#039;LogP&#039;&#039;&#039; - Partition coefficient&lt;br /&gt;
* &#039;&#039;&#039;SMILES&#039;&#039;&#039; - SMILES representation&lt;br /&gt;
* &#039;&#039;&#039;Custom properties&#039;&#039;&#039; - Any field in your SDF&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tip:&#039;&#039;&#039; Use RDKit to add custom properties to SDF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from rdkit import Chem&lt;br /&gt;
&lt;br /&gt;
mol = Chem.MolFromSmiles(&#039;c1ccccc1&#039;)&lt;br /&gt;
mol.SetProp(&#039;Catalog ID&#039;, &#039;BEN-001&#039;)&lt;br /&gt;
mol.SetProp(&#039;Price, USD&#039;, &#039;10.50&#039;)&lt;br /&gt;
mol.SetProp(&#039;Custom Property&#039;, &#039;Value&#039;)&lt;br /&gt;
&lt;br /&gt;
writer = Chem.SDWriter(&#039;output.sdf&#039;)&lt;br /&gt;
writer.write(mol)&lt;br /&gt;
writer.close()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== Performance Issues ===&lt;br /&gt;
&lt;br /&gt;
==== Slow loading with many molecules ====&lt;br /&gt;
&lt;br /&gt;
* MCS calculation is O(n) for n molecules&lt;br /&gt;
* For &amp;gt;100 molecules, expect 10-30 second load time&lt;br /&gt;
* Timeout is 10 seconds per molecule for MCS&lt;br /&gt;
&lt;br /&gt;
== License ==&lt;br /&gt;
(c) Claude and Andrii&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Interactive_Molecular_Structure_Alignment_App_for_QSAR&amp;diff=16941</id>
		<title>Interactive Molecular Structure Alignment App for QSAR</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Interactive_Molecular_Structure_Alignment_App_for_QSAR&amp;diff=16941"/>
		<updated>2025-10-06T22:28:59Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: added path to the program&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Interactive Molecular Structure Alignment Application =&lt;br /&gt;
&lt;br /&gt;
A PyQt5-based interactive tool for aligning and visualizing molecular analogs with customizable highlighting, transformations, and high-resolution export capabilities.&lt;br /&gt;
&lt;br /&gt;
== Table of Contents ==&lt;br /&gt;
&lt;br /&gt;
* [[#Installation|Installation]]&lt;br /&gt;
* [[#Quick Start|Quick Start]]&lt;br /&gt;
* [[#Features|Features]]&lt;br /&gt;
* [[#User Interface|User Interface]]&lt;br /&gt;
* [[#Workflows|Workflows]]&lt;br /&gt;
* [[#File Formats|File Formats]]&lt;br /&gt;
* [[#Troubleshooting|Troubleshooting]]&lt;br /&gt;
* [[#Tips and Best Practices|Tips and Best Practices]]&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
You can find the program in {{code|/mnt/nfs/exa/work/ak87/UCSF/SCRIPTS/SHOW_STRUCTURES/align-2d-struct-highlight_interactive.py}}&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
&lt;br /&gt;
* Python 3.7 or higher&lt;br /&gt;
* RDKit (chemistry toolkit)&lt;br /&gt;
* PyQt5 (GUI framework)&lt;br /&gt;
* Pillow (image processing)&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Installation ===&lt;br /&gt;
&lt;br /&gt;
==== Using Conda (Recommended) ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Create a new conda environment&lt;br /&gt;
conda create -n mol_aligner python=3.9&lt;br /&gt;
&lt;br /&gt;
# Activate the environment&lt;br /&gt;
conda activate mol_aligner&lt;br /&gt;
&lt;br /&gt;
# Install RDKit from conda-forge&lt;br /&gt;
conda install -c conda-forge rdkit&lt;br /&gt;
&lt;br /&gt;
# Install PyQt5 and Pillow&lt;br /&gt;
conda install pyqt pillow&lt;br /&gt;
# Or using pip&lt;br /&gt;
pip install rdkit PyQt5 pillow&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Installing RDKit via pip can be challenging on some systems. Conda installation is strongly recommended.&lt;br /&gt;
&lt;br /&gt;
=== Platform-Specific Notes ===&lt;br /&gt;
&lt;br /&gt;
==== macOS ====&lt;br /&gt;
* No additional steps required&lt;br /&gt;
* Font rendering uses system fonts (Helvetica, Arial)&lt;br /&gt;
&lt;br /&gt;
==== Linux ====&lt;br /&gt;
* Install font packages for better rendering:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt-get install fonts-dejavu-core  # Ubuntu/Debian&lt;br /&gt;
sudo yum install dejavu-sans-fonts      # CentOS/RHEL&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Windows ====&lt;br /&gt;
* No additional steps required&lt;br /&gt;
* Arial font is used by default&lt;br /&gt;
&lt;br /&gt;
== Quick Start ==&lt;br /&gt;
&lt;br /&gt;
=== Launching the Application ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python mol_aligner_app.py&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Workflow ===&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Load molecules:&#039;&#039;&#039; Click &amp;quot;Browse File&amp;quot; and select your SDF or SMILES file&lt;br /&gt;
# &#039;&#039;&#039;Set reference:&#039;&#039;&#039; Enter the SMILES string of your reference/core structure&lt;br /&gt;
# &#039;&#039;&#039;Configure display:&#039;&#039;&#039; Set number of columns (default: 4) and font size (default: 24)&lt;br /&gt;
# &#039;&#039;&#039;Click &amp;quot;Load &amp;amp; Align&amp;quot;:&#039;&#039;&#039; Molecules will be aligned and displayed&lt;br /&gt;
# &#039;&#039;&#039;Edit as needed:&#039;&#039;&#039; Select molecules, toggle highlights, rotate/mirror structures&lt;br /&gt;
# &#039;&#039;&#039;Export:&#039;&#039;&#039; Click &amp;quot;💾 Export High-Res PNG&amp;quot; to save your grid&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
=== Core Features ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Molecular Alignment:&#039;&#039;&#039; Automatically aligns analogs based on Maximum Common Substructure (MCS)&lt;br /&gt;
* &#039;&#039;&#039;Interactive Highlighting:&#039;&#039;&#039; Click atoms to toggle highlights on/off&lt;br /&gt;
* &#039;&#039;&#039;Structure Transformations:&#039;&#039;&#039; Rotate (90°) and mirror structures while keeping atom labels readable&lt;br /&gt;
* &#039;&#039;&#039;Flexible Display:&#039;&#039;&#039; Adjustable grid columns (1-10) and font sizes (16-48pt)&lt;br /&gt;
* &#039;&#039;&#039;Property Display:&#039;&#039;&#039; Show any molecular property as label (Catalog ID, Price, MW, LogP, etc.)&lt;br /&gt;
* &#039;&#039;&#039;High-Resolution Export:&#039;&#039;&#039; Export publication-quality PNG at 300 DPI&lt;br /&gt;
&lt;br /&gt;
=== Supported File Formats ===&lt;br /&gt;
&lt;br /&gt;
==== Input Files ====&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SDF (Structure Data File):&#039;&#039;&#039; .sdf extension&lt;br /&gt;
* &#039;&#039;&#039;SMILES:&#039;&#039;&#039; .smi or .smiles extension&lt;br /&gt;
&lt;br /&gt;
==== SMILES File Format ====&lt;br /&gt;
&lt;br /&gt;
Tab or space-delimited format:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
SMILES_STRING    Catalog_ID    Property1    Property2&lt;br /&gt;
c1ccccc1         Benzene       10.50        150.2&lt;br /&gt;
CCO              Ethanol       5.00         78.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* First column: SMILES string (required)&lt;br /&gt;
* Second column: Catalog ID (optional, defaults to &amp;quot;Mol_N&amp;quot;)&lt;br /&gt;
* Additional columns: Any properties you want to display&lt;br /&gt;
&lt;br /&gt;
==== SDF Files ====&lt;br /&gt;
&lt;br /&gt;
Standard SDF format with properties embedded:&lt;br /&gt;
* Catalog ID&lt;br /&gt;
* Price, USD&lt;br /&gt;
* Molecular Weight&lt;br /&gt;
* LogP&lt;br /&gt;
* Any custom properties&lt;br /&gt;
&lt;br /&gt;
== User Interface ==&lt;br /&gt;
&lt;br /&gt;
=== Main Window Components ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Toolbar ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Button !! Function !! Shortcut&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;✏️ Edit Highlights Mode&#039;&#039;&#039; || Toggle between selection and atom editing modes || Click to toggle&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;📝 Atom List...&#039;&#039;&#039; || Open dialog with checkboxes for all atoms || -&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Reset Highlights&#039;&#039;&#039; || Restore original highlights (non-matching atoms) || -&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Clear All Highlights&#039;&#039;&#039; || Remove all highlights || -&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Rotate ↻ 90°&#039;&#039;&#039; || Rotate selected molecule 90° clockwise || -&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Rotate ↺ 90°&#039;&#039;&#039; || Rotate selected molecule 90° counter-clockwise || -&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Mirror Horizontal ↔&#039;&#039;&#039; || Flip selected molecule left-to-right || -&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Mirror Vertical ↕&#039;&#039;&#039; || Flip selected molecule top-to-bottom || -&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;💾 Export High-Res PNG&#039;&#039;&#039; || Save grid as high-resolution image || -&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Reset Selected&#039;&#039;&#039; || Reset all transformations for selected molecule || -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 2. Input Section ====&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;File:&#039;&#039;&#039; Path to SDF or SMILES file&lt;br /&gt;
* &#039;&#039;&#039;Browse File:&#039;&#039;&#039; Open file dialog&lt;br /&gt;
* &#039;&#039;&#039;Reference:&#039;&#039;&#039; SMILES string of reference structure&lt;br /&gt;
* &#039;&#039;&#039;Columns:&#039;&#039;&#039; Number of columns in grid (1-10)&lt;br /&gt;
* &#039;&#039;&#039;Load &amp;amp; Align:&#039;&#039;&#039; Process and display molecules&lt;br /&gt;
&lt;br /&gt;
==== 3. Label Settings ====&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Font Size:&#039;&#039;&#039; Dropdown with sizes 16-48pt&lt;br /&gt;
* &#039;&#039;&#039;Second Line:&#039;&#039;&#039; Dropdown to select which property to display&lt;br /&gt;
** &amp;quot;Catalog ID only&amp;quot; - single line label&lt;br /&gt;
** Any property from your file&lt;br /&gt;
&lt;br /&gt;
==== 4. Grid Display ====&lt;br /&gt;
&lt;br /&gt;
* Scrollable area showing aligned molecules&lt;br /&gt;
* Click molecule to select (blue border)&lt;br /&gt;
* In Edit Mode: Click atoms to toggle highlights&lt;br /&gt;
&lt;br /&gt;
==== 5. Status Bar ====&lt;br /&gt;
&lt;br /&gt;
* Shows current operation status&lt;br /&gt;
* Displays MCS statistics after loading&lt;br /&gt;
* Shows atom selection feedback&lt;br /&gt;
&lt;br /&gt;
=== Visual Feedback ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Selection:&#039;&#039;&#039; Blue border (3px) around selected molecule&lt;br /&gt;
* &#039;&#039;&#039;Default:&#039;&#039;&#039; Gray border (1px) around unselected molecules&lt;br /&gt;
* &#039;&#039;&#039;Edit Mode:&#039;&#039;&#039; Info banner turns blue, cursor becomes crosshair&lt;br /&gt;
* &#039;&#039;&#039;Selection Mode:&#039;&#039;&#039; Gray info banner, cursor is pointing hand&lt;br /&gt;
* &#039;&#039;&#039;Highlights:&#039;&#039;&#039; Light green circles around highlighted atoms&lt;br /&gt;
&lt;br /&gt;
== Workflows ==&lt;br /&gt;
&lt;br /&gt;
=== Workflow 1: Basic Structure Alignment ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Goal:&#039;&#039;&#039; Align a series of molecular analogs and highlight variable regions&lt;br /&gt;
&lt;br /&gt;
# Prepare your data:&lt;br /&gt;
#* SDF file with multiple analogs&lt;br /&gt;
#* Reference SMILES (the core scaffold)&lt;br /&gt;
# Launch the application&lt;br /&gt;
# Click &amp;quot;Browse File&amp;quot; and select your SDF&lt;br /&gt;
# Enter reference SMILES in &amp;quot;Reference&amp;quot; field&lt;br /&gt;
# Set &amp;quot;Columns&amp;quot; to desired value (e.g., 4 for 4×N grid)&lt;br /&gt;
# Click &amp;quot;Load &amp;amp; Align&amp;quot;&lt;br /&gt;
# Review alignment:&lt;br /&gt;
#* Status bar shows MCS statistics&lt;br /&gt;
#* Green highlights show atoms different from reference&lt;br /&gt;
# Export: Click &amp;quot;💾 Export High-Res PNG&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Workflow 2: Custom Highlight Editing ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Goal:&#039;&#039;&#039; Manually adjust which atoms are highlighted&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Method 1: Direct Atom Clicking&#039;&#039;&#039;&lt;br /&gt;
# Load and align molecules (see Workflow 1)&lt;br /&gt;
# Click &amp;quot;✏️ Edit Highlights Mode&amp;quot; button in toolbar&lt;br /&gt;
# Click directly on atoms to toggle highlights on/off&lt;br /&gt;
# Status bar confirms each atom toggle&lt;br /&gt;
# Click &amp;quot;✏️ Edit Highlights Mode&amp;quot; again to exit&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Method 2: Atom List Dialog&#039;&#039;&#039;&lt;br /&gt;
# Load and align molecules&lt;br /&gt;
# Click a molecule to select it&lt;br /&gt;
# Click &amp;quot;📝 Atom List...&amp;quot; in toolbar&lt;br /&gt;
# Check/uncheck atoms in the list&lt;br /&gt;
# Use &amp;quot;Select All&amp;quot;, &amp;quot;Select None&amp;quot;, or &amp;quot;Invert&amp;quot; buttons&lt;br /&gt;
# Click &amp;quot;OK&amp;quot; to apply&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Method 3: Bulk Operations&#039;&#039;&#039;&lt;br /&gt;
# Select a molecule&lt;br /&gt;
# Click &amp;quot;Reset Highlights&amp;quot; to restore original highlights&lt;br /&gt;
# Click &amp;quot;Clear All Highlights&amp;quot; to remove all highlights&lt;br /&gt;
&lt;br /&gt;
=== Workflow 3: Structure Transformations ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Goal:&#039;&#039;&#039; Adjust molecule orientation for better visual comparison&lt;br /&gt;
&lt;br /&gt;
# Load and align molecules&lt;br /&gt;
# Click a molecule to select it (blue border appears)&lt;br /&gt;
# Apply transformations:&lt;br /&gt;
#* &#039;&#039;&#039;Rotate:&#039;&#039;&#039; Click &amp;quot;Rotate ↻ 90°&amp;quot; or &amp;quot;Rotate ↺ 90°&amp;quot;&lt;br /&gt;
#* &#039;&#039;&#039;Mirror:&#039;&#039;&#039; Click &amp;quot;Mirror Horizontal ↔&amp;quot; or &amp;quot;Mirror Vertical ↕&amp;quot;&lt;br /&gt;
# Transformations can be combined:&lt;br /&gt;
#* Example: Rotate 90° + Mirror Horizontal&lt;br /&gt;
# &#039;&#039;&#039;Important:&#039;&#039;&#039; Atom labels remain upright and readable&lt;br /&gt;
# To undo: Click &amp;quot;Reset Selected&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Workflow 4: Customizing Labels ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Goal:&#039;&#039;&#039; Display specific molecular properties&lt;br /&gt;
&lt;br /&gt;
# Load molecules with properties&lt;br /&gt;
# After loading, check &amp;quot;Second Line&amp;quot; dropdown&lt;br /&gt;
#* It auto-populates with available properties&lt;br /&gt;
# Select desired property:&lt;br /&gt;
#* &amp;quot;Catalog ID only&amp;quot; - single line&lt;br /&gt;
#* &amp;quot;Price, USD&amp;quot; - shows price&lt;br /&gt;
#* &amp;quot;Molecular Weight&amp;quot; - shows MW&lt;br /&gt;
#* Any other property from your file&lt;br /&gt;
# Adjust &amp;quot;Font Size&amp;quot; for readability (try 32 or 36)&lt;br /&gt;
# Changes apply immediately to all molecules&lt;br /&gt;
# Export preserves your settings&lt;br /&gt;
&lt;br /&gt;
=== Workflow 5: Publication-Quality Export ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Goal:&#039;&#039;&#039; Create high-resolution image for papers/presentations&lt;br /&gt;
&lt;br /&gt;
# Complete your analysis (alignment, highlights, labels)&lt;br /&gt;
# Configure display:&lt;br /&gt;
#* Font Size: 32-40pt for publication&lt;br /&gt;
#* Second Line: Choose relevant property&lt;br /&gt;
#* Columns: Adjust for best layout&lt;br /&gt;
# Click &amp;quot;💾 Export High-Res PNG&amp;quot;&lt;br /&gt;
# Choose save location&lt;br /&gt;
# Result:&lt;br /&gt;
#* 700×700 pixels per molecule (2× display size)&lt;br /&gt;
#* 300 DPI resolution&lt;br /&gt;
#* Fonts scaled 2× for clarity&lt;br /&gt;
#* All transformations and highlights preserved&lt;br /&gt;
&lt;br /&gt;
== File Formats ==&lt;br /&gt;
&lt;br /&gt;
=== Creating SMILES Files ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Basic format:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
c1ccccc1         Benzene      10.50&lt;br /&gt;
c1ccc(O)cc1      Phenol       15.20&lt;br /&gt;
c1ccc(N)cc1      Aniline      18.00&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;With multiple properties:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
SMILES           ID           Price    MW      LogP&lt;br /&gt;
c1ccccc1         BEN-001      10.50    78.11   2.13&lt;br /&gt;
c1ccc(O)cc1      PHE-002      15.20    94.11   1.46&lt;br /&gt;
c1ccc(N)cc1      ANI-003      18.00    93.13   0.90&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Naming convention:&#039;&#039;&#039;&lt;br /&gt;
* Use .smi or .smiles extension&lt;br /&gt;
* Tab or space-delimited&lt;br /&gt;
* First column must be valid SMILES&lt;br /&gt;
* Comments: Lines starting with # are ignored&lt;br /&gt;
&lt;br /&gt;
=== SDF File Properties ===&lt;br /&gt;
&lt;br /&gt;
The application reads all properties from SDF files. Common properties:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Catalog ID&#039;&#039;&#039; - Molecule identifier&lt;br /&gt;
* &#039;&#039;&#039;Price, USD&#039;&#039;&#039; - Pricing information&lt;br /&gt;
* &#039;&#039;&#039;Molecular Weight&#039;&#039;&#039; - Calculated or experimental MW&lt;br /&gt;
* &#039;&#039;&#039;LogP&#039;&#039;&#039; - Partition coefficient&lt;br /&gt;
* &#039;&#039;&#039;SMILES&#039;&#039;&#039; - SMILES representation&lt;br /&gt;
* &#039;&#039;&#039;Custom properties&#039;&#039;&#039; - Any field in your SDF&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tip:&#039;&#039;&#039; Use RDKit to add custom properties to SDF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from rdkit import Chem&lt;br /&gt;
&lt;br /&gt;
mol = Chem.MolFromSmiles(&#039;c1ccccc1&#039;)&lt;br /&gt;
mol.SetProp(&#039;Catalog ID&#039;, &#039;BEN-001&#039;)&lt;br /&gt;
mol.SetProp(&#039;Price, USD&#039;, &#039;10.50&#039;)&lt;br /&gt;
mol.SetProp(&#039;Custom Property&#039;, &#039;Value&#039;)&lt;br /&gt;
&lt;br /&gt;
writer = Chem.SDWriter(&#039;output.sdf&#039;)&lt;br /&gt;
writer.write(mol)&lt;br /&gt;
writer.close()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== Performance Issues ===&lt;br /&gt;
&lt;br /&gt;
==== Slow loading with many molecules ====&lt;br /&gt;
&lt;br /&gt;
* MCS calculation is O(n) for n molecules&lt;br /&gt;
* For &amp;gt;100 molecules, expect 10-30 second load time&lt;br /&gt;
* Timeout is 10 seconds per molecule for MCS&lt;br /&gt;
&lt;br /&gt;
== License ==&lt;br /&gt;
(c) Claude and Andrii&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Interactive_Molecular_Structure_Alignment_App_for_QSAR&amp;diff=16940</id>
		<title>Interactive Molecular Structure Alignment App for QSAR</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Interactive_Molecular_Structure_Alignment_App_for_QSAR&amp;diff=16940"/>
		<updated>2025-10-06T21:02:01Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: Created page with &amp;quot;= Interactive Molecular Structure Alignment Application =  A PyQt5-based interactive tool for aligning and visualizing molecular analogs with customizable highlighting, transformations, and high-resolution export capabilities.  == Table of Contents ==  * Installation * Quick Start * Features * User Interface * Workflows * File Formats * #Troubleshooting|Troubleshooting...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Interactive Molecular Structure Alignment Application =&lt;br /&gt;
&lt;br /&gt;
A PyQt5-based interactive tool for aligning and visualizing molecular analogs with customizable highlighting, transformations, and high-resolution export capabilities.&lt;br /&gt;
&lt;br /&gt;
== Table of Contents ==&lt;br /&gt;
&lt;br /&gt;
* [[#Installation|Installation]]&lt;br /&gt;
* [[#Quick Start|Quick Start]]&lt;br /&gt;
* [[#Features|Features]]&lt;br /&gt;
* [[#User Interface|User Interface]]&lt;br /&gt;
* [[#Workflows|Workflows]]&lt;br /&gt;
* [[#File Formats|File Formats]]&lt;br /&gt;
* [[#Troubleshooting|Troubleshooting]]&lt;br /&gt;
* [[#Tips and Best Practices|Tips and Best Practices]]&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
&lt;br /&gt;
* Python 3.7 or higher&lt;br /&gt;
* RDKit (chemistry toolkit)&lt;br /&gt;
* PyQt5 (GUI framework)&lt;br /&gt;
* Pillow (image processing)&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Installation ===&lt;br /&gt;
&lt;br /&gt;
==== Using Conda (Recommended) ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Create a new conda environment&lt;br /&gt;
conda create -n mol_aligner python=3.9&lt;br /&gt;
&lt;br /&gt;
# Activate the environment&lt;br /&gt;
conda activate mol_aligner&lt;br /&gt;
&lt;br /&gt;
# Install RDKit from conda-forge&lt;br /&gt;
conda install -c conda-forge rdkit&lt;br /&gt;
&lt;br /&gt;
# Install PyQt5 and Pillow&lt;br /&gt;
conda install pyqt pillow&lt;br /&gt;
# Or using pip&lt;br /&gt;
pip install rdkit PyQt5 pillow&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Installing RDKit via pip can be challenging on some systems. Conda installation is strongly recommended.&lt;br /&gt;
&lt;br /&gt;
=== Platform-Specific Notes ===&lt;br /&gt;
&lt;br /&gt;
==== macOS ====&lt;br /&gt;
* No additional steps required&lt;br /&gt;
* Font rendering uses system fonts (Helvetica, Arial)&lt;br /&gt;
&lt;br /&gt;
==== Linux ====&lt;br /&gt;
* Install font packages for better rendering:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt-get install fonts-dejavu-core  # Ubuntu/Debian&lt;br /&gt;
sudo yum install dejavu-sans-fonts      # CentOS/RHEL&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Windows ====&lt;br /&gt;
* No additional steps required&lt;br /&gt;
* Arial font is used by default&lt;br /&gt;
&lt;br /&gt;
== Quick Start ==&lt;br /&gt;
&lt;br /&gt;
=== Launching the Application ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python mol_aligner_app.py&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Workflow ===&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Load molecules:&#039;&#039;&#039; Click &amp;quot;Browse File&amp;quot; and select your SDF or SMILES file&lt;br /&gt;
# &#039;&#039;&#039;Set reference:&#039;&#039;&#039; Enter the SMILES string of your reference/core structure&lt;br /&gt;
# &#039;&#039;&#039;Configure display:&#039;&#039;&#039; Set number of columns (default: 4) and font size (default: 24)&lt;br /&gt;
# &#039;&#039;&#039;Click &amp;quot;Load &amp;amp; Align&amp;quot;:&#039;&#039;&#039; Molecules will be aligned and displayed&lt;br /&gt;
# &#039;&#039;&#039;Edit as needed:&#039;&#039;&#039; Select molecules, toggle highlights, rotate/mirror structures&lt;br /&gt;
# &#039;&#039;&#039;Export:&#039;&#039;&#039; Click &amp;quot;💾 Export High-Res PNG&amp;quot; to save your grid&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
=== Core Features ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Molecular Alignment:&#039;&#039;&#039; Automatically aligns analogs based on Maximum Common Substructure (MCS)&lt;br /&gt;
* &#039;&#039;&#039;Interactive Highlighting:&#039;&#039;&#039; Click atoms to toggle highlights on/off&lt;br /&gt;
* &#039;&#039;&#039;Structure Transformations:&#039;&#039;&#039; Rotate (90°) and mirror structures while keeping atom labels readable&lt;br /&gt;
* &#039;&#039;&#039;Flexible Display:&#039;&#039;&#039; Adjustable grid columns (1-10) and font sizes (16-48pt)&lt;br /&gt;
* &#039;&#039;&#039;Property Display:&#039;&#039;&#039; Show any molecular property as label (Catalog ID, Price, MW, LogP, etc.)&lt;br /&gt;
* &#039;&#039;&#039;High-Resolution Export:&#039;&#039;&#039; Export publication-quality PNG at 300 DPI&lt;br /&gt;
&lt;br /&gt;
=== Supported File Formats ===&lt;br /&gt;
&lt;br /&gt;
==== Input Files ====&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SDF (Structure Data File):&#039;&#039;&#039; .sdf extension&lt;br /&gt;
* &#039;&#039;&#039;SMILES:&#039;&#039;&#039; .smi or .smiles extension&lt;br /&gt;
&lt;br /&gt;
==== SMILES File Format ====&lt;br /&gt;
&lt;br /&gt;
Tab or space-delimited format:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
SMILES_STRING    Catalog_ID    Property1    Property2&lt;br /&gt;
c1ccccc1         Benzene       10.50        150.2&lt;br /&gt;
CCO              Ethanol       5.00         78.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* First column: SMILES string (required)&lt;br /&gt;
* Second column: Catalog ID (optional, defaults to &amp;quot;Mol_N&amp;quot;)&lt;br /&gt;
* Additional columns: Any properties you want to display&lt;br /&gt;
&lt;br /&gt;
==== SDF Files ====&lt;br /&gt;
&lt;br /&gt;
Standard SDF format with properties embedded:&lt;br /&gt;
* Catalog ID&lt;br /&gt;
* Price, USD&lt;br /&gt;
* Molecular Weight&lt;br /&gt;
* LogP&lt;br /&gt;
* Any custom properties&lt;br /&gt;
&lt;br /&gt;
== User Interface ==&lt;br /&gt;
&lt;br /&gt;
=== Main Window Components ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Toolbar ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Button !! Function !! Shortcut&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;✏️ Edit Highlights Mode&#039;&#039;&#039; || Toggle between selection and atom editing modes || Click to toggle&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;📝 Atom List...&#039;&#039;&#039; || Open dialog with checkboxes for all atoms || -&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Reset Highlights&#039;&#039;&#039; || Restore original highlights (non-matching atoms) || -&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Clear All Highlights&#039;&#039;&#039; || Remove all highlights || -&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Rotate ↻ 90°&#039;&#039;&#039; || Rotate selected molecule 90° clockwise || -&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Rotate ↺ 90°&#039;&#039;&#039; || Rotate selected molecule 90° counter-clockwise || -&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Mirror Horizontal ↔&#039;&#039;&#039; || Flip selected molecule left-to-right || -&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Mirror Vertical ↕&#039;&#039;&#039; || Flip selected molecule top-to-bottom || -&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;💾 Export High-Res PNG&#039;&#039;&#039; || Save grid as high-resolution image || -&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Reset Selected&#039;&#039;&#039; || Reset all transformations for selected molecule || -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 2. Input Section ====&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;File:&#039;&#039;&#039; Path to SDF or SMILES file&lt;br /&gt;
* &#039;&#039;&#039;Browse File:&#039;&#039;&#039; Open file dialog&lt;br /&gt;
* &#039;&#039;&#039;Reference:&#039;&#039;&#039; SMILES string of reference structure&lt;br /&gt;
* &#039;&#039;&#039;Columns:&#039;&#039;&#039; Number of columns in grid (1-10)&lt;br /&gt;
* &#039;&#039;&#039;Load &amp;amp; Align:&#039;&#039;&#039; Process and display molecules&lt;br /&gt;
&lt;br /&gt;
==== 3. Label Settings ====&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Font Size:&#039;&#039;&#039; Dropdown with sizes 16-48pt&lt;br /&gt;
* &#039;&#039;&#039;Second Line:&#039;&#039;&#039; Dropdown to select which property to display&lt;br /&gt;
** &amp;quot;Catalog ID only&amp;quot; - single line label&lt;br /&gt;
** Any property from your file&lt;br /&gt;
&lt;br /&gt;
==== 4. Grid Display ====&lt;br /&gt;
&lt;br /&gt;
* Scrollable area showing aligned molecules&lt;br /&gt;
* Click molecule to select (blue border)&lt;br /&gt;
* In Edit Mode: Click atoms to toggle highlights&lt;br /&gt;
&lt;br /&gt;
==== 5. Status Bar ====&lt;br /&gt;
&lt;br /&gt;
* Shows current operation status&lt;br /&gt;
* Displays MCS statistics after loading&lt;br /&gt;
* Shows atom selection feedback&lt;br /&gt;
&lt;br /&gt;
=== Visual Feedback ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Selection:&#039;&#039;&#039; Blue border (3px) around selected molecule&lt;br /&gt;
* &#039;&#039;&#039;Default:&#039;&#039;&#039; Gray border (1px) around unselected molecules&lt;br /&gt;
* &#039;&#039;&#039;Edit Mode:&#039;&#039;&#039; Info banner turns blue, cursor becomes crosshair&lt;br /&gt;
* &#039;&#039;&#039;Selection Mode:&#039;&#039;&#039; Gray info banner, cursor is pointing hand&lt;br /&gt;
* &#039;&#039;&#039;Highlights:&#039;&#039;&#039; Light green circles around highlighted atoms&lt;br /&gt;
&lt;br /&gt;
== Workflows ==&lt;br /&gt;
&lt;br /&gt;
=== Workflow 1: Basic Structure Alignment ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Goal:&#039;&#039;&#039; Align a series of molecular analogs and highlight variable regions&lt;br /&gt;
&lt;br /&gt;
# Prepare your data:&lt;br /&gt;
#* SDF file with multiple analogs&lt;br /&gt;
#* Reference SMILES (the core scaffold)&lt;br /&gt;
# Launch the application&lt;br /&gt;
# Click &amp;quot;Browse File&amp;quot; and select your SDF&lt;br /&gt;
# Enter reference SMILES in &amp;quot;Reference&amp;quot; field&lt;br /&gt;
# Set &amp;quot;Columns&amp;quot; to desired value (e.g., 4 for 4×N grid)&lt;br /&gt;
# Click &amp;quot;Load &amp;amp; Align&amp;quot;&lt;br /&gt;
# Review alignment:&lt;br /&gt;
#* Status bar shows MCS statistics&lt;br /&gt;
#* Green highlights show atoms different from reference&lt;br /&gt;
# Export: Click &amp;quot;💾 Export High-Res PNG&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Workflow 2: Custom Highlight Editing ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Goal:&#039;&#039;&#039; Manually adjust which atoms are highlighted&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Method 1: Direct Atom Clicking&#039;&#039;&#039;&lt;br /&gt;
# Load and align molecules (see Workflow 1)&lt;br /&gt;
# Click &amp;quot;✏️ Edit Highlights Mode&amp;quot; button in toolbar&lt;br /&gt;
# Click directly on atoms to toggle highlights on/off&lt;br /&gt;
# Status bar confirms each atom toggle&lt;br /&gt;
# Click &amp;quot;✏️ Edit Highlights Mode&amp;quot; again to exit&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Method 2: Atom List Dialog&#039;&#039;&#039;&lt;br /&gt;
# Load and align molecules&lt;br /&gt;
# Click a molecule to select it&lt;br /&gt;
# Click &amp;quot;📝 Atom List...&amp;quot; in toolbar&lt;br /&gt;
# Check/uncheck atoms in the list&lt;br /&gt;
# Use &amp;quot;Select All&amp;quot;, &amp;quot;Select None&amp;quot;, or &amp;quot;Invert&amp;quot; buttons&lt;br /&gt;
# Click &amp;quot;OK&amp;quot; to apply&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Method 3: Bulk Operations&#039;&#039;&#039;&lt;br /&gt;
# Select a molecule&lt;br /&gt;
# Click &amp;quot;Reset Highlights&amp;quot; to restore original highlights&lt;br /&gt;
# Click &amp;quot;Clear All Highlights&amp;quot; to remove all highlights&lt;br /&gt;
&lt;br /&gt;
=== Workflow 3: Structure Transformations ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Goal:&#039;&#039;&#039; Adjust molecule orientation for better visual comparison&lt;br /&gt;
&lt;br /&gt;
# Load and align molecules&lt;br /&gt;
# Click a molecule to select it (blue border appears)&lt;br /&gt;
# Apply transformations:&lt;br /&gt;
#* &#039;&#039;&#039;Rotate:&#039;&#039;&#039; Click &amp;quot;Rotate ↻ 90°&amp;quot; or &amp;quot;Rotate ↺ 90°&amp;quot;&lt;br /&gt;
#* &#039;&#039;&#039;Mirror:&#039;&#039;&#039; Click &amp;quot;Mirror Horizontal ↔&amp;quot; or &amp;quot;Mirror Vertical ↕&amp;quot;&lt;br /&gt;
# Transformations can be combined:&lt;br /&gt;
#* Example: Rotate 90° + Mirror Horizontal&lt;br /&gt;
# &#039;&#039;&#039;Important:&#039;&#039;&#039; Atom labels remain upright and readable&lt;br /&gt;
# To undo: Click &amp;quot;Reset Selected&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Workflow 4: Customizing Labels ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Goal:&#039;&#039;&#039; Display specific molecular properties&lt;br /&gt;
&lt;br /&gt;
# Load molecules with properties&lt;br /&gt;
# After loading, check &amp;quot;Second Line&amp;quot; dropdown&lt;br /&gt;
#* It auto-populates with available properties&lt;br /&gt;
# Select desired property:&lt;br /&gt;
#* &amp;quot;Catalog ID only&amp;quot; - single line&lt;br /&gt;
#* &amp;quot;Price, USD&amp;quot; - shows price&lt;br /&gt;
#* &amp;quot;Molecular Weight&amp;quot; - shows MW&lt;br /&gt;
#* Any other property from your file&lt;br /&gt;
# Adjust &amp;quot;Font Size&amp;quot; for readability (try 32 or 36)&lt;br /&gt;
# Changes apply immediately to all molecules&lt;br /&gt;
# Export preserves your settings&lt;br /&gt;
&lt;br /&gt;
=== Workflow 5: Publication-Quality Export ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Goal:&#039;&#039;&#039; Create high-resolution image for papers/presentations&lt;br /&gt;
&lt;br /&gt;
# Complete your analysis (alignment, highlights, labels)&lt;br /&gt;
# Configure display:&lt;br /&gt;
#* Font Size: 32-40pt for publication&lt;br /&gt;
#* Second Line: Choose relevant property&lt;br /&gt;
#* Columns: Adjust for best layout&lt;br /&gt;
# Click &amp;quot;💾 Export High-Res PNG&amp;quot;&lt;br /&gt;
# Choose save location&lt;br /&gt;
# Result:&lt;br /&gt;
#* 700×700 pixels per molecule (2× display size)&lt;br /&gt;
#* 300 DPI resolution&lt;br /&gt;
#* Fonts scaled 2× for clarity&lt;br /&gt;
#* All transformations and highlights preserved&lt;br /&gt;
&lt;br /&gt;
== File Formats ==&lt;br /&gt;
&lt;br /&gt;
=== Creating SMILES Files ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Basic format:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
c1ccccc1         Benzene      10.50&lt;br /&gt;
c1ccc(O)cc1      Phenol       15.20&lt;br /&gt;
c1ccc(N)cc1      Aniline      18.00&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;With multiple properties:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
SMILES           ID           Price    MW      LogP&lt;br /&gt;
c1ccccc1         BEN-001      10.50    78.11   2.13&lt;br /&gt;
c1ccc(O)cc1      PHE-002      15.20    94.11   1.46&lt;br /&gt;
c1ccc(N)cc1      ANI-003      18.00    93.13   0.90&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Naming convention:&#039;&#039;&#039;&lt;br /&gt;
* Use .smi or .smiles extension&lt;br /&gt;
* Tab or space-delimited&lt;br /&gt;
* First column must be valid SMILES&lt;br /&gt;
* Comments: Lines starting with # are ignored&lt;br /&gt;
&lt;br /&gt;
=== SDF File Properties ===&lt;br /&gt;
&lt;br /&gt;
The application reads all properties from SDF files. Common properties:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Catalog ID&#039;&#039;&#039; - Molecule identifier&lt;br /&gt;
* &#039;&#039;&#039;Price, USD&#039;&#039;&#039; - Pricing information&lt;br /&gt;
* &#039;&#039;&#039;Molecular Weight&#039;&#039;&#039; - Calculated or experimental MW&lt;br /&gt;
* &#039;&#039;&#039;LogP&#039;&#039;&#039; - Partition coefficient&lt;br /&gt;
* &#039;&#039;&#039;SMILES&#039;&#039;&#039; - SMILES representation&lt;br /&gt;
* &#039;&#039;&#039;Custom properties&#039;&#039;&#039; - Any field in your SDF&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tip:&#039;&#039;&#039; Use RDKit to add custom properties to SDF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from rdkit import Chem&lt;br /&gt;
&lt;br /&gt;
mol = Chem.MolFromSmiles(&#039;c1ccccc1&#039;)&lt;br /&gt;
mol.SetProp(&#039;Catalog ID&#039;, &#039;BEN-001&#039;)&lt;br /&gt;
mol.SetProp(&#039;Price, USD&#039;, &#039;10.50&#039;)&lt;br /&gt;
mol.SetProp(&#039;Custom Property&#039;, &#039;Value&#039;)&lt;br /&gt;
&lt;br /&gt;
writer = Chem.SDWriter(&#039;output.sdf&#039;)&lt;br /&gt;
writer.write(mol)&lt;br /&gt;
writer.close()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== Performance Issues ===&lt;br /&gt;
&lt;br /&gt;
==== Slow loading with many molecules ====&lt;br /&gt;
&lt;br /&gt;
* MCS calculation is O(n) for n molecules&lt;br /&gt;
* For &amp;gt;100 molecules, expect 10-30 second load time&lt;br /&gt;
* Timeout is 10 seconds per molecule for MCS&lt;br /&gt;
&lt;br /&gt;
== License ==&lt;br /&gt;
(c) Claude and Andrii&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Running_DOCK6_with_ChemGrid_Score_and_db2_files&amp;diff=16878</id>
		<title>Running DOCK6 with ChemGrid Score and db2 files</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Running_DOCK6_with_ChemGrid_Score_and_db2_files&amp;diff=16878"/>
		<updated>2025-09-09T19:37:01Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Installation ==&lt;br /&gt;
Obtain DOCK 6 from [https://github.com/docking-org/dock6 the official GitHub repository]. See also the DOCK 6 manual: [https://dock.compbio.ucsf.edu/DOCK_6/dock6_manual.htm#Installation Installation]. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# on epyc-A40&lt;br /&gt;
cd dock6/install&lt;br /&gt;
./configure gnu&lt;br /&gt;
make all&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Large-scale docking (LSD) ==&lt;br /&gt;
The most recent copy on Wynton is in &amp;lt;code&amp;gt;/wynton/group/bks/work/ak87/UCSF/SCRIPTS/DOCK6/2025-08-Trents_fix/dock6/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Converting DOCK 3 grids to DOCK 6 ===&lt;br /&gt;
See the [[#Convert_grids|Scripts/Convert Grids]] section below. This has been tested on Gimel and should also work on Wynton. The preferred workflow starts from both &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;working&amp;lt;/code&amp;gt; directories produced by DOCK 3 &amp;lt;code&amp;gt;blastermaster&amp;lt;/code&amp;gt;. When that is not available, the script requires the DOCK 3 &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; only. DOCK 3 and DOCK 6 installations are needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh convert_dock3_grids_dockfiles.sh &amp;lt;path_to_dock3_grids_dockfiles&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Converted grids reproduce the same scores when rescoring DOCK 3 poses. For Mac1, however, top scores during large-scale docking were in the thousands, likely because some ligands extended beyond the grid box.&lt;br /&gt;
&lt;br /&gt;
=== Running LSD ===&lt;br /&gt;
Running LSD with DOCK 6 is analogous to DOCK 3:&lt;br /&gt;
* Prepare grids in &amp;lt;code&amp;gt;dock6files&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Obtain SubDock from [https://github.com/docking-org/SUBDOCK6/tree/main the SUBDOCK6 repository].&lt;br /&gt;
* Prepare lists of ligand &amp;lt;code&amp;gt;.tgz&amp;lt;/code&amp;gt; files in an &amp;lt;code&amp;gt;sdi&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
* Create &amp;lt;code&amp;gt;run_subdock6.sh&amp;lt;/code&amp;gt; in the working directory and run it (see [[#Submit_LSD|Scripts/Submit LSD]] below). The script targets Wynton but should work on clusters using SGE or SLURM. You can re-run it to retry unfinished jobs.&lt;br /&gt;
&lt;br /&gt;
=== Processing LSD ===&lt;br /&gt;
Run the parsing script (see [[#Process_LSD|Scripts/Process LSD]] below). It writes a CSV of scores (similar to &amp;lt;code&amp;gt;extract_all.sort.uniq.txt&amp;lt;/code&amp;gt;) and a second CSV with per-subdirectory runtimes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python parse_dock_logs.py --root /path/to/search \&lt;br /&gt;
  --ligand_csv /path/to/out/ligand_scores.csv \&lt;br /&gt;
  --stat_csv /path/to/out/stat_summary.csv&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To do:&#039;&#039;&#039; extract poses.&lt;br /&gt;
&lt;br /&gt;
== Rescoring DOCK 3 poses ==&lt;br /&gt;
See [[#Rescoring|Scripts/Rescoring]]. Edit the script to specify:&lt;br /&gt;
* The &amp;lt;code&amp;gt;mol2.gz&amp;lt;/code&amp;gt; file with poses to rescore.&lt;br /&gt;
* A directory with &amp;lt;code&amp;gt;db2&amp;lt;/code&amp;gt; files (DOCK 6 reads solvation data from these).&lt;br /&gt;
* DOCK 6 grids (&amp;lt;code&amp;gt;dock6files&amp;lt;/code&amp;gt;).&lt;br /&gt;
* Parameter files from the DOCK 6 installation.&lt;br /&gt;
* The helper &amp;lt;code&amp;gt;lc_blazing_fast_separate_mol2_into_smaller_files.py&amp;lt;/code&amp;gt; is used to split large MOL2 files for speed.&lt;br /&gt;
&lt;br /&gt;
== Scripts ==&lt;br /&gt;
=== Convert grids ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# convert_dock3_grids_dockfiles.sh&lt;br /&gt;
# Convert DOCK3 grids to DOCK6 dockfiles&lt;br /&gt;
# Author Trent Balius (converted to bash)&lt;br /&gt;
&lt;br /&gt;
set -e&lt;br /&gt;
echo &amp;quot;sh convert_dock3_grids_dockfiles.sh &amp;lt;path_to_dock3_grids_dockfiles&amp;gt;&amp;quot;&lt;br /&gt;
workdir=&amp;quot;$(pwd)&amp;quot;&lt;br /&gt;
cd &amp;quot;$workdir&amp;quot; || exit&lt;br /&gt;
# system=&amp;quot;$(basename &amp;quot;$workdir&amp;quot;)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#filedir=&amp;quot;/is2/projects/RAS-CompChem/static/work/DUDEZ/dudez_dockprep/${system}_dock6prep/blastermaster/dockfiles&amp;quot;&lt;br /&gt;
if [ -z &amp;quot;$1&amp;quot; ]; then&lt;br /&gt;
	echo &amp;quot;Usage: sh convert_dock3_grids_dockfiles.sh &amp;lt;path_to_dock3_grids_dockfiles&amp;gt;&amp;quot;&lt;br /&gt;
	exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
filedir=$1&lt;br /&gt;
# Directory where the converted DOCK6 dockfiles will be stored&lt;br /&gt;
dock6files_dir=&amp;quot;${workdir}/dock6files&amp;quot;&lt;br /&gt;
&lt;br /&gt;
mkdir -p &amp;quot;$dock6files_dir&amp;quot;&lt;br /&gt;
cd &amp;quot;$dock6files_dir&amp;quot; || exit&lt;br /&gt;
&lt;br /&gt;
cp &amp;quot;$filedir&amp;quot;/vdw.* .&lt;br /&gt;
#cp &amp;quot;$filedir/box&amp;quot; .&lt;br /&gt;
#cp &amp;quot;$filedir/qnifft.electrostatics.phi&amp;quot; .&lt;br /&gt;
cp &amp;quot;$filedir/trim.electrostatics.phi&amp;quot; .&lt;br /&gt;
cp &amp;quot;$filedir/matching_spheres.sph&amp;quot; .&lt;br /&gt;
cp &amp;quot;$filedir&amp;quot;/ligand.desolv.* .&lt;br /&gt;
cp &amp;quot;$filedir/INDOCK&amp;quot; .&lt;br /&gt;
cp &amp;quot;$filedir/rec.crg.pdb&amp;quot; rec.pdb&lt;br /&gt;
&lt;br /&gt;
perl /nfs/soft/dock/versions/dock37/DOCK-3.7-trunk/proteins/makebox/makebox.smallokay.pl matching_spheres.sph rec.pdb box 10.0&lt;br /&gt;
&lt;br /&gt;
# Creating standalone grids, so no links to the original files&lt;br /&gt;
# ln -sf vdw.bmp chem.bmp&lt;br /&gt;
# ln -sf vdw.vdw chem.vdw&lt;br /&gt;
# #ln -sf vdw.esp chem.esp&lt;br /&gt;
# ln -sf vdw.vdw chem.esp&lt;br /&gt;
# #ln -sf qnifft.electrostatics.phi rec+sph.phi&lt;br /&gt;
# #ln -sf trim.electrostatics.phi rec+sph.phi&lt;br /&gt;
# ln -sf trim.electrostatics.phi chem.phi&lt;br /&gt;
&lt;br /&gt;
cp -v vdw.bmp chem.bmp&lt;br /&gt;
cp -v  vdw.vdw chem.vdw&lt;br /&gt;
cp -v  vdw.vdw chem.esp&lt;br /&gt;
cp -v trim.electrostatics.phi chem.phi&lt;br /&gt;
&lt;br /&gt;
dsize=$(grep delphi_nsize INDOCK | awk &#039;{print $2}&#039;)&lt;br /&gt;
if [ -z &amp;quot;$dsize&amp;quot; ]; then&lt;br /&gt;
	echo &amp;quot;Error: delphi_nsize not found in INDOCK. Please check the INDOCK file.&amp;quot;&lt;br /&gt;
	exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; gconv.in&lt;br /&gt;
compute_grids                  yes&lt;br /&gt;
DOCK3_7_grids                  yes&lt;br /&gt;
QNIFFT_grid                    yes&lt;br /&gt;
grid_spacing                   0.2&lt;br /&gt;
phi_grid_size                  $dsize&lt;br /&gt;
output_molecule                no&lt;br /&gt;
contact_score                  no&lt;br /&gt;
contact_cutoff_distance        4.5&lt;br /&gt;
chemical_score                 yes&lt;br /&gt;
energy_score                   yes&lt;br /&gt;
energy_cutoff_distance         10&lt;br /&gt;
atom_model                     u&lt;br /&gt;
attractive_exponent            6&lt;br /&gt;
repulsive_exponent             12&lt;br /&gt;
distance_dielectric            yes&lt;br /&gt;
dielectric_factor              4&lt;br /&gt;
bump_filter                    yes&lt;br /&gt;
bump_overlap                   0.5&lt;br /&gt;
receptor_file                  rec.crg&lt;br /&gt;
box_file                       box&lt;br /&gt;
vdw_definition_file            /nfs/home/ak87/PROGRAM/DOCK6-NEBIUS/dock6-gritukan_merged/parameters/vdw_AMBER_parm94.defn&lt;br /&gt;
chemical_definition_file       /nfs/home/ak87/PROGRAM/DOCK6-NEBIUS/dock6-gritukan_merged/parameters/chemgrid/conv.defn&lt;br /&gt;
score_grid_prefix              chem&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
/nfs/home/ak87/PROGRAM/DOCK6-NEBIUS/dock6-gritukan_merged/bin/grid-convert -i gconv.in &amp;gt; gconv.log&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Submit LSD ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
export EXPORT_DEST=$PWD/output&lt;br /&gt;
export DOCKFILES=$PWD/dock6files&lt;br /&gt;
export DOCKEXEC=/wynton/group/bks/work/ak87/UCSF/SCRIPTS/DOCK6/2025-08-Trents_fix/dock6/bin/dock6&lt;br /&gt;
export SHRTCACHE=/dev/shm&lt;br /&gt;
export LONGCACHE=/tmp&lt;br /&gt;
export SHRTCACHE_USE_ENV=&lt;br /&gt;
export USE_DB2_TGZ=true&lt;br /&gt;
export USE_DB2_TGZ_BATCH_SIZE=1&lt;br /&gt;
export USE_DB2=false&lt;br /&gt;
export USE_DB2_BATCH_SIZE=100&lt;br /&gt;
export USE_SLURM=False&lt;br /&gt;
export USE_SLURM_ARGS=--export=ALL&lt;br /&gt;
export USE_SGE=True&lt;br /&gt;
export USE_SGE_ARGS=&amp;quot;-l s_rt=08:28:00 -l h_rt=08:30:00 -l mem_free=2G&amp;quot;&lt;br /&gt;
export USE_PARALLEL=false&lt;br /&gt;
export MAX_PARALLEL=-1&lt;br /&gt;
export QSUB_EXEC=qsub&lt;br /&gt;
export SBATCH_EXEC=sbatch&lt;br /&gt;
export PARALLEL_EXEC=parallel&lt;br /&gt;
export SUBMIT_WAIT_TIME=0&lt;br /&gt;
&lt;br /&gt;
for i in  sdi/* ; do&lt;br /&gt;
       	export k=$(basename $i .in)&lt;br /&gt;
       	echo k $k&lt;br /&gt;
       	export INPUT_SOURCE=$PWD/$i&lt;br /&gt;
       	export EXPORT_DEST=$PWD/output/$k&lt;br /&gt;
       	bash &amp;lt;/path/to/subdock6.bash&amp;gt;&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Process LSD ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env python3&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
parse_dock_logs.py&lt;br /&gt;
&lt;br /&gt;
Recursively parse DOCK &#039;dock.out*&#039; files:&lt;br /&gt;
  • Extract all LIGAND score components; keep the record with the lowest&lt;br /&gt;
    Chemgrid_Score per molecule.&lt;br /&gt;
  • Extract STAT summary for each file.&lt;br /&gt;
  • Save two CSV files: ligand_scores and stat_summary.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
    python parse_dock_logs.py \&lt;br /&gt;
        --root /path/to/search \&lt;br /&gt;
        --ligand_csv /path/to/out/ligand_scores.csv \&lt;br /&gt;
        --stat_csv /path/to/out/stat_summary.csv&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
import argparse&lt;br /&gt;
import re&lt;br /&gt;
from pathlib import Path&lt;br /&gt;
import pandas as pd&lt;br /&gt;
&lt;br /&gt;
# ──────────────────────────────────────────────────────────────────────────────&lt;br /&gt;
# Regex patterns for parsing DOCK output files&lt;br /&gt;
LIGAND_START_RE = re.compile(r&amp;quot;^-+$&amp;quot;)  # Lines with only dashes&lt;br /&gt;
MOLECULE_RE = re.compile(r&amp;quot;^\s*Molecule:\s*(\S+)&amp;quot;, re.IGNORECASE)&lt;br /&gt;
LIGAND_KEYVAL_RE = re.compile(&lt;br /&gt;
    r&amp;quot;^\s*([A-Za-z0-9_]+):\s*([-+]?\d*\.?\d+)\s*$&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
STAT_BLOCK_RE = re.compile(r&amp;quot;^(=+.*STAT|.*STAT.*)&amp;quot;, re.IGNORECASE)&lt;br /&gt;
STAT_MOLS_RE = re.compile(r&amp;quot;^\s*(\d+)\s+Molecules Processed&amp;quot;, re.IGNORECASE)&lt;br /&gt;
STAT_TIME_RE = re.compile(r&amp;quot;^Total elapsed time:\s+([\d.]+) seconds&amp;quot;, re.IGNORECASE)&lt;br /&gt;
ELAPSED_LINE_RE = re.compile(r&amp;quot;Total elapsed time:&amp;quot;, re.IGNORECASE)&lt;br /&gt;
&lt;br /&gt;
# ──────────────────────────────────────────────────────────────────────────────&lt;br /&gt;
def file_finished(lines, tail=50) -&amp;gt; bool:&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Return True if &#039;Total elapsed time&#039; appears in the last `tail` lines.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    return any(ELAPSED_LINE_RE.search(l) for l in lines[-tail:])&lt;br /&gt;
&lt;br /&gt;
# ──────────────────────────────────────────────────────────────────────────────&lt;br /&gt;
def parse_ligands(lines, subdir, filename):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Yield dictionaries with ligand scores.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    i = 0&lt;br /&gt;
    record_count = 0&lt;br /&gt;
    while i &amp;lt; len(lines):&lt;br /&gt;
        # Look for lines with dashes (separator before ligand record)&lt;br /&gt;
        if LIGAND_START_RE.match(lines[i]):&lt;br /&gt;
            # Skip ahead to find Molecule: line&lt;br /&gt;
            j = i + 1&lt;br /&gt;
            while j &amp;lt; len(lines) and not MOLECULE_RE.search(lines[j]):&lt;br /&gt;
                j += 1&lt;br /&gt;
            &lt;br /&gt;
            if j &amp;gt;= len(lines):&lt;br /&gt;
                i += 1&lt;br /&gt;
                continue&lt;br /&gt;
                &lt;br /&gt;
            # Found a molecule line, start parsing&lt;br /&gt;
            molecule_match = MOLECULE_RE.search(lines[j])&lt;br /&gt;
            if not molecule_match:&lt;br /&gt;
                i += 1&lt;br /&gt;
                continue&lt;br /&gt;
                &lt;br /&gt;
            record = {&lt;br /&gt;
                &amp;quot;subdir&amp;quot;: subdir, &lt;br /&gt;
                &amp;quot;file&amp;quot;: filename,&lt;br /&gt;
                &amp;quot;Molecule&amp;quot;: molecule_match.group(1)&lt;br /&gt;
            }&lt;br /&gt;
            &lt;br /&gt;
            # Parse key-value pairs from the rest of the record&lt;br /&gt;
            k = j + 1&lt;br /&gt;
            while k &amp;lt; len(lines):&lt;br /&gt;
                line = lines[k].strip()&lt;br /&gt;
                &lt;br /&gt;
                # Stop if we hit another separator or definitive end markers&lt;br /&gt;
                if (line.startswith(&amp;quot;---&amp;quot;) or &lt;br /&gt;
                    line.startswith(&amp;quot;===&amp;quot;) or &lt;br /&gt;
                    line.startswith(&amp;quot;score &amp;gt;&amp;quot;) or&lt;br /&gt;
                    line.startswith(&amp;quot;Total elapsed time&amp;quot;)):&lt;br /&gt;
                    break&lt;br /&gt;
                &lt;br /&gt;
                # Try to match key-value pairs&lt;br /&gt;
                kv_match = LIGAND_KEYVAL_RE.match(lines[k])&lt;br /&gt;
                if kv_match:&lt;br /&gt;
                    key, val = kv_match.groups()&lt;br /&gt;
                    if val:  # Only add if value is not empty&lt;br /&gt;
                        record[key] = float(val)&lt;br /&gt;
                &lt;br /&gt;
                k += 1&lt;br /&gt;
            &lt;br /&gt;
            # Only yield if we found meaningful data&lt;br /&gt;
            if len(record) &amp;gt; 3:  # Has molecule + metadata + at least one score&lt;br /&gt;
                record_count += 1&lt;br /&gt;
                yield record&lt;br /&gt;
            &lt;br /&gt;
            i = k  # Continue from where we left off&lt;br /&gt;
        else:&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
# ──────────────────────────────────────────────────────────────────────────────&lt;br /&gt;
def parse_stat(lines, subdir, filename):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Return dict with STAT info or None if block not found.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    for idx, line in enumerate(lines):&lt;br /&gt;
        if STAT_BLOCK_RE.match(line):&lt;br /&gt;
            mols = elapsed = None&lt;br /&gt;
            for j in range(idx + 1, len(lines)):&lt;br /&gt;
                if mols is None:&lt;br /&gt;
                    m = STAT_MOLS_RE.match(lines[j])&lt;br /&gt;
                    if m:&lt;br /&gt;
                        mols = int(m.group(1))&lt;br /&gt;
                if elapsed is None:&lt;br /&gt;
                    t = STAT_TIME_RE.match(lines[j])&lt;br /&gt;
                    if t:&lt;br /&gt;
                        elapsed = float(t.group(1))&lt;br /&gt;
                if lines[j].startswith(&amp;quot;=&amp;quot;) and j &amp;gt; idx + 1:&lt;br /&gt;
                    break  # end of STAT block&lt;br /&gt;
            return {&lt;br /&gt;
                &amp;quot;subdir&amp;quot;: subdir,&lt;br /&gt;
                &amp;quot;file&amp;quot;: filename,&lt;br /&gt;
                &amp;quot;molecules_processed&amp;quot;: mols,&lt;br /&gt;
                &amp;quot;elapsed_seconds&amp;quot;: elapsed,&lt;br /&gt;
            }&lt;br /&gt;
    return None&lt;br /&gt;
&lt;br /&gt;
# ──────────────────────────────────────────────────────────────────────────────&lt;br /&gt;
def main():&lt;br /&gt;
    ap = argparse.ArgumentParser(description=&amp;quot;Parse DOCK log files.&amp;quot;)&lt;br /&gt;
    ap.add_argument(&amp;quot;--root&amp;quot;, type=Path, default=Path.cwd(),&lt;br /&gt;
                    help=&amp;quot;Root directory to search (default: CWD)&amp;quot;)&lt;br /&gt;
    ap.add_argument(&amp;quot;--ligand_csv&amp;quot;, type=Path, required=True,&lt;br /&gt;
                    help=&amp;quot;Output CSV for ligand scores&amp;quot;)&lt;br /&gt;
    ap.add_argument(&amp;quot;--stat_csv&amp;quot;, type=Path, required=True,&lt;br /&gt;
                    help=&amp;quot;Output CSV for STAT summaries&amp;quot;)&lt;br /&gt;
    args = ap.parse_args()&lt;br /&gt;
&lt;br /&gt;
    ligand_records = []&lt;br /&gt;
    stat_records = []&lt;br /&gt;
&lt;br /&gt;
    for path in args.root.rglob(&amp;quot;dock.out*&amp;quot;):&lt;br /&gt;
        print(f&amp;quot;Processing {path}&amp;quot;)&lt;br /&gt;
        if not path.is_file():&lt;br /&gt;
            continue&lt;br /&gt;
        lines = path.read_text(errors=&amp;quot;ignore&amp;quot;).splitlines()&lt;br /&gt;
        if not file_finished(lines):&lt;br /&gt;
            print(f&amp;quot;  Skipping: file not finished&amp;quot;)&lt;br /&gt;
            continue  # skip incomplete file&lt;br /&gt;
        &lt;br /&gt;
        subdir = str(path.parent.relative_to(args.root))&lt;br /&gt;
        filename = path.name&lt;br /&gt;
&lt;br /&gt;
        # LIGAND parsing&lt;br /&gt;
        ligand_records_from_file = list(parse_ligands(lines, subdir, filename))&lt;br /&gt;
        ligand_records.extend(ligand_records_from_file)&lt;br /&gt;
        print(f&amp;quot;  Found {len(ligand_records_from_file)} ligand records&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
        # STAT parsing&lt;br /&gt;
        stat = parse_stat(lines, subdir, filename)&lt;br /&gt;
        if stat:&lt;br /&gt;
            stat_records.append(stat)&lt;br /&gt;
&lt;br /&gt;
    if not ligand_records:&lt;br /&gt;
        print(&amp;quot;No completed ligand data found.&amp;quot;)&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    # Ligand DF &amp;amp; best scores&lt;br /&gt;
    df_lig = pd.DataFrame(ligand_records)&lt;br /&gt;
    &lt;br /&gt;
    # Check if Chemgrid_Score exists, if not use alternative column&lt;br /&gt;
    score_column = &amp;quot;Chemgrid_Score&amp;quot;&lt;br /&gt;
    if score_column not in df_lig.columns:&lt;br /&gt;
        # Look for alternative score columns&lt;br /&gt;
        possible_scores = [col for col in df_lig.columns if &amp;quot;score&amp;quot; in col.lower()]&lt;br /&gt;
        if possible_scores:&lt;br /&gt;
            score_column = possible_scores[0]&lt;br /&gt;
            print(f&amp;quot;Using {score_column} instead of Chemgrid_Score&amp;quot;)&lt;br /&gt;
        else:&lt;br /&gt;
            print(&amp;quot;No score column found!&amp;quot;)&lt;br /&gt;
            return&lt;br /&gt;
    &lt;br /&gt;
    best_idx = (&lt;br /&gt;
        df_lig.groupby(&amp;quot;Molecule&amp;quot;)[score_column]&lt;br /&gt;
        .idxmin()&lt;br /&gt;
        .dropna()&lt;br /&gt;
    )&lt;br /&gt;
    df_best = df_lig.loc[best_idx].sort_values(score_column)&lt;br /&gt;
    args.ligand_csv.parent.mkdir(parents=True, exist_ok=True)&lt;br /&gt;
    df_best.to_csv(args.ligand_csv, index=False)&lt;br /&gt;
&lt;br /&gt;
    # STAT DF&lt;br /&gt;
    if stat_records:&lt;br /&gt;
        df_stat = pd.DataFrame(stat_records)&lt;br /&gt;
        args.stat_csv.parent.mkdir(parents=True, exist_ok=True)&lt;br /&gt;
        df_stat.to_csv(args.stat_csv, index=False)&lt;br /&gt;
&lt;br /&gt;
    print(f&amp;quot;Wrote {len(df_best)} molecules to {args.ligand_csv}&amp;quot;)&lt;br /&gt;
    if stat_records:&lt;br /&gt;
        print(f&amp;quot;Wrote {len(df_stat)} STAT rows to {args.stat_csv}&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
    main()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Rescoring ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env bash&lt;br /&gt;
# ------------------------------------------------------------------&lt;br /&gt;
# Rescoring pipeline — Bash port of the original tcsh script&lt;br /&gt;
# ------------------------------------------------------------------&lt;br /&gt;
# IFS=$&#039;\n\t&#039;               # safe word splitting&lt;br /&gt;
&lt;br /&gt;
# ------------------------- CONFIGURATION --------------------------&lt;br /&gt;
system=&amp;quot;AMPC&amp;quot;             # set your system tag here&lt;br /&gt;
# system=&amp;quot;EGFR&amp;quot;            # uncomment to switch target&lt;br /&gt;
&lt;br /&gt;
outdir=&amp;quot;${system}_rescore_v3.8_v6&amp;quot;&lt;br /&gt;
src_gz=&amp;quot;/home/ak87/Desktop/SMALL_PROJ/DOCK6-NEBIUS/2025-06-TEST/TEST-LINKIN/RUN-TRENTs-COMMENTS/DOCK3/1/output/test.mol2.gz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
db2_dir=&amp;quot;/home/ak87/Desktop/SMALL_PROJ/DOCK6-NEBIUS/2025-06-TEST/AMPC-TESTED/&amp;quot;&lt;br /&gt;
dockfiles_link=&amp;quot;/home/ak87/Desktop/SMALL_PROJ/DOCK6-NEBIUS/2025-06-TEST/TMP2/dock6files&amp;quot;&lt;br /&gt;
&lt;br /&gt;
dock6_bin=&amp;quot;/home/ak87/Programs/dock6-gritukan_merged/bin/dock6&amp;quot;&lt;br /&gt;
separate_py=&amp;quot;/home/ak87/Programs/lc_blazing_fast_separate_mol2_into_smaller_files_AK.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
vdw_defn=&amp;quot;/home/ak87/Programs/dock6-gritukan_merged/parameters/vdw_AMBER_parm94.dock3_7.defn&amp;quot;&lt;br /&gt;
flex_defn=&amp;quot;/home/ak87/Programs/dock6-gritukan_merged/parameters/flex.defn&amp;quot;&lt;br /&gt;
flex_tbl=&amp;quot;/home/ak87/Programs/dock6-gritukan_merged/parameters/flex_drive.tbl&amp;quot;&lt;br /&gt;
# ------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
mkdir -p &amp;quot;$outdir&amp;quot;&lt;br /&gt;
cd &amp;quot;$outdir&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Unzip test.mol2 once&lt;br /&gt;
zcat &amp;quot;$src_gz&amp;quot; &amp;gt; test.mol2&lt;br /&gt;
&lt;br /&gt;
# Link dockfiles directory (overwrite stale link if present)&lt;br /&gt;
ln -sfn &amp;quot;$dockfiles_link&amp;quot; dockfiles&lt;br /&gt;
&lt;br /&gt;
# Fresh output accumulator&lt;br /&gt;
rm -f total_energy.txt&lt;br /&gt;
&lt;br /&gt;
# Split the multi-mol2 file into chunks named split001.mol2 …&lt;br /&gt;
python &amp;quot;$separate_py&amp;quot; test.mol2 split 1&lt;br /&gt;
rm test.mol2&lt;br /&gt;
mol2files=$(ls *.mol2)&lt;br /&gt;
echo $mol2files&lt;br /&gt;
&lt;br /&gt;
# ---------------------- MAIN PROCESSING LOOP ---------------------&lt;br /&gt;
for mol2file in $mol2files; do&lt;br /&gt;
    # Grab ligand-source path (single value expected)&lt;br /&gt;
    # file=$(grep -m1 &amp;quot;Ligand Source File:&amp;quot; &amp;quot;$mol2file&amp;quot; | awk &#039;{print $5}&#039;)&lt;br /&gt;
    ligand_id=$(grep &amp;quot;##########                 Name:&amp;quot; &amp;quot;$mol2file&amp;quot; | awk &#039;{print $3}&#039;)&lt;br /&gt;
    ligand_charge=$(grep &amp;quot;##########        Ligand Charge:&amp;quot; &amp;quot;$mol2file&amp;quot; | awk &#039;{print $4}&#039;)&lt;br /&gt;
    echo &amp;quot;Processing ligand: $ligand_id (charge: $ligand_charge, source: $mol2file)&amp;quot;&lt;br /&gt;
    found_file=false&lt;br /&gt;
    for file in &amp;quot;$db2_dir&amp;quot;/*&amp;quot;$ligand_id&amp;quot;*.db2; do&lt;br /&gt;
        echo &amp;quot;Checking file: $file&amp;quot;&lt;br /&gt;
        this_charge=$(head -n 2 &amp;quot;$file&amp;quot; | tail -n 1 | awk &#039;{print $2}&#039;)&lt;br /&gt;
        echo $ligand_id $this_charge $ligand_charge&lt;br /&gt;
        match=$(python3 -c &amp;quot;import sys; print(&amp;quot;1&amp;quot;) if float(&#039;$ligand_charge&#039;) == float(&#039;$this_charge&#039;) else sprint(&amp;quot;2&amp;quot;)&amp;quot;)&lt;br /&gt;
        if [[ &amp;quot;$match&amp;quot; -eq &amp;quot;1&amp;quot; ]]; then&lt;br /&gt;
            echo &amp;quot;Found source file: $file (charge match: $ligand_charge)&amp;quot;&lt;br /&gt;
            found_file=true&lt;br /&gt;
            break&lt;br /&gt;
        fi&lt;br /&gt;
    done&lt;br /&gt;
    if [[ $found_file == false ]]; then&lt;br /&gt;
        echo &amp;quot;No matching source file found for ligand: $ligand_id (charge: $ligand_charge)&amp;quot;&lt;br /&gt;
        continue&lt;br /&gt;
    fi&lt;br /&gt;
    name=&amp;quot;${mol2file%.*}&amp;quot;          # basename without .mol2&lt;br /&gt;
&lt;br /&gt;
    echo &amp;quot;Processing $mol2file  (source ⇒ $file)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # Build solvation table&lt;br /&gt;
    cat &amp;quot;$file&amp;quot; | grep &amp;quot;^A&amp;quot; \&lt;br /&gt;
        | awk &#039;{printf&amp;quot;%f %f %f %f %f\n&amp;quot;,0.0,$8,0.0,$9,$10}&#039; \&lt;br /&gt;
        &amp;gt; &amp;quot;${name}.solv&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    printf &#039;%s\n&#039; &amp;quot;$name&amp;quot; &amp;gt; molname.txt   # not used later but kept&lt;br /&gt;
&lt;br /&gt;
    # Append TRIPOS solvation section&lt;br /&gt;
    {&lt;br /&gt;
        printf &#039;@&amp;lt;TRIPOS&amp;gt;SOLVATION\n&#039;&lt;br /&gt;
        printf &#039;LIG header\n&#039;&lt;br /&gt;
        cat &amp;quot;${name}.solv&amp;quot;&lt;br /&gt;
    } &amp;gt;&amp;gt; &amp;quot;${name}.mol2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # ------------------- Generate dock.in on-the-fly --------------&lt;br /&gt;
    cat &amp;gt; dock.in &amp;lt;&amp;lt;EOF&lt;br /&gt;
conformer_search_type                                        rigid&lt;br /&gt;
use_internal_energy                                          no&lt;br /&gt;
ligand_atom_file                                             ${name}.mol2&lt;br /&gt;
limit_max_ligands                                            no&lt;br /&gt;
skip_molecule                                                no&lt;br /&gt;
read_mol_solvation                                           yes&lt;br /&gt;
calculate_rmsd                                               no&lt;br /&gt;
use_database_filter                                          no&lt;br /&gt;
orient_ligand                                                no&lt;br /&gt;
bump_filter                                                  no&lt;br /&gt;
score_molecules                                              yes&lt;br /&gt;
contact_score_primary                                        no&lt;br /&gt;
grid_score_primary                                           no&lt;br /&gt;
gist_score_primary                                           no&lt;br /&gt;
multigrid_score_primary                                      no&lt;br /&gt;
dock3.5_score_primary                                        yes&lt;br /&gt;
dock3.5_vdw_score                                            yes&lt;br /&gt;
dock3.5_grd_prefix                                           dockfiles/chem52&lt;br /&gt;
dock3.5_electrostatic_score                                  yes&lt;br /&gt;
dock3.5_ligand_desolvation_score                             volume&lt;br /&gt;
dock3.5_solvent_occlusion_file                               dockfiles/ligand.desolv.heavy&lt;br /&gt;
dock3.5_redistribute_positive_desolvation                    no&lt;br /&gt;
dock3.5_hydrogen_desolvation_grid                            yes&lt;br /&gt;
dock3.5_hydrogen_solvent_occlusion_file                      dockfiles/ligand.desolv.hydrogen&lt;br /&gt;
dock3.5_receptor_desolvation_score                           no&lt;br /&gt;
dock3.5_write_atomic_energy_contrib                          no&lt;br /&gt;
dock3.5_score_vdw_scale                                      1&lt;br /&gt;
dock3.5_score_es_scale                                       1&lt;br /&gt;
minimize_ligand                                              no&lt;br /&gt;
atom_model                                                   all&lt;br /&gt;
vdw_defn_file                                                ${vdw_defn}&lt;br /&gt;
flex_defn_file                                               ${flex_defn}&lt;br /&gt;
flex_drive_file                                              ${flex_tbl}&lt;br /&gt;
ligand_outfile_prefix                                        ${name}_output&lt;br /&gt;
write_orientations                                           no&lt;br /&gt;
num_scored_conformers                                        1&lt;br /&gt;
rank_ligands                                                 no&lt;br /&gt;
EOF&lt;br /&gt;
    # --------------------- Run DOCK and harvest -------------------&lt;br /&gt;
    &amp;quot;$dock6_bin&amp;quot; -i dock.in -o dock.out&lt;br /&gt;
&lt;br /&gt;
    # Pull chemgrid and energy terms into running table&lt;br /&gt;
    echo &amp;quot;$(grep Chemgrid_Score &amp;quot;${name}_output_scored.mol2&amp;quot;) \&lt;br /&gt;
$(grep &#039;Total Energy:&#039; &amp;quot;${name}.mol2&amp;quot;)&amp;quot; \&lt;br /&gt;
        | awk &#039;{print $3, $7}&#039; &amp;gt;&amp;gt; total_energy.txt&lt;br /&gt;
done&lt;br /&gt;
# ------------------------------------------------------------------&lt;br /&gt;
echo &amp;quot;All done — summary energies written to total_energy.txt&amp;quot;(base)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Running_DOCK6_with_ChemGrid_Score_and_db2_files&amp;diff=16877</id>
		<title>Running DOCK6 with ChemGrid Score and db2 files</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Running_DOCK6_with_ChemGrid_Score_and_db2_files&amp;diff=16877"/>
		<updated>2025-09-09T19:36:50Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Installation ==&lt;br /&gt;
Obtain DOCK 6 from [https://github.com/docking-org/dock6 the official GitHub repository]. See also the DOCK 6 manual: [https://dock.compbio.ucsf.edu/DOCK_6/dock6_manual.htm#Installation Installation]. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# on epyc-A40&lt;br /&gt;
cd dock6/install&lt;br /&gt;
./configure gnu&lt;br /&gt;
make all&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Large-scale docking (LSD) ==&lt;br /&gt;
The most recent copy on Wynton is in &amp;lt;code&amp;gt;/wynton/group/bks/work/ak87/UCSF/SCRIPTS/DOCK6/2025-08-Trents_fix/dock6/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Converting DOCK 3 grids to DOCK 6 ===&lt;br /&gt;
See the [[#Convert_Grids|Scripts/Convert Grids]] section below. This has been tested on Gimel and should also work on Wynton. The preferred workflow starts from both &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;working&amp;lt;/code&amp;gt; directories produced by DOCK 3 &amp;lt;code&amp;gt;blastermaster&amp;lt;/code&amp;gt;. When that is not available, the script requires the DOCK 3 &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; only. DOCK 3 and DOCK 6 installations are needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh convert_dock3_grids_dockfiles.sh &amp;lt;path_to_dock3_grids_dockfiles&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Converted grids reproduce the same scores when rescoring DOCK 3 poses. For Mac1, however, top scores during large-scale docking were in the thousands, likely because some ligands extended beyond the grid box.&lt;br /&gt;
&lt;br /&gt;
=== Running LSD ===&lt;br /&gt;
Running LSD with DOCK 6 is analogous to DOCK 3:&lt;br /&gt;
* Prepare grids in &amp;lt;code&amp;gt;dock6files&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Obtain SubDock from [https://github.com/docking-org/SUBDOCK6/tree/main the SUBDOCK6 repository].&lt;br /&gt;
* Prepare lists of ligand &amp;lt;code&amp;gt;.tgz&amp;lt;/code&amp;gt; files in an &amp;lt;code&amp;gt;sdi&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
* Create &amp;lt;code&amp;gt;run_subdock6.sh&amp;lt;/code&amp;gt; in the working directory and run it (see [[#Submit_LSD|Scripts/Submit LSD]] below). The script targets Wynton but should work on clusters using SGE or SLURM. You can re-run it to retry unfinished jobs.&lt;br /&gt;
&lt;br /&gt;
=== Processing LSD ===&lt;br /&gt;
Run the parsing script (see [[#Process_LSD|Scripts/Process LSD]] below). It writes a CSV of scores (similar to &amp;lt;code&amp;gt;extract_all.sort.uniq.txt&amp;lt;/code&amp;gt;) and a second CSV with per-subdirectory runtimes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python parse_dock_logs.py --root /path/to/search \&lt;br /&gt;
  --ligand_csv /path/to/out/ligand_scores.csv \&lt;br /&gt;
  --stat_csv /path/to/out/stat_summary.csv&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To do:&#039;&#039;&#039; extract poses.&lt;br /&gt;
&lt;br /&gt;
== Rescoring DOCK 3 poses ==&lt;br /&gt;
See [[#Rescoring|Scripts/Rescoring]]. Edit the script to specify:&lt;br /&gt;
* The &amp;lt;code&amp;gt;mol2.gz&amp;lt;/code&amp;gt; file with poses to rescore.&lt;br /&gt;
* A directory with &amp;lt;code&amp;gt;db2&amp;lt;/code&amp;gt; files (DOCK 6 reads solvation data from these).&lt;br /&gt;
* DOCK 6 grids (&amp;lt;code&amp;gt;dock6files&amp;lt;/code&amp;gt;).&lt;br /&gt;
* Parameter files from the DOCK 6 installation.&lt;br /&gt;
* The helper &amp;lt;code&amp;gt;lc_blazing_fast_separate_mol2_into_smaller_files.py&amp;lt;/code&amp;gt; is used to split large MOL2 files for speed.&lt;br /&gt;
&lt;br /&gt;
== Scripts ==&lt;br /&gt;
=== Convert grids ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# convert_dock3_grids_dockfiles.sh&lt;br /&gt;
# Convert DOCK3 grids to DOCK6 dockfiles&lt;br /&gt;
# Author Trent Balius (converted to bash)&lt;br /&gt;
&lt;br /&gt;
set -e&lt;br /&gt;
echo &amp;quot;sh convert_dock3_grids_dockfiles.sh &amp;lt;path_to_dock3_grids_dockfiles&amp;gt;&amp;quot;&lt;br /&gt;
workdir=&amp;quot;$(pwd)&amp;quot;&lt;br /&gt;
cd &amp;quot;$workdir&amp;quot; || exit&lt;br /&gt;
# system=&amp;quot;$(basename &amp;quot;$workdir&amp;quot;)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#filedir=&amp;quot;/is2/projects/RAS-CompChem/static/work/DUDEZ/dudez_dockprep/${system}_dock6prep/blastermaster/dockfiles&amp;quot;&lt;br /&gt;
if [ -z &amp;quot;$1&amp;quot; ]; then&lt;br /&gt;
	echo &amp;quot;Usage: sh convert_dock3_grids_dockfiles.sh &amp;lt;path_to_dock3_grids_dockfiles&amp;gt;&amp;quot;&lt;br /&gt;
	exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
filedir=$1&lt;br /&gt;
# Directory where the converted DOCK6 dockfiles will be stored&lt;br /&gt;
dock6files_dir=&amp;quot;${workdir}/dock6files&amp;quot;&lt;br /&gt;
&lt;br /&gt;
mkdir -p &amp;quot;$dock6files_dir&amp;quot;&lt;br /&gt;
cd &amp;quot;$dock6files_dir&amp;quot; || exit&lt;br /&gt;
&lt;br /&gt;
cp &amp;quot;$filedir&amp;quot;/vdw.* .&lt;br /&gt;
#cp &amp;quot;$filedir/box&amp;quot; .&lt;br /&gt;
#cp &amp;quot;$filedir/qnifft.electrostatics.phi&amp;quot; .&lt;br /&gt;
cp &amp;quot;$filedir/trim.electrostatics.phi&amp;quot; .&lt;br /&gt;
cp &amp;quot;$filedir/matching_spheres.sph&amp;quot; .&lt;br /&gt;
cp &amp;quot;$filedir&amp;quot;/ligand.desolv.* .&lt;br /&gt;
cp &amp;quot;$filedir/INDOCK&amp;quot; .&lt;br /&gt;
cp &amp;quot;$filedir/rec.crg.pdb&amp;quot; rec.pdb&lt;br /&gt;
&lt;br /&gt;
perl /nfs/soft/dock/versions/dock37/DOCK-3.7-trunk/proteins/makebox/makebox.smallokay.pl matching_spheres.sph rec.pdb box 10.0&lt;br /&gt;
&lt;br /&gt;
# Creating standalone grids, so no links to the original files&lt;br /&gt;
# ln -sf vdw.bmp chem.bmp&lt;br /&gt;
# ln -sf vdw.vdw chem.vdw&lt;br /&gt;
# #ln -sf vdw.esp chem.esp&lt;br /&gt;
# ln -sf vdw.vdw chem.esp&lt;br /&gt;
# #ln -sf qnifft.electrostatics.phi rec+sph.phi&lt;br /&gt;
# #ln -sf trim.electrostatics.phi rec+sph.phi&lt;br /&gt;
# ln -sf trim.electrostatics.phi chem.phi&lt;br /&gt;
&lt;br /&gt;
cp -v vdw.bmp chem.bmp&lt;br /&gt;
cp -v  vdw.vdw chem.vdw&lt;br /&gt;
cp -v  vdw.vdw chem.esp&lt;br /&gt;
cp -v trim.electrostatics.phi chem.phi&lt;br /&gt;
&lt;br /&gt;
dsize=$(grep delphi_nsize INDOCK | awk &#039;{print $2}&#039;)&lt;br /&gt;
if [ -z &amp;quot;$dsize&amp;quot; ]; then&lt;br /&gt;
	echo &amp;quot;Error: delphi_nsize not found in INDOCK. Please check the INDOCK file.&amp;quot;&lt;br /&gt;
	exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; gconv.in&lt;br /&gt;
compute_grids                  yes&lt;br /&gt;
DOCK3_7_grids                  yes&lt;br /&gt;
QNIFFT_grid                    yes&lt;br /&gt;
grid_spacing                   0.2&lt;br /&gt;
phi_grid_size                  $dsize&lt;br /&gt;
output_molecule                no&lt;br /&gt;
contact_score                  no&lt;br /&gt;
contact_cutoff_distance        4.5&lt;br /&gt;
chemical_score                 yes&lt;br /&gt;
energy_score                   yes&lt;br /&gt;
energy_cutoff_distance         10&lt;br /&gt;
atom_model                     u&lt;br /&gt;
attractive_exponent            6&lt;br /&gt;
repulsive_exponent             12&lt;br /&gt;
distance_dielectric            yes&lt;br /&gt;
dielectric_factor              4&lt;br /&gt;
bump_filter                    yes&lt;br /&gt;
bump_overlap                   0.5&lt;br /&gt;
receptor_file                  rec.crg&lt;br /&gt;
box_file                       box&lt;br /&gt;
vdw_definition_file            /nfs/home/ak87/PROGRAM/DOCK6-NEBIUS/dock6-gritukan_merged/parameters/vdw_AMBER_parm94.defn&lt;br /&gt;
chemical_definition_file       /nfs/home/ak87/PROGRAM/DOCK6-NEBIUS/dock6-gritukan_merged/parameters/chemgrid/conv.defn&lt;br /&gt;
score_grid_prefix              chem&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
/nfs/home/ak87/PROGRAM/DOCK6-NEBIUS/dock6-gritukan_merged/bin/grid-convert -i gconv.in &amp;gt; gconv.log&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Submit LSD ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
export EXPORT_DEST=$PWD/output&lt;br /&gt;
export DOCKFILES=$PWD/dock6files&lt;br /&gt;
export DOCKEXEC=/wynton/group/bks/work/ak87/UCSF/SCRIPTS/DOCK6/2025-08-Trents_fix/dock6/bin/dock6&lt;br /&gt;
export SHRTCACHE=/dev/shm&lt;br /&gt;
export LONGCACHE=/tmp&lt;br /&gt;
export SHRTCACHE_USE_ENV=&lt;br /&gt;
export USE_DB2_TGZ=true&lt;br /&gt;
export USE_DB2_TGZ_BATCH_SIZE=1&lt;br /&gt;
export USE_DB2=false&lt;br /&gt;
export USE_DB2_BATCH_SIZE=100&lt;br /&gt;
export USE_SLURM=False&lt;br /&gt;
export USE_SLURM_ARGS=--export=ALL&lt;br /&gt;
export USE_SGE=True&lt;br /&gt;
export USE_SGE_ARGS=&amp;quot;-l s_rt=08:28:00 -l h_rt=08:30:00 -l mem_free=2G&amp;quot;&lt;br /&gt;
export USE_PARALLEL=false&lt;br /&gt;
export MAX_PARALLEL=-1&lt;br /&gt;
export QSUB_EXEC=qsub&lt;br /&gt;
export SBATCH_EXEC=sbatch&lt;br /&gt;
export PARALLEL_EXEC=parallel&lt;br /&gt;
export SUBMIT_WAIT_TIME=0&lt;br /&gt;
&lt;br /&gt;
for i in  sdi/* ; do&lt;br /&gt;
       	export k=$(basename $i .in)&lt;br /&gt;
       	echo k $k&lt;br /&gt;
       	export INPUT_SOURCE=$PWD/$i&lt;br /&gt;
       	export EXPORT_DEST=$PWD/output/$k&lt;br /&gt;
       	bash &amp;lt;/path/to/subdock6.bash&amp;gt;&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Process LSD ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env python3&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
parse_dock_logs.py&lt;br /&gt;
&lt;br /&gt;
Recursively parse DOCK &#039;dock.out*&#039; files:&lt;br /&gt;
  • Extract all LIGAND score components; keep the record with the lowest&lt;br /&gt;
    Chemgrid_Score per molecule.&lt;br /&gt;
  • Extract STAT summary for each file.&lt;br /&gt;
  • Save two CSV files: ligand_scores and stat_summary.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
    python parse_dock_logs.py \&lt;br /&gt;
        --root /path/to/search \&lt;br /&gt;
        --ligand_csv /path/to/out/ligand_scores.csv \&lt;br /&gt;
        --stat_csv /path/to/out/stat_summary.csv&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
import argparse&lt;br /&gt;
import re&lt;br /&gt;
from pathlib import Path&lt;br /&gt;
import pandas as pd&lt;br /&gt;
&lt;br /&gt;
# ──────────────────────────────────────────────────────────────────────────────&lt;br /&gt;
# Regex patterns for parsing DOCK output files&lt;br /&gt;
LIGAND_START_RE = re.compile(r&amp;quot;^-+$&amp;quot;)  # Lines with only dashes&lt;br /&gt;
MOLECULE_RE = re.compile(r&amp;quot;^\s*Molecule:\s*(\S+)&amp;quot;, re.IGNORECASE)&lt;br /&gt;
LIGAND_KEYVAL_RE = re.compile(&lt;br /&gt;
    r&amp;quot;^\s*([A-Za-z0-9_]+):\s*([-+]?\d*\.?\d+)\s*$&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
STAT_BLOCK_RE = re.compile(r&amp;quot;^(=+.*STAT|.*STAT.*)&amp;quot;, re.IGNORECASE)&lt;br /&gt;
STAT_MOLS_RE = re.compile(r&amp;quot;^\s*(\d+)\s+Molecules Processed&amp;quot;, re.IGNORECASE)&lt;br /&gt;
STAT_TIME_RE = re.compile(r&amp;quot;^Total elapsed time:\s+([\d.]+) seconds&amp;quot;, re.IGNORECASE)&lt;br /&gt;
ELAPSED_LINE_RE = re.compile(r&amp;quot;Total elapsed time:&amp;quot;, re.IGNORECASE)&lt;br /&gt;
&lt;br /&gt;
# ──────────────────────────────────────────────────────────────────────────────&lt;br /&gt;
def file_finished(lines, tail=50) -&amp;gt; bool:&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Return True if &#039;Total elapsed time&#039; appears in the last `tail` lines.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    return any(ELAPSED_LINE_RE.search(l) for l in lines[-tail:])&lt;br /&gt;
&lt;br /&gt;
# ──────────────────────────────────────────────────────────────────────────────&lt;br /&gt;
def parse_ligands(lines, subdir, filename):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Yield dictionaries with ligand scores.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    i = 0&lt;br /&gt;
    record_count = 0&lt;br /&gt;
    while i &amp;lt; len(lines):&lt;br /&gt;
        # Look for lines with dashes (separator before ligand record)&lt;br /&gt;
        if LIGAND_START_RE.match(lines[i]):&lt;br /&gt;
            # Skip ahead to find Molecule: line&lt;br /&gt;
            j = i + 1&lt;br /&gt;
            while j &amp;lt; len(lines) and not MOLECULE_RE.search(lines[j]):&lt;br /&gt;
                j += 1&lt;br /&gt;
            &lt;br /&gt;
            if j &amp;gt;= len(lines):&lt;br /&gt;
                i += 1&lt;br /&gt;
                continue&lt;br /&gt;
                &lt;br /&gt;
            # Found a molecule line, start parsing&lt;br /&gt;
            molecule_match = MOLECULE_RE.search(lines[j])&lt;br /&gt;
            if not molecule_match:&lt;br /&gt;
                i += 1&lt;br /&gt;
                continue&lt;br /&gt;
                &lt;br /&gt;
            record = {&lt;br /&gt;
                &amp;quot;subdir&amp;quot;: subdir, &lt;br /&gt;
                &amp;quot;file&amp;quot;: filename,&lt;br /&gt;
                &amp;quot;Molecule&amp;quot;: molecule_match.group(1)&lt;br /&gt;
            }&lt;br /&gt;
            &lt;br /&gt;
            # Parse key-value pairs from the rest of the record&lt;br /&gt;
            k = j + 1&lt;br /&gt;
            while k &amp;lt; len(lines):&lt;br /&gt;
                line = lines[k].strip()&lt;br /&gt;
                &lt;br /&gt;
                # Stop if we hit another separator or definitive end markers&lt;br /&gt;
                if (line.startswith(&amp;quot;---&amp;quot;) or &lt;br /&gt;
                    line.startswith(&amp;quot;===&amp;quot;) or &lt;br /&gt;
                    line.startswith(&amp;quot;score &amp;gt;&amp;quot;) or&lt;br /&gt;
                    line.startswith(&amp;quot;Total elapsed time&amp;quot;)):&lt;br /&gt;
                    break&lt;br /&gt;
                &lt;br /&gt;
                # Try to match key-value pairs&lt;br /&gt;
                kv_match = LIGAND_KEYVAL_RE.match(lines[k])&lt;br /&gt;
                if kv_match:&lt;br /&gt;
                    key, val = kv_match.groups()&lt;br /&gt;
                    if val:  # Only add if value is not empty&lt;br /&gt;
                        record[key] = float(val)&lt;br /&gt;
                &lt;br /&gt;
                k += 1&lt;br /&gt;
            &lt;br /&gt;
            # Only yield if we found meaningful data&lt;br /&gt;
            if len(record) &amp;gt; 3:  # Has molecule + metadata + at least one score&lt;br /&gt;
                record_count += 1&lt;br /&gt;
                yield record&lt;br /&gt;
            &lt;br /&gt;
            i = k  # Continue from where we left off&lt;br /&gt;
        else:&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
# ──────────────────────────────────────────────────────────────────────────────&lt;br /&gt;
def parse_stat(lines, subdir, filename):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Return dict with STAT info or None if block not found.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    for idx, line in enumerate(lines):&lt;br /&gt;
        if STAT_BLOCK_RE.match(line):&lt;br /&gt;
            mols = elapsed = None&lt;br /&gt;
            for j in range(idx + 1, len(lines)):&lt;br /&gt;
                if mols is None:&lt;br /&gt;
                    m = STAT_MOLS_RE.match(lines[j])&lt;br /&gt;
                    if m:&lt;br /&gt;
                        mols = int(m.group(1))&lt;br /&gt;
                if elapsed is None:&lt;br /&gt;
                    t = STAT_TIME_RE.match(lines[j])&lt;br /&gt;
                    if t:&lt;br /&gt;
                        elapsed = float(t.group(1))&lt;br /&gt;
                if lines[j].startswith(&amp;quot;=&amp;quot;) and j &amp;gt; idx + 1:&lt;br /&gt;
                    break  # end of STAT block&lt;br /&gt;
            return {&lt;br /&gt;
                &amp;quot;subdir&amp;quot;: subdir,&lt;br /&gt;
                &amp;quot;file&amp;quot;: filename,&lt;br /&gt;
                &amp;quot;molecules_processed&amp;quot;: mols,&lt;br /&gt;
                &amp;quot;elapsed_seconds&amp;quot;: elapsed,&lt;br /&gt;
            }&lt;br /&gt;
    return None&lt;br /&gt;
&lt;br /&gt;
# ──────────────────────────────────────────────────────────────────────────────&lt;br /&gt;
def main():&lt;br /&gt;
    ap = argparse.ArgumentParser(description=&amp;quot;Parse DOCK log files.&amp;quot;)&lt;br /&gt;
    ap.add_argument(&amp;quot;--root&amp;quot;, type=Path, default=Path.cwd(),&lt;br /&gt;
                    help=&amp;quot;Root directory to search (default: CWD)&amp;quot;)&lt;br /&gt;
    ap.add_argument(&amp;quot;--ligand_csv&amp;quot;, type=Path, required=True,&lt;br /&gt;
                    help=&amp;quot;Output CSV for ligand scores&amp;quot;)&lt;br /&gt;
    ap.add_argument(&amp;quot;--stat_csv&amp;quot;, type=Path, required=True,&lt;br /&gt;
                    help=&amp;quot;Output CSV for STAT summaries&amp;quot;)&lt;br /&gt;
    args = ap.parse_args()&lt;br /&gt;
&lt;br /&gt;
    ligand_records = []&lt;br /&gt;
    stat_records = []&lt;br /&gt;
&lt;br /&gt;
    for path in args.root.rglob(&amp;quot;dock.out*&amp;quot;):&lt;br /&gt;
        print(f&amp;quot;Processing {path}&amp;quot;)&lt;br /&gt;
        if not path.is_file():&lt;br /&gt;
            continue&lt;br /&gt;
        lines = path.read_text(errors=&amp;quot;ignore&amp;quot;).splitlines()&lt;br /&gt;
        if not file_finished(lines):&lt;br /&gt;
            print(f&amp;quot;  Skipping: file not finished&amp;quot;)&lt;br /&gt;
            continue  # skip incomplete file&lt;br /&gt;
        &lt;br /&gt;
        subdir = str(path.parent.relative_to(args.root))&lt;br /&gt;
        filename = path.name&lt;br /&gt;
&lt;br /&gt;
        # LIGAND parsing&lt;br /&gt;
        ligand_records_from_file = list(parse_ligands(lines, subdir, filename))&lt;br /&gt;
        ligand_records.extend(ligand_records_from_file)&lt;br /&gt;
        print(f&amp;quot;  Found {len(ligand_records_from_file)} ligand records&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
        # STAT parsing&lt;br /&gt;
        stat = parse_stat(lines, subdir, filename)&lt;br /&gt;
        if stat:&lt;br /&gt;
            stat_records.append(stat)&lt;br /&gt;
&lt;br /&gt;
    if not ligand_records:&lt;br /&gt;
        print(&amp;quot;No completed ligand data found.&amp;quot;)&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    # Ligand DF &amp;amp; best scores&lt;br /&gt;
    df_lig = pd.DataFrame(ligand_records)&lt;br /&gt;
    &lt;br /&gt;
    # Check if Chemgrid_Score exists, if not use alternative column&lt;br /&gt;
    score_column = &amp;quot;Chemgrid_Score&amp;quot;&lt;br /&gt;
    if score_column not in df_lig.columns:&lt;br /&gt;
        # Look for alternative score columns&lt;br /&gt;
        possible_scores = [col for col in df_lig.columns if &amp;quot;score&amp;quot; in col.lower()]&lt;br /&gt;
        if possible_scores:&lt;br /&gt;
            score_column = possible_scores[0]&lt;br /&gt;
            print(f&amp;quot;Using {score_column} instead of Chemgrid_Score&amp;quot;)&lt;br /&gt;
        else:&lt;br /&gt;
            print(&amp;quot;No score column found!&amp;quot;)&lt;br /&gt;
            return&lt;br /&gt;
    &lt;br /&gt;
    best_idx = (&lt;br /&gt;
        df_lig.groupby(&amp;quot;Molecule&amp;quot;)[score_column]&lt;br /&gt;
        .idxmin()&lt;br /&gt;
        .dropna()&lt;br /&gt;
    )&lt;br /&gt;
    df_best = df_lig.loc[best_idx].sort_values(score_column)&lt;br /&gt;
    args.ligand_csv.parent.mkdir(parents=True, exist_ok=True)&lt;br /&gt;
    df_best.to_csv(args.ligand_csv, index=False)&lt;br /&gt;
&lt;br /&gt;
    # STAT DF&lt;br /&gt;
    if stat_records:&lt;br /&gt;
        df_stat = pd.DataFrame(stat_records)&lt;br /&gt;
        args.stat_csv.parent.mkdir(parents=True, exist_ok=True)&lt;br /&gt;
        df_stat.to_csv(args.stat_csv, index=False)&lt;br /&gt;
&lt;br /&gt;
    print(f&amp;quot;Wrote {len(df_best)} molecules to {args.ligand_csv}&amp;quot;)&lt;br /&gt;
    if stat_records:&lt;br /&gt;
        print(f&amp;quot;Wrote {len(df_stat)} STAT rows to {args.stat_csv}&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
    main()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Rescoring ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env bash&lt;br /&gt;
# ------------------------------------------------------------------&lt;br /&gt;
# Rescoring pipeline — Bash port of the original tcsh script&lt;br /&gt;
# ------------------------------------------------------------------&lt;br /&gt;
# IFS=$&#039;\n\t&#039;               # safe word splitting&lt;br /&gt;
&lt;br /&gt;
# ------------------------- CONFIGURATION --------------------------&lt;br /&gt;
system=&amp;quot;AMPC&amp;quot;             # set your system tag here&lt;br /&gt;
# system=&amp;quot;EGFR&amp;quot;            # uncomment to switch target&lt;br /&gt;
&lt;br /&gt;
outdir=&amp;quot;${system}_rescore_v3.8_v6&amp;quot;&lt;br /&gt;
src_gz=&amp;quot;/home/ak87/Desktop/SMALL_PROJ/DOCK6-NEBIUS/2025-06-TEST/TEST-LINKIN/RUN-TRENTs-COMMENTS/DOCK3/1/output/test.mol2.gz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
db2_dir=&amp;quot;/home/ak87/Desktop/SMALL_PROJ/DOCK6-NEBIUS/2025-06-TEST/AMPC-TESTED/&amp;quot;&lt;br /&gt;
dockfiles_link=&amp;quot;/home/ak87/Desktop/SMALL_PROJ/DOCK6-NEBIUS/2025-06-TEST/TMP2/dock6files&amp;quot;&lt;br /&gt;
&lt;br /&gt;
dock6_bin=&amp;quot;/home/ak87/Programs/dock6-gritukan_merged/bin/dock6&amp;quot;&lt;br /&gt;
separate_py=&amp;quot;/home/ak87/Programs/lc_blazing_fast_separate_mol2_into_smaller_files_AK.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
vdw_defn=&amp;quot;/home/ak87/Programs/dock6-gritukan_merged/parameters/vdw_AMBER_parm94.dock3_7.defn&amp;quot;&lt;br /&gt;
flex_defn=&amp;quot;/home/ak87/Programs/dock6-gritukan_merged/parameters/flex.defn&amp;quot;&lt;br /&gt;
flex_tbl=&amp;quot;/home/ak87/Programs/dock6-gritukan_merged/parameters/flex_drive.tbl&amp;quot;&lt;br /&gt;
# ------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
mkdir -p &amp;quot;$outdir&amp;quot;&lt;br /&gt;
cd &amp;quot;$outdir&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Unzip test.mol2 once&lt;br /&gt;
zcat &amp;quot;$src_gz&amp;quot; &amp;gt; test.mol2&lt;br /&gt;
&lt;br /&gt;
# Link dockfiles directory (overwrite stale link if present)&lt;br /&gt;
ln -sfn &amp;quot;$dockfiles_link&amp;quot; dockfiles&lt;br /&gt;
&lt;br /&gt;
# Fresh output accumulator&lt;br /&gt;
rm -f total_energy.txt&lt;br /&gt;
&lt;br /&gt;
# Split the multi-mol2 file into chunks named split001.mol2 …&lt;br /&gt;
python &amp;quot;$separate_py&amp;quot; test.mol2 split 1&lt;br /&gt;
rm test.mol2&lt;br /&gt;
mol2files=$(ls *.mol2)&lt;br /&gt;
echo $mol2files&lt;br /&gt;
&lt;br /&gt;
# ---------------------- MAIN PROCESSING LOOP ---------------------&lt;br /&gt;
for mol2file in $mol2files; do&lt;br /&gt;
    # Grab ligand-source path (single value expected)&lt;br /&gt;
    # file=$(grep -m1 &amp;quot;Ligand Source File:&amp;quot; &amp;quot;$mol2file&amp;quot; | awk &#039;{print $5}&#039;)&lt;br /&gt;
    ligand_id=$(grep &amp;quot;##########                 Name:&amp;quot; &amp;quot;$mol2file&amp;quot; | awk &#039;{print $3}&#039;)&lt;br /&gt;
    ligand_charge=$(grep &amp;quot;##########        Ligand Charge:&amp;quot; &amp;quot;$mol2file&amp;quot; | awk &#039;{print $4}&#039;)&lt;br /&gt;
    echo &amp;quot;Processing ligand: $ligand_id (charge: $ligand_charge, source: $mol2file)&amp;quot;&lt;br /&gt;
    found_file=false&lt;br /&gt;
    for file in &amp;quot;$db2_dir&amp;quot;/*&amp;quot;$ligand_id&amp;quot;*.db2; do&lt;br /&gt;
        echo &amp;quot;Checking file: $file&amp;quot;&lt;br /&gt;
        this_charge=$(head -n 2 &amp;quot;$file&amp;quot; | tail -n 1 | awk &#039;{print $2}&#039;)&lt;br /&gt;
        echo $ligand_id $this_charge $ligand_charge&lt;br /&gt;
        match=$(python3 -c &amp;quot;import sys; print(&amp;quot;1&amp;quot;) if float(&#039;$ligand_charge&#039;) == float(&#039;$this_charge&#039;) else sprint(&amp;quot;2&amp;quot;)&amp;quot;)&lt;br /&gt;
        if [[ &amp;quot;$match&amp;quot; -eq &amp;quot;1&amp;quot; ]]; then&lt;br /&gt;
            echo &amp;quot;Found source file: $file (charge match: $ligand_charge)&amp;quot;&lt;br /&gt;
            found_file=true&lt;br /&gt;
            break&lt;br /&gt;
        fi&lt;br /&gt;
    done&lt;br /&gt;
    if [[ $found_file == false ]]; then&lt;br /&gt;
        echo &amp;quot;No matching source file found for ligand: $ligand_id (charge: $ligand_charge)&amp;quot;&lt;br /&gt;
        continue&lt;br /&gt;
    fi&lt;br /&gt;
    name=&amp;quot;${mol2file%.*}&amp;quot;          # basename without .mol2&lt;br /&gt;
&lt;br /&gt;
    echo &amp;quot;Processing $mol2file  (source ⇒ $file)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # Build solvation table&lt;br /&gt;
    cat &amp;quot;$file&amp;quot; | grep &amp;quot;^A&amp;quot; \&lt;br /&gt;
        | awk &#039;{printf&amp;quot;%f %f %f %f %f\n&amp;quot;,0.0,$8,0.0,$9,$10}&#039; \&lt;br /&gt;
        &amp;gt; &amp;quot;${name}.solv&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    printf &#039;%s\n&#039; &amp;quot;$name&amp;quot; &amp;gt; molname.txt   # not used later but kept&lt;br /&gt;
&lt;br /&gt;
    # Append TRIPOS solvation section&lt;br /&gt;
    {&lt;br /&gt;
        printf &#039;@&amp;lt;TRIPOS&amp;gt;SOLVATION\n&#039;&lt;br /&gt;
        printf &#039;LIG header\n&#039;&lt;br /&gt;
        cat &amp;quot;${name}.solv&amp;quot;&lt;br /&gt;
    } &amp;gt;&amp;gt; &amp;quot;${name}.mol2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # ------------------- Generate dock.in on-the-fly --------------&lt;br /&gt;
    cat &amp;gt; dock.in &amp;lt;&amp;lt;EOF&lt;br /&gt;
conformer_search_type                                        rigid&lt;br /&gt;
use_internal_energy                                          no&lt;br /&gt;
ligand_atom_file                                             ${name}.mol2&lt;br /&gt;
limit_max_ligands                                            no&lt;br /&gt;
skip_molecule                                                no&lt;br /&gt;
read_mol_solvation                                           yes&lt;br /&gt;
calculate_rmsd                                               no&lt;br /&gt;
use_database_filter                                          no&lt;br /&gt;
orient_ligand                                                no&lt;br /&gt;
bump_filter                                                  no&lt;br /&gt;
score_molecules                                              yes&lt;br /&gt;
contact_score_primary                                        no&lt;br /&gt;
grid_score_primary                                           no&lt;br /&gt;
gist_score_primary                                           no&lt;br /&gt;
multigrid_score_primary                                      no&lt;br /&gt;
dock3.5_score_primary                                        yes&lt;br /&gt;
dock3.5_vdw_score                                            yes&lt;br /&gt;
dock3.5_grd_prefix                                           dockfiles/chem52&lt;br /&gt;
dock3.5_electrostatic_score                                  yes&lt;br /&gt;
dock3.5_ligand_desolvation_score                             volume&lt;br /&gt;
dock3.5_solvent_occlusion_file                               dockfiles/ligand.desolv.heavy&lt;br /&gt;
dock3.5_redistribute_positive_desolvation                    no&lt;br /&gt;
dock3.5_hydrogen_desolvation_grid                            yes&lt;br /&gt;
dock3.5_hydrogen_solvent_occlusion_file                      dockfiles/ligand.desolv.hydrogen&lt;br /&gt;
dock3.5_receptor_desolvation_score                           no&lt;br /&gt;
dock3.5_write_atomic_energy_contrib                          no&lt;br /&gt;
dock3.5_score_vdw_scale                                      1&lt;br /&gt;
dock3.5_score_es_scale                                       1&lt;br /&gt;
minimize_ligand                                              no&lt;br /&gt;
atom_model                                                   all&lt;br /&gt;
vdw_defn_file                                                ${vdw_defn}&lt;br /&gt;
flex_defn_file                                               ${flex_defn}&lt;br /&gt;
flex_drive_file                                              ${flex_tbl}&lt;br /&gt;
ligand_outfile_prefix                                        ${name}_output&lt;br /&gt;
write_orientations                                           no&lt;br /&gt;
num_scored_conformers                                        1&lt;br /&gt;
rank_ligands                                                 no&lt;br /&gt;
EOF&lt;br /&gt;
    # --------------------- Run DOCK and harvest -------------------&lt;br /&gt;
    &amp;quot;$dock6_bin&amp;quot; -i dock.in -o dock.out&lt;br /&gt;
&lt;br /&gt;
    # Pull chemgrid and energy terms into running table&lt;br /&gt;
    echo &amp;quot;$(grep Chemgrid_Score &amp;quot;${name}_output_scored.mol2&amp;quot;) \&lt;br /&gt;
$(grep &#039;Total Energy:&#039; &amp;quot;${name}.mol2&amp;quot;)&amp;quot; \&lt;br /&gt;
        | awk &#039;{print $3, $7}&#039; &amp;gt;&amp;gt; total_energy.txt&lt;br /&gt;
done&lt;br /&gt;
# ------------------------------------------------------------------&lt;br /&gt;
echo &amp;quot;All done — summary energies written to total_energy.txt&amp;quot;(base)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Running_DOCK6_with_ChemGrid_Score_and_db2_files&amp;diff=16876</id>
		<title>Running DOCK6 with ChemGrid Score and db2 files</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Running_DOCK6_with_ChemGrid_Score_and_db2_files&amp;diff=16876"/>
		<updated>2025-09-09T19:36:10Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Installation ==&lt;br /&gt;
Obtain DOCK 6 from [https://github.com/docking-org/dock6 the official GitHub repository]. See also the DOCK 6 manual: [https://dock.compbio.ucsf.edu/DOCK_6/dock6_manual.htm#Installation Installation]. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# on epyc-A40&lt;br /&gt;
cd dock6/install&lt;br /&gt;
./configure gnu&lt;br /&gt;
make all&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Large-scale docking (LSD) ==&lt;br /&gt;
The most recent copy on Wynton is in &amp;lt;code&amp;gt;/wynton/group/bks/work/ak87/UCSF/SCRIPTS/DOCK6/2025-08-Trents_fix/dock6/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Converting DOCK 3 grids to DOCK 6 ===&lt;br /&gt;
See the [[#Convert Grids|Scripts/Convert_grids]] section below. This has been tested on Gimel and should also work on Wynton. The preferred workflow starts from both &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;working&amp;lt;/code&amp;gt; directories produced by DOCK 3 &amp;lt;code&amp;gt;blastermaster&amp;lt;/code&amp;gt;. When that is not available, the script requires the DOCK 3 &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; only. DOCK 3 and DOCK 6 installations are needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh convert_dock3_grids_dockfiles.sh &amp;lt;path_to_dock3_grids_dockfiles&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Converted grids reproduce the same scores when rescoring DOCK 3 poses. For Mac1, however, top scores during large-scale docking were in the thousands, likely because some ligands extended beyond the grid box.&lt;br /&gt;
&lt;br /&gt;
=== Running LSD ===&lt;br /&gt;
Running LSD with DOCK 6 is analogous to DOCK 3:&lt;br /&gt;
* Prepare grids in &amp;lt;code&amp;gt;dock6files&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Obtain SubDock from [https://github.com/docking-org/SUBDOCK6/tree/main the SUBDOCK6 repository].&lt;br /&gt;
* Prepare lists of ligand &amp;lt;code&amp;gt;.tgz&amp;lt;/code&amp;gt; files in an &amp;lt;code&amp;gt;sdi&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
* Create &amp;lt;code&amp;gt;run_subdock6.sh&amp;lt;/code&amp;gt; in the working directory and run it (see [[#Submit LSD|Scripts/Submit_LSD]] below). The script targets Wynton but should work on clusters using SGE or SLURM. You can re-run it to retry unfinished jobs.&lt;br /&gt;
&lt;br /&gt;
=== Processing LSD ===&lt;br /&gt;
Run the parsing script (see [[#Process LSD|Scripts/Process_LSD]] below). It writes a CSV of scores (similar to &amp;lt;code&amp;gt;extract_all.sort.uniq.txt&amp;lt;/code&amp;gt;) and a second CSV with per-subdirectory runtimes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python parse_dock_logs.py --root /path/to/search \&lt;br /&gt;
  --ligand_csv /path/to/out/ligand_scores.csv \&lt;br /&gt;
  --stat_csv /path/to/out/stat_summary.csv&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To do:&#039;&#039;&#039; extract poses.&lt;br /&gt;
&lt;br /&gt;
== Rescoring DOCK 3 poses ==&lt;br /&gt;
See [[#Rescoring|Scripts/Rescoring]]. Edit the script to specify:&lt;br /&gt;
* The &amp;lt;code&amp;gt;mol2.gz&amp;lt;/code&amp;gt; file with poses to rescore.&lt;br /&gt;
* A directory with &amp;lt;code&amp;gt;db2&amp;lt;/code&amp;gt; files (DOCK 6 reads solvation data from these).&lt;br /&gt;
* DOCK 6 grids (&amp;lt;code&amp;gt;dock6files&amp;lt;/code&amp;gt;).&lt;br /&gt;
* Parameter files from the DOCK 6 installation.&lt;br /&gt;
* The helper &amp;lt;code&amp;gt;lc_blazing_fast_separate_mol2_into_smaller_files.py&amp;lt;/code&amp;gt; is used to split large MOL2 files for speed.&lt;br /&gt;
&lt;br /&gt;
== Scripts ==&lt;br /&gt;
=== Convert grids ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# convert_dock3_grids_dockfiles.sh&lt;br /&gt;
# Convert DOCK3 grids to DOCK6 dockfiles&lt;br /&gt;
# Author Trent Balius (converted to bash)&lt;br /&gt;
&lt;br /&gt;
set -e&lt;br /&gt;
echo &amp;quot;sh convert_dock3_grids_dockfiles.sh &amp;lt;path_to_dock3_grids_dockfiles&amp;gt;&amp;quot;&lt;br /&gt;
workdir=&amp;quot;$(pwd)&amp;quot;&lt;br /&gt;
cd &amp;quot;$workdir&amp;quot; || exit&lt;br /&gt;
# system=&amp;quot;$(basename &amp;quot;$workdir&amp;quot;)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#filedir=&amp;quot;/is2/projects/RAS-CompChem/static/work/DUDEZ/dudez_dockprep/${system}_dock6prep/blastermaster/dockfiles&amp;quot;&lt;br /&gt;
if [ -z &amp;quot;$1&amp;quot; ]; then&lt;br /&gt;
	echo &amp;quot;Usage: sh convert_dock3_grids_dockfiles.sh &amp;lt;path_to_dock3_grids_dockfiles&amp;gt;&amp;quot;&lt;br /&gt;
	exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
filedir=$1&lt;br /&gt;
# Directory where the converted DOCK6 dockfiles will be stored&lt;br /&gt;
dock6files_dir=&amp;quot;${workdir}/dock6files&amp;quot;&lt;br /&gt;
&lt;br /&gt;
mkdir -p &amp;quot;$dock6files_dir&amp;quot;&lt;br /&gt;
cd &amp;quot;$dock6files_dir&amp;quot; || exit&lt;br /&gt;
&lt;br /&gt;
cp &amp;quot;$filedir&amp;quot;/vdw.* .&lt;br /&gt;
#cp &amp;quot;$filedir/box&amp;quot; .&lt;br /&gt;
#cp &amp;quot;$filedir/qnifft.electrostatics.phi&amp;quot; .&lt;br /&gt;
cp &amp;quot;$filedir/trim.electrostatics.phi&amp;quot; .&lt;br /&gt;
cp &amp;quot;$filedir/matching_spheres.sph&amp;quot; .&lt;br /&gt;
cp &amp;quot;$filedir&amp;quot;/ligand.desolv.* .&lt;br /&gt;
cp &amp;quot;$filedir/INDOCK&amp;quot; .&lt;br /&gt;
cp &amp;quot;$filedir/rec.crg.pdb&amp;quot; rec.pdb&lt;br /&gt;
&lt;br /&gt;
perl /nfs/soft/dock/versions/dock37/DOCK-3.7-trunk/proteins/makebox/makebox.smallokay.pl matching_spheres.sph rec.pdb box 10.0&lt;br /&gt;
&lt;br /&gt;
# Creating standalone grids, so no links to the original files&lt;br /&gt;
# ln -sf vdw.bmp chem.bmp&lt;br /&gt;
# ln -sf vdw.vdw chem.vdw&lt;br /&gt;
# #ln -sf vdw.esp chem.esp&lt;br /&gt;
# ln -sf vdw.vdw chem.esp&lt;br /&gt;
# #ln -sf qnifft.electrostatics.phi rec+sph.phi&lt;br /&gt;
# #ln -sf trim.electrostatics.phi rec+sph.phi&lt;br /&gt;
# ln -sf trim.electrostatics.phi chem.phi&lt;br /&gt;
&lt;br /&gt;
cp -v vdw.bmp chem.bmp&lt;br /&gt;
cp -v  vdw.vdw chem.vdw&lt;br /&gt;
cp -v  vdw.vdw chem.esp&lt;br /&gt;
cp -v trim.electrostatics.phi chem.phi&lt;br /&gt;
&lt;br /&gt;
dsize=$(grep delphi_nsize INDOCK | awk &#039;{print $2}&#039;)&lt;br /&gt;
if [ -z &amp;quot;$dsize&amp;quot; ]; then&lt;br /&gt;
	echo &amp;quot;Error: delphi_nsize not found in INDOCK. Please check the INDOCK file.&amp;quot;&lt;br /&gt;
	exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; gconv.in&lt;br /&gt;
compute_grids                  yes&lt;br /&gt;
DOCK3_7_grids                  yes&lt;br /&gt;
QNIFFT_grid                    yes&lt;br /&gt;
grid_spacing                   0.2&lt;br /&gt;
phi_grid_size                  $dsize&lt;br /&gt;
output_molecule                no&lt;br /&gt;
contact_score                  no&lt;br /&gt;
contact_cutoff_distance        4.5&lt;br /&gt;
chemical_score                 yes&lt;br /&gt;
energy_score                   yes&lt;br /&gt;
energy_cutoff_distance         10&lt;br /&gt;
atom_model                     u&lt;br /&gt;
attractive_exponent            6&lt;br /&gt;
repulsive_exponent             12&lt;br /&gt;
distance_dielectric            yes&lt;br /&gt;
dielectric_factor              4&lt;br /&gt;
bump_filter                    yes&lt;br /&gt;
bump_overlap                   0.5&lt;br /&gt;
receptor_file                  rec.crg&lt;br /&gt;
box_file                       box&lt;br /&gt;
vdw_definition_file            /nfs/home/ak87/PROGRAM/DOCK6-NEBIUS/dock6-gritukan_merged/parameters/vdw_AMBER_parm94.defn&lt;br /&gt;
chemical_definition_file       /nfs/home/ak87/PROGRAM/DOCK6-NEBIUS/dock6-gritukan_merged/parameters/chemgrid/conv.defn&lt;br /&gt;
score_grid_prefix              chem&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
/nfs/home/ak87/PROGRAM/DOCK6-NEBIUS/dock6-gritukan_merged/bin/grid-convert -i gconv.in &amp;gt; gconv.log&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Submit LSD ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
export EXPORT_DEST=$PWD/output&lt;br /&gt;
export DOCKFILES=$PWD/dock6files&lt;br /&gt;
export DOCKEXEC=/wynton/group/bks/work/ak87/UCSF/SCRIPTS/DOCK6/2025-08-Trents_fix/dock6/bin/dock6&lt;br /&gt;
export SHRTCACHE=/dev/shm&lt;br /&gt;
export LONGCACHE=/tmp&lt;br /&gt;
export SHRTCACHE_USE_ENV=&lt;br /&gt;
export USE_DB2_TGZ=true&lt;br /&gt;
export USE_DB2_TGZ_BATCH_SIZE=1&lt;br /&gt;
export USE_DB2=false&lt;br /&gt;
export USE_DB2_BATCH_SIZE=100&lt;br /&gt;
export USE_SLURM=False&lt;br /&gt;
export USE_SLURM_ARGS=--export=ALL&lt;br /&gt;
export USE_SGE=True&lt;br /&gt;
export USE_SGE_ARGS=&amp;quot;-l s_rt=08:28:00 -l h_rt=08:30:00 -l mem_free=2G&amp;quot;&lt;br /&gt;
export USE_PARALLEL=false&lt;br /&gt;
export MAX_PARALLEL=-1&lt;br /&gt;
export QSUB_EXEC=qsub&lt;br /&gt;
export SBATCH_EXEC=sbatch&lt;br /&gt;
export PARALLEL_EXEC=parallel&lt;br /&gt;
export SUBMIT_WAIT_TIME=0&lt;br /&gt;
&lt;br /&gt;
for i in  sdi/* ; do&lt;br /&gt;
       	export k=$(basename $i .in)&lt;br /&gt;
       	echo k $k&lt;br /&gt;
       	export INPUT_SOURCE=$PWD/$i&lt;br /&gt;
       	export EXPORT_DEST=$PWD/output/$k&lt;br /&gt;
       	bash &amp;lt;/path/to/subdock6.bash&amp;gt;&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Process LSD ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env python3&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
parse_dock_logs.py&lt;br /&gt;
&lt;br /&gt;
Recursively parse DOCK &#039;dock.out*&#039; files:&lt;br /&gt;
  • Extract all LIGAND score components; keep the record with the lowest&lt;br /&gt;
    Chemgrid_Score per molecule.&lt;br /&gt;
  • Extract STAT summary for each file.&lt;br /&gt;
  • Save two CSV files: ligand_scores and stat_summary.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
    python parse_dock_logs.py \&lt;br /&gt;
        --root /path/to/search \&lt;br /&gt;
        --ligand_csv /path/to/out/ligand_scores.csv \&lt;br /&gt;
        --stat_csv /path/to/out/stat_summary.csv&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
import argparse&lt;br /&gt;
import re&lt;br /&gt;
from pathlib import Path&lt;br /&gt;
import pandas as pd&lt;br /&gt;
&lt;br /&gt;
# ──────────────────────────────────────────────────────────────────────────────&lt;br /&gt;
# Regex patterns for parsing DOCK output files&lt;br /&gt;
LIGAND_START_RE = re.compile(r&amp;quot;^-+$&amp;quot;)  # Lines with only dashes&lt;br /&gt;
MOLECULE_RE = re.compile(r&amp;quot;^\s*Molecule:\s*(\S+)&amp;quot;, re.IGNORECASE)&lt;br /&gt;
LIGAND_KEYVAL_RE = re.compile(&lt;br /&gt;
    r&amp;quot;^\s*([A-Za-z0-9_]+):\s*([-+]?\d*\.?\d+)\s*$&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
STAT_BLOCK_RE = re.compile(r&amp;quot;^(=+.*STAT|.*STAT.*)&amp;quot;, re.IGNORECASE)&lt;br /&gt;
STAT_MOLS_RE = re.compile(r&amp;quot;^\s*(\d+)\s+Molecules Processed&amp;quot;, re.IGNORECASE)&lt;br /&gt;
STAT_TIME_RE = re.compile(r&amp;quot;^Total elapsed time:\s+([\d.]+) seconds&amp;quot;, re.IGNORECASE)&lt;br /&gt;
ELAPSED_LINE_RE = re.compile(r&amp;quot;Total elapsed time:&amp;quot;, re.IGNORECASE)&lt;br /&gt;
&lt;br /&gt;
# ──────────────────────────────────────────────────────────────────────────────&lt;br /&gt;
def file_finished(lines, tail=50) -&amp;gt; bool:&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Return True if &#039;Total elapsed time&#039; appears in the last `tail` lines.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    return any(ELAPSED_LINE_RE.search(l) for l in lines[-tail:])&lt;br /&gt;
&lt;br /&gt;
# ──────────────────────────────────────────────────────────────────────────────&lt;br /&gt;
def parse_ligands(lines, subdir, filename):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Yield dictionaries with ligand scores.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    i = 0&lt;br /&gt;
    record_count = 0&lt;br /&gt;
    while i &amp;lt; len(lines):&lt;br /&gt;
        # Look for lines with dashes (separator before ligand record)&lt;br /&gt;
        if LIGAND_START_RE.match(lines[i]):&lt;br /&gt;
            # Skip ahead to find Molecule: line&lt;br /&gt;
            j = i + 1&lt;br /&gt;
            while j &amp;lt; len(lines) and not MOLECULE_RE.search(lines[j]):&lt;br /&gt;
                j += 1&lt;br /&gt;
            &lt;br /&gt;
            if j &amp;gt;= len(lines):&lt;br /&gt;
                i += 1&lt;br /&gt;
                continue&lt;br /&gt;
                &lt;br /&gt;
            # Found a molecule line, start parsing&lt;br /&gt;
            molecule_match = MOLECULE_RE.search(lines[j])&lt;br /&gt;
            if not molecule_match:&lt;br /&gt;
                i += 1&lt;br /&gt;
                continue&lt;br /&gt;
                &lt;br /&gt;
            record = {&lt;br /&gt;
                &amp;quot;subdir&amp;quot;: subdir, &lt;br /&gt;
                &amp;quot;file&amp;quot;: filename,&lt;br /&gt;
                &amp;quot;Molecule&amp;quot;: molecule_match.group(1)&lt;br /&gt;
            }&lt;br /&gt;
            &lt;br /&gt;
            # Parse key-value pairs from the rest of the record&lt;br /&gt;
            k = j + 1&lt;br /&gt;
            while k &amp;lt; len(lines):&lt;br /&gt;
                line = lines[k].strip()&lt;br /&gt;
                &lt;br /&gt;
                # Stop if we hit another separator or definitive end markers&lt;br /&gt;
                if (line.startswith(&amp;quot;---&amp;quot;) or &lt;br /&gt;
                    line.startswith(&amp;quot;===&amp;quot;) or &lt;br /&gt;
                    line.startswith(&amp;quot;score &amp;gt;&amp;quot;) or&lt;br /&gt;
                    line.startswith(&amp;quot;Total elapsed time&amp;quot;)):&lt;br /&gt;
                    break&lt;br /&gt;
                &lt;br /&gt;
                # Try to match key-value pairs&lt;br /&gt;
                kv_match = LIGAND_KEYVAL_RE.match(lines[k])&lt;br /&gt;
                if kv_match:&lt;br /&gt;
                    key, val = kv_match.groups()&lt;br /&gt;
                    if val:  # Only add if value is not empty&lt;br /&gt;
                        record[key] = float(val)&lt;br /&gt;
                &lt;br /&gt;
                k += 1&lt;br /&gt;
            &lt;br /&gt;
            # Only yield if we found meaningful data&lt;br /&gt;
            if len(record) &amp;gt; 3:  # Has molecule + metadata + at least one score&lt;br /&gt;
                record_count += 1&lt;br /&gt;
                yield record&lt;br /&gt;
            &lt;br /&gt;
            i = k  # Continue from where we left off&lt;br /&gt;
        else:&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
# ──────────────────────────────────────────────────────────────────────────────&lt;br /&gt;
def parse_stat(lines, subdir, filename):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Return dict with STAT info or None if block not found.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    for idx, line in enumerate(lines):&lt;br /&gt;
        if STAT_BLOCK_RE.match(line):&lt;br /&gt;
            mols = elapsed = None&lt;br /&gt;
            for j in range(idx + 1, len(lines)):&lt;br /&gt;
                if mols is None:&lt;br /&gt;
                    m = STAT_MOLS_RE.match(lines[j])&lt;br /&gt;
                    if m:&lt;br /&gt;
                        mols = int(m.group(1))&lt;br /&gt;
                if elapsed is None:&lt;br /&gt;
                    t = STAT_TIME_RE.match(lines[j])&lt;br /&gt;
                    if t:&lt;br /&gt;
                        elapsed = float(t.group(1))&lt;br /&gt;
                if lines[j].startswith(&amp;quot;=&amp;quot;) and j &amp;gt; idx + 1:&lt;br /&gt;
                    break  # end of STAT block&lt;br /&gt;
            return {&lt;br /&gt;
                &amp;quot;subdir&amp;quot;: subdir,&lt;br /&gt;
                &amp;quot;file&amp;quot;: filename,&lt;br /&gt;
                &amp;quot;molecules_processed&amp;quot;: mols,&lt;br /&gt;
                &amp;quot;elapsed_seconds&amp;quot;: elapsed,&lt;br /&gt;
            }&lt;br /&gt;
    return None&lt;br /&gt;
&lt;br /&gt;
# ──────────────────────────────────────────────────────────────────────────────&lt;br /&gt;
def main():&lt;br /&gt;
    ap = argparse.ArgumentParser(description=&amp;quot;Parse DOCK log files.&amp;quot;)&lt;br /&gt;
    ap.add_argument(&amp;quot;--root&amp;quot;, type=Path, default=Path.cwd(),&lt;br /&gt;
                    help=&amp;quot;Root directory to search (default: CWD)&amp;quot;)&lt;br /&gt;
    ap.add_argument(&amp;quot;--ligand_csv&amp;quot;, type=Path, required=True,&lt;br /&gt;
                    help=&amp;quot;Output CSV for ligand scores&amp;quot;)&lt;br /&gt;
    ap.add_argument(&amp;quot;--stat_csv&amp;quot;, type=Path, required=True,&lt;br /&gt;
                    help=&amp;quot;Output CSV for STAT summaries&amp;quot;)&lt;br /&gt;
    args = ap.parse_args()&lt;br /&gt;
&lt;br /&gt;
    ligand_records = []&lt;br /&gt;
    stat_records = []&lt;br /&gt;
&lt;br /&gt;
    for path in args.root.rglob(&amp;quot;dock.out*&amp;quot;):&lt;br /&gt;
        print(f&amp;quot;Processing {path}&amp;quot;)&lt;br /&gt;
        if not path.is_file():&lt;br /&gt;
            continue&lt;br /&gt;
        lines = path.read_text(errors=&amp;quot;ignore&amp;quot;).splitlines()&lt;br /&gt;
        if not file_finished(lines):&lt;br /&gt;
            print(f&amp;quot;  Skipping: file not finished&amp;quot;)&lt;br /&gt;
            continue  # skip incomplete file&lt;br /&gt;
        &lt;br /&gt;
        subdir = str(path.parent.relative_to(args.root))&lt;br /&gt;
        filename = path.name&lt;br /&gt;
&lt;br /&gt;
        # LIGAND parsing&lt;br /&gt;
        ligand_records_from_file = list(parse_ligands(lines, subdir, filename))&lt;br /&gt;
        ligand_records.extend(ligand_records_from_file)&lt;br /&gt;
        print(f&amp;quot;  Found {len(ligand_records_from_file)} ligand records&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
        # STAT parsing&lt;br /&gt;
        stat = parse_stat(lines, subdir, filename)&lt;br /&gt;
        if stat:&lt;br /&gt;
            stat_records.append(stat)&lt;br /&gt;
&lt;br /&gt;
    if not ligand_records:&lt;br /&gt;
        print(&amp;quot;No completed ligand data found.&amp;quot;)&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    # Ligand DF &amp;amp; best scores&lt;br /&gt;
    df_lig = pd.DataFrame(ligand_records)&lt;br /&gt;
    &lt;br /&gt;
    # Check if Chemgrid_Score exists, if not use alternative column&lt;br /&gt;
    score_column = &amp;quot;Chemgrid_Score&amp;quot;&lt;br /&gt;
    if score_column not in df_lig.columns:&lt;br /&gt;
        # Look for alternative score columns&lt;br /&gt;
        possible_scores = [col for col in df_lig.columns if &amp;quot;score&amp;quot; in col.lower()]&lt;br /&gt;
        if possible_scores:&lt;br /&gt;
            score_column = possible_scores[0]&lt;br /&gt;
            print(f&amp;quot;Using {score_column} instead of Chemgrid_Score&amp;quot;)&lt;br /&gt;
        else:&lt;br /&gt;
            print(&amp;quot;No score column found!&amp;quot;)&lt;br /&gt;
            return&lt;br /&gt;
    &lt;br /&gt;
    best_idx = (&lt;br /&gt;
        df_lig.groupby(&amp;quot;Molecule&amp;quot;)[score_column]&lt;br /&gt;
        .idxmin()&lt;br /&gt;
        .dropna()&lt;br /&gt;
    )&lt;br /&gt;
    df_best = df_lig.loc[best_idx].sort_values(score_column)&lt;br /&gt;
    args.ligand_csv.parent.mkdir(parents=True, exist_ok=True)&lt;br /&gt;
    df_best.to_csv(args.ligand_csv, index=False)&lt;br /&gt;
&lt;br /&gt;
    # STAT DF&lt;br /&gt;
    if stat_records:&lt;br /&gt;
        df_stat = pd.DataFrame(stat_records)&lt;br /&gt;
        args.stat_csv.parent.mkdir(parents=True, exist_ok=True)&lt;br /&gt;
        df_stat.to_csv(args.stat_csv, index=False)&lt;br /&gt;
&lt;br /&gt;
    print(f&amp;quot;Wrote {len(df_best)} molecules to {args.ligand_csv}&amp;quot;)&lt;br /&gt;
    if stat_records:&lt;br /&gt;
        print(f&amp;quot;Wrote {len(df_stat)} STAT rows to {args.stat_csv}&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
    main()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Rescoring ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env bash&lt;br /&gt;
# ------------------------------------------------------------------&lt;br /&gt;
# Rescoring pipeline — Bash port of the original tcsh script&lt;br /&gt;
# ------------------------------------------------------------------&lt;br /&gt;
# IFS=$&#039;\n\t&#039;               # safe word splitting&lt;br /&gt;
&lt;br /&gt;
# ------------------------- CONFIGURATION --------------------------&lt;br /&gt;
system=&amp;quot;AMPC&amp;quot;             # set your system tag here&lt;br /&gt;
# system=&amp;quot;EGFR&amp;quot;            # uncomment to switch target&lt;br /&gt;
&lt;br /&gt;
outdir=&amp;quot;${system}_rescore_v3.8_v6&amp;quot;&lt;br /&gt;
src_gz=&amp;quot;/home/ak87/Desktop/SMALL_PROJ/DOCK6-NEBIUS/2025-06-TEST/TEST-LINKIN/RUN-TRENTs-COMMENTS/DOCK3/1/output/test.mol2.gz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
db2_dir=&amp;quot;/home/ak87/Desktop/SMALL_PROJ/DOCK6-NEBIUS/2025-06-TEST/AMPC-TESTED/&amp;quot;&lt;br /&gt;
dockfiles_link=&amp;quot;/home/ak87/Desktop/SMALL_PROJ/DOCK6-NEBIUS/2025-06-TEST/TMP2/dock6files&amp;quot;&lt;br /&gt;
&lt;br /&gt;
dock6_bin=&amp;quot;/home/ak87/Programs/dock6-gritukan_merged/bin/dock6&amp;quot;&lt;br /&gt;
separate_py=&amp;quot;/home/ak87/Programs/lc_blazing_fast_separate_mol2_into_smaller_files_AK.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
vdw_defn=&amp;quot;/home/ak87/Programs/dock6-gritukan_merged/parameters/vdw_AMBER_parm94.dock3_7.defn&amp;quot;&lt;br /&gt;
flex_defn=&amp;quot;/home/ak87/Programs/dock6-gritukan_merged/parameters/flex.defn&amp;quot;&lt;br /&gt;
flex_tbl=&amp;quot;/home/ak87/Programs/dock6-gritukan_merged/parameters/flex_drive.tbl&amp;quot;&lt;br /&gt;
# ------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
mkdir -p &amp;quot;$outdir&amp;quot;&lt;br /&gt;
cd &amp;quot;$outdir&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Unzip test.mol2 once&lt;br /&gt;
zcat &amp;quot;$src_gz&amp;quot; &amp;gt; test.mol2&lt;br /&gt;
&lt;br /&gt;
# Link dockfiles directory (overwrite stale link if present)&lt;br /&gt;
ln -sfn &amp;quot;$dockfiles_link&amp;quot; dockfiles&lt;br /&gt;
&lt;br /&gt;
# Fresh output accumulator&lt;br /&gt;
rm -f total_energy.txt&lt;br /&gt;
&lt;br /&gt;
# Split the multi-mol2 file into chunks named split001.mol2 …&lt;br /&gt;
python &amp;quot;$separate_py&amp;quot; test.mol2 split 1&lt;br /&gt;
rm test.mol2&lt;br /&gt;
mol2files=$(ls *.mol2)&lt;br /&gt;
echo $mol2files&lt;br /&gt;
&lt;br /&gt;
# ---------------------- MAIN PROCESSING LOOP ---------------------&lt;br /&gt;
for mol2file in $mol2files; do&lt;br /&gt;
    # Grab ligand-source path (single value expected)&lt;br /&gt;
    # file=$(grep -m1 &amp;quot;Ligand Source File:&amp;quot; &amp;quot;$mol2file&amp;quot; | awk &#039;{print $5}&#039;)&lt;br /&gt;
    ligand_id=$(grep &amp;quot;##########                 Name:&amp;quot; &amp;quot;$mol2file&amp;quot; | awk &#039;{print $3}&#039;)&lt;br /&gt;
    ligand_charge=$(grep &amp;quot;##########        Ligand Charge:&amp;quot; &amp;quot;$mol2file&amp;quot; | awk &#039;{print $4}&#039;)&lt;br /&gt;
    echo &amp;quot;Processing ligand: $ligand_id (charge: $ligand_charge, source: $mol2file)&amp;quot;&lt;br /&gt;
    found_file=false&lt;br /&gt;
    for file in &amp;quot;$db2_dir&amp;quot;/*&amp;quot;$ligand_id&amp;quot;*.db2; do&lt;br /&gt;
        echo &amp;quot;Checking file: $file&amp;quot;&lt;br /&gt;
        this_charge=$(head -n 2 &amp;quot;$file&amp;quot; | tail -n 1 | awk &#039;{print $2}&#039;)&lt;br /&gt;
        echo $ligand_id $this_charge $ligand_charge&lt;br /&gt;
        match=$(python3 -c &amp;quot;import sys; print(&amp;quot;1&amp;quot;) if float(&#039;$ligand_charge&#039;) == float(&#039;$this_charge&#039;) else sprint(&amp;quot;2&amp;quot;)&amp;quot;)&lt;br /&gt;
        if [[ &amp;quot;$match&amp;quot; -eq &amp;quot;1&amp;quot; ]]; then&lt;br /&gt;
            echo &amp;quot;Found source file: $file (charge match: $ligand_charge)&amp;quot;&lt;br /&gt;
            found_file=true&lt;br /&gt;
            break&lt;br /&gt;
        fi&lt;br /&gt;
    done&lt;br /&gt;
    if [[ $found_file == false ]]; then&lt;br /&gt;
        echo &amp;quot;No matching source file found for ligand: $ligand_id (charge: $ligand_charge)&amp;quot;&lt;br /&gt;
        continue&lt;br /&gt;
    fi&lt;br /&gt;
    name=&amp;quot;${mol2file%.*}&amp;quot;          # basename without .mol2&lt;br /&gt;
&lt;br /&gt;
    echo &amp;quot;Processing $mol2file  (source ⇒ $file)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # Build solvation table&lt;br /&gt;
    cat &amp;quot;$file&amp;quot; | grep &amp;quot;^A&amp;quot; \&lt;br /&gt;
        | awk &#039;{printf&amp;quot;%f %f %f %f %f\n&amp;quot;,0.0,$8,0.0,$9,$10}&#039; \&lt;br /&gt;
        &amp;gt; &amp;quot;${name}.solv&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    printf &#039;%s\n&#039; &amp;quot;$name&amp;quot; &amp;gt; molname.txt   # not used later but kept&lt;br /&gt;
&lt;br /&gt;
    # Append TRIPOS solvation section&lt;br /&gt;
    {&lt;br /&gt;
        printf &#039;@&amp;lt;TRIPOS&amp;gt;SOLVATION\n&#039;&lt;br /&gt;
        printf &#039;LIG header\n&#039;&lt;br /&gt;
        cat &amp;quot;${name}.solv&amp;quot;&lt;br /&gt;
    } &amp;gt;&amp;gt; &amp;quot;${name}.mol2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # ------------------- Generate dock.in on-the-fly --------------&lt;br /&gt;
    cat &amp;gt; dock.in &amp;lt;&amp;lt;EOF&lt;br /&gt;
conformer_search_type                                        rigid&lt;br /&gt;
use_internal_energy                                          no&lt;br /&gt;
ligand_atom_file                                             ${name}.mol2&lt;br /&gt;
limit_max_ligands                                            no&lt;br /&gt;
skip_molecule                                                no&lt;br /&gt;
read_mol_solvation                                           yes&lt;br /&gt;
calculate_rmsd                                               no&lt;br /&gt;
use_database_filter                                          no&lt;br /&gt;
orient_ligand                                                no&lt;br /&gt;
bump_filter                                                  no&lt;br /&gt;
score_molecules                                              yes&lt;br /&gt;
contact_score_primary                                        no&lt;br /&gt;
grid_score_primary                                           no&lt;br /&gt;
gist_score_primary                                           no&lt;br /&gt;
multigrid_score_primary                                      no&lt;br /&gt;
dock3.5_score_primary                                        yes&lt;br /&gt;
dock3.5_vdw_score                                            yes&lt;br /&gt;
dock3.5_grd_prefix                                           dockfiles/chem52&lt;br /&gt;
dock3.5_electrostatic_score                                  yes&lt;br /&gt;
dock3.5_ligand_desolvation_score                             volume&lt;br /&gt;
dock3.5_solvent_occlusion_file                               dockfiles/ligand.desolv.heavy&lt;br /&gt;
dock3.5_redistribute_positive_desolvation                    no&lt;br /&gt;
dock3.5_hydrogen_desolvation_grid                            yes&lt;br /&gt;
dock3.5_hydrogen_solvent_occlusion_file                      dockfiles/ligand.desolv.hydrogen&lt;br /&gt;
dock3.5_receptor_desolvation_score                           no&lt;br /&gt;
dock3.5_write_atomic_energy_contrib                          no&lt;br /&gt;
dock3.5_score_vdw_scale                                      1&lt;br /&gt;
dock3.5_score_es_scale                                       1&lt;br /&gt;
minimize_ligand                                              no&lt;br /&gt;
atom_model                                                   all&lt;br /&gt;
vdw_defn_file                                                ${vdw_defn}&lt;br /&gt;
flex_defn_file                                               ${flex_defn}&lt;br /&gt;
flex_drive_file                                              ${flex_tbl}&lt;br /&gt;
ligand_outfile_prefix                                        ${name}_output&lt;br /&gt;
write_orientations                                           no&lt;br /&gt;
num_scored_conformers                                        1&lt;br /&gt;
rank_ligands                                                 no&lt;br /&gt;
EOF&lt;br /&gt;
    # --------------------- Run DOCK and harvest -------------------&lt;br /&gt;
    &amp;quot;$dock6_bin&amp;quot; -i dock.in -o dock.out&lt;br /&gt;
&lt;br /&gt;
    # Pull chemgrid and energy terms into running table&lt;br /&gt;
    echo &amp;quot;$(grep Chemgrid_Score &amp;quot;${name}_output_scored.mol2&amp;quot;) \&lt;br /&gt;
$(grep &#039;Total Energy:&#039; &amp;quot;${name}.mol2&amp;quot;)&amp;quot; \&lt;br /&gt;
        | awk &#039;{print $3, $7}&#039; &amp;gt;&amp;gt; total_energy.txt&lt;br /&gt;
done&lt;br /&gt;
# ------------------------------------------------------------------&lt;br /&gt;
echo &amp;quot;All done — summary energies written to total_energy.txt&amp;quot;(base)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Running_DOCK6_with_ChemGrid_Score_and_db2_files&amp;diff=16875</id>
		<title>Running DOCK6 with ChemGrid Score and db2 files</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Running_DOCK6_with_ChemGrid_Score_and_db2_files&amp;diff=16875"/>
		<updated>2025-09-09T19:35:35Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Installation ==&lt;br /&gt;
Obtain DOCK 6 from [https://github.com/docking-org/dock6 the official GitHub repository]. See also the DOCK 6 manual: [https://dock.compbio.ucsf.edu/DOCK_6/dock6_manual.htm#Installation Installation]. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# on epyc-A40&lt;br /&gt;
cd dock6/install&lt;br /&gt;
./configure gnu&lt;br /&gt;
make all&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Large-scale docking (LSD) ==&lt;br /&gt;
The most recent copy on Wynton is in &amp;lt;code&amp;gt;/wynton/group/bks/work/ak87/UCSF/SCRIPTS/DOCK6/2025-08-Trents_fix/dock6/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Converting DOCK 3 grids to DOCK 6 ===&lt;br /&gt;
See the [[#Convert Grids|Scripts/Convert_Grids]] section below. This has been tested on Gimel and should also work on Wynton. The preferred workflow starts from both &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;working&amp;lt;/code&amp;gt; directories produced by DOCK 3 &amp;lt;code&amp;gt;blastermaster&amp;lt;/code&amp;gt;. When that is not available, the script requires the DOCK 3 &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; only. DOCK 3 and DOCK 6 installations are needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh convert_dock3_grids_dockfiles.sh &amp;lt;path_to_dock3_grids_dockfiles&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Converted grids reproduce the same scores when rescoring DOCK 3 poses. For Mac1, however, top scores during large-scale docking were in the thousands, likely because some ligands extended beyond the grid box.&lt;br /&gt;
&lt;br /&gt;
=== Running LSD ===&lt;br /&gt;
Running LSD with DOCK 6 is analogous to DOCK 3:&lt;br /&gt;
* Prepare grids in &amp;lt;code&amp;gt;dock6files&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Obtain SubDock from [https://github.com/docking-org/SUBDOCK6/tree/main the SUBDOCK6 repository].&lt;br /&gt;
* Prepare lists of ligand &amp;lt;code&amp;gt;.tgz&amp;lt;/code&amp;gt; files in an &amp;lt;code&amp;gt;sdi&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
* Create &amp;lt;code&amp;gt;run_subdock6.sh&amp;lt;/code&amp;gt; in the working directory and run it (see [[#Submit LSD|Scripts/Submit_LSD]] below). The script targets Wynton but should work on clusters using SGE or SLURM. You can re-run it to retry unfinished jobs.&lt;br /&gt;
&lt;br /&gt;
=== Processing LSD ===&lt;br /&gt;
Run the parsing script (see [[#Process LSD|Scripts/Process_LSD]] below). It writes a CSV of scores (similar to &amp;lt;code&amp;gt;extract_all.sort.uniq.txt&amp;lt;/code&amp;gt;) and a second CSV with per-subdirectory runtimes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python parse_dock_logs.py --root /path/to/search \&lt;br /&gt;
  --ligand_csv /path/to/out/ligand_scores.csv \&lt;br /&gt;
  --stat_csv /path/to/out/stat_summary.csv&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To do:&#039;&#039;&#039; extract poses.&lt;br /&gt;
&lt;br /&gt;
== Rescoring DOCK 3 poses ==&lt;br /&gt;
See [[#Rescoring|Scripts/Rescoring]]. Edit the script to specify:&lt;br /&gt;
* The &amp;lt;code&amp;gt;mol2.gz&amp;lt;/code&amp;gt; file with poses to rescore.&lt;br /&gt;
* A directory with &amp;lt;code&amp;gt;db2&amp;lt;/code&amp;gt; files (DOCK 6 reads solvation data from these).&lt;br /&gt;
* DOCK 6 grids (&amp;lt;code&amp;gt;dock6files&amp;lt;/code&amp;gt;).&lt;br /&gt;
* Parameter files from the DOCK 6 installation.&lt;br /&gt;
* The helper &amp;lt;code&amp;gt;lc_blazing_fast_separate_mol2_into_smaller_files.py&amp;lt;/code&amp;gt; is used to split large MOL2 files for speed.&lt;br /&gt;
&lt;br /&gt;
== Scripts ==&lt;br /&gt;
=== Convert grids ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# convert_dock3_grids_dockfiles.sh&lt;br /&gt;
# Convert DOCK3 grids to DOCK6 dockfiles&lt;br /&gt;
# Author Trent Balius (converted to bash)&lt;br /&gt;
&lt;br /&gt;
set -e&lt;br /&gt;
echo &amp;quot;sh convert_dock3_grids_dockfiles.sh &amp;lt;path_to_dock3_grids_dockfiles&amp;gt;&amp;quot;&lt;br /&gt;
workdir=&amp;quot;$(pwd)&amp;quot;&lt;br /&gt;
cd &amp;quot;$workdir&amp;quot; || exit&lt;br /&gt;
# system=&amp;quot;$(basename &amp;quot;$workdir&amp;quot;)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#filedir=&amp;quot;/is2/projects/RAS-CompChem/static/work/DUDEZ/dudez_dockprep/${system}_dock6prep/blastermaster/dockfiles&amp;quot;&lt;br /&gt;
if [ -z &amp;quot;$1&amp;quot; ]; then&lt;br /&gt;
	echo &amp;quot;Usage: sh convert_dock3_grids_dockfiles.sh &amp;lt;path_to_dock3_grids_dockfiles&amp;gt;&amp;quot;&lt;br /&gt;
	exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
filedir=$1&lt;br /&gt;
# Directory where the converted DOCK6 dockfiles will be stored&lt;br /&gt;
dock6files_dir=&amp;quot;${workdir}/dock6files&amp;quot;&lt;br /&gt;
&lt;br /&gt;
mkdir -p &amp;quot;$dock6files_dir&amp;quot;&lt;br /&gt;
cd &amp;quot;$dock6files_dir&amp;quot; || exit&lt;br /&gt;
&lt;br /&gt;
cp &amp;quot;$filedir&amp;quot;/vdw.* .&lt;br /&gt;
#cp &amp;quot;$filedir/box&amp;quot; .&lt;br /&gt;
#cp &amp;quot;$filedir/qnifft.electrostatics.phi&amp;quot; .&lt;br /&gt;
cp &amp;quot;$filedir/trim.electrostatics.phi&amp;quot; .&lt;br /&gt;
cp &amp;quot;$filedir/matching_spheres.sph&amp;quot; .&lt;br /&gt;
cp &amp;quot;$filedir&amp;quot;/ligand.desolv.* .&lt;br /&gt;
cp &amp;quot;$filedir/INDOCK&amp;quot; .&lt;br /&gt;
cp &amp;quot;$filedir/rec.crg.pdb&amp;quot; rec.pdb&lt;br /&gt;
&lt;br /&gt;
perl /nfs/soft/dock/versions/dock37/DOCK-3.7-trunk/proteins/makebox/makebox.smallokay.pl matching_spheres.sph rec.pdb box 10.0&lt;br /&gt;
&lt;br /&gt;
# Creating standalone grids, so no links to the original files&lt;br /&gt;
# ln -sf vdw.bmp chem.bmp&lt;br /&gt;
# ln -sf vdw.vdw chem.vdw&lt;br /&gt;
# #ln -sf vdw.esp chem.esp&lt;br /&gt;
# ln -sf vdw.vdw chem.esp&lt;br /&gt;
# #ln -sf qnifft.electrostatics.phi rec+sph.phi&lt;br /&gt;
# #ln -sf trim.electrostatics.phi rec+sph.phi&lt;br /&gt;
# ln -sf trim.electrostatics.phi chem.phi&lt;br /&gt;
&lt;br /&gt;
cp -v vdw.bmp chem.bmp&lt;br /&gt;
cp -v  vdw.vdw chem.vdw&lt;br /&gt;
cp -v  vdw.vdw chem.esp&lt;br /&gt;
cp -v trim.electrostatics.phi chem.phi&lt;br /&gt;
&lt;br /&gt;
dsize=$(grep delphi_nsize INDOCK | awk &#039;{print $2}&#039;)&lt;br /&gt;
if [ -z &amp;quot;$dsize&amp;quot; ]; then&lt;br /&gt;
	echo &amp;quot;Error: delphi_nsize not found in INDOCK. Please check the INDOCK file.&amp;quot;&lt;br /&gt;
	exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; gconv.in&lt;br /&gt;
compute_grids                  yes&lt;br /&gt;
DOCK3_7_grids                  yes&lt;br /&gt;
QNIFFT_grid                    yes&lt;br /&gt;
grid_spacing                   0.2&lt;br /&gt;
phi_grid_size                  $dsize&lt;br /&gt;
output_molecule                no&lt;br /&gt;
contact_score                  no&lt;br /&gt;
contact_cutoff_distance        4.5&lt;br /&gt;
chemical_score                 yes&lt;br /&gt;
energy_score                   yes&lt;br /&gt;
energy_cutoff_distance         10&lt;br /&gt;
atom_model                     u&lt;br /&gt;
attractive_exponent            6&lt;br /&gt;
repulsive_exponent             12&lt;br /&gt;
distance_dielectric            yes&lt;br /&gt;
dielectric_factor              4&lt;br /&gt;
bump_filter                    yes&lt;br /&gt;
bump_overlap                   0.5&lt;br /&gt;
receptor_file                  rec.crg&lt;br /&gt;
box_file                       box&lt;br /&gt;
vdw_definition_file            /nfs/home/ak87/PROGRAM/DOCK6-NEBIUS/dock6-gritukan_merged/parameters/vdw_AMBER_parm94.defn&lt;br /&gt;
chemical_definition_file       /nfs/home/ak87/PROGRAM/DOCK6-NEBIUS/dock6-gritukan_merged/parameters/chemgrid/conv.defn&lt;br /&gt;
score_grid_prefix              chem&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
/nfs/home/ak87/PROGRAM/DOCK6-NEBIUS/dock6-gritukan_merged/bin/grid-convert -i gconv.in &amp;gt; gconv.log&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Submit LSD ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
export EXPORT_DEST=$PWD/output&lt;br /&gt;
export DOCKFILES=$PWD/dock6files&lt;br /&gt;
export DOCKEXEC=/wynton/group/bks/work/ak87/UCSF/SCRIPTS/DOCK6/2025-08-Trents_fix/dock6/bin/dock6&lt;br /&gt;
export SHRTCACHE=/dev/shm&lt;br /&gt;
export LONGCACHE=/tmp&lt;br /&gt;
export SHRTCACHE_USE_ENV=&lt;br /&gt;
export USE_DB2_TGZ=true&lt;br /&gt;
export USE_DB2_TGZ_BATCH_SIZE=1&lt;br /&gt;
export USE_DB2=false&lt;br /&gt;
export USE_DB2_BATCH_SIZE=100&lt;br /&gt;
export USE_SLURM=False&lt;br /&gt;
export USE_SLURM_ARGS=--export=ALL&lt;br /&gt;
export USE_SGE=True&lt;br /&gt;
export USE_SGE_ARGS=&amp;quot;-l s_rt=08:28:00 -l h_rt=08:30:00 -l mem_free=2G&amp;quot;&lt;br /&gt;
export USE_PARALLEL=false&lt;br /&gt;
export MAX_PARALLEL=-1&lt;br /&gt;
export QSUB_EXEC=qsub&lt;br /&gt;
export SBATCH_EXEC=sbatch&lt;br /&gt;
export PARALLEL_EXEC=parallel&lt;br /&gt;
export SUBMIT_WAIT_TIME=0&lt;br /&gt;
&lt;br /&gt;
for i in  sdi/* ; do&lt;br /&gt;
       	export k=$(basename $i .in)&lt;br /&gt;
       	echo k $k&lt;br /&gt;
       	export INPUT_SOURCE=$PWD/$i&lt;br /&gt;
       	export EXPORT_DEST=$PWD/output/$k&lt;br /&gt;
       	bash &amp;lt;/path/to/subdock6.bash&amp;gt;&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Process LSD ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env python3&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
parse_dock_logs.py&lt;br /&gt;
&lt;br /&gt;
Recursively parse DOCK &#039;dock.out*&#039; files:&lt;br /&gt;
  • Extract all LIGAND score components; keep the record with the lowest&lt;br /&gt;
    Chemgrid_Score per molecule.&lt;br /&gt;
  • Extract STAT summary for each file.&lt;br /&gt;
  • Save two CSV files: ligand_scores and stat_summary.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
    python parse_dock_logs.py \&lt;br /&gt;
        --root /path/to/search \&lt;br /&gt;
        --ligand_csv /path/to/out/ligand_scores.csv \&lt;br /&gt;
        --stat_csv /path/to/out/stat_summary.csv&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
import argparse&lt;br /&gt;
import re&lt;br /&gt;
from pathlib import Path&lt;br /&gt;
import pandas as pd&lt;br /&gt;
&lt;br /&gt;
# ──────────────────────────────────────────────────────────────────────────────&lt;br /&gt;
# Regex patterns for parsing DOCK output files&lt;br /&gt;
LIGAND_START_RE = re.compile(r&amp;quot;^-+$&amp;quot;)  # Lines with only dashes&lt;br /&gt;
MOLECULE_RE = re.compile(r&amp;quot;^\s*Molecule:\s*(\S+)&amp;quot;, re.IGNORECASE)&lt;br /&gt;
LIGAND_KEYVAL_RE = re.compile(&lt;br /&gt;
    r&amp;quot;^\s*([A-Za-z0-9_]+):\s*([-+]?\d*\.?\d+)\s*$&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
STAT_BLOCK_RE = re.compile(r&amp;quot;^(=+.*STAT|.*STAT.*)&amp;quot;, re.IGNORECASE)&lt;br /&gt;
STAT_MOLS_RE = re.compile(r&amp;quot;^\s*(\d+)\s+Molecules Processed&amp;quot;, re.IGNORECASE)&lt;br /&gt;
STAT_TIME_RE = re.compile(r&amp;quot;^Total elapsed time:\s+([\d.]+) seconds&amp;quot;, re.IGNORECASE)&lt;br /&gt;
ELAPSED_LINE_RE = re.compile(r&amp;quot;Total elapsed time:&amp;quot;, re.IGNORECASE)&lt;br /&gt;
&lt;br /&gt;
# ──────────────────────────────────────────────────────────────────────────────&lt;br /&gt;
def file_finished(lines, tail=50) -&amp;gt; bool:&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Return True if &#039;Total elapsed time&#039; appears in the last `tail` lines.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    return any(ELAPSED_LINE_RE.search(l) for l in lines[-tail:])&lt;br /&gt;
&lt;br /&gt;
# ──────────────────────────────────────────────────────────────────────────────&lt;br /&gt;
def parse_ligands(lines, subdir, filename):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Yield dictionaries with ligand scores.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    i = 0&lt;br /&gt;
    record_count = 0&lt;br /&gt;
    while i &amp;lt; len(lines):&lt;br /&gt;
        # Look for lines with dashes (separator before ligand record)&lt;br /&gt;
        if LIGAND_START_RE.match(lines[i]):&lt;br /&gt;
            # Skip ahead to find Molecule: line&lt;br /&gt;
            j = i + 1&lt;br /&gt;
            while j &amp;lt; len(lines) and not MOLECULE_RE.search(lines[j]):&lt;br /&gt;
                j += 1&lt;br /&gt;
            &lt;br /&gt;
            if j &amp;gt;= len(lines):&lt;br /&gt;
                i += 1&lt;br /&gt;
                continue&lt;br /&gt;
                &lt;br /&gt;
            # Found a molecule line, start parsing&lt;br /&gt;
            molecule_match = MOLECULE_RE.search(lines[j])&lt;br /&gt;
            if not molecule_match:&lt;br /&gt;
                i += 1&lt;br /&gt;
                continue&lt;br /&gt;
                &lt;br /&gt;
            record = {&lt;br /&gt;
                &amp;quot;subdir&amp;quot;: subdir, &lt;br /&gt;
                &amp;quot;file&amp;quot;: filename,&lt;br /&gt;
                &amp;quot;Molecule&amp;quot;: molecule_match.group(1)&lt;br /&gt;
            }&lt;br /&gt;
            &lt;br /&gt;
            # Parse key-value pairs from the rest of the record&lt;br /&gt;
            k = j + 1&lt;br /&gt;
            while k &amp;lt; len(lines):&lt;br /&gt;
                line = lines[k].strip()&lt;br /&gt;
                &lt;br /&gt;
                # Stop if we hit another separator or definitive end markers&lt;br /&gt;
                if (line.startswith(&amp;quot;---&amp;quot;) or &lt;br /&gt;
                    line.startswith(&amp;quot;===&amp;quot;) or &lt;br /&gt;
                    line.startswith(&amp;quot;score &amp;gt;&amp;quot;) or&lt;br /&gt;
                    line.startswith(&amp;quot;Total elapsed time&amp;quot;)):&lt;br /&gt;
                    break&lt;br /&gt;
                &lt;br /&gt;
                # Try to match key-value pairs&lt;br /&gt;
                kv_match = LIGAND_KEYVAL_RE.match(lines[k])&lt;br /&gt;
                if kv_match:&lt;br /&gt;
                    key, val = kv_match.groups()&lt;br /&gt;
                    if val:  # Only add if value is not empty&lt;br /&gt;
                        record[key] = float(val)&lt;br /&gt;
                &lt;br /&gt;
                k += 1&lt;br /&gt;
            &lt;br /&gt;
            # Only yield if we found meaningful data&lt;br /&gt;
            if len(record) &amp;gt; 3:  # Has molecule + metadata + at least one score&lt;br /&gt;
                record_count += 1&lt;br /&gt;
                yield record&lt;br /&gt;
            &lt;br /&gt;
            i = k  # Continue from where we left off&lt;br /&gt;
        else:&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
# ──────────────────────────────────────────────────────────────────────────────&lt;br /&gt;
def parse_stat(lines, subdir, filename):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Return dict with STAT info or None if block not found.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    for idx, line in enumerate(lines):&lt;br /&gt;
        if STAT_BLOCK_RE.match(line):&lt;br /&gt;
            mols = elapsed = None&lt;br /&gt;
            for j in range(idx + 1, len(lines)):&lt;br /&gt;
                if mols is None:&lt;br /&gt;
                    m = STAT_MOLS_RE.match(lines[j])&lt;br /&gt;
                    if m:&lt;br /&gt;
                        mols = int(m.group(1))&lt;br /&gt;
                if elapsed is None:&lt;br /&gt;
                    t = STAT_TIME_RE.match(lines[j])&lt;br /&gt;
                    if t:&lt;br /&gt;
                        elapsed = float(t.group(1))&lt;br /&gt;
                if lines[j].startswith(&amp;quot;=&amp;quot;) and j &amp;gt; idx + 1:&lt;br /&gt;
                    break  # end of STAT block&lt;br /&gt;
            return {&lt;br /&gt;
                &amp;quot;subdir&amp;quot;: subdir,&lt;br /&gt;
                &amp;quot;file&amp;quot;: filename,&lt;br /&gt;
                &amp;quot;molecules_processed&amp;quot;: mols,&lt;br /&gt;
                &amp;quot;elapsed_seconds&amp;quot;: elapsed,&lt;br /&gt;
            }&lt;br /&gt;
    return None&lt;br /&gt;
&lt;br /&gt;
# ──────────────────────────────────────────────────────────────────────────────&lt;br /&gt;
def main():&lt;br /&gt;
    ap = argparse.ArgumentParser(description=&amp;quot;Parse DOCK log files.&amp;quot;)&lt;br /&gt;
    ap.add_argument(&amp;quot;--root&amp;quot;, type=Path, default=Path.cwd(),&lt;br /&gt;
                    help=&amp;quot;Root directory to search (default: CWD)&amp;quot;)&lt;br /&gt;
    ap.add_argument(&amp;quot;--ligand_csv&amp;quot;, type=Path, required=True,&lt;br /&gt;
                    help=&amp;quot;Output CSV for ligand scores&amp;quot;)&lt;br /&gt;
    ap.add_argument(&amp;quot;--stat_csv&amp;quot;, type=Path, required=True,&lt;br /&gt;
                    help=&amp;quot;Output CSV for STAT summaries&amp;quot;)&lt;br /&gt;
    args = ap.parse_args()&lt;br /&gt;
&lt;br /&gt;
    ligand_records = []&lt;br /&gt;
    stat_records = []&lt;br /&gt;
&lt;br /&gt;
    for path in args.root.rglob(&amp;quot;dock.out*&amp;quot;):&lt;br /&gt;
        print(f&amp;quot;Processing {path}&amp;quot;)&lt;br /&gt;
        if not path.is_file():&lt;br /&gt;
            continue&lt;br /&gt;
        lines = path.read_text(errors=&amp;quot;ignore&amp;quot;).splitlines()&lt;br /&gt;
        if not file_finished(lines):&lt;br /&gt;
            print(f&amp;quot;  Skipping: file not finished&amp;quot;)&lt;br /&gt;
            continue  # skip incomplete file&lt;br /&gt;
        &lt;br /&gt;
        subdir = str(path.parent.relative_to(args.root))&lt;br /&gt;
        filename = path.name&lt;br /&gt;
&lt;br /&gt;
        # LIGAND parsing&lt;br /&gt;
        ligand_records_from_file = list(parse_ligands(lines, subdir, filename))&lt;br /&gt;
        ligand_records.extend(ligand_records_from_file)&lt;br /&gt;
        print(f&amp;quot;  Found {len(ligand_records_from_file)} ligand records&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
        # STAT parsing&lt;br /&gt;
        stat = parse_stat(lines, subdir, filename)&lt;br /&gt;
        if stat:&lt;br /&gt;
            stat_records.append(stat)&lt;br /&gt;
&lt;br /&gt;
    if not ligand_records:&lt;br /&gt;
        print(&amp;quot;No completed ligand data found.&amp;quot;)&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    # Ligand DF &amp;amp; best scores&lt;br /&gt;
    df_lig = pd.DataFrame(ligand_records)&lt;br /&gt;
    &lt;br /&gt;
    # Check if Chemgrid_Score exists, if not use alternative column&lt;br /&gt;
    score_column = &amp;quot;Chemgrid_Score&amp;quot;&lt;br /&gt;
    if score_column not in df_lig.columns:&lt;br /&gt;
        # Look for alternative score columns&lt;br /&gt;
        possible_scores = [col for col in df_lig.columns if &amp;quot;score&amp;quot; in col.lower()]&lt;br /&gt;
        if possible_scores:&lt;br /&gt;
            score_column = possible_scores[0]&lt;br /&gt;
            print(f&amp;quot;Using {score_column} instead of Chemgrid_Score&amp;quot;)&lt;br /&gt;
        else:&lt;br /&gt;
            print(&amp;quot;No score column found!&amp;quot;)&lt;br /&gt;
            return&lt;br /&gt;
    &lt;br /&gt;
    best_idx = (&lt;br /&gt;
        df_lig.groupby(&amp;quot;Molecule&amp;quot;)[score_column]&lt;br /&gt;
        .idxmin()&lt;br /&gt;
        .dropna()&lt;br /&gt;
    )&lt;br /&gt;
    df_best = df_lig.loc[best_idx].sort_values(score_column)&lt;br /&gt;
    args.ligand_csv.parent.mkdir(parents=True, exist_ok=True)&lt;br /&gt;
    df_best.to_csv(args.ligand_csv, index=False)&lt;br /&gt;
&lt;br /&gt;
    # STAT DF&lt;br /&gt;
    if stat_records:&lt;br /&gt;
        df_stat = pd.DataFrame(stat_records)&lt;br /&gt;
        args.stat_csv.parent.mkdir(parents=True, exist_ok=True)&lt;br /&gt;
        df_stat.to_csv(args.stat_csv, index=False)&lt;br /&gt;
&lt;br /&gt;
    print(f&amp;quot;Wrote {len(df_best)} molecules to {args.ligand_csv}&amp;quot;)&lt;br /&gt;
    if stat_records:&lt;br /&gt;
        print(f&amp;quot;Wrote {len(df_stat)} STAT rows to {args.stat_csv}&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
    main()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Rescoring ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env bash&lt;br /&gt;
# ------------------------------------------------------------------&lt;br /&gt;
# Rescoring pipeline — Bash port of the original tcsh script&lt;br /&gt;
# ------------------------------------------------------------------&lt;br /&gt;
# IFS=$&#039;\n\t&#039;               # safe word splitting&lt;br /&gt;
&lt;br /&gt;
# ------------------------- CONFIGURATION --------------------------&lt;br /&gt;
system=&amp;quot;AMPC&amp;quot;             # set your system tag here&lt;br /&gt;
# system=&amp;quot;EGFR&amp;quot;            # uncomment to switch target&lt;br /&gt;
&lt;br /&gt;
outdir=&amp;quot;${system}_rescore_v3.8_v6&amp;quot;&lt;br /&gt;
src_gz=&amp;quot;/home/ak87/Desktop/SMALL_PROJ/DOCK6-NEBIUS/2025-06-TEST/TEST-LINKIN/RUN-TRENTs-COMMENTS/DOCK3/1/output/test.mol2.gz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
db2_dir=&amp;quot;/home/ak87/Desktop/SMALL_PROJ/DOCK6-NEBIUS/2025-06-TEST/AMPC-TESTED/&amp;quot;&lt;br /&gt;
dockfiles_link=&amp;quot;/home/ak87/Desktop/SMALL_PROJ/DOCK6-NEBIUS/2025-06-TEST/TMP2/dock6files&amp;quot;&lt;br /&gt;
&lt;br /&gt;
dock6_bin=&amp;quot;/home/ak87/Programs/dock6-gritukan_merged/bin/dock6&amp;quot;&lt;br /&gt;
separate_py=&amp;quot;/home/ak87/Programs/lc_blazing_fast_separate_mol2_into_smaller_files_AK.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
vdw_defn=&amp;quot;/home/ak87/Programs/dock6-gritukan_merged/parameters/vdw_AMBER_parm94.dock3_7.defn&amp;quot;&lt;br /&gt;
flex_defn=&amp;quot;/home/ak87/Programs/dock6-gritukan_merged/parameters/flex.defn&amp;quot;&lt;br /&gt;
flex_tbl=&amp;quot;/home/ak87/Programs/dock6-gritukan_merged/parameters/flex_drive.tbl&amp;quot;&lt;br /&gt;
# ------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
mkdir -p &amp;quot;$outdir&amp;quot;&lt;br /&gt;
cd &amp;quot;$outdir&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Unzip test.mol2 once&lt;br /&gt;
zcat &amp;quot;$src_gz&amp;quot; &amp;gt; test.mol2&lt;br /&gt;
&lt;br /&gt;
# Link dockfiles directory (overwrite stale link if present)&lt;br /&gt;
ln -sfn &amp;quot;$dockfiles_link&amp;quot; dockfiles&lt;br /&gt;
&lt;br /&gt;
# Fresh output accumulator&lt;br /&gt;
rm -f total_energy.txt&lt;br /&gt;
&lt;br /&gt;
# Split the multi-mol2 file into chunks named split001.mol2 …&lt;br /&gt;
python &amp;quot;$separate_py&amp;quot; test.mol2 split 1&lt;br /&gt;
rm test.mol2&lt;br /&gt;
mol2files=$(ls *.mol2)&lt;br /&gt;
echo $mol2files&lt;br /&gt;
&lt;br /&gt;
# ---------------------- MAIN PROCESSING LOOP ---------------------&lt;br /&gt;
for mol2file in $mol2files; do&lt;br /&gt;
    # Grab ligand-source path (single value expected)&lt;br /&gt;
    # file=$(grep -m1 &amp;quot;Ligand Source File:&amp;quot; &amp;quot;$mol2file&amp;quot; | awk &#039;{print $5}&#039;)&lt;br /&gt;
    ligand_id=$(grep &amp;quot;##########                 Name:&amp;quot; &amp;quot;$mol2file&amp;quot; | awk &#039;{print $3}&#039;)&lt;br /&gt;
    ligand_charge=$(grep &amp;quot;##########        Ligand Charge:&amp;quot; &amp;quot;$mol2file&amp;quot; | awk &#039;{print $4}&#039;)&lt;br /&gt;
    echo &amp;quot;Processing ligand: $ligand_id (charge: $ligand_charge, source: $mol2file)&amp;quot;&lt;br /&gt;
    found_file=false&lt;br /&gt;
    for file in &amp;quot;$db2_dir&amp;quot;/*&amp;quot;$ligand_id&amp;quot;*.db2; do&lt;br /&gt;
        echo &amp;quot;Checking file: $file&amp;quot;&lt;br /&gt;
        this_charge=$(head -n 2 &amp;quot;$file&amp;quot; | tail -n 1 | awk &#039;{print $2}&#039;)&lt;br /&gt;
        echo $ligand_id $this_charge $ligand_charge&lt;br /&gt;
        match=$(python3 -c &amp;quot;import sys; print(&amp;quot;1&amp;quot;) if float(&#039;$ligand_charge&#039;) == float(&#039;$this_charge&#039;) else sprint(&amp;quot;2&amp;quot;)&amp;quot;)&lt;br /&gt;
        if [[ &amp;quot;$match&amp;quot; -eq &amp;quot;1&amp;quot; ]]; then&lt;br /&gt;
            echo &amp;quot;Found source file: $file (charge match: $ligand_charge)&amp;quot;&lt;br /&gt;
            found_file=true&lt;br /&gt;
            break&lt;br /&gt;
        fi&lt;br /&gt;
    done&lt;br /&gt;
    if [[ $found_file == false ]]; then&lt;br /&gt;
        echo &amp;quot;No matching source file found for ligand: $ligand_id (charge: $ligand_charge)&amp;quot;&lt;br /&gt;
        continue&lt;br /&gt;
    fi&lt;br /&gt;
    name=&amp;quot;${mol2file%.*}&amp;quot;          # basename without .mol2&lt;br /&gt;
&lt;br /&gt;
    echo &amp;quot;Processing $mol2file  (source ⇒ $file)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # Build solvation table&lt;br /&gt;
    cat &amp;quot;$file&amp;quot; | grep &amp;quot;^A&amp;quot; \&lt;br /&gt;
        | awk &#039;{printf&amp;quot;%f %f %f %f %f\n&amp;quot;,0.0,$8,0.0,$9,$10}&#039; \&lt;br /&gt;
        &amp;gt; &amp;quot;${name}.solv&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    printf &#039;%s\n&#039; &amp;quot;$name&amp;quot; &amp;gt; molname.txt   # not used later but kept&lt;br /&gt;
&lt;br /&gt;
    # Append TRIPOS solvation section&lt;br /&gt;
    {&lt;br /&gt;
        printf &#039;@&amp;lt;TRIPOS&amp;gt;SOLVATION\n&#039;&lt;br /&gt;
        printf &#039;LIG header\n&#039;&lt;br /&gt;
        cat &amp;quot;${name}.solv&amp;quot;&lt;br /&gt;
    } &amp;gt;&amp;gt; &amp;quot;${name}.mol2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # ------------------- Generate dock.in on-the-fly --------------&lt;br /&gt;
    cat &amp;gt; dock.in &amp;lt;&amp;lt;EOF&lt;br /&gt;
conformer_search_type                                        rigid&lt;br /&gt;
use_internal_energy                                          no&lt;br /&gt;
ligand_atom_file                                             ${name}.mol2&lt;br /&gt;
limit_max_ligands                                            no&lt;br /&gt;
skip_molecule                                                no&lt;br /&gt;
read_mol_solvation                                           yes&lt;br /&gt;
calculate_rmsd                                               no&lt;br /&gt;
use_database_filter                                          no&lt;br /&gt;
orient_ligand                                                no&lt;br /&gt;
bump_filter                                                  no&lt;br /&gt;
score_molecules                                              yes&lt;br /&gt;
contact_score_primary                                        no&lt;br /&gt;
grid_score_primary                                           no&lt;br /&gt;
gist_score_primary                                           no&lt;br /&gt;
multigrid_score_primary                                      no&lt;br /&gt;
dock3.5_score_primary                                        yes&lt;br /&gt;
dock3.5_vdw_score                                            yes&lt;br /&gt;
dock3.5_grd_prefix                                           dockfiles/chem52&lt;br /&gt;
dock3.5_electrostatic_score                                  yes&lt;br /&gt;
dock3.5_ligand_desolvation_score                             volume&lt;br /&gt;
dock3.5_solvent_occlusion_file                               dockfiles/ligand.desolv.heavy&lt;br /&gt;
dock3.5_redistribute_positive_desolvation                    no&lt;br /&gt;
dock3.5_hydrogen_desolvation_grid                            yes&lt;br /&gt;
dock3.5_hydrogen_solvent_occlusion_file                      dockfiles/ligand.desolv.hydrogen&lt;br /&gt;
dock3.5_receptor_desolvation_score                           no&lt;br /&gt;
dock3.5_write_atomic_energy_contrib                          no&lt;br /&gt;
dock3.5_score_vdw_scale                                      1&lt;br /&gt;
dock3.5_score_es_scale                                       1&lt;br /&gt;
minimize_ligand                                              no&lt;br /&gt;
atom_model                                                   all&lt;br /&gt;
vdw_defn_file                                                ${vdw_defn}&lt;br /&gt;
flex_defn_file                                               ${flex_defn}&lt;br /&gt;
flex_drive_file                                              ${flex_tbl}&lt;br /&gt;
ligand_outfile_prefix                                        ${name}_output&lt;br /&gt;
write_orientations                                           no&lt;br /&gt;
num_scored_conformers                                        1&lt;br /&gt;
rank_ligands                                                 no&lt;br /&gt;
EOF&lt;br /&gt;
    # --------------------- Run DOCK and harvest -------------------&lt;br /&gt;
    &amp;quot;$dock6_bin&amp;quot; -i dock.in -o dock.out&lt;br /&gt;
&lt;br /&gt;
    # Pull chemgrid and energy terms into running table&lt;br /&gt;
    echo &amp;quot;$(grep Chemgrid_Score &amp;quot;${name}_output_scored.mol2&amp;quot;) \&lt;br /&gt;
$(grep &#039;Total Energy:&#039; &amp;quot;${name}.mol2&amp;quot;)&amp;quot; \&lt;br /&gt;
        | awk &#039;{print $3, $7}&#039; &amp;gt;&amp;gt; total_energy.txt&lt;br /&gt;
done&lt;br /&gt;
# ------------------------------------------------------------------&lt;br /&gt;
echo &amp;quot;All done — summary energies written to total_energy.txt&amp;quot;(base)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Running_DOCK6_with_ChemGrid_Score_and_db2_files&amp;diff=16874</id>
		<title>Running DOCK6 with ChemGrid Score and db2 files</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Running_DOCK6_with_ChemGrid_Score_and_db2_files&amp;diff=16874"/>
		<updated>2025-09-09T18:39:25Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Installation ==&lt;br /&gt;
Obtain DOCK 6 from [https://github.com/docking-org/dock6 the official GitHub repository]. See also the DOCK 6 manual: [https://dock.compbio.ucsf.edu/DOCK_6/dock6_manual.htm#Installation Installation]. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# on epyc-A40&lt;br /&gt;
cd dock6/install&lt;br /&gt;
./configure gnu&lt;br /&gt;
make all&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Large-scale docking (LSD) ==&lt;br /&gt;
The most recent copy on Wynton is in &amp;lt;code&amp;gt;/wynton/group/bks/work/ak87/UCSF/SCRIPTS/DOCK6/2025-08-Trents_fix/dock6/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Converting DOCK 3 grids to DOCK 6 ===&lt;br /&gt;
See the [[#Convert Grids|Scripts/Convert Grids]] section below. This has been tested on Gimel and should also work on Wynton. The preferred workflow starts from both &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;working&amp;lt;/code&amp;gt; directories produced by DOCK 3 &amp;lt;code&amp;gt;blastermaster&amp;lt;/code&amp;gt;. When that is not available, the script requires the DOCK 3 &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; only. DOCK 3 and DOCK 6 installations are needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh convert_dock3_grids_dockfiles.sh &amp;lt;path_to_dock3_grids_dockfiles&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Converted grids reproduce the same scores when rescoring DOCK 3 poses. For Mac1, however, top scores during large-scale docking were in the thousands, likely because some ligands extended beyond the grid box.&lt;br /&gt;
&lt;br /&gt;
=== Running LSD ===&lt;br /&gt;
Running LSD with DOCK 6 is analogous to DOCK 3:&lt;br /&gt;
* Prepare grids in &amp;lt;code&amp;gt;dock6files&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Obtain SubDock from [https://github.com/docking-org/SUBDOCK6/tree/main the SUBDOCK6 repository].&lt;br /&gt;
* Prepare lists of ligand &amp;lt;code&amp;gt;.tgz&amp;lt;/code&amp;gt; files in an &amp;lt;code&amp;gt;sdi&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
* Create &amp;lt;code&amp;gt;run_subdock6.sh&amp;lt;/code&amp;gt; in the working directory and run it (see [[#Submit LSD|Scripts/Submit LSD]] below). The script targets Wynton but should work on clusters using SGE or SLURM. You can re-run it to retry unfinished jobs.&lt;br /&gt;
&lt;br /&gt;
=== Processing LSD ===&lt;br /&gt;
Run the parsing script (see [[#Process LSD|Scripts/Process LSD]] below). It writes a CSV of scores (similar to &amp;lt;code&amp;gt;extract_all.sort.uniq.txt&amp;lt;/code&amp;gt;) and a second CSV with per-subdirectory runtimes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python parse_dock_logs.py --root /path/to/search \&lt;br /&gt;
  --ligand_csv /path/to/out/ligand_scores.csv \&lt;br /&gt;
  --stat_csv /path/to/out/stat_summary.csv&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To do:&#039;&#039;&#039; extract poses.&lt;br /&gt;
&lt;br /&gt;
== Rescoring DOCK 3 poses ==&lt;br /&gt;
See [[#Rescoring|Scripts/Rescoring]]. Edit the script to specify:&lt;br /&gt;
* The &amp;lt;code&amp;gt;mol2.gz&amp;lt;/code&amp;gt; file with poses to rescore.&lt;br /&gt;
* A directory with &amp;lt;code&amp;gt;db2&amp;lt;/code&amp;gt; files (DOCK 6 reads solvation data from these).&lt;br /&gt;
* DOCK 6 grids (&amp;lt;code&amp;gt;dock6files&amp;lt;/code&amp;gt;).&lt;br /&gt;
* Parameter files from the DOCK 6 installation.&lt;br /&gt;
* The helper &amp;lt;code&amp;gt;lc_blazing_fast_separate_mol2_into_smaller_files.py&amp;lt;/code&amp;gt; is used to split large MOL2 files for speed.&lt;br /&gt;
&lt;br /&gt;
== Scripts ==&lt;br /&gt;
=== Convert grids ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# convert_dock3_grids_dockfiles.sh&lt;br /&gt;
# Convert DOCK3 grids to DOCK6 dockfiles&lt;br /&gt;
# Author Trent Balius (converted to bash)&lt;br /&gt;
&lt;br /&gt;
set -e&lt;br /&gt;
echo &amp;quot;sh convert_dock3_grids_dockfiles.sh &amp;lt;path_to_dock3_grids_dockfiles&amp;gt;&amp;quot;&lt;br /&gt;
workdir=&amp;quot;$(pwd)&amp;quot;&lt;br /&gt;
cd &amp;quot;$workdir&amp;quot; || exit&lt;br /&gt;
# system=&amp;quot;$(basename &amp;quot;$workdir&amp;quot;)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#filedir=&amp;quot;/is2/projects/RAS-CompChem/static/work/DUDEZ/dudez_dockprep/${system}_dock6prep/blastermaster/dockfiles&amp;quot;&lt;br /&gt;
if [ -z &amp;quot;$1&amp;quot; ]; then&lt;br /&gt;
	echo &amp;quot;Usage: sh convert_dock3_grids_dockfiles.sh &amp;lt;path_to_dock3_grids_dockfiles&amp;gt;&amp;quot;&lt;br /&gt;
	exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
filedir=$1&lt;br /&gt;
# Directory where the converted DOCK6 dockfiles will be stored&lt;br /&gt;
dock6files_dir=&amp;quot;${workdir}/dock6files&amp;quot;&lt;br /&gt;
&lt;br /&gt;
mkdir -p &amp;quot;$dock6files_dir&amp;quot;&lt;br /&gt;
cd &amp;quot;$dock6files_dir&amp;quot; || exit&lt;br /&gt;
&lt;br /&gt;
cp &amp;quot;$filedir&amp;quot;/vdw.* .&lt;br /&gt;
#cp &amp;quot;$filedir/box&amp;quot; .&lt;br /&gt;
#cp &amp;quot;$filedir/qnifft.electrostatics.phi&amp;quot; .&lt;br /&gt;
cp &amp;quot;$filedir/trim.electrostatics.phi&amp;quot; .&lt;br /&gt;
cp &amp;quot;$filedir/matching_spheres.sph&amp;quot; .&lt;br /&gt;
cp &amp;quot;$filedir&amp;quot;/ligand.desolv.* .&lt;br /&gt;
cp &amp;quot;$filedir/INDOCK&amp;quot; .&lt;br /&gt;
cp &amp;quot;$filedir/rec.crg.pdb&amp;quot; rec.pdb&lt;br /&gt;
&lt;br /&gt;
perl /nfs/soft/dock/versions/dock37/DOCK-3.7-trunk/proteins/makebox/makebox.smallokay.pl matching_spheres.sph rec.pdb box 10.0&lt;br /&gt;
&lt;br /&gt;
# Creating standalone grids, so no links to the original files&lt;br /&gt;
# ln -sf vdw.bmp chem.bmp&lt;br /&gt;
# ln -sf vdw.vdw chem.vdw&lt;br /&gt;
# #ln -sf vdw.esp chem.esp&lt;br /&gt;
# ln -sf vdw.vdw chem.esp&lt;br /&gt;
# #ln -sf qnifft.electrostatics.phi rec+sph.phi&lt;br /&gt;
# #ln -sf trim.electrostatics.phi rec+sph.phi&lt;br /&gt;
# ln -sf trim.electrostatics.phi chem.phi&lt;br /&gt;
&lt;br /&gt;
cp -v vdw.bmp chem.bmp&lt;br /&gt;
cp -v  vdw.vdw chem.vdw&lt;br /&gt;
cp -v  vdw.vdw chem.esp&lt;br /&gt;
cp -v trim.electrostatics.phi chem.phi&lt;br /&gt;
&lt;br /&gt;
dsize=$(grep delphi_nsize INDOCK | awk &#039;{print $2}&#039;)&lt;br /&gt;
if [ -z &amp;quot;$dsize&amp;quot; ]; then&lt;br /&gt;
	echo &amp;quot;Error: delphi_nsize not found in INDOCK. Please check the INDOCK file.&amp;quot;&lt;br /&gt;
	exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; gconv.in&lt;br /&gt;
compute_grids                  yes&lt;br /&gt;
DOCK3_7_grids                  yes&lt;br /&gt;
QNIFFT_grid                    yes&lt;br /&gt;
grid_spacing                   0.2&lt;br /&gt;
phi_grid_size                  $dsize&lt;br /&gt;
output_molecule                no&lt;br /&gt;
contact_score                  no&lt;br /&gt;
contact_cutoff_distance        4.5&lt;br /&gt;
chemical_score                 yes&lt;br /&gt;
energy_score                   yes&lt;br /&gt;
energy_cutoff_distance         10&lt;br /&gt;
atom_model                     u&lt;br /&gt;
attractive_exponent            6&lt;br /&gt;
repulsive_exponent             12&lt;br /&gt;
distance_dielectric            yes&lt;br /&gt;
dielectric_factor              4&lt;br /&gt;
bump_filter                    yes&lt;br /&gt;
bump_overlap                   0.5&lt;br /&gt;
receptor_file                  rec.crg&lt;br /&gt;
box_file                       box&lt;br /&gt;
vdw_definition_file            /nfs/home/ak87/PROGRAM/DOCK6-NEBIUS/dock6-gritukan_merged/parameters/vdw_AMBER_parm94.defn&lt;br /&gt;
chemical_definition_file       /nfs/home/ak87/PROGRAM/DOCK6-NEBIUS/dock6-gritukan_merged/parameters/chemgrid/conv.defn&lt;br /&gt;
score_grid_prefix              chem&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
/nfs/home/ak87/PROGRAM/DOCK6-NEBIUS/dock6-gritukan_merged/bin/grid-convert -i gconv.in &amp;gt; gconv.log&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Submit LSD ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
export EXPORT_DEST=$PWD/output&lt;br /&gt;
export DOCKFILES=$PWD/dock6files&lt;br /&gt;
export DOCKEXEC=/wynton/group/bks/work/ak87/UCSF/SCRIPTS/DOCK6/2025-08-Trents_fix/dock6/bin/dock6&lt;br /&gt;
export SHRTCACHE=/dev/shm&lt;br /&gt;
export LONGCACHE=/tmp&lt;br /&gt;
export SHRTCACHE_USE_ENV=&lt;br /&gt;
export USE_DB2_TGZ=true&lt;br /&gt;
export USE_DB2_TGZ_BATCH_SIZE=1&lt;br /&gt;
export USE_DB2=false&lt;br /&gt;
export USE_DB2_BATCH_SIZE=100&lt;br /&gt;
export USE_SLURM=False&lt;br /&gt;
export USE_SLURM_ARGS=--export=ALL&lt;br /&gt;
export USE_SGE=True&lt;br /&gt;
export USE_SGE_ARGS=&amp;quot;-l s_rt=08:28:00 -l h_rt=08:30:00 -l mem_free=2G&amp;quot;&lt;br /&gt;
export USE_PARALLEL=false&lt;br /&gt;
export MAX_PARALLEL=-1&lt;br /&gt;
export QSUB_EXEC=qsub&lt;br /&gt;
export SBATCH_EXEC=sbatch&lt;br /&gt;
export PARALLEL_EXEC=parallel&lt;br /&gt;
export SUBMIT_WAIT_TIME=0&lt;br /&gt;
&lt;br /&gt;
for i in  sdi/* ; do&lt;br /&gt;
       	export k=$(basename $i .in)&lt;br /&gt;
       	echo k $k&lt;br /&gt;
       	export INPUT_SOURCE=$PWD/$i&lt;br /&gt;
       	export EXPORT_DEST=$PWD/output/$k&lt;br /&gt;
       	bash &amp;lt;/path/to/subdock6.bash&amp;gt;&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Process LSD ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env python3&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
parse_dock_logs.py&lt;br /&gt;
&lt;br /&gt;
Recursively parse DOCK &#039;dock.out*&#039; files:&lt;br /&gt;
  • Extract all LIGAND score components; keep the record with the lowest&lt;br /&gt;
    Chemgrid_Score per molecule.&lt;br /&gt;
  • Extract STAT summary for each file.&lt;br /&gt;
  • Save two CSV files: ligand_scores and stat_summary.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
    python parse_dock_logs.py \&lt;br /&gt;
        --root /path/to/search \&lt;br /&gt;
        --ligand_csv /path/to/out/ligand_scores.csv \&lt;br /&gt;
        --stat_csv /path/to/out/stat_summary.csv&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
import argparse&lt;br /&gt;
import re&lt;br /&gt;
from pathlib import Path&lt;br /&gt;
import pandas as pd&lt;br /&gt;
&lt;br /&gt;
# ──────────────────────────────────────────────────────────────────────────────&lt;br /&gt;
# Regex patterns for parsing DOCK output files&lt;br /&gt;
LIGAND_START_RE = re.compile(r&amp;quot;^-+$&amp;quot;)  # Lines with only dashes&lt;br /&gt;
MOLECULE_RE = re.compile(r&amp;quot;^\s*Molecule:\s*(\S+)&amp;quot;, re.IGNORECASE)&lt;br /&gt;
LIGAND_KEYVAL_RE = re.compile(&lt;br /&gt;
    r&amp;quot;^\s*([A-Za-z0-9_]+):\s*([-+]?\d*\.?\d+)\s*$&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
STAT_BLOCK_RE = re.compile(r&amp;quot;^(=+.*STAT|.*STAT.*)&amp;quot;, re.IGNORECASE)&lt;br /&gt;
STAT_MOLS_RE = re.compile(r&amp;quot;^\s*(\d+)\s+Molecules Processed&amp;quot;, re.IGNORECASE)&lt;br /&gt;
STAT_TIME_RE = re.compile(r&amp;quot;^Total elapsed time:\s+([\d.]+) seconds&amp;quot;, re.IGNORECASE)&lt;br /&gt;
ELAPSED_LINE_RE = re.compile(r&amp;quot;Total elapsed time:&amp;quot;, re.IGNORECASE)&lt;br /&gt;
&lt;br /&gt;
# ──────────────────────────────────────────────────────────────────────────────&lt;br /&gt;
def file_finished(lines, tail=50) -&amp;gt; bool:&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Return True if &#039;Total elapsed time&#039; appears in the last `tail` lines.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    return any(ELAPSED_LINE_RE.search(l) for l in lines[-tail:])&lt;br /&gt;
&lt;br /&gt;
# ──────────────────────────────────────────────────────────────────────────────&lt;br /&gt;
def parse_ligands(lines, subdir, filename):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Yield dictionaries with ligand scores.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    i = 0&lt;br /&gt;
    record_count = 0&lt;br /&gt;
    while i &amp;lt; len(lines):&lt;br /&gt;
        # Look for lines with dashes (separator before ligand record)&lt;br /&gt;
        if LIGAND_START_RE.match(lines[i]):&lt;br /&gt;
            # Skip ahead to find Molecule: line&lt;br /&gt;
            j = i + 1&lt;br /&gt;
            while j &amp;lt; len(lines) and not MOLECULE_RE.search(lines[j]):&lt;br /&gt;
                j += 1&lt;br /&gt;
            &lt;br /&gt;
            if j &amp;gt;= len(lines):&lt;br /&gt;
                i += 1&lt;br /&gt;
                continue&lt;br /&gt;
                &lt;br /&gt;
            # Found a molecule line, start parsing&lt;br /&gt;
            molecule_match = MOLECULE_RE.search(lines[j])&lt;br /&gt;
            if not molecule_match:&lt;br /&gt;
                i += 1&lt;br /&gt;
                continue&lt;br /&gt;
                &lt;br /&gt;
            record = {&lt;br /&gt;
                &amp;quot;subdir&amp;quot;: subdir, &lt;br /&gt;
                &amp;quot;file&amp;quot;: filename,&lt;br /&gt;
                &amp;quot;Molecule&amp;quot;: molecule_match.group(1)&lt;br /&gt;
            }&lt;br /&gt;
            &lt;br /&gt;
            # Parse key-value pairs from the rest of the record&lt;br /&gt;
            k = j + 1&lt;br /&gt;
            while k &amp;lt; len(lines):&lt;br /&gt;
                line = lines[k].strip()&lt;br /&gt;
                &lt;br /&gt;
                # Stop if we hit another separator or definitive end markers&lt;br /&gt;
                if (line.startswith(&amp;quot;---&amp;quot;) or &lt;br /&gt;
                    line.startswith(&amp;quot;===&amp;quot;) or &lt;br /&gt;
                    line.startswith(&amp;quot;score &amp;gt;&amp;quot;) or&lt;br /&gt;
                    line.startswith(&amp;quot;Total elapsed time&amp;quot;)):&lt;br /&gt;
                    break&lt;br /&gt;
                &lt;br /&gt;
                # Try to match key-value pairs&lt;br /&gt;
                kv_match = LIGAND_KEYVAL_RE.match(lines[k])&lt;br /&gt;
                if kv_match:&lt;br /&gt;
                    key, val = kv_match.groups()&lt;br /&gt;
                    if val:  # Only add if value is not empty&lt;br /&gt;
                        record[key] = float(val)&lt;br /&gt;
                &lt;br /&gt;
                k += 1&lt;br /&gt;
            &lt;br /&gt;
            # Only yield if we found meaningful data&lt;br /&gt;
            if len(record) &amp;gt; 3:  # Has molecule + metadata + at least one score&lt;br /&gt;
                record_count += 1&lt;br /&gt;
                yield record&lt;br /&gt;
            &lt;br /&gt;
            i = k  # Continue from where we left off&lt;br /&gt;
        else:&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
# ──────────────────────────────────────────────────────────────────────────────&lt;br /&gt;
def parse_stat(lines, subdir, filename):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Return dict with STAT info or None if block not found.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    for idx, line in enumerate(lines):&lt;br /&gt;
        if STAT_BLOCK_RE.match(line):&lt;br /&gt;
            mols = elapsed = None&lt;br /&gt;
            for j in range(idx + 1, len(lines)):&lt;br /&gt;
                if mols is None:&lt;br /&gt;
                    m = STAT_MOLS_RE.match(lines[j])&lt;br /&gt;
                    if m:&lt;br /&gt;
                        mols = int(m.group(1))&lt;br /&gt;
                if elapsed is None:&lt;br /&gt;
                    t = STAT_TIME_RE.match(lines[j])&lt;br /&gt;
                    if t:&lt;br /&gt;
                        elapsed = float(t.group(1))&lt;br /&gt;
                if lines[j].startswith(&amp;quot;=&amp;quot;) and j &amp;gt; idx + 1:&lt;br /&gt;
                    break  # end of STAT block&lt;br /&gt;
            return {&lt;br /&gt;
                &amp;quot;subdir&amp;quot;: subdir,&lt;br /&gt;
                &amp;quot;file&amp;quot;: filename,&lt;br /&gt;
                &amp;quot;molecules_processed&amp;quot;: mols,&lt;br /&gt;
                &amp;quot;elapsed_seconds&amp;quot;: elapsed,&lt;br /&gt;
            }&lt;br /&gt;
    return None&lt;br /&gt;
&lt;br /&gt;
# ──────────────────────────────────────────────────────────────────────────────&lt;br /&gt;
def main():&lt;br /&gt;
    ap = argparse.ArgumentParser(description=&amp;quot;Parse DOCK log files.&amp;quot;)&lt;br /&gt;
    ap.add_argument(&amp;quot;--root&amp;quot;, type=Path, default=Path.cwd(),&lt;br /&gt;
                    help=&amp;quot;Root directory to search (default: CWD)&amp;quot;)&lt;br /&gt;
    ap.add_argument(&amp;quot;--ligand_csv&amp;quot;, type=Path, required=True,&lt;br /&gt;
                    help=&amp;quot;Output CSV for ligand scores&amp;quot;)&lt;br /&gt;
    ap.add_argument(&amp;quot;--stat_csv&amp;quot;, type=Path, required=True,&lt;br /&gt;
                    help=&amp;quot;Output CSV for STAT summaries&amp;quot;)&lt;br /&gt;
    args = ap.parse_args()&lt;br /&gt;
&lt;br /&gt;
    ligand_records = []&lt;br /&gt;
    stat_records = []&lt;br /&gt;
&lt;br /&gt;
    for path in args.root.rglob(&amp;quot;dock.out*&amp;quot;):&lt;br /&gt;
        print(f&amp;quot;Processing {path}&amp;quot;)&lt;br /&gt;
        if not path.is_file():&lt;br /&gt;
            continue&lt;br /&gt;
        lines = path.read_text(errors=&amp;quot;ignore&amp;quot;).splitlines()&lt;br /&gt;
        if not file_finished(lines):&lt;br /&gt;
            print(f&amp;quot;  Skipping: file not finished&amp;quot;)&lt;br /&gt;
            continue  # skip incomplete file&lt;br /&gt;
        &lt;br /&gt;
        subdir = str(path.parent.relative_to(args.root))&lt;br /&gt;
        filename = path.name&lt;br /&gt;
&lt;br /&gt;
        # LIGAND parsing&lt;br /&gt;
        ligand_records_from_file = list(parse_ligands(lines, subdir, filename))&lt;br /&gt;
        ligand_records.extend(ligand_records_from_file)&lt;br /&gt;
        print(f&amp;quot;  Found {len(ligand_records_from_file)} ligand records&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
        # STAT parsing&lt;br /&gt;
        stat = parse_stat(lines, subdir, filename)&lt;br /&gt;
        if stat:&lt;br /&gt;
            stat_records.append(stat)&lt;br /&gt;
&lt;br /&gt;
    if not ligand_records:&lt;br /&gt;
        print(&amp;quot;No completed ligand data found.&amp;quot;)&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    # Ligand DF &amp;amp; best scores&lt;br /&gt;
    df_lig = pd.DataFrame(ligand_records)&lt;br /&gt;
    &lt;br /&gt;
    # Check if Chemgrid_Score exists, if not use alternative column&lt;br /&gt;
    score_column = &amp;quot;Chemgrid_Score&amp;quot;&lt;br /&gt;
    if score_column not in df_lig.columns:&lt;br /&gt;
        # Look for alternative score columns&lt;br /&gt;
        possible_scores = [col for col in df_lig.columns if &amp;quot;score&amp;quot; in col.lower()]&lt;br /&gt;
        if possible_scores:&lt;br /&gt;
            score_column = possible_scores[0]&lt;br /&gt;
            print(f&amp;quot;Using {score_column} instead of Chemgrid_Score&amp;quot;)&lt;br /&gt;
        else:&lt;br /&gt;
            print(&amp;quot;No score column found!&amp;quot;)&lt;br /&gt;
            return&lt;br /&gt;
    &lt;br /&gt;
    best_idx = (&lt;br /&gt;
        df_lig.groupby(&amp;quot;Molecule&amp;quot;)[score_column]&lt;br /&gt;
        .idxmin()&lt;br /&gt;
        .dropna()&lt;br /&gt;
    )&lt;br /&gt;
    df_best = df_lig.loc[best_idx].sort_values(score_column)&lt;br /&gt;
    args.ligand_csv.parent.mkdir(parents=True, exist_ok=True)&lt;br /&gt;
    df_best.to_csv(args.ligand_csv, index=False)&lt;br /&gt;
&lt;br /&gt;
    # STAT DF&lt;br /&gt;
    if stat_records:&lt;br /&gt;
        df_stat = pd.DataFrame(stat_records)&lt;br /&gt;
        args.stat_csv.parent.mkdir(parents=True, exist_ok=True)&lt;br /&gt;
        df_stat.to_csv(args.stat_csv, index=False)&lt;br /&gt;
&lt;br /&gt;
    print(f&amp;quot;Wrote {len(df_best)} molecules to {args.ligand_csv}&amp;quot;)&lt;br /&gt;
    if stat_records:&lt;br /&gt;
        print(f&amp;quot;Wrote {len(df_stat)} STAT rows to {args.stat_csv}&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
    main()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Rescoring ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env bash&lt;br /&gt;
# ------------------------------------------------------------------&lt;br /&gt;
# Rescoring pipeline — Bash port of the original tcsh script&lt;br /&gt;
# ------------------------------------------------------------------&lt;br /&gt;
# IFS=$&#039;\n\t&#039;               # safe word splitting&lt;br /&gt;
&lt;br /&gt;
# ------------------------- CONFIGURATION --------------------------&lt;br /&gt;
system=&amp;quot;AMPC&amp;quot;             # set your system tag here&lt;br /&gt;
# system=&amp;quot;EGFR&amp;quot;            # uncomment to switch target&lt;br /&gt;
&lt;br /&gt;
outdir=&amp;quot;${system}_rescore_v3.8_v6&amp;quot;&lt;br /&gt;
src_gz=&amp;quot;/home/ak87/Desktop/SMALL_PROJ/DOCK6-NEBIUS/2025-06-TEST/TEST-LINKIN/RUN-TRENTs-COMMENTS/DOCK3/1/output/test.mol2.gz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
db2_dir=&amp;quot;/home/ak87/Desktop/SMALL_PROJ/DOCK6-NEBIUS/2025-06-TEST/AMPC-TESTED/&amp;quot;&lt;br /&gt;
dockfiles_link=&amp;quot;/home/ak87/Desktop/SMALL_PROJ/DOCK6-NEBIUS/2025-06-TEST/TMP2/dock6files&amp;quot;&lt;br /&gt;
&lt;br /&gt;
dock6_bin=&amp;quot;/home/ak87/Programs/dock6-gritukan_merged/bin/dock6&amp;quot;&lt;br /&gt;
separate_py=&amp;quot;/home/ak87/Programs/lc_blazing_fast_separate_mol2_into_smaller_files_AK.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
vdw_defn=&amp;quot;/home/ak87/Programs/dock6-gritukan_merged/parameters/vdw_AMBER_parm94.dock3_7.defn&amp;quot;&lt;br /&gt;
flex_defn=&amp;quot;/home/ak87/Programs/dock6-gritukan_merged/parameters/flex.defn&amp;quot;&lt;br /&gt;
flex_tbl=&amp;quot;/home/ak87/Programs/dock6-gritukan_merged/parameters/flex_drive.tbl&amp;quot;&lt;br /&gt;
# ------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
mkdir -p &amp;quot;$outdir&amp;quot;&lt;br /&gt;
cd &amp;quot;$outdir&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Unzip test.mol2 once&lt;br /&gt;
zcat &amp;quot;$src_gz&amp;quot; &amp;gt; test.mol2&lt;br /&gt;
&lt;br /&gt;
# Link dockfiles directory (overwrite stale link if present)&lt;br /&gt;
ln -sfn &amp;quot;$dockfiles_link&amp;quot; dockfiles&lt;br /&gt;
&lt;br /&gt;
# Fresh output accumulator&lt;br /&gt;
rm -f total_energy.txt&lt;br /&gt;
&lt;br /&gt;
# Split the multi-mol2 file into chunks named split001.mol2 …&lt;br /&gt;
python &amp;quot;$separate_py&amp;quot; test.mol2 split 1&lt;br /&gt;
rm test.mol2&lt;br /&gt;
mol2files=$(ls *.mol2)&lt;br /&gt;
echo $mol2files&lt;br /&gt;
&lt;br /&gt;
# ---------------------- MAIN PROCESSING LOOP ---------------------&lt;br /&gt;
for mol2file in $mol2files; do&lt;br /&gt;
    # Grab ligand-source path (single value expected)&lt;br /&gt;
    # file=$(grep -m1 &amp;quot;Ligand Source File:&amp;quot; &amp;quot;$mol2file&amp;quot; | awk &#039;{print $5}&#039;)&lt;br /&gt;
    ligand_id=$(grep &amp;quot;##########                 Name:&amp;quot; &amp;quot;$mol2file&amp;quot; | awk &#039;{print $3}&#039;)&lt;br /&gt;
    ligand_charge=$(grep &amp;quot;##########        Ligand Charge:&amp;quot; &amp;quot;$mol2file&amp;quot; | awk &#039;{print $4}&#039;)&lt;br /&gt;
    echo &amp;quot;Processing ligand: $ligand_id (charge: $ligand_charge, source: $mol2file)&amp;quot;&lt;br /&gt;
    found_file=false&lt;br /&gt;
    for file in &amp;quot;$db2_dir&amp;quot;/*&amp;quot;$ligand_id&amp;quot;*.db2; do&lt;br /&gt;
        echo &amp;quot;Checking file: $file&amp;quot;&lt;br /&gt;
        this_charge=$(head -n 2 &amp;quot;$file&amp;quot; | tail -n 1 | awk &#039;{print $2}&#039;)&lt;br /&gt;
        echo $ligand_id $this_charge $ligand_charge&lt;br /&gt;
        match=$(python3 -c &amp;quot;import sys; print(&amp;quot;1&amp;quot;) if float(&#039;$ligand_charge&#039;) == float(&#039;$this_charge&#039;) else sprint(&amp;quot;2&amp;quot;)&amp;quot;)&lt;br /&gt;
        if [[ &amp;quot;$match&amp;quot; -eq &amp;quot;1&amp;quot; ]]; then&lt;br /&gt;
            echo &amp;quot;Found source file: $file (charge match: $ligand_charge)&amp;quot;&lt;br /&gt;
            found_file=true&lt;br /&gt;
            break&lt;br /&gt;
        fi&lt;br /&gt;
    done&lt;br /&gt;
    if [[ $found_file == false ]]; then&lt;br /&gt;
        echo &amp;quot;No matching source file found for ligand: $ligand_id (charge: $ligand_charge)&amp;quot;&lt;br /&gt;
        continue&lt;br /&gt;
    fi&lt;br /&gt;
    name=&amp;quot;${mol2file%.*}&amp;quot;          # basename without .mol2&lt;br /&gt;
&lt;br /&gt;
    echo &amp;quot;Processing $mol2file  (source ⇒ $file)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # Build solvation table&lt;br /&gt;
    cat &amp;quot;$file&amp;quot; | grep &amp;quot;^A&amp;quot; \&lt;br /&gt;
        | awk &#039;{printf&amp;quot;%f %f %f %f %f\n&amp;quot;,0.0,$8,0.0,$9,$10}&#039; \&lt;br /&gt;
        &amp;gt; &amp;quot;${name}.solv&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    printf &#039;%s\n&#039; &amp;quot;$name&amp;quot; &amp;gt; molname.txt   # not used later but kept&lt;br /&gt;
&lt;br /&gt;
    # Append TRIPOS solvation section&lt;br /&gt;
    {&lt;br /&gt;
        printf &#039;@&amp;lt;TRIPOS&amp;gt;SOLVATION\n&#039;&lt;br /&gt;
        printf &#039;LIG header\n&#039;&lt;br /&gt;
        cat &amp;quot;${name}.solv&amp;quot;&lt;br /&gt;
    } &amp;gt;&amp;gt; &amp;quot;${name}.mol2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # ------------------- Generate dock.in on-the-fly --------------&lt;br /&gt;
    cat &amp;gt; dock.in &amp;lt;&amp;lt;EOF&lt;br /&gt;
conformer_search_type                                        rigid&lt;br /&gt;
use_internal_energy                                          no&lt;br /&gt;
ligand_atom_file                                             ${name}.mol2&lt;br /&gt;
limit_max_ligands                                            no&lt;br /&gt;
skip_molecule                                                no&lt;br /&gt;
read_mol_solvation                                           yes&lt;br /&gt;
calculate_rmsd                                               no&lt;br /&gt;
use_database_filter                                          no&lt;br /&gt;
orient_ligand                                                no&lt;br /&gt;
bump_filter                                                  no&lt;br /&gt;
score_molecules                                              yes&lt;br /&gt;
contact_score_primary                                        no&lt;br /&gt;
grid_score_primary                                           no&lt;br /&gt;
gist_score_primary                                           no&lt;br /&gt;
multigrid_score_primary                                      no&lt;br /&gt;
dock3.5_score_primary                                        yes&lt;br /&gt;
dock3.5_vdw_score                                            yes&lt;br /&gt;
dock3.5_grd_prefix                                           dockfiles/chem52&lt;br /&gt;
dock3.5_electrostatic_score                                  yes&lt;br /&gt;
dock3.5_ligand_desolvation_score                             volume&lt;br /&gt;
dock3.5_solvent_occlusion_file                               dockfiles/ligand.desolv.heavy&lt;br /&gt;
dock3.5_redistribute_positive_desolvation                    no&lt;br /&gt;
dock3.5_hydrogen_desolvation_grid                            yes&lt;br /&gt;
dock3.5_hydrogen_solvent_occlusion_file                      dockfiles/ligand.desolv.hydrogen&lt;br /&gt;
dock3.5_receptor_desolvation_score                           no&lt;br /&gt;
dock3.5_write_atomic_energy_contrib                          no&lt;br /&gt;
dock3.5_score_vdw_scale                                      1&lt;br /&gt;
dock3.5_score_es_scale                                       1&lt;br /&gt;
minimize_ligand                                              no&lt;br /&gt;
atom_model                                                   all&lt;br /&gt;
vdw_defn_file                                                ${vdw_defn}&lt;br /&gt;
flex_defn_file                                               ${flex_defn}&lt;br /&gt;
flex_drive_file                                              ${flex_tbl}&lt;br /&gt;
ligand_outfile_prefix                                        ${name}_output&lt;br /&gt;
write_orientations                                           no&lt;br /&gt;
num_scored_conformers                                        1&lt;br /&gt;
rank_ligands                                                 no&lt;br /&gt;
EOF&lt;br /&gt;
    # --------------------- Run DOCK and harvest -------------------&lt;br /&gt;
    &amp;quot;$dock6_bin&amp;quot; -i dock.in -o dock.out&lt;br /&gt;
&lt;br /&gt;
    # Pull chemgrid and energy terms into running table&lt;br /&gt;
    echo &amp;quot;$(grep Chemgrid_Score &amp;quot;${name}_output_scored.mol2&amp;quot;) \&lt;br /&gt;
$(grep &#039;Total Energy:&#039; &amp;quot;${name}.mol2&amp;quot;)&amp;quot; \&lt;br /&gt;
        | awk &#039;{print $3, $7}&#039; &amp;gt;&amp;gt; total_energy.txt&lt;br /&gt;
done&lt;br /&gt;
# ------------------------------------------------------------------&lt;br /&gt;
echo &amp;quot;All done — summary energies written to total_energy.txt&amp;quot;(base)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Running_DOCK6_with_ChemGrid_Score_and_db2_files&amp;diff=16873</id>
		<title>Running DOCK6 with ChemGrid Score and db2 files</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Running_DOCK6_with_ChemGrid_Score_and_db2_files&amp;diff=16873"/>
		<updated>2025-09-09T18:32:07Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: first draft&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Installation ==&lt;br /&gt;
Obtain DOCK 6 from [https://github.com/docking-org/dock6 the official GitHub repository]. See also the DOCK 6 manual: [https://dock.compbio.ucsf.edu/DOCK_6/dock6_manual.htm#Installation Installation]. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# on epyc-A40&lt;br /&gt;
cd dock6/install&lt;br /&gt;
./configure gnu&lt;br /&gt;
make all&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Large-scale docking (LSD) ==&lt;br /&gt;
The most recent copy on Wynton is in &amp;lt;code&amp;gt;/wynton/group/bks/work/ak87/UCSF/SCRIPTS/DOCK6/2025-08-Trents_fix/dock6/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Converting DOCK 3 grids to DOCK 6 ===&lt;br /&gt;
See the Scripts/Convert Grids section below. This has been tested on Gimel and should also work on Wynton. The preferred workflow starts from both &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;working&amp;lt;/code&amp;gt; directories produced by DOCK 3 &amp;lt;code&amp;gt;blastermaster&amp;lt;/code&amp;gt;. When that is not available, the script requires the DOCK 3 &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; only. DOCK 3 and DOCK 6 installations are needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh convert_dock3_grids_dockfiles.sh &amp;lt;path_to_dock3_grids_dockfiles&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Converted grids reproduce the same scores when rescoring DOCK 3 poses. For Mac1, however, top scores during large-scale docking were in the thousands, likely because some ligands extended beyond the grid box.&lt;br /&gt;
&lt;br /&gt;
=== Running LSD ===&lt;br /&gt;
Running LSD with DOCK 6 is analogous to DOCK 3:&lt;br /&gt;
* Prepare grids in &amp;lt;code&amp;gt;dock6files&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Obtain SubDock from [https://github.com/docking-org/SUBDOCK6/tree/main the SUBDOCK6 repository].&lt;br /&gt;
* Prepare lists of ligand &amp;lt;code&amp;gt;.tgz&amp;lt;/code&amp;gt; files in an &amp;lt;code&amp;gt;sdi&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
* Create &amp;lt;code&amp;gt;run_subdock6.sh&amp;lt;/code&amp;gt; in the working directory and run it (see Scripts/Submit LSD below). The script targets Wynton but should work on clusters using SGE or SLURM. You can re-run it to retry unfinished jobs.&lt;br /&gt;
&lt;br /&gt;
=== Processing LSD ===&lt;br /&gt;
Run the parsing script (see Scripts/Process LSD below). It writes a CSV of scores (similar to &amp;lt;code&amp;gt;extract_all.sort.uniq.txt&amp;lt;/code&amp;gt;) and a second CSV with per-subdirectory runtimes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python parse_dock_logs.py --root /path/to/search \&lt;br /&gt;
  --ligand_csv /path/to/out/ligand_scores.csv \&lt;br /&gt;
  --stat_csv /path/to/out/stat_summary.csv&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To do:&#039;&#039;&#039; extract poses.&lt;br /&gt;
&lt;br /&gt;
== Rescoring DOCK 3 poses ==&lt;br /&gt;
See Scripts/Rescoring. Edit the script to specify:&lt;br /&gt;
* The &amp;lt;code&amp;gt;mol2.gz&amp;lt;/code&amp;gt; file with poses to rescore.&lt;br /&gt;
* A directory with &amp;lt;code&amp;gt;db2&amp;lt;/code&amp;gt; files (DOCK 6 reads solvation data from these).&lt;br /&gt;
* DOCK 6 grids (&amp;lt;code&amp;gt;dock6files&amp;lt;/code&amp;gt;).&lt;br /&gt;
* Parameter files from the DOCK 6 installation.&lt;br /&gt;
* The helper &amp;lt;code&amp;gt;lc_blazing_fast_separate_mol2_into_smaller_files.py&amp;lt;/code&amp;gt; is used to split large MOL2 files for speed.&lt;br /&gt;
&lt;br /&gt;
== Scripts ==&lt;br /&gt;
=== Convert grids ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# convert_dock3_grids_dockfiles.sh&lt;br /&gt;
# Convert DOCK3 grids to DOCK6 dockfiles&lt;br /&gt;
# Author Trent Balius (converted to bash)&lt;br /&gt;
&lt;br /&gt;
set -e&lt;br /&gt;
echo &amp;quot;sh convert_dock3_grids_dockfiles.sh &amp;lt;path_to_dock3_grids_dockfiles&amp;gt;&amp;quot;&lt;br /&gt;
workdir=&amp;quot;$(pwd)&amp;quot;&lt;br /&gt;
cd &amp;quot;$workdir&amp;quot; || exit&lt;br /&gt;
# system=&amp;quot;$(basename &amp;quot;$workdir&amp;quot;)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#filedir=&amp;quot;/is2/projects/RAS-CompChem/static/work/DUDEZ/dudez_dockprep/${system}_dock6prep/blastermaster/dockfiles&amp;quot;&lt;br /&gt;
if [ -z &amp;quot;$1&amp;quot; ]; then&lt;br /&gt;
	echo &amp;quot;Usage: sh convert_dock3_grids_dockfiles.sh &amp;lt;path_to_dock3_grids_dockfiles&amp;gt;&amp;quot;&lt;br /&gt;
	exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
filedir=$1&lt;br /&gt;
# Directory where the converted DOCK6 dockfiles will be stored&lt;br /&gt;
dock6files_dir=&amp;quot;${workdir}/dock6files&amp;quot;&lt;br /&gt;
&lt;br /&gt;
mkdir -p &amp;quot;$dock6files_dir&amp;quot;&lt;br /&gt;
cd &amp;quot;$dock6files_dir&amp;quot; || exit&lt;br /&gt;
&lt;br /&gt;
cp &amp;quot;$filedir&amp;quot;/vdw.* .&lt;br /&gt;
#cp &amp;quot;$filedir/box&amp;quot; .&lt;br /&gt;
#cp &amp;quot;$filedir/qnifft.electrostatics.phi&amp;quot; .&lt;br /&gt;
cp &amp;quot;$filedir/trim.electrostatics.phi&amp;quot; .&lt;br /&gt;
cp &amp;quot;$filedir/matching_spheres.sph&amp;quot; .&lt;br /&gt;
cp &amp;quot;$filedir&amp;quot;/ligand.desolv.* .&lt;br /&gt;
cp &amp;quot;$filedir/INDOCK&amp;quot; .&lt;br /&gt;
cp &amp;quot;$filedir/rec.crg.pdb&amp;quot; rec.pdb&lt;br /&gt;
&lt;br /&gt;
perl /nfs/soft/dock/versions/dock37/DOCK-3.7-trunk/proteins/makebox/makebox.smallokay.pl matching_spheres.sph rec.pdb box 10.0&lt;br /&gt;
&lt;br /&gt;
# Creating standalone grids, so no links to the original files&lt;br /&gt;
# ln -sf vdw.bmp chem.bmp&lt;br /&gt;
# ln -sf vdw.vdw chem.vdw&lt;br /&gt;
# #ln -sf vdw.esp chem.esp&lt;br /&gt;
# ln -sf vdw.vdw chem.esp&lt;br /&gt;
# #ln -sf qnifft.electrostatics.phi rec+sph.phi&lt;br /&gt;
# #ln -sf trim.electrostatics.phi rec+sph.phi&lt;br /&gt;
# ln -sf trim.electrostatics.phi chem.phi&lt;br /&gt;
&lt;br /&gt;
cp -v vdw.bmp chem.bmp&lt;br /&gt;
cp -v  vdw.vdw chem.vdw&lt;br /&gt;
cp -v  vdw.vdw chem.esp&lt;br /&gt;
cp -v trim.electrostatics.phi chem.phi&lt;br /&gt;
&lt;br /&gt;
dsize=$(grep delphi_nsize INDOCK | awk &#039;{print $2}&#039;)&lt;br /&gt;
if [ -z &amp;quot;$dsize&amp;quot; ]; then&lt;br /&gt;
	echo &amp;quot;Error: delphi_nsize not found in INDOCK. Please check the INDOCK file.&amp;quot;&lt;br /&gt;
	exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; gconv.in&lt;br /&gt;
compute_grids                  yes&lt;br /&gt;
DOCK3_7_grids                  yes&lt;br /&gt;
QNIFFT_grid                    yes&lt;br /&gt;
grid_spacing                   0.2&lt;br /&gt;
phi_grid_size                  $dsize&lt;br /&gt;
output_molecule                no&lt;br /&gt;
contact_score                  no&lt;br /&gt;
contact_cutoff_distance        4.5&lt;br /&gt;
chemical_score                 yes&lt;br /&gt;
energy_score                   yes&lt;br /&gt;
energy_cutoff_distance         10&lt;br /&gt;
atom_model                     u&lt;br /&gt;
attractive_exponent            6&lt;br /&gt;
repulsive_exponent             12&lt;br /&gt;
distance_dielectric            yes&lt;br /&gt;
dielectric_factor              4&lt;br /&gt;
bump_filter                    yes&lt;br /&gt;
bump_overlap                   0.5&lt;br /&gt;
receptor_file                  rec.crg&lt;br /&gt;
box_file                       box&lt;br /&gt;
vdw_definition_file            /nfs/home/ak87/PROGRAM/DOCK6-NEBIUS/dock6-gritukan_merged/parameters/vdw_AMBER_parm94.defn&lt;br /&gt;
chemical_definition_file       /nfs/home/ak87/PROGRAM/DOCK6-NEBIUS/dock6-gritukan_merged/parameters/chemgrid/conv.defn&lt;br /&gt;
score_grid_prefix              chem&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
/nfs/home/ak87/PROGRAM/DOCK6-NEBIUS/dock6-gritukan_merged/bin/grid-convert -i gconv.in &amp;gt; gconv.log&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Submit LSD ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
export EXPORT_DEST=$PWD/output&lt;br /&gt;
export DOCKFILES=$PWD/dock6files&lt;br /&gt;
export DOCKEXEC=/wynton/group/bks/work/ak87/UCSF/SCRIPTS/DOCK6/2025-08-Trents_fix/dock6/bin/dock6&lt;br /&gt;
export SHRTCACHE=/dev/shm&lt;br /&gt;
export LONGCACHE=/tmp&lt;br /&gt;
export SHRTCACHE_USE_ENV=&lt;br /&gt;
export USE_DB2_TGZ=true&lt;br /&gt;
export USE_DB2_TGZ_BATCH_SIZE=1&lt;br /&gt;
export USE_DB2=false&lt;br /&gt;
export USE_DB2_BATCH_SIZE=100&lt;br /&gt;
export USE_SLURM=False&lt;br /&gt;
export USE_SLURM_ARGS=--export=ALL&lt;br /&gt;
export USE_SGE=True&lt;br /&gt;
export USE_SGE_ARGS=&amp;quot;-l s_rt=08:28:00 -l h_rt=08:30:00 -l mem_free=2G&amp;quot;&lt;br /&gt;
export USE_PARALLEL=false&lt;br /&gt;
export MAX_PARALLEL=-1&lt;br /&gt;
export QSUB_EXEC=qsub&lt;br /&gt;
export SBATCH_EXEC=sbatch&lt;br /&gt;
export PARALLEL_EXEC=parallel&lt;br /&gt;
export SUBMIT_WAIT_TIME=0&lt;br /&gt;
&lt;br /&gt;
for i in  sdi/* ; do&lt;br /&gt;
       	export k=$(basename $i .in)&lt;br /&gt;
       	echo k $k&lt;br /&gt;
       	export INPUT_SOURCE=$PWD/$i&lt;br /&gt;
       	export EXPORT_DEST=$PWD/output/$k&lt;br /&gt;
       	bash &amp;lt;/path/to/subdock6.bash&amp;gt;&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Process LSD ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env python3&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
parse_dock_logs.py&lt;br /&gt;
&lt;br /&gt;
Recursively parse DOCK &#039;dock.out*&#039; files:&lt;br /&gt;
  • Extract all LIGAND score components; keep the record with the lowest&lt;br /&gt;
    Chemgrid_Score per molecule.&lt;br /&gt;
  • Extract STAT summary for each file.&lt;br /&gt;
  • Save two CSV files: ligand_scores and stat_summary.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
    python parse_dock_logs.py \&lt;br /&gt;
        --root /path/to/search \&lt;br /&gt;
        --ligand_csv /path/to/out/ligand_scores.csv \&lt;br /&gt;
        --stat_csv /path/to/out/stat_summary.csv&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
import argparse&lt;br /&gt;
import re&lt;br /&gt;
from pathlib import Path&lt;br /&gt;
import pandas as pd&lt;br /&gt;
&lt;br /&gt;
# ──────────────────────────────────────────────────────────────────────────────&lt;br /&gt;
# Regex patterns for parsing DOCK output files&lt;br /&gt;
LIGAND_START_RE = re.compile(r&amp;quot;^-+$&amp;quot;)  # Lines with only dashes&lt;br /&gt;
MOLECULE_RE = re.compile(r&amp;quot;^\s*Molecule:\s*(\S+)&amp;quot;, re.IGNORECASE)&lt;br /&gt;
LIGAND_KEYVAL_RE = re.compile(&lt;br /&gt;
    r&amp;quot;^\s*([A-Za-z0-9_]+):\s*([-+]?\d*\.?\d+)\s*$&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
STAT_BLOCK_RE = re.compile(r&amp;quot;^(=+.*STAT|.*STAT.*)&amp;quot;, re.IGNORECASE)&lt;br /&gt;
STAT_MOLS_RE = re.compile(r&amp;quot;^\s*(\d+)\s+Molecules Processed&amp;quot;, re.IGNORECASE)&lt;br /&gt;
STAT_TIME_RE = re.compile(r&amp;quot;^Total elapsed time:\s+([\d.]+) seconds&amp;quot;, re.IGNORECASE)&lt;br /&gt;
ELAPSED_LINE_RE = re.compile(r&amp;quot;Total elapsed time:&amp;quot;, re.IGNORECASE)&lt;br /&gt;
&lt;br /&gt;
# ──────────────────────────────────────────────────────────────────────────────&lt;br /&gt;
def file_finished(lines, tail=50) -&amp;gt; bool:&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Return True if &#039;Total elapsed time&#039; appears in the last `tail` lines.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    return any(ELAPSED_LINE_RE.search(l) for l in lines[-tail:])&lt;br /&gt;
&lt;br /&gt;
# ──────────────────────────────────────────────────────────────────────────────&lt;br /&gt;
def parse_ligands(lines, subdir, filename):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Yield dictionaries with ligand scores.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    i = 0&lt;br /&gt;
    record_count = 0&lt;br /&gt;
    while i &amp;lt; len(lines):&lt;br /&gt;
        # Look for lines with dashes (separator before ligand record)&lt;br /&gt;
        if LIGAND_START_RE.match(lines[i]):&lt;br /&gt;
            # Skip ahead to find Molecule: line&lt;br /&gt;
            j = i + 1&lt;br /&gt;
            while j &amp;lt; len(lines) and not MOLECULE_RE.search(lines[j]):&lt;br /&gt;
                j += 1&lt;br /&gt;
            &lt;br /&gt;
            if j &amp;gt;= len(lines):&lt;br /&gt;
                i += 1&lt;br /&gt;
                continue&lt;br /&gt;
                &lt;br /&gt;
            # Found a molecule line, start parsing&lt;br /&gt;
            molecule_match = MOLECULE_RE.search(lines[j])&lt;br /&gt;
            if not molecule_match:&lt;br /&gt;
                i += 1&lt;br /&gt;
                continue&lt;br /&gt;
                &lt;br /&gt;
            record = {&lt;br /&gt;
                &amp;quot;subdir&amp;quot;: subdir, &lt;br /&gt;
                &amp;quot;file&amp;quot;: filename,&lt;br /&gt;
                &amp;quot;Molecule&amp;quot;: molecule_match.group(1)&lt;br /&gt;
            }&lt;br /&gt;
            &lt;br /&gt;
            # Parse key-value pairs from the rest of the record&lt;br /&gt;
            k = j + 1&lt;br /&gt;
            while k &amp;lt; len(lines):&lt;br /&gt;
                line = lines[k].strip()&lt;br /&gt;
                &lt;br /&gt;
                # Stop if we hit another separator or definitive end markers&lt;br /&gt;
                if (line.startswith(&amp;quot;---&amp;quot;) or &lt;br /&gt;
                    line.startswith(&amp;quot;===&amp;quot;) or &lt;br /&gt;
                    line.startswith(&amp;quot;score &amp;gt;&amp;quot;) or&lt;br /&gt;
                    line.startswith(&amp;quot;Total elapsed time&amp;quot;)):&lt;br /&gt;
                    break&lt;br /&gt;
                &lt;br /&gt;
                # Try to match key-value pairs&lt;br /&gt;
                kv_match = LIGAND_KEYVAL_RE.match(lines[k])&lt;br /&gt;
                if kv_match:&lt;br /&gt;
                    key, val = kv_match.groups()&lt;br /&gt;
                    if val:  # Only add if value is not empty&lt;br /&gt;
                        record[key] = float(val)&lt;br /&gt;
                &lt;br /&gt;
                k += 1&lt;br /&gt;
            &lt;br /&gt;
            # Only yield if we found meaningful data&lt;br /&gt;
            if len(record) &amp;gt; 3:  # Has molecule + metadata + at least one score&lt;br /&gt;
                record_count += 1&lt;br /&gt;
                yield record&lt;br /&gt;
            &lt;br /&gt;
            i = k  # Continue from where we left off&lt;br /&gt;
        else:&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
# ──────────────────────────────────────────────────────────────────────────────&lt;br /&gt;
def parse_stat(lines, subdir, filename):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Return dict with STAT info or None if block not found.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    for idx, line in enumerate(lines):&lt;br /&gt;
        if STAT_BLOCK_RE.match(line):&lt;br /&gt;
            mols = elapsed = None&lt;br /&gt;
            for j in range(idx + 1, len(lines)):&lt;br /&gt;
                if mols is None:&lt;br /&gt;
                    m = STAT_MOLS_RE.match(lines[j])&lt;br /&gt;
                    if m:&lt;br /&gt;
                        mols = int(m.group(1))&lt;br /&gt;
                if elapsed is None:&lt;br /&gt;
                    t = STAT_TIME_RE.match(lines[j])&lt;br /&gt;
                    if t:&lt;br /&gt;
                        elapsed = float(t.group(1))&lt;br /&gt;
                if lines[j].startswith(&amp;quot;=&amp;quot;) and j &amp;gt; idx + 1:&lt;br /&gt;
                    break  # end of STAT block&lt;br /&gt;
            return {&lt;br /&gt;
                &amp;quot;subdir&amp;quot;: subdir,&lt;br /&gt;
                &amp;quot;file&amp;quot;: filename,&lt;br /&gt;
                &amp;quot;molecules_processed&amp;quot;: mols,&lt;br /&gt;
                &amp;quot;elapsed_seconds&amp;quot;: elapsed,&lt;br /&gt;
            }&lt;br /&gt;
    return None&lt;br /&gt;
&lt;br /&gt;
# ──────────────────────────────────────────────────────────────────────────────&lt;br /&gt;
def main():&lt;br /&gt;
    ap = argparse.ArgumentParser(description=&amp;quot;Parse DOCK log files.&amp;quot;)&lt;br /&gt;
    ap.add_argument(&amp;quot;--root&amp;quot;, type=Path, default=Path.cwd(),&lt;br /&gt;
                    help=&amp;quot;Root directory to search (default: CWD)&amp;quot;)&lt;br /&gt;
    ap.add_argument(&amp;quot;--ligand_csv&amp;quot;, type=Path, required=True,&lt;br /&gt;
                    help=&amp;quot;Output CSV for ligand scores&amp;quot;)&lt;br /&gt;
    ap.add_argument(&amp;quot;--stat_csv&amp;quot;, type=Path, required=True,&lt;br /&gt;
                    help=&amp;quot;Output CSV for STAT summaries&amp;quot;)&lt;br /&gt;
    args = ap.parse_args()&lt;br /&gt;
&lt;br /&gt;
    ligand_records = []&lt;br /&gt;
    stat_records = []&lt;br /&gt;
&lt;br /&gt;
    for path in args.root.rglob(&amp;quot;dock.out*&amp;quot;):&lt;br /&gt;
        print(f&amp;quot;Processing {path}&amp;quot;)&lt;br /&gt;
        if not path.is_file():&lt;br /&gt;
            continue&lt;br /&gt;
        lines = path.read_text(errors=&amp;quot;ignore&amp;quot;).splitlines()&lt;br /&gt;
        if not file_finished(lines):&lt;br /&gt;
            print(f&amp;quot;  Skipping: file not finished&amp;quot;)&lt;br /&gt;
            continue  # skip incomplete file&lt;br /&gt;
        &lt;br /&gt;
        subdir = str(path.parent.relative_to(args.root))&lt;br /&gt;
        filename = path.name&lt;br /&gt;
&lt;br /&gt;
        # LIGAND parsing&lt;br /&gt;
        ligand_records_from_file = list(parse_ligands(lines, subdir, filename))&lt;br /&gt;
        ligand_records.extend(ligand_records_from_file)&lt;br /&gt;
        print(f&amp;quot;  Found {len(ligand_records_from_file)} ligand records&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
        # STAT parsing&lt;br /&gt;
        stat = parse_stat(lines, subdir, filename)&lt;br /&gt;
        if stat:&lt;br /&gt;
            stat_records.append(stat)&lt;br /&gt;
&lt;br /&gt;
    if not ligand_records:&lt;br /&gt;
        print(&amp;quot;No completed ligand data found.&amp;quot;)&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    # Ligand DF &amp;amp; best scores&lt;br /&gt;
    df_lig = pd.DataFrame(ligand_records)&lt;br /&gt;
    &lt;br /&gt;
    # Check if Chemgrid_Score exists, if not use alternative column&lt;br /&gt;
    score_column = &amp;quot;Chemgrid_Score&amp;quot;&lt;br /&gt;
    if score_column not in df_lig.columns:&lt;br /&gt;
        # Look for alternative score columns&lt;br /&gt;
        possible_scores = [col for col in df_lig.columns if &amp;quot;score&amp;quot; in col.lower()]&lt;br /&gt;
        if possible_scores:&lt;br /&gt;
            score_column = possible_scores[0]&lt;br /&gt;
            print(f&amp;quot;Using {score_column} instead of Chemgrid_Score&amp;quot;)&lt;br /&gt;
        else:&lt;br /&gt;
            print(&amp;quot;No score column found!&amp;quot;)&lt;br /&gt;
            return&lt;br /&gt;
    &lt;br /&gt;
    best_idx = (&lt;br /&gt;
        df_lig.groupby(&amp;quot;Molecule&amp;quot;)[score_column]&lt;br /&gt;
        .idxmin()&lt;br /&gt;
        .dropna()&lt;br /&gt;
    )&lt;br /&gt;
    df_best = df_lig.loc[best_idx].sort_values(score_column)&lt;br /&gt;
    args.ligand_csv.parent.mkdir(parents=True, exist_ok=True)&lt;br /&gt;
    df_best.to_csv(args.ligand_csv, index=False)&lt;br /&gt;
&lt;br /&gt;
    # STAT DF&lt;br /&gt;
    if stat_records:&lt;br /&gt;
        df_stat = pd.DataFrame(stat_records)&lt;br /&gt;
        args.stat_csv.parent.mkdir(parents=True, exist_ok=True)&lt;br /&gt;
        df_stat.to_csv(args.stat_csv, index=False)&lt;br /&gt;
&lt;br /&gt;
    print(f&amp;quot;Wrote {len(df_best)} molecules to {args.ligand_csv}&amp;quot;)&lt;br /&gt;
    if stat_records:&lt;br /&gt;
        print(f&amp;quot;Wrote {len(df_stat)} STAT rows to {args.stat_csv}&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
    main()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Rescoring ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env bash&lt;br /&gt;
# ------------------------------------------------------------------&lt;br /&gt;
# Rescoring pipeline — Bash port of the original tcsh script&lt;br /&gt;
# ------------------------------------------------------------------&lt;br /&gt;
# IFS=$&#039;\n\t&#039;               # safe word splitting&lt;br /&gt;
&lt;br /&gt;
# ------------------------- CONFIGURATION --------------------------&lt;br /&gt;
system=&amp;quot;AMPC&amp;quot;             # set your system tag here&lt;br /&gt;
# system=&amp;quot;EGFR&amp;quot;            # uncomment to switch target&lt;br /&gt;
&lt;br /&gt;
outdir=&amp;quot;${system}_rescore_v3.8_v6&amp;quot;&lt;br /&gt;
src_gz=&amp;quot;/home/ak87/Desktop/SMALL_PROJ/DOCK6-NEBIUS/2025-06-TEST/TEST-LINKIN/RUN-TRENTs-COMMENTS/DOCK3/1/output/test.mol2.gz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
db2_dir=&amp;quot;/home/ak87/Desktop/SMALL_PROJ/DOCK6-NEBIUS/2025-06-TEST/AMPC-TESTED/&amp;quot;&lt;br /&gt;
dockfiles_link=&amp;quot;/home/ak87/Desktop/SMALL_PROJ/DOCK6-NEBIUS/2025-06-TEST/TMP2/dock6files&amp;quot;&lt;br /&gt;
&lt;br /&gt;
dock6_bin=&amp;quot;/home/ak87/Programs/dock6-gritukan_merged/bin/dock6&amp;quot;&lt;br /&gt;
separate_py=&amp;quot;/home/ak87/Programs/lc_blazing_fast_separate_mol2_into_smaller_files_AK.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
vdw_defn=&amp;quot;/home/ak87/Programs/dock6-gritukan_merged/parameters/vdw_AMBER_parm94.dock3_7.defn&amp;quot;&lt;br /&gt;
flex_defn=&amp;quot;/home/ak87/Programs/dock6-gritukan_merged/parameters/flex.defn&amp;quot;&lt;br /&gt;
flex_tbl=&amp;quot;/home/ak87/Programs/dock6-gritukan_merged/parameters/flex_drive.tbl&amp;quot;&lt;br /&gt;
# ------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
mkdir -p &amp;quot;$outdir&amp;quot;&lt;br /&gt;
cd &amp;quot;$outdir&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Unzip test.mol2 once&lt;br /&gt;
zcat &amp;quot;$src_gz&amp;quot; &amp;gt; test.mol2&lt;br /&gt;
&lt;br /&gt;
# Link dockfiles directory (overwrite stale link if present)&lt;br /&gt;
ln -sfn &amp;quot;$dockfiles_link&amp;quot; dockfiles&lt;br /&gt;
&lt;br /&gt;
# Fresh output accumulator&lt;br /&gt;
rm -f total_energy.txt&lt;br /&gt;
&lt;br /&gt;
# Split the multi-mol2 file into chunks named split001.mol2 …&lt;br /&gt;
python &amp;quot;$separate_py&amp;quot; test.mol2 split 1&lt;br /&gt;
rm test.mol2&lt;br /&gt;
mol2files=$(ls *.mol2)&lt;br /&gt;
echo $mol2files&lt;br /&gt;
&lt;br /&gt;
# ---------------------- MAIN PROCESSING LOOP ---------------------&lt;br /&gt;
for mol2file in $mol2files; do&lt;br /&gt;
    # Grab ligand-source path (single value expected)&lt;br /&gt;
    # file=$(grep -m1 &amp;quot;Ligand Source File:&amp;quot; &amp;quot;$mol2file&amp;quot; | awk &#039;{print $5}&#039;)&lt;br /&gt;
    ligand_id=$(grep &amp;quot;##########                 Name:&amp;quot; &amp;quot;$mol2file&amp;quot; | awk &#039;{print $3}&#039;)&lt;br /&gt;
    ligand_charge=$(grep &amp;quot;##########        Ligand Charge:&amp;quot; &amp;quot;$mol2file&amp;quot; | awk &#039;{print $4}&#039;)&lt;br /&gt;
    echo &amp;quot;Processing ligand: $ligand_id (charge: $ligand_charge, source: $mol2file)&amp;quot;&lt;br /&gt;
    found_file=false&lt;br /&gt;
    for file in &amp;quot;$db2_dir&amp;quot;/*&amp;quot;$ligand_id&amp;quot;*.db2; do&lt;br /&gt;
        echo &amp;quot;Checking file: $file&amp;quot;&lt;br /&gt;
        this_charge=$(head -n 2 &amp;quot;$file&amp;quot; | tail -n 1 | awk &#039;{print $2}&#039;)&lt;br /&gt;
        echo $ligand_id $this_charge $ligand_charge&lt;br /&gt;
        match=$(python3 -c &amp;quot;import sys; print(&amp;quot;1&amp;quot;) if float(&#039;$ligand_charge&#039;) == float(&#039;$this_charge&#039;) else sprint(&amp;quot;2&amp;quot;)&amp;quot;)&lt;br /&gt;
        if [[ &amp;quot;$match&amp;quot; -eq &amp;quot;1&amp;quot; ]]; then&lt;br /&gt;
            echo &amp;quot;Found source file: $file (charge match: $ligand_charge)&amp;quot;&lt;br /&gt;
            found_file=true&lt;br /&gt;
            break&lt;br /&gt;
        fi&lt;br /&gt;
    done&lt;br /&gt;
    if [[ $found_file == false ]]; then&lt;br /&gt;
        echo &amp;quot;No matching source file found for ligand: $ligand_id (charge: $ligand_charge)&amp;quot;&lt;br /&gt;
        continue&lt;br /&gt;
    fi&lt;br /&gt;
    name=&amp;quot;${mol2file%.*}&amp;quot;          # basename without .mol2&lt;br /&gt;
&lt;br /&gt;
    echo &amp;quot;Processing $mol2file  (source ⇒ $file)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # Build solvation table&lt;br /&gt;
    cat &amp;quot;$file&amp;quot; | grep &amp;quot;^A&amp;quot; \&lt;br /&gt;
        | awk &#039;{printf&amp;quot;%f %f %f %f %f\n&amp;quot;,0.0,$8,0.0,$9,$10}&#039; \&lt;br /&gt;
        &amp;gt; &amp;quot;${name}.solv&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    printf &#039;%s\n&#039; &amp;quot;$name&amp;quot; &amp;gt; molname.txt   # not used later but kept&lt;br /&gt;
&lt;br /&gt;
    # Append TRIPOS solvation section&lt;br /&gt;
    {&lt;br /&gt;
        printf &#039;@&amp;lt;TRIPOS&amp;gt;SOLVATION\n&#039;&lt;br /&gt;
        printf &#039;LIG header\n&#039;&lt;br /&gt;
        cat &amp;quot;${name}.solv&amp;quot;&lt;br /&gt;
    } &amp;gt;&amp;gt; &amp;quot;${name}.mol2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # ------------------- Generate dock.in on-the-fly --------------&lt;br /&gt;
    cat &amp;gt; dock.in &amp;lt;&amp;lt;EOF&lt;br /&gt;
conformer_search_type                                        rigid&lt;br /&gt;
use_internal_energy                                          no&lt;br /&gt;
ligand_atom_file                                             ${name}.mol2&lt;br /&gt;
limit_max_ligands                                            no&lt;br /&gt;
skip_molecule                                                no&lt;br /&gt;
read_mol_solvation                                           yes&lt;br /&gt;
calculate_rmsd                                               no&lt;br /&gt;
use_database_filter                                          no&lt;br /&gt;
orient_ligand                                                no&lt;br /&gt;
bump_filter                                                  no&lt;br /&gt;
score_molecules                                              yes&lt;br /&gt;
contact_score_primary                                        no&lt;br /&gt;
grid_score_primary                                           no&lt;br /&gt;
gist_score_primary                                           no&lt;br /&gt;
multigrid_score_primary                                      no&lt;br /&gt;
dock3.5_score_primary                                        yes&lt;br /&gt;
dock3.5_vdw_score                                            yes&lt;br /&gt;
dock3.5_grd_prefix                                           dockfiles/chem52&lt;br /&gt;
dock3.5_electrostatic_score                                  yes&lt;br /&gt;
dock3.5_ligand_desolvation_score                             volume&lt;br /&gt;
dock3.5_solvent_occlusion_file                               dockfiles/ligand.desolv.heavy&lt;br /&gt;
dock3.5_redistribute_positive_desolvation                    no&lt;br /&gt;
dock3.5_hydrogen_desolvation_grid                            yes&lt;br /&gt;
dock3.5_hydrogen_solvent_occlusion_file                      dockfiles/ligand.desolv.hydrogen&lt;br /&gt;
dock3.5_receptor_desolvation_score                           no&lt;br /&gt;
dock3.5_write_atomic_energy_contrib                          no&lt;br /&gt;
dock3.5_score_vdw_scale                                      1&lt;br /&gt;
dock3.5_score_es_scale                                       1&lt;br /&gt;
minimize_ligand                                              no&lt;br /&gt;
atom_model                                                   all&lt;br /&gt;
vdw_defn_file                                                ${vdw_defn}&lt;br /&gt;
flex_defn_file                                               ${flex_defn}&lt;br /&gt;
flex_drive_file                                              ${flex_tbl}&lt;br /&gt;
ligand_outfile_prefix                                        ${name}_output&lt;br /&gt;
write_orientations                                           no&lt;br /&gt;
num_scored_conformers                                        1&lt;br /&gt;
rank_ligands                                                 no&lt;br /&gt;
EOF&lt;br /&gt;
    # --------------------- Run DOCK and harvest -------------------&lt;br /&gt;
    &amp;quot;$dock6_bin&amp;quot; -i dock.in -o dock.out&lt;br /&gt;
&lt;br /&gt;
    # Pull chemgrid and energy terms into running table&lt;br /&gt;
    echo &amp;quot;$(grep Chemgrid_Score &amp;quot;${name}_output_scored.mol2&amp;quot;) \&lt;br /&gt;
$(grep &#039;Total Energy:&#039; &amp;quot;${name}.mol2&amp;quot;)&amp;quot; \&lt;br /&gt;
        | awk &#039;{print $3, $7}&#039; &amp;gt;&amp;gt; total_energy.txt&lt;br /&gt;
done&lt;br /&gt;
# ------------------------------------------------------------------&lt;br /&gt;
echo &amp;quot;All done — summary energies written to total_energy.txt&amp;quot;(base)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Extended_Search_of_Analogs_via_Bioisosteric_Replacements&amp;diff=15534</id>
		<title>Extended Search of Analogs via Bioisosteric Replacements</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Extended_Search_of_Analogs_via_Bioisosteric_Replacements&amp;diff=15534"/>
		<updated>2023-09-21T06:41:17Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: disclaimer added&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Rationale ===&lt;br /&gt;
Our standard pipeline of searching for analogs (at least as I know it) consists of entering the SMILES of a molecule of interest into all flavors of SmallWorld and Arthor, available in the lab. This procedure has two drawbacks:&lt;br /&gt;
&lt;br /&gt;
# Limited diversity.  SmallWorld&#039;s and Arthor&#039;s measure of distance between the analogs and the parent compound is graph edit distance.&amp;lt;ref&amp;gt;I am probably using slightly wrong terminology here, so be it. You can learn more about it from many marvelous Nextmove&#039;s presentations, like this one: https://www.nextmovesoftware.com/talks/Sayle_SmallWorld_Oxford_202003.pdf&amp;lt;/ref&amp;gt; This metric, while useful and robust, is somewhat different from a chemist&#039;s idea of similarity. For example, the graph edit distance between benzene and cyclohexane is 6. It is quite far, and normally we do not consider such distant analogs. But as a part of a lead-like molecule, these two rings may replace each other in certain cases, without the loss of biological activity of the whole compound. &lt;br /&gt;
# Time investments. Manual search in the databases takes quite some time, especially if you need to find analogs for many compounds. &lt;br /&gt;
&lt;br /&gt;
I wanted to create an automated procedure for analog searching. SmallWorld API is perfectly suitable for that, although sometimes unstable. But to overcome the issue of limited diversity, I decided to use the bioisosteric replacement program, which is currently being developed by Maksim Tsukanov.&lt;br /&gt;
&lt;br /&gt;
=== How it works ===&lt;br /&gt;
The pipeline for the extended analog search works in two steps:&lt;br /&gt;
&lt;br /&gt;
# Create bioisosteres of the original molecule (method created by Maksim Tsukanov, currently under development)&lt;br /&gt;
# Search for their closest analogs in SmallWorld (distance up to 2)&lt;br /&gt;
&lt;br /&gt;
=== How to use ===&lt;br /&gt;
&#039;&#039;&#039;DISCLAIMER&#039;&#039;&#039;: The Bioisostere pipeline is under development, which means its ability to yield results is not assured. SmallWorld API is unstable sometimes. Every request is retried 4 times if unsuccessful, but it may still not return results in certain cases. The exhaustive search for analogs is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
The scripts are currently available on Gimel only. Once the bioisostere program is published, running the whole pipeline on any Linux/MacOS machine will be possible. &lt;br /&gt;
&lt;br /&gt;
All scripts are deposited in &amp;lt;code&amp;gt;~ak87/PROGRAM/ANALOGS&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To look for analogs, do the following:&lt;br /&gt;
&lt;br /&gt;
# Log on to Gimel&lt;br /&gt;
# ssh to any of the newer machines (Gimel5, epyc, n-1-XX...)&lt;br /&gt;
# Prepare a file with &amp;lt;code&amp;gt;SMILES name&amp;lt;/code&amp;gt;, separated by a tab. So far, I&#039;ve tested the pipeline with one compound at a time. In theory, you should be able to enter as many compounds as you like, but the analogs will be mixed up.&lt;br /&gt;
# &amp;lt;code&amp;gt;sh ~ak87/PROGRAM/ANALOGS/analog-search.sh &amp;lt;input.smi&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The run should take about 10-20 minutes, depending on the size of your molecule and its &amp;quot;popularity&amp;quot; in the commercial databases. I deliberately did not make requests to the databases parallel in order to omit overloading the API.  &lt;br /&gt;
&lt;br /&gt;
The list of analogs will be stored in &amp;lt;code&amp;gt;final_analogs.smi&amp;lt;/code&amp;gt;. The format is &amp;lt;code&amp;gt;SMILES ID Distance&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also run any of the stages separately. To perform a bulk SmallWorld search, run sh &amp;lt;code&amp;gt;~ak87/PROGRAM/ANALOGS/bulk-analogs-bioisostere-sw1.sh &amp;lt;input.smi&amp;gt;&amp;lt;/code&amp;gt; Currently, it only searches for the analogs with a distance of up to 2, but you can copy the script and modify it as you like.&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Extended_Search_of_Analogs_via_Bioisosteric_Replacements&amp;diff=15533</id>
		<title>Extended Search of Analogs via Bioisosteric Replacements</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Extended_Search_of_Analogs_via_Bioisosteric_Replacements&amp;diff=15533"/>
		<updated>2023-09-21T06:16:12Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: Created page with &amp;quot;=== Rationale === Our standard pipeline of searching for analogs (at least as I know it) consists of entering the SMILES of a molecule of interest into all flavors of SmallWorld and Arthor, available in the lab. This procedure has two drawbacks:  # Limited diversity.  SmallWorld&amp;#039;s and Arthor&amp;#039;s measure of distance between the analogs and the parent compound is graph edit distance.&amp;lt;ref&amp;gt;I am probably using slightly wrong terminology here, so be it. You can learn more about...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Rationale ===&lt;br /&gt;
Our standard pipeline of searching for analogs (at least as I know it) consists of entering the SMILES of a molecule of interest into all flavors of SmallWorld and Arthor, available in the lab. This procedure has two drawbacks:&lt;br /&gt;
&lt;br /&gt;
# Limited diversity.  SmallWorld&#039;s and Arthor&#039;s measure of distance between the analogs and the parent compound is graph edit distance.&amp;lt;ref&amp;gt;I am probably using slightly wrong terminology here, so be it. You can learn more about it from many marvelous Nextmove&#039;s presentations, like this one: https://www.nextmovesoftware.com/talks/Sayle_SmallWorld_Oxford_202003.pdf&amp;lt;/ref&amp;gt; This metric, while useful and robust, is somewhat different from a chemist&#039;s idea of similarity. For example, the graph edit distance between benzene and cyclohexane is 6. It is quite far, and normally we do not consider such distant analogs. But as a part of a lead-like molecule, these two rings may replace each other in certain cases, without the loss of biological activity of the whole compound. &lt;br /&gt;
# Time investments. Manual search in the databases takes quite some time, especially if you need to find analogs for many compounds. &lt;br /&gt;
&lt;br /&gt;
I wanted to create an automated procedure for analog searching. SmallWorld API is perfectly suitable for that, although sometimes unstable. But to overcome the issue of limited diversity, I decided to use the bioisosteric replacement program, which is currently being developed by Maksim Tsukanov.&lt;br /&gt;
&lt;br /&gt;
=== How it works ===&lt;br /&gt;
The pipeline for the extended analog search works in two steps:&lt;br /&gt;
&lt;br /&gt;
# Create bioisosteres of the original molecule (method created by Maksim Tsukanov, currently under development)&lt;br /&gt;
# Search for their closest analogs in SmallWorld (distance up to 2)&lt;br /&gt;
&lt;br /&gt;
=== How to use ===&lt;br /&gt;
The scripts are currently available on Gimel only. Once the bioisostere program is published, running the whole pipeline on any Linux/MacOS machine will be possible. &lt;br /&gt;
&lt;br /&gt;
All scripts are deposited in &amp;lt;code&amp;gt;~ak87/PROGRAM/ANALOGS&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To look for analogs, do the following:&lt;br /&gt;
&lt;br /&gt;
# Log on to Gimel&lt;br /&gt;
# ssh to any of the newer machines (Gimel5, epyc, n-1-XX...)&lt;br /&gt;
# Prepare a file with &amp;lt;code&amp;gt;SMILES name&amp;lt;/code&amp;gt;, separated by a tab. So far, I&#039;ve tested the pipeline with one compound at a time. In theory, you should be able to enter as many compounds as you like, but the analogs will be mixed up.&lt;br /&gt;
# &amp;lt;code&amp;gt;sh ~ak87/PROGRAM/ANALOGS/analog-search.sh &amp;lt;input.smi&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The run should take about 10-20 minutes, depending on the size of your molecule and its &amp;quot;popularity&amp;quot; in the commercial databases. I deliberately did not make requests to the databases parallel in order to omit overloading the API.  &lt;br /&gt;
&lt;br /&gt;
The list of analogs will be stored in &amp;lt;code&amp;gt;final_analogs.smi&amp;lt;/code&amp;gt;. The format is &amp;lt;code&amp;gt;SMILES ID Distance&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also run any of the stages separately. To perform a bulk SmallWorld search, run sh &amp;lt;code&amp;gt;~ak87/PROGRAM/ANALOGS/bulk-analogs-bioisostere-sw1.sh &amp;lt;input.smi&amp;gt;&amp;lt;/code&amp;gt; Currently, it only searches for the analogs with a distance of up to 2, but you can copy the script and modify it as you like.&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Global_Matching_Sphere_Optimization&amp;diff=15465</id>
		<title>Global Matching Sphere Optimization</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Global_Matching_Sphere_Optimization&amp;diff=15465"/>
		<updated>2023-07-20T00:20:02Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Goal ==&lt;br /&gt;
To optimize your matching sphere (MS) setups getting more enrichment with fewer spheres.&lt;br /&gt;
== Description ==&lt;br /&gt;
The program performs optimization of matching spheres using genetic algorithm. It selects spheres from two sets:&lt;br /&gt;
* heavy atoms of xtal-lig &lt;br /&gt;
* spheres prepared by SPHGEN program&lt;br /&gt;
At each generation, N matching sphere sets are created, containing a maximum of M spheres each. Then retrospective docking is done for each set, and sets are ranked by the &lt;br /&gt;
&lt;br /&gt;
* enrichment (normalized logAUC, see [http://arxiv.org/abs/2210.10905 Ian&#039;s paper]), &lt;br /&gt;
* RMSD of the docked pose to the experimental one. &lt;br /&gt;
&lt;br /&gt;
After that, a quarter of sets &amp;quot;survive&amp;quot; and produce a new generation by direct transfer, mutations, and crossover. This process is repeated until enrichment, RMSD and minimum number of spheres do not change substantially in 10 generations.&lt;br /&gt;
&lt;br /&gt;
The program consists of two main modules:&lt;br /&gt;
* a Python script (&amp;lt;code&amp;gt;juggler.py&amp;lt;/code&amp;gt;) that performs MS generation, optimization, and ranking.&lt;br /&gt;
* a Bash script, that watches created directory structure, runs docking and processes docking results&lt;br /&gt;
== Setup &amp;amp; Running ==&lt;br /&gt;
So far, the program is running on Wynton and Gimel. LMK if you are interested in launching it on other clusters.&lt;br /&gt;
&lt;br /&gt;
The scripts and example config file are in&lt;br /&gt;
&lt;br /&gt;
Wynton&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/wynton/group/bks/soft/juggler&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gimel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/nfs/home/ak87/PROGRAM/juggler&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup ===&lt;br /&gt;
Install [https://wiki.docking.org/index.php?title=SUBDOCK_DOCK3.8 SUBDOCK]&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://github.com/docking-org/SUBDOCK.git&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Install [https://wiki.docking.org/index.php/Docking_Analysis_in_DOCK3.8#top_poses.py top_poses.py]&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://github.com/docking-org/docktop.git&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Preparation ===&lt;br /&gt;
What you need to prepare:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; directory with any tools of your liking (blastermaster, dockopt etc). You will also need &lt;br /&gt;
* &amp;lt;code&amp;gt;rec.pdb&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;rec.crg.pdb&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;xtal-lig.pdb&amp;lt;/code&amp;gt;:  To get RMSD of xtal-lig docked poses to the experimental pose, your xtal-lig.pdb must have correct bond orders and atom valences. You can edit it in Schrodinger and save as &amp;lt;code&amp;gt;xtal-lig.pdb&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ligands.names&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;decoys.names&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;sdi&amp;lt;/code&amp;gt; file with the paths to ligand .tgz files..&lt;br /&gt;
&lt;br /&gt;
Prepare &amp;lt;code&amp;gt;juggler_config.yml&amp;lt;/code&amp;gt; file. Queue type is &amp;lt;code&amp;gt;sge&amp;lt;/code&amp;gt; for Wynton and &amp;lt;code&amp;gt;slurm&amp;lt;/code&amp;gt; for Gimel (newer machines, like gimel5/gimel2/n-1-XXX...). Put the config into an empty directory.&amp;lt;syntaxhighlight lang=&amp;quot;yaml&amp;quot;&amp;gt;&lt;br /&gt;
################################################&lt;br /&gt;
# Paths for your target&lt;br /&gt;
# NSP14 -- example&lt;br /&gt;
receptor_file_path: &amp;quot;/wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/GENERATION/rec.pdb&amp;quot;&lt;br /&gt;
rec_crg_file_path: &amp;quot;/wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/GENERATION/rec.crg.pdb&amp;quot;&lt;br /&gt;
xtal_lig_file_path: &amp;quot;/wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/GENERATION/TMP/xtal-lig-no-ring.pdb&amp;quot;&lt;br /&gt;
dock_files_dir_path: &amp;quot;/wynton/home/irwin/ak87/ak87/UCSF/NSP14/RECEPTOR/TYR368_0.2-ALA353_0.2-GLY333_0.2/ZINC611-XTAL/LSD/ALL-SPH/dockfiles&amp;quot;&lt;br /&gt;
lig_names_file_path: &amp;quot;/wynton/home/irwin/ak87/ak87/UCSF/NSP14/LIGANDS/REPACK/ligands.names&amp;quot;&lt;br /&gt;
dec_names_file_path: &amp;quot;/wynton/home/irwin/ak87/ak87/UCSF/NSP14/LIGANDS/REPACK/decoys.names&amp;quot;&lt;br /&gt;
sdi_file_path: &amp;quot;/wynton/home/irwin/ak87/ak87/UCSF/NSP14/LIGANDS/REPACK/ligands_repack_wynton_sdi&amp;quot;&lt;br /&gt;
&lt;br /&gt;
################################################&lt;br /&gt;
# Executables and running&lt;br /&gt;
dockbase: &amp;quot;/wynton/group/bks/soft/DOCK&amp;quot;&lt;br /&gt;
subdock_bash_file_path: &amp;quot;/wynton/home/irwin/ak87/PROGRAM/SUBDOCK/subdock.bash&amp;quot;&lt;br /&gt;
queue_type: &amp;quot;sge&amp;quot; # &amp;quot;slurm&amp;quot; or &amp;quot;sge&amp;quot;&lt;br /&gt;
top_poses_file: &amp;quot;/wynton/home/irwin/ak87/PROGRAM/docktop/top_poses.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
###############################################&lt;br /&gt;
# Max and min number of spheres&lt;br /&gt;
min_sph: 4 # min is 4&lt;br /&gt;
max_sph: 10 # max is 100&lt;br /&gt;
&lt;br /&gt;
###############################################&lt;br /&gt;
# Parameters for genetic algorithm&lt;br /&gt;
# Don&#039;t need to be adjusted for most purposes&lt;br /&gt;
&lt;br /&gt;
# sample_size: 20 # Please, note that 1/4 of the sample size survives.&lt;br /&gt;
# mutation_prob: 0.01&lt;br /&gt;
# crossover_prob: 0.10&lt;br /&gt;
# go_to_next_gen_prob: 0.30&lt;br /&gt;
# gen_new_prob: 0.01&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
###############################################&lt;br /&gt;
# Parameters for sphere generation&lt;br /&gt;
# Don&#039;t need to be adjusted for most purposes&lt;br /&gt;
&lt;br /&gt;
# # changed to 1.0 for compatability with xtal-lig spheres&lt;br /&gt;
# close_dist: 1.0&lt;br /&gt;
# far_dist: 5.0&lt;br /&gt;
# min_sph: 4&lt;br /&gt;
# max_sph: 10&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running ===&lt;br /&gt;
&lt;br /&gt;
==== Launch Juggler: ====&lt;br /&gt;
Enter a screen environment so your run is not interrupted if you disconnect your SSH session. Then do:&lt;br /&gt;
&lt;br /&gt;
* Wynton&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;source /wynton/group/bks/soft/python_envs/python3.8.5.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python /wynton/group/bks/soft/juggler/juggler-v0.8.py 2&amp;amp;&amp;gt;1 &amp;gt; juggler.log&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Gimel (gimel2/gimel5/n-1-XXX ...)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;source /nfs/soft/ian/python3.8.5.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python /nfs/home/ak87/PROGRAM/juggler/juggler-v0.8.py 2&amp;amp;&amp;gt;1 &amp;gt; juggler.log&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can detach from the screen (Ctrl-A d).&lt;br /&gt;
&lt;br /&gt;
==== Launch docking daemon😈: ====&lt;br /&gt;
Being in the same directory, open a new screen. Launch a docking daemon:&lt;br /&gt;
&lt;br /&gt;
* Wynton&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;source /wynton/group/bks/soft/python_envs/python3.8.5.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sh /wynton/group/bks/soft/juggler/rundockd-v0.8.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Gimel (gimel2/gimel5/n-1-XXX ...)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;source /nfs/soft/ian/python3.8.5.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sh /nfs/home/ak87/PROGRAM/juggler/rundockd-v0.8.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can run other calculations in the meantime, as Juggler will track the task IDs that it launched.&lt;br /&gt;
&lt;br /&gt;
The run will take few hours to ~2 days depending on the number of actives and decoys and the load of Wynton.&lt;br /&gt;
&lt;br /&gt;
=== Processing results ===&lt;br /&gt;
At the end of a run you will get a message that convergence was reachedThe script will print the paths to where three best matching sphere sets are:&lt;br /&gt;
&lt;br /&gt;
* best enrichment&lt;br /&gt;
* best RMSD&lt;br /&gt;
* best balanced metrics (highest enrichment, lowest RMSD and lowest Nsph).&lt;br /&gt;
&lt;br /&gt;
You can use &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; from the listed directories.&lt;br /&gt;
&lt;br /&gt;
You can also track the optimization progress running the following script in your working directory:&lt;br /&gt;
&lt;br /&gt;
* Wynton&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/wynton/group/bks/soft/juggler/plot_all_metrics.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Gimel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/nfs/home/ak87/PROGRAM/juggler/plot_all_metrics.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It produces &amp;lt;code&amp;gt;combined_metrics.png&amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:Combined metrics plot from a GA run.png|thumb|Combined metrics plot from a GA run]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If not converged&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The program will stop after 200 generations if convergence is not reached. In case it takes too long you can stop it any time by pressing Ctrl-C. It doesn&#039;t mean that you have no results, though. Juggler generates &amp;lt;code&amp;gt;combined_metrics.dat&amp;lt;/code&amp;gt; file in the working directory, which contains metrics for all sets explored. It contains the following columns:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Generations Set# NormLogAUC RMSD Nsph Combined_metrics&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can paste its content into Excel, sort by the highest NormLogAUC and pick a MS set of your liking.&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Global_Matching_Sphere_Optimization&amp;diff=15464</id>
		<title>Global Matching Sphere Optimization</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Global_Matching_Sphere_Optimization&amp;diff=15464"/>
		<updated>2023-07-20T00:19:13Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Goal ==&lt;br /&gt;
To optimize your matching sphere (MS) setups getting more enrichment with fewer spheres.&lt;br /&gt;
== Description ==&lt;br /&gt;
The program performs optimization of matching spheres using genetic algorithm. It selects spheres from two sets:&lt;br /&gt;
* heavy atoms of xtal-lig &lt;br /&gt;
* spheres prepared by SPHGEN program&lt;br /&gt;
At each generation, N matching sphere sets are created, containing a maximum of M spheres each. Then retrospective docking is done for each set, and sets are ranked by the &lt;br /&gt;
&lt;br /&gt;
* enrichment (normalized logAUC, see [http://arxiv.org/abs/2210.10905 Ian&#039;s paper]), &lt;br /&gt;
* RMSD of the docked pose to the experimental one. &lt;br /&gt;
&lt;br /&gt;
After that, a quarter of sets &amp;quot;survive&amp;quot; and produce a new generation by direct transfer, mutations, and crossover. This process is repeated until enrichment, RMSD and minimum number of spheres do not change substantially in 10 generations.&lt;br /&gt;
&lt;br /&gt;
The program consists of two main modules:&lt;br /&gt;
* a Python script (&amp;lt;code&amp;gt;juggler.py&amp;lt;/code&amp;gt;) that performs MS generation, optimization, and ranking.&lt;br /&gt;
* a Bash script, that watches created directory structure, runs docking and processes docking results&lt;br /&gt;
== Setup &amp;amp; Running ==&lt;br /&gt;
So far, the program is running on Wynton and Gimel. LMK if you are interested in launching it on other clusters.&lt;br /&gt;
&lt;br /&gt;
The scripts and example config file are in&lt;br /&gt;
&lt;br /&gt;
Wynton&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/wynton/group/bks/soft/juggler&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gimel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/nfs/home/ak87/PROGRAM/juggler&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup ===&lt;br /&gt;
Install [https://wiki.docking.org/index.php?title=SUBDOCK_DOCK3.8 SUBDOCK]&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://github.com/docking-org/SUBDOCK.git&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Install [https://wiki.docking.org/index.php/Docking_Analysis_in_DOCK3.8#top_poses.py top_poses.py]&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://github.com/docking-org/docktop.git&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Preparation ===&lt;br /&gt;
What you need to prepare:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; directory with any tools of your liking (blastermaster, dockopt etc). You will also need &lt;br /&gt;
* &amp;lt;code&amp;gt;rec.pdb&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;rec.crg.pdb&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;xtal-lig.pdb&amp;lt;/code&amp;gt;:  To get RMSD of xtal-lig docked poses to the experimental pose, your xtal-lig.pdb must have correct bond orders and atom valences. You can edit it in Schrodinger and save as &amp;lt;code&amp;gt;xtal-lig.pdb&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ligands.names&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;decoys.names&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;sdi&amp;lt;/code&amp;gt; file with the paths to ligand .tgz files..&lt;br /&gt;
&lt;br /&gt;
Prepare &amp;lt;code&amp;gt;juggler_config.yml&amp;lt;/code&amp;gt; file. Queue type is &amp;lt;code&amp;gt;sge&amp;lt;/code&amp;gt; for Wynton and &amp;lt;code&amp;gt;slurm&amp;lt;/code&amp;gt; for Gimel (newer machines, like gimel5/gimel2/n-1-XXX...). Put the config into an empty directory.&amp;lt;syntaxhighlight lang=&amp;quot;yaml&amp;quot;&amp;gt;&lt;br /&gt;
################################################&lt;br /&gt;
# Paths for your target&lt;br /&gt;
# NSP14 -- example&lt;br /&gt;
receptor_file_path: &amp;quot;/wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/GENERATION/rec.pdb&amp;quot;&lt;br /&gt;
rec_crg_file_path: &amp;quot;/wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/GENERATION/rec.crg.pdb&amp;quot;&lt;br /&gt;
xtal_lig_file_path: &amp;quot;/wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/GENERATION/TMP/xtal-lig-no-ring.pdb&amp;quot;&lt;br /&gt;
dock_files_dir_path: &amp;quot;/wynton/home/irwin/ak87/ak87/UCSF/NSP14/RECEPTOR/TYR368_0.2-ALA353_0.2-GLY333_0.2/ZINC611-XTAL/LSD/ALL-SPH/dockfiles&amp;quot;&lt;br /&gt;
lig_names_file_path: &amp;quot;/wynton/home/irwin/ak87/ak87/UCSF/NSP14/LIGANDS/REPACK/ligands.names&amp;quot;&lt;br /&gt;
dec_names_file_path: &amp;quot;/wynton/home/irwin/ak87/ak87/UCSF/NSP14/LIGANDS/REPACK/decoys.names&amp;quot;&lt;br /&gt;
sdi_file_path: &amp;quot;/wynton/home/irwin/ak87/ak87/UCSF/NSP14/LIGANDS/REPACK/ligands_repack_wynton_sdi&amp;quot;&lt;br /&gt;
&lt;br /&gt;
################################################&lt;br /&gt;
# Executables and running&lt;br /&gt;
dockbase: &amp;quot;/wynton/group/bks/soft/DOCK&amp;quot;&lt;br /&gt;
subdock_bash_file_path: &amp;quot;/wynton/home/irwin/ak87/PROGRAM/SUBDOCK/subdock.bash&amp;quot;&lt;br /&gt;
queue_type: &amp;quot;sge&amp;quot; # &amp;quot;slurm&amp;quot; or &amp;quot;sge&amp;quot;&lt;br /&gt;
top_poses_file: &amp;quot;/wynton/home/irwin/ak87/PROGRAM/docktop/top_poses.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
###############################################&lt;br /&gt;
# Max and min number of spheres&lt;br /&gt;
min_sph: 4 # min is 4&lt;br /&gt;
max_sph: 10 # max is 100&lt;br /&gt;
&lt;br /&gt;
###############################################&lt;br /&gt;
# Parameters for genetic algorithm&lt;br /&gt;
# Don&#039;t need to be adjusted for most purposes&lt;br /&gt;
&lt;br /&gt;
# sample_size: 20 # Please, note that 1/4 of the sample size survives.&lt;br /&gt;
# mutation_prob: 0.01&lt;br /&gt;
# crossover_prob: 0.10&lt;br /&gt;
# go_to_next_gen_prob: 0.30&lt;br /&gt;
# gen_new_prob: 0.01&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
###############################################&lt;br /&gt;
# Parameters for sphere generation&lt;br /&gt;
# Don&#039;t need to be adjusted for most purposes&lt;br /&gt;
&lt;br /&gt;
# # changed to 1.0 for compatability with xtal-lig spheres&lt;br /&gt;
# close_dist: 1.0&lt;br /&gt;
# far_dist: 5.0&lt;br /&gt;
# min_sph: 4&lt;br /&gt;
# max_sph: 10&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running ===&lt;br /&gt;
&lt;br /&gt;
==== Launch Juggler: ====&lt;br /&gt;
Enter a screen environment so your run is not interrupted if you disconnect your SSH session. Then do:&lt;br /&gt;
&lt;br /&gt;
* Wynton&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;source /wynton/group/bks/soft/python_envs/python3.8.5.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python /wynton/group/bks/soft/juggler/juggler-v0.8.py 2&amp;amp;&amp;gt;1 &amp;gt; juggler.log&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Gimel (gimel2/gimel5/n-1-XXX ...)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ource /nfs/soft/ian/python3.8.5.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python /nfs/home/ak87/PROGRAM/juggler/juggler-v0.8.py 2&amp;amp;&amp;gt;1 &amp;gt; juggler.log&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can detach from the screen (Ctrl-A d).&lt;br /&gt;
&lt;br /&gt;
==== Launch docking daemon😈: ====&lt;br /&gt;
Being in the same directory, open a new screen. Launch a docking daemon:&lt;br /&gt;
&lt;br /&gt;
* Wynton&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;source /wynton/group/bks/soft/python_envs/python3.8.5.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sh /wynton/group/bks/soft/juggler/rundockd-v0.8.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Gimel (gimel2/gimel5/n-1-XXX ...)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ource /nfs/soft/ian/python3.8.5.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sh /nfs/home/ak87/PROGRAM/juggler/rundockd-v0.8.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can run other calculations in the meantime, as Juggler will track the task IDs that it launched.&lt;br /&gt;
&lt;br /&gt;
The run will take few hours to ~2 days depending on the number of actives and decoys and the load of Wynton.&lt;br /&gt;
&lt;br /&gt;
=== Processing results ===&lt;br /&gt;
At the end of a run you will get a message that convergence was reachedThe script will print the paths to where three best matching sphere sets are:&lt;br /&gt;
&lt;br /&gt;
* best enrichment&lt;br /&gt;
* best RMSD&lt;br /&gt;
* best balanced metrics (highest enrichment, lowest RMSD and lowest Nsph).&lt;br /&gt;
&lt;br /&gt;
You can use &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; from the listed directories.&lt;br /&gt;
&lt;br /&gt;
You can also track the optimization progress running the following script in your working directory:&lt;br /&gt;
&lt;br /&gt;
* Wynton&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/wynton/group/bks/soft/juggler/plot_all_metrics.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Gimel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/nfs/home/ak87/PROGRAM/juggler/plot_all_metrics.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It produces &amp;lt;code&amp;gt;combined_metrics.png&amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:Combined metrics plot from a GA run.png|thumb|Combined metrics plot from a GA run]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If not converged&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The program will stop after 200 generations if convergence is not reached. In case it takes too long you can stop it any time by pressing Ctrl-C. It doesn&#039;t mean that you have no results, though. Juggler generates &amp;lt;code&amp;gt;combined_metrics.dat&amp;lt;/code&amp;gt; file in the working directory, which contains metrics for all sets explored. It contains the following columns:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Generations Set# NormLogAUC RMSD Nsph Combined_metrics&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can paste its content into Excel, sort by the highest NormLogAUC and pick a MS set of your liking.&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Global_Matching_Sphere_Optimization&amp;diff=15463</id>
		<title>Global Matching Sphere Optimization</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Global_Matching_Sphere_Optimization&amp;diff=15463"/>
		<updated>2023-07-20T00:16:39Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Goal ==&lt;br /&gt;
To optimize your matching sphere (MS) setups getting more enrichment with fewer spheres.&lt;br /&gt;
== Description ==&lt;br /&gt;
The program performs optimization of matching spheres using genetic algorithm. It selects spheres from two sets:&lt;br /&gt;
* heavy atoms of xtal-lig &lt;br /&gt;
* spheres prepared by SPHGEN program&lt;br /&gt;
At each generation, N matching sphere sets are created, containing a maximum of M spheres each. Then retrospective docking is done for each set, and sets are ranked by the &lt;br /&gt;
&lt;br /&gt;
* enrichment (normalized logAUC, see [http://arxiv.org/abs/2210.10905 Ian&#039;s paper]), &lt;br /&gt;
* RMSD of the docked pose to the experimental one. &lt;br /&gt;
&lt;br /&gt;
After that, a quarter of sets &amp;quot;survive&amp;quot; and produce a new generation by direct transfer, mutations, and crossover. This process is repeated until enrichment, RMSD and minimum number of spheres do not change substantially in 10 generations.&lt;br /&gt;
&lt;br /&gt;
The program consists of two main modules:&lt;br /&gt;
* a Python script (&amp;lt;code&amp;gt;juggler.py&amp;lt;/code&amp;gt;) that performs MS generation, optimization, and ranking.&lt;br /&gt;
* a Bash script, that watches created directory structure, runs docking and processes docking results&lt;br /&gt;
== Setup &amp;amp; Running ==&lt;br /&gt;
So far, the program is running on Wynton and Gimel. LMK if you are interested in launching it on other clusters.&lt;br /&gt;
&lt;br /&gt;
The scripts and example config file are in&lt;br /&gt;
&lt;br /&gt;
Wynton&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/wynton/group/bks/soft/juggler&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gimel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/nfs/home/ak87/PROGRAM/juggler&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup ===&lt;br /&gt;
Install [https://wiki.docking.org/index.php?title=SUBDOCK_DOCK3.8 SUBDOCK]&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://github.com/docking-org/SUBDOCK.git&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Install [https://wiki.docking.org/index.php/Docking_Analysis_in_DOCK3.8#top_poses.py top_poses.py]&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://github.com/docking-org/docktop.git&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Preparation ===&lt;br /&gt;
What you need to prepare:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; directory with any tools of your liking (blastermaster, dockopt etc). You will also need &lt;br /&gt;
* &amp;lt;code&amp;gt;rec.pdb&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;rec.crg.pdb&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;xtal-lig.pdb&amp;lt;/code&amp;gt;:  To get RMSD of xtal-lig docked poses to the experimental pose, your xtal-lig.pdb must have correct bond orders and atom valences. You can edit it in Schrodinger and save as &amp;lt;code&amp;gt;xtal-lig.pdb&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ligands.names&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;decoys.names&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;sdi&amp;lt;/code&amp;gt; file with the paths to ligand .tgz files..&lt;br /&gt;
&lt;br /&gt;
Prepare &amp;lt;code&amp;gt;juggler_config.yml&amp;lt;/code&amp;gt; file. Queue type is &amp;lt;code&amp;gt;sge&amp;lt;/code&amp;gt; for Wynton and &amp;lt;code&amp;gt;slurm&amp;lt;/code&amp;gt; for Gimel (newer machines, like gimel5/gimel2/n-1-XXX...). Put the config into an empty directory.&amp;lt;syntaxhighlight lang=&amp;quot;yaml&amp;quot;&amp;gt;&lt;br /&gt;
################################################&lt;br /&gt;
# Paths for your target&lt;br /&gt;
# NSP14 -- example&lt;br /&gt;
receptor_file_path: &amp;quot;/wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/GENERATION/rec.pdb&amp;quot;&lt;br /&gt;
rec_crg_file_path: &amp;quot;/wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/GENERATION/rec.crg.pdb&amp;quot;&lt;br /&gt;
xtal_lig_file_path: &amp;quot;/wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/GENERATION/TMP/xtal-lig-no-ring.pdb&amp;quot;&lt;br /&gt;
dock_files_dir_path: &amp;quot;/wynton/home/irwin/ak87/ak87/UCSF/NSP14/RECEPTOR/TYR368_0.2-ALA353_0.2-GLY333_0.2/ZINC611-XTAL/LSD/ALL-SPH/dockfiles&amp;quot;&lt;br /&gt;
lig_names_file_path: &amp;quot;/wynton/home/irwin/ak87/ak87/UCSF/NSP14/LIGANDS/REPACK/ligands.names&amp;quot;&lt;br /&gt;
dec_names_file_path: &amp;quot;/wynton/home/irwin/ak87/ak87/UCSF/NSP14/LIGANDS/REPACK/decoys.names&amp;quot;&lt;br /&gt;
sdi_file_path: &amp;quot;/wynton/home/irwin/ak87/ak87/UCSF/NSP14/LIGANDS/REPACK/ligands_repack_wynton_sdi&amp;quot;&lt;br /&gt;
&lt;br /&gt;
################################################&lt;br /&gt;
# Executables and running&lt;br /&gt;
dockbase: &amp;quot;/wynton/group/bks/soft/DOCK&amp;quot;&lt;br /&gt;
subdock_bash_file_path: &amp;quot;/wynton/home/irwin/ak87/PROGRAM/SUBDOCK/subdock.bash&amp;quot;&lt;br /&gt;
queue_type: &amp;quot;sge&amp;quot; # &amp;quot;slurm&amp;quot; or &amp;quot;sge&amp;quot;&lt;br /&gt;
top_poses_file: &amp;quot;/wynton/home/irwin/ak87/PROGRAM/docktop/top_poses.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
###############################################&lt;br /&gt;
# Max and min number of spheres&lt;br /&gt;
min_sph: 4 # min is 4&lt;br /&gt;
max_sph: 10 # max is 100&lt;br /&gt;
&lt;br /&gt;
###############################################&lt;br /&gt;
# Parameters for genetic algorithm&lt;br /&gt;
# Don&#039;t need to be adjusted for most purposes&lt;br /&gt;
&lt;br /&gt;
# sample_size: 20 # Please, note that 1/4 of the sample size survives.&lt;br /&gt;
# mutation_prob: 0.01&lt;br /&gt;
# crossover_prob: 0.10&lt;br /&gt;
# go_to_next_gen_prob: 0.30&lt;br /&gt;
# gen_new_prob: 0.01&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
###############################################&lt;br /&gt;
# Parameters for sphere generation&lt;br /&gt;
# Don&#039;t need to be adjusted for most purposes&lt;br /&gt;
&lt;br /&gt;
# # changed to 1.0 for compatability with xtal-lig spheres&lt;br /&gt;
# close_dist: 1.0&lt;br /&gt;
# far_dist: 5.0&lt;br /&gt;
# min_sph: 4&lt;br /&gt;
# max_sph: 10&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running ===&lt;br /&gt;
&lt;br /&gt;
==== Launch Juggler: ====&lt;br /&gt;
Enter a screen environment so your run is not interrupted if you disconnect your SSH session. Then do:&lt;br /&gt;
&lt;br /&gt;
* Wynton&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;source /wynton/group/bks/soft/python_envs/python3.8.5.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python /wynton/group/bks/soft/juggler/juggler-v0.8.py 2&amp;amp;&amp;gt;1 &amp;gt; juggler.log&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Gimel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ource /nfs/soft/ian/python3.8.5.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python /nfs/home/ak87/PROGRAM/juggler/juggler-v0.8.py 2&amp;amp;&amp;gt;1 &amp;gt; juggler.log&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can detach from the screen (Ctrl-A d).&lt;br /&gt;
&lt;br /&gt;
==== Launch docking daemon😈: ====&lt;br /&gt;
Being in the same directory, open a new screen. Launch a docking daemon:&lt;br /&gt;
&lt;br /&gt;
* Wynton&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sh /wynton/group/bks/soft/juggler/rundockd-v0.8.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Gimel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sh /nfs/home/ak87/PROGRAM/juggler/rundockd-v0.8.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can run other calculations in the meantime, as Juggler will track the task IDs that it launched.&lt;br /&gt;
&lt;br /&gt;
The run will take few hours to ~2 days depending on the number of actives and decoys and the load of Wynton.&lt;br /&gt;
&lt;br /&gt;
=== Processing results ===&lt;br /&gt;
At the end of a run you will get a message that convergence was reachedThe script will print the paths to where three best matching sphere sets are:&lt;br /&gt;
&lt;br /&gt;
* best enrichment&lt;br /&gt;
* best RMSD&lt;br /&gt;
* best balanced metrics (highest enrichment, lowest RMSD and lowest Nsph).&lt;br /&gt;
&lt;br /&gt;
You can use &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; from the listed directories.&lt;br /&gt;
&lt;br /&gt;
You can also track the optimization progress running the following script in your working directory:&lt;br /&gt;
&lt;br /&gt;
* Wynton&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/wynton/group/bks/soft/juggler/plot_all_metrics.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Gimel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/nfs/home/ak87/PROGRAM/juggler/plot_all_metrics.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It produces &amp;lt;code&amp;gt;combined_metrics.png&amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:Combined metrics plot from a GA run.png|thumb|Combined metrics plot from a GA run]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If not converged&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The program will stop after 200 generations if convergence is not reached. In case it takes too long you can stop it any time by pressing Ctrl-C. It doesn&#039;t mean that you have no results, though. Juggler generates &amp;lt;code&amp;gt;combined_metrics.dat&amp;lt;/code&amp;gt; file in the working directory, which contains metrics for all sets explored. It contains the following columns:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Generations Set# NormLogAUC RMSD Nsph Combined_metrics&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can paste its content into Excel, sort by the highest NormLogAUC and pick a MS set of your liking.&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Global_Matching_Sphere_Optimization&amp;diff=15462</id>
		<title>Global Matching Sphere Optimization</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Global_Matching_Sphere_Optimization&amp;diff=15462"/>
		<updated>2023-07-17T16:04:16Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: updated to describe the new version of Juggler&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Goal ==&lt;br /&gt;
To optimize your matching sphere (MS) setups getting more enrichment with fewer spheres.&lt;br /&gt;
== Description ==&lt;br /&gt;
The program performs optimization of matching spheres using genetic algorithm. It selects spheres from two sets:&lt;br /&gt;
* heavy atoms of xtal-lig &lt;br /&gt;
* spheres prepared by SPHGEN program&lt;br /&gt;
At each generation, N matching sphere sets are created, containing a maximum of M spheres each. Then retrospective docking is done for each set, and sets are ranked by the &lt;br /&gt;
&lt;br /&gt;
* enrichment (normalized logAUC, see [http://arxiv.org/abs/2210.10905 Ian&#039;s paper]), &lt;br /&gt;
* RMSD of the docked pose to the experimental one. &lt;br /&gt;
&lt;br /&gt;
After that, a quarter of sets &amp;quot;survive&amp;quot; and produce a new generation by direct transfer, mutations, and crossover. This process is repeated until enrichment, RMSD and minimum number of spheres do not change substantially in 10 generations.&lt;br /&gt;
&lt;br /&gt;
The program consists of two main modules:&lt;br /&gt;
* a Python script (&amp;lt;code&amp;gt;juggler.py&amp;lt;/code&amp;gt;) that performs MS generation, optimization, and ranking.&lt;br /&gt;
* a Bash script, that watches created directory structure, runs docking and processes docking results&lt;br /&gt;
== Setup &amp;amp; Running ==&lt;br /&gt;
So far, the program is running on Wynton and Gimel. LMK if you are interested in launching it on other clusters.&lt;br /&gt;
&lt;br /&gt;
The scripts and example config file are in&lt;br /&gt;
&lt;br /&gt;
Wynton&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/wynton/group/bks/soft/juggler&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gimel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/nfs/home/ak87/PROGRAM/juggler&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup ===&lt;br /&gt;
Install [https://wiki.docking.org/index.php?title=SUBDOCK_DOCK3.8 SUBDOCK]&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://github.com/docking-org/SUBDOCK.git&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Install [https://wiki.docking.org/index.php/Docking_Analysis_in_DOCK3.8#top_poses.py top_poses.py]&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://github.com/docking-org/docktop.git&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Preparation ===&lt;br /&gt;
What you need to prepare:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; directory with any tools of your liking (blastermaster, dockopt etc). You will also need &lt;br /&gt;
* &amp;lt;code&amp;gt;rec.pdb&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;rec.crg.pdb&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;xtal-lig.pdb&amp;lt;/code&amp;gt;:  To get RMSD of xtal-lig docked poses to the experimental pose, your xtal-lig.pdb must have correct bond orders and atom valences. You can edit it in Schrodinger and save as &amp;lt;code&amp;gt;xtal-lig.pdb&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ligands.names&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;decoys.names&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;sdi&amp;lt;/code&amp;gt; file with the paths to ligand .tgz files..&lt;br /&gt;
&lt;br /&gt;
Prepare &amp;lt;code&amp;gt;juggler_config.yml&amp;lt;/code&amp;gt; file. Queue type is &amp;lt;code&amp;gt;sge&amp;lt;/code&amp;gt; for Wynton and &amp;lt;code&amp;gt;slurm&amp;lt;/code&amp;gt; for Gimel (newer machines, like gimel5/gimel2/n-1-XXX...). Put the config into an empty directory.&amp;lt;syntaxhighlight lang=&amp;quot;yaml&amp;quot;&amp;gt;&lt;br /&gt;
################################################&lt;br /&gt;
# Paths for your target&lt;br /&gt;
# NSP14 -- example&lt;br /&gt;
receptor_file_path: &amp;quot;/wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/GENERATION/rec.pdb&amp;quot;&lt;br /&gt;
rec_crg_file_path: &amp;quot;/wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/GENERATION/rec.crg.pdb&amp;quot;&lt;br /&gt;
xtal_lig_file_path: &amp;quot;/wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/GENERATION/TMP/xtal-lig-no-ring.pdb&amp;quot;&lt;br /&gt;
dock_files_dir_path: &amp;quot;/wynton/home/irwin/ak87/ak87/UCSF/NSP14/RECEPTOR/TYR368_0.2-ALA353_0.2-GLY333_0.2/ZINC611-XTAL/LSD/ALL-SPH/dockfiles&amp;quot;&lt;br /&gt;
lig_names_file_path: &amp;quot;/wynton/home/irwin/ak87/ak87/UCSF/NSP14/LIGANDS/REPACK/ligands.names&amp;quot;&lt;br /&gt;
dec_names_file_path: &amp;quot;/wynton/home/irwin/ak87/ak87/UCSF/NSP14/LIGANDS/REPACK/decoys.names&amp;quot;&lt;br /&gt;
sdi_file_path: &amp;quot;/wynton/home/irwin/ak87/ak87/UCSF/NSP14/LIGANDS/REPACK/ligands_repack_wynton_sdi&amp;quot;&lt;br /&gt;
&lt;br /&gt;
################################################&lt;br /&gt;
# Executables and running&lt;br /&gt;
dockbase: &amp;quot;/wynton/group/bks/soft/DOCK&amp;quot;&lt;br /&gt;
subdock_bash_file_path: &amp;quot;/wynton/home/irwin/ak87/PROGRAM/SUBDOCK/subdock.bash&amp;quot;&lt;br /&gt;
queue_type: &amp;quot;sge&amp;quot; # &amp;quot;slurm&amp;quot; or &amp;quot;sge&amp;quot;&lt;br /&gt;
top_poses_file: &amp;quot;/wynton/home/irwin/ak87/PROGRAM/docktop/top_poses.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
###############################################&lt;br /&gt;
# Max and min number of spheres&lt;br /&gt;
min_sph: 4 # min is 4&lt;br /&gt;
max_sph: 10 # max is 100&lt;br /&gt;
&lt;br /&gt;
###############################################&lt;br /&gt;
# Parameters for genetic algorithm&lt;br /&gt;
# Don&#039;t need to be adjusted for most purposes&lt;br /&gt;
&lt;br /&gt;
# sample_size: 20 # Please, note that 1/4 of the sample size survives.&lt;br /&gt;
# mutation_prob: 0.01&lt;br /&gt;
# crossover_prob: 0.10&lt;br /&gt;
# go_to_next_gen_prob: 0.30&lt;br /&gt;
# gen_new_prob: 0.01&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
###############################################&lt;br /&gt;
# Parameters for sphere generation&lt;br /&gt;
# Don&#039;t need to be adjusted for most purposes&lt;br /&gt;
&lt;br /&gt;
# # changed to 1.0 for compatability with xtal-lig spheres&lt;br /&gt;
# close_dist: 1.0&lt;br /&gt;
# far_dist: 5.0&lt;br /&gt;
# min_sph: 4&lt;br /&gt;
# max_sph: 10&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running ===&lt;br /&gt;
&lt;br /&gt;
==== Launch Juggler: ====&lt;br /&gt;
Enter a screen environment so your run is not interrupted if you disconnect your SSH session. Then do:&lt;br /&gt;
&lt;br /&gt;
* Wynton&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;source /wynton/group/bks/soft/python_envs/python3.8.5.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python /wynton/group/bks/soft/juggler/juggler-v0.8.py 2&amp;amp;&amp;gt;1 &amp;gt; juggler.log&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Gimel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;source /wynton/group/bks/soft/python_envs/python3.8.5.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python /nfs/home/ak87/PROGRAM/juggler/juggler-v0.8.py 2&amp;amp;&amp;gt;1 &amp;gt; juggler.log&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can detach from the screen (Ctrl-A d).&lt;br /&gt;
&lt;br /&gt;
==== Launch docking daemon😈: ====&lt;br /&gt;
Being in the same directory, open a new screen. Launch a docking daemon:&lt;br /&gt;
&lt;br /&gt;
* Wynton&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sh /wynton/group/bks/soft/juggler/rundockd-v0.8.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Gimel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sh /nfs/home/ak87/PROGRAM/juggler/rundockd-v0.8.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can run other calculations in the meantime, as Juggler will track the task IDs that it launched.&lt;br /&gt;
&lt;br /&gt;
The run will take few hours to ~2 days depending on the number of actives and decoys and the load of Wynton.&lt;br /&gt;
&lt;br /&gt;
=== Processing results ===&lt;br /&gt;
At the end of a run you will get a message that convergence was reachedThe script will print the paths to where three best matching sphere sets are:&lt;br /&gt;
&lt;br /&gt;
* best enrichment&lt;br /&gt;
* best RMSD&lt;br /&gt;
* best balanced metrics (highest enrichment, lowest RMSD and lowest Nsph).&lt;br /&gt;
&lt;br /&gt;
You can use &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; from the listed directories.&lt;br /&gt;
&lt;br /&gt;
You can also track the optimization progress running the following script in your working directory:&lt;br /&gt;
&lt;br /&gt;
* Wynton&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/wynton/group/bks/soft/juggler/plot_all_metrics.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Gimel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/nfs/home/ak87/PROGRAM/juggler/plot_all_metrics.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It produces &amp;lt;code&amp;gt;combined_metrics.png&amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:Combined metrics plot from a GA run.png|thumb|Combined metrics plot from a GA run]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If not converged&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The program will stop after 200 generations if convergence is not reached. In case it takes too long you can stop it any time by pressing Ctrl-C. It doesn&#039;t mean that you have no results, though. Juggler generates &amp;lt;code&amp;gt;combined_metrics.dat&amp;lt;/code&amp;gt; file in the working directory, which contains metrics for all sets explored. It contains the following columns:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Generations Set# NormLogAUC RMSD Nsph Combined_metrics&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can paste its content into Excel, sort by the highest NormLogAUC and pick a MS set of your liking.&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Membrane_Modeling&amp;diff=15413</id>
		<title>Membrane Modeling</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Membrane_Modeling&amp;diff=15413"/>
		<updated>2023-05-31T21:36:51Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Written by Stefan Gahbauer, 2019/11/03&lt;br /&gt;
&lt;br /&gt;
In order to account for ligand desolvation and electrostatic interactions in the low-dielectric environment of the hydrophobic membrane core, a lipid-bilayer is generated around the target receptor and included in the docking score grid generation.&lt;br /&gt;
Aiming at a fast, robust and computationally effective equilibration of the lipid bilayer around the embedded transmembrane receptor, coarse-grained (CG) molecular dynamics (MD) simulations and (if needed) subsequent atomistic simulations are employed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Required software and datasets =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gromacs&#039;&#039;&#039; (v5 or newer) - Molecular Dynamics software package (http://manual.gromacs.org/)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CHARMM36m force field&#039;&#039;&#039; (http://mackerell.umaryland.edu/charmm_ff.shtml)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MARTINI&#039;&#039;&#039; Coarse-grained force field parameters(http://cgmartini.nl/)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DSSP&#039;&#039;&#039; - Secondary Structure assignment (https://swift.cmbi.umcn.nl/gv/dssp/ , https://anaconda.org/salilab/dssp)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;martinize.py&#039;&#039;&#039; - Coarse-graining atomistic protein structures (http://cgmartini.nl/index.php/tools2/proteins-and-bilayers)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;insane.py&#039;&#039;&#039; - INSerting proteins in coarse-grained MembrANE (http://cgmartini.nl/index.php/tools2/proteins-and-bilayers)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;initram.sh&#039;&#039;&#039; and &#039;&#039;&#039;backward.py&#039;&#039;&#039; - Conversion of coarse-grained system to atomistic resolution (http://cgmartini.nl/index.php/tools2/resolution-transformation)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 1) Setting up the coarse-grained system =&lt;br /&gt;
&lt;br /&gt;
This is automated in the script:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/0001-prepare-protein-CG-membrane.sh&lt;br /&gt;
&lt;br /&gt;
== 1.1) Prepare your files ==&lt;br /&gt;
&lt;br /&gt;
Copy the script above to your working directory.&lt;br /&gt;
&lt;br /&gt;
Copy your rec.pdb to your working directory.&lt;br /&gt;
&lt;br /&gt;
If your rec.pdb has gaps, e.g. unresolved loops between transmembrane helices in case of GPCRs, try to model missing residues.&lt;br /&gt;
&lt;br /&gt;
One way is to use MODELLER following https://salilab.org/modeller/wiki/Missing%20residues.&lt;br /&gt;
&lt;br /&gt;
Corresponding input scripts for modeller can be found in:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/modeller&lt;br /&gt;
&lt;br /&gt;
== 1.2) Run the script ==&lt;br /&gt;
&lt;br /&gt;
Login to gimel2.&lt;br /&gt;
&lt;br /&gt;
./0001-prepare-protein-CG-membrane.sh&lt;br /&gt;
&lt;br /&gt;
The script reads rec.pdb and copies all other required files from &lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/gromacs&lt;br /&gt;
&lt;br /&gt;
=== Workflow ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;a.&#039;&#039;&#039; Generate CHARMM36m force field parameters of your protein in a Gromacs-readable format. &lt;br /&gt;
&lt;br /&gt;
Used tool: gmx pdb2gmx &lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;pdb2gmx&#039;&#039; directory&lt;br /&gt;
&lt;br /&gt;
-conf.gro / conf.pdb - Gromacs coordinate file&lt;br /&gt;
&lt;br /&gt;
-topol.top / Protein-atomistic.itp - Gromacs topology file, i.e. force field description of your input structure&lt;br /&gt;
&lt;br /&gt;
-posre.itp - Position restraints for heavy atoms of atomistic protein strucutre.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;b.&#039;&#039;&#039; Build coarse-grained structure&lt;br /&gt;
&lt;br /&gt;
Used tool: martinize.py&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-chain_.ssd - Output from the DSSP program that is called by martinize.py&lt;br /&gt;
&lt;br /&gt;
-prot-cg.pdb - Coarse-grained protein structure&lt;br /&gt;
&lt;br /&gt;
-prot-cg.top - Coarse-grained Martini topology of system&lt;br /&gt;
&lt;br /&gt;
-Protein.itp - Coarse-grained Martini description of Protein structure&lt;br /&gt;
&lt;br /&gt;
-prot-rot.pdb - Coarse-grained protein structure aligned along z-axis of the simulation box according to the proteins first principal component axis. This ensures the correct placement of the protein during membrane preparation. &#039;&#039;&#039;You may have to adjust the orientation of your input structure prior to membrane modeling.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;c.&#039;&#039;&#039; Build coarse-grained membrane&lt;br /&gt;
&lt;br /&gt;
Used tool: insane.py&lt;br /&gt;
&lt;br /&gt;
Here, a lipid bilayer will be created around the protein structure (in the x/y-plane) and water will be added to the system. The default box shape is rectangular and the size is set to x,y=10nm, z=11nm. This can be changed in the ./insane.py command line. The default lipid type is POPC, you can change that to arbitrary lipid compositions using the -l and -u options of of insane.py.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-out.top / topol-cg.top - Topology of coarse-grained system&lt;br /&gt;
&lt;br /&gt;
-cg-membrane.gro/.pdb - Coarse-grained system coordinates. &#039;&#039;&#039;Carefully inspect and visualize the cg-membrane.pdb.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use PyMOL to check if you&#039;re protein is embedded correctly in the lipid bilayer.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 2) Simulating the coarse-grained system =&lt;br /&gt;
&lt;br /&gt;
This is automated in the script:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/0002-run-CG-Minimization-and-MD.sh&lt;br /&gt;
&lt;br /&gt;
== 2.1) Run the script ==&lt;br /&gt;
&lt;br /&gt;
Copy the script above to your working directory.&lt;br /&gt;
&lt;br /&gt;
./0002-run-CG-Minimization-and-MD.sh&lt;br /&gt;
&lt;br /&gt;
=== Workflow ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;a.&#039;&#039;&#039; Minimize coarse-grained system&lt;br /&gt;
&lt;br /&gt;
Used tools: gmx grompp , gmx mdrun&lt;br /&gt;
&lt;br /&gt;
gmx grompp generates a single .tpr file that contains all information necessary for running a MD simulation or minimization using gmx mdrun.&lt;br /&gt;
&lt;br /&gt;
Minimization parameters are provided in martini_new-rf_min.mdp. The system will be minimized in 500 steps using steepest descent. The protein structure will be frozen during minimization.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-min.tpr - MD run input file&lt;br /&gt;
&lt;br /&gt;
-min.log - Output log file from minimization&lt;br /&gt;
&lt;br /&gt;
-min.trr - Minimization trajectory&lt;br /&gt;
&lt;br /&gt;
-min.gro - Minimized system coordinates&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;b.&#039;&#039;&#039; Simulate coarse-grained system&lt;br /&gt;
&lt;br /&gt;
MD simulation parameters are provided in martini_v2.x_new-rf.mdp. Strong position restraints are applied on the protein structure during the simulation. The system will be simulated for 50ns.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-md.tpr - MD run input file&lt;br /&gt;
&lt;br /&gt;
-md.log - Output log file from simulation&lt;br /&gt;
&lt;br /&gt;
-md.trr - lossless trajectory of simulation&lt;br /&gt;
&lt;br /&gt;
-md.xtc - coordinates of simulation trajectory&lt;br /&gt;
&lt;br /&gt;
-md.gro - coordinates of final simulation snapshot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The simulation will run for roughly 3 hours.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 3) Converting coarse-grained system to atomistic resolution and select lipid atoms for grid generation =&lt;br /&gt;
&lt;br /&gt;
This is automated in the script:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/0003-backmap-and-lpd-selection.sh&lt;br /&gt;
&lt;br /&gt;
== 3.1) Run the script ==&lt;br /&gt;
&lt;br /&gt;
Copy the script above to your working directory.&lt;br /&gt;
&lt;br /&gt;
./0003-backmap-and-lpd-selection.sh&lt;br /&gt;
&lt;br /&gt;
=== Workflow ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;a.&#039;&#039;&#039; Backmapping from coarse-grained to atomistic&lt;br /&gt;
&lt;br /&gt;
Used tool: gmx trjconv, initram.sh&lt;br /&gt;
&lt;br /&gt;
gmx trjconv can perform a variety of conversions of MD trajectory, e.g. making molecules broken over the periodic boundary conditions whole again. &lt;br /&gt;
&lt;br /&gt;
initram.sh calls the backward.py program which performs the backmapping of input coarse-grained to atomistic systems, and performs a small series of short minimizations and simulations to relax the backmapped system.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;backmap&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-0-backmapped.gro / projected.gro - initial backmapped coordinates&lt;br /&gt;
&lt;br /&gt;
-backmapped.top - Topology of atomistic system&lt;br /&gt;
&lt;br /&gt;
-1-EM*/2-EM* - Output from minimizations &lt;br /&gt;
&lt;br /&gt;
-3-mdpr*/4-mdpr*/5-mdpr*/6-mdpr* - Output from simulations&lt;br /&gt;
&lt;br /&gt;
-backmapped.gro - Coordinates of final backmapped and relaxed system&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This may need a few attempts to work all the way through. There is a while-loop that only stops until all relaxation steps have finished.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;b.&#039;&#039;&#039; Replacing backmapped protein with initial atomistic protein structure&lt;br /&gt;
&lt;br /&gt;
Used tool: PyMOL script align.pml&lt;br /&gt;
&lt;br /&gt;
The pymol script will align the initial &amp;quot;Gromacs&amp;quot;-protein structure (conf.pdb) onto the backmapped structure and combine the fitted protein coordinates with the coordinates of the lipid and solvent environment.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;backmap/prepare_AA_system&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-conf-fitted.pdb - Fitted initial protein structure&lt;br /&gt;
&lt;br /&gt;
-backmapped-environment.pdb - All membrane and water coordinates&lt;br /&gt;
&lt;br /&gt;
-fitted_system.pdb - Complete system containing fitted protein and environment coordinates&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure that fitted_system.pdb has the same number of coordinates as backmapped-mol.pdb.&#039;&#039;&#039; If there is a discrepancy there might be an issue with the PyMOL version you&#039;re using to run align.pml. Using PyMOL v2 or newer seems to avoid any issues. You can also generate backmapped-environment.pdb manually by taking all POPC and Water cooridnates from backmapped-mol.pdb.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;c.&#039;&#039;&#039; Run minimizations of atomistic system&lt;br /&gt;
&lt;br /&gt;
Used tools: gmx grompp, gmx mdrun&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;backmap/prepare_AA_system&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
Tow minimizations will be calculated. &lt;br /&gt;
&lt;br /&gt;
1) Minimization with frozen protein coordinates: 1,500 steps steepest descent (min_freeze.mdp).&lt;br /&gt;
&lt;br /&gt;
-min_freeze* - Output files of first minimization&lt;br /&gt;
&lt;br /&gt;
2) Minimization of full system: 500 steps (min.mdp).&lt;br /&gt;
&lt;br /&gt;
-min* - Output files of second minimization&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;d.&#039;&#039;&#039; Select lipid atoms for DOCK grid generation&lt;br /&gt;
&lt;br /&gt;
Used tools: PyMOL script prepare.pml&lt;br /&gt;
&lt;br /&gt;
This will select carbon and hydrogen atoms of the hydrophobic lipid tail segments in a radius of 1.7 nm around the protein and assign them to the atom type &amp;quot;LPD&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You need to provide the rec.pdb to want to use for docking (potentially with missing loops) at that step as xtal-prot.pdb&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;backmap/prepare_AA_system/prepare_min&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-shell-LPD.pdb - all LPD atoms selected for grid generation&lt;br /&gt;
&lt;br /&gt;
Add these coordinates to your docking protein structure and provide a amb.crg.oxt file adding&lt;br /&gt;
&lt;br /&gt;
C     lpd        0.000     LIPID SPHERE&lt;br /&gt;
&lt;br /&gt;
Now you can run blastermaster.&lt;br /&gt;
&lt;br /&gt;
= Membrane modelling in Schrodinger =&lt;br /&gt;
Written by Andrii Kyrylchuk, 2022/04/20&lt;br /&gt;
&lt;br /&gt;
== MD of protein and membrane ==&lt;br /&gt;
Import structure &#039;&#039;&#039;without&#039;&#039;&#039; ligand, use &amp;lt;u&amp;gt;Preparation wizard&amp;lt;/u&amp;gt; as described in &amp;quot;Code for Controls...&amp;quot;  to model missing loops and capping.&lt;br /&gt;
&lt;br /&gt;
Then open &amp;lt;u&amp;gt;System Builder&amp;lt;/u&amp;gt;, click &amp;lt;code&amp;gt;Setup membrane&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to the website https://opm.phar.umich.edu/proteins/ and find your protein. Copy residue numbers from the bottom of the page to the field &amp;lt;code&amp;gt;Transmembrane atoms...&amp;lt;/code&amp;gt;. The format is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;res.num 76-97,112-136,141,...&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click &amp;lt;code&amp;gt;Place Automatically&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt;. Then click &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt;. Examine lipids and solvent after run completes.&lt;br /&gt;
&lt;br /&gt;
Then use &amp;lt;u&amp;gt;Molecular Dynamics&amp;lt;/u&amp;gt; menu to set up the calculation. Select prepared system, click &amp;lt;code&amp;gt;Load&amp;lt;/code&amp;gt; on top of the menu. Put simulation time of 5 ns, &amp;lt;code&amp;gt;Advanced Options&amp;lt;/code&amp;gt; -- &amp;lt;code&amp;gt;Restraints&amp;lt;/code&amp;gt; -- &amp;lt;code&amp;gt;Add.&amp;lt;/code&amp;gt; Select protein, and put &amp;lt;code&amp;gt;Force Constant&amp;lt;/code&amp;gt; of 100, click &amp;lt;code&amp;gt;Apply&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;OK.&amp;lt;/code&amp;gt; Then click down arrow left of the &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt; button in the parent window and click &amp;lt;code&amp;gt;Write&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;NOTE&#039;&#039;&#039;: In my experience, restrained MD runs with NgPT in Schrodinger often fail with the following message:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&#039;&#039;Allowed momentum exceeded on 17 particles.&#039;&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This seems to be related to the interference of restraints and the ensemble, as no such error is observed if no restraints are imposed, or if NVT ensemble is used. Still, NgPT ensemble is important for correct membrane sampling, because simulations at NVT long enough to permit membrane relaxation, lead to the smearing of the lipid bilayer and the formation of empty space.&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;If the mentioned problem occurs, import the last coordinates of the run (*-out.cms) into Maestro, open Minimization menu, load the structure from the workspace, and apply restraints on lipid and protein (force restraint of 10 is usually enough). Then run a minimization for 100 ps, and try to run NgPT MD starting from the optimized structure.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; NPT ensemble can safely be used instead of NgPT&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Copy the project folder (desmond_md_job_X) to gimel, login to &amp;lt;u&amp;gt;gimel5&amp;lt;/u&amp;gt;, edit desmond_md_job_X.sh: delete &amp;lt;code&amp;gt;-lic DESMOND_GPGPU:16&amp;lt;/code&amp;gt; and insert &amp;lt;code&amp;gt;-HOST gimel5.gpu&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;gimel5.heavygpu&amp;lt;/code&amp;gt;). Export &amp;lt;code&amp;gt;$SCHRODINGER&amp;lt;/code&amp;gt; variable:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SCHRODINGER=/nfs/soft2/schrodinger/2023-3/&amp;lt;/code&amp;gt; (or a newer version)&lt;br /&gt;
&lt;br /&gt;
Run .sh file, and your task will be submitted to a queue. For my system it took 1.5 hr to complete.&lt;br /&gt;
&lt;br /&gt;
Download the project folder to your PC, open Maestro, click &amp;lt;code&amp;gt;Import  structure&amp;lt;/code&amp;gt; and open &amp;lt;code&amp;gt;-out.cms&amp;lt;/code&amp;gt;, click on &amp;lt;code&amp;gt;T&amp;lt;/code&amp;gt; icon at the new entry in project table and click &amp;lt;code&amp;gt;Display Trajectory Snapshots&amp;lt;/code&amp;gt;. Select the last one, click &amp;lt;code&amp;gt;Display&amp;lt;/code&amp;gt; and check if the protein did not change position during MD run, then click &amp;lt;code&amp;gt;Export&amp;lt;/code&amp;gt;, to Project Table, Frames Selected only. You will get a new entry in the Project Table. Export it to a &amp;lt;code&amp;gt;.pdb&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
== Preparation of the structure for Blastermaster ==&lt;br /&gt;
Use &amp;lt;code&amp;gt;prepare.pml&amp;lt;/code&amp;gt; script. You need to provide the &amp;lt;code&amp;gt;rec.pdb&amp;lt;/code&amp;gt; to want to use for docking (potentially with missing loops) at that step as &amp;lt;code&amp;gt;xtal-prot.pdb&amp;lt;/code&amp;gt;. Rename MD system as &amp;lt;code&amp;gt;last-mol.pdb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;pymol -qc last-mol.pdb xtal-prot.pdb prepare.pml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
align last-mol, xtal-prot&lt;br /&gt;
&lt;br /&gt;
remove ////SPC&lt;br /&gt;
&lt;br /&gt;
create MEM, ////POPC&lt;br /&gt;
&lt;br /&gt;
# these atom numbers do not exist in POPC or DPPC&lt;br /&gt;
# therefore, we do not remove protons from the lipid&lt;br /&gt;
# structure to make more spheres. Uncomment these&lt;br /&gt;
# lines and change to proper H numbers if needed.&lt;br /&gt;
#remove /MEM////HS&lt;br /&gt;
#remove /MEM////HX&lt;br /&gt;
#remove /MEM////HY&lt;br /&gt;
#remove /MEM////H*B&lt;br /&gt;
#remove /MEM////H*A&lt;br /&gt;
#remove /MEM////H*C&lt;br /&gt;
&lt;br /&gt;
remove /MEM////C1&lt;br /&gt;
remove /MEM////C2&lt;br /&gt;
remove /MEM////C3&lt;br /&gt;
remove /MEM////C11&lt;br /&gt;
remove /MEM////C12&lt;br /&gt;
remove /MEM////C13&lt;br /&gt;
remove /MEM////C14&lt;br /&gt;
remove /MEM////C15&lt;br /&gt;
&lt;br /&gt;
create MEM_C, /MEM////*C* | /MEM////H*R | /MEM////H*S | /MEM////H*T | /MEM////H*X | /MEM////H*Y | /MEM////H*Z&lt;br /&gt;
&lt;br /&gt;
create shell, MEM_C within 20 of xtal-prot&lt;br /&gt;
&lt;br /&gt;
set retain_order, 1&lt;br /&gt;
&lt;br /&gt;
save shell.pdb, shell&lt;br /&gt;
&lt;br /&gt;
alter shell, resn=&#039;LPD&#039;&lt;br /&gt;
alter shell, name=&#039;C&#039;&lt;br /&gt;
alter shell, chain=&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
rebuild&lt;br /&gt;
&lt;br /&gt;
save shell-LPD.pdb, shell&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Preparation of grids with thinspheres ==&lt;br /&gt;
Prepare grids with thinspheres for the protein without lipid as described in https://wiki.docking.org/index.php/How_to_do_parameter_scanning&lt;br /&gt;
&lt;br /&gt;
Create an empty directory and put &amp;lt;code&amp;gt;shell-LPD.pdb&amp;lt;/code&amp;gt; there. Then run the following script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sh blast-membrane-thinsph-scan.sh {path to the collection of &amp;quot;es_ld_thin_sph_rad_X.X&amp;quot; directories} {path to the dir with original working and dockfiles directories}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script runs qnifft and solvmap for each &amp;lt;code&amp;gt;es_ld_thin_sph_rad_X.X&amp;lt;/code&amp;gt; directory, and then uses the second script of parameter scanning protocol to combine files into &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; directories.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important! LOOK AT YOUR GRIDS! Desolvation -- larger solvation where water is. Electrostatics -- no electrostatics in the lipid region. vdW -- no vdW in the lipid region.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# a script to prepare a protein with the lipid membrane for DOCK with thinsphere scan&lt;br /&gt;
# PREREQ -- run first step of https://wiki.docking.org/index.php/How_to_do_parameter_scanning (new_0001_generate_ES_LD_generation.py )&lt;br /&gt;
# first argument -- path to the directory where dirs &amp;quot;es_ld_thin_sph_rad_X.X&amp;quot; are stored. &lt;br /&gt;
# second argument -- path to the dir with original working and dockfiles&lt;br /&gt;
# run in a new directory with shell-LPD.pdb&lt;br /&gt;
&lt;br /&gt;
run_once () {&lt;br /&gt;
# mkdir  add_membrane&lt;br /&gt;
# Run qnifft for electrostatic grids&lt;br /&gt;
# cp $blastfiles_membrane/shell-LPD.pdb&lt;br /&gt;
# delete all fields except HETATM from shell-LPD.pdb&lt;br /&gt;
cp $curr_dir/shell-LPD.pdb .&lt;br /&gt;
sed -ir &#039;/^CRYST1/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^CONECT/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^END/d&#039; shell-LPD.pdb&lt;br /&gt;
cp $blastermaster_Prot/working/rec.crg.pdb .&lt;br /&gt;
#cp $blastermaster_Prot/working/lowdielectric.sph.pdb # (if wanted, if you run a  parameter scan, be sure to use the correct spheres!)&lt;br /&gt;
#cp -r $blastermaster_Prot/dockfiles .&lt;br /&gt;
#cp -r $blastermaster_Prot/INDOCK .&lt;br /&gt;
mv rec.crg.pdb  rec.crg.solo.pdb&lt;br /&gt;
cat rec.crg.solo.pdb shell-LPD.pdb  &amp;gt; receptor.crg.lowdielectric.pdb&lt;br /&gt;
# extracting SPH lines from receptor&lt;br /&gt;
number=$(grep -n  SPH  $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb | head -n 1 | awk -F &amp;quot;:&amp;quot; &#039;{print $1}&#039;)&lt;br /&gt;
tail --lines=+$number $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb &amp;gt;&amp;gt; receptor.crg.lowdielectric.pdb&lt;br /&gt;
need_files=&amp;quot;amb.crg.oxt&lt;br /&gt;
qnifft.parm&lt;br /&gt;
vdw.siz&amp;quot;&lt;br /&gt;
for file in $need_files&lt;br /&gt;
do&lt;br /&gt;
	if [ -e $blastermaster_Prot/working/$file ]&lt;br /&gt;
	then&lt;br /&gt;
		cp $blastermaster_Prot/working/$file .&lt;br /&gt;
	else&lt;br /&gt;
		cp $blast_orig/working/$file .&lt;br /&gt;
	fi&lt;br /&gt;
done&lt;br /&gt;
echo &amp;quot;C     lpd        0.000     LIPID SPHERE&amp;quot; &amp;gt;&amp;gt; amb.crg.oxt&lt;br /&gt;
cp $blastermaster_Prot/working/box .&lt;br /&gt;
cp $blastermaster_Prot/working/qnifft.parm .&lt;br /&gt;
cp $blastermaster_Prot/working/vdw.siz .&lt;br /&gt;
$DOCKBASE/proteins/qnifft/bin/qnifft22_193_pgf_32 qnifft.parm &amp;gt;&amp;amp; qnifft.log&lt;br /&gt;
$DOCKBASE/proteins/blastermaster/phiTrim.py qnifft.electrostatics.phi box trim.electrostatics.phi &amp;gt;&amp;amp; trim.log&lt;br /&gt;
&lt;br /&gt;
#cp trim.electrostatics.phi dockfiles/.&lt;br /&gt;
&lt;br /&gt;
# Check if the grid size changed:&lt;br /&gt;
#echo &amp;quot;Check if the grid size changed, compare this with INDOCK&amp;quot;&lt;br /&gt;
#python ~jklyu/zzz.script/pymol_movie/phi_to_dx.py trim.electrostatics.phi trim.electrostatics.phi.dx &amp;gt; gridsize&lt;br /&gt;
#head -n 1 gridsize&lt;br /&gt;
# compare with delphi_nsize in INDOCK&lt;br /&gt;
&lt;br /&gt;
# Run solvmap for Ligand Desolvation Grids if they are present in the folder&lt;br /&gt;
if [ -e $blastermaster_Prot/working/heavy ]&lt;br /&gt;
then&lt;br /&gt;
	mkdir heavy&lt;br /&gt;
	cd heavy || exit&lt;br /&gt;
	cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
	cp ../box .&lt;br /&gt;
	cp $blastermaster_Prot/working/heavy/INSEV .&lt;br /&gt;
	$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
	#cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
	cd ../ || exit&lt;br /&gt;
&lt;br /&gt;
	mkdir hydrogen&lt;br /&gt;
	cd hydrogen || exit&lt;br /&gt;
	cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
	cp ../box .&lt;br /&gt;
	cp $blastermaster_Prot/working/hydrogen/INSEV .&lt;br /&gt;
	$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
	#cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
fi&lt;br /&gt;
echo $dir &amp;quot; DONE!&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
curr_dir=$(pwd)&lt;br /&gt;
workdirs=$1&lt;br /&gt;
blast_orig=$2&lt;br /&gt;
dirs=$(ls -d $workdirs/es_ld_thin_sph_rad_*)&lt;br /&gt;
for dir in $dirs&lt;br /&gt;
do&lt;br /&gt;
	blastermaster_Prot=$dir&lt;br /&gt;
	local_dir=$(echo $dir | awk -F&amp;quot;\/&amp;quot; &#039;{print $NF}&#039;)&lt;br /&gt;
	mkdir -p $local_dir/working&lt;br /&gt;
	cd $local_dir/working || exit&lt;br /&gt;
	run_once&lt;br /&gt;
	cd $curr_dir || exit&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
python ~rstein/zzz.scripts/DOCK_prep_scripts/new_0002_combine_es_ld_grids_into_combos.py -p $blast_orig&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running blastermaster with default parameters ==&lt;br /&gt;
&#039;&#039;&#039;Warning! Do not use these grids, as the default grids with lipid spheres give incorrect solvation energies. Use the ones with thinspheres instead!&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# a script to prepare a protein with the lipid membrane for DOCK &lt;br /&gt;
# first argument -- path to blastermaster files of the protein without membrane&lt;br /&gt;
# run in a new directory with shell-LPD.pdb&lt;br /&gt;
blastermaster_Prot=$1&lt;br /&gt;
# mkdir  add_membrane&lt;br /&gt;
# Run qnifft for electrostatic grids&lt;br /&gt;
# cp $blastfiles_membrane/shell-LPD.pdb&lt;br /&gt;
# delete all fields except HETATM from shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^CRYST1/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^CONECT/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^END/d&#039; shell-LPD.pdb&lt;br /&gt;
cp $blastermaster_Prot/working/rec.crg.pdb .&lt;br /&gt;
#cp $blastermaster_Prot/working/lowdielectric.sph.pdb # (if wanted, if you run a  parameter scan, be sure to use the correct spheres!)&lt;br /&gt;
cp -r $blastermaster_Prot/dockfiles .&lt;br /&gt;
cp -r $blastermaster_Prot/INDOCK .&lt;br /&gt;
mv rec.crg.pdb  rec.crg.solo.pdb&lt;br /&gt;
cat rec.crg.solo.pdb shell-LPD.pdb  &amp;gt; receptor.crg.lowdielectric.pdb&lt;br /&gt;
# extracting SPH lines from receptor&lt;br /&gt;
number=$(grep -n  SPH  $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb | head -n 1 | awk -F &amp;quot;:&amp;quot; &#039;{print $1}&#039;)&lt;br /&gt;
tail --lines=+$number $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb &amp;gt;&amp;gt; rec.crg.lowdielectric.pdb&lt;br /&gt;
cp $blastermaster_Prot/working/amb.crg.oxt .&lt;br /&gt;
echo &amp;quot;C     lpd        0.000     LIPID SPHERE&amp;quot; &amp;gt;&amp;gt; amb.crg.oxt&lt;br /&gt;
cp $blastermaster_Prot/working/box .&lt;br /&gt;
cp $blastermaster_Prot/working/qnifft.parm .&lt;br /&gt;
cp $blastermaster_Prot/working/vdw.siz .&lt;br /&gt;
$DOCKBASE/proteins/qnifft/bin/qnifft22_193_pgf_32 qnifft.parm &amp;gt;&amp;amp; qnifft.log&lt;br /&gt;
$DOCKBASE/proteins/blastermaster/phiTrim.py qnifft.electrostatics.phi box trim.electrostatics.phi &amp;gt;&amp;amp; trim.log&lt;br /&gt;
&lt;br /&gt;
cp trim.electrostatics.phi dockfiles/.&lt;br /&gt;
&lt;br /&gt;
# Check if the grid size changed:&lt;br /&gt;
echo &amp;quot;Check if the grid size changed, compare this with INDOCK&amp;quot;&lt;br /&gt;
python ~jklyu/zzz.script/pymol_movie/phi_to_dx.py trim.electrostatics.phi trim.electrostatics.phi.dx &amp;gt; gridsize&lt;br /&gt;
head -n 1 gridsize&lt;br /&gt;
# compare with delphi_nsize in INDOCK&lt;br /&gt;
&lt;br /&gt;
# Run solvmap for Ligand Desolvation Grids&lt;br /&gt;
mkdir heavy&lt;br /&gt;
cd heavy || exit&lt;br /&gt;
cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
cp ../box .&lt;br /&gt;
cp $blastermaster_Prot/working/heavy/INSEV .&lt;br /&gt;
$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
cd ../ || exit&lt;br /&gt;
&lt;br /&gt;
mkdir hydrogen&lt;br /&gt;
cd hydroger || exit&lt;br /&gt;
cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
cp ../box .&lt;br /&gt;
cp $blastermaster_Prot/working/hydrogen/INSEV .&lt;br /&gt;
$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
echo &amp;quot;DONE!&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Lipid membrane models from MemProtMD ==&lt;br /&gt;
If a protein-membrane complex was already modeled for your system and deposited at [http://memprotmd.bioch.ox.ac.uk/home/ MemProtMD] website, you can use it and skip doing MD in Schrodinger. The steps are very similar to the ones after Schrodinger run.&lt;br /&gt;
&lt;br /&gt;
Download the &amp;lt;code&amp;gt;*_default_dppc.mpmd.finalframe.atomistic.pdb&amp;lt;/code&amp;gt; file from the bottom of the page. Rename it to &amp;lt;code&amp;gt;last-mol.pdb&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Use prepare.pml script (below). You need to provide the &amp;lt;code&amp;gt;rec.pdb&amp;lt;/code&amp;gt; to want to use for docking (potentially with missing loops) at that step as &amp;lt;code&amp;gt;xtal-prot.pdb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;pymol -qc last-mol.pdb xtal-prot.pdb prepare.pml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script below differs from the one for processing Schrodinger results in two points: solvent residue is &amp;lt;code&amp;gt;SOL&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;SPC&amp;lt;/code&amp;gt;, and lipids are called &amp;lt;code&amp;gt;DPPC&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;POPC&amp;lt;/code&amp;gt;.&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
align last-mol, xtal-prot&lt;br /&gt;
&lt;br /&gt;
remove ////SOL&lt;br /&gt;
&lt;br /&gt;
create MEM, ////DPPC&lt;br /&gt;
&lt;br /&gt;
remove /MEM////HS&lt;br /&gt;
remove /MEM////HX&lt;br /&gt;
remove /MEM////HY&lt;br /&gt;
remove /MEM////H*B&lt;br /&gt;
remove /MEM////H*A&lt;br /&gt;
remove /MEM////H*C&lt;br /&gt;
&lt;br /&gt;
remove /MEM////C1&lt;br /&gt;
remove /MEM////C2&lt;br /&gt;
remove /MEM////C3&lt;br /&gt;
remove /MEM////C11&lt;br /&gt;
remove /MEM////C12&lt;br /&gt;
remove /MEM////C13&lt;br /&gt;
remove /MEM////C14&lt;br /&gt;
remove /MEM////C15&lt;br /&gt;
&lt;br /&gt;
create MEM_C, /MEM////*C* | /MEM////H*R | /MEM////H*S | /MEM////H*T | /MEM////H*X | /MEM////H*Y | /MEM////H*Z&lt;br /&gt;
&lt;br /&gt;
create shell, MEM_C within 20 of xtal-prot&lt;br /&gt;
&lt;br /&gt;
set retain_order, 1&lt;br /&gt;
&lt;br /&gt;
save shell.pdb, shell&lt;br /&gt;
&lt;br /&gt;
alter shell, resn=&#039;LPD&#039;&lt;br /&gt;
alter shell, name=&#039;C&#039;&lt;br /&gt;
alter shell, chain=&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
rebuild&lt;br /&gt;
&lt;br /&gt;
save shell-LPD.pdb, shell&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Positioning of the membrane ==&lt;br /&gt;
If there is no precomputed membrane position from OPM or MemProtMD, you can model it using  PPM 3.0 webserver (https://opm.phar.umich.edu/ppm_server3) or standalone software. The software is installed in &amp;lt;code&amp;gt;/nfs/home/ak87/exa/PROGRAM/OPM-MEMBRANE&amp;lt;/code&amp;gt;. Copy &amp;lt;code&amp;gt;res.lib&amp;lt;/code&amp;gt; file from the program directory to the directory with your .pdb file. Create input file like this:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
0 PMm out rec.pdb&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;blockquote&amp;gt;0 or 1 -“do not use” or “use” heteroatoms in the input PDB file, respectively (solvent molecules are always excluded).&lt;br /&gt;
&lt;br /&gt;
MOM - type of membrane (see list of 3-letter codes for membranes below)&lt;br /&gt;
&lt;br /&gt;
“in” or “out” means topology of N-terminus of first subunit included in the corresponding input PDB file&lt;br /&gt;
&lt;br /&gt;
With this option, for every input pdb file, the program will selected automatically the flat or curved membrane boundaries, whichever had the lower calculated transfer energy.&amp;lt;/blockquote&amp;gt;Then run the program:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;~ak87/exa/PROGRAM/OPM-MEMBRANE/immers&amp;lt;1membrane.inp&amp;gt;rec-opm.out&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;datasub1&amp;lt;/code&amp;gt; file to extract residue numbers for the membrane placement in Maestro.&lt;br /&gt;
See ppm3_instructions.docx file in the program directory for more detail.&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Membrane_Modeling&amp;diff=15412</id>
		<title>Membrane Modeling</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Membrane_Modeling&amp;diff=15412"/>
		<updated>2023-05-31T21:27:25Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Written by Stefan Gahbauer, 2019/11/03&lt;br /&gt;
&lt;br /&gt;
In order to account for ligand desolvation and electrostatic interactions in the low-dielectric environment of the hydrophobic membrane core, a lipid-bilayer is generated around the target receptor and included in the docking score grid generation.&lt;br /&gt;
Aiming at a fast, robust and computationally effective equilibration of the lipid bilayer around the embedded transmembrane receptor, coarse-grained (CG) molecular dynamics (MD) simulations and (if needed) subsequent atomistic simulations are employed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Required software and datasets =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gromacs&#039;&#039;&#039; (v5 or newer) - Molecular Dynamics software package (http://manual.gromacs.org/)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CHARMM36m force field&#039;&#039;&#039; (http://mackerell.umaryland.edu/charmm_ff.shtml)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MARTINI&#039;&#039;&#039; Coarse-grained force field parameters(http://cgmartini.nl/)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DSSP&#039;&#039;&#039; - Secondary Structure assignment (https://swift.cmbi.umcn.nl/gv/dssp/ , https://anaconda.org/salilab/dssp)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;martinize.py&#039;&#039;&#039; - Coarse-graining atomistic protein structures (http://cgmartini.nl/index.php/tools2/proteins-and-bilayers)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;insane.py&#039;&#039;&#039; - INSerting proteins in coarse-grained MembrANE (http://cgmartini.nl/index.php/tools2/proteins-and-bilayers)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;initram.sh&#039;&#039;&#039; and &#039;&#039;&#039;backward.py&#039;&#039;&#039; - Conversion of coarse-grained system to atomistic resolution (http://cgmartini.nl/index.php/tools2/resolution-transformation)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 1) Setting up the coarse-grained system =&lt;br /&gt;
&lt;br /&gt;
This is automated in the script:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/0001-prepare-protein-CG-membrane.sh&lt;br /&gt;
&lt;br /&gt;
== 1.1) Prepare your files ==&lt;br /&gt;
&lt;br /&gt;
Copy the script above to your working directory.&lt;br /&gt;
&lt;br /&gt;
Copy your rec.pdb to your working directory.&lt;br /&gt;
&lt;br /&gt;
If your rec.pdb has gaps, e.g. unresolved loops between transmembrane helices in case of GPCRs, try to model missing residues.&lt;br /&gt;
&lt;br /&gt;
One way is to use MODELLER following https://salilab.org/modeller/wiki/Missing%20residues.&lt;br /&gt;
&lt;br /&gt;
Corresponding input scripts for modeller can be found in:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/modeller&lt;br /&gt;
&lt;br /&gt;
== 1.2) Run the script ==&lt;br /&gt;
&lt;br /&gt;
Login to gimel2.&lt;br /&gt;
&lt;br /&gt;
./0001-prepare-protein-CG-membrane.sh&lt;br /&gt;
&lt;br /&gt;
The script reads rec.pdb and copies all other required files from &lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/gromacs&lt;br /&gt;
&lt;br /&gt;
=== Workflow ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;a.&#039;&#039;&#039; Generate CHARMM36m force field parameters of your protein in a Gromacs-readable format. &lt;br /&gt;
&lt;br /&gt;
Used tool: gmx pdb2gmx &lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;pdb2gmx&#039;&#039; directory&lt;br /&gt;
&lt;br /&gt;
-conf.gro / conf.pdb - Gromacs coordinate file&lt;br /&gt;
&lt;br /&gt;
-topol.top / Protein-atomistic.itp - Gromacs topology file, i.e. force field description of your input structure&lt;br /&gt;
&lt;br /&gt;
-posre.itp - Position restraints for heavy atoms of atomistic protein strucutre.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;b.&#039;&#039;&#039; Build coarse-grained structure&lt;br /&gt;
&lt;br /&gt;
Used tool: martinize.py&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-chain_.ssd - Output from the DSSP program that is called by martinize.py&lt;br /&gt;
&lt;br /&gt;
-prot-cg.pdb - Coarse-grained protein structure&lt;br /&gt;
&lt;br /&gt;
-prot-cg.top - Coarse-grained Martini topology of system&lt;br /&gt;
&lt;br /&gt;
-Protein.itp - Coarse-grained Martini description of Protein structure&lt;br /&gt;
&lt;br /&gt;
-prot-rot.pdb - Coarse-grained protein structure aligned along z-axis of the simulation box according to the proteins first principal component axis. This ensures the correct placement of the protein during membrane preparation. &#039;&#039;&#039;You may have to adjust the orientation of your input structure prior to membrane modeling.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;c.&#039;&#039;&#039; Build coarse-grained membrane&lt;br /&gt;
&lt;br /&gt;
Used tool: insane.py&lt;br /&gt;
&lt;br /&gt;
Here, a lipid bilayer will be created around the protein structure (in the x/y-plane) and water will be added to the system. The default box shape is rectangular and the size is set to x,y=10nm, z=11nm. This can be changed in the ./insane.py command line. The default lipid type is POPC, you can change that to arbitrary lipid compositions using the -l and -u options of of insane.py.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-out.top / topol-cg.top - Topology of coarse-grained system&lt;br /&gt;
&lt;br /&gt;
-cg-membrane.gro/.pdb - Coarse-grained system coordinates. &#039;&#039;&#039;Carefully inspect and visualize the cg-membrane.pdb.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use PyMOL to check if you&#039;re protein is embedded correctly in the lipid bilayer.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 2) Simulating the coarse-grained system =&lt;br /&gt;
&lt;br /&gt;
This is automated in the script:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/0002-run-CG-Minimization-and-MD.sh&lt;br /&gt;
&lt;br /&gt;
== 2.1) Run the script ==&lt;br /&gt;
&lt;br /&gt;
Copy the script above to your working directory.&lt;br /&gt;
&lt;br /&gt;
./0002-run-CG-Minimization-and-MD.sh&lt;br /&gt;
&lt;br /&gt;
=== Workflow ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;a.&#039;&#039;&#039; Minimize coarse-grained system&lt;br /&gt;
&lt;br /&gt;
Used tools: gmx grompp , gmx mdrun&lt;br /&gt;
&lt;br /&gt;
gmx grompp generates a single .tpr file that contains all information necessary for running a MD simulation or minimization using gmx mdrun.&lt;br /&gt;
&lt;br /&gt;
Minimization parameters are provided in martini_new-rf_min.mdp. The system will be minimized in 500 steps using steepest descent. The protein structure will be frozen during minimization.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-min.tpr - MD run input file&lt;br /&gt;
&lt;br /&gt;
-min.log - Output log file from minimization&lt;br /&gt;
&lt;br /&gt;
-min.trr - Minimization trajectory&lt;br /&gt;
&lt;br /&gt;
-min.gro - Minimized system coordinates&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;b.&#039;&#039;&#039; Simulate coarse-grained system&lt;br /&gt;
&lt;br /&gt;
MD simulation parameters are provided in martini_v2.x_new-rf.mdp. Strong position restraints are applied on the protein structure during the simulation. The system will be simulated for 50ns.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-md.tpr - MD run input file&lt;br /&gt;
&lt;br /&gt;
-md.log - Output log file from simulation&lt;br /&gt;
&lt;br /&gt;
-md.trr - lossless trajectory of simulation&lt;br /&gt;
&lt;br /&gt;
-md.xtc - coordinates of simulation trajectory&lt;br /&gt;
&lt;br /&gt;
-md.gro - coordinates of final simulation snapshot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The simulation will run for roughly 3 hours.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 3) Converting coarse-grained system to atomistic resolution and select lipid atoms for grid generation =&lt;br /&gt;
&lt;br /&gt;
This is automated in the script:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/0003-backmap-and-lpd-selection.sh&lt;br /&gt;
&lt;br /&gt;
== 3.1) Run the script ==&lt;br /&gt;
&lt;br /&gt;
Copy the script above to your working directory.&lt;br /&gt;
&lt;br /&gt;
./0003-backmap-and-lpd-selection.sh&lt;br /&gt;
&lt;br /&gt;
=== Workflow ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;a.&#039;&#039;&#039; Backmapping from coarse-grained to atomistic&lt;br /&gt;
&lt;br /&gt;
Used tool: gmx trjconv, initram.sh&lt;br /&gt;
&lt;br /&gt;
gmx trjconv can perform a variety of conversions of MD trajectory, e.g. making molecules broken over the periodic boundary conditions whole again. &lt;br /&gt;
&lt;br /&gt;
initram.sh calls the backward.py program which performs the backmapping of input coarse-grained to atomistic systems, and performs a small series of short minimizations and simulations to relax the backmapped system.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;backmap&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-0-backmapped.gro / projected.gro - initial backmapped coordinates&lt;br /&gt;
&lt;br /&gt;
-backmapped.top - Topology of atomistic system&lt;br /&gt;
&lt;br /&gt;
-1-EM*/2-EM* - Output from minimizations &lt;br /&gt;
&lt;br /&gt;
-3-mdpr*/4-mdpr*/5-mdpr*/6-mdpr* - Output from simulations&lt;br /&gt;
&lt;br /&gt;
-backmapped.gro - Coordinates of final backmapped and relaxed system&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This may need a few attempts to work all the way through. There is a while-loop that only stops until all relaxation steps have finished.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;b.&#039;&#039;&#039; Replacing backmapped protein with initial atomistic protein structure&lt;br /&gt;
&lt;br /&gt;
Used tool: PyMOL script align.pml&lt;br /&gt;
&lt;br /&gt;
The pymol script will align the initial &amp;quot;Gromacs&amp;quot;-protein structure (conf.pdb) onto the backmapped structure and combine the fitted protein coordinates with the coordinates of the lipid and solvent environment.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;backmap/prepare_AA_system&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-conf-fitted.pdb - Fitted initial protein structure&lt;br /&gt;
&lt;br /&gt;
-backmapped-environment.pdb - All membrane and water coordinates&lt;br /&gt;
&lt;br /&gt;
-fitted_system.pdb - Complete system containing fitted protein and environment coordinates&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure that fitted_system.pdb has the same number of coordinates as backmapped-mol.pdb.&#039;&#039;&#039; If there is a discrepancy there might be an issue with the PyMOL version you&#039;re using to run align.pml. Using PyMOL v2 or newer seems to avoid any issues. You can also generate backmapped-environment.pdb manually by taking all POPC and Water cooridnates from backmapped-mol.pdb.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;c.&#039;&#039;&#039; Run minimizations of atomistic system&lt;br /&gt;
&lt;br /&gt;
Used tools: gmx grompp, gmx mdrun&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;backmap/prepare_AA_system&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
Tow minimizations will be calculated. &lt;br /&gt;
&lt;br /&gt;
1) Minimization with frozen protein coordinates: 1,500 steps steepest descent (min_freeze.mdp).&lt;br /&gt;
&lt;br /&gt;
-min_freeze* - Output files of first minimization&lt;br /&gt;
&lt;br /&gt;
2) Minimization of full system: 500 steps (min.mdp).&lt;br /&gt;
&lt;br /&gt;
-min* - Output files of second minimization&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;d.&#039;&#039;&#039; Select lipid atoms for DOCK grid generation&lt;br /&gt;
&lt;br /&gt;
Used tools: PyMOL script prepare.pml&lt;br /&gt;
&lt;br /&gt;
This will select carbon and hydrogen atoms of the hydrophobic lipid tail segments in a radius of 1.7 nm around the protein and assign them to the atom type &amp;quot;LPD&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You need to provide the rec.pdb to want to use for docking (potentially with missing loops) at that step as xtal-prot.pdb&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;backmap/prepare_AA_system/prepare_min&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-shell-LPD.pdb - all LPD atoms selected for grid generation&lt;br /&gt;
&lt;br /&gt;
Add these coordinates to your docking protein structure and provide a amb.crg.oxt file adding&lt;br /&gt;
&lt;br /&gt;
C     lpd        0.000     LIPID SPHERE&lt;br /&gt;
&lt;br /&gt;
Now you can run blastermaster.&lt;br /&gt;
&lt;br /&gt;
= Membrane modelling in Schrodinger =&lt;br /&gt;
Written by Andrii Kyrylchuk, 2022/04/20&lt;br /&gt;
&lt;br /&gt;
== MD of protein and membrane ==&lt;br /&gt;
Import structure &#039;&#039;&#039;without&#039;&#039;&#039; ligand, use &amp;lt;u&amp;gt;Preparation wizard&amp;lt;/u&amp;gt; as described in &amp;quot;Code for Controls...&amp;quot;  to model missing loops and capping.&lt;br /&gt;
&lt;br /&gt;
Then open &amp;lt;u&amp;gt;System Builder&amp;lt;/u&amp;gt;, click &amp;lt;code&amp;gt;Setup membrane&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to the website https://opm.phar.umich.edu/proteins/ and find your protein. Copy residue numbers from the bottom of the page to the field &amp;lt;code&amp;gt;Transmembrane atoms...&amp;lt;/code&amp;gt;. The format is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;res.num 76-97,112-136,141,...&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click &amp;lt;code&amp;gt;Place Automatically&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt;. Then click &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt;. Examine lipids and solvent after run completes.&lt;br /&gt;
&lt;br /&gt;
Then use &amp;lt;u&amp;gt;Molecular Dynamics&amp;lt;/u&amp;gt; menu to set up the calculation. Select prepared system, click &amp;lt;code&amp;gt;Load&amp;lt;/code&amp;gt; on top of the menu. Put simulation time of 5 ns, &amp;lt;code&amp;gt;Advanced Options&amp;lt;/code&amp;gt; -- &amp;lt;code&amp;gt;Restraints&amp;lt;/code&amp;gt; -- &amp;lt;code&amp;gt;Add.&amp;lt;/code&amp;gt; Select protein, and put &amp;lt;code&amp;gt;Force Constant&amp;lt;/code&amp;gt; of 100, click &amp;lt;code&amp;gt;Apply&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;OK.&amp;lt;/code&amp;gt; Then click down arrow left of the &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt; button in the parent window and click &amp;lt;code&amp;gt;Write&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;NOTE&#039;&#039;&#039;: In my experience, restrained MD runs with NgPT in Schrodinger often fail with the following message:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&#039;&#039;Allowed momentum exceeded on 17 particles.&#039;&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This seems to be related to the interference of restraints and the ensemble, as no such error is observed if no restraints are imposed, or if NVT ensemble is used. Still, NgPT ensemble is important for correct membrane sampling, because simulations at NVT long enough to permit membrane relaxation, lead to the smearing of the lipid bilayer and the formation of empty space.&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;If the mentioned problem occurs, import the last coordinates of the run (*-out.cms) into Maestro, open Minimization menu, load the structure from the workspace, and apply restraints on lipid and protein (force restraint of 10 is usually enough). Then run a minimization for 100 ps, and try to run NgPT MD starting from the optimized structure.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039; NPT ensemble can safely be used instead of NgPT&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Copy the project folder (desmond_md_job_X) to gimel, login to &amp;lt;u&amp;gt;gimel5&amp;lt;/u&amp;gt;, edit desmond_md_job_X.sh: delete &amp;lt;code&amp;gt;-lic DESMOND_GPGPU:16&amp;lt;/code&amp;gt; and insert &amp;lt;code&amp;gt;-HOST gimel5.gpu&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;gimel5.heavygpu&amp;lt;/code&amp;gt;). Export &amp;lt;code&amp;gt;$SCHRODINGER&amp;lt;/code&amp;gt; variable:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SCHRODINGER=/nfs/soft2/schrodinger/2023-3/&amp;lt;/code&amp;gt; (or a newer version)&lt;br /&gt;
&lt;br /&gt;
Run .sh file, and your task will be submitted to a queue. For my system it took 1.5 hr to complete.&lt;br /&gt;
&lt;br /&gt;
Download the project folder to your PC, open Maestro, click &amp;lt;code&amp;gt;Import  structure&amp;lt;/code&amp;gt; and open &amp;lt;code&amp;gt;-out.cms&amp;lt;/code&amp;gt;, click on &amp;lt;code&amp;gt;T&amp;lt;/code&amp;gt; icon at the new entry in project table and click &amp;lt;code&amp;gt;Display Trajectory Snapshots&amp;lt;/code&amp;gt;. Select the last one, click &amp;lt;code&amp;gt;Display&amp;lt;/code&amp;gt; and check if the protein did not change position during MD run, then click &amp;lt;code&amp;gt;Export&amp;lt;/code&amp;gt;, to Project Table, Frames Selected only. You will get a new entry in the Project Table. Export it to a &amp;lt;code&amp;gt;.pdb&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
== Preparation of the structure for Blastermaster ==&lt;br /&gt;
Use &amp;lt;code&amp;gt;prepare.pml&amp;lt;/code&amp;gt; script. You need to provide the &amp;lt;code&amp;gt;rec.pdb&amp;lt;/code&amp;gt; to want to use for docking (potentially with missing loops) at that step as &amp;lt;code&amp;gt;xtal-prot.pdb&amp;lt;/code&amp;gt;. Rename MD system as &amp;lt;code&amp;gt;last-mol.pdb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;pymol -qc last-mol.pdb xtal-prot.pdb prepare.pml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
align last-mol, xtal-prot&lt;br /&gt;
&lt;br /&gt;
remove ////SPC&lt;br /&gt;
&lt;br /&gt;
create MEM, ////POPC&lt;br /&gt;
&lt;br /&gt;
# these atom numbers do not exist in POPC or DPPC&lt;br /&gt;
# therefore, we do not remove protons from the lipid&lt;br /&gt;
# structure to make more spheres. Uncomment these&lt;br /&gt;
# lines and change to proper H numbers if needed.&lt;br /&gt;
#remove /MEM////HS&lt;br /&gt;
#remove /MEM////HX&lt;br /&gt;
#remove /MEM////HY&lt;br /&gt;
#remove /MEM////H*B&lt;br /&gt;
#remove /MEM////H*A&lt;br /&gt;
#remove /MEM////H*C&lt;br /&gt;
&lt;br /&gt;
remove /MEM////C1&lt;br /&gt;
remove /MEM////C2&lt;br /&gt;
remove /MEM////C3&lt;br /&gt;
remove /MEM////C11&lt;br /&gt;
remove /MEM////C12&lt;br /&gt;
remove /MEM////C13&lt;br /&gt;
remove /MEM////C14&lt;br /&gt;
remove /MEM////C15&lt;br /&gt;
&lt;br /&gt;
create MEM_C, /MEM////*C* | /MEM////H*R | /MEM////H*S | /MEM////H*T | /MEM////H*X | /MEM////H*Y | /MEM////H*Z&lt;br /&gt;
&lt;br /&gt;
create shell, MEM_C within 20 of xtal-prot&lt;br /&gt;
&lt;br /&gt;
set retain_order, 1&lt;br /&gt;
&lt;br /&gt;
save shell.pdb, shell&lt;br /&gt;
&lt;br /&gt;
alter shell, resn=&#039;LPD&#039;&lt;br /&gt;
alter shell, name=&#039;C&#039;&lt;br /&gt;
alter shell, chain=&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
rebuild&lt;br /&gt;
&lt;br /&gt;
save shell-LPD.pdb, shell&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Preparation of grids with thinspheres ==&lt;br /&gt;
Prepare grids with thinspheres for the protein without lipid as described in https://wiki.docking.org/index.php/How_to_do_parameter_scanning&lt;br /&gt;
&lt;br /&gt;
Create an empty directory and put &amp;lt;code&amp;gt;shell-LPD.pdb&amp;lt;/code&amp;gt; there. Then run the following script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sh blast-membrane-thinsph-scan.sh {path to the collection of &amp;quot;es_ld_thin_sph_rad_X.X&amp;quot; directories} {path to the dir with original working and dockfiles directories}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script runs qnifft and solvmap for each &amp;lt;code&amp;gt;es_ld_thin_sph_rad_X.X&amp;lt;/code&amp;gt; directory, and then uses the second script of parameter scanning protocol to combine files into &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; directories.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important! LOOK AT YOUR GRIDS! Desolvation -- larger solvation where water is. Electrostatics -- no electrostatics in the lipid region. vdW -- no vdW in the lipid region.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# a script to prepare a protein with the lipid membrane for DOCK with thinsphere scan&lt;br /&gt;
# PREREQ -- run first step of https://wiki.docking.org/index.php/How_to_do_parameter_scanning (new_0001_generate_ES_LD_generation.py )&lt;br /&gt;
# first argument -- path to the directory where dirs &amp;quot;es_ld_thin_sph_rad_X.X&amp;quot; are stored. &lt;br /&gt;
# second argument -- path to the dir with original working and dockfiles&lt;br /&gt;
# run in a new directory with shell-LPD.pdb&lt;br /&gt;
&lt;br /&gt;
run_once () {&lt;br /&gt;
# mkdir  add_membrane&lt;br /&gt;
# Run qnifft for electrostatic grids&lt;br /&gt;
# cp $blastfiles_membrane/shell-LPD.pdb&lt;br /&gt;
# delete all fields except HETATM from shell-LPD.pdb&lt;br /&gt;
cp $curr_dir/shell-LPD.pdb .&lt;br /&gt;
sed -ir &#039;/^CRYST1/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^CONECT/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^END/d&#039; shell-LPD.pdb&lt;br /&gt;
cp $blastermaster_Prot/working/rec.crg.pdb .&lt;br /&gt;
#cp $blastermaster_Prot/working/lowdielectric.sph.pdb # (if wanted, if you run a  parameter scan, be sure to use the correct spheres!)&lt;br /&gt;
#cp -r $blastermaster_Prot/dockfiles .&lt;br /&gt;
#cp -r $blastermaster_Prot/INDOCK .&lt;br /&gt;
mv rec.crg.pdb  rec.crg.solo.pdb&lt;br /&gt;
cat rec.crg.solo.pdb shell-LPD.pdb  &amp;gt; receptor.crg.lowdielectric.pdb&lt;br /&gt;
# extracting SPH lines from receptor&lt;br /&gt;
number=$(grep -n  SPH  $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb | head -n 1 | awk -F &amp;quot;:&amp;quot; &#039;{print $1}&#039;)&lt;br /&gt;
tail --lines=+$number $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb &amp;gt;&amp;gt; receptor.crg.lowdielectric.pdb&lt;br /&gt;
need_files=&amp;quot;amb.crg.oxt&lt;br /&gt;
qnifft.parm&lt;br /&gt;
vdw.siz&amp;quot;&lt;br /&gt;
for file in $need_files&lt;br /&gt;
do&lt;br /&gt;
	if [ -e $blastermaster_Prot/working/$file ]&lt;br /&gt;
	then&lt;br /&gt;
		cp $blastermaster_Prot/working/$file .&lt;br /&gt;
	else&lt;br /&gt;
		cp $blast_orig/working/$file .&lt;br /&gt;
	fi&lt;br /&gt;
done&lt;br /&gt;
echo &amp;quot;C     lpd        0.000     LIPID SPHERE&amp;quot; &amp;gt;&amp;gt; amb.crg.oxt&lt;br /&gt;
cp $blastermaster_Prot/working/box .&lt;br /&gt;
cp $blastermaster_Prot/working/qnifft.parm .&lt;br /&gt;
cp $blastermaster_Prot/working/vdw.siz .&lt;br /&gt;
$DOCKBASE/proteins/qnifft/bin/qnifft22_193_pgf_32 qnifft.parm &amp;gt;&amp;amp; qnifft.log&lt;br /&gt;
$DOCKBASE/proteins/blastermaster/phiTrim.py qnifft.electrostatics.phi box trim.electrostatics.phi &amp;gt;&amp;amp; trim.log&lt;br /&gt;
&lt;br /&gt;
#cp trim.electrostatics.phi dockfiles/.&lt;br /&gt;
&lt;br /&gt;
# Check if the grid size changed:&lt;br /&gt;
#echo &amp;quot;Check if the grid size changed, compare this with INDOCK&amp;quot;&lt;br /&gt;
#python ~jklyu/zzz.script/pymol_movie/phi_to_dx.py trim.electrostatics.phi trim.electrostatics.phi.dx &amp;gt; gridsize&lt;br /&gt;
#head -n 1 gridsize&lt;br /&gt;
# compare with delphi_nsize in INDOCK&lt;br /&gt;
&lt;br /&gt;
# Run solvmap for Ligand Desolvation Grids if they are present in the folder&lt;br /&gt;
if [ -e $blastermaster_Prot/working/heavy ]&lt;br /&gt;
then&lt;br /&gt;
	mkdir heavy&lt;br /&gt;
	cd heavy || exit&lt;br /&gt;
	cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
	cp ../box .&lt;br /&gt;
	cp $blastermaster_Prot/working/heavy/INSEV .&lt;br /&gt;
	$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
	#cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
	cd ../ || exit&lt;br /&gt;
&lt;br /&gt;
	mkdir hydrogen&lt;br /&gt;
	cd hydrogen || exit&lt;br /&gt;
	cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
	cp ../box .&lt;br /&gt;
	cp $blastermaster_Prot/working/hydrogen/INSEV .&lt;br /&gt;
	$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
	#cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
fi&lt;br /&gt;
echo $dir &amp;quot; DONE!&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
curr_dir=$(pwd)&lt;br /&gt;
workdirs=$1&lt;br /&gt;
blast_orig=$2&lt;br /&gt;
dirs=$(ls -d $workdirs/es_ld_thin_sph_rad_*)&lt;br /&gt;
for dir in $dirs&lt;br /&gt;
do&lt;br /&gt;
	blastermaster_Prot=$dir&lt;br /&gt;
	local_dir=$(echo $dir | awk -F&amp;quot;\/&amp;quot; &#039;{print $NF}&#039;)&lt;br /&gt;
	mkdir -p $local_dir/working&lt;br /&gt;
	cd $local_dir/working || exit&lt;br /&gt;
	run_once&lt;br /&gt;
	cd $curr_dir || exit&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
python ~rstein/zzz.scripts/DOCK_prep_scripts/new_0002_combine_es_ld_grids_into_combos.py -p $blast_orig&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running blastermaster with default parameters ==&lt;br /&gt;
&#039;&#039;&#039;Warning! Do not use these grids, as the default grids with lipid spheres give incorrect solvation energies. Use the ones with thinspheres instead!&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# a script to prepare a protein with the lipid membrane for DOCK &lt;br /&gt;
# first argument -- path to blastermaster files of the protein without membrane&lt;br /&gt;
# run in a new directory with shell-LPD.pdb&lt;br /&gt;
blastermaster_Prot=$1&lt;br /&gt;
# mkdir  add_membrane&lt;br /&gt;
# Run qnifft for electrostatic grids&lt;br /&gt;
# cp $blastfiles_membrane/shell-LPD.pdb&lt;br /&gt;
# delete all fields except HETATM from shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^CRYST1/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^CONECT/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^END/d&#039; shell-LPD.pdb&lt;br /&gt;
cp $blastermaster_Prot/working/rec.crg.pdb .&lt;br /&gt;
#cp $blastermaster_Prot/working/lowdielectric.sph.pdb # (if wanted, if you run a  parameter scan, be sure to use the correct spheres!)&lt;br /&gt;
cp -r $blastermaster_Prot/dockfiles .&lt;br /&gt;
cp -r $blastermaster_Prot/INDOCK .&lt;br /&gt;
mv rec.crg.pdb  rec.crg.solo.pdb&lt;br /&gt;
cat rec.crg.solo.pdb shell-LPD.pdb  &amp;gt; receptor.crg.lowdielectric.pdb&lt;br /&gt;
# extracting SPH lines from receptor&lt;br /&gt;
number=$(grep -n  SPH  $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb | head -n 1 | awk -F &amp;quot;:&amp;quot; &#039;{print $1}&#039;)&lt;br /&gt;
tail --lines=+$number $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb &amp;gt;&amp;gt; rec.crg.lowdielectric.pdb&lt;br /&gt;
cp $blastermaster_Prot/working/amb.crg.oxt .&lt;br /&gt;
echo &amp;quot;C     lpd        0.000     LIPID SPHERE&amp;quot; &amp;gt;&amp;gt; amb.crg.oxt&lt;br /&gt;
cp $blastermaster_Prot/working/box .&lt;br /&gt;
cp $blastermaster_Prot/working/qnifft.parm .&lt;br /&gt;
cp $blastermaster_Prot/working/vdw.siz .&lt;br /&gt;
$DOCKBASE/proteins/qnifft/bin/qnifft22_193_pgf_32 qnifft.parm &amp;gt;&amp;amp; qnifft.log&lt;br /&gt;
$DOCKBASE/proteins/blastermaster/phiTrim.py qnifft.electrostatics.phi box trim.electrostatics.phi &amp;gt;&amp;amp; trim.log&lt;br /&gt;
&lt;br /&gt;
cp trim.electrostatics.phi dockfiles/.&lt;br /&gt;
&lt;br /&gt;
# Check if the grid size changed:&lt;br /&gt;
echo &amp;quot;Check if the grid size changed, compare this with INDOCK&amp;quot;&lt;br /&gt;
python ~jklyu/zzz.script/pymol_movie/phi_to_dx.py trim.electrostatics.phi trim.electrostatics.phi.dx &amp;gt; gridsize&lt;br /&gt;
head -n 1 gridsize&lt;br /&gt;
# compare with delphi_nsize in INDOCK&lt;br /&gt;
&lt;br /&gt;
# Run solvmap for Ligand Desolvation Grids&lt;br /&gt;
mkdir heavy&lt;br /&gt;
cd heavy || exit&lt;br /&gt;
cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
cp ../box .&lt;br /&gt;
cp $blastermaster_Prot/working/heavy/INSEV .&lt;br /&gt;
$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
cd ../ || exit&lt;br /&gt;
&lt;br /&gt;
mkdir hydrogen&lt;br /&gt;
cd hydroger || exit&lt;br /&gt;
cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
cp ../box .&lt;br /&gt;
cp $blastermaster_Prot/working/hydrogen/INSEV .&lt;br /&gt;
$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
echo &amp;quot;DONE!&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Lipid membrane models from MemProtMD ==&lt;br /&gt;
If a protein-membrane complex was already modeled for your system and deposited at [http://memprotmd.bioch.ox.ac.uk/home/ MemProtMD] website, you can use it and skip doing MD in Schrodinger. The steps are very similar to the ones after Schrodinger run.&lt;br /&gt;
&lt;br /&gt;
Download the &amp;lt;code&amp;gt;*_default_dppc.mpmd.finalframe.atomistic.pdb&amp;lt;/code&amp;gt; file from the bottom of the page. Rename it to &amp;lt;code&amp;gt;last-mol.pdb&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Use prepare.pml script (below). You need to provide the &amp;lt;code&amp;gt;rec.pdb&amp;lt;/code&amp;gt; to want to use for docking (potentially with missing loops) at that step as &amp;lt;code&amp;gt;xtal-prot.pdb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;pymol -qc last-mol.pdb xtal-prot.pdb prepare.pml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script below differs from the one for processing Schrodinger results in two points: solvent residue is &amp;lt;code&amp;gt;SOL&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;SPC&amp;lt;/code&amp;gt;, and lipids are called &amp;lt;code&amp;gt;DPPC&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;POPC&amp;lt;/code&amp;gt;.&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
align last-mol, xtal-prot&lt;br /&gt;
&lt;br /&gt;
remove ////SOL&lt;br /&gt;
&lt;br /&gt;
create MEM, ////DPPC&lt;br /&gt;
&lt;br /&gt;
remove /MEM////HS&lt;br /&gt;
remove /MEM////HX&lt;br /&gt;
remove /MEM////HY&lt;br /&gt;
remove /MEM////H*B&lt;br /&gt;
remove /MEM////H*A&lt;br /&gt;
remove /MEM////H*C&lt;br /&gt;
&lt;br /&gt;
remove /MEM////C1&lt;br /&gt;
remove /MEM////C2&lt;br /&gt;
remove /MEM////C3&lt;br /&gt;
remove /MEM////C11&lt;br /&gt;
remove /MEM////C12&lt;br /&gt;
remove /MEM////C13&lt;br /&gt;
remove /MEM////C14&lt;br /&gt;
remove /MEM////C15&lt;br /&gt;
&lt;br /&gt;
create MEM_C, /MEM////*C* | /MEM////H*R | /MEM////H*S | /MEM////H*T | /MEM////H*X | /MEM////H*Y | /MEM////H*Z&lt;br /&gt;
&lt;br /&gt;
create shell, MEM_C within 20 of xtal-prot&lt;br /&gt;
&lt;br /&gt;
set retain_order, 1&lt;br /&gt;
&lt;br /&gt;
save shell.pdb, shell&lt;br /&gt;
&lt;br /&gt;
alter shell, resn=&#039;LPD&#039;&lt;br /&gt;
alter shell, name=&#039;C&#039;&lt;br /&gt;
alter shell, chain=&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
rebuild&lt;br /&gt;
&lt;br /&gt;
save shell-LPD.pdb, shell&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Positioning of the membrane ==&lt;br /&gt;
If there is no precomputed membrane position from OPM or MemProtMD, you can model it using  PPM 3.0 webserver (https://opm.phar.umich.edu/ppm_server3) or standalone software. The software is installed in &amp;lt;code&amp;gt;/nfs/home/ak87/exa/PROGRAM/OPM-MEMBRANE&amp;lt;/code&amp;gt;. Copy &amp;lt;code&amp;gt;res.lib&amp;lt;/code&amp;gt; file from the program directory to the directory with your .pdb file. Create input file like this:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
0 PMm out rec.pdb&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;blockquote&amp;gt;0 or 1 -“do not use” or “use” heteroatoms in the input PDB file, respectively (solvent molecules are always excluded).&lt;br /&gt;
&lt;br /&gt;
MOM - type of membrane (see list of 3-letter codes for membranes below)&lt;br /&gt;
&lt;br /&gt;
“in” or “out” means topology of N-terminus of first subunit included in the corresponding input PDB file&lt;br /&gt;
&lt;br /&gt;
With this option, for every input pdb file, the program will selected automatically the flat or curved membrane boundaries, whichever had the lower calculated transfer energy.&amp;lt;/blockquote&amp;gt;Then run the program:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;~ak87/exa/PROGRAM/OPM-MEMBRANE/immers&amp;lt;1membrane.inp&amp;gt;rec-opm.out&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;datasub1&amp;lt;/code&amp;gt; file to extract residue numbers for the membrane placement in Maestro.&lt;br /&gt;
See ppm3_instructions.docx file in the program directory for more detail.&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Global_Matching_Sphere_Optimization&amp;diff=15378</id>
		<title>Global Matching Sphere Optimization</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Global_Matching_Sphere_Optimization&amp;diff=15378"/>
		<updated>2023-05-03T20:38:56Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Goal ==&lt;br /&gt;
To optimize your matching sphere (MS) setups getting more enrichment with fewer spheres.&lt;br /&gt;
== Description ==&lt;br /&gt;
The program performs optimization of matching spheres using genetic algorithm. It selects spheres from two sets:&lt;br /&gt;
* heavy atoms of xtal-lig &lt;br /&gt;
* spheres prepared by SPHGEN program&lt;br /&gt;
At each generation, N matching sphere sets are created, containing a maximum of M spheres each. Then retrospective docking is done for each set, and sets are ranked by the &lt;br /&gt;
&lt;br /&gt;
* enrichment (normalized logAUC, see [http://arxiv.org/abs/2210.10905 Ian&#039;s paper]), &lt;br /&gt;
* RMSD of the docked pose to the experimental one. &lt;br /&gt;
&lt;br /&gt;
After that, a quarter of sets &amp;quot;survive&amp;quot; and produce a new generation by direct transfer, mutations, and crossover. This process is repeated until enrichment, RMSD and minimum number of spheres do not change substantially in 10 generations.&lt;br /&gt;
&lt;br /&gt;
The program consists of two main modules:&lt;br /&gt;
* a Python script (&amp;lt;code&amp;gt;juggler.py&amp;lt;/code&amp;gt;) that performs MS generation, optimization, and ranking.&lt;br /&gt;
* a Bash script, that watches created directory structure, runs docking and processes docking results&lt;br /&gt;
== Setup &amp;amp; Running ==&lt;br /&gt;
So far, the program is running on Wynton. LMK if you are interested in launching it on Gimel or other clusters.&lt;br /&gt;
&lt;br /&gt;
The scripts and example config file are in &amp;lt;code&amp;gt;/wynton/group/bks/soft/juggler&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Preparation ===&lt;br /&gt;
Prepare &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; directory with any tools of your liking (blastermaster, dockopt etc). You will also need &amp;lt;code&amp;gt;rec.pdb&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;rec.crg.pdb&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xtal-lig.pdb&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ligands.names&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;decoys.names&amp;lt;/code&amp;gt; and a &amp;lt;code&amp;gt;sdi&amp;lt;/code&amp;gt; directory with the paths to ligand .tgz files. To get RMSD of xtal-lig docked poses to the experimental pose, your xtal-lig.pdb must have correct bond orders and atom valences. You can edit it in Schrodinger and save as &amp;lt;code&amp;gt;xtal-lig.pdb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Prepare &amp;lt;code&amp;gt;juggler_config.yml&amp;lt;/code&amp;gt; file. Put it into an empty directory.&lt;br /&gt;
&lt;br /&gt;
=== Running ===&lt;br /&gt;
Enter a screen environment so your run is not interrupted if you disconnect your SSH session. Then do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;source /wynton/group/bks/soft/python_envs/python3.8.5.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python /wynton/group/bks/soft/juggler/juggler.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can detach from the screen (Ctrl-A d).&lt;br /&gt;
&lt;br /&gt;
Open a new screen. In the same directory launch a docking daemon&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/wynton/group/bks/soft/juggler/rundockd-wynton-taskid.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can run other calculations on Wynton in the meantime, as Juggler will track the task IDs that it launched.&lt;br /&gt;
&lt;br /&gt;
The run will take few hours to ~2 days depending on the number of actives and decoys and the load of Wynton.&lt;br /&gt;
&lt;br /&gt;
=== Processing results ===&lt;br /&gt;
The script will print the paths to where three best matching sphere sets are:&lt;br /&gt;
&lt;br /&gt;
* best enrichment&lt;br /&gt;
* best RMSD&lt;br /&gt;
* best balanced metrics (highest enrichment, lowest RMSD and lowest Nsph).&lt;br /&gt;
&lt;br /&gt;
You can use &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; from the listed directories.&lt;br /&gt;
&lt;br /&gt;
You can also track the optimization progress running the following script in your working directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/wynton/group/bks/soft/juggler/plot_all_metrics.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It produces &amp;lt;code&amp;gt;combined_metrics.png&amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:Combined metrics plot from a GA run.png|thumb|Combined metrics plot from a GA run]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If not converged&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The program will stop after 200 generations if convergence is not reached. In case it takes too long you can stop it any time by pressing Ctrl-C. It doesn&#039;t mean that you have no results, though. Juggler generates &amp;lt;code&amp;gt;combined_metrics.dat&amp;lt;/code&amp;gt; file in the working directory, which contains metrics for all sets explored. It contains the following columns:&lt;br /&gt;
&lt;br /&gt;
Generations Set# NormLogAUC RMSD Nsph Combined_metrics&lt;br /&gt;
&lt;br /&gt;
You can paste its content into Excel, sort by the highest NormLogAUC and pick a MS set of your liking.&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Global_Matching_Sphere_Optimization&amp;diff=15377</id>
		<title>Global Matching Sphere Optimization</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Global_Matching_Sphere_Optimization&amp;diff=15377"/>
		<updated>2023-05-02T00:02:35Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Goal ==&lt;br /&gt;
To optimize your matching sphere (MS) setups getting more enrichment with fewer spheres.&lt;br /&gt;
== Description ==&lt;br /&gt;
The program performs optimization of matching spheres using genetic algorithm. It selects spheres from two sets:&lt;br /&gt;
* heavy atoms of xtal-lig &lt;br /&gt;
* spheres prepared by SPHGEN program&lt;br /&gt;
At each generation, N matching sphere sets are created, containing a maximum of M spheres each. Then retrospective docking is done for each set, and sets are ranked by the &lt;br /&gt;
&lt;br /&gt;
* enrichment (normalized logAUC, see [http://arxiv.org/abs/2210.10905 Ian&#039;s paper]), &lt;br /&gt;
* RMSD of the docked pose to the experimental one. &lt;br /&gt;
&lt;br /&gt;
After that, a quarter of sets &amp;quot;survive&amp;quot; and produce a new generation by direct transfer, mutations, and crossover. This process is repeated until enrichment, RMSD and minimum number of spheres do not change substantially in 10 generations.&lt;br /&gt;
&lt;br /&gt;
The program consists of two main modules:&lt;br /&gt;
* a Python script (&amp;lt;code&amp;gt;juggler.py&amp;lt;/code&amp;gt;) that performs MS generation, optimization, and ranking.&lt;br /&gt;
* a Bash script, that watches created directory structure, runs docking and processes docking results&lt;br /&gt;
== Setup &amp;amp; Running ==&lt;br /&gt;
So far, the program is running on Wynton. LMK if you are interested in launching it on Gimel or other clusters.&lt;br /&gt;
&lt;br /&gt;
The scripts and example config file are in &amp;lt;code&amp;gt;/wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/RELEASE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Preparation ===&lt;br /&gt;
Prepare &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; directory with any tools of your liking (blastermaster, dockopt etc). You will also need &amp;lt;code&amp;gt;rec.pdb&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;rec.crg.pdb&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xtal-lig.pdb&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ligands.names&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;decoys.names&amp;lt;/code&amp;gt; and a &amp;lt;code&amp;gt;sdi&amp;lt;/code&amp;gt; directory with the paths to ligand .tgz files. To get RMSD of xtal-lig docked poses to the experimental pose, your xtal-lig.pdb must have correct bond orders and atom valences. You can edit it in Schrodinger and save as &amp;lt;code&amp;gt;xtal-lig.pdb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Prepare &amp;lt;code&amp;gt;juggler_config.yml&amp;lt;/code&amp;gt; file. Put it into an empty directory.&lt;br /&gt;
&lt;br /&gt;
=== Running ===&lt;br /&gt;
Enter a screen environment so your run is not interrupted if you disconnect your SSH session. Then do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;source /wynton/group/bks/soft/python_envs/python3.8.5.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python /wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/RELEASE/juggler.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can detach from the screen (Ctrl-A d).&lt;br /&gt;
&lt;br /&gt;
Open a new screen. In the same directory launch a docking daemon&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/RELEASE/rundockd-wynton-taskid.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can run other calculations on Wynton in the meantime, as Juggler will track the task IDs that it launched.&lt;br /&gt;
&lt;br /&gt;
The run will take few hours to ~2 days depending on the number of actives and decoys and the load of Wynton.&lt;br /&gt;
&lt;br /&gt;
=== Processing results ===&lt;br /&gt;
The script will print the paths to where three best matching sphere sets are:&lt;br /&gt;
&lt;br /&gt;
* best enrichment&lt;br /&gt;
* best RMSD&lt;br /&gt;
* best balanced metrics (highest enrichment, lowest RMSD and lowest Nsph).&lt;br /&gt;
&lt;br /&gt;
You can use &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; from the listed directories.&lt;br /&gt;
&lt;br /&gt;
You can also track the optimization progress running the following script in your working directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/RELEASE/plot_all_metrics.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It produces &amp;lt;code&amp;gt;combined_metrics.png&amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:Combined metrics plot from a GA run.png|thumb|Combined metrics plot from a GA run]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If not converged&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The program will stop after 200 generations if convergence is not reached. In case it takes too long you can stop it any time by pressing Ctrl-C. It doesn&#039;t mean that you have no results, though. Juggler generates &amp;lt;code&amp;gt;combined_metrics.dat&amp;lt;/code&amp;gt; file in the working directory, which contains metrics for all sets explored. It contains the following columns:&lt;br /&gt;
&lt;br /&gt;
Generations Set# NormLogAUC RMSD Nsph Combined_metrics&lt;br /&gt;
&lt;br /&gt;
You can paste its content into Excel, sort by the highest NormLogAUC and pick a MS set of your liking.&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Global_Matching_Sphere_Optimization&amp;diff=15376</id>
		<title>Global Matching Sphere Optimization</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Global_Matching_Sphere_Optimization&amp;diff=15376"/>
		<updated>2023-05-02T00:01:45Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Goal ==&lt;br /&gt;
To optimize your matching sphere (MS) setups getting more enrichment with fewer spheres.&lt;br /&gt;
== Description ==&lt;br /&gt;
The program performs optimization of matching spheres using genetic algorithm. It selects spheres from two sets:&lt;br /&gt;
* heavy atoms of xtal-lig &lt;br /&gt;
* spheres prepared by SPHGEN program&lt;br /&gt;
At each generation, N matching sphere sets are created, containing a maximum of M spheres each. Then retrospective docking is done for each set, and sets are ranked by the &lt;br /&gt;
&lt;br /&gt;
* enrichment (normalized logAUC, see [http://arxiv.org/abs/2210.10905 Ian&#039;s paper]), &lt;br /&gt;
* RMSD of the docked pose to the experimental one. &lt;br /&gt;
&lt;br /&gt;
After that, a quarter of sets &amp;quot;survive&amp;quot; and produce a new generation by direct transfer, mutations, and crossover. This process is repeated until enrichment, RMSD and minimum number of spheres do not change substantially in 10 generations.&lt;br /&gt;
&lt;br /&gt;
The program consists of two main modules:&lt;br /&gt;
* a Python script (&amp;lt;code&amp;gt;juggler.py&amp;lt;/code&amp;gt;) that performs MS generation, optimization, and ranking.&lt;br /&gt;
* a Bash script, that watches created directory structure, runs docking and processes docking results&lt;br /&gt;
== Setup &amp;amp; Running ==&lt;br /&gt;
So far, the program is running on Wynton. LMK if you are interested in launching it on Gimel or other clusters.&lt;br /&gt;
&lt;br /&gt;
The scripts and example config file are in &amp;lt;code&amp;gt;/wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/RELEASE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Preparation ===&lt;br /&gt;
Prepare &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; directory with any tools of your liking (blastermaster, dockopt etc). You will also need &amp;lt;code&amp;gt;rec.pdb&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;rec.crg.pdb&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xtal-lig.pdb&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ligands.names&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;decoys.names&amp;lt;/code&amp;gt; and a &amp;lt;code&amp;gt;sdi&amp;lt;/code&amp;gt; directory with the paths to ligand .tgz files. To get RMSD of xtal-lig docked poses to the experimental pose, your xtal-lig.pdb must have correct bond orders and atom valences. You can edit it in Schrodinger and save as &amp;lt;code&amp;gt;xtal-lig.pdb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Prepare &amp;lt;code&amp;gt;juggler_config.yml&amp;lt;/code&amp;gt; file. Put it into an empty directory.&lt;br /&gt;
&lt;br /&gt;
=== Running ===&lt;br /&gt;
Enter a screen environment so your run is not interrupted if you disconnect your SSH session. Then do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;source /wynton/group/bks/soft/python_envs/python3.8.5.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python /wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/RELEASE/juggler.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can detach from the screen (Ctrl-A d).&lt;br /&gt;
&lt;br /&gt;
Open a new screen. In the same directory launch a docking daemon&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/RELEASE/rundockd-wynton-taskid.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can run other calculations on Wynton in the meantime, as Juggler will track the task IDs that it launched.&lt;br /&gt;
&lt;br /&gt;
The run will take few hours to ~2 days depending on the number of actives and decoys and the load of Wynton.&lt;br /&gt;
&lt;br /&gt;
=== Processing results ===&lt;br /&gt;
The script will print the paths to where three best matching sphere sets are:&lt;br /&gt;
&lt;br /&gt;
* best enrichment&lt;br /&gt;
* best RMSD&lt;br /&gt;
* best balanced metrics (highest enrichment, lowest RMSD and lowest Nsph).&lt;br /&gt;
&lt;br /&gt;
You can use &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; from the listed directories.&lt;br /&gt;
&lt;br /&gt;
You can also track the optimization progress running the following script in your working directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/RELEASE/plot_all_metrics.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It produces &amp;lt;code&amp;gt;combined_metrics.png&amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:Combined metrics plot from a GA run.png|thumb|Combined metrics plot from a GA run]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If not converged&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The program will stop after 200 generations if convergence is not reached. In case it takes too long you can stop it any time by pressing Ctrl-C. It doesn&#039;t mean that you have no results, though. Juggler generates &amp;lt;code&amp;gt;combined_metrics.dat&amp;lt;/code&amp;gt; file in the working directory, which contains metrics for all sets explored. It contains the following columns:&lt;br /&gt;
Generations Set# NormLogAUC RMSD Nsph Combined_metrics&lt;br /&gt;
You can paste its content into Excel, sort by the highest NormLogAUC and pick a MS set of your liking.&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Global_Matching_Sphere_Optimization&amp;diff=15375</id>
		<title>Global Matching Sphere Optimization</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Global_Matching_Sphere_Optimization&amp;diff=15375"/>
		<updated>2023-05-02T00:01:25Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Goal ==&lt;br /&gt;
To optimize your matching sphere (MS) setups getting more enrichment with fewer spheres.&lt;br /&gt;
== Description ==&lt;br /&gt;
The program performs optimization of matching spheres using genetic algorithm. It selects spheres from two sets:&lt;br /&gt;
* heavy atoms of xtal-lig &lt;br /&gt;
* spheres prepared by SPHGEN program&lt;br /&gt;
At each generation, N matching sphere sets are created, containing a maximum of M spheres each. Then retrospective docking is done for each set, and sets are ranked by the &lt;br /&gt;
&lt;br /&gt;
* enrichment (normalized logAUC, see [http://arxiv.org/abs/2210.10905 Ian&#039;s paper]), &lt;br /&gt;
* RMSD of the docked pose to the experimental one. &lt;br /&gt;
&lt;br /&gt;
After that, a quarter of sets &amp;quot;survive&amp;quot; and produce a new generation by direct transfer, mutations, and crossover. This process is repeated until enrichment, RMSD and minimum number of spheres do not change substantially in 10 generations.&lt;br /&gt;
&lt;br /&gt;
The program consists of two main modules:&lt;br /&gt;
* a Python script (&amp;lt;code&amp;gt;juggler.py&amp;lt;/code&amp;gt;) that performs MS generation, optimization, and ranking.&lt;br /&gt;
* a Bash script, that watches created directory structure, runs docking and processes docking results&lt;br /&gt;
== Setup &amp;amp; Running ==&lt;br /&gt;
So far, the program is running on Wynton. LMK if you are interested in launching it on Gimel or other clusters.&lt;br /&gt;
&lt;br /&gt;
The scripts and example config file are in &amp;lt;code&amp;gt;/wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/RELEASE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Preparation ===&lt;br /&gt;
Prepare &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; directory with any tools of your liking (blastermaster, dockopt etc). You will also need &amp;lt;code&amp;gt;rec.pdb&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;rec.crg.pdb&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xtal-lig.pdb&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ligands.names&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;decoys.names&amp;lt;/code&amp;gt; and a &amp;lt;code&amp;gt;sdi&amp;lt;/code&amp;gt; directory with the paths to ligand .tgz files. To get RMSD of xtal-lig docked poses to the experimental pose, your xtal-lig.pdb must have correct bond orders and atom valences. You can edit it in Schrodinger and save as &amp;lt;code&amp;gt;xtal-lig.pdb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Prepare &amp;lt;code&amp;gt;juggler_config.yml&amp;lt;/code&amp;gt; file. Put it into an empty directory.&lt;br /&gt;
&lt;br /&gt;
=== Running ===&lt;br /&gt;
Enter a screen environment so your run is not interrupted if you disconnect your SSH session. Then do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;source /wynton/group/bks/soft/python_envs/python3.8.5.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python /wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/RELEASE/juggler.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can detach from the screen (Ctrl-A d).&lt;br /&gt;
&lt;br /&gt;
Open a new screen. In the same directory launch a docking daemon&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/RELEASE/rundockd-wynton-taskid.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can run other calculations on Wynton in the meantime, as Juggler will track the task IDs that it launched.&lt;br /&gt;
&lt;br /&gt;
The run will take few hours to ~2 days depending on the number of actives and decoys and the load of Wynton.&lt;br /&gt;
&lt;br /&gt;
=== Processing results ===&lt;br /&gt;
The script will print the paths to where three best matching sphere sets are:&lt;br /&gt;
&lt;br /&gt;
* best enrichment&lt;br /&gt;
* best RMSD&lt;br /&gt;
* best balanced metrics (highest enrichment, lowest RMSD and lowest Nsph).&lt;br /&gt;
&lt;br /&gt;
You can use &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; from the listed directories.&lt;br /&gt;
&lt;br /&gt;
You can also track the optimization progress running the following script in your working directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/RELEASE/plot_all_metrics.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It produces &amp;lt;code&amp;gt;combined_metrics.png&amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:Combined metrics plot from a GA run.png|thumb|Combined metrics plot from a GA run]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If not converged&#039;&#039;&#039;&lt;br /&gt;
The program will stop after 200 generations if convergence is not reached. In case it takes too long you can stop it any time by pressing Ctrl-C. It doesn&#039;t mean that you have no results, though. Juggler generates &amp;lt;code&amp;gt;combined_metrics.dat&amp;lt;/code&amp;gt; file in the working directory, which contains metrics for all sets explored. It contains the following columns:&lt;br /&gt;
Generations Set# NormLogAUC RMSD Nsph Combined_metrics&lt;br /&gt;
You can paste its content into Excel, sort by the highest NormLogAUC and pick a MS set of your liking.&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Global_Matching_Sphere_Optimization&amp;diff=15374</id>
		<title>Global Matching Sphere Optimization</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Global_Matching_Sphere_Optimization&amp;diff=15374"/>
		<updated>2023-05-02T00:00:47Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Goal ==&lt;br /&gt;
To optimize your matching sphere (MS) setups getting more enrichment with fewer spheres.&lt;br /&gt;
== Description ==&lt;br /&gt;
The program performs optimization of matching spheres using genetic algorithm. It selects spheres from two sets:&lt;br /&gt;
* heavy atoms of xtal-lig &lt;br /&gt;
* spheres prepared by SPHGEN program&lt;br /&gt;
At each generation, N matching sphere sets are created, containing a maximum of M spheres each. Then retrospective docking is done for each set, and sets are ranked by the &lt;br /&gt;
&lt;br /&gt;
* enrichment (normalized logAUC, see [http://arxiv.org/abs/2210.10905 Ian&#039;s paper]), &lt;br /&gt;
* RMSD of the docked pose to the experimental one. &lt;br /&gt;
&lt;br /&gt;
After that, a quarter of sets &amp;quot;survive&amp;quot; and produce a new generation by direct transfer, mutations, and crossover. This process is repeated until enrichment, RMSD and minimum number of spheres do not change substantially in 10 generations.&lt;br /&gt;
&lt;br /&gt;
The program consists of two main modules:&lt;br /&gt;
* a Python script (&amp;lt;code&amp;gt;juggler.py&amp;lt;/code&amp;gt;) that performs MS generation, optimization, and ranking.&lt;br /&gt;
* a Bash script, that watches created directory structure, runs docking and processes docking results&lt;br /&gt;
== Setup &amp;amp; Running ==&lt;br /&gt;
So far, the program is running on Wynton. LMK if you are interested in launching it on Gimel or other clusters.&lt;br /&gt;
&lt;br /&gt;
The scripts and example config file are in &amp;lt;code&amp;gt;/wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/RELEASE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Preparation ===&lt;br /&gt;
Prepare &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; directory with any tools of your liking (blastermaster, dockopt etc). You will also need &amp;lt;code&amp;gt;rec.pdb&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;rec.crg.pdb&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xtal-lig.pdb&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ligands.names&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;decoys.names&amp;lt;/code&amp;gt; and a &amp;lt;code&amp;gt;sdi&amp;lt;/code&amp;gt; directory with the paths to ligand .tgz files. To get RMSD of xtal-lig docked poses to the experimental pose, your xtal-lig.pdb must have correct bond orders and atom valences. You can edit it in Schrodinger and save as &amp;lt;code&amp;gt;xtal-lig.pdb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Prepare &amp;lt;code&amp;gt;juggler_config.yml&amp;lt;/code&amp;gt; file. Put it into an empty directory.&lt;br /&gt;
&lt;br /&gt;
=== Running ===&lt;br /&gt;
Enter a screen environment so your run is not interrupted if you disconnect your SSH session. Then do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;source /wynton/group/bks/soft/python_envs/python3.8.5.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python /wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/RELEASE/juggler.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can detach from the screen (Ctrl-A d).&lt;br /&gt;
&lt;br /&gt;
Open a new screen. In the same directory launch a docking daemon&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/RELEASE/rundockd-wynton-taskid.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can run other calculations on Wynton in the meantime, as Juggler will track the task IDs that it launched.&lt;br /&gt;
&lt;br /&gt;
The run will take few hours to ~2 days depending on the number of actives and decoys and the load of Wynton.&lt;br /&gt;
&lt;br /&gt;
=== Processing results ===&lt;br /&gt;
The script will print the paths to where three best matching sphere sets are:&lt;br /&gt;
&lt;br /&gt;
* best enrichment&lt;br /&gt;
* best RMSD&lt;br /&gt;
* best balanced metrics (highest enrichment, lowest RMSD and lowest Nsph).&lt;br /&gt;
&lt;br /&gt;
You can use &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; from the listed directories.&lt;br /&gt;
&lt;br /&gt;
You can also track the optimization progress running the following script in your working directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/RELEASE/plot_all_metrics.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It produces &amp;lt;code&amp;gt;combined_metrics.png&amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:Combined metrics plot from a GA run.png|thumb|Combined metrics plot from a GA run]]&lt;br /&gt;
&lt;br /&gt;
* If not converged*&lt;br /&gt;
The program will stop after 200 generations if convergence is not reached. In case it takes too long you can stop it any time by pressing Ctrl-C. It doesn&#039;t mean that you have no results, though. Juggler generates &amp;lt;code&amp;gt;combined_metrics.dat&amp;lt;/code&amp;gt; file in the working directory, which contains metrics for all sets explored. It contains the following columns:&lt;br /&gt;
Generations Set# NormLogAUC RMSD Nsph Combined_metrics&lt;br /&gt;
You can paste its content into Excel, sort by the highest NormLogAUC and pick a MS set of your liking.&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Global_Matching_Sphere_Optimization&amp;diff=15373</id>
		<title>Global Matching Sphere Optimization</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Global_Matching_Sphere_Optimization&amp;diff=15373"/>
		<updated>2023-05-01T23:01:45Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Goal ==&lt;br /&gt;
To optimize your matching sphere (MS) setups getting more enrichment with fewer spheres.&lt;br /&gt;
== Description ==&lt;br /&gt;
The program performs optimization of matching spheres using genetic algorithm. It selects spheres from two sets:&lt;br /&gt;
* heavy atoms of xtal-lig &lt;br /&gt;
* spheres prepared by SPHGEN program&lt;br /&gt;
At each generation, N matching sphere sets are created, containing a maximum of M spheres each. Then retrospective docking is done for each set, and sets are ranked by the &lt;br /&gt;
&lt;br /&gt;
* enrichment (normalized logAUC, see [http://arxiv.org/abs/2210.10905 Ian&#039;s paper]), &lt;br /&gt;
* RMSD of the docked pose to the experimental one. &lt;br /&gt;
&lt;br /&gt;
After that, a quarter of sets &amp;quot;survive&amp;quot; and produce a new generation by direct transfer, mutations, and crossover. This process is repeated until enrichment, RMSD and minimum number of spheres do not change substantially in 10 generations.&lt;br /&gt;
&lt;br /&gt;
The program consists of two main modules:&lt;br /&gt;
* a Python script (&amp;lt;code&amp;gt;juggler.py&amp;lt;/code&amp;gt;) that performs MS generation, optimization, and ranking.&lt;br /&gt;
* a Bash script, that watches created directory structure, runs docking and processes docking results&lt;br /&gt;
== Setup &amp;amp; Running ==&lt;br /&gt;
So far, the program is running on Wynton. LMK if you are interested in launching it on Gimel or other clusters.&lt;br /&gt;
&lt;br /&gt;
The scripts and example config file are in &amp;lt;code&amp;gt;/wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/RELEASE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Preparation ===&lt;br /&gt;
Prepare &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; directory with any tools of your liking (blastermaster, dockopt etc). You will also need &amp;lt;code&amp;gt;rec.pdb&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;rec.crg.pdb&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xtal-lig.pdb&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ligands.names&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;decoys.names&amp;lt;/code&amp;gt; and a &amp;lt;code&amp;gt;sdi&amp;lt;/code&amp;gt; directory with the paths to ligand .tgz files. To get RMSD of xtal-lig docked poses to the experimental pose, your xtal-lig.pdb must have correct bond orders and atom valences. You can edit it in Schrodinger and save as &amp;lt;code&amp;gt;xtal-lig.pdb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Prepare &amp;lt;code&amp;gt;juggler_config.yml&amp;lt;/code&amp;gt; file. Put it into an empty directory.&lt;br /&gt;
&lt;br /&gt;
=== Running ===&lt;br /&gt;
Enter a screen environment so your run is not interrupted if you disconnect your SSH session. Then do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;source /wynton/group/bks/soft/python_envs/python3.8.5.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python /wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/RELEASE/juggler.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can detach from the screen (Ctrl-A d).&lt;br /&gt;
&lt;br /&gt;
Open a new screen. In the same directory launch a docking daemon&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/RELEASE/rundockd-wynton-taskid.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can run other calculations on Wynton in the meantime, as Juggler will track the task IDs that it launched.&lt;br /&gt;
&lt;br /&gt;
The run will take few hours to ~2 days depending on the number of actives and decoys and the load of Wynton.&lt;br /&gt;
&lt;br /&gt;
=== Processing results ===&lt;br /&gt;
The script will print the paths to where three best matching sphere sets are:&lt;br /&gt;
&lt;br /&gt;
* best enrichment&lt;br /&gt;
* best RMSD&lt;br /&gt;
* best balanced metrics (highest enrichment, lowest RMSD and lowest Nsph).&lt;br /&gt;
&lt;br /&gt;
You can use &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; from the listed directories.&lt;br /&gt;
&lt;br /&gt;
You can also track the optimization progress running the following script in your working directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/RELEASE/plot_all_metrics.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It produces &amp;lt;code&amp;gt;combined_metrics.png&amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:Combined metrics plot from a GA run.png|thumb|Combined metrics plot from a GA run]]&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=File:Combined_metrics_plot_from_a_GA_run.png&amp;diff=15372</id>
		<title>File:Combined metrics plot from a GA run.png</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=File:Combined_metrics_plot_from_a_GA_run.png&amp;diff=15372"/>
		<updated>2023-05-01T23:01:24Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;combined metrics plot from a GA run&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Global_Matching_Sphere_Optimization&amp;diff=15371</id>
		<title>Global Matching Sphere Optimization</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Global_Matching_Sphere_Optimization&amp;diff=15371"/>
		<updated>2023-05-01T19:52:22Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Goal ==&lt;br /&gt;
To optimize your matching sphere (MS) setups getting more enrichment with fewer spheres.&lt;br /&gt;
== Description ==&lt;br /&gt;
The program performs optimization of matching spheres using genetic algorithm. It selects spheres from two sets:&lt;br /&gt;
* heavy atoms of xtal-lig &lt;br /&gt;
* spheres prepared by SPHGEN program&lt;br /&gt;
At each generation, N matching sphere sets are created, containing a maximum of M spheres each. Then retrospective docking is done for each set, and sets are ranked by the &lt;br /&gt;
&lt;br /&gt;
* enrichment (normalized logAUC, see [http://arxiv.org/abs/2210.10905 Ian&#039;s paper]), &lt;br /&gt;
* RMSD of the docked pose to the experimental one. &lt;br /&gt;
&lt;br /&gt;
After that, a quarter of sets &amp;quot;survive&amp;quot; and produce a new generation by direct transfer, mutations, and crossover. This process is repeated until enrichment, RMSD and minimum number of spheres do not change substantially in 10 generations.&lt;br /&gt;
&lt;br /&gt;
The program consists of two main modules:&lt;br /&gt;
* a Python script (&amp;lt;code&amp;gt;juggler.py&amp;lt;/code&amp;gt;) that performs MS generation, optimization, and ranking.&lt;br /&gt;
* a Bash script, that watches created directory structure, runs docking and processes docking results&lt;br /&gt;
== Setup &amp;amp; Running ==&lt;br /&gt;
So far, the program is running on Wynton. LMK if you are interested in launching it on Gimel or other clusters.&lt;br /&gt;
&lt;br /&gt;
The scripts and example config file are in &amp;lt;code&amp;gt;/wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/RELEASE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Preparation ===&lt;br /&gt;
Prepare &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; directory with any tools of your liking (blastermaster, dockopt etc). You will also need &amp;lt;code&amp;gt;rec.pdb&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;rec.crg.pdb&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xtal-lig.pdb&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ligands.names&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;decoys.names&amp;lt;/code&amp;gt; and a &amp;lt;code&amp;gt;sdi&amp;lt;/code&amp;gt; directory with the paths to ligand .tgz files. To get RMSD of xtal-lig docked poses to the experimental pose, your xtal-lig.pdb must have correct bond orders and atom valences. You can edit it in Schrodinger and save as &amp;lt;code&amp;gt;xtal-lig.pdb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Prepare &amp;lt;code&amp;gt;juggler_config.yml&amp;lt;/code&amp;gt; file. Put it into an empty directory.&lt;br /&gt;
&lt;br /&gt;
=== Running ===&lt;br /&gt;
Enter a screen environment so your run is not interrupted if you disconnect your SSH session. Then do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;source /wynton/group/bks/soft/python_envs/python3.8.5.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python /wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/RELEASE/juggler.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can detach from the screen (Ctrl-A d).&lt;br /&gt;
&lt;br /&gt;
Open a new screen. In the same directory launch a docking daemon&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/RELEASE/rundockd-wynton-taskid.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can run other calculations on Wynton in the meantime, as Juggler will track the task IDs that it launched.&lt;br /&gt;
&lt;br /&gt;
The run will take few hours to ~2 days depending on the number of actives and decoys and the load of Wynton.&lt;br /&gt;
&lt;br /&gt;
=== Processing results ===&lt;br /&gt;
The script will print the paths to where three best matching sphere sets are:&lt;br /&gt;
&lt;br /&gt;
* best enrichment&lt;br /&gt;
* best RMSD&lt;br /&gt;
* best balanced metrics (highest enrichment, lowest RMSD and lowest Nsph).&lt;br /&gt;
&lt;br /&gt;
You can use &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; from the listed directories.&lt;br /&gt;
&lt;br /&gt;
You can also track the optimization progress running the following script in your working directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/RELEASE/plot_all_metrics.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It produces &amp;lt;code&amp;gt;combined_metrics.png&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Global_Matching_Sphere_Optimization&amp;diff=15370</id>
		<title>Global Matching Sphere Optimization</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Global_Matching_Sphere_Optimization&amp;diff=15370"/>
		<updated>2023-04-30T07:06:18Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
To optimize your matching sphere (MS) setups getting more enrichment with fewer spheres.&lt;br /&gt;
== Description ==&lt;br /&gt;
The program performs optimization of matching spheres using genetic algorithm. It selects spheres from two sets:&lt;br /&gt;
* heavy atoms of xtal-lig &lt;br /&gt;
* spheres prepared by SPHGEN program&lt;br /&gt;
At each generation, N matching sphere sets are created, containing a maximum of M spheres each. Then retrospective docking is done for each set, and sets are ranked by the enrichment, RMSD of the docked pose to the experimental one. After that, a quarter of sets &amp;quot;survive&amp;quot; and produce a new generation by direct transfer, mutations, and crossover. This process is repeated until enrichment, RMSD and minimum number of spheres do not change substantially in 10 generations.&lt;br /&gt;
&lt;br /&gt;
The program consists of two main modules:&lt;br /&gt;
* a Python script (&amp;lt;code&amp;gt;juggler.py&amp;lt;/code&amp;gt;) that performs MS generation, optimization, and ranking.&lt;br /&gt;
* a Bash script, that watches created directory structure, runs docking and processes docking results&lt;br /&gt;
== Setup ==&lt;br /&gt;
So far, the program is running on Wynton. LMK if you are interested in launching it on Gimel or other clusters.&lt;br /&gt;
&lt;br /&gt;
Prepare &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; directory with any tools of your liking (blastermaster, dockopt etc). You will also need &amp;lt;code&amp;gt;rec.pdb&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;rec.crg.pdb&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;xtal-lig.pdb&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ligands.names&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;decoys.names&amp;lt;/code&amp;gt; and a &amp;lt;code&amp;gt;sdi&amp;lt;/code&amp;gt; directory with the paths to ligand .tgz files. To get RMSD of xtal-lig docked poses to the experimental pose, your xtal-lig.pdb must have correct bond orders and atom valences. You can edit it in Schrodinger and save as &amp;lt;code&amp;gt;xtal-lig.pdb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Prepare &amp;lt;code&amp;gt;juggler_config.yml&amp;lt;/code&amp;gt; file. Put it into an empty directory.&lt;br /&gt;
&lt;br /&gt;
Enter a screen environment so your run is not interrupted if you disconnect your SSH session. Then do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;source /wynton/group/bks/soft/python_envs/python3.8.5.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python /wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/RELEASE/juggler.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can detach from the screen (Ctrl-A d).&lt;br /&gt;
&lt;br /&gt;
Open a new screen. In the same directory launch a docking daemon&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/RELEASE/rundockd-wynton-taskid.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can run other calculations on Wynton in the meantime, as Juggler will track the task IDs that it launched.&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Global_Matching_Sphere_Optimization&amp;diff=15369</id>
		<title>Global Matching Sphere Optimization</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Global_Matching_Sphere_Optimization&amp;diff=15369"/>
		<updated>2023-04-30T07:01:38Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Goal ==&lt;br /&gt;
To optimize your matching sphere (MS) setups getting more enrichment with fewer spheres.&lt;br /&gt;
== Description ==&lt;br /&gt;
The program performs optimization of matching spheres using genetic algorithm. It selects spheres from two sets:&lt;br /&gt;
* heavy atoms of xtal-lig &lt;br /&gt;
* spheres prepared by SPHGEN program&lt;br /&gt;
At each generation, N matching sphere sets are created, containing a maximum of M spheres each. Then retrospective docking is done for each set, and sets are ranked by the enrichment, RMSD of the docked pose to the experimental one. After that, a quarter of sets &amp;quot;survive&amp;quot; and produce a new generation by direct transfer, mutations, and crossover. This process is repeated until enrichment, RMSD and minimum number of spheres do not change substantially in 10 generations.&lt;br /&gt;
The program consists of two main modules:&lt;br /&gt;
* a Python script (juggler.py) that performs MS generation, optimization, and ranking.&lt;br /&gt;
* a Bash script, that watches created directory structure, runs docking and processes docking results&lt;br /&gt;
== Setup ==&lt;br /&gt;
So far, the program is running on Wynton. LMK if you are interested in launching it on Gimel or other clusters.&lt;br /&gt;
Prepare dockfiles directory with any tools of your liking (blastermaster, dockopt etc). You will also need rec.pdb, rec.crg.pdb, xtal-lig.pdb, ligands.names, decoys.names and a &amp;quot;sdi&amp;quot; directory with the paths to ligand .tgz files. To get RMSD of xtal-lig docked poses to the experimental pose, your xtal-lig.pdb must have correct bond orders and atom valences. You can edit it in Schrodinger and save as xtal-lig.pdb.&lt;br /&gt;
Prepare juggler_config.yml file. Put it into an empty directory.&lt;br /&gt;
Enter a screen environment so your run is not interrupted if you disconnect your SSH session. Then do:&lt;br /&gt;
source /wynton/group/bks/soft/python_envs/python3.8.5.sh&lt;br /&gt;
python /wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/RELEASE/juggler.py&lt;br /&gt;
You can detach from the screen (Ctrl-A d).&lt;br /&gt;
Open a new screen. In the same directory launch a docking daemon&lt;br /&gt;
/wynton/home/irwin/ak87/ak87/UCSF/NEOCORTEX/SCRIPTS/RELEASE/rundockd-wynton-taskid.sh&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Global_Matching_Sphere_Optimization&amp;diff=15368</id>
		<title>Global Matching Sphere Optimization</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Global_Matching_Sphere_Optimization&amp;diff=15368"/>
		<updated>2023-04-30T06:59:10Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Goal ==&lt;br /&gt;
To optimize your matching sphere (MS) setups getting more enrichment with fewer spheres.&lt;br /&gt;
== Description ==&lt;br /&gt;
The program performs optimization of matching spheres using genetic algorithm. It selects spheres from two sets:&lt;br /&gt;
* heavy atoms of xtal-lig &lt;br /&gt;
* spheres prepared by SPHGEN program&lt;br /&gt;
At each generation, N matching sphere sets are created, containing a maximum of M spheres each. Then retrospective docking is done for each set, and sets are ranked by the enrichment, RMSD of the docked pose to the experimental one. After that, a quarter of sets &amp;quot;survive&amp;quot; and produce a new generation by direct transfer, mutations, and crossover. This process is repeated until enrichment, RMSD and minimum number of spheres do not change substantially in 10 generations.&lt;br /&gt;
The program consists of two main modules:&lt;br /&gt;
* a Python script (juggler.py) that performs MS generation, optimization, and ranking.&lt;br /&gt;
* a Bash script, that watches created directory structure, runs docking and processes docking results&lt;br /&gt;
== Setup ==&lt;br /&gt;
So far, the program is running on Wynton. LMK if you are interested in launching it on Gimel or other clusters.&lt;br /&gt;
Prepare dockfiles directory with any tools of your liking (blastermaster, dockopt etc). You will also need rec.pdb, rec.crg.pdb, xtal-lig.pdb, ligands.names, decoys.names and a &amp;quot;sdi&amp;quot; directory with the paths to ligand .tgz files. To get RMSD of xtal-lig docked poses to the experimental pose, your xtal-lig.pdb must have correct bond orders and atom valences. You can edit it in Schrodinger and save as xtal-lig.pdb.&lt;br /&gt;
Prepare juggler_config.yml file. Put it into an empty directory.&lt;br /&gt;
Enter a screen environment so your run is not interrupted if you disconnect your SSH session. Then do:&lt;br /&gt;
source /wynton/group/bks/soft/python_envs/python3.8.5.sh&lt;br /&gt;
python ../../juggler-v0.7.py&lt;br /&gt;
You can detach from the screen (Ctrl-A d).&lt;br /&gt;
Open a new screen. In the same directory launch a docking daemon&lt;br /&gt;
sh ../../rundockd-wynton-taskid.sh&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Global_Matching_Sphere_Optimization&amp;diff=15367</id>
		<title>Global Matching Sphere Optimization</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Global_Matching_Sphere_Optimization&amp;diff=15367"/>
		<updated>2023-04-30T06:58:48Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: Created page with &amp;quot;== Goal == To optimize your matching sphere (MS) setups getting more enrichment with fewer spheres. == Description == The program performs optimization of matching spheres using genetic algorithm. It selects spheres from two sets: * heavy atoms of xtal-lig  * spheres prepared by SPHGEN program At each generation, N matching sphere sets are created, containing a maximum of M spheres each. Then retrospective docking is done for each set, and sets are ranked by the enrichme...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Goal ==&lt;br /&gt;
To optimize your matching sphere (MS) setups getting more enrichment with fewer spheres.&lt;br /&gt;
== Description ==&lt;br /&gt;
The program performs optimization of matching spheres using genetic algorithm. It selects spheres from two sets:&lt;br /&gt;
* heavy atoms of xtal-lig &lt;br /&gt;
* spheres prepared by SPHGEN program&lt;br /&gt;
At each generation, N matching sphere sets are created, containing a maximum of M spheres each. Then retrospective docking is done for each set, and sets are ranked by the enrichment, RMSD of the docked pose to the experimental one. After that, a quarter of sets &amp;quot;survive&amp;quot; and produce a new generation by direct transfer, mutations, and crossover. This process is repeated until enrichment, RMSD and minimum number of spheres do not change substantially in 10 generations.&lt;br /&gt;
The program consists of two main modules:&lt;br /&gt;
a Py&lt;br /&gt;
* thon script (juggler.py) that performs MS generation, optimization, and ranking.&lt;br /&gt;
* a Bas&lt;br /&gt;
h script, that watches created directory structure, runs docking and processes docking results&lt;br /&gt;
== Setup ==&lt;br /&gt;
So far, the program is running on Wynton. LMK if you are interested in launching it on Gimel or other clusters.&lt;br /&gt;
Prepare dockfiles directory with any tools of your liking (blastermaster, dockopt etc). You will also need rec.pdb, rec.crg.pdb, xtal-lig.pdb, ligands.names, decoys.names and a &amp;quot;sdi&amp;quot; directory with the paths to ligand .tgz files. To get RMSD of xtal-lig docked poses to the experimental pose, your xtal-lig.pdb must have correct bond orders and atom valences. You can edit it in Schrodinger and save as xtal-lig.pdb.&lt;br /&gt;
Prepare juggler_config.yml file. Put it into an empty directory.&lt;br /&gt;
Enter a screen environment so your run is not interrupted if you disconnect your SSH session. Then do:&lt;br /&gt;
source /wynton/group/bks/soft/python_envs/python3.8.5.sh&lt;br /&gt;
python ../../juggler-v0.7.py&lt;br /&gt;
You can detach from the screen (Ctrl-A d).&lt;br /&gt;
Open a new screen. In the same directory launch a docking daemon&lt;br /&gt;
sh ../../rundockd-wynton-taskid.sh&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Membrane_Modeling&amp;diff=15081</id>
		<title>Membrane Modeling</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Membrane_Modeling&amp;diff=15081"/>
		<updated>2023-01-10T17:59:57Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Written by Stefan Gahbauer, 2019/11/03&lt;br /&gt;
&lt;br /&gt;
In order to account for ligand desolvation and electrostatic interactions in the low-dielectric environment of the hydrophobic membrane core, a lipid-bilayer is generated around the target receptor and included in the docking score grid generation.&lt;br /&gt;
Aiming at a fast, robust and computationally effective equilibration of the lipid bilayer around the embedded transmembrane receptor, coarse-grained (CG) molecular dynamics (MD) simulations and (if needed) subsequent atomistic simulations are employed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Required software and datasets =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gromacs&#039;&#039;&#039; (v5 or newer) - Molecular Dynamics software package (http://manual.gromacs.org/)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CHARMM36m force field&#039;&#039;&#039; (http://mackerell.umaryland.edu/charmm_ff.shtml)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MARTINI&#039;&#039;&#039; Coarse-grained force field parameters(http://cgmartini.nl/)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DSSP&#039;&#039;&#039; - Secondary Structure assignment (https://swift.cmbi.umcn.nl/gv/dssp/ , https://anaconda.org/salilab/dssp)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;martinize.py&#039;&#039;&#039; - Coarse-graining atomistic protein structures (http://cgmartini.nl/index.php/tools2/proteins-and-bilayers)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;insane.py&#039;&#039;&#039; - INSerting proteins in coarse-grained MembrANE (http://cgmartini.nl/index.php/tools2/proteins-and-bilayers)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;initram.sh&#039;&#039;&#039; and &#039;&#039;&#039;backward.py&#039;&#039;&#039; - Conversion of coarse-grained system to atomistic resolution (http://cgmartini.nl/index.php/tools2/resolution-transformation)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 1) Setting up the coarse-grained system =&lt;br /&gt;
&lt;br /&gt;
This is automated in the script:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/0001-prepare-protein-CG-membrane.sh&lt;br /&gt;
&lt;br /&gt;
== 1.1) Prepare your files ==&lt;br /&gt;
&lt;br /&gt;
Copy the script above to your working directory.&lt;br /&gt;
&lt;br /&gt;
Copy your rec.pdb to your working directory.&lt;br /&gt;
&lt;br /&gt;
If your rec.pdb has gaps, e.g. unresolved loops between transmembrane helices in case of GPCRs, try to model missing residues.&lt;br /&gt;
&lt;br /&gt;
One way is to use MODELLER following https://salilab.org/modeller/wiki/Missing%20residues.&lt;br /&gt;
&lt;br /&gt;
Corresponding input scripts for modeller can be found in:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/modeller&lt;br /&gt;
&lt;br /&gt;
== 1.2) Run the script ==&lt;br /&gt;
&lt;br /&gt;
Login to gimel2.&lt;br /&gt;
&lt;br /&gt;
./0001-prepare-protein-CG-membrane.sh&lt;br /&gt;
&lt;br /&gt;
The script reads rec.pdb and copies all other required files from &lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/gromacs&lt;br /&gt;
&lt;br /&gt;
=== Workflow ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;a.&#039;&#039;&#039; Generate CHARMM36m force field parameters of your protein in a Gromacs-readable format. &lt;br /&gt;
&lt;br /&gt;
Used tool: gmx pdb2gmx &lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;pdb2gmx&#039;&#039; directory&lt;br /&gt;
&lt;br /&gt;
-conf.gro / conf.pdb - Gromacs coordinate file&lt;br /&gt;
&lt;br /&gt;
-topol.top / Protein-atomistic.itp - Gromacs topology file, i.e. force field description of your input structure&lt;br /&gt;
&lt;br /&gt;
-posre.itp - Position restraints for heavy atoms of atomistic protein strucutre.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;b.&#039;&#039;&#039; Build coarse-grained structure&lt;br /&gt;
&lt;br /&gt;
Used tool: martinize.py&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-chain_.ssd - Output from the DSSP program that is called by martinize.py&lt;br /&gt;
&lt;br /&gt;
-prot-cg.pdb - Coarse-grained protein structure&lt;br /&gt;
&lt;br /&gt;
-prot-cg.top - Coarse-grained Martini topology of system&lt;br /&gt;
&lt;br /&gt;
-Protein.itp - Coarse-grained Martini description of Protein structure&lt;br /&gt;
&lt;br /&gt;
-prot-rot.pdb - Coarse-grained protein structure aligned along z-axis of the simulation box according to the proteins first principal component axis. This ensures the correct placement of the protein during membrane preparation. &#039;&#039;&#039;You may have to adjust the orientation of your input structure prior to membrane modeling.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;c.&#039;&#039;&#039; Build coarse-grained membrane&lt;br /&gt;
&lt;br /&gt;
Used tool: insane.py&lt;br /&gt;
&lt;br /&gt;
Here, a lipid bilayer will be created around the protein structure (in the x/y-plane) and water will be added to the system. The default box shape is rectangular and the size is set to x,y=10nm, z=11nm. This can be changed in the ./insane.py command line. The default lipid type is POPC, you can change that to arbitrary lipid compositions using the -l and -u options of of insane.py.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-out.top / topol-cg.top - Topology of coarse-grained system&lt;br /&gt;
&lt;br /&gt;
-cg-membrane.gro/.pdb - Coarse-grained system coordinates. &#039;&#039;&#039;Carefully inspect and visualize the cg-membrane.pdb.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use PyMOL to check if you&#039;re protein is embedded correctly in the lipid bilayer.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 2) Simulating the coarse-grained system =&lt;br /&gt;
&lt;br /&gt;
This is automated in the script:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/0002-run-CG-Minimization-and-MD.sh&lt;br /&gt;
&lt;br /&gt;
== 2.1) Run the script ==&lt;br /&gt;
&lt;br /&gt;
Copy the script above to your working directory.&lt;br /&gt;
&lt;br /&gt;
./0002-run-CG-Minimization-and-MD.sh&lt;br /&gt;
&lt;br /&gt;
=== Workflow ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;a.&#039;&#039;&#039; Minimize coarse-grained system&lt;br /&gt;
&lt;br /&gt;
Used tools: gmx grompp , gmx mdrun&lt;br /&gt;
&lt;br /&gt;
gmx grompp generates a single .tpr file that contains all information necessary for running a MD simulation or minimization using gmx mdrun.&lt;br /&gt;
&lt;br /&gt;
Minimization parameters are provided in martini_new-rf_min.mdp. The system will be minimized in 500 steps using steepest descent. The protein structure will be frozen during minimization.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-min.tpr - MD run input file&lt;br /&gt;
&lt;br /&gt;
-min.log - Output log file from minimization&lt;br /&gt;
&lt;br /&gt;
-min.trr - Minimization trajectory&lt;br /&gt;
&lt;br /&gt;
-min.gro - Minimized system coordinates&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;b.&#039;&#039;&#039; Simulate coarse-grained system&lt;br /&gt;
&lt;br /&gt;
MD simulation parameters are provided in martini_v2.x_new-rf.mdp. Strong position restraints are applied on the protein structure during the simulation. The system will be simulated for 50ns.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-md.tpr - MD run input file&lt;br /&gt;
&lt;br /&gt;
-md.log - Output log file from simulation&lt;br /&gt;
&lt;br /&gt;
-md.trr - lossless trajectory of simulation&lt;br /&gt;
&lt;br /&gt;
-md.xtc - coordinates of simulation trajectory&lt;br /&gt;
&lt;br /&gt;
-md.gro - coordinates of final simulation snapshot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The simulation will run for roughly 3 hours.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 3) Converting coarse-grained system to atomistic resolution and select lipid atoms for grid generation =&lt;br /&gt;
&lt;br /&gt;
This is automated in the script:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/0003-backmap-and-lpd-selection.sh&lt;br /&gt;
&lt;br /&gt;
== 3.1) Run the script ==&lt;br /&gt;
&lt;br /&gt;
Copy the script above to your working directory.&lt;br /&gt;
&lt;br /&gt;
./0003-backmap-and-lpd-selection.sh&lt;br /&gt;
&lt;br /&gt;
=== Workflow ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;a.&#039;&#039;&#039; Backmapping from coarse-grained to atomistic&lt;br /&gt;
&lt;br /&gt;
Used tool: gmx trjconv, initram.sh&lt;br /&gt;
&lt;br /&gt;
gmx trjconv can perform a variety of conversions of MD trajectory, e.g. making molecules broken over the periodic boundary conditions whole again. &lt;br /&gt;
&lt;br /&gt;
initram.sh calls the backward.py program which performs the backmapping of input coarse-grained to atomistic systems, and performs a small series of short minimizations and simulations to relax the backmapped system.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;backmap&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-0-backmapped.gro / projected.gro - initial backmapped coordinates&lt;br /&gt;
&lt;br /&gt;
-backmapped.top - Topology of atomistic system&lt;br /&gt;
&lt;br /&gt;
-1-EM*/2-EM* - Output from minimizations &lt;br /&gt;
&lt;br /&gt;
-3-mdpr*/4-mdpr*/5-mdpr*/6-mdpr* - Output from simulations&lt;br /&gt;
&lt;br /&gt;
-backmapped.gro - Coordinates of final backmapped and relaxed system&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This may need a few attempts to work all the way through. There is a while-loop that only stops until all relaxation steps have finished.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;b.&#039;&#039;&#039; Replacing backmapped protein with initial atomistic protein structure&lt;br /&gt;
&lt;br /&gt;
Used tool: PyMOL script align.pml&lt;br /&gt;
&lt;br /&gt;
The pymol script will align the initial &amp;quot;Gromacs&amp;quot;-protein structure (conf.pdb) onto the backmapped structure and combine the fitted protein coordinates with the coordinates of the lipid and solvent environment.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;backmap/prepare_AA_system&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-conf-fitted.pdb - Fitted initial protein structure&lt;br /&gt;
&lt;br /&gt;
-backmapped-environment.pdb - All membrane and water coordinates&lt;br /&gt;
&lt;br /&gt;
-fitted_system.pdb - Complete system containing fitted protein and environment coordinates&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure that fitted_system.pdb has the same number of coordinates as backmapped-mol.pdb.&#039;&#039;&#039; If there is a discrepancy there might be an issue with the PyMOL version you&#039;re using to run align.pml. Using PyMOL v2 or newer seems to avoid any issues. You can also generate backmapped-environment.pdb manually by taking all POPC and Water cooridnates from backmapped-mol.pdb.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;c.&#039;&#039;&#039; Run minimizations of atomistic system&lt;br /&gt;
&lt;br /&gt;
Used tools: gmx grompp, gmx mdrun&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;backmap/prepare_AA_system&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
Tow minimizations will be calculated. &lt;br /&gt;
&lt;br /&gt;
1) Minimization with frozen protein coordinates: 1,500 steps steepest descent (min_freeze.mdp).&lt;br /&gt;
&lt;br /&gt;
-min_freeze* - Output files of first minimization&lt;br /&gt;
&lt;br /&gt;
2) Minimization of full system: 500 steps (min.mdp).&lt;br /&gt;
&lt;br /&gt;
-min* - Output files of second minimization&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;d.&#039;&#039;&#039; Select lipid atoms for DOCK grid generation&lt;br /&gt;
&lt;br /&gt;
Used tools: PyMOL script prepare.pml&lt;br /&gt;
&lt;br /&gt;
This will select carbon and hydrogen atoms of the hydrophobic lipid tail segments in a radius of 1.7 nm around the protein and assign them to the atom type &amp;quot;LPD&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You need to provide the rec.pdb to want to use for docking (potentially with missing loops) at that step as xtal-prot.pdb&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;backmap/prepare_AA_system/prepare_min&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-shell-LPD.pdb - all LPD atoms selected for grid generation&lt;br /&gt;
&lt;br /&gt;
Add these coordinates to your docking protein structure and provide a amb.crg.oxt file adding&lt;br /&gt;
&lt;br /&gt;
C     lpd        0.000     LIPID SPHERE&lt;br /&gt;
&lt;br /&gt;
Now you can run blastermaster.&lt;br /&gt;
&lt;br /&gt;
= Membrane modelling in Schrodinger =&lt;br /&gt;
Written by Andrii Kyrylchuk, 2022/04/20&lt;br /&gt;
&lt;br /&gt;
== MD of protein and membrane ==&lt;br /&gt;
Import structure &#039;&#039;&#039;without&#039;&#039;&#039; ligand, use &amp;lt;u&amp;gt;Preparation wizard&amp;lt;/u&amp;gt; as described in &amp;quot;Code for Controls...&amp;quot;  to model missing loops and capping.&lt;br /&gt;
&lt;br /&gt;
Then open &amp;lt;u&amp;gt;System Builder&amp;lt;/u&amp;gt;, click &amp;lt;code&amp;gt;Setup membrane&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to the website https://opm.phar.umich.edu/proteins/ and find your protein. Copy residue numbers from the bottom of the page to the field &amp;lt;code&amp;gt;Transmembrane atoms...&amp;lt;/code&amp;gt;. The format is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;res.num 76-97,112-136,141,...&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click &amp;lt;code&amp;gt;Place Automatically&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt;. Then click &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt;. Examine lipids and solvent after run completes.&lt;br /&gt;
&lt;br /&gt;
Then use &amp;lt;u&amp;gt;Molecular Dynamics&amp;lt;/u&amp;gt; menu to set up the calculation. Select prepared system, click &amp;lt;code&amp;gt;Load&amp;lt;/code&amp;gt; on top of the menu. Put simulation time of 5 ns, &amp;lt;code&amp;gt;Advanced Options&amp;lt;/code&amp;gt; -- &amp;lt;code&amp;gt;Restraints&amp;lt;/code&amp;gt; -- &amp;lt;code&amp;gt;Add.&amp;lt;/code&amp;gt; Select protein, and put &amp;lt;code&amp;gt;Force Constant&amp;lt;/code&amp;gt; of 100, click &amp;lt;code&amp;gt;Apply&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;OK.&amp;lt;/code&amp;gt; Then click down arrow left of the &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt; button in the parent window and click &amp;lt;code&amp;gt;Write&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;NOTE&#039;&#039;&#039;: In my experience, restrained MD runs with NgPT in Schrodinger often fail with the following message:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&#039;&#039;Allowed momentum exceeded on 17 particles.&#039;&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This seems to be related to the interference of restraints and the ensemble, as no such error is observed if no restraints are imposed, or if NVT ensemble is used. Still, NgPT ensemble is important for correct membrane sampling, because simulations at NVT long enough to permit membrane relaxation, lead to the smearing of the lipid bilayer and the formation of empty space.&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;If the mentioned problem occurs, import the last coordinates of the run (*-out.cms) into Maestro, open Minimization menu, load the structure from the workspace, and apply restraints on lipid and protein (force restraint of 10 is usually enough). Then run a minimization for 100 ps, and try to run NgPT MD starting from the optimized structure.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;TO CHECK&#039;&#039;&#039;: NPT ensemble.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Copy the project folder (desmond_md_job_X) to gimel, login to &amp;lt;u&amp;gt;gimel5&amp;lt;/u&amp;gt;, edit desmond_md_job_X.sh: delete &amp;lt;code&amp;gt;-lic DESMOND_GPGPU:16&amp;lt;/code&amp;gt; and insert &amp;lt;code&amp;gt;-HOST gimel5.gpu&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;gimel5.heavygpu&amp;lt;/code&amp;gt;). Export &amp;lt;code&amp;gt;$SCHRODINGER&amp;lt;/code&amp;gt; variable:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SCHRODINGER=/nfs/soft2/schrodinger/2023-3/&amp;lt;/code&amp;gt; (or a newer version)&lt;br /&gt;
&lt;br /&gt;
Run .sh file, and your task will be submitted to a queue. For my system it took 1.5 hr to complete.&lt;br /&gt;
&lt;br /&gt;
Download the project folder to your PC, open Maestro, click &amp;lt;code&amp;gt;Import  structure&amp;lt;/code&amp;gt; and open &amp;lt;code&amp;gt;-out.cms&amp;lt;/code&amp;gt;, click on &amp;lt;code&amp;gt;T&amp;lt;/code&amp;gt; icon at the new entry in project table and click &amp;lt;code&amp;gt;Display Trajectory Snapshots&amp;lt;/code&amp;gt;. Select the last one, click &amp;lt;code&amp;gt;Display&amp;lt;/code&amp;gt; and check if the protein did not change position during MD run, then click &amp;lt;code&amp;gt;Export&amp;lt;/code&amp;gt;, to Project Table, Frames Selected only. You will get a new entry in the Project Table. Export it to a &amp;lt;code&amp;gt;.pdb&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
== Preparation of the structure for Blastermaster ==&lt;br /&gt;
Use &amp;lt;code&amp;gt;prepare.pml&amp;lt;/code&amp;gt; script. You need to provide the &amp;lt;code&amp;gt;rec.pdb&amp;lt;/code&amp;gt; to want to use for docking (potentially with missing loops) at that step as &amp;lt;code&amp;gt;xtal-prot.pdb&amp;lt;/code&amp;gt;. Rename MD system as &amp;lt;code&amp;gt;last-mol.pdb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;pymol -qc last-mol.pdb xtal-prot.pdb prepare.pml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
align last-mol, xtal-prot&lt;br /&gt;
&lt;br /&gt;
remove ////SPC&lt;br /&gt;
&lt;br /&gt;
create MEM, ////POPC&lt;br /&gt;
&lt;br /&gt;
# these atom numbers do not exist in POPC or DPPC&lt;br /&gt;
# therefore, we do not remove protons from the lipid&lt;br /&gt;
# structure to make more spheres. Uncomment these&lt;br /&gt;
# lines and change to proper H numbers if needed.&lt;br /&gt;
#remove /MEM////HS&lt;br /&gt;
#remove /MEM////HX&lt;br /&gt;
#remove /MEM////HY&lt;br /&gt;
#remove /MEM////H*B&lt;br /&gt;
#remove /MEM////H*A&lt;br /&gt;
#remove /MEM////H*C&lt;br /&gt;
&lt;br /&gt;
remove /MEM////C1&lt;br /&gt;
remove /MEM////C2&lt;br /&gt;
remove /MEM////C3&lt;br /&gt;
remove /MEM////C11&lt;br /&gt;
remove /MEM////C12&lt;br /&gt;
remove /MEM////C13&lt;br /&gt;
remove /MEM////C14&lt;br /&gt;
remove /MEM////C15&lt;br /&gt;
&lt;br /&gt;
create MEM_C, /MEM////*C* | /MEM////H*R | /MEM////H*S | /MEM////H*T | /MEM////H*X | /MEM////H*Y | /MEM////H*Z&lt;br /&gt;
&lt;br /&gt;
create shell, MEM_C within 20 of xtal-prot&lt;br /&gt;
&lt;br /&gt;
set retain_order, 1&lt;br /&gt;
&lt;br /&gt;
save shell.pdb, shell&lt;br /&gt;
&lt;br /&gt;
alter shell, resn=&#039;LPD&#039;&lt;br /&gt;
alter shell, name=&#039;C&#039;&lt;br /&gt;
alter shell, chain=&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
rebuild&lt;br /&gt;
&lt;br /&gt;
save shell-LPD.pdb, shell&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Preparation of grids with thinspheres ==&lt;br /&gt;
Prepare grids with thinspheres for the protein without lipid as described in https://wiki.docking.org/index.php/How_to_do_parameter_scanning&lt;br /&gt;
&lt;br /&gt;
Create an empty directory and put &amp;lt;code&amp;gt;shell-LPD.pdb&amp;lt;/code&amp;gt; there. Then run the following script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sh blast-membrane-thinsph-scan.sh {path to the collection of &amp;quot;es_ld_thin_sph_rad_X.X&amp;quot; directories} {path to the dir with original working and dockfiles directories}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script runs qnifft and solvmap for each &amp;lt;code&amp;gt;es_ld_thin_sph_rad_X.X&amp;lt;/code&amp;gt; directory, and then uses the second script of parameter scanning protocol to combine files into &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; directories.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important! LOOK AT YOUR GRIDS! Desolvation -- larger solvation where water is. Electrostatics -- no electrostatics in the lipid region. vdW -- no vdW in the lipid region.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# a script to prepare a protein with the lipid membrane for DOCK with thinsphere scan&lt;br /&gt;
# PREREQ -- run first step of https://wiki.docking.org/index.php/How_to_do_parameter_scanning (new_0001_generate_ES_LD_generation.py )&lt;br /&gt;
# first argument -- path to the directory where dirs &amp;quot;es_ld_thin_sph_rad_X.X&amp;quot; are stored. &lt;br /&gt;
# second argument -- path to the dir with original working and dockfiles&lt;br /&gt;
# run in a new directory with shell-LPD.pdb&lt;br /&gt;
&lt;br /&gt;
run_once () {&lt;br /&gt;
# mkdir  add_membrane&lt;br /&gt;
# Run qnifft for electrostatic grids&lt;br /&gt;
# cp $blastfiles_membrane/shell-LPD.pdb&lt;br /&gt;
# delete all fields except HETATM from shell-LPD.pdb&lt;br /&gt;
cp $curr_dir/shell-LPD.pdb .&lt;br /&gt;
sed -ir &#039;/^CRYST1/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^CONECT/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^END/d&#039; shell-LPD.pdb&lt;br /&gt;
cp $blastermaster_Prot/working/rec.crg.pdb .&lt;br /&gt;
#cp $blastermaster_Prot/working/lowdielectric.sph.pdb # (if wanted, if you run a  parameter scan, be sure to use the correct spheres!)&lt;br /&gt;
#cp -r $blastermaster_Prot/dockfiles .&lt;br /&gt;
#cp -r $blastermaster_Prot/INDOCK .&lt;br /&gt;
mv rec.crg.pdb  rec.crg.solo.pdb&lt;br /&gt;
cat rec.crg.solo.pdb shell-LPD.pdb  &amp;gt; receptor.crg.lowdielectric.pdb&lt;br /&gt;
# extracting SPH lines from receptor&lt;br /&gt;
number=$(grep -n  SPH  $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb | head -n 1 | awk -F &amp;quot;:&amp;quot; &#039;{print $1}&#039;)&lt;br /&gt;
tail --lines=+$number $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb &amp;gt;&amp;gt; receptor.crg.lowdielectric.pdb&lt;br /&gt;
need_files=&amp;quot;amb.crg.oxt&lt;br /&gt;
qnifft.parm&lt;br /&gt;
vdw.siz&amp;quot;&lt;br /&gt;
for file in $need_files&lt;br /&gt;
do&lt;br /&gt;
	if [ -e $blastermaster_Prot/working/$file ]&lt;br /&gt;
	then&lt;br /&gt;
		cp $blastermaster_Prot/working/$file .&lt;br /&gt;
	else&lt;br /&gt;
		cp $blast_orig/working/$file .&lt;br /&gt;
	fi&lt;br /&gt;
done&lt;br /&gt;
echo &amp;quot;C     lpd        0.000     LIPID SPHERE&amp;quot; &amp;gt;&amp;gt; amb.crg.oxt&lt;br /&gt;
cp $blastermaster_Prot/working/box .&lt;br /&gt;
cp $blastermaster_Prot/working/qnifft.parm .&lt;br /&gt;
cp $blastermaster_Prot/working/vdw.siz .&lt;br /&gt;
$DOCKBASE/proteins/qnifft/bin/qnifft22_193_pgf_32 qnifft.parm &amp;gt;&amp;amp; qnifft.log&lt;br /&gt;
$DOCKBASE/proteins/blastermaster/phiTrim.py qnifft.electrostatics.phi box trim.electrostatics.phi &amp;gt;&amp;amp; trim.log&lt;br /&gt;
&lt;br /&gt;
#cp trim.electrostatics.phi dockfiles/.&lt;br /&gt;
&lt;br /&gt;
# Check if the grid size changed:&lt;br /&gt;
#echo &amp;quot;Check if the grid size changed, compare this with INDOCK&amp;quot;&lt;br /&gt;
#python ~jklyu/zzz.script/pymol_movie/phi_to_dx.py trim.electrostatics.phi trim.electrostatics.phi.dx &amp;gt; gridsize&lt;br /&gt;
#head -n 1 gridsize&lt;br /&gt;
# compare with delphi_nsize in INDOCK&lt;br /&gt;
&lt;br /&gt;
# Run solvmap for Ligand Desolvation Grids if they are present in the folder&lt;br /&gt;
if [ -e $blastermaster_Prot/working/heavy ]&lt;br /&gt;
then&lt;br /&gt;
	mkdir heavy&lt;br /&gt;
	cd heavy || exit&lt;br /&gt;
	cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
	cp ../box .&lt;br /&gt;
	cp $blastermaster_Prot/working/heavy/INSEV .&lt;br /&gt;
	$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
	#cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
	cd ../ || exit&lt;br /&gt;
&lt;br /&gt;
	mkdir hydrogen&lt;br /&gt;
	cd hydrogen || exit&lt;br /&gt;
	cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
	cp ../box .&lt;br /&gt;
	cp $blastermaster_Prot/working/hydrogen/INSEV .&lt;br /&gt;
	$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
	#cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
fi&lt;br /&gt;
echo $dir &amp;quot; DONE!&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
curr_dir=$(pwd)&lt;br /&gt;
workdirs=$1&lt;br /&gt;
blast_orig=$2&lt;br /&gt;
dirs=$(ls -d $workdirs/es_ld_thin_sph_rad_*)&lt;br /&gt;
for dir in $dirs&lt;br /&gt;
do&lt;br /&gt;
	blastermaster_Prot=$dir&lt;br /&gt;
	local_dir=$(echo $dir | awk -F&amp;quot;\/&amp;quot; &#039;{print $NF}&#039;)&lt;br /&gt;
	mkdir -p $local_dir/working&lt;br /&gt;
	cd $local_dir/working || exit&lt;br /&gt;
	run_once&lt;br /&gt;
	cd $curr_dir || exit&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
python ~rstein/zzz.scripts/DOCK_prep_scripts/new_0002_combine_es_ld_grids_into_combos.py -p $blast_orig&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running blastermaster with default parameters ==&lt;br /&gt;
&#039;&#039;&#039;Warning! Do not use these grids, as the default grids with lipid spheres give incorrect solvation energies. Use the ones with thinspheres instead!&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# a script to prepare a protein with the lipid membrane for DOCK &lt;br /&gt;
# first argument -- path to blastermaster files of the protein without membrane&lt;br /&gt;
# run in a new directory with shell-LPD.pdb&lt;br /&gt;
blastermaster_Prot=$1&lt;br /&gt;
# mkdir  add_membrane&lt;br /&gt;
# Run qnifft for electrostatic grids&lt;br /&gt;
# cp $blastfiles_membrane/shell-LPD.pdb&lt;br /&gt;
# delete all fields except HETATM from shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^CRYST1/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^CONECT/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^END/d&#039; shell-LPD.pdb&lt;br /&gt;
cp $blastermaster_Prot/working/rec.crg.pdb .&lt;br /&gt;
#cp $blastermaster_Prot/working/lowdielectric.sph.pdb # (if wanted, if you run a  parameter scan, be sure to use the correct spheres!)&lt;br /&gt;
cp -r $blastermaster_Prot/dockfiles .&lt;br /&gt;
cp -r $blastermaster_Prot/INDOCK .&lt;br /&gt;
mv rec.crg.pdb  rec.crg.solo.pdb&lt;br /&gt;
cat rec.crg.solo.pdb shell-LPD.pdb  &amp;gt; receptor.crg.lowdielectric.pdb&lt;br /&gt;
# extracting SPH lines from receptor&lt;br /&gt;
number=$(grep -n  SPH  $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb | head -n 1 | awk -F &amp;quot;:&amp;quot; &#039;{print $1}&#039;)&lt;br /&gt;
tail --lines=+$number $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb &amp;gt;&amp;gt; rec.crg.lowdielectric.pdb&lt;br /&gt;
cp $blastermaster_Prot/working/amb.crg.oxt .&lt;br /&gt;
echo &amp;quot;C     lpd        0.000     LIPID SPHERE&amp;quot; &amp;gt;&amp;gt; amb.crg.oxt&lt;br /&gt;
cp $blastermaster_Prot/working/box .&lt;br /&gt;
cp $blastermaster_Prot/working/qnifft.parm .&lt;br /&gt;
cp $blastermaster_Prot/working/vdw.siz .&lt;br /&gt;
$DOCKBASE/proteins/qnifft/bin/qnifft22_193_pgf_32 qnifft.parm &amp;gt;&amp;amp; qnifft.log&lt;br /&gt;
$DOCKBASE/proteins/blastermaster/phiTrim.py qnifft.electrostatics.phi box trim.electrostatics.phi &amp;gt;&amp;amp; trim.log&lt;br /&gt;
&lt;br /&gt;
cp trim.electrostatics.phi dockfiles/.&lt;br /&gt;
&lt;br /&gt;
# Check if the grid size changed:&lt;br /&gt;
echo &amp;quot;Check if the grid size changed, compare this with INDOCK&amp;quot;&lt;br /&gt;
python ~jklyu/zzz.script/pymol_movie/phi_to_dx.py trim.electrostatics.phi trim.electrostatics.phi.dx &amp;gt; gridsize&lt;br /&gt;
head -n 1 gridsize&lt;br /&gt;
# compare with delphi_nsize in INDOCK&lt;br /&gt;
&lt;br /&gt;
# Run solvmap for Ligand Desolvation Grids&lt;br /&gt;
mkdir heavy&lt;br /&gt;
cd heavy || exit&lt;br /&gt;
cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
cp ../box .&lt;br /&gt;
cp $blastermaster_Prot/working/heavy/INSEV .&lt;br /&gt;
$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
cd ../ || exit&lt;br /&gt;
&lt;br /&gt;
mkdir hydrogen&lt;br /&gt;
cd hydroger || exit&lt;br /&gt;
cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
cp ../box .&lt;br /&gt;
cp $blastermaster_Prot/working/hydrogen/INSEV .&lt;br /&gt;
$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
echo &amp;quot;DONE!&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Lipid membrane models from MemProtMD ==&lt;br /&gt;
If a protein-membrane complex was already modeled for your system and deposited at [http://memprotmd.bioch.ox.ac.uk/home/ MemProtMD] website, you can use it and skip doing MD in Schrodinger. The steps are very similar to the ones after Schrodinger run.&lt;br /&gt;
&lt;br /&gt;
Download the &amp;lt;code&amp;gt;*_default_dppc.mpmd.finalframe.atomistic.pdb&amp;lt;/code&amp;gt; file from the bottom of the page. Rename it to &amp;lt;code&amp;gt;last-mol.pdb&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Use prepare.pml script (below). You need to provide the &amp;lt;code&amp;gt;rec.pdb&amp;lt;/code&amp;gt; to want to use for docking (potentially with missing loops) at that step as &amp;lt;code&amp;gt;xtal-prot.pdb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;pymol -qc last-mol.pdb xtal-prot.pdb prepare.pml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script below differs from the one for processing Schrodinger results in two points: solvent residue is &amp;lt;code&amp;gt;SOL&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;SPC&amp;lt;/code&amp;gt;, and lipids are called &amp;lt;code&amp;gt;DPPC&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;POPC&amp;lt;/code&amp;gt;.&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
align last-mol, xtal-prot&lt;br /&gt;
&lt;br /&gt;
remove ////SOL&lt;br /&gt;
&lt;br /&gt;
create MEM, ////DPPC&lt;br /&gt;
&lt;br /&gt;
remove /MEM////HS&lt;br /&gt;
remove /MEM////HX&lt;br /&gt;
remove /MEM////HY&lt;br /&gt;
remove /MEM////H*B&lt;br /&gt;
remove /MEM////H*A&lt;br /&gt;
remove /MEM////H*C&lt;br /&gt;
&lt;br /&gt;
remove /MEM////C1&lt;br /&gt;
remove /MEM////C2&lt;br /&gt;
remove /MEM////C3&lt;br /&gt;
remove /MEM////C11&lt;br /&gt;
remove /MEM////C12&lt;br /&gt;
remove /MEM////C13&lt;br /&gt;
remove /MEM////C14&lt;br /&gt;
remove /MEM////C15&lt;br /&gt;
&lt;br /&gt;
create MEM_C, /MEM////*C* | /MEM////H*R | /MEM////H*S | /MEM////H*T | /MEM////H*X | /MEM////H*Y | /MEM////H*Z&lt;br /&gt;
&lt;br /&gt;
create shell, MEM_C within 20 of xtal-prot&lt;br /&gt;
&lt;br /&gt;
set retain_order, 1&lt;br /&gt;
&lt;br /&gt;
save shell.pdb, shell&lt;br /&gt;
&lt;br /&gt;
alter shell, resn=&#039;LPD&#039;&lt;br /&gt;
alter shell, name=&#039;C&#039;&lt;br /&gt;
alter shell, chain=&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
rebuild&lt;br /&gt;
&lt;br /&gt;
save shell-LPD.pdb, shell&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Positioning of the membrane ==&lt;br /&gt;
If there is no precomputed membrane position from OPM or MemProtMD, you can model it using  PPM 3.0 webserver (https://opm.phar.umich.edu/ppm_server3) or standalone software. The software is installed in &amp;lt;code&amp;gt;/nfs/home/ak87/exa/PROGRAM/OPM-MEMBRANE&amp;lt;/code&amp;gt;. Copy &amp;lt;code&amp;gt;res.lib&amp;lt;/code&amp;gt; file from the program directory to the directory with your .pdb file. Create input file like this:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
0 PMm out rec.pdb&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;blockquote&amp;gt;0 or 1 -“do not use” or “use” heteroatoms in the input PDB file, respectively (solvent molecules are always excluded).&lt;br /&gt;
&lt;br /&gt;
MOM - type of membrane (see list of 3-letter codes for membranes below)&lt;br /&gt;
&lt;br /&gt;
“in” or “out” means topology of N-terminus of first subunit included in the corresponding input PDB file&lt;br /&gt;
&lt;br /&gt;
With this option, for every input pdb file, the program will selected automatically the flat or curved membrane boundaries, whichever had the lower calculated transfer energy.&amp;lt;/blockquote&amp;gt;Then run the program:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;~ak87/exa/PROGRAM/OPM-MEMBRANE/immers&amp;lt;1membrane.inp&amp;gt;rec-opm.out&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;datasub1&amp;lt;/code&amp;gt; file to extract residue numbers for the membrane placement in Maestro.&lt;br /&gt;
See ppm3_instructions.docx file in the program directory for more detail.&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Membrane_Modeling&amp;diff=15080</id>
		<title>Membrane Modeling</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Membrane_Modeling&amp;diff=15080"/>
		<updated>2023-01-10T17:59:39Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Written by Stefan Gahbauer, 2019/11/03&lt;br /&gt;
&lt;br /&gt;
In order to account for ligand desolvation and electrostatic interactions in the low-dielectric environment of the hydrophobic membrane core, a lipid-bilayer is generated around the target receptor and included in the docking score grid generation.&lt;br /&gt;
Aiming at a fast, robust and computationally effective equilibration of the lipid bilayer around the embedded transmembrane receptor, coarse-grained (CG) molecular dynamics (MD) simulations and (if needed) subsequent atomistic simulations are employed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Required software and datasets =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gromacs&#039;&#039;&#039; (v5 or newer) - Molecular Dynamics software package (http://manual.gromacs.org/)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CHARMM36m force field&#039;&#039;&#039; (http://mackerell.umaryland.edu/charmm_ff.shtml)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MARTINI&#039;&#039;&#039; Coarse-grained force field parameters(http://cgmartini.nl/)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DSSP&#039;&#039;&#039; - Secondary Structure assignment (https://swift.cmbi.umcn.nl/gv/dssp/ , https://anaconda.org/salilab/dssp)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;martinize.py&#039;&#039;&#039; - Coarse-graining atomistic protein structures (http://cgmartini.nl/index.php/tools2/proteins-and-bilayers)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;insane.py&#039;&#039;&#039; - INSerting proteins in coarse-grained MembrANE (http://cgmartini.nl/index.php/tools2/proteins-and-bilayers)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;initram.sh&#039;&#039;&#039; and &#039;&#039;&#039;backward.py&#039;&#039;&#039; - Conversion of coarse-grained system to atomistic resolution (http://cgmartini.nl/index.php/tools2/resolution-transformation)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 1) Setting up the coarse-grained system =&lt;br /&gt;
&lt;br /&gt;
This is automated in the script:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/0001-prepare-protein-CG-membrane.sh&lt;br /&gt;
&lt;br /&gt;
== 1.1) Prepare your files ==&lt;br /&gt;
&lt;br /&gt;
Copy the script above to your working directory.&lt;br /&gt;
&lt;br /&gt;
Copy your rec.pdb to your working directory.&lt;br /&gt;
&lt;br /&gt;
If your rec.pdb has gaps, e.g. unresolved loops between transmembrane helices in case of GPCRs, try to model missing residues.&lt;br /&gt;
&lt;br /&gt;
One way is to use MODELLER following https://salilab.org/modeller/wiki/Missing%20residues.&lt;br /&gt;
&lt;br /&gt;
Corresponding input scripts for modeller can be found in:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/modeller&lt;br /&gt;
&lt;br /&gt;
== 1.2) Run the script ==&lt;br /&gt;
&lt;br /&gt;
Login to gimel2.&lt;br /&gt;
&lt;br /&gt;
./0001-prepare-protein-CG-membrane.sh&lt;br /&gt;
&lt;br /&gt;
The script reads rec.pdb and copies all other required files from &lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/gromacs&lt;br /&gt;
&lt;br /&gt;
=== Workflow ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;a.&#039;&#039;&#039; Generate CHARMM36m force field parameters of your protein in a Gromacs-readable format. &lt;br /&gt;
&lt;br /&gt;
Used tool: gmx pdb2gmx &lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;pdb2gmx&#039;&#039; directory&lt;br /&gt;
&lt;br /&gt;
-conf.gro / conf.pdb - Gromacs coordinate file&lt;br /&gt;
&lt;br /&gt;
-topol.top / Protein-atomistic.itp - Gromacs topology file, i.e. force field description of your input structure&lt;br /&gt;
&lt;br /&gt;
-posre.itp - Position restraints for heavy atoms of atomistic protein strucutre.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;b.&#039;&#039;&#039; Build coarse-grained structure&lt;br /&gt;
&lt;br /&gt;
Used tool: martinize.py&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-chain_.ssd - Output from the DSSP program that is called by martinize.py&lt;br /&gt;
&lt;br /&gt;
-prot-cg.pdb - Coarse-grained protein structure&lt;br /&gt;
&lt;br /&gt;
-prot-cg.top - Coarse-grained Martini topology of system&lt;br /&gt;
&lt;br /&gt;
-Protein.itp - Coarse-grained Martini description of Protein structure&lt;br /&gt;
&lt;br /&gt;
-prot-rot.pdb - Coarse-grained protein structure aligned along z-axis of the simulation box according to the proteins first principal component axis. This ensures the correct placement of the protein during membrane preparation. &#039;&#039;&#039;You may have to adjust the orientation of your input structure prior to membrane modeling.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;c.&#039;&#039;&#039; Build coarse-grained membrane&lt;br /&gt;
&lt;br /&gt;
Used tool: insane.py&lt;br /&gt;
&lt;br /&gt;
Here, a lipid bilayer will be created around the protein structure (in the x/y-plane) and water will be added to the system. The default box shape is rectangular and the size is set to x,y=10nm, z=11nm. This can be changed in the ./insane.py command line. The default lipid type is POPC, you can change that to arbitrary lipid compositions using the -l and -u options of of insane.py.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-out.top / topol-cg.top - Topology of coarse-grained system&lt;br /&gt;
&lt;br /&gt;
-cg-membrane.gro/.pdb - Coarse-grained system coordinates. &#039;&#039;&#039;Carefully inspect and visualize the cg-membrane.pdb.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use PyMOL to check if you&#039;re protein is embedded correctly in the lipid bilayer.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 2) Simulating the coarse-grained system =&lt;br /&gt;
&lt;br /&gt;
This is automated in the script:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/0002-run-CG-Minimization-and-MD.sh&lt;br /&gt;
&lt;br /&gt;
== 2.1) Run the script ==&lt;br /&gt;
&lt;br /&gt;
Copy the script above to your working directory.&lt;br /&gt;
&lt;br /&gt;
./0002-run-CG-Minimization-and-MD.sh&lt;br /&gt;
&lt;br /&gt;
=== Workflow ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;a.&#039;&#039;&#039; Minimize coarse-grained system&lt;br /&gt;
&lt;br /&gt;
Used tools: gmx grompp , gmx mdrun&lt;br /&gt;
&lt;br /&gt;
gmx grompp generates a single .tpr file that contains all information necessary for running a MD simulation or minimization using gmx mdrun.&lt;br /&gt;
&lt;br /&gt;
Minimization parameters are provided in martini_new-rf_min.mdp. The system will be minimized in 500 steps using steepest descent. The protein structure will be frozen during minimization.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-min.tpr - MD run input file&lt;br /&gt;
&lt;br /&gt;
-min.log - Output log file from minimization&lt;br /&gt;
&lt;br /&gt;
-min.trr - Minimization trajectory&lt;br /&gt;
&lt;br /&gt;
-min.gro - Minimized system coordinates&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;b.&#039;&#039;&#039; Simulate coarse-grained system&lt;br /&gt;
&lt;br /&gt;
MD simulation parameters are provided in martini_v2.x_new-rf.mdp. Strong position restraints are applied on the protein structure during the simulation. The system will be simulated for 50ns.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-md.tpr - MD run input file&lt;br /&gt;
&lt;br /&gt;
-md.log - Output log file from simulation&lt;br /&gt;
&lt;br /&gt;
-md.trr - lossless trajectory of simulation&lt;br /&gt;
&lt;br /&gt;
-md.xtc - coordinates of simulation trajectory&lt;br /&gt;
&lt;br /&gt;
-md.gro - coordinates of final simulation snapshot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The simulation will run for roughly 3 hours.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 3) Converting coarse-grained system to atomistic resolution and select lipid atoms for grid generation =&lt;br /&gt;
&lt;br /&gt;
This is automated in the script:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/0003-backmap-and-lpd-selection.sh&lt;br /&gt;
&lt;br /&gt;
== 3.1) Run the script ==&lt;br /&gt;
&lt;br /&gt;
Copy the script above to your working directory.&lt;br /&gt;
&lt;br /&gt;
./0003-backmap-and-lpd-selection.sh&lt;br /&gt;
&lt;br /&gt;
=== Workflow ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;a.&#039;&#039;&#039; Backmapping from coarse-grained to atomistic&lt;br /&gt;
&lt;br /&gt;
Used tool: gmx trjconv, initram.sh&lt;br /&gt;
&lt;br /&gt;
gmx trjconv can perform a variety of conversions of MD trajectory, e.g. making molecules broken over the periodic boundary conditions whole again. &lt;br /&gt;
&lt;br /&gt;
initram.sh calls the backward.py program which performs the backmapping of input coarse-grained to atomistic systems, and performs a small series of short minimizations and simulations to relax the backmapped system.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;backmap&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-0-backmapped.gro / projected.gro - initial backmapped coordinates&lt;br /&gt;
&lt;br /&gt;
-backmapped.top - Topology of atomistic system&lt;br /&gt;
&lt;br /&gt;
-1-EM*/2-EM* - Output from minimizations &lt;br /&gt;
&lt;br /&gt;
-3-mdpr*/4-mdpr*/5-mdpr*/6-mdpr* - Output from simulations&lt;br /&gt;
&lt;br /&gt;
-backmapped.gro - Coordinates of final backmapped and relaxed system&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This may need a few attempts to work all the way through. There is a while-loop that only stops until all relaxation steps have finished.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;b.&#039;&#039;&#039; Replacing backmapped protein with initial atomistic protein structure&lt;br /&gt;
&lt;br /&gt;
Used tool: PyMOL script align.pml&lt;br /&gt;
&lt;br /&gt;
The pymol script will align the initial &amp;quot;Gromacs&amp;quot;-protein structure (conf.pdb) onto the backmapped structure and combine the fitted protein coordinates with the coordinates of the lipid and solvent environment.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;backmap/prepare_AA_system&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-conf-fitted.pdb - Fitted initial protein structure&lt;br /&gt;
&lt;br /&gt;
-backmapped-environment.pdb - All membrane and water coordinates&lt;br /&gt;
&lt;br /&gt;
-fitted_system.pdb - Complete system containing fitted protein and environment coordinates&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure that fitted_system.pdb has the same number of coordinates as backmapped-mol.pdb.&#039;&#039;&#039; If there is a discrepancy there might be an issue with the PyMOL version you&#039;re using to run align.pml. Using PyMOL v2 or newer seems to avoid any issues. You can also generate backmapped-environment.pdb manually by taking all POPC and Water cooridnates from backmapped-mol.pdb.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;c.&#039;&#039;&#039; Run minimizations of atomistic system&lt;br /&gt;
&lt;br /&gt;
Used tools: gmx grompp, gmx mdrun&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;backmap/prepare_AA_system&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
Tow minimizations will be calculated. &lt;br /&gt;
&lt;br /&gt;
1) Minimization with frozen protein coordinates: 1,500 steps steepest descent (min_freeze.mdp).&lt;br /&gt;
&lt;br /&gt;
-min_freeze* - Output files of first minimization&lt;br /&gt;
&lt;br /&gt;
2) Minimization of full system: 500 steps (min.mdp).&lt;br /&gt;
&lt;br /&gt;
-min* - Output files of second minimization&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;d.&#039;&#039;&#039; Select lipid atoms for DOCK grid generation&lt;br /&gt;
&lt;br /&gt;
Used tools: PyMOL script prepare.pml&lt;br /&gt;
&lt;br /&gt;
This will select carbon and hydrogen atoms of the hydrophobic lipid tail segments in a radius of 1.7 nm around the protein and assign them to the atom type &amp;quot;LPD&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You need to provide the rec.pdb to want to use for docking (potentially with missing loops) at that step as xtal-prot.pdb&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;backmap/prepare_AA_system/prepare_min&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-shell-LPD.pdb - all LPD atoms selected for grid generation&lt;br /&gt;
&lt;br /&gt;
Add these coordinates to your docking protein structure and provide a amb.crg.oxt file adding&lt;br /&gt;
&lt;br /&gt;
C     lpd        0.000     LIPID SPHERE&lt;br /&gt;
&lt;br /&gt;
Now you can run blastermaster.&lt;br /&gt;
&lt;br /&gt;
= Membrane modelling in Schrodinger =&lt;br /&gt;
Written by Andrii Kyrylchuk, 2022/04/20&lt;br /&gt;
&lt;br /&gt;
== MD of protein and membrane ==&lt;br /&gt;
Import structure &#039;&#039;&#039;without&#039;&#039;&#039; ligand, use &amp;lt;u&amp;gt;Preparation wizard&amp;lt;/u&amp;gt; as described in &amp;quot;Code for Controls...&amp;quot;  to model missing loops and capping.&lt;br /&gt;
&lt;br /&gt;
Then open &amp;lt;u&amp;gt;System Builder&amp;lt;/u&amp;gt;, click &amp;lt;code&amp;gt;Setup membrane&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to the website https://opm.phar.umich.edu/proteins/ and find your protein. Copy residue numbers from the bottom of the page to the field &amp;lt;code&amp;gt;Transmembrane atoms...&amp;lt;/code&amp;gt;. The format is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;res.num 76-97,112-136,141,...&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click &amp;lt;code&amp;gt;Place Automatically&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt;. Then click &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt;. Examine lipids and solvent after run completes.&lt;br /&gt;
&lt;br /&gt;
Then use &amp;lt;u&amp;gt;Molecular Dynamics&amp;lt;/u&amp;gt; menu to set up the calculation. Select prepared system, click &amp;lt;code&amp;gt;Load&amp;lt;/code&amp;gt; on top of the menu. Put simulation time of 5 ns, &amp;lt;code&amp;gt;Advanced Options&amp;lt;/code&amp;gt; -- &amp;lt;code&amp;gt;Restraints&amp;lt;/code&amp;gt; -- &amp;lt;code&amp;gt;Add.&amp;lt;/code&amp;gt; Select protein, and put &amp;lt;code&amp;gt;Force Constant&amp;lt;/code&amp;gt; of 100, click &amp;lt;code&amp;gt;Apply&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;OK.&amp;lt;/code&amp;gt; Then click down arrow left of the &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt; button in the parent window and click &amp;lt;code&amp;gt;Write&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;NOTE&#039;&#039;&#039;: In my experience, restrained MD runs with NgPT in Schrodinger often fail with the following message:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&#039;&#039;Allowed momentum exceeded on 17 particles.&#039;&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This seems to be related to the interference of restraints and the ensemble, as no such error is observed if no restraints are imposed, or if NVT ensemble is used. Still, NgPT ensemble is important for correct membrane sampling, because simulations at NVT long enough to permit membrane relaxation, lead to the smearing of the lipid bilayer and the formation of empty space.&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;If the mentioned problem occurs, import the last coordinates of the run (*-out.cms) into Maestro, open Minimization menu, load the structure from the workspace, and apply restraints on lipid and protein (force restraint of 10 is usually enough). Then run a minimization for 100 ps, and try to run NgPT MD starting from the optimized structure.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;TO CHECK&#039;&#039;&#039;: NPT ensemble.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Copy the project folder (desmond_md_job_X) to gimel, login to &amp;lt;u&amp;gt;gimel5&amp;lt;/u&amp;gt;, edit desmond_md_job_X.sh: delete &amp;lt;code&amp;gt;-lic DESMOND_GPGPU:16&amp;lt;/code&amp;gt; and insert &amp;lt;code&amp;gt;-HOST gimel5.gpu&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;gimel5.heavygpu&amp;lt;/code&amp;gt;). Export &amp;lt;code&amp;gt;$SCHRODINGER&amp;lt;/code&amp;gt; variable:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SCHRODINGER=/nfs/soft2/schrodinger/2023-3/&amp;lt;/code&amp;gt; (or a newer version)&lt;br /&gt;
&lt;br /&gt;
Run .sh file, and your task will be submitted to a queue. For my system it took 1.5 hr to complete.&lt;br /&gt;
&lt;br /&gt;
Download the project folder to your PC, open Maestro, click &amp;lt;code&amp;gt;Import  structure&amp;lt;/code&amp;gt; and open &amp;lt;code&amp;gt;-out.cms&amp;lt;/code&amp;gt;, click on &amp;lt;code&amp;gt;T&amp;lt;/code&amp;gt; icon at the new entry in project table and click &amp;lt;code&amp;gt;Display Trajectory Snapshots&amp;lt;/code&amp;gt;. Select the last one, click &amp;lt;code&amp;gt;Display&amp;lt;/code&amp;gt; and check if the protein did not change position during MD run, then click &amp;lt;code&amp;gt;Export&amp;lt;/code&amp;gt;, to Project Table, Frames Selected only. You will get a new entry in the Project Table. Export it to a &amp;lt;code&amp;gt;.pdb&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
== Preparation of the structure for Blastermaster ==&lt;br /&gt;
Use &amp;lt;code&amp;gt;prepare.pml&amp;lt;/code&amp;gt; script. You need to provide the &amp;lt;code&amp;gt;rec.pdb&amp;lt;/code&amp;gt; to want to use for docking (potentially with missing loops) at that step as &amp;lt;code&amp;gt;xtal-prot.pdb&amp;lt;/code&amp;gt;. Rename MD system as &amp;lt;code&amp;gt;last-mol.pdb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;pymol -qc last-mol.pdb xtal-prot.pdb prepare.pml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
align last-mol, xtal-prot&lt;br /&gt;
&lt;br /&gt;
remove ////SPC&lt;br /&gt;
&lt;br /&gt;
create MEM, ////POPC&lt;br /&gt;
&lt;br /&gt;
# these atom numbers do not exist in POPC or DPPC&lt;br /&gt;
# therefore, we do not remove protons from the lipid&lt;br /&gt;
# structure to make more spheres. Uncomment these&lt;br /&gt;
# lines and change to proper H numbers if needed.&lt;br /&gt;
#remove /MEM////HS&lt;br /&gt;
#remove /MEM////HX&lt;br /&gt;
#remove /MEM////HY&lt;br /&gt;
#remove /MEM////H*B&lt;br /&gt;
#remove /MEM////H*A&lt;br /&gt;
#remove /MEM////H*C&lt;br /&gt;
&lt;br /&gt;
remove /MEM////C1&lt;br /&gt;
remove /MEM////C2&lt;br /&gt;
remove /MEM////C3&lt;br /&gt;
remove /MEM////C11&lt;br /&gt;
remove /MEM////C12&lt;br /&gt;
remove /MEM////C13&lt;br /&gt;
remove /MEM////C14&lt;br /&gt;
remove /MEM////C15&lt;br /&gt;
&lt;br /&gt;
create MEM_C, /MEM////*C* | /MEM////H*R | /MEM////H*S | /MEM////H*T | /MEM////H*X | /MEM////H*Y | /MEM////H*Z&lt;br /&gt;
&lt;br /&gt;
create shell, MEM_C within 20 of xtal-prot&lt;br /&gt;
&lt;br /&gt;
set retain_order, 1&lt;br /&gt;
&lt;br /&gt;
save shell.pdb, shell&lt;br /&gt;
&lt;br /&gt;
alter shell, resn=&#039;LPD&#039;&lt;br /&gt;
alter shell, name=&#039;C&#039;&lt;br /&gt;
alter shell, chain=&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
rebuild&lt;br /&gt;
&lt;br /&gt;
save shell-LPD.pdb, shell&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Preparation of grids with thinspheres ==&lt;br /&gt;
Prepare grids with thinspheres for the protein without lipid as described in https://wiki.docking.org/index.php/How_to_do_parameter_scanning&lt;br /&gt;
&lt;br /&gt;
Create an empty directory and put &amp;lt;code&amp;gt;shell-LPD.pdb&amp;lt;/code&amp;gt; there. Then run the following script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sh blast-membrane-thinsph-scan.sh {path to the collection of &amp;quot;es_ld_thin_sph_rad_X.X&amp;quot; directories} {path to the dir with original working and dockfiles directories}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script runs qnifft and solvmap for each &amp;lt;code&amp;gt;es_ld_thin_sph_rad_X.X&amp;lt;/code&amp;gt; directory, and then uses the second script of parameter scanning protocol to combine files into &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; directories.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important! LOOK AT YOUR GRIDS! Desolvation -- larger solvation where water is. Electrostatics -- no electrostatics in the lipid region. vdW -- no vdW in the lipid region.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# a script to prepare a protein with the lipid membrane for DOCK with thinsphere scan&lt;br /&gt;
# PREREQ -- run first step of https://wiki.docking.org/index.php/How_to_do_parameter_scanning (new_0001_generate_ES_LD_generation.py )&lt;br /&gt;
# first argument -- path to the directory where dirs &amp;quot;es_ld_thin_sph_rad_X.X&amp;quot; are stored. &lt;br /&gt;
# second argument -- path to the dir with original working and dockfiles&lt;br /&gt;
# run in a new directory with shell-LPD.pdb&lt;br /&gt;
&lt;br /&gt;
run_once () {&lt;br /&gt;
# mkdir  add_membrane&lt;br /&gt;
# Run qnifft for electrostatic grids&lt;br /&gt;
# cp $blastfiles_membrane/shell-LPD.pdb&lt;br /&gt;
# delete all fields except HETATM from shell-LPD.pdb&lt;br /&gt;
cp $curr_dir/shell-LPD.pdb .&lt;br /&gt;
sed -ir &#039;/^CRYST1/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^CONECT/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^END/d&#039; shell-LPD.pdb&lt;br /&gt;
cp $blastermaster_Prot/working/rec.crg.pdb .&lt;br /&gt;
#cp $blastermaster_Prot/working/lowdielectric.sph.pdb # (if wanted, if you run a  parameter scan, be sure to use the correct spheres!)&lt;br /&gt;
#cp -r $blastermaster_Prot/dockfiles .&lt;br /&gt;
#cp -r $blastermaster_Prot/INDOCK .&lt;br /&gt;
mv rec.crg.pdb  rec.crg.solo.pdb&lt;br /&gt;
cat rec.crg.solo.pdb shell-LPD.pdb  &amp;gt; receptor.crg.lowdielectric.pdb&lt;br /&gt;
# extracting SPH lines from receptor&lt;br /&gt;
number=$(grep -n  SPH  $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb | head -n 1 | awk -F &amp;quot;:&amp;quot; &#039;{print $1}&#039;)&lt;br /&gt;
tail --lines=+$number $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb &amp;gt;&amp;gt; receptor.crg.lowdielectric.pdb&lt;br /&gt;
need_files=&amp;quot;amb.crg.oxt&lt;br /&gt;
qnifft.parm&lt;br /&gt;
vdw.siz&amp;quot;&lt;br /&gt;
for file in $need_files&lt;br /&gt;
do&lt;br /&gt;
	if [ -e $blastermaster_Prot/working/$file ]&lt;br /&gt;
	then&lt;br /&gt;
		cp $blastermaster_Prot/working/$file .&lt;br /&gt;
	else&lt;br /&gt;
		cp $blast_orig/working/$file .&lt;br /&gt;
	fi&lt;br /&gt;
done&lt;br /&gt;
echo &amp;quot;C     lpd        0.000     LIPID SPHERE&amp;quot; &amp;gt;&amp;gt; amb.crg.oxt&lt;br /&gt;
cp $blastermaster_Prot/working/box .&lt;br /&gt;
cp $blastermaster_Prot/working/qnifft.parm .&lt;br /&gt;
cp $blastermaster_Prot/working/vdw.siz .&lt;br /&gt;
$DOCKBASE/proteins/qnifft/bin/qnifft22_193_pgf_32 qnifft.parm &amp;gt;&amp;amp; qnifft.log&lt;br /&gt;
$DOCKBASE/proteins/blastermaster/phiTrim.py qnifft.electrostatics.phi box trim.electrostatics.phi &amp;gt;&amp;amp; trim.log&lt;br /&gt;
&lt;br /&gt;
#cp trim.electrostatics.phi dockfiles/.&lt;br /&gt;
&lt;br /&gt;
# Check if the grid size changed:&lt;br /&gt;
#echo &amp;quot;Check if the grid size changed, compare this with INDOCK&amp;quot;&lt;br /&gt;
#python ~jklyu/zzz.script/pymol_movie/phi_to_dx.py trim.electrostatics.phi trim.electrostatics.phi.dx &amp;gt; gridsize&lt;br /&gt;
#head -n 1 gridsize&lt;br /&gt;
# compare with delphi_nsize in INDOCK&lt;br /&gt;
&lt;br /&gt;
# Run solvmap for Ligand Desolvation Grids if they are present in the folder&lt;br /&gt;
if [ -e $blastermaster_Prot/working/heavy ]&lt;br /&gt;
then&lt;br /&gt;
	mkdir heavy&lt;br /&gt;
	cd heavy || exit&lt;br /&gt;
	cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
	cp ../box .&lt;br /&gt;
	cp $blastermaster_Prot/working/heavy/INSEV .&lt;br /&gt;
	$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
	#cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
	cd ../ || exit&lt;br /&gt;
&lt;br /&gt;
	mkdir hydrogen&lt;br /&gt;
	cd hydrogen || exit&lt;br /&gt;
	cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
	cp ../box .&lt;br /&gt;
	cp $blastermaster_Prot/working/hydrogen/INSEV .&lt;br /&gt;
	$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
	#cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
fi&lt;br /&gt;
echo $dir &amp;quot; DONE!&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
curr_dir=$(pwd)&lt;br /&gt;
workdirs=$1&lt;br /&gt;
blast_orig=$2&lt;br /&gt;
dirs=$(ls -d $workdirs/es_ld_thin_sph_rad_*)&lt;br /&gt;
for dir in $dirs&lt;br /&gt;
do&lt;br /&gt;
	blastermaster_Prot=$dir&lt;br /&gt;
	local_dir=$(echo $dir | awk -F&amp;quot;\/&amp;quot; &#039;{print $NF}&#039;)&lt;br /&gt;
	mkdir -p $local_dir/working&lt;br /&gt;
	cd $local_dir/working || exit&lt;br /&gt;
	run_once&lt;br /&gt;
	cd $curr_dir || exit&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
python ~rstein/zzz.scripts/DOCK_prep_scripts/new_0002_combine_es_ld_grids_into_combos.py -p $blast_orig&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running blastermaster with default parameters ==&lt;br /&gt;
&#039;&#039;&#039;Warning! Do not use these grids, as the default grids with lipid spheres give incorrect solvation energies. Use the ones with thinspheres instead!&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# a script to prepare a protein with the lipid membrane for DOCK &lt;br /&gt;
# first argument -- path to blastermaster files of the protein without membrane&lt;br /&gt;
# run in a new directory with shell-LPD.pdb&lt;br /&gt;
blastermaster_Prot=$1&lt;br /&gt;
# mkdir  add_membrane&lt;br /&gt;
# Run qnifft for electrostatic grids&lt;br /&gt;
# cp $blastfiles_membrane/shell-LPD.pdb&lt;br /&gt;
# delete all fields except HETATM from shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^CRYST1/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^CONECT/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^END/d&#039; shell-LPD.pdb&lt;br /&gt;
cp $blastermaster_Prot/working/rec.crg.pdb .&lt;br /&gt;
#cp $blastermaster_Prot/working/lowdielectric.sph.pdb # (if wanted, if you run a  parameter scan, be sure to use the correct spheres!)&lt;br /&gt;
cp -r $blastermaster_Prot/dockfiles .&lt;br /&gt;
cp -r $blastermaster_Prot/INDOCK .&lt;br /&gt;
mv rec.crg.pdb  rec.crg.solo.pdb&lt;br /&gt;
cat rec.crg.solo.pdb shell-LPD.pdb  &amp;gt; receptor.crg.lowdielectric.pdb&lt;br /&gt;
# extracting SPH lines from receptor&lt;br /&gt;
number=$(grep -n  SPH  $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb | head -n 1 | awk -F &amp;quot;:&amp;quot; &#039;{print $1}&#039;)&lt;br /&gt;
tail --lines=+$number $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb &amp;gt;&amp;gt; rec.crg.lowdielectric.pdb&lt;br /&gt;
cp $blastermaster_Prot/working/amb.crg.oxt .&lt;br /&gt;
echo &amp;quot;C     lpd        0.000     LIPID SPHERE&amp;quot; &amp;gt;&amp;gt; amb.crg.oxt&lt;br /&gt;
cp $blastermaster_Prot/working/box .&lt;br /&gt;
cp $blastermaster_Prot/working/qnifft.parm .&lt;br /&gt;
cp $blastermaster_Prot/working/vdw.siz .&lt;br /&gt;
$DOCKBASE/proteins/qnifft/bin/qnifft22_193_pgf_32 qnifft.parm &amp;gt;&amp;amp; qnifft.log&lt;br /&gt;
$DOCKBASE/proteins/blastermaster/phiTrim.py qnifft.electrostatics.phi box trim.electrostatics.phi &amp;gt;&amp;amp; trim.log&lt;br /&gt;
&lt;br /&gt;
cp trim.electrostatics.phi dockfiles/.&lt;br /&gt;
&lt;br /&gt;
# Check if the grid size changed:&lt;br /&gt;
echo &amp;quot;Check if the grid size changed, compare this with INDOCK&amp;quot;&lt;br /&gt;
python ~jklyu/zzz.script/pymol_movie/phi_to_dx.py trim.electrostatics.phi trim.electrostatics.phi.dx &amp;gt; gridsize&lt;br /&gt;
head -n 1 gridsize&lt;br /&gt;
# compare with delphi_nsize in INDOCK&lt;br /&gt;
&lt;br /&gt;
# Run solvmap for Ligand Desolvation Grids&lt;br /&gt;
mkdir heavy&lt;br /&gt;
cd heavy || exit&lt;br /&gt;
cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
cp ../box .&lt;br /&gt;
cp $blastermaster_Prot/working/heavy/INSEV .&lt;br /&gt;
$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
cd ../ || exit&lt;br /&gt;
&lt;br /&gt;
mkdir hydrogen&lt;br /&gt;
cd hydroger || exit&lt;br /&gt;
cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
cp ../box .&lt;br /&gt;
cp $blastermaster_Prot/working/hydrogen/INSEV .&lt;br /&gt;
$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
echo &amp;quot;DONE!&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Lipid membrane models from MemProtMD ==&lt;br /&gt;
If a protein-membrane complex was already modeled for your system and deposited at [http://memprotmd.bioch.ox.ac.uk/home/ MemProtMD] website, you can use it and skip doing MD in Schrodinger. The steps are very similar to the ones after Schrodinger run.&lt;br /&gt;
&lt;br /&gt;
Download the &amp;lt;code&amp;gt;*_default_dppc.mpmd.finalframe.atomistic.pdb&amp;lt;/code&amp;gt; file from the bottom of the page. Rename it to &amp;lt;code&amp;gt;last-mol.pdb&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Use prepare.pml script (below). You need to provide the &amp;lt;code&amp;gt;rec.pdb&amp;lt;/code&amp;gt; to want to use for docking (potentially with missing loops) at that step as &amp;lt;code&amp;gt;xtal-prot.pdb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;pymol -qc last-mol.pdb xtal-prot.pdb prepare.pml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script below differs from the one for processing Schrodinger results in two points: solvent residue is &amp;lt;code&amp;gt;SOL&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;SPC&amp;lt;/code&amp;gt;, and lipids are called &amp;lt;code&amp;gt;DPPC&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;POPC&amp;lt;/code&amp;gt;.&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
align last-mol, xtal-prot&lt;br /&gt;
&lt;br /&gt;
remove ////SOL&lt;br /&gt;
&lt;br /&gt;
create MEM, ////DPPC&lt;br /&gt;
&lt;br /&gt;
remove /MEM////HS&lt;br /&gt;
remove /MEM////HX&lt;br /&gt;
remove /MEM////HY&lt;br /&gt;
remove /MEM////H*B&lt;br /&gt;
remove /MEM////H*A&lt;br /&gt;
remove /MEM////H*C&lt;br /&gt;
&lt;br /&gt;
remove /MEM////C1&lt;br /&gt;
remove /MEM////C2&lt;br /&gt;
remove /MEM////C3&lt;br /&gt;
remove /MEM////C11&lt;br /&gt;
remove /MEM////C12&lt;br /&gt;
remove /MEM////C13&lt;br /&gt;
remove /MEM////C14&lt;br /&gt;
remove /MEM////C15&lt;br /&gt;
&lt;br /&gt;
create MEM_C, /MEM////*C* | /MEM////H*R | /MEM////H*S | /MEM////H*T | /MEM////H*X | /MEM////H*Y | /MEM////H*Z&lt;br /&gt;
&lt;br /&gt;
create shell, MEM_C within 20 of xtal-prot&lt;br /&gt;
&lt;br /&gt;
set retain_order, 1&lt;br /&gt;
&lt;br /&gt;
save shell.pdb, shell&lt;br /&gt;
&lt;br /&gt;
alter shell, resn=&#039;LPD&#039;&lt;br /&gt;
alter shell, name=&#039;C&#039;&lt;br /&gt;
alter shell, chain=&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
rebuild&lt;br /&gt;
&lt;br /&gt;
save shell-LPD.pdb, shell&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Positioning of the membrane ==&lt;br /&gt;
If there is no precomputed membrane position from OPM or MemProtMD, you can model it using  PPM 3.0 webserver (https://opm.phar.umich.edu/ppm_server3) or standalone software. The software is installed in &amp;lt;code&amp;gt;/nfs/home/ak87/exa/PROGRAM/OPM-MEMBRANE&amp;lt;/code&amp;gt;. Copy &amp;lt;code&amp;gt;res.lib&amp;lt;/code&amp;gt; file from the program directory to the directory with your .pdb file. Create input file like this:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
0 PMm out rec.pdb&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;blockquote&amp;gt;0 or 1 -“do not use” or “use” heteroatoms in the input PDB file, respectively (solvent molecules are always excluded).&lt;br /&gt;
&lt;br /&gt;
MOM - type of membrane (see list of 3-letter codes for membranes below)&lt;br /&gt;
&lt;br /&gt;
“in” or “out” means topology of N-terminus of first subunit included in the corresponding input PDB file&lt;br /&gt;
&lt;br /&gt;
With this option, for every input pdb file, the program will selected automatically the flat or curved membrane boundaries, whichever had the lower calculated transfer energy.&amp;lt;/blockquote&amp;gt;Then run the program:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;~ak87/exa/PROGRAM/OPM-MEMBRANE/immers&amp;lt;1membrane.inp&amp;gt;rec-opm.out&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;datasub1&amp;lt;/code&amp;gt; file to extract residue numbers for the membrane placement in Maestro.&lt;br /&gt;
See ppm3_instructions.docx file in the program directory for more detail. Test&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=User:Iamkaant&amp;diff=15079</id>
		<title>User:Iamkaant</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=User:Iamkaant&amp;diff=15079"/>
		<updated>2023-01-10T17:58:54Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;My name is Andrii Kyrylchuk and I’m a PhD in organic chemistry. My research work began with quantum chemistry; then I’ve devoted almost 7 years to organic synthesis and then returned to computations. Now my work is mainly focused on quantum chemistry &amp;amp; molecular docking, but I’m also interested in the different topics of organic chemistry, general chemistry, NMR, biochemistry, IT, astronomy etc.&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=User:Iamkaant&amp;diff=15078</id>
		<title>User:Iamkaant</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=User:Iamkaant&amp;diff=15078"/>
		<updated>2023-01-10T17:58:46Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;My name is Andrii Kyrylchuk and I’m a PhD in organic chemistry. My research work began with quantum chemistry; then I’ve devoted almost 7 years to organic synthesis and then returned to computations. Now my work is mainly focused on quantum chemistry &amp;amp; molecular docking, but I’m also interested in the different topics of organic chemistry, general chemistry, NMR, biochemistry, IT, astronomy etc. Test&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Membrane_Modeling&amp;diff=14951</id>
		<title>Membrane Modeling</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Membrane_Modeling&amp;diff=14951"/>
		<updated>2022-10-31T22:58:41Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: added the note to export $SCHRODINGER variable before running the script&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Written by Stefan Gahbauer, 2019/11/03&lt;br /&gt;
&lt;br /&gt;
In order to account for ligand desolvation and electrostatic interactions in the low-dielectric environment of the hydrophobic membrane core, a lipid-bilayer is generated around the target receptor and included in the docking score grid generation.&lt;br /&gt;
Aiming at a fast, robust and computationally effective equilibration of the lipid bilayer around the embedded transmembrane receptor, coarse-grained (CG) molecular dynamics (MD) simulations and (if needed) subsequent atomistic simulations are employed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Required software and datasets =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gromacs&#039;&#039;&#039; (v5 or newer) - Molecular Dynamics software package (http://manual.gromacs.org/)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CHARMM36m force field&#039;&#039;&#039; (http://mackerell.umaryland.edu/charmm_ff.shtml)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MARTINI&#039;&#039;&#039; Coarse-grained force field parameters(http://cgmartini.nl/)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DSSP&#039;&#039;&#039; - Secondary Structure assignment (https://swift.cmbi.umcn.nl/gv/dssp/ , https://anaconda.org/salilab/dssp)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;martinize.py&#039;&#039;&#039; - Coarse-graining atomistic protein structures (http://cgmartini.nl/index.php/tools2/proteins-and-bilayers)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;insane.py&#039;&#039;&#039; - INSerting proteins in coarse-grained MembrANE (http://cgmartini.nl/index.php/tools2/proteins-and-bilayers)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;initram.sh&#039;&#039;&#039; and &#039;&#039;&#039;backward.py&#039;&#039;&#039; - Conversion of coarse-grained system to atomistic resolution (http://cgmartini.nl/index.php/tools2/resolution-transformation)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 1) Setting up the coarse-grained system =&lt;br /&gt;
&lt;br /&gt;
This is automated in the script:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/0001-prepare-protein-CG-membrane.sh&lt;br /&gt;
&lt;br /&gt;
== 1.1) Prepare your files ==&lt;br /&gt;
&lt;br /&gt;
Copy the script above to your working directory.&lt;br /&gt;
&lt;br /&gt;
Copy your rec.pdb to your working directory.&lt;br /&gt;
&lt;br /&gt;
If your rec.pdb has gaps, e.g. unresolved loops between transmembrane helices in case of GPCRs, try to model missing residues.&lt;br /&gt;
&lt;br /&gt;
One way is to use MODELLER following https://salilab.org/modeller/wiki/Missing%20residues.&lt;br /&gt;
&lt;br /&gt;
Corresponding input scripts for modeller can be found in:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/modeller&lt;br /&gt;
&lt;br /&gt;
== 1.2) Run the script ==&lt;br /&gt;
&lt;br /&gt;
Login to gimel2.&lt;br /&gt;
&lt;br /&gt;
./0001-prepare-protein-CG-membrane.sh&lt;br /&gt;
&lt;br /&gt;
The script reads rec.pdb and copies all other required files from &lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/gromacs&lt;br /&gt;
&lt;br /&gt;
=== Workflow ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;a.&#039;&#039;&#039; Generate CHARMM36m force field parameters of your protein in a Gromacs-readable format. &lt;br /&gt;
&lt;br /&gt;
Used tool: gmx pdb2gmx &lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;pdb2gmx&#039;&#039; directory&lt;br /&gt;
&lt;br /&gt;
-conf.gro / conf.pdb - Gromacs coordinate file&lt;br /&gt;
&lt;br /&gt;
-topol.top / Protein-atomistic.itp - Gromacs topology file, i.e. force field description of your input structure&lt;br /&gt;
&lt;br /&gt;
-posre.itp - Position restraints for heavy atoms of atomistic protein strucutre.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;b.&#039;&#039;&#039; Build coarse-grained structure&lt;br /&gt;
&lt;br /&gt;
Used tool: martinize.py&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-chain_.ssd - Output from the DSSP program that is called by martinize.py&lt;br /&gt;
&lt;br /&gt;
-prot-cg.pdb - Coarse-grained protein structure&lt;br /&gt;
&lt;br /&gt;
-prot-cg.top - Coarse-grained Martini topology of system&lt;br /&gt;
&lt;br /&gt;
-Protein.itp - Coarse-grained Martini description of Protein structure&lt;br /&gt;
&lt;br /&gt;
-prot-rot.pdb - Coarse-grained protein structure aligned along z-axis of the simulation box according to the proteins first principal component axis. This ensures the correct placement of the protein during membrane preparation. &#039;&#039;&#039;You may have to adjust the orientation of your input structure prior to membrane modeling.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;c.&#039;&#039;&#039; Build coarse-grained membrane&lt;br /&gt;
&lt;br /&gt;
Used tool: insane.py&lt;br /&gt;
&lt;br /&gt;
Here, a lipid bilayer will be created around the protein structure (in the x/y-plane) and water will be added to the system. The default box shape is rectangular and the size is set to x,y=10nm, z=11nm. This can be changed in the ./insane.py command line. The default lipid type is POPC, you can change that to arbitrary lipid compositions using the -l and -u options of of insane.py.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-out.top / topol-cg.top - Topology of coarse-grained system&lt;br /&gt;
&lt;br /&gt;
-cg-membrane.gro/.pdb - Coarse-grained system coordinates. &#039;&#039;&#039;Carefully inspect and visualize the cg-membrane.pdb.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use PyMOL to check if you&#039;re protein is embedded correctly in the lipid bilayer.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 2) Simulating the coarse-grained system =&lt;br /&gt;
&lt;br /&gt;
This is automated in the script:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/0002-run-CG-Minimization-and-MD.sh&lt;br /&gt;
&lt;br /&gt;
== 2.1) Run the script ==&lt;br /&gt;
&lt;br /&gt;
Copy the script above to your working directory.&lt;br /&gt;
&lt;br /&gt;
./0002-run-CG-Minimization-and-MD.sh&lt;br /&gt;
&lt;br /&gt;
=== Workflow ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;a.&#039;&#039;&#039; Minimize coarse-grained system&lt;br /&gt;
&lt;br /&gt;
Used tools: gmx grompp , gmx mdrun&lt;br /&gt;
&lt;br /&gt;
gmx grompp generates a single .tpr file that contains all information necessary for running a MD simulation or minimization using gmx mdrun.&lt;br /&gt;
&lt;br /&gt;
Minimization parameters are provided in martini_new-rf_min.mdp. The system will be minimized in 500 steps using steepest descent. The protein structure will be frozen during minimization.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-min.tpr - MD run input file&lt;br /&gt;
&lt;br /&gt;
-min.log - Output log file from minimization&lt;br /&gt;
&lt;br /&gt;
-min.trr - Minimization trajectory&lt;br /&gt;
&lt;br /&gt;
-min.gro - Minimized system coordinates&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;b.&#039;&#039;&#039; Simulate coarse-grained system&lt;br /&gt;
&lt;br /&gt;
MD simulation parameters are provided in martini_v2.x_new-rf.mdp. Strong position restraints are applied on the protein structure during the simulation. The system will be simulated for 50ns.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-md.tpr - MD run input file&lt;br /&gt;
&lt;br /&gt;
-md.log - Output log file from simulation&lt;br /&gt;
&lt;br /&gt;
-md.trr - lossless trajectory of simulation&lt;br /&gt;
&lt;br /&gt;
-md.xtc - coordinates of simulation trajectory&lt;br /&gt;
&lt;br /&gt;
-md.gro - coordinates of final simulation snapshot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The simulation will run for roughly 3 hours.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 3) Converting coarse-grained system to atomistic resolution and select lipid atoms for grid generation =&lt;br /&gt;
&lt;br /&gt;
This is automated in the script:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/0003-backmap-and-lpd-selection.sh&lt;br /&gt;
&lt;br /&gt;
== 3.1) Run the script ==&lt;br /&gt;
&lt;br /&gt;
Copy the script above to your working directory.&lt;br /&gt;
&lt;br /&gt;
./0003-backmap-and-lpd-selection.sh&lt;br /&gt;
&lt;br /&gt;
=== Workflow ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;a.&#039;&#039;&#039; Backmapping from coarse-grained to atomistic&lt;br /&gt;
&lt;br /&gt;
Used tool: gmx trjconv, initram.sh&lt;br /&gt;
&lt;br /&gt;
gmx trjconv can perform a variety of conversions of MD trajectory, e.g. making molecules broken over the periodic boundary conditions whole again. &lt;br /&gt;
&lt;br /&gt;
initram.sh calls the backward.py program which performs the backmapping of input coarse-grained to atomistic systems, and performs a small series of short minimizations and simulations to relax the backmapped system.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;backmap&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-0-backmapped.gro / projected.gro - initial backmapped coordinates&lt;br /&gt;
&lt;br /&gt;
-backmapped.top - Topology of atomistic system&lt;br /&gt;
&lt;br /&gt;
-1-EM*/2-EM* - Output from minimizations &lt;br /&gt;
&lt;br /&gt;
-3-mdpr*/4-mdpr*/5-mdpr*/6-mdpr* - Output from simulations&lt;br /&gt;
&lt;br /&gt;
-backmapped.gro - Coordinates of final backmapped and relaxed system&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This may need a few attempts to work all the way through. There is a while-loop that only stops until all relaxation steps have finished.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;b.&#039;&#039;&#039; Replacing backmapped protein with initial atomistic protein structure&lt;br /&gt;
&lt;br /&gt;
Used tool: PyMOL script align.pml&lt;br /&gt;
&lt;br /&gt;
The pymol script will align the initial &amp;quot;Gromacs&amp;quot;-protein structure (conf.pdb) onto the backmapped structure and combine the fitted protein coordinates with the coordinates of the lipid and solvent environment.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;backmap/prepare_AA_system&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-conf-fitted.pdb - Fitted initial protein structure&lt;br /&gt;
&lt;br /&gt;
-backmapped-environment.pdb - All membrane and water coordinates&lt;br /&gt;
&lt;br /&gt;
-fitted_system.pdb - Complete system containing fitted protein and environment coordinates&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure that fitted_system.pdb has the same number of coordinates as backmapped-mol.pdb.&#039;&#039;&#039; If there is a discrepancy there might be an issue with the PyMOL version you&#039;re using to run align.pml. Using PyMOL v2 or newer seems to avoid any issues. You can also generate backmapped-environment.pdb manually by taking all POPC and Water cooridnates from backmapped-mol.pdb.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;c.&#039;&#039;&#039; Run minimizations of atomistic system&lt;br /&gt;
&lt;br /&gt;
Used tools: gmx grompp, gmx mdrun&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;backmap/prepare_AA_system&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
Tow minimizations will be calculated. &lt;br /&gt;
&lt;br /&gt;
1) Minimization with frozen protein coordinates: 1,500 steps steepest descent (min_freeze.mdp).&lt;br /&gt;
&lt;br /&gt;
-min_freeze* - Output files of first minimization&lt;br /&gt;
&lt;br /&gt;
2) Minimization of full system: 500 steps (min.mdp).&lt;br /&gt;
&lt;br /&gt;
-min* - Output files of second minimization&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;d.&#039;&#039;&#039; Select lipid atoms for DOCK grid generation&lt;br /&gt;
&lt;br /&gt;
Used tools: PyMOL script prepare.pml&lt;br /&gt;
&lt;br /&gt;
This will select carbon and hydrogen atoms of the hydrophobic lipid tail segments in a radius of 1.7 nm around the protein and assign them to the atom type &amp;quot;LPD&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You need to provide the rec.pdb to want to use for docking (potentially with missing loops) at that step as xtal-prot.pdb&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;backmap/prepare_AA_system/prepare_min&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-shell-LPD.pdb - all LPD atoms selected for grid generation&lt;br /&gt;
&lt;br /&gt;
Add these coordinates to your docking protein structure and provide a amb.crg.oxt file adding&lt;br /&gt;
&lt;br /&gt;
C     lpd        0.000     LIPID SPHERE&lt;br /&gt;
&lt;br /&gt;
Now you can run blastermaster.&lt;br /&gt;
&lt;br /&gt;
= Membrane modelling in Schrodinger =&lt;br /&gt;
Written by Andrii Kyrylchuk, 2022/04/20&lt;br /&gt;
&lt;br /&gt;
== MD of protein and membrane ==&lt;br /&gt;
Import structure &#039;&#039;&#039;without&#039;&#039;&#039; ligand, use &amp;lt;u&amp;gt;Preparation wizard&amp;lt;/u&amp;gt; as described in &amp;quot;Code for Controls...&amp;quot;  to model missing loops and capping.&lt;br /&gt;
&lt;br /&gt;
Then open &amp;lt;u&amp;gt;System Builder&amp;lt;/u&amp;gt;, click &amp;lt;code&amp;gt;Setup membrane&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to the website https://opm.phar.umich.edu/proteins/ and find your protein. Copy residue numbers from the bottom of the page to the field &amp;lt;code&amp;gt;Transmembrane atoms...&amp;lt;/code&amp;gt;. The format is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;res.num 76-97,112-136,141,...&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click &amp;lt;code&amp;gt;Place Automatically&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt;. Then click &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt;. Examine lipids and solvent after run completes.&lt;br /&gt;
&lt;br /&gt;
Then use &amp;lt;u&amp;gt;Molecular Dynamics&amp;lt;/u&amp;gt; menu to set up the calculation. Select prepared system, click &amp;lt;code&amp;gt;Load&amp;lt;/code&amp;gt; on top of the menu. Put simulation time of 5 ns, &amp;lt;code&amp;gt;Advanced Options&amp;lt;/code&amp;gt; -- &amp;lt;code&amp;gt;Restraints&amp;lt;/code&amp;gt; -- &amp;lt;code&amp;gt;Add.&amp;lt;/code&amp;gt; Select protein, and put &amp;lt;code&amp;gt;Force Constant&amp;lt;/code&amp;gt; of 100, click &amp;lt;code&amp;gt;Apply&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;OK.&amp;lt;/code&amp;gt; Then click down arrow left of the &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt; button in the parent window and click &amp;lt;code&amp;gt;Write&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;NOTE&#039;&#039;&#039;: In my experience, restrained MD runs with NgPT in Schrodinger often fail with the following message:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&#039;&#039;Allowed momentum exceeded on 17 particles.&#039;&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This seems to be related to the interference of restraints and the ensemble, as no such error is observed if no restraints are imposed, or if NVT ensemble is used. Still, NgPT ensemble is important for correct membrane sampling, because simulations at NVT long enough to permit membrane relaxation, lead to the smearing of the lipid bilayer and the formation of empty space.&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;If the mentioned problem occurs, import the last coordinates of the run (*-out.cms) into Maestro, open Minimization menu, load the structure from the workspace, and apply restraints on lipid and protein (force restraint of 10 is usually enough). Then run a minimization for 100 ps, and try to run NgPT MD starting from the optimized structure.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;TO CHECK&#039;&#039;&#039;: NPT ensemble.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Copy the project folder (desmond_md_job_X) to gimel, login to &amp;lt;u&amp;gt;gimel5&amp;lt;/u&amp;gt;, edit desmond_md_job_X.sh: delete &amp;lt;code&amp;gt;-lic DESMOND_GPGPU:16&amp;lt;/code&amp;gt; and insert &amp;lt;code&amp;gt;-HOST gimel5.gpu&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;gimel5.heavygpu&amp;lt;/code&amp;gt;). Export &amp;lt;code&amp;gt;$SCHRODINGER&amp;lt;/code&amp;gt; variable:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SCHRODINGER=/nfs/soft2/schrodinger/2023-3/&amp;lt;/code&amp;gt; (or a newer version)&lt;br /&gt;
&lt;br /&gt;
Run .sh file, and your task will be submitted to a queue. For my system it took 1.5 hr to complete.&lt;br /&gt;
&lt;br /&gt;
Download the project folder to your PC, open Maestro, click &amp;lt;code&amp;gt;Import  structure&amp;lt;/code&amp;gt; and open &amp;lt;code&amp;gt;-out.cms&amp;lt;/code&amp;gt;, click on &amp;lt;code&amp;gt;T&amp;lt;/code&amp;gt; icon at the new entry in project table and click &amp;lt;code&amp;gt;Display Trajectory Snapshots&amp;lt;/code&amp;gt;. Select the last one, click &amp;lt;code&amp;gt;Display&amp;lt;/code&amp;gt; and check if the protein did not change position during MD run, then click &amp;lt;code&amp;gt;Export&amp;lt;/code&amp;gt;, to Project Table, Frames Selected only. You will get a new entry in the Project Table. Export it to a &amp;lt;code&amp;gt;.pdb&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
== Preparation of the structure for Blastermaster ==&lt;br /&gt;
Use &amp;lt;code&amp;gt;prepare.pml&amp;lt;/code&amp;gt; script. You need to provide the &amp;lt;code&amp;gt;rec.pdb&amp;lt;/code&amp;gt; to want to use for docking (potentially with missing loops) at that step as &amp;lt;code&amp;gt;xtal-prot.pdb&amp;lt;/code&amp;gt;. Rename MD system as &amp;lt;code&amp;gt;last-mol.pdb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;pymol -qc last-mol.pdb xtal-prot.pdb prepare.pml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
align last-mol, xtal-prot&lt;br /&gt;
&lt;br /&gt;
remove ////SPC&lt;br /&gt;
&lt;br /&gt;
create MEM, ////POPC&lt;br /&gt;
&lt;br /&gt;
# these atom numbers do not exist in POPC or DPPC&lt;br /&gt;
# therefore, we do not remove protons from the lipid&lt;br /&gt;
# structure to make more spheres. Uncomment these&lt;br /&gt;
# lines and change to proper H numbers if needed.&lt;br /&gt;
#remove /MEM////HS&lt;br /&gt;
#remove /MEM////HX&lt;br /&gt;
#remove /MEM////HY&lt;br /&gt;
#remove /MEM////H*B&lt;br /&gt;
#remove /MEM////H*A&lt;br /&gt;
#remove /MEM////H*C&lt;br /&gt;
&lt;br /&gt;
remove /MEM////C1&lt;br /&gt;
remove /MEM////C2&lt;br /&gt;
remove /MEM////C3&lt;br /&gt;
remove /MEM////C11&lt;br /&gt;
remove /MEM////C12&lt;br /&gt;
remove /MEM////C13&lt;br /&gt;
remove /MEM////C14&lt;br /&gt;
remove /MEM////C15&lt;br /&gt;
&lt;br /&gt;
create MEM_C, /MEM////*C* | /MEM////H*R | /MEM////H*S | /MEM////H*T | /MEM////H*X | /MEM////H*Y | /MEM////H*Z&lt;br /&gt;
&lt;br /&gt;
create shell, MEM_C within 20 of xtal-prot&lt;br /&gt;
&lt;br /&gt;
set retain_order, 1&lt;br /&gt;
&lt;br /&gt;
save shell.pdb, shell&lt;br /&gt;
&lt;br /&gt;
alter shell, resn=&#039;LPD&#039;&lt;br /&gt;
alter shell, name=&#039;C&#039;&lt;br /&gt;
alter shell, chain=&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
rebuild&lt;br /&gt;
&lt;br /&gt;
save shell-LPD.pdb, shell&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Preparation of grids with thinspheres ==&lt;br /&gt;
Prepare grids with thinspheres for the protein without lipid as described in https://wiki.docking.org/index.php/How_to_do_parameter_scanning&lt;br /&gt;
&lt;br /&gt;
Create an empty directory and put &amp;lt;code&amp;gt;shell-LPD.pdb&amp;lt;/code&amp;gt; there. Then run the following script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sh blast-membrane-thinsph-scan.sh {path to the collection of &amp;quot;es_ld_thin_sph_rad_X.X&amp;quot; directories} {path to the dir with original working and dockfiles directories}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script runs qnifft and solvmap for each &amp;lt;code&amp;gt;es_ld_thin_sph_rad_X.X&amp;lt;/code&amp;gt; directory, and then uses the second script of parameter scanning protocol to combine files into &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; directories.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important! LOOK AT YOUR GRIDS! Desolvation -- larger solvation where water is. Electrostatics -- no electrostatics in the lipid region. vdW -- no vdW in the lipid region.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# a script to prepare a protein with the lipid membrane for DOCK with thinsphere scan&lt;br /&gt;
# PREREQ -- run first step of https://wiki.docking.org/index.php/How_to_do_parameter_scanning (new_0001_generate_ES_LD_generation.py )&lt;br /&gt;
# first argument -- path to the directory where dirs &amp;quot;es_ld_thin_sph_rad_X.X&amp;quot; are stored. &lt;br /&gt;
# second argument -- path to the dir with original working and dockfiles&lt;br /&gt;
# run in a new directory with shell-LPD.pdb&lt;br /&gt;
&lt;br /&gt;
run_once () {&lt;br /&gt;
# mkdir  add_membrane&lt;br /&gt;
# Run qnifft for electrostatic grids&lt;br /&gt;
# cp $blastfiles_membrane/shell-LPD.pdb&lt;br /&gt;
# delete all fields except HETATM from shell-LPD.pdb&lt;br /&gt;
cp $curr_dir/shell-LPD.pdb .&lt;br /&gt;
sed -ir &#039;/^CRYST1/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^CONECT/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^END/d&#039; shell-LPD.pdb&lt;br /&gt;
cp $blastermaster_Prot/working/rec.crg.pdb .&lt;br /&gt;
#cp $blastermaster_Prot/working/lowdielectric.sph.pdb # (if wanted, if you run a  parameter scan, be sure to use the correct spheres!)&lt;br /&gt;
#cp -r $blastermaster_Prot/dockfiles .&lt;br /&gt;
#cp -r $blastermaster_Prot/INDOCK .&lt;br /&gt;
mv rec.crg.pdb  rec.crg.solo.pdb&lt;br /&gt;
cat rec.crg.solo.pdb shell-LPD.pdb  &amp;gt; receptor.crg.lowdielectric.pdb&lt;br /&gt;
# extracting SPH lines from receptor&lt;br /&gt;
number=$(grep -n  SPH  $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb | head -n 1 | awk -F &amp;quot;:&amp;quot; &#039;{print $1}&#039;)&lt;br /&gt;
tail --lines=+$number $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb &amp;gt;&amp;gt; receptor.crg.lowdielectric.pdb&lt;br /&gt;
need_files=&amp;quot;amb.crg.oxt&lt;br /&gt;
qnifft.parm&lt;br /&gt;
vdw.siz&amp;quot;&lt;br /&gt;
for file in $need_files&lt;br /&gt;
do&lt;br /&gt;
	if [ -e $blastermaster_Prot/working/$file ]&lt;br /&gt;
	then&lt;br /&gt;
		cp $blastermaster_Prot/working/$file .&lt;br /&gt;
	else&lt;br /&gt;
		cp $blast_orig/working/$file .&lt;br /&gt;
	fi&lt;br /&gt;
done&lt;br /&gt;
echo &amp;quot;C     lpd        0.000     LIPID SPHERE&amp;quot; &amp;gt;&amp;gt; amb.crg.oxt&lt;br /&gt;
cp $blastermaster_Prot/working/box .&lt;br /&gt;
cp $blastermaster_Prot/working/qnifft.parm .&lt;br /&gt;
cp $blastermaster_Prot/working/vdw.siz .&lt;br /&gt;
$DOCKBASE/proteins/qnifft/bin/qnifft22_193_pgf_32 qnifft.parm &amp;gt;&amp;amp; qnifft.log&lt;br /&gt;
$DOCKBASE/proteins/blastermaster/phiTrim.py qnifft.electrostatics.phi box trim.electrostatics.phi &amp;gt;&amp;amp; trim.log&lt;br /&gt;
&lt;br /&gt;
#cp trim.electrostatics.phi dockfiles/.&lt;br /&gt;
&lt;br /&gt;
# Check if the grid size changed:&lt;br /&gt;
#echo &amp;quot;Check if the grid size changed, compare this with INDOCK&amp;quot;&lt;br /&gt;
#python ~jklyu/zzz.script/pymol_movie/phi_to_dx.py trim.electrostatics.phi trim.electrostatics.phi.dx &amp;gt; gridsize&lt;br /&gt;
#head -n 1 gridsize&lt;br /&gt;
# compare with delphi_nsize in INDOCK&lt;br /&gt;
&lt;br /&gt;
# Run solvmap for Ligand Desolvation Grids if they are present in the folder&lt;br /&gt;
if [ -e $blastermaster_Prot/working/heavy ]&lt;br /&gt;
then&lt;br /&gt;
	mkdir heavy&lt;br /&gt;
	cd heavy || exit&lt;br /&gt;
	cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
	cp ../box .&lt;br /&gt;
	cp $blastermaster_Prot/working/heavy/INSEV .&lt;br /&gt;
	$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
	#cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
	cd ../ || exit&lt;br /&gt;
&lt;br /&gt;
	mkdir hydrogen&lt;br /&gt;
	cd hydrogen || exit&lt;br /&gt;
	cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
	cp ../box .&lt;br /&gt;
	cp $blastermaster_Prot/working/hydrogen/INSEV .&lt;br /&gt;
	$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
	#cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
fi&lt;br /&gt;
echo $dir &amp;quot; DONE!&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
curr_dir=$(pwd)&lt;br /&gt;
workdirs=$1&lt;br /&gt;
blast_orig=$2&lt;br /&gt;
dirs=$(ls -d $workdirs/es_ld_thin_sph_rad_*)&lt;br /&gt;
for dir in $dirs&lt;br /&gt;
do&lt;br /&gt;
	blastermaster_Prot=$dir&lt;br /&gt;
	local_dir=$(echo $dir | awk -F&amp;quot;\/&amp;quot; &#039;{print $NF}&#039;)&lt;br /&gt;
	mkdir -p $local_dir/working&lt;br /&gt;
	cd $local_dir/working || exit&lt;br /&gt;
	run_once&lt;br /&gt;
	cd $curr_dir || exit&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
python ~rstein/zzz.scripts/DOCK_prep_scripts/new_0002_combine_es_ld_grids_into_combos.py -p $blast_orig&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running blastermaster with default parameters ==&lt;br /&gt;
&#039;&#039;&#039;Warning! Do not use these grids, as the default grids with lipid spheres give incorrect solvation energies. Use the ones with thinspheres instead!&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# a script to prepare a protein with the lipid membrane for DOCK &lt;br /&gt;
# first argument -- path to blastermaster files of the protein without membrane&lt;br /&gt;
# run in a new directory with shell-LPD.pdb&lt;br /&gt;
blastermaster_Prot=$1&lt;br /&gt;
# mkdir  add_membrane&lt;br /&gt;
# Run qnifft for electrostatic grids&lt;br /&gt;
# cp $blastfiles_membrane/shell-LPD.pdb&lt;br /&gt;
# delete all fields except HETATM from shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^CRYST1/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^CONECT/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^END/d&#039; shell-LPD.pdb&lt;br /&gt;
cp $blastermaster_Prot/working/rec.crg.pdb .&lt;br /&gt;
#cp $blastermaster_Prot/working/lowdielectric.sph.pdb # (if wanted, if you run a  parameter scan, be sure to use the correct spheres!)&lt;br /&gt;
cp -r $blastermaster_Prot/dockfiles .&lt;br /&gt;
cp -r $blastermaster_Prot/INDOCK .&lt;br /&gt;
mv rec.crg.pdb  rec.crg.solo.pdb&lt;br /&gt;
cat rec.crg.solo.pdb shell-LPD.pdb  &amp;gt; receptor.crg.lowdielectric.pdb&lt;br /&gt;
# extracting SPH lines from receptor&lt;br /&gt;
number=$(grep -n  SPH  $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb | head -n 1 | awk -F &amp;quot;:&amp;quot; &#039;{print $1}&#039;)&lt;br /&gt;
tail --lines=+$number $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb &amp;gt;&amp;gt; rec.crg.lowdielectric.pdb&lt;br /&gt;
cp $blastermaster_Prot/working/amb.crg.oxt .&lt;br /&gt;
echo &amp;quot;C     lpd        0.000     LIPID SPHERE&amp;quot; &amp;gt;&amp;gt; amb.crg.oxt&lt;br /&gt;
cp $blastermaster_Prot/working/box .&lt;br /&gt;
cp $blastermaster_Prot/working/qnifft.parm .&lt;br /&gt;
cp $blastermaster_Prot/working/vdw.siz .&lt;br /&gt;
$DOCKBASE/proteins/qnifft/bin/qnifft22_193_pgf_32 qnifft.parm &amp;gt;&amp;amp; qnifft.log&lt;br /&gt;
$DOCKBASE/proteins/blastermaster/phiTrim.py qnifft.electrostatics.phi box trim.electrostatics.phi &amp;gt;&amp;amp; trim.log&lt;br /&gt;
&lt;br /&gt;
cp trim.electrostatics.phi dockfiles/.&lt;br /&gt;
&lt;br /&gt;
# Check if the grid size changed:&lt;br /&gt;
echo &amp;quot;Check if the grid size changed, compare this with INDOCK&amp;quot;&lt;br /&gt;
python ~jklyu/zzz.script/pymol_movie/phi_to_dx.py trim.electrostatics.phi trim.electrostatics.phi.dx &amp;gt; gridsize&lt;br /&gt;
head -n 1 gridsize&lt;br /&gt;
# compare with delphi_nsize in INDOCK&lt;br /&gt;
&lt;br /&gt;
# Run solvmap for Ligand Desolvation Grids&lt;br /&gt;
mkdir heavy&lt;br /&gt;
cd heavy || exit&lt;br /&gt;
cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
cp ../box .&lt;br /&gt;
cp $blastermaster_Prot/working/heavy/INSEV .&lt;br /&gt;
$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
cd ../ || exit&lt;br /&gt;
&lt;br /&gt;
mkdir hydrogen&lt;br /&gt;
cd hydroger || exit&lt;br /&gt;
cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
cp ../box .&lt;br /&gt;
cp $blastermaster_Prot/working/hydrogen/INSEV .&lt;br /&gt;
$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
echo &amp;quot;DONE!&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Lipid membrane models from MemProtMD ==&lt;br /&gt;
If a protein-membrane complex was already modeled for your system and deposited at [http://memprotmd.bioch.ox.ac.uk/home/ MemProtMD] website, you can use it and skip doing MD in Schrodinger. The steps are very similar to the ones after Schrodinger run.&lt;br /&gt;
&lt;br /&gt;
Download the &amp;lt;code&amp;gt;*_default_dppc.mpmd.finalframe.atomistic.pdb&amp;lt;/code&amp;gt; file from the bottom of the page. Rename it to &amp;lt;code&amp;gt;last-mol.pdb&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Use prepare.pml script (below). You need to provide the &amp;lt;code&amp;gt;rec.pdb&amp;lt;/code&amp;gt; to want to use for docking (potentially with missing loops) at that step as &amp;lt;code&amp;gt;xtal-prot.pdb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;pymol -qc last-mol.pdb xtal-prot.pdb prepare.pml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script below differs from the one for processing Schrodinger results in two points: solvent residue is &amp;lt;code&amp;gt;SOL&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;SPC&amp;lt;/code&amp;gt;, and lipids are called &amp;lt;code&amp;gt;DPPC&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;POPC&amp;lt;/code&amp;gt;.&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
align last-mol, xtal-prot&lt;br /&gt;
&lt;br /&gt;
remove ////SOL&lt;br /&gt;
&lt;br /&gt;
create MEM, ////DPPC&lt;br /&gt;
&lt;br /&gt;
remove /MEM////HS&lt;br /&gt;
remove /MEM////HX&lt;br /&gt;
remove /MEM////HY&lt;br /&gt;
remove /MEM////H*B&lt;br /&gt;
remove /MEM////H*A&lt;br /&gt;
remove /MEM////H*C&lt;br /&gt;
&lt;br /&gt;
remove /MEM////C1&lt;br /&gt;
remove /MEM////C2&lt;br /&gt;
remove /MEM////C3&lt;br /&gt;
remove /MEM////C11&lt;br /&gt;
remove /MEM////C12&lt;br /&gt;
remove /MEM////C13&lt;br /&gt;
remove /MEM////C14&lt;br /&gt;
remove /MEM////C15&lt;br /&gt;
&lt;br /&gt;
create MEM_C, /MEM////*C* | /MEM////H*R | /MEM////H*S | /MEM////H*T | /MEM////H*X | /MEM////H*Y | /MEM////H*Z&lt;br /&gt;
&lt;br /&gt;
create shell, MEM_C within 20 of xtal-prot&lt;br /&gt;
&lt;br /&gt;
set retain_order, 1&lt;br /&gt;
&lt;br /&gt;
save shell.pdb, shell&lt;br /&gt;
&lt;br /&gt;
alter shell, resn=&#039;LPD&#039;&lt;br /&gt;
alter shell, name=&#039;C&#039;&lt;br /&gt;
alter shell, chain=&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
rebuild&lt;br /&gt;
&lt;br /&gt;
save shell-LPD.pdb, shell&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Positioning of the membrane ==&lt;br /&gt;
If there is no precomputed membrane position from OPM or MemProtMD, you can model it using  PPM 3.0 webserver (https://opm.phar.umich.edu/ppm_server3) or standalone software. The software is installed in &amp;lt;code&amp;gt;/nfs/home/ak87/exa/PROGRAM/OPM-MEMBRANE&amp;lt;/code&amp;gt;. Copy &amp;lt;code&amp;gt;res.lib&amp;lt;/code&amp;gt; file from the program directory to the directory with your .pdb file. Create input file like this:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
0 PMm out rec.pdb&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;blockquote&amp;gt;0 or 1 -“do not use” or “use” heteroatoms in the input PDB file, respectively (solvent molecules are always excluded).&lt;br /&gt;
&lt;br /&gt;
MOM - type of membrane (see list of 3-letter codes for membranes below)&lt;br /&gt;
&lt;br /&gt;
“in” or “out” means topology of N-terminus of first subunit included in the corresponding input PDB file&lt;br /&gt;
&lt;br /&gt;
With this option, for every input pdb file, the program will selected automatically the flat or curved membrane boundaries, whichever had the lower calculated transfer energy.&amp;lt;/blockquote&amp;gt;Then run the program:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;~ak87/exa/PROGRAM/OPM-MEMBRANE/immers&amp;lt;1membrane.inp&amp;gt;rec-opm.out&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;datasub1&amp;lt;/code&amp;gt; file to extract residue numbers for the membrane placement in Maestro.&lt;br /&gt;
See ppm3_instructions.docx file in the program directory for more detail.&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Synthesia&amp;diff=14902</id>
		<title>Synthesia</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Synthesia&amp;diff=14902"/>
		<updated>2022-10-11T17:43:11Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: /* How to create this tree? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;blockquote&amp;gt;Synthesia is a command-line tool that uses an entire retrosynthetic route as a guide pathway to generate optimized structural analogues of a lead compound without compromising the synthesizability of the structure. The users has the ability to guide the structural modifications in a desired direction by specifying structural constraints.&amp;lt;/blockquote&amp;gt;Original publication: https://pubs.acs.org/doi/10.1021/acs.jcim.2c00246&lt;br /&gt;
&lt;br /&gt;
Website: https://software.zbh.uni-hamburg.de/customers/tools &lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
To obtain the license, you need to register and get your account approved. Then login to the website, click on Synthesia and &amp;quot;Download the license file&amp;quot;. Your license key is inside the file, it looks like &amp;lt;code&amp;gt;AAAAAAAliFQAAAAU2eM8ZjTTELGD3LzxBgt3/1DGaW4=&amp;lt;/code&amp;gt;. Copy the license key from the file, download and unpack the program and run the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;./synthesia --license &amp;lt;your_license_here&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
My installation is in &amp;lt;code&amp;gt;/mnt/nfs/exa/work/ak87/UCSF/SynthI/SYNTHESIA/synthesia_1.0.0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running ==&lt;br /&gt;
To run the program, you need:&lt;br /&gt;
&lt;br /&gt;
# a retrosynthetic tree and &lt;br /&gt;
# a library of building blocks (&amp;quot;&amp;lt;code&amp;gt;SMILES Name&amp;lt;/code&amp;gt;&amp;quot;, no preprocessing needed).&lt;br /&gt;
&lt;br /&gt;
The tool returns analogs of a target molecule synthesizable by the given route from given BBs. The analogs may be filtered by 29 different parameters (see SI or README.md file):&lt;br /&gt;
&lt;br /&gt;
# Extended-Connectivity Fingerprints (ECFP)&lt;br /&gt;
# Functional-Class Fingerprints (FCFP)&lt;br /&gt;
# Connected Subgraph Fingerprints (CSFP)&lt;br /&gt;
# Largest Ring&lt;br /&gt;
# Largest Ringsystem&lt;br /&gt;
# Molecular Weight&lt;br /&gt;
# Number of Hydrogen-Bond Acceptors&lt;br /&gt;
# Number of Anions&lt;br /&gt;
# Number of Aromatic Atoms&lt;br /&gt;
# Number of Aromatic Rings&lt;br /&gt;
# Number of Aromatic Ringsystems&lt;br /&gt;
# Number of Cations&lt;br /&gt;
# Number of Hydrogen-Bond Donors&lt;br /&gt;
# Number of Halogens&lt;br /&gt;
# Number of Non-Hydrogen Atoms&lt;br /&gt;
# Number of Hetero Atoms&lt;br /&gt;
# Number of Hydrophobic Points&lt;br /&gt;
# Number of Inorganic Atoms&lt;br /&gt;
# Number of Lipinski Donors&lt;br /&gt;
# Number of Nitrogens and Oxygens&lt;br /&gt;
# Number of Non-Hydrogen Bonds&lt;br /&gt;
# Number of Rings&lt;br /&gt;
# Number of Ringsystems&lt;br /&gt;
# Number of Rotatable Bonds&lt;br /&gt;
# LogP-Value&lt;br /&gt;
# Total Charge&lt;br /&gt;
# Topological Polar Surface Area (TPSA)&lt;br /&gt;
# Volume&lt;br /&gt;
# Matching SMARTSS3 pattern. Either inclusion or exclusion&lt;br /&gt;
&lt;br /&gt;
=== Retrosynthetic tree ===&lt;br /&gt;
This is a .json file that describes all steps needed to synthesize the molecule in question and starting reagents. The steps are encoded in SMARTS. Each reaction node should contain reaction SMARTS + SMILES of the product. The tree for [https://zinc15.docking.org/substances/ZINC000000000347/ granisetron] synthesis via amidation is shown below.&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;smiles&amp;quot;: &amp;quot;CN1C2CCCC1CC(C2)NC(=O)c1nn(C)c2ccccc12&amp;quot;,&lt;br /&gt;
  &amp;quot;is_chemical&amp;quot;: true,&lt;br /&gt;
  &amp;quot;children&amp;quot;:&lt;br /&gt;
  [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;smiles&amp;quot;: &amp;quot;CN1C2CCCC1CC(C2)NC(=O)c1nn(C)c2ccccc12&amp;quot;,&lt;br /&gt;
      &amp;quot;is_reaction&amp;quot;: true,&lt;br /&gt;
      &amp;quot;smartsPattern&amp;quot;: &amp;quot;[#7:1].[#8]-[#6:2](=O)&amp;gt;&amp;gt;[#7:1]-[#6:2](=O)&amp;quot;,&lt;br /&gt;
      &amp;quot;children&amp;quot;:&lt;br /&gt;
      [&lt;br /&gt;
        {&lt;br /&gt;
          &amp;quot;smiles&amp;quot;: &amp;quot;Cn1nc(C(O)=O)c2ccccc12&amp;quot;,&lt;br /&gt;
          &amp;quot;is_chemical&amp;quot;: true,&lt;br /&gt;
          &amp;quot;children&amp;quot;: []&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
          &amp;quot;smiles&amp;quot;: &amp;quot;CN1C2CCCC1CC(N)C2&amp;quot;,&lt;br /&gt;
          &amp;quot;is_chemical&amp;quot;: true,&lt;br /&gt;
          &amp;quot;children&amp;quot;: []&lt;br /&gt;
        }&lt;br /&gt;
      ]&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==== How to create this tree? ====&lt;br /&gt;
* If only one stage needed -- just write manually.&lt;br /&gt;
* The authors used open-source ML tool AiZynthFinder: https://jcheminf.biomedcentral.com/articles/10.1186/s13321-020-00472-1, https://github.com/MolecularAI/aizynthfinder&lt;br /&gt;
* Reaxys Retrosynthesis tool (was not able to find a root for granisetron though, seems to use only published procedures)&lt;br /&gt;
* Sci-Finder Retrosynthesis. Exports results in .pdf only, but at least you can copy compound SMILES from the Retrosynthesis Plan, just click on the structure and select &amp;quot;Substance Detail&amp;quot;.&lt;br /&gt;
* IBM RXN https://rxn.res.ibm.com/. Based on machine-extracted patent reactions. You have to manually select reactions for each step.&lt;br /&gt;
* Spaya AI https://spaya.ai. &lt;br /&gt;
&lt;br /&gt;
In any case, except for one stage synthesis, I would recommend consulting a synthetic chemist before creating analogs.&lt;br /&gt;
&lt;br /&gt;
=== Configuration file ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;All additional settings of Synthesia can be specified in a configuration file. This file is optional and the user does not have to use it. If both the configuration file as well as command line parameters are used to define parameters, the settings parsed via command line overwrite settings defined in the configuration file. The configuration file has to be in valid standard JSON format. An example configuration file is bundled with Synthesia.&amp;lt;/blockquote&amp;gt;So far I&#039;ve been using only command line parameters.&lt;br /&gt;
&lt;br /&gt;
=== Running ===&lt;br /&gt;
&amp;lt;code&amp;gt;./synthesia --inputStructures ../../Enamine-BB/2022-03_Chemspace_Building_Blocks_noRU_SMILES.smiles --retroSynTree amide_tree.json --output amide_out-ecfp.json  --threads 4 --verbosity 5 --allLeaves --useECFP 2 tanimoto 0.6 1.0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--inputStructures&amp;lt;/code&amp;gt; -- a library of BBs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--retroSynTree&amp;lt;/code&amp;gt; -- self-explanatory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--output&amp;lt;/code&amp;gt; -- output .json file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--threads&amp;lt;/code&amp;gt; -- Number of threads used for parallelization.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--allLeaves&amp;lt;/code&amp;gt; -- &#039;&#039;&#039;very important&#039;&#039;&#039;: without it you will only get suitable BBs and not final structures. The README says: &#039;&#039;Set this parameter to true if all chemical leaf nodes should be open for exchange. Either this parameter or the option allChemicals must be set or the nodeId parameter must be specified&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--useECFP&amp;lt;/code&amp;gt; -- filter analogs by ECFP. 4 parameter values are expected: &amp;lt;Integer&amp;gt; &amp;lt;String&amp;gt; &amp;lt;Integer&amp;gt; &amp;lt;Integer&amp;gt; The first number equals the appended number of the FCFP. The second string parameters specifies the similarity measure method for a fingerprint comparison. Options are &#039;tanimoto&#039;, &#039;cosine&#039;, &#039;hamming&#039;, &#039;euclidean&#039;, &#039;dice.&#039; The third number specifies the minimum threshold value for the similarity fingerprint comparison and the fourth number specifies the maximum threshold value.&lt;br /&gt;
&lt;br /&gt;
This command executed on Gimel returns 511 analogs of granisetron in 1&#039;56&amp;quot; from 436K BBs.&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
Pros of Synthesia — flexibility, multistage reactions of virtually any complexity and number of stages, fine-tuning of analog properties (No. of aromatic rings, halogens, cations, logP…).&lt;br /&gt;
&lt;br /&gt;
Cons — closed sources, licensing on a per-year basis, steep learning curve, need to create retrosynthetic trees for each compound.&lt;br /&gt;
&lt;br /&gt;
My resume at the moment — may be interesting to look into given access to a synthetic chemistry group.&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Membrane_Modeling&amp;diff=14754</id>
		<title>Membrane Modeling</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Membrane_Modeling&amp;diff=14754"/>
		<updated>2022-09-04T21:20:11Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Written by Stefan Gahbauer, 2019/11/03&lt;br /&gt;
&lt;br /&gt;
In order to account for ligand desolvation and electrostatic interactions in the low-dielectric environment of the hydrophobic membrane core, a lipid-bilayer is generated around the target receptor and included in the docking score grid generation.&lt;br /&gt;
Aiming at a fast, robust and computationally effective equilibration of the lipid bilayer around the embedded transmembrane receptor, coarse-grained (CG) molecular dynamics (MD) simulations and (if needed) subsequent atomistic simulations are employed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Required software and datasets =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gromacs&#039;&#039;&#039; (v5 or newer) - Molecular Dynamics software package (http://manual.gromacs.org/)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CHARMM36m force field&#039;&#039;&#039; (http://mackerell.umaryland.edu/charmm_ff.shtml)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MARTINI&#039;&#039;&#039; Coarse-grained force field parameters(http://cgmartini.nl/)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DSSP&#039;&#039;&#039; - Secondary Structure assignment (https://swift.cmbi.umcn.nl/gv/dssp/ , https://anaconda.org/salilab/dssp)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;martinize.py&#039;&#039;&#039; - Coarse-graining atomistic protein structures (http://cgmartini.nl/index.php/tools2/proteins-and-bilayers)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;insane.py&#039;&#039;&#039; - INSerting proteins in coarse-grained MembrANE (http://cgmartini.nl/index.php/tools2/proteins-and-bilayers)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;initram.sh&#039;&#039;&#039; and &#039;&#039;&#039;backward.py&#039;&#039;&#039; - Conversion of coarse-grained system to atomistic resolution (http://cgmartini.nl/index.php/tools2/resolution-transformation)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 1) Setting up the coarse-grained system =&lt;br /&gt;
&lt;br /&gt;
This is automated in the script:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/0001-prepare-protein-CG-membrane.sh&lt;br /&gt;
&lt;br /&gt;
== 1.1) Prepare your files ==&lt;br /&gt;
&lt;br /&gt;
Copy the script above to your working directory.&lt;br /&gt;
&lt;br /&gt;
Copy your rec.pdb to your working directory.&lt;br /&gt;
&lt;br /&gt;
If your rec.pdb has gaps, e.g. unresolved loops between transmembrane helices in case of GPCRs, try to model missing residues.&lt;br /&gt;
&lt;br /&gt;
One way is to use MODELLER following https://salilab.org/modeller/wiki/Missing%20residues.&lt;br /&gt;
&lt;br /&gt;
Corresponding input scripts for modeller can be found in:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/modeller&lt;br /&gt;
&lt;br /&gt;
== 1.2) Run the script ==&lt;br /&gt;
&lt;br /&gt;
Login to gimel2.&lt;br /&gt;
&lt;br /&gt;
./0001-prepare-protein-CG-membrane.sh&lt;br /&gt;
&lt;br /&gt;
The script reads rec.pdb and copies all other required files from &lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/gromacs&lt;br /&gt;
&lt;br /&gt;
=== Workflow ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;a.&#039;&#039;&#039; Generate CHARMM36m force field parameters of your protein in a Gromacs-readable format. &lt;br /&gt;
&lt;br /&gt;
Used tool: gmx pdb2gmx &lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;pdb2gmx&#039;&#039; directory&lt;br /&gt;
&lt;br /&gt;
-conf.gro / conf.pdb - Gromacs coordinate file&lt;br /&gt;
&lt;br /&gt;
-topol.top / Protein-atomistic.itp - Gromacs topology file, i.e. force field description of your input structure&lt;br /&gt;
&lt;br /&gt;
-posre.itp - Position restraints for heavy atoms of atomistic protein strucutre.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;b.&#039;&#039;&#039; Build coarse-grained structure&lt;br /&gt;
&lt;br /&gt;
Used tool: martinize.py&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-chain_.ssd - Output from the DSSP program that is called by martinize.py&lt;br /&gt;
&lt;br /&gt;
-prot-cg.pdb - Coarse-grained protein structure&lt;br /&gt;
&lt;br /&gt;
-prot-cg.top - Coarse-grained Martini topology of system&lt;br /&gt;
&lt;br /&gt;
-Protein.itp - Coarse-grained Martini description of Protein structure&lt;br /&gt;
&lt;br /&gt;
-prot-rot.pdb - Coarse-grained protein structure aligned along z-axis of the simulation box according to the proteins first principal component axis. This ensures the correct placement of the protein during membrane preparation. &#039;&#039;&#039;You may have to adjust the orientation of your input structure prior to membrane modeling.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;c.&#039;&#039;&#039; Build coarse-grained membrane&lt;br /&gt;
&lt;br /&gt;
Used tool: insane.py&lt;br /&gt;
&lt;br /&gt;
Here, a lipid bilayer will be created around the protein structure (in the x/y-plane) and water will be added to the system. The default box shape is rectangular and the size is set to x,y=10nm, z=11nm. This can be changed in the ./insane.py command line. The default lipid type is POPC, you can change that to arbitrary lipid compositions using the -l and -u options of of insane.py.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-out.top / topol-cg.top - Topology of coarse-grained system&lt;br /&gt;
&lt;br /&gt;
-cg-membrane.gro/.pdb - Coarse-grained system coordinates. &#039;&#039;&#039;Carefully inspect and visualize the cg-membrane.pdb.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use PyMOL to check if you&#039;re protein is embedded correctly in the lipid bilayer.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 2) Simulating the coarse-grained system =&lt;br /&gt;
&lt;br /&gt;
This is automated in the script:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/0002-run-CG-Minimization-and-MD.sh&lt;br /&gt;
&lt;br /&gt;
== 2.1) Run the script ==&lt;br /&gt;
&lt;br /&gt;
Copy the script above to your working directory.&lt;br /&gt;
&lt;br /&gt;
./0002-run-CG-Minimization-and-MD.sh&lt;br /&gt;
&lt;br /&gt;
=== Workflow ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;a.&#039;&#039;&#039; Minimize coarse-grained system&lt;br /&gt;
&lt;br /&gt;
Used tools: gmx grompp , gmx mdrun&lt;br /&gt;
&lt;br /&gt;
gmx grompp generates a single .tpr file that contains all information necessary for running a MD simulation or minimization using gmx mdrun.&lt;br /&gt;
&lt;br /&gt;
Minimization parameters are provided in martini_new-rf_min.mdp. The system will be minimized in 500 steps using steepest descent. The protein structure will be frozen during minimization.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-min.tpr - MD run input file&lt;br /&gt;
&lt;br /&gt;
-min.log - Output log file from minimization&lt;br /&gt;
&lt;br /&gt;
-min.trr - Minimization trajectory&lt;br /&gt;
&lt;br /&gt;
-min.gro - Minimized system coordinates&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;b.&#039;&#039;&#039; Simulate coarse-grained system&lt;br /&gt;
&lt;br /&gt;
MD simulation parameters are provided in martini_v2.x_new-rf.mdp. Strong position restraints are applied on the protein structure during the simulation. The system will be simulated for 50ns.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-md.tpr - MD run input file&lt;br /&gt;
&lt;br /&gt;
-md.log - Output log file from simulation&lt;br /&gt;
&lt;br /&gt;
-md.trr - lossless trajectory of simulation&lt;br /&gt;
&lt;br /&gt;
-md.xtc - coordinates of simulation trajectory&lt;br /&gt;
&lt;br /&gt;
-md.gro - coordinates of final simulation snapshot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The simulation will run for roughly 3 hours.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 3) Converting coarse-grained system to atomistic resolution and select lipid atoms for grid generation =&lt;br /&gt;
&lt;br /&gt;
This is automated in the script:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/0003-backmap-and-lpd-selection.sh&lt;br /&gt;
&lt;br /&gt;
== 3.1) Run the script ==&lt;br /&gt;
&lt;br /&gt;
Copy the script above to your working directory.&lt;br /&gt;
&lt;br /&gt;
./0003-backmap-and-lpd-selection.sh&lt;br /&gt;
&lt;br /&gt;
=== Workflow ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;a.&#039;&#039;&#039; Backmapping from coarse-grained to atomistic&lt;br /&gt;
&lt;br /&gt;
Used tool: gmx trjconv, initram.sh&lt;br /&gt;
&lt;br /&gt;
gmx trjconv can perform a variety of conversions of MD trajectory, e.g. making molecules broken over the periodic boundary conditions whole again. &lt;br /&gt;
&lt;br /&gt;
initram.sh calls the backward.py program which performs the backmapping of input coarse-grained to atomistic systems, and performs a small series of short minimizations and simulations to relax the backmapped system.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;backmap&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-0-backmapped.gro / projected.gro - initial backmapped coordinates&lt;br /&gt;
&lt;br /&gt;
-backmapped.top - Topology of atomistic system&lt;br /&gt;
&lt;br /&gt;
-1-EM*/2-EM* - Output from minimizations &lt;br /&gt;
&lt;br /&gt;
-3-mdpr*/4-mdpr*/5-mdpr*/6-mdpr* - Output from simulations&lt;br /&gt;
&lt;br /&gt;
-backmapped.gro - Coordinates of final backmapped and relaxed system&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This may need a few attempts to work all the way through. There is a while-loop that only stops until all relaxation steps have finished.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;b.&#039;&#039;&#039; Replacing backmapped protein with initial atomistic protein structure&lt;br /&gt;
&lt;br /&gt;
Used tool: PyMOL script align.pml&lt;br /&gt;
&lt;br /&gt;
The pymol script will align the initial &amp;quot;Gromacs&amp;quot;-protein structure (conf.pdb) onto the backmapped structure and combine the fitted protein coordinates with the coordinates of the lipid and solvent environment.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;backmap/prepare_AA_system&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-conf-fitted.pdb - Fitted initial protein structure&lt;br /&gt;
&lt;br /&gt;
-backmapped-environment.pdb - All membrane and water coordinates&lt;br /&gt;
&lt;br /&gt;
-fitted_system.pdb - Complete system containing fitted protein and environment coordinates&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure that fitted_system.pdb has the same number of coordinates as backmapped-mol.pdb.&#039;&#039;&#039; If there is a discrepancy there might be an issue with the PyMOL version you&#039;re using to run align.pml. Using PyMOL v2 or newer seems to avoid any issues. You can also generate backmapped-environment.pdb manually by taking all POPC and Water cooridnates from backmapped-mol.pdb.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;c.&#039;&#039;&#039; Run minimizations of atomistic system&lt;br /&gt;
&lt;br /&gt;
Used tools: gmx grompp, gmx mdrun&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;backmap/prepare_AA_system&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
Tow minimizations will be calculated. &lt;br /&gt;
&lt;br /&gt;
1) Minimization with frozen protein coordinates: 1,500 steps steepest descent (min_freeze.mdp).&lt;br /&gt;
&lt;br /&gt;
-min_freeze* - Output files of first minimization&lt;br /&gt;
&lt;br /&gt;
2) Minimization of full system: 500 steps (min.mdp).&lt;br /&gt;
&lt;br /&gt;
-min* - Output files of second minimization&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;d.&#039;&#039;&#039; Select lipid atoms for DOCK grid generation&lt;br /&gt;
&lt;br /&gt;
Used tools: PyMOL script prepare.pml&lt;br /&gt;
&lt;br /&gt;
This will select carbon and hydrogen atoms of the hydrophobic lipid tail segments in a radius of 1.7 nm around the protein and assign them to the atom type &amp;quot;LPD&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You need to provide the rec.pdb to want to use for docking (potentially with missing loops) at that step as xtal-prot.pdb&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;backmap/prepare_AA_system/prepare_min&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-shell-LPD.pdb - all LPD atoms selected for grid generation&lt;br /&gt;
&lt;br /&gt;
Add these coordinates to your docking protein structure and provide a amb.crg.oxt file adding&lt;br /&gt;
&lt;br /&gt;
C     lpd        0.000     LIPID SPHERE&lt;br /&gt;
&lt;br /&gt;
Now you can run blastermaster.&lt;br /&gt;
&lt;br /&gt;
= Membrane modelling in Schrodinger =&lt;br /&gt;
Written by Andrii Kyrylchuk, 2022/04/20&lt;br /&gt;
&lt;br /&gt;
== MD of protein and membrane ==&lt;br /&gt;
Import structure &#039;&#039;&#039;without&#039;&#039;&#039; ligand, use &amp;lt;u&amp;gt;Preparation wizard&amp;lt;/u&amp;gt; as described in &amp;quot;Code for Controls...&amp;quot;  to model missing loops and capping.&lt;br /&gt;
&lt;br /&gt;
Then open &amp;lt;u&amp;gt;System Builder&amp;lt;/u&amp;gt;, click &amp;lt;code&amp;gt;Setup membrane&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to the website https://opm.phar.umich.edu/proteins/ and find your protein. Copy residue numbers from the bottom of the page to the field &amp;lt;code&amp;gt;Transmembrane atoms...&amp;lt;/code&amp;gt;. The format is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;res.num 76-97,112-136,141,...&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click &amp;lt;code&amp;gt;Place Automatically&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt;. Then click &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt;. Examine lipids and solvent after run completes.&lt;br /&gt;
&lt;br /&gt;
Then use &amp;lt;u&amp;gt;Molecular Dynamics&amp;lt;/u&amp;gt; menu to set up the calculation. Select prepared system, click &amp;lt;code&amp;gt;Load&amp;lt;/code&amp;gt; on top of the menu. Put simulation time of 5 ns, &amp;lt;code&amp;gt;Advanced Options&amp;lt;/code&amp;gt; -- &amp;lt;code&amp;gt;Restraints&amp;lt;/code&amp;gt; -- &amp;lt;code&amp;gt;Add.&amp;lt;/code&amp;gt; Select protein, and put &amp;lt;code&amp;gt;Force Constant&amp;lt;/code&amp;gt; of 100, click &amp;lt;code&amp;gt;Apply&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;OK.&amp;lt;/code&amp;gt; Then click down arrow left of the &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt; button in the parent window and click &amp;lt;code&amp;gt;Write&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;NOTE&#039;&#039;&#039;: In my experience, restrained MD runs with NgPT in Schrodinger often fail with the following message:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&#039;&#039;Allowed momentum exceeded on 17 particles.&#039;&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This seems to be related to the interference of restraints and the ensemble, as no such error is observed if no restraints are imposed, or if NVT ensemble is used. Still, NgPT ensemble is important for correct membrane sampling, because simulations at NVT long enough to permit membrane relaxation, lead to the smearing of the lipid bilayer and the formation of empty space.&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;If the mentioned problem occurs, import the last coordinates of the run (*-out.cms) into Maestro, open Minimization menu, load the structure from the workspace, and apply restraints on lipid and protein (force restraint of 10 is usually enough). Then run a minimization for 100 ps, and try to run NgPT MD starting from the optimized structure.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;TO CHECK&#039;&#039;&#039;: NPT ensemble.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Copy the project folder (desmond_md_job_X) to gimel, login to &amp;lt;u&amp;gt;gimel5&amp;lt;/u&amp;gt;, edit desmond_md_job_X.sh: delete &amp;lt;code&amp;gt;-lic DESMOND_GPGPU:16&amp;lt;/code&amp;gt; and insert &amp;lt;code&amp;gt;-HOST gimel5.gpu&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;gimel5.heavygpu&amp;lt;/code&amp;gt;). Run .sh file, and your task will be submitted to a queue. For my system it took 1.5 hr to complete.&lt;br /&gt;
&lt;br /&gt;
Download the project folder to your PC, open Maestro, click &amp;lt;code&amp;gt;Import  structure&amp;lt;/code&amp;gt; and open &amp;lt;code&amp;gt;-out.cms&amp;lt;/code&amp;gt;, click on &amp;lt;code&amp;gt;T&amp;lt;/code&amp;gt; icon at the new entry in project table and click &amp;lt;code&amp;gt;Display Trajectory Snapshots&amp;lt;/code&amp;gt;. Select the last one, click &amp;lt;code&amp;gt;Display&amp;lt;/code&amp;gt; and check if the protein did not change position during MD run, then click &amp;lt;code&amp;gt;Export&amp;lt;/code&amp;gt;, to Project Table, Frames Selected only. You will get a new entry in the Project Table. Export it to a &amp;lt;code&amp;gt;.pdb&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
== Preparation of the structure for Blastermaster ==&lt;br /&gt;
Use &amp;lt;code&amp;gt;prepare.pml&amp;lt;/code&amp;gt; script. You need to provide the &amp;lt;code&amp;gt;rec.pdb&amp;lt;/code&amp;gt; to want to use for docking (potentially with missing loops) at that step as &amp;lt;code&amp;gt;xtal-prot.pdb&amp;lt;/code&amp;gt;. Rename MD system as &amp;lt;code&amp;gt;last-mol.pdb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;pymol -qc last-mol.pdb xtal-prot.pdb prepare.pml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
align last-mol, xtal-prot&lt;br /&gt;
&lt;br /&gt;
remove ////SPC&lt;br /&gt;
&lt;br /&gt;
create MEM, ////POPC&lt;br /&gt;
&lt;br /&gt;
# these atom numbers do not exist in POPC or DPPC&lt;br /&gt;
# therefore, we do not remove protons from the lipid&lt;br /&gt;
# structure to make more spheres. Uncomment these&lt;br /&gt;
# lines and change to proper H numbers if needed.&lt;br /&gt;
#remove /MEM////HS&lt;br /&gt;
#remove /MEM////HX&lt;br /&gt;
#remove /MEM////HY&lt;br /&gt;
#remove /MEM////H*B&lt;br /&gt;
#remove /MEM////H*A&lt;br /&gt;
#remove /MEM////H*C&lt;br /&gt;
&lt;br /&gt;
remove /MEM////C1&lt;br /&gt;
remove /MEM////C2&lt;br /&gt;
remove /MEM////C3&lt;br /&gt;
remove /MEM////C11&lt;br /&gt;
remove /MEM////C12&lt;br /&gt;
remove /MEM////C13&lt;br /&gt;
remove /MEM////C14&lt;br /&gt;
remove /MEM////C15&lt;br /&gt;
&lt;br /&gt;
create MEM_C, /MEM////*C* | /MEM////H*R | /MEM////H*S | /MEM////H*T | /MEM////H*X | /MEM////H*Y | /MEM////H*Z&lt;br /&gt;
&lt;br /&gt;
create shell, MEM_C within 20 of xtal-prot&lt;br /&gt;
&lt;br /&gt;
set retain_order, 1&lt;br /&gt;
&lt;br /&gt;
save shell.pdb, shell&lt;br /&gt;
&lt;br /&gt;
alter shell, resn=&#039;LPD&#039;&lt;br /&gt;
alter shell, name=&#039;C&#039;&lt;br /&gt;
alter shell, chain=&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
rebuild&lt;br /&gt;
&lt;br /&gt;
save shell-LPD.pdb, shell&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Preparation of grids with thinspheres ==&lt;br /&gt;
Prepare grids with thinspheres for the protein without lipid as described in https://wiki.docking.org/index.php/How_to_do_parameter_scanning&lt;br /&gt;
&lt;br /&gt;
Create an empty directory and put &amp;lt;code&amp;gt;shell-LPD.pdb&amp;lt;/code&amp;gt; there. Then run the following script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sh blast-membrane-thinsph-scan.sh {path to the collection of &amp;quot;es_ld_thin_sph_rad_X.X&amp;quot; directories} {path to the dir with original working and dockfiles directories}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script runs qnifft and solvmap for each &amp;lt;code&amp;gt;es_ld_thin_sph_rad_X.X&amp;lt;/code&amp;gt; directory, and then uses the second script of parameter scanning protocol to combine files into &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; directories.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important! LOOK AT YOUR GRIDS! Desolvation -- larger solvation where water is. Electrostatics -- no electrostatics in the lipid region. vdW -- no vdW in the lipid region.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# a script to prepare a protein with the lipid membrane for DOCK with thinsphere scan&lt;br /&gt;
# PREREQ -- run first step of https://wiki.docking.org/index.php/How_to_do_parameter_scanning (new_0001_generate_ES_LD_generation.py )&lt;br /&gt;
# first argument -- path to the directory where dirs &amp;quot;es_ld_thin_sph_rad_X.X&amp;quot; are stored. &lt;br /&gt;
# second argument -- path to the dir with original working and dockfiles&lt;br /&gt;
# run in a new directory with shell-LPD.pdb&lt;br /&gt;
&lt;br /&gt;
run_once () {&lt;br /&gt;
# mkdir  add_membrane&lt;br /&gt;
# Run qnifft for electrostatic grids&lt;br /&gt;
# cp $blastfiles_membrane/shell-LPD.pdb&lt;br /&gt;
# delete all fields except HETATM from shell-LPD.pdb&lt;br /&gt;
cp $curr_dir/shell-LPD.pdb .&lt;br /&gt;
sed -ir &#039;/^CRYST1/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^CONECT/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^END/d&#039; shell-LPD.pdb&lt;br /&gt;
cp $blastermaster_Prot/working/rec.crg.pdb .&lt;br /&gt;
#cp $blastermaster_Prot/working/lowdielectric.sph.pdb # (if wanted, if you run a  parameter scan, be sure to use the correct spheres!)&lt;br /&gt;
#cp -r $blastermaster_Prot/dockfiles .&lt;br /&gt;
#cp -r $blastermaster_Prot/INDOCK .&lt;br /&gt;
mv rec.crg.pdb  rec.crg.solo.pdb&lt;br /&gt;
cat rec.crg.solo.pdb shell-LPD.pdb  &amp;gt; receptor.crg.lowdielectric.pdb&lt;br /&gt;
# extracting SPH lines from receptor&lt;br /&gt;
number=$(grep -n  SPH  $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb | head -n 1 | awk -F &amp;quot;:&amp;quot; &#039;{print $1}&#039;)&lt;br /&gt;
tail --lines=+$number $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb &amp;gt;&amp;gt; receptor.crg.lowdielectric.pdb&lt;br /&gt;
need_files=&amp;quot;amb.crg.oxt&lt;br /&gt;
qnifft.parm&lt;br /&gt;
vdw.siz&amp;quot;&lt;br /&gt;
for file in $need_files&lt;br /&gt;
do&lt;br /&gt;
	if [ -e $blastermaster_Prot/working/$file ]&lt;br /&gt;
	then&lt;br /&gt;
		cp $blastermaster_Prot/working/$file .&lt;br /&gt;
	else&lt;br /&gt;
		cp $blast_orig/working/$file .&lt;br /&gt;
	fi&lt;br /&gt;
done&lt;br /&gt;
echo &amp;quot;C     lpd        0.000     LIPID SPHERE&amp;quot; &amp;gt;&amp;gt; amb.crg.oxt&lt;br /&gt;
cp $blastermaster_Prot/working/box .&lt;br /&gt;
cp $blastermaster_Prot/working/qnifft.parm .&lt;br /&gt;
cp $blastermaster_Prot/working/vdw.siz .&lt;br /&gt;
$DOCKBASE/proteins/qnifft/bin/qnifft22_193_pgf_32 qnifft.parm &amp;gt;&amp;amp; qnifft.log&lt;br /&gt;
$DOCKBASE/proteins/blastermaster/phiTrim.py qnifft.electrostatics.phi box trim.electrostatics.phi &amp;gt;&amp;amp; trim.log&lt;br /&gt;
&lt;br /&gt;
#cp trim.electrostatics.phi dockfiles/.&lt;br /&gt;
&lt;br /&gt;
# Check if the grid size changed:&lt;br /&gt;
#echo &amp;quot;Check if the grid size changed, compare this with INDOCK&amp;quot;&lt;br /&gt;
#python ~jklyu/zzz.script/pymol_movie/phi_to_dx.py trim.electrostatics.phi trim.electrostatics.phi.dx &amp;gt; gridsize&lt;br /&gt;
#head -n 1 gridsize&lt;br /&gt;
# compare with delphi_nsize in INDOCK&lt;br /&gt;
&lt;br /&gt;
# Run solvmap for Ligand Desolvation Grids if they are present in the folder&lt;br /&gt;
if [ -e $blastermaster_Prot/working/heavy ]&lt;br /&gt;
then&lt;br /&gt;
	mkdir heavy&lt;br /&gt;
	cd heavy || exit&lt;br /&gt;
	cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
	cp ../box .&lt;br /&gt;
	cp $blastermaster_Prot/working/heavy/INSEV .&lt;br /&gt;
	$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
	#cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
	cd ../ || exit&lt;br /&gt;
&lt;br /&gt;
	mkdir hydrogen&lt;br /&gt;
	cd hydrogen || exit&lt;br /&gt;
	cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
	cp ../box .&lt;br /&gt;
	cp $blastermaster_Prot/working/hydrogen/INSEV .&lt;br /&gt;
	$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
	#cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
fi&lt;br /&gt;
echo $dir &amp;quot; DONE!&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
curr_dir=$(pwd)&lt;br /&gt;
workdirs=$1&lt;br /&gt;
blast_orig=$2&lt;br /&gt;
dirs=$(ls -d $workdirs/es_ld_thin_sph_rad_*)&lt;br /&gt;
for dir in $dirs&lt;br /&gt;
do&lt;br /&gt;
	blastermaster_Prot=$dir&lt;br /&gt;
	local_dir=$(echo $dir | awk -F&amp;quot;\/&amp;quot; &#039;{print $NF}&#039;)&lt;br /&gt;
	mkdir -p $local_dir/working&lt;br /&gt;
	cd $local_dir/working || exit&lt;br /&gt;
	run_once&lt;br /&gt;
	cd $curr_dir || exit&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
python ~rstein/zzz.scripts/DOCK_prep_scripts/new_0002_combine_es_ld_grids_into_combos.py -p $blast_orig&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running blastermaster with default parameters ==&lt;br /&gt;
&#039;&#039;&#039;Warning! Do not use these grids, as the default grids with lipid spheres give incorrect solvation energies. Use the ones with thinspheres instead!&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# a script to prepare a protein with the lipid membrane for DOCK &lt;br /&gt;
# first argument -- path to blastermaster files of the protein without membrane&lt;br /&gt;
# run in a new directory with shell-LPD.pdb&lt;br /&gt;
blastermaster_Prot=$1&lt;br /&gt;
# mkdir  add_membrane&lt;br /&gt;
# Run qnifft for electrostatic grids&lt;br /&gt;
# cp $blastfiles_membrane/shell-LPD.pdb&lt;br /&gt;
# delete all fields except HETATM from shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^CRYST1/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^CONECT/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^END/d&#039; shell-LPD.pdb&lt;br /&gt;
cp $blastermaster_Prot/working/rec.crg.pdb .&lt;br /&gt;
#cp $blastermaster_Prot/working/lowdielectric.sph.pdb # (if wanted, if you run a  parameter scan, be sure to use the correct spheres!)&lt;br /&gt;
cp -r $blastermaster_Prot/dockfiles .&lt;br /&gt;
cp -r $blastermaster_Prot/INDOCK .&lt;br /&gt;
mv rec.crg.pdb  rec.crg.solo.pdb&lt;br /&gt;
cat rec.crg.solo.pdb shell-LPD.pdb  &amp;gt; receptor.crg.lowdielectric.pdb&lt;br /&gt;
# extracting SPH lines from receptor&lt;br /&gt;
number=$(grep -n  SPH  $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb | head -n 1 | awk -F &amp;quot;:&amp;quot; &#039;{print $1}&#039;)&lt;br /&gt;
tail --lines=+$number $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb &amp;gt;&amp;gt; rec.crg.lowdielectric.pdb&lt;br /&gt;
cp $blastermaster_Prot/working/amb.crg.oxt .&lt;br /&gt;
echo &amp;quot;C     lpd        0.000     LIPID SPHERE&amp;quot; &amp;gt;&amp;gt; amb.crg.oxt&lt;br /&gt;
cp $blastermaster_Prot/working/box .&lt;br /&gt;
cp $blastermaster_Prot/working/qnifft.parm .&lt;br /&gt;
cp $blastermaster_Prot/working/vdw.siz .&lt;br /&gt;
$DOCKBASE/proteins/qnifft/bin/qnifft22_193_pgf_32 qnifft.parm &amp;gt;&amp;amp; qnifft.log&lt;br /&gt;
$DOCKBASE/proteins/blastermaster/phiTrim.py qnifft.electrostatics.phi box trim.electrostatics.phi &amp;gt;&amp;amp; trim.log&lt;br /&gt;
&lt;br /&gt;
cp trim.electrostatics.phi dockfiles/.&lt;br /&gt;
&lt;br /&gt;
# Check if the grid size changed:&lt;br /&gt;
echo &amp;quot;Check if the grid size changed, compare this with INDOCK&amp;quot;&lt;br /&gt;
python ~jklyu/zzz.script/pymol_movie/phi_to_dx.py trim.electrostatics.phi trim.electrostatics.phi.dx &amp;gt; gridsize&lt;br /&gt;
head -n 1 gridsize&lt;br /&gt;
# compare with delphi_nsize in INDOCK&lt;br /&gt;
&lt;br /&gt;
# Run solvmap for Ligand Desolvation Grids&lt;br /&gt;
mkdir heavy&lt;br /&gt;
cd heavy || exit&lt;br /&gt;
cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
cp ../box .&lt;br /&gt;
cp $blastermaster_Prot/working/heavy/INSEV .&lt;br /&gt;
$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
cd ../ || exit&lt;br /&gt;
&lt;br /&gt;
mkdir hydrogen&lt;br /&gt;
cd hydroger || exit&lt;br /&gt;
cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
cp ../box .&lt;br /&gt;
cp $blastermaster_Prot/working/hydrogen/INSEV .&lt;br /&gt;
$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
echo &amp;quot;DONE!&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Lipid membrane models from MemProtMD ==&lt;br /&gt;
If a protein-membrane complex was already modeled for your system and deposited at [http://memprotmd.bioch.ox.ac.uk/home/ MemProtMD] website, you can use it and skip doing MD in Schrodinger. The steps are very similar to the ones after Schrodinger run.&lt;br /&gt;
&lt;br /&gt;
Download the &amp;lt;code&amp;gt;*_default_dppc.mpmd.finalframe.atomistic.pdb&amp;lt;/code&amp;gt; file from the bottom of the page. Rename it to &amp;lt;code&amp;gt;last-mol.pdb&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Use prepare.pml script (below). You need to provide the &amp;lt;code&amp;gt;rec.pdb&amp;lt;/code&amp;gt; to want to use for docking (potentially with missing loops) at that step as &amp;lt;code&amp;gt;xtal-prot.pdb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;pymol -qc last-mol.pdb xtal-prot.pdb prepare.pml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script below differs from the one for processing Schrodinger results in two points: solvent residue is &amp;lt;code&amp;gt;SOL&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;SPC&amp;lt;/code&amp;gt;, and lipids are called &amp;lt;code&amp;gt;DPPC&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;POPC&amp;lt;/code&amp;gt;.&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
align last-mol, xtal-prot&lt;br /&gt;
&lt;br /&gt;
remove ////SOL&lt;br /&gt;
&lt;br /&gt;
create MEM, ////DPPC&lt;br /&gt;
&lt;br /&gt;
remove /MEM////HS&lt;br /&gt;
remove /MEM////HX&lt;br /&gt;
remove /MEM////HY&lt;br /&gt;
remove /MEM////H*B&lt;br /&gt;
remove /MEM////H*A&lt;br /&gt;
remove /MEM////H*C&lt;br /&gt;
&lt;br /&gt;
remove /MEM////C1&lt;br /&gt;
remove /MEM////C2&lt;br /&gt;
remove /MEM////C3&lt;br /&gt;
remove /MEM////C11&lt;br /&gt;
remove /MEM////C12&lt;br /&gt;
remove /MEM////C13&lt;br /&gt;
remove /MEM////C14&lt;br /&gt;
remove /MEM////C15&lt;br /&gt;
&lt;br /&gt;
create MEM_C, /MEM////*C* | /MEM////H*R | /MEM////H*S | /MEM////H*T | /MEM////H*X | /MEM////H*Y | /MEM////H*Z&lt;br /&gt;
&lt;br /&gt;
create shell, MEM_C within 20 of xtal-prot&lt;br /&gt;
&lt;br /&gt;
set retain_order, 1&lt;br /&gt;
&lt;br /&gt;
save shell.pdb, shell&lt;br /&gt;
&lt;br /&gt;
alter shell, resn=&#039;LPD&#039;&lt;br /&gt;
alter shell, name=&#039;C&#039;&lt;br /&gt;
alter shell, chain=&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
rebuild&lt;br /&gt;
&lt;br /&gt;
save shell-LPD.pdb, shell&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Positioning of the membrane ==&lt;br /&gt;
If there is no precomputed membrane position from OPM or MemProtMD, you can model it using  PPM 3.0 webserver (https://opm.phar.umich.edu/ppm_server3) or standalone software. The software is installed in &amp;lt;code&amp;gt;/nfs/home/ak87/exa/PROGRAM/OPM-MEMBRANE&amp;lt;/code&amp;gt;. Copy &amp;lt;code&amp;gt;res.lib&amp;lt;/code&amp;gt; file from the program directory to the directory with your .pdb file. Create input file like this:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
0 PMm out rec.pdb&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;blockquote&amp;gt;0 or 1 -“do not use” or “use” heteroatoms in the input PDB file, respectively (solvent molecules are always excluded).&lt;br /&gt;
&lt;br /&gt;
MOM - type of membrane (see list of 3-letter codes for membranes below)&lt;br /&gt;
&lt;br /&gt;
“in” or “out” means topology of N-terminus of first subunit included in the corresponding input PDB file&lt;br /&gt;
&lt;br /&gt;
With this option, for every input pdb file, the program will selected automatically the flat or curved membrane boundaries, whichever had the lower calculated transfer energy.&amp;lt;/blockquote&amp;gt;Then run the program:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;~ak87/exa/PROGRAM/OPM-MEMBRANE/immers&amp;lt;1membrane.inp&amp;gt;rec-opm.out&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;datasub1&amp;lt;/code&amp;gt; file to extract residue numbers for the membrane placement in Maestro.&lt;br /&gt;
See ppm3_instructions.docx file in the program directory for more detail.&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Membrane_Modeling&amp;diff=14753</id>
		<title>Membrane Modeling</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Membrane_Modeling&amp;diff=14753"/>
		<updated>2022-09-04T21:19:22Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: added the manual for membrane positioning&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Written by Stefan Gahbauer, 2019/11/03&lt;br /&gt;
&lt;br /&gt;
In order to account for ligand desolvation and electrostatic interactions in the low-dielectric environment of the hydrophobic membrane core, a lipid-bilayer is generated around the target receptor and included in the docking score grid generation.&lt;br /&gt;
Aiming at a fast, robust and computationally effective equilibration of the lipid bilayer around the embedded transmembrane receptor, coarse-grained (CG) molecular dynamics (MD) simulations and (if needed) subsequent atomistic simulations are employed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Required software and datasets =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gromacs&#039;&#039;&#039; (v5 or newer) - Molecular Dynamics software package (http://manual.gromacs.org/)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CHARMM36m force field&#039;&#039;&#039; (http://mackerell.umaryland.edu/charmm_ff.shtml)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MARTINI&#039;&#039;&#039; Coarse-grained force field parameters(http://cgmartini.nl/)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DSSP&#039;&#039;&#039; - Secondary Structure assignment (https://swift.cmbi.umcn.nl/gv/dssp/ , https://anaconda.org/salilab/dssp)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;martinize.py&#039;&#039;&#039; - Coarse-graining atomistic protein structures (http://cgmartini.nl/index.php/tools2/proteins-and-bilayers)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;insane.py&#039;&#039;&#039; - INSerting proteins in coarse-grained MembrANE (http://cgmartini.nl/index.php/tools2/proteins-and-bilayers)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;initram.sh&#039;&#039;&#039; and &#039;&#039;&#039;backward.py&#039;&#039;&#039; - Conversion of coarse-grained system to atomistic resolution (http://cgmartini.nl/index.php/tools2/resolution-transformation)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 1) Setting up the coarse-grained system =&lt;br /&gt;
&lt;br /&gt;
This is automated in the script:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/0001-prepare-protein-CG-membrane.sh&lt;br /&gt;
&lt;br /&gt;
== 1.1) Prepare your files ==&lt;br /&gt;
&lt;br /&gt;
Copy the script above to your working directory.&lt;br /&gt;
&lt;br /&gt;
Copy your rec.pdb to your working directory.&lt;br /&gt;
&lt;br /&gt;
If your rec.pdb has gaps, e.g. unresolved loops between transmembrane helices in case of GPCRs, try to model missing residues.&lt;br /&gt;
&lt;br /&gt;
One way is to use MODELLER following https://salilab.org/modeller/wiki/Missing%20residues.&lt;br /&gt;
&lt;br /&gt;
Corresponding input scripts for modeller can be found in:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/modeller&lt;br /&gt;
&lt;br /&gt;
== 1.2) Run the script ==&lt;br /&gt;
&lt;br /&gt;
Login to gimel2.&lt;br /&gt;
&lt;br /&gt;
./0001-prepare-protein-CG-membrane.sh&lt;br /&gt;
&lt;br /&gt;
The script reads rec.pdb and copies all other required files from &lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/gromacs&lt;br /&gt;
&lt;br /&gt;
=== Workflow ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;a.&#039;&#039;&#039; Generate CHARMM36m force field parameters of your protein in a Gromacs-readable format. &lt;br /&gt;
&lt;br /&gt;
Used tool: gmx pdb2gmx &lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;pdb2gmx&#039;&#039; directory&lt;br /&gt;
&lt;br /&gt;
-conf.gro / conf.pdb - Gromacs coordinate file&lt;br /&gt;
&lt;br /&gt;
-topol.top / Protein-atomistic.itp - Gromacs topology file, i.e. force field description of your input structure&lt;br /&gt;
&lt;br /&gt;
-posre.itp - Position restraints for heavy atoms of atomistic protein strucutre.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;b.&#039;&#039;&#039; Build coarse-grained structure&lt;br /&gt;
&lt;br /&gt;
Used tool: martinize.py&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-chain_.ssd - Output from the DSSP program that is called by martinize.py&lt;br /&gt;
&lt;br /&gt;
-prot-cg.pdb - Coarse-grained protein structure&lt;br /&gt;
&lt;br /&gt;
-prot-cg.top - Coarse-grained Martini topology of system&lt;br /&gt;
&lt;br /&gt;
-Protein.itp - Coarse-grained Martini description of Protein structure&lt;br /&gt;
&lt;br /&gt;
-prot-rot.pdb - Coarse-grained protein structure aligned along z-axis of the simulation box according to the proteins first principal component axis. This ensures the correct placement of the protein during membrane preparation. &#039;&#039;&#039;You may have to adjust the orientation of your input structure prior to membrane modeling.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;c.&#039;&#039;&#039; Build coarse-grained membrane&lt;br /&gt;
&lt;br /&gt;
Used tool: insane.py&lt;br /&gt;
&lt;br /&gt;
Here, a lipid bilayer will be created around the protein structure (in the x/y-plane) and water will be added to the system. The default box shape is rectangular and the size is set to x,y=10nm, z=11nm. This can be changed in the ./insane.py command line. The default lipid type is POPC, you can change that to arbitrary lipid compositions using the -l and -u options of of insane.py.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-out.top / topol-cg.top - Topology of coarse-grained system&lt;br /&gt;
&lt;br /&gt;
-cg-membrane.gro/.pdb - Coarse-grained system coordinates. &#039;&#039;&#039;Carefully inspect and visualize the cg-membrane.pdb.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use PyMOL to check if you&#039;re protein is embedded correctly in the lipid bilayer.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 2) Simulating the coarse-grained system =&lt;br /&gt;
&lt;br /&gt;
This is automated in the script:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/0002-run-CG-Minimization-and-MD.sh&lt;br /&gt;
&lt;br /&gt;
== 2.1) Run the script ==&lt;br /&gt;
&lt;br /&gt;
Copy the script above to your working directory.&lt;br /&gt;
&lt;br /&gt;
./0002-run-CG-Minimization-and-MD.sh&lt;br /&gt;
&lt;br /&gt;
=== Workflow ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;a.&#039;&#039;&#039; Minimize coarse-grained system&lt;br /&gt;
&lt;br /&gt;
Used tools: gmx grompp , gmx mdrun&lt;br /&gt;
&lt;br /&gt;
gmx grompp generates a single .tpr file that contains all information necessary for running a MD simulation or minimization using gmx mdrun.&lt;br /&gt;
&lt;br /&gt;
Minimization parameters are provided in martini_new-rf_min.mdp. The system will be minimized in 500 steps using steepest descent. The protein structure will be frozen during minimization.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-min.tpr - MD run input file&lt;br /&gt;
&lt;br /&gt;
-min.log - Output log file from minimization&lt;br /&gt;
&lt;br /&gt;
-min.trr - Minimization trajectory&lt;br /&gt;
&lt;br /&gt;
-min.gro - Minimized system coordinates&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;b.&#039;&#039;&#039; Simulate coarse-grained system&lt;br /&gt;
&lt;br /&gt;
MD simulation parameters are provided in martini_v2.x_new-rf.mdp. Strong position restraints are applied on the protein structure during the simulation. The system will be simulated for 50ns.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-md.tpr - MD run input file&lt;br /&gt;
&lt;br /&gt;
-md.log - Output log file from simulation&lt;br /&gt;
&lt;br /&gt;
-md.trr - lossless trajectory of simulation&lt;br /&gt;
&lt;br /&gt;
-md.xtc - coordinates of simulation trajectory&lt;br /&gt;
&lt;br /&gt;
-md.gro - coordinates of final simulation snapshot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The simulation will run for roughly 3 hours.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 3) Converting coarse-grained system to atomistic resolution and select lipid atoms for grid generation =&lt;br /&gt;
&lt;br /&gt;
This is automated in the script:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/0003-backmap-and-lpd-selection.sh&lt;br /&gt;
&lt;br /&gt;
== 3.1) Run the script ==&lt;br /&gt;
&lt;br /&gt;
Copy the script above to your working directory.&lt;br /&gt;
&lt;br /&gt;
./0003-backmap-and-lpd-selection.sh&lt;br /&gt;
&lt;br /&gt;
=== Workflow ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;a.&#039;&#039;&#039; Backmapping from coarse-grained to atomistic&lt;br /&gt;
&lt;br /&gt;
Used tool: gmx trjconv, initram.sh&lt;br /&gt;
&lt;br /&gt;
gmx trjconv can perform a variety of conversions of MD trajectory, e.g. making molecules broken over the periodic boundary conditions whole again. &lt;br /&gt;
&lt;br /&gt;
initram.sh calls the backward.py program which performs the backmapping of input coarse-grained to atomistic systems, and performs a small series of short minimizations and simulations to relax the backmapped system.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;backmap&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-0-backmapped.gro / projected.gro - initial backmapped coordinates&lt;br /&gt;
&lt;br /&gt;
-backmapped.top - Topology of atomistic system&lt;br /&gt;
&lt;br /&gt;
-1-EM*/2-EM* - Output from minimizations &lt;br /&gt;
&lt;br /&gt;
-3-mdpr*/4-mdpr*/5-mdpr*/6-mdpr* - Output from simulations&lt;br /&gt;
&lt;br /&gt;
-backmapped.gro - Coordinates of final backmapped and relaxed system&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This may need a few attempts to work all the way through. There is a while-loop that only stops until all relaxation steps have finished.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;b.&#039;&#039;&#039; Replacing backmapped protein with initial atomistic protein structure&lt;br /&gt;
&lt;br /&gt;
Used tool: PyMOL script align.pml&lt;br /&gt;
&lt;br /&gt;
The pymol script will align the initial &amp;quot;Gromacs&amp;quot;-protein structure (conf.pdb) onto the backmapped structure and combine the fitted protein coordinates with the coordinates of the lipid and solvent environment.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;backmap/prepare_AA_system&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-conf-fitted.pdb - Fitted initial protein structure&lt;br /&gt;
&lt;br /&gt;
-backmapped-environment.pdb - All membrane and water coordinates&lt;br /&gt;
&lt;br /&gt;
-fitted_system.pdb - Complete system containing fitted protein and environment coordinates&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure that fitted_system.pdb has the same number of coordinates as backmapped-mol.pdb.&#039;&#039;&#039; If there is a discrepancy there might be an issue with the PyMOL version you&#039;re using to run align.pml. Using PyMOL v2 or newer seems to avoid any issues. You can also generate backmapped-environment.pdb manually by taking all POPC and Water cooridnates from backmapped-mol.pdb.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;c.&#039;&#039;&#039; Run minimizations of atomistic system&lt;br /&gt;
&lt;br /&gt;
Used tools: gmx grompp, gmx mdrun&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;backmap/prepare_AA_system&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
Tow minimizations will be calculated. &lt;br /&gt;
&lt;br /&gt;
1) Minimization with frozen protein coordinates: 1,500 steps steepest descent (min_freeze.mdp).&lt;br /&gt;
&lt;br /&gt;
-min_freeze* - Output files of first minimization&lt;br /&gt;
&lt;br /&gt;
2) Minimization of full system: 500 steps (min.mdp).&lt;br /&gt;
&lt;br /&gt;
-min* - Output files of second minimization&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;d.&#039;&#039;&#039; Select lipid atoms for DOCK grid generation&lt;br /&gt;
&lt;br /&gt;
Used tools: PyMOL script prepare.pml&lt;br /&gt;
&lt;br /&gt;
This will select carbon and hydrogen atoms of the hydrophobic lipid tail segments in a radius of 1.7 nm around the protein and assign them to the atom type &amp;quot;LPD&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You need to provide the rec.pdb to want to use for docking (potentially with missing loops) at that step as xtal-prot.pdb&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;backmap/prepare_AA_system/prepare_min&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-shell-LPD.pdb - all LPD atoms selected for grid generation&lt;br /&gt;
&lt;br /&gt;
Add these coordinates to your docking protein structure and provide a amb.crg.oxt file adding&lt;br /&gt;
&lt;br /&gt;
C     lpd        0.000     LIPID SPHERE&lt;br /&gt;
&lt;br /&gt;
Now you can run blastermaster.&lt;br /&gt;
&lt;br /&gt;
= Membrane modelling in Schrodinger =&lt;br /&gt;
Written by Andrii Kyrylchuk, 2022/04/20&lt;br /&gt;
&lt;br /&gt;
== MD of protein and membrane ==&lt;br /&gt;
Import structure &#039;&#039;&#039;without&#039;&#039;&#039; ligand, use &amp;lt;u&amp;gt;Preparation wizard&amp;lt;/u&amp;gt; as described in &amp;quot;Code for Controls...&amp;quot;  to model missing loops and capping.&lt;br /&gt;
&lt;br /&gt;
Then open &amp;lt;u&amp;gt;System Builder&amp;lt;/u&amp;gt;, click &amp;lt;code&amp;gt;Setup membrane&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to the website https://opm.phar.umich.edu/proteins/ and find your protein. Copy residue numbers from the bottom of the page to the field &amp;lt;code&amp;gt;Transmembrane atoms...&amp;lt;/code&amp;gt;. The format is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;res.num 76-97,112-136,141,...&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click &amp;lt;code&amp;gt;Place Automatically&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt;. Then click &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt;. Examine lipids and solvent after run completes.&lt;br /&gt;
&lt;br /&gt;
Then use &amp;lt;u&amp;gt;Molecular Dynamics&amp;lt;/u&amp;gt; menu to set up the calculation. Select prepared system, click &amp;lt;code&amp;gt;Load&amp;lt;/code&amp;gt; on top of the menu. Put simulation time of 5 ns, &amp;lt;code&amp;gt;Advanced Options&amp;lt;/code&amp;gt; -- &amp;lt;code&amp;gt;Restraints&amp;lt;/code&amp;gt; -- &amp;lt;code&amp;gt;Add.&amp;lt;/code&amp;gt; Select protein, and put &amp;lt;code&amp;gt;Force Constant&amp;lt;/code&amp;gt; of 100, click &amp;lt;code&amp;gt;Apply&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;OK.&amp;lt;/code&amp;gt; Then click down arrow left of the &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt; button in the parent window and click &amp;lt;code&amp;gt;Write&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;NOTE&#039;&#039;&#039;: In my experience, restrained MD runs with NgPT in Schrodinger often fail with the following message:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&#039;&#039;Allowed momentum exceeded on 17 particles.&#039;&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This seems to be related to the interference of restraints and the ensemble, as no such error is observed if no restraints are imposed, or if NVT ensemble is used. Still, NgPT ensemble is important for correct membrane sampling, because simulations at NVT long enough to permit membrane relaxation, lead to the smearing of the lipid bilayer and the formation of empty space.&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;If the mentioned problem occurs, import the last coordinates of the run (*-out.cms) into Maestro, open Minimization menu, load the structure from the workspace, and apply restraints on lipid and protein (force restraint of 10 is usually enough). Then run a minimization for 100 ps, and try to run NgPT MD starting from the optimized structure.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;TO CHECK&#039;&#039;&#039;: NPT ensemble.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Copy the project folder (desmond_md_job_X) to gimel, login to &amp;lt;u&amp;gt;gimel5&amp;lt;/u&amp;gt;, edit desmond_md_job_X.sh: delete &amp;lt;code&amp;gt;-lic DESMOND_GPGPU:16&amp;lt;/code&amp;gt; and insert &amp;lt;code&amp;gt;-HOST gimel5.gpu&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;gimel5.heavygpu&amp;lt;/code&amp;gt;). Run .sh file, and your task will be submitted to a queue. For my system it took 1.5 hr to complete.&lt;br /&gt;
&lt;br /&gt;
Download the project folder to your PC, open Maestro, click &amp;lt;code&amp;gt;Import  structure&amp;lt;/code&amp;gt; and open &amp;lt;code&amp;gt;-out.cms&amp;lt;/code&amp;gt;, click on &amp;lt;code&amp;gt;T&amp;lt;/code&amp;gt; icon at the new entry in project table and click &amp;lt;code&amp;gt;Display Trajectory Snapshots&amp;lt;/code&amp;gt;. Select the last one, click &amp;lt;code&amp;gt;Display&amp;lt;/code&amp;gt; and check if the protein did not change position during MD run, then click &amp;lt;code&amp;gt;Export&amp;lt;/code&amp;gt;, to Project Table, Frames Selected only. You will get a new entry in the Project Table. Export it to a &amp;lt;code&amp;gt;.pdb&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
== Preparation of the structure for Blastermaster ==&lt;br /&gt;
Use &amp;lt;code&amp;gt;prepare.pml&amp;lt;/code&amp;gt; script. You need to provide the &amp;lt;code&amp;gt;rec.pdb&amp;lt;/code&amp;gt; to want to use for docking (potentially with missing loops) at that step as &amp;lt;code&amp;gt;xtal-prot.pdb&amp;lt;/code&amp;gt;. Rename MD system as &amp;lt;code&amp;gt;last-mol.pdb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;pymol -qc last-mol.pdb xtal-prot.pdb prepare.pml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
align last-mol, xtal-prot&lt;br /&gt;
&lt;br /&gt;
remove ////SPC&lt;br /&gt;
&lt;br /&gt;
create MEM, ////POPC&lt;br /&gt;
&lt;br /&gt;
# these atom numbers do not exist in POPC or DPPC&lt;br /&gt;
# therefore, we do not remove protons from the lipid&lt;br /&gt;
# structure to make more spheres. Uncomment these&lt;br /&gt;
# lines and change to proper H numbers if needed.&lt;br /&gt;
#remove /MEM////HS&lt;br /&gt;
#remove /MEM////HX&lt;br /&gt;
#remove /MEM////HY&lt;br /&gt;
#remove /MEM////H*B&lt;br /&gt;
#remove /MEM////H*A&lt;br /&gt;
#remove /MEM////H*C&lt;br /&gt;
&lt;br /&gt;
remove /MEM////C1&lt;br /&gt;
remove /MEM////C2&lt;br /&gt;
remove /MEM////C3&lt;br /&gt;
remove /MEM////C11&lt;br /&gt;
remove /MEM////C12&lt;br /&gt;
remove /MEM////C13&lt;br /&gt;
remove /MEM////C14&lt;br /&gt;
remove /MEM////C15&lt;br /&gt;
&lt;br /&gt;
create MEM_C, /MEM////*C* | /MEM////H*R | /MEM////H*S | /MEM////H*T | /MEM////H*X | /MEM////H*Y | /MEM////H*Z&lt;br /&gt;
&lt;br /&gt;
create shell, MEM_C within 20 of xtal-prot&lt;br /&gt;
&lt;br /&gt;
set retain_order, 1&lt;br /&gt;
&lt;br /&gt;
save shell.pdb, shell&lt;br /&gt;
&lt;br /&gt;
alter shell, resn=&#039;LPD&#039;&lt;br /&gt;
alter shell, name=&#039;C&#039;&lt;br /&gt;
alter shell, chain=&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
rebuild&lt;br /&gt;
&lt;br /&gt;
save shell-LPD.pdb, shell&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Preparation of grids with thinspheres ==&lt;br /&gt;
Prepare grids with thinspheres for the protein without lipid as described in https://wiki.docking.org/index.php/How_to_do_parameter_scanning&lt;br /&gt;
&lt;br /&gt;
Create an empty directory and put &amp;lt;code&amp;gt;shell-LPD.pdb&amp;lt;/code&amp;gt; there. Then run the following script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sh blast-membrane-thinsph-scan.sh {path to the collection of &amp;quot;es_ld_thin_sph_rad_X.X&amp;quot; directories} {path to the dir with original working and dockfiles directories}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script runs qnifft and solvmap for each &amp;lt;code&amp;gt;es_ld_thin_sph_rad_X.X&amp;lt;/code&amp;gt; directory, and then uses the second script of parameter scanning protocol to combine files into &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; directories.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important! LOOK AT YOUR GRIDS! Desolvation -- larger solvation where water is. Electrostatics -- no electrostatics in the lipid region. vdW -- no vdW in the lipid region.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# a script to prepare a protein with the lipid membrane for DOCK with thinsphere scan&lt;br /&gt;
# PREREQ -- run first step of https://wiki.docking.org/index.php/How_to_do_parameter_scanning (new_0001_generate_ES_LD_generation.py )&lt;br /&gt;
# first argument -- path to the directory where dirs &amp;quot;es_ld_thin_sph_rad_X.X&amp;quot; are stored. &lt;br /&gt;
# second argument -- path to the dir with original working and dockfiles&lt;br /&gt;
# run in a new directory with shell-LPD.pdb&lt;br /&gt;
&lt;br /&gt;
run_once () {&lt;br /&gt;
# mkdir  add_membrane&lt;br /&gt;
# Run qnifft for electrostatic grids&lt;br /&gt;
# cp $blastfiles_membrane/shell-LPD.pdb&lt;br /&gt;
# delete all fields except HETATM from shell-LPD.pdb&lt;br /&gt;
cp $curr_dir/shell-LPD.pdb .&lt;br /&gt;
sed -ir &#039;/^CRYST1/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^CONECT/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^END/d&#039; shell-LPD.pdb&lt;br /&gt;
cp $blastermaster_Prot/working/rec.crg.pdb .&lt;br /&gt;
#cp $blastermaster_Prot/working/lowdielectric.sph.pdb # (if wanted, if you run a  parameter scan, be sure to use the correct spheres!)&lt;br /&gt;
#cp -r $blastermaster_Prot/dockfiles .&lt;br /&gt;
#cp -r $blastermaster_Prot/INDOCK .&lt;br /&gt;
mv rec.crg.pdb  rec.crg.solo.pdb&lt;br /&gt;
cat rec.crg.solo.pdb shell-LPD.pdb  &amp;gt; receptor.crg.lowdielectric.pdb&lt;br /&gt;
# extracting SPH lines from receptor&lt;br /&gt;
number=$(grep -n  SPH  $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb | head -n 1 | awk -F &amp;quot;:&amp;quot; &#039;{print $1}&#039;)&lt;br /&gt;
tail --lines=+$number $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb &amp;gt;&amp;gt; receptor.crg.lowdielectric.pdb&lt;br /&gt;
need_files=&amp;quot;amb.crg.oxt&lt;br /&gt;
qnifft.parm&lt;br /&gt;
vdw.siz&amp;quot;&lt;br /&gt;
for file in $need_files&lt;br /&gt;
do&lt;br /&gt;
	if [ -e $blastermaster_Prot/working/$file ]&lt;br /&gt;
	then&lt;br /&gt;
		cp $blastermaster_Prot/working/$file .&lt;br /&gt;
	else&lt;br /&gt;
		cp $blast_orig/working/$file .&lt;br /&gt;
	fi&lt;br /&gt;
done&lt;br /&gt;
echo &amp;quot;C     lpd        0.000     LIPID SPHERE&amp;quot; &amp;gt;&amp;gt; amb.crg.oxt&lt;br /&gt;
cp $blastermaster_Prot/working/box .&lt;br /&gt;
cp $blastermaster_Prot/working/qnifft.parm .&lt;br /&gt;
cp $blastermaster_Prot/working/vdw.siz .&lt;br /&gt;
$DOCKBASE/proteins/qnifft/bin/qnifft22_193_pgf_32 qnifft.parm &amp;gt;&amp;amp; qnifft.log&lt;br /&gt;
$DOCKBASE/proteins/blastermaster/phiTrim.py qnifft.electrostatics.phi box trim.electrostatics.phi &amp;gt;&amp;amp; trim.log&lt;br /&gt;
&lt;br /&gt;
#cp trim.electrostatics.phi dockfiles/.&lt;br /&gt;
&lt;br /&gt;
# Check if the grid size changed:&lt;br /&gt;
#echo &amp;quot;Check if the grid size changed, compare this with INDOCK&amp;quot;&lt;br /&gt;
#python ~jklyu/zzz.script/pymol_movie/phi_to_dx.py trim.electrostatics.phi trim.electrostatics.phi.dx &amp;gt; gridsize&lt;br /&gt;
#head -n 1 gridsize&lt;br /&gt;
# compare with delphi_nsize in INDOCK&lt;br /&gt;
&lt;br /&gt;
# Run solvmap for Ligand Desolvation Grids if they are present in the folder&lt;br /&gt;
if [ -e $blastermaster_Prot/working/heavy ]&lt;br /&gt;
then&lt;br /&gt;
	mkdir heavy&lt;br /&gt;
	cd heavy || exit&lt;br /&gt;
	cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
	cp ../box .&lt;br /&gt;
	cp $blastermaster_Prot/working/heavy/INSEV .&lt;br /&gt;
	$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
	#cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
	cd ../ || exit&lt;br /&gt;
&lt;br /&gt;
	mkdir hydrogen&lt;br /&gt;
	cd hydrogen || exit&lt;br /&gt;
	cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
	cp ../box .&lt;br /&gt;
	cp $blastermaster_Prot/working/hydrogen/INSEV .&lt;br /&gt;
	$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
	#cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
fi&lt;br /&gt;
echo $dir &amp;quot; DONE!&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
curr_dir=$(pwd)&lt;br /&gt;
workdirs=$1&lt;br /&gt;
blast_orig=$2&lt;br /&gt;
dirs=$(ls -d $workdirs/es_ld_thin_sph_rad_*)&lt;br /&gt;
for dir in $dirs&lt;br /&gt;
do&lt;br /&gt;
	blastermaster_Prot=$dir&lt;br /&gt;
	local_dir=$(echo $dir | awk -F&amp;quot;\/&amp;quot; &#039;{print $NF}&#039;)&lt;br /&gt;
	mkdir -p $local_dir/working&lt;br /&gt;
	cd $local_dir/working || exit&lt;br /&gt;
	run_once&lt;br /&gt;
	cd $curr_dir || exit&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
python ~rstein/zzz.scripts/DOCK_prep_scripts/new_0002_combine_es_ld_grids_into_combos.py -p $blast_orig&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running blastermaster with default parameters ==&lt;br /&gt;
&#039;&#039;&#039;Warning! Do not use these grids, as the default grids with lipid spheres give incorrect solvation energies. Use the ones with thinspheres instead!&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# a script to prepare a protein with the lipid membrane for DOCK &lt;br /&gt;
# first argument -- path to blastermaster files of the protein without membrane&lt;br /&gt;
# run in a new directory with shell-LPD.pdb&lt;br /&gt;
blastermaster_Prot=$1&lt;br /&gt;
# mkdir  add_membrane&lt;br /&gt;
# Run qnifft for electrostatic grids&lt;br /&gt;
# cp $blastfiles_membrane/shell-LPD.pdb&lt;br /&gt;
# delete all fields except HETATM from shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^CRYST1/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^CONECT/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^END/d&#039; shell-LPD.pdb&lt;br /&gt;
cp $blastermaster_Prot/working/rec.crg.pdb .&lt;br /&gt;
#cp $blastermaster_Prot/working/lowdielectric.sph.pdb # (if wanted, if you run a  parameter scan, be sure to use the correct spheres!)&lt;br /&gt;
cp -r $blastermaster_Prot/dockfiles .&lt;br /&gt;
cp -r $blastermaster_Prot/INDOCK .&lt;br /&gt;
mv rec.crg.pdb  rec.crg.solo.pdb&lt;br /&gt;
cat rec.crg.solo.pdb shell-LPD.pdb  &amp;gt; receptor.crg.lowdielectric.pdb&lt;br /&gt;
# extracting SPH lines from receptor&lt;br /&gt;
number=$(grep -n  SPH  $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb | head -n 1 | awk -F &amp;quot;:&amp;quot; &#039;{print $1}&#039;)&lt;br /&gt;
tail --lines=+$number $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb &amp;gt;&amp;gt; rec.crg.lowdielectric.pdb&lt;br /&gt;
cp $blastermaster_Prot/working/amb.crg.oxt .&lt;br /&gt;
echo &amp;quot;C     lpd        0.000     LIPID SPHERE&amp;quot; &amp;gt;&amp;gt; amb.crg.oxt&lt;br /&gt;
cp $blastermaster_Prot/working/box .&lt;br /&gt;
cp $blastermaster_Prot/working/qnifft.parm .&lt;br /&gt;
cp $blastermaster_Prot/working/vdw.siz .&lt;br /&gt;
$DOCKBASE/proteins/qnifft/bin/qnifft22_193_pgf_32 qnifft.parm &amp;gt;&amp;amp; qnifft.log&lt;br /&gt;
$DOCKBASE/proteins/blastermaster/phiTrim.py qnifft.electrostatics.phi box trim.electrostatics.phi &amp;gt;&amp;amp; trim.log&lt;br /&gt;
&lt;br /&gt;
cp trim.electrostatics.phi dockfiles/.&lt;br /&gt;
&lt;br /&gt;
# Check if the grid size changed:&lt;br /&gt;
echo &amp;quot;Check if the grid size changed, compare this with INDOCK&amp;quot;&lt;br /&gt;
python ~jklyu/zzz.script/pymol_movie/phi_to_dx.py trim.electrostatics.phi trim.electrostatics.phi.dx &amp;gt; gridsize&lt;br /&gt;
head -n 1 gridsize&lt;br /&gt;
# compare with delphi_nsize in INDOCK&lt;br /&gt;
&lt;br /&gt;
# Run solvmap for Ligand Desolvation Grids&lt;br /&gt;
mkdir heavy&lt;br /&gt;
cd heavy || exit&lt;br /&gt;
cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
cp ../box .&lt;br /&gt;
cp $blastermaster_Prot/working/heavy/INSEV .&lt;br /&gt;
$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
cd ../ || exit&lt;br /&gt;
&lt;br /&gt;
mkdir hydrogen&lt;br /&gt;
cd hydroger || exit&lt;br /&gt;
cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
cp ../box .&lt;br /&gt;
cp $blastermaster_Prot/working/hydrogen/INSEV .&lt;br /&gt;
$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
echo &amp;quot;DONE!&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Lipid membrane models from MemProtMD ==&lt;br /&gt;
If a protein-membrane complex was already modeled for your system and deposited at [http://memprotmd.bioch.ox.ac.uk/home/ MemProtMD] website, you can use it and skip doing MD in Schrodinger. The steps are very similar to the ones after Schrodinger run.&lt;br /&gt;
&lt;br /&gt;
Download the &amp;lt;code&amp;gt;*_default_dppc.mpmd.finalframe.atomistic.pdb&amp;lt;/code&amp;gt; file from the bottom of the page. Rename it to &amp;lt;code&amp;gt;last-mol.pdb&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Use prepare.pml script (below). You need to provide the &amp;lt;code&amp;gt;rec.pdb&amp;lt;/code&amp;gt; to want to use for docking (potentially with missing loops) at that step as &amp;lt;code&amp;gt;xtal-prot.pdb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;pymol -qc last-mol.pdb xtal-prot.pdb prepare.pml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script below differs from the one for processing Schrodinger results in two points: solvent residue is &amp;lt;code&amp;gt;SOL&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;SPC&amp;lt;/code&amp;gt;, and lipids are called &amp;lt;code&amp;gt;DPPC&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;POPC&amp;lt;/code&amp;gt;.&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
align last-mol, xtal-prot&lt;br /&gt;
&lt;br /&gt;
remove ////SOL&lt;br /&gt;
&lt;br /&gt;
create MEM, ////DPPC&lt;br /&gt;
&lt;br /&gt;
remove /MEM////HS&lt;br /&gt;
remove /MEM////HX&lt;br /&gt;
remove /MEM////HY&lt;br /&gt;
remove /MEM////H*B&lt;br /&gt;
remove /MEM////H*A&lt;br /&gt;
remove /MEM////H*C&lt;br /&gt;
&lt;br /&gt;
remove /MEM////C1&lt;br /&gt;
remove /MEM////C2&lt;br /&gt;
remove /MEM////C3&lt;br /&gt;
remove /MEM////C11&lt;br /&gt;
remove /MEM////C12&lt;br /&gt;
remove /MEM////C13&lt;br /&gt;
remove /MEM////C14&lt;br /&gt;
remove /MEM////C15&lt;br /&gt;
&lt;br /&gt;
create MEM_C, /MEM////*C* | /MEM////H*R | /MEM////H*S | /MEM////H*T | /MEM////H*X | /MEM////H*Y | /MEM////H*Z&lt;br /&gt;
&lt;br /&gt;
create shell, MEM_C within 20 of xtal-prot&lt;br /&gt;
&lt;br /&gt;
set retain_order, 1&lt;br /&gt;
&lt;br /&gt;
save shell.pdb, shell&lt;br /&gt;
&lt;br /&gt;
alter shell, resn=&#039;LPD&#039;&lt;br /&gt;
alter shell, name=&#039;C&#039;&lt;br /&gt;
alter shell, chain=&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
rebuild&lt;br /&gt;
&lt;br /&gt;
save shell-LPD.pdb, shell&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Positioning of the membrane ==&lt;br /&gt;
If there is no precomputed membrane position from OPM or MemProtMD, you can model it using  PPM 3.0 webserver (https://opm.phar.umich.edu/ppm_server3) or standalone software. The software is installed in &amp;lt;code&amp;gt;/nfs/home/ak87/exa/PROGRAM/OPM-MEMBRANE&amp;lt;/code&amp;gt;. Copy &amp;lt;code&amp;gt;res.lib&amp;lt;/code&amp;gt; file from the program directory to the directory with your .pdb file. Create input file like this:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
0 PMm out rec.pdb&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;blockquote&amp;gt;0 or 1 -“do not use” or “use” heteroatoms in the input PDB file, respectively (solvent molecules are always excluded).&lt;br /&gt;
&lt;br /&gt;
MOM - type of membrane (see list of 3-letter codes for membranes below)&lt;br /&gt;
&lt;br /&gt;
“in” or “out” means topology of N-terminus of first subunit included in the corresponding input PDB file&lt;br /&gt;
&lt;br /&gt;
With this option, for every input pdb file, the program will selected automatically the flat or curved membrane boundaries, whichever had the lower calculated transfer energy.&amp;lt;/blockquote&amp;gt;Then run the program:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;~ak87/exa/PROGRAM/OPM-MEMBRANE/immers&amp;lt;1membrane.inp&amp;gt;rec-opm.out&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;datasub1&amp;lt;/code&amp;gt; file to extract residue numbers for the membrane placement in Maestro&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Synthesia&amp;diff=14651</id>
		<title>Synthesia</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Synthesia&amp;diff=14651"/>
		<updated>2022-08-11T18:57:24Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: added retrosynthesis route generation by IBM RXN&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;blockquote&amp;gt;Synthesia is a command-line tool that uses an entire retrosynthetic route as a guide pathway to generate optimized structural analogues of a lead compound without compromising the synthesizability of the structure. The users has the ability to guide the structural modifications in a desired direction by specifying structural constraints.&amp;lt;/blockquote&amp;gt;Original publication: https://pubs.acs.org/doi/10.1021/acs.jcim.2c00246&lt;br /&gt;
&lt;br /&gt;
Website: https://software.zbh.uni-hamburg.de/customers/tools &lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
To obtain the license, you need to register and get your account approved. Then login to the website, click on Synthesia and &amp;quot;Download the license file&amp;quot;. Your license key is inside the file, it looks like &amp;lt;code&amp;gt;AAAAAAAliFQAAAAU2eM8ZjTTELGD3LzxBgt3/1DGaW4=&amp;lt;/code&amp;gt;. Copy the license key from the file, download and unpack the program and run the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;./synthesia --license &amp;lt;your_license_here&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
My installation is in &amp;lt;code&amp;gt;/mnt/nfs/exa/work/ak87/UCSF/SynthI/SYNTHESIA/synthesia_1.0.0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running ==&lt;br /&gt;
To run the program, you need:&lt;br /&gt;
&lt;br /&gt;
# a retrosynthetic tree and &lt;br /&gt;
# a library of building blocks (&amp;quot;&amp;lt;code&amp;gt;SMILES Name&amp;lt;/code&amp;gt;&amp;quot;, no preprocessing needed).&lt;br /&gt;
&lt;br /&gt;
The tool returns analogs of a target molecule synthesizable by the given route from given BBs. The analogs may be filtered by 29 different parameters (see SI or README.md file):&lt;br /&gt;
&lt;br /&gt;
# Extended-Connectivity Fingerprints (ECFP)&lt;br /&gt;
# Functional-Class Fingerprints (FCFP)&lt;br /&gt;
# Connected Subgraph Fingerprints (CSFP)&lt;br /&gt;
# Largest Ring&lt;br /&gt;
# Largest Ringsystem&lt;br /&gt;
# Molecular Weight&lt;br /&gt;
# Number of Hydrogen-Bond Acceptors&lt;br /&gt;
# Number of Anions&lt;br /&gt;
# Number of Aromatic Atoms&lt;br /&gt;
# Number of Aromatic Rings&lt;br /&gt;
# Number of Aromatic Ringsystems&lt;br /&gt;
# Number of Cations&lt;br /&gt;
# Number of Hydrogen-Bond Donors&lt;br /&gt;
# Number of Halogens&lt;br /&gt;
# Number of Non-Hydrogen Atoms&lt;br /&gt;
# Number of Hetero Atoms&lt;br /&gt;
# Number of Hydrophobic Points&lt;br /&gt;
# Number of Inorganic Atoms&lt;br /&gt;
# Number of Lipinski Donors&lt;br /&gt;
# Number of Nitrogens and Oxygens&lt;br /&gt;
# Number of Non-Hydrogen Bonds&lt;br /&gt;
# Number of Rings&lt;br /&gt;
# Number of Ringsystems&lt;br /&gt;
# Number of Rotatable Bonds&lt;br /&gt;
# LogP-Value&lt;br /&gt;
# Total Charge&lt;br /&gt;
# Topological Polar Surface Area (TPSA)&lt;br /&gt;
# Volume&lt;br /&gt;
# Matching SMARTSS3 pattern. Either inclusion or exclusion&lt;br /&gt;
&lt;br /&gt;
=== Retrosynthetic tree ===&lt;br /&gt;
This is a .json file that describes all steps needed to synthesize the molecule in question and starting reagents. The steps are encoded in SMARTS. Each reaction node should contain reaction SMARTS + SMILES of the product. The tree for [https://zinc15.docking.org/substances/ZINC000000000347/ granisetron] synthesis via amidation is shown below.&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;smiles&amp;quot;: &amp;quot;CN1C2CCCC1CC(C2)NC(=O)c1nn(C)c2ccccc12&amp;quot;,&lt;br /&gt;
  &amp;quot;is_chemical&amp;quot;: true,&lt;br /&gt;
  &amp;quot;children&amp;quot;:&lt;br /&gt;
  [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;smiles&amp;quot;: &amp;quot;CN1C2CCCC1CC(C2)NC(=O)c1nn(C)c2ccccc12&amp;quot;,&lt;br /&gt;
      &amp;quot;is_reaction&amp;quot;: true,&lt;br /&gt;
      &amp;quot;smartsPattern&amp;quot;: &amp;quot;[#7:1].[#8]-[#6:2](=O)&amp;gt;&amp;gt;[#7:1]-[#6:2](=O)&amp;quot;,&lt;br /&gt;
      &amp;quot;children&amp;quot;:&lt;br /&gt;
      [&lt;br /&gt;
        {&lt;br /&gt;
          &amp;quot;smiles&amp;quot;: &amp;quot;Cn1nc(C(O)=O)c2ccccc12&amp;quot;,&lt;br /&gt;
          &amp;quot;is_chemical&amp;quot;: true,&lt;br /&gt;
          &amp;quot;children&amp;quot;: []&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
          &amp;quot;smiles&amp;quot;: &amp;quot;CN1C2CCCC1CC(N)C2&amp;quot;,&lt;br /&gt;
          &amp;quot;is_chemical&amp;quot;: true,&lt;br /&gt;
          &amp;quot;children&amp;quot;: []&lt;br /&gt;
        }&lt;br /&gt;
      ]&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==== How to create this tree? ====&lt;br /&gt;
* If only one stage needed -- just write manually.&lt;br /&gt;
* The authors used open-source ML tool AiZynthFinder: https://jcheminf.biomedcentral.com/articles/10.1186/s13321-020-00472-1, https://github.com/MolecularAI/aizynthfinder&lt;br /&gt;
* Reaxys Retrosynthesis tool (was not able to find a root for granisetron though, seems to use only published procedures)&lt;br /&gt;
* Sci-Finder Retrosynthesis. Exports results in .pdf only, but at least you can copy compound SMILES from the Retrosynthesis Plan, just click on the structure and select &amp;quot;Substance Detail&amp;quot;.&lt;br /&gt;
* IBM RXN https://rxn.res.ibm.com/. Based on machine-extracted patent reactions. You have to manually select reactions for each step.&lt;br /&gt;
&lt;br /&gt;
In any case, except for one stage synthesis, I would recommend consulting a synthetic chemist before creating analogs.&lt;br /&gt;
&lt;br /&gt;
=== Configuration file ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;All additional settings of Synthesia can be specified in a configuration file. This file is optional and the user does not have to use it. If both the configuration file as well as command line parameters are used to define parameters, the settings parsed via command line overwrite settings defined in the configuration file. The configuration file has to be in valid standard JSON format. An example configuration file is bundled with Synthesia.&amp;lt;/blockquote&amp;gt;So far I&#039;ve been using only command line parameters.&lt;br /&gt;
&lt;br /&gt;
=== Running ===&lt;br /&gt;
&amp;lt;code&amp;gt;./synthesia --inputStructures ../../Enamine-BB/2022-03_Chemspace_Building_Blocks_noRU_SMILES.smiles --retroSynTree amide_tree.json --output amide_out-ecfp.json  --threads 4 --verbosity 5 --allLeaves --useECFP 2 tanimoto 0.6 1.0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--inputStructures&amp;lt;/code&amp;gt; -- a library of BBs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--retroSynTree&amp;lt;/code&amp;gt; -- self-explanatory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--output&amp;lt;/code&amp;gt; -- output .json file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--threads&amp;lt;/code&amp;gt; -- Number of threads used for parallelization.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--allLeaves&amp;lt;/code&amp;gt; -- &#039;&#039;&#039;very important&#039;&#039;&#039;: without it you will only get suitable BBs and not final structures. The README says: &#039;&#039;Set this parameter to true if all chemical leaf nodes should be open for exchange. Either this parameter or the option allChemicals must be set or the nodeId parameter must be specified&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--useECFP&amp;lt;/code&amp;gt; -- filter analogs by ECFP. 4 parameter values are expected: &amp;lt;Integer&amp;gt; &amp;lt;String&amp;gt; &amp;lt;Integer&amp;gt; &amp;lt;Integer&amp;gt; The first number equals the appended number of the FCFP. The second string parameters specifies the similarity measure method for a fingerprint comparison. Options are &#039;tanimoto&#039;, &#039;cosine&#039;, &#039;hamming&#039;, &#039;euclidean&#039;, &#039;dice.&#039; The third number specifies the minimum threshold value for the similarity fingerprint comparison and the fourth number specifies the maximum threshold value.&lt;br /&gt;
&lt;br /&gt;
This command executed on Gimel returns 511 analogs of granisetron in 1&#039;56&amp;quot; from 436K BBs.&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
Pros of Synthesia — flexibility, multistage reactions of virtually any complexity and number of stages, fine-tuning of analog properties (No. of aromatic rings, halogens, cations, logP…).&lt;br /&gt;
&lt;br /&gt;
Cons — closed sources, licensing on a per-year basis, steep learning curve, need to create retrosynthetic trees for each compound.&lt;br /&gt;
&lt;br /&gt;
My resume at the moment — may be interesting to look into given access to a synthetic chemistry group.&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Synthesia&amp;diff=14545</id>
		<title>Synthesia</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Synthesia&amp;diff=14545"/>
		<updated>2022-08-03T21:11:54Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;blockquote&amp;gt;Synthesia is a command-line tool that uses an entire retrosynthetic route as a guide pathway to generate optimized structural analogues of a lead compound without compromising the synthesizability of the structure. The users has the ability to guide the structural modifications in a desired direction by specifying structural constraints.&amp;lt;/blockquote&amp;gt;Original publication: https://pubs.acs.org/doi/10.1021/acs.jcim.2c00246&lt;br /&gt;
&lt;br /&gt;
Website: https://software.zbh.uni-hamburg.de/customers/tools &lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
To obtain the license, you need to register and get your account approved. Then login to the website, click on Synthesia and &amp;quot;Download the license file&amp;quot;. Your license key is inside the file, it looks like &amp;lt;code&amp;gt;AAAAAAAliFQAAAAU2eM8ZjTTELGD3LzxBgt3/1DGaW4=&amp;lt;/code&amp;gt;. Copy the license key from the file, download and unpack the program and run the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;./synthesia --license &amp;lt;your_license_here&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
My installation is in &amp;lt;code&amp;gt;/mnt/nfs/exa/work/ak87/UCSF/SynthI/SYNTHESIA/synthesia_1.0.0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running ==&lt;br /&gt;
To run the program, you need:&lt;br /&gt;
&lt;br /&gt;
# a retrosynthetic tree and &lt;br /&gt;
# a library of building blocks (&amp;quot;&amp;lt;code&amp;gt;SMILES Name&amp;lt;/code&amp;gt;&amp;quot;, no preprocessing needed).&lt;br /&gt;
&lt;br /&gt;
The tool returns analogs of a target molecule synthesizable by the given route from given BBs. The analogs may be filtered by 29 different parameters (see SI or README.md file):&lt;br /&gt;
&lt;br /&gt;
# Extended-Connectivity Fingerprints (ECFP)&lt;br /&gt;
# Functional-Class Fingerprints (FCFP)&lt;br /&gt;
# Connected Subgraph Fingerprints (CSFP)&lt;br /&gt;
# Largest Ring&lt;br /&gt;
# Largest Ringsystem&lt;br /&gt;
# Molecular Weight&lt;br /&gt;
# Number of Hydrogen-Bond Acceptors&lt;br /&gt;
# Number of Anions&lt;br /&gt;
# Number of Aromatic Atoms&lt;br /&gt;
# Number of Aromatic Rings&lt;br /&gt;
# Number of Aromatic Ringsystems&lt;br /&gt;
# Number of Cations&lt;br /&gt;
# Number of Hydrogen-Bond Donors&lt;br /&gt;
# Number of Halogens&lt;br /&gt;
# Number of Non-Hydrogen Atoms&lt;br /&gt;
# Number of Hetero Atoms&lt;br /&gt;
# Number of Hydrophobic Points&lt;br /&gt;
# Number of Inorganic Atoms&lt;br /&gt;
# Number of Lipinski Donors&lt;br /&gt;
# Number of Nitrogens and Oxygens&lt;br /&gt;
# Number of Non-Hydrogen Bonds&lt;br /&gt;
# Number of Rings&lt;br /&gt;
# Number of Ringsystems&lt;br /&gt;
# Number of Rotatable Bonds&lt;br /&gt;
# LogP-Value&lt;br /&gt;
# Total Charge&lt;br /&gt;
# Topological Polar Surface Area (TPSA)&lt;br /&gt;
# Volume&lt;br /&gt;
# Matching SMARTSS3 pattern. Either inclusion or exclusion&lt;br /&gt;
&lt;br /&gt;
=== Retrosynthetic tree ===&lt;br /&gt;
This is a .json file that describes all steps needed to synthesize the molecule in question and starting reagents. The steps are encoded in SMARTS. Each reaction node should contain reaction SMARTS + SMILES of the product. The tree for [https://zinc15.docking.org/substances/ZINC000000000347/ granisetron] synthesis via amidation is shown below.&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;smiles&amp;quot;: &amp;quot;CN1C2CCCC1CC(C2)NC(=O)c1nn(C)c2ccccc12&amp;quot;,&lt;br /&gt;
  &amp;quot;is_chemical&amp;quot;: true,&lt;br /&gt;
  &amp;quot;children&amp;quot;:&lt;br /&gt;
  [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;smiles&amp;quot;: &amp;quot;CN1C2CCCC1CC(C2)NC(=O)c1nn(C)c2ccccc12&amp;quot;,&lt;br /&gt;
      &amp;quot;is_reaction&amp;quot;: true,&lt;br /&gt;
      &amp;quot;smartsPattern&amp;quot;: &amp;quot;[#7:1].[#8]-[#6:2](=O)&amp;gt;&amp;gt;[#7:1]-[#6:2](=O)&amp;quot;,&lt;br /&gt;
      &amp;quot;children&amp;quot;:&lt;br /&gt;
      [&lt;br /&gt;
        {&lt;br /&gt;
          &amp;quot;smiles&amp;quot;: &amp;quot;Cn1nc(C(O)=O)c2ccccc12&amp;quot;,&lt;br /&gt;
          &amp;quot;is_chemical&amp;quot;: true,&lt;br /&gt;
          &amp;quot;children&amp;quot;: []&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
          &amp;quot;smiles&amp;quot;: &amp;quot;CN1C2CCCC1CC(N)C2&amp;quot;,&lt;br /&gt;
          &amp;quot;is_chemical&amp;quot;: true,&lt;br /&gt;
          &amp;quot;children&amp;quot;: []&lt;br /&gt;
        }&lt;br /&gt;
      ]&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==== How to create this tree? ====&lt;br /&gt;
* If only one stage needed -- just write manually.&lt;br /&gt;
* The authors used open-source ML tool AiZynthFinder: https://jcheminf.biomedcentral.com/articles/10.1186/s13321-020-00472-1, https://github.com/MolecularAI/aizynthfinder&lt;br /&gt;
* Reaxys Retrosynthesis tool (was not able to find a root for granisetron though, seems to use only published procedures)&lt;br /&gt;
* Sci-Finder Retrosynthesis. Exports results in .pdf only, but at least you can copy compound SMILES from the Retrosynthesis Plan, just click on the structure and select &amp;quot;Substance Detail&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In any case, except for one stage synthesis, I would recommend consulting a synthetic chemist before creating analogs.&lt;br /&gt;
&lt;br /&gt;
=== Configuration file ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;All additional settings of Synthesia can be specified in a configuration file. This file is optional and the user does not have to use it. If both the configuration file as well as command line parameters are used to define parameters, the settings parsed via command line overwrite settings defined in the configuration file. The configuration file has to be in valid standard JSON format. An example configuration file is bundled with Synthesia.&amp;lt;/blockquote&amp;gt;So far I&#039;ve been using only command line parameters.&lt;br /&gt;
&lt;br /&gt;
=== Running ===&lt;br /&gt;
&amp;lt;code&amp;gt;./synthesia --inputStructures ../../Enamine-BB/2022-03_Chemspace_Building_Blocks_noRU_SMILES.smiles --retroSynTree amide_tree.json --output amide_out-ecfp.json  --threads 4 --verbosity 5 --allLeaves --useECFP 2 tanimoto 0.6 1.0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--inputStructures&amp;lt;/code&amp;gt; -- a library of BBs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--retroSynTree&amp;lt;/code&amp;gt; -- self-explanatory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--output&amp;lt;/code&amp;gt; -- output .json file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--threads&amp;lt;/code&amp;gt; -- Number of threads used for parallelization.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--allLeaves&amp;lt;/code&amp;gt; -- &#039;&#039;&#039;very important&#039;&#039;&#039;: without it you will only get suitable BBs and not final structures. The README says: &#039;&#039;Set this parameter to true if all chemical leaf nodes should be open for exchange. Either this parameter or the option allChemicals must be set or the nodeId parameter must be specified&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--useECFP&amp;lt;/code&amp;gt; -- filter analogs by ECFP. 4 parameter values are expected: &amp;lt;Integer&amp;gt; &amp;lt;String&amp;gt; &amp;lt;Integer&amp;gt; &amp;lt;Integer&amp;gt; The first number equals the appended number of the FCFP. The second string parameters specifies the similarity measure method for a fingerprint comparison. Options are &#039;tanimoto&#039;, &#039;cosine&#039;, &#039;hamming&#039;, &#039;euclidean&#039;, &#039;dice.&#039; The third number specifies the minimum threshold value for the similarity fingerprint comparison and the fourth number specifies the maximum threshold value.&lt;br /&gt;
&lt;br /&gt;
This command executed on Gimel returns 511 analogs of granisetron in 1&#039;56&amp;quot; from 436K BBs.&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
Pros of Synthesia — flexibility, multistage reactions of virtually any complexity and number of stages, fine-tuning of analog properties (No. of aromatic rings, halogens, cations, logP…).&lt;br /&gt;
&lt;br /&gt;
Cons — closed sources, licensing on a per-year basis, steep learning curve, need to create retrosynthetic trees for each compound.&lt;br /&gt;
&lt;br /&gt;
My resume at the moment — may be interesting to look into given access to a synthetic chemistry group.&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Synthesia&amp;diff=14542</id>
		<title>Synthesia</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Synthesia&amp;diff=14542"/>
		<updated>2022-08-03T21:10:09Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: added retrosynthesis route generation tools&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;blockquote&amp;gt;Synthesia is a command-line tool that uses an entire retrosynthetic route as a guide pathway to generate optimized structural analogues of a lead compound without compromising the synthesizability of the structure. The users has the ability to guide the structural modifications in a desired direction by specifying structural constraints.&amp;lt;/blockquote&amp;gt;Original publication: https://pubs.acs.org/doi/10.1021/acs.jcim.2c00246&lt;br /&gt;
&lt;br /&gt;
Website: https://software.zbh.uni-hamburg.de/customers/tools &lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
To obtain the license, you need to register and get your account approved. Then login to the website, click on Synthesia and &amp;quot;Download the license file&amp;quot;. Your license key is inside the file, it looks like &amp;lt;code&amp;gt;AAAAAAAliFQAAAAU2eM8ZjTTELGD3LzxBgt3/1DGaW4=&amp;lt;/code&amp;gt;. Copy the license key from the file, download and unpack the program and run the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;./synthesia --license &amp;lt;your_license_here&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
My installation is in &amp;lt;code&amp;gt;/mnt/nfs/exa/work/ak87/UCSF/SynthI/SYNTHESIA/synthesia_1.0.0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running ==&lt;br /&gt;
To run the program, you need:&lt;br /&gt;
&lt;br /&gt;
# a retrosynthetic tree and &lt;br /&gt;
# a library of building blocks (&amp;quot;&amp;lt;code&amp;gt;SMILES Name&amp;lt;/code&amp;gt;&amp;quot;, no preprocessing needed).&lt;br /&gt;
&lt;br /&gt;
The tool returns analogs of a target molecule synthesizable by the given route from given BBs. The analogs may be filtered by 29 different parameters (see SI or README.md file):&lt;br /&gt;
&lt;br /&gt;
# Extended-Connectivity Fingerprints (ECFP)&lt;br /&gt;
# Functional-Class Fingerprints (FCFP)&lt;br /&gt;
# Connected Subgraph Fingerprints (CSFP)&lt;br /&gt;
# Largest Ring&lt;br /&gt;
# Largest Ringsystem&lt;br /&gt;
# Molecular Weight&lt;br /&gt;
# Number of Hydrogen-Bond Acceptors&lt;br /&gt;
# Number of Anions&lt;br /&gt;
# Number of Aromatic Atoms&lt;br /&gt;
# Number of Aromatic Rings&lt;br /&gt;
# Number of Aromatic Ringsystems&lt;br /&gt;
# Number of Cations&lt;br /&gt;
# Number of Hydrogen-Bond Donors&lt;br /&gt;
# Number of Halogens&lt;br /&gt;
# Number of Non-Hydrogen Atoms&lt;br /&gt;
# Number of Hetero Atoms&lt;br /&gt;
# Number of Hydrophobic Points&lt;br /&gt;
# Number of Inorganic Atoms&lt;br /&gt;
# Number of Lipinski Donors&lt;br /&gt;
# Number of Nitrogens and Oxygens&lt;br /&gt;
# Number of Non-Hydrogen Bonds&lt;br /&gt;
# Number of Rings&lt;br /&gt;
# Number of Ringsystems&lt;br /&gt;
# Number of Rotatable Bonds&lt;br /&gt;
# LogP-Value&lt;br /&gt;
# Total Charge&lt;br /&gt;
# Topological Polar Surface Area (TPSA)&lt;br /&gt;
# Volume&lt;br /&gt;
# Matching SMARTSS3 pattern. Either inclusion or exclusion&lt;br /&gt;
&lt;br /&gt;
=== Retrosynthetic tree ===&lt;br /&gt;
This is a .json file that describes all steps needed to synthesize the molecule in question and starting reagents. The steps are encoded in SMARTS. Each reaction node should contain reaction SMARTS + SMILES of the product. The tree for [https://zinc15.docking.org/substances/ZINC000000000347/ granisetron] synthesis via amidation is shown below.&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;smiles&amp;quot;: &amp;quot;CN1C2CCCC1CC(C2)NC(=O)c1nn(C)c2ccccc12&amp;quot;,&lt;br /&gt;
  &amp;quot;is_chemical&amp;quot;: true,&lt;br /&gt;
  &amp;quot;children&amp;quot;:&lt;br /&gt;
  [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;smiles&amp;quot;: &amp;quot;CN1C2CCCC1CC(C2)NC(=O)c1nn(C)c2ccccc12&amp;quot;,&lt;br /&gt;
      &amp;quot;is_reaction&amp;quot;: true,&lt;br /&gt;
      &amp;quot;smartsPattern&amp;quot;: &amp;quot;[#7:1].[#8]-[#6:2](=O)&amp;gt;&amp;gt;[#7:1]-[#6:2](=O)&amp;quot;,&lt;br /&gt;
      &amp;quot;children&amp;quot;:&lt;br /&gt;
      [&lt;br /&gt;
        {&lt;br /&gt;
          &amp;quot;smiles&amp;quot;: &amp;quot;Cn1nc(C(O)=O)c2ccccc12&amp;quot;,&lt;br /&gt;
          &amp;quot;is_chemical&amp;quot;: true,&lt;br /&gt;
          &amp;quot;children&amp;quot;: []&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
          &amp;quot;smiles&amp;quot;: &amp;quot;CN1C2CCCC1CC(N)C2&amp;quot;,&lt;br /&gt;
          &amp;quot;is_chemical&amp;quot;: true,&lt;br /&gt;
          &amp;quot;children&amp;quot;: []&lt;br /&gt;
        }&lt;br /&gt;
      ]&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==== How to create this tree? ====&lt;br /&gt;
* If only one stage needed -- just write manually.&lt;br /&gt;
* The authors used open-source ML tool AiZynthFinder: https://jcheminf.biomedcentral.com/articles/10.1186/s13321-020-00472-1, https://github.com/MolecularAI/aizynthfinder&lt;br /&gt;
* Reaxys Retrosynthesis tool (was not able to find a root for granisetron though, seems to use only published procedures)&lt;br /&gt;
* Sci-Finder Retrosynthesis. Exports results in .pdf only, but at least you can copy compound SMILES from the Retrosynthesis Plan, just click on the structure and select &amp;quot;Substance Detail&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In any case, except for one stage synthesis, I would recommend consulting a synthetic chemist before creating analogs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Configuration file ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;All additional settings of Synthesia can be specified in a configuration file. This file is optional and the user does not have to use it. If both the configuration file as well as command line parameters are used to define parameters, the settings parsed via command line overwrite settings defined in the configuration file. The configuration file has to be in valid standard JSON format. An example configuration file is bundled with Synthesia.&amp;lt;/blockquote&amp;gt;So far I&#039;ve been using only command line parameters.&lt;br /&gt;
&lt;br /&gt;
=== Running ===&lt;br /&gt;
&amp;lt;code&amp;gt;./synthesia --inputStructures ../../Enamine-BB/2022-03_Chemspace_Building_Blocks_noRU_SMILES.smiles --retroSynTree amide_tree.json --output amide_out-ecfp.json  --threads 4 --verbosity 5 --allLeaves --useECFP 2 tanimoto 0.6 1.0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--inputStructures&amp;lt;/code&amp;gt; -- a library of BBs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--retroSynTree&amp;lt;/code&amp;gt; -- self-explanatory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--output&amp;lt;/code&amp;gt; -- output .json file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--threads&amp;lt;/code&amp;gt; -- Number of threads used for parallelization.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--allLeaves&amp;lt;/code&amp;gt; -- &#039;&#039;&#039;very important&#039;&#039;&#039;: without it you will only get suitable BBs and not final structures. The README says: &#039;&#039;Set this parameter to true if all chemical leaf nodes should be open for exchange. Either this parameter or the option allChemicals must be set or the nodeId parameter must be specified&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--useECFP&amp;lt;/code&amp;gt; -- filter analogs by ECFP. 4 parameter values are expected: &amp;lt;Integer&amp;gt; &amp;lt;String&amp;gt; &amp;lt;Integer&amp;gt; &amp;lt;Integer&amp;gt; The first number equals the appended number of the FCFP. The second string parameters specifies the similarity measure method for a fingerprint comparison. Options are &#039;tanimoto&#039;, &#039;cosine&#039;, &#039;hamming&#039;, &#039;euclidean&#039;, &#039;dice.&#039; The third number specifies the minimum threshold value for the similarity fingerprint comparison and the fourth number specifies the maximum threshold value.&lt;br /&gt;
&lt;br /&gt;
This command executed on Gimel returns 511 analogs of granisetron in 1&#039;56&amp;quot; from 436K BBs.&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
Pros of Synthesia — flexibility, multistage reactions of virtually any complexity and number of stages, fine-tuning of analog properties (No. of aromatic rings, halogens, cations, logP…).&lt;br /&gt;
&lt;br /&gt;
Cons — closed sources, licensing on a per-year basis, steep learning curve, need to create retrosynthetic trees for each compound.&lt;br /&gt;
&lt;br /&gt;
My resume at the moment — may be interesting to look into given access to a synthetic chemistry group.&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Synthesia&amp;diff=14541</id>
		<title>Synthesia</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Synthesia&amp;diff=14541"/>
		<updated>2022-08-03T20:49:07Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;blockquote&amp;gt;Synthesia is a command-line tool that uses an entire retrosynthetic route as a guide pathway to generate optimized structural analogues of a lead compound without compromising the synthesizability of the structure. The users has the ability to guide the structural modifications in a desired direction by specifying structural constraints.&amp;lt;/blockquote&amp;gt;Original publication: https://pubs.acs.org/doi/10.1021/acs.jcim.2c00246&lt;br /&gt;
&lt;br /&gt;
Website: https://software.zbh.uni-hamburg.de/customers/tools &lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
To obtain the license, you need to register and get your account approved. Then login to the website, click on Synthesia and &amp;quot;Download the license file&amp;quot;. Your license key is inside the file, it looks like &amp;lt;code&amp;gt;AAAAAAAliFQAAAAU2eM8ZjTTELGD3LzxBgt3/1DGaW4=&amp;lt;/code&amp;gt;. Copy the license key from the file, download and unpack the program and run the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;./synthesia --license &amp;lt;your_license_here&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
My installation is in &amp;lt;code&amp;gt;/mnt/nfs/exa/work/ak87/UCSF/SynthI/SYNTHESIA/synthesia_1.0.0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running ==&lt;br /&gt;
To run the program, you need:&lt;br /&gt;
&lt;br /&gt;
# a retrosynthetic tree and &lt;br /&gt;
# a library of building blocks (&amp;quot;&amp;lt;code&amp;gt;SMILES Name&amp;lt;/code&amp;gt;&amp;quot;, no preprocessing needed).&lt;br /&gt;
&lt;br /&gt;
The tool returns analogs of a target molecule synthesizable by the given route from given BBs. The analogs may be filtered by 29 different parameters (see SI or README.md file):&lt;br /&gt;
&lt;br /&gt;
# Extended-Connectivity Fingerprints (ECFP)&lt;br /&gt;
# Functional-Class Fingerprints (FCFP)&lt;br /&gt;
# Connected Subgraph Fingerprints (CSFP)&lt;br /&gt;
# Largest Ring&lt;br /&gt;
# Largest Ringsystem&lt;br /&gt;
# Molecular Weight&lt;br /&gt;
# Number of Hydrogen-Bond Acceptors&lt;br /&gt;
# Number of Anions&lt;br /&gt;
# Number of Aromatic Atoms&lt;br /&gt;
# Number of Aromatic Rings&lt;br /&gt;
# Number of Aromatic Ringsystems&lt;br /&gt;
# Number of Cations&lt;br /&gt;
# Number of Hydrogen-Bond Donors&lt;br /&gt;
# Number of Halogens&lt;br /&gt;
# Number of Non-Hydrogen Atoms&lt;br /&gt;
# Number of Hetero Atoms&lt;br /&gt;
# Number of Hydrophobic Points&lt;br /&gt;
# Number of Inorganic Atoms&lt;br /&gt;
# Number of Lipinski Donors&lt;br /&gt;
# Number of Nitrogens and Oxygens&lt;br /&gt;
# Number of Non-Hydrogen Bonds&lt;br /&gt;
# Number of Rings&lt;br /&gt;
# Number of Ringsystems&lt;br /&gt;
# Number of Rotatable Bonds&lt;br /&gt;
# LogP-Value&lt;br /&gt;
# Total Charge&lt;br /&gt;
# Topological Polar Surface Area (TPSA)&lt;br /&gt;
# Volume&lt;br /&gt;
# Matching SMARTSS3 pattern. Either inclusion or exclusion&lt;br /&gt;
&lt;br /&gt;
=== Retrosynthetic tree ===&lt;br /&gt;
This is a .json file that describes all steps needed to synthesize the molecule in question and starting reagents. The steps are encoded in SMARTS. Each reaction node should contain reaction SMARTS + SMILES of the product. The tree for [https://zinc15.docking.org/substances/ZINC000000000347/ granisetron] synthesis via amidation is shown below.&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;smiles&amp;quot;: &amp;quot;CN1C2CCCC1CC(C2)NC(=O)c1nn(C)c2ccccc12&amp;quot;,&lt;br /&gt;
  &amp;quot;is_chemical&amp;quot;: true,&lt;br /&gt;
  &amp;quot;children&amp;quot;:&lt;br /&gt;
  [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;smiles&amp;quot;: &amp;quot;CN1C2CCCC1CC(C2)NC(=O)c1nn(C)c2ccccc12&amp;quot;,&lt;br /&gt;
      &amp;quot;is_reaction&amp;quot;: true,&lt;br /&gt;
      &amp;quot;smartsPattern&amp;quot;: &amp;quot;[#7:1].[#8]-[#6:2](=O)&amp;gt;&amp;gt;[#7:1]-[#6:2](=O)&amp;quot;,&lt;br /&gt;
      &amp;quot;children&amp;quot;:&lt;br /&gt;
      [&lt;br /&gt;
        {&lt;br /&gt;
          &amp;quot;smiles&amp;quot;: &amp;quot;Cn1nc(C(O)=O)c2ccccc12&amp;quot;,&lt;br /&gt;
          &amp;quot;is_chemical&amp;quot;: true,&lt;br /&gt;
          &amp;quot;children&amp;quot;: []&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
          &amp;quot;smiles&amp;quot;: &amp;quot;CN1C2CCCC1CC(N)C2&amp;quot;,&lt;br /&gt;
          &amp;quot;is_chemical&amp;quot;: true,&lt;br /&gt;
          &amp;quot;children&amp;quot;: []&lt;br /&gt;
        }&lt;br /&gt;
      ]&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;How to create this tree?&lt;br /&gt;
&lt;br /&gt;
=== Configuration file ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;All additional settings of Synthesia can be specified in a configuration file. This file is optional and the user does not have to use it. If both the configuration file as well as command line parameters are used to define parameters, the settings parsed via command line overwrite settings defined in the configuration file. The configuration file has to be in valid standard JSON format. An example configuration file is bundled with Synthesia.&amp;lt;/blockquote&amp;gt;So far I&#039;ve been using only command line parameters.&lt;br /&gt;
&lt;br /&gt;
=== Running ===&lt;br /&gt;
&amp;lt;code&amp;gt;./synthesia --inputStructures ../../Enamine-BB/2022-03_Chemspace_Building_Blocks_noRU_SMILES.smiles --retroSynTree amide_tree.json --output amide_out-ecfp.json  --threads 4 --verbosity 5 --allLeaves --useECFP 2 tanimoto 0.6 1.0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--inputStructures&amp;lt;/code&amp;gt; -- a library of BBs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--retroSynTree&amp;lt;/code&amp;gt; -- self-explanatory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--output&amp;lt;/code&amp;gt; -- output .json file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--threads&amp;lt;/code&amp;gt; -- Number of threads used for parallelization.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--allLeaves&amp;lt;/code&amp;gt; -- &#039;&#039;&#039;very important&#039;&#039;&#039;: without it you will only get suitable BBs and not final structures. The README says: &#039;&#039;Set this parameter to true if all chemical leaf nodes should be open for exchange. Either this parameter or the option allChemicals must be set or the nodeId parameter must be specified&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--useECFP&amp;lt;/code&amp;gt; -- filter analogs by ECFP. 4 parameter values are expected: &amp;lt;Integer&amp;gt; &amp;lt;String&amp;gt; &amp;lt;Integer&amp;gt; &amp;lt;Integer&amp;gt; The first number equals the appended number of the FCFP. The second string parameters specifies the similarity measure method for a fingerprint comparison. Options are &#039;tanimoto&#039;, &#039;cosine&#039;, &#039;hamming&#039;, &#039;euclidean&#039;, &#039;dice.&#039; The third number specifies the minimum threshold value for the similarity fingerprint comparison and the fourth number specifies the maximum threshold value.&lt;br /&gt;
&lt;br /&gt;
This command executed on Gimel returns 511 analogs of granisetron in 1&#039;56&amp;quot; from 436K BBs.&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
Pros of Synthesia — flexibility, multistage reactions of virtually any complexity and number of stages, fine-tuning of analog properties (No. of aromatic rings, halogens, cations, logP…).&lt;br /&gt;
&lt;br /&gt;
Cons — closed sources, licensing on a per-year basis, steep learning curve, need to create retrosynthetic trees for each compound.&lt;br /&gt;
&lt;br /&gt;
My resume at the moment — may be interesting to look into given access to a synthetic chemistry group.&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Synthesia&amp;diff=14540</id>
		<title>Synthesia</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Synthesia&amp;diff=14540"/>
		<updated>2022-08-03T20:48:39Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;blockquote&amp;gt;Synthesia is a command-line tool that uses an entire retrosynthetic route as a guide pathway to generate optimized structural analogues of a lead compound without compromising the synthesizability of the structure. The users has the ability to guide the structural modifications in a desired direction by specifying structural constraints.&amp;lt;/blockquote&amp;gt;Original publication: https://pubs.acs.org/doi/10.1021/acs.jcim.2c00246&lt;br /&gt;
&lt;br /&gt;
Website: https://software.zbh.uni-hamburg.de/customers/tools &lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
To obtain the license, you need to register and get your account approved. Then login to the website, click on Synthesia and &amp;quot;Download the license file&amp;quot;. Your license key is inside the file, it looks like &amp;lt;code&amp;gt;AAAAAAAliFQAAAAU2eM8ZjTTELGD3LzxBgt3/1DGaW4=&amp;lt;/code&amp;gt;. Copy the license key from the file, download and unpack the program and run the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;./synthesia --license &amp;lt;your_license_here&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
My installation is in &amp;lt;code&amp;gt;/mnt/nfs/exa/work/ak87/UCSF/SynthI/SYNTHESIA/synthesia_1.0.0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running ==&lt;br /&gt;
To run the program, you need:&lt;br /&gt;
&lt;br /&gt;
# a retrosynthetic tree and &lt;br /&gt;
# a library of building blocks (&amp;quot;&amp;lt;code&amp;gt;SMILES Name&amp;lt;/code&amp;gt;&amp;quot;, no preprocessing needed).&lt;br /&gt;
&lt;br /&gt;
The tool returns analogs of a target molecule synthesizable by the given route from given BBs. The analogs may be filtered by 29 different parameters (see SI or README.md file):&lt;br /&gt;
&lt;br /&gt;
# Extended-Connectivity Fingerprints (ECFP)&lt;br /&gt;
# Functional-Class Fingerprints (FCFP)&lt;br /&gt;
# Connected Subgraph Fingerprints (CSFP)&lt;br /&gt;
# Largest Ring&lt;br /&gt;
# Largest Ringsystem&lt;br /&gt;
# Molecular Weight&lt;br /&gt;
# Number of Hydrogen-Bond Acceptors&lt;br /&gt;
# Number of Anions&lt;br /&gt;
# Number of Aromatic Atoms&lt;br /&gt;
# Number of Aromatic Rings&lt;br /&gt;
# Number of Aromatic Ringsystems&lt;br /&gt;
# Number of Cations&lt;br /&gt;
# Number of Hydrogen-Bond Donors&lt;br /&gt;
# Number of Halogens&lt;br /&gt;
# Number of Non-Hydrogen Atoms&lt;br /&gt;
# Number of Hetero Atoms&lt;br /&gt;
# Number of Hydrophobic Points&lt;br /&gt;
# Number of Inorganic Atoms&lt;br /&gt;
# Number of Lipinski Donors&lt;br /&gt;
# Number of Nitrogens and Oxygens&lt;br /&gt;
# Number of Non-Hydrogen Bonds&lt;br /&gt;
# Number of Rings&lt;br /&gt;
# Number of Ringsystems&lt;br /&gt;
# Number of Rotatable Bonds&lt;br /&gt;
# LogP-Value&lt;br /&gt;
# Total Charge&lt;br /&gt;
# Topological Polar Surface Area (TPSA)&lt;br /&gt;
# Volume&lt;br /&gt;
# Matching SMARTSS3 pattern. Either inclusion or exclusion&lt;br /&gt;
&lt;br /&gt;
=== Retrosynthetic tree ===&lt;br /&gt;
This is a .json file that describes all steps needed to synthesize the molecule in question and starting reagents. The steps are encoded in SMARTS. Each reaction node should contain reaction SMARTS + SMILES of the product. The tree for [https://zinc15.docking.org/substances/ZINC000000000347/ granisetron] synthesis via amidation is shown below.&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;smiles&amp;quot;: &amp;quot;CN1C2CCCC1CC(C2)NC(=O)c1nn(C)c2ccccc12&amp;quot;,&lt;br /&gt;
  &amp;quot;is_chemical&amp;quot;: true,&lt;br /&gt;
  &amp;quot;children&amp;quot;:&lt;br /&gt;
  [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;smiles&amp;quot;: &amp;quot;CN1C2CCCC1CC(C2)NC(=O)c1nn(C)c2ccccc12&amp;quot;,&lt;br /&gt;
      &amp;quot;is_reaction&amp;quot;: true,&lt;br /&gt;
      &amp;quot;smartsPattern&amp;quot;: &amp;quot;[#7:1].[#8]-[#6:2](=O)&amp;gt;&amp;gt;[#7:1]-[#6:2](=O)&amp;quot;,&lt;br /&gt;
      &amp;quot;children&amp;quot;:&lt;br /&gt;
      [&lt;br /&gt;
        {&lt;br /&gt;
          &amp;quot;smiles&amp;quot;: &amp;quot;Cn1nc(C(O)=O)c2ccccc12&amp;quot;,&lt;br /&gt;
          &amp;quot;is_chemical&amp;quot;: true,&lt;br /&gt;
          &amp;quot;children&amp;quot;: []&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
          &amp;quot;smiles&amp;quot;: &amp;quot;CN1C2CCCC1CC(N)C2&amp;quot;,&lt;br /&gt;
          &amp;quot;is_chemical&amp;quot;: true,&lt;br /&gt;
          &amp;quot;children&amp;quot;: []&lt;br /&gt;
        }&lt;br /&gt;
      ]&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;How to create this tree?&lt;br /&gt;
&lt;br /&gt;
=== Configuration file ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;All additional settings of Synthesia can be specified in a configuration file. This file is optional and the user does not have to use it. If both the configuration file as well as command line parameters are used to define parameters, the settings parsed via command line overwrite settings defined in the configuration file. The configuration file has to be in valid standard JSON format. An example configuration file is bundled with Synthesia.&amp;lt;/blockquote&amp;gt;So far I&#039;ve been using only command line parameters.&lt;br /&gt;
&lt;br /&gt;
=== Running ===&lt;br /&gt;
&amp;lt;code&amp;gt;./synthesia --inputStructures ../../Enamine-BB/2022-03_Chemspace_Building_Blocks_noRU_SMILES.smiles --retroSynTree amide_tree.json --output amide_out-ecfp.json  --threads 4 --verbosity 5 --allLeaves --useECFP 2 tanimoto 0.6 1.0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--inputStructures&amp;lt;/code&amp;gt; -- a library of BBs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--retroSynTree&amp;lt;/code&amp;gt; -- self-explanatory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--output&amp;lt;/code&amp;gt; -- output .json file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--threads&amp;lt;/code&amp;gt; -- Number of threads used for parallelization.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--allLeaves&amp;lt;/code&amp;gt; -- &#039;&#039;&#039;very important&#039;&#039;&#039;: without it you will only get suitable BBs and not final structures. The README says: &#039;&#039;Set this parameter to true if all chemical leaf nodes should be open for exchange. Either this parameter or the option allChemicals must be set or the nodeId parameter must be specified&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--useECFP&amp;lt;/code&amp;gt; -- filter analogs by ECFP. 4 parameter values are expected:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Integer&amp;gt; &amp;lt;String&amp;gt; &amp;lt;Integer&amp;gt; &amp;lt;Integer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first number equals the appended number of the FCFP. The second string parameters specifies the similarity measure method for a fingerprint comparison. Options are &#039;tanimoto&#039;, &#039;cosine&#039;, &#039;hamming&#039;, &#039;euclidean&#039;, &#039;dice.&#039; The third number specifies the minimum threshold value for the similarity fingerprint comparison and the fourth number specifies the maximum threshold value.&lt;br /&gt;
&lt;br /&gt;
This command executed on Gimel returns 511 analogs of granisetron in 1&#039;56&amp;quot; from 436K BBs.&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
Pros of Synthesia — flexibility, multistage reactions of virtually any complexity and number of stages, fine-tuning of analog properties (No. of aromatic rings, halogens, cations, logP…).&lt;br /&gt;
&lt;br /&gt;
Cons — closed sources, licensing on a per-year basis, steep learning curve, need to create retrosynthetic trees for each compound.&lt;br /&gt;
&lt;br /&gt;
My resume at the moment — may be interesting to look into given access to a synthetic chemistry group.&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Synthesia&amp;diff=14538</id>
		<title>Synthesia</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Synthesia&amp;diff=14538"/>
		<updated>2022-08-03T20:46:45Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;blockquote&amp;gt;Synthesia is a command-line tool that uses an entire retrosynthetic route as a guide pathway to generate optimized structural analogues of a lead compound without compromising the synthesizability of the structure. The users has the ability to guide the structural modifications in a desired direction by specifying structural constraints.&amp;lt;/blockquote&amp;gt;Original publication: https://pubs.acs.org/doi/10.1021/acs.jcim.2c00246&lt;br /&gt;
&lt;br /&gt;
Website: https://software.zbh.uni-hamburg.de/customers/tools &lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
To obtain the license, you need to register and get your account approved. Then login to the website, click on Synthesia and &amp;quot;Download the license file&amp;quot;. Your license key is inside the file, it looks like &amp;lt;code&amp;gt;AAAAAAAliFQAAAAU2eM8ZjTTELGD3LzxBgt3/1DGaW4=&amp;lt;/code&amp;gt;. Copy the license key from the file, download and unpack the program and run the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;./synthesia --license &amp;lt;your_license_here&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
My installation is in &amp;lt;code&amp;gt;/mnt/nfs/exa/work/ak87/UCSF/SynthI/SYNTHESIA/synthesia_1.0.0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running ==&lt;br /&gt;
To run the program, you need:&lt;br /&gt;
&lt;br /&gt;
# a retrosynthetic tree and &lt;br /&gt;
# a library of building blocks (&amp;quot;&amp;lt;code&amp;gt;SMILES Name&amp;lt;/code&amp;gt;&amp;quot;, no preprocessing needed).&lt;br /&gt;
&lt;br /&gt;
The tool returns analogs of a target molecule synthesizable by the given route from given BBs. The analogs may be filtered by 29 different parameters (see SI or README.md file):&lt;br /&gt;
&lt;br /&gt;
# Extended-Connectivity Fingerprints (ECFP)&lt;br /&gt;
# Functional-Class Fingerprints (FCFP)&lt;br /&gt;
# Connected Subgraph Fingerprints (CSFP)&lt;br /&gt;
# Largest Ring&lt;br /&gt;
# Largest Ringsystem&lt;br /&gt;
# Molecular Weight&lt;br /&gt;
# Number of Hydrogen-Bond Acceptors&lt;br /&gt;
# Number of Anions&lt;br /&gt;
# Number of Aromatic Atoms&lt;br /&gt;
# Number of Aromatic Rings&lt;br /&gt;
# Number of Aromatic Ringsystems&lt;br /&gt;
# Number of Cations&lt;br /&gt;
# Number of Hydrogen-Bond Donors&lt;br /&gt;
# Number of Halogens&lt;br /&gt;
# Number of Non-Hydrogen Atoms&lt;br /&gt;
# Number of Hetero Atoms&lt;br /&gt;
# Number of Hydrophobic Points&lt;br /&gt;
# Number of Inorganic Atoms&lt;br /&gt;
# Number of Lipinski Donors&lt;br /&gt;
# Number of Nitrogens and Oxygens&lt;br /&gt;
# Number of Non-Hydrogen Bonds&lt;br /&gt;
# Number of Rings&lt;br /&gt;
# Number of Ringsystems&lt;br /&gt;
# Number of Rotatable Bonds&lt;br /&gt;
# LogP-Value&lt;br /&gt;
# Total Charge&lt;br /&gt;
# Topological Polar Surface Area (TPSA)&lt;br /&gt;
# Volume&lt;br /&gt;
# Matching SMARTSS3 pattern. Either inclusion or exclusion&lt;br /&gt;
&lt;br /&gt;
=== Retrosynthetic tree ===&lt;br /&gt;
This is a .json file that describes all steps needed to synthesize the molecule in question and starting reagents. The steps are encoded in SMARTS. Each reaction node should contain reaction SMARTS + SMILES of the product. The tree for [https://zinc15.docking.org/substances/ZINC000000000347/ granisetron] synthesis via amidation is shown below.&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;smiles&amp;quot;: &amp;quot;CN1C2CCCC1CC(C2)NC(=O)c1nn(C)c2ccccc12&amp;quot;,&lt;br /&gt;
  &amp;quot;is_chemical&amp;quot;: true,&lt;br /&gt;
  &amp;quot;children&amp;quot;:&lt;br /&gt;
  [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;smiles&amp;quot;: &amp;quot;CN1C2CCCC1CC(C2)NC(=O)c1nn(C)c2ccccc12&amp;quot;,&lt;br /&gt;
      &amp;quot;is_reaction&amp;quot;: true,&lt;br /&gt;
      &amp;quot;smartsPattern&amp;quot;: &amp;quot;[#7:1].[#8]-[#6:2](=O)&amp;gt;&amp;gt;[#7:1]-[#6:2](=O)&amp;quot;,&lt;br /&gt;
      &amp;quot;children&amp;quot;:&lt;br /&gt;
      [&lt;br /&gt;
        {&lt;br /&gt;
          &amp;quot;smiles&amp;quot;: &amp;quot;Cn1nc(C(O)=O)c2ccccc12&amp;quot;,&lt;br /&gt;
          &amp;quot;is_chemical&amp;quot;: true,&lt;br /&gt;
          &amp;quot;children&amp;quot;: []&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
          &amp;quot;smiles&amp;quot;: &amp;quot;CN1C2CCCC1CC(N)C2&amp;quot;,&lt;br /&gt;
          &amp;quot;is_chemical&amp;quot;: true,&lt;br /&gt;
          &amp;quot;children&amp;quot;: []&lt;br /&gt;
        }&lt;br /&gt;
      ]&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;How to create this tree?&lt;br /&gt;
&lt;br /&gt;
=== Configuration file ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;All additional settings of Synthesia can be specified in a configuration file. This file is optional and the user does not have to use it. If both the configuration file as well as command line parameters are used to define parameters, the settings parsed via command line overwrite settings defined in the configuration file. The configuration file has to be in valid standard JSON format. An example configuration file is bundled with Synthesia.&amp;lt;/blockquote&amp;gt;So far I&#039;ve been using only command line parameters.&lt;br /&gt;
&lt;br /&gt;
=== Running ===&lt;br /&gt;
&amp;lt;code&amp;gt;./synthesia --inputStructures ../../Enamine-BB/2022-03_Chemspace_Building_Blocks_noRU_SMILES.smiles --retroSynTree amide_tree.json --output amide_out-ecfp.json  --threads 4 --verbosity 5 --allLeaves --useECFP 2 tanimoto 0.6 1.0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--inputStructures&amp;lt;/code&amp;gt; -- a library of BBs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--retroSynTree&amp;lt;/code&amp;gt; -- self-explanatory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--output&amp;lt;/code&amp;gt; -- output .json file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--threads&amp;lt;/code&amp;gt; -- Number of threads used for parallelization.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--allLeaves&amp;lt;/code&amp;gt; -- &#039;&#039;&#039;very important&#039;&#039;&#039;: without it you will only get suitable BBs and not final structures. The README says: &#039;&#039;Set this parameter to true if all chemical leaf nodes should be open for exchange. Either this parameter or the option allChemicals must be set or the nodeId parameter must be specified&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--useECFP&amp;lt;/code&amp;gt; -- filter analogs by ECFP. 4 parameter values are expected:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Integer&amp;gt; &amp;lt;String&amp;gt; &amp;lt;Integer&amp;gt; &amp;lt;Integer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first number equals the appended number of the FCFP. The second string parameters specifies the similarity measure method for a fingerprint comparison. Options are &#039;tanimoto&#039;, &#039;cosine&#039;, &#039;hamming&#039;, &#039;euclidean&#039;, &#039;dice.&#039; The third number specifies the minimum threshold value for the similarity fingerprint comparison and the fourth number specifies the maximum threshold value.&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
Pros of Synthesia — flexibility, multistage reactions of virtually any complexity and number of stages, fine-tuning of analog properties (No. of aromatic rings, halogens, cations, logP…).&lt;br /&gt;
&lt;br /&gt;
Cons — closed sources, licensing on a per-year basis, steep learning curve, need to create retrosynthetic trees for each compound.&lt;br /&gt;
&lt;br /&gt;
My resume at the moment — may be interesting to look into given access to a synthetic chemistry group.&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Synthesia&amp;diff=14537</id>
		<title>Synthesia</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Synthesia&amp;diff=14537"/>
		<updated>2022-08-03T20:44:49Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: Created page with &amp;quot;&amp;lt;blockquote&amp;gt;Synthesia is a command-line tool that uses an entire retrosynthetic route as a guide pathway to generate optimized structural analogues of a lead compound without...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;blockquote&amp;gt;Synthesia is a command-line tool that uses an entire retrosynthetic route as a guide pathway to generate optimized structural analogues of a lead compound without compromising the synthesizability of the structure. The users has the ability to guide the structural modifications in a desired direction by specifying structural constraints.&amp;lt;/blockquote&amp;gt;Original publication: https://pubs.acs.org/doi/10.1021/acs.jcim.2c00246&lt;br /&gt;
&lt;br /&gt;
Website: https://software.zbh.uni-hamburg.de/customers/tools &lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
To obtain the license, you need to register and get your account approved. Then login to the website, click on Synthesia and &amp;quot;Download the license file&amp;quot;. Your license key is inside the file, it looks like &amp;lt;code&amp;gt;AAAAAAAliFQAAAAU2eM8ZjTTELGD3LzxBgt3/1DGaW4=&amp;lt;/code&amp;gt;. Copy the license key from the file, download and unpack the program and run the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;./synthesia --license &amp;lt;your_license_here&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
My installation is in &amp;lt;code&amp;gt;/mnt/nfs/exa/work/ak87/UCSF/SynthI/SYNTHESIA/synthesia_1.0.0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running ==&lt;br /&gt;
To run the program, you need:&lt;br /&gt;
&lt;br /&gt;
# a retrosynthetic tree and &lt;br /&gt;
# a library of building blocks (&amp;quot;&amp;lt;code&amp;gt;SMILES Name&amp;lt;/code&amp;gt;&amp;quot;, no preprocessing needed).&lt;br /&gt;
&lt;br /&gt;
The tool returns analogs of a target molecule synthesizable by the given route from given BBs. The analogs may be filtered by 29 different parameters (see SI or README.md file):&lt;br /&gt;
&lt;br /&gt;
# Extended-Connectivity Fingerprints (ECFP)&lt;br /&gt;
# Functional-Class Fingerprints (FCFP)&lt;br /&gt;
# Connected Subgraph Fingerprints (CSFP)&lt;br /&gt;
# Largest Ring&lt;br /&gt;
# Largest Ringsystem&lt;br /&gt;
# Molecular Weight&lt;br /&gt;
# Number of Hydrogen-Bond Acceptors&lt;br /&gt;
# Number of Anions&lt;br /&gt;
# Number of Aromatic Atoms&lt;br /&gt;
# Number of Aromatic Rings&lt;br /&gt;
# Number of Aromatic Ringsystems&lt;br /&gt;
# Number of Cations&lt;br /&gt;
# Number of Hydrogen-Bond Donors&lt;br /&gt;
# Number of Halogens&lt;br /&gt;
# Number of Non-Hydrogen Atoms&lt;br /&gt;
# Number of Hetero Atoms&lt;br /&gt;
# Number of Hydrophobic Points&lt;br /&gt;
# Number of Inorganic Atoms&lt;br /&gt;
# Number of Lipinski Donors&lt;br /&gt;
# Number of Nitrogens and Oxygens&lt;br /&gt;
# Number of Non-Hydrogen Bonds&lt;br /&gt;
# Number of Rings&lt;br /&gt;
# Number of Ringsystems&lt;br /&gt;
# Number of Rotatable Bonds&lt;br /&gt;
# LogP-Value&lt;br /&gt;
# Total Charge&lt;br /&gt;
# Topological Polar Surface Area (TPSA)&lt;br /&gt;
# Volume&lt;br /&gt;
# Matching SMARTSS3 pattern. Either inclusion or exclusion&lt;br /&gt;
&lt;br /&gt;
=== Retrosynthetic tree ===&lt;br /&gt;
This is a .json file that describes all steps needed to synthesize the molecule in question and starting reagents. The steps are encoded in SMARTS. Each reaction node should contain reaction SMARTS + SMILES of the product. The tree for [https://zinc15.docking.org/substances/ZINC000000000347/ granisetron] synthesis via amidation is shown below.&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;smiles&amp;quot;: &amp;quot;CN1C2CCCC1CC(C2)NC(=O)c1nn(C)c2ccccc12&amp;quot;,&lt;br /&gt;
  &amp;quot;is_chemical&amp;quot;: true,&lt;br /&gt;
  &amp;quot;children&amp;quot;:&lt;br /&gt;
  [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;smiles&amp;quot;: &amp;quot;CN1C2CCCC1CC(C2)NC(=O)c1nn(C)c2ccccc12&amp;quot;,&lt;br /&gt;
      &amp;quot;is_reaction&amp;quot;: true,&lt;br /&gt;
      &amp;quot;smartsPattern&amp;quot;: &amp;quot;[#7:1].[#8]-[#6:2](=O)&amp;gt;&amp;gt;[#7:1]-[#6:2](=O)&amp;quot;,&lt;br /&gt;
      &amp;quot;children&amp;quot;:&lt;br /&gt;
      [&lt;br /&gt;
        {&lt;br /&gt;
          &amp;quot;smiles&amp;quot;: &amp;quot;Cn1nc(C(O)=O)c2ccccc12&amp;quot;,&lt;br /&gt;
          &amp;quot;is_chemical&amp;quot;: true,&lt;br /&gt;
          &amp;quot;children&amp;quot;: []&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
          &amp;quot;smiles&amp;quot;: &amp;quot;CN1C2CCCC1CC(N)C2&amp;quot;,&lt;br /&gt;
          &amp;quot;is_chemical&amp;quot;: true,&lt;br /&gt;
          &amp;quot;children&amp;quot;: []&lt;br /&gt;
        }&lt;br /&gt;
      ]&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;How to create this tree?&lt;br /&gt;
&lt;br /&gt;
=== Configuration file ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;All additional settings of Synthesia can be specified in a configuration file. This file is optional and the user does not have to use it. If both the configuration file as well as command line parameters are used to define parameters, the settings parsed via command line overwrite settings defined in the configuration file. The configuration file has to be in valid standard JSON format. An example configuration file is bundled with Synthesia.&amp;lt;/blockquote&amp;gt;So far I&#039;ve been using only command line parameters.&lt;br /&gt;
&lt;br /&gt;
=== Running ===&lt;br /&gt;
&amp;lt;code&amp;gt;./synthesia --inputStructures ../../Enamine-BB/2022-03_Chemspace_Building_Blocks_noRU_SMILES.smiles --retroSynTree amide_tree.json --output amide_out-ecfp.json  --threads 4 --verbosity 5 --allLeaves --useECFP 2 tanimoto 0.6 1.0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--inputStructures&amp;lt;/code&amp;gt; -- a library of BBs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--retroSynTree&amp;lt;/code&amp;gt; -- self-explanatory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--output&amp;lt;/code&amp;gt; -- output .json file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--threads&amp;lt;/code&amp;gt; -- Number of threads used for parallelization.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--allLeaves&amp;lt;/code&amp;gt; -- &#039;&#039;&#039;very important&#039;&#039;&#039;: without it you will only get suitable BBs and not final structures. The README says: &#039;&#039;Set this parameter to true if all chemical leaf nodes should be open for exchange. Either this parameter or the option allChemicals must be set or the nodeId parameter must be specified&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--useECFP&amp;lt;/code&amp;gt; -- filter analogs by ECFP. 4 parameter values are expected:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Integer&amp;gt; &amp;lt;String&amp;gt; &amp;lt;Integer&amp;gt; &amp;lt;Integer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first number equals the appended number of the FCFP. The second string parameters specifies the similarity measure method for a fingerprint comparison. Options are &#039;tanimoto&#039;, &#039;cosine&#039;, &#039;hamming&#039;, &#039;euclidean&#039;, &#039;dice.&#039; The third number specifies the minimum threshold value for the similarity fingerprint comparison and the fourth number specifies the maximum threshold value.&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
Pros of Synthesia — flexibility, multistage reactions of virtually any complexity and number of stages, fine-tuning of analog properties (No. of aromatic rings, halogens, cations, logP…).&lt;br /&gt;
&lt;br /&gt;
Cons — closed sources, steep learning curve, need to create retrosynthetic trees for each compound.&lt;br /&gt;
&lt;br /&gt;
My resume at the moment — may be interesting to look into given access to a synthetic chemistry group.&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Membrane_Modeling&amp;diff=14296</id>
		<title>Membrane Modeling</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Membrane_Modeling&amp;diff=14296"/>
		<updated>2022-06-14T02:51:31Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: added troubleshooting of MD runs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Written by Stefan Gahbauer, 2019/11/03&lt;br /&gt;
&lt;br /&gt;
In order to account for ligand desolvation and electrostatic interactions in the low-dielectric environment of the hydrophobic membrane core, a lipid-bilayer is generated around the target receptor and included in the docking score grid generation.&lt;br /&gt;
Aiming at a fast, robust and computationally effective equilibration of the lipid bilayer around the embedded transmembrane receptor, coarse-grained (CG) molecular dynamics (MD) simulations and (if needed) subsequent atomistic simulations are employed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Required software and datasets =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gromacs&#039;&#039;&#039; (v5 or newer) - Molecular Dynamics software package (http://manual.gromacs.org/)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CHARMM36m force field&#039;&#039;&#039; (http://mackerell.umaryland.edu/charmm_ff.shtml)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MARTINI&#039;&#039;&#039; Coarse-grained force field parameters(http://cgmartini.nl/)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DSSP&#039;&#039;&#039; - Secondary Structure assignment (https://swift.cmbi.umcn.nl/gv/dssp/ , https://anaconda.org/salilab/dssp)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;martinize.py&#039;&#039;&#039; - Coarse-graining atomistic protein structures (http://cgmartini.nl/index.php/tools2/proteins-and-bilayers)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;insane.py&#039;&#039;&#039; - INSerting proteins in coarse-grained MembrANE (http://cgmartini.nl/index.php/tools2/proteins-and-bilayers)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;initram.sh&#039;&#039;&#039; and &#039;&#039;&#039;backward.py&#039;&#039;&#039; - Conversion of coarse-grained system to atomistic resolution (http://cgmartini.nl/index.php/tools2/resolution-transformation)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 1) Setting up the coarse-grained system =&lt;br /&gt;
&lt;br /&gt;
This is automated in the script:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/0001-prepare-protein-CG-membrane.sh&lt;br /&gt;
&lt;br /&gt;
== 1.1) Prepare your files ==&lt;br /&gt;
&lt;br /&gt;
Copy the script above to your working directory.&lt;br /&gt;
&lt;br /&gt;
Copy your rec.pdb to your working directory.&lt;br /&gt;
&lt;br /&gt;
If your rec.pdb has gaps, e.g. unresolved loops between transmembrane helices in case of GPCRs, try to model missing residues.&lt;br /&gt;
&lt;br /&gt;
One way is to use MODELLER following https://salilab.org/modeller/wiki/Missing%20residues.&lt;br /&gt;
&lt;br /&gt;
Corresponding input scripts for modeller can be found in:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/modeller&lt;br /&gt;
&lt;br /&gt;
== 1.2) Run the script ==&lt;br /&gt;
&lt;br /&gt;
Login to gimel2.&lt;br /&gt;
&lt;br /&gt;
./0001-prepare-protein-CG-membrane.sh&lt;br /&gt;
&lt;br /&gt;
The script reads rec.pdb and copies all other required files from &lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/gromacs&lt;br /&gt;
&lt;br /&gt;
=== Workflow ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;a.&#039;&#039;&#039; Generate CHARMM36m force field parameters of your protein in a Gromacs-readable format. &lt;br /&gt;
&lt;br /&gt;
Used tool: gmx pdb2gmx &lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;pdb2gmx&#039;&#039; directory&lt;br /&gt;
&lt;br /&gt;
-conf.gro / conf.pdb - Gromacs coordinate file&lt;br /&gt;
&lt;br /&gt;
-topol.top / Protein-atomistic.itp - Gromacs topology file, i.e. force field description of your input structure&lt;br /&gt;
&lt;br /&gt;
-posre.itp - Position restraints for heavy atoms of atomistic protein strucutre.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;b.&#039;&#039;&#039; Build coarse-grained structure&lt;br /&gt;
&lt;br /&gt;
Used tool: martinize.py&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-chain_.ssd - Output from the DSSP program that is called by martinize.py&lt;br /&gt;
&lt;br /&gt;
-prot-cg.pdb - Coarse-grained protein structure&lt;br /&gt;
&lt;br /&gt;
-prot-cg.top - Coarse-grained Martini topology of system&lt;br /&gt;
&lt;br /&gt;
-Protein.itp - Coarse-grained Martini description of Protein structure&lt;br /&gt;
&lt;br /&gt;
-prot-rot.pdb - Coarse-grained protein structure aligned along z-axis of the simulation box according to the proteins first principal component axis. This ensures the correct placement of the protein during membrane preparation. &#039;&#039;&#039;You may have to adjust the orientation of your input structure prior to membrane modeling.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;c.&#039;&#039;&#039; Build coarse-grained membrane&lt;br /&gt;
&lt;br /&gt;
Used tool: insane.py&lt;br /&gt;
&lt;br /&gt;
Here, a lipid bilayer will be created around the protein structure (in the x/y-plane) and water will be added to the system. The default box shape is rectangular and the size is set to x,y=10nm, z=11nm. This can be changed in the ./insane.py command line. The default lipid type is POPC, you can change that to arbitrary lipid compositions using the -l and -u options of of insane.py.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-out.top / topol-cg.top - Topology of coarse-grained system&lt;br /&gt;
&lt;br /&gt;
-cg-membrane.gro/.pdb - Coarse-grained system coordinates. &#039;&#039;&#039;Carefully inspect and visualize the cg-membrane.pdb.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use PyMOL to check if you&#039;re protein is embedded correctly in the lipid bilayer.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 2) Simulating the coarse-grained system =&lt;br /&gt;
&lt;br /&gt;
This is automated in the script:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/0002-run-CG-Minimization-and-MD.sh&lt;br /&gt;
&lt;br /&gt;
== 2.1) Run the script ==&lt;br /&gt;
&lt;br /&gt;
Copy the script above to your working directory.&lt;br /&gt;
&lt;br /&gt;
./0002-run-CG-Minimization-and-MD.sh&lt;br /&gt;
&lt;br /&gt;
=== Workflow ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;a.&#039;&#039;&#039; Minimize coarse-grained system&lt;br /&gt;
&lt;br /&gt;
Used tools: gmx grompp , gmx mdrun&lt;br /&gt;
&lt;br /&gt;
gmx grompp generates a single .tpr file that contains all information necessary for running a MD simulation or minimization using gmx mdrun.&lt;br /&gt;
&lt;br /&gt;
Minimization parameters are provided in martini_new-rf_min.mdp. The system will be minimized in 500 steps using steepest descent. The protein structure will be frozen during minimization.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-min.tpr - MD run input file&lt;br /&gt;
&lt;br /&gt;
-min.log - Output log file from minimization&lt;br /&gt;
&lt;br /&gt;
-min.trr - Minimization trajectory&lt;br /&gt;
&lt;br /&gt;
-min.gro - Minimized system coordinates&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;b.&#039;&#039;&#039; Simulate coarse-grained system&lt;br /&gt;
&lt;br /&gt;
MD simulation parameters are provided in martini_v2.x_new-rf.mdp. Strong position restraints are applied on the protein structure during the simulation. The system will be simulated for 50ns.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-md.tpr - MD run input file&lt;br /&gt;
&lt;br /&gt;
-md.log - Output log file from simulation&lt;br /&gt;
&lt;br /&gt;
-md.trr - lossless trajectory of simulation&lt;br /&gt;
&lt;br /&gt;
-md.xtc - coordinates of simulation trajectory&lt;br /&gt;
&lt;br /&gt;
-md.gro - coordinates of final simulation snapshot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The simulation will run for roughly 3 hours.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 3) Converting coarse-grained system to atomistic resolution and select lipid atoms for grid generation =&lt;br /&gt;
&lt;br /&gt;
This is automated in the script:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/0003-backmap-and-lpd-selection.sh&lt;br /&gt;
&lt;br /&gt;
== 3.1) Run the script ==&lt;br /&gt;
&lt;br /&gt;
Copy the script above to your working directory.&lt;br /&gt;
&lt;br /&gt;
./0003-backmap-and-lpd-selection.sh&lt;br /&gt;
&lt;br /&gt;
=== Workflow ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;a.&#039;&#039;&#039; Backmapping from coarse-grained to atomistic&lt;br /&gt;
&lt;br /&gt;
Used tool: gmx trjconv, initram.sh&lt;br /&gt;
&lt;br /&gt;
gmx trjconv can perform a variety of conversions of MD trajectory, e.g. making molecules broken over the periodic boundary conditions whole again. &lt;br /&gt;
&lt;br /&gt;
initram.sh calls the backward.py program which performs the backmapping of input coarse-grained to atomistic systems, and performs a small series of short minimizations and simulations to relax the backmapped system.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;backmap&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-0-backmapped.gro / projected.gro - initial backmapped coordinates&lt;br /&gt;
&lt;br /&gt;
-backmapped.top - Topology of atomistic system&lt;br /&gt;
&lt;br /&gt;
-1-EM*/2-EM* - Output from minimizations &lt;br /&gt;
&lt;br /&gt;
-3-mdpr*/4-mdpr*/5-mdpr*/6-mdpr* - Output from simulations&lt;br /&gt;
&lt;br /&gt;
-backmapped.gro - Coordinates of final backmapped and relaxed system&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This may need a few attempts to work all the way through. There is a while-loop that only stops until all relaxation steps have finished.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;b.&#039;&#039;&#039; Replacing backmapped protein with initial atomistic protein structure&lt;br /&gt;
&lt;br /&gt;
Used tool: PyMOL script align.pml&lt;br /&gt;
&lt;br /&gt;
The pymol script will align the initial &amp;quot;Gromacs&amp;quot;-protein structure (conf.pdb) onto the backmapped structure and combine the fitted protein coordinates with the coordinates of the lipid and solvent environment.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;backmap/prepare_AA_system&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-conf-fitted.pdb - Fitted initial protein structure&lt;br /&gt;
&lt;br /&gt;
-backmapped-environment.pdb - All membrane and water coordinates&lt;br /&gt;
&lt;br /&gt;
-fitted_system.pdb - Complete system containing fitted protein and environment coordinates&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure that fitted_system.pdb has the same number of coordinates as backmapped-mol.pdb.&#039;&#039;&#039; If there is a discrepancy there might be an issue with the PyMOL version you&#039;re using to run align.pml. Using PyMOL v2 or newer seems to avoid any issues. You can also generate backmapped-environment.pdb manually by taking all POPC and Water cooridnates from backmapped-mol.pdb.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;c.&#039;&#039;&#039; Run minimizations of atomistic system&lt;br /&gt;
&lt;br /&gt;
Used tools: gmx grompp, gmx mdrun&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;backmap/prepare_AA_system&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
Tow minimizations will be calculated. &lt;br /&gt;
&lt;br /&gt;
1) Minimization with frozen protein coordinates: 1,500 steps steepest descent (min_freeze.mdp).&lt;br /&gt;
&lt;br /&gt;
-min_freeze* - Output files of first minimization&lt;br /&gt;
&lt;br /&gt;
2) Minimization of full system: 500 steps (min.mdp).&lt;br /&gt;
&lt;br /&gt;
-min* - Output files of second minimization&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;d.&#039;&#039;&#039; Select lipid atoms for DOCK grid generation&lt;br /&gt;
&lt;br /&gt;
Used tools: PyMOL script prepare.pml&lt;br /&gt;
&lt;br /&gt;
This will select carbon and hydrogen atoms of the hydrophobic lipid tail segments in a radius of 1.7 nm around the protein and assign them to the atom type &amp;quot;LPD&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You need to provide the rec.pdb to want to use for docking (potentially with missing loops) at that step as xtal-prot.pdb&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;backmap/prepare_AA_system/prepare_min&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-shell-LPD.pdb - all LPD atoms selected for grid generation&lt;br /&gt;
&lt;br /&gt;
Add these coordinates to your docking protein structure and provide a amb.crg.oxt file adding&lt;br /&gt;
&lt;br /&gt;
C     lpd        0.000     LIPID SPHERE&lt;br /&gt;
&lt;br /&gt;
Now you can run blastermaster.&lt;br /&gt;
&lt;br /&gt;
= Membrane modelling in Schrodinger =&lt;br /&gt;
Written by Andrii Kyrylchuk, 2022/04/20&lt;br /&gt;
&lt;br /&gt;
== MD of protein and membrane ==&lt;br /&gt;
Import structure &#039;&#039;&#039;without&#039;&#039;&#039; ligand, use &amp;lt;u&amp;gt;Preparation wizard&amp;lt;/u&amp;gt; as described in &amp;quot;Code for Controls...&amp;quot;  to model missing loops and capping.&lt;br /&gt;
&lt;br /&gt;
Then open &amp;lt;u&amp;gt;System Builder&amp;lt;/u&amp;gt;, click &amp;lt;code&amp;gt;Setup membrane&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to the website https://opm.phar.umich.edu/proteins/ and find your protein. Copy residue numbers from the bottom of the page to the field &amp;lt;code&amp;gt;Transmembrane atoms...&amp;lt;/code&amp;gt;. The format is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;res.num 76-97,112-136,141,...&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click &amp;lt;code&amp;gt;Place Automatically&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt;. Then click &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt;. Examine lipids and solvent after run completes.&lt;br /&gt;
&lt;br /&gt;
Then use &amp;lt;u&amp;gt;Molecular Dynamics&amp;lt;/u&amp;gt; menu to set up the calculation. Select prepared system, click &amp;lt;code&amp;gt;Load&amp;lt;/code&amp;gt; on top of the menu. Put simulation time of 5 ns, &amp;lt;code&amp;gt;Advanced Options&amp;lt;/code&amp;gt; -- &amp;lt;code&amp;gt;Restraints&amp;lt;/code&amp;gt; -- &amp;lt;code&amp;gt;Add.&amp;lt;/code&amp;gt; Select protein, and put &amp;lt;code&amp;gt;Force Constant&amp;lt;/code&amp;gt; of 100, click &amp;lt;code&amp;gt;Apply&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;OK.&amp;lt;/code&amp;gt; Then click down arrow left of the &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt; button in the parent window and click &amp;lt;code&amp;gt;Write&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;NOTE&#039;&#039;&#039;: In my experience, restrained MD runs with NgPT in Schrodinger often fail with the following message:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&#039;&#039;Allowed momentum exceeded on 17 particles.&#039;&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This seems to be related to the interference of restraints and the ensemble, as no such error is observed if no restraints are imposed, or if NVT ensemble is used. Still, NgPT ensemble is important for correct membrane sampling, because simulations at NVT long enough to permit membrane relaxation, lead to the smearing of the lipid bilayer and the formation of empty space.&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;If the mentioned problem occurs, import the last coordinates of the run (*-out.cms) into Maestro, open Minimization menu, load the structure from the workspace, and apply restraints on lipid and protein (force restraint of 10 is usually enough). Then run a minimization for 100 ps, and try to run NgPT MD starting from the optimized structure.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;TO CHECK&#039;&#039;&#039;: NPT ensemble.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Copy the project folder (desmond_md_job_X) to gimel, login to &amp;lt;u&amp;gt;gimel5&amp;lt;/u&amp;gt;, edit desmond_md_job_X.sh: delete &amp;lt;code&amp;gt;-lic DESMOND_GPGPU:16&amp;lt;/code&amp;gt; and insert &amp;lt;code&amp;gt;-HOST gimel5.gpu&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;gimel5.heavygpu&amp;lt;/code&amp;gt;). Run .sh file, and your task will be submitted to a queue. For my system it took 1.5 hr to complete.&lt;br /&gt;
&lt;br /&gt;
Download the project folder to your PC, open Maestro, click &amp;lt;code&amp;gt;Import  structure&amp;lt;/code&amp;gt; and open &amp;lt;code&amp;gt;-out.cms&amp;lt;/code&amp;gt;, click on &amp;lt;code&amp;gt;T&amp;lt;/code&amp;gt; icon at the new entry in project table and click &amp;lt;code&amp;gt;Display Trajectory Snapshots&amp;lt;/code&amp;gt;. Select the last one, click &amp;lt;code&amp;gt;Display&amp;lt;/code&amp;gt; and check if the protein did not change position during MD run, then click &amp;lt;code&amp;gt;Export&amp;lt;/code&amp;gt;, to Project Table, Frames Selected only. You will get a new entry in the Project Table. Export it to a &amp;lt;code&amp;gt;.pdb&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
== Preparation of the structure for Blastermaster ==&lt;br /&gt;
Use &amp;lt;code&amp;gt;prepare.pml&amp;lt;/code&amp;gt; script. You need to provide the &amp;lt;code&amp;gt;rec.pdb&amp;lt;/code&amp;gt; to want to use for docking (potentially with missing loops) at that step as &amp;lt;code&amp;gt;xtal-prot.pdb&amp;lt;/code&amp;gt;. Rename MD system as &amp;lt;code&amp;gt;last-mol.pdb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;pymol -qc last-mol.pdb xtal-prot.pdb prepare.pml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
align last-mol, xtal-prot&lt;br /&gt;
&lt;br /&gt;
remove ////SPC&lt;br /&gt;
&lt;br /&gt;
create MEM, ////POPC&lt;br /&gt;
&lt;br /&gt;
# these atom numbers do not exist in POPC or DPPC&lt;br /&gt;
# therefore, we do not remove protons from the lipid&lt;br /&gt;
# structure to make more spheres. Uncomment these&lt;br /&gt;
# lines and change to proper H numbers if needed.&lt;br /&gt;
#remove /MEM////HS&lt;br /&gt;
#remove /MEM////HX&lt;br /&gt;
#remove /MEM////HY&lt;br /&gt;
#remove /MEM////H*B&lt;br /&gt;
#remove /MEM////H*A&lt;br /&gt;
#remove /MEM////H*C&lt;br /&gt;
&lt;br /&gt;
remove /MEM////C1&lt;br /&gt;
remove /MEM////C2&lt;br /&gt;
remove /MEM////C3&lt;br /&gt;
remove /MEM////C11&lt;br /&gt;
remove /MEM////C12&lt;br /&gt;
remove /MEM////C13&lt;br /&gt;
remove /MEM////C14&lt;br /&gt;
remove /MEM////C15&lt;br /&gt;
&lt;br /&gt;
create MEM_C, /MEM////*C* | /MEM////H*R | /MEM////H*S | /MEM////H*T | /MEM////H*X | /MEM////H*Y | /MEM////H*Z&lt;br /&gt;
&lt;br /&gt;
create shell, MEM_C within 20 of xtal-prot&lt;br /&gt;
&lt;br /&gt;
set retain_order, 1&lt;br /&gt;
&lt;br /&gt;
save shell.pdb, shell&lt;br /&gt;
&lt;br /&gt;
alter shell, resn=&#039;LPD&#039;&lt;br /&gt;
alter shell, name=&#039;C&#039;&lt;br /&gt;
alter shell, chain=&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
rebuild&lt;br /&gt;
&lt;br /&gt;
save shell-LPD.pdb, shell&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Preparation of grids with thinspheres ==&lt;br /&gt;
Prepare grids with thinspheres for the protein without lipid as described in https://wiki.docking.org/index.php/How_to_do_parameter_scanning&lt;br /&gt;
&lt;br /&gt;
Create an empty directory and put &amp;lt;code&amp;gt;shell-LPD.pdb&amp;lt;/code&amp;gt; there. Then run the following script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sh blast-membrane-thinsph-scan.sh {path to the collection of &amp;quot;es_ld_thin_sph_rad_X.X&amp;quot; directories} {path to the dir with original working and dockfiles directories}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script runs qnifft and solvmap for each &amp;lt;code&amp;gt;es_ld_thin_sph_rad_X.X&amp;lt;/code&amp;gt; directory, and then uses the second script of parameter scanning protocol to combine files into &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; directories.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important! LOOK AT YOUR GRIDS! Desolvation -- larger solvation where water is. Electrostatics -- no electrostatics in the lipid region. vdW -- no vdW in the lipid region.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# a script to prepare a protein with the lipid membrane for DOCK with thinsphere scan&lt;br /&gt;
# PREREQ -- run first step of https://wiki.docking.org/index.php/How_to_do_parameter_scanning (new_0001_generate_ES_LD_generation.py )&lt;br /&gt;
# first argument -- path to the directory where dirs &amp;quot;es_ld_thin_sph_rad_X.X&amp;quot; are stored. &lt;br /&gt;
# second argument -- path to the dir with original working and dockfiles&lt;br /&gt;
# run in a new directory with shell-LPD.pdb&lt;br /&gt;
&lt;br /&gt;
run_once () {&lt;br /&gt;
# mkdir  add_membrane&lt;br /&gt;
# Run qnifft for electrostatic grids&lt;br /&gt;
# cp $blastfiles_membrane/shell-LPD.pdb&lt;br /&gt;
# delete all fields except HETATM from shell-LPD.pdb&lt;br /&gt;
cp $curr_dir/shell-LPD.pdb .&lt;br /&gt;
sed -ir &#039;/^CRYST1/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^CONECT/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^END/d&#039; shell-LPD.pdb&lt;br /&gt;
cp $blastermaster_Prot/working/rec.crg.pdb .&lt;br /&gt;
#cp $blastermaster_Prot/working/lowdielectric.sph.pdb # (if wanted, if you run a  parameter scan, be sure to use the correct spheres!)&lt;br /&gt;
#cp -r $blastermaster_Prot/dockfiles .&lt;br /&gt;
#cp -r $blastermaster_Prot/INDOCK .&lt;br /&gt;
mv rec.crg.pdb  rec.crg.solo.pdb&lt;br /&gt;
cat rec.crg.solo.pdb shell-LPD.pdb  &amp;gt; receptor.crg.lowdielectric.pdb&lt;br /&gt;
# extracting SPH lines from receptor&lt;br /&gt;
number=$(grep -n  SPH  $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb | head -n 1 | awk -F &amp;quot;:&amp;quot; &#039;{print $1}&#039;)&lt;br /&gt;
tail --lines=+$number $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb &amp;gt;&amp;gt; receptor.crg.lowdielectric.pdb&lt;br /&gt;
need_files=&amp;quot;amb.crg.oxt&lt;br /&gt;
qnifft.parm&lt;br /&gt;
vdw.siz&amp;quot;&lt;br /&gt;
for file in $need_files&lt;br /&gt;
do&lt;br /&gt;
	if [ -e $blastermaster_Prot/working/$file ]&lt;br /&gt;
	then&lt;br /&gt;
		cp $blastermaster_Prot/working/$file .&lt;br /&gt;
	else&lt;br /&gt;
		cp $blast_orig/working/$file .&lt;br /&gt;
	fi&lt;br /&gt;
done&lt;br /&gt;
echo &amp;quot;C     lpd        0.000     LIPID SPHERE&amp;quot; &amp;gt;&amp;gt; amb.crg.oxt&lt;br /&gt;
cp $blastermaster_Prot/working/box .&lt;br /&gt;
cp $blastermaster_Prot/working/qnifft.parm .&lt;br /&gt;
cp $blastermaster_Prot/working/vdw.siz .&lt;br /&gt;
$DOCKBASE/proteins/qnifft/bin/qnifft22_193_pgf_32 qnifft.parm &amp;gt;&amp;amp; qnifft.log&lt;br /&gt;
$DOCKBASE/proteins/blastermaster/phiTrim.py qnifft.electrostatics.phi box trim.electrostatics.phi &amp;gt;&amp;amp; trim.log&lt;br /&gt;
&lt;br /&gt;
#cp trim.electrostatics.phi dockfiles/.&lt;br /&gt;
&lt;br /&gt;
# Check if the grid size changed:&lt;br /&gt;
#echo &amp;quot;Check if the grid size changed, compare this with INDOCK&amp;quot;&lt;br /&gt;
#python ~jklyu/zzz.script/pymol_movie/phi_to_dx.py trim.electrostatics.phi trim.electrostatics.phi.dx &amp;gt; gridsize&lt;br /&gt;
#head -n 1 gridsize&lt;br /&gt;
# compare with delphi_nsize in INDOCK&lt;br /&gt;
&lt;br /&gt;
# Run solvmap for Ligand Desolvation Grids if they are present in the folder&lt;br /&gt;
if [ -e $blastermaster_Prot/working/heavy ]&lt;br /&gt;
then&lt;br /&gt;
	mkdir heavy&lt;br /&gt;
	cd heavy || exit&lt;br /&gt;
	cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
	cp ../box .&lt;br /&gt;
	cp $blastermaster_Prot/working/heavy/INSEV .&lt;br /&gt;
	$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
	#cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
	cd ../ || exit&lt;br /&gt;
&lt;br /&gt;
	mkdir hydrogen&lt;br /&gt;
	cd hydrogen || exit&lt;br /&gt;
	cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
	cp ../box .&lt;br /&gt;
	cp $blastermaster_Prot/working/hydrogen/INSEV .&lt;br /&gt;
	$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
	#cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
fi&lt;br /&gt;
echo $dir &amp;quot; DONE!&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
curr_dir=$(pwd)&lt;br /&gt;
workdirs=$1&lt;br /&gt;
blast_orig=$2&lt;br /&gt;
dirs=$(ls -d $workdirs/es_ld_thin_sph_rad_*)&lt;br /&gt;
for dir in $dirs&lt;br /&gt;
do&lt;br /&gt;
	blastermaster_Prot=$dir&lt;br /&gt;
	local_dir=$(echo $dir | awk -F&amp;quot;\/&amp;quot; &#039;{print $NF}&#039;)&lt;br /&gt;
	mkdir -p $local_dir/working&lt;br /&gt;
	cd $local_dir/working || exit&lt;br /&gt;
	run_once&lt;br /&gt;
	cd $curr_dir || exit&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
python ~rstein/zzz.scripts/DOCK_prep_scripts/new_0002_combine_es_ld_grids_into_combos.py -p $blast_orig&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running blastermaster with default parameters ==&lt;br /&gt;
&#039;&#039;&#039;Warning! Do not use these grids, as the default grids with lipid spheres give incorrect solvation energies. Use the ones with thinspheres instead!&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# a script to prepare a protein with the lipid membrane for DOCK &lt;br /&gt;
# first argument -- path to blastermaster files of the protein without membrane&lt;br /&gt;
# run in a new directory with shell-LPD.pdb&lt;br /&gt;
blastermaster_Prot=$1&lt;br /&gt;
# mkdir  add_membrane&lt;br /&gt;
# Run qnifft for electrostatic grids&lt;br /&gt;
# cp $blastfiles_membrane/shell-LPD.pdb&lt;br /&gt;
# delete all fields except HETATM from shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^CRYST1/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^CONECT/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^END/d&#039; shell-LPD.pdb&lt;br /&gt;
cp $blastermaster_Prot/working/rec.crg.pdb .&lt;br /&gt;
#cp $blastermaster_Prot/working/lowdielectric.sph.pdb # (if wanted, if you run a  parameter scan, be sure to use the correct spheres!)&lt;br /&gt;
cp -r $blastermaster_Prot/dockfiles .&lt;br /&gt;
cp -r $blastermaster_Prot/INDOCK .&lt;br /&gt;
mv rec.crg.pdb  rec.crg.solo.pdb&lt;br /&gt;
cat rec.crg.solo.pdb shell-LPD.pdb  &amp;gt; receptor.crg.lowdielectric.pdb&lt;br /&gt;
# extracting SPH lines from receptor&lt;br /&gt;
number=$(grep -n  SPH  $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb | head -n 1 | awk -F &amp;quot;:&amp;quot; &#039;{print $1}&#039;)&lt;br /&gt;
tail --lines=+$number $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb &amp;gt;&amp;gt; rec.crg.lowdielectric.pdb&lt;br /&gt;
cp $blastermaster_Prot/working/amb.crg.oxt .&lt;br /&gt;
echo &amp;quot;C     lpd        0.000     LIPID SPHERE&amp;quot; &amp;gt;&amp;gt; amb.crg.oxt&lt;br /&gt;
cp $blastermaster_Prot/working/box .&lt;br /&gt;
cp $blastermaster_Prot/working/qnifft.parm .&lt;br /&gt;
cp $blastermaster_Prot/working/vdw.siz .&lt;br /&gt;
$DOCKBASE/proteins/qnifft/bin/qnifft22_193_pgf_32 qnifft.parm &amp;gt;&amp;amp; qnifft.log&lt;br /&gt;
$DOCKBASE/proteins/blastermaster/phiTrim.py qnifft.electrostatics.phi box trim.electrostatics.phi &amp;gt;&amp;amp; trim.log&lt;br /&gt;
&lt;br /&gt;
cp trim.electrostatics.phi dockfiles/.&lt;br /&gt;
&lt;br /&gt;
# Check if the grid size changed:&lt;br /&gt;
echo &amp;quot;Check if the grid size changed, compare this with INDOCK&amp;quot;&lt;br /&gt;
python ~jklyu/zzz.script/pymol_movie/phi_to_dx.py trim.electrostatics.phi trim.electrostatics.phi.dx &amp;gt; gridsize&lt;br /&gt;
head -n 1 gridsize&lt;br /&gt;
# compare with delphi_nsize in INDOCK&lt;br /&gt;
&lt;br /&gt;
# Run solvmap for Ligand Desolvation Grids&lt;br /&gt;
mkdir heavy&lt;br /&gt;
cd heavy || exit&lt;br /&gt;
cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
cp ../box .&lt;br /&gt;
cp $blastermaster_Prot/working/heavy/INSEV .&lt;br /&gt;
$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
cd ../ || exit&lt;br /&gt;
&lt;br /&gt;
mkdir hydrogen&lt;br /&gt;
cd hydroger || exit&lt;br /&gt;
cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
cp ../box .&lt;br /&gt;
cp $blastermaster_Prot/working/hydrogen/INSEV .&lt;br /&gt;
$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
echo &amp;quot;DONE!&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Lipid membrane models from MemProtMD ==&lt;br /&gt;
If a protein-membrane complex was already modeled for your system and deposited at [http://memprotmd.bioch.ox.ac.uk/home/ MemProtMD] website, you can use it and skip doing MD in Schrodinger. The steps are very similar to the ones after Schrodinger run.&lt;br /&gt;
&lt;br /&gt;
Download the &amp;lt;code&amp;gt;*_default_dppc.mpmd.finalframe.atomistic.pdb&amp;lt;/code&amp;gt; file from the bottom of the page. Rename it to &amp;lt;code&amp;gt;last-mol.pdb&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Use prepare.pml script (below). You need to provide the &amp;lt;code&amp;gt;rec.pdb&amp;lt;/code&amp;gt; to want to use for docking (potentially with missing loops) at that step as &amp;lt;code&amp;gt;xtal-prot.pdb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;pymol -qc last-mol.pdb xtal-prot.pdb prepare.pml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script below differs from the one for processing Schrodinger results in two points: solvent residue is &amp;lt;code&amp;gt;SOL&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;SPC&amp;lt;/code&amp;gt;, and lipids are called &amp;lt;code&amp;gt;DPPC&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;POPC&amp;lt;/code&amp;gt;.&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
align last-mol, xtal-prot&lt;br /&gt;
&lt;br /&gt;
remove ////SOL&lt;br /&gt;
&lt;br /&gt;
create MEM, ////DPPC&lt;br /&gt;
&lt;br /&gt;
remove /MEM////HS&lt;br /&gt;
remove /MEM////HX&lt;br /&gt;
remove /MEM////HY&lt;br /&gt;
remove /MEM////H*B&lt;br /&gt;
remove /MEM////H*A&lt;br /&gt;
remove /MEM////H*C&lt;br /&gt;
&lt;br /&gt;
remove /MEM////C1&lt;br /&gt;
remove /MEM////C2&lt;br /&gt;
remove /MEM////C3&lt;br /&gt;
remove /MEM////C11&lt;br /&gt;
remove /MEM////C12&lt;br /&gt;
remove /MEM////C13&lt;br /&gt;
remove /MEM////C14&lt;br /&gt;
remove /MEM////C15&lt;br /&gt;
&lt;br /&gt;
create MEM_C, /MEM////*C* | /MEM////H*R | /MEM////H*S | /MEM////H*T | /MEM////H*X | /MEM////H*Y | /MEM////H*Z&lt;br /&gt;
&lt;br /&gt;
create shell, MEM_C within 20 of xtal-prot&lt;br /&gt;
&lt;br /&gt;
set retain_order, 1&lt;br /&gt;
&lt;br /&gt;
save shell.pdb, shell&lt;br /&gt;
&lt;br /&gt;
alter shell, resn=&#039;LPD&#039;&lt;br /&gt;
alter shell, name=&#039;C&#039;&lt;br /&gt;
alter shell, chain=&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
rebuild&lt;br /&gt;
&lt;br /&gt;
save shell-LPD.pdb, shell&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Conversion_of_.rxn_files_to_reaction_SMARTS&amp;diff=14243</id>
		<title>Conversion of .rxn files to reaction SMARTS</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Conversion_of_.rxn_files_to_reaction_SMARTS&amp;diff=14243"/>
		<updated>2022-06-06T21:14:39Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: Created page with &amp;quot;DataWarrior folks have implemented enumeration protocol in their soft. It is published in 10.1021/acs.jcim.1c01041  They store reactions in .rxn format, which is documented in...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;DataWarrior folks have implemented enumeration protocol in their soft. It is published in 10.1021/acs.jcim.1c01041&lt;br /&gt;
&lt;br /&gt;
They store reactions in .rxn format, which is documented in https://docs.chemaxon.com/display/docs/mdl-molfiles-rgfiles-sdfiles-rxnfiles-rdfiles-formats.md. The files can be found in &amp;quot;reactions&amp;quot; directory in https://github.com/joewah/Virtual-Fragment-Spaces&lt;br /&gt;
&lt;br /&gt;
The .rxn files can be opened in ChemAxon MarvinSketch. Then just select the reaction, right click, Copy as -- Daylight SMARTS. And you get the correct SMARTS with all atom lists. For example, for amidation reaction I got&lt;br /&gt;
&lt;br /&gt;
[#7,#8]-[#7H1:1](-[#6:2]=[#7,#8,#16])-[#6,#16]=[#7,#8,#16].[#6:3]-[#6:4](-[#8,#17;D1])=[O:5]&amp;gt;&amp;gt;[#6:2]-[#7:1]-[#6:4](-[#6:3])=[O:5]&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Membrane_Modeling&amp;diff=14174</id>
		<title>Membrane Modeling</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Membrane_Modeling&amp;diff=14174"/>
		<updated>2022-04-26T06:53:58Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: changed Pymol script: Hs are not removed from lipids&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Written by Stefan Gahbauer, 2019/11/03&lt;br /&gt;
&lt;br /&gt;
In order to account for ligand desolvation and electrostatic interactions in the low-dielectric environment of the hydrophobic membrane core, a lipid-bilayer is generated around the target receptor and included in the docking score grid generation.&lt;br /&gt;
Aiming at a fast, robust and computationally effective equilibration of the lipid bilayer around the embedded transmembrane receptor, coarse-grained (CG) molecular dynamics (MD) simulations and (if needed) subsequent atomistic simulations are employed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Required software and datasets =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gromacs&#039;&#039;&#039; (v5 or newer) - Molecular Dynamics software package (http://manual.gromacs.org/)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CHARMM36m force field&#039;&#039;&#039; (http://mackerell.umaryland.edu/charmm_ff.shtml)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MARTINI&#039;&#039;&#039; Coarse-grained force field parameters(http://cgmartini.nl/)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DSSP&#039;&#039;&#039; - Secondary Structure assignment (https://swift.cmbi.umcn.nl/gv/dssp/ , https://anaconda.org/salilab/dssp)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;martinize.py&#039;&#039;&#039; - Coarse-graining atomistic protein structures (http://cgmartini.nl/index.php/tools2/proteins-and-bilayers)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;insane.py&#039;&#039;&#039; - INSerting proteins in coarse-grained MembrANE (http://cgmartini.nl/index.php/tools2/proteins-and-bilayers)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;initram.sh&#039;&#039;&#039; and &#039;&#039;&#039;backward.py&#039;&#039;&#039; - Conversion of coarse-grained system to atomistic resolution (http://cgmartini.nl/index.php/tools2/resolution-transformation)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 1) Setting up the coarse-grained system =&lt;br /&gt;
&lt;br /&gt;
This is automated in the script:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/0001-prepare-protein-CG-membrane.sh&lt;br /&gt;
&lt;br /&gt;
== 1.1) Prepare your files ==&lt;br /&gt;
&lt;br /&gt;
Copy the script above to your working directory.&lt;br /&gt;
&lt;br /&gt;
Copy your rec.pdb to your working directory.&lt;br /&gt;
&lt;br /&gt;
If your rec.pdb has gaps, e.g. unresolved loops between transmembrane helices in case of GPCRs, try to model missing residues.&lt;br /&gt;
&lt;br /&gt;
One way is to use MODELLER following https://salilab.org/modeller/wiki/Missing%20residues.&lt;br /&gt;
&lt;br /&gt;
Corresponding input scripts for modeller can be found in:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/modeller&lt;br /&gt;
&lt;br /&gt;
== 1.2) Run the script ==&lt;br /&gt;
&lt;br /&gt;
Login to gimel2.&lt;br /&gt;
&lt;br /&gt;
./0001-prepare-protein-CG-membrane.sh&lt;br /&gt;
&lt;br /&gt;
The script reads rec.pdb and copies all other required files from &lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/gromacs&lt;br /&gt;
&lt;br /&gt;
=== Workflow ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;a.&#039;&#039;&#039; Generate CHARMM36m force field parameters of your protein in a Gromacs-readable format. &lt;br /&gt;
&lt;br /&gt;
Used tool: gmx pdb2gmx &lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;pdb2gmx&#039;&#039; directory&lt;br /&gt;
&lt;br /&gt;
-conf.gro / conf.pdb - Gromacs coordinate file&lt;br /&gt;
&lt;br /&gt;
-topol.top / Protein-atomistic.itp - Gromacs topology file, i.e. force field description of your input structure&lt;br /&gt;
&lt;br /&gt;
-posre.itp - Position restraints for heavy atoms of atomistic protein strucutre.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;b.&#039;&#039;&#039; Build coarse-grained structure&lt;br /&gt;
&lt;br /&gt;
Used tool: martinize.py&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-chain_.ssd - Output from the DSSP program that is called by martinize.py&lt;br /&gt;
&lt;br /&gt;
-prot-cg.pdb - Coarse-grained protein structure&lt;br /&gt;
&lt;br /&gt;
-prot-cg.top - Coarse-grained Martini topology of system&lt;br /&gt;
&lt;br /&gt;
-Protein.itp - Coarse-grained Martini description of Protein structure&lt;br /&gt;
&lt;br /&gt;
-prot-rot.pdb - Coarse-grained protein structure aligned along z-axis of the simulation box according to the proteins first principal component axis. This ensures the correct placement of the protein during membrane preparation. &#039;&#039;&#039;You may have to adjust the orientation of your input structure prior to membrane modeling.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;c.&#039;&#039;&#039; Build coarse-grained membrane&lt;br /&gt;
&lt;br /&gt;
Used tool: insane.py&lt;br /&gt;
&lt;br /&gt;
Here, a lipid bilayer will be created around the protein structure (in the x/y-plane) and water will be added to the system. The default box shape is rectangular and the size is set to x,y=10nm, z=11nm. This can be changed in the ./insane.py command line. The default lipid type is POPC, you can change that to arbitrary lipid compositions using the -l and -u options of of insane.py.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-out.top / topol-cg.top - Topology of coarse-grained system&lt;br /&gt;
&lt;br /&gt;
-cg-membrane.gro/.pdb - Coarse-grained system coordinates. &#039;&#039;&#039;Carefully inspect and visualize the cg-membrane.pdb.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use PyMOL to check if you&#039;re protein is embedded correctly in the lipid bilayer.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 2) Simulating the coarse-grained system =&lt;br /&gt;
&lt;br /&gt;
This is automated in the script:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/0002-run-CG-Minimization-and-MD.sh&lt;br /&gt;
&lt;br /&gt;
== 2.1) Run the script ==&lt;br /&gt;
&lt;br /&gt;
Copy the script above to your working directory.&lt;br /&gt;
&lt;br /&gt;
./0002-run-CG-Minimization-and-MD.sh&lt;br /&gt;
&lt;br /&gt;
=== Workflow ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;a.&#039;&#039;&#039; Minimize coarse-grained system&lt;br /&gt;
&lt;br /&gt;
Used tools: gmx grompp , gmx mdrun&lt;br /&gt;
&lt;br /&gt;
gmx grompp generates a single .tpr file that contains all information necessary for running a MD simulation or minimization using gmx mdrun.&lt;br /&gt;
&lt;br /&gt;
Minimization parameters are provided in martini_new-rf_min.mdp. The system will be minimized in 500 steps using steepest descent. The protein structure will be frozen during minimization.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-min.tpr - MD run input file&lt;br /&gt;
&lt;br /&gt;
-min.log - Output log file from minimization&lt;br /&gt;
&lt;br /&gt;
-min.trr - Minimization trajectory&lt;br /&gt;
&lt;br /&gt;
-min.gro - Minimized system coordinates&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;b.&#039;&#039;&#039; Simulate coarse-grained system&lt;br /&gt;
&lt;br /&gt;
MD simulation parameters are provided in martini_v2.x_new-rf.mdp. Strong position restraints are applied on the protein structure during the simulation. The system will be simulated for 50ns.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-md.tpr - MD run input file&lt;br /&gt;
&lt;br /&gt;
-md.log - Output log file from simulation&lt;br /&gt;
&lt;br /&gt;
-md.trr - lossless trajectory of simulation&lt;br /&gt;
&lt;br /&gt;
-md.xtc - coordinates of simulation trajectory&lt;br /&gt;
&lt;br /&gt;
-md.gro - coordinates of final simulation snapshot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The simulation will run for roughly 3 hours.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 3) Converting coarse-grained system to atomistic resolution and select lipid atoms for grid generation =&lt;br /&gt;
&lt;br /&gt;
This is automated in the script:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/0003-backmap-and-lpd-selection.sh&lt;br /&gt;
&lt;br /&gt;
== 3.1) Run the script ==&lt;br /&gt;
&lt;br /&gt;
Copy the script above to your working directory.&lt;br /&gt;
&lt;br /&gt;
./0003-backmap-and-lpd-selection.sh&lt;br /&gt;
&lt;br /&gt;
=== Workflow ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;a.&#039;&#039;&#039; Backmapping from coarse-grained to atomistic&lt;br /&gt;
&lt;br /&gt;
Used tool: gmx trjconv, initram.sh&lt;br /&gt;
&lt;br /&gt;
gmx trjconv can perform a variety of conversions of MD trajectory, e.g. making molecules broken over the periodic boundary conditions whole again. &lt;br /&gt;
&lt;br /&gt;
initram.sh calls the backward.py program which performs the backmapping of input coarse-grained to atomistic systems, and performs a small series of short minimizations and simulations to relax the backmapped system.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;backmap&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-0-backmapped.gro / projected.gro - initial backmapped coordinates&lt;br /&gt;
&lt;br /&gt;
-backmapped.top - Topology of atomistic system&lt;br /&gt;
&lt;br /&gt;
-1-EM*/2-EM* - Output from minimizations &lt;br /&gt;
&lt;br /&gt;
-3-mdpr*/4-mdpr*/5-mdpr*/6-mdpr* - Output from simulations&lt;br /&gt;
&lt;br /&gt;
-backmapped.gro - Coordinates of final backmapped and relaxed system&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This may need a few attempts to work all the way through. There is a while-loop that only stops until all relaxation steps have finished.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;b.&#039;&#039;&#039; Replacing backmapped protein with initial atomistic protein structure&lt;br /&gt;
&lt;br /&gt;
Used tool: PyMOL script align.pml&lt;br /&gt;
&lt;br /&gt;
The pymol script will align the initial &amp;quot;Gromacs&amp;quot;-protein structure (conf.pdb) onto the backmapped structure and combine the fitted protein coordinates with the coordinates of the lipid and solvent environment.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;backmap/prepare_AA_system&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-conf-fitted.pdb - Fitted initial protein structure&lt;br /&gt;
&lt;br /&gt;
-backmapped-environment.pdb - All membrane and water coordinates&lt;br /&gt;
&lt;br /&gt;
-fitted_system.pdb - Complete system containing fitted protein and environment coordinates&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure that fitted_system.pdb has the same number of coordinates as backmapped-mol.pdb.&#039;&#039;&#039; If there is a discrepancy there might be an issue with the PyMOL version you&#039;re using to run align.pml. Using PyMOL v2 or newer seems to avoid any issues. You can also generate backmapped-environment.pdb manually by taking all POPC and Water cooridnates from backmapped-mol.pdb.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;c.&#039;&#039;&#039; Run minimizations of atomistic system&lt;br /&gt;
&lt;br /&gt;
Used tools: gmx grompp, gmx mdrun&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;backmap/prepare_AA_system&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
Tow minimizations will be calculated. &lt;br /&gt;
&lt;br /&gt;
1) Minimization with frozen protein coordinates: 1,500 steps steepest descent (min_freeze.mdp).&lt;br /&gt;
&lt;br /&gt;
-min_freeze* - Output files of first minimization&lt;br /&gt;
&lt;br /&gt;
2) Minimization of full system: 500 steps (min.mdp).&lt;br /&gt;
&lt;br /&gt;
-min* - Output files of second minimization&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;d.&#039;&#039;&#039; Select lipid atoms for DOCK grid generation&lt;br /&gt;
&lt;br /&gt;
Used tools: PyMOL script prepare.pml&lt;br /&gt;
&lt;br /&gt;
This will select carbon and hydrogen atoms of the hydrophobic lipid tail segments in a radius of 1.7 nm around the protein and assign them to the atom type &amp;quot;LPD&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You need to provide the rec.pdb to want to use for docking (potentially with missing loops) at that step as xtal-prot.pdb&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;backmap/prepare_AA_system/prepare_min&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-shell-LPD.pdb - all LPD atoms selected for grid generation&lt;br /&gt;
&lt;br /&gt;
Add these coordinates to your docking protein structure and provide a amb.crg.oxt file adding&lt;br /&gt;
&lt;br /&gt;
C     lpd        0.000     LIPID SPHERE&lt;br /&gt;
&lt;br /&gt;
Now you can run blastermaster.&lt;br /&gt;
&lt;br /&gt;
= Membrane modelling in Schrodinger =&lt;br /&gt;
Written by Andrii Kyrylchuk, 2022/04/20&lt;br /&gt;
&lt;br /&gt;
== MD of protein and membrane ==&lt;br /&gt;
Import structure &#039;&#039;&#039;without&#039;&#039;&#039; ligand, use &amp;lt;u&amp;gt;Preparation wizard&amp;lt;/u&amp;gt; as described in &amp;quot;Code for Controls...&amp;quot;  to model missing loops and capping.&lt;br /&gt;
&lt;br /&gt;
Then open &amp;lt;u&amp;gt;System Builder&amp;lt;/u&amp;gt;, click &amp;lt;code&amp;gt;Setup membrane&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to the website https://opm.phar.umich.edu/proteins/ and find your protein. Copy residue numbers from the bottom of the page to the field &amp;lt;code&amp;gt;Transmembrane atoms...&amp;lt;/code&amp;gt;. The format is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;res.num 76-97,112-136,141,...&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click &amp;lt;code&amp;gt;Place Automatically&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt;. Then click &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt;. Examine lipids and solvent after run completes.&lt;br /&gt;
&lt;br /&gt;
Then use &amp;lt;u&amp;gt;Molecular Dynamics&amp;lt;/u&amp;gt; menu to set up the calculation. Select prepared system, click &amp;lt;code&amp;gt;Load&amp;lt;/code&amp;gt; on top of the menu. Put simulation time of 5 ns, &amp;lt;code&amp;gt;Advanced Options&amp;lt;/code&amp;gt; -- &amp;lt;code&amp;gt;Restraints&amp;lt;/code&amp;gt; -- &amp;lt;code&amp;gt;Add.&amp;lt;/code&amp;gt; Select protein, and put &amp;lt;code&amp;gt;Force Constant&amp;lt;/code&amp;gt; of 100, click &amp;lt;code&amp;gt;Apply&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;OK.&amp;lt;/code&amp;gt; Then click down arrow left of the &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt; button in the parent window and click &amp;lt;code&amp;gt;Write&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Copy the project folder (desmond_md_job_X) to gimel, login to &amp;lt;u&amp;gt;gimel5&amp;lt;/u&amp;gt;, edit desmond_md_job_X.sh: delete &amp;lt;code&amp;gt;-lic DESMOND_GPGPU:16&amp;lt;/code&amp;gt; and insert &amp;lt;code&amp;gt;-HOST gimel5.gpu&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;gimel5.heavygpu&amp;lt;/code&amp;gt;). Run .sh file, and your task will be submitted to a queue. For my system it took 1.5 hr to complete.&lt;br /&gt;
&lt;br /&gt;
Download the project folder to your PC, open Maestro, click &amp;lt;code&amp;gt;Import  structure&amp;lt;/code&amp;gt; and open &amp;lt;code&amp;gt;-out.cms&amp;lt;/code&amp;gt;, click on &amp;lt;code&amp;gt;T&amp;lt;/code&amp;gt; icon at the new entry in project table and click &amp;lt;code&amp;gt;Display Trajectory Snapshots&amp;lt;/code&amp;gt;. Select the last one, click &amp;lt;code&amp;gt;Display&amp;lt;/code&amp;gt; and check if the protein did not change position during MD run, then click &amp;lt;code&amp;gt;Export&amp;lt;/code&amp;gt;, to Project Table, Frames Selected only. You will get a new entry in the Project Table. Export it to a &amp;lt;code&amp;gt;.pdb&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
== Preparation of the structure for Blastermaster ==&lt;br /&gt;
Use &amp;lt;code&amp;gt;prepare.pml&amp;lt;/code&amp;gt; script. You need to provide the &amp;lt;code&amp;gt;rec.pdb&amp;lt;/code&amp;gt; to want to use for docking (potentially with missing loops) at that step as &amp;lt;code&amp;gt;xtal-prot.pdb&amp;lt;/code&amp;gt;. Rename MD system as &amp;lt;code&amp;gt;last-mol.pdb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;pymol -qc last-mol.pdb xtal-prot.pdb prepare.pml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
align last-mol, xtal-prot&lt;br /&gt;
&lt;br /&gt;
remove ////SPC&lt;br /&gt;
&lt;br /&gt;
create MEM, ////POPC&lt;br /&gt;
&lt;br /&gt;
# these atom numbers do not exist in POPC or DPPC&lt;br /&gt;
# therefore, we do not remove protons from the lipid&lt;br /&gt;
# structure to make more spheres. Uncomment these&lt;br /&gt;
# lines and change to proper H numbers if needed.&lt;br /&gt;
#remove /MEM////HS&lt;br /&gt;
#remove /MEM////HX&lt;br /&gt;
#remove /MEM////HY&lt;br /&gt;
#remove /MEM////H*B&lt;br /&gt;
#remove /MEM////H*A&lt;br /&gt;
#remove /MEM////H*C&lt;br /&gt;
&lt;br /&gt;
remove /MEM////C1&lt;br /&gt;
remove /MEM////C2&lt;br /&gt;
remove /MEM////C3&lt;br /&gt;
remove /MEM////C11&lt;br /&gt;
remove /MEM////C12&lt;br /&gt;
remove /MEM////C13&lt;br /&gt;
remove /MEM////C14&lt;br /&gt;
remove /MEM////C15&lt;br /&gt;
&lt;br /&gt;
create MEM_C, /MEM////*C* | /MEM////H*R | /MEM////H*S | /MEM////H*T | /MEM////H*X | /MEM////H*Y | /MEM////H*Z&lt;br /&gt;
&lt;br /&gt;
create shell, MEM_C within 20 of xtal-prot&lt;br /&gt;
&lt;br /&gt;
set retain_order, 1&lt;br /&gt;
&lt;br /&gt;
save shell.pdb, shell&lt;br /&gt;
&lt;br /&gt;
alter shell, resn=&#039;LPD&#039;&lt;br /&gt;
alter shell, name=&#039;C&#039;&lt;br /&gt;
alter shell, chain=&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
rebuild&lt;br /&gt;
&lt;br /&gt;
save shell-LPD.pdb, shell&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Preparation of grids with thinspheres ==&lt;br /&gt;
Prepare grids with thinspheres for the protein without lipid as described in https://wiki.docking.org/index.php/How_to_do_parameter_scanning&lt;br /&gt;
&lt;br /&gt;
Create an empty directory and put &amp;lt;code&amp;gt;shell-LPD.pdb&amp;lt;/code&amp;gt; there. Then run the following script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sh blast-membrane-thinsph-scan.sh {path to the collection of &amp;quot;es_ld_thin_sph_rad_X.X&amp;quot; directories} {path to the dir with original working and dockfiles directories}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script runs qnifft and solvmap for each &amp;lt;code&amp;gt;es_ld_thin_sph_rad_X.X&amp;lt;/code&amp;gt; directory, and then uses the second script of parameter scanning protocol to combine files into &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; directories.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important! LOOK AT YOUR GRIDS! Desolvation -- larger solvation where water is. Electrostatics -- no electrostatics in the lipid region. vdW -- no vdW in the lipid region.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# a script to prepare a protein with the lipid membrane for DOCK with thinsphere scan&lt;br /&gt;
# PREREQ -- run first step of https://wiki.docking.org/index.php/How_to_do_parameter_scanning (new_0001_generate_ES_LD_generation.py )&lt;br /&gt;
# first argument -- path to the directory where dirs &amp;quot;es_ld_thin_sph_rad_X.X&amp;quot; are stored. &lt;br /&gt;
# second argument -- path to the dir with original working and dockfiles&lt;br /&gt;
# run in a new directory with shell-LPD.pdb&lt;br /&gt;
&lt;br /&gt;
run_once () {&lt;br /&gt;
# mkdir  add_membrane&lt;br /&gt;
# Run qnifft for electrostatic grids&lt;br /&gt;
# cp $blastfiles_membrane/shell-LPD.pdb&lt;br /&gt;
# delete all fields except HETATM from shell-LPD.pdb&lt;br /&gt;
cp $curr_dir/shell-LPD.pdb .&lt;br /&gt;
sed -ir &#039;/^CRYST1/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^CONECT/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^END/d&#039; shell-LPD.pdb&lt;br /&gt;
cp $blastermaster_Prot/working/rec.crg.pdb .&lt;br /&gt;
#cp $blastermaster_Prot/working/lowdielectric.sph.pdb # (if wanted, if you run a  parameter scan, be sure to use the correct spheres!)&lt;br /&gt;
#cp -r $blastermaster_Prot/dockfiles .&lt;br /&gt;
#cp -r $blastermaster_Prot/INDOCK .&lt;br /&gt;
mv rec.crg.pdb  rec.crg.solo.pdb&lt;br /&gt;
cat rec.crg.solo.pdb shell-LPD.pdb  &amp;gt; receptor.crg.lowdielectric.pdb&lt;br /&gt;
# extracting SPH lines from receptor&lt;br /&gt;
number=$(grep -n  SPH  $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb | head -n 1 | awk -F &amp;quot;:&amp;quot; &#039;{print $1}&#039;)&lt;br /&gt;
tail --lines=+$number $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb &amp;gt;&amp;gt; receptor.crg.lowdielectric.pdb&lt;br /&gt;
need_files=&amp;quot;amb.crg.oxt&lt;br /&gt;
qnifft.parm&lt;br /&gt;
vdw.siz&amp;quot;&lt;br /&gt;
for file in $need_files&lt;br /&gt;
do&lt;br /&gt;
	if [ -e $blastermaster_Prot/working/$file ]&lt;br /&gt;
	then&lt;br /&gt;
		cp $blastermaster_Prot/working/$file .&lt;br /&gt;
	else&lt;br /&gt;
		cp $blast_orig/working/$file .&lt;br /&gt;
	fi&lt;br /&gt;
done&lt;br /&gt;
echo &amp;quot;C     lpd        0.000     LIPID SPHERE&amp;quot; &amp;gt;&amp;gt; amb.crg.oxt&lt;br /&gt;
cp $blastermaster_Prot/working/box .&lt;br /&gt;
cp $blastermaster_Prot/working/qnifft.parm .&lt;br /&gt;
cp $blastermaster_Prot/working/vdw.siz .&lt;br /&gt;
$DOCKBASE/proteins/qnifft/bin/qnifft22_193_pgf_32 qnifft.parm &amp;gt;&amp;amp; qnifft.log&lt;br /&gt;
$DOCKBASE/proteins/blastermaster/phiTrim.py qnifft.electrostatics.phi box trim.electrostatics.phi &amp;gt;&amp;amp; trim.log&lt;br /&gt;
&lt;br /&gt;
#cp trim.electrostatics.phi dockfiles/.&lt;br /&gt;
&lt;br /&gt;
# Check if the grid size changed:&lt;br /&gt;
#echo &amp;quot;Check if the grid size changed, compare this with INDOCK&amp;quot;&lt;br /&gt;
#python ~jklyu/zzz.script/pymol_movie/phi_to_dx.py trim.electrostatics.phi trim.electrostatics.phi.dx &amp;gt; gridsize&lt;br /&gt;
#head -n 1 gridsize&lt;br /&gt;
# compare with delphi_nsize in INDOCK&lt;br /&gt;
&lt;br /&gt;
# Run solvmap for Ligand Desolvation Grids if they are present in the folder&lt;br /&gt;
if [ -e $blastermaster_Prot/working/heavy ]&lt;br /&gt;
then&lt;br /&gt;
	mkdir heavy&lt;br /&gt;
	cd heavy || exit&lt;br /&gt;
	cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
	cp ../box .&lt;br /&gt;
	cp $blastermaster_Prot/working/heavy/INSEV .&lt;br /&gt;
	$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
	#cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
	cd ../ || exit&lt;br /&gt;
&lt;br /&gt;
	mkdir hydrogen&lt;br /&gt;
	cd hydrogen || exit&lt;br /&gt;
	cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
	cp ../box .&lt;br /&gt;
	cp $blastermaster_Prot/working/hydrogen/INSEV .&lt;br /&gt;
	$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
	#cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
fi&lt;br /&gt;
echo $dir &amp;quot; DONE!&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
curr_dir=$(pwd)&lt;br /&gt;
workdirs=$1&lt;br /&gt;
blast_orig=$2&lt;br /&gt;
dirs=$(ls -d $workdirs/es_ld_thin_sph_rad_*)&lt;br /&gt;
for dir in $dirs&lt;br /&gt;
do&lt;br /&gt;
	blastermaster_Prot=$dir&lt;br /&gt;
	local_dir=$(echo $dir | awk -F&amp;quot;\/&amp;quot; &#039;{print $NF}&#039;)&lt;br /&gt;
	mkdir -p $local_dir/working&lt;br /&gt;
	cd $local_dir/working || exit&lt;br /&gt;
	run_once&lt;br /&gt;
	cd $curr_dir || exit&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
python ~rstein/zzz.scripts/DOCK_prep_scripts/new_0002_combine_es_ld_grids_into_combos.py -p $blast_orig&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running blastermaster with default parameters ==&lt;br /&gt;
&#039;&#039;&#039;Warning! Do not use these grids, as the default grids with lipid spheres give incorrect solvation energies. Use the ones with thinspheres instead!&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# a script to prepare a protein with the lipid membrane for DOCK &lt;br /&gt;
# first argument -- path to blastermaster files of the protein without membrane&lt;br /&gt;
# run in a new directory with shell-LPD.pdb&lt;br /&gt;
blastermaster_Prot=$1&lt;br /&gt;
# mkdir  add_membrane&lt;br /&gt;
# Run qnifft for electrostatic grids&lt;br /&gt;
# cp $blastfiles_membrane/shell-LPD.pdb&lt;br /&gt;
# delete all fields except HETATM from shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^CRYST1/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^CONECT/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^END/d&#039; shell-LPD.pdb&lt;br /&gt;
cp $blastermaster_Prot/working/rec.crg.pdb .&lt;br /&gt;
#cp $blastermaster_Prot/working/lowdielectric.sph.pdb # (if wanted, if you run a  parameter scan, be sure to use the correct spheres!)&lt;br /&gt;
cp -r $blastermaster_Prot/dockfiles .&lt;br /&gt;
cp -r $blastermaster_Prot/INDOCK .&lt;br /&gt;
mv rec.crg.pdb  rec.crg.solo.pdb&lt;br /&gt;
cat rec.crg.solo.pdb shell-LPD.pdb  &amp;gt; receptor.crg.lowdielectric.pdb&lt;br /&gt;
# extracting SPH lines from receptor&lt;br /&gt;
number=$(grep -n  SPH  $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb | head -n 1 | awk -F &amp;quot;:&amp;quot; &#039;{print $1}&#039;)&lt;br /&gt;
tail --lines=+$number $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb &amp;gt;&amp;gt; rec.crg.lowdielectric.pdb&lt;br /&gt;
cp $blastermaster_Prot/working/amb.crg.oxt .&lt;br /&gt;
echo &amp;quot;C     lpd        0.000     LIPID SPHERE&amp;quot; &amp;gt;&amp;gt; amb.crg.oxt&lt;br /&gt;
cp $blastermaster_Prot/working/box .&lt;br /&gt;
cp $blastermaster_Prot/working/qnifft.parm .&lt;br /&gt;
cp $blastermaster_Prot/working/vdw.siz .&lt;br /&gt;
$DOCKBASE/proteins/qnifft/bin/qnifft22_193_pgf_32 qnifft.parm &amp;gt;&amp;amp; qnifft.log&lt;br /&gt;
$DOCKBASE/proteins/blastermaster/phiTrim.py qnifft.electrostatics.phi box trim.electrostatics.phi &amp;gt;&amp;amp; trim.log&lt;br /&gt;
&lt;br /&gt;
cp trim.electrostatics.phi dockfiles/.&lt;br /&gt;
&lt;br /&gt;
# Check if the grid size changed:&lt;br /&gt;
echo &amp;quot;Check if the grid size changed, compare this with INDOCK&amp;quot;&lt;br /&gt;
python ~jklyu/zzz.script/pymol_movie/phi_to_dx.py trim.electrostatics.phi trim.electrostatics.phi.dx &amp;gt; gridsize&lt;br /&gt;
head -n 1 gridsize&lt;br /&gt;
# compare with delphi_nsize in INDOCK&lt;br /&gt;
&lt;br /&gt;
# Run solvmap for Ligand Desolvation Grids&lt;br /&gt;
mkdir heavy&lt;br /&gt;
cd heavy || exit&lt;br /&gt;
cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
cp ../box .&lt;br /&gt;
cp $blastermaster_Prot/working/heavy/INSEV .&lt;br /&gt;
$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
cd ../ || exit&lt;br /&gt;
&lt;br /&gt;
mkdir hydrogen&lt;br /&gt;
cd hydroger || exit&lt;br /&gt;
cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
cp ../box .&lt;br /&gt;
cp $blastermaster_Prot/working/hydrogen/INSEV .&lt;br /&gt;
$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
echo &amp;quot;DONE!&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Lipid membrane models from MemProtMD ==&lt;br /&gt;
If a protein-membrane complex was already modeled for your system and deposited at [http://memprotmd.bioch.ox.ac.uk/home/ MemProtMD] website, you can use it and skip doing MD in Schrodinger. The steps are very similar to the ones after Schrodinger run.&lt;br /&gt;
&lt;br /&gt;
Download the &amp;lt;code&amp;gt;*_default_dppc.mpmd.finalframe.atomistic.pdb&amp;lt;/code&amp;gt; file from the bottom of the page. Rename it to &amp;lt;code&amp;gt;last-mol.pdb&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Use prepare.pml script (below). You need to provide the &amp;lt;code&amp;gt;rec.pdb&amp;lt;/code&amp;gt; to want to use for docking (potentially with missing loops) at that step as &amp;lt;code&amp;gt;xtal-prot.pdb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;pymol -qc last-mol.pdb xtal-prot.pdb prepare.pml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script below differs from the one for processing Schrodinger results in two points: solvent residue is &amp;lt;code&amp;gt;SOL&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;SPC&amp;lt;/code&amp;gt;, and lipids are called &amp;lt;code&amp;gt;DPPC&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;POPC&amp;lt;/code&amp;gt;.&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
align last-mol, xtal-prot&lt;br /&gt;
&lt;br /&gt;
remove ////SOL&lt;br /&gt;
&lt;br /&gt;
create MEM, ////DPPC&lt;br /&gt;
&lt;br /&gt;
remove /MEM////HS&lt;br /&gt;
remove /MEM////HX&lt;br /&gt;
remove /MEM////HY&lt;br /&gt;
remove /MEM////H*B&lt;br /&gt;
remove /MEM////H*A&lt;br /&gt;
remove /MEM////H*C&lt;br /&gt;
&lt;br /&gt;
remove /MEM////C1&lt;br /&gt;
remove /MEM////C2&lt;br /&gt;
remove /MEM////C3&lt;br /&gt;
remove /MEM////C11&lt;br /&gt;
remove /MEM////C12&lt;br /&gt;
remove /MEM////C13&lt;br /&gt;
remove /MEM////C14&lt;br /&gt;
remove /MEM////C15&lt;br /&gt;
&lt;br /&gt;
create MEM_C, /MEM////*C* | /MEM////H*R | /MEM////H*S | /MEM////H*T | /MEM////H*X | /MEM////H*Y | /MEM////H*Z&lt;br /&gt;
&lt;br /&gt;
create shell, MEM_C within 20 of xtal-prot&lt;br /&gt;
&lt;br /&gt;
set retain_order, 1&lt;br /&gt;
&lt;br /&gt;
save shell.pdb, shell&lt;br /&gt;
&lt;br /&gt;
alter shell, resn=&#039;LPD&#039;&lt;br /&gt;
alter shell, name=&#039;C&#039;&lt;br /&gt;
alter shell, chain=&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
rebuild&lt;br /&gt;
&lt;br /&gt;
save shell-LPD.pdb, shell&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Membrane_Modeling&amp;diff=14168</id>
		<title>Membrane Modeling</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Membrane_Modeling&amp;diff=14168"/>
		<updated>2022-04-21T01:42:06Z</updated>

		<summary type="html">&lt;p&gt;Iamkaant: added protocol for MemProtMD&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Written by Stefan Gahbauer, 2019/11/03&lt;br /&gt;
&lt;br /&gt;
In order to account for ligand desolvation and electrostatic interactions in the low-dielectric environment of the hydrophobic membrane core, a lipid-bilayer is generated around the target receptor and included in the docking score grid generation.&lt;br /&gt;
Aiming at a fast, robust and computationally effective equilibration of the lipid bilayer around the embedded transmembrane receptor, coarse-grained (CG) molecular dynamics (MD) simulations and (if needed) subsequent atomistic simulations are employed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Required software and datasets =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gromacs&#039;&#039;&#039; (v5 or newer) - Molecular Dynamics software package (http://manual.gromacs.org/)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CHARMM36m force field&#039;&#039;&#039; (http://mackerell.umaryland.edu/charmm_ff.shtml)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MARTINI&#039;&#039;&#039; Coarse-grained force field parameters(http://cgmartini.nl/)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DSSP&#039;&#039;&#039; - Secondary Structure assignment (https://swift.cmbi.umcn.nl/gv/dssp/ , https://anaconda.org/salilab/dssp)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;martinize.py&#039;&#039;&#039; - Coarse-graining atomistic protein structures (http://cgmartini.nl/index.php/tools2/proteins-and-bilayers)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;insane.py&#039;&#039;&#039; - INSerting proteins in coarse-grained MembrANE (http://cgmartini.nl/index.php/tools2/proteins-and-bilayers)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;initram.sh&#039;&#039;&#039; and &#039;&#039;&#039;backward.py&#039;&#039;&#039; - Conversion of coarse-grained system to atomistic resolution (http://cgmartini.nl/index.php/tools2/resolution-transformation)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 1) Setting up the coarse-grained system =&lt;br /&gt;
&lt;br /&gt;
This is automated in the script:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/0001-prepare-protein-CG-membrane.sh&lt;br /&gt;
&lt;br /&gt;
== 1.1) Prepare your files ==&lt;br /&gt;
&lt;br /&gt;
Copy the script above to your working directory.&lt;br /&gt;
&lt;br /&gt;
Copy your rec.pdb to your working directory.&lt;br /&gt;
&lt;br /&gt;
If your rec.pdb has gaps, e.g. unresolved loops between transmembrane helices in case of GPCRs, try to model missing residues.&lt;br /&gt;
&lt;br /&gt;
One way is to use MODELLER following https://salilab.org/modeller/wiki/Missing%20residues.&lt;br /&gt;
&lt;br /&gt;
Corresponding input scripts for modeller can be found in:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/modeller&lt;br /&gt;
&lt;br /&gt;
== 1.2) Run the script ==&lt;br /&gt;
&lt;br /&gt;
Login to gimel2.&lt;br /&gt;
&lt;br /&gt;
./0001-prepare-protein-CG-membrane.sh&lt;br /&gt;
&lt;br /&gt;
The script reads rec.pdb and copies all other required files from &lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/gromacs&lt;br /&gt;
&lt;br /&gt;
=== Workflow ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;a.&#039;&#039;&#039; Generate CHARMM36m force field parameters of your protein in a Gromacs-readable format. &lt;br /&gt;
&lt;br /&gt;
Used tool: gmx pdb2gmx &lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;pdb2gmx&#039;&#039; directory&lt;br /&gt;
&lt;br /&gt;
-conf.gro / conf.pdb - Gromacs coordinate file&lt;br /&gt;
&lt;br /&gt;
-topol.top / Protein-atomistic.itp - Gromacs topology file, i.e. force field description of your input structure&lt;br /&gt;
&lt;br /&gt;
-posre.itp - Position restraints for heavy atoms of atomistic protein strucutre.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;b.&#039;&#039;&#039; Build coarse-grained structure&lt;br /&gt;
&lt;br /&gt;
Used tool: martinize.py&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-chain_.ssd - Output from the DSSP program that is called by martinize.py&lt;br /&gt;
&lt;br /&gt;
-prot-cg.pdb - Coarse-grained protein structure&lt;br /&gt;
&lt;br /&gt;
-prot-cg.top - Coarse-grained Martini topology of system&lt;br /&gt;
&lt;br /&gt;
-Protein.itp - Coarse-grained Martini description of Protein structure&lt;br /&gt;
&lt;br /&gt;
-prot-rot.pdb - Coarse-grained protein structure aligned along z-axis of the simulation box according to the proteins first principal component axis. This ensures the correct placement of the protein during membrane preparation. &#039;&#039;&#039;You may have to adjust the orientation of your input structure prior to membrane modeling.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;c.&#039;&#039;&#039; Build coarse-grained membrane&lt;br /&gt;
&lt;br /&gt;
Used tool: insane.py&lt;br /&gt;
&lt;br /&gt;
Here, a lipid bilayer will be created around the protein structure (in the x/y-plane) and water will be added to the system. The default box shape is rectangular and the size is set to x,y=10nm, z=11nm. This can be changed in the ./insane.py command line. The default lipid type is POPC, you can change that to arbitrary lipid compositions using the -l and -u options of of insane.py.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-out.top / topol-cg.top - Topology of coarse-grained system&lt;br /&gt;
&lt;br /&gt;
-cg-membrane.gro/.pdb - Coarse-grained system coordinates. &#039;&#039;&#039;Carefully inspect and visualize the cg-membrane.pdb.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use PyMOL to check if you&#039;re protein is embedded correctly in the lipid bilayer.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 2) Simulating the coarse-grained system =&lt;br /&gt;
&lt;br /&gt;
This is automated in the script:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/0002-run-CG-Minimization-and-MD.sh&lt;br /&gt;
&lt;br /&gt;
== 2.1) Run the script ==&lt;br /&gt;
&lt;br /&gt;
Copy the script above to your working directory.&lt;br /&gt;
&lt;br /&gt;
./0002-run-CG-Minimization-and-MD.sh&lt;br /&gt;
&lt;br /&gt;
=== Workflow ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;a.&#039;&#039;&#039; Minimize coarse-grained system&lt;br /&gt;
&lt;br /&gt;
Used tools: gmx grompp , gmx mdrun&lt;br /&gt;
&lt;br /&gt;
gmx grompp generates a single .tpr file that contains all information necessary for running a MD simulation or minimization using gmx mdrun.&lt;br /&gt;
&lt;br /&gt;
Minimization parameters are provided in martini_new-rf_min.mdp. The system will be minimized in 500 steps using steepest descent. The protein structure will be frozen during minimization.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-min.tpr - MD run input file&lt;br /&gt;
&lt;br /&gt;
-min.log - Output log file from minimization&lt;br /&gt;
&lt;br /&gt;
-min.trr - Minimization trajectory&lt;br /&gt;
&lt;br /&gt;
-min.gro - Minimized system coordinates&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;b.&#039;&#039;&#039; Simulate coarse-grained system&lt;br /&gt;
&lt;br /&gt;
MD simulation parameters are provided in martini_v2.x_new-rf.mdp. Strong position restraints are applied on the protein structure during the simulation. The system will be simulated for 50ns.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;martini&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-md.tpr - MD run input file&lt;br /&gt;
&lt;br /&gt;
-md.log - Output log file from simulation&lt;br /&gt;
&lt;br /&gt;
-md.trr - lossless trajectory of simulation&lt;br /&gt;
&lt;br /&gt;
-md.xtc - coordinates of simulation trajectory&lt;br /&gt;
&lt;br /&gt;
-md.gro - coordinates of final simulation snapshot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The simulation will run for roughly 3 hours.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 3) Converting coarse-grained system to atomistic resolution and select lipid atoms for grid generation =&lt;br /&gt;
&lt;br /&gt;
This is automated in the script:&lt;br /&gt;
&lt;br /&gt;
/mnt/nfs/home/stefan/zzz.scripts/INSERT-MEMBRANE/FILES/0003-backmap-and-lpd-selection.sh&lt;br /&gt;
&lt;br /&gt;
== 3.1) Run the script ==&lt;br /&gt;
&lt;br /&gt;
Copy the script above to your working directory.&lt;br /&gt;
&lt;br /&gt;
./0003-backmap-and-lpd-selection.sh&lt;br /&gt;
&lt;br /&gt;
=== Workflow ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;a.&#039;&#039;&#039; Backmapping from coarse-grained to atomistic&lt;br /&gt;
&lt;br /&gt;
Used tool: gmx trjconv, initram.sh&lt;br /&gt;
&lt;br /&gt;
gmx trjconv can perform a variety of conversions of MD trajectory, e.g. making molecules broken over the periodic boundary conditions whole again. &lt;br /&gt;
&lt;br /&gt;
initram.sh calls the backward.py program which performs the backmapping of input coarse-grained to atomistic systems, and performs a small series of short minimizations and simulations to relax the backmapped system.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;backmap&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-0-backmapped.gro / projected.gro - initial backmapped coordinates&lt;br /&gt;
&lt;br /&gt;
-backmapped.top - Topology of atomistic system&lt;br /&gt;
&lt;br /&gt;
-1-EM*/2-EM* - Output from minimizations &lt;br /&gt;
&lt;br /&gt;
-3-mdpr*/4-mdpr*/5-mdpr*/6-mdpr* - Output from simulations&lt;br /&gt;
&lt;br /&gt;
-backmapped.gro - Coordinates of final backmapped and relaxed system&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This may need a few attempts to work all the way through. There is a while-loop that only stops until all relaxation steps have finished.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;b.&#039;&#039;&#039; Replacing backmapped protein with initial atomistic protein structure&lt;br /&gt;
&lt;br /&gt;
Used tool: PyMOL script align.pml&lt;br /&gt;
&lt;br /&gt;
The pymol script will align the initial &amp;quot;Gromacs&amp;quot;-protein structure (conf.pdb) onto the backmapped structure and combine the fitted protein coordinates with the coordinates of the lipid and solvent environment.&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;backmap/prepare_AA_system&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-conf-fitted.pdb - Fitted initial protein structure&lt;br /&gt;
&lt;br /&gt;
-backmapped-environment.pdb - All membrane and water coordinates&lt;br /&gt;
&lt;br /&gt;
-fitted_system.pdb - Complete system containing fitted protein and environment coordinates&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure that fitted_system.pdb has the same number of coordinates as backmapped-mol.pdb.&#039;&#039;&#039; If there is a discrepancy there might be an issue with the PyMOL version you&#039;re using to run align.pml. Using PyMOL v2 or newer seems to avoid any issues. You can also generate backmapped-environment.pdb manually by taking all POPC and Water cooridnates from backmapped-mol.pdb.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;c.&#039;&#039;&#039; Run minimizations of atomistic system&lt;br /&gt;
&lt;br /&gt;
Used tools: gmx grompp, gmx mdrun&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the &#039;&#039;backmap/prepare_AA_system&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
Tow minimizations will be calculated. &lt;br /&gt;
&lt;br /&gt;
1) Minimization with frozen protein coordinates: 1,500 steps steepest descent (min_freeze.mdp).&lt;br /&gt;
&lt;br /&gt;
-min_freeze* - Output files of first minimization&lt;br /&gt;
&lt;br /&gt;
2) Minimization of full system: 500 steps (min.mdp).&lt;br /&gt;
&lt;br /&gt;
-min* - Output files of second minimization&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;d.&#039;&#039;&#039; Select lipid atoms for DOCK grid generation&lt;br /&gt;
&lt;br /&gt;
Used tools: PyMOL script prepare.pml&lt;br /&gt;
&lt;br /&gt;
This will select carbon and hydrogen atoms of the hydrophobic lipid tail segments in a radius of 1.7 nm around the protein and assign them to the atom type &amp;quot;LPD&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You need to provide the rec.pdb to want to use for docking (potentially with missing loops) at that step as xtal-prot.pdb&lt;br /&gt;
&lt;br /&gt;
Output files are stored in the generated &#039;&#039;backmap/prepare_AA_system/prepare_min&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
-shell-LPD.pdb - all LPD atoms selected for grid generation&lt;br /&gt;
&lt;br /&gt;
Add these coordinates to your docking protein structure and provide a amb.crg.oxt file adding&lt;br /&gt;
&lt;br /&gt;
C     lpd        0.000     LIPID SPHERE&lt;br /&gt;
&lt;br /&gt;
Now you can run blastermaster.&lt;br /&gt;
&lt;br /&gt;
= Membrane modelling in Schrodinger =&lt;br /&gt;
Written by Andrii Kyrylchuk, 2022/04/20&lt;br /&gt;
&lt;br /&gt;
== MD of protein and membrane ==&lt;br /&gt;
Import structure &#039;&#039;&#039;without&#039;&#039;&#039; ligand, use &amp;lt;u&amp;gt;Preparation wizard&amp;lt;/u&amp;gt; as described in &amp;quot;Code for Controls...&amp;quot;  to model missing loops and capping.&lt;br /&gt;
&lt;br /&gt;
Then open &amp;lt;u&amp;gt;System Builder&amp;lt;/u&amp;gt;, click &amp;lt;code&amp;gt;Setup membrane&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to the website https://opm.phar.umich.edu/proteins/ and find your protein. Copy residue numbers from the bottom of the page to the field &amp;lt;code&amp;gt;Transmembrane atoms...&amp;lt;/code&amp;gt;. The format is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;res.num 76-97,112-136,141,...&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click &amp;lt;code&amp;gt;Place Automatically&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt;. Then click &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt;. Examine lipids and solvent after run completes.&lt;br /&gt;
&lt;br /&gt;
Then use &amp;lt;u&amp;gt;Molecular Dynamics&amp;lt;/u&amp;gt; menu to set up the calculation. Select prepared system, click &amp;lt;code&amp;gt;Load&amp;lt;/code&amp;gt; on top of the menu. Put simulation time of 5 ns, &amp;lt;code&amp;gt;Advanced Options&amp;lt;/code&amp;gt; -- &amp;lt;code&amp;gt;Restraints&amp;lt;/code&amp;gt; -- &amp;lt;code&amp;gt;Add.&amp;lt;/code&amp;gt; Select protein, and put &amp;lt;code&amp;gt;Force Constant&amp;lt;/code&amp;gt; of 100, click &amp;lt;code&amp;gt;Apply&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;OK.&amp;lt;/code&amp;gt; Then click down arrow left of the &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt; button in the parent window and click &amp;lt;code&amp;gt;Write&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Copy the project folder (desmond_md_job_X) to gimel, login to &amp;lt;u&amp;gt;gimel5&amp;lt;/u&amp;gt;, edit desmond_md_job_X.sh: delete &amp;lt;code&amp;gt;-lic DESMOND_GPGPU:16&amp;lt;/code&amp;gt; and insert &amp;lt;code&amp;gt;-HOST gimel5.gpu&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;gimel5.heavygpu&amp;lt;/code&amp;gt;). Run .sh file, and your task will be submitted to a queue. For my system it took 1.5 hr to complete.&lt;br /&gt;
&lt;br /&gt;
Download the project folder to your PC, open Maestro, click &amp;lt;code&amp;gt;Import  structure&amp;lt;/code&amp;gt; and open &amp;lt;code&amp;gt;-out.cms&amp;lt;/code&amp;gt;, click on &amp;lt;code&amp;gt;T&amp;lt;/code&amp;gt; icon at the new entry in project table and click &amp;lt;code&amp;gt;Display Trajectory Snapshots&amp;lt;/code&amp;gt;. Select the last one, click &amp;lt;code&amp;gt;Display&amp;lt;/code&amp;gt; and check if the protein did not change position during MD run, then click &amp;lt;code&amp;gt;Export&amp;lt;/code&amp;gt;, to Project Table, Frames Selected only. You will get a new entry in the Project Table. Export it to a &amp;lt;code&amp;gt;.pdb&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
== Preparation of the structure for Blastermaster ==&lt;br /&gt;
Use &amp;lt;code&amp;gt;prepare.pml&amp;lt;/code&amp;gt; script. You need to provide the &amp;lt;code&amp;gt;rec.pdb&amp;lt;/code&amp;gt; to want to use for docking (potentially with missing loops) at that step as &amp;lt;code&amp;gt;xtal-prot.pdb&amp;lt;/code&amp;gt;. Rename MD system as &amp;lt;code&amp;gt;last-mol.pdb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;pymol -qc last-mol.pdb xtal-prot.pdb prepare.pml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
align last-mol, xtal-prot&lt;br /&gt;
&lt;br /&gt;
remove ////SPC&lt;br /&gt;
&lt;br /&gt;
create MEM, ////POPC&lt;br /&gt;
&lt;br /&gt;
remove /MEM////HS&lt;br /&gt;
remove /MEM////HX&lt;br /&gt;
remove /MEM////HY&lt;br /&gt;
remove /MEM////H*B&lt;br /&gt;
remove /MEM////H*A&lt;br /&gt;
remove /MEM////H*C&lt;br /&gt;
&lt;br /&gt;
remove /MEM////C1&lt;br /&gt;
remove /MEM////C2&lt;br /&gt;
remove /MEM////C3&lt;br /&gt;
remove /MEM////C11&lt;br /&gt;
remove /MEM////C12&lt;br /&gt;
remove /MEM////C13&lt;br /&gt;
remove /MEM////C14&lt;br /&gt;
remove /MEM////C15&lt;br /&gt;
&lt;br /&gt;
create MEM_C, /MEM////*C* | /MEM////H*R | /MEM////H*S | /MEM////H*T | /MEM////H*X | /MEM////H*Y | /MEM////H*Z&lt;br /&gt;
&lt;br /&gt;
create shell, MEM_C within 20 of xtal-prot&lt;br /&gt;
&lt;br /&gt;
set retain_order, 1&lt;br /&gt;
&lt;br /&gt;
save shell.pdb, shell&lt;br /&gt;
&lt;br /&gt;
alter shell, resn=&#039;LPD&#039;&lt;br /&gt;
alter shell, name=&#039;C&#039;&lt;br /&gt;
alter shell, chain=&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
rebuild&lt;br /&gt;
&lt;br /&gt;
save shell-LPD.pdb, shell&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Preparation of grids with thinspheres ==&lt;br /&gt;
Prepare grids with thinspheres for the protein without lipid as described in https://wiki.docking.org/index.php/How_to_do_parameter_scanning&lt;br /&gt;
&lt;br /&gt;
Create an empty directory and put &amp;lt;code&amp;gt;shell-LPD.pdb&amp;lt;/code&amp;gt; there. Then run the following script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sh blast-membrane-thinsph-scan.sh {path to the collection of &amp;quot;es_ld_thin_sph_rad_X.X&amp;quot; directories} {path to the dir with original working and dockfiles directories}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script runs qnifft and solvmap for each &amp;lt;code&amp;gt;es_ld_thin_sph_rad_X.X&amp;lt;/code&amp;gt; directory, and then uses the second script of parameter scanning protocol to combine files into &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; directories.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important! LOOK AT YOUR GRIDS! Desolvation -- larger solvation where water is. Electrostatics -- no electrostatics in the lipid region. vdW -- no vdW in the lipid region.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# a script to prepare a protein with the lipid membrane for DOCK with thinsphere scan&lt;br /&gt;
# PREREQ -- run first step of https://wiki.docking.org/index.php/How_to_do_parameter_scanning (new_0001_generate_ES_LD_generation.py )&lt;br /&gt;
# first argument -- path to the directory where dirs &amp;quot;es_ld_thin_sph_rad_X.X&amp;quot; are stored. &lt;br /&gt;
# second argument -- path to the dir with original working and dockfiles&lt;br /&gt;
# run in a new directory with shell-LPD.pdb&lt;br /&gt;
&lt;br /&gt;
run_once () {&lt;br /&gt;
# mkdir  add_membrane&lt;br /&gt;
# Run qnifft for electrostatic grids&lt;br /&gt;
# cp $blastfiles_membrane/shell-LPD.pdb&lt;br /&gt;
# delete all fields except HETATM from shell-LPD.pdb&lt;br /&gt;
cp $curr_dir/shell-LPD.pdb .&lt;br /&gt;
sed -ir &#039;/^CRYST1/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^CONECT/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^END/d&#039; shell-LPD.pdb&lt;br /&gt;
cp $blastermaster_Prot/working/rec.crg.pdb .&lt;br /&gt;
#cp $blastermaster_Prot/working/lowdielectric.sph.pdb # (if wanted, if you run a  parameter scan, be sure to use the correct spheres!)&lt;br /&gt;
#cp -r $blastermaster_Prot/dockfiles .&lt;br /&gt;
#cp -r $blastermaster_Prot/INDOCK .&lt;br /&gt;
mv rec.crg.pdb  rec.crg.solo.pdb&lt;br /&gt;
cat rec.crg.solo.pdb shell-LPD.pdb  &amp;gt; receptor.crg.lowdielectric.pdb&lt;br /&gt;
# extracting SPH lines from receptor&lt;br /&gt;
number=$(grep -n  SPH  $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb | head -n 1 | awk -F &amp;quot;:&amp;quot; &#039;{print $1}&#039;)&lt;br /&gt;
tail --lines=+$number $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb &amp;gt;&amp;gt; receptor.crg.lowdielectric.pdb&lt;br /&gt;
need_files=&amp;quot;amb.crg.oxt&lt;br /&gt;
qnifft.parm&lt;br /&gt;
vdw.siz&amp;quot;&lt;br /&gt;
for file in $need_files&lt;br /&gt;
do&lt;br /&gt;
	if [ -e $blastermaster_Prot/working/$file ]&lt;br /&gt;
	then&lt;br /&gt;
		cp $blastermaster_Prot/working/$file .&lt;br /&gt;
	else&lt;br /&gt;
		cp $blast_orig/working/$file .&lt;br /&gt;
	fi&lt;br /&gt;
done&lt;br /&gt;
echo &amp;quot;C     lpd        0.000     LIPID SPHERE&amp;quot; &amp;gt;&amp;gt; amb.crg.oxt&lt;br /&gt;
cp $blastermaster_Prot/working/box .&lt;br /&gt;
cp $blastermaster_Prot/working/qnifft.parm .&lt;br /&gt;
cp $blastermaster_Prot/working/vdw.siz .&lt;br /&gt;
$DOCKBASE/proteins/qnifft/bin/qnifft22_193_pgf_32 qnifft.parm &amp;gt;&amp;amp; qnifft.log&lt;br /&gt;
$DOCKBASE/proteins/blastermaster/phiTrim.py qnifft.electrostatics.phi box trim.electrostatics.phi &amp;gt;&amp;amp; trim.log&lt;br /&gt;
&lt;br /&gt;
#cp trim.electrostatics.phi dockfiles/.&lt;br /&gt;
&lt;br /&gt;
# Check if the grid size changed:&lt;br /&gt;
#echo &amp;quot;Check if the grid size changed, compare this with INDOCK&amp;quot;&lt;br /&gt;
#python ~jklyu/zzz.script/pymol_movie/phi_to_dx.py trim.electrostatics.phi trim.electrostatics.phi.dx &amp;gt; gridsize&lt;br /&gt;
#head -n 1 gridsize&lt;br /&gt;
# compare with delphi_nsize in INDOCK&lt;br /&gt;
&lt;br /&gt;
# Run solvmap for Ligand Desolvation Grids if they are present in the folder&lt;br /&gt;
if [ -e $blastermaster_Prot/working/heavy ]&lt;br /&gt;
then&lt;br /&gt;
	mkdir heavy&lt;br /&gt;
	cd heavy || exit&lt;br /&gt;
	cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
	cp ../box .&lt;br /&gt;
	cp $blastermaster_Prot/working/heavy/INSEV .&lt;br /&gt;
	$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
	#cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
	cd ../ || exit&lt;br /&gt;
&lt;br /&gt;
	mkdir hydrogen&lt;br /&gt;
	cd hydrogen || exit&lt;br /&gt;
	cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
	cp ../box .&lt;br /&gt;
	cp $blastermaster_Prot/working/hydrogen/INSEV .&lt;br /&gt;
	$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
	#cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
fi&lt;br /&gt;
echo $dir &amp;quot; DONE!&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
curr_dir=$(pwd)&lt;br /&gt;
workdirs=$1&lt;br /&gt;
blast_orig=$2&lt;br /&gt;
dirs=$(ls -d $workdirs/es_ld_thin_sph_rad_*)&lt;br /&gt;
for dir in $dirs&lt;br /&gt;
do&lt;br /&gt;
	blastermaster_Prot=$dir&lt;br /&gt;
	local_dir=$(echo $dir | awk -F&amp;quot;\/&amp;quot; &#039;{print $NF}&#039;)&lt;br /&gt;
	mkdir -p $local_dir/working&lt;br /&gt;
	cd $local_dir/working || exit&lt;br /&gt;
	run_once&lt;br /&gt;
	cd $curr_dir || exit&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
python ~rstein/zzz.scripts/DOCK_prep_scripts/new_0002_combine_es_ld_grids_into_combos.py -p $blast_orig&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running blastermaster with default parameters ==&lt;br /&gt;
&#039;&#039;&#039;Warning! Do not use these grids, as the default grids with lipid spheres give incorrect solvation energies. Use the ones with thinspheres instead!&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# a script to prepare a protein with the lipid membrane for DOCK &lt;br /&gt;
# first argument -- path to blastermaster files of the protein without membrane&lt;br /&gt;
# run in a new directory with shell-LPD.pdb&lt;br /&gt;
blastermaster_Prot=$1&lt;br /&gt;
# mkdir  add_membrane&lt;br /&gt;
# Run qnifft for electrostatic grids&lt;br /&gt;
# cp $blastfiles_membrane/shell-LPD.pdb&lt;br /&gt;
# delete all fields except HETATM from shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^CRYST1/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^CONECT/d&#039; shell-LPD.pdb&lt;br /&gt;
sed -ir &#039;/^END/d&#039; shell-LPD.pdb&lt;br /&gt;
cp $blastermaster_Prot/working/rec.crg.pdb .&lt;br /&gt;
#cp $blastermaster_Prot/working/lowdielectric.sph.pdb # (if wanted, if you run a  parameter scan, be sure to use the correct spheres!)&lt;br /&gt;
cp -r $blastermaster_Prot/dockfiles .&lt;br /&gt;
cp -r $blastermaster_Prot/INDOCK .&lt;br /&gt;
mv rec.crg.pdb  rec.crg.solo.pdb&lt;br /&gt;
cat rec.crg.solo.pdb shell-LPD.pdb  &amp;gt; receptor.crg.lowdielectric.pdb&lt;br /&gt;
# extracting SPH lines from receptor&lt;br /&gt;
number=$(grep -n  SPH  $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb | head -n 1 | awk -F &amp;quot;:&amp;quot; &#039;{print $1}&#039;)&lt;br /&gt;
tail --lines=+$number $blastermaster_Prot/working/receptor.crg.lowdielectric.pdb &amp;gt;&amp;gt; rec.crg.lowdielectric.pdb&lt;br /&gt;
cp $blastermaster_Prot/working/amb.crg.oxt .&lt;br /&gt;
echo &amp;quot;C     lpd        0.000     LIPID SPHERE&amp;quot; &amp;gt;&amp;gt; amb.crg.oxt&lt;br /&gt;
cp $blastermaster_Prot/working/box .&lt;br /&gt;
cp $blastermaster_Prot/working/qnifft.parm .&lt;br /&gt;
cp $blastermaster_Prot/working/vdw.siz .&lt;br /&gt;
$DOCKBASE/proteins/qnifft/bin/qnifft22_193_pgf_32 qnifft.parm &amp;gt;&amp;amp; qnifft.log&lt;br /&gt;
$DOCKBASE/proteins/blastermaster/phiTrim.py qnifft.electrostatics.phi box trim.electrostatics.phi &amp;gt;&amp;amp; trim.log&lt;br /&gt;
&lt;br /&gt;
cp trim.electrostatics.phi dockfiles/.&lt;br /&gt;
&lt;br /&gt;
# Check if the grid size changed:&lt;br /&gt;
echo &amp;quot;Check if the grid size changed, compare this with INDOCK&amp;quot;&lt;br /&gt;
python ~jklyu/zzz.script/pymol_movie/phi_to_dx.py trim.electrostatics.phi trim.electrostatics.phi.dx &amp;gt; gridsize&lt;br /&gt;
head -n 1 gridsize&lt;br /&gt;
# compare with delphi_nsize in INDOCK&lt;br /&gt;
&lt;br /&gt;
# Run solvmap for Ligand Desolvation Grids&lt;br /&gt;
mkdir heavy&lt;br /&gt;
cd heavy || exit&lt;br /&gt;
cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
cp ../box .&lt;br /&gt;
cp $blastermaster_Prot/working/heavy/INSEV .&lt;br /&gt;
$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
cd ../ || exit&lt;br /&gt;
&lt;br /&gt;
mkdir hydrogen&lt;br /&gt;
cd hydroger || exit&lt;br /&gt;
cp ../receptor.crg.lowdielectric.pdb rec.crg.lds.pdb # (with thin spheres [if needed] and membrane)&lt;br /&gt;
cp ../box .&lt;br /&gt;
cp $blastermaster_Prot/working/hydrogen/INSEV .&lt;br /&gt;
$DOCKBASE/proteins/solvmap/bin/solvmap &amp;gt;&amp;amp; solvmap.log&lt;br /&gt;
cp ligand.desolv.heavy ../dockfiles/.&lt;br /&gt;
echo &amp;quot;DONE!&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Lipid membrane models from MemProtMD ==&lt;br /&gt;
If a protein-membrane complex was already modeled for your system and deposited at [http://memprotmd.bioch.ox.ac.uk/home/ MemProtMD] website, you can use it and skip doing MD in Schrodinger. The steps are very similar to the ones after Schrodinger run.&lt;br /&gt;
&lt;br /&gt;
Download the &amp;lt;code&amp;gt;*_default_dppc.mpmd.finalframe.atomistic.pdb&amp;lt;/code&amp;gt; file from the bottom of the page. Rename it to &amp;lt;code&amp;gt;last-mol.pdb&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Use prepare.pml script (below). You need to provide the &amp;lt;code&amp;gt;rec.pdb&amp;lt;/code&amp;gt; to want to use for docking (potentially with missing loops) at that step as &amp;lt;code&amp;gt;xtal-prot.pdb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;pymol -qc last-mol.pdb xtal-prot.pdb prepare.pml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script below differs from the one for processing Schrodinger results in two points: solvent residue is &amp;lt;code&amp;gt;SOL&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;SPC&amp;lt;/code&amp;gt;, and lipids are called &amp;lt;code&amp;gt;DPPC&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;POPC&amp;lt;/code&amp;gt;.&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
align last-mol, xtal-prot&lt;br /&gt;
&lt;br /&gt;
remove ////SOL&lt;br /&gt;
&lt;br /&gt;
create MEM, ////DPPC&lt;br /&gt;
&lt;br /&gt;
remove /MEM////HS&lt;br /&gt;
remove /MEM////HX&lt;br /&gt;
remove /MEM////HY&lt;br /&gt;
remove /MEM////H*B&lt;br /&gt;
remove /MEM////H*A&lt;br /&gt;
remove /MEM////H*C&lt;br /&gt;
&lt;br /&gt;
remove /MEM////C1&lt;br /&gt;
remove /MEM////C2&lt;br /&gt;
remove /MEM////C3&lt;br /&gt;
remove /MEM////C11&lt;br /&gt;
remove /MEM////C12&lt;br /&gt;
remove /MEM////C13&lt;br /&gt;
remove /MEM////C14&lt;br /&gt;
remove /MEM////C15&lt;br /&gt;
&lt;br /&gt;
create MEM_C, /MEM////*C* | /MEM////H*R | /MEM////H*S | /MEM////H*T | /MEM////H*X | /MEM////H*Y | /MEM////H*Z&lt;br /&gt;
&lt;br /&gt;
create shell, MEM_C within 20 of xtal-prot&lt;br /&gt;
&lt;br /&gt;
set retain_order, 1&lt;br /&gt;
&lt;br /&gt;
save shell.pdb, shell&lt;br /&gt;
&lt;br /&gt;
alter shell, resn=&#039;LPD&#039;&lt;br /&gt;
alter shell, name=&#039;C&#039;&lt;br /&gt;
alter shell, chain=&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
rebuild&lt;br /&gt;
&lt;br /&gt;
save shell-LPD.pdb, shell&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
</feed>