tissue_of_interest = "Liver"
library(here)
source("/restricted/projectnb/waxmanlab/kkarri/scRNAseq_data_integration/boilerplate.R")
#tiss = load_tissue_droplet(tissue_of_interest)
#library(scater)
library(dplyr)
library(Seurat)
library(cowplot)
#library(MAST)

load('/net/waxman-server/mnt/data/waxmanlabvm_home/kkarri/G185/G185M3M4_subhep_SCT_PC30_res0.2_GB.Rdata')
load('/net/waxman-server/mnt/data/waxmanlabvm_home/kkarri/G185/G185M3M4_subhep_SCT_PC10_res0.2_GB.Rdata')

ctrl_aggr29_subhep_p1.1 <- DimPlot(ctrl_aggr29_subhep, label=TRUE)
DefaultAssay(ctrl_aggr29_subhep) <- "RNA"
ctrl_aggr29_subhep <- NormalizeData(ctrl_aggr29_subhep)

#ctrl_aggr29_subhep_Diff321.0 <- FindMarkers(ctrl_aggr29_subhep, ident.1 = c('3','2','1'),ident.2 = '0', logfc.threshold = 0, min.pct = 0 )
ctrl_aggr29_subhep_Diff32.1 <- FindMarkers(ctrl_aggr29_subhep, ident.1 = c('3','2'),ident.2 = '1', logfc.threshold = 0, min.pct = 0 )
ctrl_aggr29_subhep_Diff2.1 <- FindMarkers(ctrl_aggr29_subhep, ident.1 = c('2'),ident.2 = '1', logfc.threshold = 0, min.pct = 0 )
ctrl_aggr29_subhep_Diff3.1 <- FindMarkers(ctrl_aggr29_subhep, ident.1 = c('3'),ident.2 = '1', logfc.threshold = 0, min.pct = 0 )
ctrl_aggr29_subhep_Diff2.3 <- FindMarkers(ctrl_aggr29_subhep, ident.1 = c('2'),ident.2 = '3', logfc.threshold = 0, min.pct = 0 )
ctrl_aggr29_subhep_AllMarkers <- FindAllMarkers(ctrl_aggr29_subhep,logfc.threshold = 0, min.pct = 0 )

#write.table(ctrl_aggr29_subhep_Diff321.0,'/net/waxman-server/mnt/data/waxmanlabvm_home/kkarri/G185/G185M3M4_subhep_Diff321.0', sep='\t')
write.table(ctrl_aggr29_subhep_Diff32.1,'/net/waxman-server/mnt/data/waxmanlabvm_home/kkarri/G185/G18M3M4_subhep_Diff32.1', sep='\t')
write.table(ctrl_aggr29_subhep_Diff2.1,'/net/waxman-server/mnt/data/waxmanlabvm_home/kkarri/G185/G185M3M4_subhep_Diff2.1', sep='\t')
write.table(ctrl_aggr29_subhep_Diff3.1,'/net/waxman-server/mnt/data/waxmanlabvm_home/kkarri/G185/G185M3M4_subhep_Diff3.1', sep='\t')
write.table(ctrl_aggr29_subhep_Diff2.3,'/net/waxman-server/mnt/data/waxmanlabvm_home/kkarri/G185/G185M3M4_subhep_Diff2.3', sep='\t')
write.table(ctrl_aggr29_subhep_AllMarkers,'/net/waxman-server/mnt/data/waxmanlabvm_home/kkarri/G185/G184M3M4_subhep_AllMarkers', sep='\t')
