-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_RABBIT.jl
64 lines (58 loc) · 1.61 KB
/
install_RABBIT.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
function tryusing(pkgname::AbstractString)
try
@eval using $(Symbol(pkgname))
catch
@eval Pkg.add($pkgname)
@eval using $(Symbol(pkgname))
end
end
using Pkg
tryusing("ArgParse")
function parse_commandline()
s = ArgParseSettings()
@add_arg_table s begin
"--isdev"
help = "if true, pakcages will be developped instead of being added"
arg_type = Bool
default = false
end
return parse_args(s)
end
function main()
println(PROGRAM_FILE)
parsed_args = parse_commandline()
isdev = parsed_args["isdev"]
installstr = isdev ? "develop" : "add"
@info string("Start to ", installstr, "RABBIT packages...")
filedir = abspath(dirname(@__FILE__),"packages")
println("Install RABBIT from ",filedir)
pkgls = [
"HMM",
"Pedigrees",
"MagicPrior",
"MagicBase",
"MagicSimulate",
"MagicReconstruct",
"MagicCall",
"MagicFilter",
"MagicImpute",
"SpectralEmbedding",
"MagicLD",
"MagicLinkage",
"MagicMap",
"MagicScan",
"RABBITCLI"
]
Pkg.activate()
rabbit_url = "https://github.com/Biometris/RABBIT"
@time for pkg in pkgls
@info string(installstr, " ", pkg)
if isdev
Pkg.develop(PackageSpec(path=joinpath(filedir,pkg)))
else
Pkg.add(PackageSpec(url=rabbit_url,subdir=string("packages/",pkg)))
end
end
return 0
end
main()