@@ -5,25 +5,9 @@ module VARNA
55# `-foo` : error, no argument for option foo
66# `-foo bar` : no error or warning
77
8- using Scratch: @get_scratch!
9-
10- const _download_url = " https://varna.lri.fr/bin/VARNAv3-93.jar"
11-
12- # this will be filled in by `__init__()`
13- _download_cache = " "
14-
15- function __init__ ()
16- global _download_cache = @get_scratch! (" jar" )
17- end
18-
19- function _download_varna_jar (url= _download_url)
20- fname = joinpath (_download_cache, basename (url))
21- if ! isfile (fname)
22- @info " downloading VARNA jar file from $url "
23- download (url, fname)
24- end
25- return fname
26- end
8+ # TODO , this doesn't work: using LazyArtifacts: @artifact_str
9+ using LazyArtifacts
10+ _get_varna_jar () = artifact " VARNAv3-93_jar/VARNAv3-93.jar"
2711
2812# VARNA-3.93 supported formats: JPEG,PNG,EPS,XFIG,SVG
2913const _map_fileendings_to_mime = Dict (
@@ -187,7 +171,7 @@ function plot(dbn::AbstractString;
187171 fileformat:: AbstractString = " svg" ,
188172 verbose:: Bool = false ,
189173 plot_opts... )
190- varna_jarpath = _download_varna_jar ()
174+ varna_jarpath = _get_varna_jar ()
191175 if length (dbn) != length (seq)
192176 throw (ArgumentError (" structure and sequence must have same length: $(length (dbn)) != $(length (seq)) " ))
193177 end
@@ -226,7 +210,7 @@ function plot_compare(; dbn1::AbstractString,
226210 fileformat:: AbstractString = " svg" ,
227211 verbose:: Bool = false ,
228212 plot_opts... )
229- varna_jarpath = _download_varna_jar ()
213+ varna_jarpath = _get_varna_jar ()
230214 if length (dbn1) != length (dbn2) || length (dbn1) != length (seq1) || length (dbn1) != length (seq2)
231215 throw (ArgumentError (" all structures and sequences must have same length, here they are: " *
232216 " dbn1=$(length (dbn1)) , seq1=$(length (seq1)) , dbn2=$(length (dbn2)) , seq2=$(length (seq2)) )" ))
0 commit comments