View count.sh
git ls-files | xargs cat | wc -l
View gist:1cb76558fda8c01fc85c014afda28b18
test_df %>%
dplyr::arrange(chromosome, isotype, start, stop) %>%
dplyr::filter(
(!(lead(start) == stop & lead(haplotype) == haplotype & lead(isotype) == isotype & lead(chromosome) == chromosome) | is.na(lag(start)) | is.na(lead(stop)))
) %>%
dplyr::mutate(stop = ifelse(lead(isotype) == isotype &
lead(haplotype) == haplotype &
View gist:d2bb89371403073ae9e6b024dca88c05
library(imager)
library(cowplot)
im <- imager::load.image("https://storage.googleapis.com/elegansvariation.org/photos/hawaii2017/C-3273.jpg")
plot <- ggplot() + annotation_raster(im, xmin=-Inf, xmax=Inf, ymin=-Inf, ymax=Inf)
cowplot::plot_grid(plot, plot)
View is_overlapping.R
is_overlapping <- function(start_1, end_1, start_2, end_2) {
if (
(dplyr::between(start_1, start_2, end_2)) |
(dplyr::between(end_1, start_2, end_2)) |
(dplyr::between(start_2, start_1, end_1)) |
(dplyr::between(end_2, start_1, end_1))
) {
return(TRUE)
}
FALSE
View bash_profile.sh
# VERSION 1
export HOMEBREW_EDITOR=nano
export PS1='\[\e[0;35m\][\h::\w] 😱 \[\e[m\] '
export PATH="$HOME/.linuxbrew/bin:~/google-cloud-sdk/bin:$PATH"
export MANPATH="$(brew --prefix)/share/man:$MANPATH"
export INFOPATH="$(brew --prefix)/share/info:$INFOPATH"
# Load modules
module load bamtools/2.4.1
#module load bcftools/1.4-6 - messes with qstat
View awk_ceiling.sh
awk '{printf("%d\n",$0+=$0<0?0:0.9)}'
View curl.md

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
View rsid_annotation.sh
#!/usr/bin/bash
# @author = Daniel E. Cook
# @date = 2017-10-09
# This script downloads rs identifiers
# The function 'annotate_rsid' can be used to annotate a strat file with rsid.
# Usage:
# zcat chr1.strat.frq.gz | annotate_rside - | bgzip > out.bed.gz
curl -s http://hgdownload.cse.ucsc.edu/goldenPath/hg19/database/snp150.txt.gz | \
gunzip -c | \
View keybase.md

Keybase proof

I hereby claim:

  • I am danielecook on github.
  • I am danielecook (https://keybase.io/danielecook) on keybase.
  • I have a public key ASCbBKJnoEdxZ_P-Ch2FzRbEIKg0iSyZgjZRsU4lDZvhsgo

To claim this, I am signing this object:

View download_blast_db.sh
# cd /usr/local/share/blast
lftp ftp://ftp.ncbi.nlm.nih.gov -e 'mget /blast/db/nt*.tar.gz'
lftp ftp://ftp.ncbi.nlm.nih.gov -e 'mget /blast/db/nr*.tar.gz'
lftp ftp://ftp.ncbi.nlm.nih.gov -e 'mget /blast/db/refseq_genomic*.tar.gz'
other_genomic.*tar.gz