Skip to content

Commit

Permalink
update style and add some nodes docs
Browse files Browse the repository at this point in the history
  • Loading branch information
BradyAJohnston committed Sep 4, 2023
1 parent c4dd714 commit ad78f4e
Show file tree
Hide file tree
Showing 18 changed files with 136 additions and 184 deletions.
Binary file modified MolecularNodes/assets/MN_data_file.blend
Binary file not shown.
12 changes: 6 additions & 6 deletions MolecularNodes/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -943,20 +943,20 @@ def draw(self, context):
layout.operator_context = "INVOKE_DEFAULT"
layout.menu('MN_MT_ADD_NODE_MENU_SYLING',
text='Style', icon_value=77)
layout.menu('MN_MT_ADD_NODE_MENU_COLOR',
text='Color', icon = 'COLORSET_07_VEC')
layout.menu('MN_MT_ADD_NODE_MENU_DENSITY', icon = "LIGHTPROBE_CUBEMAP",
text = "Density")
layout.menu('MN_MT_ADD_NODE_MENU_BONDS',
text='Bonds', icon = 'FIXED_SIZE')
layout.menu('MN_MT_ADD_NODE_MENU_SELECTIONS',
text='Selection', icon_value=256)
layout.menu('MN_MT_ADD_NODE_MENU_COLOR',
text='Color', icon = 'COLORSET_07_VEC')
layout.menu('MN_MT_ADD_NODE_MENU_ANIMATION',
text='Animation', icon_value=409)
layout.menu('MN_MT_ADD_NODE_MENU_ASSEMBLY',
text='Assemblies', icon = 'GROUP_VERTEX')
layout.menu('MN_MT_ADD_NODE_MENU_DENSITY', icon = "LIGHTPROBE_CUBEMAP",
text = "Density")
layout.menu('MN_MT_ADD_NODE_MENU_DNA',
text='DNA', icon='GP_SELECT_BETWEEN_STROKES')
layout.menu('MN_MT_ADD_NODE_MENU_BONDS',
text='Bonds', icon = 'FIXED_SIZE')
layout.menu('MN_MT_ADD_NODE_MENU_UTILITIES',
text='Utilities', icon_value=92)

Expand Down
8 changes: 6 additions & 2 deletions docs/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ website:
title: "Molecular Nodes"
sidebar:
collapse-level: 1
style: docked
style: floating
search: true
contents:
- href: index.md
text: Home

- installation.md
- getting-started.md
- nodes/nodes.md
- section: Tutorials
contents: tutorials/*
- examples.md
- molecular_nodes.qmd
- documentation.md
- section: Python API
contents: reference/*
Expand All @@ -34,6 +34,10 @@ website:

format:
html:
page-layout: full
grid:
sidebar-width: 250px
body-width: 1000px
theme:
light: sandstone
dark: darkly
Expand Down
Binary file added docs/images/nodes_style_atoms.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
109 changes: 0 additions & 109 deletions docs/molecular_nodes.qmd

This file was deleted.

81 changes: 16 additions & 65 deletions docs/nodes.md
Original file line number Diff line number Diff line change
@@ -1,76 +1,27 @@
---
title: "Node Documentation"
title: "Nodes"
editor: visual
number-sections: true
number-depth: 3
---

# Nodes
## Syling

## Properties
### Atoms

### Atomic Properties
![Screenshot of `MN_style_atoms`](videos/style_atoms.mp4)

The `MN_prop_setup` node associates all of the different atomic properties with their corresponding atoms in the structure.
#### Inputs:

#### Required Inputs
- Atoms

-
- Edges and Vertices containing atomic information to apply the style to.
- Selection
- A ``
- Eevee / Cycles
- Scale Radii
- Eevee: Subdivisions
- Eevee: Shade Smooth
- Material

- **Atoms:** mesh vertices or point-cloud that are the `XYZ` locations of the atoms.

- **Properties Collections:** The collection that contains the `NAME_properties_1` models that were imported alongside the structure.

#### Optional Inputs:

A boolean switch for each of the atomic properties.
By default the properties are enabled, but they can be disable if required to provide a slight performance improvement if not required.

#### Outputs

- **Atoms (**mesh vertices or point-cloud)**:** that are the `XYZ` locations of the atoms, that also have *named attributes* for each of the atomic properties that were selected for set up.

- **atomic_number** (integer field): integer number corresponding to the atomic number of the atom.
Defaults to 0 if *atomic_number* cannot be determined.

- **chain_number** (integer field): integer number corresponding to the chain that the atom belongs to.
Chains will be sorted into alphabetical order, then given a corresponding integer number starting from 1.
Defaults to 0 if *chain_number* cannot be determined.

- **atom_name_number** (integer field): integer number corresponding to the name of the atom within the structure ("CA" for the alpha carbon).
Defaults to 0 if *atom_name_number* cannot be determined.

- **AA_sequence_number** (integer field): integer number corresponding to the sequence number of the amino acid in the structure that the atom belongs to.
For LYS32 the *AA_sequence_number* will be 32.
Defaults to 0 if *AA_sequence_number* cannot be determined.

- **AA_name** (integer field): integer number corresponding to the different residue names.
Amino acids are numbered 1-20 based on alphabetical order.
See the `MN_sel_AA_name` node for the corresponding order.

- **atom_index** (integer field): integer number corresponding to the order of the atom within the structure file.

- **B_factor** (float field): a float number corresponding to the value that was present in the B factor column, also known as the *temperature factor*.

- **is_backbone** (boolean field): a boolean value (TRUE or FALSE, 1 or 0) as to whether or not the atom is part of the backbone of the protein.

- **is_alpha_carbon** (boolean field): a boolean value (TRUE or FALSE, 1 or 0) as to whether or not the atom is an *alpha carbon* of the amino acid.

![](images/paste-781B1B8E.png){fig-align="center"}

## Styling Nodes

### Style Ribbon

This node uses the `is_alpha_carbon` property and the `chain_number` properties to generate a ribbon-representation of the structure as a mesh.
Options are available for the radius, smoothness and the resolution of the ribbon.

#### Required Inputs

- **Atoms** (mesh vertices or point cloud): atoms that contain at least the *is_alpha_carbon* named attribute and the *chain_number* attribute to ensure the ribbons are separated by chain.

#### Outputs

- **Ribbon** (mesh): a mesh that is the ribbon representation of the structure.

- **Curve** (spline / curve): a curve that goes through all of the alpha carbons in the structure, that is used to build the final ribbon mesh.

![](images/paste-84C866C3.png){fig-align="center"}
66 changes: 66 additions & 0 deletions docs/nodes/nodes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
title: "Nodes"
editor: visual
number-sections: true
number-depth: 2
toc-depth: 3
---

## Styling

### Atoms

Style to apply the traditional space-filling atomic representation of atoms. Spheres are scaled based on the `vdw_radii` attribute. By default the `Point Cloud` rendering system is used, which is only visible inside of Cycles.

![`MN_style_atoms`](videos/style_atoms.mp4)

#### Inputs:

| Name | Data Type | Default | Description |
|------------|------------|------------|--------------------------------------|
| Atoms | Geometry | | Vertices + edges describing atomic data to apply the style to. |
| Selection | Boolean \<*Field*\> | `True` | Boolean field, defining whether or not to apply the style. |
| Eevee / Cycles | Boolean \<*Field*\> | `False` | Boolean field, defining whether or not to instance geoemtry for Eevee or use Point Cloud rendering for Cycles. |
| Scale Radii | Float \<*Field*\> | `0.8` | Scale the resulting spheres to a proportion of the atoms Van der Waal radii. |
| Eevee: Subdivisions | Integer \<*Field\>* | `2` | Number of subdivisions for the instanced geometry, when using Eevee atoms. |
| Eevee: Shade Smooth | Boolean \<*Field*\> | `True` | Boolean field, whether to shade the Eevee atoms smooth. |
| Material | Material | `MN_atomic_material` | Material to apply to the resulting geometry. |

### Cartoon

Style to apply the traditional cartoon representation of protein structures. This style highlights alpha-helices and beta-sheets with arrows and cylinders.

![](videos/style_cartoon.mp4)

| Name | Data Type | Default | Description |
|------------|------------|------------|--------------------------------------|
| Atoms | Geometry | | Vertices + edges describing atomic data to apply the style to. |
| Selection | Boolean \<*Field*\> | `True` | Boolean field, defining whether or not to apply the style. |
| Quality | Integer \<*Field\>* | `2` | Integer field controlling the number of subdivisions and thus 'quality' of the cartoon. |
| Smooth / Sharp | Boolean \<*Field*\> | `False` | Boolean field, whether or not to create smooth or sharp styler cartoon geometry. |
| Arrows | Boolean \<*Field*\> | `True` | Boolean field, whether or not to create arrows for beta-sheet cartoons. |
| Cylinders | Boolean \<*Field*\> | `False` | Boolean field, whether or not to create cylinders for alpha-helix. |
| Thickness | Float \<*Field*\> | `0.4` | Float field controlling the thickness of the cartoons. |
| Width | Float \<*Field*\> | `1.8` | Float field controlling the width of alpha-helices and beta-sheets, along the 'flat' part of the cartoon mesh. |
| Loop Radius | Float \<*Field*\> | `0.18` | Float field controlling the radius of the loop geometry between secondary structure cartoons. |
| BS Smooth | Float \<*Field*\> | `1.00` | Factor from `0` to `1`, controlling the amount to smooth the beta-sheet geometry that is created. |
| Shade Smooth | Boolean \<*Field*\> | `True` | Boolean field, whether to shade the resulting cartoon mesh smooth. |
| Material | Material | `MN_atomic_material` | Material to apply to the resulting geometry. |

### Ribbon

Style that creates a continuous solid ribbon or licorice tube through the alpha-carbons of the structure.

![](videos/style_ribbon.mp4)

| Name | Data Type | Default | Description |
|------------|------------|------------|--------------------------------------|
| Atoms | Geometry | | Vertices + edges describing atomic data to apply the style to. |
| Selection | Boolean \<*Field*\> | `True` | Boolean field, defining whether or not to apply the style. |
| Quality | Integer \<*Field\>* | `2` | Integer field controlling the number of subdivisions and thus 'quality' of the cartoon. |
| Radius | Float \<*Field*\> | `0.18` | Float field controlling the radius of the loop geometry between secondary structure cartoons. |
| BS Smooth | Float \<*Field*\> | `1.00` | Factor from `0` to `1`, controlling the amount to smooth the beta-sheet geometry that is created. |
| Shade Smoothing | Boolean \<*Field*\> | `True` | Boolean field, whether to shade the resulting cartoon mesh smooth. |
| Material | Material | `MN_atomic_material` | Material to apply to the resulting geometry. |

## Selection
Binary file added docs/nodes/videos/style_atoms.mp4
Binary file not shown.
Binary file added docs/nodes/videos/style_cartoon.mp4
Binary file not shown.
Binary file added docs/nodes/videos/style_ribbon.mp4
Binary file not shown.
Loading

0 comments on commit ad78f4e

Please sign in to comment.