sequenceserver 1.0.0.pre.5 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of sequenceserver might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.bootstrap/README.mkd +2 -0
- data/.bootstrap/config.json +416 -0
- data/.gitignore +56 -0
- data/.mailmap +5 -0
- data/.rspec +2 -0
- data/.rubocop.yml +51 -0
- data/.travis.yml +18 -0
- data/COPYRIGHT.txt +13 -0
- data/Gruntfile.js +133 -0
- data/LICENSE.txt +638 -46
- data/{LICENSE.Apache.txt → LICENSE/Apache.txt} +0 -0
- data/LICENSE/d3.txt +26 -0
- data/Rakefile +13 -0
- data/bin/sequenceserver +27 -4
- data/lib/sequenceserver.rb +26 -13
- data/lib/sequenceserver/database.rb +19 -8
- data/lib/sequenceserver/exceptions.rb +9 -1
- data/package.json +29 -0
- data/public/css/custom.css +10 -2
- data/public/dist/css/sequenceserver.min.css +1 -1
- data/public/dist/css/sequenceserver.min.css.gz +0 -0
- data/public/dist/js/sequenceserver.min.js +1 -1
- data/public/dist/js/sequenceserver.min.js.gz +0 -0
- data/public/js/jquery.t.js +2 -2
- data/public/js/sequence.js +4 -1
- data/public/js/sequenceserver.js +23 -20
- data/sequenceserver.gemspec +3 -6
- data/spec/blast_spec.rb +297 -0
- data/spec/capybara_spec.rb +51 -0
- data/spec/config_spec.rb +87 -0
- data/spec/database/funky_ids/funky_ids.fa +12 -0
- data/spec/database/funky_ids/funky_ids.fa.nhr +0 -0
- data/spec/database/funky_ids/funky_ids.fa.nin +0 -0
- data/spec/database/funky_ids/funky_ids.fa.nog +0 -0
- data/spec/database/funky_ids/funky_ids.fa.nsd +11 -0
- data/spec/database/funky_ids/funky_ids.fa.nsi +0 -0
- data/spec/database/funky_ids/funky_ids.fa.nsq +0 -0
- data/spec/database/sample/links.rb +23 -0
- data/spec/database/sample/proteins/Solenopsis_invicta/Sinvicta2-2-3.prot.subset.fasta +6449 -0
- data/spec/database/sample/proteins/Solenopsis_invicta/Sinvicta2-2-3.prot.subset.fasta.phr +0 -0
- data/spec/database/sample/proteins/Solenopsis_invicta/Sinvicta2-2-3.prot.subset.fasta.pin +0 -0
- data/spec/database/sample/proteins/Solenopsis_invicta/Sinvicta2-2-3.prot.subset.fasta.pog +0 -0
- data/spec/database/sample/proteins/Solenopsis_invicta/Sinvicta2-2-3.prot.subset.fasta.psd +2378 -0
- data/spec/database/sample/proteins/Solenopsis_invicta/Sinvicta2-2-3.prot.subset.fasta.psi +0 -0
- data/spec/database/sample/proteins/Solenopsis_invicta/Sinvicta2-2-3.prot.subset.fasta.psq +0 -0
- data/spec/database/sample/si_uniprot_idmap.yml +14180 -0
- data/spec/database/sample/transcripts/Solenopsis_invicta/Sinvicta2-2-3.cdna.subset.fasta +5486 -0
- data/spec/database/sample/transcripts/Solenopsis_invicta/Sinvicta2-2-3.cdna.subset.fasta.nhr +0 -0
- data/spec/database/sample/transcripts/Solenopsis_invicta/Sinvicta2-2-3.cdna.subset.fasta.nin +0 -0
- data/spec/database/sample/transcripts/Solenopsis_invicta/Sinvicta2-2-3.cdna.subset.fasta.nog +0 -0
- data/spec/database/sample/transcripts/Solenopsis_invicta/Sinvicta2-2-3.cdna.subset.fasta.nsd +946 -0
- data/spec/database/sample/transcripts/Solenopsis_invicta/Sinvicta2-2-3.cdna.subset.fasta.nsi +0 -0
- data/spec/database/sample/transcripts/Solenopsis_invicta/Sinvicta2-2-3.cdna.subset.fasta.nsq +0 -0
- data/spec/database/unformatted/Cardiocondyla_obscurior/Cobs1.4.proteins.fa +148303 -0
- data/spec/database/without_parse_seqids/without_parse_seqids.fa +10 -0
- data/spec/database/without_parse_seqids/without_parse_seqids.fa.phr +0 -0
- data/spec/database/without_parse_seqids/without_parse_seqids.fa.pin +0 -0
- data/spec/database/without_parse_seqids/without_parse_seqids.fa.psq +0 -0
- data/spec/database_spec.rb +129 -0
- data/spec/empty_config.yml +0 -0
- data/spec/routes_spec.rb +103 -0
- data/spec/sample.conf +2 -0
- data/spec/sample_reports/blastn_sample.asn +144 -0
- data/spec/sample_reports/blastp_sample.asn +1187 -0
- data/spec/sample_reports/blastx_sample.asn +1191 -0
- data/spec/sample_reports/no_hits_sample.asn +130 -0
- data/spec/sample_reports/tblastn_sample.asn +1107 -0
- data/spec/sample_reports/tblastx_sample.asn +2422 -0
- data/spec/sample_reports/with_hits_sample.asn +1489 -0
- data/spec/sequence_spec.rb +100 -0
- data/spec/sequenceserver_spec.rb +108 -0
- data/spec/spec_helper.rb +11 -0
- data/views/result.erb +55 -33
- data/views/search.erb +28 -23
- metadata +63 -151
- data/public/dist/js/webshims/shims/FlashCanvas/canvas2png.js +0 -1
- data/public/dist/js/webshims/shims/FlashCanvas/flashcanvas.js +0 -1
- data/public/dist/js/webshims/shims/FlashCanvas/flashcanvas.swf +0 -0
- data/public/dist/js/webshims/shims/FlashCanvasPro/canvas2png.js +0 -1
- data/public/dist/js/webshims/shims/FlashCanvasPro/flash10canvas.swf +0 -0
- data/public/dist/js/webshims/shims/FlashCanvasPro/flash9canvas.swf +0 -0
- data/public/dist/js/webshims/shims/FlashCanvasPro/flashcanvas.js +0 -1
- data/public/dist/js/webshims/shims/canvas-blob.js +0 -1
- data/public/dist/js/webshims/shims/color-picker.js +0 -2
- data/public/dist/js/webshims/shims/combos/1.js +0 -6
- data/public/dist/js/webshims/shims/combos/10.js +0 -2
- data/public/dist/js/webshims/shims/combos/11.js +0 -2
- data/public/dist/js/webshims/shims/combos/12.js +0 -6
- data/public/dist/js/webshims/shims/combos/13.js +0 -1
- data/public/dist/js/webshims/shims/combos/14.js +0 -1
- data/public/dist/js/webshims/shims/combos/15.js +0 -2
- data/public/dist/js/webshims/shims/combos/16.js +0 -7
- data/public/dist/js/webshims/shims/combos/17.js +0 -2
- data/public/dist/js/webshims/shims/combos/18.js +0 -3
- data/public/dist/js/webshims/shims/combos/2.js +0 -7
- data/public/dist/js/webshims/shims/combos/21.js +0 -2
- data/public/dist/js/webshims/shims/combos/22.js +0 -1
- data/public/dist/js/webshims/shims/combos/23.js +0 -6
- data/public/dist/js/webshims/shims/combos/25.js +0 -2
- data/public/dist/js/webshims/shims/combos/27.js +0 -1
- data/public/dist/js/webshims/shims/combos/28.js +0 -1
- data/public/dist/js/webshims/shims/combos/29.js +0 -1
- data/public/dist/js/webshims/shims/combos/3.js +0 -1
- data/public/dist/js/webshims/shims/combos/30.js +0 -2
- data/public/dist/js/webshims/shims/combos/31.js +0 -1
- data/public/dist/js/webshims/shims/combos/33.js +0 -1
- data/public/dist/js/webshims/shims/combos/34.js +0 -1
- data/public/dist/js/webshims/shims/combos/4.js +0 -1
- data/public/dist/js/webshims/shims/combos/5.js +0 -2
- data/public/dist/js/webshims/shims/combos/6.js +0 -2
- data/public/dist/js/webshims/shims/combos/7.js +0 -7
- data/public/dist/js/webshims/shims/combos/8.js +0 -7
- data/public/dist/js/webshims/shims/combos/9.js +0 -2
- data/public/dist/js/webshims/shims/combos/97.js +0 -1
- data/public/dist/js/webshims/shims/combos/98.js +0 -1
- data/public/dist/js/webshims/shims/combos/99.js +0 -1
- data/public/dist/js/webshims/shims/details.js +0 -1
- data/public/dist/js/webshims/shims/dom-extend.js +0 -1
- data/public/dist/js/webshims/shims/es5.js +0 -1
- data/public/dist/js/webshims/shims/es6.js +0 -1
- data/public/dist/js/webshims/shims/excanvas.js +0 -1
- data/public/dist/js/webshims/shims/filereader-xhr.js +0 -1
- data/public/dist/js/webshims/shims/form-combat.js +0 -1
- data/public/dist/js/webshims/shims/form-core.js +0 -1
- data/public/dist/js/webshims/shims/form-datalist-lazy.js +0 -1
- data/public/dist/js/webshims/shims/form-datalist.js +0 -1
- data/public/dist/js/webshims/shims/form-fixrangechange.js +0 -1
- data/public/dist/js/webshims/shims/form-inputmode.js +0 -1
- data/public/dist/js/webshims/shims/form-message.js +0 -1
- data/public/dist/js/webshims/shims/form-native-extend.js +0 -1
- data/public/dist/js/webshims/shims/form-number-date-api.js +0 -1
- data/public/dist/js/webshims/shims/form-number-date-ui.js +0 -1
- data/public/dist/js/webshims/shims/form-shim-extend.js +0 -1
- data/public/dist/js/webshims/shims/form-shim-extend2.js +0 -1
- data/public/dist/js/webshims/shims/form-validation.js +0 -1
- data/public/dist/js/webshims/shims/form-validators.js +0 -1
- data/public/dist/js/webshims/shims/forms-picker.js +0 -1
- data/public/dist/js/webshims/shims/geolocation.js +0 -1
- data/public/dist/js/webshims/shims/i18n/formcfg-ar.js +0 -1
- data/public/dist/js/webshims/shims/i18n/formcfg-ch-CN.js +0 -1
- data/public/dist/js/webshims/shims/i18n/formcfg-cs.js +0 -1
- data/public/dist/js/webshims/shims/i18n/formcfg-de.js +0 -1
- data/public/dist/js/webshims/shims/i18n/formcfg-el.js +0 -1
- data/public/dist/js/webshims/shims/i18n/formcfg-en.js +0 -1
- data/public/dist/js/webshims/shims/i18n/formcfg-es.js +0 -1
- data/public/dist/js/webshims/shims/i18n/formcfg-fa.js +0 -1
- data/public/dist/js/webshims/shims/i18n/formcfg-fr.js +0 -1
- data/public/dist/js/webshims/shims/i18n/formcfg-he.js +0 -1
- data/public/dist/js/webshims/shims/i18n/formcfg-hi.js +0 -1
- data/public/dist/js/webshims/shims/i18n/formcfg-hu.js +0 -1
- data/public/dist/js/webshims/shims/i18n/formcfg-it.js +0 -1
- data/public/dist/js/webshims/shims/i18n/formcfg-ja.js +0 -1
- data/public/dist/js/webshims/shims/i18n/formcfg-lt.js +0 -1
- data/public/dist/js/webshims/shims/i18n/formcfg-nl.js +0 -1
- data/public/dist/js/webshims/shims/i18n/formcfg-pl.js +0 -1
- data/public/dist/js/webshims/shims/i18n/formcfg-pt-BR.js +0 -1
- data/public/dist/js/webshims/shims/i18n/formcfg-pt-PT.js +0 -1
- data/public/dist/js/webshims/shims/i18n/formcfg-pt.js +0 -1
- data/public/dist/js/webshims/shims/i18n/formcfg-ru.js +0 -1
- data/public/dist/js/webshims/shims/i18n/formcfg-sv.js +0 -1
- data/public/dist/js/webshims/shims/i18n/formcfg-zh-CN.js +0 -1
- data/public/dist/js/webshims/shims/i18n/formcfg-zh-TW.js +0 -1
- data/public/dist/js/webshims/shims/jme/alternate-media.js +0 -1
- data/public/dist/js/webshims/shims/jme/base.js +0 -1
- data/public/dist/js/webshims/shims/jme/controls.css +0 -1
- data/public/dist/js/webshims/shims/jme/jme.eot +0 -0
- data/public/dist/js/webshims/shims/jme/jme.svg +0 -36
- data/public/dist/js/webshims/shims/jme/jme.ttf +0 -0
- data/public/dist/js/webshims/shims/jme/jme.woff +0 -0
- data/public/dist/js/webshims/shims/jme/mediacontrols-lazy.js +0 -1
- data/public/dist/js/webshims/shims/jme/mediacontrols.js +0 -1
- data/public/dist/js/webshims/shims/jme/playlist.js +0 -1
- data/public/dist/js/webshims/shims/jpicker/images/AlphaBar.png +0 -0
- data/public/dist/js/webshims/shims/jpicker/images/Bars.png +0 -0
- data/public/dist/js/webshims/shims/jpicker/images/Maps.png +0 -0
- data/public/dist/js/webshims/shims/jpicker/images/NoColor.png +0 -0
- data/public/dist/js/webshims/shims/jpicker/images/bar-opacity.png +0 -0
- data/public/dist/js/webshims/shims/jpicker/images/map-opacity.png +0 -0
- data/public/dist/js/webshims/shims/jpicker/images/mappoint.gif +0 -0
- data/public/dist/js/webshims/shims/jpicker/images/picker.gif +0 -0
- data/public/dist/js/webshims/shims/jpicker/images/preview-opacity.png +0 -0
- data/public/dist/js/webshims/shims/jpicker/images/rangearrows.gif +0 -0
- data/public/dist/js/webshims/shims/jpicker/jpicker.css +0 -1
- data/public/dist/js/webshims/shims/matchMedia.js +0 -3
- data/public/dist/js/webshims/shims/mediacapture-picker.js +0 -1
- data/public/dist/js/webshims/shims/mediacapture.js +0 -1
- data/public/dist/js/webshims/shims/mediaelement-core.js +0 -1
- data/public/dist/js/webshims/shims/mediaelement-debug.js +0 -1
- data/public/dist/js/webshims/shims/mediaelement-jaris.js +0 -1
- data/public/dist/js/webshims/shims/mediaelement-native-fix.js +0 -1
- data/public/dist/js/webshims/shims/mediaelement-yt.js +0 -1
- data/public/dist/js/webshims/shims/moxie/flash/Moxie.cdn.swf +0 -0
- data/public/dist/js/webshims/shims/moxie/flash/Moxie.min.swf +0 -0
- data/public/dist/js/webshims/shims/moxie/js/moxie-html4.js +0 -3
- data/public/dist/js/webshims/shims/moxie/js/moxie-swf.js +0 -2
- data/public/dist/js/webshims/shims/picture.js +0 -1
- data/public/dist/js/webshims/shims/plugins/jquery.ui.position.js +0 -11
- data/public/dist/js/webshims/shims/range-ui.js +0 -1
- data/public/dist/js/webshims/shims/sizzle.js +0 -11
- data/public/dist/js/webshims/shims/sticky.js +0 -1
- data/public/dist/js/webshims/shims/styles/color-picker.png +0 -0
- data/public/dist/js/webshims/shims/styles/forms-ext.css +0 -1
- data/public/dist/js/webshims/shims/styles/forms-picker.css +0 -1
- data/public/dist/js/webshims/shims/styles/progress.gif +0 -0
- data/public/dist/js/webshims/shims/styles/progress.png +0 -0
- data/public/dist/js/webshims/shims/styles/shim-ext.css +0 -1
- data/public/dist/js/webshims/shims/styles/shim.css +0 -1
- data/public/dist/js/webshims/shims/styles/transparent.png +0 -0
- data/public/dist/js/webshims/shims/styles/widget.eot +0 -0
- data/public/dist/js/webshims/shims/styles/widget.svg +0 -12
- data/public/dist/js/webshims/shims/styles/widget.ttf +0 -0
- data/public/dist/js/webshims/shims/styles/widget.woff +0 -0
- data/public/dist/js/webshims/shims/swf/JarisFLVPlayer.swf +0 -0
- data/public/dist/js/webshims/shims/swfmini-embed.js +0 -1
- data/public/dist/js/webshims/shims/swfmini.js +0 -6
- data/public/dist/js/webshims/shims/track-ui.js +0 -1
- data/public/dist/js/webshims/shims/track.js +0 -1
- data/public/dist/js/webshims/shims/url.js +0 -1
- data/public/dist/js/webshims/shims/usermedia-core.js +0 -1
- data/public/dist/js/webshims/shims/usermedia-shim.js +0 -1
@@ -0,0 +1,100 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'sequenceserver/sequence'
|
3
|
+
require 'digest/md5'
|
4
|
+
|
5
|
+
# Test Sequence class.
|
6
|
+
module SequenceServer
|
7
|
+
describe 'Sequence type detection' do
|
8
|
+
it 'should be able to detect nucleotide sequences' do
|
9
|
+
sequences = [
|
10
|
+
'AAAAAAAAAAAAAAAAAAAAAT',
|
11
|
+
' CAGATGCRRCAAAGCAAACGGCAA 34523453 652352',
|
12
|
+
'ACCNNNNNNXXXXCAUUUUUU',
|
13
|
+
"ACGT\n\t\t\nACCACGGACCACGAAAGCG"
|
14
|
+
]
|
15
|
+
sequences.each do |sequence|
|
16
|
+
Sequence.guess_type(sequence).should == :nucleotide
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'should be able to detect protein sequences' do
|
21
|
+
sequences = [
|
22
|
+
'ADSACGHKSJLFCVMGTL',
|
23
|
+
' 345 KSSYPHYSPPPPHS 345 23453 652352',
|
24
|
+
'GEYSNLNNNNNNXXXXSSSSSSSSSSSSSSSSSSSSSSS',
|
25
|
+
"EE\n\t\t\n \t\t\EEQRRQQSARTSRRQR"
|
26
|
+
]
|
27
|
+
sequences.each do |sequence|
|
28
|
+
Sequence.guess_type(sequence).should == :protein
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'should be able to say sequence type detection impossible' do
|
33
|
+
Sequence.guess_type('ACSFGT').should be_nil
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'should be able to tell composition of a sequence string' do
|
37
|
+
Sequence.composition('asdfasdfffffAsdf').should == { 'a' => 2, 'd' => 3,
|
38
|
+
'f' => 7, 's' => 3,
|
39
|
+
'A' => 1 }
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
describe 'Sequence retrieval' do
|
44
|
+
root = SequenceServer.root
|
45
|
+
database_dir = File.join(root, 'spec', 'database')
|
46
|
+
|
47
|
+
let 'a_normal_database_id' do
|
48
|
+
Digest::MD5.hexdigest File.join(database_dir, 'sample', 'proteins',
|
49
|
+
'Solenopsis_invicta',
|
50
|
+
'Sinvicta2-2-3.prot.subset.fasta')
|
51
|
+
end
|
52
|
+
|
53
|
+
let 'funky_ids_database_id' do
|
54
|
+
Digest::MD5.hexdigest File.join(database_dir, 'funky_ids',
|
55
|
+
'funky_ids.fa')
|
56
|
+
end
|
57
|
+
|
58
|
+
before :all do
|
59
|
+
SequenceServer.config[:database_dir] = database_dir
|
60
|
+
Database.scan_databases_dir
|
61
|
+
end
|
62
|
+
|
63
|
+
it 'should be able to retrieve sequences from database' do
|
64
|
+
sequences = Sequence::Retriever.new('SI2.2.0_06267',
|
65
|
+
a_normal_database_id).sequences
|
66
|
+
|
67
|
+
sequences.length.should eq 1
|
68
|
+
sequences.first.gi.should be_nil
|
69
|
+
sequences.first.seqid.should eq 'SI2.2.0_06267'
|
70
|
+
sequences.first.id.should eq 'SI2.2.0_06267'
|
71
|
+
sequences.first.title.should eq 'locus=Si_gnF.scaffold02592'\
|
72
|
+
'[1282609..1284114].pep_2 quality=100.00'
|
73
|
+
sequences.first.value.should == "\
|
74
|
+
MNTLWLSLWDYPGKLPLNFMVFDTKDDLQAAYWRDPYSIPLAVIFEDPQPISQRLIYEIRTNPSYTLPPPPTKLYSAPI\
|
75
|
+
SCRKNKTGHWMDDILSIKTGESCPVNNYLHSGFLALQMITDITKIKLENSDVTIPDIKLIMFPKEPYTADWMLAFRVVI\
|
76
|
+
PLYMVLALSQFITYLLILIVGEKENKIKEGMKMMGLNDSVF"
|
77
|
+
end
|
78
|
+
|
79
|
+
it 'should be able to retrieve more than one sequence from a database' do
|
80
|
+
sequences = Sequence::Retriever.new(['SI2.2.0_06267', 'SI2.2.0_13722'],
|
81
|
+
a_normal_database_id).sequences
|
82
|
+
sequences.length.should == 2
|
83
|
+
end
|
84
|
+
|
85
|
+
# it 'should be able to retrieve sequences from database even if accession'\
|
86
|
+
# 'contains only numbers' do
|
87
|
+
# Database.scan_databases_dir
|
88
|
+
# sequences = Sequence.from_blastdb(123456, funky_ids_database_id)
|
89
|
+
# sequences.length.should == 1
|
90
|
+
# end
|
91
|
+
|
92
|
+
it 'should be able to retrieve sequences from database for all kinds of'\
|
93
|
+
'funky accessions' do
|
94
|
+
funky_accessions = ['abcdef#', 'abc#def', '123#456'] # , '123456#']
|
95
|
+
sequences = Sequence::Retriever.new(funky_accessions,
|
96
|
+
funky_ids_database_id).sequences
|
97
|
+
sequences.length.should == 3
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
@@ -0,0 +1,108 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
# Test the main module, startup process, etc.
|
4
|
+
module SequenceServer
|
5
|
+
# NOTE:
|
6
|
+
# Testing SequenceServer's initialization can be a bit tricky. For
|
7
|
+
# instance, to test num_threads, correct database_dir must be set.
|
8
|
+
describe 'SequenceServer' do
|
9
|
+
let 'root' do
|
10
|
+
SequenceServer.root
|
11
|
+
end
|
12
|
+
|
13
|
+
let 'empty_config' do
|
14
|
+
File.join(root, 'spec', 'empty_config.yml')
|
15
|
+
end
|
16
|
+
|
17
|
+
let 'database_dir' do
|
18
|
+
File.join(root, 'spec', 'database')
|
19
|
+
end
|
20
|
+
|
21
|
+
let 'database_dir_no_db' do
|
22
|
+
File.join(root, 'spec', 'database', 'unformatted',
|
23
|
+
'Cardiocondyla_obscurior')
|
24
|
+
end
|
25
|
+
|
26
|
+
let 'config' do
|
27
|
+
{ :config_file => empty_config }
|
28
|
+
end
|
29
|
+
|
30
|
+
# bin, if set, should be a _directory_ that exists
|
31
|
+
it 'raises appropriate error if bin incorrectly set' do
|
32
|
+
# Raise if bin dir does not exist.
|
33
|
+
expect do
|
34
|
+
SequenceServer.init(config.update :bin => '/foo/bar')
|
35
|
+
end.to raise_error(BIN_DIR_NOT_FOUND)
|
36
|
+
|
37
|
+
# Raise if bin dir is not a directory.
|
38
|
+
expect do
|
39
|
+
SequenceServer.init(config.update :bin => __FILE__)
|
40
|
+
end.to raise_error(BIN_DIR_NOT_FOUND)
|
41
|
+
end
|
42
|
+
|
43
|
+
# database_dir is compulsory
|
44
|
+
it 'raises appropriate error if database_dir not set' do
|
45
|
+
expect do
|
46
|
+
SequenceServer.init(config.update :config_file => empty_config)
|
47
|
+
end.to raise_error(DATABASE_DIR_NOT_SET)
|
48
|
+
end
|
49
|
+
|
50
|
+
# database_dir, when set, should be a _directory_ that exists.
|
51
|
+
it 'raises appropriate error if database_dir incorrectly set' do
|
52
|
+
# Raise if database_dir does not exist.
|
53
|
+
expect do
|
54
|
+
SequenceServer.init(config.update :database_dir => '/foo/bar')
|
55
|
+
end.to raise_error(DATABASE_DIR_NOT_FOUND)
|
56
|
+
|
57
|
+
# Raise if database_dir is not a directory.
|
58
|
+
expect do
|
59
|
+
SequenceServer.init(config.update :database_dir => __FILE__)
|
60
|
+
end.to raise_error(DATABASE_DIR_NOT_FOUND)
|
61
|
+
end
|
62
|
+
|
63
|
+
# database_dir, when correctly set, should contain at least one BLAST+
|
64
|
+
# database.
|
65
|
+
it "raises appropriate error if database_dir doesn't contain any BLAST+"\
|
66
|
+
'database' do
|
67
|
+
expect do
|
68
|
+
SequenceServer.init(config.update :database_dir => database_dir_no_db)
|
69
|
+
end.to raise_error(NO_BLAST_DATABASE_FOUND)
|
70
|
+
end
|
71
|
+
|
72
|
+
# num_threads, if set, should a number not less than 1.
|
73
|
+
it 'raises appropriate error if num_threads incorrectly set' do
|
74
|
+
# Raise if not a number.
|
75
|
+
expect do
|
76
|
+
SequenceServer.init(config.update :database_dir => database_dir,
|
77
|
+
:num_threads => 'foo')
|
78
|
+
end.to raise_error(NUM_THREADS_INCORRECT)
|
79
|
+
|
80
|
+
# Raise if less than 1.
|
81
|
+
expect do
|
82
|
+
SequenceServer.init(config.update :database_dir => database_dir,
|
83
|
+
:num_threads => 0)
|
84
|
+
end.to raise_error(NUM_THREADS_INCORRECT)
|
85
|
+
end
|
86
|
+
|
87
|
+
# extension file, if set, should be a _file_ that exists.
|
88
|
+
it 'raises appropriate error if require incorrectly set' do
|
89
|
+
# Raise if not found.
|
90
|
+
expect do
|
91
|
+
SequenceServer.init(config.update :database_dir => database_dir,
|
92
|
+
:require => 'foo/bar')
|
93
|
+
end.to raise_error(EXTENSION_FILE_NOT_FOUND)
|
94
|
+
|
95
|
+
# Raise if directory.
|
96
|
+
expect do
|
97
|
+
SequenceServer.init(config.update :database_dir => database_dir,
|
98
|
+
:require => File.dirname(__FILE__))
|
99
|
+
end.to raise_error(EXTENSION_FILE_NOT_FOUND)
|
100
|
+
end
|
101
|
+
|
102
|
+
it 'has a list of databases after startup' do
|
103
|
+
SequenceServer.init(config.update :database_dir => database_dir)
|
104
|
+
Database.all.should_not be_empty
|
105
|
+
Database.all.length.should == 4
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
data/spec/spec_helper.rb
ADDED
data/views/result.erb
CHANGED
@@ -82,42 +82,64 @@
|
|
82
82
|
<div
|
83
83
|
class="page-content collapse in"
|
84
84
|
id="<%="Query_#{query.number}_hit_#{hit.number}_alignment"%>">
|
85
|
-
<
|
86
|
-
|
87
|
-
</p>
|
88
|
-
<% hit.hsps.each do |hsp| %>
|
85
|
+
<div
|
86
|
+
class="row">
|
89
87
|
<div
|
90
|
-
class="
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
<td> <%= prettify value %> </th>
|
104
|
-
<% end %>
|
105
|
-
</tr>
|
106
|
-
</tbody>
|
107
|
-
</table>
|
108
|
-
<div class="alignment"><%= hsp.pp %></div>
|
88
|
+
class="col-md-4">
|
89
|
+
Hit length: <%= hit.length %>
|
90
|
+
</div>
|
91
|
+
<div
|
92
|
+
class="hit-links text-right col-md-8">
|
93
|
+
<label>
|
94
|
+
<input
|
95
|
+
type="checkbox" value="<%= hit.accession %>" data-target="<%= "#Query_#{query.number}_hit_#{hit.number}" %>">
|
96
|
+
Select
|
97
|
+
</label>
|
98
|
+
<% hit.links.each do |link| %>
|
99
|
+
| <%= a link %>
|
100
|
+
<% end %>
|
109
101
|
</div>
|
110
|
-
<% end %>
|
111
|
-
<div class="hit-links text-right">
|
112
|
-
<label>
|
113
|
-
<input
|
114
|
-
type="checkbox" value="<%= hit.accession %>" data-target="<%= "#Query_#{query.number}_hit_#{hit.number}" %>">
|
115
|
-
Select
|
116
|
-
</label>
|
117
|
-
<% hit.links.each do |link| %>
|
118
|
-
| <%= a link %>
|
119
|
-
<% end %>
|
120
102
|
</div>
|
103
|
+
<table
|
104
|
+
class="table hsps">
|
105
|
+
<tbody>
|
106
|
+
<% hit.hsps.each do |hsp| %>
|
107
|
+
<tr>
|
108
|
+
<td>
|
109
|
+
<%= hsp.number %>.
|
110
|
+
</td>
|
111
|
+
<td
|
112
|
+
style="width: 100%;">
|
113
|
+
<div
|
114
|
+
class="hsp" id="<%="Query_#{query.number}_hit_#{hit.number}_#{hsp.number}"%>"
|
115
|
+
data-hsp-evalue="<%= hsp.evalue %>" data-hsp-start="<%= hsp.qstart %>"
|
116
|
+
data-hsp-end="<%= hsp.qend %>" data-hsp-frame="<%= hsp.sframe %>">
|
117
|
+
<table
|
118
|
+
class="table table-condensed hsp-stats">
|
119
|
+
<thead>
|
120
|
+
<% hsp.stats.keys.each do |key| %>
|
121
|
+
<th>
|
122
|
+
<%= key %>
|
123
|
+
</th>
|
124
|
+
<% end %>
|
125
|
+
</thead>
|
126
|
+
<tbody>
|
127
|
+
<tr>
|
128
|
+
<% hsp.stats.values.each do |value| %>
|
129
|
+
<td>
|
130
|
+
<%= prettify value %>
|
131
|
+
</th>
|
132
|
+
<% end %>
|
133
|
+
</tr>
|
134
|
+
</tbody>
|
135
|
+
</table>
|
136
|
+
<div class="alignment"><%= hsp.pp %></div>
|
137
|
+
</div>
|
138
|
+
</td>
|
139
|
+
</tr>
|
140
|
+
<% end %>
|
141
|
+
</tbody>
|
142
|
+
</table>
|
121
143
|
</div>
|
122
144
|
</div>
|
123
145
|
<% end %>
|
data/views/search.erb
CHANGED
@@ -79,7 +79,7 @@
|
|
79
79
|
<div
|
80
80
|
class="dnd-errors">
|
81
81
|
<div
|
82
|
-
class="dnd-error"
|
82
|
+
class="dnd-error row"
|
83
83
|
id="dnd-multi-notification"
|
84
84
|
style="display: none;">
|
85
85
|
<div
|
@@ -89,7 +89,7 @@
|
|
89
89
|
</div>
|
90
90
|
|
91
91
|
<div
|
92
|
-
class="dnd-error"
|
92
|
+
class="dnd-error row"
|
93
93
|
id="dnd-large-file-notification"
|
94
94
|
style="display: none;">
|
95
95
|
<div
|
@@ -99,7 +99,7 @@
|
|
99
99
|
</div>
|
100
100
|
|
101
101
|
<div
|
102
|
-
class="dnd-error"
|
102
|
+
class="dnd-error row"
|
103
103
|
id="dnd-format-notification"
|
104
104
|
style="display: none;">
|
105
105
|
<div
|
@@ -148,7 +148,7 @@
|
|
148
148
|
<textarea
|
149
149
|
class="form-control text-monospace" name="sequence" id="sequence"
|
150
150
|
rows="10"
|
151
|
-
autofocus
|
151
|
+
autofocus
|
152
152
|
spellcheck="false"
|
153
153
|
placeholder="Paste query sequence(s) or drag file containing query sequence(s) in FASTA format here ..." ></textarea>
|
154
154
|
</div>
|
@@ -158,7 +158,7 @@
|
|
158
158
|
<div
|
159
159
|
class="notifications">
|
160
160
|
<div
|
161
|
-
class="notification"
|
161
|
+
class="notification row"
|
162
162
|
id="nucleotide-sequence-notification"
|
163
163
|
style="display: none;">
|
164
164
|
<div
|
@@ -168,7 +168,7 @@
|
|
168
168
|
</div>
|
169
169
|
|
170
170
|
<div
|
171
|
-
class="notification"
|
171
|
+
class="notification row"
|
172
172
|
id="protein-sequence-notification"
|
173
173
|
style="display: none;">
|
174
174
|
<div
|
@@ -178,7 +178,7 @@
|
|
178
178
|
</div>
|
179
179
|
|
180
180
|
<div
|
181
|
-
class="notification"
|
181
|
+
class="notification row"
|
182
182
|
id="mixed-sequence-notification"
|
183
183
|
style="display: none;">
|
184
184
|
<div
|
@@ -225,38 +225,43 @@
|
|
225
225
|
<div
|
226
226
|
class="col-md-8">
|
227
227
|
<div
|
228
|
-
class="form-group
|
229
|
-
<label
|
230
|
-
class="col-md-3 control-label"
|
231
|
-
for="advanced">
|
232
|
-
Advanced Parameters:
|
233
|
-
</label>
|
228
|
+
class="form-group">
|
234
229
|
<div
|
235
|
-
class="col-md-
|
230
|
+
class="col-md-12">
|
236
231
|
<div
|
237
232
|
class="input-group">
|
233
|
+
<label
|
234
|
+
class="control-label cursor-pointer"
|
235
|
+
for="advanced">
|
236
|
+
Advanced Parameters:
|
237
|
+
</label>
|
238
238
|
<input
|
239
239
|
type="text"
|
240
240
|
class="form-control" name="advanced" id="advanced"
|
241
241
|
title="View, and enter advanced parameters."
|
242
242
|
placeholder="eg: -evalue 1.0e-5 -num_alignments 100"/>
|
243
|
-
<div class="input-group-addon cursor-pointer" data-toggle="modal" data-
|
243
|
+
<div class="input-group-addon cursor-pointer" data-toggle="modal" data-target="#help">
|
244
244
|
<i class="fa fa-question"></i>
|
245
245
|
</div>
|
246
246
|
</div>
|
247
247
|
</div>
|
248
248
|
</div>
|
249
249
|
</div>
|
250
|
-
|
251
250
|
<div
|
252
251
|
class="col-md-4">
|
253
252
|
<div
|
254
|
-
class="
|
255
|
-
<
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
253
|
+
class="form-group">
|
254
|
+
<div
|
255
|
+
class="col-md-12">
|
256
|
+
<div
|
257
|
+
id="methods">
|
258
|
+
<button
|
259
|
+
type="submit"
|
260
|
+
id="method" class="btn btn-primary form-control">
|
261
|
+
blast
|
262
|
+
</button>
|
263
|
+
</div>
|
264
|
+
</div>
|
260
265
|
</div>
|
261
266
|
</div>
|
262
267
|
</div>
|
@@ -295,7 +300,7 @@
|
|
295
300
|
<br>
|
296
301
|
Please Cite:
|
297
302
|
<a href='http://www.sequenceserver.com'>
|
298
|
-
Priyam, Woodcroft, Rai & Wurm, <strong>SequenceServer</strong> (<em>in prep</em>)
|
303
|
+
Priyam, Woodcroft, Rai & Wurm, <strong>SequenceServer</strong> (<em>in prep</em>)
|
299
304
|
</a>
|
300
305
|
& relevant data sources.
|
301
306
|
</p>
|