Skip to content

Instantly share code, notes, and snippets.

View seandavi's full-sized avatar

Sean Davis seandavi

View GitHub Profile
#!/bin/bash
sudo apt-get install -y libcurl4-gnutls-dev
sudo apt-get install -y libxml2-dev
sudo apt-get install -y texlive
@seandavi
seandavi / Bioc_DOI_creator.R
Created June 15, 2017 21:08
Create a Bioconductor DOI using the EZID service.
#' Generate a DOI for a bioconductor package
#'
#' This function makes calls out to the EZID API (v2) described
#' here: \url{https://ezid.lib.purdue.edu/doc/apidoc.2.html}. The
#' function creates a new DOI for a bioc package (cannot already
#' exist). The target URL for the DOI is the short Bioconductor
#' package URL.
#'
#' The login information for the "real" Bioconductor account
#' should be stored in the environment variables "EZID_USERNAME"
@seandavi
seandavi / query.R
Last active April 25, 2017 18:58
TARGET sample submission data for DCC
library(RMySQL)
con = dbConnect(MySQL(),user='sdavis',password='XXXXX',host='127.0.0.1',port=3308,dbname='solexa')
con = dbConnect(MySQL(),user='sdavis',password='mic2222',host='127.0.0.1',port=3308,dbname='solexa')
res = dbGetQuery(con,
"select study_id,source.name, sample.name, fcb.type as software,
fcb.dateStamp as basecalldate, fcb.softwareVersion as version, study_id,
sr.date as run_date, sr.sequencer as sequencer, ssr.library_id as library_id,
sr.ID as run_id, sample.ID as sample_id, nt.value as sample_source,
sample.sample_type, part.value as partitioning_method, ssr.ID as read_group_id
from solexa_sample as sample
@seandavi
seandavi / bigquery_join.R
Created March 27, 2017 20:38
bigrquery join example demonstrating error with "USING"
library(dplyr)
library(bigrquery)
db1 = src_bigquery(project = 'bigquery-public-data', dataset = 'hacker_news', billing = 'isb-cgc-04-0020')
comments = tbl(src = db1, 'full')
stories = tbl(src = db1, 'stories')
sessionInfo()
@seandavi
seandavi / post-commit
Created March 24, 2017 12:41 — forked from rmflight/post-commit
useful commit hooks for R package dev
#!/path/2/Rscript
# License: CC0 (just be nice and point others to where you got this)
# Author: Robert M Flight <[email protected]>, github.com/rmflight
#
# This is a post-commit hook that after a successful commit subsequently increments the package version in DESCRIPTION
# and commits that. Analogous to the pre-commit at https://gist.github.com/rmflight/8863882, but useful if you only have
# good reasons for not doing it on the pre-commit.
#
# To install it, simply copy this into the ".git/hooks/post-commit" file of your git repo, change /path/2/Rscript, and make
@seandavi
seandavi / ncit2bigquery.R
Created March 21, 2017 17:29
NCI Thesaurus flat file to Bigquery using bigrquery and rstats
# Note that this will need to be
# edited to address different google
# project details
library(downloader)
library(readr)
zipname = "Thesaurus.zip"
# change to get the version you like.
download("http://evs.nci.nih.gov/ftp1/NCI_Thesaurus/Thesaurus_17.02d.FLAT.zip",destfile=zipname)
unzip(zipname)
thes = read_tsv("Thesaurus.txt")
@seandavi
seandavi / debian_rstudio_server_install.sh
Last active July 6, 2018 20:36
Install rstudio server on debian
#!/bin/bash
sudo apt-get install -y libcurl4-openssl-dev libxml2-dev libssl-dev
sudo apt-get install -y r-base r-base-dev
sudo apt-get install -y gdebi-core
wget https://download2.rstudio.org/rstudio-server-1.0.136-amd64.deb
sudo gdebi --non-interactive rstudio-server-1.0.136-amd64.deb
# rstudio will be running on port 8787
@seandavi
seandavi / debian_docker_install.sh
Last active March 14, 2017 20:56
install docker on debian
#!/bin/bash
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
---
Software:
- title: metabox
languages:
- R
doi: 10.1371/journal.pone.0171046
manuscript: http://dx.doi.org/10.1371/journal.pone.0171046
pubmed_id: 28141874
repository: https://github.com/kwanjeeraw/metabox/
application_type: web application
@seandavi
seandavi / yaml.yaml
Created February 4, 2017 09:45
yaml rendering test
--- !clarkevans.com/^invoice
invoice: 34843
date : 2001-01-23
bill-to: &id001
given : Chris
family : Dumars
address:
lines: |
458 Walkman Dr.
Suite #292