sequenceserver 1.0.0.pre.2 → 1.0.0.pre.3

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.

Files changed (337) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/README.md +18 -4
  4. data/bin/sequenceserver +219 -124
  5. data/lib/sequenceserver.rb +156 -153
  6. data/lib/sequenceserver/blast.rb +163 -432
  7. data/lib/sequenceserver/blast/exceptions.rb +27 -0
  8. data/lib/sequenceserver/blast/hit.rb +32 -0
  9. data/lib/sequenceserver/blast/hsp.rb +260 -0
  10. data/lib/sequenceserver/blast/query.rb +28 -0
  11. data/lib/sequenceserver/blast/report.rb +123 -0
  12. data/lib/sequenceserver/config.rb +94 -0
  13. data/lib/sequenceserver/database.rb +89 -49
  14. data/lib/sequenceserver/exceptions.rb +154 -0
  15. data/lib/sequenceserver/links.rb +1 -1
  16. data/lib/sequenceserver/logger.rb +5 -7
  17. data/lib/sequenceserver/sequence.rb +40 -39
  18. data/public/css/bootstrap.min.css +5 -7
  19. data/public/css/custom.css +28 -27
  20. data/public/dist/css/sequenceserver.min.css +1 -0
  21. data/public/dist/css/sequenceserver.min.css.gz +0 -0
  22. data/public/dist/fonts/FontAwesome.otf +0 -0
  23. data/public/dist/fonts/fontawesome-webfont.eot +0 -0
  24. data/public/dist/fonts/fontawesome-webfont.svg +565 -0
  25. data/public/dist/fonts/fontawesome-webfont.ttf +0 -0
  26. data/public/dist/fonts/fontawesome-webfont.woff +0 -0
  27. data/public/dist/fonts/fontawesome-webfont.woff2 +0 -0
  28. data/public/dist/js/sequenceserver.min.js +12 -0
  29. data/public/dist/js/sequenceserver.min.js.gz +0 -0
  30. data/public/dist/js/shims/FlashCanvas/canvas2png.js +1 -0
  31. data/public/dist/js/shims/FlashCanvas/flashcanvas.js +1 -0
  32. data/public/dist/js/shims/FlashCanvas/flashcanvas.swf +0 -0
  33. data/public/dist/js/shims/FlashCanvasPro/canvas2png.js +1 -0
  34. data/public/dist/js/shims/FlashCanvasPro/flash10canvas.swf +0 -0
  35. data/public/dist/js/shims/FlashCanvasPro/flash9canvas.swf +0 -0
  36. data/public/dist/js/shims/FlashCanvasPro/flashcanvas.js +1 -0
  37. data/public/dist/js/shims/canvas-blob.js +1 -0
  38. data/public/dist/js/shims/color-picker.js +2 -0
  39. data/public/dist/js/shims/combos/1.js +6 -0
  40. data/public/dist/js/shims/combos/10.js +2 -0
  41. data/public/dist/js/shims/combos/11.js +2 -0
  42. data/public/dist/js/shims/combos/12.js +6 -0
  43. data/public/dist/js/shims/combos/13.js +1 -0
  44. data/public/dist/js/shims/combos/14.js +1 -0
  45. data/public/dist/js/shims/combos/15.js +2 -0
  46. data/public/dist/js/shims/combos/16.js +7 -0
  47. data/public/dist/js/shims/combos/17.js +2 -0
  48. data/public/dist/js/shims/combos/18.js +3 -0
  49. data/public/dist/js/shims/combos/2.js +7 -0
  50. data/public/dist/js/shims/combos/21.js +2 -0
  51. data/public/dist/js/shims/combos/22.js +1 -0
  52. data/public/dist/js/shims/combos/23.js +6 -0
  53. data/public/dist/js/shims/combos/25.js +2 -0
  54. data/public/dist/js/shims/combos/27.js +1 -0
  55. data/public/dist/js/shims/combos/28.js +1 -0
  56. data/public/dist/js/shims/combos/29.js +1 -0
  57. data/public/dist/js/shims/combos/3.js +1 -0
  58. data/public/dist/js/shims/combos/30.js +2 -0
  59. data/public/dist/js/shims/combos/31.js +1 -0
  60. data/public/dist/js/shims/combos/33.js +1 -0
  61. data/public/dist/js/shims/combos/34.js +1 -0
  62. data/public/dist/js/shims/combos/4.js +1 -0
  63. data/public/dist/js/shims/combos/5.js +2 -0
  64. data/public/dist/js/shims/combos/6.js +2 -0
  65. data/public/dist/js/shims/combos/7.js +7 -0
  66. data/public/dist/js/shims/combos/8.js +7 -0
  67. data/public/dist/js/shims/combos/9.js +2 -0
  68. data/public/dist/js/shims/combos/97.js +1 -0
  69. data/public/dist/js/shims/combos/98.js +1 -0
  70. data/public/dist/js/shims/combos/99.js +1 -0
  71. data/public/dist/js/shims/details.js +1 -0
  72. data/public/dist/js/shims/dom-extend.js +1 -0
  73. data/public/dist/js/shims/es5.js +1 -0
  74. data/public/dist/js/shims/es6.js +1 -0
  75. data/public/dist/js/shims/excanvas.js +1 -0
  76. data/public/dist/js/shims/filereader-xhr.js +1 -0
  77. data/public/dist/js/shims/form-combat.js +1 -0
  78. data/public/dist/js/shims/form-core.js +1 -0
  79. data/public/dist/js/shims/form-datalist-lazy.js +1 -0
  80. data/public/dist/js/shims/form-datalist.js +1 -0
  81. data/public/dist/js/shims/form-fixrangechange.js +1 -0
  82. data/public/dist/js/shims/form-inputmode.js +1 -0
  83. data/public/dist/js/shims/form-message.js +1 -0
  84. data/public/dist/js/shims/form-native-extend.js +1 -0
  85. data/public/dist/js/shims/form-number-date-api.js +1 -0
  86. data/public/dist/js/shims/form-number-date-ui.js +1 -0
  87. data/public/dist/js/shims/form-shim-extend.js +1 -0
  88. data/public/dist/js/shims/form-shim-extend2.js +1 -0
  89. data/public/dist/js/shims/form-validation.js +1 -0
  90. data/public/dist/js/shims/form-validators.js +1 -0
  91. data/public/dist/js/shims/forms-picker.js +1 -0
  92. data/public/dist/js/shims/geolocation.js +1 -0
  93. data/public/dist/js/shims/i18n/formcfg-ar.js +1 -0
  94. data/public/dist/js/shims/i18n/formcfg-ch-CN.js +1 -0
  95. data/public/dist/js/shims/i18n/formcfg-cs.js +1 -0
  96. data/public/dist/js/shims/i18n/formcfg-de.js +1 -0
  97. data/public/dist/js/shims/i18n/formcfg-el.js +1 -0
  98. data/public/dist/js/shims/i18n/formcfg-en.js +1 -0
  99. data/public/dist/js/shims/i18n/formcfg-es.js +1 -0
  100. data/public/dist/js/shims/i18n/formcfg-fa.js +1 -0
  101. data/public/dist/js/shims/i18n/formcfg-fr.js +1 -0
  102. data/public/dist/js/shims/i18n/formcfg-he.js +1 -0
  103. data/public/dist/js/shims/i18n/formcfg-hi.js +1 -0
  104. data/public/dist/js/shims/i18n/formcfg-hu.js +1 -0
  105. data/public/dist/js/shims/i18n/formcfg-it.js +1 -0
  106. data/public/dist/js/shims/i18n/formcfg-ja.js +1 -0
  107. data/public/dist/js/shims/i18n/formcfg-lt.js +1 -0
  108. data/public/dist/js/shims/i18n/formcfg-nl.js +1 -0
  109. data/public/dist/js/shims/i18n/formcfg-pl.js +1 -0
  110. data/public/dist/js/shims/i18n/formcfg-pt-BR.js +1 -0
  111. data/public/dist/js/shims/i18n/formcfg-pt-PT.js +1 -0
  112. data/public/dist/js/shims/i18n/formcfg-pt.js +1 -0
  113. data/public/dist/js/shims/i18n/formcfg-ru.js +1 -0
  114. data/public/dist/js/shims/i18n/formcfg-sv.js +1 -0
  115. data/public/dist/js/shims/i18n/formcfg-zh-CN.js +1 -0
  116. data/public/dist/js/shims/i18n/formcfg-zh-TW.js +1 -0
  117. data/public/dist/js/shims/jme/alternate-media.js +1 -0
  118. data/public/dist/js/shims/jme/base.js +1 -0
  119. data/public/dist/js/shims/jme/controls.css +1 -0
  120. data/public/dist/js/shims/jme/jme.eot +0 -0
  121. data/public/dist/js/shims/jme/jme.svg +36 -0
  122. data/public/dist/js/shims/jme/jme.ttf +0 -0
  123. data/public/dist/js/shims/jme/jme.woff +0 -0
  124. data/public/dist/js/shims/jme/mediacontrols-lazy.js +1 -0
  125. data/public/dist/js/shims/jme/mediacontrols.js +1 -0
  126. data/public/dist/js/shims/jme/playlist.js +1 -0
  127. data/public/dist/js/shims/jpicker/images/AlphaBar.png +0 -0
  128. data/public/dist/js/shims/jpicker/images/Bars.png +0 -0
  129. data/public/dist/js/shims/jpicker/images/Maps.png +0 -0
  130. data/public/dist/js/shims/jpicker/images/NoColor.png +0 -0
  131. data/public/dist/js/shims/jpicker/images/bar-opacity.png +0 -0
  132. data/public/dist/js/shims/jpicker/images/map-opacity.png +0 -0
  133. data/public/dist/js/shims/jpicker/images/mappoint.gif +0 -0
  134. data/public/dist/js/shims/jpicker/images/picker.gif +0 -0
  135. data/public/dist/js/shims/jpicker/images/preview-opacity.png +0 -0
  136. data/public/dist/js/shims/jpicker/images/rangearrows.gif +0 -0
  137. data/public/dist/js/shims/jpicker/jpicker.css +1 -0
  138. data/public/dist/js/shims/matchMedia.js +3 -0
  139. data/public/dist/js/shims/mediacapture-picker.js +1 -0
  140. data/public/dist/js/shims/mediacapture.js +1 -0
  141. data/public/dist/js/shims/mediaelement-core.js +1 -0
  142. data/public/dist/js/shims/mediaelement-debug.js +1 -0
  143. data/public/dist/js/shims/mediaelement-jaris.js +1 -0
  144. data/public/dist/js/shims/mediaelement-native-fix.js +1 -0
  145. data/public/dist/js/shims/mediaelement-yt.js +1 -0
  146. data/public/dist/js/shims/moxie/flash/Moxie.cdn.swf +0 -0
  147. data/public/dist/js/shims/moxie/flash/Moxie.min.swf +0 -0
  148. data/public/dist/js/shims/moxie/js/moxie-html4.js +3 -0
  149. data/public/dist/js/shims/moxie/js/moxie-swf.js +2 -0
  150. data/public/dist/js/shims/picture.js +1 -0
  151. data/public/dist/js/shims/plugins/jquery.ui.position.js +11 -0
  152. data/public/dist/js/shims/range-ui.js +1 -0
  153. data/public/dist/js/shims/sizzle.js +11 -0
  154. data/public/dist/js/shims/sticky.js +1 -0
  155. data/public/dist/js/shims/styles/color-picker.png +0 -0
  156. data/public/dist/js/shims/styles/forms-ext.css +1 -0
  157. data/public/dist/js/shims/styles/forms-picker.css +1 -0
  158. data/public/dist/js/shims/styles/progress.gif +0 -0
  159. data/public/dist/js/shims/styles/progress.png +0 -0
  160. data/public/dist/js/shims/styles/shim-ext.css +1 -0
  161. data/public/dist/js/shims/styles/shim.css +1 -0
  162. data/public/dist/js/shims/styles/transparent.png +0 -0
  163. data/public/dist/js/shims/styles/widget.eot +0 -0
  164. data/public/dist/js/shims/styles/widget.svg +12 -0
  165. data/public/dist/js/shims/styles/widget.ttf +0 -0
  166. data/public/dist/js/shims/styles/widget.woff +0 -0
  167. data/public/dist/js/shims/swf/JarisFLVPlayer.swf +0 -0
  168. data/public/dist/js/shims/swfmini-embed.js +1 -0
  169. data/public/dist/js/shims/swfmini.js +6 -0
  170. data/public/dist/js/shims/track-ui.js +1 -0
  171. data/public/dist/js/shims/track.js +1 -0
  172. data/public/dist/js/shims/url.js +1 -0
  173. data/public/dist/js/shims/usermedia-core.js +1 -0
  174. data/public/dist/js/shims/usermedia-shim.js +1 -0
  175. data/public/dist/js/webshims/shims/FlashCanvas/canvas2png.js +1 -0
  176. data/public/dist/js/webshims/shims/FlashCanvas/flashcanvas.js +1 -0
  177. data/public/dist/js/webshims/shims/FlashCanvas/flashcanvas.swf +0 -0
  178. data/public/dist/js/webshims/shims/FlashCanvasPro/canvas2png.js +1 -0
  179. data/public/dist/js/webshims/shims/FlashCanvasPro/flash10canvas.swf +0 -0
  180. data/public/dist/js/webshims/shims/FlashCanvasPro/flash9canvas.swf +0 -0
  181. data/public/dist/js/webshims/shims/FlashCanvasPro/flashcanvas.js +1 -0
  182. data/public/dist/js/webshims/shims/canvas-blob.js +1 -0
  183. data/public/dist/js/webshims/shims/color-picker.js +2 -0
  184. data/public/dist/js/webshims/shims/combos/1.js +6 -0
  185. data/public/dist/js/webshims/shims/combos/10.js +2 -0
  186. data/public/dist/js/webshims/shims/combos/11.js +2 -0
  187. data/public/dist/js/webshims/shims/combos/12.js +6 -0
  188. data/public/dist/js/webshims/shims/combos/13.js +1 -0
  189. data/public/dist/js/webshims/shims/combos/14.js +1 -0
  190. data/public/dist/js/webshims/shims/combos/15.js +2 -0
  191. data/public/dist/js/webshims/shims/combos/16.js +7 -0
  192. data/public/dist/js/webshims/shims/combos/17.js +2 -0
  193. data/public/dist/js/webshims/shims/combos/18.js +3 -0
  194. data/public/dist/js/webshims/shims/combos/2.js +7 -0
  195. data/public/dist/js/webshims/shims/combos/21.js +2 -0
  196. data/public/dist/js/webshims/shims/combos/22.js +1 -0
  197. data/public/dist/js/webshims/shims/combos/23.js +6 -0
  198. data/public/dist/js/webshims/shims/combos/25.js +2 -0
  199. data/public/dist/js/webshims/shims/combos/27.js +1 -0
  200. data/public/dist/js/webshims/shims/combos/28.js +1 -0
  201. data/public/dist/js/webshims/shims/combos/29.js +1 -0
  202. data/public/dist/js/webshims/shims/combos/3.js +1 -0
  203. data/public/dist/js/webshims/shims/combos/30.js +2 -0
  204. data/public/dist/js/webshims/shims/combos/31.js +1 -0
  205. data/public/dist/js/webshims/shims/combos/33.js +1 -0
  206. data/public/dist/js/webshims/shims/combos/34.js +1 -0
  207. data/public/dist/js/webshims/shims/combos/4.js +1 -0
  208. data/public/dist/js/webshims/shims/combos/5.js +2 -0
  209. data/public/dist/js/webshims/shims/combos/6.js +2 -0
  210. data/public/dist/js/webshims/shims/combos/7.js +7 -0
  211. data/public/dist/js/webshims/shims/combos/8.js +7 -0
  212. data/public/dist/js/webshims/shims/combos/9.js +2 -0
  213. data/public/dist/js/webshims/shims/combos/97.js +1 -0
  214. data/public/dist/js/webshims/shims/combos/98.js +1 -0
  215. data/public/dist/js/webshims/shims/combos/99.js +1 -0
  216. data/public/dist/js/webshims/shims/details.js +1 -0
  217. data/public/dist/js/webshims/shims/dom-extend.js +1 -0
  218. data/public/dist/js/webshims/shims/es5.js +1 -0
  219. data/public/dist/js/webshims/shims/es6.js +1 -0
  220. data/public/dist/js/webshims/shims/excanvas.js +1 -0
  221. data/public/dist/js/webshims/shims/filereader-xhr.js +1 -0
  222. data/public/dist/js/webshims/shims/form-combat.js +1 -0
  223. data/public/dist/js/webshims/shims/form-core.js +1 -0
  224. data/public/dist/js/webshims/shims/form-datalist-lazy.js +1 -0
  225. data/public/dist/js/webshims/shims/form-datalist.js +1 -0
  226. data/public/dist/js/webshims/shims/form-fixrangechange.js +1 -0
  227. data/public/dist/js/webshims/shims/form-inputmode.js +1 -0
  228. data/public/dist/js/webshims/shims/form-message.js +1 -0
  229. data/public/dist/js/webshims/shims/form-native-extend.js +1 -0
  230. data/public/dist/js/webshims/shims/form-number-date-api.js +1 -0
  231. data/public/dist/js/webshims/shims/form-number-date-ui.js +1 -0
  232. data/public/dist/js/webshims/shims/form-shim-extend.js +1 -0
  233. data/public/dist/js/webshims/shims/form-shim-extend2.js +1 -0
  234. data/public/dist/js/webshims/shims/form-validation.js +1 -0
  235. data/public/dist/js/webshims/shims/form-validators.js +1 -0
  236. data/public/dist/js/webshims/shims/forms-picker.js +1 -0
  237. data/public/dist/js/webshims/shims/geolocation.js +1 -0
  238. data/public/dist/js/webshims/shims/i18n/formcfg-ar.js +1 -0
  239. data/public/dist/js/webshims/shims/i18n/formcfg-ch-CN.js +1 -0
  240. data/public/dist/js/webshims/shims/i18n/formcfg-cs.js +1 -0
  241. data/public/dist/js/webshims/shims/i18n/formcfg-de.js +1 -0
  242. data/public/dist/js/webshims/shims/i18n/formcfg-el.js +1 -0
  243. data/public/dist/js/webshims/shims/i18n/formcfg-en.js +1 -0
  244. data/public/dist/js/webshims/shims/i18n/formcfg-es.js +1 -0
  245. data/public/dist/js/webshims/shims/i18n/formcfg-fa.js +1 -0
  246. data/public/dist/js/webshims/shims/i18n/formcfg-fr.js +1 -0
  247. data/public/dist/js/webshims/shims/i18n/formcfg-he.js +1 -0
  248. data/public/dist/js/webshims/shims/i18n/formcfg-hi.js +1 -0
  249. data/public/dist/js/webshims/shims/i18n/formcfg-hu.js +1 -0
  250. data/public/dist/js/webshims/shims/i18n/formcfg-it.js +1 -0
  251. data/public/dist/js/webshims/shims/i18n/formcfg-ja.js +1 -0
  252. data/public/dist/js/webshims/shims/i18n/formcfg-lt.js +1 -0
  253. data/public/dist/js/webshims/shims/i18n/formcfg-nl.js +1 -0
  254. data/public/dist/js/webshims/shims/i18n/formcfg-pl.js +1 -0
  255. data/public/dist/js/webshims/shims/i18n/formcfg-pt-BR.js +1 -0
  256. data/public/dist/js/webshims/shims/i18n/formcfg-pt-PT.js +1 -0
  257. data/public/dist/js/webshims/shims/i18n/formcfg-pt.js +1 -0
  258. data/public/dist/js/webshims/shims/i18n/formcfg-ru.js +1 -0
  259. data/public/dist/js/webshims/shims/i18n/formcfg-sv.js +1 -0
  260. data/public/dist/js/webshims/shims/i18n/formcfg-zh-CN.js +1 -0
  261. data/public/dist/js/webshims/shims/i18n/formcfg-zh-TW.js +1 -0
  262. data/public/dist/js/webshims/shims/jme/alternate-media.js +1 -0
  263. data/public/dist/js/webshims/shims/jme/base.js +1 -0
  264. data/public/dist/js/webshims/shims/jme/controls.css +1 -0
  265. data/public/dist/js/webshims/shims/jme/jme.eot +0 -0
  266. data/public/dist/js/webshims/shims/jme/jme.svg +36 -0
  267. data/public/dist/js/webshims/shims/jme/jme.ttf +0 -0
  268. data/public/dist/js/webshims/shims/jme/jme.woff +0 -0
  269. data/public/dist/js/webshims/shims/jme/mediacontrols-lazy.js +1 -0
  270. data/public/dist/js/webshims/shims/jme/mediacontrols.js +1 -0
  271. data/public/dist/js/webshims/shims/jme/playlist.js +1 -0
  272. data/public/dist/js/webshims/shims/jpicker/images/AlphaBar.png +0 -0
  273. data/public/dist/js/webshims/shims/jpicker/images/Bars.png +0 -0
  274. data/public/dist/js/webshims/shims/jpicker/images/Maps.png +0 -0
  275. data/public/dist/js/webshims/shims/jpicker/images/NoColor.png +0 -0
  276. data/public/dist/js/webshims/shims/jpicker/images/bar-opacity.png +0 -0
  277. data/public/dist/js/webshims/shims/jpicker/images/map-opacity.png +0 -0
  278. data/public/dist/js/webshims/shims/jpicker/images/mappoint.gif +0 -0
  279. data/public/dist/js/webshims/shims/jpicker/images/picker.gif +0 -0
  280. data/public/dist/js/webshims/shims/jpicker/images/preview-opacity.png +0 -0
  281. data/public/dist/js/webshims/shims/jpicker/images/rangearrows.gif +0 -0
  282. data/public/dist/js/webshims/shims/jpicker/jpicker.css +1 -0
  283. data/public/dist/js/webshims/shims/matchMedia.js +3 -0
  284. data/public/dist/js/webshims/shims/mediacapture-picker.js +1 -0
  285. data/public/dist/js/webshims/shims/mediacapture.js +1 -0
  286. data/public/dist/js/webshims/shims/mediaelement-core.js +1 -0
  287. data/public/dist/js/webshims/shims/mediaelement-debug.js +1 -0
  288. data/public/dist/js/webshims/shims/mediaelement-jaris.js +1 -0
  289. data/public/dist/js/webshims/shims/mediaelement-native-fix.js +1 -0
  290. data/public/dist/js/webshims/shims/mediaelement-yt.js +1 -0
  291. data/public/dist/js/webshims/shims/moxie/flash/Moxie.cdn.swf +0 -0
  292. data/public/dist/js/webshims/shims/moxie/flash/Moxie.min.swf +0 -0
  293. data/public/dist/js/webshims/shims/moxie/js/moxie-html4.js +3 -0
  294. data/public/dist/js/webshims/shims/moxie/js/moxie-swf.js +2 -0
  295. data/public/dist/js/webshims/shims/picture.js +1 -0
  296. data/public/dist/js/webshims/shims/plugins/jquery.ui.position.js +11 -0
  297. data/public/dist/js/webshims/shims/range-ui.js +1 -0
  298. data/public/dist/js/webshims/shims/sizzle.js +11 -0
  299. data/public/dist/js/webshims/shims/sticky.js +1 -0
  300. data/public/dist/js/webshims/shims/styles/color-picker.png +0 -0
  301. data/public/dist/js/webshims/shims/styles/forms-ext.css +1 -0
  302. data/public/dist/js/webshims/shims/styles/forms-picker.css +1 -0
  303. data/public/dist/js/webshims/shims/styles/progress.gif +0 -0
  304. data/public/dist/js/webshims/shims/styles/progress.png +0 -0
  305. data/public/dist/js/webshims/shims/styles/shim-ext.css +1 -0
  306. data/public/dist/js/webshims/shims/styles/shim.css +1 -0
  307. data/public/dist/js/webshims/shims/styles/transparent.png +0 -0
  308. data/public/dist/js/webshims/shims/styles/widget.eot +0 -0
  309. data/public/dist/js/webshims/shims/styles/widget.svg +12 -0
  310. data/public/dist/js/webshims/shims/styles/widget.ttf +0 -0
  311. data/public/dist/js/webshims/shims/styles/widget.woff +0 -0
  312. data/public/dist/js/webshims/shims/swf/JarisFLVPlayer.swf +0 -0
  313. data/public/dist/js/webshims/shims/swfmini-embed.js +1 -0
  314. data/public/dist/js/webshims/shims/swfmini.js +6 -0
  315. data/public/dist/js/webshims/shims/track-ui.js +1 -0
  316. data/public/dist/js/webshims/shims/track.js +1 -0
  317. data/public/dist/js/webshims/shims/url.js +1 -0
  318. data/public/dist/js/webshims/shims/usermedia-core.js +1 -0
  319. data/public/dist/js/webshims/shims/usermedia-shim.js +1 -0
  320. data/public/js/bootstrap.min.js +3 -8
  321. data/public/js/jquery-ui.min.js +6 -0
  322. data/public/js/jquery.min.js +4 -0
  323. data/public/js/jquery.t.js +4 -4
  324. data/public/js/sequenceserver.blast.js +20 -18
  325. data/public/js/sequenceserver.js +116 -74
  326. data/sequenceserver.gemspec +20 -16
  327. data/views/400.erb +2 -1
  328. data/views/500.erb +6 -1
  329. data/views/result.erb +38 -18
  330. data/views/search.erb +49 -32
  331. metadata +389 -11
  332. data/public/img/glyphicons-halflings-white.png +0 -0
  333. data/public/img/glyphicons-halflings.png +0 -0
  334. data/public/js/jquery-ui.js +0 -14987
  335. data/public/js/jquery.js +0 -5
  336. data/public/js/jquery.scrollspy.js +0 -74
  337. data/public/sequence.min.js +0 -1
@@ -0,0 +1,27 @@
1
+ module SequenceServer
2
+ module BLAST
3
+ # To signal error in query sequence or options.
4
+ #
5
+ # ArgumentError is raised when BLAST+'s exit status is 1; see [1].
6
+ class ArgumentError < ArgumentError
7
+ end
8
+
9
+ # To signal internal errors.
10
+ #
11
+ # RuntimeError is raised when BLAST+'s exits status is one of 2, 3, 4, or
12
+ # 255; see [1]. These are rare, infrastructure errors, used internally,
13
+ # and of concern only to the admins/developers.
14
+ class RuntimeError < RuntimeError
15
+ def initialize(status, message)
16
+ @status = status
17
+ @message = message
18
+ end
19
+
20
+ attr_reader :status, :message
21
+
22
+ def to_s
23
+ "#{status}, #{message}"
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,32 @@
1
+ module SequenceServer
2
+ # Define BLAST::Hit.
3
+ module BLAST
4
+ # Hit Object to store all the hits per Query.
5
+ # @member [Fixnum] number
6
+ # @member [String] id
7
+ # @member [String] def
8
+ # @member [String] accession
9
+ # @member [Fixnum] len
10
+ # @member [HSP] hsp
11
+ Hit = Struct.new(:number, :id, :title, :accession, :len, :hsps) do
12
+ def initialize(*args)
13
+ args[0] = args[0].to_i
14
+ args[2] = '' if args[2] == 'No definition line'
15
+ args[4] = args[4].to_i
16
+ super
17
+ end
18
+
19
+ alias_method :length, :len
20
+
21
+ # Hit evalue is the minimum evalue of all HSP(s).
22
+ def evalue
23
+ hsps.map(&:evalue).min
24
+ end
25
+
26
+ # Hit score is the sum of bit scores of all HSP(s).
27
+ def score
28
+ hsps.map(&:bit_score).reduce(:+)
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,260 @@
1
+ module SequenceServer
2
+ # Define BLAST::HSP and BLAST::HSP::*.
3
+ module BLAST
4
+ # Structure to hold generic HSP data for each hit.
5
+ #
6
+ # HSP class is not used directly. Relevant HSP stats and formatting the
7
+ # alignment changes with BLAST algorithm. We subclass HSP for each BLAST
8
+ # algorithm.
9
+ HSP = Struct.new(:number, :bit_score, :score, :evalue, :qstart, :qend,
10
+ :sstart, :send, :qframe, :sframe, :identity, :positives,
11
+ :gaps, :len, :qseq, :sseq, :midline) do
12
+ INTEGER_ARGS = [0, 2].concat((4..13).to_a)
13
+ FLOAT_ARGS = [1, 3]
14
+
15
+ def initialize(*args)
16
+ INTEGER_ARGS.each do |i|
17
+ args[i] = args[i].to_i
18
+ end
19
+
20
+ FLOAT_ARGS.each do |i|
21
+ args[i] = args[i].to_f
22
+ end
23
+
24
+ super
25
+ end
26
+
27
+ alias_method :length, :len
28
+
29
+ # Returns a Hash of stats common to all BLAST algorithms. Subclasses must
30
+ # update the returned Hash to add relevant stats of their own.
31
+ #
32
+ def stats
33
+ {
34
+ 'Score' => [bit_score, score],
35
+ 'E value' => evalue,
36
+ 'Identities' => [in_fraction(identity, length),
37
+ in_percentage(identity, length)],
38
+ 'Gaps' => [in_fraction(gaps, length),
39
+ in_percentage(gaps, length)]
40
+ }
41
+ end
42
+
43
+ # Returns pretty formatted alignment String.
44
+ #
45
+ # Calls out to `nqseq`, `nsseq`, `qframe_unit`, `sframe_unit`,
46
+ # `qframe_sign`, and `sframe_sign` attributes. The default value of
47
+ # these attributes suit BLASTP. Subclasses must override these
48
+ # attributes appropriately.
49
+ #
50
+ # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity
51
+ # rubocop:disable Metrics/MethodLength, Style/FormatString
52
+ def pp
53
+ chars = 60
54
+ lines = (length / chars.to_f).ceil
55
+ width = [qend, send, qstart, sstart].map(&:to_s).map(&:length).max
56
+
57
+ nqseq = self.nqseq
58
+ nsseq = self.nsseq
59
+
60
+ s = ''
61
+ (1..lines).each do |i|
62
+ lqstart = nqseq
63
+ lqseq = qseq[chars * (i - 1), chars]
64
+ nqseq += (lqseq.length - lqseq.count('-')) * qframe_unit * qframe_sign
65
+ lqend = nqseq - qframe_sign
66
+ s << "Query %#{width}d #{lqseq} #{lqend}\n" % lqstart
67
+
68
+ lmseq = midline[chars * (i - 1), chars]
69
+ s << "#{' ' * (width + 8)} #{lmseq}\n"
70
+
71
+ lsstart = nsseq
72
+ lsseq = sseq[chars * (i - 1), chars]
73
+ nsseq += (lsseq.length - lsseq.count('-')) * sframe_unit * sframe_sign
74
+ lsend = nsseq - sframe_sign
75
+ s << "Subject %#{width}d #{lsseq} #{lsend}\n" % lsstart
76
+
77
+ s << "\n" unless i == lines
78
+ end
79
+ s
80
+ end
81
+ # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity
82
+ # rubocop:enable Metrics/MethodLength, Style/FormatString
83
+
84
+ ## We calculate start and end coordinate of each line of the alignment ##
85
+ ## based on the six attributes below. See `pp` method. ##
86
+
87
+ # Alignment start coordinate for query sequence.
88
+ #
89
+ # This will be qstart or qend depending on the direction in which the
90
+ # (translated) query sequence aligned.
91
+ def nqseq
92
+ qframe >= 0 ? qstart : qend
93
+ end
94
+
95
+ # Alignment start coordinate for subject sequence.
96
+ #
97
+ # This will be sstart or send depending on the direction in which the
98
+ # (translated) subject sequence aligned.
99
+ def nsseq
100
+ sframe >= 0 ? sstart : send
101
+ end
102
+
103
+ # Jump in query coordinate.
104
+ #
105
+ # Roughly,
106
+ #
107
+ # qend = qstart + n * qframe_unit
108
+ #
109
+ # This will be 1 or 3 depending on whether the query sequence was
110
+ # translated or not.
111
+ def qframe_unit
112
+ 1
113
+ end
114
+
115
+ # Jump in subject coordinate.
116
+ #
117
+ # Roughly,
118
+ #
119
+ # send = sstart + n * sframe_unit
120
+ #
121
+ # This will be 1 or 3 depending on whether the subject sequence was
122
+ # translated or not.
123
+ def sframe_unit
124
+ 1
125
+ end
126
+
127
+ # If we should add or subtract qframe_unit from qstart to arrive at qend.
128
+ #
129
+ # Roughly,
130
+ #
131
+ # qend = qstart + (qframe_sign) * n * qframe_unit
132
+ #
133
+ # This will be +1 or -1, depending on the direction in which the
134
+ # (translated) query sequence aligned.
135
+ def qframe_sign
136
+ qframe >= 0 ? 1 : -1
137
+ end
138
+
139
+ # If we should add or subtract sframe_unit from sstart to arrive at send.
140
+ #
141
+ # Roughly,
142
+ #
143
+ # send = sstart + (sframe_sign) * n * sframe_unit
144
+ #
145
+ # This will be +1 or -1, depending on the direction in which the
146
+ # (translated) subject sequence aligned.
147
+ def sframe_sign
148
+ sframe >= 0 ? 1 : -1
149
+ end
150
+
151
+ ## We define stats in terms of the following functions. ##
152
+
153
+ # Return fractional representation as String.
154
+ #
155
+ # NOTE:
156
+ # Rational class reduces the fraction so we can't use that.
157
+ def in_fraction(num, den)
158
+ "#{num}/#{den}"
159
+ end
160
+
161
+ # Return percentage as Float.
162
+ def in_percentage(num, den)
163
+ format '%.2f', (num * 100.0 / den)
164
+ end
165
+ end
166
+
167
+ class HSP
168
+ # HSP subclass for BLASTX algorithm.
169
+ class BLASTX < self
170
+ def stats
171
+ super.update 'Query frame' => qframe
172
+ end
173
+
174
+ # Translated nucleotide query against protein database, hence 3.
175
+ def qframe_unit
176
+ 3
177
+ end
178
+ end
179
+
180
+ # HSP subclass for BLASTP algorithm.
181
+ class BLASTP < self
182
+ def stats
183
+ super.update(
184
+ 'Positives' =>
185
+ [
186
+ in_fraction(positives, length),
187
+ in_percentage(positives, length)
188
+ ]
189
+ )
190
+ end
191
+ end
192
+
193
+ # HSP subclass for BLASTN algorithm.
194
+ class BLASTN < self
195
+ def stats
196
+ super.update('Strand' =>
197
+ "#{qframe > 0 ? '+' : '-'}/#{sframe > 0 ? '+' : '-'}")
198
+ end
199
+
200
+ # BLASTN is a bit weird in that, no matter which direction the query
201
+ # sequence aligned in, qstart is taken as alignment start coordinate
202
+ # for query.
203
+ #
204
+ # NOTE:
205
+ # Because BLAST reverses the qstart and qend for BLASTN?
206
+ def nqseq
207
+ qstart
208
+ end
209
+
210
+ # BLASTN is a bit weird in that, no matter which direction the subject
211
+ # sequence aligned in, sstart is taken as alignment start coordinate
212
+ # for subject.
213
+ #
214
+ # NOTE:
215
+ # Because BLAST reverses the sstart and send for BLASTN?
216
+ def nsseq
217
+ sstart
218
+ end
219
+ end
220
+
221
+ # HSP subclass for TBLASTX algorithm.
222
+ class TBLASTX < self
223
+ def stats
224
+ super.update(
225
+ 'Frame' => in_fraction(qframe, sframe),
226
+ 'Positives' =>
227
+ [
228
+ in_fraction(positives, length),
229
+ in_percentage(positives, length)
230
+ ]
231
+ )
232
+ end
233
+
234
+ # Translated nucleotide query against translated nucleotide database,
235
+ # hence 3.
236
+ def qframe_unit
237
+ 3
238
+ end
239
+
240
+ # Translated nucleotide query against translated nucleotide database,
241
+ # hence 3.
242
+ def sframe_unit
243
+ 3
244
+ end
245
+ end
246
+
247
+ # HSP subclass for TBLASTN algorithm.
248
+ class TBLASTN < self
249
+ def stats
250
+ super.update 'Hit frame' => sframe
251
+ end
252
+
253
+ # Protein query against translated nucleotide database, hence 3.
254
+ def sframe_unit
255
+ 3
256
+ end
257
+ end
258
+ end
259
+ end
260
+ end
@@ -0,0 +1,28 @@
1
+ module SequenceServer
2
+ # Define BLAST::Query.
3
+ module BLAST
4
+ # Capture results per query of a BLAST search.
5
+ # @member [String] number
6
+ # @member [String] def
7
+ # @member [Fixnum] len
8
+ # @member [Array(Hit)] hits
9
+ Query = Struct.new(:number, :def, :len, :hits) do
10
+ def initialize(*args)
11
+ args[0] = args[0].to_i
12
+ args[1] = "Query_#{args[0]}" if args[1] == 'No definition line'
13
+ args[2] = args[2].to_i
14
+ @id, *rest = args[1].split
15
+ @title = rest.join(' ')
16
+ super
17
+ end
18
+
19
+ def sort_hits_by_evalue!
20
+ @hits = hits.sort_by(&:evalue)
21
+ end
22
+
23
+ attr_reader :id, :title
24
+
25
+ alias_method :length, :len
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,123 @@
1
+ module SequenceServer
2
+ module BLAST
3
+ # Captures BLAST results from BLAST+'s XML output.
4
+ class Report
5
+ include Links
6
+
7
+ # Expects a File object and Database objects used to BLAST against.
8
+ #
9
+ # Parses the XML file into an intermediate representation (ir) and
10
+ # constructs an object model from that.
11
+ #
12
+ # NOTE:
13
+ # Databases param is optional for test suite.
14
+ #
15
+ # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
16
+ def initialize(rfile, databases = nil)
17
+ @archive_file = rfile
18
+
19
+ xml_file = BLAST.format('report' => @archive_file,
20
+ 'type' => 'full',
21
+ 'format' => 'xml')
22
+
23
+ ir = File.open(xml_file[:filepath]) do |f|
24
+ node_to_array Ox.parse(f.read).root
25
+ end
26
+
27
+ @program = ir[0]
28
+ @program_version = ir[1]
29
+ @querydb = Array databases
30
+ @parameters = {
31
+ :matrix => ir[7][0],
32
+ :evalue => ir[7][1],
33
+ :gapopen => ir[7][2],
34
+ :gapextend => ir[7][3],
35
+ :filters => ir[7][4]
36
+ }
37
+
38
+ ir[8].each_with_index do |n, i|
39
+ @stats ||= n[5][0]
40
+ @queries ||= []
41
+ @queries.push(Query.new(n[0], n[2], n[3], []))
42
+
43
+ # Ensure a hit object is received. No hits, returns a newline. Note
44
+ # that checking to "\n" doesn't work since n[4] = ["\n"]
45
+ if n[4] == ["\n"]
46
+ @queries[i][:hits] = []
47
+ else
48
+ n[4].each_with_index do |hits, j|
49
+ @queries[i][:hits].push(Hit.new(hits[0], hits[1], hits[2],
50
+ hits[3], hits[4], []))
51
+ hits[5].each do |hsp|
52
+ hsp_klass = HSP.const_get program.upcase
53
+ @queries[i][:hits][j][:hsps].push(hsp_klass.new(*hsp))
54
+ end
55
+ end
56
+ @queries[i].sort_hits_by_evalue!
57
+ end
58
+ end
59
+ end
60
+ # rubocop:enable Metrics/AbcSize, Metrics/MethodLength
61
+
62
+ attr_reader :archive_file
63
+ attr_reader :program, :program_version
64
+
65
+ # :nodoc:
66
+ # params are defaults provided by BLAST or user input to tweak the
67
+ # result. stats are computed metrics provided by BLAST.
68
+ #
69
+ # BLAST+ doesn't list all input params (like word_size) in the XML
70
+ # output. Only matrix, evalue, gapopen, gapextend, and filters.
71
+ attr_reader :params, :stats
72
+
73
+ attr_reader :querydb
74
+
75
+ attr_reader :queries
76
+
77
+ # Helper methods for pretty printing results
78
+
79
+ def link_per_hit(sequence_id)
80
+ links = Links.instance_methods.map { |m| send(m, sequence_id) }
81
+
82
+ # Sort links based on :order key (ascending)
83
+ links.compact!.sort_by! { |link| link[:order] }
84
+ end
85
+
86
+ # Returns an array of database objects which contain the queried
87
+ # sequence id.
88
+ # NOTE: This function may return more than one database object for
89
+ # a single sequence id.
90
+ #
91
+ # e.g., which_blastdb('SI_2.2.23') => [<Database: ...>, ...]
92
+ def which_blastdb(sequence_id)
93
+ querydb.select { |db| db.include? sequence_id }
94
+ end
95
+
96
+ private
97
+
98
+ PARSEABLE_AS_ARRAY = %w(Parameters BlastOutput_param Iteration_stat
99
+ Statistics Iteration_hits BlastOutput_iterations
100
+ Iteration Hit Hit_hsps Hsp)
101
+
102
+ def node_to_array(element)
103
+ element.nodes.map { |n| node_to_value n }
104
+ end
105
+
106
+ def node_to_value(node)
107
+ # Ensure that the recursion doesn't fails when String value is received.
108
+ return node if node.is_a?(String)
109
+
110
+ if PARSEABLE_AS_ARRAY.include? node.name
111
+ value = node_to_array(node)
112
+ else
113
+ value = first_text(node)
114
+ end
115
+ value
116
+ end
117
+
118
+ def first_text(node)
119
+ node.nodes.find { |n| n.is_a? String }
120
+ end
121
+ end
122
+ end
123
+ end