Skip to content

Instantly share code, notes, and snippets.

@bheavner
bheavner / gist:a6c9bfe9d960542216d2
Created November 11, 2015 00:34
Apply provenance to existing synapse object
metaDataOnly <- synGet(synapseId, downloadFile=F)
activity_name <- "RNA-seq Count File Merging"
input_files <- c("syn2875347")
code_files <- list(list(name = "merge_mouse_tau_rnaseq_counts.R",
url = "https://github.com/jaeddy/ampSynapseProjects/blob/v0.1-alpha/dataEnablement/R/merge_mouse_tau_rnaseq_counts.R",
wasExecuted = T),
list(name = "merge_count_files.R",
url = "https://github.com/jaeddy/ampSynapseProjects/blob/v0.1-alpha/dataEnablement/R/merge_count_files.R",
wasExecuted = T))
@bheavner
bheavner / gist:a8709acf26e02a6fb5015e20fab12837
Last active March 29, 2016 23:22
library install checking for short course
print("Hi from github :)")
print("Do you have randomForest?")
# do we want specific versions?
if(!require(randomForest, quiet = TRUE)){
install.packages("randomForest", quiet=TRUE)
suppressWarnings(library(randomForest))
}
@bheavner
bheavner / .gitignore
Created April 5, 2017 17:59
a .gitignore for GAC usage
# don't commit files that may have passwords
.env
*.cnf
# History files
.Rhistory
.Rapp.history
# Session Data files
.RData
@bheavner
bheavner / return-true.R
Last active April 6, 2017 20:41
A trivial R function that returns TRUE
return_true <- function(){
return(TRUE)
}
@bheavner
bheavner / test-testthat.R
Created April 6, 2017 18:49
A simple test to ensure testthat is working (and to enable devtools::check() on an empty project)
context("test_testthat - unit tests")
test_that("test_return_true returns TRUE", {
expect_true(return_true())
})
@bheavner
bheavner / hello.R
Created August 6, 2017 20:40
hello in R for testing source in RMD
print("hello!")
library(tidyverse)
parsed_snp_file <- "parsed_snp.tsv"
parsed_indel_file <- "parsed_indel.tsv"
unit_defs_file <- "feature_bounds_20170804.tsv"
snps <- read_tsv(parsed_snp_file, comment = "#")
indels <- read_tsv(parsed_indel_file, comment = "#")
@bheavner
bheavner / minids_from_R
Last active June 15, 2018 18:51
Example of minting a minid with the minidtools R client
# goal: mint minids for freeze 5 annotation in exchange area.
# requires digest and minidtools libraries
# computes checksum using local copy of the file
localPath <-
paste0("/projects/topmed/variant_annotation/freeze_5/database/v0/",
"parsed_files/2_snv.tsv.gz")
# use location on exchange area for the location metadata in the minid
@bheavner
bheavner / minids.txt
Created June 15, 2018 19:11
List of minids
example minid: ark:/57799/b9z705
TOMBSTONEd minid used in package: ark:/57799/b9j69h
TOPMED parsed annotation chr 2 minid: minid:b9g69w