Skip to content

Commit 75ecd1c

Browse files
committed
rename R2R.R2Rplot => R2R.Plot, r2r() => run_r2r()
1 parent 700e9a1 commit 75ecd1c

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

src/r2r.jl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,35 +86,35 @@ function _runcmd(cmd::Cmd)
8686
return exitcode, out, err
8787
end
8888

89-
struct R2Rplot
89+
struct Plot
9090
svg::String
9191
end
9292

93-
function Base.showable(mime::Type{T}, p::R2Rplot) where {T <: MIME}
93+
function Base.showable(mime::Type{T}, p::Plot) where {T <: MIME}
9494
if mime === MIME"image/svg+xml"
9595
return true
9696
end
9797
return false
9898
end
9999

100-
function Base.show(io::IO, mime::MIME"image/svg+xml", p::R2Rplot)
100+
function Base.show(io::IO, mime::MIME"image/svg+xml", p::Plot)
101101
# TODO: why doesn't the following signature work? claims there is
102102
# no method to call for MIME"image/svg+xml", but
103103
# MIME"image/svg+xml" <: MIME ???
104-
# function Base.show(io::IO, mime::T, p::R2Rplot) where {T <: MIME}
104+
# function Base.show(io::IO, mime::T, p::Plot) where {T <: MIME}
105105
println(io, p.svg)
106106
end
107107

108108
function plot(msa::MSA; kwargs...)
109-
ps, res, out, err = r2r(msa; kwargs...)
110-
return R2Rplot(res)
109+
ps, res, out, err = run_r2r(msa; kwargs...)
110+
return Plot(res)
111111
end
112112

113-
function r2r(msa::MSA;
114-
GSC_weighted_consensus::Bool = true,
115-
identity_levels = [0.97, 0.9, 0.75],
116-
present_levels = [0.97, 0.9, 0.75, 0.5],
117-
max_noncanon::Real = 0.1)
113+
function run_r2r(msa::MSA;
114+
GSC_weighted_consensus::Bool = true,
115+
identity_levels = [0.97, 0.9, 0.75],
116+
present_levels = [0.97, 0.9, 0.75, 0.5],
117+
max_noncanon::Real = 0.1)
118118
# TODO
119119
# - output file type: svg or pdf
120120
# - assertions on identity_levels, present_levels, max_noncanon

test/r2r.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using Test
22
using PlotRNA: R2R
33
using BioStockholm: MSA
4-
using PlotRNA.R2R: R2Rplot
54

65
const R2R_MSA = [
76
parse(MSA,
@@ -17,17 +16,17 @@ MSA{Char}(; seq = Dict("a" => "GAAAC", "b" => "UAAAA"),
1716
GC = Dict("SS_cons" => "<...>")),
1817
]
1918

20-
@testset "R2R.r2r" begin
19+
@testset "R2R.run_r2r" begin
2120
showtestset()
2221
Tres = Tuple{Int, String, String, String}
2322
for msa in R2R_MSA
24-
@test R2R.r2r(msa) isa Tres
23+
@test R2R.run_r2r(msa) isa Tres
2524
end
2625
end
2726

2827
@testset "R2R.plot" begin
2928
showtestset()
30-
Tres = R2Rplot
29+
Tres = R2R.Plot
3130
for msa in R2R_MSA
3231
@test R2R.plot(msa) isa Tres
3332
end

0 commit comments

Comments
 (0)