Last active
September 11, 2022 23:48
-
-
Save robertness/88472e2fb09511c1e853 to your computer and use it in GitHub Desktop.
Import Sachs 2005 Bayesian Network Single Cell Dataset
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| importData <- function(dir){ | |
| # Imports datasets used in the paper: | |
| #Sachs, Karen, et al. "Causal protein-signaling networks derived from multiparameter single-cell data." Science 308.5721 (2005): 523-529. | |
| # Imports the data from the Data Files directory downloaded as a zip from the publication's site on Science.com | |
| # Direct link to the file as of Dec 15, 2014: | |
| # http://www.sciencemag.org/content/suppl/2005/04/21/308.5721.523.DC1/Sachs.SOM.Datasets.zip | |
| # | |
| require(gdata) | |
| setwd(dir) | |
| filenames <- system('ls',intern=T) | |
| filenames <- filenames[-which(filenames %in% c('Sachs_Nolan_Perturbation Data Sets_Final.doc', 'interventions_tab.csv', 'validated.csv'))] | |
| data.list <- lapply(filenames, read.xls) | |
| #Sanitize filenames | |
| filenames <- gsub("\\+", "_", gsub("\\.xls", "", sapply(filenames, function(nom) strsplit(nom, " ")[[1]][2]))) | |
| names(data.list) <- filenames | |
| for(i in 1:length(data.list)){ | |
| data.list[[i]]$filename <- filenames[i] | |
| names(data.list[[i]]) <- names(data.list[[1]]) | |
| } | |
| data.list | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment