Skip to content

Instantly share code, notes, and snippets.

View danielecook's full-sized avatar
😀
Things are going good

Daniel E Cook danielecook

😀
Things are going good
View GitHub Profile
@danielecook
danielecook / nextflow_debug.sh
Last active May 22, 2020 16:05
Nextflow debug command #nextflow
function parse_opts() {
local RUNNER
local VOLUMES
local MEMORY
local IMAGE
local WORK
local ENTRYPOINT
while [[ $# -gt 0 ]]
do
opt="$1"
@danielecook
danielecook / docker_rm.sh
Created May 7, 2020 01:02
Docker remove images
drm() { docker rm $(docker ps -q -a); }
@danielecook
danielecook / rstudio_setwd.R
Created May 6, 2020 15:16
Rstudio setwd to current working file
try(setwd(dirname(rstudioapi::getActiveDocumentContext()$path)))
@danielecook
danielecook / toplevel.sh
Created May 5, 2020 01:17
git repo directory
git rev-parse --show-toplevel
@danielecook
danielecook / uniq.awk
Created May 4, 2020 12:11
Unique lines awk (seen)
awk '!seen[$2]++'
@danielecook
danielecook / chrom_order.R
Created May 4, 2020 12:11
Chromosome order as a factor in R
# For chr_order with 'chr' prefix
# chr_order <- paste0("chr", c((1:22),"X","Y","M"))
chr_order <-c((1:22),"X","Y","M")
df$chrom <- factor(df$chrom, chr_order, ordered=TRUE)
@danielecook
danielecook / user_id
Created April 28, 2020 15:52
Lookup username based on ID number #unix #CAMP
id -nu 30004297
@danielecook
danielecook / .Rprofile.r
Created April 27, 2020 18:43 — forked from stephenturner/.Rprofile.r
My .Rprofile
print("Loading R Profile")
options("repos" = c(CRAN = "http://cran.rstudio.com/"))
## Create a new invisible environment for all the functions to go in so it doesn't clutter your workspace.
.env <- new.env()
## Returns a logical vector TRUE for elements of X not in Y
.env$"%nin%" <- function(x, y) !(x %in% y)
@danielecook
danielecook / diff_hashes.py
Last active April 22, 2020 15:58
Parse nextflow output with -dump-hashes enabled for comparison #nextflow
#!/usr/bin/env python
import sys
import re
import io
import pandas as pd
import numpy as np
HELP_MSG = """
diff hashes
@danielecook
danielecook / keybindings.json
Last active April 19, 2020 17:09
VSCode Key Bindings
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "alt+cmd+j",
"command": "workbench.action.togglePanel"
},
{
"key": "cmd+j",
"command": "-workbench.action.togglePanel"
},