-
Notifications
You must be signed in to change notification settings - Fork 0
/
quast_evaluator_cli.r
62 lines (44 loc) · 1.49 KB
/
quast_evaluator_cli.r
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
#!/usr/bin/Rscript
library(docopt)
options(warn=1)
source("quast_evaluator.r")
'Usage:
quast_evaluator_cli.r new <assemblers.tsv> <info.tsv> -o DIRECTORY [-c FILE] [-h]
quast_evaluator_cli.r reuse <combinedRef.tsv> <ref.tsv> -o DIRECTORY [-c FILE] [-h]
-h --help
-o DIRECTORY specify optional output directory [default: ./]
-c FILE Plot configuration tsv file. The following columns are allowed: plot (name of the plot), min (Minimum plot scale) and max (Maximum plot scale).
' -> doc
options <- docopt(doc)
outputPath = normalizePath(options[["-o"]])
plotConfPath = options[["-c"]]
newModus = options[["new"]]
if(newModus){
assemblersPath = normalizePath(options$assemblers.tsv)
infoPaths = normalizePath(options$info.tsv)
if(!is.null(plotConfPath)){
plotConfPath = normalizePath(plotConfPath)
}
# initialize dataframes
init(assemblersPath, infoPaths)
# read in additional the data
prepareData(plotConfPath = plotConfPath)
# build the plots
buildPlots(outputPath)
# export the tables
writeTables(outputPath)
}
reuseModus = options[["reuse"]]
if(reuseModus){
combinedRefPath = normalizePath(options$combinedRef.tsv)
refPath = normalizePath(options$ref.tsv)
if(!is.null(plotConfPath)){
plotConfPath = normalizePath(plotConfPath)
}
# prepare the data
prepareData(existingCombinedRefPath = combinedRefPath, existingRefPath = refPath, plotConfPath = plotConfPath)
# build the plots
buildPlots(outputPath)
# export the tables
writeTables(outputPath)
}