MurrellGroup / ProtPlot.jl

Protein ribbon plots implemented in Julia using Makie
MIT License
13 stars 1 forks source link
julia makie plot protein ribbon

ProtPlot

Latest Release MIT license Build Status Coverage

ProtPlot is a Julia package for rendering 3D protein ribbon using Makie.jl.

Overview

ProtPlot exports the Ribbon plot:

Examples

A ribbon plot is constructed from a Vector{Backboner.Protein.Chain}, which you can obtain from a PDB file using the exported readpdb function. For convenience, argument conversion methods are defined, so you can also pass:

using GLMakie # use the GLMakie backend
using ProtPlot

# Create and display a ribbon plot in an interactive window
ribbon_scene("test/data/1ASS.pdb", backgroundcolor=:black, colormap=:jet)

plain gradient

Customizing colors

Use the colors keyword argument to customize colors at the residue level. This argument should be a vector of vectors, where each vector contains either:

# Load protein data from a PDB file
chains = readpdb("test/data/1ASS.pdb")

colors = rand.(length.(chains))

ribbon_scene(chains, colors=colors, colormap=:hsv)

random colors

Attributes

You may customize the geometry of the ribbon by specifying the value of attributes in the keyword arguments of your call. Here's a list of available attributes and their defaults:

Camera controls

Makie allows programmatic control over the camera. Use the camcontrols keyword to control the initial view in a ribbon_scene call:

ribbon_scene("test/data/1ASS.pdb", camcontrols=(; lookat=Vec3f(30, 0, 60), eyeposition=Vec3f(160, -75, 0), upvector=Vec3f(0, 0, 1)))

camera