Skip to content

Commit

Permalink
Update ribbon methods
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonOresten committed Nov 15, 2023
1 parent e7593e3 commit 21211bb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/ribbon/render.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function ribbon!(
color_vectors::AbstractVector{<:AbstractVector{<:RGB}},
)
has_missing_ss(protein) && assign_secondary_structure!(protein)
remove_singleton_strands!.(protein)
remove_singleton_strands!.(protein) # TODO: don't mutate
@assert length(protein) == length(color_vectors)
@assert length.(protein) == length.(color_vectors)
for (chain, colors) in zip(protein, color_vectors)
Expand All @@ -94,10 +94,13 @@ function ribbon!(
ribbon!(container, protein, color_vectors)
end

function ribbon(protein::Protein)
scene = Scene(backgroundcolor=:black)#, axis=(;type=Axis3, aspect=:data))
function ribbon(
protein::Protein,
color_vectors::ColorScheme = [smooth_color_vector(colorscheme, length(chain)) for chain in protein],
)
scene = Scene(backgroundcolor=:black)
cam3d!(scene)
ribbon!(scene, protein)
ribbon!(scene, protein, color_vectors)
center!(scene)
display(scene)
end

0 comments on commit 21211bb

Please sign in to comment.