Trying to recreate AFDB's visualization of pLDDT NewCartoon colors #391
-
Hi, maybe this is a basic question. I am trying to recreate the stepped colors used in AlphaFold Database's structural visualization of predicted models. Specifically, the structures have the residues' pLDDT values stored in the b-factor column of the .pdb file. My logic for setting up the node tree follows the solution for Q&A #269 where multiple color_set/selection node pairs are used, one for each of the steps in pLDDT color scheme (see below). Unfortunately, the MN_select_attribute selection node does not have the b-factor values as a possible attribute to select by. Alternatively, there is the MN_color_attribute_map coloring node but this only allows for up to a three color map with various color interpolation styles. I'm fairly new to blender and geometry nodes, so what's a good way of implementing this qualitative color scheme? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
Looking at the inner mechanism of the MN_select_attribute, maybe I can create a boolean return value based on residues' b-factor attributes (within the various ranges of the color scheme) and use this to select atoms to then be colored with the respective color from the scheme? |
Beta Was this translation helpful? Give feedback.
-
Group input fields for the desired atom selection node will be:
Group output from the selection node will be an Atoms group that passed the boolean tests. After some digging through the default selection node groups, I think this is going to mirror the MN_select_res_id_range node group but use the b_factor named attribute and Float. |
Beta Was this translation helpful? Give feedback.
-
Hi mate, thanks for asking the question! You could do the different coloring based on boolean selections as in #269, but the cleaner way would be to have a couple of switch nodes as in the example below: This group of nodes can become a node group with inputs (for the cutoffs) and outputs (the color), which you can create by selecting them and creating a group with Cmd/Ctrl + G. This is useful node group and one that I will include in the future release of MN as I'm sure there will be lots of AlphaFold visualisations going on with it. |
Beta Was this translation helpful? Give feedback.
-
I stepped away for a bit but here's where I got. where the MN_select_res_by_attribute node group is Just for any other interested parties: the hex codes for the AFDB colors are FF7D45, FFDB13, 65CBF3, and 0053D6. |
Beta Was this translation helpful? Give feedback.
Hi mate, thanks for asking the question! You could do the different coloring based on boolean selections as in #269, but the cleaner way would be to have a couple of switch nodes as in the example below:
This group of nodes can become a node group with inputs (for the cutoffs) and outputs (the color), which you can create by selecting them and creating a group with Cmd/Ctrl + G. This is useful node group and one that I will include in the future release of MN as I'm sure there will be lots of AlphaFold visualisations going on with it.