Skip to content

Instantly share code, notes, and snippets.

View seandavi's full-sized avatar

Sean Davis seandavi

View GitHub Profile
@seandavi
seandavi / semanticscholar_to_bigquery.sh
Created January 29, 2022 19:08
Load semantic scholar json to bigquery
#!/bin/bash
# requires about 200G of disk space
# downloads stuff
# create disposable bucket
# upload
# bq load
# remove bucket
mkdir -p ss
cd ss
wget https://s3-us-west-2.amazonaws.com/ai2-s2-research-public/open-corpus/2022-01-01/manifest.txt
@seandavi
seandavi / start_rstudio.sh
Created January 4, 2022 03:30
Start and stop an Rstudio-based container on GCP VM
#!/bin/bash
CONTAINER=ghcr.io/seandavi/buildabiocworkshop
ZONE=us-central1-a
PASSWORD=rstudio
INSTANCE=rs-2
gcloud compute instances create-with-container $INSTANCE \
--container-image $CONTAINER \
--container-env PASSWORD=$PASSWORD \
--tags rstudio
@seandavi
seandavi / start_instance.sh
Created December 17, 2021 21:35
A self-deleting gcp instance
#!/bin/bash
gcloud compute instances create myinstance \
--metadata-from-file=startup-script=startup.sh \
--scopes=compute-rw
@seandavi
seandavi / download_biosample.R
Created July 22, 2021 16:52
download all of EBI biosample as json
start_date='2000-01-01'
end_date = '2021-12-31'
datefilter = function(date) {
startdate = format(date,'%Y-%m-%d')
return(sprintf("dt:release:from=%suntil=%s",startdate,startdate))
}
download_biosample = function(date) {
require(httr)

output: rmarkdown::html_document: highlight: pygments toc: true toc_depth: 3 fig_width: 5 bibliography: "r system.file(package='dummychapter1', 'vignettes', 'bibliography.bib')" vignette: > %\VignetteIndexEntry{dummychapter1}

### Keybase proof
I hereby claim:
* I am seandavi on github.
* I am seandavi (https://keybase.io/seandavi) on keybase.
* I have a public key ASAQ8VtxEXZOXbXUmfgPSsE2L-mF4g5oHcMRkosW0EszDgo
To claim this, I am signing this object:
@seandavi
seandavi / README.ipynb
Last active September 21, 2020 13:34
sars2pack jupyter notebook for Cornell comp bio talk
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@seandavi
seandavi / nextflow_trace_columns.tsv
Created July 8, 2020 11:51
nextflow_trace_columns.txt
Name Description
task_id Task ID.
hash Task hash code.
native_id Task ID given by the underlying execution system e.g. POSIX process PID when executed locally, job ID when executed by a grid engine, etc.
process Nextflow process name.
tag User provided identifier associated this task.
name Task name.
status Task status.
exit POSIX process exit status.
module Environment module used to run the task.
@seandavi
seandavi / covid_cases_by_largest_country.R
Created June 25, 2020 15:50
Countries vying for largest share of new COVID-19 cases
library(sars2pack)
library(dplyr)
library(zoo)
library(cowplot)
library(ggplot2)
y = ecdc_data() %>% dplyr::group_by(iso3c) %>%
add_incidence_column(count_column = 'confirmed') %>%
align_to_baseline(confirmed>50,group_vars = 'iso3c') %>%
dplyr::arrange(date) %>%
browseURL('https://seandavi.github.io/ITR/r_intro_mechanics.html')
1 + 1
x = 10
x
y = 20
y
y + x
browseURL('https://seandavi.github.io/ITR/vectors.html')
# vectors