@@ -7,6 +7,7 @@ export VARNA, R2R, plot_structure
77
88function __init__ ()
99 @require CairoMakie= " 13f3f980-e62b-5c42-98c6-ff1f3baf88f0" include (" plot_structure_makie.jl" )
10+ @require UnicodePlots= " b8865327-cd53-5732-bb35-84acbb429228" include (" uniplot.jl" )
1011end
1112
1213include (" plot_structure.jl" )
@@ -18,13 +19,14 @@ include("r2r.jl")
1819 plot_structure (" (((...)))" ; sequence= " GGGAAACCC" )
1920 # TODO : how to precompile but using @require from Requires.jl?
2021 # measure: are these precompile statements improving TTFP?
22+ # uniplot("(((...)))")
2123 # plot_structure_makie("(((...)))")
2224 # plot_structure_makie("(((...)))"; sequence="GGGAAACCC")
2325end
2426
25- # We define the docstring of plot_structure_makie here so it's always
26- # available, even if the plot_structure_makie implementation wasn't
27- # included because CairoMakie was not loaded.
27+ # We define the docstrings of plot_structure_makie and uniplot here so they're always
28+ # available, even if they weren't loaded via @require in __init__().
29+
2830"""
2931 plot_structure_makie(structure; [sequence, savepath, layout_type, colorscheme])
3032
@@ -35,4 +37,16 @@ PlotRNA with `using CairoMakie, PlotRNA`.
3537"""
3638function plot_structure_makie end
3739
40+ """
41+ uniplot(dbn; title, width, height)
42+
43+ Plot secondary structure using UnicodePlots, usually to show inside a
44+ terminal.
45+
46+ Using this function requires UnicodePlots to have been loaded before
47+ PlotRNA with `using UnicodePlots, PlotRNA`.
48+ """
49+ function uniplot end
50+
51+
3852end # module PlotRNA
0 commit comments