-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e28d185
commit ee60c80
Showing
12 changed files
with
292 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import matplotlib.pyplot as plt | ||
from fgutils.proxy import MolProxy, ProxyGroup, ProxyGraph, Parser | ||
from fgutils.vis import plot_graph | ||
|
||
pattern = "C{g}(C)C{g}(C)(C)C" | ||
g_2 = ProxyGroup("g", ProxyGraph("c1ccccc1", anchor=[1, 3])) | ||
g_3 = ProxyGroup("g", ProxyGraph("c1ccccc1", anchor=[1, 3, 4])) | ||
g_4 = ProxyGroup("g", ProxyGraph("c1ccccc1", anchor=[1, 3, 4, 5])) | ||
|
||
parser = Parser() | ||
proxy1 = MolProxy(pattern, g_2) | ||
proxy2 = MolProxy(pattern, g_3) | ||
proxy3 = MolProxy(pattern, g_4) | ||
|
||
parent_graph = parser(pattern) | ||
mol1 = next(proxy1) | ||
mol2 = next(proxy2) | ||
mol3 = next(proxy3) | ||
|
||
fig, ax = plt.subplots(2, 2, dpi=200, figsize=(16, 9)) | ||
plot_graph( | ||
parent_graph, ax[0, 0], show_labels=True, show_edge_labels=False, title="parent" | ||
) | ||
plot_graph(mol1, ax[0, 1], show_edge_labels=False, title="2 anchor nodes") | ||
plot_graph(mol2, ax[1, 0], show_edge_labels=False, title="3 anchor nodes") | ||
plot_graph(mol3, ax[1, 1], show_edge_labels=False, title="4 anchor nodes") | ||
plt.savefig( | ||
"doc/figures/multiple_anchor_example.png", bbox_inches="tight", transparent=True | ||
) | ||
plt.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from fgutils.fgconfig import print_tree, FGConfigProvider, FGTreeNode | ||
|
||
provider = FGConfigProvider() | ||
tree = provider.get_tree() | ||
s = print_tree(tree) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
================= | ||
Functional Groups | ||
================= | ||
|
||
FGUtils provides a class :py:class:`~fgutils.query.FGQuery` to query a | ||
molecules functional groups. | ||
|
||
Functional group tree | ||
===================== | ||
|
||
.. code-block:: | ||
Functional Group Parents Pattern | ||
-------------------------------------------------------------------------- | ||
ether [ROOT] ROR | ||
├── ketal [ether] RC(OR)(OR)R | ||
│ ├── acetal [ketal] RC(OC)(OC)H | ||
│ └── hemiketal [ketal, alcohol] RC(OH)(OR)R | ||
│ └── hemiacetal [hemiketal] RC(OC)(OH)H | ||
├── ester [ketone, ether] RC(=O)OR | ||
│ ├── anhydride [ester] RC(=O)OC(=O)R | ||
│ ├── peroxy_acid [ester, peroxide] RC(=O)OOH | ||
│ ├── carbamate [ester, amide] ROC(=O)N(R)R | ||
│ └── carboxylic_acid [ester, alcohol] RC(=O)OH | ||
├── alcohol [ether] COH | ||
│ ├── hemiketal [ketal, alcohol] RC(OH)(OR)R | ||
│ │ └── hemiacetal [hemiketal] RC(OC)(OH)H | ||
│ ├── carboxylic_acid [ester, alcohol] RC(=O)OH | ||
│ ├── enol [alcohol] C=COH | ||
│ ├── primary_alcohol [alcohol] CCOH | ||
│ │ └── secondary_alcohol [primary_alcohol] C(C)(C)OH | ||
│ │ └── tertiary_alcohol [secondary_alcohol] C(C)(C)(C)OH | ||
│ └── phenol [alcohol] C:COH | ||
└── peroxide [ether] ROOR | ||
└── peroxy_acid [ester, peroxide] RC(=O)OOH | ||
thioether [ROOT] RSR | ||
└── thioester [ketone, thioether] RC(=O)SR | ||
amine [ROOT] RN(R)R | ||
├── amide [ketone, amine] RC(=O)N(R)R | ||
│ └── carbamate [ester, amide] ROC(=O)N(R)R | ||
└── anilin [amine] C:CN(R)R | ||
carbonyl [ROOT] C(=O) | ||
├── ketene [carbonyl] RC(R)=C=O | ||
└── ketone [carbonyl] RC(=O)R | ||
├── amide [ketone, amine] RC(=O)N(R)R | ||
│ └── carbamate [ester, amide] ROC(=O)N(R)R | ||
├── thioester [ketone, thioether] RC(=O)SR | ||
├── ester [ketone, ether] RC(=O)OR | ||
│ ├── anhydride [ester] RC(=O)OC(=O)R | ||
│ ├── peroxy_acid [ester, peroxide] RC(=O)OOH | ||
│ ├── carbamate [ester, amide] ROC(=O)N(R)R | ||
│ └── carboxylic_acid [ester, alcohol] RC(=O)OH | ||
├── acyl_chloride [ketone] RC(=O)Cl | ||
└── aldehyde [ketone] RC(=O)H | ||
nitrose [ROOT] RN=O | ||
└── nitro [nitrose] RN(=O)O | ||
nitrile [ROOT] RC#N |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,12 @@ | |
References | ||
========== | ||
|
||
query | ||
===== | ||
|
||
.. automodule:: fgutils.query | ||
:members: | ||
|
||
parse | ||
===== | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.