genevalidator 1.6.12 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.gitignore +30 -1
- data/.ruby-version +1 -0
- data/.travis.yml +13 -12
- data/Gemfile +4 -1
- data/Gemfile.lock +135 -0
- data/README.md +104 -122
- data/Rakefile +377 -5
- data/aux/gv_results.slim +155 -0
- data/aux/html_files/css/gv.compiled.min.css +8 -0
- data/aux/{files → html_files}/css/src/bootstrap.min.css +0 -0
- data/aux/{files → html_files}/css/src/font-awesome.min.css +0 -0
- data/aux/{files → html_files}/css/src/style.css +0 -0
- data/aux/{files → html_files}/fonts/FontAwesome.otf +0 -0
- data/aux/{files → html_files}/fonts/fontawesome-webfont.eot +0 -0
- data/aux/{files → html_files}/fonts/fontawesome-webfont.svg +0 -0
- data/aux/{files → html_files}/fonts/fontawesome-webfont.ttf +0 -0
- data/aux/{files → html_files}/fonts/fontawesome-webfont.woff +0 -0
- data/aux/{files → html_files}/img/gene.png +0 -0
- data/aux/html_files/js/gv.compiled.min.js +1 -0
- data/aux/{files → html_files}/js/src/bootstrap.min.js +0 -0
- data/aux/{files → html_files}/js/src/d3.v3.min.js +0 -0
- data/aux/{files → html_files}/js/src/jquery-2.1.1.min.js +0 -0
- data/aux/{files → html_files}/js/src/jquery.tablesorter.min.js +0 -0
- data/aux/{files → html_files}/js/src/plots.js +1 -1
- data/aux/{files → html_files}/js/src/script.js +0 -0
- data/aux/{files → html_files}/json/.gitkeep +0 -0
- data/bin/genevalidator +393 -56
- data/exemplar_data/README.md +60 -0
- data/{data/mrna_data.fasta → exemplar_data/mrna_data.fa} +1 -1
- data/{data/protein_data.fasta → exemplar_data/protein_data.fa} +0 -0
- data/genevalidator.gemspec +35 -20
- data/install.sh +92 -0
- data/lib/genevalidator.rb +171 -56
- data/lib/genevalidator/arg_validation.rb +26 -55
- data/lib/genevalidator/blast.rb +44 -99
- data/lib/genevalidator/clusterization.rb +18 -22
- data/lib/genevalidator/exceptions.rb +17 -17
- data/lib/genevalidator/ext/array.rb +21 -4
- data/lib/genevalidator/get_raw_sequences.rb +32 -31
- data/lib/genevalidator/hsp.rb +31 -2
- data/lib/genevalidator/json_to_gv_results.rb +38 -122
- data/lib/genevalidator/output.rb +158 -172
- data/lib/genevalidator/output_files.rb +134 -0
- data/lib/genevalidator/pool.rb +2 -5
- data/lib/genevalidator/query.rb +1 -1
- data/lib/genevalidator/tabular_parser.rb +8 -29
- data/lib/genevalidator/validation.rb +48 -90
- data/lib/genevalidator/validation_alignment.rb +64 -75
- data/lib/genevalidator/validation_blast_reading_frame.rb +13 -9
- data/lib/genevalidator/validation_duplication.rb +85 -84
- data/lib/genevalidator/validation_gene_merge.rb +46 -35
- data/lib/genevalidator/validation_length_cluster.rb +18 -15
- data/lib/genevalidator/validation_length_rank.rb +19 -15
- data/lib/genevalidator/validation_maker_qi.rb +13 -12
- data/lib/genevalidator/validation_open_reading_frame.rb +16 -13
- data/lib/genevalidator/validation_report.rb +1 -1
- data/lib/genevalidator/validation_test.rb +1 -1
- data/lib/genevalidator/version.rb +1 -1
- data/test/overall.rb +1 -1
- data/test/test_all_validations.rb +36 -24
- data/test/test_blast.rb +39 -24
- data/test/test_clusterization_2d.rb +4 -4
- data/test/test_helper.rb +2 -2
- data/test/test_query.rb +16 -20
- data/test/test_validation_open_reading_frame.rb +122 -122
- data/test/test_validations.rb +12 -10
- metadata +94 -79
- data/aux/files/css/genevalidator.compiled.min.css +0 -16
- data/aux/files/js/genevalidator.compiled.min.js +0 -28
- data/aux/json_footer.erb +0 -8
- data/aux/json_header.erb +0 -19
- data/aux/json_query.erb +0 -15
- data/aux/template_footer.erb +0 -8
- data/aux/template_header.erb +0 -19
- data/aux/template_query.erb +0 -14
- data/data/README.md +0 -57
- data/data/mrna_data.fasta.blast_tabular +0 -3567
- data/data/mrna_data.fasta.blast_tabular.raw_seq +0 -53998
- data/data/mrna_data.fasta.blast_tabular.raw_seq.idx +0 -5440
- data/data/mrna_data.fasta.blast_xml +0 -39800
- data/data/mrna_data.fasta.blast_xml.raw_seq +0 -2554
- data/data/mrna_data.fasta.blast_xml.raw_seq.idx +0 -3127
- data/data/mrna_data.fasta.json +0 -1
- data/data/protein_data.fasta.blast_tabular +0 -3278
- data/data/protein_data.fasta.blast_tabular.raw_seq +0 -61295
- data/data/protein_data.fasta.blast_tabular.raw_seq.idx +0 -4438
- data/data/protein_data.fasta.blast_xml +0 -26228
- data/data/protein_data.fasta.blast_xml.raw_seq +0 -9803
- data/data/protein_data.fasta.blast_xml.raw_seq.idx +0 -1777
- data/data/protein_data.fasta.json +0 -1
data/Rakefile
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
require 'rake/testtask'
|
|
2
|
+
GEMSPEC = Gem::Specification.load('genevalidator.gemspec')
|
|
2
3
|
|
|
3
4
|
task default: [:build]
|
|
4
5
|
|
|
5
6
|
desc 'Builds and installs'
|
|
6
7
|
task install: [:build] do
|
|
7
|
-
|
|
8
|
-
sh "gem install ./genevalidator-#{GeneValidator::VERSION}.gem"
|
|
8
|
+
sh "gem install #{Rake.original_dir}/genevalidator-#{GEMSPEC.version}.gem"
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
desc 'Runs tests, generates documentation, builds gem (default)'
|
|
12
|
-
task build: [
|
|
13
|
-
sh
|
|
12
|
+
task build: %i[test doc] do
|
|
13
|
+
sh "gem build #{Rake.original_dir}/genevalidator.gemspec"
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
desc 'Runs tests'
|
|
@@ -18,11 +18,383 @@ task :test do
|
|
|
18
18
|
Rake::TestTask.new do |t|
|
|
19
19
|
t.libs.push 'lib'
|
|
20
20
|
t.test_files = FileList['test/test_*.rb']
|
|
21
|
-
t.verbose =
|
|
21
|
+
t.verbose = false
|
|
22
|
+
t.warning = false
|
|
22
23
|
end
|
|
23
24
|
end
|
|
24
25
|
|
|
26
|
+
desc 'Build Assets'
|
|
27
|
+
task :assets do
|
|
28
|
+
# Requires uglifycss and uglifyjs
|
|
29
|
+
# npm install uglifycss -g
|
|
30
|
+
# npm install uglify-js -g
|
|
31
|
+
assets_dir = File.expand_path('aux/html_files', __dir__)
|
|
32
|
+
`rm #{assets_dir}/css/gv.compiled.min.css`
|
|
33
|
+
`rm #{assets_dir}/js/gv.compiled.min.js`
|
|
34
|
+
sh "uglifycss --output '#{assets_dir}/css/gv.compiled.min.css'" \
|
|
35
|
+
" '#{assets_dir}/css/src/font-awesome.min.css'" \
|
|
36
|
+
" '#{assets_dir}/css/src/bootstrap.min.css'" \
|
|
37
|
+
" '#{assets_dir}/css/src/style.css'"
|
|
38
|
+
|
|
39
|
+
sh "uglifyjs '#{assets_dir}/js/src/jquery-2.1.1.min.js'" \
|
|
40
|
+
" '#{assets_dir}/js/src/bootstrap.min.js'" \
|
|
41
|
+
" '#{assets_dir}/js/src/jquery.tablesorter.min.js'" \
|
|
42
|
+
" '#{assets_dir}/js/src/d3.v3.min.js'" \
|
|
43
|
+
" '#{assets_dir}/js/src/plots.js' '#{assets_dir}/js/src/script.js'" \
|
|
44
|
+
" -m -c -o '#{assets_dir}/js/gv.compiled.min.js'"
|
|
45
|
+
end
|
|
46
|
+
|
|
25
47
|
desc 'Generates documentation'
|
|
26
48
|
task :doc do
|
|
27
49
|
sh "yardoc 'lib/**/*.rb'"
|
|
28
50
|
end
|
|
51
|
+
|
|
52
|
+
##
|
|
53
|
+
#### TRAVELLING RUBY
|
|
54
|
+
##
|
|
55
|
+
|
|
56
|
+
# For Bundler.with_clean_env
|
|
57
|
+
require 'bundler/setup'
|
|
58
|
+
|
|
59
|
+
TMP_DIR = "#{Rake.original_dir}/tmp".freeze
|
|
60
|
+
APP_NAME = "#{GEMSPEC.name}-#{GEMSPEC.version}".freeze
|
|
61
|
+
PLATFORMS = %w[linux-x86 linux-x86_64 osx].freeze
|
|
62
|
+
TRAVELING_RUBY_VERSION = 'traveling-ruby-20150715-2.2.2'.freeze
|
|
63
|
+
TRAVELING_RUBYGEMS_VERSION = 'traveling-ruby-gems-20150715-2.2.2'.freeze
|
|
64
|
+
NOKOGIRI_VERSION = 'nokogiri-1.6.6.2'.freeze
|
|
65
|
+
MAFFT = {
|
|
66
|
+
version: '7.397',
|
|
67
|
+
'linux-x86': 'https://mafft.cbrc.jp/alignment/software/mafft-7.397-linux.tgz',
|
|
68
|
+
'linux-x86_64': 'https://mafft.cbrc.jp/alignment/software/mafft-7.397-linux.tgz',
|
|
69
|
+
osx: 'https://mafft.cbrc.jp/alignment/software/mafft-7.397-mac.zip'
|
|
70
|
+
}.freeze
|
|
71
|
+
BLAST = {
|
|
72
|
+
version: '2.7.1+',
|
|
73
|
+
'linux-x86': 'https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.7.1/ncbi-blast-2.7.1+-x64-linux.tar.gz',
|
|
74
|
+
'linux-x86_64': 'https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.7.1/ncbi-blast-2.7.1+-x64-linux.tar.gz',
|
|
75
|
+
osx: 'https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.7.1/ncbi-blast-2.7.1+-x64-macosx.tar.gz'
|
|
76
|
+
}.freeze
|
|
77
|
+
JQ = {
|
|
78
|
+
version: '1.5',
|
|
79
|
+
'linux-x86': 'https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux32',
|
|
80
|
+
'linux-x86_64': 'https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64',
|
|
81
|
+
osx: 'https://github.com/stedolan/jq/releases/download/jq-1.5/jq-osx-amd64'
|
|
82
|
+
}.freeze
|
|
83
|
+
CSVTK = {
|
|
84
|
+
version: '0.14.0',
|
|
85
|
+
'linux-x86': 'https://github.com/shenwei356/csvtk/releases/download/v0.14.0/csvtk_linux_386.tar.gz',
|
|
86
|
+
'linux-x86_64': 'https://github.com/shenwei356/csvtk/releases/download/v0.14.0/csvtk_linux_amd64.tar.gz',
|
|
87
|
+
osx: 'https://github.com/shenwei356/csvtk/releases/download/v0.14.0/csvtk_darwin_amd64.tar.gz'
|
|
88
|
+
}.freeze
|
|
89
|
+
|
|
90
|
+
desc 'Create standalone GeneValidator packages'
|
|
91
|
+
task :package do
|
|
92
|
+
rm_rf TMP_DIR
|
|
93
|
+
mkdir TMP_DIR
|
|
94
|
+
task('package:build' => ['package:linux-x86', 'package:linux-x86_64', 'package:osx']).invoke
|
|
95
|
+
rm_rf TMP_DIR
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Usage:
|
|
99
|
+
# - Complete run
|
|
100
|
+
# rake package
|
|
101
|
+
# - Just create directories and don't compress
|
|
102
|
+
# rake package DIR_ONLY=1
|
|
103
|
+
namespace :package do
|
|
104
|
+
PLATFORMS.each do |platform|
|
|
105
|
+
task platform => [
|
|
106
|
+
:bundle_install, :reduce_bundle_size,
|
|
107
|
+
"#{TMP_DIR}/#{TRAVELING_RUBY_VERSION}-#{platform}.tar.gz",
|
|
108
|
+
"#{TMP_DIR}/#{TRAVELING_RUBY_VERSION}-#{platform}-#{NOKOGIRI_VERSION}.tar.gz"
|
|
109
|
+
] do
|
|
110
|
+
package_dir = "#{Rake.original_dir}/#{APP_NAME}-#{platform}"
|
|
111
|
+
lib_dir = "#{package_dir}/lib/"
|
|
112
|
+
bin_dir = "#{package_dir}/bin/"
|
|
113
|
+
exemplar_dir = "#{package_dir}/exemplar_data/"
|
|
114
|
+
blast_db_dir = "#{package_dir}/blast_db"
|
|
115
|
+
app_dir = "#{lib_dir}/app/"
|
|
116
|
+
vendor_dir = "#{lib_dir}/vendor/"
|
|
117
|
+
ruby_dir = "#{lib_dir}/ruby/"
|
|
118
|
+
pack_dir = "#{lib_dir}/packages/"
|
|
119
|
+
nokogiri_path = "#{TMP_DIR}/#{TRAVELING_RUBY_VERSION}-#{platform}-" \
|
|
120
|
+
"#{NOKOGIRI_VERSION}.tar.gz"
|
|
121
|
+
ruby_path = "#{TMP_DIR}/#{TRAVELING_RUBY_VERSION}-#{platform}.tar.gz"
|
|
122
|
+
|
|
123
|
+
# set up dir structure
|
|
124
|
+
rm_rf package_dir
|
|
125
|
+
mkdir_p app_dir
|
|
126
|
+
mkdir bin_dir
|
|
127
|
+
mkdir exemplar_dir
|
|
128
|
+
mkdir vendor_dir
|
|
129
|
+
mkdir ruby_dir
|
|
130
|
+
mkdir pack_dir
|
|
131
|
+
|
|
132
|
+
cp_r "#{Rake.original_dir}/bin", app_dir
|
|
133
|
+
cp_r "#{TMP_DIR}/vendor", lib_dir
|
|
134
|
+
|
|
135
|
+
cp "#{Rake.original_dir}/exemplar_data/mrna_data.fa", exemplar_dir
|
|
136
|
+
cp "#{Rake.original_dir}/exemplar_data/protein_data.fa", exemplar_dir
|
|
137
|
+
|
|
138
|
+
cd vendor_dir do
|
|
139
|
+
File.write('Gemfile', GEMFILE_CONTENTS)
|
|
140
|
+
mkdir '.bundle'
|
|
141
|
+
File.write('.bundle/config', BUNDLER_CONFIG)
|
|
142
|
+
|
|
143
|
+
sh "tar -xzf #{nokogiri_path} -C ruby"
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
cd lib_dir do
|
|
147
|
+
sh "tar -xzf #{ruby_path} -C ruby"
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
cd pack_dir do
|
|
151
|
+
process_package(MAFFT[platform.to_sym], 'mafft')
|
|
152
|
+
process_package(BLAST[platform.to_sym], 'blast')
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
cd package_dir do
|
|
156
|
+
File.write(GEMSPEC.name, SCRIPT_CONTENTS)
|
|
157
|
+
sh "chmod +x #{GEMSPEC.name}"
|
|
158
|
+
File.write('Readme.txt', readme_contents(platform))
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
cd bin_dir do
|
|
162
|
+
Dir['../lib/packages/blast/bin/*'].each do |bin|
|
|
163
|
+
ln_s bin, File.basename(bin)
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Copy a version of GV script into the bin directory
|
|
167
|
+
sh "sed 's|SELFDIR}/|SELFDIR}/../|g' #{package_dir}/#{GEMSPEC.name} > #{GEMSPEC.name}"
|
|
168
|
+
sh "chmod +x #{GEMSPEC.name}"
|
|
169
|
+
|
|
170
|
+
# Install JQ
|
|
171
|
+
sh "curl -L #{JQ[platform.to_sym]} -o jq"
|
|
172
|
+
sh 'chmod +x jq'
|
|
173
|
+
|
|
174
|
+
# Install CSVTK
|
|
175
|
+
sh "curl -L #{CSVTK[platform.to_sym]} | tar zxf -"
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
cp_r "#{TMP_DIR}/blast_db", blast_db_dir
|
|
179
|
+
|
|
180
|
+
unless ENV['DIR_ONLY']
|
|
181
|
+
cd Rake.original_dir do
|
|
182
|
+
sh "tar -czf #{APP_NAME}-#{platform}.tar.gz #{APP_NAME}-#{platform}"
|
|
183
|
+
rm_rf package_dir
|
|
184
|
+
end
|
|
185
|
+
end
|
|
186
|
+
end
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
desc 'Install gems to local directory'
|
|
190
|
+
task :bundle_install do
|
|
191
|
+
if RUBY_VERSION !~ /^2\.2\./
|
|
192
|
+
abort "You can only 'bundle install' using Ruby 2.2, because that's " \
|
|
193
|
+
'what Traveling Ruby uses.'
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
cd Rake.original_dir do
|
|
197
|
+
cp 'Gemfile', TMP_DIR
|
|
198
|
+
File.write("#{TMP_DIR}/#{GEMSPEC.name}.gemspec", edited_gemspec_content)
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
cd TMP_DIR do
|
|
202
|
+
Bundler.with_clean_env do
|
|
203
|
+
sh 'env BUNDLE_IGNORE_CONFIG=1 bundle install --path vendor ' \
|
|
204
|
+
'--without development test'
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
cd 'vendor/ruby/2.2.0' do
|
|
208
|
+
cd 'gems' do
|
|
209
|
+
mkdir APP_NAME
|
|
210
|
+
%w[aux lib].each { |d| cp_r "#{Rake.original_dir}/#{d}", APP_NAME }
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
cd 'specifications' do
|
|
214
|
+
cp "#{TMP_DIR}/#{GEMSPEC.name}.gemspec", "#{APP_NAME}.gemspec"
|
|
215
|
+
end
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
mkdir 'blast_db'
|
|
219
|
+
cd 'blast_db' do
|
|
220
|
+
sh 'update_blastdb.pl --decompress swissprot' do |_, e|
|
|
221
|
+
abort 'update_blastdb.pl failed to run.' if e.exitstatus == 2
|
|
222
|
+
# This script returns 0 on successful operations that result in no
|
|
223
|
+
# downloads, 1 on successful operations that downloaded files,
|
|
224
|
+
# and 2 on errors.
|
|
225
|
+
end
|
|
226
|
+
end
|
|
227
|
+
end
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
desc 'Reduce Vendor size'
|
|
231
|
+
task :reduce_bundle_size do
|
|
232
|
+
cd "#{TMP_DIR}/vendor" do
|
|
233
|
+
sh 'rm -f */*/cache/*'
|
|
234
|
+
sh 'rm -rf ruby/*/extensions'
|
|
235
|
+
sh "find ruby/2.2.0/gems -name '*.so' | xargs rm -f"
|
|
236
|
+
sh "find ruby/2.2.0/gems -name '*.bundle' | xargs rm -f"
|
|
237
|
+
sh "find ruby/2.2.0/gems -name '*.o' | xargs rm -f"
|
|
238
|
+
|
|
239
|
+
# Remove tests
|
|
240
|
+
%w[test tests spec features benchmark].each do |dir|
|
|
241
|
+
sh "rm -rf ruby/*/gems/*/#{dir}"
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
# Remove documentation
|
|
245
|
+
%w[README* CHANGE* Change* COPYING* LICENSE* MIT-LICENSE* TODO *.txt *.md *.rdoc].each do |file|
|
|
246
|
+
sh "rm -f ruby/*/gems/*/#{file}"
|
|
247
|
+
end
|
|
248
|
+
%w[doc docs example examples sample doc-api].each do |dir|
|
|
249
|
+
sh "rm -rf ruby/*/gems/*/#{dir}"
|
|
250
|
+
end
|
|
251
|
+
sh "find ruby -name '*.md' | xargs rm -f"
|
|
252
|
+
|
|
253
|
+
# Remove misc unnecessary files
|
|
254
|
+
sh 'rm -rf ruby/*/gems/*/.gitignore'
|
|
255
|
+
sh 'rm -rf ruby/*/gems/*/.travis.yml'
|
|
256
|
+
|
|
257
|
+
# Remove leftover native extension sources and compilation objects
|
|
258
|
+
sh 'rm -f ruby/*/gems/*/ext/Makefile'
|
|
259
|
+
sh 'rm -f ruby/*/gems/*/ext/*/Makefile'
|
|
260
|
+
sh 'rm -f ruby/*/gems/*/ext/*/tmp'
|
|
261
|
+
sh "find ruby -name '*.c' | xargs rm -f"
|
|
262
|
+
sh "find ruby -name '*.cpp' | xargs rm -f"
|
|
263
|
+
sh "find ruby -name '*.h' | xargs rm -f"
|
|
264
|
+
sh "find ruby -name '*.rl' | xargs rm -f"
|
|
265
|
+
sh "find ruby -name 'extconf.rb' | xargs rm -f"
|
|
266
|
+
sh "find ruby/2.2.0/gems -name '*.o' | xargs rm -f"
|
|
267
|
+
sh "find ruby/2.2.0/gems -name '*.so' | xargs rm -f"
|
|
268
|
+
sh "find ruby/2.2.0/gems -name '*.bundle' | xargs rm -f"
|
|
269
|
+
|
|
270
|
+
# Remove Java files. They're only used for JRuby support
|
|
271
|
+
sh "find ruby -name '*.java' | xargs rm -f"
|
|
272
|
+
sh "find ruby -name '*.class' | xargs rm -f"
|
|
273
|
+
end
|
|
274
|
+
end
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
PLATFORMS.each do |platform|
|
|
278
|
+
file "#{TMP_DIR}/#{TRAVELING_RUBY_VERSION}-#{platform}.tar.gz" do
|
|
279
|
+
download_runtime(platform)
|
|
280
|
+
end
|
|
281
|
+
file "#{TMP_DIR}/#{TRAVELING_RUBY_VERSION}-#{platform}-#{NOKOGIRI_VERSION}.tar.gz" do
|
|
282
|
+
download_native_extension(platform, NOKOGIRI_VERSION)
|
|
283
|
+
end
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
def download_runtime(platform)
|
|
287
|
+
sh "curl -L --fail -o #{TMP_DIR}/#{TRAVELING_RUBY_VERSION}-#{platform}.tar.gz " \
|
|
288
|
+
"https://d6r77u77i8pq3.cloudfront.net/releases/#{TRAVELING_RUBY_VERSION}-#{platform}.tar.gz"
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
def download_native_extension(platform, gem_name_and_version)
|
|
292
|
+
sh "curl -L --fail -o #{TMP_DIR}/#{TRAVELING_RUBY_VERSION}-#{platform}-#{gem_name_and_version}.tar.gz " \
|
|
293
|
+
"https://d6r77u77i8pq3.cloudfront.net/releases/#{TRAVELING_RUBYGEMS_VERSION}-#{platform}/#{gem_name_and_version}.tar.gz"
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
def process_package(url, package_name)
|
|
297
|
+
if url.end_with?('.tar.gz', '.tgz')
|
|
298
|
+
mkdir package_name
|
|
299
|
+
cd package_name do
|
|
300
|
+
sh "curl -L --fail #{url} | tar -xzf - --strip-components=1"
|
|
301
|
+
end
|
|
302
|
+
elsif url.end_with?('.zip')
|
|
303
|
+
sh "curl -L --fail #{url} -o #{package_name}.zip"
|
|
304
|
+
sh "unzip #{package_name}.zip"
|
|
305
|
+
mv 'mafft-mac', package_name
|
|
306
|
+
rm "#{package_name}.zip"
|
|
307
|
+
end
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
def edited_gemspec_content
|
|
311
|
+
file_list = Dir['lib/**/**'] + Dir['aux/**/**']
|
|
312
|
+
edited_gemspec = []
|
|
313
|
+
File.readlines('genevalidator.gemspec').each_with_index do |l, index|
|
|
314
|
+
next if index < 4 # skip first four lines
|
|
315
|
+
l = "s.version = '#{GEMSPEC.version}'\n" if l =~ /^\s+s.version/
|
|
316
|
+
l = "s.files = ['#{file_list.join("','")}']\n" if l =~ /^\s+s.files/
|
|
317
|
+
l = "s.add_dependency 'nokogiri', '1.6.6.2'\nend" if l =~ /^end/
|
|
318
|
+
edited_gemspec << l
|
|
319
|
+
end
|
|
320
|
+
edited_gemspec.join
|
|
321
|
+
end
|
|
322
|
+
|
|
323
|
+
GEMFILE_CONTENTS = <<-GEMFILE.freeze
|
|
324
|
+
source 'http://rubygems.org'
|
|
325
|
+
|
|
326
|
+
gem 'bio', '~> 1.4'
|
|
327
|
+
gem 'bio-blastxmlparser', '~> 2.0'
|
|
328
|
+
gem '#{GEMSPEC.name}', '#{GEMSPEC.version}'
|
|
329
|
+
gem 'nokogiri', '1.6.6.2'
|
|
330
|
+
gem 'statsample', '2.1.0'
|
|
331
|
+
GEMFILE
|
|
332
|
+
|
|
333
|
+
SCRIPT_CONTENTS = <<-SCRIPT.freeze
|
|
334
|
+
#!/bin/bash
|
|
335
|
+
set -e
|
|
336
|
+
|
|
337
|
+
# Figure out where this script is located.
|
|
338
|
+
SELFDIR="$(dirname "$0")"
|
|
339
|
+
SELFDIR="$(cd "$SELFDIR" && pwd)"
|
|
340
|
+
|
|
341
|
+
# Tell Bundler where the Gemfile and gems are.
|
|
342
|
+
export BUNDLE_GEMFILE="${SELFDIR}/lib/vendor/Gemfile"
|
|
343
|
+
unset BUNDLE_IGNORE_CONFIG
|
|
344
|
+
|
|
345
|
+
MAFFT_DIR="${SELFDIR}/lib/packages/mafft/mafftdir"
|
|
346
|
+
BLAST_BIN="${SELFDIR}/lib/packages/blast/bin"
|
|
347
|
+
GV_BLAST_DB_DIR="${SELFDIR}/blast_db"; export GV_BLAST_DB_DIR
|
|
348
|
+
|
|
349
|
+
MAFFT_BINARIES="${MAFFT_DIR}/libexec"; export MAFFT_BINARIES;
|
|
350
|
+
|
|
351
|
+
# Run the actual app using the bundled Ruby interpreter, with Bundler activated.
|
|
352
|
+
PATH=${MAFFT_DIR}/bin:${BLAST_BIN}:$PATH exec "${SELFDIR}/lib/ruby/bin/ruby" -rbundler/setup "${SELFDIR}/lib/app/bin/genevalidator" --db "${GV_BLAST_DB_DIR}/swissprot" "$@"
|
|
353
|
+
|
|
354
|
+
SCRIPT
|
|
355
|
+
|
|
356
|
+
BUNDLER_CONFIG = <<-CONFIG.freeze
|
|
357
|
+
BUNDLE_PATH: .
|
|
358
|
+
BUNDLE_WITHOUT: "development:test"
|
|
359
|
+
BUNDLE_DISABLE_SHARED_GEMS: '1'
|
|
360
|
+
CONFIG
|
|
361
|
+
|
|
362
|
+
def readme_contents(platform)
|
|
363
|
+
<<-README
|
|
364
|
+
|
|
365
|
+
--------------------------------------------------------------------------------
|
|
366
|
+
GeneValidator (v#{GEMSPEC.version})
|
|
367
|
+
Website: https://wurmlab.github.io/tools/genevalidator/
|
|
368
|
+
Paper: https://doi.org/10.1093/bioinformatics/btw015
|
|
369
|
+
|
|
370
|
+
Standalone Package for #{platform}.
|
|
371
|
+
This package includes BLAST+ (v#{BLAST[:version]}), MAFFT (v#{MAFFT[:version]}), JQ (v#{JQ[:version]}), CSVTK (v#{CSVTK[:version]}) and the Swissprot BLAST database.
|
|
372
|
+
|
|
373
|
+
Please cite as follows:
|
|
374
|
+
Dragan M‡, Moghul MI‡, Priyam A, Bustos C & Wurm Y. 2015.
|
|
375
|
+
GeneValidator: identify problems with protein-coding gene predictions".
|
|
376
|
+
Bioinformatics, doi: 10.1093/bioinformatics/btw015.
|
|
377
|
+
-------------------------------------------------------------------------------
|
|
378
|
+
|
|
379
|
+
Running GeneValidator with Exemplar Data:
|
|
380
|
+
|
|
381
|
+
cd /path/to/genevalidator/package/
|
|
382
|
+
genevalidator -d blast_db/swissprot exemplar_data/protein_data.fa
|
|
383
|
+
|
|
384
|
+
Run the following to see all options available.
|
|
385
|
+
|
|
386
|
+
genevalidator -h
|
|
387
|
+
|
|
388
|
+
See https://github.com/wurmlab/genevalidator for more usage information.
|
|
389
|
+
|
|
390
|
+
Please contact us if you require any further information.
|
|
391
|
+
|
|
392
|
+
-------------------------------------------------------------------------------
|
|
393
|
+
Genevalidator is licensed under the AGPL-3.0 License.
|
|
394
|
+
|
|
395
|
+
Dependencies packaged with GeneValidator are licensed under their respective licenses:
|
|
396
|
+
BLAST+ (Public Domain), Mafft (BSD), JQ (MIT), CSVTK (MIT) and SwissProt BLAST DB (CC BY-ND 3.0).
|
|
397
|
+
-------------------------------------------------------------------------------
|
|
398
|
+
|
|
399
|
+
README
|
|
400
|
+
end
|
data/aux/gv_results.slim
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
doctype html
|
|
2
|
+
html
|
|
3
|
+
head
|
|
4
|
+
title GeneValidator: identify problems with gene predictions
|
|
5
|
+
script src="html_files/js/gv.compiled.min.js" type="text/javascript"
|
|
6
|
+
link href="html_files/css/gv.compiled.min.css" rel="stylesheet" type="text/css" /
|
|
7
|
+
body
|
|
8
|
+
#spinner1.modal aria-hidden="true" role="dialog" tabindex="-1"
|
|
9
|
+
.modal-dialog
|
|
10
|
+
.modal-content
|
|
11
|
+
.modal-body.text-center
|
|
12
|
+
h2 Loading ...
|
|
13
|
+
i.fa.fa-spinner.fa-5x.fa-spin
|
|
14
|
+
#alert.modal.fade aria-hidden="true" role="dialog" tabindex="-1"
|
|
15
|
+
.modal-dialog
|
|
16
|
+
.modal-content
|
|
17
|
+
.modal-header
|
|
18
|
+
button.close data-dismiss="modal" type="button"
|
|
19
|
+
span aria-hidden="true" ×
|
|
20
|
+
span.sr-only Close
|
|
21
|
+
h4.modal-title Oops, Something went wrong!
|
|
22
|
+
.modal-body
|
|
23
|
+
p This operation is not posible. There seems to be too many queries...
|
|
24
|
+
.modal-footer
|
|
25
|
+
button.btn.btn-default data-dismiss="modal" type="button" Close
|
|
26
|
+
#browseralert.modal.fade aria-hidden="true" role="dialog" tabindex="-1"
|
|
27
|
+
.modal-dialog
|
|
28
|
+
.modal-content.browser-alert
|
|
29
|
+
.modal-header
|
|
30
|
+
button.close data-dismiss="modal" type="button"
|
|
31
|
+
span aria-hidden="true" ×
|
|
32
|
+
span.sr-only Close
|
|
33
|
+
h4.modal-title Incompatible Browser!
|
|
34
|
+
#browseralertbody.modal-body
|
|
35
|
+
p#browseralertText
|
|
36
|
+
strong#mainbrowseralertText Sorry, this feature is not supported in your browser.
|
|
37
|
+
br
|
|
38
|
+
strong Please run the following command in your terminal:
|
|
39
|
+
pre style="background-color: #f2dede"
|
|
40
|
+
| genevalidator serve #{@dirs[:output_dir]}
|
|
41
|
+
p This is because some browsers do not allow access to local files.
|
|
42
|
+
p
|
|
43
|
+
| Alternatively, you can use
|
|
44
|
+
strong Mozilla FireFox
|
|
45
|
+
| to view this file without running the above web server.
|
|
46
|
+
.container
|
|
47
|
+
span.menu_icon.pull-right
|
|
48
|
+
a href="#" onclick="GV.toggleAllPlots(this);"
|
|
49
|
+
i.fa.fa-2x.fa-bar-chart-o
|
|
50
|
+
br/
|
|
51
|
+
span#show_all_plots Show All Charts
|
|
52
|
+
span.menu_icon.pull-right
|
|
53
|
+
a href="https://github.com/wurmlab/genevalidator" target="_blank"
|
|
54
|
+
i.fa.fa-2x.fa-github
|
|
55
|
+
br/
|
|
56
|
+
| Source Code
|
|
57
|
+
span.menu_icon.pull-right
|
|
58
|
+
a href="http://wurmlab.github.io/tools/genevalidator/"
|
|
59
|
+
i.fa.fa-2x.fa-info-circle
|
|
60
|
+
br/
|
|
61
|
+
| About
|
|
62
|
+
.clearfix
|
|
63
|
+
img.logo alt="logo" src="html_files/img/gene.png" /
|
|
64
|
+
.page-title
|
|
65
|
+
h1
|
|
66
|
+
| Gene Validator
|
|
67
|
+
small
|
|
68
|
+
| v#{GeneValidator::VERSION}
|
|
69
|
+
h4.subheading Identify Problems with Gene Predictions
|
|
70
|
+
#overview.text-left style="margin-top:20px"
|
|
71
|
+
#overview_text
|
|
72
|
+
button#overview_btn.btn.btn-primary.btn-sm data-toggle="button" onclick="GV.toggleOverviewBtn();" data-overviewjson="html_files/json/overview.json"
|
|
73
|
+
- if @all_html_fnames.length > 1
|
|
74
|
+
nav
|
|
75
|
+
ul.pagination
|
|
76
|
+
- @all_html_fnames.each_with_index do |file, idx|
|
|
77
|
+
li
|
|
78
|
+
a href="#{File.basename(file)}"
|
|
79
|
+
= idx + 1
|
|
80
|
+
table#sortable_table.table.table-striped.table-collapsed.table-bordered.table-condensed.tablesorter style="margin-top:20px"
|
|
81
|
+
thead
|
|
82
|
+
tr#header
|
|
83
|
+
th #
|
|
84
|
+
th Ranking
|
|
85
|
+
th
|
|
86
|
+
| Sequence Definition
|
|
87
|
+
span data-placement="top" data-toggle="tooltip" title=("Query definition as it apears in the input fasta file.")
|
|
88
|
+
i.fa.fa-question-circle
|
|
89
|
+
th
|
|
90
|
+
| No. Hits
|
|
91
|
+
span data-placement="top" data-toggle="tooltip" title=("Number of non-identical hits found by BLAST.")
|
|
92
|
+
i.fa.fa-question-circle
|
|
93
|
+
- @json_data_section[0][:validations].each do |_short_header, item|
|
|
94
|
+
th.sorter-false
|
|
95
|
+
strong
|
|
96
|
+
= item[:header]
|
|
97
|
+
|
|
|
98
|
+
- if item[:header] == "Length Cluster" || item[:header] == "Gene Merge" || item[:header] == "Main ORF" || item[:header] == "Missing/Extra Sequences"
|
|
99
|
+
span data-placement="top" data-toggle="tooltip" title=("Charts available for this validation")
|
|
100
|
+
i.fa.fa-bar-chart-o.chartIcon
|
|
101
|
+
|
|
|
102
|
+
span data-placement="top" data-toggle="tooltip" title="#{item[:description]}"
|
|
103
|
+
i.fa.fa-question-circle
|
|
104
|
+
th.sorter-false.chart-column
|
|
105
|
+
tbody
|
|
106
|
+
- @json_data_section.each do |row|
|
|
107
|
+
tr data-jsonfile="html_files/json/#{@dirs[:filename]}_#{row[:idx]}.json" data-target="toggle#{row[:idx]}"
|
|
108
|
+
td title="idx" = row[:idx]
|
|
109
|
+
td data-score="#{row[:overall_score]}"
|
|
110
|
+
.ratings
|
|
111
|
+
.empty-stars
|
|
112
|
+
.full-stars style=("width:#{row[:overall_score]}%;")
|
|
113
|
+
td title="Definition" = row[:definition]
|
|
114
|
+
td title=("No. Hits") = row[:no_hits]
|
|
115
|
+
- row[:validations].each do |_short_header, item|
|
|
116
|
+
td class="#{item[:status]}" title="#{item[:header]}"
|
|
117
|
+
== item[:print].gsub(' ', ' ').gsub('; ', '; ')
|
|
118
|
+
- if row[:validations].select { |_short_header, item| item[:graphs] != nil }.map{ |_short_header, item| item[:graphs].length }.inject(0) { |r, e| r + e } != 0
|
|
119
|
+
td
|
|
120
|
+
button.plot_btn.btn.btn-default title=("Show plots")
|
|
121
|
+
i.fa.fa-bar-chart-o
|
|
122
|
+
- else
|
|
123
|
+
td
|
|
124
|
+
- if @all_html_fnames.length > 1
|
|
125
|
+
nav
|
|
126
|
+
ul.pagination
|
|
127
|
+
- @all_html_fnames.each_with_index do |file, idx|
|
|
128
|
+
li
|
|
129
|
+
a href="#{File.basename(file)}"
|
|
130
|
+
= idx + 1
|
|
131
|
+
footer
|
|
132
|
+
.container.center-block
|
|
133
|
+
p.text-muted.text-center
|
|
134
|
+
| Please cite:
|
|
135
|
+
a href="https://academic.oup.com/bioinformatics/article/32/10/1559/1742817/GeneValidator-identify-problems-with-protein"
|
|
136
|
+
| "Dragan M
|
|
137
|
+
sup> ‡
|
|
138
|
+
| , Moghul MI
|
|
139
|
+
sup> ‡
|
|
140
|
+
| , Priyam A, Bustos C & Wurm Y
|
|
141
|
+
em (2016)
|
|
142
|
+
| GeneValidator: identify problematic gene predictions"
|
|
143
|
+
br/
|
|
144
|
+
| Developed at
|
|
145
|
+
a href="https://wurmlab.github.io" target="_blank" Wurm Lab
|
|
146
|
+
| ,
|
|
147
|
+
a href="http://www.sbcs.qmul.ac.uk" target="_blank" QMUL
|
|
148
|
+
| with funding by
|
|
149
|
+
a href="http://www.bbsrc.ac.uk/home/home.aspx" target="_blank" BBSRC
|
|
150
|
+
| and
|
|
151
|
+
a href="https://www.google-melange.com/gsoc/homepage/google/gsoc2013" target="_blank" Google Summer of Code 2013
|
|
152
|
+
br/
|
|
153
|
+
| This page was created by
|
|
154
|
+
a href="https://wurmlab.github.io/tools/genevalidator/" target="_blank" GeneValidator
|
|
155
|
+
| v#{GeneValidator::VERSION}
|