Synapse tables with data

We have two tables on synapse that have cNF patient data in them - Patient Table - Sample Table

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,Race,Gender,Age,Pain,Itching FROM syn7342635")$asDataFrame()%>%
  select(-c(ROW_ID,ROW_VERSION))
## 
 [####################]100.00%   1/1   Done...    
Downloading  [####################]100.00%   616.0bytes/616.0bytes (161.5kB/s) Job-98309147915215270017646377.csv Done...
samp.tab<-synapser::synTableQuery("SELECT Patient,TumorNumber,Length_in_mm FROM syn5556216")$asDataFrame()%>%
  select(-c(ROW_ID,ROW_VERSION))
## 
 [####################]100.00%   1/1   Done...    
Downloading  [####################]100.00%   1.4kB/1.4kB (2.2MB/s) Job-98309152569397727354925106.csv Done...

Merge data together

For the purposes of this analysis we want to have just the age, sex, tumor size and and ‘reformed’ patient name

full.tab<-samp.tab%>%left_join(pat.tab,by='Patient')%>%
  mutate(specimenID=paste0('patient',Patient,'tumor',TumorNumber))
DT::datatable(full.tab)

Now we can get the immune data!

Collect Immune Data

Now we can download the imune data and evaluate any correlations betwen scores and tumor size

imm.data<-synTableQuery("SELECT * FROM syn20710536 where tumorType='Cutaneous Neurofibroma'")$asDataFrame()
## 
 [####################]100.00%   1/1   Done...    
Downloading  [####################]100.00%   265.4kB/265.4kB (625.6kB/s) Job-98309164243089157346811320.csv Done...
data.with.var<-imm.data%>%left_join(full.tab,by='specimenID')

#now coampute the correlation with size for each transcript...?
tum.cors=data.with.var%>%group_by(method,cell_type)%>%
  mutate(corVal=cor(score,Length_in_mm))%>%
  arrange(desc(abs(corVal)))%>%
  select(cell_type,method,corVal)%>%distinct()

DT::datatable(tum.cors)

So this is interesting - not all cell types are associated with tumor growth, specifically Mast cells are not. NK cells, macrophages, B cells - they are. Yes the correlation values are as high as we’d like, but it’s a start.

cs.cells=subset(tum.cors,abs(corVal)>0.35)%>%
    subset(method=='cibersort')%>%ungroup()%>%
    select(cell_type)%>%unlist()

subset(data.with.var,method=='cibersort')%>%
    subset(cell_type%in%cs.cells)%>%
    ggplot()+geom_point(aes(x=score,y=Length_in_mm,col=sex))+facet_grid(cell_type~.)

mc.cells=subset(tum.cors,abs(corVal)>0.35)%>%
    subset(method=='mcp_counter')%>%ungroup()%>%
    select(cell_type)%>%unlist()

subset(data.with.var,method=='mcp_counter')%>%
    subset(cell_type%in%mc.cells)%>%
    ggplot()+geom_point(aes(x=score,y=Length_in_mm,col=sex))+facet_grid(cell_type~.)

So it seems like the dendritic cells, monocytes, and macrophages seem to have a weak role in tumor growth.

Any correlation with itching

Perhaps itching is driving this?

subset(data.with.var,method=='cibersort')%>%
    subset(cell_type%in%cs.cells)%>%
    ggplot()+geom_point(aes(x=score,y=Length_in_mm,col=Itching))+facet_grid(cell_type~.)

subset(data.with.var,method=='mcp_counter')%>%
    subset(cell_type%in%mc.cells)%>%
    ggplot()+geom_point(aes(x=score,y=Length_in_mm,col=Itching))+facet_grid(cell_type~.)

Doesn’t seem to be. But we can do a test to see if Itching is correlated

data.with.var%>%select(Pain,Itching)%>%distinct()
##    Pain Itching
## 1 FALSE   FALSE
## 2  TRUE    TRUE
## 3 FALSE    TRUE
#it seems patients who have pain also have itching, so will only evaluate itching
sig.vals<-data.with.var%>%
  spread(key=Itching,value=score)%>%
  group_by(method,cell_type)%>%
  mutate(pval=wilcox.test(`TRUE`,`FALSE`)$p.value)%>%
  select(method,cell_type,pval)%>%distinct()%>%
  ungroup()

#there are some?!
DT::datatable(subset(sig.vals,pval<0.05))
subset(data.with.var,method=='mcp_counter')%>%
  subset(cell_type%in%subset(sig.vals,pval<0.05)$cell_type)%>%
  ggplot()+geom_boxplot(aes(x=cell_type,y=score,fill=Itching))+scale_y_log10()

Last thing to check is that if the Itching phenotype is correlated with the growth.

Next steps

Not sure what else we can do with these. Some ideas:

  • Look to see if these cell types are up-regulated in pNFs that become MPNSTs
  • Look to see if these cell types are different between pNFs and MPNSTs