Skip to content

Instantly share code, notes, and snippets.

View stevekm's full-sized avatar

Stephen Kelly stevekm

View GitHub Profile
@ckandoth
ckandoth / ensembl_vep_102_with_offline_cache.md
Last active November 7, 2023 14:32
Install Ensembl's VEP v102 with local cache for running offline

Ensembl's VEP (Variant Effect Predictor) is popular for how it picks a single effect per gene as detailed here, its CLIA-compliant HGVS variant format, and Sequence Ontology nomenclature for variant effects.

Instead of the official instructions, we will use conda to install VEP and its dependencies. If you don't already have conda, install it into $HOME/miniconda3 as follows:

curl -sL https://repo.anaconda.com/miniconda/Miniconda3-py37_4.9.2-Linux-x86_64.sh -o /tmp/miniconda.sh
sh /tmp/miniconda.sh -bfp $HOME/miniconda3

Add the conda bin folder into your $PATH so that all installed tools are accessible via command-line. You can also add this to your ~/.bashrc

@andreas-wilm
andreas-wilm / nvmraid.sh
Last active June 5, 2023 22:11
Combine all NVMs on AWS instance (e.g. i3) as raid0 and mount as data
# https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/raid-config.html
nvmes=$(sudo lsblk | awk '/^nvme/ {printf "/dev/%s ", $1}')
sudo mdadm --create --verbose /dev/md0 --level=0 --name=my_raid --raid-devices=$(echo $nvmes | wc -w) $nvmes
sleep 10# crutch
sudo mkfs.ext4 -L my_raid /dev/md0
sudo mdadm --detail --scan | sudo tee -a /etc/mdadm.conf
sudo dracut -H -f /boot/initramfs-$(uname -r).img $(uname -r)
sudo mkdir /data
sudo mount LABEL=my_raid /data
sudo chown ec2-user:ec2-user /data/
@johnl
johnl / set-all-file-mtime-to-commit-time.sh
Last active January 13, 2023 16:56
Change file modification timestamps to the last git commit timestamps for all files in a git tree
#!/bin/bash
git ls-files -z | xargs -0 -n1 -I{} -- git log -1 --format="%at {}" {} | perl -ane '($t,$f)=@F;utime($t,$t,$f)'
@ckandoth
ckandoth / ensembl_vep_95_with_offline_cache.md
Last active October 4, 2022 21:49
Install Ensembl's VEP v95 with various caches for running offline

Ensembl's VEP (Variant Effect Predictor) is popular for how it picks a single effect per gene as detailed here, its CLIA-compliant HGVS variant format, and Sequence Ontology nomenclature for variant effects.

To follow these instructions, we'll assume you have these packaged essentials installed:

## For Debian/Ubuntu system admins ##
sudo apt-get install -y build-essential git libncurses-dev

## For RHEL/CentOS system admins ##
sudo yum groupinstall -y 'Development Tools'
sudo yum install -y git ncurses-devel
@pathunstrom
pathunstrom / index.html
Created January 11, 2018 01:02
Dual Movement
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
.box {
height: 100px;
width: 100px;
top: 100px;
@pingf
pingf / dash_button.py
Created July 6, 2017 15:28
dash_2button_switch
# -*- coding: utf-8 -*-
from time import sleep
import dash
from dash_core_components import Graph
from dash_html_components import H1, Div, Button
from comp import Button
from dash.dependencies import Input, Output, Event, State
app = dash.Dash()
@owulveryck
owulveryck / app.js
Last active November 24, 2022 22:08
WebSocket simple example / server in go, client in JS
window.addEventListener("load", function(evt) {
var output = document.getElementById("output");
var input = document.getElementById("input");
var ws;
var print = function(message) {
var d = document.createElement("div");
d.innerHTML = message;
output.appendChild(d);
@akorobov
akorobov / rustup-install.md
Created March 19, 2017 19:15
Installing rustup in different location

To install rustup in different directory (i.e. /opt):

  1. install rustup in custom directory pointed to by RUSTUP_HOME envvar:
curl https://sh.rustup.rs -sSf | sudo RUSTUP_HOME=/opt/rustup sh -s -- -y
  1. select default tool chain
@drernie
drernie / csvtomap.go
Created March 10, 2017 22:48
Golang Convert CSV Records to Dictionaries using Header Row as Keys
// CSVToMap takes a reader and returns an array of dictionaries, using the header row as the keys
func CSVToMap(reader io.Reader) []map[string]string {
r := csv.NewReader(reader)
rows := []map[string]string{}
var header []string
for {
record, err := r.Read()
if err == io.EOF {
break
}
@stevekm
stevekm / ssh_server_commands.md
Last active December 4, 2023 15:02
handy ssh, rsync, scp commands

Here are some handy commands for connecting to servers and copying files about. These are all for Linux terminal / bash shell

Do cool things with ssh; log in & run command, find files in dir

# log into server
ssh username@server.edu -Y 
# -X      Enables X11 forwarding. <- use this to enable X11 graphical windows, but this will eventually time out & you'll lose the X11 connection
# -Y      Enables trusted X11 forwarding. <- this one preserves your X11 connection while you're logged in