Synapse tables with data

For this data we are using the JHU biobank data that we’ve analyzed previously as part of a larger cohort: - Patient Table - RNA-Seq Table (actually we don’t use this, only the transformed data below:)

We also have Immune Data - Tumor Deconvolution Table

Let’s see if there are any correlations between immune populations and tumor growth.

pat.tab<-synapser::synTableQuery("SELECT Patient_ID as individualID,Dermal_Neurofibromas,Plexiform_Neurofibromas,MPNST FROM syn18634454")$asDataFrame()%>%
  select(-c(ROW_ID,ROW_VERSION))
## 
 [####################]100.00%   1/1   Done...    
Downloading  [####################]100.00%   1.3kB/1.3kB (683.0kB/s) Job-98494836683927076661479633.csv Done...
pat.samps<-synTableQuery('select distinct specimenID,individualID from syn20812185')$asDataFrame()
## 
 [####################]100.00%   1/1   Done...    
Downloading  [####################]100.00%   994.0bytes/994.0bytes (1.4MB/s) Job-98494847719605489258404191.csv Done...
imm.tab<-synapser::synTableQuery("SELECT * FROM syn20710536")$asDataFrame()%>%
  select(-c(ROW_ID,ROW_VERSION))%>%left_join(pat.samps,by='specimenID')
## 
Create CSV FileHandle [##########----------]51.08%   7008/13720       
Create CSV FileHandle [####################]100.00%   13720/13720   Done...    
Downloading  [####################]100.00%   1.1MB/1.1MB (1.6MB/s) Job-98494855749542581041952262.csv Done...
tab<-pat.tab%>%left_join(imm.tab,by='individualID')

tab%>%select(individualID,Plexiform_Neurofibromas,MPNST,specimenID,tumorType)%>%distinct()%>%DT::datatable()

Compare patients

First let’s look at pNF immune scores bracketed by whether or not patient has pNFs

tab%>%subset(tumorType=='Plexiform Neurofibroma')%>%
  subset(method!='xcell')%>%
  ggplot()+geom_boxplot(aes(x=cell_type,y=score,fill=MPNST))+scale_y_log10()+ theme(axis.text.x = element_text(angle = 90, hjust = 1))+facet_grid(.~method)

Interesting! Some cell types look different. Let’s try the converse.

tab%>%subset(tumorType=='Plexiform Neurofibroma')%>%
  subset(method!='xcell')%>%
  ggplot()+geom_boxplot(aes(x=cell_type,y=score,fill=`Dermal_Neurofibromas`))+scale_y_log10()+ theme(axis.text.x = element_text(angle = 90, hjust = 1))+facet_grid(.~method)

tab%>%subset(tumorType=='Malignant Peripheral Nerve Sheath Tumor')%>%
  subset(method!='xcell')%>%
  ggplot()+geom_boxplot(aes(x=cell_type,y=score,fill=Plexiform_Neurofibromas))+scale_y_log10()+ theme(axis.text.x = element_text(angle = 90, hjust = 1))+facet_grid(.~method)

Significance tests

For each tumor type, evaluate the significance in differences with/without MPNST development.

mpnst.res<-tab%>%
  subset(tumorType=='Plexiform Neurofibroma')%>%
  spread(key=MPNST,value=score)%>%
  group_by(method,cell_type)%>%
  mutate(pval=t.test(Present,Absent)$p.value)%>%
  select(method,cell_type,pval)%>%distinct()%>%
  ungroup()%>%
  mutate(correctedP=p.adjust(pval))

mpnst.res%>%arrange(pval)
## # A tibble: 49 x 4
##    method      cell_type             pval correctedP
##    <chr>       <chr>                <dbl>      <dbl>
##  1 mcp_counter T cell CD8+         0.0292          1
##  2 cibersort   Macrophage M1       0.0975          1
##  3 xcell       Macrophage M1       0.138           1
##  4 xcell       Macrophage M2       0.149           1
##  5 cibersort   Monocyte            0.167           1
##  6 xcell       Macrophage          0.171           1
##  7 mcp_counter Macrophage/Monocyte 0.197           1
##  8 mcp_counter Monocyte            0.197           1
##  9 cibersort   NK cell activated   0.217           1
## 10 mcp_counter T cell              0.221           1
## # … with 39 more rows

Not very much is significant, but we can try to plot those for further analysis/research.

toplot<-subset(mpnst.res,pval<0.1)

subset(tab,tumorType=='Plexiform Neurofibroma')%>%
  subset(method%in%toplot$method)%>%
  subset(cell_type%in%toplot$cell_type)%>%
  ggplot(aes(x=cell_type,y=score,col=MPNST))+
    geom_boxplot(outlier.shape=NA)+
    geom_point(position=position_jitterdodge())+
  facet_grid(.~method)+scale_y_log10()

Because this is only five patients we are limited. What if we look at neurofibromas as well?

Neurofibromas OR Plexiform Neurofibromas

Here we group neurofibromas with pNFs to see if we get the same result

nf.res<-tab%>%
  subset(tumorType%in%c('Plexiform Neurofibroma','Neurofibroma'))%>%
  spread(key=MPNST,value=score)%>%
  group_by(method,cell_type)%>%
  mutate(pval=t.test(Present,Absent)$p.value)%>%
  select(method,cell_type,pval)%>%distinct()%>%
  ungroup()%>%
  mutate(correctedP=p.adjust(pval))

nf.res%>%arrange(pval)
## # A tibble: 49 x 4
##    method      cell_type                        pval correctedP
##    <chr>       <chr>                           <dbl>      <dbl>
##  1 cibersort   Macrophage M1            0.0000000375 0.00000169
##  2 cibersort   Monocyte                 0.00294      0.129     
##  3 cibersort   T cell follicular helper 0.00610      0.262     
##  4 cibersort   NK cell activated        0.0190       0.798     
##  5 cibersort   Dendritic cell activated 0.0523       1         
##  6 cibersort   Mast cell activated      0.0532       1         
##  7 mcp_counter Macrophage/Monocyte      0.0725       1         
##  8 mcp_counter Monocyte                 0.0725       1         
##  9 cibersort   Eosinophil               0.158        1         
## 10 xcell       T cell CD8+              0.173        1         
## # … with 39 more rows
toplot<-subset(nf.res,pval<0.1)

for(method in c('cibersort','mcp_counter')){
 
   nplot<-toplot[which(toplot$method==method),]##subset fails here,
  
  p<-tab%>%subset(tumorType%in%c('Plexiform Neurofibroma','Neurofibroma'))%>%
  subset(method==method)%>%
  subset(cell_type%in%nplot$cell_type)%>%
  ggplot(aes(x=cell_type,y=score,col=MPNST))+
    geom_boxplot(outlier.shape=NA)+
    geom_point(position=position_jitterdodge(),aes(shape=tumorType,group=MPNST))+
    theme(axis.text.x = element_text(angle = 90, hjust = 1))+
    ggtitle(method)
  if(method=='cibersort')
    p<-p+scale_y_log10()
  print(p)
}

Next steps

We should look into the information about this, I’m not sure if it’s prognostic or not.