Material¶
Data graph nodes (samson.DataModel.DataGraph.Node
) in SAMSON may have materials that apply to themselves and their descendants.
Materials may be used to modify the visual appearance of data graph nodes.
Each material has an associated color scheme to color nodes in a specific way,
e.g. color atoms by residue, chain, etc. or based on node properties (e.g. temperature factor, occupancy, etc.).
# get all residues
nodeIndexer = SAMSON.getNodes('node.type sm')
# create a color scheme per residue type
# by providing the node indexer of residues to the color scheme constructor
# we allow it to determine the color range based on the minimal and maximal residue types
colorScheme = sam.DataModel.Color.ColorSchemePerResidueType(nodeIndexer)
# apply the color scheme to nodes
for node in nodeIndexer:
material = sam.DataModel.DataGraph.Material()
material.setColorScheme(colorScheme)
node.setMaterial(material)
See also
SAMSON API: SBDDataGraphNodeMaterial
-
class
samson.DataModel.DataGraph.
Material
(*args, **kwargs)¶ Bases:
samson.Core.Reference.ReferenceTarget
This class describes a material.
Overloaded function.
- __init__(self: samson.DataModel.DataGraph.Material) -> None
Constructs a material
- __init__(self: samson.DataModel.DataGraph.Material, colorScheme: samson.DataModel.DataGraph.ColorScheme) -> None
Constructs a material based on a given color scheme
- __init__(self: samson.DataModel.DataGraph.Material, color: SBDColor) -> None
Constructs a material based on a given color
-
getColorScheme
(self: samson.DataModel.DataGraph.Material) → samson.DataModel.DataGraph.ColorScheme¶ Returns the color scheme
-
getMemoryFootprint
(self: samson.Core.Reference.ReferenceTarget) → int¶ Returns the memory footprint
-
getNode
(self: samson.DataModel.DataGraph.Material) → samson.DataModel.DataGraph.Node¶
-
setColorScheme
(self: samson.DataModel.DataGraph.Material, colorScheme: samson.DataModel.DataGraph.ColorScheme) → bool¶ Sets the color scheme
-
isSerializable
¶ Returns true when the class is serializable