source("http://cf.10xgenomics.com/supp/cell-exp/rkit-install-2.0.0.R")
library(cellrangerRkit)
packageVersion("cellrangerRkit")
genome <- "mm10"
?load_cellranger_matrix
gene_bc_matrix <- load_cellranger_matrix("/Volumes/BB_USC_2/10xGenomics/Example_data/nuclei_2k_S1_old", genome='mm10')
head(gene_bc_matrix)
gene_bc_matrix@barcode_filtered
gene_bc_matrix@molecule_info
gene_bc_matrix@experimentData
gene_bc_matrix@assayData
readcount_matrix <- get_read_count_mtx(gene_bc_matrix)
?load_molecule_info
load_molecule_info(gene_bc_matrix)
gene_bc_matrix <- load_molecule_info(gene_bc_matrix)
readcount_matrix <-exprs(gbm)
readcount_matrix <-exprs(gene_bc_matrix)
head(readcount_matrix)
readcount_matrix <- get_read_count_mtx(gene_bc_matrix)
readcount_matrix
gene_bc_matrix <- load_cellranger_matrix("/Volumes/BB_USC_2/10xGenomics/Example_data/nuclei_2k_S1_old", genome='mm10')
readcount_matrix <- exprs(gene_bc_matrix)
readcount_matrix
library('scde')
install.packages("doMC", dep=T)
install.packages("caTools", dep=T)
install.packages("utils", dep=T)
install.packages("utils", dep = T)
source("http://bioconductor.org/biocLite.R")
biocLite( "BSgenome" )
library('massiR')
data(y.probes)
names(y.probes)
library(biomaRt)
mart <- useMart('ensembl', dataset="mmusculus_gene_ensembl")
filters <- listFilters(mart)
attributes <- listAttributes(mart)
gene.attributes.illwg6.2 <- getBM(mart=mart, values=TRUE,filters=c("with_illumina_mousewg_6_v2"),attributes= c("illumina_mousewg_6_v2", "entrezgene","chromosome_name", "start_position","end_position", "strand"))
# Remove the probes mapped to multiple genomic regions:
unique.probe.illwg6.2 <- subset(gene.attributes.illwg6.2, subset=!duplicated(gene.attributes.illwg6.2[,1]))
# Select the probes that correspond to y chromosome genes:
y.unique.illwg6.2 <- subset(unique.probe.illwg6.2, subset=unique.probe.illwg6.2$chromosome_name == "Y")
y.unique.illwg6.2
gene.attributes.Mouse430_2 <- getBM(mart=mart, values=TRUE,filters=c("with_affy_mouse430_2"),attributes= c("affy_mouse430_2", "entrezgene","chromosome_name", "start_position","end_position", "strand"))
# Remove the probes mapped to multiple genomic regions:
unique.probe.Mouse430_2 <- subset(gene.attributes.Mouse430_2, subset=!duplicated(gene.attributes.illwg6.2[,1]))
# Select the probes that correspond to y chromosome genes:
y.unique.Mouse430_2 <- subset(unique.probe.Mouse430_2, subset=unique.probe.Mouse430_2$chromosome_name == "Y")
########################################################################
#### B. Mouse430_2
gene.attributes.Mouse430_2 <- getBM(mart=mart, values=TRUE,filters=c("with_affy_mouse430_2"),attributes= c("affy_mouse430_2", "entrezgene","chromosome_name", "start_position","end_position", "strand"))
# Remove the probes mapped to multiple genomic regions:
unique.probe.Mouse430_2 <- subset(gene.attributes.Mouse430_2, subset=!duplicated(gene.attributes.Mouse430_2[,1]))
# Select the probes that correspond to y chromosome genes:
y.unique.Mouse430_2 <- subset(unique.probe.Mouse430_2, subset=unique.probe.Mouse430_2$chromosome_name == "Y")
########################################################################
########################################################################
#### B. Illumina_MouseRef-8_v2.0
gene.attributes.illmr8 <- getBM(mart=mart, values=TRUE,filters=c("with_illumina_mouseref_8"),attributes= c("illumina_mouseref_8", "entrezgene","chromosome_name", "start_position","end_position", "strand"))
# Remove the probes mapped to multiple genomic regions:
unique.probe.illmr8 <- subset(gene.attributes.illmr8, subset=!duplicated(gene.attributes.illmr8[,1]))
# Select the probes that correspond to y chromosome genes:
y.unique.illmr8 <- subset(unique.probe.illmr8, subset=unique.probe.illmr8$chromosome_name == "Y")
########################################################################
head(y.unique.illwg6.2)
head(v)
head(y.unique.Mouse430_2)
head(y.unique.illmr8)
my.illwg6.2.probes <- data.frame(row.names=y.unique.illwg6.2$illumina_mousewg_6_v2)
my.Mouse430_2.probes <- data.frame(y.unique.Mouse430_2=y.unique.illwg6.2$affy_mouse430_2)
my.illmr8.probes <- data.frame(y.unique.illmr8=y.unique.illwg6.2$illumina_mouseref_8)
my.illmr8.probes
my.illmr8.probes <- data.frame(y.unique.illmr8=unique.probe.illmr8$illumina_mouseref_8)
my.illmr8.probes
my.illwg6.2.probes <- data.frame(row.names=y.unique.illwg6.2$illumina_mousewg_6_v2)
my.Mouse430_2.probes <- data.frame(row.names=y.unique.Mouse430_2=y.unique.illwg6.2$affy_mouse430_2)
my.illmr8.probes <- data.frame(row.names=y.unique.illmr8=unique.probe.illmr8$illumina_mouseref_8)
my.Mouse430_2.probes <- data.frame(row.names=y.unique.Mouse430_2$affy_mouse430_2)
my.illmr8.probes <- data.frame(row.names=y.unique.illmr8$illumina_mouseref_8)
my.illmr8.probes
GSE29984 <- read.table("/Volumes/BB_USC_2/Longevity_project/Datasets/Microarray/GEO_series_Matrix/GSE29984/GSE29984_series_matrix.txt",sep = "\t", header = T, skip = 86)
GSE19640 <- read.table("/Volumes/BB_USC_2/Longevity_project/Datasets/Microarray/Affymetrix_RAW/Processed/2018-03-13_GSE19640_RMA.Data.txt",sep = "\t", header = T)
GSE28417 <- read.table("/Volumes/BB_USC_2/Longevity_project/Datasets/Microarray/Affymetrix_RAW/Processed/2018-03-16_GSE28417_RMA.Data.txt",sep = "\t", header = T)
GSE29984 <- read.csv("/Volumes/BB_USC_2/Longevity_project/Datasets/Microarray/GEO_series_Matrix/GSE29984/GSE29984_series_matrix.txt",sep = "\t", header = T, skip = 86)
GSE19640 <- read.csv("/Volumes/BB_USC_2/Longevity_project/Datasets/Microarray/Affymetrix_RAW/Processed/2018-03-13_GSE19640_RMA.Data.txt",sep = "\t", header = T)
GSE28417 <- read.csv("/Volumes/BB_USC_2/Longevity_project/Datasets/Microarray/Affymetrix_RAW/Processed/2018-03-16_GSE28417_RMA.Data.txt",sep = "\t", header = T)
?massi_select
head(GSE29984)
rownames(GSE29984) <- GSE29984$ID_REF
my.illmr8.probes
massi.select.out <- massi_select(GSE29984, y.unique.illmr8$illumina_mouseref_8, threshold=4)
massi.select.out <- massi_select(GSE29984, data.frame(y.unique.illmr8$illumina_mouseref_8), threshold=4)
massi.select.out
head(GSE29984)
massi.select.out <- massi_select(GSE29984[,-1], data.frame(y.unique.illmr8$illumina_mouseref_8), threshold=4)
massi.select.out
y.unique.illmr8$illumina_mouseref_8
options(stringsAsFactors = F)
GSE29984 <- read.csv("/Volumes/BB_USC_2/Longevity_project/Datasets/Microarray/GEO_series_Matrix/GSE29984/GSE29984_series_matrix.txt",sep = "\t", header = T, skip = 86)
rownames(GSE29984) <- GSE29984$ID_REF
GSE19640 <- read.csv("/Volumes/BB_USC_2/Longevity_project/Datasets/Microarray/Affymetrix_RAW/Processed/2018-03-13_GSE19640_RMA.Data.txt",sep = "\t", header = T)
GSE28417 <- read.csv("/Volumes/BB_USC_2/Longevity_project/Datasets/Microarray/Affymetrix_RAW/Processed/2018-03-16_GSE28417_RMA.Data.txt",sep = "\t", header = T)
massi.select.out <- massi_select(GSE29984[,-1], data.frame(y.unique.illmr8$illumina_mouseref_8), threshold=4)
massi.select.out
massi.select.out <- massi_select(GSE19640, data.frame(y.unique.Mouse430_2$affy_mouse430_2), threshold=4)
GSE29984 <- GSE29984[!apply(GSE29984[,-1],1,is.na),]
GSE29984 <- GSE29984[!apply(GSE29984[,-1],1,is.na),-1]
GSE19640 <- GSE19640[!apply(GSE19640,1,is.na),]
GSE28417 <- GSE28417[!apply(GSE28417,1,is.na),]
head(GSE29984)
apply(GSE29984[,-1],1,is.na)
head(apply(GSE29984[,-1],1,is.na))
load("/Users/benayoun/Dropbox/Manuscripts_and_Publications/2018_aging_epigenomics_data_description/Code_checking/Code_For_Review/Figure3_Machine_learning/2016-11-21_Complete_feature_matrices_FOLD_CHANGE_NA_RM.RData")
load("/Users/benayoun/Dropbox/Manuscripts_and_Publications/2018_aging_epigenomics_data_description/Code_checking/Code_For_Review/Figure3_Machine_learning/2017-03-20_Complete_feature_matrices_CEREB_FOLD_CHANGE_NA_RM.RData")
my.cereb.features
summary(my.cereb.features)
summary(my.cereb.features$age_change)
summary(my.heart[=.features$age_change)
summary(my.heart.features$age_change)
summary(my.liver.features$age_change)
summary(my.ob.features$age_change)
setwd('/Volumes/BB_Backup_3//BD_aging_project/Machine_learning_aging/Predict_Fold_change/oldie_runs_2016-11-21/Model_RData/RF')
source('parsing_functions_vRF.R')
# load input data
load('/Volumes/BB_Backup_3/BD_aging_project/Machine_learning_aging/Predict_Fold_change/2016-11-21_Complete_feature_matrices_FOLD_CHANGE_NA_RM.RData')
load('/Volumes/BB_Backup_3/BD_aging_project/Machine_learning_aging/Predict_Fold_change/2017-03-20_Complete_feature_matrices_CEREB_FOLD_CHANGE_NA_RM.RData')
library('pheatmap')
my.accuracy.colors <- c("lightblue1","lightsalmon","indianred1","brown2","firebrick3","firebrick4")
### 1. with Samplings
my.ob.samp <- read.table('2017-03-28_Olfactory_Bulb_chromatin_model_cross_tissue_AVERAGE_RF_metrics_classification_withSampling.txt')
my.cereb.samp <- read.table('2017-03-28_Cerebellum_chromatin_model_cross_tissue_AVERAGE_RF_metrics_classification_withSampling.txt')
my.heart.samp <- read.table('2017-03-28_Heart_chromatin_model_cross_tissue_AVERAGE_RF_metrics_classification_withSampling.txt')
my.liver.samp <- read.table('2017-03-28_Liver_chromatin_model_cross_tissue_AVERAGE_RF_metrics_classification_withSampling.txt')
my.samp.accuracies <- data.frame(cbind(my.heart.samp$accuracy,
my.liver.samp$accuracy,
my.cereb.samp$accuracy,
my.ob.samp$accuracy))
rownames(my.samp.accuracies) <- rownames(my.ob.samp)
colnames(my.samp.accuracies) <- paste(rownames(my.samp.accuracies),"trained_model",sep="_")
my.random <- rep(0.5,4)
my.perfect <- rep(1,4)
my.samp.accuracies.all <- rbind(my.samp.accuracies,my.random,my.perfect)
rownames(my.samp.accuracies.all)[5:6] <- c("random accuracy","perfect accuracy")
# plot combined accuracy heatmaps
pdf(paste(Sys.Date(),"_cross_tissue_RF_accuracies_with_sampling_heatmap.pdf", sep="_"), onefile=F)
pheatmap(my.samp.accuracies.all, cluster_rows = F, cluster_cols = F,
col = colorRampPalette(my.accuracy.colors)(50),
main = "3-class classification with sampling")
dev.off()
getwd()
my.ob.samp <- read.table('Chromatin/cross_tissues_accuracies/2017-03-28_Olfactory_Bulb_chromatin_model_cross_tissue_AVERAGE_RF_metrics_classification_withSampling.txt')
my.cereb.samp <- read.table('Chromatin/cross_tissues_accuracies/2017-03-28_Cerebellum_chromatin_model_cross_tissue_AVERAGE_RF_metrics_classification_withSampling.txt')
my.heart.samp <- read.table('Chromatin/cross_tissues_accuracies/2017-03-28_Heart_chromatin_model_cross_tissue_AVERAGE_RF_metrics_classification_withSampling.txt')
my.liver.samp <- read.table('Chromatin/cross_tissues_accuracies/2017-03-28_Liver_chromatin_model_cross_tissue_AVERAGE_RF_metrics_classification_withSampling.txt')
my.samp.accuracies <- data.frame(cbind(my.heart.samp$accuracy,
my.liver.samp$accuracy,
my.cereb.samp$accuracy,
my.ob.samp$accuracy))
rownames(my.samp.accuracies) <- rownames(my.ob.samp)
colnames(my.samp.accuracies) <- paste(rownames(my.samp.accuracies),"trained_model",sep="_")
my.random <- rep(0.5,4)
my.perfect <- rep(1,4)
my.samp.accuracies.all <- rbind(my.samp.accuracies,my.random,my.perfect)
rownames(my.samp.accuracies.all)[5:6] <- c("random accuracy","perfect accuracy")
# plot combined accuracy heatmaps
pdf(paste(Sys.Date(),"_cross_tissue_RF_accuracies_with_sampling_heatmap.pdf", sep="_"), onefile=F)
pheatmap(my.samp.accuracies.all, cluster_rows = F, cluster_cols = F,
col = colorRampPalette(my.accuracy.colors)(50),
main = "3-class classification with sampling")
dev.off()
### 2. without constant class
my.ob.cst <- read.table('Chromatin/cross_tissues_accuracies/2017-03-28_Olfactory_Bulb_chromatin_model_cross_tissue_RF_metrics_classification_noCST.txt')
my.cereb.cst <- read.table('Chromatin/cross_tissues_accuracies/2017-03-28_Cerebellum_chromatin_model_cross_tissue_RF_metrics_classification_noCST.txt')
my.heart.cst <- read.table('Chromatin/cross_tissues_accuracies/2017-03-28_Heart_chromatin_model_cross_tissue_RF_metrics_classification_noCST.txt')
my.liver.cst <- read.table('Chromatin/cross_tissues_accuracies/2017-03-28_Liver_chromatin_model_cross_tissue_RF_metrics_classification_noCST.txt')
my.cst.accuracies <- data.frame(cbind(my.heart.cst$accuracy,
my.liver.cst$accuracy,
my.cereb.cst$accuracy,
my.ob.cst$accuracy))
rownames(my.cst.accuracies) <- rownames(my.ob.cst)
colnames(my.cst.accuracies) <- paste(rownames(my.cst.accuracies),"trained_model",sep="_")
my.random <- rep(0.5,4)
my.perfect <- rep(1,4)
my.cst.accuracies.all <- rbind(my.cst.accuracies,my.random,my.perfect)
rownames(my.cst.accuracies.all)[5:6] <- c("random accuracy","perfect accuracy")
# plot combined accuracy heatmaps
pdf(paste(Sys.Date(),"_cross_tissue_RF_accuracies_noCST_heatmap.pdf", sep="_"), onefile=F)
pheatmap(my.cst.accuracies.all, cluster_rows = F, cluster_cols = F,
col = colorRampPalette(my.accuracy.colors)(50),
main = "2-class classification (no sampling)")
dev.off()
my.accuracy.colors <- c("floralwhite","lightsalmon","indianred1","firebrick3","firebrick","firebrick4")
### 1. with Samplings
my.ob.samp <- read.table('Chromatin/cross_tissues_accuracies/2017-03-28_Olfactory_Bulb_chromatin_model_cross_tissue_AVERAGE_RF_metrics_classification_withSampling.txt')
my.cereb.samp <- read.table('Chromatin/cross_tissues_accuracies/2017-03-28_Cerebellum_chromatin_model_cross_tissue_AVERAGE_RF_metrics_classification_withSampling.txt')
my.heart.samp <- read.table('Chromatin/cross_tissues_accuracies/2017-03-28_Heart_chromatin_model_cross_tissue_AVERAGE_RF_metrics_classification_withSampling.txt')
my.liver.samp <- read.table('Chromatin/cross_tissues_accuracies/2017-03-28_Liver_chromatin_model_cross_tissue_AVERAGE_RF_metrics_classification_withSampling.txt')
my.samp.accuracies <- data.frame(cbind(my.heart.samp$accuracy,
my.liver.samp$accuracy,
my.cereb.samp$accuracy,
my.ob.samp$accuracy))
rownames(my.samp.accuracies) <- rownames(my.ob.samp)
colnames(my.samp.accuracies) <- paste(rownames(my.samp.accuracies),"trained_model",sep="_")
my.random <- rep(0.5,4)
my.perfect <- rep(1,4)
my.samp.accuracies.all <- rbind(my.samp.accuracies,my.random,my.perfect)
rownames(my.samp.accuracies.all)[5:6] <- c("random accuracy","perfect accuracy")
# plot combined accuracy heatmaps
pdf(paste(Sys.Date(),"_cross_tissue_RF_accuracies_with_sampling_heatmap.pdf", sep="_"), onefile=F)
pheatmap(my.samp.accuracies.all, cluster_rows = F, cluster_cols = F,
col = colorRampPalette(my.accuracy.colors)(50),
main = "3-class classification with sampling")
dev.off()
### 2. without constant class
my.ob.cst <- read.table('Chromatin/cross_tissues_accuracies/2017-03-28_Olfactory_Bulb_chromatin_model_cross_tissue_RF_metrics_classification_noCST.txt')
my.cereb.cst <- read.table('Chromatin/cross_tissues_accuracies/2017-03-28_Cerebellum_chromatin_model_cross_tissue_RF_metrics_classification_noCST.txt')
my.heart.cst <- read.table('Chromatin/cross_tissues_accuracies/2017-03-28_Heart_chromatin_model_cross_tissue_RF_metrics_classification_noCST.txt')
my.liver.cst <- read.table('Chromatin/cross_tissues_accuracies/2017-03-28_Liver_chromatin_model_cross_tissue_RF_metrics_classification_noCST.txt')
my.cst.accuracies <- data.frame(cbind(my.heart.cst$accuracy,
my.liver.cst$accuracy,
my.cereb.cst$accuracy,
my.ob.cst$accuracy))
rownames(my.cst.accuracies) <- rownames(my.ob.cst)
colnames(my.cst.accuracies) <- paste(rownames(my.cst.accuracies),"trained_model",sep="_")
my.random <- rep(0.5,4)
my.perfect <- rep(1,4)
my.cst.accuracies.all <- rbind(my.cst.accuracies,my.random,my.perfect)
rownames(my.cst.accuracies.all)[5:6] <- c("random accuracy","perfect accuracy")
# plot combined accuracy heatmaps
pdf(paste(Sys.Date(),"_cross_tissue_RF_accuracies_noCST_heatmap.pdf", sep="_"), onefile=F)
pheatmap(my.cst.accuracies.all, cluster_rows = F, cluster_cols = F,
col = colorRampPalette(my.accuracy.colors)(50),
main = "2-class classification (no sampling)")
dev.off()
setwd('/Volumes/MyBook_3/BD_aging_project/Machine_learning_aging/Predict_Fold_change/oldie_runs_2016-11-21/Model_RData/GBM')
source('parsing_functions_vGBM.R')
# load input data
load('/Volumes/MyBook_3/BD_aging_project/Machine_learning_aging/Predict_Fold_change/2016-11-21_Complete_feature_matrices_FOLD_CHANGE_NA_RM.RData')
load('/Volumes/MyBook_3/BD_aging_project/Machine_learning_aging/Predict_Fold_change/2017-03-20_Complete_feature_matrices_CEREB_FOLD_CHANGE_NA_RM.RData')
# 2017-02-24
# start parsing out ML results for GBM runs
# 2017-03-28
# rerun with updated H3 cerebellum data
# 2018-04-13
# change heatmap colors for Anne
##setwd('/Volumes/MyBook_3/BD_aging_project/Machine_learning_aging/Predict_Fold_change/oldie_runs_2016-11-21/Model_RData/GBM')
setwd('/Volumes/BB_Backup_3/BD_aging_project/Machine_learning_aging/Predict_Fold_change/oldie_runs_2016-11-21/Model_RData/GBM')
source('parsing_functions_vGBM.R')
# load input data
load('/Volumes/BB_Backup_3/BD_aging_project/Machine_learning_aging/Predict_Fold_change/2016-11-21_Complete_feature_matrices_FOLD_CHANGE_NA_RM.RData')
load('/Volumes/BB_Backup_3/BD_aging_project/Machine_learning_aging/Predict_Fold_change/2017-03-20_Complete_feature_matrices_CEREB_FOLD_CHANGE_NA_RM.RData')
library('pheatmap')
my.accuracy.colors <- c("floralwhite","lightsalmon","indianred1","firebrick3","firebrick","firebrick4")
library('pheatmap')
#my.accuracy.colors <- c("lightyellow","lightblue1","steelblue1","royalblue3","dodgerblue4","midnightblue")
my.accuracy.colors <- c("floralwhite","lightsalmon","indianred1","firebrick3","firebrick","firebrick4")
### 1. with Samplings
my.ob.samp <- read.table('Chromatin/cross_tissues_accuracies/2017-03-29_Olfactory_Bulb_chromatin_model_cross_tissue_AVERAGE_GBM_metrics_classification_withSampling.txt')
my.cereb.samp <- read.table('Chromatin/cross_tissues_accuracies/2017-03-29_Cerebellum_chromatin_model_cross_tissue_AVERAGE_GBM_metrics_classification_withSampling.txt')
my.heart.samp <- read.table('Chromatin/cross_tissues_accuracies/2017-03-28_Heart_chromatin_model_cross_tissue_AVERAGE_GBM_metrics_classification_withSampling.txt')
my.liver.samp <- read.table('Chromatin/cross_tissues_accuracies/2017-03-28_Liver_chromatin_model_cross_tissue_AVERAGE_GBM_metrics_classification_withSampling.txt')
my.samp.accuracies <- data.frame(cbind(my.heart.samp$accuracy,
my.liver.samp$accuracy,
my.cereb.samp$accuracy,
my.ob.samp$accuracy))
rownames(my.samp.accuracies) <- rownames(my.ob.samp)
colnames(my.samp.accuracies) <- paste(rownames(my.samp.accuracies),"trained_model",sep="_")
my.random <- rep(0.5,4)
my.peGBMect <- rep(1,4)
my.samp.accuracies.all <- rbind(my.samp.accuracies,my.random,my.peGBMect)
rownames(my.samp.accuracies.all)[5:6] <- c("random accuracy","perfect accuracy")
# plot combined accuracy heatmaps
pdf(paste(Sys.Date(),"_cross_tissue_GBM_accuracies_with_sampling_heatmap.pdf", sep="_"), onefile=F)
pheatmap(my.samp.accuracies.all, cluster_rows = F, cluster_cols = F,
col = colorRampPalette(my.accuracy.colors)(50),
main = "3-class classification with sampling")
dev.off()
my.ob.samp <- read.table('Chromatin/cross_tissues_accuracies/2017-03-29_Olfactory_Bulb_chromatin_model_cross_tissue_AVERAGE_GBM_metrics_classification_withSampling.txt')
getwd()
my.ob.samp <- read.table('Chromatin/Cross_Tissue_predictions/2017-03-29_Olfactory_Bulb_chromatin_model_cross_tissue_AVERAGE_GBM_metrics_classification_withSampling.txt')
my.cereb.samp <- read.table('Chromatin/Cross_Tissue_predictions/2017-03-29_Cerebellum_chromatin_model_cross_tissue_AVERAGE_GBM_metrics_classification_withSampling.txt')
my.heart.samp <- read.table('Chromatin/Cross_Tissue_predictions/2017-03-28_Heart_chromatin_model_cross_tissue_AVERAGE_GBM_metrics_classification_withSampling.txt')
my.liver.samp <- read.table('Chromatin/Cross_Tissue_predictions/2017-03-28_Liver_chromatin_model_cross_tissue_AVERAGE_GBM_metrics_classification_withSampling.txt')
my.samp.accuracies <- data.frame(cbind(my.heart.samp$accuracy,
my.liver.samp$accuracy,
my.cereb.samp$accuracy,
my.ob.samp$accuracy))
rownames(my.samp.accuracies) <- rownames(my.ob.samp)
colnames(my.samp.accuracies) <- paste(rownames(my.samp.accuracies),"trained_model",sep="_")
my.random <- rep(0.5,4)
my.peGBMect <- rep(1,4)
my.samp.accuracies.all <- rbind(my.samp.accuracies,my.random,my.peGBMect)
rownames(my.samp.accuracies.all)[5:6] <- c("random accuracy","perfect accuracy")
# plot combined accuracy heatmaps
pdf(paste(Sys.Date(),"_cross_tissue_GBM_accuracies_with_sampling_heatmap.pdf", sep="_"), onefile=F)
pheatmap(my.samp.accuracies.all, cluster_rows = F, cluster_cols = F,
col = colorRampPalette(my.accuracy.colors)(50),
main = "3-class classification with sampling")
dev.off()
### 2. without constant class
my.ob.cst <- read.table('Chromatin/Cross_Tissue_predictions/2017-03-29_Olfactory_Bulb_chromatin_model_cross_tissue_GBM_metrics_classification_noCST.txt')
my.cereb.cst <- read.table('Chromatin/Cross_Tissue_predictions/2017-03-29_Cerebellum_chromatin_model_cross_tissue_GBM_metrics_classification_noCST.txt')
my.heart.cst <- read.table('Chromatin/Cross_Tissue_predictions/2017-03-28_Heart_chromatin_model_cross_tissue_GBM_metrics_classification_noCST.txt')
my.liver.cst <- read.table('Chromatin/Cross_Tissue_predictions/2017-03-28_Liver_chromatin_model_cross_tissue_GBM_metrics_classification_noCST.txt')
my.cst.accuracies <- data.frame(cbind(my.heart.cst$accuracy,
my.liver.cst$accuracy,
my.cereb.cst$accuracy,
my.ob.cst$accuracy))
rownames(my.cst.accuracies) <- rownames(my.ob.cst)
colnames(my.cst.accuracies) <- paste(rownames(my.cst.accuracies),"trained_model",sep="_")
my.random <- rep(0.5,4)
my.peGBMect <- rep(1,4)
my.cst.accuracies.all <- rbind(my.cst.accuracies,my.random,my.peGBMect)
rownames(my.cst.accuracies.all)[5:6] <- c("random accuracy","perfect accuracy")
# plot combined accuracy heatmaps
pdf(paste(Sys.Date(),"_cross_tissue_GBM_accuracies_noCST_heatmap.pdf", sep="_"), onefile=F)
pheatmap(my.cst.accuracies.all, cluster_rows = F, cluster_cols = F,
col = colorRampPalette(my.accuracy.colors)(50),
main = "2-class classification (no sampling)")
dev.off()
