Skip to content

Instantly share code, notes, and snippets.

@izahn
izahn / R screen scraping example.R
Created June 14, 2013 21:06
This R script contains a simple screen scraping example, downloading the text of the articles in the CNN website rss feed.
## This R script contains a simple screen scraping example,
## downloading the text of the articles in the CNN website
## rss feed.
library(RCurl)
library(XML)
options(stringsAsFactors = FALSE)
## get rss document
@andradei
andradei / sb3_keybindings_vowels.json
Last active December 18, 2023 16:09
Sublime Text 3 Key Bindings for Vowals with Accent (use with keyboard layout US, International with Dead Keys and similar)
[
// Key remaps
// - a
{ "keys": ["alt + ' + a"], "command": "insert", "args": {"characters": "á"}},
{ "keys": ["alt + ` + a"], "command": "insert", "args": {"characters": "à"}},
{ "keys": ["alt + \" + a"], "command": "insert", "args": {"characters": "ä"}},
{ "keys": ["alt + ~ + a"], "command": "insert", "args": {"characters": "ã"}},
// - A
@hrbrmstr
hrbrmstr / grid.R
Last active April 21, 2020 13:01
how to make a percentage grid in R
library(ggplot2)
library(tidyr)
dat <- as.data.frame(matrix(rep(c(rep("A", 24), rep("B", 8)), 10), nrow=10, byrow=TRUE))
dat$y <- rownames(dat)
dat %>%
gather(x, value, -y) %>%
mutate(x=as.numeric(gsub("V", "", x))) -> dat

How to match RPPA samples to their patients in The Cancer Genome Atlas (TCGA)

When I wrote the TCGA Toolbox and the TCGA.rppa module, one of biggest problems was to match samples and patients.

Both sample and patient files can be accessed through the Open Access HTTP Directory. For glioblastoma multiforme (gbm), the samples can be found in the gbm/cgcc/mdanderson.org/mda_rppa_core/protein_exp/mdanderson.org_GBM.MDA_RPPA_Core.Level_3.1.0.0/ directory, and the patients can be found [in the nationwidechildrens.org_clinical_patient_gbm.txt file in

@stormwild
stormwild / conda-environments.md
Last active September 5, 2023 04:55
Creating python2 environment in conda

Conda Environment

Create and activate an environment

conda create -n python2 python=2.7 anaconda
source activate python2

Deactivate environment