Introduction

Let’s QC this data.

suppressPackageStartupMessages({
  library("gplots")
  library("reshape2")
  library("WGCNA")
  library("dplyr")
  library("DESeq2")
  library("mitch")
  library("MASS")
  library("eulerr")
  library("beeswarm")
})

Multi-qc results

Please have a look at the multiQC report. Here are a few key points:

  • Skewer trimming resulted in loss of only a tiny number of bases. This indicates the sequence quality is very high.

  • Fastqc results showing the number of unique and duplicate reads indicates a few samples with <10M unique reads.

  • Per seqence GC content showed an unusual profile for two samples. PG1423-EOS R1 and R2 had GC profile max at 40% compared to the mean. PG2090-EOS also showed an unusual pattern with underrepresented low GC%.

  • Sequence duplication levels were elevated for some fastq files. Here are the files of concern, with <20% unique reads: PG3627-POD1_S86_R1_001 PG3627-POD1_S86_R2_001 PG3609-T0_S317_R1_001 PG2090-EOS_S134_R1_001 PG2090-EOS_S134_R2_001

  • There were two files with overrepresented sequences: PG2090-EOS R1 and R2. Others are okay.

  • Adapter content was very low which is good.

The fastq files were also checked with validatefastq-assembly which looks for signs of file corruption which can occur in large data transfers. No problematic files were detected.

rRNA amount

Ribosomal RNA carryover can be a source of noise. The proportion should be <10% and there were a few samples in excess of this including PG2020-EOS, PG815-EOS, PG1452-EOS and PG702-POD1.

rrna <- read.table("rrna_stats.txt")
rrna <- rrna[,c(1,5)]
rrna$V1 <- sapply(strsplit(rrna$V1,"\\."),"[[",1)
rrna$V5 <- gsub("\\(","",rrna$V5)
rrna$V5 <- gsub("%","",rrna$V5)
rrna$V5 <- as.numeric(rrna$V5)
str(rrna)
## 'data.frame':    319 obs. of  2 variables:
##  $ V1: chr  "3166-POD1_S266_R1_001" "3166-T0_S265_R1_001" "3167-POD1_S268_R1_001" "3167-T0_S267_R1_001" ...
##  $ V5: num  0.57 1.11 0.61 0.93 0.96 0.79 0.7 5.2 1.14 2.83 ...
rrna2 <- rrna[,2]
names(rrna2) <- rrna[,1]

par(mar=c(5,8,3,1))
barplot(rrna2,horiz=TRUE,las=1,cex.names=0.5,main="rRNA carryover")

rrna2 <- rrna2[order(-rrna2)]
barplot(head(rrna2,20),horiz=TRUE,las=1,cex.names=0.6,main="rRNA carryover")

Load the data

tmp <- read.table("3col.tsv.gz",header=FALSE)
x <- as.matrix(acast(tmp, V2~V1, value.var="V3", fun.aggregate = sum))
x <- as.data.frame(x)
accession <- sapply((strsplit(rownames(x),"\\|")),"[[",2)
symbol<-sapply((strsplit(rownames(x),"\\|")),"[[",6)
x$geneid <- paste(accession,symbol)
xx <- aggregate(. ~ geneid,x,sum)
rownames(xx) <- xx$geneid
colnames <- gsub("T0R","T0",colnames(xx))
xx$geneid = NULL
xx <- round(xx)
xx[1:10,1:6]
##                             3166-POD1 3166-T0 3167-POD1 3167-T0 3171-POD1
## ENSG00000000003.15 TSPAN6           3       1         5       5        23
## ENSG00000000005.6 TNMD              0       0         0       0         0
## ENSG00000000419.14 DPM1           685     577       521     735       811
## ENSG00000000457.14 SCYL3          622     611       550     777       789
## ENSG00000000460.17 C1orf112       181     171       232     263       215
## ENSG00000000938.13 FGR          33797   44344     31524   38959     26402
## ENSG00000000971.16 CFH            106      40        98     183       195
## ENSG00000001036.14 FUCA2         1229     769      1150     868       978
## ENSG00000001084.13 GCLC           944    1085       577     961       908
## ENSG00000001167.15 NFYA          1243    1277      1295    1605      1166
##                             3171-T0
## ENSG00000000003.15 TSPAN6         4
## ENSG00000000005.6 TNMD            1
## ENSG00000000419.14 DPM1         494
## ENSG00000000457.14 SCYL3        575
## ENSG00000000460.17 C1orf112     196
## ENSG00000000938.13 FGR        33751
## ENSG00000000971.16 CFH          130
## ENSG00000001036.14 FUCA2        805
## ENSG00000001084.13 GCLC         798
## ENSG00000001167.15 NFYA        1251
saveRDS(xx,"paddi_genecounts.Rds")

Number of reads per sample

Let’s look at the number of reads per sample

Most samples were in the range of 25-30 million assigned reads. Just 2 samples had less than 20 million reads: PG1452-EOS and PG1423-EOS. The maximum read count was about 40 million for PG7072-EOS.

xxcs <- colSums(xx)
par(mar=c(5,8,3,1))
barplot(xxcs,horiz=TRUE,las=1,main="no. reads per sample")

barplot(head(xxcs[order(xxcs)],20),horiz=TRUE,las=1,main="lowest no. reads per sample")

barplot(head(xxcs[order(-xxcs)],20),horiz=TRUE,las=1,main="highest no. reads per sample")

MDS

Some outliers are apparent.

PG2090-EOS to the left of the chart - this is clearly the effect of rRNA carryover. Other samples over to the left of the chart include PG815-EOS, PG145-EOS and PG702-POD1 which all have elevated rRNA.

heatmap.2( cor(xx),trace="none",scale="none")

mds <- cmdscale(dist(t(xx)))

par(mar=c(5,5,3,1))
minx <- min(mds[,1])
maxx <- max(mds[,1])
miny <- min(mds[,2])
maxy <- max(mds[,2])

plot(mds, xlab="Coordinate 1", ylab="Coordinate 2",
  xlim=c(minx*1.1,maxx*1.1), ylim = c(miny*1.1,maxy*1.1) ,
  type = "p", col="gray", pch=19, cex.axis=1.3,cex.lab=1.3, bty='n')
text(mds, labels=rownames(mds), cex=0.8)

col <- rownames(mds)
col <- sapply(strsplit(col,"-"),"[[",2)
col <- gsub("T0","lightblue",col)
col <- gsub("POD1","orange",col)
col <- gsub("EOS","pink",col)

plot(mds, xlab="Coordinate 1", ylab="Coordinate 2",
  xlim=c(minx*1.1,maxx*1.1), ylim = c(miny*1.1,maxy*1.1) , cex=1.5 ,
  type = "p", col=col, pch=19, cex.axis=1.3,cex.lab=1.3, bty='n')
#text(mds, labels=rownames(mds), cex=0.8) 
mtext("blue=T0, orange=POD1, pink=EOS")

Exclude PG2090-EOS and repeat the analysis.

xx <- xx[,grep("PG2090-EOS",colnames(xx),invert=TRUE)]

mds <- cmdscale(dist(t(xx)))

par(mar=c(5,5,3,1))
minx <- min(mds[,1])
maxx <- max(mds[,1])
miny <- min(mds[,2])
maxy <- max(mds[,2])

plot(mds, xlab="Coordinate 1", ylab="Coordinate 2",
  xlim=c(minx*1.1,maxx*1.1), ylim = c(miny*1.1,maxy*1.1) ,
  type = "p", col="gray", pch=19, cex.axis=1.3,cex.lab=1.3, bty='n')
text(mds, labels=rownames(mds), cex=0.8)

col <- rownames(mds)
col <- sapply(strsplit(col,"-"),"[[",2)
col <- gsub("T0","lightblue",col)
col <- gsub("POD1","orange",col)
col <- gsub("EOS","pink",col)

plot(mds, xlab="Coordinate 1", ylab="Coordinate 2",
  xlim=c(minx*1.1,maxx*1.1), ylim = c(miny*1.1,maxy*1.1) , cex=1.5 ,
  type = "p", col=col, pch=19, cex.axis=1.3,cex.lab=1.3, bty='n')
#text(mds, labels=rownames(mds), cex=0.8) 
mtext("blue=T0, orange=POD1, pink=EOS")

In the MDS plot with PG2090-EOS removed, there appears to be some separation of T0, POD1 and EOS samples. POD1 (orange) are more towards the upper side of the chart and T0 (blue) are toward the bottom right. EOS (pink) are quite spread out.

Conclusion

PG2090-EOS suffered rRNA carryover and needs to be re-prepared. The other samples with slightly higher rRNA are not a problem as the rRNA can be corrected for statistically. not sure what to do about samples with low numbers of unique reads.

Load patient info

xx <- xx[,order(colnames(xx))]

ss <- read.csv("PADDIgenomicsData.csv")
ss <- ss[order(ss$PG_number),]
colnames(ss)
##  [1] "PG_number"                        "sexD"                            
##  [3] "ageD"                             "weightD"                         
##  [5] "heightD"                          "asaD"                            
##  [7] "ethnicityD"                       "ethnicity_otherD"                
##  [9] "current_smokerD"                  "diabetes_typeD"                  
## [11] "daily_insulinD"                   "oral_hypoglycemicsD"             
## [13] "non_insulin_injectablesD"         "diabetes_yrs_since_diagnosisD"   
## [15] "DM_years"                         "creatinine_preopD"               
## [17] "crp_preopD"                       "crp_preop_typeD"                 
## [19] "crp_preop_naD"                    "hba1c_doneD"                     
## [21] "surgery_typeD"                    "surgery_procedureD"              
## [23] "surgery_dominantD"                "wound_typeOP"                    
## [25] "non_study_dexameth_steriodPOSTOP" "nonstudy_dexameth_steriodD3"     
## [27] "HbA1c"                            "bmi"                             
## [29] "whodas_total_preop"               "revised_whodas_preop"            
## [31] "neut_lymph_ratio_d0"              "neut_lymph_ratio_d1"             
## [33] "neut_lymph_ratio_change_d1"       "neut_lymph_ratio_d2"             
## [35] "neut_lymph_ratio_change_d2"       "neut_lymph_ratio_d1_2"           
## [37] "neut_lymph_ratio_d2_2"            "ab_noninfection"                 
## [39] "risk"                             "risk_cat"                        
## [41] "bmi_cat"                          "asa_cat"                         
## [43] "wound_type_cat"                   "oxygen_quin"                     
## [45] "duration_sx"                      "duration_sx_quin"                
## [47] "anyDex"                           "anyDex_count"                    
## [49] "anyDexMiss"                       "anyDex2"                         
## [51] "treatment_group"                  "deltacrp"                        
## [53] "crp_group"
str(ss)
## 'data.frame':    117 obs. of  53 variables:
##  $ PG_number                       : chr  "3166" "3167" "3171" "3172" ...
##  $ sexD                            : chr  "Male" "Male" "Male" "Male" ...
##  $ ageD                            : int  62 67 61 78 73 77 84 54 70 62 ...
##  $ weightD                         : num  64.5 78.8 71.1 43 83.6 ...
##  $ heightD                         : num  163 169 165 156 171 167 133 155 170 175 ...
##  $ asaD                            : int  2 2 2 2 2 3 3 2 2 2 ...
##  $ ethnicityD                      : chr  "Asian" "Asian" "Asian" "Asian" ...
##  $ ethnicity_otherD                : chr  "" "" "" "" ...
##  $ current_smokerD                 : chr  "No" "No" "No" "No" ...
##  $ diabetes_typeD                  : chr  "" "" "" "" ...
##  $ daily_insulinD                  : chr  "" "" "" "" ...
##  $ oral_hypoglycemicsD             : chr  "" "" "" "" ...
##  $ non_insulin_injectablesD        : chr  "" "" "" "" ...
##  $ diabetes_yrs_since_diagnosisD   : int  NA NA NA NA NA 1 NA NA NA NA ...
##  $ DM_years                        : int  NA NA NA NA NA 1 NA NA NA NA ...
##  $ creatinine_preopD               : int  68 82 82 96 105 90 54 47 109 98 ...
##  $ crp_preopD                      : chr  "2.1" "0.6" "2.7" "1.2" ...
##  $ crp_preop_typeD                 : chr  "CRP" "CRP" "CRP" "CRP" ...
##  $ crp_preop_naD                   : int  0 0 0 0 0 0 0 0 0 0 ...
##  $ hba1c_doneD                     : chr  "Yes" "Yes" "Yes" "Yes" ...
##  $ surgery_typeD                   : chr  "Laparoscopic assisted low anterior resection of rectum" "Laparoscopic sigmoidectomy" "Laparoscopic assisted anterior resection of rectum" "Robotic assisted laparoscopic radical prostatectomy, pelvic lymph node dissection" ...
##  $ surgery_procedureD              : chr  "None of the above" "None of the above" "None of the above" "None of the above" ...
##  $ surgery_dominantD               : chr  "Gastrointestinal" "Gastrointestinal" "Gastrointestinal" "Urology-renal" ...
##  $ wound_typeOP                    : chr  "Clean / contaminated" "Clean / contaminated" "Clean / contaminated" "Clean / contaminated" ...
##  $ non_study_dexameth_steriodPOSTOP: chr  "No" "No" "No" "No" ...
##  $ nonstudy_dexameth_steriodD3     : chr  "No" "No" "No" "No" ...
##  $ HbA1c                           : num  5.7 6.2 6.2 6.3 6.3 ...
##  $ bmi                             : num  24.3 27.6 26.1 17.7 28.6 ...
##  $ whodas_total_preop              : int  16 12 12 12 12 12 24 14 12 12 ...
##  $ revised_whodas_preop            : int  16 12 12 12 12 12 24 14 12 12 ...
##  $ neut_lymph_ratio_d0             : num  4.3 2.94 2.29 2.93 2.62 ...
##  $ neut_lymph_ratio_d1             : num  13 6.5 7.22 23.2 8.57 ...
##  $ neut_lymph_ratio_change_d1      : num  8.7 3.56 4.93 20.27 5.95 ...
##  $ neut_lymph_ratio_d2             : num  5.92 3.68 3.77 22 NA ...
##  $ neut_lymph_ratio_change_d2      : num  1.623 0.741 1.475 19.071 NA ...
##  $ neut_lymph_ratio_d1_2           : num  13 6.5 7.22 23.2 8.57 ...
##  $ neut_lymph_ratio_d2_2           : num  5.92 3.68 3.77 22 NA ...
##  $ ab_noninfection                 : int  1 1 0 1 1 1 1 1 1 1 ...
##  $ risk                            : int  2 2 2 2 2 5 4 1 2 1 ...
##  $ risk_cat                        : chr  "Moderate" "Moderate" "Moderate" "Moderate" ...
##  $ bmi_cat                         : chr  "Normal [18.5 to <25]" "Overweight [25 to <30]" "Overweight [25 to <30]" "Underweight [BMI<18.5]" ...
##  $ asa_cat                         : chr  "1-2" "1-2" "1-2" "1-2" ...
##  $ wound_type_cat                  : chr  "Contaminated" "Contaminated" "Contaminated" "Contaminated" ...
##  $ oxygen_quin                     : chr  "0.21-0.4" "0.21-0.4" "0.21-0.4" "0.21-0.4" ...
##  $ duration_sx                     : num  2.5 2.67 2.42 3.17 2.5 ...
##  $ duration_sx_quin                : chr  "2.18-2.82" "2.18-2.82" "2.18-2.82" "2.83-3.75" ...
##  $ anyDex                          : chr  "No" "No" "No" "No" ...
##  $ anyDex_count                    : int  0 0 0 0 0 0 0 0 0 0 ...
##  $ anyDexMiss                      : int  0 0 0 0 0 0 0 0 0 0 ...
##  $ anyDex2                         : int  0 0 0 0 0 0 0 0 0 0 ...
##  $ treatment_group                 : int  1 1 2 2 1 1 2 1 2 1 ...
##  $ deltacrp                        : num  39.3 38.3 49 189.9 7.3 ...
##  $ crp_group                       : int  1 1 1 4 1 1 4 1 4 1 ...
summary(ss)
##   PG_number             sexD                ageD          weightD      
##  Length:117         Length:117         Min.   :25.00   Min.   : 41.00  
##  Class :character   Class :character   1st Qu.:54.00   1st Qu.: 68.50  
##  Mode  :character   Mode  :character   Median :62.00   Median : 82.00  
##                                        Mean   :61.03   Mean   : 84.55  
##                                        3rd Qu.:69.00   3rd Qu.: 95.40  
##                                        Max.   :86.00   Max.   :185.00  
##                                                                        
##     heightD           asaD        ethnicityD        ethnicity_otherD  
##  Min.   :133.0   Min.   :1.000   Length:117         Length:117        
##  1st Qu.:163.0   1st Qu.:2.000   Class :character   Class :character  
##  Median :171.0   Median :2.000   Mode  :character   Mode  :character  
##  Mean   :170.2   Mean   :2.308                                        
##  3rd Qu.:178.0   3rd Qu.:3.000                                        
##  Max.   :193.0   Max.   :4.000                                        
##                                                                       
##  current_smokerD    diabetes_typeD     daily_insulinD     oral_hypoglycemicsD
##  Length:117         Length:117         Length:117         Length:117         
##  Class :character   Class :character   Class :character   Class :character   
##  Mode  :character   Mode  :character   Mode  :character   Mode  :character   
##                                                                              
##                                                                              
##                                                                              
##                                                                              
##  non_insulin_injectablesD diabetes_yrs_since_diagnosisD    DM_years     
##  Length:117               Min.   : 1.000                Min.   : 1.000  
##  Class :character         1st Qu.: 1.500                1st Qu.: 1.500  
##  Mode  :character         Median : 7.000                Median : 7.000  
##                           Mean   : 7.467                Mean   : 7.467  
##                           3rd Qu.:11.000                3rd Qu.:11.000  
##                           Max.   :18.000                Max.   :18.000  
##                           NA's   :102                   NA's   :102     
##  creatinine_preopD  crp_preopD        crp_preop_typeD    crp_preop_naD
##  Min.   : 19.0     Length:117         Length:117         Min.   :0    
##  1st Qu.: 66.0     Class :character   Class :character   1st Qu.:0    
##  Median : 76.0     Mode  :character   Mode  :character   Median :0    
##  Mean   : 80.3                                           Mean   :0    
##  3rd Qu.: 91.0                                           3rd Qu.:0    
##  Max.   :177.0                                           Max.   :0    
##  NA's   :10                                                           
##  hba1c_doneD        surgery_typeD      surgery_procedureD surgery_dominantD 
##  Length:117         Length:117         Length:117         Length:117        
##  Class :character   Class :character   Class :character   Class :character  
##  Mode  :character   Mode  :character   Mode  :character   Mode  :character  
##                                                                             
##                                                                             
##                                                                             
##                                                                             
##  wound_typeOP       non_study_dexameth_steriodPOSTOP
##  Length:117         Length:117                      
##  Class :character   Class :character                
##  Mode  :character   Mode  :character                
##                                                     
##                                                     
##                                                     
##                                                     
##  nonstudy_dexameth_steriodD3     HbA1c             bmi       
##  Length:117                  Min.   : 4.500   Min.   :16.59  
##  Class :character            1st Qu.: 5.200   1st Qu.:24.93  
##  Mode  :character            Median : 5.600   Median :28.07  
##                              Mean   : 5.714   Mean   :29.00  
##                              3rd Qu.: 5.900   3rd Qu.:31.73  
##                              Max.   :10.000   Max.   :72.27  
##                                                              
##  whodas_total_preop revised_whodas_preop neut_lymph_ratio_d0
##  Min.   :12.00      Min.   :12.00        Min.   : 0.5312    
##  1st Qu.:12.00      1st Qu.:12.00        1st Qu.: 1.8254    
##  Median :14.00      Median :14.00        Median : 2.5737    
##  Mean   :16.74      Mean   :16.74        Mean   : 2.8745    
##  3rd Qu.:17.00      3rd Qu.:17.00        3rd Qu.: 3.3338    
##  Max.   :50.00      Max.   :50.00        Max.   :11.0000    
##                                          NA's   :9          
##  neut_lymph_ratio_d1 neut_lymph_ratio_change_d1 neut_lymph_ratio_d2
##  Min.   : 1.375      Min.   :-1.255             Min.   : 0.1235    
##  1st Qu.: 5.132      1st Qu.: 2.610             1st Qu.: 3.7692    
##  Median : 7.353      Median : 4.450             Median : 6.7273    
##  Mean   : 8.882      Mean   : 6.088             Mean   : 8.1589    
##  3rd Qu.:11.627      3rd Qu.: 8.730             3rd Qu.:10.8889    
##  Max.   :44.000      Max.   :39.299             Max.   :25.6042    
##  NA's   :13          NA's   :21                 NA's   :28         
##  neut_lymph_ratio_change_d2 neut_lymph_ratio_d1_2 neut_lymph_ratio_d2_2
##  Min.   :-6.182             Min.   : 1.375        Min.   : 0.1235      
##  1st Qu.: 1.591             1st Qu.: 5.132        1st Qu.: 3.7692      
##  Median : 4.356             Median : 7.353        Median : 6.7273      
##  Mean   : 5.356             Mean   : 8.882        Mean   : 8.1589      
##  3rd Qu.: 7.403             3rd Qu.:11.627        3rd Qu.:10.8889      
##  Max.   :22.776             Max.   :44.000        Max.   :25.6042      
##  NA's   :35                 NA's   :13            NA's   :28           
##  ab_noninfection       risk         risk_cat           bmi_cat         
##  Min.   :0.0000   Min.   :0.000   Length:117         Length:117        
##  1st Qu.:0.0000   1st Qu.:1.000   Class :character   Class :character  
##  Median :0.0000   Median :1.000   Mode  :character   Mode  :character  
##  Mean   :0.4495   Mean   :1.598                                        
##  3rd Qu.:1.0000   3rd Qu.:2.000                                        
##  Max.   :1.0000   Max.   :6.000                                        
##  NA's   :8                                                             
##    asa_cat          wound_type_cat     oxygen_quin         duration_sx     
##  Length:117         Length:117         Length:117         Min.   : 0.6833  
##  Class :character   Class :character   Class :character   1st Qu.: 2.5000  
##  Mode  :character   Mode  :character   Mode  :character   Median : 3.3333  
##                                                           Mean   : 3.9007  
##                                                           3rd Qu.: 4.7667  
##                                                           Max.   :10.6667  
##                                                                            
##  duration_sx_quin      anyDex           anyDex_count      anyDexMiss      
##  Length:117         Length:117         Min.   :0.0000   Min.   :0.000000  
##  Class :character   Class :character   1st Qu.:0.0000   1st Qu.:0.000000  
##  Mode  :character   Mode  :character   Median :0.0000   Median :0.000000  
##                                        Mean   :0.1282   Mean   :0.008547  
##                                        3rd Qu.:0.0000   3rd Qu.:0.000000  
##                                        Max.   :2.0000   Max.   :1.000000  
##                                                                           
##     anyDex2       treatment_group    deltacrp       crp_group    
##  Min.   :0.0000   Min.   :1.000   Min.   :-16.7   Min.   :1.000  
##  1st Qu.:0.0000   1st Qu.:1.000   1st Qu.: 32.9   1st Qu.:1.000  
##  Median :0.0000   Median :2.000   Median : 49.5   Median :1.000  
##  Mean   :0.1111   Mean   :1.556   Mean   :130.9   Mean   :2.487  
##  3rd Qu.:0.0000   3rd Qu.:2.000   3rd Qu.:221.1   3rd Qu.:4.000  
##  Max.   :1.0000   Max.   :2.000   Max.   :359.0   Max.   :4.000  
## 
ss1 <- ss

rownames(ss) <- paste(ss$PG_number,ss$timepoint,sep="-")

dim(ss)
## [1] 117  53
ss$ageCS <- scale(ss$ageD)
ss$sexD <- as.numeric(factor(ss$sexD))
ss$ethnicityCAT <- ss$ethnicityD
ss$ethnicityD <- as.numeric(factor(ss$ethnicityD))
ss$current_smokerD <- as.numeric(factor(ss$current_smokerD))
ss$diabetes_typeD <- as.numeric(factor(ss$diabetes_typeD))
ss$daily_insulinD <- as.numeric(factor(ss$daily_insulinD))
ss$oral_hypoglycemicsD <- as.numeric(factor(ss$oral_hypoglycemicsD))
ss$crp_preopD <- as.numeric(gsub("<5","2.5",gsub("<1","0.5",gsub("<1.0","0.5",ss$crp_preopD))))
ss$surgery_dominantD <- as.numeric(factor(ss$surgery_dominantD))
ss$wound_typeOP <- as.numeric(factor(ss$wound_typeOP))
ss$risk_cat <- as.numeric(factor(ss$risk_cat,levels=c("Low","Moderate","High")))
ss$wound_type_cat <- as.numeric(factor(ss$wound_type_cat))
ss$anyDex <- as.numeric(factor(ss$anyDex))

ss$bmi_cat <- as.numeric(factor(ss$bmi_cat,
  levels=c("Underweight [BMI<18.5]","Normal [18.5 to <25]",
  "Overweight [25 to <30]","Obese [30 to <40]","Super obese [40+]")))

ss <- ss[,c("PG_number","sexD","ageD","ageCS","weightD","asaD","heightD","ethnicityCAT","ethnicityD",
  "current_smokerD","diabetes_typeD","daily_insulinD","creatinine_preopD",
  "surgery_dominantD","wound_typeOP","HbA1c","bmi","revised_whodas_preop",
  "neut_lymph_ratio_d0","neut_lymph_ratio_d1","neut_lymph_ratio_d2","ab_noninfection",
  "risk","risk_cat","bmi_cat","wound_type_cat","duration_sx","anyDex","treatment_group",
  "deltacrp","crp_group")]

ss <- ss[order(rownames(ss)),]

ss_t0 <- ss
ss_eos <- ss
ss_pod1 <- ss

ss_t0$timepoint <- "T0"
ss_eos$timepoint <- "EOS"
ss_pod1$timepoint <- "POD1"

rownames(ss_t0) <- paste(ss_t0$PG_number,"T0",sep="-")
rownames(ss_eos) <- paste(ss_t0$PG_number,"EOS",sep="-")
rownames(ss_pod1) <- paste(ss_t0$PG_number,"POD1",sep="-")

ss <- rbind(ss_t0, ss_eos, ss_pod1)

rownames(ss) <- paste(ss$PG_number,ss$timepoint,sep="-")

xt0 <- xx[,grep("T0",colnames(xx))]
xpod1 <- xx[,grep("POD1",colnames(xx))]
xeos <- xx[,grep("EOS",colnames(xx))]

xt0f <- xt0[rowMeans(xt0)>=10,]
xpod1f <- xpod1[rowMeans(xpod1)>=10,]
xeosf <- xeos[rowMeans(xeos)>=10,]

dim(xt0f)
## [1] 21935   111
dim(xpod1f)
## [1] 21313   109
dim(xeosf)
## [1] 22067    98
ss_t0 <- ss_t0[which(rownames(ss_t0) %in% colnames(xt0)),]
ss_pod1 <- ss_pod1[which(rownames(ss_pod1) %in% colnames(xpod1)),]
ss_eos <- ss_eos[which(rownames(ss_eos) %in% colnames(xeos)),]

colnames(xt0) %in% rownames(ss_t0)
##   [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
##  [16] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
##  [31] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
##  [46] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
##  [61] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
##  [76] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
##  [91] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [106] TRUE TRUE TRUE TRUE TRUE TRUE
colnames(xpod1) %in% rownames(ss_pod1)
##   [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
##  [16] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
##  [31] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
##  [46] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
##  [61] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
##  [76] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
##  [91] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [106] TRUE TRUE TRUE TRUE
colnames(xeos) %in% rownames(ss_eos)
##  [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [16] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [31] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [46] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [61] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [76] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [91] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
rownames(ss_t0) %in% colnames(xt0)
##   [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
##  [16] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
##  [31] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
##  [46] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
##  [61] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
##  [76] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
##  [91] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [106] TRUE TRUE TRUE TRUE TRUE TRUE
rownames(ss_pod1) %in% colnames(xpod1)
##   [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
##  [16] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
##  [31] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
##  [46] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
##  [61] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
##  [76] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
##  [91] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [106] TRUE TRUE TRUE TRUE
rownames(ss_eos) %in% colnames(xeos)
##  [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [16] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [31] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [46] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [61] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [76] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [91] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
xxf <- xx[rowMeans(xx)>=10,]
xxf <- xxf[,order(colnames(xxf))]

PCA Analysis

This is a clinical study and each patient has detailed clinical metadata. Not all of these will be important to the gene expression profiles. Do determine that, we will use PCA analysis of the first 5 PCs to understand which PCs associate with which clinical parameters.

mx <- xt0f
ss2 <- ss_t0
ss2$ethnicityCAT = ss2$ageCS = NULL
ss2$timepoint = ss2$PG_number = NULL

pca <- prcomp(t(mx),center = TRUE, scale = TRUE,retx=TRUE)
loadings = pca$x

par(cex=0.75, mar = c(6, 8.5, 3, 3))

plot(pca,type="lines",col="blue")

nGenes <- nrow(mx)
nSamples <- ncol(mx)
datTraits <- ss2
moduleTraitCor <- cor(loadings[,1:8], datTraits, use = "p")
moduleTraitPvalue <- corPvalueStudent(moduleTraitCor, nSamples)
textMatrix <- paste(signif(moduleTraitCor, 2), "\n(",
  signif(moduleTraitPvalue, 1), ")", sep = "")

dim(textMatrix) = dim(moduleTraitCor)

labeledHeatmap(Matrix = t(moduleTraitCor),
  xLabels = colnames(loadings)[1:ncol(t(moduleTraitCor))],
  yLabels = names(datTraits), colorLabels = FALSE, colors = blueWhiteRed(6),
  textMatrix = t(textMatrix), setStdMargins = FALSE, cex.text = 0.5,
  cex.lab.y = 0.6, zlim = c(-0.45,0.45),
  main = paste("PCA-trait relationships @T0: Top principal components"))

mx <- xeosf
ss2 <- ss_eos
ss2$ethnicityCAT = ss2$ageCS = NULL
ss2$timepoint = ss2$PG_number =NULL

pca <- prcomp(t(mx),center = TRUE, scale = TRUE,retx=TRUE)
loadings = pca$x
plot(pca,type="lines",col="blue")

nGenes <- nrow(mx)
nSamples <- ncol(mx)
datTraits <- ss2
moduleTraitCor <- cor(loadings[,1:8], datTraits, use = "p")
moduleTraitPvalue <- corPvalueStudent(moduleTraitCor, nSamples)
textMatrix <- paste(signif(moduleTraitCor, 2), "\n(",
  signif(moduleTraitPvalue, 1), ")", sep = "")

dim(textMatrix) = dim(moduleTraitCor)

labeledHeatmap(Matrix = t(moduleTraitCor),
  xLabels = colnames(loadings)[1:ncol(t(moduleTraitCor))],
  yLabels = names(datTraits), colorLabels = FALSE, colors = blueWhiteRed(6),
  textMatrix = t(textMatrix), setStdMargins = FALSE, cex.text = 0.5,
  cex.lab.y = 0.6, zlim = c(-0.45,0.45),
  main = paste("PCA-trait relationships @EOS: Top principal components"))
## Warning in numbers2colors(data, signed, colors = colors, lim = zlim, naColor =
## naColor): Some values of 'x' are above given maximum and will be truncated to
## the maximum.

mx <- xpod1f
ss2 <- ss_pod1
ss2$ethnicityCAT = ss2$ageCS = NULL
ss2$timepoint = ss2$PG_number = NULL

pca <- prcomp(t(mx),center = TRUE, scale = TRUE,retx=TRUE)
loadings = pca$x
plot(pca,type="lines",col="blue")

nGenes <- nrow(mx)
nSamples <- ncol(mx)
datTraits <- ss2
moduleTraitCor <- cor(loadings[,1:8], datTraits, use = "p")
moduleTraitPvalue <- corPvalueStudent(moduleTraitCor, nSamples)
textMatrix <- paste(signif(moduleTraitCor, 2), "\n(",
  signif(moduleTraitPvalue, 1), ")", sep = "")

dim(textMatrix) = dim(moduleTraitCor)

labeledHeatmap(Matrix = t(moduleTraitCor),
  xLabels = colnames(loadings)[1:ncol(t(moduleTraitCor))],
  yLabels = names(datTraits), colorLabels = FALSE, colors = blueWhiteRed(6),
  textMatrix = t(textMatrix), setStdMargins = FALSE, cex.text = 0.5,
  cex.lab.y = 0.6, zlim = c(-0.45,0.45),
  main = paste("PCA-trait relationships @POD1: Top principal components"))
## Warning in numbers2colors(data, signed, colors = colors, lim = zlim, naColor =
## naColor): Some values of 'x' are above given maximum and will be truncated to
## the maximum.

Now export PDF.

mx <- xt0f
ss2 <- ss_t0
ss2$ethnicityCAT = ss2$ageCS = NULL
ss2$timepoint = ss2$PG_number = NULL
pca <- prcomp(t(mx),center = TRUE, scale = TRUE,retx=TRUE)
loadings = pca$x

pdf("pca_cor.pdf",height=7,width=7)
par(cex=0.75, mar = c(6, 8.5, 3, 3))

plot(pca,type="lines",col="blue")
nGenes <- nrow(mx)
nSamples <- ncol(mx)
datTraits <- ss2
moduleTraitCor <- cor(loadings[,1:8], datTraits, use = "p")
moduleTraitPvalue <- corPvalueStudent(moduleTraitCor, nSamples)
textMatrix <- paste(signif(moduleTraitCor, 2), "\n(",
  signif(moduleTraitPvalue, 1), ")", sep = "")

dim(textMatrix) = dim(moduleTraitCor)

labeledHeatmap(Matrix = t(moduleTraitCor),
  xLabels = colnames(loadings)[1:ncol(t(moduleTraitCor))],
  yLabels = names(datTraits), colorLabels = FALSE, colors = blueWhiteRed(6),
  textMatrix = t(textMatrix), setStdMargins = FALSE, cex.text = 0.5,
  cex.lab.y = 0.6, zlim = c(-0.45,0.45),
  main = paste("PCA-trait relationships @T0: Top principal components"))

mx <- xeosf
ss2 <- ss_eos
ss2$ethnicityCAT = ss2$ageCS = NULL
ss2$timepoint = ss2$PG_number = NULL
pca <- prcomp(t(mx),center = TRUE, scale = TRUE,retx=TRUE)
loadings = pca$x
plot(pca,type="lines",col="blue")
nGenes <- nrow(mx)
nSamples <- ncol(mx)
datTraits <- ss2
moduleTraitCor <- cor(loadings[,1:8], datTraits, use = "p")
moduleTraitPvalue <- corPvalueStudent(moduleTraitCor, nSamples)
textMatrix <- paste(signif(moduleTraitCor, 2), "\n(",
  signif(moduleTraitPvalue, 1), ")", sep = "")

dim(textMatrix) = dim(moduleTraitCor)

labeledHeatmap(Matrix = t(moduleTraitCor),
  xLabels = colnames(loadings)[1:ncol(t(moduleTraitCor))],
  yLabels = names(datTraits), colorLabels = FALSE, colors = blueWhiteRed(6),
  textMatrix = t(textMatrix), setStdMargins = FALSE, cex.text = 0.5,
  cex.lab.y = 0.6, zlim = c(-0.45,0.45),
  main = paste("PCA-trait relationships @EOS: Top principal components"))
## Warning in numbers2colors(data, signed, colors = colors, lim = zlim, naColor =
## naColor): Some values of 'x' are above given maximum and will be truncated to
## the maximum.
mx <- xpod1f
ss2 <- ss_pod1
ss2$ethnicityCAT = ss2$ageCS = NULL
ss2$timepoint = ss2$PG_number = NULL
pca <- prcomp(t(mx),center = TRUE, scale = TRUE,retx=TRUE)
loadings = pca$x
plot(pca,type="lines",col="blue")
nGenes <- nrow(mx)
nSamples <- ncol(mx)
datTraits <- ss2
moduleTraitCor <- cor(loadings[,1:8], datTraits, use = "p")
moduleTraitPvalue <- corPvalueStudent(moduleTraitCor, nSamples)
textMatrix <- paste(signif(moduleTraitCor, 2), "\n(",
  signif(moduleTraitPvalue, 1), ")", sep = "")

dim(textMatrix) = dim(moduleTraitCor)

labeledHeatmap(Matrix = t(moduleTraitCor),
  xLabels = colnames(loadings)[1:ncol(t(moduleTraitCor))],
  yLabels = names(datTraits), colorLabels = FALSE, colors = blueWhiteRed(6),
  textMatrix = t(textMatrix), setStdMargins = FALSE, cex.text = 0.5,
  cex.lab.y = 0.6, zlim = c(-0.45,0.45),
  main = paste("PCA-trait relationships @POD1: Top principal components"))
## Warning in numbers2colors(data, signed, colors = colors, lim = zlim, naColor =
## naColor): Some values of 'x' are above given maximum and will be truncated to
## the maximum.
dev.off()
## png 
##   2

PCA plots

par(mfrow=c(3,3))

#T0
mx <- xt0f
ss2 <- ss_t0
pca <- prcomp(t(mx),center = TRUE, scale = TRUE,retx=TRUE)
labs=gsub("-T0","",rownames(pca$x))
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
plot(pca$x[,1:2],cex=2,col="gray",pch=19,bty="none", xlim=c(XMIN,XMAX) )
mtext("T0")
text(pca$x[,1:2],labels=labs)
plot(pca$x[,c(1,3)],cex=2,col="gray",pch=19,bty="none", xlim=c(XMIN,XMAX) )
mtext("T0")
text(pca$x[,c(1,3)],labels=labs)
XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col="gray",pch=19,bty="none", xlim=c(XMIN,XMAX) )
mtext("T0")
text(pca$x[,2:3],labels=labs)

#EOS
mx <- xeosf
ss2 <- ss_eos
pca <- prcomp(t(mx),center = TRUE, scale = TRUE,retx=TRUE)
labs=gsub("-EOS","",rownames(pca$x))
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
plot(pca$x[,1:2],cex=2,col="gray",pch=19,bty="none", xlim=c(XMIN,XMAX) )
mtext("EOS")
text(pca$x[,1:2],labels=labs)
plot(pca$x[,c(1,3)],cex=2,col="gray",pch=19,bty="none", xlim=c(XMIN,XMAX) )
mtext("EOS")
text(pca$x[,c(1,3)],labels=labs)
XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col="gray",pch=19,bty="none", xlim=c(XMIN,XMAX) )
mtext("EOS")
text(pca$x[,2:3],labels=labs)

#POD1
mx <- xpod1f
ss2 <- ss_pod1
pca <- prcomp(t(mx),center = TRUE, scale = TRUE,retx=TRUE)
labs=gsub("-POD1","",rownames(pca$x))
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
plot(pca$x[,1:2],cex=2,col="gray",pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs)
mtext("POD1")
plot(pca$x[,c(1,3)],cex=2,col="gray",pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs)
mtext("POD1")
XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col="gray",pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs)
mtext("POD1")

dev.off()
## null device 
##           1
pdf("pca_charts.pdf",width=9,height=9)
par(mfrow=c(3,3))
#T0
mx <- xt0f
ss2 <- ss_t0
pca <- prcomp(t(mx),center = TRUE, scale = TRUE,retx=TRUE)
labs=gsub("-T0","",rownames(pca$x))
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
plot(pca$x[,1:2],cex=2,col="gray",pch=19,bty="none", xlim=c(XMIN,XMAX) )
mtext("T0")
text(pca$x[,1:2],labels=labs)

plot(pca$x[,c(1,3)],cex=2,col="gray",pch=19,bty="none", xlim=c(XMIN,XMAX) )
mtext("T0")
text(pca$x[,c(1,3)],labels=labs)

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col="gray",pch=19,bty="none", xlim=c(XMIN,XMAX) )
mtext("T0")
text(pca$x[,2:3],labels=labs)

#EOS
mx <- xeosf
ss2 <- ss_eos
pca <- prcomp(t(mx),center = TRUE, scale = TRUE,retx=TRUE)
labs=gsub("-EOS","",rownames(pca$x))
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
plot(pca$x[,1:2],cex=2,col="gray",pch=19,bty="none", xlim=c(XMIN,XMAX) )
mtext("EOS")
text(pca$x[,1:2],labels=labs)
plot(pca$x[,c(1,3)],cex=2,col="gray",pch=19,bty="none", xlim=c(XMIN,XMAX) )
mtext("EOS")
text(pca$x[,c(1,3)],labels=labs)
XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col="gray",pch=19,bty="none", xlim=c(XMIN,XMAX) )
mtext("EOS")
text(pca$x[,2:3],labels=labs)

#POD1
mx <- xpod1f
ss2 <- ss_pod1
pca <- prcomp(t(mx),center = TRUE, scale = TRUE,retx=TRUE)
labs=gsub("-POD1","",rownames(pca$x))
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
plot(pca$x[,1:2],cex=2,col="gray",pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs)
mtext("POD1")
plot(pca$x[,c(1,3)],cex=2,col="gray",pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs)
mtext("POD1")
XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col="gray",pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs)
mtext("POD1")

dev.off()
## pdf 
##   2

Specific PCA charts

Specific PCAs for key clinical parameters:

  • wound type
  • surg duration
  • ethnicity
  • age
  • sex
  • treatment group

And ones we didn’t include:

  • bmi
  • asaD
  • smoker
  • diabetes_typeD
  • crp
# wound type clean (1) contaminated (2)

mx <- xt0f
ss2 <- ss_t0
pca <- prcomp(t(mx),center = TRUE, scale = TRUE,retx=TRUE)
labs=gsub("-T0","",rownames(pca$x))
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
cols <- as.character(ss_t0$wound_type_cat)
cols <- gsub("2","red",gsub("1","gray",cols))
plot(pca$x[,1:2],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("T0 - wound type")

plot(pca$x[,c(1,3)],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("T0 - wound type")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("T0 - wound type")

# surg duration
my_palette <- colorRampPalette(c("yellow", "orange", "red"))(n = 10)
decile <- ntile(ss_t0$duration_sx, 10)
mycols <- my_palette[decile]
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
plot(pca$x[,1:2],cex=2,col=mycols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("T0 - surgical duration deciles")

plot(pca$x[,c(1,3)],cex=2,col=mycols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("T0 - surgical duration deciles")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=mycols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("T0 - surgical duration deciles")

# Ethnicity Levels [1-4]: Asian, Maori/Polynesian, Other, White/Caucasian
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
cols <- as.character(ss_t0$ethnicityD)
plot(pca$x[,1:2],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("T0 - ethnicity")

plot(pca$x[,c(1,3)],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("T0 - ethnicity")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("T0 - ethnicity")

# age
my_palette <- colorRampPalette(c("yellow", "orange", "red"))(n = 10)
decile <- ntile(ss_t0$ageD, 10)
mycols <- my_palette[decile]
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
plot(pca$x[,1:2],cex=2,col=mycols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("T0 - age deciles")

plot(pca$x[,c(1,3)],cex=2,col=mycols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("T0 - age deciles")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=mycols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("T0 - age deciles")

# sex female=1 male=2
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
cols <- as.character(ss_t0$sexD)
cols <- gsub("1","pink",gsub("2","lightblue",cols))
plot(pca$x[,1:2],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("T0 - sex: female=pink, male=lightblue")

plot(pca$x[,c(1,3)],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("T0 - sex: female=pink, male=lightblue")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("T0 - sex: female=pink, male=lightblue")

# bmi
my_palette <- colorRampPalette(c("yellow", "orange", "red"))(n = 10)
decile <- ntile(ss_t0$bmi, 10)
mycols <- my_palette[decile]
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
plot(pca$x[,1:2],cex=2,col=mycols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("T0 - BMI deciles")

plot(pca$x[,c(1,3)],cex=2,col=mycols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("T0 - BMI deciles")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=mycols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("T0 - BMI deciles")

# asaD levels 1:4 black,red,green,blue
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
cols <- as.character(ss_t0$asaD)
plot(pca$x[,1:2],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("T0 - asaD")

plot(pca$x[,c(1,3)],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("T0 - asaD")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("T0 - asaD")

# Current smoker no, yes
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
cols <- as.character(ss_t0$current_smokerD)
plot(pca$x[,1:2],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("T0 - current smoker")

plot(pca$x[,c(1,3)],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("T0 - current smoker")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("T0 - current smoker")

# diabetes
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
cols <- as.character(ss_t0$diabetes_typeD)
plot(pca$x[,1:2],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("T0 - diabetes")

plot(pca$x[,c(1,3)],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("T0 - diabetes")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("T0 - diabetes")

# treatment group
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
cols <- as.character(ss_t0$treatment_group)
cols <- gsub("2","orange",gsub("1","cyan3",cols))
plot(pca$x[,1:2],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("T0 - treatment group")

plot(pca$x[,c(1,3)],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("T0 - treatment group")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("T0 - treatment group")

# treatment group
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
cols <- as.character(ss_t0$crp_group)
cols <- gsub("4","orange",gsub("1","cyan3",cols))
plot(pca$x[,1:2],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("T0 - CRP group")

plot(pca$x[,c(1,3)],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("T0 - CRP group")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("T0 - CRP group")

EOS.

# wound type clean (1) contaminated (2)

mx <- xeosf
ss2 <- ss_eos
pca <- prcomp(t(mx),center = TRUE, scale = TRUE,retx=TRUE)
labs=gsub("-EOS","",rownames(pca$x))
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
cols <- as.character(ss_eos$wound_type_cat)
cols <- gsub("2","red",gsub("1","gray",cols))
plot(pca$x[,1:2],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("EOS - wound type")

plot(pca$x[,c(1,3)],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("EOS - wound type")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("EOS - wound type")

# surg duration
my_palette <- colorRampPalette(c("yellow", "orange", "red"))(n = 10)
decile <- ntile(ss_eos$duration_sx, 10)
mycols <- my_palette[decile]
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
plot(pca$x[,1:2],cex=2,col=mycols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("EOS - surgical duration deciles")

plot(pca$x[,c(1,3)],cex=2,col=mycols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("EOS - surgical duration deciles")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=mycols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("EOS - surgical duration deciles")

# Ethnicity Levels [1-4]: Asian, Maori/Polynesian, Other, White/Caucasian
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
cols <- as.character(ss_eos$ethnicityD)
plot(pca$x[,1:2],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("EOS  - ethnicity")

plot(pca$x[,c(1,3)],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("EOS  - ethnicity")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("EOS  - ethnicity")

# age
my_palette <- colorRampPalette(c("yellow", "orange", "red"))(n = 10)
decile <- ntile(ss_eos$ageD, 10)
mycols <- my_palette[decile]
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
plot(pca$x[,1:2],cex=2,col=mycols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("EOS - age deciles")

plot(pca$x[,c(1,3)],cex=2,col=mycols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("EOS - age deciles")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=mycols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("EOS - age deciles")

# sex female=1 male=2
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
cols <- as.character(ss_eos$sexD)
cols <- gsub("1","pink",gsub("2","lightblue",cols))
plot(pca$x[,1:2],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("EOS - sex: female=pink, male=lightblue")

plot(pca$x[,c(1,3)],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("EOS - sex: female=pink, male=lightblue")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("EOS - sex: female=pink, male=lightblue")

# bmi
my_palette <- colorRampPalette(c("yellow", "orange", "red"))(n = 10)
decile <- ntile(ss_eos$bmi, 10)
mycols <- my_palette[decile]
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
plot(pca$x[,1:2],cex=2,col=mycols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("EOS - BMI deciles")

plot(pca$x[,c(1,3)],cex=2,col=mycols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("EOS - BMI deciles")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=mycols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("EOS - BMI deciles")

# asaD levels 1:4 black,red,green,blue
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
cols <- as.character(ss_eos$asaD)
plot(pca$x[,1:2],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("EOS - asaD")

plot(pca$x[,c(1,3)],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("EOS - asaD")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("EOS - asaD")

# Current smoker no, yes
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
cols <- as.character(ss_eos$current_smokerD)
plot(pca$x[,1:2],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("EOS - current smoker")

plot(pca$x[,c(1,3)],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("EOS - current smoker")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("EOS - current smoker")

# diabetes
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
cols <- as.character(ss_eos$diabetes_typeD)
plot(pca$x[,1:2],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("EOS - diabetes")

plot(pca$x[,c(1,3)],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("EOS - diabetes")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("EOS - diabetes")

# treatment group
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
cols <- as.character(ss_eos$treatment_group)
cols <- gsub("2","orange",gsub("1","cyan3",cols))
plot(pca$x[,1:2],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("EOS - treatment group")

plot(pca$x[,c(1,3)],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("EOS - treatment group")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("EOS - treatment group")

# treatment group
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
cols <- as.character(ss_eos$crp_group)
cols <- gsub("4","orange",gsub("1","cyan3",cols))
plot(pca$x[,1:2],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("EOS - CRP group")

plot(pca$x[,c(1,3)],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("EOS - CRP group")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("EOS - CRP group")

POD1.

# wound type clean (1) contaminated (2)

mx <- xpod1f
ss2 <- ss_pod1
pca <- prcomp(t(mx),center = TRUE, scale = TRUE,retx=TRUE)
labs=gsub("-POD1","",rownames(pca$x))
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
cols <- as.character(ss_pod1$wound_type_cat)
cols <- gsub("2","red",gsub("1","gray",cols))
plot(pca$x[,1:2],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("POD1 - wound type")

plot(pca$x[,c(1,3)],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("POD1 - wound type")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("POD1 - wound type")

# surg duration
my_palette <- colorRampPalette(c("yellow", "orange", "red"))(n = 10)
decile <- ntile(ss_pod1$duration_sx, 10)
mycols <- my_palette[decile]
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
plot(pca$x[,1:2],cex=2,col=mycols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("POD1 - surgical duration deciles")

plot(pca$x[,c(1,3)],cex=2,col=mycols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("POD1 - surgical duration deciles")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=mycols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("POD1 - surgical duration deciles")

# Ethnicity Levels [1-4]: Asian, Maori/Polynesian, Other, White/Caucasian
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
cols <- as.character(ss_pod1$ethnicityD)
plot(pca$x[,1:2],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("POD1  - ethnicity")

plot(pca$x[,c(1,3)],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("POD1  - ethnicity")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("POD1  - ethnicity")

# age
my_palette <- colorRampPalette(c("yellow", "orange", "red"))(n = 10)
decile <- ntile(ss_pod1$ageD, 10)
mycols <- my_palette[decile]
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
plot(pca$x[,1:2],cex=2,col=mycols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("POD1 - age deciles")

plot(pca$x[,c(1,3)],cex=2,col=mycols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("POD1 - age deciles")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=mycols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("POD1 - age deciles")

# sex female=1 male=2
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
cols <- as.character(ss_pod1$sexD)
cols <- gsub("1","pink",gsub("2","lightblue",cols))
plot(pca$x[,1:2],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("POD1 - sex: female=pink, male=lightblue")

plot(pca$x[,c(1,3)],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("POD1 - sex: female=pink, male=lightblue")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("POD1 - sex: female=pink, male=lightblue")

# bmi
my_palette <- colorRampPalette(c("yellow", "orange", "red"))(n = 10)
decile <- ntile(ss_pod1$bmi, 10)
mycols <- my_palette[decile]
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
plot(pca$x[,1:2],cex=2,col=mycols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("POD1 - BMI deciles")

plot(pca$x[,c(1,3)],cex=2,col=mycols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("POD1 - BMI deciles")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=mycols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("POD1 - BMI deciles")

# asaD levels 1:4 black,red,green,blue
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
cols <- as.character(ss_pod1$asaD)
plot(pca$x[,1:2],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("POD1 - asaD")

plot(pca$x[,c(1,3)],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("POD1 - asaD")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("POD1 - asaD")

# Current smoker no, yes
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
cols <- as.character(ss_pod1$current_smokerD)
plot(pca$x[,1:2],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("POD1 - current smoker")

plot(pca$x[,c(1,3)],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("POD1 - current smoker")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("POD1 - current smoker")

# diabetes
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
cols <- as.character(ss_pod1$diabetes_typeD)
plot(pca$x[,1:2],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("POD1 - diabetes")

plot(pca$x[,c(1,3)],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("POD1 - diabetes")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("POD1 - diabetes")

# treatment group
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
cols <- as.character(ss_pod1$treatment_group)
cols <- gsub("2","orange",gsub("1","cyan3",cols))
plot(pca$x[,1:2],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("POD1 - treatment group")

plot(pca$x[,c(1,3)],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("POD1 - treatment group")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("POD1 - treatment group")

# treatment group
XMIN=min(pca$x[,1])*1.1
XMAX=max(pca$x[,1])*1.1
cols <- as.character(ss_pod1$crp_group)
cols <- gsub("4","orange",gsub("1","cyan3",cols))
plot(pca$x[,1:2],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,1:2],labels=labs,cex=0.7)
mtext("POD1 - CRP group")

plot(pca$x[,c(1,3)],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,c(1,3)],labels=labs,cex=0.7)
mtext("POD1 - CRP group")

XMIN=min(pca$x[,2])*1.1
XMAX=max(pca$x[,2])*1.1
plot(pca$x[,2:3],cex=2,col=cols,pch=19,bty="none", xlim=c(XMIN,XMAX) )
text(pca$x[,2:3],labels=labs,cex=0.7)
mtext("POD1 - CRP group")

Blood composition

xn <- xx
gt <- as.data.frame(sapply(strsplit(rownames(xn)," "),"[[",2) )
rownames(gt) <- rownames(xx)
colnames(gt) = "genesymbol"
gt$geneID <- rownames(xx)
blood <- read.table("https://raw.githubusercontent.com/giannimonaco/ABIS/master/data/sigmatrixRNAseq.txt")
blood2 <- merge(gt,blood,by.x="genesymbol",by.y=0)
blood2 <- blood2[which(!duplicated(blood2$genesymbol)),]
rownames(blood2) <- blood2$geneID
blood2 <- blood2[,c(3:ncol(blood2))]
genes <- intersect(rownames(xx), rownames(blood2))
dec <- apply(xx[genes, , drop=F], 2, function(x) coef(rlm( as.matrix(blood2[genes,]), x, maxit =100 ))) *100
## Warning in rlm.default(as.matrix(blood2[genes, ]), x, maxit = 100): 'rlm'
## failed to converge in 100 steps
## Warning in rlm.default(as.matrix(blood2[genes, ]), x, maxit = 100): 'rlm'
## failed to converge in 100 steps
dec <- t(dec/colSums(dec)*100)
dec <- signif(dec, 3)
# remove negative values
dec2 <- t(apply(dec,2,function(x) { mymin=min(x) ; if (mymin<0) { x + (mymin * -1) } else { x } } ))
dec2 <- apply(dec2,2,function(x) {x / sum(x) *100} )
colfunc <- colorRampPalette(c("blue", "white", "red"))
heatmap.2( dec2, col=colfunc(25),scale="row",
 trace="none",margins = c(5,5), cexRow=.7, cexCol=.8,  main="cell type abundances")

heatmap.2( dec2, col=colfunc(25),scale="none",
 trace="none",margins = c(5,5), cexRow=.7, cexCol=.8,  main="cell type abundances")

par(mar=c(5,10,3,1))
boxplot(t(dec2[order(rowMeans(dec2)),]),horizontal=TRUE,las=1, xlab="estimated cell proportion (%)")

par(mar = c(5.1, 4.1, 4.1, 2.1))
heatmap.2( cor(dec2),trace="none",scale="none")

heatmap.2( cor(t(dec2)),trace="none",scale="none", margins = c(8,8))

par(mar=c(5,10,3,1))
barplot(apply(dec2,1,sd),horiz=TRUE,las=1,xlab="SD of cell proportions (%)")

which(apply(dec2,1,sd)>4)
##    Monocytes.C             NK   T.CD8.Memory    T.CD4.Naive Neutrophils.LD 
##              1              2              3              4             10
saveRDS(dec2,"cellcomposition.Rds")

Based on this analysis we can begin with correction of:

  • Monocytes.C
  • NK
  • T.CD8.Memory
  • T.CD4.Naive
  • Neutrophils.LD

According to the correlation heatmap, these are not strongly correlated.

Now look at how the cell proportions change over time.

ct0 <- dec2[,grep("-T0",colnames(dec2))]
ceos <- dec2[,grep("-EOS",colnames(dec2))]
cpod1 <- dec2[,grep("-POD1",colnames(dec2))]
par(mar=c(5,10,3,1))
boxplot(t(ct0),horizontal=TRUE,las=1, xlab="estimated cell proportion (%)",main="T0")

boxplot(t(ceos),horizontal=TRUE,las=1, xlab="estimated cell proportion (%)",main="EOS")

boxplot(t(cpod1),horizontal=TRUE,las=1, xlab="estimated cell proportion (%)",main="POD1")

sscell <- as.data.frame(t(dec2))
sscell_t0 <- sscell[grep("-T0",rownames(sscell)),]
sscell_eos <- sscell[grep("-EOS",rownames(sscell)),]
sscell_pod1 <- sscell[grep("POD1",rownames(sscell)),]

Now look at the cell composition across time points and groups.

# trt1 and trt2 togethr
null <- lapply(1:17 , function(i) {
  cellname <- colnames(sscell_t0)[i]
  t0vals <- sscell_t0[,i]
  eosvals <- sscell_eos[,i]
  pod1vals <- sscell_pod1[,i]
  cl <- list("t0"=t0vals,"EOS"=eosvals,"POD1"=pod1vals)
  boxplot(cl,col="white",cex=0,ylab="estimated relative cell proportion",main=cellname)
  beeswarm(cl,pch=19,col="darkgray",cex=1.5,add=TRUE)
})

sscell_t0$trt <- ss[match(rownames(sscell_t0),rownames(ss)),"treatment_group"]
sscell_eos$trt <- ss[match(rownames(sscell_eos),rownames(ss)),"treatment_group"]
sscell_pod1$trt <- ss[match(rownames(sscell_pod1),rownames(ss)),"treatment_group"]

null <- lapply(1:17 , function(i) {
  cellname <- colnames(sscell_t0)[i]
  t0vals_trt1 <- subset(sscell_t0,trt==1)[,i]
  t0vals_trt2 <- subset(sscell_t0,trt==2)[,i]

  eosvals_trt1 <- subset(sscell_eos,trt==1)[,i]
  eosvals_trt2 <- subset(sscell_eos,trt==2)[,i]

  pod1vals_trt1 <- subset(sscell_pod1,trt==1)[,i]
  pod1vals_trt2 <- subset(sscell_pod1,trt==2)[,i]

  cl <- list("t0 trt1"=t0vals_trt1,"t0 trt2"=t0vals_trt2,
    "EOS trt1"=eosvals_trt1, "EOS trt2"=eosvals_trt2,
    "POD1 trt1"=pod1vals_trt1, "POD1 trt2"=pod1vals_trt2 )
  boxplot(cl,col="white",cex=0,ylab="estimated relative cell proportion",main=cellname)
  beeswarm(cl,pch=19,col="darkgray",cex=1.2,add=TRUE)
})

Now look at how cell types associate with the PCAs.

#xt0f xeosf xpod1f
#sscell_t0 sscell_eos sscell_pod1

## T0
mx <- xt0f

ss2 <- sscell_t0

pca <- prcomp(t(mx),center = TRUE, scale = TRUE,retx=TRUE)

loadings = pca$x
par(mar = c(5.1, 4.1, 4.1, 2.1))
plot(pca,type="lines",col="blue")

nGenes <- nrow(mx)
nSamples <- ncol(mx)
datTraits <- ss2
moduleTraitCor <- cor(loadings[,1:8], datTraits, use = "p")
moduleTraitPvalue <- corPvalueStudent(moduleTraitCor, nSamples)
textMatrix <- paste(signif(moduleTraitCor, 2), "\n(",
  signif(moduleTraitPvalue, 1), ")", sep = "")

dim(textMatrix) = dim(moduleTraitCor)

labeledHeatmap(Matrix = t(moduleTraitCor),
  xLabels = colnames(loadings)[1:ncol(t(moduleTraitCor))],
  yLabels = names(datTraits), colorLabels = FALSE, colors = blueWhiteRed(6),
  textMatrix = t(textMatrix), setStdMargins = FALSE, cex.text = 0.5,
  cex.lab.y = 0.6, zlim = c(-0.45,0.45),
  main = paste("PCA-cell relationships @T0: Top principal components"))
## Warning in numbers2colors(data, signed, colors = colors, lim = zlim, naColor =
## naColor): Some values of 'x' are below given minimum and will be truncated to
## the minimum.
## Warning in numbers2colors(data, signed, colors = colors, lim = zlim, naColor =
## naColor): Some values of 'x' are above given maximum and will be truncated to
## the maximum.

## EOS
mx <- xeosf

ss2 <- sscell_eos

pca <- prcomp(t(mx),center = TRUE, scale = TRUE,retx=TRUE)

loadings = pca$x

plot(pca,type="lines",col="blue")

nGenes <- nrow(mx)
nSamples <- ncol(mx)
datTraits <- ss2
moduleTraitCor <- cor(loadings[,1:8], datTraits, use = "p")
moduleTraitPvalue <- corPvalueStudent(moduleTraitCor, nSamples)
textMatrix <- paste(signif(moduleTraitCor, 2), "\n(",
  signif(moduleTraitPvalue, 1), ")", sep = "")

dim(textMatrix) = dim(moduleTraitCor)

labeledHeatmap(Matrix = t(moduleTraitCor),
  xLabels = colnames(loadings)[1:ncol(t(moduleTraitCor))],
  yLabels = names(datTraits), colorLabels = FALSE, colors = blueWhiteRed(6),
  textMatrix = t(textMatrix), setStdMargins = FALSE, cex.text = 0.5,
  cex.lab.y = 0.6, zlim = c(-0.45,0.45),
  main = paste("PCA-cell relationships @EOS: Top principal components"))
## Warning in numbers2colors(data, signed, colors = colors, lim = zlim, naColor =
## naColor): Some values of 'x' are below given minimum and will be truncated to
## the minimum.
## Warning in numbers2colors(data, signed, colors = colors, lim = zlim, naColor =
## naColor): Some values of 'x' are above given maximum and will be truncated to
## the maximum.

## POD1
mx <- xpod1f

ss2 <- sscell_pod1

pca <- prcomp(t(mx),center = TRUE, scale = TRUE,retx=TRUE)

loadings = pca$x

plot(pca,type="lines",col="blue")

nGenes <- nrow(mx)
nSamples <- ncol(mx)
datTraits <- ss2
moduleTraitCor <- cor(loadings[,1:8], datTraits, use = "p")
moduleTraitPvalue <- corPvalueStudent(moduleTraitCor, nSamples)
textMatrix <- paste(signif(moduleTraitCor, 2), "\n(",
  signif(moduleTraitPvalue, 1), ")", sep = "")

dim(textMatrix) = dim(moduleTraitCor)

labeledHeatmap(Matrix = t(moduleTraitCor),
  xLabels = colnames(loadings)[1:ncol(t(moduleTraitCor))],
  yLabels = names(datTraits), colorLabels = FALSE, colors = blueWhiteRed(6),
  textMatrix = t(textMatrix), setStdMargins = FALSE, cex.text = 0.5,
  cex.lab.y = 0.6, zlim = c(-0.45,0.45),
  main = paste("PCA-cell relationships @POD1: Top principal components"))
## Warning in numbers2colors(data, signed, colors = colors, lim = zlim, naColor =
## naColor): Some values of 'x' are below given minimum and will be truncated to
## the minimum.
## Warning in numbers2colors(data, signed, colors = colors, lim = zlim, naColor =
## naColor): Some values of 'x' are above given maximum and will be truncated to
## the maximum.

The conclusion here is that the cell types correlate strongly with the principal components. The good news is that we have selected the cell types that associate the strongest, so we can correct for their contribution.

Differential expression

Specific PCAs for key clinical parameters:

  • wound type
  • surg duration
  • ethnicity
  • age
  • sex

And blood composition:

  • Monocytes.C
  • NK
  • T.CD8.Memory
  • T.CD4.Naive
  • Neutrophils.LD

And ones we didn’t include:

  • bmi
  • asaD
  • smoker
  • diabetes_typeD

TODO:

  • age data centred and scaled

  • ethnicity categories unordered

Overview

  1. CRP group comparisons not stratified for treatment group (inflamation)

  2. Treatment group comparisons not stratified for CRP group (Steroid)

  3. CRP group comparisons statified for treatment group: inflammation and steroid

  4. Treatment group complarisons stratified for CRP group: steroid and inflammation

  5. Sex differences in low CRP group (not stratified for treatment group)

  6. Sex differences in high CRP group (not stratified for treatment group)

CRP group differences not stratified

CRP low vs high at t=0

mx <- xt0f
ss2 <- as.data.frame(cbind(ss_t0,sscell_t0))
mx <- mx[,colnames(mx) %in% rownames(ss2)]

# base model
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ crp_group )
## converting counts to integer mode
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
## -- replacing outliers and refitting for 390 genes
## -- DESeq argument 'minReplicatesForReplace' = 7 
## -- original counts are preserved in counts(dds)
## estimating dispersions
## fitting model and testing
z <- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                  baseMean log2FoldChange      lfcSE      stat
## ENSG00000179593.16 ALOX15B      192.12350     -0.7187508 0.10489179 -6.852308
## ENSG00000141744.4 PNMT           35.64128     -0.4354625 0.09456325 -4.604986
## ENSG00000087116.16 ADAMTS2       96.08857     -0.5387022 0.12313891 -4.374752
## ENSG00000057294.16 PKP2          83.96200     -0.3049742 0.07109219 -4.289842
## ENSG00000279359.1 RP11-36D19.9   12.76771     -0.5030155 0.11986382 -4.196558
## ENSG00000276168.1 RN7SL1        591.11188      0.2489061 0.06119920  4.067147
## ENSG00000063438.20 AHRR          92.23299     -0.4595163 0.11376981 -4.039000
## ENSG00000233916.1 ZDHHC20P1      21.16714     -0.3347389 0.08736544 -3.831480
## ENSG00000189056.15 RELN          17.27434      0.1809771 0.04776302  3.789062
## ENSG00000274012.1 RN7SL2       1037.64399      0.2367552 0.06518141  3.632250
##                                      pvalue         padj
## ENSG00000179593.16 ALOX15B     7.266794e-12 1.593971e-07
## ENSG00000141744.4 PNMT         4.124926e-06 4.524013e-02
## ENSG00000087116.16 ADAMTS2     1.215705e-05 8.888828e-02
## ENSG00000057294.16 PKP2        1.788006e-05 9.804975e-02
## ENSG00000279359.1 RP11-36D19.9 2.710017e-05 1.188885e-01
## ENSG00000276168.1 RN7SL1       4.759225e-05 1.682084e-01
## ENSG00000063438.20 AHRR        5.367947e-05 1.682084e-01
## ENSG00000233916.1 ZDHHC20P1    1.273749e-04 3.492459e-01
## ENSG00000189056.15 RELN        1.512169e-04 3.685491e-01
## ENSG00000274012.1 RN7SL2       2.809608e-04 6.162874e-01
mean(abs(dge$stat))
## [1] 0.7207644
# model with clinical covariates
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS + crp_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 20 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                  baseMean log2FoldChange      lfcSE      stat
## ENSG00000223609.11 HBD          153.11532      0.6127017 0.13080850  4.683959
## ENSG00000261026.1 CTD-3247F14.2  13.74757     -1.0503473 0.23156953 -4.535775
## ENSG00000206177.7 HBM            45.70050      0.6155113 0.14218666  4.328896
## ENSG00000004939.16 SLC4A1       233.82225      0.4920445 0.12031713  4.089563
## ENSG00000169877.10 AHSP          34.93993      0.6188578 0.15316672  4.040419
## ENSG00000179593.16 ALOX15B      250.75091     -0.3691708 0.09277372 -3.979261
## ENSG00000218052.5 ADAMTS7P4      23.44923      0.2098524 0.05372181  3.906280
## ENSG00000268734.1 CTB-61M7.2     10.82400     -1.5114453 0.38789134 -3.896569
## ENSG00000166947.15 EPB42         37.40076      0.4773174 0.12488402  3.822085
## ENSG00000179388.9 EGR3          270.39768     -0.5197675 0.13823652 -3.759987
##                                       pvalue      padj
## ENSG00000223609.11 HBD          2.813859e-06 0.0617220
## ENSG00000261026.1 CTD-3247F14.2 5.739229e-06 0.0629450
## ENSG00000206177.7 HBM           1.498584e-05 0.1095715
## ENSG00000004939.16 SLC4A1       4.321860e-05 0.2340715
## ENSG00000169877.10 AHSP         5.335572e-05 0.2340715
## ENSG00000179593.16 ALOX15B      6.912983e-05 0.2527272
## ENSG00000218052.5 ADAMTS7P4     9.372795e-05 0.2675113
## ENSG00000268734.1 CTB-61M7.2    9.756510e-05 0.2675113
## ENSG00000166947.15 EPB42        1.323281e-04 0.3225129
## ENSG00000179388.9 EGR3          1.699222e-04 0.3727244
mean(abs(dge$stat))
## [1] 0.7617846
crp_t0 <- dge

# model with clinical and cell covariates
# Monocytes.C NK T.CD8.Memory T.CD4.Naive Neutrophils.LD
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS +
    Monocytes.C + NK + T.CD8.Memory + T.CD4.Naive + Neutrophils.LD + crp_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   the design formula contains one or more numeric variables that have mean or
##   standard deviation larger than 5 (an arbitrary threshold to trigger this message).
##   Including numeric variables with large mean can induce collinearity with the intercept.
##   Users should center and scale numeric variables in the design to improve GLM convergence.
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 11 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                              baseMean log2FoldChange      lfcSE      stat
## ENSG00000223609.11 HBD      153.11532     0.58209593 0.13422143  4.336833
## ENSG00000206177.7 HBM        45.70050     0.55382261 0.14446831  3.833523
## ENSG00000004939.16 SLC4A1   233.82225     0.46687689 0.12375126  3.772704
## ENSG00000132122.12 SPATA6   215.55260    -0.09259567 0.02479843 -3.733933
## ENSG00000169877.10 AHSP      34.93993     0.58801794 0.15784167  3.725366
## ENSG00000076864.20 RAP1GAP   14.58834     0.30003378 0.08110658  3.699253
## ENSG00000181126.13 HLA-V    366.66600    -0.44464770 0.12076431 -3.681946
## ENSG00000218052.5 ADAMTS7P4  23.44923     0.18427003 0.05011215  3.677153
## ENSG00000170153.11 RNF150    16.74377    -0.64214074 0.17647020 -3.638805
## ENSG00000166947.15 EPB42     37.40076     0.45926219 0.12825639  3.580813
##                                   pvalue      padj
## ENSG00000223609.11 HBD      1.445504e-05 0.3170712
## ENSG00000206177.7 HBM       1.263209e-04 0.6466756
## ENSG00000004939.16 SLC4A1   1.614877e-04 0.6466756
## ENSG00000132122.12 SPATA6   1.885126e-04 0.6466756
## ENSG00000169877.10 AHSP     1.950322e-04 0.6466756
## ENSG00000076864.20 RAP1GAP  2.162348e-04 0.6466756
## ENSG00000181126.13 HLA-V    2.314602e-04 0.6466756
## ENSG00000218052.5 ADAMTS7P4 2.358516e-04 0.6466756
## ENSG00000170153.11 RNF150   2.739056e-04 0.6585246
## ENSG00000166947.15 EPB42    3.425263e-04 0.6585246
mean(abs(dge$stat))
## [1] 0.7499656
crp_t0_adj <- dge

CRP low vs high at EOS

mx <- xeosf
ss2 <- as.data.frame(cbind(ss_eos,sscell_eos))
mx <- mx[,colnames(mx) %in% rownames(ss2)]

# base model
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ crp_group )
## converting counts to integer mode
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
## -- replacing outliers and refitting for 118 genes
## -- DESeq argument 'minReplicatesForReplace' = 7 
## -- original counts are preserved in counts(dds)
## estimating dispersions
## fitting model and testing
z <- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                   baseMean log2FoldChange      lfcSE     stat
## ENSG00000139572.4 GPR84          231.01210      0.7893177 0.09543038 8.271137
## ENSG00000113368.12 LMNB1        2665.88768      0.4224482 0.05453011 7.747062
## ENSG00000280091.1 CTC-312O10.3    32.83608      0.5061573 0.06958189 7.274267
## ENSG00000137193.14 PIM1         7966.43548      0.3023359 0.04160685 7.266494
## ENSG00000170525.21 PFKFB3       4788.95198      0.5364125 0.07387475 7.261108
## ENSG00000079385.23 CEACAM1      1095.76169      0.7812428 0.10858770 7.194579
## ENSG00000069399.15 BCL3         3591.85376      0.4579237 0.06480903 7.065740
## ENSG00000184557.4 SOCS3        13113.96513      0.6655088 0.09494900 7.009118
## ENSG00000198019.13 FCGR1B        681.83152      0.5275512 0.07634910 6.909724
## ENSG00000163251.4 FZD5            91.58576      0.4341470 0.06308193 6.882272
##                                      pvalue         padj
## ENSG00000139572.4 GPR84        1.326872e-16 2.871217e-12
## ENSG00000113368.12 LMNB1       9.404335e-15 1.017502e-10
## ENSG00000280091.1 CTC-312O10.3 3.483056e-13 1.661581e-09
## ENSG00000137193.14 PIM1        3.689370e-13 1.661581e-09
## ENSG00000170525.21 PFKFB3      3.839320e-13 1.661581e-09
## ENSG00000079385.23 CEACAM1     6.265387e-13 2.259612e-09
## ENSG00000069399.15 BCL3        1.597623e-12 4.938709e-09
## ENSG00000184557.4 SOCS3        2.398244e-12 6.486949e-09
## ENSG00000198019.13 FCGR1B      4.855988e-12 1.167541e-08
## ENSG00000163251.4 FZD5         5.890533e-12 1.274652e-08
mean(abs(dge$stat))
## [1] 1.485292
# model with clinical covariates
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS + crp_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 13 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                              baseMean log2FoldChange      lfcSE     stat
## ENSG00000139572.4 GPR84     231.01210      0.7183062 0.11564967 6.211053
## ENSG00000127954.13 STEAP4  2533.73582      0.5130516 0.09062352 5.661352
## ENSG00000184557.4 SOCS3   13113.96513      0.6216040 0.11307436 5.497303
## ENSG00000176597.12 B3GNT5   367.05640      0.4553917 0.08837595 5.152891
## ENSG00000059804.16 SLC2A3  9795.99656      0.4116953 0.08137334 5.059338
## ENSG00000170525.21 PFKFB3  4788.95198      0.4492633 0.08908047 5.043343
## ENSG00000069399.15 BCL3    3591.85376      0.3933702 0.07815095 5.033467
## ENSG00000121742.19 GJB6      54.89967      0.6668659 0.13279923 5.021610
## ENSG00000113368.12 LMNB1   2665.88768      0.3025021 0.06103820 4.955947
## ENSG00000173281.5 PPP1R3B  1142.35672      0.4439020 0.08968117 4.949780
##                                 pvalue         padj
## ENSG00000139572.4 GPR84   5.263078e-10 1.138877e-05
## ENSG00000127954.13 STEAP4 1.501854e-08 1.624931e-04
## ENSG00000184557.4 SOCS3   3.856442e-08 2.781651e-04
## ENSG00000176597.12 B3GNT5 2.565005e-07 1.385985e-03
## ENSG00000059804.16 SLC2A3 4.207135e-07 1.385985e-03
## ENSG00000170525.21 PFKFB3 4.574686e-07 1.385985e-03
## ENSG00000069399.15 BCL3   4.816882e-07 1.385985e-03
## ENSG00000121742.19 GJB6   5.124025e-07 1.385985e-03
## ENSG00000113368.12 LMNB1  7.197870e-07 1.407299e-03
## ENSG00000173281.5 PPP1R3B 7.429758e-07 1.407299e-03
mean(abs(dge$stat))
## [1] 1.185116
crp_eos <- dge

# model with clinical and cell covariates
# Monocytes.C NK T.CD8.Memory T.CD4.Naive Neutrophils.LD
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS +
    Monocytes.C + NK + T.CD8.Memory + T.CD4.Naive + Neutrophils.LD + crp_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   the design formula contains one or more numeric variables that have mean or
##   standard deviation larger than 5 (an arbitrary threshold to trigger this message).
##   Including numeric variables with large mean can induce collinearity with the intercept.
##   Users should center and scale numeric variables in the design to improve GLM convergence.
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 9 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                  baseMean log2FoldChange      lfcSE      stat
## ENSG00000197632.9 SERPINB2      260.41250      0.3545761 0.06850138  5.176189
## ENSG00000127954.13 STEAP4      2533.73582      0.2836443 0.05488758  5.167732
## ENSG00000139572.4 GPR84         231.01210      0.4490274 0.08779641  5.114416
## ENSG00000211459.2 MT-RNR1    100058.33839     -0.2858692 0.05843432 -4.892145
## ENSG00000241560.7 ZBTB20-AS1     46.10569      0.2579937 0.05302105  4.865873
## ENSG00000210082.2 MT-RNR2    242496.36564     -0.2401137 0.04976253 -4.825190
## ENSG00000064763.11 FAR2         604.97645     -0.2053606 0.04311803 -4.762754
## ENSG00000135678.12 CPM          575.43286     -0.3101463 0.06641944 -4.669512
## ENSG00000155659.15 VSIG4        356.81388     -0.4006950 0.08583339 -4.668288
## ENSG00000050730.16 TNIP3         55.66088      0.2325018 0.04992622  4.656908
##                                    pvalue        padj
## ENSG00000197632.9 SERPINB2   2.264644e-07 0.002314927
## ENSG00000127954.13 STEAP4    2.369522e-07 0.002314927
## ENSG00000139572.4 GPR84      3.147134e-07 0.002314927
## ENSG00000211459.2 MT-RNR1    9.974282e-07 0.005029176
## ENSG00000241560.7 ZBTB20-AS1 1.139524e-06 0.005029176
## ENSG00000210082.2 MT-RNR2    1.398697e-06 0.005144173
## ENSG00000064763.11 FAR2      1.909682e-06 0.006020137
## ENSG00000135678.12 CPM       3.019167e-06 0.007083372
## ENSG00000155659.15 VSIG4     3.037196e-06 0.007083372
## ENSG00000050730.16 TNIP3     3.209939e-06 0.007083372
mean(abs(dge$stat))
## [1] 0.9721301
crp_eos_adj <- dge

CRP low vs high at POD1

mx <- xpod1f
ss2 <- as.data.frame(cbind(ss_pod1,sscell_pod1))
mx <- mx[,colnames(mx) %in% rownames(ss2)]

# base model
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ crp_group )
## converting counts to integer mode
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
## -- replacing outliers and refitting for 134 genes
## -- DESeq argument 'minReplicatesForReplace' = 7 
## -- original counts are preserved in counts(dds)
## estimating dispersions
## fitting model and testing
z <- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                               baseMean log2FoldChange      lfcSE      stat
## ENSG00000007968.7 E2F2       870.17416      0.4436761 0.03676788 12.066948
## ENSG00000137869.15 CYP19A1    81.93527      0.9960649 0.09264040 10.751949
## ENSG00000163710.9 PCOLCE2     18.25602      1.0744848 0.10096581 10.642066
## ENSG00000104918.8 RETN      1801.19251      0.7757049 0.07614859 10.186726
## ENSG00000132170.24 PPARG     168.63657      0.5429631 0.05405474 10.044690
## ENSG00000145287.11 PLAC8    4671.33188      0.3457873 0.03478431  9.940898
## ENSG00000183578.8 TNFAIP8L3   24.65972      0.7720344 0.07809643  9.885655
## ENSG00000135424.18 ITGA7     436.10324      0.5378278 0.05479987  9.814399
## ENSG00000108950.12 FAM20A   1751.41363      0.6102328 0.06295930  9.692497
## ENSG00000165092.13 ALDH1A1   410.41112     -0.5138028 0.05334920 -9.630936
##                                   pvalue         padj
## ENSG00000007968.7 E2F2      1.578813e-33 3.364925e-29
## ENSG00000137869.15 CYP19A1  5.802268e-27 6.183186e-23
## ENSG00000163710.9 PCOLCE2   1.898717e-26 1.348912e-22
## ENSG00000104918.8 RETN      2.272894e-24 1.211055e-20
## ENSG00000132170.24 PPARG    9.695213e-24 4.132682e-20
## ENSG00000145287.11 PLAC8    2.763251e-23 9.815527e-20
## ENSG00000183578.8 TNFAIP8L3 4.804293e-23 1.462770e-19
## ENSG00000135424.18 ITGA7    9.761766e-23 2.600656e-19
## ENSG00000108950.12 FAM20A   3.244949e-22 7.684400e-19
## ENSG00000165092.13 ALDH1A1  5.918789e-22 1.261472e-18
mean(abs(dge$stat))
## [1] 1.827282
# model with clinical covariates
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS + crp_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 24 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                              baseMean log2FoldChange      lfcSE      stat
## ENSG00000007968.7 E2F2      870.17416      0.3860936 0.04401299  8.772264
## ENSG00000163710.9 PCOLCE2    18.25602      0.9879318 0.11793493  8.376923
## ENSG00000137869.15 CYP19A1   81.93527      0.8122448 0.10657233  7.621535
## ENSG00000104918.8 RETN     1801.19251      0.6489135 0.08536396  7.601727
## ENSG00000132170.24 PPARG    168.63657      0.4789945 0.06318857  7.580398
## ENSG00000135424.18 ITGA7    436.10324      0.4767597 0.06544080  7.285359
## ENSG00000108950.12 FAM20A  1751.41363      0.5260557 0.07302081  7.204190
## ENSG00000169994.19 MYO7B    618.31752      0.3324557 0.04684399  7.097083
## ENSG00000165092.13 ALDH1A1  410.41112     -0.4432919 0.06264590 -7.076151
## ENSG00000116016.14 EPAS1    154.17271      0.3555413 0.05078144  7.001402
##                                  pvalue         padj
## ENSG00000007968.7 E2F2     1.751085e-18 3.732087e-14
## ENSG00000163710.9 PCOLCE2  5.432955e-17 5.789628e-13
## ENSG00000137869.15 CYP19A1 2.506768e-14 1.468447e-10
## ENSG00000104918.8 RETN     2.922041e-14 1.468447e-10
## ENSG00000132170.24 PPARG   3.444956e-14 1.468447e-10
## ENSG00000135424.18 ITGA7   3.208156e-13 1.139591e-09
## ENSG00000108950.12 FAM20A  5.839004e-13 1.777810e-09
## ENSG00000169994.19 MYO7B   1.274176e-12 3.394564e-09
## ENSG00000165092.13 ALDH1A1 1.482132e-12 3.509854e-09
## ENSG00000116016.14 EPAS1   2.534142e-12 5.401016e-09
mean(abs(dge$stat))
## [1] 1.324957
crp_pod1 <- dge

# model with clinical and cell covariates
# Monocytes.C NK T.CD8.Memory T.CD4.Naive Neutrophils.LD
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS +
    Monocytes.C + NK + T.CD8.Memory + T.CD4.Naive + Neutrophils.LD + crp_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   the design formula contains one or more numeric variables that have mean or
##   standard deviation larger than 5 (an arbitrary threshold to trigger this message).
##   Including numeric variables with large mean can induce collinearity with the intercept.
##   Users should center and scale numeric variables in the design to improve GLM convergence.
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 8 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                              baseMean log2FoldChange      lfcSE      stat
## ENSG00000007968.7 E2F2      870.17416      0.3472345 0.04014188  8.650180
## ENSG00000165092.13 ALDH1A1  410.41112     -0.4939869 0.05929804 -8.330578
## ENSG00000137869.15 CYP19A1   81.93527      0.7605312 0.09261922  8.211375
## ENSG00000132170.24 PPARG    168.63657      0.4271253 0.05248859  8.137488
## ENSG00000163710.9 PCOLCE2    18.25602      0.7905130 0.09924489  7.965276
## ENSG00000108950.12 FAM20A  1751.41363      0.4989988 0.06457599  7.727313
## ENSG00000135424.18 ITGA7    436.10324      0.4381670 0.05874170  7.459215
## ENSG00000116016.14 EPAS1    154.17271      0.2817621 0.03934883  7.160621
## ENSG00000104918.8 RETN     1801.19251      0.5040455 0.07279215  6.924449
## ENSG00000169994.19 MYO7B    618.31752      0.3134418 0.04566547  6.863870
##                                  pvalue         padj
## ENSG00000007968.7 E2F2     5.141838e-18 1.095880e-13
## ENSG00000165092.13 ALDH1A1 8.044867e-17 8.573012e-13
## ENSG00000137869.15 CYP19A1 2.186696e-16 1.553502e-12
## ENSG00000132170.24 PPARG   4.035620e-16 2.150279e-12
## ENSG00000163710.9 PCOLCE2  1.648551e-15 7.027116e-12
## ENSG00000108950.12 FAM20A  1.098407e-14 3.901725e-11
## ENSG00000135424.18 ITGA7   8.703923e-14 2.650096e-10
## ENSG00000116016.14 EPAS1   8.031221e-13 2.139618e-09
## ENSG00000104918.8 RETN     4.376743e-12 1.036461e-08
## ENSG00000169994.19 MYO7B   6.701977e-12 1.428392e-08
mean(abs(dge$stat))
## [1] 1.110864
crp_pod1_adj <- dge

Treatment group differences not stratified

Treatment A vs B at t0

mx <- xt0f
ss2 <- as.data.frame(cbind(ss_t0,sscell_t0))
mx <- mx[,colnames(mx) %in% rownames(ss2)]

# base model
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ treatment_group )
## converting counts to integer mode
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
## -- replacing outliers and refitting for 364 genes
## -- DESeq argument 'minReplicatesForReplace' = 7 
## -- original counts are preserved in counts(dds)
## estimating dispersions
## fitting model and testing
z <- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                 baseMean log2FoldChange     lfcSE      stat
## ENSG00000179593.16 ALOX15B     250.75091     -2.4535079 0.3356004 -7.310802
## ENSG00000279359.1 RP11-36D19.9  24.97417     -2.8528835 0.4030002 -7.079112
## ENSG00000141744.4 PNMT          35.64128     -1.7581232 0.2682321 -6.554486
## ENSG00000276085.1 CCL3L1       308.64747     -1.7142384 0.3110313 -5.511466
## ENSG00000057294.16 PKP2         92.33310     -1.2052440 0.2230360 -5.403810
## ENSG00000079215.15 SLC1A3      219.79787     -1.7005517 0.3337533 -5.095236
## ENSG00000164056.11 SPRY1        69.48429     -1.1641127 0.2336978 -4.981274
## ENSG00000233916.1 ZDHHC20P1     21.16714     -1.2626226 0.2544397 -4.962364
## ENSG00000277632.2 CCL3         559.74862     -1.3892331 0.2870354 -4.839937
## ENSG00000122644.13 ARL4A       383.47521     -0.6984909 0.1479189 -4.722121
##                                      pvalue         padj
## ENSG00000179593.16 ALOX15B     2.655536e-13 5.824918e-09
## ENSG00000279359.1 RP11-36D19.9 1.450807e-12 1.591172e-08
## ENSG00000141744.4 PNMT         5.583392e-11 4.082390e-07
## ENSG00000276085.1 CCL3L1       3.558581e-08 1.951437e-04
## ENSG00000057294.16 PKP2        6.523988e-08 2.862073e-04
## ENSG00000079215.15 SLC1A3      3.483078e-07 1.273355e-03
## ENSG00000164056.11 SPRY1       6.316694e-07 1.909446e-03
## ENSG00000233916.1 ZDHHC20P1    6.964017e-07 1.909446e-03
## ENSG00000277632.2 CCL3         1.298804e-06 3.165474e-03
## ENSG00000122644.13 ARL4A       2.333975e-06 5.119575e-03
mean(abs(dge$stat))
## [1] 0.733293
# model with clinical covariates
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS + treatment_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 13 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                               baseMean log2FoldChange      lfcSE      stat
## ENSG00000123838.11 C4BPA      33.66576      2.4906731 0.51109471  4.873212
## ENSG00000131845.15 ZNF304    418.79903      0.2874110 0.06121095  4.695418
## ENSG00000277632.2 CCL3       559.74862     -1.2496211 0.26775579 -4.667018
## ENSG00000179593.16 ALOX15B   250.75091     -1.0955858 0.23730414 -4.616800
## ENSG00000122644.13 ARL4A     383.47521     -0.6835449 0.15051404 -4.541403
## ENSG00000229807.13 XIST    10626.92285     -1.8127793 0.41367738 -4.382109
## ENSG00000162599.17 NFIA      232.38832     -0.3571616 0.08172420 -4.370328
## ENSG00000276085.1 CCL3L1     308.64747     -1.2489298 0.29873614 -4.180712
## ENSG00000079215.15 SLC1A3    219.79787     -0.9048776 0.21710493 -4.167927
## ENSG00000115306.16 SPTBN1   3986.49830      0.2464913 0.06133022  4.019084
##                                  pvalue       padj
## ENSG00000123838.11 C4BPA   1.097980e-06 0.01722679
## ENSG00000131845.15 ZNF304  2.660617e-06 0.01722679
## ENSG00000277632.2 CCL3     3.056028e-06 0.01722679
## ENSG00000179593.16 ALOX15B 3.897024e-06 0.01722679
## ENSG00000122644.13 ARL4A   5.588112e-06 0.01976180
## ENSG00000229807.13 XIST    1.175361e-05 0.03133750
## ENSG00000162599.17 NFIA    1.240598e-05 0.03133750
## ENSG00000276085.1 CCL3L1   2.905975e-05 0.06039029
## ENSG00000079215.15 SLC1A3  3.073818e-05 0.06039029
## ENSG00000115306.16 SPTBN1  5.842493e-05 0.09853338
mean(abs(dge$stat))
## [1] 0.8180621
avb_t0 <- dge

# model with clinical and cell covariates
# Monocytes.C NK T.CD8.Memory T.CD4.Naive Neutrophils.LD
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS +
    Monocytes.C + NK + T.CD8.Memory + T.CD4.Naive + Neutrophils.LD + treatment_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   the design formula contains one or more numeric variables that have mean or
##   standard deviation larger than 5 (an arbitrary threshold to trigger this message).
##   Including numeric variables with large mean can induce collinearity with the intercept.
##   Users should center and scale numeric variables in the design to improve GLM convergence.
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 22 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                               baseMean log2FoldChange      lfcSE      stat
## ENSG00000169429.11 CXCL8    1371.70225     -2.0614293 0.36628836 -5.627886
## ENSG00000131845.15 ZNF304    418.79903      0.2742914 0.05932016  4.623915
## ENSG00000234665.9 LERFS       41.30684     -1.7954846 0.40114817 -4.475864
## ENSG00000122644.13 ARL4A     383.47521     -0.6387885 0.14587916 -4.378888
## ENSG00000104361.10 NIPAL2    763.75731     -0.3251850 0.07817289 -4.159818
## ENSG00000276085.1 CCL3L1     308.64747     -1.2043196 0.29535827 -4.077488
## ENSG00000162599.17 NFIA      232.38832     -0.3313865 0.08168434 -4.056916
## ENSG00000256128.6 LINC00944  120.56609     -0.4234680 0.10605120 -3.993052
## ENSG00000166394.15 CYB5R2     33.12472     -0.5263833 0.13248018 -3.973299
## ENSG00000115306.16 SPTBN1   3986.49830      0.1888577 0.04792235  3.940910
##                                   pvalue         padj
## ENSG00000169429.11 CXCL8    1.824312e-08 0.0004001629
## ENSG00000131845.15 ZNF304   3.765643e-06 0.0412996946
## ENSG00000234665.9 LERFS     7.610294e-06 0.0556439312
## ENSG00000122644.13 ARL4A    1.192864e-05 0.0654136686
## ENSG00000104361.10 NIPAL2   3.185017e-05 0.1397266985
## ENSG00000276085.1 CCL3L1    4.552497e-05 0.1558170057
## ENSG00000162599.17 NFIA     4.972505e-05 0.1558170057
## ENSG00000256128.6 LINC00944 6.522817e-05 0.1618680799
## ENSG00000166394.15 CYB5R2   7.088411e-05 0.1618680799
## ENSG00000115306.16 SPTBN1   8.117315e-05 0.1618680799
mean(abs(dge$stat))
## [1] 0.8368417
avb_t0_adj <- dge

Treatment A vs B at EOS

mx <- xeosf
ss2 <- as.data.frame(cbind(ss_eos,sscell_eos))
mx <- mx[,colnames(mx) %in% rownames(ss2)]

# base model
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ treatment_group )
## converting counts to integer mode
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
## -- replacing outliers and refitting for 129 genes
## -- DESeq argument 'minReplicatesForReplace' = 7 
## -- original counts are preserved in counts(dds)
## estimating dispersions
## fitting model and testing
z <- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                   baseMean log2FoldChange      lfcSE      stat
## ENSG00000164056.11 SPRY1         165.16703     -2.6495876 0.15023175 -17.63667
## ENSG00000141744.4 PNMT            87.09740     -3.6453219 0.21308129 -17.10766
## ENSG00000048740.18 CELF2       14860.56325     -0.8538206 0.06266085 -13.62606
## ENSG00000279359.1 RP11-36D19.9   103.42684     -3.9721070 0.31107434 -12.76900
## ENSG00000179593.16 ALOX15B       847.15559     -3.1265685 0.24545606 -12.73779
## ENSG00000057294.16 PKP2          172.03315     -2.2928606 0.18394552 -12.46489
## ENSG00000064300.9 NGFR            61.81062     -2.2893270 0.18445275 -12.41145
## ENSG00000196935.9 SRGAP1         329.84060     -1.7220092 0.14799455 -11.63563
## ENSG00000272870.3 SAP30-DT       136.77299     -0.7521312 0.06569743 -11.44841
## ENSG00000145990.11 GFOD1        1933.33604     -1.2571490 0.11028762 -11.39882
##                                      pvalue         padj
## ENSG00000164056.11 SPRY1       1.288377e-69 2.843061e-65
## ENSG00000141744.4 PNMT         1.301255e-65 1.435740e-61
## ENSG00000048740.18 CELF2       2.802994e-42 2.061789e-38
## ENSG00000279359.1 RP11-36D19.9 2.442852e-37 1.347661e-33
## ENSG00000179593.16 ALOX15B     3.645637e-37 1.608966e-33
## ENSG00000057294.16 PKP2        1.160326e-35 4.267485e-32
## ENSG00000064300.9 NGFR         2.265006e-35 7.140270e-32
## ENSG00000196935.9 SRGAP1       2.715924e-31 7.491537e-28
## ENSG00000272870.3 SAP30-DT     2.394942e-30 5.872132e-27
## ENSG00000145990.11 GFOD1       4.238097e-30 9.352208e-27
mean(abs(dge$stat))
## [1] 1.492199
# model with clinical covariates
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS + treatment_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 14 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                   baseMean log2FoldChange      lfcSE      stat
## ENSG00000164056.11 SPRY1         165.16703     -2.7059237 0.15638312 -17.30317
## ENSG00000141744.4 PNMT            87.09740     -3.5010599 0.21937506 -15.95924
## ENSG00000279359.1 RP11-36D19.9   103.42684     -4.2902517 0.32298993 -13.28293
## ENSG00000179593.16 ALOX15B       847.15559     -3.2375724 0.25327794 -12.78269
## ENSG00000196935.9 SRGAP1         329.84060     -1.8289813 0.14310723 -12.78050
## ENSG00000048740.18 CELF2       14860.56325     -0.8384829 0.06660418 -12.58904
## ENSG00000057294.16 PKP2          172.03315     -2.2412930 0.18649597 -12.01792
## ENSG00000064300.9 NGFR            61.81062     -2.3210963 0.19383753 -11.97444
## ENSG00000272870.3 SAP30-DT       136.77299     -0.7544104 0.06880368 -10.96468
## ENSG00000145990.11 GFOD1        1933.33604     -1.2370843 0.11592467 -10.67145
##                                      pvalue         padj
## ENSG00000164056.11 SPRY1       4.452072e-67 9.824386e-63
## ENSG00000141744.4 PNMT         2.456924e-57 2.710847e-53
## ENSG00000279359.1 RP11-36D19.9 2.908007e-40 2.139033e-36
## ENSG00000179593.16 ALOX15B     2.048692e-37 9.300053e-34
## ENSG00000196935.9 SRGAP1       2.107231e-37 9.300053e-34
## ENSG00000048740.18 CELF2       2.425963e-36 8.922286e-33
## ENSG00000057294.16 PKP2        2.860952e-33 9.018946e-30
## ENSG00000064300.9 NGFR         4.836794e-33 1.334169e-29
## ENSG00000272870.3 SAP30-DT     5.649914e-28 1.385296e-24
## ENSG00000145990.11 GFOD1       1.384500e-26 3.055175e-23
mean(abs(dge$stat))
## [1] 1.414198
avb_eos <- dge

# model with clinical and cell covariates
# Monocytes.C NK T.CD8.Memory T.CD4.Naive Neutrophils.LD
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS +
    Monocytes.C + NK + T.CD8.Memory + T.CD4.Naive + Neutrophils.LD + treatment_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   the design formula contains one or more numeric variables that have mean or
##   standard deviation larger than 5 (an arbitrary threshold to trigger this message).
##   Including numeric variables with large mean can induce collinearity with the intercept.
##   Users should center and scale numeric variables in the design to improve GLM convergence.
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 13 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                  baseMean log2FoldChange      lfcSE      stat
## ENSG00000164056.11 SPRY1         165.1670     -2.7923982 0.17387074 -16.06020
## ENSG00000179593.16 ALOX15B       847.1556     -3.8150687 0.26013490 -14.66573
## ENSG00000198585.12 NUDT16       5301.4426     -1.3105279 0.09401216 -13.93998
## ENSG00000135678.12 CPM           575.4329     -1.7177297 0.12683010 -13.54355
## ENSG00000111666.11 CHPT1        1197.7668     -1.0307176 0.07716078 -13.35805
## ENSG00000279359.1 RP11-36D19.9   103.4268     -4.1756341 0.32422360 -12.87887
## ENSG00000141744.4 PNMT            87.0974     -3.0318991 0.23852957 -12.71079
## ENSG00000177575.13 CD163       25120.8560     -2.0894785 0.16631212 -12.56360
## ENSG00000171105.14 INSR         1211.6882     -1.3065370 0.10720954 -12.18676
## ENSG00000136478.8 TEX2           944.3836     -0.9718897 0.08209004 -11.83931
##                                      pvalue         padj
## ENSG00000164056.11 SPRY1       4.850141e-58 1.070281e-53
## ENSG00000179593.16 ALOX15B     1.068588e-48 1.179026e-44
## ENSG00000198585.12 NUDT16      3.620236e-44 2.662925e-40
## ENSG00000135678.12 CPM         8.650618e-42 4.772330e-38
## ENSG00000111666.11 CHPT1       1.063123e-40 4.691985e-37
## ENSG00000279359.1 RP11-36D19.9 5.919469e-38 2.177082e-34
## ENSG00000141744.4 PNMT         5.151192e-37 1.623877e-33
## ENSG00000177575.13 CD163       3.347618e-36 9.233985e-33
## ENSG00000171105.14 INSR        3.656678e-34 8.965767e-31
## ENSG00000136478.8 TEX2         2.444450e-32 5.394168e-29
mean(abs(dge$stat))
## [1] 1.213855
avb_eos_adj <- dge

Treatment A vs B at POD1

mx <- xpod1f
ss2 <- as.data.frame(cbind(ss_pod1,sscell_pod1))
mx <- mx[,colnames(mx) %in% rownames(ss2)]

# base model
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ treatment_group )
## converting counts to integer mode
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
## -- replacing outliers and refitting for 253 genes
## -- DESeq argument 'minReplicatesForReplace' = 7 
## -- original counts are preserved in counts(dds)
## estimating dispersions
## fitting model and testing
z <- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                  baseMean log2FoldChange      lfcSE      stat
## ENSG00000186081.12 KRT5          14.54120      2.1890736 0.27368008  7.998659
## ENSG00000115414.21 FN1          184.93708     -1.5590144 0.21045312 -7.407894
## ENSG00000155659.15 VSIG4       1506.08672     -2.0082041 0.28041210 -7.161617
## ENSG00000149534.9 MS4A2          83.83329      1.4807287 0.21267882  6.962276
## ENSG00000154269.15 ENPP3         37.09384      1.2813396 0.18714544  6.846758
## ENSG00000131016.17 AKAP12       103.10713      1.4235129 0.21406789  6.649820
## ENSG00000259162.1 RP11-203M5.6   24.74288      1.3334574 0.20408383  6.533871
## ENSG00000140287.11 HDC          496.98643      1.4313408 0.22105777  6.474963
## ENSG00000179348.12 GATA2        687.51559      1.2570611 0.19461993  6.459056
## ENSG00000163050.18 COQ8A       2009.95700     -0.3111471 0.04862536 -6.398865
##                                      pvalue         padj
## ENSG00000186081.12 KRT5        1.257816e-15 2.680784e-11
## ENSG00000115414.21 FN1         1.283207e-13 1.367449e-09
## ENSG00000155659.15 VSIG4       7.973092e-13 5.664350e-09
## ENSG00000149534.9 MS4A2        3.348181e-12 1.783995e-08
## ENSG00000154269.15 ENPP3       7.554214e-12 3.220059e-08
## ENSG00000131016.17 AKAP12      2.934514e-11 1.042388e-07
## ENSG00000259162.1 RP11-203M5.6 6.409120e-11 1.951394e-07
## ENSG00000140287.11 HDC         9.483534e-11 2.494996e-07
## ENSG00000179348.12 GATA2       1.053581e-10 2.494996e-07
## ENSG00000163050.18 COQ8A       1.565362e-10 3.336256e-07
mean(abs(dge$stat))
## [1] 1.083107
# model with clinical covariates
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS + treatment_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 19 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                  baseMean log2FoldChange     lfcSE      stat
## ENSG00000186081.12 KRT5          14.54120       2.189179 0.2813120  7.782032
## ENSG00000155659.15 VSIG4       1506.08672      -2.046371 0.2808756 -7.285686
## ENSG00000149534.9 MS4A2          83.83329       1.501000 0.2091159  7.177839
## ENSG00000259162.1 RP11-203M5.6   24.74288       1.419827 0.1981389  7.165817
## ENSG00000229961.3 RP11-71G12.1   66.93635       1.279558 0.1908412  6.704834
## ENSG00000154269.15 ENPP3         37.09384       1.266610 0.1901442  6.661315
## ENSG00000131016.17 AKAP12       103.10713       1.405739 0.2170297  6.477170
## ENSG00000179348.12 GATA2        687.51559       1.268771 0.1991819  6.369909
## ENSG00000115414.21 FN1          184.93708      -1.183497 0.1874768 -6.312766
## ENSG00000140287.11 HDC          496.98643       1.423136 0.2259646  6.298047
##                                      pvalue         padj
## ENSG00000186081.12 KRT5        7.136868e-15 1.521081e-10
## ENSG00000155659.15 VSIG4       3.200364e-13 3.410468e-09
## ENSG00000149534.9 MS4A2        7.082214e-13 4.120010e-09
## ENSG00000259162.1 RP11-203M5.6 7.732388e-13 4.120010e-09
## ENSG00000229961.3 RP11-71G12.1 2.016353e-11 8.594904e-08
## ENSG00000154269.15 ENPP3       2.713883e-11 9.640164e-08
## ENSG00000131016.17 AKAP12      9.345891e-11 2.845557e-07
## ENSG00000179348.12 GATA2       1.891400e-10 5.038926e-07
## ENSG00000115414.21 FN1         2.740912e-10 6.424139e-07
## ENSG00000140287.11 HDC         3.014188e-10 6.424139e-07
mean(abs(dge$stat))
## [1] 0.947625
avb_pod1 <- dge

# model with clinical and cell covariates
# Monocytes.C NK T.CD8.Memory T.CD4.Naive Neutrophils.LD
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS +
    Monocytes.C + NK + T.CD8.Memory + T.CD4.Naive + Neutrophils.LD + treatment_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   the design formula contains one or more numeric variables that have mean or
##   standard deviation larger than 5 (an arbitrary threshold to trigger this message).
##   Including numeric variables with large mean can induce collinearity with the intercept.
##   Users should center and scale numeric variables in the design to improve GLM convergence.
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 7 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                   baseMean log2FoldChange      lfcSE      stat
## ENSG00000186081.12 KRT5           14.54120      2.2389705 0.28501584  7.855600
## ENSG00000155659.15 VSIG4        1506.08672     -1.8413863 0.23966497 -7.683168
## ENSG00000259162.1 RP11-203M5.6    24.74288      1.4492545 0.19622316  7.385746
## ENSG00000229961.3 RP11-71G12.1    66.93635      1.3530051 0.19043462  7.104828
## ENSG00000149534.9 MS4A2           83.83329      1.4271747 0.20531024  6.951308
## ENSG00000105426.17 PTPRS         203.16124      0.8200685 0.12225142  6.708049
## ENSG00000131016.17 AKAP12        103.10713      1.4256435 0.21310542  6.689851
## ENSG00000154269.15 ENPP3          37.09384      1.1882697 0.18396236  6.459309
## ENSG00000135218.19 CD36        11489.98755      0.4990621 0.07877094  6.335612
## ENSG00000070915.10 SLC12A3        21.89994      1.1148229 0.17749304  6.280938
##                                      pvalue         padj
## ENSG00000186081.12 KRT5        3.978615e-15 8.479621e-11
## ENSG00000155659.15 VSIG4       1.552015e-14 1.653905e-10
## ENSG00000259162.1 RP11-203M5.6 1.516008e-13 1.077023e-09
## ENSG00000229961.3 RP11-71G12.1 1.204729e-12 6.419095e-09
## ENSG00000149534.9 MS4A2        3.619152e-12 1.542700e-08
## ENSG00000105426.17 PTPRS       1.972438e-11 6.801829e-08
## ENSG00000131016.17 AKAP12      2.233979e-11 6.801829e-08
## ENSG00000154269.15 ENPP3       1.051821e-10 2.802183e-07
## ENSG00000135218.19 CD36        2.364016e-10 5.598252e-07
## ENSG00000070915.10 SLC12A3     3.365354e-10 7.172578e-07
mean(abs(dge$stat))
## [1] 1.031508
avb_pod1_adj <- dge

Treatment group differences stratified

Treatment A vs B t0 in CRP low group

mx <- xt0f
ss2 <- as.data.frame(cbind(ss_t0,sscell_t0))
ss2 <- subset(ss2,crp_group==1)
mx <- mx[,colnames(mx) %in% rownames(ss2)]

# base model
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ treatment_group )
## converting counts to integer mode
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
## -- replacing outliers and refitting for 480 genes
## -- DESeq argument 'minReplicatesForReplace' = 7 
## -- original counts are preserved in counts(dds)
## estimating dispersions
## fitting model and testing
z <- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                  baseMean log2FoldChange     lfcSE      stat
## ENSG00000279359.1 RP11-36D19.9  39.871182     -3.3255603 0.6426406 -5.174837
## ENSG00000141744.4 PNMT          51.670695     -2.1905424 0.4563927 -4.799687
## ENSG00000204936.10 CD177       229.544285     -2.5908627 0.5761080 -4.497182
## ENSG00000169429.11 CXCL8       901.340924     -2.4617931 0.5620815 -4.379780
## ENSG00000179593.16 ALOX15B     395.592390     -2.3562217 0.5403176 -4.360808
## ENSG00000122644.13 ARL4A       438.849245     -0.9185857 0.2291829 -4.008090
## ENSG00000115155.19 OTOF        120.892044      1.2138657 0.3046429  3.984553
## ENSG00000258471.2 RP11-84C10.4  14.882458      0.8381249 0.2161208  3.878039
## ENSG00000253230.9 MIR124-1HG     8.779545     -3.3333199 0.8661717 -3.848336
## ENSG00000079215.15 SLC1A3      309.537268     -2.0483519 0.5335749 -3.838921
##                                      pvalue        padj
## ENSG00000279359.1 RP11-36D19.9 2.281100e-07 0.005003594
## ENSG00000141744.4 PNMT         1.589136e-06 0.017428844
## ENSG00000204936.10 CD177       6.885989e-06 0.050348057
## ENSG00000169429.11 CXCL8       1.187994e-05 0.056847985
## ENSG00000179593.16 ALOX15B     1.295828e-05 0.056847985
## ENSG00000122644.13 ARL4A       6.121173e-05 0.211852584
## ENSG00000115155.19 OTOF        6.760739e-05 0.211852584
## ENSG00000258471.2 RP11-84C10.4 1.053019e-04 0.257544790
## ENSG00000253230.9 MIR124-1HG   1.189227e-04 0.257544790
## ENSG00000079215.15 SLC1A3      1.235763e-04 0.257544790
mean(abs(dge$stat))
## [1] 0.7426341
# model with clinical covariates
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS + treatment_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 20 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                  baseMean log2FoldChange     lfcSE      stat
## ENSG00000123838.11 C4BPA         56.27087      4.1711659 0.7549682  5.524956
## ENSG00000115155.19 OTOF         120.89204      1.3340109 0.2995082  4.454005
## ENSG00000258471.2 RP11-84C10.4   14.88246      0.9535482 0.2237348  4.261957
## ENSG00000234665.9 LERFS          57.91435     -2.2458162 0.5334487 -4.209995
## ENSG00000119922.11 IFIT2       1771.40268      1.5450687 0.3900461  3.961246
## ENSG00000126262.5 FFAR2        1188.14797      1.9518484 0.5036095  3.875718
## ENSG00000185745.10 IFIT1        822.12911      1.4987801 0.3868363  3.874456
## ENSG00000215630.6 GUSBP9        203.39614     -0.6165686 0.1653777 -3.728245
## ENSG00000119917.15 IFIT3       1355.72352      1.3841010 0.3721027  3.719675
## ENSG00000287095.1 CTC-215C12.2   51.19664      0.7011972 0.1942702  3.609391
##                                      pvalue         padj
## ENSG00000123838.11 C4BPA       3.295688e-08 0.0007229091
## ENSG00000115155.19 OTOF        8.428327e-06 0.0924376784
## ENSG00000258471.2 RP11-84C10.4 2.026442e-05 0.1400421942
## ENSG00000234665.9 LERFS        2.553767e-05 0.1400421942
## ENSG00000119922.11 IFIT2       7.455966e-05 0.3270932241
## ENSG00000126262.5 FFAR2        1.063107e-04 0.3348632016
## ENSG00000185745.10 IFIT1       1.068631e-04 0.3348632016
## ENSG00000215630.6 GUSBP9       1.928181e-04 0.4861753379
## ENSG00000119917.15 IFIT3       1.994793e-04 0.4861753379
## ENSG00000287095.1 CTC-215C12.2 3.069169e-04 0.5721555858
mean(abs(dge$stat))
## [1] 0.74519
avb_crplo_t0 <- dge

# model with clinical and cell covariates
# Monocytes.C NK T.CD8.Memory T.CD4.Naive Neutrophils.LD
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS +
    Monocytes.C + NK + T.CD8.Memory + T.CD4.Naive + Neutrophils.LD + treatment_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   the design formula contains one or more numeric variables that have mean or
##   standard deviation larger than 5 (an arbitrary threshold to trigger this message).
##   Including numeric variables with large mean can induce collinearity with the intercept.
##   Users should center and scale numeric variables in the design to improve GLM convergence.
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 36 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                  baseMean log2FoldChange      lfcSE      stat
## ENSG00000074803.20 SLC12A1       84.81635     -2.4687621 0.56636860 -4.358932
## ENSG00000198794.12 SCAMP5       140.06582      0.6687557 0.16129046  4.146282
## ENSG00000258471.2 RP11-84C10.4   14.88246      0.9213002 0.22556681  4.084378
## ENSG00000146426.19 TIAM2        156.83010      0.2658416 0.06670403  3.985391
## ENSG00000165029.17 ABCA1        721.16202      0.4761514 0.12104536  3.933661
## ENSG00000177191.2 B3GNT8        337.40623     -0.4161721 0.10764368 -3.866201
## ENSG00000215630.6 GUSBP9        203.39614     -0.5856877 0.15250674 -3.840405
## ENSG00000125384.7 PTGER2       3444.28853     -0.3095152 0.08088687 -3.826520
## ENSG00000115155.19 OTOF         120.89204      1.1760123 0.31810878  3.696887
## ENSG00000234665.9 LERFS          57.91435     -1.9741234 0.53705027 -3.675863
##                                      pvalue      padj
## ENSG00000074803.20 SLC12A1     1.306988e-05 0.2866878
## ENSG00000198794.12 SCAMP5      3.379179e-05 0.3231391
## ENSG00000258471.2 RP11-84C10.4 4.419500e-05 0.3231391
## ENSG00000146426.19 TIAM2       6.736913e-05 0.3563548
## ENSG00000165029.17 ABCA1       8.366188e-05 0.3563548
## ENSG00000177191.2 B3GNT8       1.105439e-04 0.3563548
## ENSG00000215630.6 GUSBP9       1.228314e-04 0.3563548
## ENSG00000125384.7 PTGER2       1.299676e-04 0.3563548
## ENSG00000115155.19 OTOF        2.182591e-04 0.5030785
## ENSG00000234665.9 LERFS        2.370464e-04 0.5030785
mean(abs(dge$stat))
## [1] 0.7355223
avb_crplo_t0_adj <- dge

Treatment A vs B t0 in CRP high group

mx <- xt0f
ss2 <- as.data.frame(cbind(ss_t0,sscell_t0))
ss2 <- subset(ss2,crp_group==4)
mx <- mx[,colnames(mx) %in% rownames(ss2)]

# base model
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ treatment_group )
## converting counts to integer mode
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
## -- replacing outliers and refitting for 280 genes
## -- DESeq argument 'minReplicatesForReplace' = 7 
## -- original counts are preserved in counts(dds)
## estimating dispersions
## fitting model and testing
z <- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                 baseMean log2FoldChange     lfcSE      stat
## ENSG00000211652.2 IGLV7-43      57.72448      2.1239087 0.4170212  5.093048
## ENSG00000276085.1 CCL3L1       255.05022     -2.1290046 0.4413594 -4.823744
## ENSG00000263711.6 LINC02864     15.37815     -1.0912344 0.2360114 -4.623651
## ENSG00000211655.3 IGLV1-36      15.01384      1.7966484 0.3932588  4.568616
## ENSG00000278920.1 RP3-412A9.17 103.00331     -0.4584785 0.1045193 -4.386546
## ENSG00000211644.3 IGLV1-51     213.01635      1.6268219 0.3714944  4.379130
## ENSG00000211640.4 IGLV6-57      85.08443      1.7610091 0.4123498  4.270669
## ENSG00000211673.2 IGLV3-1      232.41139      1.6806179 0.3957575  4.246585
## ENSG00000211659.2 IGLV3-25     147.02115      1.3601124 0.3264996  4.165740
## ENSG00000203999.9 LINC01270    100.96329     -0.9138279 0.2252296 -4.057317
##                                      pvalue        padj
## ENSG00000211652.2 IGLV7-43     3.523525e-07 0.007728851
## ENSG00000276085.1 CCL3L1       1.408886e-06 0.015451954
## ENSG00000263711.6 LINC02864    3.770448e-06 0.026922780
## ENSG00000211655.3 IGLV1-36     4.909556e-06 0.026922780
## ENSG00000278920.1 RP3-412A9.17 1.151649e-05 0.043560797
## ENSG00000211644.3 IGLV1-51     1.191542e-05 0.043560797
## ENSG00000211640.4 IGLV6-57     1.948878e-05 0.059513437
## ENSG00000211673.2 IGLV3-1      2.170538e-05 0.059513437
## ENSG00000211659.2 IGLV3-25     3.103448e-05 0.075637926
## ENSG00000203999.9 LINC01270    4.963970e-05 0.108884692
mean(abs(dge$stat))
## [1] 0.9391897
# model with clinical covariates
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS + treatment_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 11 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                   baseMean log2FoldChange     lfcSE      stat
## ENSG00000274611.4 TBC1D3          75.11060     30.0000000 3.4788124  8.623633
## ENSG00000225630.1 MTND2P28       130.06123     -2.3686307 0.4535022 -5.222975
## ENSG00000276085.1 CCL3L1         255.05022     -2.3116418 0.4587641 -5.038847
## ENSG00000211652.2 IGLV7-43        57.72448      2.0854416 0.4313195  4.835027
## ENSG00000278920.1 RP3-412A9.17   103.00331     -0.5045173 0.1058888 -4.764595
## ENSG00000263711.6 LINC02864       15.37815     -1.0913346 0.2490844 -4.381385
## ENSG00000211935.3 IGHV1-3        103.80490      1.9185937 0.4471155  4.291047
## ENSG00000272763.1 RP11-357H14.17  12.74908     -1.7976987 0.4292167 -4.188324
## ENSG00000248801.7 C8orf34-AS1     64.73886     -0.4796651 0.1151577 -4.165288
## ENSG00000211655.3 IGLV1-36        15.01384      1.5932344 0.3874480  4.112124
##                                        pvalue         padj
## ENSG00000274611.4 TBC1D3         6.486304e-18 1.422771e-13
## ENSG00000225630.1 MTND2P28       1.760713e-07 1.931062e-03
## ENSG00000276085.1 CCL3L1         4.683455e-07 3.424386e-03
## ENSG00000211652.2 IGLV7-43       1.331273e-06 7.300367e-03
## ENSG00000278920.1 RP3-412A9.17   1.892337e-06 8.301684e-03
## ENSG00000263711.6 LINC02864      1.179272e-05 4.311221e-02
## ENSG00000211935.3 IGHV1-3        1.778326e-05 5.572511e-02
## ENSG00000272763.1 RP11-357H14.17 2.810225e-05 7.578765e-02
## ENSG00000248801.7 C8orf34-AS1    3.109591e-05 7.578765e-02
## ENSG00000211655.3 IGLV1-36       3.920355e-05 8.599298e-02
mean(abs(dge$stat))
## [1] 0.9640175
avb_crphi_t0 <- dge

# model with clinical and cell covariates
# Monocytes.C NK T.CD8.Memory T.CD4.Naive Neutrophils.LD
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS +
    Monocytes.C + NK + T.CD8.Memory + T.CD4.Naive + Neutrophils.LD + treatment_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   the design formula contains one or more numeric variables that have mean or
##   standard deviation larger than 5 (an arbitrary threshold to trigger this message).
##   Including numeric variables with large mean can induce collinearity with the intercept.
##   Users should center and scale numeric variables in the design to improve GLM convergence.
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 46 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                   baseMean log2FoldChange      lfcSE      stat
## ENSG00000278920.1 RP3-412A9.17   103.00331     -0.5815433 0.10376866 -5.604229
## ENSG00000184166.3 OR1D2           43.84299     -0.7606212 0.14772354 -5.148950
## ENSG00000130368.7 MAS1            36.87331     -0.6653172 0.13143908 -5.061791
## ENSG00000243290.3 IGKV1-12        66.84308      1.3286837 0.28373948  4.682759
## ENSG00000100304.13 TTLL12       1016.56775      0.3673839 0.07974225  4.607142
## ENSG00000248801.7 C8orf34-AS1     64.73886     -0.5485504 0.12079590 -4.541134
## ENSG00000261501.1 BBS7-DT         61.88604     -0.6923032 0.15272857 -4.532899
## ENSG00000287671.1 RP11-728E14.5  125.36742     -0.5274317 0.11684949 -4.513770
## ENSG00000142910.16 TINAGL1        22.44874     -0.6820573 0.15340323 -4.446173
## ENSG00000229321.2 AC008269.2      16.95875     -0.7855292 0.17956581 -4.374604
##                                       pvalue         padj
## ENSG00000278920.1 RP3-412A9.17  2.091843e-08 0.0004588459
## ENSG00000184166.3 OR1D2         2.619485e-07 0.0028729202
## ENSG00000130368.7 MAS1          4.153352e-07 0.0030367928
## ENSG00000243290.3 IGKV1-12      2.830389e-06 0.0155211476
## ENSG00000100304.13 TTLL12       4.082404e-06 0.0174617324
## ENSG00000248801.7 C8orf34-AS1   5.595247e-06 0.0174617324
## ENSG00000261501.1 BBS7-DT       5.817969e-06 0.0174617324
## ENSG00000287671.1 RP11-728E14.5 6.368537e-06 0.0174617324
## ENSG00000142910.16 TINAGL1      8.741345e-06 0.0213046007
## ENSG00000229321.2 AC008269.2    1.216533e-05 0.0248290026
mean(abs(dge$stat))
## [1] 1.015188
avb_crphi_t0_adj <- dge

Treatment A vs B EOS in CRP low group

mx <- xeosf
ss2 <- as.data.frame(cbind(ss_eos,sscell_eos))
ss2 <- subset(ss2,crp_group==1)
mx <- mx[,colnames(mx) %in% rownames(ss2)]

# base model
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ treatment_group )
## converting counts to integer mode
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
## -- replacing outliers and refitting for 107 genes
## -- DESeq argument 'minReplicatesForReplace' = 7 
## -- original counts are preserved in counts(dds)
## estimating dispersions
## fitting model and testing
z <- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                   baseMean log2FoldChange      lfcSE       stat
## ENSG00000279359.1 RP11-36D19.9   119.04727     -5.1395504 0.37985433 -13.530320
## ENSG00000141744.4 PNMT           139.75155     -3.9629221 0.29974528 -13.220966
## ENSG00000164056.11 SPRY1         233.24893     -2.7293406 0.22123908 -12.336611
## ENSG00000101187.16 SLCO4A1       173.38666     -2.6729667 0.23016884 -11.613069
## ENSG00000145990.11 GFOD1        2388.12563     -1.6208396 0.15147358 -10.700478
## ENSG00000048740.18 CELF2       17256.47082     -0.9431284 0.08907268 -10.588301
## ENSG00000079215.15 SLC1A3       1233.66208     -3.3548344 0.32004337 -10.482437
## ENSG00000064300.9 NGFR            79.80579     -2.7214417 0.27282216  -9.975149
## ENSG00000057294.16 PKP2          259.99533     -2.5509565 0.28208476  -9.043227
## ENSG00000168807.16 SNTB2        1676.95276     -0.9053557 0.10490101  -8.630572
##                                      pvalue         padj
## ENSG00000279359.1 RP11-36D19.9 1.035724e-41 2.285429e-37
## ENSG00000141744.4 PNMT         6.640567e-40 7.326538e-36
## ENSG00000164056.11 SPRY1       5.752639e-35 4.231258e-31
## ENSG00000101187.16 SLCO4A1     3.536877e-31 1.951118e-27
## ENSG00000145990.11 GFOD1       1.012550e-26 4.468585e-23
## ENSG00000048740.18 CELF2       3.376656e-26 1.241821e-22
## ENSG00000079215.15 SLC1A3      1.040281e-25 3.279263e-22
## ENSG00000064300.9 NGFR         1.958070e-23 5.400845e-20
## ENSG00000057294.16 PKP2        1.521137e-19 3.729489e-16
## ENSG00000168807.16 SNTB2       6.104587e-18 1.347038e-14
mean(abs(dge$stat))
## [1] 1.272032
# model with clinical covariates
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS + treatment_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 15 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                   baseMean log2FoldChange      lfcSE       stat
## ENSG00000279359.1 RP11-36D19.9   119.04727     -5.3472996 0.39841130 -13.421556
## ENSG00000141744.4 PNMT           139.75155     -3.7766877 0.30856468 -12.239533
## ENSG00000164056.11 SPRY1         233.24893     -2.8225809 0.23140843 -12.197399
## ENSG00000079215.15 SLC1A3       1233.66208     -3.7771409 0.31036871 -12.169851
## ENSG00000101187.16 SLCO4A1       173.38666     -2.7558923 0.24132532 -11.419822
## ENSG00000048740.18 CELF2       17256.47082     -0.9616907 0.09345649 -10.290251
## ENSG00000145990.11 GFOD1        2388.12563     -1.5620788 0.15651131  -9.980613
## ENSG00000057294.16 PKP2          259.99533     -2.7302298 0.28018872  -9.744253
## ENSG00000064300.9 NGFR            79.80579     -2.5660575 0.28091181  -9.134744
## ENSG00000119138.5 KLF9          2597.08994     -1.0787187 0.11881849  -9.078710
##                                      pvalue         padj
## ENSG00000279359.1 RP11-36D19.9 4.521201e-41 9.976935e-37
## ENSG00000141744.4 PNMT         1.911285e-34 2.108816e-30
## ENSG00000164056.11 SPRY1       3.209130e-34 2.360529e-30
## ENSG00000079215.15 SLC1A3      4.499038e-34 2.482007e-30
## ENSG00000101187.16 SLCO4A1     3.329137e-30 1.469281e-26
## ENSG00000048740.18 CELF2       7.797325e-25 2.867726e-21
## ENSG00000145990.11 GFOD1       1.853188e-23 5.842043e-20
## ENSG00000057294.16 PKP2        1.952090e-22 5.384597e-19
## ENSG00000064300.9 NGFR         6.556155e-20 1.607496e-16
## ENSG00000119138.5 KLF9         1.098688e-19 2.424474e-16
mean(abs(dge$stat))
## [1] 1.214828
avb_crplo_eos <- dge

# model with clinical and cell covariates
# Monocytes.C NK T.CD8.Memory T.CD4.Naive Neutrophils.LD
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS +
    Monocytes.C + NK + T.CD8.Memory + T.CD4.Naive + Neutrophils.LD + treatment_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   the design formula contains one or more numeric variables that have mean or
##   standard deviation larger than 5 (an arbitrary threshold to trigger this message).
##   Including numeric variables with large mean can induce collinearity with the intercept.
##   Users should center and scale numeric variables in the design to improve GLM convergence.
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 37 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                  baseMean log2FoldChange     lfcSE       stat
## ENSG00000279359.1 RP11-36D19.9   119.0473      -5.771853 0.4355807 -13.250941
## ENSG00000079215.15 SLC1A3       1233.6621      -4.437439 0.3485794 -12.730066
## ENSG00000164056.11 SPRY1         233.2489      -2.991515 0.2506529 -11.934894
## ENSG00000177575.13 CD163       22464.4744      -2.338915 0.2145180 -10.903118
## ENSG00000198363.18 ASPH         1869.6176      -1.762933 0.1692565 -10.415751
## ENSG00000101187.16 SLCO4A1       173.3867      -2.889167 0.2818292 -10.251480
## ENSG00000179593.16 ALOX15B      1208.5228      -4.514366 0.4436746 -10.174949
## ENSG00000174705.13 SH3PXD2B      449.8765      -2.978486 0.2929393 -10.167586
## ENSG00000111666.11 CHPT1        1299.4517      -1.180981 0.1223822  -9.649938
## ENSG00000135678.12 CPM           757.4190      -2.017817 0.2097879  -9.618366
##                                      pvalue         padj
## ENSG00000279359.1 RP11-36D19.9 4.455820e-40 9.832658e-36
## ENSG00000079215.15 SLC1A3      4.024988e-37 4.440971e-33
## ENSG00000164056.11 SPRY1       7.785798e-33 5.726973e-29
## ENSG00000177575.13 CD163       1.113747e-27 6.144261e-24
## ENSG00000198363.18 ASPH        2.101314e-25 9.273939e-22
## ENSG00000101187.16 SLCO4A1     1.165452e-24 4.286340e-21
## ENSG00000179593.16 ALOX15B     2.565331e-24 7.631877e-21
## ENSG00000174705.13 SH3PXD2B    2.766802e-24 7.631877e-21
## ENSG00000111666.11 CHPT1       4.918551e-22 1.205974e-18
## ENSG00000135678.12 CPM         6.688507e-22 1.475953e-18
mean(abs(dge$stat))
## [1] 1.063161
avb_crplo_eos_adj <- dge

Save DEX responsive genes. We will quantify DEX response then investigate patterns in t0 that associate with this reponse.

# save 10 dex genes
dex_genes <- rownames(head(subset(avb_crplo_eos_adj,log2FoldChange<0),10))
dex_genes
##  [1] "ENSG00000279359.1 RP11-36D19.9" "ENSG00000079215.15 SLC1A3"     
##  [3] "ENSG00000164056.11 SPRY1"       "ENSG00000177575.13 CD163"      
##  [5] "ENSG00000198363.18 ASPH"        "ENSG00000101187.16 SLCO4A1"    
##  [7] "ENSG00000179593.16 ALOX15B"     "ENSG00000174705.13 SH3PXD2B"   
##  [9] "ENSG00000111666.11 CHPT1"       "ENSG00000135678.12 CPM"
# Get normalised values
myrows <- which(rownames(avb_crplo_eos_adj) %in% dex_genes)
mycols <- grep("EOS",colnames(avb_crplo_eos_adj))
dexmx <- avb_crplo_eos_adj[myrows,mycols]
dim(dexmx)
## [1] 10 46
# get dex scores
dex_response_metric <- colSums(dexmx)
par(mar=c(5.1,8.1,2.1,2.1))
barplot(sort(dex_response_metric),las=1,cex.names=0.6,
  horiz=TRUE,xlab="Dex response metric",xlim=c(70,115),
  xpd = FALSE)

par(mar=c(5.1,4.1,4.1,2.1))

# Look at dex gene score across samples by treatment group
trt1 <- rownames(subset(ss2,treatment_group==1))
trt2 <- rownames(subset(ss2,treatment_group==2))
trt1_dex_response <- dex_response_metric[which(names(dex_response_metric) %in% trt1)]
trt2_dex_response <- dex_response_metric[which(names(dex_response_metric) %in% trt2)]
summary(trt1_dex_response)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   77.58   96.62  102.34  100.29  105.18  111.72
summary(trt2_dex_response)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   70.27   73.76   77.93   79.54   83.33   92.84
trt_dex_response_list <- list("Trt1"=trt1_dex_response,"Trt2"=trt2_dex_response)
boxplot(trt_dex_response_list,col="white",cex=0,ylab="dex score")
beeswarm(trt_dex_response_list,col="darkgray",pch=19,cex=2,add=TRUE)

# now look at effectiveness of dex response in 
infec <- read.table("infec.tsv",header=TRUE)
infectrue <- subset(infec,infection30d==1)$PG_number
infecfalse <- subset(infec,infection30d==0)$PG_number
names(dex_response_metric) <- gsub("-EOS","",names(dex_response_metric))
infectrue_dexresponse <- dex_response_metric[ names(dex_response_metric) %in% infectrue ]
infecfalse_dexresponse <- dex_response_metric[ names(dex_response_metric) %in% infecfalse ]
dex_response_list <- list("Infec"=infectrue_dexresponse,"NoInfec"=infecfalse_dexresponse)
boxplot(dex_response_list,col="white",cex=0,ylab="dex score")
beeswarm(dex_response_list,col="darkgray",pch=19,cex=2,add=TRUE)

t.test(infectrue_dexresponse,infecfalse_dexresponse)
## 
##  Welch Two Sample t-test
## 
## data:  infectrue_dexresponse and infecfalse_dexresponse
## t = -1.4331, df = 4.8251, p-value = 0.2133
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -24.986343   7.224344
## sample estimates:
## mean of x mean of y 
##  84.70911  93.59011

Associate dex response score in trt2 group with t=0 expression.

trt2_dex_response_scaled <- as.vector(scale(trt2_dex_response,center=TRUE))
names(trt2_dex_response_scaled) <- names(trt2_dex_response)
trt2_dex_response_df <- data.frame(trt2_dex_response_scaled)
rownames(trt2_dex_response_df) <- gsub("EOS","T0",rownames(trt2_dex_response_df))
mx <- xt0f
ss2 <- as.data.frame(cbind(ss_t0,sscell_t0))
ss3 <- merge(trt2_dex_response_df,ss2,by=0)
rownames(ss3) <- ss3$Row.names
mx <- mx[,colnames(mx) %in% rownames(ss3)]

# base model
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss3,
  design = ~ sexD + wound_typeOP + duration_sx + ageCS + trt2_dex_response_scaled )
## converting counts to integer mode
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
z <- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                   baseMean log2FoldChange     lfcSE       stat
## ENSG00000284554.2 CTA-150C2.22    7.988630    -25.7373705 2.3112125 -11.135874
## ENSG00000242534.3 IGKV2D-28       7.721722    -11.9464101 2.3042187  -5.184582
## ENSG00000235333.3 PVRIG2P        17.322720    -11.7238152 2.2842767  -5.132397
## ENSG00000274611.4 TBC1D3         98.760968      9.7608627 2.2450262   4.347772
## ENSG00000176749.9 CDK5R1        459.986881      0.6421002 0.1502502   4.273541
## ENSG00000123689.6 G0S2         8577.081659     -4.2893071 1.0117741  -4.239392
## ENSG00000204001.10 LCN8         118.326291      2.1286236 0.5138756   4.142294
## ENSG00000183117.19 CSMD1         66.213539      1.3570037 0.3304898   4.106038
## ENSG00000197549.9 PRAMENP        25.343084      1.0287261 0.2546918   4.039102
## ENSG00000274641.2 H2BC17         19.638809     -1.5987417 0.4065211  -3.932740
##                                      pvalue         padj
## ENSG00000284554.2 CTA-150C2.22 8.391806e-29 1.840659e-24
## ENSG00000242534.3 IGKV2D-28    2.165002e-07 2.091590e-03
## ENSG00000235333.3 PVRIG2P      2.860750e-07 2.091590e-03
## ENSG00000274611.4 TBC1D3       1.375273e-05 7.541312e-02
## ENSG00000176749.9 CDK5R1       1.923928e-05 8.193301e-02
## ENSG00000123689.6 G0S2         2.241260e-05 8.193301e-02
## ENSG00000204001.10 LCN8        3.438495e-05 1.077428e-01
## ENSG00000183117.19 CSMD1       4.025031e-05 1.103563e-01
## ENSG00000197549.9 PRAMENP      5.365618e-05 1.307661e-01
## ENSG00000274641.2 H2BC17       8.398310e-05 1.842085e-01
mean(abs(dge$stat))
## [1] NA

CSMD1 could be interpreted to be an inhibitor of DEX response.

trt2_dex_response2 <- trt2_dex_response[which(gsub("-EOS","-T0",names(trt2_dex_response)) %in% colnames(rpm))]

rpm <- apply(mx,2,function(x) { x/sum(x) * 1e6 } )

cor_res <- lapply(1:nrow(rpm), function(i) {
  unlist(cor.test(rpm[i,],trt2_dex_response2)[c(3,4)])
})
## Warning in cor(x, y): the standard deviation is zero
cor_df <- do.call(rbind,cor_res)
rownames(cor_df) <- rownames(rpm)
cor_df <- cor_df[order(cor_df[,"p.value"]),]
cor_df <- as.data.frame(cor_df)
cor_df$fdr <- p.adjust(cor_df$p.value)
head(cor_df,20)
##                                      p.value estimate.cor fdr
## ENSG00000277369.1 RP11-486I11.2 0.0001208918    0.8148046   1
## ENSG00000143479.18 DYRK3        0.0003297005   -0.7835221   1
## ENSG00000266718.2 RP11-466A19.1 0.0004948834    0.7692380   1
## ENSG00000256553.1 TRAV1-2       0.0011941397   -0.7344828   1
## ENSG00000241280.1 RP11-221J22.2 0.0017586674    0.7173561   1
## ENSG00000119915.5 ELOVL3        0.0019863136    0.7117111   1
## ENSG00000176749.9 CDK5R1        0.0020724582    0.7097116   1
## ENSG00000233845.1 AC093732.1    0.0024785758    0.7011053   1
## ENSG00000165874.13 SHLD2P1      0.0031503512    0.6891002   1
## ENSG00000219607.4 PPP1R3G       0.0036687059    0.6811814   1
## ENSG00000185924.7 RTN4RL1       0.0037910002    0.6794458   1
## ENSG00000254186.3 RP11-541P9.3  0.0039953533   -0.6766436   1
## ENSG00000182873.5 PRKCZ-AS1     0.0043995541   -0.6714239   1
## ENSG00000204584.1 RP11-304F15.3 0.0046492458    0.6683890   1
## ENSG00000251408.1 RP11-586D19.2 0.0047616191   -0.6670656   1
## ENSG00000183117.19 CSMD1        0.0050020910    0.6643156   1
## ENSG00000124785.9 NRN1          0.0052571995    0.6615116   1
## ENSG00000226124.8 FTCDNL1       0.0056111628    0.6577959   1
## ENSG00000094804.12 CDC6         0.0056585995   -0.6573123   1
## ENSG00000198535.5 C2CD4A        0.0060948847   -0.6530097   1

CSMD1 is in the top 20 however it wasn’t significant. DYRK3 appeared in the top spot using the simple pearson correlation however it wasn’t statistically significant.

Treatment A vs B EOS in CRP high group

mx <- xeosf
ss2 <- as.data.frame(cbind(ss_eos,sscell_eos))
ss2 <- subset(ss2,crp_group==4)
mx <- mx[,colnames(mx) %in% rownames(ss2)]

# base model
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ treatment_group )
## converting counts to integer mode
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
## -- replacing outliers and refitting for 138 genes
## -- DESeq argument 'minReplicatesForReplace' = 7 
## -- original counts are preserved in counts(dds)
## estimating dispersions
## fitting model and testing
z <- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                 baseMean log2FoldChange      lfcSE       stat
## ENSG00000164056.11 SPRY1       108.76416      -2.532611 0.23899712 -10.596828
## ENSG00000141744.4 PNMT          43.59054      -3.129900 0.34146482  -9.166098
## ENSG00000179593.16 ALOX15B     547.79622      -3.162199 0.34916134  -9.056555
## ENSG00000279359.1 RP11-36D19.9  90.34984      -4.142272 0.49438312  -8.378669
## ENSG00000196935.9 SRGAP1       282.89286      -1.854628 0.22365011  -8.292544
## ENSG00000078053.17 AMPH        157.80806      -2.281000 0.27608001  -8.262098
## ENSG00000162599.17 NFIA        308.67237      -1.033152 0.12746020  -8.105685
## ENSG00000272870.3 SAP30-DT     121.11095      -0.790170 0.09793683  -8.068160
## ENSG00000110721.12 CHKA        869.95783      -1.224275 0.15266598  -8.019306
## ENSG00000121578.13 B4GALT4     865.64102      -1.070193 0.13932538  -7.681251
##                                      pvalue         padj
## ENSG00000164056.11 SPRY1       3.082572e-26 6.802313e-22
## ENSG00000141744.4 PNMT         4.904496e-20 5.411376e-16
## ENSG00000179593.16 ALOX15B     1.346361e-19 9.903380e-16
## ENSG00000279359.1 RP11-36D19.9 5.352966e-17 2.953098e-13
## ENSG00000196935.9 SRGAP1       1.108512e-16 4.892306e-13
## ENSG00000078053.17 AMPH        1.431340e-16 5.264228e-13
## ENSG00000162599.17 NFIA        5.244902e-16 1.653418e-12
## ENSG00000272870.3 SAP30-DT     7.136550e-16 1.968528e-12
## ENSG00000110721.12 CHKA        1.063440e-15 2.607436e-12
## ENSG00000121578.13 B4GALT4     1.575425e-14 3.476490e-11
mean(abs(dge$stat))
## [1] 1.198902
# model with clinical covariates
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS + treatment_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   the design formula contains one or more numeric variables that have mean or
##   standard deviation larger than 5 (an arbitrary threshold to trigger this message).
##   Including numeric variables with large mean can induce collinearity with the intercept.
##   Users should center and scale numeric variables in the design to improve GLM convergence.
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 4 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                  baseMean log2FoldChange      lfcSE       stat
## ENSG00000164056.11 SPRY1        108.76416     -2.6668649 0.24704112 -10.795227
## ENSG00000279359.1 RP11-36D19.9   90.34984     -4.7806957 0.51198611  -9.337550
## ENSG00000141744.4 PNMT           43.59054     -3.2127745 0.34991481  -9.181590
## ENSG00000196935.9 SRGAP1        282.89286     -1.9362951 0.21148877  -9.155545
## ENSG00000179593.16 ALOX15B      547.79622     -3.1108104 0.36495565  -8.523804
## ENSG00000272870.3 SAP30-DT      121.11095     -0.8277754 0.09990025  -8.286020
## ENSG00000198585.12 NUDT16      4719.70533     -1.1852330 0.14956356  -7.924611
## ENSG00000121578.13 B4GALT4      865.64102     -1.0802468 0.13973364  -7.730757
## ENSG00000078053.17 AMPH         157.80806     -2.1961542 0.28426014  -7.725860
## ENSG00000124523.17 SIRT5        897.95933     -0.9857449 0.12942403  -7.616398
##                                      pvalue         padj
## ENSG00000164056.11 SPRY1       3.625670e-27 8.000766e-23
## ENSG00000279359.1 RP11-36D19.9 9.858924e-21 1.087784e-16
## ENSG00000141744.4 PNMT         4.247710e-20 2.983674e-16
## ENSG00000196935.9 SRGAP1       5.408392e-20 2.983674e-16
## ENSG00000179593.16 ALOX15B     1.543970e-17 6.814156e-14
## ENSG00000272870.3 SAP30-DT     1.171015e-16 4.306798e-13
## ENSG00000198585.12 NUDT16      2.288621e-15 7.214715e-12
## ENSG00000121578.13 B4GALT4     1.069090e-14 2.724055e-11
## ENSG00000078053.17 AMPH        1.111003e-14 2.724055e-11
## ENSG00000124523.17 SIRT5       2.608535e-14 5.404484e-11
mean(abs(dge$stat))
## [1] 1.268339
avb_crphi_eos <- dge

# model with clinical and cell covariates
# Monocytes.C NK T.CD8.Memory T.CD4.Naive Neutrophils.LD
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS +
    Monocytes.C + NK + T.CD8.Memory + T.CD4.Naive + Neutrophils.LD + treatment_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   the design formula contains one or more numeric variables that have mean or
##   standard deviation larger than 5 (an arbitrary threshold to trigger this message).
##   Including numeric variables with large mean can induce collinearity with the intercept.
##   Users should center and scale numeric variables in the design to improve GLM convergence.
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 20 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                   baseMean log2FoldChange     lfcSE      stat
## ENSG00000164056.11 SPRY1         108.76416     -2.6240004 0.2866809 -9.153035
## ENSG00000198585.12 NUDT16       4719.70533     -1.1065368 0.1246267 -8.878812
## ENSG00000179593.16 ALOX15B       547.79622     -2.9766733 0.3371682 -8.828453
## ENSG00000141744.4 PNMT            43.59054     -2.7567440 0.3639445 -7.574627
## ENSG00000135678.12 CPM           424.57761     -1.1706712 0.1570310 -7.455033
## ENSG00000136478.8 TEX2           868.89100     -0.8306822 0.1119672 -7.418975
## ENSG00000279359.1 RP11-36D19.9    90.34984     -3.6900821 0.4986320 -7.400412
## ENSG00000196935.9 SRGAP1         282.89286     -1.4946291 0.2031922 -7.355740
## ENSG00000177575.13 CD163       27248.95998     -1.9982460 0.2717813 -7.352403
## ENSG00000111666.11 CHPT1        1111.30704     -0.9224094 0.1255707 -7.345735
##                                      pvalue         padj
## ENSG00000164056.11 SPRY1       5.535587e-20 1.221538e-15
## ENSG00000198585.12 NUDT16      6.757819e-19 7.456240e-15
## ENSG00000179593.16 ALOX15B     1.061335e-18 7.806830e-15
## ENSG00000141744.4 PNMT         3.601611e-14 1.986919e-10
## ENSG00000135678.12 CPM         8.984554e-14 3.965243e-10
## ENSG00000136478.8 TEX2         1.180299e-13 4.279816e-10
## ENSG00000279359.1 RP11-36D19.9 1.357625e-13 4.279816e-10
## ENSG00000196935.9 SRGAP1       1.898724e-13 4.515586e-10
## ENSG00000177575.13 CD163       1.946745e-13 4.515586e-10
## ENSG00000111666.11 CHPT1       2.046307e-13 4.515586e-10
mean(abs(dge$stat))
## [1] 0.930019
avb_crphi_eos_adj <- dge

Treatment A vs B POD1 in CRP low group

mx <- xpod1f
ss2 <- as.data.frame(cbind(ss_pod1,sscell_pod1))
ss2 <- subset(ss2,crp_group==1)
mx <- mx[,colnames(mx) %in% rownames(ss2)]

# base model
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ treatment_group )
## converting counts to integer mode
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
## -- replacing outliers and refitting for 101 genes
## -- DESeq argument 'minReplicatesForReplace' = 7 
## -- original counts are preserved in counts(dds)
## estimating dispersions
## fitting model and testing
z <- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                  baseMean log2FoldChange     lfcSE      stat
## ENSG00000186081.12 KRT5          14.54816       2.576551 0.4235145  6.083739
## ENSG00000204044.6 SLC12A5-AS1    25.14097      -3.075518 0.5156713 -5.964106
## ENSG00000152463.15 OLAH          24.53332      -2.873612 0.4851144 -5.923576
## ENSG00000146072.6 TNFRSF21       42.89273       1.040202 0.1856047  5.604397
## ENSG00000259162.1 RP11-203M5.6   26.14874       1.581181 0.2897282  5.457464
## ENSG00000142627.13 EPHA2         19.20075       1.637299 0.3055916  5.357800
## ENSG00000204936.10 CD177        618.22625      -3.037256 0.5784007 -5.251128
## ENSG00000155659.15 VSIG4       1772.93303      -2.147337 0.4164836 -5.155873
## ENSG00000154269.15 ENPP3         32.41553       1.154158 0.2238815  5.155219
## ENSG00000229961.3 RP11-71G12.1   75.23398       1.526810 0.2963257  5.152473
##                                      pvalue         padj
## ENSG00000186081.12 KRT5        1.174117e-09 2.237975e-05
## ENSG00000204044.6 SLC12A5-AS1  2.459774e-09 2.237975e-05
## ENSG00000152463.15 OLAH        3.150155e-09 2.237975e-05
## ENSG00000146072.6 TNFRSF21     2.089813e-08 1.113505e-04
## ENSG00000259162.1 RP11-203M5.6 4.829843e-08 2.058769e-04
## ENSG00000142627.13 EPHA2       8.424125e-08 2.992389e-04
## ENSG00000204936.10 CD177       1.511709e-07 4.602722e-04
## ENSG00000155659.15 VSIG4       2.524517e-07 5.478997e-04
## ENSG00000154269.15 ENPP3       2.533344e-07 5.478997e-04
## ENSG00000229961.3 RP11-71G12.1 2.570730e-07 5.478997e-04
mean(abs(dge$stat))
## [1] 1.083967
# model with clinical covariates
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS + treatment_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 10 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                  baseMean log2FoldChange     lfcSE      stat
## ENSG00000155659.15 VSIG4       1772.93303     -2.8430229 0.3779008 -7.523199
## ENSG00000087116.16 ADAMTS2     1436.45625     -3.7809954 0.5047904 -7.490228
## ENSG00000186081.12 KRT5          14.54816      2.8196082 0.4406358  6.398953
## ENSG00000100985.7 MMP9         3694.58444     -2.9906166 0.5378907 -5.559897
## ENSG00000229961.3 RP11-71G12.1   75.23398      1.6244682 0.2922447  5.558589
## ENSG00000259162.1 RP11-203M5.6   26.14874      1.5474793 0.2819920  5.487672
## ENSG00000105223.20 PLD3        5830.74295     -0.5634004 0.1044934 -5.391731
## ENSG00000142627.13 EPHA2         19.20075      1.7165708 0.3199429  5.365241
## ENSG00000149534.9 MS4A2          73.42690      1.3047162 0.2497248  5.224615
## ENSG00000115590.14 IL1R2       1210.70599     -2.4983175 0.4790051 -5.215638
##                                      pvalue         padj
## ENSG00000155659.15 VSIG4       5.345199e-14 4.485859e-10
## ENSG00000087116.16 ADAMTS2     6.875406e-14 4.485859e-10
## ENSG00000186081.12 KRT5        1.564457e-10           NA
## ENSG00000100985.7 MMP9         2.699346e-08 1.174126e-04
## ENSG00000229961.3 RP11-71G12.1 2.719649e-08           NA
## ENSG00000259162.1 RP11-203M5.6 4.072656e-08           NA
## ENSG00000105223.20 PLD3        6.978235e-08 2.276475e-04
## ENSG00000142627.13 EPHA2       8.084104e-08           NA
## ENSG00000149534.9 MS4A2        1.745178e-07           NA
## ENSG00000115590.14 IL1R2       1.831854e-07 4.780772e-04
mean(abs(dge$stat))
## [1] 1.269181
avb_crplo_pod1 <- dge

# model with clinical and cell covariates
# Monocytes.C NK T.CD8.Memory T.CD4.Naive Neutrophils.LD
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS +
    Monocytes.C + NK + T.CD8.Memory + T.CD4.Naive + Neutrophils.LD + treatment_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   the design formula contains one or more numeric variables that have mean or
##   standard deviation larger than 5 (an arbitrary threshold to trigger this message).
##   Including numeric variables with large mean can induce collinearity with the intercept.
##   Users should center and scale numeric variables in the design to improve GLM convergence.
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 33 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                  baseMean log2FoldChange      lfcSE      stat
## ENSG00000155659.15 VSIG4       1772.93303     -2.0162400 0.33720409 -5.979287
## ENSG00000087116.16 ADAMTS2     1436.45625     -2.5921949 0.44416561 -5.836100
## ENSG00000186081.12 KRT5          14.54816      2.3884545 0.46530941  5.133046
## ENSG00000101004.15 NINL         135.28899     -0.8218318 0.16059437 -5.117438
## ENSG00000229961.3 RP11-71G12.1   75.23398      1.5446697 0.30769579  5.020120
## ENSG00000135218.19 CD36        8887.60274      0.5861706 0.12676967  4.623902
## ENSG00000259162.1 RP11-203M5.6   26.14874      1.3790996 0.29872568  4.616609
## ENSG00000149534.9 MS4A2          73.42690      1.1437686 0.24915411  4.590607
## ENSG00000146072.6 TNFRSF21       42.89273      0.9927942 0.21822909  4.549321
## ENSG00000102524.12 TNFSF13B    1891.40085      0.4415408 0.09736608  4.534853
##                                      pvalue         padj
## ENSG00000155659.15 VSIG4       2.241164e-09 4.776592e-05
## ENSG00000087116.16 ADAMTS2     5.343688e-09 5.694501e-05
## ENSG00000186081.12 KRT5        2.850904e-07 1.650232e-03
## ENSG00000101004.15 NINL        3.097138e-07 1.650232e-03
## ENSG00000229961.3 RP11-71G12.1 5.163931e-07 2.201177e-03
## ENSG00000135218.19 CD36        3.765871e-06 1.177433e-02
## ENSG00000259162.1 RP11-203M5.6 3.900617e-06 1.177433e-02
## ENSG00000149534.9 MS4A2        4.419586e-06 1.177433e-02
## ENSG00000146072.6 TNFRSF21     5.381927e-06 1.228560e-02
## ENSG00000102524.12 TNFSF13B    5.764368e-06 1.228560e-02
mean(abs(dge$stat))
## [1] 1.007248
avb_crplo_pod1_adj <- dge

Treatment A vs B POD in CRP high group

mx <- xpod1f
ss2 <- as.data.frame(cbind(ss_pod1,sscell_pod1))
ss2 <- subset(ss2,crp_group==4)
mx <- mx[,colnames(mx) %in% rownames(ss2)]

# base model
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ treatment_group )
## converting counts to integer mode
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
## -- replacing outliers and refitting for 250 genes
## -- DESeq argument 'minReplicatesForReplace' = 7 
## -- original counts are preserved in counts(dds)
## estimating dispersions
## fitting model and testing
z <- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                  baseMean log2FoldChange     lfcSE      stat
## ENSG00000131016.17 AKAP12       118.08416       1.904352 0.3589243  5.305720
## ENSG00000149534.9 MS4A2          93.32501       1.866884 0.3696944  5.049802
## ENSG00000186081.12 KRT5          14.48988       2.017019 0.4076553  4.947854
## ENSG00000229961.3 RP11-71G12.1   58.76722       1.339119 0.2735828  4.894748
## ENSG00000140287.11 HDC          571.69806       1.885327 0.3856378  4.888854
## ENSG00000179348.12 GATA2        810.50517       1.608564 0.3351194  4.799972
## ENSG00000158715.6 SLC45A3       258.52371       1.306224 0.2724756  4.793914
## ENSG00000155659.15 VSIG4       1247.57497      -2.125654 0.4456523 -4.769759
## ENSG00000246363.3 LINC02458      30.59379       1.828502 0.3945107  4.634861
## ENSG00000259162.1 RP11-203M5.6   23.31281       1.481681 0.3212551  4.612163
##                                      pvalue        padj
## ENSG00000131016.17 AKAP12      1.122292e-07 0.002252664
## ENSG00000149534.9 MS4A2        4.422678e-07 0.004071602
## ENSG00000186081.12 KRT5        7.503634e-07 0.004071602
## ENSG00000229961.3 RP11-71G12.1 9.843169e-07 0.004071602
## ENSG00000140287.11 HDC         1.014249e-06 0.004071602
## ENSG00000179348.12 GATA2       1.586878e-06 0.004627772
## ENSG00000158715.6 SLC45A3      1.635586e-06 0.004627772
## ENSG00000155659.15 VSIG4       1.844469e-06 0.004627772
## ENSG00000246363.3 LINC02458    3.571771e-06 0.007965842
## ENSG00000259162.1 RP11-203M5.6 3.985011e-06 0.007998713
mean(abs(dge$stat))
## [1] 0.7008559
# model with clinical covariates
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS + treatment_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 12 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                              baseMean log2FoldChange     lfcSE      stat
## ENSG00000274611.4 TBC1D3     56.78775     24.5695598 3.4483161  7.125089
## ENSG00000155659.15 VSIG4   1247.57497     -2.6203399 0.4278950 -6.123792
## ENSG00000225630.1 MTND2P28  106.98061     -2.1843250 0.4275721 -5.108671
## ENSG00000078053.17 AMPH     167.98498     -1.4433937 0.2894022 -4.987501
## ENSG00000186081.12 KRT5      14.48988      2.0084378 0.4078153  4.924871
## ENSG00000198794.12 SCAMP5    65.44507      0.9688744 0.1982756  4.886503
## ENSG00000131016.17 AKAP12   118.08416      1.8265393 0.3775147  4.838327
## ENSG00000211935.3 IGHV1-3    64.54582      1.5403262 0.3349438  4.598760
## ENSG00000179348.12 GATA2    810.50517      1.6245124 0.3536185  4.593969
## ENSG00000158715.6 SLC45A3   258.52371      1.3109805 0.2872035  4.564640
##                                  pvalue         padj
## ENSG00000274611.4 TBC1D3   1.040133e-12 2.216835e-08
## ENSG00000155659.15 VSIG4   9.137432e-10 9.737304e-06
## ENSG00000225630.1 MTND2P28 3.244325e-07 2.304877e-03
## ENSG00000078053.17 AMPH    6.116527e-07 3.259038e-03
## ENSG00000186081.12 KRT5    8.441597e-07 3.598315e-03
## ENSG00000198794.12 SCAMP5  1.026427e-06 3.646041e-03
## ENSG00000131016.17 AKAP12  1.309367e-06 3.986649e-03
## ENSG00000211935.3 IGHV1-3  4.250123e-06 1.000198e-02
## ENSG00000179348.12 GATA2   4.348936e-06 1.000198e-02
## ENSG00000158715.6 SLC45A3  5.003516e-06 1.000198e-02
mean(abs(dge$stat))
## [1] 0.6749656
avb_crphi_pod1 <- dge

# model with clinical and cell covariates
# Monocytes.C NK T.CD8.Memory T.CD4.Naive Neutrophils.LD
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS +
    Monocytes.C + NK + T.CD8.Memory + T.CD4.Naive + Neutrophils.LD + treatment_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   the design formula contains one or more numeric variables that have mean or
##   standard deviation larger than 5 (an arbitrary threshold to trigger this message).
##   Including numeric variables with large mean can induce collinearity with the intercept.
##   Users should center and scale numeric variables in the design to improve GLM convergence.
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 27 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                              baseMean log2FoldChange     lfcSE      stat
## ENSG00000155659.15 VSIG4   1247.57497     -2.2950320 0.4103782 -5.592480
## ENSG00000186081.12 KRT5      14.48988      2.2017581 0.4208578  5.231596
## ENSG00000244116.3 IGKV2-28   94.97033      1.5259902 0.2978606  5.123169
## ENSG00000078053.17 AMPH     167.98498     -1.3607277 0.2682920 -5.071816
## ENSG00000198794.12 SCAMP5    65.44507      1.0198080 0.2040033  4.998977
## ENSG00000100453.13 GZMB    1428.85140      0.7408132 0.1523886  4.861341
## ENSG00000111249.14 CUX2      26.61410      1.3377186 0.2819178  4.745066
## ENSG00000132465.12 JCHAIN  1006.89958      1.1477793 0.2442314  4.699557
## ENSG00000211644.3 IGLV1-51  142.58626      1.2413126 0.2645593  4.692001
## ENSG00000211648.2 IGLV1-47  132.22632      1.2555063 0.2699166  4.651460
##                                  pvalue         padj
## ENSG00000155659.15 VSIG4   2.238485e-08 0.0004770883
## ENSG00000186081.12 KRT5    1.680523e-07 0.0017908490
## ENSG00000244116.3 IGKV2-28 3.004421e-07 0.0020995290
## ENSG00000078053.17 AMPH    3.940373e-07 0.0020995290
## ENSG00000198794.12 SCAMP5  5.763523e-07 0.0024567593
## ENSG00000100453.13 GZMB    1.165931e-06 0.0041415801
## ENSG00000111249.14 CUX2    2.084381e-06 0.0063463454
## ENSG00000132465.12 JCHAIN  2.607268e-06 0.0064068364
## ENSG00000211644.3 IGLV1-51 2.705463e-06 0.0064068364
## ENSG00000211648.2 IGLV1-47 3.295937e-06 0.0070246299
mean(abs(dge$stat))
## [1] 0.7716351
avb_crphi_pod1_adj <- dge

CRP Group Comparisons statified

CRP low vs high at t=0 treatment group A

mx <- xt0f
ss2 <- as.data.frame(cbind(ss_t0,sscell_t0))
ss2 <- subset(ss2,treatment_group==1)
mx <- mx[,colnames(mx) %in% rownames(ss2)]

# base model
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ crp_group )
## converting counts to integer mode
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
## -- replacing outliers and refitting for 116 genes
## -- DESeq argument 'minReplicatesForReplace' = 7 
## -- original counts are preserved in counts(dds)
## estimating dispersions
## fitting model and testing
z <- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                 baseMean log2FoldChange      lfcSE      stat
## ENSG00000211640.4 IGLV6-57      73.94116     -0.5012755 0.09503047 -5.274892
## ENSG00000211644.3 IGLV1-51     249.02248     -0.6160909 0.11760002 -5.238867
## ENSG00000211652.2 IGLV7-43      52.51336     -0.6502306 0.12553982 -5.179477
## ENSG00000211655.3 IGLV1-36      15.50197     -0.6064267 0.12419400 -4.882899
## ENSG00000279359.1 RP11-36D19.9  43.68155     -1.1247960 0.24645555 -4.563890
## ENSG00000263711.6 LINC02864     16.11890      0.3756337 0.08415429  4.463631
## ENSG00000211673.2 IGLV3-1      180.11226     -0.4099034 0.09521025 -4.305244
## ENSG00000113790.11 EHHADH       70.48409      0.1809165 0.04324047  4.183961
## ENSG00000087116.16 ADAMTS2     144.89306     -0.8669518 0.21120081 -4.104869
## ENSG00000211649.3 IGLV7-46      63.48682     -0.5888044 0.14456169 -4.073032
##                                      pvalue        padj
## ENSG00000211640.4 IGLV6-57     1.328340e-07 0.001595313
## ENSG00000211644.3 IGLV1-51     1.615655e-07 0.001595313
## ENSG00000211652.2 IGLV7-43     2.225087e-07 0.001595313
## ENSG00000211655.3 IGLV1-36     1.045375e-06 0.005621245
## ENSG00000279359.1 RP11-36D19.9 5.021440e-06 0.021601231
## ENSG00000263711.6 LINC02864    8.058233e-06 0.028887422
## ENSG00000211673.2 IGLV3-1      1.668016e-05 0.051253362
## ENSG00000113790.11 EHHADH      2.864731e-05 0.077021866
## ENSG00000087116.16 ADAMTS2     4.045433e-05 0.096681348
## ENSG00000211649.3 IGLV7-46     4.640502e-05 0.099812567
mean(abs(dge$stat))
## [1] 0.8542119
# model with clinical covariates
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS + crp_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 25 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                  baseMean log2FoldChange      lfcSE      stat
## ENSG00000274611.4 TBC1D3         61.02093     -9.1421319 1.32357018 -6.907176
## ENSG00000278599.6 TBC1D3E        18.70446     -7.7297743 1.32279104 -5.843534
## ENSG00000280035.1 RP11-10J21.2   19.49861      0.4739069 0.10831763  4.375159
## ENSG00000203999.9 LINC01270     118.07792      0.3907644 0.09069852  4.308387
## ENSG00000203814.6 H2BC18         64.74206      0.4615320 0.10714744  4.307448
## ENSG00000211652.2 IGLV7-43       52.51336     -0.6209722 0.14601308 -4.252853
## ENSG00000211655.3 IGLV1-36       15.50197     -0.5985422 0.14468747 -4.136794
## ENSG00000225764.2 P3H2-AS1       10.20911      0.3674466 0.08926866  4.116188
## ENSG00000211679.2 IGLC3         802.12582     -0.6140036 0.14922781 -4.114539
## ENSG00000267303.1 CTD-2369P2.12  14.16784      1.8563724 0.45893893  4.044923
##                                       pvalue         padj
## ENSG00000274611.4 TBC1D3        4.943970e-12 1.084460e-07
## ENSG00000278599.6 TBC1D3E       5.110489e-09 5.604929e-05
## ENSG00000280035.1 RP11-10J21.2  1.213439e-05 7.245095e-02
## ENSG00000203999.9 LINC01270     1.644492e-05 7.245095e-02
## ENSG00000203814.6 H2BC18        1.651492e-05 7.245095e-02
## ENSG00000211652.2 IGLV7-43      2.110639e-05 7.716144e-02
## ENSG00000211655.3 IGLV1-36      3.521920e-05 9.455306e-02
## ENSG00000225764.2 P3H2-AS1      3.851901e-05 9.455306e-02
## ENSG00000211679.2 IGLC3         3.879542e-05 9.455306e-02
## ENSG00000267303.1 CTD-2369P2.12 5.234043e-05 1.148087e-01
mean(abs(dge$stat))
## [1] 0.8946528
crp_t0_a <- dge

# model with clinical and cell covariates
# Monocytes.C NK T.CD8.Memory T.CD4.Naive Neutrophils.LD
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS +
    Monocytes.C + NK + T.CD8.Memory + T.CD4.Naive + Neutrophils.LD + crp_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   the design formula contains one or more numeric variables that have mean or
##   standard deviation larger than 5 (an arbitrary threshold to trigger this message).
##   Including numeric variables with large mean can induce collinearity with the intercept.
##   Users should center and scale numeric variables in the design to improve GLM convergence.
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 67 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                   baseMean log2FoldChange      lfcSE      stat
## ENSG00000159189.12 C1QC           45.19243    -0.61040273 0.11320820 -5.391860
## ENSG00000087116.16 ADAMTS2       144.89306    -0.85240097 0.18580458 -4.587621
## ENSG00000211679.2 IGLC3          802.12582    -0.62143112 0.13983515 -4.444027
## ENSG00000173372.17 C1QA          192.01764    -0.39137607 0.09031133 -4.333632
## ENSG00000203999.9 LINC01270      118.07792     0.22311853 0.05197873  4.292497
## ENSG00000173369.17 C1QB           92.28254    -0.43614730 0.10549051 -4.134470
## ENSG00000213614.11 HEXA         3639.45630    -0.06053357 0.01485206 -4.075769
## ENSG00000255446.1 CTD-2531D15.4   17.55993     0.76019163 0.18656869  4.074594
## ENSG00000225764.2 P3H2-AS1        10.20911     0.38295774 0.09524805  4.020636
## ENSG00000211652.2 IGLV7-43        52.51336    -0.56403860 0.14280717 -3.949652
##                                       pvalue        padj
## ENSG00000159189.12 C1QC         6.973218e-08 0.001529575
## ENSG00000087116.16 ADAMTS2      4.483259e-06 0.049170146
## ENSG00000211679.2 IGLC3         8.829069e-06 0.064555213
## ENSG00000173372.17 C1QA         1.466691e-05 0.077507296
## ENSG00000203999.9 LINC01270     1.766749e-05 0.077507296
## ENSG00000173369.17 C1QB         3.557752e-05 0.126385981
## ENSG00000213614.11 HEXA         4.586247e-05 0.126385981
## ENSG00000255446.1 CTD-2531D15.4 4.609473e-05 0.126385981
## ENSG00000225764.2 P3H2-AS1      5.804118e-05 0.141459245
## ENSG00000211652.2 IGLV7-43      7.826493e-05 0.164623107
mean(abs(dge$stat))
## [1] 0.9126823
crp_t0_a_adj <- dge

CRP low vs high at t=0 treatment group B

mx <- xt0f
ss2 <- as.data.frame(cbind(ss_t0,sscell_t0))
ss2 <- subset(ss2,treatment_group==2)
mx <- mx[,colnames(mx) %in% rownames(ss2)]

# base model
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ crp_group )
## converting counts to integer mode
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
## -- replacing outliers and refitting for 698 genes
## -- DESeq argument 'minReplicatesForReplace' = 7 
## -- original counts are preserved in counts(dds)
## estimating dispersions
## fitting model and testing
z <- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                               baseMean log2FoldChange      lfcSE      stat
## ENSG00000274012.1 RN7SL2   1005.235348      0.3958682 0.08669141  4.566406
## ENSG00000276168.1 RN7SL1    552.306545      0.3503249 0.07971834  4.394533
## ENSG00000165029.17 ABCA1    676.864267     -0.2828435 0.07210273 -3.922786
## ENSG00000050767.18 COL23A1   32.027614      0.3304131 0.08555804  3.861860
## ENSG00000134321.13 RSAD2    562.578486     -0.3324054 0.08678497 -3.830218
## ENSG00000183117.19 CSMD1     45.694830     -0.4349344 0.11463824 -3.793973
## ENSG00000160179.19 ABCG1    431.970974     -0.1967463 0.05391060 -3.649492
## ENSG00000170153.11 RNF150     8.709392     -0.6451407 0.18034165 -3.577325
## ENSG00000196565.15 HBG2     259.037625      0.6586983 0.18849443  3.494524
## ENSG00000049247.14 UTS2      39.902866      0.3607631 0.10531292  3.425630
##                                  pvalue      padj
## ENSG00000274012.1 RN7SL2   4.961569e-06 0.1088320
## ENSG00000276168.1 RN7SL1   1.110112e-05 0.1217515
## ENSG00000165029.17 ABCA1   8.753099e-05 0.5419992
## ENSG00000050767.18 COL23A1 1.125272e-04 0.5419992
## ENSG00000134321.13 RSAD2   1.280297e-04 0.5419992
## ENSG00000183117.19 CSMD1   1.482560e-04 0.5419992
## ENSG00000160179.19 ABCG1   2.627594e-04 0.8233755
## ENSG00000170153.11 RNF150  3.471282e-04 0.9483616
## ENSG00000196565.15 HBG2    4.749080e-04 0.9483616
## ENSG00000049247.14 UTS2    6.133744e-04 0.9483616
mean(abs(dge$stat))
## [1] 0.8139089
# model with clinical covariates
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS + crp_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 11 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                   baseMean log2FoldChange      lfcSE      stat
## ENSG00000261026.1 CTD-3247F14.2   17.85183     -1.5577738 0.32799353 -4.749404
## ENSG00000078114.19 NEBL           35.44421     -0.8971180 0.19693027 -4.555511
## ENSG00000181126.13 HLA-V         336.08002     -0.6596009 0.14626672 -4.509576
## ENSG00000243224.1 RP5-1157M23.2   44.63609      0.2250026 0.05160220  4.360329
## ENSG00000139287.13 TPH2           42.04591     -0.1966640 0.04960475 -3.964621
## ENSG00000152767.17 FARP1         160.37684     -0.1615427 0.04078672 -3.960669
## ENSG00000123838.11 C4BPA          52.54006     -1.0740085 0.27120443 -3.960144
## ENSG00000254681.6 PKD1P5        2181.95360      0.3720053 0.09477314  3.925218
## ENSG00000119922.11 IFIT2        1651.64063     -0.5395922 0.13801521 -3.909657
## ENSG00000251023.1 RP11-549J18.1   42.31889     -0.1712000 0.04460148 -3.838437
##                                       pvalue       padj
## ENSG00000261026.1 CTD-3247F14.2 2.040169e-06 0.04475111
## ENSG00000078114.19 NEBL         5.225842e-06 0.04749455
## ENSG00000181126.13 HLA-V        6.495722e-06 0.04749455
## ENSG00000243224.1 RP5-1157M23.2 1.298668e-05 0.07121573
## ENSG00000139287.13 TPH2         7.351259e-05 0.22526554
## ENSG00000152767.17 FARP1        7.474011e-05 0.22526554
## ENSG00000123838.11 C4BPA        7.490465e-05 0.22526554
## ENSG00000254681.6 PKD1P5        8.665106e-05 0.22526554
## ENSG00000119922.11 IFIT2        9.242716e-05 0.22526554
## ENSG00000251023.1 RP11-549J18.1 1.238201e-04 0.23027538
mean(abs(dge$stat))
## [1] 1.048832
crp_t0_b <- dge

# model with clinical and cell covariates
# Monocytes.C NK T.CD8.Memory T.CD4.Naive Neutrophils.LD
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS +
    Monocytes.C + NK + T.CD8.Memory + T.CD4.Naive + Neutrophils.LD + crp_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   the design formula contains one or more numeric variables that have mean or
##   standard deviation larger than 5 (an arbitrary threshold to trigger this message).
##   Including numeric variables with large mean can induce collinearity with the intercept.
##   Users should center and scale numeric variables in the design to improve GLM convergence.
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 37 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                   baseMean log2FoldChange      lfcSE      stat
## ENSG00000074803.20 SLC12A1        35.08453      0.9122526 0.20486985  4.452839
## ENSG00000181126.13 HLA-V         336.08002     -0.6874493 0.15532026 -4.426012
## ENSG00000260447.1 RP11-304L19.2   11.22085      0.5616031 0.13834164  4.059538
## ENSG00000243224.1 RP5-1157M23.2   44.63609      0.1916944 0.04730854  4.052004
## ENSG00000102854.16 MSLN           53.97058     -0.8879198 0.22198314 -3.999943
## ENSG00000274012.1 RN7SL2        1005.23535      0.4319977 0.11522675  3.749110
## ENSG00000154620.6 TMSB4Y          57.87988     -0.3468062 0.09388812 -3.693824
## ENSG00000249021.1 CTC-505O3.3     12.00956     -0.2429090 0.06703841 -3.623431
## ENSG00000275329.1 RP11-83N9.6      9.92069      0.3085146 0.08571315  3.599385
## ENSG00000276168.1 RN7SL1         552.30655      0.3722778 0.10422593  3.571835
##                                       pvalue      padj
## ENSG00000074803.20 SLC12A1      8.474212e-06 0.1052785
## ENSG00000181126.13 HLA-V        9.599131e-06 0.1052785
## ENSG00000260447.1 RP11-304L19.2 4.916997e-05 0.2779507
## ENSG00000243224.1 RP5-1157M23.2 5.078072e-05 0.2779507
## ENSG00000102854.16 MSLN         6.335781e-05 0.2779507
## ENSG00000274012.1 RN7SL2        1.774633e-04 0.6487762
## ENSG00000154620.6 TMSB4Y        2.209071e-04 0.6895367
## ENSG00000249021.1 CTC-505O3.3   2.907209e-04 0.6895367
## ENSG00000275329.1 RP11-83N9.6   3.189707e-04 0.6895367
## ENSG00000276168.1 RN7SL1        3.544892e-04 0.6895367
mean(abs(dge$stat))
## [1] 0.9050064
crp_t0_b_adj <- dge

CRP low vs high at EOS treatment group A

mx <- xeosf
ss2 <- as.data.frame(cbind(ss_eos,sscell_eos))
ss2 <- subset(ss2,treatment_group==1)
mx <- mx[,colnames(mx) %in% rownames(ss2)]

# base model
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ crp_group )
## converting counts to integer mode
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
## -- replacing outliers and refitting for 147 genes
## -- DESeq argument 'minReplicatesForReplace' = 7 
## -- original counts are preserved in counts(dds)
## estimating dispersions
## fitting model and testing
z <- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                              baseMean log2FoldChange      lfcSE       stat
## ENSG00000234200.2 U82671.8   23.74781     -8.4175144 0.77303756 -10.888881
## ENSG00000204936.10 CD177   2664.36071      1.3040566 0.17489685   7.456147
## ENSG00000139572.4 GPR84     194.83068      0.9793090 0.14085127   6.952788
## ENSG00000170525.21 PFKFB3  4648.61993      0.6889378 0.10435049   6.602152
## ENSG00000176597.12 B3GNT5   364.32833      0.6671879 0.10515716   6.344674
## ENSG00000132170.24 PPARG    105.03591      0.8466718 0.13451424   6.294291
## ENSG00000079385.23 CEACAM1 1083.04204      0.9180621 0.14625935   6.276946
## ENSG00000187775.17 DNAH17   603.73830      0.4485171 0.07177030   6.249342
## ENSG00000136634.7 IL10       75.57604      0.7835233 0.12565466   6.235529
## ENSG00000135916.16 ITM2C    660.76621     -0.3402779 0.05494465  -6.193103
##                                  pvalue         padj
## ENSG00000234200.2 U82671.8 1.302299e-27 2.873783e-23
## ENSG00000204936.10 CD177   8.908934e-14 9.829672e-10
## ENSG00000139572.4 GPR84    3.581374e-12 2.634339e-08
## ENSG00000170525.21 PFKFB3  4.052308e-11 2.235557e-07
## ENSG00000176597.12 B3GNT5  2.228974e-10 9.837353e-07
## ENSG00000132170.24 PPARG   3.088083e-10 1.088493e-06
## ENSG00000079385.23 CEACAM1 3.452870e-10 1.088493e-06
## ENSG00000187775.17 DNAH17  4.121860e-10 1.103974e-06
## ENSG00000136634.7 IL10     4.502544e-10 1.103974e-06
## ENSG00000135916.16 ITM2C   5.899107e-10 1.301756e-06
mean(abs(dge$stat))
## [1] 1.38808
# model with clinical covariates
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS + crp_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 12 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                    baseMean log2FoldChange      lfcSE      stat
## ENSG00000278599.6 TBC1D3E          21.72131     -9.5092053 1.36712905 -6.955602
## ENSG00000258035.2 RP11-74K11.2     20.51590      0.7829509 0.14913630  5.249902
## ENSG00000076356.7 PLXNA2          257.73317      0.4637443 0.09006613  5.148932
## ENSG00000204936.10 CD177         2664.36071      1.1813741 0.23038336  5.127862
## ENSG00000159339.13 PADI4        13293.00692      0.8773302 0.17145591  5.116943
## ENSG00000283345.1 CTD-3092A11.3    36.24736     -0.8647693 0.17126294 -5.049366
## ENSG00000235750.10 KIAA0040      3047.27341      0.3626779 0.07233427  5.013916
## ENSG00000211966.2 IGHV5-51        190.52981     -0.6341490 0.12802140 -4.953461
## ENSG00000176597.12 B3GNT5         364.32833      0.6767111 0.13768368  4.914969
## ENSG00000203999.9 LINC01270       154.60133      0.5209756 0.10632606  4.899793
##                                       pvalue         padj
## ENSG00000278599.6 TBC1D3E       3.510601e-12 7.596590e-08
## ENSG00000258035.2 RP11-74K11.2  1.521803e-07 1.343898e-03
## ENSG00000076356.7 PLXNA2        2.619744e-07 1.343898e-03
## ENSG00000204936.10 CD177        2.930508e-07 1.343898e-03
## ENSG00000159339.13 PADI4        3.105268e-07 1.343898e-03
## ENSG00000283345.1 CTD-3092A11.3 4.432785e-07 1.598684e-03
## ENSG00000235750.10 KIAA0040     5.333326e-07 1.648683e-03
## ENSG00000211966.2 IGHV5-51      7.290485e-07 1.971985e-03
## ENSG00000176597.12 B3GNT5       8.879630e-07 2.075999e-03
## ENSG00000203999.9 LINC01270     9.593786e-07 2.075999e-03
mean(abs(dge$stat))
## [1] 1.342187
crp_eos_a <- dge

# model with clinical and cell covariates
# Monocytes.C NK T.CD8.Memory T.CD4.Naive Neutrophils.LD
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS +
    Monocytes.C + NK + T.CD8.Memory + T.CD4.Naive + Neutrophils.LD + crp_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   the design formula contains one or more numeric variables that have mean or
##   standard deviation larger than 5 (an arbitrary threshold to trigger this message).
##   Including numeric variables with large mean can induce collinearity with the intercept.
##   Users should center and scale numeric variables in the design to improve GLM convergence.
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 42 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                    baseMean log2FoldChange      lfcSE      stat
## ENSG00000278599.6 TBC1D3E         21.721315    -10.2553792 1.57048944 -6.530053
## ENSG00000283345.1 CTD-3092A11.3   36.247361     -1.0143122 0.19599256 -5.175258
## ENSG00000282339.1 LLNLF-176F2.1    8.210905     -6.9030990 1.56532705 -4.410004
## ENSG00000228668.1 TRGV5P          68.256402     -0.6121273 0.14417808 -4.245633
## ENSG00000102524.12 TNFSF13B     1626.167180      0.2026085 0.04878487  4.153100
## ENSG00000233937.7 CTC-338M12.4   139.717383     -0.1962152 0.04828865 -4.063382
## ENSG00000087116.16 ADAMTS2       779.297104     -0.8224640 0.21388124 -3.845424
## ENSG00000260271.3 RP1-45N11.1     58.349444      0.2237876 0.05997439  3.731386
## ENSG00000204001.10 LCN8           74.503582      1.3084012 0.35407420  3.695274
## ENSG00000258035.2 RP11-74K11.2    20.515904      0.4374888 0.12062684  3.626795
##                                       pvalue         padj
## ENSG00000278599.6 TBC1D3E       6.574645e-11 1.450827e-06
## ENSG00000283345.1 CTD-3092A11.3 2.275958e-07 2.511179e-03
## ENSG00000282339.1 LLNLF-176F2.1 1.033686e-05 7.603448e-02
## ENSG00000228668.1 TRGV5P        2.179767e-05 1.202523e-01
## ENSG00000102524.12 TNFSF13B     3.280007e-05 1.447598e-01
## ENSG00000233937.7 CTC-338M12.4  4.836686e-05 1.778853e-01
## ENSG00000087116.16 ADAMTS2      1.203443e-04 3.793770e-01
## ENSG00000260271.3 RP1-45N11.1   1.904294e-04 5.252758e-01
## ENSG00000204001.10 LCN8         2.196497e-04 5.385567e-01
## ENSG00000258035.2 RP11-74K11.2  2.869612e-04 5.974026e-01
mean(abs(dge$stat))
## [1] 0.8430902
crp_eos_a_adj <- dge

CRP low vs high at EOS treatment group B

mx <- xeosf
ss2 <- as.data.frame(cbind(ss_eos,sscell_eos))
ss2 <- subset(ss2,treatment_group==2)
mx <- mx[,colnames(mx) %in% rownames(ss2)]

# base model
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ crp_group )
## converting counts to integer mode
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
## -- replacing outliers and refitting for 128 genes
## -- DESeq argument 'minReplicatesForReplace' = 7 
## -- original counts are preserved in counts(dds)
## estimating dispersions
## fitting model and testing
z <- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                   baseMean log2FoldChange      lfcSE      stat
## ENSG00000254873.1 RP11-770J1.5    47.54511     -0.5668914 0.10956959 -5.173802
## ENSG00000224370.1 RP11-814E24.3   49.76184      0.4472603 0.09003302  4.967737
## ENSG00000241860.7 RP11-34P13.13 4903.99846      0.3733341 0.07548746  4.945644
## ENSG00000236911.6 RP11-78B10.2    74.74105      0.5093406 0.10317766  4.936539
## ENSG00000238035.8 AC138035.2    1313.25226      0.3740127 0.07824059  4.780290
## ENSG00000280279.1 LINC02887      485.42034      0.3717109 0.07800330  4.765323
## ENSG00000101187.16 SLCO4A1        97.59953      0.5650296 0.11859698  4.764283
## ENSG00000260528.5 FAM157C       3056.40251      0.3665312 0.07752802  4.727726
## ENSG00000230724.9 LINC01001     3269.93917      0.3263093 0.06964405  4.685387
## ENSG00000264769.1 RP11-498C9.12   41.75148      0.2941786 0.06310258  4.661910
##                                       pvalue        padj
## ENSG00000254873.1 RP11-770J1.5  2.293775e-07 0.004386980
## ENSG00000224370.1 RP11-814E24.3 6.773878e-07 0.004386980
## ENSG00000241860.7 RP11-34P13.13 7.589257e-07 0.004386980
## ENSG00000236911.6 RP11-78B10.2  7.952109e-07 0.004386980
## ENSG00000238035.8 AC138035.2    1.750423e-06 0.005974689
## ENSG00000280279.1 LINC02887     1.885513e-06 0.005974689
## ENSG00000101187.16 SLCO4A1      1.895265e-06 0.005974689
## ENSG00000260528.5 FAM157C       2.270486e-06 0.006262853
## ENSG00000230724.9 LINC01001     2.794320e-06 0.006349407
## ENSG00000264769.1 RP11-498C9.12 3.132880e-06 0.006349407
mean(abs(dge$stat))
## [1] 1.041369
# model with clinical covariates
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS + crp_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 5 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                  baseMean log2FoldChange      lfcSE      stat
## ENSG00000181126.13 HLA-V        396.17882     -0.8065180 0.16968812 -4.752943
## ENSG00000254873.1 RP11-770J1.5   47.54511     -0.5826915 0.13036812 -4.469586
## ENSG00000175874.10 CREG2         15.85760      0.3267149 0.07358462  4.439989
## ENSG00000074803.20 SLC12A1       36.66028      0.8797267 0.20623352  4.265682
## ENSG00000147852.17 VLDLR         60.44142      0.2384517 0.05590948  4.264959
## ENSG00000136274.9 NACAD          13.87223     -0.6254904 0.14828300 -4.218221
## ENSG00000158321.18 AUTS2       1107.33233      0.2789351 0.07162732  3.894256
## ENSG00000241484.10 ARHGAP8       48.02920      0.3161707 0.08197094  3.857107
## ENSG00000179841.8 AKAP5         164.98261      0.2475874 0.06420904  3.855958
## ENSG00000043514.17 TRIT1        438.15726     -0.1127517 0.02930561 -3.847443
##                                      pvalue       padj
## ENSG00000181126.13 HLA-V       2.004768e-06 0.04423922
## ENSG00000254873.1 RP11-770J1.5 7.837118e-06 0.06617416
## ENSG00000175874.10 CREG2       8.996351e-06 0.06617416
## ENSG00000074803.20 SLC12A1     1.992921e-05 0.08824094
## ENSG00000147852.17 VLDLR       1.999387e-05 0.08824094
## ENSG00000136274.9 NACAD        2.462376e-05 0.09056210
## ENSG00000158321.18 AUTS2       9.850051e-05 0.26338536
## ENSG00000241484.10 ARHGAP8     1.147368e-04 0.26338536
## ENSG00000179841.8 AKAP5        1.152772e-04 0.26338536
## ENSG00000043514.17 TRIT1       1.193571e-04 0.26338536
mean(abs(dge$stat))
## [1] 0.885868
crp_eos_b <- dge

# model with clinical and cell covariates
# Monocytes.C NK T.CD8.Memory T.CD4.Naive Neutrophils.LD
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS +
    Monocytes.C + NK + T.CD8.Memory + T.CD4.Naive + Neutrophils.LD + crp_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   the design formula contains one or more numeric variables that have mean or
##   standard deviation larger than 5 (an arbitrary threshold to trigger this message).
##   Including numeric variables with large mean can induce collinearity with the intercept.
##   Users should center and scale numeric variables in the design to improve GLM convergence.
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 44 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                  baseMean log2FoldChange      lfcSE      stat
## ENSG00000074803.20 SLC12A1       36.66028      0.9974386 0.22461306  4.440697
## ENSG00000099139.14 PCSK5       1284.53014      0.3871194 0.09428526  4.105831
## ENSG00000175874.10 CREG2         15.85760      0.2917051 0.07128137  4.092305
## ENSG00000112799.9 LY86          950.19080     -0.1665188 0.04275961 -3.894300
## ENSG00000181126.13 HLA-V        396.17882     -0.7233685 0.18577054 -3.893882
## ENSG00000167680.17 SEMA6B       577.15312      0.6250133 0.16781047  3.724519
## ENSG00000225813.1 AC009299.4     13.97230      0.6532645 0.17553661  3.721528
## ENSG00000264522.6 OTUD7B        213.51620      0.1084653 0.02937072  3.692974
## ENSG00000254873.1 RP11-770J1.5   47.54511     -0.4819889 0.13089297 -3.682313
## ENSG00000188599.17 NPIPP1       219.50741     -0.1879393 0.05163699 -3.639626
##                                      pvalue      padj
## ENSG00000074803.20 SLC12A1     8.966780e-06 0.1978699
## ENSG00000099139.14 PCSK5       4.028635e-05 0.3141656
## ENSG00000175874.10 CREG2       4.271069e-05 0.3141656
## ENSG00000112799.9 LY86         9.848252e-05 0.4353942
## ENSG00000181126.13 HLA-V       9.865279e-05 0.4353942
## ENSG00000167680.17 SEMA6B      1.956880e-04 0.5666993
## ENSG00000225813.1 AC009299.4   1.980206e-04 0.5666993
## ENSG00000264522.6 OTUD7B       2.216469e-04 0.5666993
## ENSG00000254873.1 RP11-770J1.5 2.311276e-04 0.5666993
## ENSG00000188599.17 NPIPP1      2.730339e-04 0.6025038
mean(abs(dge$stat))
## [1] 0.8130305
crp_eos_b_adj <- dge

CRP low vs high at POD treatment group A

mx <- xpod1f
ss2 <- as.data.frame(cbind(ss_pod1,sscell_pod1))
ss2 <- subset(ss2,treatment_group==1)
mx <- mx[,colnames(mx) %in% rownames(ss2)]

# base model
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ crp_group )
## converting counts to integer mode
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
## -- replacing outliers and refitting for 189 genes
## -- DESeq argument 'minReplicatesForReplace' = 7 
## -- original counts are preserved in counts(dds)
## estimating dispersions
## fitting model and testing
z <- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                              baseMean log2FoldChange      lfcSE      stat
## ENSG00000007968.7 E2F2      650.98716      0.3793948 0.06004490  6.318518
## ENSG00000137869.15 CYP19A1   60.07323      0.9765750 0.15547632  6.281181
## ENSG00000157064.11 NMNAT2    41.43058      0.4835623 0.07985053  6.055844
## ENSG00000229647.2 MYOSLID    64.61066      0.3230300 0.05367352  6.018424
## ENSG00000165092.13 ALDH1A1  556.69422     -0.4848466 0.08067903 -6.009574
## ENSG00000145287.11 PLAC8   3561.63102      0.2630043 0.04382192  6.001663
## ENSG00000138821.14 SLC39A8  521.43838      0.2641136 0.04467962  5.911276
## ENSG00000132170.24 PPARG    144.66113      0.5565381 0.09494223  5.861861
## ENSG00000198018.7 ENTPD7    368.85840      0.2161036 0.03790805  5.700732
## ENSG00000116016.14 EPAS1    116.95950      0.3548271 0.06246220  5.680670
##                                  pvalue         padj
## ENSG00000007968.7 E2F2     2.640843e-10 2.955877e-06
## ENSG00000137869.15 CYP19A1 3.360096e-10 2.955877e-06
## ENSG00000157064.11 NMNAT2  1.396832e-09 5.727059e-06
## ENSG00000229647.2 MYOSLID  1.761237e-09 5.727059e-06
## ENSG00000165092.13 ALDH1A1 1.860109e-09 5.727059e-06
## ENSG00000145287.11 PLAC8   1.953072e-09 5.727059e-06
## ENSG00000138821.14 SLC39A8 3.394684e-09 8.532295e-06
## ENSG00000132170.24 PPARG   4.577089e-09 1.006616e-05
## ENSG00000198018.7 ENTPD7   1.192940e-08 2.332066e-05
## ENSG00000116016.14 EPAS1   1.341684e-08 2.360559e-05
mean(abs(dge$stat))
## [1] 1.199973
# model with clinical covariates
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS + crp_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 21 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                             baseMean log2FoldChange      lfcSE       stat
## ENSG00000274611.4 TBC1D3    51.46372    -30.0000000 1.33164905 -22.528458
## ENSG00000278599.6 TBC1D3E   16.34998    -24.6438767 1.33044880 -18.522980
## ENSG00000124508.17 BTN2A2 1048.79703     -0.1524054 0.02952679  -5.161599
## ENSG00000215883.11 CYB5RL  377.01565     -0.1494372 0.02926069  -5.107098
## ENSG00000145287.11 PLAC8  3561.63102      0.2386112 0.05025490   4.748019
## ENSG00000116016.14 EPAS1   116.95950      0.3652741 0.07758263   4.708195
## ENSG00000157064.11 NMNAT2   41.43058      0.4652492 0.10224666   4.550263
## ENSG00000132170.24 PPARG   144.66113      0.5281924 0.11718850   4.507203
## ENSG00000128928.10 IVD    1354.85885     -0.1506996 0.03353677  -4.493564
## ENSG00000229647.2 MYOSLID   64.61066      0.2852099 0.06372435   4.475682
##                                  pvalue          padj
## ENSG00000274611.4 TBC1D3  2.184275e-112 3.752802e-108
## ENSG00000278599.6 TBC1D3E  1.347666e-76            NA
## ENSG00000124508.17 BTN2A2  2.448497e-07  1.873552e-03
## ENSG00000215883.11 CYB5RL  3.271437e-07  1.873552e-03
## ENSG00000145287.11 PLAC8   2.054189e-06  8.587756e-03
## ENSG00000116016.14 EPAS1   2.499202e-06  8.587756e-03
## ENSG00000157064.11 NMNAT2  5.357881e-06  1.454044e-02
## ENSG00000132170.24 PPARG   6.568765e-06  1.454044e-02
## ENSG00000128928.10 IVD     7.004101e-06  1.454044e-02
## ENSG00000229647.2 MYOSLID  7.616782e-06  1.454044e-02
mean(abs(dge$stat))
## [1] 0.9984807
crp_pod1_a <- dge

# model with clinical and cell covariates
# Monocytes.C NK T.CD8.Memory T.CD4.Naive Neutrophils.LD
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS +
    Monocytes.C + NK + T.CD8.Memory + T.CD4.Naive + Neutrophils.LD + crp_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   the design formula contains one or more numeric variables that have mean or
##   standard deviation larger than 5 (an arbitrary threshold to trigger this message).
##   Including numeric variables with large mean can induce collinearity with the intercept.
##   Users should center and scale numeric variables in the design to improve GLM convergence.
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 44 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                               baseMean log2FoldChange      lfcSE      stat
## ENSG00000157064.11 NMNAT2     41.43058      0.4307897 0.07049747  6.110711
## ENSG00000137869.15 CYP19A1    60.07323      0.7601826 0.12811908  5.933406
## ENSG00000132170.24 PPARG     144.66113      0.4814874 0.08507044  5.659868
## ENSG00000188404.10 SELL    17514.30914      0.2026588 0.03680197  5.506736
## ENSG00000116016.14 EPAS1     116.95950      0.3446736 0.06274337  5.493386
## ENSG00000145287.11 PLAC8    3561.63102      0.2334478 0.04478158  5.213031
## ENSG00000124508.17 BTN2A2   1048.79703     -0.1590625 0.03058359 -5.200910
## ENSG00000148926.10 ADM      1409.50883      0.3668759 0.07139352  5.138785
## ENSG00000121316.11 PLBD1   16469.89344      0.2213555 0.04552841  4.861919
## ENSG00000213694.6 S1PR3     1119.21786     -0.2721949 0.05603887 -4.857252
##                                  pvalue         padj
## ENSG00000157064.11 NMNAT2  9.918830e-10 1.622125e-05
## ENSG00000137869.15 CYP19A1 2.967136e-09 2.426227e-05
## ENSG00000132170.24 PPARG   1.514894e-08 8.258194e-05
## ENSG00000188404.10 SELL    3.655475e-08 1.289678e-04
## ENSG00000116016.14 EPAS1   3.943004e-08 1.289678e-04
## ENSG00000145287.11 PLAC8   1.857798e-07 4.633204e-04
## ENSG00000124508.17 BTN2A2  1.983150e-07 4.633204e-04
## ENSG00000148926.10 ADM     2.765209e-07 5.652779e-04
## ENSG00000121316.11 PLBD1   1.162529e-06 1.835271e-03
## ENSG00000213694.6 S1PR3    1.190263e-06 1.835271e-03
mean(abs(dge$stat))
## [1] 1.026993
crp_pod1_a_adj <- dge

CRP low vs high at POD1 treatment group B

mx <- xpod1f
ss2 <- as.data.frame(cbind(ss_pod1,sscell_pod1))
ss2 <- subset(ss2,treatment_group==2)
mx <- mx[,colnames(mx) %in% rownames(ss2)]

# base model
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ crp_group )
## converting counts to integer mode
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
## -- replacing outliers and refitting for 155 genes
## -- DESeq argument 'minReplicatesForReplace' = 7 
## -- original counts are preserved in counts(dds)
## estimating dispersions
## fitting model and testing
z <- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                  baseMean log2FoldChange      lfcSE     stat
## ENSG00000163710.9 PCOLCE2        25.62512      1.3200438 0.14618904 9.029704
## ENSG00000108950.12 FAM20A      2102.38150      0.6575075 0.07427370 8.852494
## ENSG00000100985.7 MMP9        18630.15953      1.8475668 0.21250458 8.694245
## ENSG00000007968.7 E2F2         1048.78071      0.4485439 0.05226883 8.581478
## ENSG00000137869.15 CYP19A1       99.79869      1.1020306 0.13128996 8.393869
## ENSG00000132170.24 PPARG        188.27369      0.5948070 0.07128398 8.344190
## ENSG00000204044.6 SLC12A5-AS1   114.09553      1.7590874 0.21836871 8.055583
## ENSG00000104918.8 RETN         2356.87387      0.9009685 0.11335111 7.948475
## ENSG00000170439.7 METTL7B       242.42694      0.8427309 0.10841597 7.773125
## ENSG00000135424.18 ITGA7        522.88039      0.5671980 0.07353784 7.713009
##                                     pvalue         padj
## ENSG00000163710.9 PCOLCE2     1.721371e-19 3.668585e-15
## ENSG00000108950.12 FAM20A     8.558475e-19 9.119911e-15
## ENSG00000100985.7 MMP9        3.491438e-18 2.480318e-14
## ENSG00000007968.7 E2F2        9.366156e-18 4.990288e-14
## ENSG00000137869.15 CYP19A1    4.704022e-17 2.005042e-13
## ENSG00000132170.24 PPARG      7.170384e-17 2.546921e-13
## ENSG00000204044.6 SLC12A5-AS1 7.910065e-16 2.408276e-12
## ENSG00000104918.8 RETN        1.888211e-15 5.030195e-12
## ENSG00000170439.7 METTL7B     7.657300e-15 1.813249e-11
## ENSG00000135424.18 ITGA7      1.228856e-14 2.618938e-11
mean(abs(dge$stat))
## [1] 1.485697
# model with clinical covariates
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS + crp_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 9 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                              baseMean log2FoldChange      lfcSE     stat
## ENSG00000163710.9 PCOLCE2    25.62512      1.2259018 0.16300795 7.520503
## ENSG00000108950.12 FAM20A  2102.38150      0.5855328 0.08329079 7.029983
## ENSG00000007968.7 E2F2     1048.78071      0.3962539 0.05925388 6.687392
## ENSG00000104918.8 RETN     2356.87387      0.6987862 0.11335834 6.164401
## ENSG00000132170.24 PPARG    188.27369      0.4927135 0.08019928 6.143615
## ENSG00000135424.18 ITGA7    522.88039      0.5073466 0.08559087 5.927579
## ENSG00000169994.19 MYO7B    752.03451      0.3289064 0.05770625 5.699667
## ENSG00000170439.7 METTL7B   242.42694      0.7107035 0.12800229 5.552272
## ENSG00000050767.18 COL23A1   59.82685      0.4828160 0.08728568 5.531446
## ENSG00000137869.15 CYP19A1   99.79869      0.8331307 0.15065203 5.530166
##                                  pvalue         padj
## ENSG00000163710.9 PCOLCE2  5.456582e-14 1.095300e-09
## ENSG00000108950.12 FAM20A  2.065589e-12 2.073128e-08
## ENSG00000007968.7 E2F2     2.271826e-11 1.520078e-07
## ENSG00000104918.8 RETN     7.075058e-10 3.238343e-06
## ENSG00000132170.24 PPARG   8.066416e-10 3.238343e-06
## ENSG00000135424.18 ITGA7   3.074341e-09 1.028521e-05
## ENSG00000169994.19 MYO7B   1.200415e-08 3.442275e-05
## ENSG00000170439.7 METTL7B  2.819810e-08 6.421919e-05
## ENSG00000050767.18 COL23A1 3.176019e-08 6.421919e-05
## ENSG00000137869.15 CYP19A1 3.199282e-08 6.421919e-05
mean(abs(dge$stat))
## [1] 1.126174
crp_pod1_b <- dge

# model with clinical and cell covariates
# Monocytes.C NK T.CD8.Memory T.CD4.Naive Neutrophils.LD
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD + wound_typeOP + duration_sx + ethnicityCAT + ageCS +
    Monocytes.C + NK + T.CD8.Memory + T.CD4.Naive + Neutrophils.LD + crp_group )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   the design formula contains one or more numeric variables that have mean or
##   standard deviation larger than 5 (an arbitrary threshold to trigger this message).
##   Including numeric variables with large mean can induce collinearity with the intercept.
##   Users should center and scale numeric variables in the design to improve GLM convergence.
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 11 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                              baseMean log2FoldChange      lfcSE      stat
## ENSG00000108950.12 FAM20A  2102.38150      0.5299315 0.07604550  6.968611
## ENSG00000163710.9 PCOLCE2    25.62512      0.9580851 0.14903229  6.428708
## ENSG00000132170.24 PPARG    188.27369      0.3979331 0.06842514  5.815597
## ENSG00000007968.7 E2F2     1048.78071      0.3171167 0.05559108  5.704454
## ENSG00000050767.18 COL23A1   59.82685      0.4708113 0.08827758  5.333305
## ENSG00000169994.19 MYO7B    752.03451      0.2899857 0.05465458  5.305789
## ENSG00000165092.13 ALDH1A1  290.37570     -0.4508214 0.08776359 -5.136770
## ENSG00000135424.18 ITGA7    522.88039      0.4244227 0.08275512  5.128659
## ENSG00000101187.16 SLCO4A1   83.64489      0.3936650 0.07837397  5.022905
## ENSG00000104918.8 RETN     2356.87387      0.4949748 0.10112306  4.894776
##                                  pvalue         padj
## ENSG00000108950.12 FAM20A  3.200859e-12 6.425083e-08
## ENSG00000163710.9 PCOLCE2  1.286930e-10 1.291627e-06
## ENSG00000132170.24 PPARG   6.041790e-09 4.042561e-05
## ENSG00000007968.7 E2F2     1.167169e-08 5.857147e-05
## ENSG00000050767.18 COL23A1 9.644089e-08 3.753200e-04
## ENSG00000169994.19 MYO7B   1.121865e-07 3.753200e-04
## ENSG00000165092.13 ALDH1A1 2.795011e-07 7.321977e-04
## ENSG00000135424.18 ITGA7   2.918140e-07 7.321977e-04
## ENSG00000101187.16 SLCO4A1 5.089561e-07 1.135142e-03
## ENSG00000104918.8 RETN     9.841752e-07 1.975535e-03
mean(abs(dge$stat))
## [1] 0.9391025
crp_pod1_b_adj <- dge

Sex differences in low CRP group (not stratified for treatment group)

SexD: 1=Female and 2=Male I confirmed with this expresion data

T0

No correction for treatment group.

#load chromossome2gene table
chr2gene <- read.table("../ref/chr2gene.tsv")
xyg <- subset(chr2gene,V1=="chrX" | V1=="chrY")

mx <- xt0

dim(mx)
## [1] 60649   111
mx <- mx[which(! sapply(strsplit(rownames(mx)," "),"[[",1) %in% xyg$V2),]
dim(mx)
## [1] 57660   111
ss2 <- as.data.frame(cbind(ss_t0,sscell_t0))
ss2 <- subset(ss2,crp_group==1)
mx <- mx[,colnames(mx) %in% rownames(ss2)]
mx <- mx[which(rowMeans(mx)>10),]
dim(mx)
## [1] 21291    56
# base model
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD )
## converting counts to integer mode
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
## -- replacing outliers and refitting for 344 genes
## -- DESeq argument 'minReplicatesForReplace' = 7 
## -- original counts are preserved in counts(dds)
## estimating dispersions
## fitting model and testing
z <- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                  baseMean log2FoldChange     lfcSE      stat
## ENSG00000234551.2 LINC01309      33.64159      2.3288688 0.1992312 11.689275
## ENSG00000223078.1 RNU2-55P       14.21314      2.1704799 0.2226793  9.747112
## ENSG00000287059.1 RP11-14A10.1   32.94434      1.8071869 0.2310635  7.821169
## ENSG00000249036.1 RP11-625I7.1   28.25079     -1.5570247 0.2110902 -7.376110
## ENSG00000280384.1 RP4-695O20.1   17.21499      0.8828052 0.1408053  6.269688
## ENSG00000196415.10 PRTN3        119.82185      2.4998558 0.4519385  5.531407
## ENSG00000247081.8 BAALC-AS1      32.75231      0.7696459 0.1396175  5.512532
## ENSG00000205611.5 LINC01597      73.26068      0.7738234 0.1414218  5.471742
## ENSG00000287763.1 RP11-153P14.1  75.91258     -2.5117536 0.4793555 -5.239855
## ENSG00000164821.5 DEFA4         258.59435      2.1153822 0.4041379  5.234308
##                                       pvalue         padj
## ENSG00000234551.2 LINC01309     1.446156e-31 3.079011e-27
## ENSG00000223078.1 RNU2-55P      1.897902e-22 2.020412e-18
## ENSG00000287059.1 RP11-14A10.1  5.233482e-15 3.714202e-11
## ENSG00000249036.1 RP11-625I7.1  1.629809e-13 8.675068e-10
## ENSG00000280384.1 RP4-695O20.1  3.617720e-10 1.540498e-06
## ENSG00000196415.10 PRTN3        3.176724e-08 1.075830e-04
## ENSG00000247081.8 BAALC-AS1     3.537085e-08 1.075830e-04
## ENSG00000205611.5 LINC01597     4.456328e-08 1.185996e-04
## ENSG00000287763.1 RP11-153P14.1 1.607025e-07 3.525872e-04
## ENSG00000164821.5 DEFA4         1.656039e-07 3.525872e-04
mean(abs(dge$stat))
## [1] 0.8831267
# model with clinical covariates
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ wound_typeOP + duration_sx + ethnicityCAT + ageCS + sexD )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 6 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                  baseMean log2FoldChange      lfcSE      stat
## ENSG00000234551.2 LINC01309      33.64159      2.4713038 0.23173499 10.664353
## ENSG00000223078.1 RNU2-55P       14.21314      2.1079567 0.25785314  8.175028
## ENSG00000287059.1 RP11-14A10.1   32.94434      1.7241550 0.26989561  6.388229
## ENSG00000249036.1 RP11-625I7.1   28.25079     -1.4908856 0.24549422 -6.072997
## ENSG00000205611.5 LINC01597      73.26068      0.8616120 0.15206704  5.666001
## ENSG00000280384.1 RP4-695O20.1   17.21499      0.8767754 0.16064316  5.457907
## ENSG00000261795.1 RP11-90P13.1   15.89334     -3.3636765 0.67220055 -5.003978
## ENSG00000184385.2 UMODL1-AS1     14.24879      3.4958582 0.72614584  4.814265
## ENSG00000196415.10 PRTN3        119.82185      2.3118201 0.48338320  4.782583
## ENSG00000128872.10 TMOD2       1918.82328     -0.4642050 0.09895551 -4.691047
##                                      pvalue         padj
## ENSG00000234551.2 LINC01309    1.494350e-26 3.181620e-22
## ENSG00000223078.1 RNU2-55P     2.957963e-16 3.148900e-12
## ENSG00000287059.1 RP11-14A10.1 1.678178e-10 1.191003e-06
## ENSG00000249036.1 RP11-625I7.1 1.255450e-09 6.682449e-06
## ENSG00000205611.5 LINC01597    1.461686e-08 6.224153e-05
## ENSG00000280384.1 RP4-695O20.1 4.817809e-08 1.709599e-04
## ENSG00000261795.1 RP11-90P13.1 5.615930e-07 1.708125e-03
## ENSG00000184385.2 UMODL1-AS1   1.477430e-06 3.931995e-03
## ENSG00000196415.10 PRTN3       1.730573e-06 4.093959e-03
## ENSG00000128872.10 TMOD2       2.718100e-06 5.787107e-03
mean(abs(dge$stat))
## [1] 0.9241159
mvf_lo_t0 <- dge

# model with clinical and cell covariates
# Monocytes.C NK T.CD8.Memory T.CD4.Naive Neutrophils.LD
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ wound_typeOP + duration_sx + ethnicityCAT + ageCS +
    Monocytes.C + NK + T.CD8.Memory + T.CD4.Naive + Neutrophils.LD + sexD )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   the design formula contains one or more numeric variables that have mean or
##   standard deviation larger than 5 (an arbitrary threshold to trigger this message).
##   Including numeric variables with large mean can induce collinearity with the intercept.
##   Users should center and scale numeric variables in the design to improve GLM convergence.
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 34 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                 baseMean log2FoldChange     lfcSE      stat
## ENSG00000234551.2 LINC01309     33.64159      2.4518641 0.2491134  9.842362
## ENSG00000223078.1 RNU2-55P      14.21314      2.0931763 0.2679162  7.812802
## ENSG00000249036.1 RP11-625I7.1  28.25079     -1.5651460 0.2478516 -6.314850
## ENSG00000287059.1 RP11-14A10.1  32.94434      1.6366468 0.2682068  6.102182
## ENSG00000205611.5 LINC01597     73.26068      0.7846061 0.1529007  5.131476
## ENSG00000110203.9 FOLR3        799.87269      1.6227754 0.3273100  4.957916
## ENSG00000261795.1 RP11-90P13.1  15.89334     -3.3514359 0.6905475 -4.853302
## ENSG00000196415.10 PRTN3       119.82185      2.4205744 0.5002323  4.838901
## ENSG00000280384.1 RP4-695O20.1  17.21499      0.8158338 0.1693221  4.818235
## ENSG00000165029.17 ABCA1       721.24100     -0.7541062 0.1577748 -4.779637
##                                      pvalue         padj
## ENSG00000234551.2 LINC01309    7.395355e-23 1.544002e-18
## ENSG00000223078.1 RNU2-55P     5.593026e-15 5.838560e-11
## ENSG00000249036.1 RP11-625I7.1 2.704232e-10 1.881965e-06
## ENSG00000287059.1 RP11-14A10.1 1.046299e-09 5.461160e-06
## ENSG00000205611.5 LINC01597    2.874794e-07 1.200399e-03
## ENSG00000110203.9 FOLR3        7.125324e-07 2.479375e-03
## ENSG00000261795.1 RP11-90P13.1 1.214223e-06 3.358942e-03
## ENSG00000196415.10 PRTN3       1.305591e-06 3.358942e-03
## ENSG00000280384.1 RP4-695O20.1 1.448335e-06 3.358942e-03
## ENSG00000165029.17 ABCA1       1.756123e-06 3.358942e-03
mean(abs(dge$stat))
## [1] 1.053656
mvf_lo_t0_adj <- dge

dim(subset(mvf_lo_t0,padj<0.05))
## [1] 19 62

EOS

No correction for treatment group.

#load chromossome2gene table
chr2gene <- read.table("../ref/chr2gene.tsv")
xyg <- subset(chr2gene,V1=="chrX" | V1=="chrY")

mx <- xeos

dim(mx)
## [1] 60649    98
mx <- mx[which(! sapply(strsplit(rownames(mx)," "),"[[",1) %in% xyg$V2),]
dim(mx)
## [1] 57660    98
ss2 <- as.data.frame(cbind(ss_eos,sscell_eos))
ss2 <- subset(ss2,crp_group==1)
mx <- mx[,colnames(mx) %in% rownames(ss2)]
mx <- mx[which(rowMeans(mx)>10),]
dim(mx)
## [1] 21512    46
# base model
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD )
## converting counts to integer mode
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
## -- replacing outliers and refitting for 106 genes
## -- DESeq argument 'minReplicatesForReplace' = 7 
## -- original counts are preserved in counts(dds)
## estimating dispersions
## fitting model and testing
z <- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                baseMean log2FoldChange     lfcSE      stat
## ENSG00000234551.2 LINC01309    32.07936       2.626331 0.2043337 12.853148
## ENSG00000223078.1 RNU2-55P     16.91390       2.317063 0.2134552 10.855030
## ENSG00000287059.1 RP11-14A10.1 31.85305       2.343386 0.2446115  9.580030
## ENSG00000249036.1 RP11-625I7.1 25.07900      -1.818686 0.1976662 -9.200793
## ENSG00000241111.1 PRICKLE2-AS1 13.60330       1.929835 0.2331559  8.277016
## ENSG00000261618.2 LINC02605    34.62957       1.152047 0.1606795  7.169844
## ENSG00000280384.1 RP4-695O20.1 17.77907       1.061146 0.1746189  6.076926
## ENSG00000279319.1 RP11-693M3.1 16.85722       1.165895 0.2188475  5.327430
## ENSG00000284692.2 RP1-58B11.2  15.70704       1.211100 0.2331978  5.193448
## ENSG00000159212.13 CLIC6       13.32563       1.538270 0.3144323  4.892215
##                                      pvalue         padj
## ENSG00000234551.2 LINC01309    8.257972e-38 1.776455e-33
## ENSG00000223078.1 RNU2-55P     1.887450e-27 2.030141e-23
## ENSG00000287059.1 RP11-14A10.1 9.701656e-22 6.956734e-18
## ENSG00000249036.1 RP11-625I7.1 3.553184e-20 1.910902e-16
## ENSG00000241111.1 PRICKLE2-AS1 1.263003e-16 5.433946e-13
## ENSG00000261618.2 LINC02605    7.508315e-13 2.691981e-09
## ENSG00000280384.1 RP4-695O20.1 1.225079e-09 3.764843e-06
## ENSG00000279319.1 RP11-693M3.1 9.961199e-08 2.678566e-04
## ENSG00000284692.2 RP1-58B11.2  2.064350e-07 4.934255e-04
## ENSG00000159212.13 CLIC6       9.970758e-07 2.144910e-03
mean(abs(dge$stat))
## [1] 0.9159988
# model with clinical covariates
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ wound_typeOP + duration_sx + ethnicityCAT + ageCS + sexD )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 5 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                baseMean log2FoldChange     lfcSE      stat
## ENSG00000234551.2 LINC01309    32.07936       2.589031 0.2311757 11.199412
## ENSG00000223078.1 RNU2-55P     16.91390       2.527264 0.2374445 10.643597
## ENSG00000287059.1 RP11-14A10.1 31.85305       2.572627 0.2805731  9.169186
## ENSG00000241111.1 PRICKLE2-AS1 13.60330       2.013881 0.2721151  7.400843
## ENSG00000249036.1 RP11-625I7.1 25.07900      -1.735733 0.2349588 -7.387393
## ENSG00000261618.2 LINC02605    34.62957       1.170551 0.1797314  6.512778
## ENSG00000184385.2 UMODL1-AS1   59.58609       5.093233 0.9088449  5.604073
## ENSG00000280384.1 RP4-695O20.1 17.77907       1.056001 0.1916923  5.508834
## ENSG00000205611.5 LINC01597    94.98889       1.075723 0.2276478  4.725385
## ENSG00000284692.2 RP1-58B11.2  15.70704       1.226824 0.2615174  4.691173
##                                      pvalue         padj
## ENSG00000234551.2 LINC01309    4.104503e-29 8.829607e-25
## ENSG00000223078.1 RNU2-55P     1.867769e-26 2.008972e-22
## ENSG00000287059.1 RP11-14A10.1 4.766061e-20 3.417583e-16
## ENSG00000241111.1 PRICKLE2-AS1 1.353225e-13 6.442204e-10
## ENSG00000249036.1 RP11-625I7.1 1.497351e-13 6.442204e-10
## ENSG00000261618.2 LINC02605    7.377374e-11 2.645035e-07
## ENSG00000184385.2 UMODL1-AS1   2.093725e-08 6.434317e-05
## ENSG00000280384.1 RP4-695O20.1 3.612177e-08 9.713143e-05
## ENSG00000205611.5 LINC01597    2.296802e-06 5.464630e-03
## ENSG00000284692.2 RP1-58B11.2  2.716432e-06 5.464630e-03
mean(abs(dge$stat))
## [1] 1.041239
mvf_lo_eos <- dge

# model with clinical and cell covariates
# Monocytes.C NK T.CD8.Memory T.CD4.Naive Neutrophils.LD
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ wound_typeOP + duration_sx + ethnicityCAT + ageCS +
    Monocytes.C + NK + T.CD8.Memory + T.CD4.Naive + Neutrophils.LD + sexD )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   the design formula contains one or more numeric variables that have mean or
##   standard deviation larger than 5 (an arbitrary threshold to trigger this message).
##   Including numeric variables with large mean can induce collinearity with the intercept.
##   Users should center and scale numeric variables in the design to improve GLM convergence.
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 43 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                  baseMean log2FoldChange     lfcSE      stat
## ENSG00000234551.2 LINC01309      32.07936      2.5687262 0.2647647  9.701919
## ENSG00000223078.1 RNU2-55P       16.91390      2.4648229 0.2728376  9.034029
## ENSG00000287059.1 RP11-14A10.1   31.85305      2.4177997 0.2710388  8.920494
## ENSG00000249036.1 RP11-625I7.1   25.07900     -1.8549603 0.2709563 -6.845975
## ENSG00000241111.1 PRICKLE2-AS1   13.60330      1.8163346 0.2918300  6.223947
## ENSG00000261618.2 LINC02605      34.62957      1.1442358 0.2006150  5.703640
## ENSG00000205611.5 LINC01597      94.98889      1.0459230 0.1887519  5.541257
## ENSG00000165617.15 DACT1        178.23996     -1.3978545 0.2563636 -5.452624
## ENSG00000157985.19 AGAP1        505.51722      0.8943585 0.1906247  4.691723
## ENSG00000287763.1 RP11-153P14.1  61.09995     -3.3614571 0.7429108 -4.524712
##                                       pvalue         padj
## ENSG00000234551.2 LINC01309     2.958793e-22 6.241277e-18
## ENSG00000223078.1 RNU2-55P      1.654650e-19 1.745159e-15
## ENSG00000287059.1 RP11-14A10.1  4.642148e-19 3.264049e-15
## ENSG00000249036.1 RP11-625I7.1  7.595658e-12 4.005570e-08
## ENSG00000241111.1 PRICKLE2-AS1  4.848011e-10 2.045279e-06
## ENSG00000261618.2 LINC02605     1.172753e-08 4.123009e-05
## ENSG00000205611.5 LINC01597     3.003077e-08 9.049557e-05
## ENSG00000165617.15 DACT1        4.963190e-08 1.308669e-04
## ENSG00000157985.19 AGAP1        2.709134e-06 6.349607e-03
## ENSG00000287763.1 RP11-153P14.1 6.047789e-06 1.275721e-02
mean(abs(dge$stat))
## [1] 0.8322918
mvf_lo_eos_adj <- dge

dim(subset(mvf_lo_eos,padj<0.05))
## [1] 33 52

POD1

No correction for treatment group.

#load chromossome2gene table
chr2gene <- read.table("../ref/chr2gene.tsv")
xyg <- subset(chr2gene,V1=="chrX" | V1=="chrY")

mx <- xpod1

dim(mx)
## [1] 60649   109
mx <- mx[which(! sapply(strsplit(rownames(mx)," "),"[[",1) %in% xyg$V2),]
dim(mx)
## [1] 57660   109
ss2 <- as.data.frame(cbind(ss_pod1,sscell_pod1))
ss2 <- subset(ss2,crp_group==1)
mx <- mx[,colnames(mx) %in% rownames(ss2)]
mx <- mx[which(rowMeans(mx)>10),]
dim(mx)
## [1] 20659    55
# base model
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD )
## converting counts to integer mode
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
## -- replacing outliers and refitting for 122 genes
## -- DESeq argument 'minReplicatesForReplace' = 7 
## -- original counts are preserved in counts(dds)
## estimating dispersions
## fitting model and testing
z <- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                 baseMean log2FoldChange     lfcSE       stat
## ENSG00000234551.2 LINC01309     34.12360      2.4651830 0.1761162  13.997477
## ENSG00000249036.1 RP11-625I7.1  21.88654     -1.9476850 0.1672608 -11.644596
## ENSG00000223078.1 RNU2-55P      13.46670      2.4858941 0.2197302  11.313394
## ENSG00000251199.6 RP11-400D2.2  25.27517      1.2521909 0.1550861   8.074167
## ENSG00000241111.1 PRICKLE2-AS1  10.02828      1.7763327 0.2567832   6.917637
## ENSG00000287763.1 RP11-153P14.1 69.51778     -2.6560497 0.4655662  -5.704988
## ENSG00000287059.1 RP11-14A10.1  22.95559      1.3682563 0.2444267   5.597818
## ENSG00000261618.2 LINC02605     31.80415      0.8652806 0.1596389   5.420235
## ENSG00000078114.19 NEBL         33.02077      3.1015394 0.5786268   5.360172
## ENSG00000242741.2 LINC02005     15.47253      0.9387608 0.1777857   5.280294
##                                       pvalue         padj
## ENSG00000234551.2 LINC01309     1.615029e-44 3.336487e-40
## ENSG00000249036.1 RP11-625I7.1  2.444769e-31 2.525325e-27
## ENSG00000223078.1 RNU2-55P      1.126456e-29 7.757148e-26
## ENSG00000251199.6 RP11-400D2.2  6.793902e-16 3.508881e-12
## ENSG00000241111.1 PRICKLE2-AS1  4.592394e-12 1.897485e-08
## ENSG00000287763.1 RP11-153P14.1 1.163512e-08 4.006167e-05
## ENSG00000287059.1 RP11-14A10.1  2.170659e-08 6.406234e-05
## ENSG00000261618.2 LINC02605     5.952074e-08 1.537049e-04
## ENSG00000078114.19 NEBL         8.314272e-08 1.908495e-04
## ENSG00000242741.2 LINC02005     1.289770e-07 2.664537e-04
mean(abs(dge$stat))
## [1] 0.7233669
# model with clinical covariates
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ wound_typeOP + duration_sx + ethnicityCAT + ageCS + sexD )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 4 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                baseMean log2FoldChange     lfcSE      stat
## ENSG00000234551.2 LINC01309    34.12360      2.5895969 0.1983491 13.055751
## ENSG00000249036.1 RP11-625I7.1 21.88654     -1.8468544 0.1885919 -9.792862
## ENSG00000223078.1 RNU2-55P     13.46670      2.4049572 0.2521087  9.539366
## ENSG00000251199.6 RP11-400D2.2 25.27517      1.2983374 0.1804491  7.195034
## ENSG00000241111.1 PRICKLE2-AS1 10.02828      2.0733786 0.2923354  7.092465
## ENSG00000261618.2 LINC02605    31.80415      0.9719705 0.1888472  5.146862
## ENSG00000184385.2 UMODL1-AS1   10.70454      4.5617023 0.9045180  5.043241
## ENSG00000205611.5 LINC01597    51.31977      0.8279942 0.1641945  5.042766
## ENSG00000287059.1 RP11-14A10.1 22.95559      1.3892825 0.2782894  4.992223
## ENSG00000242741.2 LINC02005    15.47253      0.9523263 0.1973762  4.824930
##                                      pvalue         padj
## ENSG00000234551.2 LINC01309    5.892606e-39 1.217353e-34
## ENSG00000249036.1 RP11-625I7.1 1.208266e-22 1.248078e-18
## ENSG00000223078.1 RNU2-55P     1.437083e-21 9.896229e-18
## ENSG00000251199.6 RP11-400D2.2 6.244523e-13 3.225140e-09
## ENSG00000241111.1 PRICKLE2-AS1 1.317439e-12 5.443395e-09
## ENSG00000261618.2 LINC02605    2.648805e-07 9.120278e-04
## ENSG00000184385.2 UMODL1-AS1   4.577127e-07 1.184926e-03
## ENSG00000205611.5 LINC01597    4.588514e-07 1.184926e-03
## ENSG00000287059.1 RP11-14A10.1 5.968836e-07 1.370113e-03
## ENSG00000242741.2 LINC02005    1.400521e-06 2.893337e-03
mean(abs(dge$stat))
## [1] 0.8024447
mvf_lo_pod1 <- dge

# model with clinical and cell covariates
# Monocytes.C NK T.CD8.Memory T.CD4.Naive Neutrophils.LD
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ wound_typeOP + duration_sx + ethnicityCAT + ageCS +
    Monocytes.C + NK + T.CD8.Memory + T.CD4.Naive + Neutrophils.LD + sexD )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   the design formula contains one or more numeric variables that have mean or
##   standard deviation larger than 5 (an arbitrary threshold to trigger this message).
##   Including numeric variables with large mean can induce collinearity with the intercept.
##   Users should center and scale numeric variables in the design to improve GLM convergence.
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 25 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                  baseMean log2FoldChange     lfcSE       stat
## ENSG00000234551.2 LINC01309      34.12360      2.6736070 0.2200506  12.149965
## ENSG00000249036.1 RP11-625I7.1   21.88654     -1.9946355 0.1980809 -10.069800
## ENSG00000223078.1 RNU2-55P       13.46670      2.0483748 0.2508722   8.165012
## ENSG00000251199.6 RP11-400D2.2   25.27517      1.2757453 0.2026396   6.295638
## ENSG00000241111.1 PRICKLE2-AS1   10.02828      1.8227202 0.3176457   5.738218
## ENSG00000287763.1 RP11-153P14.1  69.51778     -2.9784871 0.5306885  -5.612496
## ENSG00000287059.1 RP11-14A10.1   22.95559      1.3525085 0.2781884   4.861844
## ENSG00000261618.2 LINC02605      31.80415      0.9841545 0.2160896   4.554382
## ENSG00000165617.15 DACT1        136.99579     -1.0197245 0.2519794  -4.046856
## ENSG00000284692.2 RP1-58B11.2    13.53876      1.2539525 0.3136026   3.998540
##                                       pvalue         padj
## ENSG00000234551.2 LINC01309     5.739020e-34 1.185624e-29
## ENSG00000249036.1 RP11-625I7.1  7.513053e-24 7.760608e-20
## ENSG00000223078.1 RNU2-55P      3.214021e-16 2.213282e-12
## ENSG00000251199.6 RP11-400D2.2  3.061378e-10 1.581125e-06
## ENSG00000241111.1 PRICKLE2-AS1  9.567766e-09 3.953210e-05
## ENSG00000287763.1 RP11-153P14.1 1.994291e-08 6.866676e-05
## ENSG00000287059.1 RP11-14A10.1  1.162972e-06 3.432261e-03
## ENSG00000261618.2 LINC02605     5.253989e-06 1.356777e-02
## ENSG00000165617.15 DACT1        5.191020e-05 1.191570e-01
## ENSG00000284692.2 RP1-58B11.2   6.373438e-05 1.307941e-01
mean(abs(dge$stat))
## [1] 0.8050564
mvf_lo_pod1_adj <- dge

dim(subset(mvf_lo_pod1,padj<0.05))
## [1] 16 61

Sex differences in high CRP group (not stratified for treatment group)

T0

No correction for treatment group.

#load chromosome2gene table
chr2gene <- read.table("../ref/chr2gene.tsv")
xyg <- subset(chr2gene,V1=="chrX" | V1=="chrY")

mx <- xt0

dim(mx)
## [1] 60649   111
mx <- mx[which(! sapply(strsplit(rownames(mx)," "),"[[",1) %in% xyg$V2),]
dim(mx)
## [1] 57660   111
ss2 <- as.data.frame(cbind(ss_t0,sscell_t0))
ss2 <- subset(ss2,crp_group==4)
mx <- mx[,colnames(mx) %in% rownames(ss2)]
mx <- mx[which(rowMeans(mx)>10),]
dim(mx)
## [1] 21177    55
# base model
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD )
## converting counts to integer mode
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
## -- replacing outliers and refitting for 291 genes
## -- DESeq argument 'minReplicatesForReplace' = 7 
## -- original counts are preserved in counts(dds)
## estimating dispersions
## fitting model and testing
z <- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                 baseMean log2FoldChange     lfcSE      stat
## ENSG00000234551.2 LINC01309     41.09906      2.7475538 0.1703948 16.124634
## ENSG00000249036.1 RP11-625I7.1  22.89777     -1.6712038 0.1890118 -8.841796
## ENSG00000223078.1 RNU2-55P      15.68780      2.0376671 0.2319994  8.783072
## ENSG00000287059.1 RP11-14A10.1  30.25752      1.8377734 0.2273394  8.083833
## ENSG00000251199.6 RP11-400D2.2  34.79657      1.1193965 0.1559826  7.176420
## ENSG00000241111.1 PRICKLE2-AS1  12.71155      1.9977146 0.2785771  7.171138
## ENSG00000282826.2 FRG1CP       568.54614      0.5373063 0.1038772  5.172515
## ENSG00000029534.21 ANK1        308.08237     -0.6663338 0.1370848 -4.860743
## ENSG00000118492.18 ADGB         28.31195      0.6425526 0.1324436  4.851519
## ENSG00000205611.5 LINC01597     72.91149      0.7235389 0.1492394  4.848175
##                                      pvalue         padj
## ENSG00000234551.2 LINC01309    1.712703e-58 3.626992e-54
## ENSG00000249036.1 RP11-625I7.1 9.419198e-19 9.973518e-15
## ENSG00000223078.1 RNU2-55P     1.590687e-18 1.122866e-14
## ENSG00000287059.1 RP11-14A10.1 6.276204e-16 3.322779e-12
## ENSG00000251199.6 RP11-400D2.2 7.156033e-13 2.625132e-09
## ENSG00000241111.1 PRICKLE2-AS1 7.437689e-13 2.625132e-09
## ENSG00000282826.2 FRG1CP       2.309639e-07 6.987318e-04
## ENSG00000029534.21 ANK1        1.169460e-06 2.638709e-03
## ENSG00000118492.18 ADGB        1.225196e-06 2.638709e-03
## ENSG00000205611.5 LINC01597    1.246026e-06 2.638709e-03
mean(abs(dge$stat))
## [1] 0.8218259
# model with clinical covariates
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ wound_typeOP + duration_sx + ethnicityCAT + ageCS + sexD )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 5 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                  baseMean log2FoldChange     lfcSE      stat
## ENSG00000234551.2 LINC01309      41.09906      2.7234360 0.1838595 14.812594
## ENSG00000223078.1 RNU2-55P       15.68780      2.0820131 0.2407429  8.648286
## ENSG00000249036.1 RP11-625I7.1   22.89777     -1.6615975 0.2070612 -8.024668
## ENSG00000287059.1 RP11-14A10.1   30.25752      1.8229839 0.2395041  7.611493
## ENSG00000251199.6 RP11-400D2.2   34.79657      1.1448244 0.1615118  7.088176
## ENSG00000241111.1 PRICKLE2-AS1   12.71155      1.9854604 0.2902379  6.840804
## ENSG00000160789.24 LMNA        1114.84849     -0.7007711 0.1364879 -5.134309
## ENSG00000205611.5 LINC01597      72.91149      0.7420386 0.1454348  5.102207
## ENSG00000259719.6 LINC02284      54.28891     -0.9905106 0.1944177 -5.094755
## ENSG00000163735.7 CXCL5         255.03703     -1.6090605 0.3224991 -4.989348
##                                      pvalue         padj
## ENSG00000234551.2 LINC01309    1.214610e-49 2.572179e-45
## ENSG00000223078.1 RNU2-55P     5.227853e-18 5.535513e-14
## ENSG00000249036.1 RP11-625I7.1 1.018007e-15 7.186111e-12
## ENSG00000287059.1 RP11-14A10.1 2.709485e-14 1.434469e-10
## ENSG00000251199.6 RP11-400D2.2 1.358907e-12 5.755514e-09
## ENSG00000241111.1 PRICKLE2-AS1 7.874968e-12 2.779470e-08
## ENSG00000160789.24 LMNA        2.831820e-07 8.216514e-04
## ENSG00000205611.5 LINC01597    3.357158e-07 8.216514e-04
## ENSG00000259719.6 LINC02284    3.491931e-07 8.216514e-04
## ENSG00000163735.7 CXCL5        6.058330e-07 1.282973e-03
mean(abs(dge$stat))
## [1] 0.8154546
mvf_hi_t0 <- dge

# model with clinical and cell covariates
# Monocytes.C NK T.CD8.Memory T.CD4.Naive Neutrophils.LD
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ wound_typeOP + duration_sx + ethnicityCAT + ageCS +
    Monocytes.C + NK + T.CD8.Memory + T.CD4.Naive + Neutrophils.LD + sexD )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   the design formula contains one or more numeric variables that have mean or
##   standard deviation larger than 5 (an arbitrary threshold to trigger this message).
##   Including numeric variables with large mean can induce collinearity with the intercept.
##   Users should center and scale numeric variables in the design to improve GLM convergence.
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 32 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                  baseMean log2FoldChange     lfcSE      stat
## ENSG00000234551.2 LINC01309      41.09906      2.6846907 0.1911359 14.045981
## ENSG00000249036.1 RP11-625I7.1   22.89777     -1.6363912 0.1700173 -9.624854
## ENSG00000223078.1 RNU2-55P       15.68780      2.1673711 0.2405690  9.009352
## ENSG00000287059.1 RP11-14A10.1   30.25752      1.9148333 0.2435334  7.862713
## ENSG00000241111.1 PRICKLE2-AS1   12.71155      2.1716927 0.2840886  7.644419
## ENSG00000251199.6 RP11-400D2.2   34.79657      1.1927657 0.1641165  7.267798
## ENSG00000160789.24 LMNA        1114.84849     -0.7762545 0.1363744 -5.692085
## ENSG00000259719.6 LINC02284      54.28891     -1.0524868 0.1892137 -5.562423
## ENSG00000154917.11 RAB6B        155.08204     -0.8860747 0.1625383 -5.451483
## ENSG00000119326.15 CTNNAL1       57.45744     -0.9210510 0.1717600 -5.362431
##                                      pvalue         padj
## ENSG00000234551.2 LINC01309    8.153186e-45 1.693091e-40
## ENSG00000249036.1 RP11-625I7.1 6.279627e-22 6.520137e-18
## ENSG00000223078.1 RNU2-55P     2.072780e-19 1.434779e-15
## ENSG00000287059.1 RP11-14A10.1 3.759030e-15 1.951500e-11
## ENSG00000241111.1 PRICKLE2-AS1 2.098905e-14 8.717170e-11
## ENSG00000251199.6 RP11-400D2.2 3.653952e-13 1.264633e-09
## ENSG00000160789.24 LMNA        1.254976e-08 3.722975e-05
## ENSG00000259719.6 LINC02284    2.660549e-08 6.906121e-05
## ENSG00000154917.11 RAB6B       4.995156e-08 1.152549e-04
## ENSG00000119326.15 CTNNAL1     8.210948e-08 1.675167e-04
mean(abs(dge$stat))
## [1] 0.9985843
mvf_hi_t0_adj <- dge

dim(subset(mvf_hi_t0,padj<0.05))
## [1] 71 61

EOS

No correction for treatment group.

#load chromosome2gene table
chr2gene <- read.table("../ref/chr2gene.tsv")
xyg <- subset(chr2gene,V1=="chrX" | V1=="chrY")

mx <- xeos

dim(mx)
## [1] 60649    98
mx <- mx[which(! sapply(strsplit(rownames(mx)," "),"[[",1) %in% xyg$V2),]
dim(mx)
## [1] 57660    98
ss2 <- as.data.frame(cbind(ss_eos,sscell_eos))
ss2 <- subset(ss2,crp_group==4)
mx <- mx[,colnames(mx) %in% rownames(ss2)]
mx <- mx[which(rowMeans(mx)>10),]
dim(mx)
## [1] 21199    52
# base model
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD )
## converting counts to integer mode
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
## -- replacing outliers and refitting for 124 genes
## -- DESeq argument 'minReplicatesForReplace' = 7 
## -- original counts are preserved in counts(dds)
## estimating dispersions
## fitting model and testing
z <- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                 baseMean log2FoldChange     lfcSE      stat
## ENSG00000234551.2 LINC01309     33.33921      2.4403190 0.1856270 13.146361
## ENSG00000287059.1 RP11-14A10.1  29.01227      1.5746345 0.2048465  7.686900
## ENSG00000223078.1 RNU2-55P      15.44212      1.6837808 0.2307396  7.297320
## ENSG00000241111.1 PRICKLE2-AS1  11.99614      1.8361849 0.2656031  6.913266
## ENSG00000249036.1 RP11-625I7.1  20.48683     -1.3690932 0.2206460 -6.204930
## ENSG00000251199.6 RP11-400D2.2  29.81371      1.3818661 0.2242179  6.163049
## ENSG00000142606.16 MMEL1        41.01197      1.2360933 0.2570226  4.809278
## ENSG00000261618.2 LINC02605     38.40968      0.6575011 0.1371833  4.792867
## ENSG00000182263.14 FIGN         14.80449      3.0725635 0.6525952  4.708223
## ENSG00000164821.5 DEFA4        396.33649      2.4120317 0.5537353  4.355929
##                                      pvalue         padj
## ENSG00000234551.2 LINC01309    1.785629e-39 3.785355e-35
## ENSG00000287059.1 RP11-14A10.1 1.507434e-14 1.597805e-10
## ENSG00000223078.1 RNU2-55P     2.935551e-13 2.074358e-09
## ENSG00000241111.1 PRICKLE2-AS1 4.736200e-12 2.510068e-08
## ENSG00000249036.1 RP11-625I7.1 5.472112e-10 2.320066e-06
## ENSG00000251199.6 RP11-400D2.2 7.135740e-10 2.521176e-06
## ENSG00000142606.16 MMEL1       1.514764e-06 4.356779e-03
## ENSG00000261618.2 LINC02605    1.644145e-06 4.356779e-03
## ENSG00000182263.14 FIGN        2.498862e-06 5.885930e-03
## ENSG00000164821.5 DEFA4        1.325038e-05 2.808948e-02
mean(abs(dge$stat))
## [1] 0.7524278
# model with clinical covariates
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ wound_typeOP + duration_sx + ethnicityCAT + ageCS + sexD )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   the design formula contains one or more numeric variables that have mean or
##   standard deviation larger than 5 (an arbitrary threshold to trigger this message).
##   Including numeric variables with large mean can induce collinearity with the intercept.
##   Users should center and scale numeric variables in the design to improve GLM convergence.
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 1 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                 baseMean log2FoldChange     lfcSE      stat
## ENSG00000234551.2 LINC01309     33.33921      2.3569271 0.1869109 12.609898
## ENSG00000287059.1 RP11-14A10.1  29.01227      1.5794570 0.2151250  7.342044
## ENSG00000223078.1 RNU2-55P      15.44212      1.6681236 0.2412151  6.915503
## ENSG00000241111.1 PRICKLE2-AS1  11.99614      1.8381605 0.2758089  6.664617
## ENSG00000249036.1 RP11-625I7.1  20.48683     -1.4387781 0.2362987 -6.088810
## ENSG00000251199.6 RP11-400D2.2  29.81371      1.4085373 0.2348460  5.997706
## ENSG00000279319.1 RP11-693M3.1  16.33692      1.0589761 0.2254952  4.696226
## ENSG00000261618.2 LINC02605     38.40968      0.6611660 0.1467102  4.506612
## ENSG00000282826.2 FRG1CP       514.33435      0.4766021 0.1125323  4.235247
## ENSG00000142606.16 MMEL1        41.01197      1.0664933 0.2523226  4.226705
##                                      pvalue         padj
## ENSG00000234551.2 LINC01309    1.862331e-36 3.947956e-32
## ENSG00000287059.1 RP11-14A10.1 2.103563e-13 2.229672e-09
## ENSG00000223078.1 RNU2-55P     4.662056e-12 3.294364e-08
## ENSG00000241111.1 PRICKLE2-AS1 2.653562e-11 1.406321e-07
## ENSG00000249036.1 RP11-625I7.1 1.137527e-09 4.822889e-06
## ENSG00000251199.6 RP11-400D2.2 2.001239e-09 7.070711e-06
## ENSG00000279319.1 RP11-693M3.1 2.650129e-06 8.025727e-03
## ENSG00000261618.2 LINC02605    6.587084e-06 1.745495e-02
## ENSG00000282826.2 FRG1CP       2.283009e-05 5.027092e-02
## ENSG00000142606.16 MMEL1       2.371382e-05 5.027092e-02
mean(abs(dge$stat))
## [1] 0.7620069
mvf_hi_eos <- dge

# model with clinical and cell covariates
# Monocytes.C NK T.CD8.Memory T.CD4.Naive Neutrophils.LD
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ wound_typeOP + duration_sx + ethnicityCAT + ageCS +
    Monocytes.C + NK + T.CD8.Memory + T.CD4.Naive + Neutrophils.LD + sexD )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   the design formula contains one or more numeric variables that have mean or
##   standard deviation larger than 5 (an arbitrary threshold to trigger this message).
##   Including numeric variables with large mean can induce collinearity with the intercept.
##   Users should center and scale numeric variables in the design to improve GLM convergence.
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 22 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                 baseMean log2FoldChange      lfcSE      stat
## ENSG00000234551.2 LINC01309     33.33921      2.3190333 0.19888020 11.660453
## ENSG00000287059.1 RP11-14A10.1  29.01227      1.6504563 0.21782310  7.577049
## ENSG00000223078.1 RNU2-55P      15.44212      1.7428476 0.23923625  7.285048
## ENSG00000241111.1 PRICKLE2-AS1  11.99614      1.8924612 0.28170812  6.717808
## ENSG00000249036.1 RP11-625I7.1  20.48683     -1.5987534 0.25234027 -6.335704
## ENSG00000251199.6 RP11-400D2.2  29.81371      1.4028800 0.24878915  5.638831
## ENSG00000282826.2 FRG1CP       514.33435      0.4860188 0.09781556  4.968727
## ENSG00000261618.2 LINC02605     38.40968      0.6865628 0.15310419  4.484285
## ENSG00000205611.5 LINC01597     72.82931      0.7217618 0.16444589  4.389053
## ENSG00000149531.15 FRG1BP       65.48543      0.8062481 0.18386033  4.385112
##                                      pvalue         padj
## ENSG00000234551.2 LINC01309    2.029588e-31 4.302523e-27
## ENSG00000287059.1 RP11-14A10.1 3.535028e-14 3.746953e-10
## ENSG00000223078.1 RNU2-55P     3.215558e-13 2.272220e-09
## ENSG00000241111.1 PRICKLE2-AS1 1.844781e-11 9.776877e-08
## ENSG00000249036.1 RP11-625I7.1 2.362594e-10 1.001692e-06
## ENSG00000251199.6 RP11-400D2.2 1.712084e-08 6.049080e-05
## ENSG00000282826.2 FRG1CP       6.739398e-07 2.040979e-03
## ENSG00000261618.2 LINC02605    7.315888e-06 1.938619e-02
## ENSG00000205611.5 LINC01597    1.138453e-05 2.457520e-02
## ENSG00000149531.15 FRG1BP      1.159262e-05 2.457520e-02
mean(abs(dge$stat))
## [1] 0.7764455
mvf_hi_eos_adj <- dge

dim(subset(mvf_hi_eos,padj<0.05))
## [1]  8 58

POD1

No correction for treatment group.

#load chromosome2gene table
chr2gene <- read.table("../ref/chr2gene.tsv")
xyg <- subset(chr2gene,V1=="chrX" | V1=="chrY")

mx <- xpod1

dim(mx)
## [1] 60649   109
mx <- mx[which(! sapply(strsplit(rownames(mx)," "),"[[",1) %in% xyg$V2),]
dim(mx)
## [1] 57660   109
ss2 <- as.data.frame(cbind(ss_pod1,sscell_pod1))
ss2 <- subset(ss2,crp_group==4)
mx <- mx[,colnames(mx) %in% rownames(ss2)]
mx <- mx[which(rowMeans(mx)>10),]
dim(mx)
## [1] 20547    54
# base model
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ sexD )
## converting counts to integer mode
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
## -- replacing outliers and refitting for 231 genes
## -- DESeq argument 'minReplicatesForReplace' = 7 
## -- original counts are preserved in counts(dds)
## estimating dispersions
## fitting model and testing
z <- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                 baseMean log2FoldChange     lfcSE      stat
## ENSG00000234551.2 LINC01309     28.88719      2.3303369 0.2131694 10.931854
## ENSG00000251199.6 RP11-400D2.2  24.04062      1.5721928 0.1783430  8.815555
## ENSG00000249036.1 RP11-625I7.1  16.02735     -1.8716484 0.2140172 -8.745319
## ENSG00000287059.1 RP11-14A10.1  17.45351      1.2737217 0.2194248  5.804820
## ENSG00000223078.1 RNU2-55P      10.63492      1.3736437 0.2454948  5.595408
## ENSG00000142606.16 MMEL1        42.71184      1.1433146 0.2127386  5.374269
## ENSG00000280384.1 RP4-695O20.1  14.18123      0.9356208 0.1807317  5.176848
## ENSG00000162069.16 BICDL2       33.70854     -2.7279023 0.5323684 -5.124087
## ENSG00000254873.1 RP11-770J1.5  48.30434      1.8877549 0.3853291  4.899071
## ENSG00000268758.7 ADGRE4P      473.39915     -1.2894914 0.2855855 -4.515255
##                                      pvalue         padj
## ENSG00000234551.2 LINC01309    8.117291e-28 1.667779e-23
## ENSG00000251199.6 RP11-400D2.2 1.190934e-18 1.223447e-14
## ENSG00000249036.1 RP11-625I7.1 2.223873e-18 1.523056e-14
## ENSG00000287059.1 RP11-14A10.1 6.443507e-09 3.309708e-05
## ENSG00000223078.1 RNU2-55P     2.201039e-08 9.044510e-05
## ENSG00000142606.16 MMEL1       7.689389e-08 2.633103e-04
## ENSG00000280384.1 RP4-695O20.1 2.256658e-07 6.623612e-04
## ENSG00000162069.16 BICDL2      2.989829e-07 7.678627e-04
## ENSG00000254873.1 RP11-770J1.5 9.629062e-07 2.198208e-03
## ENSG00000268758.7 ADGRE4P      6.324051e-06 1.299339e-02
mean(abs(dge$stat))
## [1] 0.6861829
# model with clinical covariates
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ wound_typeOP + duration_sx + ethnicityCAT + ageCS + sexD )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 4 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                 baseMean log2FoldChange     lfcSE      stat
## ENSG00000234551.2 LINC01309     28.88719       2.385083 0.2268342 10.514655
## ENSG00000251199.6 RP11-400D2.2  24.04062       1.570040 0.1886671  8.321744
## ENSG00000249036.1 RP11-625I7.1  16.02735      -1.776728 0.2305346 -7.706991
## ENSG00000287059.1 RP11-14A10.1  17.45351       1.416739 0.2211889  6.405110
## ENSG00000223078.1 RNU2-55P      10.63492       1.447740 0.2598982  5.570413
## ENSG00000280384.1 RP4-695O20.1  14.18123       0.920274 0.1922327  4.787291
## ENSG00000255398.3 HCAR3        337.50562      -2.477792 0.5269334 -4.702287
## ENSG00000162069.16 BICDL2       50.61023      -2.985381 0.6528841 -4.572605
## ENSG00000137261.15 KIAA0319     44.83620      -2.267737 0.5122779 -4.426770
## ENSG00000288700.1 RP11-22E12.2  31.68989      -2.035255 0.4605020 -4.419644
##                                      pvalue         padj
## ENSG00000234551.2 LINC01309    7.395101e-26 1.519471e-21
## ENSG00000251199.6 RP11-400D2.2 8.667818e-17 8.904883e-13
## ENSG00000249036.1 RP11-625I7.1 1.288187e-14 8.822789e-11
## ENSG00000287059.1 RP11-14A10.1 1.502613e-10 7.718546e-07
## ENSG00000223078.1 RNU2-55P     2.541369e-08 1.044350e-04
## ENSG00000280384.1 RP4-695O20.1 1.690473e-06 5.789023e-03
## ENSG00000255398.3 HCAR3        2.572637e-06 7.551426e-03
## ENSG00000162069.16 BICDL2      4.816974e-06 1.237180e-02
## ENSG00000137261.15 KIAA0319    9.565469e-06 2.031348e-02
## ENSG00000288700.1 RP11-22E12.2 9.886348e-06 2.031348e-02
mean(abs(dge$stat))
## [1] 0.6998285
mvf_hi_pod1 <- dge

# model with clinical and cell covariates
# Monocytes.C NK T.CD8.Memory T.CD4.Naive Neutrophils.LD
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ wound_typeOP + duration_sx + ethnicityCAT + ageCS +
    Monocytes.C + NK + T.CD8.Memory + T.CD4.Naive + Neutrophils.LD + sexD )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables with integer values,
##   specifying a model with increasing fold change for higher values.
##   did you mean for this to be a factor? if so, first convert
##   this variable to a factor using the factor() function
##   the design formula contains one or more numeric variables that have mean or
##   standard deviation larger than 5 (an arbitrary threshold to trigger this message).
##   Including numeric variables with large mean can induce collinearity with the intercept.
##   Users should center and scale numeric variables in the design to improve GLM convergence.
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
res <- DESeq(dds)
## estimating size factors
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
## final dispersion estimates
## fitting model and testing
## 27 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
##   Note: levels of factors in the design contain characters other than
##   letters, numbers, '_' and '.'. It is recommended (but not required) to use
##   only letters, numbers, and delimiters '_' or '.', as these are safe characters
##   for column names in R. [This is a message, not a warning or an error]
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                 baseMean log2FoldChange     lfcSE      stat
## ENSG00000234551.2 LINC01309     28.88719      2.4115309 0.2449939  9.843228
## ENSG00000251199.6 RP11-400D2.2  24.04062      1.6172504 0.2030527  7.964684
## ENSG00000249036.1 RP11-625I7.1  16.02735     -1.7745608 0.2596691 -6.833932
## ENSG00000287059.1 RP11-14A10.1  17.45351      1.5247642 0.2436638  6.257655
## ENSG00000223078.1 RNU2-55P      10.63492      1.3888621 0.2622127  5.296700
## ENSG00000175084.13 DES          28.27529     -1.6131152 0.3231907 -4.991218
## ENSG00000287763.1 RP11-153P14.1 50.70110     -2.4542507 0.5217216 -4.704138
## ENSG00000142606.16 MMEL1        42.71184      0.9755700 0.2083534  4.682286
## ENSG00000254873.1 RP11-770J1.5  48.30434      1.6729181 0.3625610  4.614170
## ENSG00000280384.1 RP4-695O20.1  14.18123      0.9225725 0.2086612  4.421389
##                                       pvalue         padj
## ENSG00000234551.2 LINC01309     7.332016e-23 1.506509e-18
## ENSG00000251199.6 RP11-400D2.2  1.656470e-15 1.701774e-11
## ENSG00000249036.1 RP11-625I7.1  8.261805e-12 5.658510e-08
## ENSG00000287059.1 RP11-14A10.1  3.908082e-10 2.007484e-06
## ENSG00000223078.1 RNU2-55P      1.179144e-07 4.845575e-04
## ENSG00000175084.13 DES          5.999962e-07 2.054687e-03
## ENSG00000287763.1 RP11-153P14.1 2.549403e-06 7.286320e-03
## ENSG00000142606.16 MMEL1        2.836938e-06 7.286320e-03
## ENSG00000254873.1 RP11-770J1.5  3.946686e-06 9.010283e-03
## ENSG00000280384.1 RP4-695O20.1  9.806835e-06 2.015010e-02
mean(abs(dge$stat))
## [1] 0.826465
mvf_hi_pod1_adj <- dge

dim(subset(mvf_hi_pod1,padj<0.05))
## [1] 18 60

Effect of surgery in males with high CRP

In sexD==1 females

16 females only with T0 and POD1

ss2 <- merge(sscell,ss,by=0)
rownames(ss2) <- ss2$Row.names

ss2 <- subset(ss2,crp_group==4 & timepoint != "EOS" & sexD == 1 )

mx <- xx[,colnames(xx) %in% rownames(ss2)]
mx <- mx[which(rowMeans(mx)>10),]
dim(mx)
## [1] 21567    33
table(chr2gene[match(sapply(strsplit(rownames(mx)," "),"[[",1),chr2gene$V2),1])
## 
##  chr1 chr10 chr11 chr12 chr13 chr14 chr15 chr16 chr17 chr18 chr19  chr2 chr20 
##  2142   809  1139  1125   375   806   739  1104  1352   336  1548  1412   545 
## chr21 chr22  chr3  chr4  chr5  chr6  chr7  chr8  chr9  chrM  chrX  chrY 
##   266   600  1147   760   931  1087  1110   724   805    19   654    32
ss2 <- ss2[which(rownames(ss2) %in% colnames(mx)),]
ss2 <- ss2[order(rownames(ss2)),]

ss2$timepoint <- factor(ss2$timepoint,levels=c("T0","POD1"))

#dim(mx)
#mx <- mx[which(! sapply(strsplit(rownames(mx)," "),"[[",1) %in% xyg$V2),]
#dim(mx)

# base model
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ PG_number + timepoint )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
z <- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                             baseMean log2FoldChange      lfcSE     stat
## ENSG00000108950.12 FAM20A  1418.5179       3.869053 0.19174287 20.17834
## ENSG00000014257.16 ACP3     869.0445       1.338041 0.07937339 16.85755
## ENSG00000156414.19 TDRD9    896.8816       2.319293 0.13761906 16.85299
## ENSG00000132170.24 PPARG    123.3816       3.213308 0.20483828 15.68705
## ENSG00000168615.13 ADAM9   1574.2542       1.624515 0.10366969 15.67010
## ENSG00000161944.16 ASGR2   2906.2035       1.620646 0.10347070 15.66285
## ENSG00000169385.3 RNASE2   1250.4443       2.346518 0.15249733 15.38727
## ENSG00000164125.16 GASK1B  3608.4252       1.654531 0.10827604 15.28067
## ENSG00000183019.7 MCEMP1   4357.8963       2.863233 0.18810447 15.22151
## ENSG00000203710.12 CR1    11629.4813       2.374281 0.16726003 14.19515
##                                 pvalue         padj
## ENSG00000108950.12 FAM20A 1.517611e-90 3.273032e-86
## ENSG00000014257.16 ACP3   9.233298e-64 7.170255e-60
## ENSG00000156414.19 TDRD9  9.973926e-64 7.170255e-60
## ENSG00000132170.24 PPARG  1.854888e-55 9.757214e-52
## ENSG00000168615.13 ADAM9  2.421816e-55 9.757214e-52
## ENSG00000161944.16 ASGR2  2.714484e-55 9.757214e-52
## ENSG00000169385.3 RNASE2  1.992547e-53 6.139037e-50
## ENSG00000164125.16 GASK1B 1.028698e-52 2.773242e-49
## ENSG00000183019.7 MCEMP1  2.546033e-52 6.101143e-49
## ENSG00000203710.12 CR1    9.817353e-46 2.117308e-42
mean(abs(dge$stat))
## [1] 2.247041
surgfemale <- dge
dim(subset(surgfemale,padj<0.05))
## [1] 8135   39
# model with clinical and cell covariates
# Monocytes.C NK T.CD8.Memory T.CD4.Naive Neutrophils.LD
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ PG_number + Monocytes.C + NK + T.CD8.Memory + T.CD4.Naive + Neutrophils.LD + timepoint )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables that have mean or
##   standard deviation larger than 5 (an arbitrary threshold to trigger this message).
##   Including numeric variables with large mean can induce collinearity with the intercept.
##   Users should center and scale numeric variables in the design to improve GLM convergence.
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
## 2 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z <- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                              baseMean log2FoldChange     lfcSE      stat
## ENSG00000165092.13 ALDH1A1   556.0900     -2.9820987 0.4109257 -7.257027
## ENSG00000108950.12 FAM20A   1418.5179      2.5446023 0.3561134  7.145483
## ENSG00000152518.8 ZFP36L2  21784.6356     -1.3510264 0.2412505 -5.600098
## ENSG00000161944.16 ASGR2    2906.2035      1.1293842 0.2188673  5.160131
## ENSG00000132170.24 PPARG     123.3816      2.4161730 0.5013513  4.819322
## ENSG00000204642.14 HLA-F   11602.3630     -0.6359361 0.1322543 -4.808434
## ENSG00000135218.19 CD36    10743.9529      1.0554441 0.2204909  4.786793
## ENSG00000156414.19 TDRD9     896.8816      1.5403556 0.3221443  4.781570
## ENSG00000203710.12 CR1     11629.4813      1.5053257 0.3160264  4.763290
## ENSG00000019169.11 MARCO    1204.4460      1.3706841 0.2912783  4.705754
##                                  pvalue         padj
## ENSG00000165092.13 ALDH1A1 3.956894e-13 5.721273e-09
## ENSG00000108950.12 FAM20A  8.967968e-13 6.483393e-09
## ENSG00000152518.8 ZFP36L2  2.142310e-08 1.032522e-04
## ENSG00000161944.16 ASGR2   2.467767e-07 8.920360e-04
## ENSG00000132170.24 PPARG   1.440472e-06 3.059869e-03
## ENSG00000204642.14 HLA-F   1.521174e-06 3.059869e-03
## ENSG00000135218.19 CD36    1.694679e-06 3.059869e-03
## ENSG00000156414.19 TDRD9   1.739316e-06 3.059869e-03
## ENSG00000203710.12 CR1     1.904614e-06 3.059869e-03
## ENSG00000019169.11 MARCO   2.529292e-06 3.657104e-03
mean(abs(dge$stat))
## [1] 0.7913256
surgfemale_adj <- dge

dim(subset(surgfemale_adj,padj<0.05))
## [1] 41 39
(dim(subset(surgfemale,padj<0.05))[1] - dim(subset(surgfemale_adj,padj<0.05))[1]) / dim(subset(surgfemale,padj<0.05))[1]
## [1] 0.99496

In sexD==2 males

38 males with T0 and POD1

ss2 <- merge(sscell,ss,by=0)
rownames(ss2) <- ss2$Row.names

ss2 <- subset(ss2,crp_group==4 & timepoint != "EOS" & sexD == 2 )

mx <- xx[,colnames(xx) %in% rownames(ss2)]
mx <- mx[which(rowMeans(mx)>10),]

table(chr2gene[match(sapply(strsplit(rownames(mx)," "),"[[",1),chr2gene$V2),1])
## 
##  chr1 chr10 chr11 chr12 chr13 chr14 chr15 chr16 chr17 chr18 chr19  chr2 chr20 
##  2146   816  1148  1130   380   814   743  1109  1354   334  1553  1416   548 
## chr21 chr22  chr3  chr4  chr5  chr6  chr7  chr8  chr9  chrM  chrX  chrY 
##   264   606  1150   758   937  1084  1120   730   805    18   647    48
ss2 <- ss2[which(rownames(ss2) %in% colnames(mx)),]
ss2 <- ss2[order(rownames(ss2)),]

ss2$timepoint <- factor(ss2$timepoint,levels=c("T0","POD1"))

#dim(mx)
#mx <- mx[which(! sapply(strsplit(rownames(mx)," "),"[[",1) %in% xyg$V2),]
#dim(mx)

# base model
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ PG_number + timepoint )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
z <- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                                baseMean log2FoldChange      lfcSE     stat
## ENSG00000108950.12 FAM20A    1528.14262       3.829099 0.16185989 23.65687
## ENSG00000132170.24 PPARG      149.75730       3.301257 0.15532787 21.25348
## ENSG00000170439.7 METTL7B     166.27177       4.936676 0.24257968 20.35074
## ENSG00000121316.11 PLBD1    15706.49246       2.007735 0.11104993 18.07957
## ENSG00000163221.9 S100A12   16539.12795       3.113329 0.18300044 17.01268
## ENSG00000174705.13 SH3PXD2B   504.64277       3.214712 0.19136611 16.79875
## ENSG00000137869.15 CYP19A1     81.26793       6.512124 0.39413773 16.52246
## ENSG00000168615.13 ADAM9     1617.51324       1.541855 0.09517653 16.19995
## ENSG00000166033.13 HTRA1      134.28398       2.514197 0.15543931 16.17478
## ENSG00000169385.3 RNASE2     1315.10460       2.148848 0.13303322 16.15272
##                                    pvalue          padj
## ENSG00000108950.12 FAM20A   1.002886e-123 2.172051e-119
## ENSG00000132170.24 PPARG    3.061301e-100  3.315083e-96
## ENSG00000170439.7 METTL7B    4.573255e-92  3.301585e-88
## ENSG00000121316.11 PLBD1     4.616370e-73  2.499533e-69
## ENSG00000163221.9 S100A12    6.613770e-65  2.864821e-61
## ENSG00000174705.13 SH3PXD2B  2.492307e-63  8.996398e-60
## ENSG00000137869.15 CYP19A1   2.528798e-61  7.824100e-58
## ENSG00000168615.13 ADAM9     5.047116e-59  1.366380e-55
## ENSG00000166033.13 HTRA1     7.596758e-59  1.828118e-55
## ENSG00000169385.3 RNASE2     1.086669e-58  2.353508e-55
mean(abs(dge$stat))
## [1] 3.040763
surgmale <- dge
dim(subset(surgmale,padj<0.05))
## [1] 11793    82
# model with clinical and cell covariates
# Monocytes.C NK T.CD8.Memory T.CD4.Naive Neutrophils.LD
dds <- DESeqDataSetFromMatrix(countData = mx , colData = ss2,
  design = ~ PG_number + Monocytes.C + NK + T.CD8.Memory + T.CD4.Naive + Neutrophils.LD + timepoint )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables that have mean or
##   standard deviation larger than 5 (an arbitrary threshold to trigger this message).
##   Including numeric variables with large mean can induce collinearity with the intercept.
##   Users should center and scale numeric variables in the design to improve GLM convergence.
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
z <- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge[order(dge$pvalue),1:6],10)
##                               baseMean log2FoldChange     lfcSE      stat
## ENSG00000108950.12 FAM20A    1528.1426      2.7390970 0.2890367  9.476642
## ENSG00000163221.9 S100A12   16539.1280      1.7317637 0.2119146  8.171988
## ENSG00000132170.24 PPARG      149.7573      2.1957935 0.2737136  8.022231
## ENSG00000137959.17 IFI44L    1295.0650     -2.1478366 0.2917842 -7.361045
## ENSG00000088827.13 SIGLEC1   1468.6407     -2.0825545 0.2913658 -7.147559
## ENSG00000170439.7 METTL7B     166.2718      3.3486625 0.4788782  6.992723
## ENSG00000183019.7 MCEMP1     5938.1573      1.5733238 0.2251231  6.988727
## ENSG00000165092.13 ALDH1A1    518.0640     -2.2354764 0.3218900 -6.944846
## ENSG00000174705.13 SH3PXD2B   504.6428      2.3935512 0.3493225  6.851982
## ENSG00000116574.6 RHOU       1117.3491      0.9279911 0.1416458  6.551490
##                                   pvalue         padj
## ENSG00000108950.12 FAM20A   2.625986e-21 5.246195e-17
## ENSG00000163221.9 S100A12   3.033483e-16 3.030146e-12
## ENSG00000132170.24 PPARG    1.038414e-15 6.915143e-12
## ENSG00000137959.17 IFI44L   1.824764e-13 9.113785e-10
## ENSG00000088827.13 SIGLEC1  8.833456e-13 3.529496e-09
## ENSG00000170439.7 METTL7B   2.696019e-12 7.916782e-09
## ENSG00000183019.7 MCEMP1    2.773925e-12 7.916782e-09
## ENSG00000165092.13 ALDH1A1  3.788738e-12 9.461427e-09
## ENSG00000174705.13 SH3PXD2B 7.283397e-12 1.616752e-08
## ENSG00000116574.6 RHOU      5.696589e-11 1.138065e-07
mean(abs(dge$stat))
## [1] 0.9878333
surgmale_adj <- dge

dim(subset(surgmale_adj,padj<0.05))
## [1] 487  82
table(chr2gene[match(sapply(strsplit(rownames(surgmale_adj)," "),"[[",1),chr2gene$V2),1])
## 
##  chr1 chr10 chr11 chr12 chr13 chr14 chr15 chr16 chr17 chr18 chr19  chr2 chr20 
##  2146   816  1148  1130   380   814   743  1109  1354   334  1553  1416   548 
## chr21 chr22  chr3  chr4  chr5  chr6  chr7  chr8  chr9  chrM  chrX  chrY 
##   264   606  1150   758   937  1084  1120   730   805    18   647    48
(dim(subset(surgmale,padj<0.05))[1] - dim(subset(surgmale_adj,padj<0.05))[1]) / dim(subset(surgmale,padj<0.05))[1]
## [1] 0.9587043

Compare male and female

surgmale_up <- rownames(subset(surgmale,padj<0.05 & log2FoldChange >0))
surgmale_dn <- rownames(subset(surgmale,padj<0.05 & log2FoldChange <0))

surgfemale_up <- rownames(subset(surgfemale,padj<0.05 & log2FoldChange >0))
surgfemale_dn <- rownames(subset(surgfemale,padj<0.05 & log2FoldChange <0))

v1 <- list("male_up"=surgmale_up, "male_dn"=surgmale_dn,
  "female_up"=surgfemale_up,"female_dn"=surgfemale_dn)

plot(euler(v1),quantities = TRUE)

common=3541+3402

uniq=1700+472+684+3114

common/(common+uniq) #54% common
## [1] 0.5376752

Session information

For reproducibility

save.image("qc.Rds")

sessionInfo()
## R version 4.5.3 (2026-03-11)
## Platform: x86_64-pc-linux-gnu
## Running under: Ubuntu 22.04.5 LTS
## 
## Matrix products: default
## BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0 
## LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0  LAPACK version 3.10.0
## 
## locale:
## [1] C
## 
## time zone: Australia/Melbourne
## tzcode source: system (glibc)
## 
## attached base packages:
## [1] stats4    stats     graphics  grDevices utils     datasets  methods  
## [8] base     
## 
## other attached packages:
##  [1] beeswarm_0.4.0              eulerr_7.0.4               
##  [3] MASS_7.3-65                 mitch_1.21.3               
##  [5] DESeq2_1.50.2               SummarizedExperiment_1.40.0
##  [7] Biobase_2.70.0              MatrixGenerics_1.22.0      
##  [9] matrixStats_1.5.0           GenomicRanges_1.62.1       
## [11] Seqinfo_1.0.0               IRanges_2.44.0             
## [13] S4Vectors_0.48.0            BiocGenerics_0.56.0        
## [15] generics_0.1.4              dplyr_1.2.0                
## [17] WGCNA_1.73                  fastcluster_1.3.0          
## [19] dynamicTreeCut_1.63-1       reshape2_1.4.5             
## [21] gplots_3.2.0               
## 
## loaded via a namespace (and not attached):
##   [1] RColorBrewer_1.1-3    rstudioapi_0.17.1     jsonlite_2.0.0       
##   [4] magrittr_2.0.4        farver_2.1.2          rmarkdown_2.30       
##   [7] vctrs_0.7.1           memoise_2.0.1.9000    base64enc_0.1-6      
##  [10] htmltools_0.5.9       S4Arrays_1.10.1       SparseArray_1.10.8   
##  [13] Formula_1.2-5         sass_0.4.10           KernSmooth_2.23-26   
##  [16] bslib_0.10.0          htmlwidgets_1.6.4     plyr_1.8.9           
##  [19] echarts4r_0.4.6       impute_1.83.0         cachem_1.1.0         
##  [22] mime_0.13             lifecycle_1.0.5       iterators_1.0.14     
##  [25] pkgconfig_2.0.3       Matrix_1.7-4          R6_2.6.1             
##  [28] fastmap_1.2.0         shiny_1.13.0          digest_0.6.39        
##  [31] colorspace_2.1-2      GGally_2.4.0          AnnotationDbi_1.71.0 
##  [34] textshaping_1.0.4     Hmisc_5.2-4           RSQLite_2.4.4        
##  [37] polyclip_1.10-7       httr_1.4.7            abind_1.4-8          
##  [40] compiler_4.5.3        bit64_4.6.0-1         doParallel_1.0.17    
##  [43] htmlTable_2.4.3       S7_0.2.1              backports_1.5.0      
##  [46] BiocParallel_1.44.0   DBI_1.2.3             ggstats_0.11.0       
##  [49] DelayedArray_0.36.0   gtools_3.9.5          caTools_1.18.3       
##  [52] tools_4.5.3           foreign_0.8-91        otel_0.2.0           
##  [55] httpuv_1.6.16         nnet_7.3-20           glue_1.8.0           
##  [58] promises_1.5.0        polylabelr_0.3.0      grid_4.5.3           
##  [61] checkmate_2.3.3       cluster_2.1.8.2       gtable_0.3.6         
##  [64] preprocessCore_1.71.0 tidyr_1.3.2           data.table_1.18.2.1  
##  [67] xml2_1.5.0            XVector_0.50.0        foreach_1.5.2        
##  [70] pillar_1.11.1         stringr_1.6.0         later_1.4.8          
##  [73] splines_4.5.3         lattice_0.22-7        survival_3.8-6       
##  [76] bit_4.6.0             tidyselect_1.2.1      GO.db_3.21.0         
##  [79] locfit_1.5-9.12       Biostrings_2.77.1     knitr_1.51           
##  [82] gridExtra_2.3         svglite_2.2.2         xfun_0.56            
##  [85] stringi_1.8.7         UCSC.utils_1.5.0      statnet.common_4.12.0
##  [88] yaml_2.3.12           kableExtra_1.4.0      evaluate_1.0.5       
##  [91] codetools_0.2-20      tibble_3.3.1          cli_3.6.5            
##  [94] rpart_4.1.24          xtable_1.8-4          systemfonts_1.3.1    
##  [97] jquerylib_0.1.4       network_1.19.0        dichromat_2.0-0.1    
## [100] Rcpp_1.1.1            GenomeInfoDb_1.45.4   coda_0.19-4.1        
## [103] png_0.1-8             parallel_4.5.3        ggplot2_4.0.2        
## [106] blob_1.2.4            bitops_1.0-9          viridisLite_0.4.3    
## [109] scales_1.4.0          purrr_1.2.1           crayon_1.5.3         
## [112] rlang_1.1.7           KEGGREST_1.49.0