An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
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 & |
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) |
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 |
# 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 |
awk '{printf("%d\n",$0+=$0<0?0:0.9)}' |
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
#!/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 | \ |
I hereby claim:
To claim this, I am signing this object:
# 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 |
# Download ref genomes/contigs | |
lftp ftp.wormbase.org -e 'mget /pub/wormbase/species/**/sequence/genomic/*.current.genomic.fa.gz' | |
function get_genomes() { | |
for i in `ls -1 *canonical*fa.gz`; do | |
IFS='.' read -r -a genome <<< "$i"; | |
zcat ${i} | sed "s/>/> ${genome[0]} :: /g" | |
done; | |
} |