Protein Visualization in the Wolfram Language

Shotik Shaha demonstrates Wolfram's protein visualization tools, which render amino acids and peptides in 2D and 3D, show protein structure from primary to quaternary levels, and map residue contacts and distances. Functions like biomoleculePlot3D, proteinBackboneAtomPlot, and proteinContactMap work for both teaching and research.
Chapters
Good morning everyone. I'm Shotik Shaha, a bioinformatics developer at Wolfram Alpha. And today I'm going to be talking about protein visualization in the Wolfram language, primarily focusing on the applications of the recently published Wolfram Protein Visualization packlet. And hopefully by the end of the talk you will be able to create your own elegant protein structures like this using the packlet. Before I start, I would like to mention a few things about the talk. So. So then this notebook that I'll be sharing with you today throughout my presentation will be shared as a community post once the talk is done. And if you want to, if you have any questions about my talk, feel free to feel free to post those questions in the YouTube or Twitch live channels. I'll try to address them as I go along. And the questions that I won't be able to address today because of the interest of time, I would make sure that I will address that I address those questions in the community post. Another thing I would like to point out is like all the images and plots that I will show today, except one, is actually generated using the Wolfram language, which just goes to show the power and versatility of the language itself. And because of the interest of time, I have generated all the outputs in advance. But people who are new to the language, this is how an input cell look looks like. And if you just click on this and press Shift and enter, then you can generate the outputs using the notebook. So without further ado, I'd like to start and would like to welcome you to my talk. So what are proteins? Proteins are nothing but covalently linked amino acids which are folded into very specific structures. And amino acids are pretty simple organic molecules. This output is created by Jason Biggs of my team and this shows a general structure of the amino acids. So it does have five important features to it. The first one is being the central alpha carbon in blue and hydrogen atom attach to the alpha carbon, a carboxyl group, an amino group and an R group. So the hydrogen alpha carbon amino and carboxyl groups are invariant or does not vary across amino acids, but the R group does. And all the richness that you see see in the world of amino acids and proteins in the world is because of this variability in this R group. So you can visualize the 2D structure of amino acids in Wolfram language using the molecule plot function. So this is the command, and this Command generates the 20 most commonly found amino acids in naturally occurring protein as a 2D plot here. So you can also Visualize amino acids in 3D using the molecule plot 3D function in the language. And here you see five of those amino acids with their names. And this is obviously much more interactive than the 2D structures. So moving on. So when amino acids are covalently linked together, these are called peptides. And peptides does not have any specific structures like protein. That's one of the main differences between peptides and proteins. And. And you can visualize peptides in the old frame language in 2D using this resource function created by Yarn of my team. And using this command you can generate 2D structure of the peptide and you can give the sequence as one letter amino acid codes. And as you can see this is like a dipeptide here consisting of tryptophan and aniline alanine respectively, color coded. And this bond between the amino group and the carboxyl group is called the peptide bonds. When you are thinking of like peptides or protein itself. You can also visualize polypeptides in 2D using this function. As you can see here, it's also possible to visualize peptides in three dimension using this function. Biosequence molecule plot 3D created by Yannigan. And this is one of the examples of the output. And this can be a pretty interactive and I believe a powerful tool for educational purposes too. So there is a question that will examples be available? So I believe like once you have access to the notebook through the community post, you can create your own examples for sure. And I have also written a community post on using the packlet itself. So the link is also there. So definitely you will have plenty of examples through this, through this talk. And you can definitely generate your own using the same command but varying the inputs. I hope that addresses the questions question. So. So because you need one letter amino acid code to generate this plot, Yarn had created this great and informative chart of different amino acids with three letter and one letter code here with their structures and other functions that can be useful and also the physical properties which you can use to create your own peptide visualization. So moving on to proteins. So the fundamental difference between peptides and proteins are proteins are polypeptides. But it is folded into very specific shape which is, which is almost completely determined by its sequence of amino acids. And it has a structure is pretty complex, it has different hierarchy of structure. So, so if you can see like this is a primary structure of proteins which is just the sequence of amino acids here which are just. It goes from N to C terminal. And you can imagine like Individual beads of individual colors correspond to one amino acid. And then you can move to secondary structures which are helices and sheets which happens going to hydrogen bonding between respective amino acid backbone atoms. And these and this is called secondary structure. And these secondary structures can itself fold into tertiary structures like this. So this is a structure of NSP2 from SARS CoV2 virus which is a single chain protein. And this structure can arise often because of interaction between side chains, van der Waals forces and so on that gives rise to this tertiary structure. So now this is just single chain protein. But you often see in nature many multimeric protein like this which is called the quaternary structure. And this is a structure of the human deoxyhemoglobin. And these are all created in the Wolfram language using biomolecule plot 3D function, which I'll talk about in a second. So now let's move to using the protein visualization packlet in the language. And as you can see, so the packlet link is here. You can go to the packlet and see in depth documentation about individual functions that I will talk about today. So it's obviously not won't be possible because of the interest of time to talk about all the like all the versatility or the options available to each function. So this can be a great resource to go and learn more in depth about the function if you want to and if you are interested in a specific function. And I have also previously posted in Wolfram community about how to use the packlet and to get started with the packlet. So this is the link to the community post. So if you have not installed the packlet, so you can just use this command to install the packlet in full language. And I obviously have it installed so I won't run it again. And once you have installed the packlet, every time you quit your session and you want to use the packlet again, you just need to load the packlet using this command and that will get you started with using the packet. So the usual way we are familiar with visualizing the protein structure as I showed here is the ribbon diagram which Jan, Jason and I created during my summer internship at Wolfram. And using this resource function biomolecule plot 3D you can create ribbon diagram like this. So the input that it one of the possible inputs that it can take is this four lettered PDB ID code and each of the experimentally determined protein structure that is available in the protein structure database whose link I'll share at the end of the Talk has a four letter unique PDB ID code so that that that can yield this ribbon diagram using this function. But it does have a lot of advantages. You can clearly see how the helices and shifts are formed and so on. But it does have I believe one disadvantage where the molecular details of the protein is not necessarily shown here, right? You, you can't see the atoms and bonds that the protein has. So because to address this issue, I created the protein backbone atom plot function as a part of the packlet. And this basically shows you the backbone atoms along with the bonds of a protein. So this is the same protein that it shows. It is now color coded in amino based on its amino acid residue. But it can also be color coded based on its chains or atoms which I will touch upon later. So the thing about. So this is definitely interactive, interactive and so on. And this does not have the side chains in it just to make it like cleaner. So it does just have the four backbone atoms per residue. And to see the side chains you can basically use this show side chains option. And for the same protein you can see the side chains and the protein backbone itself. And if you want like I, I also build this function keeping educators in mind. So if you want to teach students about like what are peptide bonds in the context of real proteins, you can use these options like highlight peptide bonds that does show you for the same protein the peptide bonds color coded like this and so on. And you can also show the residue and chain information using the atom display function. So as you can see here, so if you can see my tooltip here. So if you hover around respective atom it does show you like what is the chain, what is the amino acid and what is the residue number. Which can also be helpful if it's like a large protein, right. So as I said at the beginning of explaining this function, you can also visualize the protein structures based on atoms or chains. So backbone color rules option allows you to do that and you can also define a different plot name. So these are three different proteins which are color coded based on chains. So this is the chain to use the backbone color routes as chain or just the residue as I explained before, or just the atoms. Right. And I have the second input here is basically automatic. But if you go to the Packlet website or the packlet link and see this function, you can, you can specify specific colors for residues or atoms if you want respectively and that will give you that color. So it also helps you customize how you want to visualize the protein. So and These are again all interactive. So this is, I think, yeah, so this is like a Lyson and pore. This is like a tandem repeat protein which looks like this. And this is, as I explained, an alpha single gen to. So these are all interactive and you can generate your own like protein plots as you want. And these are like some of the protein structures I created using this function and this plot theme and which I found was kind of like my favorite structures or so on when I was thinking about like documentation and and so on. And you can like, also, if you want to teach again, students, like, you can have the question like, oh, you see this particular protein, why do you see a certain amino acid at the outside of the protein, certain amino acids inside the protein and so on. That can also give them some hints about hydrophobicity or hydrophilicity nature of protein structures of amino acids in the context of protein structures. Moving on to other functions that can be used for educational purposes. So protein backbone atom plot was only one function that I created, thinking about educators in mind, out of the three. And there are two more functions that I would like to talk about that can also be used for educational purposes. The first one being amide plane plot and the second one being dihedral angle plot. So like, amide plane plots basically shows the amide planes in protein backbones along with the backbone. So what is amide plane? Right? So amide planes are basically the planes that contain the peptide bond. So, so to start with, so if you imagine like these, this is a peptide bond, and this is the alpha carbon of amino acid 1 and amino acid 2 of a protein. And this peptide bond has a partial double bond structure because of resonance between the carboxyl oxygen and amide nitrogen. And that gives to this partial double bond character, gives rise to a planar nature of peptide bond where six atoms of adjacent amino acids basically lie in the same plane, which is called amide planes. And in textbooks like this, I, I took this picture from the source. It does show am I planes like this? So I to have like to improve my own understanding also help educators explain mite planes in the context of real proteins to students. I created this function to see like, is it really like, applicable in the context of real protein structures? And to the best of my knowledge, this is probably the first package to offer this visualization in proteins. So if you use the amide plane plot with the PDB id, you can see amide planes in the context of a real protein, which is here, avian polypeptide here. And you can See like the peptide bond and other atoms indeed lie in the same plane here, right? And for large proteins, it might become a little cumbersome to see the amide planes with the backbone. You can definitely see it if you want. But if you want to just see the amide planes, you can use this option of backbone at backbone atoms goes to false. And then you can see just the amide planes of respective proteins. And again, like, these are some of my favorite proteins that I came across. And you can also create just see the MI planes for your favorite proteins using this function. So another very important aspects of protein has to do with dihedral angles. So what is the dihedral angle? Right, so the, the dihedral angle. So the usual notion of angle we are familiar with is between two lines, but dihedral angles is the angle between two planes, as you can see here. You can create like a visualization of dihedral angle using the old from language using this command. And you can also get the value of dihedral angles between the two planes using this command, which is basically 45 degrees as we can guess from here. But what is the role of dihedral angle in the context of proteins? Actually, dihedral angles are very important because dihedral angles are determined by the size of the side chains. And because side chains cannot overlap with each other because of static interactions, you only have specific values of dihedral angles or range of values of dihedral angles in proteins. So this is just like image from one of the one of the plots for one protein created using this function. So as you can see, like dihedral angles are formed. So this is a side chain of proline. So dihedral angles are formed because of this interaction between side chains. And for a given protein here you can have two dihedral angles, φ and ψ. And this is one axis for one dihedral angle. I think this is and for the phi angle. And this is the other axis for another dihedral angle, which is the psi angle. And you can imagine like this two planes will determine the dihedral angle value psi. And the orientation of these two planes in turn will be governed by the orientation of the side chains of the amino acids. So you can to start with, you can get the dihedral angle data in proteins using the Ramachandran angles function. And these dihedral angles was first like was for the scientists to first work on these dihedral angles in the context of proteins was GN Ramachandran. And so like this Ramachandran angles function basically gives you the value of the dihedral angle for a given protein, given protein in RADIANS and if you want to get these values in degrees, you can just use this command with the PDB id that will give you the values of the dihedral angle, same degrees. And the Ramachandran plot, which is an extremely well known function in the context of protein structures, will give you the dihedral angle distribution same in for a given protein here. This is for the cubic insulin crystals here. And if you turn this residue colors option to true, it will show you different colors for the different residues. And not only that, if you hover around specific points, it will tell you what is the chain and the residue number and the amino acid name and so on, making it much more interactive and can also be used for research or teaching purposes. And this function also has a lot of other options which you can see in the documentation pages. So moving on to the dihedral angle plot. When I was developing this function, so I developed this before the dihedral angle plot. A question that was always in my mind is how do I visualize this distribution of dihedral angles in the context of like real proteins, right? Like in the context of protein structures. So that's why I created the dihedral angle plot, which can show you interactively the dihedral angle planes. And if you hover over a specific atom, you can basically see now not only the residue information, but also the specific value of the dihedral angle. And this will help you even yourself understand or teach students. Like, where is this value of dihedral angle coming from in the context of protein backbones? And you can also do more. So you can use this highlight commands to highlight the axis that gives rise to the dieter angles, right? So the NC alpha bond is the axis for phi angle and CC alpha bond is the axis for psi angle that I talked about at the beginning of exploration training this function. And that can make it much more powerful to explain. Like, okay, this is the specific phi angle and this is the specific psi angle values for these proteins. And this is the axis that is giving rise to the dihedral angles. And that's how you can understand where these values are coming from. So one thing I would like to show is if you, if you use just shift, this helps you. So just press shift and this helps you hover this image and center this image if you want to focus on a specific residue. And if you want to, if you press command, then it allows you to zoom in or zoom out. And you can zoom in and zoom out and then basically move this structure to highlight specific residues and points and teach about dihedral angles for us. Just a specific residue in the context of proteins. So that makes it much more interactive and useful when you are trying to explain dihedral angles or understand dihydro language itself. And this also helped me understand the notion of dihedral angles in the context of protein much better. And also like using combining this with the options of protein backbone atom plots like show side chains will help you basically appreciate more the role of side chains and giving rise to specific dihedral angle. As you can see here in this protein, you can see the side chance and you can basically zoom in or zoom out to see like how large or small side chains gives rise to specific values of dihedral angles. So this is are a few functions that can be used to explain protein structures primarily for educational purposes. But there are quite a few functions that I wrote for research purposes also primarily. So protein contact maps are well known in structural biology. And these are basically contact maps of pairwise residue distances in protein backbone. So, so alpha carbon trace is basically just smooth trace between like alpha carbons of individual residues. And you can generate the alpha carbon trace of a given protein using this function. And as you can see, this just shows the alpha carbon trace between. Between alpha carbon trace between the backbone of like specific residues. Right? And you can imagine like, if you want to have a 2D visualization of what's going on in the geometric feature of this backbone, you would like to see it in terms of Pry's residue. And that's where protein contact map comes into play. And this function with just this protein creates the contact map for this same protein. Right? And it shows you like, so this is like the same chain and this is basically different chain. So this is like along the diagonal, you can imagine this goes from 1 to 221. So this protein has 221 residues in total. And it does have two chains, as you can imagine. Like there are two squares. So it has two chains and it's most likely symmetric chains because it has the same structure. And it can show you a flattened version of the map of the residual residual distances in the protein. And this is really informative, but this is just not where the function applicability stops. You can use options to make it more richer. So here I've used the option of cutoff to show a binarized version of the contact map. And you can also define the colors as you want to define, like what will be the. So let me first explain what this cutoff is. Right. So this cutoff basically indicates that if a pair of residue is within 15 angstroms then color it in US1 color. And if it's above 15amp from color it in a different color. And those colors you can define here. And as you can see, obviously as expected, same chains residues are closer and that's why you see more bright spots here than here. And using this cutoff, you can create a binary version of the contact map to see like, more like if you want to like highlight some geometric feature. This does give you that flexibility too. One thing I've always wanted to do when creating this function is like this plot is just geometric in nature, right? You don't have any sequence information of the plot. It just tells you like how, what is the geometry of the backbone. So I did want to create a unique protein fingerprint. So to create that fingerprint, you do need the sequence information along this contact map, which you can do using the show residual option. So as you can see here, this is like a different protein. But in this contact map, if you set show residual option to true, it also gives you the barcode of the sequence. And this now becomes a unique fingerprint of a protein because the structure of the protein or the geometry of the protein in some sense is uniquely defined by the, by the contact map. And you also need to know the geometry of the structure. So it does give you 2D version of what the sequence is and what, what, how the geometry of the backbone looks like. And this obviously the, the color map basically, color bar basically tells you what is the distance between protein and same chance, like close together. That's why it's darker and different chains lie farther apart. That's why it's like, like lighter in color. So, so you can do more. So of course like you can define and you can visualize just the. If you want to visualize interaction between specific chains or the same chains, you can use the chains option. So this basically shows for the same protein interaction between the same chains A and A. And now you can see like, if you want to highlight this just A and a NA interaction chain A and A interaction, you can just use this change function to show like how the backbone of a specific chain will look like. And you can also do that same for different chains. So this is the interaction between A and B chains. And for the different chains, the first chain residues lie along the row and the second chain residues lie along the column. So this is not all you can actually just generate the raw data for the contact map using this residual distance matrix function. That gives you much more flexibility and allows you to do more with the data itself. If you want to generate something more like catered to your own research or educational needs, you can definitely use the data to go beyond this contact map. And these are some of the elegant contact maps I found for specific proteins, which I found was interesting and wanted to share with you. The PDB ID is given, the maximum distance between residues is given and this is the color map for the same. And in some sense like if you want to teach about it or contact maps, you can ask the question like what is the symmetry in this protein? Does it have any symmetry? Or what is what fold symmetry is there, if any. So if you just focus on this right 3dn9 you can imagine like this has six fold symmetry because there's 1, 2, 3, 4, 5, 6, 6 diagonals looking the same way. So it can help one understand the symmetries in protein like in much more detail just from geometry, without the information about residues or sequence. So contact maps is a standard and a great way to visualize residue residue distances in proteins. But I did want to highlight a specific feature that often contact map for large proteins can miss. So if you want to see what residues are important in terms of interchange interactions, it might be hard to point out from here because for large proteins it's very difficult. But you can do the same using in the form of a graph. So that's why I created the protein contact graph log function. And this basically is a circular graph that in the tooltip you can see the residue information for individual residues. And this shows you chain from N to C terminal. So this has two chains, A and B. And I know from my experience that this is a symmetric protein. That's why you see certain kinds of symmetry. But more than that, it does tell you that the interchange interaction, that these are the residues that is responsible for interchange interactions more than other residues. Right. Which can be lost in a contact map. And here I have set a default cut off of 8 Angstrom. But you can change the cut off as you want by setting the cutoff option like the protein contact map. So the color bar again shows distances of residues up to 8 angstroms. So if the residues are farther than 8 angstrom there it won't be connected by NHL. So this can be really helpful to understand like the gross topology of a protein structure which is often lost in a contact map. And you can like one of my favorite options for this function is actually scale vertex size. So what it does is basically the scale vertex size set to true scales the size of the residue or amino acid or nucleic Acid based on its connectivity. So the more connected a residue is, the larger its size is. So that can help you for a large protein identify important residues or residue pairs or set of residues that is closely, that is close to us other residues. So as you can see, like just for example, for this chain, right, which is I think chain I, you can see this residue must be pretty important. And immediately as you hover your mouse around it, you know, like, okay, this residue does lie pretty close to other residues compared to like maybe here. So this gives you an idea and helps you appreciate like the gross topology, as I said, of a protein structure if it's really complicated and helps you extract features of a protein structure that you can't from from a contact map. So and again, like you can do more with the residue with this data because you can generate the raw data using the residue distance graph function using this command. And this tells you like, if the residual list is flattened, like not taking into the chain information into account, this does tell you like how much which residues are connected to which. And combining this with the residual distance matrix function, you can generate your own graph because the residual distance matrix function will tell you like what is the specific distance between this and this residue here. So these are some of the, these are some of the elegant contact maps, contact graphs I found using this function. And a lot of things can be like extracted if you look at the structures long enough. So a few things that I might point out is like again, the symmetry, right? So some of these functions are symmetric. Some of these functions are a lot not like, this is probably not symmetric because of course the chains are different. It, it has a very rich pattern, but it's not a symmetric one. But this structure is definitely symmetric because it has seven fold symmetry. It has the same kind of structure. So does this, this other three fold symmetry. I know this from experience and this helps you. And here like all the structures are also using scale vertex size or the vertex is scaled based on its connectivity. So this does help you see in like, like the broader scale structural aspects or the coarse grain structural aspects of a protein, which I think can also be very useful on top of the contact maps. So in summary, like, what I talked about today is of course the power of Wolfram language in not only visualizing proteins, but also like just amino acids and peptides and how powerful the language can be itself in being a really good tool for educational and research purposes. And this is just to summarize the capabilities of the packlet itself. Starting from amide planes dihedral angle plots, contact graphs, contact maps, Ramachandran angles and so on, and also generating the data you need to do much more in this domain. And of course in the coming months, many more functions will be added to make it more comprehensive when it comes to analyzing protein structure using the language. And I would like to acknowledge my supervisor, Jason Biggs, without which this packlet honestly would not be possible. He helped me a lot with figuring out like, the tools I need to write a good package and the software development, the tips and tricks of software development, because I was not trained in software development myself. So he helped me a lot to make this code as efficient as it can be. Also helped with the documentation. And again, the whole Wolfram Alpha chemistry team, because I benefited a lot from their knowledge and expertise. Again, like I was the last time I did any chemistry or biochemistry was in my high school, which was at least a decade ago. So without their knowledge and guidance, I wouldn't be able to develop this packlet in such a short time. So, like, kudos to the team and my supervisor, Jason Biggs. And these are two useful resources you can look at. So this is the protein structure database. So if you just click on the link here, you will be guided to the database and you can just in the search bar give one of this one of the proteins you are interested in, the PDB IDs for that and that will let you know a lot more about the structure itself. It's pretty interactive and nice. And this is one instructional video on protein structure that I found pretty interesting and amusing. So if you are new to this world like me, feel free to watch this video and you will gain some more knowledge and insights on protein structure itself. So with this I'd like to thank you for your time and feel free to ask me any questions that you have. And thank you so much for coming.
More from Guy

Cheryl Strauss Einhorn | The Human Edge: Smarter Decisions in the Age of AI | Talks at Google

Rachel Glennerster | Innovation and the Center for Global Development | Talks at Google

Rebecca Winthrop | Rethinking the Purpose of Education in the Age of AI | Talks at Google

Dr. Robert Wachter | A Giant Leap: How AI Is Transforming Healthcare... | Talks at Google






