20 articles Codes

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

Set up ggKbase Instance on Ubuntu

Install Applications The software needed to run ggKbase includes: ruby, rbenv, rbenv-vars, sidekiq, puma, redis, mariadb, elasticsearch. rbenv (ruby env mgr) + ruby # Full doc: https://github.com/rbenv/rbenv git clone https://github.com/rbenv/rbenv.git ~/.rbenv echo ‘export PATH=”$HOME/.rbenv/bin:$PATH”‘ >> ~/.bashrc echo ‘eval “$(rbenv init -)”‘ >> ~/.bashrc source ~/.bashrc # To verify type rbenv Install ruby-build plugin, useful for…

BLAST DB Services

The BLAST Database used to be a giant monolithic database, created by the makeblastdb tool, provisioned by NCBI. The process involved dumping all the contigs, genes, and proteins sequences from the entire ggKbase database and then running the makeblastdb command. That’s why the BLAST Database was not frequently updated because it would take a very long time…

Migrating Servers to Ubuntu

TODOs On Thursday… Brian will make backup of /etc on gg , es1, es2 , db1 , db2 and /work on gg. Shufei will shutdown site and start DB backup: ggkbase_production , ggkbase_help_wp , iwgm_wp On Friday… Brian will update the OS for gg , es1, es2 , db1 , db2 Get db1 and db2 up and running with mirroring and start the refill the database Move all the…

Set up HTTPS for RAILS

Introduction To set up HTTPS for a Rails app that is served up by Nginx is quite easy, but there are a couple of little things that need to be configured. This writeup is intended to document these small yet crucial steps. This document makes the following assumptions: SSL has been obtained and placed in…

Fix for NULL feature.gene_order

Issue Due to import hiccups, the gene_order field in the features table could be set to null. Assessment To detect and assess the problem for a specific project, here is the SQL query in the MySQL console: SELECT o.id, count(f.id) FROM organisms o JOIN features f ON o.id=f.organism_id JOIN organisms_projects op ON o.id=op.organism_id JOIN projects p…

Set up development db from current production db

Configure database name in .rbenv-vars. vim .rbenv-vars DB_DEVELOPMENT=ggkbase_development DB_PRODUCTION=ggkbase_production Create the database in MySQL at the app’s root directory. bin/rails db:create db:schema:load The database tables are now empty. To get us going right away, we need to fill some of the tables with content from the production database. # Dump critical tables from production database…

Basic Ruby on Rails Work Flow

Bootstrapping in and out: user@biotite ~ $ cd work/railsapps/ggkbase/ 1- Start redis: user@biotite ~/work/railsapps/ggkbase $ ./redis_init.sh start Starting redis-server: all set 2- Check that redis is up: user@biotite ~/work/railsapps/ggkbase $ ps -ef | grep klane user@biotite ~/work/railsapps/ggkbase $ psgg user    67702     1  0 10:10 ?        00:00:00 /opt/bin/bio/redis-server 127.0.0.1:0 user@biotite ~/work/railsapps/ggkbase $ tail -f log/redis.log…

Development Tools

Development tools play an important role in the ggKbase development process and collaboration. Here are some of the tools that we are using, where you can get them, and how we are setting them up. Editors: Vim – Usually comes with Linux and Mac Need some more information about what to set up here. Atom…

Very useful SQL commands

Description of what the SQL command does SLQ CODE HERE Description of what the SQL command does SLQ CODE HERE # Find TaxonomyStat records with non-existent contigs: select * from taxonomy_stats ts left join contigs c on ts.contig_id = c.id where c.id is null; #Delete TaxonomyStat records with non-existent contigs: delete ts from taxonomy_stats ts…