Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ end
# Bootstrap
gem 'bootstrap-sass'
gem 'autoprefixer-rails'
gem 'bootstrap-slider-rails', '~> 9.8'

# JQuery extensions
gem 'jquery-ui-rails'
Expand Down Expand Up @@ -98,11 +99,18 @@ gem 'figaro'
gem 'bigdecimal', '1.3.5'
gem 'execjs', '2.7.0'

# gem 'turbolinks', '~> 5.2.0'
gem 'turbolinks', '~> 5.2.0'

gem 'concurrent-ruby'

gem 'whenever', require: false

# cookie consent
gem 'cookies_eu'

# html to image (for circos legend)
gem 'imgkit'
gem 'wkhtmltoimage-binary'

# reference select box
gem 'select2-rails'
13 changes: 13 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ GEM
bootstrap-sass (3.3.7)
autoprefixer-rails (>= 5.2.1)
sass (>= 3.3.4)
bootstrap-slider-rails (9.8.0)
railties (>= 3.2, < 6.0)
builder (3.2.4)
chronic (0.10.2)
chronic_duration (0.10.6)
Expand Down Expand Up @@ -90,6 +92,7 @@ GEM
activesupport (>= 5.0)
i18n (1.10.0)
concurrent-ruby (~> 1.0)
imgkit (1.6.3)
jbuilder (2.11.5)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
Expand Down Expand Up @@ -174,6 +177,7 @@ GEM
sprockets (> 3.0)
sprockets-rails
tilt
select2-rails (4.0.13)
sidekiq (6.5.7)
connection_pool (>= 2.2.5)
rack (~> 2.0)
Expand Down Expand Up @@ -205,6 +209,9 @@ GEM
thor (1.2.1)
thread_safe (0.3.6)
tilt (2.0.10)
turbolinks (5.2.1)
turbolinks-source (~> 5.2)
turbolinks-source (5.2.0)
tzinfo (1.2.9)
thread_safe (~> 0.1)
uglifier (4.2.0)
Expand All @@ -214,6 +221,7 @@ GEM
websocket-extensions (0.1.5)
whenever (1.0.0)
chronic (>= 0.6.3)
wkhtmltoimage-binary (0.12.5)

PLATFORMS
ruby
Expand All @@ -227,6 +235,7 @@ DEPENDENCIES
bcrypt (~> 3.1.7)
bigdecimal (= 1.3.5)
bootstrap-sass
bootstrap-slider-rails (~> 9.8)
coffee-rails (~> 4.1.0)
concurrent-ruby
cookies_eu
Expand All @@ -235,6 +244,7 @@ DEPENDENCIES
execjs (= 2.7.0)
figaro
foreman
imgkit
jbuilder (~> 2.0)
jquery-rails
jquery-ui-rails
Expand All @@ -248,6 +258,7 @@ DEPENDENCIES
ruby-debug-ide
rubyzip
sass-rails (>= 3.2)
select2-rails
sidekiq (>= 6.4.1)
sidekiq-limit_fetch
sidekiq-status
Expand All @@ -256,8 +267,10 @@ DEPENDENCIES
spring (= 1.2.0)
sys-filesystem
thin
turbolinks (~> 5.2.0)
uglifier (>= 2.7.2)
whenever
wkhtmltoimage-binary

BUNDLED WITH
1.13.6
4 changes: 4 additions & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@
//= require bootstrap
//= require_tree .
//= require cookies_eu
//= require turbolinks
//= require select2
//= require bootstrap-slider
//= require fontawesome/all.min
2 changes: 2 additions & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
*
*= require_self
*= require jquery-ui
*= require select2
*= require bootstrap-slider
*= require_tree .
*/

Expand Down
5 changes: 5 additions & 0 deletions app/controllers/jobs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,9 @@ def get_tree_genes

def get_all_synteny_images
job = Job.find_by(:job_id => params[:id])
ref = Reference.find(job[:reference_id])
kit = IMGKit.new(render_to_string partial: 'legend.html.erb', locals: {:job => job, :ref => ref})
kit.stylesheets << "#{Rails.root}/vendor/assets/stylesheets/fontawesome/all.min.css"
if job then
if job.circos_images and job.circos_images.size > 0 then
t = Tempfile.new(job.job_id)
Expand All @@ -347,6 +350,8 @@ def get_all_synteny_images
zos.put_next_entry("#{image.chromosome}.png")
zos.print IO.read(image.file.path)
end
zos.put_next_entry("circos_legend.png")
zos.print kit.to_png
end
send_file t.path, :type => 'application/zip',
:disposition => 'attachment',
Expand Down
4 changes: 4 additions & 0 deletions app/views/jobs/_legend.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<p>
top: reference chromosome from <i><%= ref[:name] %></i>, bottom: <i> <%= job[:name] %></i> contiguated pseudochromosome <br>
<span class='fa-stop fa-solid' style='color: #fb6a4a'></span> = forward strand gene &emsp; <span class='fa-stop fa-solid' style='color: #6aadd5'></span> = reverse strand gene &emsp; <span class='fa-stop fa-solid' style='color: #74c476'></span> = missing core gene &emsp; <span class='fa-stop fa-solid' style='color: #0000000'></span> = singleton gene &emsp; <span class='fa-stop fa-solid' style='color: #fff64a'></span> = gap
</p>
5 changes: 1 addition & 4 deletions app/views/jobs/_tabs.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,7 @@ var vtable;
<p>
This is <span id='map-header'></span>. Click and drag in the diagram below to pan around. Use the mouse wheel or the <span class='glyphicon glyphicon-plus'></span>/<span class='glyphicon glyphicon-minus'></span> icons to zoom in and out.
</p>
<p>
top: reference chromosome from <i><%= @ref[:name] %></i>, bottom: <i> <%= @job[:name] %></i> contiguated pseudochromosome <br />
<span class='fa fa-stop' style='color: #fb6a4a'></span> = forward strand gene &emsp; <span class='fa fa-stop' style='color: #6aadd5'></span> = reverse strand gene &emsp; <span class='fa fa-stop' style='color: #74c476'></span> = missing core gene &emsp; <span class='fa fa-stop' style='color: #0000000'></span> = singleton gene &emsp; <span class='fa fa-stop' style='color: #fff64a'></span> = gap
</p>
<%= render partial: 'legend', locals: {:job => @job, :ref => @ref} %>
<div id="image-map"></div>
</div>
<% else %>
Expand Down
8 changes: 1 addition & 7 deletions app/views/jobs/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
<% content_for(:title, "Submit new Companion job") %>
<% content_for :head do %>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-slider/6.0.7/bootstrap-slider.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-slider/6.0.7/css/bootstrap-slider.min.css" />
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/select2.min.css" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/select2.min.js"></script>
<% end %>

<div class="page-header">
<h1>Submit a new annotation job</h1>
Expand Down Expand Up @@ -244,7 +238,7 @@
<% end %>

<script type="text/javascript">
$(document).ready(function() {
$(document).on('turbolinks:load', function() {
$('.js-example-basic-single').select2();
$('#advanced-panel').slideUp();
$('#transcript-selection').slideUp();
Expand Down
8 changes: 7 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@
<head>
<title><%= content_for?(:title) ? yield(:title) : "Companion" %></title>
<%= stylesheet_link_tag 'application', media: 'all' %>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/leaflet.css" />
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/leaflet.js"></script>
<%= yield :head %>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<%= csrf_meta_tags %>
<script>
FontAwesomeConfig = {
mutateApproach: 'sync'
}
</script>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
</head>
<body>
<nav class="navbar navbar-default navbar-static-top">
Expand Down
6 changes: 6 additions & 0 deletions vendor/assets/javascripts/fontawesome/all.min.js

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions vendor/assets/stylesheets/fontawesome/all.min.css

Large diffs are not rendered by default.