molfeat.viz
¶
colors_from_feature_factory(feature_factory, cmap_name='Set1', alpha=1.0)
¶
Get a list of colors for a given feature factory. For the same
feature_factory
the returned colors will be the same.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
feature_factory |
MolChemicalFeatureFactory
|
Feature factory to use. |
required |
cmap_name |
str
|
Matplotlib colormap name. |
'Set1'
|
alpha |
float
|
Alpha value for the colors. |
1.0
|
Returns:
Name | Type | Description |
---|---|---|
colors |
Dict of feature_name as keys and colors as values. |
Source code in molfeat/viz.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
|
show_mols(mols)
¶
Generate a view of the molecules.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mols |
Union[Mol, List[Mol]]
|
A mol or a list of mols. |
required |
Returns:
Type | Description |
---|---|
nglview.widget.NGLWidget |
Source code in molfeat/viz.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|
show_pharm_features(mols, features, feature_factory, alpha=1.0, sphere_radius=0.4, show_legend=True)
¶
Generate a view of the molecules with pharmacophoric features.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mols |
Union[Mol, List[Mol]]
|
A mol or a list of mols. |
required |
features |
DataFrame
|
Features data. Columns must contain at least "feature_name", "feature_id", and "feature_coords". |
required |
feature_factory |
MolChemicalFeatureFactory
|
Feature factory to display consistent colors. |
required |
alpha |
float
|
Alpha value for the colors (currently not working). |
1.0
|
sphere_radius |
float
|
Radius of the spheres for the features. |
0.4
|
show_legend |
bool
|
Display the legend (the layout is bad but at least it shows the legend). |
True
|
Returns:
Type | Description |
---|---|
nglview.widget.NGLWidget |
Source code in molfeat/viz.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
|