Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Daniel Himmelstein dhimmel

🎯
Focusing
View GitHub Profile
@dhimmel
dhimmel / onename.txt
Created Sep 3, 2014
onename verification
View onename.txt
Verifying that +dhimmel is my Bitcoin username. You can send me #bitcoin here: https://onename.io/dhimmel
@dhimmel
dhimmel / vtm.R
Last active Aug 29, 2015
Variable threshold metrics in R for evaluating classifier performance
View vtm.R
library(ROCR)
library(caTools)
VariableThresholdMetrics <- function(score, status) {
#' Evaluate the performance of predictions for a binary outcome.
#'
#' @param score A vector of predictions for which performance should be evalauted.
#' @param status A vector of the actual outcome: \code{0} (for negatives) and \code{1} (for positives).
#' @return A list.
@dhimmel
dhimmel / sung-views.ipynb
Created Jun 6, 2015
Retrieve article level metrics for a PLOS article and visualize views over time.
View sung-views.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dhimmel
dhimmel / elevcan-voe.ipynb
Created Jun 16, 2015
Vibration of effects analysis for lung cancer versus elevation
View elevcan-voe.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dhimmel
dhimmel / bto-terms-in-gnf.tsv
Created Jun 19, 2015
BTO (BRENDA Tissue Ontology) terms corresponding to GNF expression atlas tissues
View bto-terms-in-gnf.tsv
bto_id bto_name cell_line
BTO:0000038 SW-480 cell 1
BTO:0000041 medulla oblongata 0
BTO:0000045 adrenal cortex 0
BTO:0000047 adrenal gland 0
BTO:0000084 vermiform appendix 0
BTO:0000089 blood 0
BTO:0000141 bone marrow 0
BTO:0000142 brain 0
BTO:0000211 caudate nucleus 0
@dhimmel
dhimmel / weighted-r2.R
Last active Sep 17, 2020
Computing the R-squared of a linear regression model with weighted observations in R
View weighted-r2.R
# Compare four methods for computing the R-squared (R2, coefficient of determination)
# with wieghted observations for a linear regression model in R.
# This work was written by Daniel Himmelstein (@dhimmel) with guidance
# from Alex Pankov (@a-pankov). It is released as CC0 (public domain).
get_r2_cor <- function(y, y_pred, w) {
# Calculate R2 using the correlation coefficient method
xy = cbind(y, y_pred)
return(boot::corr(d=xy, w=w) ^ 2)
}
@dhimmel
dhimmel / keybase.md
Created Nov 23, 2015
Proving account ownership for keybase.io
View keybase.md

Keybase proof

I hereby claim:

  • I am dhimmel on github.
  • I am dhimmel (https://keybase.io/dhimmel) on keybase.
  • I have a public key whose fingerprint is 8CA9 B3A5 A4B4 D442 A285 867B 03A8 B7F8 47EE A45D

To claim this, I am signing this object:

@dhimmel
dhimmel / cypher-edge-swap.adoc
Last active Dec 28, 2018
Randomized edge swaps in cypher
View cypher-edge-swap.adoc

Degree-Preserving Edge-Swap

Background

We designed a hetnet for drug repurposing that contains 50 thousand nodes (of 10 labels) and 3 million relationships (of 27 types). And we’ve chosen neo4j for handling network storage and interaction.

@dhimmel
dhimmel / preprints.ipynb
Last active Jan 4, 2016
Growth of bioscience preprints in 2015
View preprints.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dhimmel
dhimmel / hetio-ind.adoc
Last active Jan 31, 2016
2016 GraphGist Challenge · Drug repurposing by hetnet relationship prediction: a new hope · http://portal.graphgist.org/graph_gists/drug-repurposing-by-hetnet-relationship-prediction-a-new-hope
View hetio-ind.adoc

Drug repurposing by hetnet relationship prediction: a new hope


A long time ago in a galaxy far, far away…​.