sequenceserver 1.1.0.beta → 1.1.0.beta2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +7 -7
  3. data/README.md +9 -11
  4. data/Rakefile +2 -15
  5. data/lib/sequenceserver/database.rb +7 -1
  6. data/lib/sequenceserver/routes.rb +5 -2
  7. data/lib/sequenceserver/version.rb +1 -1
  8. data/lib/sequenceserver.rb +3 -1
  9. data/package.json +2 -3
  10. data/public/config.js +0 -7
  11. data/public/css/sequenceserver.css +8 -17
  12. data/public/css/sequenceserver.min.css +2 -2
  13. data/public/js/report.js +62 -45
  14. data/public/js/search.js +24 -17
  15. data/public/js/sequenceserver.js +23 -60
  16. data/public/sequenceserver-report.min.js +17 -0
  17. data/public/sequenceserver-search.min.js +11 -0
  18. data/sequenceserver.gemspec +5 -5
  19. data/spec/capybara_spec.rb +3 -3
  20. data/spec/sequence_spec.rb +2 -2
  21. data/views/layout.erb +1 -13
  22. data/views/report.erb +13 -0
  23. data/views/search.erb +45 -0
  24. metadata +26 -92
  25. data/public/css/sequenceserver.min.css.gz +0 -0
  26. data/public/sequenceserver.min.js +0 -26
  27. data/public/sequenceserver.min.js.gz +0 -0
  28. data/public/vendor/npm/object-assign@2.1.1/.jspm-hash +0 -1
  29. data/public/vendor/npm/object-assign@2.1.1/.jspm.json +0 -72
  30. data/public/vendor/npm/object-assign@2.1.1/index.js +0 -27
  31. data/public/vendor/npm/object-assign@2.1.1/package.json +0 -38
  32. data/public/vendor/npm/object-assign@2.1.1.js +0 -1
  33. data/public/vendor/npm/qs@2.4.1/.jshintignore +0 -1
  34. data/public/vendor/npm/qs@2.4.1/.jshintrc +0 -10
  35. data/public/vendor/npm/qs@2.4.1/.jspm-hash +0 -1
  36. data/public/vendor/npm/qs@2.4.1/.jspm.json +0 -61
  37. data/public/vendor/npm/qs@2.4.1/.npmignore +0 -18
  38. data/public/vendor/npm/qs@2.4.1/.travis.yml +0 -6
  39. data/public/vendor/npm/qs@2.4.1/CHANGELOG.md +0 -68
  40. data/public/vendor/npm/qs@2.4.1/CONTRIBUTING.md +0 -1
  41. data/public/vendor/npm/qs@2.4.1/LICENSE +0 -28
  42. data/public/vendor/npm/qs@2.4.1/Makefile +0 -8
  43. data/public/vendor/npm/qs@2.4.1/README.md +0 -233
  44. data/public/vendor/npm/qs@2.4.1/index.js +0 -2
  45. data/public/vendor/npm/qs@2.4.1/lib/index.js +0 -8
  46. data/public/vendor/npm/qs@2.4.1/lib/parse.js +0 -100
  47. data/public/vendor/npm/qs@2.4.1/lib/stringify.js +0 -67
  48. data/public/vendor/npm/qs@2.4.1/lib/utils.js +0 -132
  49. data/public/vendor/npm/qs@2.4.1/lib.js +0 -2
  50. data/public/vendor/npm/qs@2.4.1/package.json +0 -29
  51. data/public/vendor/npm/qs@2.4.1/test/parse.js +0 -359
  52. data/public/vendor/npm/qs@2.4.1.js +0 -1
  53. data/public/vendor/npm/react-router@0.13.3/.jspm-hash +0 -1
  54. data/public/vendor/npm/react-router@0.13.3/.jspm.json +0 -70
  55. data/public/vendor/npm/react-router@0.13.3/README.md +0 -140
  56. data/public/vendor/npm/react-router@0.13.3/lib/Cancellation.js +0 -9
  57. data/public/vendor/npm/react-router@0.13.3/lib/History.js +0 -31
  58. data/public/vendor/npm/react-router@0.13.3/lib/Match.js +0 -80
  59. data/public/vendor/npm/react-router@0.13.3/lib/Navigation.js +0 -22
  60. data/public/vendor/npm/react-router@0.13.3/lib/PathUtils.js +0 -154
  61. data/public/vendor/npm/react-router@0.13.3/lib/PropTypes.js +0 -15
  62. data/public/vendor/npm/react-router@0.13.3/lib/Redirect.js +0 -12
  63. data/public/vendor/npm/react-router@0.13.3/lib/Route.js +0 -133
  64. data/public/vendor/npm/react-router@0.13.3/lib/ScrollHistory.js +0 -53
  65. data/public/vendor/npm/react-router@0.13.3/lib/State.js +0 -25
  66. data/public/vendor/npm/react-router@0.13.3/lib/TestUtils.js +0 -102
  67. data/public/vendor/npm/react-router@0.13.3/lib/Transition.js +0 -58
  68. data/public/vendor/npm/react-router@0.13.3/lib/actions/LocationActions.js +0 -25
  69. data/public/vendor/npm/react-router@0.13.3/lib/behaviors/ImitateBrowserBehavior.js +0 -19
  70. data/public/vendor/npm/react-router@0.13.3/lib/behaviors/ScrollToTopBehavior.js +0 -15
  71. data/public/vendor/npm/react-router@0.13.3/lib/components/ActiveHandler.js +0 -111
  72. data/public/vendor/npm/react-router@0.13.3/lib/components/ContextWrapper.js +0 -39
  73. data/public/vendor/npm/react-router@0.13.3/lib/components/DefaultRoute.js +0 -41
  74. data/public/vendor/npm/react-router@0.13.3/lib/components/Link.js +0 -119
  75. data/public/vendor/npm/react-router@0.13.3/lib/components/NotFoundRoute.js +0 -41
  76. data/public/vendor/npm/react-router@0.13.3/lib/components/Redirect.js +0 -40
  77. data/public/vendor/npm/react-router@0.13.3/lib/components/Route.js +0 -67
  78. data/public/vendor/npm/react-router@0.13.3/lib/components/RouteHandler.js +0 -111
  79. data/public/vendor/npm/react-router@0.13.3/lib/createRouter.js +0 -329
  80. data/public/vendor/npm/react-router@0.13.3/lib/createRoutesFromReactChildren.js +0 -59
  81. data/public/vendor/npm/react-router@0.13.3/lib/getWindowScrollPosition.js +0 -19
  82. data/public/vendor/npm/react-router@0.13.3/lib/index.js +0 -26
  83. data/public/vendor/npm/react-router@0.13.3/lib/isReactChildren.js +0 -14
  84. data/public/vendor/npm/react-router@0.13.3/lib/locations/HashLocation.js +0 -79
  85. data/public/vendor/npm/react-router@0.13.3/lib/locations/HistoryLocation.js +0 -64
  86. data/public/vendor/npm/react-router@0.13.3/lib/locations/RefreshLocation.js +0 -18
  87. data/public/vendor/npm/react-router@0.13.3/lib/locations/StaticLocation.js +0 -50
  88. data/public/vendor/npm/react-router@0.13.3/lib/locations/TestLocation.js +0 -104
  89. data/public/vendor/npm/react-router@0.13.3/lib/runRouter.js +0 -16
  90. data/public/vendor/npm/react-router@0.13.3/lib/supportsHistory.js +0 -17
  91. data/public/vendor/npm/react-router@0.13.3/lib.js +0 -2
  92. data/public/vendor/npm/react-router@0.13.3/package.json +0 -36
  93. data/public/vendor/npm/react-router@0.13.3/umd/ReactRouter.js +0 -3388
  94. data/public/vendor/npm/react-router@0.13.3/umd/ReactRouter.min.js +0 -8
data/public/js/report.js CHANGED
@@ -1,3 +1,4 @@
1
+ import SequenceServer from './sequenceserver';
1
2
  import _ from 'underscore';
2
3
  import React from 'react';
3
4
  import d3 from 'd3';
@@ -771,23 +772,24 @@ var SideBar = React.createClass({
771
772
  aln_exporter.export_alignments(hsps_arr, "alignment-"+sequence_ids.length+"_hits");
772
773
  },
773
774
 
774
- summary: function () {
775
- var program = this.props.data.program;
776
- var numqueries = this.props.data.queries.length;
777
- var numquerydb = this.props.data.querydb.length;
778
775
 
776
+ // JSX //
777
+ render: function () {
779
778
  return (
780
- program.toUpperCase() + ': ' +
781
- numqueries + ' ' + (numqueries > 1 ? 'queries' : 'query') + ", " +
782
- numquerydb + ' ' + (numquerydb > 1 ? 'databases' : 'database')
783
- );
779
+ <div className="sidebar">
780
+ { this.showIndex() && this.index() }
781
+ { this.downloads() }
782
+ </div>
783
+ )
784
784
  },
785
785
 
786
- // Life-cycle method. //
787
- render: function () {
786
+ showIndex: function () {
787
+ return this.props.data.queries.length <= 8;
788
+ },
789
+
790
+ index: function () {
788
791
  return (
789
- <div
790
- className="sidebar">
792
+ <div className="index">
791
793
  <div
792
794
  className="section-header">
793
795
  <h4>
@@ -795,7 +797,7 @@ var SideBar = React.createClass({
795
797
  </h4>
796
798
  </div>
797
799
  <ul
798
- className="nav hover-reset active-bold index">
800
+ className="nav hover-reset active-bold">
799
801
  {
800
802
  _.map(this.props.data.queries, _.bind(function (query) {
801
803
  return (
@@ -811,80 +813,95 @@ var SideBar = React.createClass({
811
813
  }, this))
812
814
  }
813
815
  </ul>
816
+ </div>
817
+ );
818
+ },
814
819
 
815
- <br/>
816
- <br/>
820
+ summary: function () {
821
+ var program = this.props.data.program;
822
+ var numqueries = this.props.data.queries.length;
823
+ var numquerydb = this.props.data.querydb.length;
824
+
825
+ return (
826
+ program.toUpperCase() + ': ' +
827
+ numqueries + ' ' + (numqueries > 1 ? 'queries' : 'query') + ", " +
828
+ numquerydb + ' ' + (numquerydb > 1 ? 'databases' : 'database')
829
+ );
830
+ },
817
831
 
832
+ downloads: function () {
833
+ return (
834
+ <div className="downloads">
818
835
  <div
819
- className="section-header">
836
+ className="section-header">
820
837
  <h4>
821
838
  Download FASTA, XML, TSV
822
839
  </h4>
823
840
  </div>
824
841
  <ul
825
- className="downloads list-unstyled list-padded">
842
+ className="nav">
826
843
  <li>
827
844
  <a
828
- className="download-fasta-of-all"
829
- onClick={this.downloadFastaOfAll}>
845
+ className="download-fasta-of-all"
846
+ onClick={this.downloadFastaOfAll}>
830
847
  FASTA of all hits
831
848
  </a>
832
849
  </li>
833
850
  <li>
834
851
  <a
835
- className="download-fasta-of-selected disabled"
836
- onClick={this.downloadFastaOfSelected}>
852
+ className="download-fasta-of-selected disabled"
853
+ onClick={this.downloadFastaOfSelected}>
837
854
  FASTA of <span className="text-bold"></span> selected hit(s)
838
855
  </a>
839
856
  </li>
840
857
  <li>
841
858
  <a
842
- className="download-alignment-of-all"
843
- onClick={this.downloadAlignmentOfAll}>
844
- Alignment of all hits
859
+ className="download-alignment-of-all"
860
+ onClick={this.downloadAlignmentOfAll}>
861
+ Alignment of all hits
845
862
  </a>
846
863
  </li>
847
864
  <li>
848
865
  <a
849
- className="download-alignment-of-selected disabled"
850
- onClick={this.downloadAlignmentOfSelected}>
851
- Alignment of <span className="text-bold"></span> selected hit(s)
866
+ className="download-alignment-of-selected disabled"
867
+ onClick={this.downloadAlignmentOfSelected}>
868
+ Alignment of <span className="text-bold"></span> selected hit(s)
852
869
  </a>
853
870
  </li>
854
871
  <li>
855
872
  <a
856
- className="download" data-toggle="tooltip"
857
- title="15 columns: query and subject ID; scientific
858
- name, alignment length, mismatches, gaps, identity,
859
- start and end coordinates, e value, bitscore, query
860
- coverage per subject and per HSP."
861
- href={"download/" + this.props.data.search_id + ".std_tsv"}>
873
+ className="download" data-toggle="tooltip"
874
+ title="15 columns: query and subject ID; scientific
875
+ name, alignment length, mismatches, gaps, identity,
876
+ start and end coordinates, e value, bitscore, query
877
+ coverage per subject and per HSP."
878
+ href={"download/" + this.props.data.search_id + ".std_tsv"}>
862
879
  Standard tabular report
863
880
  </a>
864
881
  </li>
865
882
  <li>
866
883
  <a
867
- className="download" data-toggle="tooltip"
868
- title="44 columns: query and subject ID, GI,
869
- accessions, and length; alignment details;
870
- taxonomy details of subject sequence(s) and
871
- query coverage per subject and per HSP."
872
- href={"download/" + this.props.data.search_id + ".full_tsv"}>
884
+ className="download" data-toggle="tooltip"
885
+ title="44 columns: query and subject ID, GI,
886
+ accessions, and length; alignment details;
887
+ taxonomy details of subject sequence(s) and
888
+ query coverage per subject and per HSP."
889
+ href={"download/" + this.props.data.search_id + ".full_tsv"}>
873
890
  Full tabular report
874
891
  </a>
875
892
  </li>
876
893
  <li>
877
894
  <a
878
- className="download" data-toggle="tooltip"
879
- title="Results in XML format."
880
- href={"download/" + this.props.data.search_id + ".xml"}>
895
+ className="download" data-toggle="tooltip"
896
+ title="Results in XML format."
897
+ href={"download/" + this.props.data.search_id + ".xml"}>
881
898
  Full XML report
882
899
  </a>
883
900
  </li>
884
901
  </ul>
885
902
  </div>
886
- )
887
- }
903
+ );
904
+ },
888
905
  });
889
906
 
890
907
  /**
@@ -1211,4 +1228,4 @@ var Page = React.createClass({
1211
1228
  }
1212
1229
  });
1213
1230
 
1214
- export {Page};
1231
+ React.render(<Page/>, document.getElementById('view'));
data/public/js/search.js CHANGED
@@ -1,7 +1,7 @@
1
+ import SequenceServer from './sequenceserver';
1
2
  import _ from 'underscore';
2
3
  import React from 'react';
3
4
 
4
-
5
5
  /**
6
6
  * Load necessary polyfills.
7
7
  */
@@ -509,21 +509,8 @@ var Databases = React.createClass({
509
509
  {
510
510
  _.map(this.databases(category), _.bind(function (database) {
511
511
  return (
512
- <li
513
- className="list-group-item">
514
- <label
515
- className={(this.state.type && this.state.type !== database.type) && "disabled"}>
516
- <input
517
- type="checkbox" name="databases[]" value={database.id} data-type={database.type}
518
- disabled={this.state.type && this.state.type !== database.type}
519
- onChange=
520
- {
521
- _.bind(function () {
522
- this.handleClick(database)
523
- }, this)
524
- }/>
525
- {" " + (database.title || database.name)}
526
- </label>
512
+ <li className="list-group-item">
513
+ { this.renderDatabase(database) }
527
514
  </li>
528
515
  );
529
516
  }, this))
@@ -538,6 +525,26 @@ var Databases = React.createClass({
538
525
  );
539
526
  },
540
527
 
528
+ renderDatabase: function (database) {
529
+ var disabled = this.state.type && this.state.type !== database.type;
530
+
531
+ return (
532
+ <label
533
+ className={disabled && 'disabled database' || 'database'}>
534
+ <input
535
+ type="checkbox" name="databases[]" value={database.id}
536
+ data-type={database.type} disabled={disabled}
537
+ onChange=
538
+ {
539
+ _.bind(function () {
540
+ this.handleClick(database)
541
+ }, this)
542
+ }/>
543
+ {" " + (database.title || database.name)}
544
+ </label>
545
+ );
546
+ },
547
+
541
548
  shouldComponentUpdate: function (props, state) {
542
549
  return !(state.type && state.type === this.state.type);
543
550
  },
@@ -925,4 +932,4 @@ var Page = React.createClass({
925
932
  }
926
933
  });
927
934
 
928
- export {Page};
935
+ React.render(<Page/>, document.getElementById('view'));
@@ -1,18 +1,9 @@
1
1
  import 'jquery';
2
- import 'jquery-ui';
2
+ import 'jquery-ui/ui/effect-drop';
3
+ import 'jquery-ui/ui/effect-bounce';
3
4
  import 'bootstrap';
4
5
  import 'webshim';
5
6
 
6
- import React from 'react';
7
- import Router from 'react-router';
8
-
9
- import {Page as Search} from './search';
10
- import {Page as Report} from './report';
11
-
12
- var Route = Router.Route;
13
- var DefaultRoute = Router.DefaultRoute;
14
- var RouteHandler = Router.RouteHandler;
15
-
16
7
  /**
17
8
  * Simple, small jQuery extensions for convenience.
18
9
  */
@@ -101,59 +92,31 @@ var RouteHandler = Router.RouteHandler;
101
92
  };
102
93
  }(jQuery));
103
94
 
104
- SequenceServer = React.createClass({
105
-
106
- // Class methods. //
95
+ export default {
107
96
 
108
- statics: {
109
- FASTA_FORMAT: /^>/,
97
+ FASTA_FORMAT: /^>/,
110
98
 
111
- setupTooltips: function () {
112
- $('.pos-label').each(function () {
113
- $(this).tooltip({
114
- placement: 'right'
115
- });
99
+ setupTooltips: function () {
100
+ $('.pos-label').each(function () {
101
+ $(this).tooltip({
102
+ placement: 'right'
116
103
  });
104
+ });
117
105
 
118
- $('.downloads a').each(function () {
119
- $(this).tooltip();
120
- });
121
- },
122
-
123
- showErrorModal: function (jqXHR, beforeShow) {
124
- setTimeout(function () {
125
- beforeShow();
126
- if (jqXHR.responseText) {
127
- $("#error").html(jqXHR.responseText).modal();
128
- }
129
- else {
130
- $("#error-no-response").modal();
131
- }
132
- }, 500);
133
- },
134
-
135
- routes: function () {
136
- return (
137
- <Route handler={SequenceServer}>
138
- <Route path="/" handler={Search}/>
139
- <Route path="/:jid" handler={Report}/>
140
- </Route>
141
- );
142
- },
143
-
144
- run: function () {
145
- Router.run(this.routes(), Router.HistoryLocation, function (Root) {
146
- React.render(<Root/>, document.getElementById("view"));
147
- });
148
- }
106
+ $('.downloads a').each(function () {
107
+ $(this).tooltip();
108
+ });
149
109
  },
150
110
 
151
-
152
- // Lifecycle methods. //
153
-
154
- render: function () {
155
- return (<RouteHandler/>);
111
+ showErrorModal: function (jqXHR, beforeShow) {
112
+ setTimeout(function () {
113
+ beforeShow();
114
+ if (jqXHR.responseText) {
115
+ $("#error").html(jqXHR.responseText).modal();
116
+ }
117
+ else {
118
+ $("#error-no-response").modal();
119
+ }
120
+ }, 500);
156
121
  }
157
- });
158
-
159
- SequenceServer.run();
122
+ };