Logo
Toggle Menu
  • home
  • blog
  • about
    • about this site
    • contact
    • privacy policy
  • cinema 4d
    • plugins
    • creating c4d plugins
    • plugin cookbook
    • software
  • models
    • nodes
    • plants 1
    • other models - 1
    • other models - 2
  • osl
    • writing osl shaders
    • osl shaders for download

Creating a new plugin: 18

What's happening with PDBLoader

Anyone reading this will know that for some months I've been working on a plugin to load a Protein Data Bank file and create a model from it. I had thought it would be available by now, but this hasn't happened.

The reasons are that, on testing a variety of PDB files to make sure it worked with any file, I found some where it did not. This needed a lot of thinking about and in the end quite a bit of reworking. This is what has taken the time.

An example

Just as an example, I found a file - actually a transfer RNA, so a nucelotide chain rather than an amino acid - where the chain also contained heterogen atoms (hetatoms), not separate from the main chain but part of it and linked to other hetatoms or nucleotides in the chain. To be clear, the chain consisted mostly of nucleotides but with occasional non-nucleotide molecules forming part of the polymer chain itself.

This caused two different problems. In the first case, if I wanted to colour all molecules in the chain the same colour, so that the entire chain, both atoms and bonds, were all that colour, it didn't work and the default atom and bond colours were used. This was because I had worked on the assumption that hetatoms were never part of a chain, so would never require a chain colour. Since that proved to be incorrect, the hetatoms and their bonds needed to be coloured as for the rest of the chain. For the atoms this was easy, but for the bonds it has proved extremely tricky and I haven't quite fixed it yet - though I have an idea how to do so. This image shows part of a chain which is coloured red. You can see that while all the atoms and most bonds are red, some of the bonds are white (the default bond colour), because they are bonds within hetatom molecules even though they are part of the chain:

Chain coloured red but with some bonds white.

This leads to another problem, however. It turns out that in a PDB file with hetatoms not linked as part of the chain but separate atoms or molecules, they can have the same chain identifier as the actual polymer chain. The usual reason for this is that the hetatoms are spatially associated with the actual polymer chain. A good example is haemoglobin, where there are four amino acid chains and where each chain also has a group of haem molecules. These are heterogens and not part of the polymer, but it does make sense to give them the same chain identifier. In other cases, groups of water molecules may have the same chain identifier as a polymer chain. Is it reasonable therefore to give these associated but separate molecules the same colour as the actual polymer chain? I think it is, as long as they aren't spuriously linked to the main polymer, but it does make it harder to see the hetatms when colouring chains.

The second issue was the ribbon display. To create a ribbon, a spline is created between the alpha carbons of amino acid molecules or the C1 prime atoms of nucleotides. This works well, but what if there are heterogen molecules as part of the chain? They won't have these named atoms, so should we ignore them (which in practice doesn't make much difference to the ribbon if there is only the occasional het molecule) or should they be included - maybe by using the geometric centre of the molecule? I still haven't decided on this one.

I have no doubt that other anomalies will surface.

Progress is being made

So you can see there are issues arising from the fact that biology isn't as neat and linear as we might like it to be. While accepting that there are always going to be files that just don't display correctly, and that sometimes this is due to an error in the PDB file itself, we do need to cover as many 'anomalies' as possible to avoid too many failures. Hopefully we'll get there soon.

Page last updated September 21st 2026

Blog articles

Creating a new plugin: 18 (September 21st 2026)

Reading a text file (August 18th 2026)

Creating a new plugin: 17 (August 8th 2026)

Creating a new plugin: 16 (August 2nd 2026)

Creating a new plugin: 15 (July 26th 2026)

Creating a new plugin: 14 (July 22nd 2026)

Creating a new plugin: 13 (July 13th 2026)

Creating a new plugin: 12 (July 8th 2026)

Creating a new plugin: 11 (June 29th 2026)

Creating a new plugin: 10 (June 12th 2026)

Creating a new plugin: 9 (June 7th 2026)

Creating a new plugin: 8 (June 4th 2026)

Creating a new plugin: 7 (May 31st 2026)

Creating a new plugin: 6 (May 28th 2026)

Creating a new plugin: 5 (May 26th 2026)

Creating a new plugin: 4 (May 23rd 2026)

Creating a new plugin: 3 (May 22nd 2026)

Creating a new plugin: 2 (May 20th 2026)

Creating a new plugin: 1 (May 17th 2026)

The 'Space' plugins (May 7th 2026)

Creating PBR materials (March 24th 2026)

Data Storage - Then and Now (March 6th 2026)

Old Poser assets (March 2nd 2026)

More Noise, please (January 18th 2026)

Using GIT in VS 2022 (December 26th 2025)

Handling missing plugins (December 12th 2025)

Plugin compatibility with R2026 (November 24th 2025)

Affinity is now free! (November 3rd 2025)

World Creator 2025.1 (October 10th 2025)

So that was Cinema R2026? (September 19th 2025)

How to browse 3D assets (August 24th 2025)

Using Unity assets in Cinema 4D (August 15th 2025)

Plant Factory->Cinema 4D->World Creator (August 12th 2025)

Viewing glTF files (August 9th 2025)

Tessellation part 2 (August 5th 2025)

Shader writing with OSL - 3 (July 11th 2025)

Tessellation (June 23rd 2025)

Creating plants for C4D (June 15th 2025)

Adobe alternatives (May 28th 2025)

Using Graswald assets in C4D (May 7th 2025)

Which Mac for plugin development? (May 3rd 2025)

Why do plugin writers do it? (April 11th 2025)

Updating StarScape (February 26th 2025)

Using Cinema 4D shaders in Redshift (January 31st 2025)

PHP and MySQL (December 19th 2024)

Shader writing with OSL - 2 (November 11th 2024)

Shader writing with OSL (October 29th 2024)

StarScape (September 25th 2024)

Converting plugins from C4D 2024 to 2025 (September 16th 2024)

Cinema 4D 2025 and macOS plugins (September 15th 2025)

© 2021-2026 Microbion. All Rights Reserved.