genevalidatorapp 1.5.1 → 1.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +12 -1
- data/README.md +100 -70
- data/Rakefile +10 -7
- data/bin/genevalidatorapp +2 -3
- data/genevalidatorapp.gemspec +7 -7
- data/lib/genevalidatorapp/genevalidator.rb +1 -1
- data/lib/genevalidatorapp/version.rb +1 -1
- data/public/src/js/genevalidator.js +1 -1
- data/public/web_files/js/GV_compiled_js.min.js +1 -1
- data/spec/route_spec.rb +80 -0
- metadata +46 -48
- data/spec/app_spec.rb +0 -107
- data/spec/database_spec.rb +0 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7043715d7c1f2a8a163dff14f4d767820f023c35
|
4
|
+
data.tar.gz: c4026227dd0483bc393cabe0a895db4e08f08384
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0b66d513f0e8f77adff6bc412211148f5bebda107396c9ba4313142366d61e89ca66e155828fd007941e8c351809d22929c69e188b2a9410511d3751521efa0
|
7
|
+
data.tar.gz: b48d501b323122ab5ea5f25adf1d0c7be5e1f0ee586cee2abf8174c402057bc3a528162aa335982ab1d6f0b74b478fb2829521303b6a9e229c025ba43a474f27
|
data/.travis.yml
CHANGED
@@ -2,4 +2,15 @@ language: ruby
|
|
2
2
|
rvm:
|
3
3
|
- "2.0.0"
|
4
4
|
- "2.1.3"
|
5
|
-
- '2.2.0'
|
5
|
+
- '2.2.0'
|
6
|
+
before_install:
|
7
|
+
- wget -c "ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.2.30/ncbi-blast-2.2.30+-x64-linux.tar.gz" && tar xvf ncbi-blast-2.2.30+-x64-linux.tar.gz && export PATH="./ncbi-blast-2.2.30+/bin:$PATH"
|
8
|
+
- wget -P ~ http://mafft.cbrc.jp/alignment/software/mafft-7.205-with-extensions-src.tgz
|
9
|
+
- tar -zxvf ~/mafft-7.205-with-extensions-src.tgz -C ~
|
10
|
+
- mkdir ~/mafft
|
11
|
+
- ruby -pi -e "gsub(/^PREFIX = \/usr\/local/, 'PREFIX = ~/mafft/')" ~/mafft-7.205-with-extensions/core/Makefile
|
12
|
+
- (cd ~/mafft-7.205-with-extensions/core/ && make clean && make && make install)
|
13
|
+
- export PATH=$PATH:~/mafft/bin
|
14
|
+
cache: bundler
|
15
|
+
sudo: false
|
16
|
+
script: bundle exec rake test
|
data/README.md
CHANGED
@@ -1,101 +1,131 @@
|
|
1
1
|
# GeneValidatorApp
|
2
2
|
[![Build Status](https://travis-ci.org/wurmlab/genevalidatorapp.svg?branch=master)](https://travis-ci.org/wurmlab/genevalidatorapp)
|
3
|
-
[![Gem Version](https://badge.fury.io/rb/
|
4
|
-
[![
|
5
|
-
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/wurmlab/GeneValidatorApp/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/wurmlab/GeneValidatorApp/?branch=master)
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/genevalidatorapp.svg)](http://badge.fury.io/rb/genevalidatorapp)
|
4
|
+
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/wurmlab/genevalidatorapp/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/wurmlab/genevalidatorapp/?branch=master)
|
6
5
|
|
7
|
-
This is a Sinatra based web wrapper for [GeneValidator](https://github.com/monicadragan/GeneValidator); a program that validates gene predictions. A working example can be seen at [genevalidator.sbcs.qmul.ac.uk](http://genevalidator.sbcs.qmul.ac.uk).
|
8
6
|
|
9
|
-
If you use this program in your research, please cite us as follows:
|
10
7
|
|
11
|
-
"Dragan M, Moghul MI, Priyam A & Wurm Y (<em>in prep</em>) GeneValidator: identify problematic gene predictions"
|
12
8
|
|
13
|
-
This program was developed at [Wurm Lab](http://yannick.poulet.org), [QMUL](http://sbcs.qmul.ac.uk) with the support of a BBSRC grant.
|
14
9
|
|
10
|
+
|
11
|
+
|
12
|
+
## Introduction
|
13
|
+
|
14
|
+
This is a online web application for [GeneValidator](https://github.com/wurmlab/genevalidator). This app is currently hosted at: [genevalidator.sbcs.qmul.ac.uk](http://genevalidator.sbcs.qmul.ac.uk).
|
15
|
+
|
16
|
+
GeneValidator helps in identifing problems with gene predictions and provides useful information extracted from analysing orthologs in BLAST databases. The results produced can be used by biocurators and researchers who need accurate gene predictions.
|
17
|
+
|
18
|
+
If you use GeneValidator in your work, please cite us as follows:
|
19
|
+
> "Dragan M<sup>‡</sup>, Moghul MI<sup>‡</sup>, Priyam A, Bustos C & Wurm Y (<em>in prep.</em>) GeneValidator: identify problematic gene predictions"
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
-
|
15
27
|
## Installation
|
28
|
+
### Installation Requirements
|
29
|
+
* Ruby (>= 2.0.0)
|
30
|
+
* NCBI BLAST+ (>= 2.2.30+) (download [here](http://blast.ncbi.nlm.nih.gov/Blast.cgi?PAGE_TYPE=BlastDocs&DOC_TYPE=Download)).
|
31
|
+
* MAFFT installation (download [here](http://mafft.cbrc.jp/alignment/software/)).
|
32
|
+
|
33
|
+
Please see [here](https://gist.github.com/IsmailM/b783e8a06565197084e6) for more help with installing the prerequisites.
|
34
|
+
|
35
|
+
### Installation
|
36
|
+
Simply run the following command in the terminal.
|
37
|
+
|
38
|
+
```bash
|
39
|
+
gem install genevalidatorapp
|
40
|
+
```
|
41
|
+
|
42
|
+
If that doesn't work, try `sudo gem install genevalidatorapp` instead.
|
43
|
+
|
44
|
+
##### Running From Source (Not Recommended)
|
45
|
+
It is also possible to run from source. However, this is not recommended.
|
46
|
+
|
47
|
+
```bash
|
48
|
+
# Clone the repository.
|
49
|
+
git clone https://github.com/wurmlab/genevalidatorapp.git
|
50
|
+
|
51
|
+
# Move into GeneValidatorApp source directory.
|
52
|
+
cd GeneValidatorApp
|
53
|
+
|
54
|
+
# Install bundler
|
55
|
+
gem install bundler
|
56
|
+
|
57
|
+
# Use bundler to install dependencies
|
58
|
+
bundle install
|
59
|
+
|
60
|
+
# Optional: run tests and build the gem from source
|
61
|
+
bundle exec rake
|
62
|
+
|
63
|
+
# Run GeneValidator.
|
64
|
+
bundle exec genevalidatorapp -h
|
65
|
+
# note that `bundle exec` executes GeneValidatorApp in the context of the bundle
|
66
|
+
|
67
|
+
# Alternativaly, install GeneValidatorApp as a gem
|
68
|
+
bundle exec rake install
|
69
|
+
genevalidatorapp -h
|
70
|
+
```
|
71
|
+
|
16
72
|
|
17
|
-
1) Install all GeneValidator Prerequisites (ruby <= 2.0.0, Mafft, BLAST+). You would also require a BLAST database.
|
18
|
-
* Please see [here](https://gist.github.com/IsmailM/b783e8a06565197084e6) for more information.
|
19
73
|
|
20
|
-
2) Install GeneValidatorApp
|
21
74
|
|
22
|
-
|
75
|
+
## Launch GeneValidator
|
23
76
|
|
24
|
-
|
77
|
+
To configure and launch GeneValidatorApp, run the following from a command line.
|
25
78
|
|
26
|
-
|
79
|
+
```bash
|
80
|
+
genevalidatorapp
|
81
|
+
```
|
27
82
|
|
28
|
-
|
83
|
+
GeneValidatorApp will automatically guide you through an interactive setup process to help locate BLAST+ binaries and ask for the location of BLAST+ databases.
|
29
84
|
|
30
|
-
|
85
|
+
That's it! Open http://localhost:4567/ and start using GeneValidator!
|
31
86
|
|
32
|
-
See `$ genevalidator -h` for more information on how to run GeneValidatorApp.
|
33
87
|
|
34
|
-
USAGE
|
35
|
-
|
36
|
-
genevalidatorapp [options]
|
37
|
-
|
38
|
-
Example
|
39
|
-
|
40
|
-
# Launch GeneValidatorApp with the given config file
|
41
|
-
$ genevalidatorapp --config ~/.genevalidatorapp.conf
|
42
|
-
|
43
|
-
# Launch GeneValidatorApp with 8 threads at port 8888
|
44
|
-
$ genevalidatorapp --num_threads 8 --port 8888
|
45
88
|
|
46
|
-
# Create a config file with the other arguments
|
47
|
-
$ genevalidatorapp -s -d ~/database_dir
|
48
|
-
|
49
|
-
Compulsory (unless set in a config file)
|
50
|
-
-d, --database_dir Read BLAST database from this directory
|
51
|
-
|
52
|
-
Optional
|
53
|
-
-f, --default_db The Path to the the default database
|
54
|
-
-n, --num_threads Number of threads to use to run a BLAST search
|
55
|
-
-c, --config_file Use the given configuration file
|
56
|
-
-r, --require Load extension from this file
|
57
|
-
-p, --port Port to run GeneValidatorApp on
|
58
|
-
-s, --set Set configuration value in default or given config file
|
59
|
-
-l, --list_databases List BLAST databases
|
60
|
-
-b, --blast_bin Load BLAST+ binaries from this directory
|
61
|
-
-m, --mafft_bin Load Mafft binaries from this directory
|
62
|
-
-D, --devel Start GeneValidatorApp in development mode
|
63
|
-
-v, --version Print version number of GeneValidatorApp that will be loaded
|
64
|
-
-h, --help Display this help message.
|
65
89
|
|
66
90
|
|
67
|
-
## Setting up a Config File
|
68
91
|
|
69
|
-
|
92
|
+
## Advanced Usage
|
70
93
|
|
71
|
-
|
94
|
+
See `$ genevalidatorapp -h` for more information on all the options available when running GeneValidatorApp.
|
72
95
|
|
73
|
-
|
96
|
+
```bash
|
97
|
+
SUMMARY:
|
98
|
+
GeneValidator - Identify problems with predicted genes
|
74
99
|
|
75
|
-
|
100
|
+
USAGE:
|
101
|
+
$ genevalidatorapp [options]
|
76
102
|
|
77
|
-
|
103
|
+
Examples:
|
104
|
+
# Launch GeneValidatorApp with the given config file
|
105
|
+
$ genevalidatorapp --config ~/.genevalidatorapp.conf
|
78
106
|
|
79
|
-
|
107
|
+
# Launch GeneValidatorApp with 8 threads at port 8888
|
108
|
+
$ genevalidatorapp --num_threads 8 --port 8888
|
80
109
|
|
81
|
-
|
82
|
-
|
83
|
-
:web_dir: "/Users/ismailm/GV"
|
84
|
-
:num_threads: 8
|
85
|
-
:port: 4567
|
86
|
-
:host: localhost
|
87
|
-
:devel: true
|
88
|
-
:blast_bin: "/Users/ismailm/blast/bin"
|
89
|
-
:mafft_bin: "/Users/ismailm/mafft/bin"
|
110
|
+
# Create a config file with the other arguments
|
111
|
+
$ genevalidatorapp -s -d ~/database_dir
|
90
112
|
|
91
|
-
|
113
|
+
-c, --config_file Use the given configuration file
|
114
|
+
-b, --bin Load BLAST+ and/or MAFFT binaries from this directory
|
115
|
+
-d, --database_dir Read BLAST database from this directory
|
116
|
+
-f, --default_database_path The path to the default BLAST database
|
117
|
+
-n, --num_threads Number of threads to use to run a BLAST search
|
118
|
+
-r, --require Load extension from this file
|
119
|
+
-H, --host Host to run GeneValidatorApp on
|
120
|
+
-p, --port Port to run GeneValidatorApp on
|
121
|
+
-s, --set Set configuration value in default or given config file
|
122
|
+
-l, --list_databases List BLAST databases
|
123
|
+
-D, --devel Start GeneValidatorApp in development mode
|
124
|
+
-v, --version Print version number of GeneValidatorApp that will be loaded
|
125
|
+
-h, --help Display this help message.
|
126
|
+
```
|
92
127
|
|
93
|
-
See [GeneValidatorApp-API](https://github.com/IsmailM/GeneValidatorApp-API) for more information.
|
94
128
|
|
95
|
-
|
129
|
+
<hr>
|
96
130
|
|
97
|
-
|
98
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
99
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
100
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
101
|
-
5. Create a new Pull Request
|
131
|
+
This program was developed at [Wurm Lab](https://wurmlab.github.io), [QMUL](http://sbcs.qmul.ac.uk) with the support of a BBSRC grant.
|
data/Rakefile
CHANGED
@@ -3,13 +3,16 @@ require 'rspec/core'
|
|
3
3
|
require 'rspec/core/rake_task'
|
4
4
|
|
5
5
|
task default: [:build]
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
6
|
+
|
7
|
+
desc 'Builds and installs'
|
8
|
+
task install: [:build] do
|
9
|
+
require_relative 'lib/genevalidatorapp/version'
|
10
|
+
sh "gem install ./genevalidatorapp-#{GeneValidatorApp::VERSION}.gem"
|
11
|
+
end
|
12
|
+
|
13
|
+
desc 'Runs tests and builds gem (default)'
|
14
|
+
task build: [:test] do
|
15
|
+
sh 'gem build genevalidatorapp.gemspec'
|
13
16
|
end
|
14
17
|
|
15
18
|
task test: :spec
|
data/bin/genevalidatorapp
CHANGED
@@ -35,7 +35,7 @@ BANNER
|
|
35
35
|
argument: true
|
36
36
|
|
37
37
|
on 'b', 'bin=',
|
38
|
-
'Load BLAST+ and/or
|
38
|
+
'Load BLAST+ and/or MAFFT binaries from this directory',
|
39
39
|
argument: true,
|
40
40
|
as: Array
|
41
41
|
|
@@ -184,8 +184,7 @@ BANNER
|
|
184
184
|
# Ask user if she already has BLAST+ downloaded.
|
185
185
|
puts
|
186
186
|
puts <<MSG
|
187
|
-
GeneValidatorApp can use NCBI BLAST+ that you may have on your system already
|
188
|
-
or download the correct package for itself.
|
187
|
+
GeneValidatorApp can use NCBI BLAST+ that you may have on your system already.
|
189
188
|
Please enter the path to NCBI BLAST+.
|
190
189
|
|
191
190
|
Press Ctrl+C to quit.
|
data/genevalidatorapp.gemspec
CHANGED
@@ -6,12 +6,13 @@ require 'genevalidatorapp/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = 'genevalidatorapp'
|
8
8
|
spec.version = GeneValidatorApp::VERSION
|
9
|
-
spec.authors = ['Ismail Moghul'
|
10
|
-
|
9
|
+
spec.authors = ['Monica Dragan', 'Ismail Moghul', 'Anurag Priyam',
|
10
|
+
'Yannick Wurm']
|
11
|
+
spec.email = 'y.wurm@qmul.ac.uk'
|
11
12
|
spec.summary = 'A Web App wrapper for GeneValidator.'
|
12
13
|
spec.description = 'A Web App wrapper for GeneValidator, a program for' \
|
13
14
|
' validating gene predictions.'
|
14
|
-
spec.homepage = 'https://github.
|
15
|
+
spec.homepage = 'https://wurmlab.github.io/tools/genevalidator/'
|
15
16
|
spec.license = 'AGPL'
|
16
17
|
|
17
18
|
spec.files = `git ls-files -z`.split("\x0")
|
@@ -23,18 +24,17 @@ Gem::Specification.new do |spec|
|
|
23
24
|
|
24
25
|
spec.add_development_dependency 'bundler', '~> 1.6'
|
25
26
|
spec.add_development_dependency 'rake', '~>10.3'
|
26
|
-
spec.add_development_dependency
|
27
|
+
spec.add_development_dependency('rspec', '~> 2.8', '>= 2.8.0')
|
27
28
|
spec.add_development_dependency 'rack-test', '~> 0.6'
|
29
|
+
spec.add_development_dependency('capybara', '~> 2.4', '>= 2.4.4')
|
30
|
+
spec.add_development_dependency 'w3c_validators', '~>1.1'
|
28
31
|
|
29
32
|
spec.add_dependency 'genevalidator', '~>1.6'
|
30
33
|
spec.add_dependency 'bio', '~>1.4'
|
31
34
|
spec.add_dependency 'sinatra', '~>1.4'
|
32
|
-
spec.add_dependency 'sinatra-contrib', '~>1.4'
|
33
35
|
spec.add_dependency 'sinatra-cross_origin', '~> 0.3'
|
34
36
|
spec.add_dependency 'slim', '~>3.0'
|
35
37
|
spec.add_dependency 'slop', '~>3.6'
|
36
|
-
spec.add_dependency 'thin', '~>1.6'
|
37
|
-
spec.add_dependency 'w3c_validators', '~>1.1'
|
38
38
|
spec.post_install_message = <<INFO
|
39
39
|
|
40
40
|
------------------------------------------------------------------------
|
@@ -225,7 +225,7 @@ module GeneValidatorApp
|
|
225
225
|
end
|
226
226
|
|
227
227
|
def copy_json_folder
|
228
|
-
json_dir = File.join("#{@input_fasta_file}.html", 'files/json'
|
228
|
+
json_dir = File.join("#{@input_fasta_file}.html", 'files/json', '/.')
|
229
229
|
web_dir_json = File.join(public_dir, 'web_files/json')
|
230
230
|
logger.debug("Moving JSON files from #{json_dir} to #{web_dir_json}")
|
231
231
|
FileUtils.cp_r(json_dir, web_dir_json)
|
@@ -162,7 +162,7 @@ var ajaxFunction = function () {
|
|
162
162
|
},
|
163
163
|
error: function (e, status) {
|
164
164
|
var errorMessage;
|
165
|
-
if (e.status == 500) {
|
165
|
+
if (e.status == 500 || e.status == 400) {
|
166
166
|
errorMessage = e.responseText;
|
167
167
|
$('#results_box').show();
|
168
168
|
$('#output').html(errorMessage);
|
@@ -24,7 +24,7 @@ return this.tween("attr."+n,u.local?r:e)},Yc.style=function(n,t,e){function r(){
|
|
24
24
|
// plots.min.js
|
25
25
|
var GV;GV||(GV={}),function(){"use strict";GV.toggleAllPlots=function(t){if(window.chrome&&"file:"===window.location.protocol)$("#browseralert").modal();else{var a=$(".plot_btn");a.length>30?$("#alert").modal():($("#spinner1").modal({backdrop:"static",keyboard:"false"}),"pressed"!==t.status?(t.status="pressed",$("#show_all_plots").html("Hide All Charts"),GV.showAllPlots()):(t.status="released",$("#show_all_plots").html("Show All Charts"),GV.removeAllPlots()),$("#spinner1").modal("hide"))}},GV.showAllPlots=function(){$(".plot_btn").each(function(){"pressed"!==this.status&&GV.addData(this,"all")})},GV.removeAllPlots=function(){$(".tablesorter-childRow").each(function(){$(this).remove()}),$(".plot_btn").each(function(){this.status="released"})},GV.addData=function(t,a){if(window.chrome&&"file:"===window.location.protocol)$("#browseralert").modal();else{var e=$(t).closest("tr"),r=e.attr("data-target"),n=$("#mainrow"+r);n.length&&"pressed"!==t.status?(GV.emptyChildRow(e,r,t),GV.addDataToChildRow(e,r,a)):0===n.length?(GV.createChildRow(e,r,t),GV.addDataToChildRow(e,r,a)):n.length&&GV.removeChildRow(e,n,t),$("table").trigger("update")}},GV.toggleOverviewBtn=function(){if(window.chrome&&"file:"===window.location.protocol)$("#overview").remove();else{var t="web_files/json/overview.json";$.getJSON(t,function(t){var a=$("<span>"+t.less+"</span><br>"),e=$("<span>"+t.evaluation+"</span><br>");$("#overview_btn").hasClass("active")?($("#overview_text").html(e),$("#overview_btn").text("Show Less"),GV.addPlot(t.data,"overview",t.type,t.title,t.footer,t.xtitle,t.ytitle)):($("#overview").find("svg").remove(),$("#overview_text").html(a),$("#overview_btn").text("Show More"))})}},GV.createChildRow=function(t,a,e){var r='<tr class="tablesorter-childRow" id="mainrow'+a+'"><td colspan="12" id="row'+a+'"><div id="'+a+'" class="expanded-child"></div></td></tr>';t.addClass("tablesorter-hasChildRow"),t.after(r),e.status="pressed"},GV.removeChildRow=function(t,a,e){t.removeClass("tablesorter-hasChildRow"),a.remove(),e.status="released"},GV.emptyChildRow=function(t,a,e){var r="#"+a,n="#"+a+"explanation";$(r).empty(),$(n).remove(),GV.resetStatusOfOtherButtons(t),e.status="pressed"},GV.resetStatusOfOtherButtons=function(t){t.find("td").each(function(){"pressed"==this.status&&(this.status="released")}),t.find(".plot_btn").each(function(){"pressed"==this.status&&(this.status="released")})},GV.addDataToChildRow=function(t,a,e){var r=t.attr("data-jsonFile");$.getJSON(r,function(t){if("all"===e)for(var r in t.validations)void 0!==t.validations[r].graphs&&GV.generatePlotCommands(t.validations[r].graphs,a);else GV.addExplanation(a,t.validations[e]),void 0!==t.validations[e].graphs&&GV.generatePlotCommands(t.validations[e].graphs,a)})},GV.generatePlotCommands=function(t,a){for(var e=0;e<t.length;e++){var r=t[e];GV.addPlot(r.data,a,r.type,r.title,r.footer,r.xtitle,r.ytitle,r.aux1,r.aux2)}},GV.addExplanation=function(t,a){var e="#row"+t,r="<p><b>Approach:</b> "+a.approach+"</p>",n="<p><b>Explanation:</b> "+a.explanation+"</p>",o="<p><b>Conclusion:</b> "+a.conclusion+"</p>",l=$('<div id="'+t+'explanation" class="alert alert-info explanation_alert" role="alert">'+r+n+o+"</div>");$(e).prepend(l)},GV.addPlot=function(t,a,e,r,n,o,l,s,i){var c;switch(c=""===n?[]:n.split(";"),e){case"scatter":GV.plot_scatter(t,a,r,n,o,l,s,i);break;case"bars":GV.plot_bars(t,a,r,c,o,l,s);break;case"simplebars":GV.plot_simple_bars(t,a,r,c,o,l);break;case"lines":null!==i&&(i=i.split(",")),GV.plot_lines(t,a,r,c,o,l,s,i);break;case"align":null!==i&&(i=i.split(",")),GV.plot_align(t,a,r,c,o,l,s,i)}},GV.color_beautification=function(t){switch(t){case"red":return d3.rgb(189,54,47);case"blue":return d3.rgb(58,135,173);case"green":return d3.rgb(70,136,71);case"yellow":return d3.rgb(255,255,51);case"orange":return d3.rgb(248,148,6);case"violet":return d3.rgb(153,0,153);case"gray":return d3.rgb(160,160,160);default:return t}},GV.plot_bars=function(t,a,e,r,n,o,l){var s={top:70,right:50,bottom:75,left:50},i=600-s.left-s.right,c=500-s.top-s.bottom,d=d3.select("#".concat(a)).append("svg").attr("width",i+s.left+s.right).attr("height",c+s.top+s.bottom).append("g").attr("transform","translate("+s.left+","+s.top+")");d.append("text").attr("x",i/2).attr("y",-45).attr("text-anchor","middle").style("font-size","16px").text(e);var p=100,u=[].concat.apply([],t),f=d3.max(u,function(t){return t.value})+3,h=d3.scale.linear().domain([0,f+f/10]).range([c,0]),x=d3.min(u,function(t){return t.key});void 0!==l&&(x=Math.min(x,l));var g=d3.max(u,function(t){return t.key});void 0!==l&&(g=Math.max(g,l));var m=d3.scale.linear().domain([x-p,g+p]).range([13,i]),v=d3.svg.axis().scale(m).orient("bottom").ticks(8),y=d3.svg.axis().scale(h).orient("left").tickFormat(d3.format("d")).ticks(8);d.append("g").attr("class","x axis").attr("transform","translate(0,"+c+")").call(v).append("text").attr("class","label").attr("x",(i-n.length)/2-50).attr("y",35).style("text-anchor","start").text(n),d.append("g").attr("class","y axis").call(y).append("text").attr("class","label").attr("transform","rotate(-90)").attr("x",-(c+o.length)/2-50).attr("y",-40).style("text-anchor","start").text(o),t.map(function(t){d.selectAll(".bar").data(t).enter().append("rect").attr("x",function(t){return m(t.key)}).attr("width",6).attr("y",function(t){return h(t.value)}).attr("height",function(t){return c-h(t.value)}).attr("fill",function(t){return t.main===!0?GV.color_beautification("red"):GV.color_beautification("blue")})}),void 0!==l&&(d.append("rect").attr("x",m(l)).attr("width",4).attr("y",h(f+f/10)).style("opacity",.6).attr("height",c-h(f+f/8)).attr("fill",GV.color_beautification("black")),d.append("text").attr("transform","rotate(-90)").attr("x",-f/10-35).attr("y",m(l)-5).text("query"));for(var b=0,w=0,G=0;G<r.length;G++){var V=r[G].split(",");w=w+8*V[0].length+15}for(var k=0;k<r.length;k++){var _=r[k].split(",");d.append("rect").attr("x",(i-w)/2+b).attr("y",-30).attr("width",10).attr("height",10).style("fill",GV.color_beautification(_[1].replace(/\s+/g,""))),d.append("text").attr("x",(i-w)/2+b+15).attr("y",-20).text(_[0]),b=b+8*_[0].length+15}},GV.plot_simple_bars=function(t,a,e,r,n,o){var l={top:70,right:50,bottom:75,left:50},s=600-l.left-l.right,i=500-l.top-l.bottom,c=d3.select("#".concat(a)).append("svg").attr("width",s+l.left+l.right).attr("height",i+l.top+l.bottom).append("g").attr("transform","translate("+l.left+","+l.top+")");c.append("text").attr("x",s/2).attr("y",-45).attr("text-anchor","middle").style("font-size","16px").text(e);var d=0,p=[].concat.apply([],t),u=d3.max(p,function(t){return t.value})+3,f=d3.scale.linear().domain([0,u]).range([i,0]),h=d3.min(p,function(t){return t.key}),x=d3.max(p,function(t){return t.key}),g=d3.scale.linear().domain([h-d,x+d]).range([13,s]),m=d3.svg.axis().scale(g).orient("bottom").ticks(8),v=d3.svg.axis().scale(f).orient("left").tickFormat(d3.format("d")).ticks(8);c.append("g").attr("class","x axis").attr("transform","translate(0,"+i+")").call(m).append("text").attr("class","label").attr("x",(s-n.length)/2-50).attr("y",35).style("text-anchor","start").text(n),c.append("g").attr("class","y axis").call(v).append("text").attr("class","label").attr("transform","rotate(-90)").attr("x",-(i+o.length)/2-50).attr("y",-40).style("text-anchor","start").text(o),t.map(function(t){c.selectAll(".bar").data(t).enter().append("rect").attr("x",function(t){return g(t.key)}).attr("width",6).attr("y",function(t){return f(t.value)}).attr("height",function(t){return i-f(t.value)}).attr("fill",function(t){return t.main===!0?GV.color_beautification("red"):GV.color_beautification("blue")})})},GV.plot_scatter=function(t,a,e,r,n,o,l,s){var i={top:50,right:30,bottom:75,left:50},c=500-i.left-i.right,d=500-i.top-i.bottom,p=d3.scale.linear().range([0,c]),u=d3.scale.linear().range([d,0]),f=(d3.scale.category10(),d3.svg.axis().scale(p).orient("bottom").ticks(8)),h=d3.svg.axis().scale(u).orient("left").tickFormat(d3.format("d")).ticks(8),x=d3.select("#".concat(a)).append("svg").attr("width",c+i.left+i.right).attr("height",d+i.top+i.bottom).append("g").attr("transform","translate("+i.left+","+i.top+")");x.append("text").attr("x",c/2).attr("y",-25).attr("text-anchor","middle").style("font-size","16px").text(e),x.append("text").attr("x",c/2).attr("y",d+55).attr("text-anchor","middle").style("font-size","12px").text(r);var g=d3.max(t,function(t){return t.x}),m=d3.min(t,function(t){return t.x}),v=d3.max(t,function(t){return t.y}),y=d3.min(t,function(t){return t.y});if(p.domain(d3.extent(t,function(t){return t.x})).nice(),u.domain(d3.extent(t,function(t){return t.y})).nice(),x.append("g").attr("class","x axis").attr("transform","translate(0,"+d+")").call(f).append("text").attr("class","label").attr("x",(c-n.length)/2-50).attr("y",35).style("text-anchor","start").text(n),x.append("g").attr("class","y axis").call(h).append("text").attr("class","label").attr("transform","rotate(-90)").attr("x",-(d+o.length)/2-50).attr("y",-40).style("text-anchor","start").text(o),x.selectAll(".dot").data(t).enter().append("circle").attr("r",2).attr("cx",function(t){return p(t.x)}).attr("cy",function(t){return u(t.y)}).style("fill",function(){return GV.color_beautification("red")}).style("opacity",.6),void 0!==s&&""!==s&&void 0!==l&&""!==l){l=parseFloat(l.replace(",","."));var b=g,w=l+s*g;w>v&&(b=(v-l)/s,w=v),y>w&&(b=(y-l)/s,w=y);var G=m,V=l+s*m;V>v&&(G=(v-l)/s,V=y),y>V&&(G=(y-l)/s,V=y),x.append("line").attr("x1",p(G)).attr("y1",u(V)).attr("x2",p(b)).attr("y2",u(w)).attr("stroke-width",2).attr("stroke","black")}},GV.plot_lines=function(t,a,e,r,n,o,l,s){var i={top:70,right:50,bottom:75,left:50},c=600-i.left-i.right,d=500-i.top-i.bottom,p=d3.scale.linear().range([0,c]),u=d3.scale.linear().range([d,0]),f=(d3.scale.category10(),"");f="Open Reading Frames in all 6 Frames"===e?d3.svg.axis().scale(p).orient("bottom").ticks(0):d3.svg.axis().scale(p).orient("bottom").ticks(5);var h=d3.svg.axis().scale(u).orient("left").ticks(5),x=d3.select("#".concat(a)).append("svg").attr("width",c+i.left+i.right).attr("height",d+i.top+i.bottom).append("g").attr("transform","translate("+i.left+","+i.top+")");x.append("text").attr("x",c/2).attr("y",-35).attr("text-anchor","middle").style("font-size","16px").text(e);var g=-1;p.domain([0,d3.max(t,function(t){return t.stop})]),u.domain(d3.extent(t,function(t){return t.y})).nice(),x.append("g").attr("class","x axis").attr("transform","translate(0,"+(d+d/l)+")").call(f).append("text").attr("class","label").attr("x",(c-n.length)/2-50).attr("y",35).style("text-anchor","start").text(n),null!==s?x.append("g").attr("class","y axis").call(h.ticks(s.length).tickFormat(function(){return g+=1,s[g]})).append("text").attr("class","label").attr("transform","rotate(-90)").attr("x",-(d+o.length)/2-50).attr("y",-40).style("text-anchor","start").text(o):x.append("g").attr("class","y axis").call(h).append("text").attr("class","label").attr("transform","rotate(-90)").attr("x",-(d+o.length)/2).attr("y",-40).style("text-anchor","start").text(o),x.selectAll(".dot").data(t).enter().append("line").attr("x1",function(t){return p(t.start)}).attr("y1",function(t){return u(t.y)}).attr("x2",function(t){return p(t.stop)}).attr("x2",function(t){return p(t.stop)}).attr("y2",function(t){return u(t.y)}).attr("stroke-width",function(t){return void 0===t.dotted?"red"==t.color?d/l/2.5:d/l:d/l/5}).style("stroke-dasharray",function(t){return void 0===t.dotted?"0, 0":"2, 6"}).attr("stroke",function(t){return GV.color_beautification(t.color)});for(var m=(x.append("g").attr("class","legend").attr("height",100).attr("width",100).attr("transform","translate(-20,50)"),40),v=0,y=0;y<r.length;y++){var b=r[y].split(",");v=v+8*b[0].length+15}for(var w=0;w<r.length;w++){var G=r[w].split(",");x.append("rect").attr("x",(c-v)/2+m).attr("y",-30).attr("width",10).attr("height",10).style("fill",GV.color_beautification(G[1].replace(/\s+/g,""))),x.append("text").attr("x",(c-v)/2+m+15).attr("y",-20).text(G[0]),m=m+8*G[0].length+15}},GV.plot_align=function(t,a,e,r,n,o,l,s){var i={top:75,right:50,bottom:75,left:150},c=600-i.left-i.right,d=300-i.top-i.bottom,p=d3.scale.linear().range([0,c]),u=d3.scale.linear().range([d,0]),f=(d3.scale.category10(),d3.svg.axis().scale(p).orient("bottom").ticks(5)),h=d3.svg.axis().scale(u).orient("left").ticks(5),x=d3.select("#".concat(a)).append("svg").style("vertical-align","top").attr("width",c+i.left+i.right).attr("height",d+i.top+i.bottom).append("g").attr("transform","translate("+i.left+","+i.top+")");x.append("text").attr("x",c/2).attr("y",-35).attr("text-anchor","middle").style("font-size","16px").text(e);var g=-1;p.domain([0,d3.max(t,function(t){return t.stop})]),u.domain(d3.extent(t,function(t){return t.y})).nice(),x.append("g").attr("class","x axis").attr("transform","translate(0,"+(d+d/l)+")").call(f).append("text").attr("class","label").attr("x",(c-n.length)/2-50).attr("y",35).style("text-anchor","start").text(n),null!==s?x.append("g").attr("class","y axis").call(h.ticks(s.length).tickFormat(function(){return g+=1,s[g]})).append("text").attr("class","label").attr("transform","rotate(-90)").attr("x",-(d+o.length)/2-50).attr("y",-40).style("text-anchor","start").text(o):x.append("g").attr("class","y axis").call(h).append("text").attr("class","label").attr("transform","rotate(-90)").attr("x",-(d+o.length)/2-50).attr("y",-40).style("text-anchor","start").text(o),x.selectAll(".dot").data(t).enter().append("line").attr("x1",function(t){return p(t.start)}).attr("y1",function(t){return u(t.y)}).attr("x2",function(t){return p(t.stop)}).attr("y2",function(t){return u(t.y)}).attr("stroke-width",function(t){return-1==t.height?d/l:d/l*t.height}).attr("stroke",function(t){return GV.color_beautification(t.color)});for(var m=0,v=0,y=0;y<r.length;y++){var b=r[y].split(",");v=v+8*b[0].length+15}for(var w=0;w<r.length;w++){var G=r[w].split(",");x.append("rect").attr("x",(c-v)/2+m).attr("y",-30).attr("width",10).attr("height",10).style("fill",GV.color_beautification(G[1].replace(/\s+/g,""))),x.append("text").attr("x",(c-v)/2+m+15).attr("y",-20).text(G[0]),m=m+8*G[0].length+15}}}();
|
26
26
|
// genevalidator.min.js
|
27
|
-
$(document).ready(function(){"use strict";checkCollapseState(),keepFooterFixedToBottom(),addSeqValidation(),inputValidation(),bindTdClicks(),$(document).bind("keydown",function(G){G.ctrlKey&&13===G.keyCode&&$("#input").trigger("submit")})});var checkCollapseState=function(){"use strict";if($.cookie("GeneValidator_adv_params_status")){var G=$.cookie("GeneValidator_adv_params_status");if("open"===G){var T=document.getElementById("adv_params_btn");T.innerHTML='<i class="fa fa-pencil-square-o"></i> Hide Advanced Parameters',$("#adv_params").addClass("in")}}},keepFooterFixedToBottom=function(){"use strict";$("#mainbody").css({"margin-bottom":$("#footer").height()+15+"px"}),$(window).resize(function(){$("#mainbody").css({"margin-bottom":$("#footer").height()+15+"px"})})},addSeqValidation=function(){"use strict";jQuery.validator.addMethod("checkInputType",function(G,T){var A=[],e="";if(">"===G.charAt(0)){for(var C=G.split(">"),t=1;t<C.length;t++){var a=C[t].split("\n");if(0!==a.length){var n=jQuery.grep(a,function(G){return G});if(0!==n.length){n.shift();var r=n.join("");if(e=checkType(r,.9),A.push(e),"protein"!==e&&"dna"!==e&&"rna"!==e)return!1}}}for(var
|
27
|
+
$(document).ready(function(){"use strict";checkCollapseState(),keepFooterFixedToBottom(),addSeqValidation(),inputValidation(),bindTdClicks(),$(document).bind("keydown",function(G){G.ctrlKey&&13===G.keyCode&&$("#input").trigger("submit")})});var checkCollapseState=function(){"use strict";if($.cookie("GeneValidator_adv_params_status")){var G=$.cookie("GeneValidator_adv_params_status");if("open"===G){var T=document.getElementById("adv_params_btn");T.innerHTML='<i class="fa fa-pencil-square-o"></i> Hide Advanced Parameters',$("#adv_params").addClass("in")}}},keepFooterFixedToBottom=function(){"use strict";$("#mainbody").css({"margin-bottom":$("#footer").height()+15+"px"}),$(window).resize(function(){$("#mainbody").css({"margin-bottom":$("#footer").height()+15+"px"})})},addSeqValidation=function(){"use strict";jQuery.validator.addMethod("checkInputType",function(G,T){var A=[],e="";if(">"===G.charAt(0)){for(var C=G.split(">"),t=1;t<C.length;t++){var a=C[t].split("\n");if(0!==a.length){var n=jQuery.grep(a,function(G){return G});if(0!==n.length){n.shift();var r=n.join("");if(e=checkType(r,.9),A.push(e),"protein"!==e&&"dna"!==e&&"rna"!==e)return!1}}}for(var s=A[0],V=0;V<A.length;V++)if(A[V]!==s)return!1;return!0}return e=checkType(G,.9),"protein"!==e&&"dna"!==e&&"rna"!==e?!1:!0},"* The Input must be either DNA or protein sequence(s). Please ensure that your sequences do not contains any non-letter character(s). If there are multiple sequences, ensure that they are all of one type. ")},inputValidation=function(){"use strict";var G=$("#seq").attr("data-maxCharacters");$("#input").validate({rules:{seq:{minlength:5,required:!0,checkInputType:!0,maxlength:G},"validations[]":{required:!0}},highlight:function(G){$(G).closest(".form-group").addClass("has-error")},unhighlight:function(G){$(G).closest(".form-group").removeClass("has-error")},errorElement:"span",errorClass:"help-block",errorPlacement:function(G,T){if("validations_group"===T.parent().parent().attr("id")){var A=document.getElementById("lastValidation");G.insertAfter(A)}else T.parent(".input-group").length?G.insertAfter(T.parent()):G.insertAfter(T)},submitHandler:function(G){$("#spinner").modal({backdrop:"static",keyboard:"false"}),ajaxFunction()}})},bindTdClicks=function(){$(document).on("click","td, .plot_btn",function(G){if($(this).hasClass("success")||$(this).hasClass("danger")){var T=$(this).attr("title"),A=T.replace(/[ \/]/g,"");GV.addData(this,A)}else $(this).hasClass("plot_btn")&&GV.addData(this,"all")})},ajaxFunction=function(){"use strict";$.ajax({type:"POST",url:$("#input").attr("action"),data:$("#input").serialize(),success:function(G){$("#results_box").show(),$("#output").html(G),GV.toggleOverviewBtn(),initTableSorter(),$("[data-toggle='tooltip']").tooltip(),$("#mainbody").css({"background-color":"#fff"}),$("#search").css({"background-color":"#F5F5F5"}),$("#results").css({"border-top":"3px solid #DBDBDB"}),$("#search").css({"margin-bottom":"0"}),$("#spinner").modal("hide")},error:function(G,T){var A;500==G.status||400==G.status?(A=G.responseText,$("#results_box").show(),$("#output").html(A),$("#spinner").modal("hide")):(A=G.responseText,$("#results_box").show(),$("#output").html("There seems to be an unidentified Error."),$("#spinner").modal("hide"))}})},initTableSorter=function(){"use strict";$.tablesorter.addParser({id:"star_scores",is:function(G){return!1},format:function(G,T,A,e){var C=$(A);return 1===e?C.attr("data-score")||G:G},parsed:!1,type:"numeric"}),$("table").tablesorter({headers:{1:{sorter:"star_scores"}},sortList:[[0,0]]})},changeAdvParamsBtnText=function(){"use strict";var G=document.getElementById("adv_params_btn");'<i class="fa fa-pencil-square-o"></i> Show Advanced Parameters'===G.innerHTML?(G.innerHTML='<i class="fa fa-pencil-square-o"></i> Hide Advanced Parameters',$("#adv_params").collapse("show"),$.cookie("GeneValidator_adv_params_status","open")):(G.innerHTML='<i class="fa fa-pencil-square-o"></i> Show Advanced Parameters',$("#adv_params").collapse("hide"),$.cookie("GeneValidator_adv_params_status","closed"))},examplarSequence=function(G){"use strict";var T=">Insulin\nATGGCTCTCTGGATCCGGTCGCTGCCTCTCCTGGCCCTTCTTGCTCTTTCTGGCCCTGGGATCAGCCACGCAGCTGCCAACCAGCACCTCTGTGGCTCCCACTTGGTTGAGGCTCTCTACCTGGTGTGTGGGGAGCGGGGTTTCTTCTACTCCCCCAAAACACGGCGGGACGTTGAGCAGCCTCTAGTGAACGGTCCCCTGCATGGCGAGGTGGGAGAGCTGCCGTTCCAGCATGAGGAATACCAGAAAGTCAAGCGAGGCATCGTTGAGCAATGCTGTGAAAACCCGTGCTCCCTCTACCAACTGGAAAACTACTGCAACTAG\n>Insulin (with a duplication)\nATGGCTCTCTGGATCCGGTCGCTGCCTCTCCTGGCCCTTCTTGCTCTTTCTGGCCCTGGGATCAGCCACGCAGCTGCCAACCAGCACCTCTGTGGCTCCCACTTGGTTGAGGCTCTCTACCTGGTGTGTGGGGAGCGGGGTTTCTTCTACTCCCCCAAAACACGGCGGGACGTTGAGCAGCCTCTAGTGAACGGTCCCCTGCATGGCGAGGTGGGAGAGCTGCCGTTCCAGCATGAGGAATACCAGACAGCACCTCTGTGGCTCCCACTTGGTTGAGGCTCTCTACCTGGTGTGTGGGGAGCGGGGTTTCTTCTACTCCCCCAAAACACGGCGGGACGTTGAGCAGCCTCTAGTGAACGGTCCCCTGCATGGCGAGGTGGGAGAGCTGCCGTTCCAGCATGAGGAATACCAGAAAGTCAAGCGAGGCATCGTTGAGCAATGCTGTGAAAACCCGTGCTCCCTCTACCAACTGGAAAACTACTGCAACTAG",A=">Methylmalonyl-CoA carboxyltransferase 12S \nMAENNNLKLASTMEGRVEQLAEQRQVIEAGGGERRVEKQHSQGKQTARERLNNLLDPHSFDEVGAFRKHRTTLFGMDKAVVPADGVVTGRGTILGRPVHAASQDFTVMGGSAGETQSTKVVETMEQALLTGTPFLFFYDSGGARIQEGIDSLSGYGKMFFANVKLSGVVPQIAIIAGPCAGGASYSPALTDFIIMTKKAHMFITGPQVIKSVTGEDVTADELGGAEAHMAISGNIHFVAEDDDAAELIAKKLLSFLPQNNTEEASFVNPNNDVSPNTELRDIVPIDGKKGYDVRDVIAKIVDWGDYLEVKAGYATNLVTAFARVNGRSVGIVANQPSVMSGCLDINASDKAAEFVNFCDSFNIPLVQLVDVPGFLPGVQQEYGGIIRHGAKMLYAYSEATVPKITVVLRKAYGGSYLAMCNRDLGADAVYAWPSAEIAVMGAEGAANVIFRKEIKAADDPDAMRAEKIEEYQNAFNTPYVAAARGQVDDVIDPADTRRKIASALEMYATKRQTRPAKKPWKLPLLSEEEIMADEEEKDLMIATLNKRVASLESELGSLQSDTQGVTEDVLTAISAVAAYLGNDGSAEVVHFAPSPNWVREGRRALQNHSIR\n>locus=Si_gnF\nMWFPVVLLLLVGVAVAMPDHEHAWEPQNEYQYSVFVRTLTGVDTLKQQYTGIQLKGVLVIQVKSEELLQAKYINPRYAHIHQELSNGPYSKIPEENLEYRDIPMSGKPFEIKLKHGVIRDLLFDRNVPTWEVNMLKGIVGQLQIDTQGENAIDSQSTQIPSNSEPSSATFKAMEDSVGGKCEVLYEITPLPQHVAQTRPDRVPMSSVPSKGHHYEVKKLKNYEKCQERQLYHYGMDVKMTKENMMKRNKVVSELSTTHIVITGTLKSFTIQSTEMKNEITVQPESSDSPIGTVYSITKLTLAKINKISNSWFGPLELSNVESTGNLVYIFNNPFSDSEQRRVGQPSISRNSEQENSLETKKRSFHSHSSSSSSSSSSSSEEENESVMQSKASLRNIFMAPNVPLLPYFIGFKGKTIMKSNEHNVMQLAKDLLLQIAKEIQNPSEGYENTLEKYVNLKNLIRTMDRKQYTELEQYVSQFNKATVEGENAWYTLRDAVVHAGTGPAFVTIENWLKSGQVKGEEAAELLSKIPKSVHQPTPDYIKEFFKLIKSSVVTQQEYVNVSAPLAFAELLRNNYVVPSYYPVHSFGRMTLKGNEEIDNYISYLANQLQQGYLENNTQKIQTFIFALGVTAHPKIISVFEPYLEGKLPTTKYQRMLMVAALYDLSRDIPKLVGPIFYKLYMNENEAHEVRCMAVQQFILTDPPMITLQRVAKYTNYDQSDQVNSAVKSTLNSIINTKRPEWRNLANKARSVRYLVNPKNYDTWYSKGYYIDFENWVFKGLNVKMVASNDAVLPRYVYVGLDSIFNFLRKPTFEVGYAVSSYRQVYDLINELWNSYQFEEMREKSQGSRVEKLAQELKIKSGQKNNLEGHVLFNSVYGSMVYPYDKHRIREAVAALKKLLTSDSKLKTTAFNNFEKIVSFPMEMGVPFVYSFELPVFVKSEINFKKGEPITSRSGVYETLFCNRVQKRFGFIAPFEYQNYIAGIDKNGIMRVPLKYETNIDIKQKNFALKIHPNIPQSGTSTGLTHYSVVPFTTRQNIFNLQPVSNEGNTRPVITSEIHKMTKEKGPFSIKIESDTTKKESVLEDIVTGISKSSNSNNERYMKIDTTFESKQVAKCEIQIDMTFDAVTIHGKNQQPSHKEMQHHSKLDWKPNSKERREEIVNVLSAGLKSGTVFVADVSFSLPRLQDNTYVFTVGSVRSNIDQKLRHYFYVNTNAAQEVKYELCYSQEVQYAYPTPLNFEYAINNEPKDKLKGVLRYGRTCNTGNEIVITGSSSQSPQLRDMIENSSITKQCMEEIQKGKKSVRTCNKATDVAQVRDQLNFHIDASQLSEIRQKYDQVIGLLNYTNLSQYNVQQNSETNTIVVQNPWVMVPTVQEPWYRWAIKPSESQRQSEIDVLLDEVSQPSCTLDNDKILTFDNQLYNVQLGKCKHVLLTTYPQDSHNRRNYIPESSKVAVLAKDTDNDSRNVYVWLGNLEIELKKVGNDLKVAINGQNVEIPEKGHQESNGNEIIFEIVQLPDGSLSVISEKYGITVIFDGKHVRLYANGATYRNAIRGLCGNYDSRRDNDFLTPKNCLLTKPEEFAATYAMTNENCQGPAPENKRKAEGAMCIEVPEQQQMNVISDREAGRMMTEGGNWGYHQSNRKKEHGQDSKRGHGHKKYNQKDSQEGGSNESQYRKKHNIVYRTRVVEMDDKICFTTTPVPGCLQDTRPVERVPKKYDLYCLSKNNESMDLKRRVEEGAKPDFTQKPVNKIQNFQIPVSCSAA";"dna"===G?document.getElementById("seq").value=T:"protein"===G&&(document.getElementById("seq").value=A)},checkType=function(G,T,A,e){"use strict";void 0===T&&(T=.9),void 0===A&&(A=1e4),void 0===e&&(e=1);var C=G.slice(e-1,A),t=C.replace(/N/gi,""),a=t.length,n=(t.match(/[ACG]/gi)||[]).length/a,r=(t.match(/[T]/gi)||[]).length/a,s=(t.match(/[U]/gi)||[]).length/a,V=C.replace(/X/gi,""),S=V.length,i=(C.match(/[ARNDCQEGHILKMFPSTWYV\*]/gi)||[]).length/S;return n+r>=T||n+s>=T?r>=s?"dna":s>=r?"rna":"dna":i>=T?"protein":void 0};
|
28
28
|
// jquery.cookie.min.js
|
29
29
|
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?a(require("jquery")):a(jQuery)}(function(a){function c(a){return h.raw?a:encodeURIComponent(a)}function d(a){return h.raw?a:decodeURIComponent(a)}function e(a){return c(h.json?JSON.stringify(a):String(a))}function f(a){0===a.indexOf('"')&&(a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return a=decodeURIComponent(a.replace(b," ")),h.json?JSON.parse(a):a}catch(c){}}function g(b,c){var d=h.raw?b:f(b);return a.isFunction(c)?c(d):d}var b=/\+/g,h=a.cookie=function(b,f,i){if(void 0!==f&&!a.isFunction(f)){if(i=a.extend({},h.defaults,i),"number"==typeof i.expires){var j=i.expires,k=i.expires=new Date;k.setTime(+k+864e5*j)}return document.cookie=[c(b),"=",e(f),i.expires?"; expires="+i.expires.toUTCString():"",i.path?"; path="+i.path:"",i.domain?"; domain="+i.domain:"",i.secure?"; secure":""].join("")}for(var l=b?void 0:{},m=document.cookie?document.cookie.split("; "):[],n=0,o=m.length;o>n;n++){var p=m[n].split("="),q=d(p.shift()),r=p.join("=");if(b&&b===q){l=g(r,f);break}b||void 0===(r=g(r))||(l[q]=r)}return l};h.defaults={},a.removeCookie=function(b,c){return void 0===a.cookie(b)?!1:(a.cookie(b,"",a.extend({},c,{expires:-1})),!a.cookie(b))}});
|
30
30
|
// jquery.validate.min.js
|
data/spec/route_spec.rb
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
require 'rack/test'
|
2
|
+
require 'rspec'
|
3
|
+
require 'capybara/rspec'
|
4
|
+
require 'w3c_validators'
|
5
|
+
|
6
|
+
require 'genevalidatorapp'
|
7
|
+
|
8
|
+
# Basic unit tests for HTTP / Rack interface.
|
9
|
+
module GeneValidatorApp
|
10
|
+
include W3CValidators
|
11
|
+
describe 'Routes' do
|
12
|
+
ENV['RACK_ENV'] = 'production'
|
13
|
+
include Rack::Test::Methods
|
14
|
+
|
15
|
+
let 'root' do
|
16
|
+
GeneValidatorApp.root
|
17
|
+
end
|
18
|
+
|
19
|
+
let 'empty_config' do
|
20
|
+
File.join(root, 'spec', 'empty_config.yml')
|
21
|
+
end
|
22
|
+
|
23
|
+
let 'database_dir' do
|
24
|
+
File.join(root, 'spec', 'database')
|
25
|
+
end
|
26
|
+
|
27
|
+
before :each do
|
28
|
+
GeneValidatorApp.init(config_file: empty_config,
|
29
|
+
database_dir: database_dir)
|
30
|
+
|
31
|
+
validations = %w(lenc lenr dup merge align frame orf)
|
32
|
+
sequence = 'AGCTAGCTAGCT'
|
33
|
+
database = Database.first.name
|
34
|
+
|
35
|
+
@params = {
|
36
|
+
'validations' => validations,
|
37
|
+
'seq' => sequence,
|
38
|
+
'database' => database
|
39
|
+
}
|
40
|
+
end
|
41
|
+
|
42
|
+
let 'app' do
|
43
|
+
GeneValidatorApp
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'should start the app' do
|
47
|
+
get '/'
|
48
|
+
last_response.ok?.should == true
|
49
|
+
end
|
50
|
+
|
51
|
+
it 'returns Bad Request (400) if no sequence is provided' do
|
52
|
+
@params.delete('seq')
|
53
|
+
post '/', @params
|
54
|
+
last_response.status.should == 400
|
55
|
+
end
|
56
|
+
|
57
|
+
it 'returns Bad Request (400) if no validations is provided' do
|
58
|
+
@params.delete('validations')
|
59
|
+
post '/', @params
|
60
|
+
last_response.status.should == 400
|
61
|
+
end
|
62
|
+
|
63
|
+
it 'returns Bad Request (400) if no database is provided' do
|
64
|
+
@params.delete('database')
|
65
|
+
post '/', @params
|
66
|
+
last_response.status.should == 400
|
67
|
+
end
|
68
|
+
|
69
|
+
it 'validate the html' do
|
70
|
+
get '/'
|
71
|
+
html = last_response.body
|
72
|
+
|
73
|
+
validator = MarkupValidator.new
|
74
|
+
results = validator.validate_text(html)
|
75
|
+
|
76
|
+
results.errors.each { |err| puts err.to_s } if results.errors.length > 0
|
77
|
+
results.errors.length.should == 0
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: genevalidatorapp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
+
- Monica Dragan
|
7
8
|
- Ismail Moghul
|
9
|
+
- Anurag Priyam
|
10
|
+
- Yannick Wurm
|
8
11
|
autorequire:
|
9
12
|
bindir: bin
|
10
13
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
14
|
+
date: 2015-08-03 00:00:00.000000000 Z
|
12
15
|
dependencies:
|
13
16
|
- !ruby/object:Gem::Dependency
|
14
17
|
name: bundler
|
@@ -44,14 +47,20 @@ dependencies:
|
|
44
47
|
requirements:
|
45
48
|
- - "~>"
|
46
49
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
50
|
+
version: '2.8'
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 2.8.0
|
48
54
|
type: :development
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
51
57
|
requirements:
|
52
58
|
- - "~>"
|
53
59
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
60
|
+
version: '2.8'
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: 2.8.0
|
55
64
|
- !ruby/object:Gem::Dependency
|
56
65
|
name: rack-test
|
57
66
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,35 +76,55 @@ dependencies:
|
|
67
76
|
- !ruby/object:Gem::Version
|
68
77
|
version: '0.6'
|
69
78
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
79
|
+
name: capybara
|
71
80
|
requirement: !ruby/object:Gem::Requirement
|
72
81
|
requirements:
|
73
82
|
- - "~>"
|
74
83
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
76
|
-
|
84
|
+
version: '2.4'
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: 2.4.4
|
88
|
+
type: :development
|
77
89
|
prerelease: false
|
78
90
|
version_requirements: !ruby/object:Gem::Requirement
|
79
91
|
requirements:
|
80
92
|
- - "~>"
|
81
93
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
94
|
+
version: '2.4'
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: 2.4.4
|
83
98
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
99
|
+
name: w3c_validators
|
85
100
|
requirement: !ruby/object:Gem::Requirement
|
86
101
|
requirements:
|
87
102
|
- - "~>"
|
88
103
|
- !ruby/object:Gem::Version
|
89
|
-
version: '1.
|
104
|
+
version: '1.1'
|
105
|
+
type: :development
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - "~>"
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '1.1'
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: genevalidator
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - "~>"
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '1.6'
|
90
119
|
type: :runtime
|
91
120
|
prerelease: false
|
92
121
|
version_requirements: !ruby/object:Gem::Requirement
|
93
122
|
requirements:
|
94
123
|
- - "~>"
|
95
124
|
- !ruby/object:Gem::Version
|
96
|
-
version: '1.
|
125
|
+
version: '1.6'
|
97
126
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
127
|
+
name: bio
|
99
128
|
requirement: !ruby/object:Gem::Requirement
|
100
129
|
requirements:
|
101
130
|
- - "~>"
|
@@ -109,7 +138,7 @@ dependencies:
|
|
109
138
|
- !ruby/object:Gem::Version
|
110
139
|
version: '1.4'
|
111
140
|
- !ruby/object:Gem::Dependency
|
112
|
-
name: sinatra
|
141
|
+
name: sinatra
|
113
142
|
requirement: !ruby/object:Gem::Requirement
|
114
143
|
requirements:
|
115
144
|
- - "~>"
|
@@ -164,37 +193,8 @@ dependencies:
|
|
164
193
|
- - "~>"
|
165
194
|
- !ruby/object:Gem::Version
|
166
195
|
version: '3.6'
|
167
|
-
- !ruby/object:Gem::Dependency
|
168
|
-
name: thin
|
169
|
-
requirement: !ruby/object:Gem::Requirement
|
170
|
-
requirements:
|
171
|
-
- - "~>"
|
172
|
-
- !ruby/object:Gem::Version
|
173
|
-
version: '1.6'
|
174
|
-
type: :runtime
|
175
|
-
prerelease: false
|
176
|
-
version_requirements: !ruby/object:Gem::Requirement
|
177
|
-
requirements:
|
178
|
-
- - "~>"
|
179
|
-
- !ruby/object:Gem::Version
|
180
|
-
version: '1.6'
|
181
|
-
- !ruby/object:Gem::Dependency
|
182
|
-
name: w3c_validators
|
183
|
-
requirement: !ruby/object:Gem::Requirement
|
184
|
-
requirements:
|
185
|
-
- - "~>"
|
186
|
-
- !ruby/object:Gem::Version
|
187
|
-
version: '1.1'
|
188
|
-
type: :runtime
|
189
|
-
prerelease: false
|
190
|
-
version_requirements: !ruby/object:Gem::Requirement
|
191
|
-
requirements:
|
192
|
-
- - "~>"
|
193
|
-
- !ruby/object:Gem::Version
|
194
|
-
version: '1.1'
|
195
196
|
description: A Web App wrapper for GeneValidator, a program for validating gene predictions.
|
196
|
-
email:
|
197
|
-
- Ismail.Moghul@gmail.com
|
197
|
+
email: y.wurm@qmul.ac.uk
|
198
198
|
executables:
|
199
199
|
- genevalidatorapp
|
200
200
|
extensions: []
|
@@ -241,7 +241,6 @@ files:
|
|
241
241
|
- public/web_files/img/gene.png
|
242
242
|
- public/web_files/js/GV_compiled_js.min.js
|
243
243
|
- public/web_files/json/.gitkeep
|
244
|
-
- spec/app_spec.rb
|
245
244
|
- spec/database/funky_ids/funky_ids.fa
|
246
245
|
- spec/database/funky_ids/funky_ids.fa.nhr
|
247
246
|
- spec/database/funky_ids/funky_ids.fa.nin
|
@@ -268,13 +267,13 @@ files:
|
|
268
267
|
- spec/database/without_parse_seqids/without_parse_seqids.fa.phr
|
269
268
|
- spec/database/without_parse_seqids/without_parse_seqids.fa.pin
|
270
269
|
- spec/database/without_parse_seqids/without_parse_seqids.fa.psq
|
271
|
-
- spec/database_spec.rb
|
272
270
|
- spec/empty_config.yml
|
271
|
+
- spec/route_spec.rb
|
273
272
|
- views/500.slim
|
274
273
|
- views/index.slim
|
275
274
|
- views/layout.slim
|
276
275
|
- views/results.slim
|
277
|
-
homepage: https://github.
|
276
|
+
homepage: https://wurmlab.github.io/tools/genevalidator/
|
278
277
|
licenses:
|
279
278
|
- AGPL
|
280
279
|
metadata: {}
|
@@ -310,7 +309,6 @@ signing_key:
|
|
310
309
|
specification_version: 4
|
311
310
|
summary: A Web App wrapper for GeneValidator.
|
312
311
|
test_files:
|
313
|
-
- spec/app_spec.rb
|
314
312
|
- spec/database/funky_ids/funky_ids.fa
|
315
313
|
- spec/database/funky_ids/funky_ids.fa.nhr
|
316
314
|
- spec/database/funky_ids/funky_ids.fa.nin
|
@@ -337,6 +335,6 @@ test_files:
|
|
337
335
|
- spec/database/without_parse_seqids/without_parse_seqids.fa.phr
|
338
336
|
- spec/database/without_parse_seqids/without_parse_seqids.fa.pin
|
339
337
|
- spec/database/without_parse_seqids/without_parse_seqids.fa.psq
|
340
|
-
- spec/database_spec.rb
|
341
338
|
- spec/empty_config.yml
|
339
|
+
- spec/route_spec.rb
|
342
340
|
has_rdoc:
|
data/spec/app_spec.rb
DELETED
@@ -1,107 +0,0 @@
|
|
1
|
-
require 'genevalidatorapp'
|
2
|
-
require 'rack/test'
|
3
|
-
require 'w3c_validators'
|
4
|
-
|
5
|
-
module GeneValidatorApp
|
6
|
-
include W3CValidators
|
7
|
-
|
8
|
-
describe 'App' do
|
9
|
-
ENV['RACK_ENV'] = 'test'
|
10
|
-
include Rack::Test::Methods
|
11
|
-
|
12
|
-
let 'root' do
|
13
|
-
GeneValidatorApp.root
|
14
|
-
end
|
15
|
-
|
16
|
-
let 'empty_config' do
|
17
|
-
File.join(root, 'spec', 'empty_config.yml')
|
18
|
-
end
|
19
|
-
|
20
|
-
let 'database_dir' do
|
21
|
-
File.join(root, 'spec', 'database')
|
22
|
-
end
|
23
|
-
|
24
|
-
let 'app' do
|
25
|
-
GeneValidatorApp.init(config_file: empty_config,
|
26
|
-
database_dir: database_dir)
|
27
|
-
end
|
28
|
-
|
29
|
-
before :each do
|
30
|
-
app
|
31
|
-
@params = { 'seq' => 'AGCTAGCTAGCT',
|
32
|
-
'validations' => '["lenc", "lenr", "dup", "merge", "align", "frame", "orf"]',
|
33
|
-
'database' => Database.first.name }
|
34
|
-
end
|
35
|
-
|
36
|
-
it 'should start the app' do
|
37
|
-
get '/'
|
38
|
-
last_response.ok?.should == true
|
39
|
-
end
|
40
|
-
|
41
|
-
it 'returns Bad Request (400) if no sequence is provided' do
|
42
|
-
@params.delete('seq')
|
43
|
-
post '/input', @params
|
44
|
-
last_response.status.should == 400
|
45
|
-
end
|
46
|
-
|
47
|
-
it 'returns Bad Request (400) if no validations is provided' do
|
48
|
-
@params.delete('validations')
|
49
|
-
post '/input', @params
|
50
|
-
last_response.status.should == 400
|
51
|
-
end
|
52
|
-
|
53
|
-
it 'returns Bad Request (400) if no database is provided' do
|
54
|
-
@params.delete('database')
|
55
|
-
post '/input', @params
|
56
|
-
last_response.status.should == 400
|
57
|
-
end
|
58
|
-
|
59
|
-
it 'returns OK (200) when sequence, validations and database name are provided' do
|
60
|
-
post '/input', @params
|
61
|
-
last_response.status.should == 200
|
62
|
-
|
63
|
-
@params[:result_link] = 'yes'
|
64
|
-
post '/input', @params
|
65
|
-
last_response.status.should == 200
|
66
|
-
end
|
67
|
-
|
68
|
-
it 'returns not found (404) when random url is posted against' do
|
69
|
-
post '/not_a_real_url', @params
|
70
|
-
last_response.status.should == 404
|
71
|
-
end
|
72
|
-
|
73
|
-
it 'validate the html' do
|
74
|
-
get '/'
|
75
|
-
html = last_response.body
|
76
|
-
|
77
|
-
validator = MarkupValidator.new
|
78
|
-
r = validator.validate_text(html)
|
79
|
-
|
80
|
-
if r.errors.length > 0
|
81
|
-
r.errors.each do |err|
|
82
|
-
puts err.to_s
|
83
|
-
end
|
84
|
-
results = false
|
85
|
-
else
|
86
|
-
results = true
|
87
|
-
end
|
88
|
-
results.should == true
|
89
|
-
end
|
90
|
-
|
91
|
-
# it 'should validate the css' do
|
92
|
-
# css = File.read(File.join(root, 'public/web_files/css/custom.min.css'))
|
93
|
-
# validator = CSSValidator.new
|
94
|
-
# r = validator.validate_text(css)
|
95
|
-
|
96
|
-
# if r.errors.length > 0
|
97
|
-
# r.errors.each do |err|
|
98
|
-
# puts err.to_s
|
99
|
-
# end
|
100
|
-
# results = false
|
101
|
-
# else
|
102
|
-
# results = true
|
103
|
-
# end
|
104
|
-
# results.should == true
|
105
|
-
# end
|
106
|
-
end
|
107
|
-
end
|
data/spec/database_spec.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
require 'genevalidatorapp'
|
2
|
-
require 'genevalidatorapp/database'
|
3
|
-
require 'rspec'
|
4
|
-
|
5
|
-
module GeneValidatorApp
|
6
|
-
describe 'Database' do
|
7
|
-
let 'root' do
|
8
|
-
GeneValidatorApp.root
|
9
|
-
end
|
10
|
-
|
11
|
-
let 'empty_config' do
|
12
|
-
File.join(root, 'spec', 'empty_config.yml')
|
13
|
-
end
|
14
|
-
|
15
|
-
let 'database_dir' do
|
16
|
-
File.join(root, 'spec', 'database')
|
17
|
-
end
|
18
|
-
|
19
|
-
let 'database_dir_no_db' do
|
20
|
-
File.join(root, 'spec', 'database', 'proteins', 'Cardiocondyla_obscurior')
|
21
|
-
end
|
22
|
-
|
23
|
-
let 'app' do
|
24
|
-
GeneValidatorApp.init(config_file: empty_config,
|
25
|
-
database_dir: database_dir)
|
26
|
-
end
|
27
|
-
|
28
|
-
it 'can tell BLAST+ databases in a directory' do
|
29
|
-
end
|
30
|
-
|
31
|
-
it 'can tell NCBI multipart database name' do
|
32
|
-
# Database.multipart_database_name?('/home/ben/pd.ben/sequenceserver/db/nr.00').should be_true
|
33
|
-
# Database.multipart_database_name?('/home/ben/pd.ben/sequenceserver/db/nr').should be_false
|
34
|
-
# Database.multipart_database_name?('/home/ben/pd.ben/sequenceserver/db/img3.5.finished.faa.01').should be_true
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|