Skip to content

Commit

Permalink
Merge pull request #15 from PNNL-CompBio/matrisome-updates
Browse files Browse the repository at this point in the history
Matrisome updates
  • Loading branch information
sgosline authored Jul 14, 2023
2 parents 51c4e8b + 35ae121 commit 26a4347
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 9 deletions.
28 changes: 21 additions & 7 deletions fig4ab_plotGeneExpression.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ bannotes<-bannotes[pat2,]
mat<-mat[,pat2]


pheatmap(cor(mat,method='spearman'),
pheatmap(cor(mat,method='pearson'),
annotation_col = bannotes,#%>%
annotation_row= bannotes,#%>%
clustering_distance_rows = 'correlation',
Expand Down Expand Up @@ -79,18 +79,32 @@ p2<-restab%>%as.data.frame()%>%tibble::rownames_to_column('cNF Sample')%>%
left_join(cnfs)%>%
dplyr::mutate(`Biobank Patient`=stringr::str_replace_all(patient,'tumor[0-9]*',''))%>%
dplyr::mutate(`Biobank Patient`=stringr::str_replace_all(`Biobank Patient`,'patient','Patient '))%>%
dplyr::mutate(`Biobank Patient`=factor(`Biobank Patient`,levels=rev(c('Patient 1','Patient 2','Patient 3','Patient 4','Patient 5','Patient 6',
'Patient 8','Patient 9','Patient 10','Patient 11','Patient 13'))))
dplyr::mutate(`Biobank Patient`=factor(`Biobank Patient`,levels=c('Patient 1','Patient 2','Patient 3','Patient 4','Patient 5','Patient 6',
'Patient 8','Patient 9','Patient 10','Patient 11','Patient 13')))
p2$Extras=rep("None",nrow(p2))
p2$Extras[which(p2$Media=='Tumor')]<-'Tumor'
p2$Extras[intersect(which(p2$Cytokines=='TRUE'),which(p2$Forskolin=='TRUE'))]<-'F+C'
p2$Extras[intersect(which(p2$Cytokines=='TRUE'),which(p2$Forskolin=='FALSE'))]<-'C only'
p2$Extras[intersect(which(p2$Cytokines=='FALSE'),which(p2$Forskolin=='TRUE'))]<-'F only'

p3<-p2%>%
rowwise()%>%
#dplyr::mutate(extras=ifelse(Media=="Tumor"&&extras=="None","Tumor",extras))%>%
ggplot(aes(x=`Biobank Patient`,y=Similarity,fill=Media))+geom_boxplot(outlier.shape=NA)+
scale_fill_manual(values=media_pal)+
facet_grid(Forskolin+Cytokines~.)
#coord_flip()
facet_grid(Extras~.)+
theme_classic()



p4<-p2%>%
ggplot(aes(x=`Biobank Patient`,y=Similarity,fill=Media))+geom_boxplot(outlier.shape=NA)+
scale_fill_manual(values=media_pal)+
facet_grid(Extras~.)+
scale_y_continuous(limits=c(0.5,1))+
theme_classic()

ggsave('fig4b_organoidCorrelation.pdf',p3,height=12,width=10)
ggsave('fig4b_organoidCorrelation_largerY.pdf',p4,height=12,width=10)

write.csv(p2,file='fig4b_data.csv',row.names=F)

##now let's do the deconvolution
7 changes: 7 additions & 0 deletions fig4cd_tumorDeconv.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ source("orgPlottingFunctions.R")
source("loadExpFromCounts.R")
#source("loadOrganoidData.R")
library(ggplot2)
library(GSVA)


##load up one more annotation file
bannotes[which(bannotes$individualID=='NF0007'),'individualID']<-
sapply(rownames(bannotes[which(bannotes$individualID=='NF0007'),]),function(x)
unlist(stringr::str_split(x,pattern='[ |-][M|D|S]'))[1])

#' runImmuneDeconv
#' @param tab
Expand Down
6 changes: 4 additions & 2 deletions orgPlottingFunctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ pal = c(wesanderson::wes_palette("Chevalier1"),
media_pal = wesanderson::wes_palette('Darjeeling1')[1:4]
names(media_pal)<-c('Mammo','DMEM','StemPro','Tumor')

org_pal = c("#212155","#2B3A8D","#3375B7","#6EC6EA","#CDE8F4")
names(org_pal)<-c("NF0009","NF0012","NF0002","NF0007","NF0008")
org_pal = c("#212155","#2B3A8D","#3375B7","#6EC6EA","#CDE8F4","#6EC6EA","#9EC6EA")
names(org_pal)<-c("NF0009","NF0012","NF0002","NF0007","NF0008","NF0007-4","NF0007-2")



ctf_pal <- c("#27194D","#453286","#5D509D","#7165A9","#938ABE","#BFB7D9","#D1B4D3",
"#BF8CBA","#AE5E9F","#873180","#572455")
Expand Down

0 comments on commit 26a4347

Please sign in to comment.