20 articles Codes Page 2 / 2

This section contains code snippets, setup introductions, and configurations that are internal to only the technical development staff in ggKbase.

Stale Cache

If the binning page shows a legend that has too many boxes, or the stats on for gc or coverage or sequence length are missing, the cache is likley stale. Fix with this… p = Project.find ‘slug’ p.contigs.select(“id”).find_in_batches do |batch|  BatchTaxonomyStats.perform_async(“update”, batch.first.id, batch.last.id, “scope_type” => “Project”, “scope_id” => p.id) end # when sidekiq jobs are…

Configure MySQL

Edit my.conf. If you are using a Mac and have brewed your MySQL (Mariadb), your my.conf will be in /usr/local/etc. ## Modify the following fields in my.conf for MySQL [mysqld] max_allowed_packet = 2147483648 max_connections = 2000 net_buffer_length = 16K innodb_buffer_pool_size = 512M innodb_file_per_table [mysqldump] quick max_allowed_packet = 2147483648  

Checklist for pushing out new code to production

Procedures for rollout # Switch to the production site directory cd /works/railsapps/ggkbase # Put the web server to maintenance RAILS_ENV=production bundle exec rake web:disable # Check out new code # git stash might be needed git checkout master git pull origin master # hopefully, there is no conflict! # Update ruby gems bundle update #…

Setup BLAST, MAFFT, and Clustal-w on Mac

BLAST Install Blast from the homebrew/science tap The NCBI blast tools are being used for comparing gene sequences. For short sequences, usearch is used because it performs much better the blast tools (download the binary from the usearch website). brew tap homebrew/science brew install ncbi-c++-toolkit brew install blast Generate the sequence files A gene sequence will be…

Setup Project Import on Mac

Files and file structure File structure and files needed for importing a new project # Copy files from Google Drive tmp/PRJNA273161_taxid_overrides # create “/opt/bin/bio” folder cd /opt/bin/bio scp -r gg:/opt/bin/bio/SCG . USearch Get usearch from http://www.drive5.com/usearch/download.html. For development purpose, the free usearch 32 bit should be sufficient. mv usearch-blah-blah /opt/bin/bio/usearch64 # Regenerate the udh files in…

Setup Development Server on Mac

Install Applications While this document is written for Mac installation, the software needed to run ggKbase includes: ruby, rbenv, rbenv-vars, sidekiq, puma, redis, mariadb, elasticsearch. xcode (mac development toolkit) xcode-select –install homebrew (mac application manager) # Full doc: http://brew.sh/ ruby -e “$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)” rbenv (ruby environment manager) # Full doc: https://github.com/rbenv/rbenv brew install rbenv…

Setup production-ready, basic DB

To create empty tables in a new database according to the most recent version of the database schema (found in “db/schema.rb”) rake db:schema:load Some tables need to be pre-filled for the system to work properly. Import these tables in their entirety from the main DB: users roles local_taxonomies ncbi_taxonomies Data needed for universal lists: list_groups ( complete )…

Choosing a D3-Backed Charting Library

D3 is the most robust javascript library for building data visualization. A number of D3-backed libraries have sprung up with the specialization in making chart building easy and scalable. We tried the following libraries and picked ____________ as the winner. Below contains the description of each of the libraries that we have tried as well as the rationale…

Install WordPress Plugins

If you need additional functionalities and features for this WordPress site, the first thing you should do is to find WordPress plugins that will fulfill your needs. Given how long the WordPress has been around and the size of the community, the chances are that there are plugins out there that will meet our needs.…

Projects under the NCBI Rifle umbrella

At NCBI related BioProjects can be subsumed under a single umbrella project. For example, all  Rifle-related project are associated with the Rifle umbrella project  (BioProject ID PRJNA217089). For reference, here is a full list of project submissions under the Rifle umbrella: