Skip to content

Commit

Permalink
Deployed cb5e443 to main with MkDocs 1.2.3 and mike 1.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
hadim committed Jan 27, 2022
1 parent 6a0dbd1 commit 605e233
Show file tree
Hide file tree
Showing 11 changed files with 300 additions and 30 deletions.
49 changes: 43 additions & 6 deletions main/api/datamol.conformers.html
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ <h2 id="generate-and-working-with-conformers">Generate and working with conforme


<h4 id="datamol.conformers._conformers.generate" class="doc doc-heading">
<code class="highlight language-python"><span class="n">generate</span><span class="p">(</span><span class="n">mol</span><span class="p">,</span> <span class="n">n_confs</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">rms_cutoff</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">clear_existing</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">align_conformers</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">minimize_energy</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">method</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">energy_iterations</span><span class="o">=</span><span class="mi">500</span><span class="p">,</span> <span class="n">warning_not_converged</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span> <span class="n">random_seed</span><span class="o">=</span><span class="mi">19</span><span class="p">,</span> <span class="n">add_hs</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">verbose</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span></code>
<code class="highlight language-python"><span class="n">generate</span><span class="p">(</span><span class="n">mol</span><span class="p">,</span> <span class="n">n_confs</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">rms_cutoff</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">clear_existing</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">align_conformers</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">minimize_energy</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">method</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">energy_iterations</span><span class="o">=</span><span class="mi">500</span><span class="p">,</span> <span class="n">warning_not_converged</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span> <span class="n">random_seed</span><span class="o">=</span><span class="mi">19</span><span class="p">,</span> <span class="n">add_hs</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">fallback_to_random_coords</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">ignore_failure</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">embed_params</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">verbose</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span></code>


<a href="#datamol.conformers._conformers.generate" class="headerlink" title="Permanent link">&para;</a></h4>
Expand Down Expand Up @@ -928,6 +928,26 @@ <h4 id="datamol.conformers._conformers.generate" class="doc doc-heading">
it’s almost always a good idea to add hydrogens to the molecule first."</p></td>
<td><code>True</code></td>
</tr>
<tr>
<td><code>fallback_to_random_coords</code></td>
<td><code>bool</code></td>
<td><p>Whether to use random coordinate initializations as a fallback if the initial
embedding fails.</p></td>
<td><code>True</code></td>
</tr>
<tr>
<td><code>ignore_failure</code></td>
<td><code>bool</code></td>
<td><p>It set to True, this will avoid raising an error when the embedding fails and return None instead.</p></td>
<td><code>False</code></td>
</tr>
<tr>
<td><code>embed_params</code></td>
<td><code>dict</code></td>
<td><p>Allows the user to specify arbitrary embedding parameters for the conformers. See the Rdkit
docs for reference. This will override any other default settings.</p></td>
<td><code>None</code></td>
</tr>
<tr>
<td><code>verbose</code></td>
<td><code>bool</code></td>
Expand Down Expand Up @@ -965,6 +985,9 @@ <h4 id="datamol.conformers._conformers.generate" class="doc doc-heading">
<span class="n">warning_not_converged</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">10</span><span class="p">,</span>
<span class="n">random_seed</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">19</span><span class="p">,</span>
<span class="n">add_hs</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span>
<span class="n">fallback_to_random_coords</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span>
<span class="n">ignore_failure</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span>
<span class="n">embed_params</span><span class="p">:</span> <span class="nb">dict</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">verbose</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Chem</span><span class="o">.</span><span class="n">rdchem</span><span class="o">.</span><span class="n">Mol</span><span class="p">:</span>
<span class="sd">&quot;&quot;&quot;Compute conformers of a molecule.</span>
Expand Down Expand Up @@ -1013,6 +1036,11 @@ <h4 id="datamol.conformers._conformers.generate" class="doc doc-heading">
<span class="sd"> are removed in the returned molecule. Warning: explicit hydrogens won&#39;t be conserved. It is strongly</span>
<span class="sd"> recommended to let the default value to True. The RDKit documentation says: &quot;To get good 3D conformations,</span>
<span class="sd"> it’s almost always a good idea to add hydrogens to the molecule first.&quot;</span>
<span class="sd"> fallback_to_random_coords: Whether to use random coordinate initializations as a fallback if the initial</span>
<span class="sd"> embedding fails.</span>
<span class="sd"> ignore_failure: It set to True, this will avoid raising an error when the embedding fails and return None instead.</span>
<span class="sd"> embed_params: Allows the user to specify arbitrary embedding parameters for the conformers. See the Rdkit</span>
<span class="sd"> docs for reference. This will override any other default settings.</span>
<span class="sd"> verbose: Wether to enable logs during the process.</span>

<span class="sd"> Returns:</span>
Expand Down Expand Up @@ -1057,20 +1085,29 @@ <h4 id="datamol.conformers._conformers.generate" class="doc doc-heading">
<span class="n">params</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">AllChem</span><span class="p">,</span> <span class="n">method</span><span class="p">)()</span>
<span class="n">params</span><span class="o">.</span><span class="n">randomSeed</span> <span class="o">=</span> <span class="n">random_seed</span>
<span class="n">params</span><span class="o">.</span><span class="n">enforceChirality</span> <span class="o">=</span> <span class="kc">True</span>
<span class="k">if</span> <span class="n">embed_params</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">embed_params</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
<span class="nb">setattr</span><span class="p">(</span><span class="n">params</span><span class="p">,</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span><span class="p">)</span>

<span class="n">confs</span> <span class="o">=</span> <span class="n">AllChem</span><span class="o">.</span><span class="n">EmbedMultipleConfs</span><span class="p">(</span><span class="n">mol</span><span class="p">,</span> <span class="n">numConfs</span><span class="o">=</span><span class="n">n_confs</span><span class="p">,</span> <span class="n">params</span><span class="o">=</span><span class="n">params</span><span class="p">)</span>

<span class="c1"># Sometime embedding fails. Here we try again by disabling `enforceChirality`.</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">confs</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">confs</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span> <span class="ow">and</span> <span class="n">fallback_to_random_coords</span><span class="p">:</span>
<span class="k">if</span> <span class="n">verbose</span><span class="p">:</span>
<span class="n">logger</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span>
<span class="sa">f</span><span class="s2">&quot;Conformers embedding failed for </span><span class="si">{</span><span class="n">dm</span><span class="o">.</span><span class="n">to_smiles</span><span class="p">(</span><span class="n">mol</span><span class="p">)</span><span class="si">}</span><span class="s2">. Trying without enforcing chirality.&quot;</span>
<span class="sa">f</span><span class="s2">&quot;Conformers embedding failed for </span><span class="si">{</span><span class="n">dm</span><span class="o">.</span><span class="n">to_smiles</span><span class="p">(</span><span class="n">mol</span><span class="p">)</span><span class="si">}</span><span class="s2">. Trying with random coordinates.&quot;</span>
<span class="p">)</span>
<span class="n">params</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">AllChem</span><span class="p">,</span> <span class="n">method</span><span class="p">)()</span>
<span class="n">params</span><span class="o">.</span><span class="n">randomSeed</span> <span class="o">=</span> <span class="n">random_seed</span>
<span class="n">params</span><span class="o">.</span><span class="n">enforceChirality</span> <span class="o">=</span> <span class="kc">False</span>

<span class="n">params</span><span class="o">.</span><span class="n">useRandomCoords</span> <span class="o">=</span> <span class="kc">True</span>
<span class="n">confs</span> <span class="o">=</span> <span class="n">AllChem</span><span class="o">.</span><span class="n">EmbedMultipleConfs</span><span class="p">(</span><span class="n">mol</span><span class="p">,</span> <span class="n">numConfs</span><span class="o">=</span><span class="n">n_confs</span><span class="p">,</span> <span class="n">params</span><span class="o">=</span><span class="n">params</span><span class="p">)</span>

<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">confs</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
<span class="k">if</span> <span class="n">ignore_failure</span><span class="p">:</span>
<span class="k">if</span> <span class="n">verbose</span><span class="p">:</span>
<span class="n">logger</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span>
<span class="sa">f</span><span class="s2">&quot;Conformers embedding failed for </span><span class="si">{</span><span class="n">dm</span><span class="o">.</span><span class="n">to_smiles</span><span class="p">(</span><span class="n">mol</span><span class="p">)</span><span class="si">}</span><span class="s2">. Returning None because ignore_failure is set.&quot;</span>
<span class="p">)</span>
<span class="k">return</span> <span class="kc">None</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Conformers embedding failed for </span><span class="si">{</span><span class="n">dm</span><span class="o">.</span><span class="n">to_smiles</span><span class="p">(</span><span class="n">mol</span><span class="p">)</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span>

<span class="c1"># Minimize energy</span>
Expand Down
6 changes: 3 additions & 3 deletions main/api/datamol.descriptors.html
Original file line number Diff line number Diff line change
Expand Up @@ -1366,7 +1366,7 @@ <h4 id="rdkit.Chem.rdMolDescriptors.n_rotatable_bonds" class="doc doc-heading">


<h4 id="rdkit.Chem.Lipinski.n_aliphatic_rings" class="doc doc-heading">
<code class="highlight language-python"><span class="n">n_aliphatic_rings</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="o">=&lt;</span><span class="n">Boost</span><span class="o">.</span><span class="n">Python</span><span class="o">.</span><span class="n">function</span> <span class="nb">object</span> <span class="n">at</span> <span class="mh">0x5583d2e674c0</span><span class="o">&gt;</span><span class="p">)</span></code>
<code class="highlight language-python"><span class="n">n_aliphatic_rings</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="o">=&lt;</span><span class="n">Boost</span><span class="o">.</span><span class="n">Python</span><span class="o">.</span><span class="n">function</span> <span class="nb">object</span> <span class="n">at</span> <span class="mh">0x55ae677ab100</span><span class="o">&gt;</span><span class="p">)</span></code>


<a href="#rdkit.Chem.Lipinski.n_aliphatic_rings" class="headerlink" title="Permanent link">&para;</a></h4>
Expand Down Expand Up @@ -1395,7 +1395,7 @@ <h4 id="rdkit.Chem.Lipinski.n_aliphatic_rings" class="doc doc-heading">


<h4 id="rdkit.Chem.Lipinski.n_aromatic_rings" class="doc doc-heading">
<code class="highlight language-python"><span class="n">n_aromatic_rings</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="o">=&lt;</span><span class="n">Boost</span><span class="o">.</span><span class="n">Python</span><span class="o">.</span><span class="n">function</span> <span class="nb">object</span> <span class="n">at</span> <span class="mh">0x5583d32d0ff0</span><span class="o">&gt;</span><span class="p">)</span></code>
<code class="highlight language-python"><span class="n">n_aromatic_rings</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="o">=&lt;</span><span class="n">Boost</span><span class="o">.</span><span class="n">Python</span><span class="o">.</span><span class="n">function</span> <span class="nb">object</span> <span class="n">at</span> <span class="mh">0x55ae677aadf0</span><span class="o">&gt;</span><span class="p">)</span></code>


<a href="#rdkit.Chem.Lipinski.n_aromatic_rings" class="headerlink" title="Permanent link">&para;</a></h4>
Expand Down Expand Up @@ -1424,7 +1424,7 @@ <h4 id="rdkit.Chem.Lipinski.n_aromatic_rings" class="doc doc-heading">


<h4 id="rdkit.Chem.Lipinski.n_saturated_rings" class="doc doc-heading">
<code class="highlight language-python"><span class="n">n_saturated_rings</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="o">=&lt;</span><span class="n">Boost</span><span class="o">.</span><span class="n">Python</span><span class="o">.</span><span class="n">function</span> <span class="nb">object</span> <span class="n">at</span> <span class="mh">0x5583d32d6dd0</span><span class="o">&gt;</span><span class="p">)</span></code>
<code class="highlight language-python"><span class="n">n_saturated_rings</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="o">=&lt;</span><span class="n">Boost</span><span class="o">.</span><span class="n">Python</span><span class="o">.</span><span class="n">function</span> <span class="nb">object</span> <span class="n">at</span> <span class="mh">0x55ae677aae60</span><span class="o">&gt;</span><span class="p">)</span></code>


<a href="#rdkit.Chem.Lipinski.n_saturated_rings" class="headerlink" title="Permanent link">&para;</a></h4>
Expand Down
2 changes: 1 addition & 1 deletion main/search/search_index.json

Large diffs are not rendered by default.

Loading

0 comments on commit 605e233

Please sign in to comment.