-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathRakefile.iop_connections
68 lines (50 loc) · 1.51 KB
/
Rakefile.iop_connections
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
64
65
66
67
68
require 'rubygems'
require 'fileutils'
require 'rake/clean'
###
# fetch the data
desc "Fetch collaboration data"
file 'collaborations.xls' do
sh "wget -O collaborations.xls 'http://github.com/cassj/my_bioinfo_scripts/raw/master/collaborations.xls'"
end
CLOBBER.include('collaborations.xls')
CLEAN.include('collaborations.xls')
###
# fetch the required scripts
###
desc "Fetch convert_excel.pl"
file 'convert_excel.pl' do
sh "wget -O convert_excel.pl 'http://github.com/cassj/my_bioinfo_scripts/raw/master/convert_excel.pl'"
end
desc "draw_iop_collaborations.R"
file 'draw_iop_collaborations.R' do
sh "wget -O draw_iop_collaborations.R 'http://github.com/cassj/my_bioinfo_scripts/raw/master/draw_iop_collaborations.R'"
end
desc "Fetch all required scripts"
task :fetch_all_scripts => ['convert_excel.pl','draw_iop_collaborations.R'] do
end
CLEAN.include('convert_excel.pl')
CLEAN.include('draw_iop_collaborations.R')
CLOBBER.include('convert_excel.pl')
CLOBBER.include('draw_iop_collaborations.R')
###
# Convert excel file to csv
###
desc "Convert excel to csv"
task :excel2csv => ['collaborations.xls', 'convert_excel.pl'] do
sh "perl convert_excel.pl collaborations.xls"
end
CLEAN.include("*.csv")
CLOBBER.include("*.csv")
###
# Generate pdf graphic
###
desc "Make PDF Plot"
file "collaboration.pdf" => ['excel2csv','draw_iop_collaborations.R' ] do
sh "R --vanilla --slave< draw_iop_collaborations.R"
end
CLOBBER.include("collaboration.pdf")
###
# Do everything by default.
###
task :default => ['collaboration.pdf']