Skip to content

Commit

Permalink
return proper oneletter code in contourf, for custom residue types ha…
Browse files Browse the repository at this point in the history
…ving other than 3 letter codes (SIRAH, for example)
  • Loading branch information
lmiq committed Aug 28, 2024
1 parent b6ad2e6 commit 0e50bf8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ext/Plotting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ function Plots.contourf(
tick_labels = rc.xticks[2][tick_range]
xticks = if oneletter
for i in eachindex(tick_labels)
tick_labels[i] = PDBTools.oneletter(tick_labels[i][1:3]) * "$(rc.resnums[i])"
resnum = "$(rc.resnums[i])"
# The following will allow custom residue names to be identified
# in the tick label string, by removing the residue number
residue_name = string(strip(tick_labels[i][1:(first(findlast(resnum, tick_labels[i]))-1)]))
tick_labels[i] = PDBTools.oneletter(residue_name) * resnum
end
(tick_marks, tick_labels)
else
Expand Down

0 comments on commit 0e50bf8

Please sign in to comment.