Skip to content

Instantly share code, notes, and snippets.

View slhogle's full-sized avatar

Shane Hogle slhogle

View GitHub Profile

Linkage Disequilibrium Calculation

This is complete taken from Ryan D on biostar: http://www.biostars.org/p/2909/#16419

It takes a region in a format like "chr2:1234-3456". If an rs number is specified after the region, it will output the R^2 for every SNP in that region with the requested SNP; otherwise, it is all-vs-all.

@slhogle
slhogle / singularity_wrapper.sh
Created March 5, 2021 13:12
shell wrapper for running singularity files on MIT engaging with common bindings baked in
#!/bin/bash
nopts=$#
# Bind common CSC environment directories
SING_FLAGS="$SING_FLAGS -B /nobackup1:/nobackup1 -B /pool001:/pool001 -B /nfs:/nfs"
# Bind TMPDIR if it is set and directory exists
if [ -d "$TMPDIR" ]; then
SING_FLAGS="$SING_FLAGS -B $TMPDIR:$TMPDIR"
@slhogle
slhogle / ssh_key_pairing.md
Last active September 9, 2020 18:47
SSH key pairing

create private/public key combo

  1. ssh-keygen -b 2048 -f mykeyname
  2. create password

append public key to remote host

  1. SSH to remote host
  2. cd to ~/.ssh
  3. append contents of public key file (mykeyname_rsa.pub) to ~/.ssh/authorized_keys

add to ssh-agent

@slhogle
slhogle / README.md
Last active February 11, 2020 10:18
Installing cartopy macOSX 10.13.6

Introduction

It was a pain to install cartopy on macOS. Here is what I did. It works as of Feb 10 2020. Uses proj, geos, and gdal from homebrew. none of that conda crap. Inspiration from here

Install your geo dependencies via homebrew

brew install proj  # version 6.3.0
brew install geos  # version 3.8.0
brew install gdal  # version 2.4.4
@slhogle
slhogle / downloadChunks.py
Created September 15, 2018 11:09 — forked from gourneau/downloadChunks.py
Download large files with Python urllib2 to a temp directory
import os
import urllib2
import math
def downloadChunks(url):
"""Helper to download large files
the only arg is a url
this file will go to a temp directory
the file will also be downloaded
in chunks and print out how much remains