Skip to content

Commit

Permalink
more documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
BradyAJohnston committed Dec 19, 2024
1 parent ba20a7f commit 0400e41
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 34 deletions.
6 changes: 3 additions & 3 deletions docs/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ website:
text: Installation
- file: tutorials/
text: Tutorials
- file: documentation.qmd
- file: attributes.qmd
text: Documentation
- file: examples/
text: Examples
- file: cite/
Expand All @@ -35,10 +36,9 @@ website:
align: left
# pinned: true
contents:
- text: Docs
href: documentation.qmd
- installation.qmd
- attributes.qmd
- data_table.qmd
- text: Nodes
href: nodes/index.qmd
contents: nodes/*
Expand Down
91 changes: 66 additions & 25 deletions docs/attributes.qmd
Original file line number Diff line number Diff line change
@@ -1,29 +1,34 @@
# Attributes

Below are the attributes which are potentially created when a structure is imported
Below are the attributes which are potentially created when a structure is imported.
Explanations of type and domain conversions can be found in the Blender documentation [here](https://docs.blender.org/manual/en/latest/modeling/geometry_nodes/attributes_reference.html)

more detailed explanations of type conversions can be found in the Blender documentation [here](https://docs.blender.org/manual/en/latest/modeling/geometry_nodes/attributes_reference.html)
## World Scale

- explain about world scale (1 angstrom == 1 cm in Blender, will be changed for 5.0 to be 1 nm = 1 m)
- write-ups about different entities, ways to interact with them
In Molecular Nodes, the world scale determines how real-world measurements are translated into the 3D environment of Blender which uses metres.
Currently, 1 angstrom (Å) is equivalent to 1 centimeter (cm).
Scaling structural coodinates by `0.01` correctly converts them and `0.01` is referred to as the world scale.

When an attribute is going to be read from the geometry, it is colored red like so: `Index::Input`, `chain_id`, etc.
This scale will change in Blender 5.0 to be `0.1` so 1 nm will equal 1 m.

When an attribute is going to be read from the geometry, it is colored red like so: `Index::Input`, `chain_id`, while when a specific data type is refernce it will be colored accoring to the data type like so: `Int::Int`, `Float::Float`, `Vector::Vector`, etc.

## Data Types

### Attribute Types

Attributes are always associated with `Geometry::Geometry`.
They will be stored on one of the [domains](#domains) of the geometry.
The type of the attribute is determined by the type of the data it contains.
The following types are supported by Geometry Nodes.

| Type | Description |
|-------------------|-----------------------------------------------------|
|-----------------------|-------------------------------------------------|
| `Int::Int` | 32-bit integers |
| `Float::Float` | 32-bit floating point numbers |
| `Bool::Bool` | A simple `True::Bool` or `False::Bool` value |
| `Vector::Vector` | 3D vectors |
| `Matrix::Matrix` | 4x4 matrices, also references as `Transform::Matrix` inside of Geometry Nodes|
| `Matrix::Matrix` | 4x4 matrices, also references as `Transform::Matrix` inside of Geometry Nodes |
| `Color::Color` | RGBA colors, stored as 0..1 values |
| `Rotation::Rotation` | A rotation that internally is represented as a quaternion, but can implicitly be converted to an `Euler::Vector` vector. |

Expand All @@ -32,7 +37,7 @@ The following types are supported by Geometry Nodes.
Additional data types which are not supported as Attributes but can be used in the node tree are:

| Type | Description |
|-------------------|-----------------------------------------------------|
|-----------------------|-------------------------------------------------|
| `String::String` | String support in Geometry Nodes is limited at the moment and you cannot store strings as attributes |
| `Object::Object` | Access to objects in the 3D scene and their associated data |
| `Collection::Collection` | Access a collection of objects from the scene. Objects are returned as instances |
Expand All @@ -45,25 +50,61 @@ For `chain_id`, `entity_id` and other dynamic attributes, the unique values are

For other attributes such as `res_name`, they are looked up from the dictionary and assigned an integer value.

### Point Attributes

| Attribute | Type | Description |
|--------------|--------------|--------------------------------------------|
| `sec_struct` | `Int::Int` | Secondary structure identifier |
| `chain_id` | `Int::Int` | Identifier for the chain in the structure |
| `entity_id` | `Int::Int` | Identifier for the entity in the structure |
| `res_id` | `Int::Int` | Residue identifier |
| `res_name` | `Int::Int` | Residue name identifier |
| `atom_name` | `Int::Int` | Atom name identifier |
| `atom_id` | `Int::Int` | Atom identifier |
| `is_alpha_carbon` | `Bool::Bool` | Boolean indicating if the atom is an alpha carbon |
|------------------|------------------|------------------------------------|
| `Position` | `Vector::Vector` | Coordinates in 3D space of the points, read from the molecular data file. They are scaled by the world scale `0.01::Float` on import so that 1 Å == 1 cm. |
| `b_factor` | `Float::Float` | The temperature factor for the atom on import. If importing an AlphaFold structure this corresponds to the `pLDDT::Float` value. |
| `vdw_radii` | `Float::Float` | The radii of the atom, stored in world space (\~`0.015::Float`). Values sourced from [Wikipedia](https://en.wikipedia.org/wiki/Atomic_radii_of_the_elements_(data_page)). |
| `sec_struct` | `Int::Int` | Defines secondary structure for the residue the atom is part of. `0::Int` for not a protein. `1::Int` for helices, `2::Int` for sheets, `3::Int` for coils / unstructured. |
| `mass` | `Float::Float` | Mass of the element |
| `chain_id` | `Int::Int` | The integer representation of the chain ID, for it's position in the sorted list of chain IDs in the structure. |
| `entity_id` | `Int::Int` | Multiple chains can be the same `entity`, if they are copies of the same protein that appear multiple times in the structure. Also sorted and assigned integers on import. |
| `res_id` | `Int::Int` | The 20 canonical amino acids are `0::Int` to `19::Int` sorted alphabetically. DNA bases dAdCdGdT are `30::Int` - `33::Int`, RNA bases are ACGU from `40::Int` - `43::Int`. |
| `res_name` | `Int::Int` | Residues are mapped to integer values based on the [lookup table](data_table.qmd#residue-names). |
| `atomic_number` | `Int::Int` | Stores the atomic number of the atom for it's position on the periodic table, instead of the element's name. |
| `atom_name` | `Int::Int` | Atom names are mapped to integer values based on the [lookup table](attributes.qmd#atom-names). |
| `Color` | `Color::Color` | Color of the atom, assigned on import but often changed in node trees. |
| `atom_id` | `Int::Int` | Unique ascending value for each atom in the file, starting at `1::Int` |
| `is_alpha_carbon` | `Bool::Bool` | Computed on import or from the `atom_name` attribute. |
| `is_side_chain` | `Bool::Bool` | Computed on import or from the `atom_name` attribute. |
| `is_backbone` | `Bool::Bool` | Computed on import or from the `atom_name` attribute. |
| `is_solvent` | `Bool::Bool` | Computed on import or from the `atom_name` attribute. |
| `is_nucleic` | `Bool::Bool` | Computed on import or from the `atom_name` attribute. |
| `is_peptide` | `Bool::Bool` | Computed on import or from the `atom_name` attribute. |
| `is_hetero` | `Bool::Bool` | Computed on import or from the `atom_name` attribute. |
| `is_carb` | `Bool::Bool` | Computed on import or from the `atom_name` attribute. |

### Edge Attributes

Bonds between atoms are represented as edges in the geometry, and only the bond type is stored on the edge domain.

| Attribute | Type | Description |
|-------------|------------|-------------------------------------|
| `bond_type` | `Int::Int` | The type of bond between the atoms. |

Bond types are currently the values used by [`biotite`](https://www.biotite-python.org/latest/apidoc/biotite.structure.BondType.html)

| Bond Type | Integer Value | Description |
|------------------|:----------------:|------------------------------------|
| `ANY` | `0::Int` | Used if the actual type is unknown |
| `SINGLE` | `1::Int` | Single bond |
| `DOUBLE` | `2::Int` | Double bond |
| `TRIPLE` | `3::Int` | Triple bond |
| `QUADRUPLE` | `4::Int` | A quadruple bond |
| `AROMATIC_SINGLE` | `5::Int` | Aromatic bond with a single formal bond |
| `AROMATIC_DOUBLE` | `6::Int` | Aromatic bond with a double formal bond |
| `AROMATIC_TRIPLE` | `7::Int` | Aromatic bond with a triple formal bond |

## Domains {#domains}

| Domain | Description |
|-----------------|-------------------------------------------------------|
| `Point::Geometry` | Attributes associated with individual points of the geometry |
| `Edge::Geometry` | Attributes associated with edges connecting points |
| `Face Corner::Geometry` | Attributes associated with corners of faces formed by edges |
| `Face::Geometry` | Attributes associated with faces formed by edges |
| `Point Cloud::Geometry` | Attributes associated with points in a point cloud |
| `Curve: Points::Geometry` | Attributes associated with individual points of a curve |
| `Curve: Spline::Geometry` | Attributes associated with splines of a curve |
|---------------------|---------------------------------------------------|
| `Point::Geometry` | Individual points of geometry. These can be the vertices in a mesh, the points in a point cloud, or the control points of a curve. |
| `Edge::Geometry` | The edges of a mesh, defined as the indices between two points. |
| `Face::Geometry` | A face of a mesh, defined as a collection of edges. |
| `Corner::Geometry` | Corners of a face, where two edges meet. |
| `Curve::Geometry` | A curve object, which contains multiple control points, but can itself store attributes. |
| `Instance::Geometry` | Instances are references to other geometry. Instancing is useful for making lots of copies of some geometry for performance. |
| `Layer::Geometry` | Layers are for Grease Pencil, and contain a collection of curves. |
6 changes: 0 additions & 6 deletions docs/documentation.qmd

This file was deleted.

0 comments on commit 0400e41

Please sign in to comment.