Skip to content

Commit

Permalink
Merge branch 'master' into lis
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanweeks committed Jul 10, 2024
2 parents f44250a + 61cb8d4 commit f93aa68
Show file tree
Hide file tree
Showing 19 changed files with 630 additions and 4,884 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
sequenceserver (3.1.1)
sequenceserver (3.1.2)
json_pure (~> 2.6, >= 2.6.3)
ox (~> 2.1, >= 2.1.1)
rack_csrf (~> 2.7, >= 2.7.0)
Expand Down
24 changes: 24 additions & 0 deletions lib/sequenceserver/api_errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,30 @@ def message
end
end

# InvalidParameterError is a more generic error class that can be
# raised when the frontend sends a request with an invalid parameter
class InvalidParameterError < ValidationError
attr_reader :more_info

def initialize(more_info)
super
@more_info = more_info
end

def http_status
422
end

def title
'Invalid parameter'
end

def message
"The action you're trying to perform is not possible because \
one of the provided parameters is invalid."
end
end

# API errors have an http status, title, message, and additional information
# like stacktrace or information from program output.
APIError = Class.new(Error)
Expand Down
6 changes: 6 additions & 0 deletions lib/sequenceserver/blast.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
require_relative 'blast/job'
require_relative 'blast/report'
require_relative 'blast/constants'

module SequenceServer
module BLAST
VALID_SEQUENCE_ID = /\A[a-zA-Z0-9\-_.:*#|\[\]]+\z/
end
end
13 changes: 13 additions & 0 deletions lib/sequenceserver/database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,19 @@ def initialize(*args)
alias path name

def retrieve(accession, coords = nil)
fail(
InvalidSequenceIdError,
"Invalid sequence id: #{accession}"
) unless accession =~ SequenceServer::BLAST::VALID_SEQUENCE_ID

cmd = "blastdbcmd -db #{name} -entry '#{accession}'"

if coords
fail(
InvalidParameterError,
"Invalid range coordinates: #{coords}"
) unless coords =~ /[0-9]+-[0-9]*/

cmd << " -range #{coords}"
end
out, = sys(cmd, path: config[:bin])
Expand All @@ -52,6 +63,8 @@ def retrieve(accession, coords = nil)
# Returns true if the database contains the given sequence id.
# Returns false otherwise.
def include?(id)
fail ArgumentError, "Invalid sequence id: #{id}" unless id =~ SequenceServer::BLAST::VALID_SEQUENCE_ID

cmd = "blastdbcmd -entry '#{id}' -db #{name}"
sys(cmd, path: config[:bin]) rescue false
end
Expand Down
3 changes: 1 addition & 2 deletions lib/sequenceserver/sequence.rb
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,8 @@ def validate
)
end

valid_id_regex = /\A[a-zA-Z0-9-_.:*#|\[\]]+\z/
invalid_sequence_ids = sequence_ids.reject do |id|
id =~ valid_id_regex
id =~ SequenceServer::BLAST::VALID_SEQUENCE_ID
end

unless invalid_sequence_ids.empty?
Expand Down
2 changes: 1 addition & 1 deletion lib/sequenceserver/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Define version number.
module SequenceServer
VERSION = '3.1.1'.freeze
VERSION = '3.1.2'.freeze
end
15 changes: 8 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"watch-cloud": "webpack --watch --env=pluginsPath='../sequence_server_js_extensions' --env=targetEnv='cloud'",
"test": "jest",
"minify:css": "cleancss public/css/sequenceserver.css > public/css/sequenceserver.min.css && npx tailwindcss build -i ./public/css/app.css -o ./public/css/app.min.css --minify",
"build": "webpack && npm run minify:css",
"build-cloud": "webpack --env=pluginsPath='../sequence_server_js_extensions' --env=targetEnv='cloud' && npm run minify:css"
"build": "webpack --mode production && npm run minify:css",
"build-cloud": "webpack --mode production --env=pluginsPath='../sequence_server_js_extensions' --env=targetEnv='cloud' && npm run minify:css"
},
"dependencies": {
"babel-plugin-transform-export-extensions": "^6.22.0",
Expand Down
2 changes: 1 addition & 1 deletion public/css/app.min.css

Large diffs are not rendered by default.

2,483 changes: 2 additions & 2,481 deletions public/sequenceserver-report.min.js

Large diffs are not rendered by default.

233 changes: 233 additions & 0 deletions public/sequenceserver-report.min.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
/*!
* jQuery Browser Plugin v0.0.6
* https://github.com/gabceb/jquery-browser-plugin
*
* Original jquery-browser code Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors
* http://jquery.org/license
*
* Modifications Copyright 2013 Gabriel Cebrian
* https://github.com/gabceb
*
* Released under the MIT license
*
* Date: 2013-07-29T17:23:27-07:00
*/

/*!
* jQuery Color Animations v2.1.2
* https://github.com/jquery/jquery-color
*
* Copyright 2014 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* Date: Wed Jan 16 08:47:09 2013 -0600
*/

/*!
* jQuery UI Autocomplete 1.11.4
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/autocomplete/
*/

/*!
* jQuery UI Button 1.11.4
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/button/
*/

/*!
* jQuery UI Core 1.11.4
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/category/ui-core/
*/

/*!
* jQuery UI Datepicker 1.11.4
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/datepicker/
*/

/*!
* jQuery UI Draggable 1.11.4
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/draggable/
*/

/*!
* jQuery UI Droppable 1.11.4
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/droppable/
*/

/*!
* jQuery UI Mouse 1.11.4
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/mouse/
*/

/*!
* jQuery UI Position 1.11.4
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/position/
*/

/*!
* jQuery UI Resizable 1.11.4
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/resizable/
*/

/*!
* jQuery UI Spinner 1.11.4
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/spinner/
*/

/*!
* jQuery UI Tabs 1.11.4
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/tabs/
*/

/*!
* jQuery UI Widget 1.11.4
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/jQuery.widget/
*/

/*!
* Sizzle CSS Selector Engine v2.2.1
* http://sizzlejs.com/
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2015-10-17
*/

/*!
* jQuery JavaScript Library v2.2.4
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2016-05-20T17:23Z
*/

/*! jQuery UI - v1.11.4 - 2021-01-29
* http://jqueryui.com
* Includes: core.js, widget.js, mouse.js, position.js, draggable.js, droppable.js, resizable.js, selectable.js, sortable.js, accordion.js, autocomplete.js, button.js, datepicker.js, dialog.js, menu.js, progressbar.js, selectmenu.js, slider.js, spinner.js, tabs.js, tooltip.js, effect.js, effect-blind.js, effect-bounce.js, effect-clip.js, effect-drop.js, effect-explode.js, effect-fade.js, effect-fold.js, effect-highlight.js, effect-puff.js, effect-pulsate.js, effect-scale.js, effect-shake.js, effect-size.js, effect-slide.js, effect-transfer.js
* Copyright jQuery Foundation and other contributors; Licensed MIT */

/**
* @license React
* react-dom.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* scheduler.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* Checks if an event is supported in the current execution environment.
*
* NOTE: This will not work correctly for non-generic events such as `change`,
* `reset`, `load`, `error`, and `select`.
*
* Borrows from Modernizr.
*
* @param {string} eventNameSuffix Event name, e.g. "click".
* @return {boolean} True if the event is supported.
* @internal
* @license Modernizr 3.0.0pre (Custom Build) | MIT
*/

/** @preserve http://github.com/easeway/js-class */
1 change: 1 addition & 0 deletions public/sequenceserver-report.min.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit f93aa68

Please sign in to comment.