Source: https://github.com/markziemann/shoulder-instability-osteroarthritis

Introduction

Compare “tear edge” (AD-CAB 3001-AD-CAB 3026) to the “tendon body” (AD-CAB 3001-AD-CAB 3026) in patients who heal as compared to those that don’t heal. In the sample sheet this is defines in the ‘Tendon integrity 2 years post.op’ column, designated ‘torn’ or ‘intact’, so that we are comparing like tissue.

General steps are to load the sample sheet and profiling data, select the needed samples/groups, and then run MDS, DE and pathway analysis.

suppressPackageStartupMessages({
    library("R.utils")
    library("zoo")
    library("tidyverse")
    library("reshape2")
    library("DESeq2")
    library("gplots")
    library("fgsea")
    library("MASS")
    library("mitch")
    library("eulerr")
    library("limma")
    library("topconfects")
    library("kableExtra")
})

Import count data and sample sheet

Patients AD-CAB 3001-AD-CAB 3026.

They have both “tear” (tear edge) and “tendon” (tendon body) samples from intact and torn tissue.

x <- readRDS("counts.rds")

ss <- read.table("samplesheets/pheno_data.tsv",header=TRUE)

ss <- ss[grep("AD-CAB_3",ss$Participant_ID),]

ss <- ss[which(ss$Tendon_integrity_2_years_post.op != "NA"),]
ss <- ss[ss$Tissue != "capsule",]

head(ss,3)
##    Participant_ID Case Redcap_ID Tissue                        fastq pvt.pub
## 93    AD-CAB_3001   RC        53 tendon 1-2_S67_L001_R1_001.fastq.gz    <NA>
## 94    AD-CAB_3002   RC        54 tendon 2-2_S68_L001_R1_001.fastq.gz    <NA>
## 95    AD-CAB_3003   RC        55 tendon 3-2_S69_L001_R1_001.fastq.gz    <NA>
##    Age Sex Primary_OA Cuff_Arthropathy Prosthesis Affected_Side Height_cm
## 93  67   M       <NA>             <NA>       <NA>          Left     177.8
## 94  58   M       <NA>             <NA>       <NA>         Right     179.0
## 95  56   M       <NA>             <NA>       <NA>          Left     179.0
##    Weight_kg   BMI ASA      Smoking Diabetes Hypercholesterolaemia Hypertension
## 93       120 37.90   2  Ever_smoker       No                   Yes          Yes
## 94        79 25.00   1 Never_smoker       No                    No           No
## 95        85 26.52   1 Never_smoker       No                   Yes         <NA>
##    Thyroid CRP Creat eGFR Urea Fast_Glucose hba1c Metabolic_Syndrome
## 93      No 2.9    83   84  7.0          5.2   5.6                Yes
## 94      No 0.7    70   90  6.9          5.4   5.3                 No
## 95      No 2.9    72   90  4.3          5.2   5.4                 No
##    Tendon_integrity_2_years_post.op ASES_2_years_post.op_Pain
## 93                             Torn                        NA
## 94                             Torn                        NA
## 95                           Intact                        50
##    ASES_2_years_post.op_ADL ASES_2_years_post.op_Total Oxford_Baseline
## 93                       NA                         NA              25
## 94                       NA                         NA              33
## 95                       50                        100              38
##    Oxford_3_month Oxford_12_month Oxford_24_month QuickDASH_ QuickDASH_3_month
## 93             41              46              NA       38.6              13.6
## 94             NA              48              NA       29.5                NA
## 95             38              44              48       29.5              27.3
##    QuickDASH_12_month QuickDASH_24_month EQ.5D.3L_Baseline EQ.5D.3L_3_month
## 93               13.6                 NA             11222            11123
## 94                0.0                 NA             11111               NA
## 95                9.1                  0             11221            11121
##    EQ.5D.3L_12_month EQ.5D.3L_24_month EQVAS_Baseline EQVAS_3_month
## 93             21222                NA             90            50
## 94             11111                NA             90            NA
## 95             11111             22222             80            70
##    EQVAS_12_month EQVAS_24_month
## 93             60             NA
## 94             90             NA
## 95             80             60
table(ss$Tissue)
## 
##   tear tendon 
##     21     21
table(ss$Tendon_integrity_2_years_post.op)
## 
## Intact   Torn 
##     28     14
table(paste(ss$Tissue ,ss$Tendon_integrity_2_years_post.op))
## 
##   tear Intact     tear Torn tendon Intact   tendon Torn 
##            14             7            14             7
paste(ss$Participant_ID,ss$Tissue ,ss$Tendon_integrity_2_years_post.op)
##  [1] "AD-CAB_3001 tendon Torn"   "AD-CAB_3002 tendon Torn"  
##  [3] "AD-CAB_3003 tendon Intact" "AD-CAB_3004 tendon Intact"
##  [5] "AD-CAB_3005 tendon Torn"   "AD-CAB_3006 tendon Torn"  
##  [7] "AD-CAB_3007 tendon Intact" "AD-CAB_3008 tendon Intact"
##  [9] "AD-CAB_3009 tendon Intact" "AD-CAB_3010 tendon Intact"
## [11] "AD-CAB_3011 tendon Intact" "AD-CAB_3014 tendon Intact"
## [13] "AD-CAB_3015 tendon Intact" "AD-CAB_3016 tendon Torn"  
## [15] "AD-CAB_3017 tendon Torn"   "AD-CAB_3018 tendon Intact"
## [17] "AD-CAB_3019 tendon Intact" "AD-CAB_3020 tendon Intact"
## [19] "AD-CAB_3021 tendon Torn"   "AD-CAB_3023 tendon Intact"
## [21] "AD-CAB_3025 tendon Intact" "AD-CAB_3001 tear Torn"    
## [23] "AD-CAB_3002 tear Torn"     "AD-CAB_3003 tear Intact"  
## [25] "AD-CAB_3004 tear Intact"   "AD-CAB_3005 tear Torn"    
## [27] "AD-CAB_3006 tear Torn"     "AD-CAB_3007 tear Intact"  
## [29] "AD-CAB_3008 tear Intact"   "AD-CAB_3009 tear Intact"  
## [31] "AD-CAB_3010 tear Intact"   "AD-CAB_3011 tear Intact"  
## [33] "AD-CAB_3014 tear Intact"   "AD-CAB_3015 tear Intact"  
## [35] "AD-CAB_3016 tear Torn"     "AD-CAB_3017 tear Torn"    
## [37] "AD-CAB_3018 tear Intact"   "AD-CAB_3019 tear Intact"  
## [39] "AD-CAB_3020 tear Intact"   "AD-CAB_3021 tear Torn"    
## [41] "AD-CAB_3023 tear Intact"   "AD-CAB_3025 tear Intact"
sapply(strsplit(gsub("-",".",gsub("_L001","|",gsub("_R1","|",ss$fastq))),"\\|"),"[[",1) %in% colnames(x)
##  [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
ss$data <- sapply(strsplit(gsub("-",".",gsub("_L001","|",gsub("_R1","|",ss$fastq))),"\\|"),"[[",1)

rownames(ss)<-ss$data

Now subset the data for the different comparisons.

Tendon v tear (intact) versus Tendon v tear (torn).

Comparisons:

  1. Tendon v tear (intact): DE1.

  2. Tendon v tear (torn): DE2.

Then run a mitch analysis to see the differences.

The other approach is to find the direct differences between intact and torn samples.

  1. tendon (intact) vs tendon (torn).

  2. tear (intact) vs tear (torn).

#de1
ss1 <- ss[ss$Tendon_integrity_2_years_post.op=="Intact",]
x1 <- x[,which(colnames(x) %in% ss1$data)]
ss1 %>% kbl(caption = "Intact tendon group") %>% kable_paper("hover", full_width = F)
Intact tendon group
Participant_ID Case Redcap_ID Tissue fastq pvt.pub Age Sex Primary_OA Cuff_Arthropathy Prosthesis Affected_Side Height_cm Weight_kg BMI ASA Smoking Diabetes Hypercholesterolaemia Hypertension Thyroid CRP Creat eGFR Urea Fast_Glucose hba1c Metabolic_Syndrome Tendon_integrity_2_years_post.op ASES_2_years_post.op_Pain ASES_2_years_post.op_ADL ASES_2_years_post.op_Total Oxford_Baseline Oxford_3_month Oxford_12_month Oxford_24_month QuickDASH_ QuickDASH_3_month QuickDASH_12_month QuickDASH_24_month EQ.5D.3L_Baseline EQ.5D.3L_3_month EQ.5D.3L_12_month EQ.5D.3L_24_month EQVAS_Baseline EQVAS_3_month EQVAS_12_month EQVAS_24_month data
3.2_S69 AD-CAB_3003 RC 55 tendon 3-2_S69_L001_R1_001.fastq.gz NA 56 M NA NA NA Left 179.00 85 26.52 1 Never_smoker No Yes NA No 2.9 72 90 4.3 5.2 5.4 No Intact 50 50 100 38 38 44 48 29.5 27.3 9.1 0.0 11221 11121 11111 22222 80 70 80 60 3.2_S69
4.2_S70 AD-CAB_3004 RC 56 tendon 4-2_S70_L001_R1_001.fastq.gz NA 68 M NA NA NA Right 185.00 95 28.00 2 Ever_smoker No Yes Yes No 3.6 91 74 7.8 6.7 5.7 No Intact 45 50 95 24 41 46 48 NA 18.2 13.6 0.0 11232 11121 11121 11111 NA 80 60 52 4.2_S70
7.2_S73 AD-CAB_3007 RC 59 tendon 7-2_S73_L001_R1_001.fastq.gz NA 63 F NA NA NA Right 163.00 57 21.50 1 Ever_smoker No No No No 2.9 53 90 29.0 NA 5.3 No Intact 50 50 100 37 38 46 48 36.4 18.2 11.4 2.3 11122 11111 11111 11111 93 97 100 100 7.2_S73
8.2_S74 AD-CAB_3008 RC 60 tendon 8-2_S74_L001_R1_001.fastq.gz NA 70 M NA NA NA Left 167.00 71 25.50 2 Never_smoker No Yes Yes No 2.9 87 77 7.3 5.5 5.4 No Intact NA NA NA 24 25 47 NA 54.5 54.5 11.4 NA 22221 22221 11111 NA 90 90 92 NA 8.2_S74
9.2_S75 AD-CAB_3009 RC 61 tendon 9-2_S75_L001_R1_001.fastq.gz NA 68 M NA NA NA Right 182.00 83 25.10 2 Ever_smoker No No No No 2.9 79 88 7.5 5.8 5.8 No Intact 50 50 100 35 41 43 46 52.3 11.4 4.5 2.3 11211 11121 11111 11111 85 96 90 90 9.2_S75
10.2_S76 AD-CAB_3010 RC 62 tendon 10-2_S76_L001_R1_001.fastq.gz NA 58 M NA NA NA Left 179.00 98 30.00 2 Never_smoker No No No Yes 2.9 82 90 5.6 4.9 5.1 No Intact 45 17 62 21 45 43 44 45.5 4.5 11.4 20.5 11221 11111 11121 11221 70 70 75 85 10.2_S76
11.2_S77 AD-CAB_3011 RC 63 tendon 11-2_S77_L001_R1_001.fastq.gz NA 50 M NA NA NA Right 180.00 82 25.00 1 Never_smoker No Yes No No 2.9 99 76 6.7 5.7 6.0 No Intact 35 18 53 18 38 44 46 61.4 31.8 6.8 20.5 11221 11222 11111 11121 75 83 75 78 11.2_S77
14.2_S80 AD-CAB_3014 RC 66 tendon 14-2_S80_L001_R1_001.fastq.gz NA 70 M NA NA NA Left 1.77 100 32.00 3 Ever_smoker No Yes Yes No 2.9 86 79 7.1 6.3 5.8 Yes Intact 50 45 95 27 43 47 47 50.0 9.1 6.8 9.1 12221 11111 11111 11111 90 90 88 85 14.2_S80
15.2_S81 AD-CAB_3015 RC 69 tendon 15-2_S81_L001_R1_001.fastq.gz NA 66 M NA NA NA Left 175.00 95 31.00 3 Never_smoker No Yes Yes No 2.9 53 90 4.1 5.5 5.2 Yes Intact 50 47 97 25 NA NA 48 40.9 NA NA 13.6 11121 NA NA 11121 78 NA NA 93 15.2_S81
18.2_S84 AD-CAB_3018 RC 72 tendon 18-2_S84_L001_R1_001.fastq.gz NA 72 M NA NA NA Right 170.00 85 29.00 2 Ever_smoker No Yes Yes No 3.2 82 82 6.4 5.5 5.5 No Intact 50 50 100 36 37 48 48 31.8 13.6 9.1 0.0 11122 11112 11111 11111 90 82 92 90 18.2_S84
19.2_S85 AD-CAB_3019 RC 73 tendon 19-2_S85_L001_R1_001.fastq.gz NA 45 F NA NA NA Right 163.00 98 36.90 2 Never_smoker No Yes Yes No 4.3 70 57 4.6 4.7 5.7 Yes Intact 50 35 85 32 28 45 47 36.4 38.6 18.2 13.6 11221 11221 11121 11121 50 58 45 34 19.2_S85
20.2_S86 AD-CAB_3020 RC 67 tendon 20-2_S86_L001_R1_001.fastq.gz NA 61 M NA NA NA Right 180.00 92 29.00 1 Ever_smoker No No No No 2.9 78 57 3.9 5.5 5.6 No Intact 50 40 90 30 34 36 44 50.0 34.1 31.8 0.0 12321 12321 12211 12211 77 40 70 70 20.2_S86
23.2_S89 AD-CAB_3023 RC 75 tendon 23-2_S89_L001_R1_001.fastq.gz NA 58 M NA NA NA Right 179.00 81 25.00 2 Ever_smoker No Yes No No 2.9 75 57 5.7 5.4 5.7 No Intact 50 40 90 42 43 48 48 15.9 15.9 0.0 2.3 11211 11121 11111 11111 85 85 90 85 23.2_S89
25.2_S91 AD-CAB_3025 RC 77 tendon 25-2_S91_L001_R1_001.fastq.gz NA 62 F NA NA NA Left 157.00 95 38.50 2 Never_smoker No Yes Yes No 12.0 72 57 6.6 6.2 5.7 Yes Intact 45 43 88 26 36 38 41 59.1 29.5 31.8 18.2 12231 11221 11221 11121 82 80 60 80 25.2_S91
3.3_S95 AD-CAB_3003 RC 55 tear 3-3_S95_L001_R1_001.fastq.gz NA 56 M NA NA NA Left 179.00 85 26.52 1 Never_smoker No Yes NA No 2.9 72 90 4.3 5.2 5.4 No Intact 50 50 100 38 38 44 48 29.5 27.3 9.1 0.0 11221 11121 11111 22222 80 70 80 60 3.3_S95
4.3_S96 AD-CAB_3004 RC 56 tear 4-3_S96_L001_R1_001.fastq.gz NA 68 M NA NA NA Right 185.00 95 28.00 2 Ever_smoker No Yes Yes No 3.6 91 74 7.8 6.7 5.7 No Intact 45 50 95 24 41 46 48 NA 18.2 13.6 0.0 11232 11121 11121 11111 NA 80 60 52 4.3_S96
7.3_S99 AD-CAB_3007 RC 59 tear 7-3_S99_L001_R1_001.fastq.gz NA 63 F NA NA NA Right 163.00 57 21.50 1 Ever_smoker No No No No 2.9 53 90 29.0 NA 5.3 No Intact 50 50 100 37 38 46 48 36.4 18.2 11.4 2.3 11122 11111 11111 11111 93 97 100 100 7.3_S99
8.3_S100 AD-CAB_3008 RC 60 tear 8-3_S100_L001_R1_001.fastq.gz NA 70 M NA NA NA Left 167.00 71 25.50 2 Never_smoker No Yes Yes No 2.9 87 77 7.3 5.5 5.4 No Intact NA NA NA 24 25 47 NA 54.5 54.5 11.4 NA 22221 22221 11111 NA 90 90 92 NA 8.3_S100
9.3_S101 AD-CAB_3009 RC 61 tear 9-3_S101_L001_R1_001.fastq.gz NA 68 M NA NA NA Right 182.00 83 25.10 2 Ever_smoker No No No No 2.9 79 88 7.5 5.8 5.8 No Intact 50 50 100 35 41 43 46 52.3 11.4 4.5 2.3 11211 11121 11111 11111 85 96 90 90 9.3_S101
10.3_S102 AD-CAB_3010 RC 62 tear 10-3_S102_L001_R1_001.fastq.gz NA 58 M NA NA NA Left 179.00 98 30.00 2 Never_smoker No No No Yes 2.9 82 90 5.6 4.9 5.1 No Intact 45 17 62 21 45 43 44 45.5 4.5 11.4 20.5 11221 11111 11121 11221 70 70 75 85 10.3_S102
11.3_S103 AD-CAB_3011 RC 63 tear 11-3_S103_L001_R1_001.fastq.gz NA 50 M NA NA NA Right 180.00 82 25.00 1 Never_smoker No Yes No No 2.9 99 76 6.7 5.7 6.0 No Intact 35 18 53 18 38 44 46 61.4 31.8 6.8 20.5 11221 11222 11111 11121 75 83 75 78 11.3_S103
14.3_S106 AD-CAB_3014 RC 66 tear 14-3_S106_L001_R1_001.fastq.gz NA 70 M NA NA NA Left 1.77 100 32.00 3 Ever_smoker No Yes Yes No 2.9 86 79 7.1 6.3 5.8 Yes Intact 50 45 95 27 43 47 47 50.0 9.1 6.8 9.1 12221 11111 11111 11111 90 90 88 85 14.3_S106
15.3_S107 AD-CAB_3015 RC 69 tear 15-3_S107_L001_R1_001.fastq.gz NA 66 M NA NA NA Left 175.00 95 31.00 3 Never_smoker No Yes Yes No 2.9 53 90 4.1 5.5 5.2 Yes Intact 50 47 97 25 NA NA 48 40.9 NA NA 13.6 11121 NA NA 11121 78 NA NA 93 15.3_S107
18.3_S110 AD-CAB_3018 RC 72 tear 18-3_S110_L001_R1_001.fastq.gz NA 72 M NA NA NA Right 170.00 85 29.00 2 Ever_smoker No Yes Yes No 3.2 82 82 6.4 5.5 5.5 No Intact 50 50 100 36 37 48 48 31.8 13.6 9.1 0.0 11122 11112 11111 11111 90 82 92 90 18.3_S110
19.3_S111 AD-CAB_3019 RC 73 tear 19-3_S111_L001_R1_001.fastq.gz NA 45 F NA NA NA Right 163.00 98 36.90 2 Never_smoker No Yes Yes No 4.3 70 57 4.6 4.7 5.7 Yes Intact 50 35 85 32 28 45 47 36.4 38.6 18.2 13.6 11221 11221 11121 11121 50 58 45 34 19.3_S111
20.3_S112 AD-CAB_3020 RC 67 tear 20-3_S112_L001_R1_001.fastq.gz NA 61 M NA NA NA Right 180.00 92 29.00 1 Ever_smoker No No No No 2.9 78 57 3.9 5.5 5.6 No Intact 50 40 90 30 34 36 44 50.0 34.1 31.8 0.0 12321 12321 12211 12211 77 40 70 70 20.3_S112
23.3_S115 AD-CAB_3023 RC 75 tear 23-3_S115_L001_R1_001.fastq.gz NA 58 M NA NA NA Right 179.00 81 25.00 2 Ever_smoker No Yes No No 2.9 75 57 5.7 5.4 5.7 No Intact 50 40 90 42 43 48 48 15.9 15.9 0.0 2.3 11211 11121 11111 11111 85 85 90 85 23.3_S115
25.3_S117 AD-CAB_3025 RC 77 tear 25-3_S117_L001_R1_001.fastq.gz NA 62 F NA NA NA Left 157.00 95 38.50 2 Never_smoker No Yes Yes No 12.0 72 57 6.6 6.2 5.7 Yes Intact 45 43 88 26 36 38 41 59.1 29.5 31.8 18.2 12231 11221 11221 11121 82 80 60 80 25.3_S117
#de2
ss2 <- ss[ss$Tendon_integrity_2_years_post.op=="Torn",]
x2 <- x[,which(colnames(x) %in% ss2$data)]
ss2 %>% kbl(caption = "Torn tendon group") %>% kable_paper("hover", full_width = F)
Torn tendon group
Participant_ID Case Redcap_ID Tissue fastq pvt.pub Age Sex Primary_OA Cuff_Arthropathy Prosthesis Affected_Side Height_cm Weight_kg BMI ASA Smoking Diabetes Hypercholesterolaemia Hypertension Thyroid CRP Creat eGFR Urea Fast_Glucose hba1c Metabolic_Syndrome Tendon_integrity_2_years_post.op ASES_2_years_post.op_Pain ASES_2_years_post.op_ADL ASES_2_years_post.op_Total Oxford_Baseline Oxford_3_month Oxford_12_month Oxford_24_month QuickDASH_ QuickDASH_3_month QuickDASH_12_month QuickDASH_24_month EQ.5D.3L_Baseline EQ.5D.3L_3_month EQ.5D.3L_12_month EQ.5D.3L_24_month EQVAS_Baseline EQVAS_3_month EQVAS_12_month EQVAS_24_month data
1.2_S67 AD-CAB_3001 RC 53 tendon 1-2_S67_L001_R1_001.fastq.gz NA 67 M NA NA NA Left 177.8 120 37.9 2 Ever_smoker No Yes Yes No 2.9 83 84 7.0 5.2 5.6 Yes Torn NA NA NA 25 41 46 NA 38.6 13.6 13.6 NA 11222 11123 21222 NA 90 50 60 NA 1.2_S67
2.2_S68 AD-CAB_3002 RC 54 tendon 2-2_S68_L001_R1_001.fastq.gz NA 58 M NA NA NA Right 179.0 79 25.0 1 Never_smoker No No No No 0.7 70 90 6.9 5.4 5.3 No Torn NA NA NA 33 NA 48 NA 29.5 NA 0.0 NA 11111 NA 11111 NA 90 NA 90 NA 2.2_S68
5.2_S71 AD-CAB_3005 RC 57 tendon 5-2_S71_L001_R1_001.fastq.gz NA 59 F NA NA NA Right NA NA NA 1 Never_smoker No No No No 3.8 51 90 6.2 NA 5.2 NA Torn 50 50 100 38 45 NA 48 25.0 4.5 NA 0.0 11121 11111 NA 11111 92 94 95 NA 5.2_S71
6.2_S72 AD-CAB_3006 RC 58 tendon 6-2_S72_L001_R1_001.fastq.gz NA 65 M NA NA NA Left 172.0 78 26.0 1 Never_smoker No No No No 2.9 77 90 5.6 4.8 5.4 No Torn NA NA NA 35 31 37 NA 34.1 36.4 27.3 NA 12221 11221 11111 NA 82 40 80 NA 6.2_S72
16.2_S82 AD-CAB_3016 RC 71 tendon 16-2_S82_L001_R1_001.fastq.gz NA 68 M NA NA NA Left 180.0 88 27.0 1 Ever_smoker Yes No Yes No 2.9 73 90 4.7 7.3 8.3 No Torn 40 42 82 24 27 45 43 43.2 38.6 6.8 11.4 11122 11222 11112 11121 70 60 50 80 16.2_S82
17.2_S83 AD-CAB_3017 RC 70 tendon 17-2_S83_L001_R1_001.fastq.gz NA 60 M NA NA NA Left 166.0 80 29.0 2 Ever_smoker No No No No 2.9 119 57 7.2 NA 5.7 No Torn NA NA NA 13 40 NA NA 93.2 38.6 NA NA 12221 21211 NA NA 70 60 NA NA 17.2_S83
21.2_S87 AD-CAB_3021 RC 68 tendon 21-2_S87_L001_R1_001.fastq.gz NA 46 M NA NA NA Right 180.0 88 27.2 2 Never_smoker No Yes No No 2.9 77 57 5.9 5.9 5.3 No Torn NA NA NA 29 44 43 NA 45.5 20.5 11.4 NA NA 11111 11121 NA NA 80 65 NA 21.2_S87
1.3_S93 AD-CAB_3001 RC 53 tear 1-3_S93_L001_R1_001.fastq.gz NA 67 M NA NA NA Left 177.8 120 37.9 2 Ever_smoker No Yes Yes No 2.9 83 84 7.0 5.2 5.6 Yes Torn NA NA NA 25 41 46 NA 38.6 13.6 13.6 NA 11222 11123 21222 NA 90 50 60 NA 1.3_S93
2.3_S94 AD-CAB_3002 RC 54 tear 2-3_S94_L001_R1_001.fastq.gz NA 58 M NA NA NA Right 179.0 79 25.0 1 Never_smoker No No No No 0.7 70 90 6.9 5.4 5.3 No Torn NA NA NA 33 NA 48 NA 29.5 NA 0.0 NA 11111 NA 11111 NA 90 NA 90 NA 2.3_S94
5.3_S97 AD-CAB_3005 RC 57 tear 5-3_S97_L001_R1_001.fastq.gz NA 59 F NA NA NA Right NA NA NA 1 Never_smoker No No No No 3.8 51 90 6.2 NA 5.2 NA Torn 50 50 100 38 45 NA 48 25.0 4.5 NA 0.0 11121 11111 NA 11111 92 94 95 NA 5.3_S97
6.3_S98 AD-CAB_3006 RC 58 tear 6-3_S98_L001_R1_001.fastq.gz NA 65 M NA NA NA Left 172.0 78 26.0 1 Never_smoker No No No No 2.9 77 90 5.6 4.8 5.4 No Torn NA NA NA 35 31 37 NA 34.1 36.4 27.3 NA 12221 11221 11111 NA 82 40 80 NA 6.3_S98
16.3_S108 AD-CAB_3016 RC 71 tear 16-3_S108_L001_R1_001.fastq.gz NA 68 M NA NA NA Left 180.0 88 27.0 1 Ever_smoker Yes No Yes No 2.9 73 90 4.7 7.3 8.3 No Torn 40 42 82 24 27 45 43 43.2 38.6 6.8 11.4 11122 11222 11112 11121 70 60 50 80 16.3_S108
17.3_S109 AD-CAB_3017 RC 70 tear 17-3_S109_L001_R1_001.fastq.gz NA 60 M NA NA NA Left 166.0 80 29.0 2 Ever_smoker No No No No 2.9 119 57 7.2 NA 5.7 No Torn NA NA NA 13 40 NA NA 93.2 38.6 NA NA 12221 21211 NA NA 70 60 NA NA 17.3_S109
21.3_S113 AD-CAB_3021 RC 68 tear 21-3_S113_L001_R1_001.fastq.gz NA 46 M NA NA NA Right 180.0 88 27.2 2 Never_smoker No Yes No No 2.9 77 57 5.9 5.9 5.3 No Torn NA NA NA 29 44 43 NA 45.5 20.5 11.4 NA NA 11111 11121 NA NA 80 65 NA 21.3_S113
#de3
ss3 <- ss[ss$Tissue=="tendon",]
x3 <- x[,which(colnames(x) %in% ss3$data)]
ss3 %>% kbl(caption = "Tendon body samples") %>% kable_paper("hover", full_width = F)
Tendon body samples
Participant_ID Case Redcap_ID Tissue fastq pvt.pub Age Sex Primary_OA Cuff_Arthropathy Prosthesis Affected_Side Height_cm Weight_kg BMI ASA Smoking Diabetes Hypercholesterolaemia Hypertension Thyroid CRP Creat eGFR Urea Fast_Glucose hba1c Metabolic_Syndrome Tendon_integrity_2_years_post.op ASES_2_years_post.op_Pain ASES_2_years_post.op_ADL ASES_2_years_post.op_Total Oxford_Baseline Oxford_3_month Oxford_12_month Oxford_24_month QuickDASH_ QuickDASH_3_month QuickDASH_12_month QuickDASH_24_month EQ.5D.3L_Baseline EQ.5D.3L_3_month EQ.5D.3L_12_month EQ.5D.3L_24_month EQVAS_Baseline EQVAS_3_month EQVAS_12_month EQVAS_24_month data
1.2_S67 AD-CAB_3001 RC 53 tendon 1-2_S67_L001_R1_001.fastq.gz NA 67 M NA NA NA Left 177.80 120 37.90 2 Ever_smoker No Yes Yes No 2.9 83 84 7.0 5.2 5.6 Yes Torn NA NA NA 25 41 46 NA 38.6 13.6 13.6 NA 11222 11123 21222 NA 90 50 60 NA 1.2_S67
2.2_S68 AD-CAB_3002 RC 54 tendon 2-2_S68_L001_R1_001.fastq.gz NA 58 M NA NA NA Right 179.00 79 25.00 1 Never_smoker No No No No 0.7 70 90 6.9 5.4 5.3 No Torn NA NA NA 33 NA 48 NA 29.5 NA 0.0 NA 11111 NA 11111 NA 90 NA 90 NA 2.2_S68
3.2_S69 AD-CAB_3003 RC 55 tendon 3-2_S69_L001_R1_001.fastq.gz NA 56 M NA NA NA Left 179.00 85 26.52 1 Never_smoker No Yes NA No 2.9 72 90 4.3 5.2 5.4 No Intact 50 50 100 38 38 44 48 29.5 27.3 9.1 0.0 11221 11121 11111 22222 80 70 80 60 3.2_S69
4.2_S70 AD-CAB_3004 RC 56 tendon 4-2_S70_L001_R1_001.fastq.gz NA 68 M NA NA NA Right 185.00 95 28.00 2 Ever_smoker No Yes Yes No 3.6 91 74 7.8 6.7 5.7 No Intact 45 50 95 24 41 46 48 NA 18.2 13.6 0.0 11232 11121 11121 11111 NA 80 60 52 4.2_S70
5.2_S71 AD-CAB_3005 RC 57 tendon 5-2_S71_L001_R1_001.fastq.gz NA 59 F NA NA NA Right NA NA NA 1 Never_smoker No No No No 3.8 51 90 6.2 NA 5.2 NA Torn 50 50 100 38 45 NA 48 25.0 4.5 NA 0.0 11121 11111 NA 11111 92 94 95 NA 5.2_S71
6.2_S72 AD-CAB_3006 RC 58 tendon 6-2_S72_L001_R1_001.fastq.gz NA 65 M NA NA NA Left 172.00 78 26.00 1 Never_smoker No No No No 2.9 77 90 5.6 4.8 5.4 No Torn NA NA NA 35 31 37 NA 34.1 36.4 27.3 NA 12221 11221 11111 NA 82 40 80 NA 6.2_S72
7.2_S73 AD-CAB_3007 RC 59 tendon 7-2_S73_L001_R1_001.fastq.gz NA 63 F NA NA NA Right 163.00 57 21.50 1 Ever_smoker No No No No 2.9 53 90 29.0 NA 5.3 No Intact 50 50 100 37 38 46 48 36.4 18.2 11.4 2.3 11122 11111 11111 11111 93 97 100 100 7.2_S73
8.2_S74 AD-CAB_3008 RC 60 tendon 8-2_S74_L001_R1_001.fastq.gz NA 70 M NA NA NA Left 167.00 71 25.50 2 Never_smoker No Yes Yes No 2.9 87 77 7.3 5.5 5.4 No Intact NA NA NA 24 25 47 NA 54.5 54.5 11.4 NA 22221 22221 11111 NA 90 90 92 NA 8.2_S74
9.2_S75 AD-CAB_3009 RC 61 tendon 9-2_S75_L001_R1_001.fastq.gz NA 68 M NA NA NA Right 182.00 83 25.10 2 Ever_smoker No No No No 2.9 79 88 7.5 5.8 5.8 No Intact 50 50 100 35 41 43 46 52.3 11.4 4.5 2.3 11211 11121 11111 11111 85 96 90 90 9.2_S75
10.2_S76 AD-CAB_3010 RC 62 tendon 10-2_S76_L001_R1_001.fastq.gz NA 58 M NA NA NA Left 179.00 98 30.00 2 Never_smoker No No No Yes 2.9 82 90 5.6 4.9 5.1 No Intact 45 17 62 21 45 43 44 45.5 4.5 11.4 20.5 11221 11111 11121 11221 70 70 75 85 10.2_S76
11.2_S77 AD-CAB_3011 RC 63 tendon 11-2_S77_L001_R1_001.fastq.gz NA 50 M NA NA NA Right 180.00 82 25.00 1 Never_smoker No Yes No No 2.9 99 76 6.7 5.7 6.0 No Intact 35 18 53 18 38 44 46 61.4 31.8 6.8 20.5 11221 11222 11111 11121 75 83 75 78 11.2_S77
14.2_S80 AD-CAB_3014 RC 66 tendon 14-2_S80_L001_R1_001.fastq.gz NA 70 M NA NA NA Left 1.77 100 32.00 3 Ever_smoker No Yes Yes No 2.9 86 79 7.1 6.3 5.8 Yes Intact 50 45 95 27 43 47 47 50.0 9.1 6.8 9.1 12221 11111 11111 11111 90 90 88 85 14.2_S80
15.2_S81 AD-CAB_3015 RC 69 tendon 15-2_S81_L001_R1_001.fastq.gz NA 66 M NA NA NA Left 175.00 95 31.00 3 Never_smoker No Yes Yes No 2.9 53 90 4.1 5.5 5.2 Yes Intact 50 47 97 25 NA NA 48 40.9 NA NA 13.6 11121 NA NA 11121 78 NA NA 93 15.2_S81
16.2_S82 AD-CAB_3016 RC 71 tendon 16-2_S82_L001_R1_001.fastq.gz NA 68 M NA NA NA Left 180.00 88 27.00 1 Ever_smoker Yes No Yes No 2.9 73 90 4.7 7.3 8.3 No Torn 40 42 82 24 27 45 43 43.2 38.6 6.8 11.4 11122 11222 11112 11121 70 60 50 80 16.2_S82
17.2_S83 AD-CAB_3017 RC 70 tendon 17-2_S83_L001_R1_001.fastq.gz NA 60 M NA NA NA Left 166.00 80 29.00 2 Ever_smoker No No No No 2.9 119 57 7.2 NA 5.7 No Torn NA NA NA 13 40 NA NA 93.2 38.6 NA NA 12221 21211 NA NA 70 60 NA NA 17.2_S83
18.2_S84 AD-CAB_3018 RC 72 tendon 18-2_S84_L001_R1_001.fastq.gz NA 72 M NA NA NA Right 170.00 85 29.00 2 Ever_smoker No Yes Yes No 3.2 82 82 6.4 5.5 5.5 No Intact 50 50 100 36 37 48 48 31.8 13.6 9.1 0.0 11122 11112 11111 11111 90 82 92 90 18.2_S84
19.2_S85 AD-CAB_3019 RC 73 tendon 19-2_S85_L001_R1_001.fastq.gz NA 45 F NA NA NA Right 163.00 98 36.90 2 Never_smoker No Yes Yes No 4.3 70 57 4.6 4.7 5.7 Yes Intact 50 35 85 32 28 45 47 36.4 38.6 18.2 13.6 11221 11221 11121 11121 50 58 45 34 19.2_S85
20.2_S86 AD-CAB_3020 RC 67 tendon 20-2_S86_L001_R1_001.fastq.gz NA 61 M NA NA NA Right 180.00 92 29.00 1 Ever_smoker No No No No 2.9 78 57 3.9 5.5 5.6 No Intact 50 40 90 30 34 36 44 50.0 34.1 31.8 0.0 12321 12321 12211 12211 77 40 70 70 20.2_S86
21.2_S87 AD-CAB_3021 RC 68 tendon 21-2_S87_L001_R1_001.fastq.gz NA 46 M NA NA NA Right 180.00 88 27.20 2 Never_smoker No Yes No No 2.9 77 57 5.9 5.9 5.3 No Torn NA NA NA 29 44 43 NA 45.5 20.5 11.4 NA NA 11111 11121 NA NA 80 65 NA 21.2_S87
23.2_S89 AD-CAB_3023 RC 75 tendon 23-2_S89_L001_R1_001.fastq.gz NA 58 M NA NA NA Right 179.00 81 25.00 2 Ever_smoker No Yes No No 2.9 75 57 5.7 5.4 5.7 No Intact 50 40 90 42 43 48 48 15.9 15.9 0.0 2.3 11211 11121 11111 11111 85 85 90 85 23.2_S89
25.2_S91 AD-CAB_3025 RC 77 tendon 25-2_S91_L001_R1_001.fastq.gz NA 62 F NA NA NA Left 157.00 95 38.50 2 Never_smoker No Yes Yes No 12.0 72 57 6.6 6.2 5.7 Yes Intact 45 43 88 26 36 38 41 59.1 29.5 31.8 18.2 12231 11221 11221 11121 82 80 60 80 25.2_S91
#de4
ss4 <- ss[ss$Tissue=="tear",]
x4 <- x[,which(colnames(x) %in% ss4$data)]
ss4 %>% kbl(caption = "Tear edge samples") %>% kable_paper("hover", full_width = F)
Tear edge samples
Participant_ID Case Redcap_ID Tissue fastq pvt.pub Age Sex Primary_OA Cuff_Arthropathy Prosthesis Affected_Side Height_cm Weight_kg BMI ASA Smoking Diabetes Hypercholesterolaemia Hypertension Thyroid CRP Creat eGFR Urea Fast_Glucose hba1c Metabolic_Syndrome Tendon_integrity_2_years_post.op ASES_2_years_post.op_Pain ASES_2_years_post.op_ADL ASES_2_years_post.op_Total Oxford_Baseline Oxford_3_month Oxford_12_month Oxford_24_month QuickDASH_ QuickDASH_3_month QuickDASH_12_month QuickDASH_24_month EQ.5D.3L_Baseline EQ.5D.3L_3_month EQ.5D.3L_12_month EQ.5D.3L_24_month EQVAS_Baseline EQVAS_3_month EQVAS_12_month EQVAS_24_month data
1.3_S93 AD-CAB_3001 RC 53 tear 1-3_S93_L001_R1_001.fastq.gz NA 67 M NA NA NA Left 177.80 120 37.90 2 Ever_smoker No Yes Yes No 2.9 83 84 7.0 5.2 5.6 Yes Torn NA NA NA 25 41 46 NA 38.6 13.6 13.6 NA 11222 11123 21222 NA 90 50 60 NA 1.3_S93
2.3_S94 AD-CAB_3002 RC 54 tear 2-3_S94_L001_R1_001.fastq.gz NA 58 M NA NA NA Right 179.00 79 25.00 1 Never_smoker No No No No 0.7 70 90 6.9 5.4 5.3 No Torn NA NA NA 33 NA 48 NA 29.5 NA 0.0 NA 11111 NA 11111 NA 90 NA 90 NA 2.3_S94
3.3_S95 AD-CAB_3003 RC 55 tear 3-3_S95_L001_R1_001.fastq.gz NA 56 M NA NA NA Left 179.00 85 26.52 1 Never_smoker No Yes NA No 2.9 72 90 4.3 5.2 5.4 No Intact 50 50 100 38 38 44 48 29.5 27.3 9.1 0.0 11221 11121 11111 22222 80 70 80 60 3.3_S95
4.3_S96 AD-CAB_3004 RC 56 tear 4-3_S96_L001_R1_001.fastq.gz NA 68 M NA NA NA Right 185.00 95 28.00 2 Ever_smoker No Yes Yes No 3.6 91 74 7.8 6.7 5.7 No Intact 45 50 95 24 41 46 48 NA 18.2 13.6 0.0 11232 11121 11121 11111 NA 80 60 52 4.3_S96
5.3_S97 AD-CAB_3005 RC 57 tear 5-3_S97_L001_R1_001.fastq.gz NA 59 F NA NA NA Right NA NA NA 1 Never_smoker No No No No 3.8 51 90 6.2 NA 5.2 NA Torn 50 50 100 38 45 NA 48 25.0 4.5 NA 0.0 11121 11111 NA 11111 92 94 95 NA 5.3_S97
6.3_S98 AD-CAB_3006 RC 58 tear 6-3_S98_L001_R1_001.fastq.gz NA 65 M NA NA NA Left 172.00 78 26.00 1 Never_smoker No No No No 2.9 77 90 5.6 4.8 5.4 No Torn NA NA NA 35 31 37 NA 34.1 36.4 27.3 NA 12221 11221 11111 NA 82 40 80 NA 6.3_S98
7.3_S99 AD-CAB_3007 RC 59 tear 7-3_S99_L001_R1_001.fastq.gz NA 63 F NA NA NA Right 163.00 57 21.50 1 Ever_smoker No No No No 2.9 53 90 29.0 NA 5.3 No Intact 50 50 100 37 38 46 48 36.4 18.2 11.4 2.3 11122 11111 11111 11111 93 97 100 100 7.3_S99
8.3_S100 AD-CAB_3008 RC 60 tear 8-3_S100_L001_R1_001.fastq.gz NA 70 M NA NA NA Left 167.00 71 25.50 2 Never_smoker No Yes Yes No 2.9 87 77 7.3 5.5 5.4 No Intact NA NA NA 24 25 47 NA 54.5 54.5 11.4 NA 22221 22221 11111 NA 90 90 92 NA 8.3_S100
9.3_S101 AD-CAB_3009 RC 61 tear 9-3_S101_L001_R1_001.fastq.gz NA 68 M NA NA NA Right 182.00 83 25.10 2 Ever_smoker No No No No 2.9 79 88 7.5 5.8 5.8 No Intact 50 50 100 35 41 43 46 52.3 11.4 4.5 2.3 11211 11121 11111 11111 85 96 90 90 9.3_S101
10.3_S102 AD-CAB_3010 RC 62 tear 10-3_S102_L001_R1_001.fastq.gz NA 58 M NA NA NA Left 179.00 98 30.00 2 Never_smoker No No No Yes 2.9 82 90 5.6 4.9 5.1 No Intact 45 17 62 21 45 43 44 45.5 4.5 11.4 20.5 11221 11111 11121 11221 70 70 75 85 10.3_S102
11.3_S103 AD-CAB_3011 RC 63 tear 11-3_S103_L001_R1_001.fastq.gz NA 50 M NA NA NA Right 180.00 82 25.00 1 Never_smoker No Yes No No 2.9 99 76 6.7 5.7 6.0 No Intact 35 18 53 18 38 44 46 61.4 31.8 6.8 20.5 11221 11222 11111 11121 75 83 75 78 11.3_S103
14.3_S106 AD-CAB_3014 RC 66 tear 14-3_S106_L001_R1_001.fastq.gz NA 70 M NA NA NA Left 1.77 100 32.00 3 Ever_smoker No Yes Yes No 2.9 86 79 7.1 6.3 5.8 Yes Intact 50 45 95 27 43 47 47 50.0 9.1 6.8 9.1 12221 11111 11111 11111 90 90 88 85 14.3_S106
15.3_S107 AD-CAB_3015 RC 69 tear 15-3_S107_L001_R1_001.fastq.gz NA 66 M NA NA NA Left 175.00 95 31.00 3 Never_smoker No Yes Yes No 2.9 53 90 4.1 5.5 5.2 Yes Intact 50 47 97 25 NA NA 48 40.9 NA NA 13.6 11121 NA NA 11121 78 NA NA 93 15.3_S107
16.3_S108 AD-CAB_3016 RC 71 tear 16-3_S108_L001_R1_001.fastq.gz NA 68 M NA NA NA Left 180.00 88 27.00 1 Ever_smoker Yes No Yes No 2.9 73 90 4.7 7.3 8.3 No Torn 40 42 82 24 27 45 43 43.2 38.6 6.8 11.4 11122 11222 11112 11121 70 60 50 80 16.3_S108
17.3_S109 AD-CAB_3017 RC 70 tear 17-3_S109_L001_R1_001.fastq.gz NA 60 M NA NA NA Left 166.00 80 29.00 2 Ever_smoker No No No No 2.9 119 57 7.2 NA 5.7 No Torn NA NA NA 13 40 NA NA 93.2 38.6 NA NA 12221 21211 NA NA 70 60 NA NA 17.3_S109
18.3_S110 AD-CAB_3018 RC 72 tear 18-3_S110_L001_R1_001.fastq.gz NA 72 M NA NA NA Right 170.00 85 29.00 2 Ever_smoker No Yes Yes No 3.2 82 82 6.4 5.5 5.5 No Intact 50 50 100 36 37 48 48 31.8 13.6 9.1 0.0 11122 11112 11111 11111 90 82 92 90 18.3_S110
19.3_S111 AD-CAB_3019 RC 73 tear 19-3_S111_L001_R1_001.fastq.gz NA 45 F NA NA NA Right 163.00 98 36.90 2 Never_smoker No Yes Yes No 4.3 70 57 4.6 4.7 5.7 Yes Intact 50 35 85 32 28 45 47 36.4 38.6 18.2 13.6 11221 11221 11121 11121 50 58 45 34 19.3_S111
20.3_S112 AD-CAB_3020 RC 67 tear 20-3_S112_L001_R1_001.fastq.gz NA 61 M NA NA NA Right 180.00 92 29.00 1 Ever_smoker No No No No 2.9 78 57 3.9 5.5 5.6 No Intact 50 40 90 30 34 36 44 50.0 34.1 31.8 0.0 12321 12321 12211 12211 77 40 70 70 20.3_S112
21.3_S113 AD-CAB_3021 RC 68 tear 21-3_S113_L001_R1_001.fastq.gz NA 46 M NA NA NA Right 180.00 88 27.20 2 Never_smoker No Yes No No 2.9 77 57 5.9 5.9 5.3 No Torn NA NA NA 29 44 43 NA 45.5 20.5 11.4 NA NA 11111 11121 NA NA 80 65 NA 21.3_S113
23.3_S115 AD-CAB_3023 RC 75 tear 23-3_S115_L001_R1_001.fastq.gz NA 58 M NA NA NA Right 179.00 81 25.00 2 Ever_smoker No Yes No No 2.9 75 57 5.7 5.4 5.7 No Intact 50 40 90 42 43 48 48 15.9 15.9 0.0 2.3 11211 11121 11111 11111 85 85 90 85 23.3_S115
25.3_S117 AD-CAB_3025 RC 77 tear 25-3_S117_L001_R1_001.fastq.gz NA 62 F NA NA NA Left 157.00 95 38.50 2 Never_smoker No Yes Yes No 12.0 72 57 6.6 6.2 5.7 Yes Intact 45 43 88 26 36 38 41 59.1 29.5 31.8 18.2 12231 11221 11221 11121 82 80 60 80 25.3_S117

QC analysis

First to look at the number of reads per data set.

par(mar=c(5,8,3,1))
barplot(colSums(x1),horiz=TRUE,las=1,xlab="Intact tendon group reads")
abline(v=4e6,col="red",lty=2)

barplot(colSums(x2),horiz=TRUE,las=1,xlab="Torn tendon group reads")
abline(v=4e6,col="red",lty=2)

barplot(colSums(x3),horiz=TRUE,las=1,xlab="Tendon body reads")
abline(v=4e6,col="red",lty=2)

barplot(colSums(x4),horiz=TRUE,las=1,xlab="Tear edge reads")
abline(v=4e6,col="red",lty=2)

Filter out low reads

x1 <- x1[,colSums(x1)>4e6]
x2 <- x2[,colSums(x2)>4e6]
x3 <- x3[,colSums(x3)>4e6]
x4 <- x4[,colSums(x4)>4e6]

ss1 <- ss1[which(ss1$data %in% colnames(x1)),]
ss2 <- ss2[which(ss2$data %in% colnames(x2)),]
ss3 <- ss3[which(ss3$data %in% colnames(x3)),]
ss4 <- ss4[which(ss4$data %in% colnames(x4)),]

ss1 <- ss1[order(rownames(ss1)),]
x1 <- x1[,order(colnames(x1))]

ss2 <- ss2[order(rownames(ss2)),]
x2 <- x2[,order(colnames(x2))]

ss3 <- ss3[order(rownames(ss3)),]
x3 <- x3[,order(colnames(x3))]

ss4 <- ss4[order(rownames(ss4)),]
x4 <- x4[,order(colnames(x4))]

rownames(ss1) == colnames(x1)
##  [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
rownames(ss2) == colnames(x2)
##  [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
rownames(ss3) == colnames(x3)
##  [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [16] TRUE TRUE TRUE TRUE
rownames(ss4) == colnames(x4)
##  [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [16] TRUE TRUE TRUE TRUE

MDS plot

Multidimensional scaling plot to show the variation between all samples, very similar to PCA.

xx <- cbind(x3,x4)
ssx <- rbind(ss3,ss4)

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

plot(mds, xlab="Coordinate 1", ylab="Coordinate 2",
  type = "p",bty="n",pch=19, cex=4 ,col="gray")
text(mds, labels=rownames(mds) )

cols <- as.numeric(as.factor(ssx$Tendon_integrity_2_years_post.op))+1 #red=intact,green=torn
shapes <- as.numeric(as.factor(ssx$Tissue))+14

plot(mds, xlab="Coordinate 1", ylab="Coordinate 2",
  type = "p",bty="n",pch=shapes, cex=2 ,col=cols)
text(mds, labels=rownames(mds) )

# Add a legend
legend("top",
  legend = c("tear intact", "tendon intact", "tear torn", "tendon torn"),
  col= c("red","red","green","green"),
  pch = c(15,16,15,16),
  pt.cex = 2,
  cex = 1.2 )

Prep pathways

genesets <- gmt_import("ReactomePathways_2023-09-01.gmt")

# gene table
gt <- as.data.frame(rownames(x))
#gt$gene <- sapply(strsplit(gt[,1]," "),"[[",2)
gt[,1] <- sub("@",".",sub("\\."," ",(sub("\\.","@",gt[,1]))))
gt$gene <- sapply(strsplit(gt[,1]," "),"[[",2)
gt[,1] <- rownames(x)

DE1: Tendon v tear (intact)

colnames(x1) == rownames(ss1)
##  [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
x1f <- x1[which(rowMeans(x1)>10),]
dim(x1)
## [1] 60651    26
dim(x1f)
## [1] 16573    26
ss1$tissue <- factor(ss1$Tissue,levels=c("tendon","tear"))
ss1$redcap <- as.character(ss1$Redcap_ID,ordered=FALSE) # unfortunately not possible to correct for patient of origin.

dds <- DESeqDataSetFromMatrix(countData = x1f , colData = ss1, design = ~ Age + Sex + tissue )
## 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.
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,20) %>%
  kbl(caption = "Top gene expression differences between tendon (ctrl) and tear (case) of intact tissues") %>%
  kable_paper("hover", full_width = F)
Top gene expression differences between tendon (ctrl) and tear (case) of intact tissues
baseMean log2FoldChange lfcSE stat pvalue padj 10.2_S76 10.3_S102 11.3_S103 14.2_S80 14.3_S106 15.2_S81 15.3_S107 18.2_S84 18.3_S110 19.2_S85 19.3_S111 20.2_S86 20.3_S112 23.2_S89 23.3_S115 25.2_S91 3.2_S69 3.3_S95 4.2_S70 4.3_S96 7.2_S73 7.3_S99 8.2_S74 8.3_S100 9.2_S75 9.3_S101
ENSG00000183091.20.NEB 13657.7361 -9.475428 0.9227078 -10.269153 0 0 6.353477 5.839636 5.004771 12.278959 4.242025 10.039295 5.035579 6.803017 4.644989 16.62250 5.501492 5.328767 4.830237 16.10258 5.549527 6.814874 16.77936 4.993240 7.533251 4.649284 5.733830 6.768170 15.95547 3.796932 9.884009 5.776340
ENSG00000125414.19.MYH2 13405.4771 -11.379104 1.2336425 -9.223988 0 0 3.579296 5.602947 3.374098 12.696551 2.402798 12.475248 3.676300 8.247780 4.201051 16.26222 3.257371 3.830172 2.967203 15.59144 4.306145 8.121821 16.62435 2.402798 4.025040 2.402798 4.366180 8.236892 16.67722 3.228088 10.589621 2.916621
ENSG00000214872.8.SMTNL1 645.9268 -7.849999 0.8692640 -9.030628 0 0 4.346995 3.661730 4.319108 6.922830 3.456243 5.992967 3.514157 4.491470 3.642287 12.36789 3.594889 3.061752 2.967203 11.69789 4.256090 3.574614 11.92321 3.705787 4.493695 3.453480 4.303668 4.229608 11.96570 3.228088 6.248074 3.414995
ENSG00000248746.6.ACTN3 856.1159 -9.658681 1.0824791 -8.922742 0 0 3.245903 3.389835 4.182927 10.513053 3.269095 5.872795 3.317428 3.788352 2.402798 12.95766 3.442176 3.326941 2.402798 11.84239 3.969240 3.000658 12.52041 3.243242 6.067308 2.402798 2.965404 3.015252 11.62193 2.402798 5.898464 3.283727
ENSG00000163126.15.ANKRD23 2844.8682 -7.377102 0.8339746 -8.845715 0 0 4.956198 4.529208 5.281521 10.275355 4.820276 7.452137 5.305138 5.174880 5.465236 14.60713 4.568389 5.446665 4.371707 13.87089 5.697412 5.880867 14.09786 5.076633 5.632072 4.761920 5.164282 5.985143 13.81208 4.081205 7.954863 5.360366
ENSG00000164309.15.CMYA5 5110.9744 -6.894549 0.7988693 -8.630384 0 0 6.636348 6.133897 5.589753 11.006170 5.101029 9.705686 5.725240 6.819959 6.959593 15.26670 6.712524 6.318777 4.694398 14.46122 6.784913 7.446223 15.26851 6.132839 7.341005 5.832437 5.921527 7.109321 14.70139 4.561838 8.960604 6.933152
ENSG00000173641.18.HSPB7 1566.0350 -6.561147 0.7815509 -8.395034 0 0 4.815775 4.737931 5.943931 9.453523 4.320721 7.661171 4.334767 7.503921 4.513370 13.07901 4.136097 6.417201 4.488425 12.98875 6.879994 6.691404 13.30924 4.596238 5.703048 4.390036 5.940929 5.690275 13.54240 6.362034 7.564130 4.323863
ENSG00000164122.9.ASB5 402.6146 -8.895785 1.0740731 -8.282290 0 0 3.003142 2.979987 3.200716 7.623332 2.402798 4.344425 3.514157 3.788352 3.036669 12.25419 3.726875 3.061752 2.402798 10.68651 3.097302 3.242462 10.89687 2.402798 3.514469 3.018228 3.631351 3.262673 10.82238 2.990288 5.236594 2.916621
ENSG00000154358.23.OBSCN 4076.3400 -6.277968 0.7581847 -8.280262 0 0 5.796891 6.004100 6.654357 10.626725 6.303581 8.781143 5.869028 7.822023 6.621622 15.02425 6.801899 6.436099 5.948783 14.13468 6.535001 6.556303 15.09230 5.927943 6.793443 6.433955 6.412422 7.149254 13.94461 5.644660 8.980641 5.683286
ENSG00000140986.8.RPL3L 819.5918 -8.079442 0.9804515 -8.240532 0 0 4.346995 3.773880 3.642101 8.636915 3.019892 6.587514 4.493168 4.941270 3.778847 12.63360 4.136097 3.326941 3.368493 11.77585 3.673230 3.820070 12.70770 2.402798 4.025040 3.453480 3.631351 4.229608 12.00814 2.402798 6.732035 3.630668
ENSG00000112183.15.RBM24 427.0572 -6.509227 0.7926673 -8.211802 0 0 3.709761 4.054277 3.944622 8.142925 3.019892 5.253024 4.565606 5.374631 4.201051 11.84991 4.440006 4.067517 3.844831 10.95243 5.008824 5.153207 11.08341 3.575675 4.493695 3.453480 5.059943 4.229608 11.42637 2.990288 5.606079 4.093698
ENSG00000072954.7.TMEM38A 558.8802 -6.327064 0.7715832 -8.200106 0 0 4.197081 3.968298 4.382000 7.307271 4.067618 5.768748 3.816101 5.003512 4.009117 12.06416 4.984724 5.057925 3.844831 11.43763 5.065183 4.267384 12.17671 3.575675 5.108688 4.390036 4.482660 4.307898 11.21873 2.990288 6.466711 4.472301
ENSG00000104369.5.JPH1 331.6083 -7.319780 0.8959116 -8.170204 0 0 4.274299 2.402798 3.517710 7.903766 2.402798 5.400793 3.939906 4.298983 3.642287 11.21941 4.219341 3.061752 3.196057 10.54606 4.306145 3.704622 11.19856 3.001221 3.940320 3.266792 3.931643 3.448539 11.00862 3.228088 5.174805 3.529009
ENSG00000160678.12.S100A1 453.2676 -5.571715 0.6830624 -8.156964 0 0 4.274299 4.584577 4.382000 7.370139 4.767255 7.136680 4.761637 7.277654 4.513370 11.70575 4.297294 6.739520 4.099519 11.29838 5.008824 4.705245 11.59436 4.759198 4.959646 4.589152 4.303668 4.697394 11.00325 4.081205 6.075657 4.093698
ENSG00000185739.13.SRL 796.6372 -6.957381 0.8548156 -8.139043 0 0 3.825602 3.968298 3.374098 8.438711 3.019892 5.872795 4.334767 5.909826 3.036669 12.64168 4.740048 3.525540 3.511348 11.72237 6.195492 5.577781 12.59817 3.425213 5.108688 3.859118 5.409288 4.952188 11.96791 2.990288 6.721464 4.093698
ENSG00000164708.6.PGAM2 941.9428 -7.835474 0.9676494 -8.097431 0 0 4.026106 3.213800 3.374098 8.503187 2.402798 6.460414 3.054860 6.391347 3.778847 12.76107 4.628125 6.025763 3.196057 11.96509 4.790873 5.227556 12.88297 2.402798 5.336079 4.316124 3.365487 5.717331 12.34087 3.407010 6.955882 4.214179
ENSG00000116748.21.AMPD1 610.2067 -10.976434 1.3651242 -8.040612 0 0 3.709761 2.402798 2.970559 8.690198 2.402798 5.534424 2.402798 3.938570 2.402798 12.18398 3.257371 2.402798 2.402798 11.26987 3.485922 3.000658 11.89366 2.402798 3.940320 2.402798 3.840527 3.602093 12.11655 2.402798 6.262763 2.402798
ENSG00000163380.16.LMOD3 845.7891 -6.889563 0.8576780 -8.032808 0 0 4.114646 3.389835 3.944622 8.344091 2.402798 6.264901 4.985034 5.003512 4.286703 12.84045 5.028777 4.585259 4.309062 11.80976 4.685454 4.339876 12.60251 3.705787 4.178095 4.237574 4.237863 4.307898 12.04467 4.561838 6.375138 3.722904
ENSG00000117115.13.PADI2 567.0307 -6.933673 0.8652876 -8.013142 0 0 4.026106 3.389835 4.029536 8.182844 4.920438 5.713711 3.514157 7.879622 4.580834 11.74462 4.297294 3.955009 3.844831 11.37450 4.400631 3.242462 11.97760 3.243242 5.177555 2.402798 3.931643 5.042045 11.92653 3.555044 6.262763 3.722904
ENSG00000124701.6.APOBEC2 665.7476 -7.527524 0.9469407 -7.949309 0 0 4.197081 3.661730 3.517710 7.804887 2.402798 5.922090 3.676300 5.227575 4.009117 12.51201 4.792667 2.402798 3.635105 11.66065 4.685454 4.190388 11.74044 3.575675 4.548408 3.965866 4.237863 4.381573 12.09198 3.228088 6.277302 3.529009
dge1 <- dge
write.table(dge1,file="tear1.tsv",quote=FALSE,sep='\t')

# mitch
m1 <- mitch_import(dge1, DEtype="deseq2",geneTable=gt)
## The input is a single dataframe; one contrast only. Converting
##         it to a list for you.
## Note: Mean no. genes in input = 16573
## Note: no. genes in output = 16550
## Note: estimated proportion of input genes in output = 0.999
mres1 <- mitch_calc(m1, genesets, priority="effect")
## Note: Enrichments with large effect sizes may not be
##             statistically significant.
head(mres1$enrichment_result,20) %>%
  kbl(caption = "Top gene pathway differences between tendon (ctrl) and tear (case) of intact tissues") %>%
  kable_paper("hover", full_width = F)
Top gene pathway differences between tendon (ctrl) and tear (case) of intact tissues
set setSize pANOVA s.dist p.adjustANOVA
1443 mitochondrial fatty acid beta-oxidation of saturated fatty acids 10 0.0000102 -0.8056106 0.0001781
197 Citric acid cycle (TCA cycle) 22 0.0000000 -0.7666989 0.0000000
494 Glyoxylate metabolism and glycine degradation 23 0.0000000 -0.7666164 0.0000000
45 Activation of PPARGC1A (PGC-1alpha) by phosphorylation 10 0.0001117 -0.7055260 0.0012754
123 Branched-chain amino acid catabolism 21 0.0000001 -0.6868188 0.0000014
1429 Zinc transporters 10 0.0001695 0.6867110 0.0016855
214 Complex I biogenesis 51 0.0000000 -0.6736724 0.0000000
718 Mucopolysaccharidoses 11 0.0001164 0.6709376 0.0012941
319 Dissolution of Fibrin Clot 10 0.0002836 0.6628295 0.0024639
1074 Respiratory electron transport 93 0.0000000 -0.6422518 0.0000000
302 Diseases associated with N-glycosylation of proteins 20 0.0000009 0.6349788 0.0000192
406 Formation of ATP by chemiosmotic coupling 16 0.0000115 -0.6333313 0.0001957
1075 Respiratory electron transport, ATP synthesis by chemiosmotic coupling, and heat production by uncoupling proteins. 113 0.0000000 -0.6289399 0.0000000
1324 The citric acid (TCA) cycle and respiratory electron transport 160 0.0000000 -0.6139208 0.0000000
143 CS/DS degradation 11 0.0004299 0.6130688 0.0034531
1323 The activation of arylsulfatases 10 0.0011064 0.5956832 0.0073180
490 Glycogen synthesis 13 0.0002094 -0.5938153 0.0019624
915 Pyruvate metabolism and Citric Acid (TCA) cycle 51 0.0000000 -0.5910911 0.0000000
1256 Syndecan interactions 26 0.0000004 0.5745955 0.0000093
161 Carnitine metabolism 14 0.0002139 -0.5713940 0.0019921
m1top <- subset(mres1$enrichment_result,p.adjustANOVA<0.05)
m1up <- subset(m1top,s.dist>0)$set
m1dn <- subset(m1top,s.dist<0)$set

if (! file.exists("tear_mitchres1.html") ) {
  mitch_report(mres1,outfile="tear_mitchres1.html",overwrite=FALSE)
}

DE2: Tendon v tear (torn)

colnames(x2) == rownames(ss2)
##  [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
x2f <- x2[which(rowMeans(x2)>10),]
dim(x2)
## [1] 60651    12
dim(x2f)
## [1] 16590    12
ss2$tissue <- factor(ss2$Tissue,levels=c("tendon","tear"))
ss2$redcap <- as.character(ss2$Redcap_ID,ordered=FALSE) # unfortunately not possible to correct for patient of origin.

dds <- DESeqDataSetFromMatrix(countData = x2f , colData = ss2, design = ~ Age + Sex + tissue )
## 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.
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,20) %>%
  kbl(caption = "Top gene expression differences between tendon (ctrl) and tear (case) of torn tissues") %>%
  kable_paper("hover", full_width = F)
Top gene expression differences between tendon (ctrl) and tear (case) of torn tissues
baseMean log2FoldChange lfcSE stat pvalue padj 1.3_S93 16.2_S82 16.3_S108 17.2_S83 17.3_S109 2.2_S68 21.2_S87 21.3_S113 5.2_S71 5.3_S97 6.2_S72 6.3_S98
ENSG00000159251.8.ACTC1 1096.92105 -7.850215 1.3686937 -5.735553 0e+00 0.0001612 5.434797 13.242506 2.324036 5.431931 3.973187 6.624198 9.355165 3.202362 11.371636 3.818985 4.856548 3.778394
ENSG00000274276.4.CBSL 26.53041 2.748503 0.4964329 5.536505 0e+00 0.0001618 5.078619 3.005120 4.420193 4.249733 6.430281 3.718052 4.370129 6.348402 4.159482 6.411412 3.674782 4.596819
ENSG00000162267.12.ITIH3 85.27914 -4.518586 0.8174848 -5.527426 0e+00 0.0001618 4.792380 7.158375 4.527603 5.886580 4.198942 9.151117 5.569679 2.949825 7.521479 3.928078 4.254272 4.196300
ENSG00000162998.5.FRZB 49.83554 -4.070802 0.7407816 -5.495279 0e+00 0.0001618 4.698151 7.225747 3.673819 5.667609 4.198942 6.609311 7.370305 2.949825 7.035782 2.956933 4.465615 3.778394
ENSG00000196557.13.CACNA1H 105.20850 -6.041900 1.1128431 -5.429247 1e-07 0.0001819 5.078619 4.889082 3.773936 7.725333 3.520144 9.266824 6.109321 2.949825 8.392529 2.324036 4.529021 2.324036
ENSG00000198768.11.APCDD1L 98.62085 3.786230 0.7008539 5.402310 1e-07 0.0001819 5.041208 3.278690 8.042205 5.284509 7.836187 4.527866 4.455275 6.331292 4.065862 8.877099 3.674782 6.556856
ENSG00000258227.7.CLEC5A 79.36328 4.152771 0.7785411 5.334041 1e-07 0.0002110 3.478634 4.494723 8.200848 4.002078 7.176471 2.966670 3.678965 6.524250 4.404316 8.547718 3.901512 5.549560
ENSG00000104951.16.IL4I1 58.29778 4.364987 0.8209387 5.317069 1e-07 0.0002110 3.720953 4.331861 8.697712 4.132160 6.804925 2.966670 3.019909 5.819243 3.233675 6.427970 3.999880 5.365597
ENSG00000121068.14.TBX2 184.33772 -3.688689 0.6957024 -5.302107 1e-07 0.0002110 6.288720 7.944740 4.029754 8.471152 5.441103 9.551445 8.038406 3.683482 8.570970 6.234360 6.476076 3.934810
ENSG00000250945.1.AC096773.1 30.86213 -1.879814 0.3558985 -5.281882 1e-07 0.0002121 5.041208 6.304619 4.673866 5.360159 4.198942 6.467880 5.195676 4.265908 5.439124 4.027783 5.827013 4.507695
ENSG00000286208.1.AC093838.1 31.72052 -2.282873 0.4359259 -5.236837 2e-07 0.0002464 4.792380 6.103639 4.240153 6.243700 4.556011 6.667955 5.374307 3.803289 4.246486 2.324036 5.752566 5.209809
ENSG00000072840.13.EVC 184.75271 1.651327 0.3167304 5.213667 2e-07 0.0002496 7.120977 6.150807 8.253792 7.092872 8.804750 6.830757 7.033114 8.004625 6.136553 8.218287 6.521389 8.099035
ENSG00000139330.6.KERA 60.93028 -5.564602 1.0694044 -5.203459 2e-07 0.0002496 3.824033 8.908761 2.324036 5.384494 3.520144 6.134673 6.711413 2.324036 6.003304 3.212191 2.945596 3.778394
ENSG00000278969.1.AC026310.2 20.66536 3.707920 0.7193917 5.154244 3e-07 0.0002867 3.478634 3.005120 6.384411 3.688023 5.831402 3.419806 3.956625 5.867699 2.324036 4.894080 3.674782 5.413895
ENSG00000211451.12.GNRHR2 26.52316 -1.508742 0.2929067 -5.150932 3e-07 0.0002867 4.880463 6.029829 4.719254 5.687205 4.198942 5.581157 5.455741 4.101570 5.254073 4.119796 5.375155 4.970508
ENSG00000171551.12.ECEL1 18.29803 -4.957437 0.9660194 -5.131819 3e-07 0.0002905 2.912772 6.587294 2.324036 4.068872 3.309590 4.592543 3.507573 2.324036 6.748344 2.956933 3.384893 3.073929
ENSG00000231290.6.APCDD1L.DT 54.34127 2.928137 0.5729635 5.110512 3e-07 0.0002905 5.376433 5.147927 8.029247 4.249733 6.953951 4.388050 4.073806 5.914558 4.065862 6.840100 3.999880 5.153752
ENSG00000110786.18.PTPN5 38.19020 -4.297182 0.8412363 -5.108175 3e-07 0.0002905 5.315533 5.720823 3.295228 7.571859 3.309590 5.781675 5.494753 2.324036 5.539470 2.324036 6.296472 4.412055
ENSG00000088340.17.FER1L4 285.04857 3.713531 0.7275814 5.103939 3e-07 0.0002905 4.487007 5.841102 10.085815 6.474234 9.746425 5.193830 5.331745 7.187214 4.842303 8.718440 4.702777 9.496921
ENSG00000184166.2.OR1D2 71.97979 -1.980638 0.3984338 -4.971058 7e-07 0.0005524 5.718611 7.075569 5.293520 6.906434 4.556011 7.833395 6.499901 5.423759 5.979833 3.928078 6.621865 6.111590
dge2 <- dge
write.table(dge2,file="tear2.tsv",quote=FALSE,sep='\t')

# mitch
m2 <- mitch_import(dge2, DEtype="deseq2",geneTable=gt)
## The input is a single dataframe; one contrast only. Converting
##         it to a list for you.
## Note: Mean no. genes in input = 16590
## Note: no. genes in output = 16566
## Note: estimated proportion of input genes in output = 0.999
mres2 <- mitch_calc(m2, genesets, priority="effect")
## Note: Enrichments with large effect sizes may not be
##             statistically significant.
head(mres2$enrichment_result,20) %>%
  kbl(caption = "Top gene pathway differences between tendon (ctrl) and tear (case) of torn tissues") %>%
  kable_paper("hover", full_width = F)
Top gene pathway differences between tendon (ctrl) and tear (case) of torn tissues
set setSize pANOVA s.dist p.adjustANOVA
374 Expression and translocation of olfactory receptors 21 0.0000000 -0.7671113 0.0000001
1430 Zinc transporters 10 0.0000819 0.7192196 0.0010779
804 Olfactory Signaling Pathway 25 0.0000000 -0.6910271 0.0000001
45 Activation of PPARGC1A (PGC-1alpha) by phosphorylation 10 0.0001571 -0.6901667 0.0017544
1344 Trafficking and processing of endosomal TLR 12 0.0001176 0.6419999 0.0014699
382 FCGR activation 10 0.0004769 0.6379319 0.0045899
615 Keratan sulfate degradation 13 0.0001005 0.6229547 0.0012896
197 Citric acid cycle (TCA cycle) 22 0.0000016 -0.5907992 0.0000412
718 Mucopolysaccharidoses 11 0.0008750 0.5794514 0.0073575
856 Phase 0 - rapid depolarisation 27 0.0000006 -0.5553898 0.0000178
1015 Regulation of CDH11 gene transcription 10 0.0023704 0.5550495 0.0164358
689 Metal ion SLC transporters 18 0.0000651 0.5436441 0.0008988
1083 Retrograde neurotrophin signalling 13 0.0007301 0.5410732 0.0063584
776 Nitric oxide stimulates guanylate cyclase 17 0.0001331 -0.5351914 0.0015580
319 Dissolution of Fibrin Clot 10 0.0034828 0.5335347 0.0223925
494 Glyoxylate metabolism and glycine degradation 24 0.0000068 -0.5304881 0.0001409
143 CS/DS degradation 10 0.0042307 0.5223726 0.0260065
214 Complex I biogenesis 51 0.0000000 -0.5163422 0.0000000
1252 Striated Muscle Contraction 35 0.0000002 -0.5116569 0.0000056
1324 The activation of arylsulfatases 10 0.0054442 0.5075985 0.0317149
m2top <- subset(mres2$enrichment_result,p.adjustANOVA<0.05)
m2up <- subset(m2top,s.dist>0)$set
m2dn <- subset(m2top,s.dist<0)$set

if (! file.exists("tear_mitchres2.html") ) {
  mitch_report(mres2,outfile="tear_mitchres2.html",overwrite=FALSE)
}

Now run a mitch analysis to see the similarities/differences between tendon-tear for intact vs torn

l1 <- list("intact"=dge1,"torn"=dge2)
mm <- mitch_import(l1, DEtype="deseq2",geneTable=gt)
## Note: Mean no. genes in input = 16581.5
## Note: no. genes in output = 16178
## Note: estimated proportion of input genes in output = 0.976
mmres1 <- mitch_calc(mm, genesets, priority="effect")
## Note: Enrichments with large effect sizes may not be 
##             statistically significant.
head(mmres1$enrichment_result,20) %>%
  kbl(caption = "Top tendon-tear pathways in intact and torn samples") %>%
  kable_paper("hover", full_width = F)
Top tendon-tear pathways in intact and torn samples
set setSize pMANOVA s.intact s.torn p.intact p.torn s.dist SD p.adjustMANOVA
1426 Zinc transporters 10 0.0001508 0.6848095 0.7194582 0.0001767 0.0000815 0.9932694 0.0245003 0.0011316
45 Activation of PPARGC1A (PGC-1alpha) by phosphorylation 10 0.0001731 -0.7032905 -0.6919842 0.0001174 0.0001509 0.9866405 0.0079948 0.0012561
197 Citric acid cycle (TCA cycle) 22 0.0000000 -0.7640899 -0.5928898 0.0000000 0.0000015 0.9671358 0.1210568 0.0000001
1440 mitochondrial fatty acid beta-oxidation of saturated fatty acids 10 0.0000572 -0.8036244 -0.4966353 0.0000108 0.0065392 0.9447004 0.2170741 0.0005182
494 Glyoxylate metabolism and glycine degradation 23 0.0000000 -0.7634008 -0.5289815 0.0000000 0.0000112 0.9287637 0.1657595 0.0000000
717 Mucopolysaccharidoses 11 0.0003995 0.6686291 0.5789740 0.0001229 0.0008838 0.8844636 0.0633958 0.0024906
319 Dissolution of Fibrin Clot 10 0.0011594 0.6626423 0.5332756 0.0002848 0.0034989 0.8505749 0.0914760 0.0057931
214 Complex I biogenesis 51 0.0000000 -0.6701695 -0.5185884 0.0000000 0.0000000 0.8473848 0.1071841 0.0000000
382 FCGR activation 10 0.0015636 0.5507546 0.6376423 0.0025625 0.0004797 0.8425665 0.0614389 0.0072651
1340 Trafficking and processing of endosomal TLR 12 0.0004732 0.5246299 0.6419337 0.0016504 0.0001178 0.8290449 0.0829463 0.0028411
143 CS/DS degradation 10 0.0023950 0.6205715 0.5214621 0.0006781 0.0042980 0.8105750 0.0700809 0.0102173
374 Expression and translocation of olfactory receptors 21 0.0000000 -0.2445085 -0.7685273 0.0524491 0.0000000 0.8064853 0.3705372 0.0000000
1073 Respiratory electron transport 93 0.0000000 -0.6391709 -0.4871091 0.0000000 0.0000000 0.8036260 0.1075239 0.0000000
302 Diseases associated with N-glycosylation of proteins 20 0.0000050 0.6326773 0.4936750 0.0000010 0.0001323 0.8024933 0.0982895 0.0000678
406 Formation of ATP by chemiosmotic coupling 16 0.0000609 -0.6303211 -0.4945938 0.0000127 0.0006141 0.8012039 0.0959737 0.0005364
615 Keratan sulfate degradation 13 0.0004343 0.4950629 0.6233743 0.0019972 0.0000994 0.7960420 0.0907299 0.0026738
1074 Respiratory electron transport, ATP synthesis by chemiosmotic coupling, and heat production by uncoupling proteins. 113 0.0000000 -0.6259785 -0.4794334 0.0000000 0.0000000 0.7884830 0.1036231 0.0000000
1321 The activation of arylsulfatases 10 0.0038148 0.5938521 0.5069644 0.0011462 0.0055029 0.7808157 0.0614389 0.0155036
1249 Striated Muscle Contraction 34 0.0000000 -0.5653166 -0.5215669 0.0000000 0.0000001 0.7691651 0.0309357 0.0000003
123 Branched-chain amino acid catabolism 21 0.0000001 -0.6844593 -0.3284291 0.0000001 0.0091819 0.7591773 0.2517514 0.0000021
if (! file.exists("tear_multimitchres1.html") ) {
  mitch_report(mmres1,outfile="tear_multimitchres1.html",overwrite=FALSE)
}
## Dataset saved as " /tmp/RtmpUPjaUw/tear_multimitchres1.rds ".
## 
## 
## processing file: mitch.Rmd
## 1/34                             
## 2/34 [checklibraries]            
## 3/34                             
## 4/34 [peek]                      
## 5/34                             
## 6/34 [metrics]                   
## 7/34                             
## 8/34 [scatterplot]
## 9/34                             
## 10/34 [contourplot]
## 11/34                             
## 12/34 [input_geneset_metrics1]    
## 13/34                             
## 14/34 [input_geneset_metrics2]
## 15/34                             
## 16/34 [input_geneset_metrics3]
## 17/34                             
## 18/34 [echart1d]                  
## 19/34 [echart2d]                  
## 20/34                             
## 21/34 [heatmap]
## 22/34                             
## 23/34 [effectsize]                
## 24/34                             
## 25/34 [results_table]             
## 26/34                             
## 27/34 [results_table_complete]    
## 28/34                             
## 29/34 [detailed_geneset_reports1d]
## 30/34                             
## 31/34 [detailed_geneset_reports2d]
## 32/34                             
## 33/34 [session_info]              
## 34/34
## output file: /mnt/data/mdz/projects/shoulder/shoulder-instability-osteroarthritis/mitch.knit.md
## /home/mdz/anaconda3/bin/pandoc +RTS -K512m -RTS /mnt/data/mdz/projects/shoulder/shoulder-instability-osteroarthritis/mitch.knit.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash --output /tmp/RtmpUPjaUw/mitch_report.html --lua-filter /usr/local/lib/R/site-library/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /usr/local/lib/R/site-library/rmarkdown/rmarkdown/lua/latex-div.lua --self-contained --variable bs3=TRUE --section-divs --template /usr/local/lib/R/site-library/rmarkdown/rmd/h/default.html --no-highlight --variable highlightjs=1 --variable theme=bootstrap --mathjax --variable 'mathjax-url=https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' --include-in-header /tmp/RtmpUPjaUw/rmarkdown-str14d65b2074b384.html
## 
## Output created: /tmp/RtmpUPjaUw/mitch_report.html
## [1] TRUE
# prioritise by SD to get the discordant pathways
mmres1 <- mitch_calc(mm, genesets, priority="SD")
## Note: Prioritisation by SD after selecting sets with 
##             p.adjustMANOVA<=0.05.
head(mmres1$enrichment_result,20) %>%
  kbl(caption = "Top tendon-tear pathways in intact and torn samples (discordant only)") %>%
  kable_paper("hover", full_width = F)
Top tendon-tear pathways in intact and torn samples (discordant only)
set setSize pMANOVA s.intact s.torn p.intact p.torn s.dist SD p.adjustMANOVA
374 Expression and translocation of olfactory receptors 21 0.0000000 -0.2445085 -0.7685273 0.0524491 0.0000000 0.8064853 0.3705372 0.0000000
802 Olfactory Signaling Pathway 25 0.0000000 -0.2076568 -0.6924113 0.0723481 0.0000000 0.7228795 0.3427732 0.0000000
1015 Regulation of FOXO transcriptional activity by acetylation 10 0.0016650 -0.4900915 -0.0217838 0.0072833 0.9050626 0.4905754 0.3311436 0.0076391
114 Beta-oxidation of very long chain fatty acids 10 0.0016810 -0.5153018 -0.0617887 0.0047773 0.7351367 0.5189931 0.3206822 0.0076644
504 HDMs demethylate histones 21 0.0000170 -0.0725176 0.3769294 0.5651727 0.0027896 0.3838418 0.3178070 0.0001959
393 FOXO-mediated transcription of cell death genes 15 0.0002053 -0.4846171 -0.0573697 0.0011553 0.7005038 0.4880011 0.3021095 0.0014560
1430 cGMP effects 14 0.0003608 -0.0712430 -0.4931240 0.6444591 0.0013998 0.4982438 0.2983150 0.0023398
188 Chk1/Chk2(Cds1) mediated inactivation of Cyclin B:Cdk1 complex 11 0.0046890 0.4235620 0.0126014 0.0149997 0.9423158 0.4237494 0.2905930 0.0185905
1196 Signaling by Leptin 11 0.0017309 -0.5212920 -0.1119396 0.0027556 0.5203670 0.5331752 0.2894558 0.0078187
932 RHO GTPases activate CIT 19 0.0016437 0.2330948 -0.1409513 0.0786214 0.2875688 0.2723976 0.2644905 0.0075893
123 Branched-chain amino acid catabolism 21 0.0000001 -0.6844593 -0.3284291 0.0000001 0.0091819 0.7591773 0.2517514 0.0000021
292 Deposition of new CENPA-containing nucleosomes at the centromere 30 0.0000306 0.3480555 -0.0028528 0.0009697 0.9784305 0.3480672 0.2481296 0.0003169
792 Nucleosome assembly 30 0.0000306 0.3480555 -0.0028528 0.0009697 0.9784305 0.3480672 0.2481296 0.0003169
774 Nitric oxide stimulates guanylate cyclase 17 0.0001308 -0.1862545 -0.5369972 0.1837300 0.0001263 0.5683808 0.2480125 0.0009989
289 Degradation of cysteine and homocysteine 14 0.0014468 -0.4908880 -0.1432902 0.0014718 0.3533218 0.5113738 0.2457888 0.0068095
273 Defective HDR through Homologous Recombination Repair (HRR) due to PALB2 loss of BRCA1 binding function 24 0.0000431 0.4456481 0.0986288 0.0001573 0.4030330 0.4564317 0.2453797 0.0004196
274 Defective HDR through Homologous Recombination Repair (HRR) due to PALB2 loss of BRCA2/RAD51/RAD51C binding function 24 0.0000431 0.4456481 0.0986288 0.0001573 0.4030330 0.4564317 0.2453797 0.0004196
278 Defective homologous recombination repair (HRR) due to BRCA1 loss of function 24 0.0000431 0.4456481 0.0986288 0.0001573 0.4030330 0.4564317 0.2453797 0.0004196
280 Defective homologous recombination repair (HRR) due to PALB2 loss of function 24 0.0000431 0.4456481 0.0986288 0.0001573 0.4030330 0.4564317 0.2453797 0.0004196
548 Impaired BRCA2 binding to PALB2 23 0.0000695 0.4507125 0.1102445 0.0001827 0.3601656 0.4639996 0.2407472 0.0005828
if (! file.exists("tear_multmitchres1_discord.html") ) {
  mitch_report(mmres1,outfile="tear_multmitchres1_discord.html",overwrite=FALSE)
}
## Dataset saved as " /tmp/RtmpUPjaUw/tear_multmitchres1_discord.rds ".
## 
## 
## processing file: mitch.Rmd
## 1/34                             
## 2/34 [checklibraries]            
## 3/34                             
## 4/34 [peek]                      
## 5/34                             
## 6/34 [metrics]                   
## 7/34                             
## 8/34 [scatterplot]
## 9/34                             
## 10/34 [contourplot]
## 11/34                             
## 12/34 [input_geneset_metrics1]    
## 13/34                             
## 14/34 [input_geneset_metrics2]
## 15/34                             
## 16/34 [input_geneset_metrics3]
## 17/34                             
## 18/34 [echart1d]                  
## 19/34 [echart2d]                  
## 20/34                             
## 21/34 [heatmap]
## 22/34                             
## 23/34 [effectsize]                
## 24/34                             
## 25/34 [results_table]             
## 26/34                             
## 27/34 [results_table_complete]    
## 28/34                             
## 29/34 [detailed_geneset_reports1d]
## 30/34                             
## 31/34 [detailed_geneset_reports2d]
## 32/34                             
## 33/34 [session_info]              
## 34/34
## output file: /mnt/data/mdz/projects/shoulder/shoulder-instability-osteroarthritis/mitch.knit.md
## /home/mdz/anaconda3/bin/pandoc +RTS -K512m -RTS /mnt/data/mdz/projects/shoulder/shoulder-instability-osteroarthritis/mitch.knit.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash --output /tmp/RtmpUPjaUw/mitch_report.html --lua-filter /usr/local/lib/R/site-library/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /usr/local/lib/R/site-library/rmarkdown/rmarkdown/lua/latex-div.lua --self-contained --variable bs3=TRUE --section-divs --template /usr/local/lib/R/site-library/rmarkdown/rmd/h/default.html --no-highlight --variable highlightjs=1 --variable theme=bootstrap --mathjax --variable 'mathjax-url=https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' --include-in-header /tmp/RtmpUPjaUw/rmarkdown-str14d65b52a75977.html
## 
## Output created: /tmp/RtmpUPjaUw/mitch_report.html
## [1] TRUE

The other approach is to find the direct differences between intact and torn samples.

DE3. tendon (intact) vs tendon (torn).

colnames(x3) == rownames(ss3)
##  [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [16] TRUE TRUE TRUE TRUE
x3f <- x3[which(rowMeans(x3)>10),]
dim(x3)
## [1] 60651    19
dim(x3f)
## [1] 16536    19
ss3$tissue <- factor(ss3$Tissue,levels=c("tendon","tear"))
ss3$integrity <- factor(ss3$Tendon_integrity_2_years_post.op)

dds <- DESeqDataSetFromMatrix(countData = x3f , colData = ss3, design = ~ Age + Sex + integrity )
## 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.
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## 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)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
head(dge,20) %>%
  kbl(caption = "Top gene expression differences between intact (ctrl) and torn (case) tendon.") %>%
  kable_paper("hover", full_width = F)
Top gene expression differences between intact (ctrl) and torn (case) tendon.
baseMean log2FoldChange lfcSE stat pvalue padj 10.2_S76 14.2_S80 15.2_S81 16.2_S82 17.2_S83 18.2_S84 19.2_S85 2.2_S68 20.2_S86 21.2_S87 23.2_S89 25.2_S91 3.2_S69 4.2_S70 5.2_S71 6.2_S72 7.2_S73 8.2_S74 9.2_S75
ENSG00000108405.4.P2RX1 41.21403 4.3413409 0.9823026 4.419556 0.0000099 0.1006945 3.255370 3.885790 4.443246 3.671201 4.290304 6.271105 1.915476 8.759992 2.669663 3.403286 4.376566 2.863137 3.586673 3.898479 7.374338 3.109345 3.788873 2.781987 5.454967
ENSG00000255769.7.GOLGA2P10 16.18043 -2.4280355 0.5644333 -4.301722 0.0000169 0.1006945 3.255370 4.046465 4.676274 2.668721 3.198832 1.915476 6.246798 3.583503 4.283121 4.144979 5.391856 4.573979 5.908772 3.537995 3.605618 3.282044 4.425996 4.882578 4.596984
ENSG00000134917.10.ADAMTS8 44.63816 3.4303461 0.8005346 4.285069 0.0000183 0.1006945 4.104454 3.701675 4.378192 9.330768 3.510394 4.479089 3.554327 4.003720 1.915476 3.702948 3.876923 3.993704 3.814767 3.427855 6.228635 3.977773 3.512536 4.735653 3.854440
ENSG00000162852.14.CNST 175.51083 -0.7802754 0.2058750 -3.790044 0.0001506 0.6226657 7.474345 7.222186 6.959817 6.980698 6.506107 6.989153 8.685764 7.097355 7.434936 7.442272 8.134954 7.690348 8.506628 7.111960 7.440062 6.525901 7.651766 7.710144 6.892307
ENSG00000227827.3.PKD1P2 66.04932 -3.1708756 0.8872557 -3.573801 0.0003518 0.9215750 5.204110 7.662761 7.501349 4.196915 2.504424 4.763028 6.920423 5.356804 4.109923 6.315477 8.350164 5.294121 1.915476 6.724714 1.915476 4.143746 6.117823 5.742922 5.011279
ENSG00000273066.5.AL355987.4 12.13401 -1.3820308 0.3876083 -3.565534 0.0003631 0.9215750 4.317294 4.255494 3.802930 3.795263 3.755181 4.763028 4.843324 3.911130 4.757901 4.799120 4.198760 3.993704 4.795113 4.298916 2.927189 2.617642 3.512536 4.384472 4.506250
ENSG00000120693.14.SMAD9 98.94344 1.2294166 0.3466388 3.546679 0.0003901 0.9215750 5.567825 5.960168 6.607501 8.604941 7.027494 6.570295 6.139789 7.126734 5.278600 6.757063 6.891459 6.506179 5.862599 6.321890 7.348897 5.672774 6.698430 6.559717 6.333705
ENSG00000122042.10.UBL3 289.30915 -0.4758400 0.1389598 -3.424300 0.0006164 0.9999176 8.396061 8.245663 8.156159 7.906647 8.070629 7.541399 8.940188 7.734578 8.524283 8.000441 8.345029 8.368836 8.271668 8.470747 7.768950 7.986200 8.252087 8.378637 8.028581
ENSG00000263276.1.AC020978.7 11.21707 -1.6121027 0.4772870 -3.377638 0.0007311 0.9999176 4.317294 2.850282 4.080897 3.671201 3.415976 3.457650 5.760422 3.300721 4.757901 3.562659 3.748702 3.993704 4.795113 3.638623 2.927189 3.679636 4.425996 4.481074 4.458519
ENSG00000225783.8.MIAT 226.49307 2.1919115 0.6716071 3.263681 0.0010997 0.9999176 7.277072 6.981102 5.957138 10.373561 5.766977 7.494778 3.969024 5.484189 6.616130 7.423980 7.397557 8.124700 5.066314 5.493698 10.249400 7.302258 7.537217 4.481074 6.613693
ENSG00000228716.7.DHFR 109.31693 -0.6409490 0.1989584 -3.221523 0.0012751 0.9999176 6.776544 6.943115 7.113019 5.954547 6.641428 7.269581 7.229113 6.777383 7.247293 7.106004 7.284027 6.558848 7.746789 6.765465 6.301307 6.375359 6.381335 5.887241 6.686046
ENSG00000138829.12.FBN2 12.72584 2.2872322 0.7107843 3.217899 0.0012913 0.9999176 3.085671 3.885790 5.241285 6.774140 5.055372 3.457650 1.915476 4.319711 3.673207 2.683679 3.252399 3.377566 1.915476 3.427855 4.117123 3.561678 3.703592 4.167603 2.540207
ENSG00000000005.6.TNMD 250.62746 2.6208379 0.8228680 3.185004 0.0014475 0.9999176 5.133254 7.449118 5.670393 11.511902 6.969918 5.708015 2.894475 7.662883 6.832078 6.771613 7.831373 7.781693 2.915085 5.913338 8.068087 4.708157 4.963498 5.921156 7.674865
ENSG00000215424.10.MCM3AP.AS1 31.28213 -0.7800067 0.2468202 -3.160222 0.0015765 0.9999176 5.540829 5.490212 6.139853 4.359410 4.876313 4.825751 5.552982 5.141293 5.531626 5.061830 5.127730 4.625413 5.489322 5.493698 4.718563 4.943848 5.376546 5.352296 5.277691
ENSG00000116396.15.KCNC4 132.81346 1.0654126 0.3396946 3.136384 0.0017105 0.9999176 6.918901 6.714121 6.893662 8.699243 6.909945 7.117832 5.171001 7.662883 5.658273 7.237539 7.465408 6.479103 6.819663 7.111960 7.903149 6.738127 7.262890 6.352104 6.725814
ENSG00000274810.4.NPHP3.ACAD11 16.35090 -1.2720445 0.4076874 -3.120146 0.0018076 0.9999176 4.979858 3.598092 5.377657 3.795263 3.959221 5.152446 4.134502 3.811263 4.574173 4.144979 4.919420 3.993704 5.146198 5.134751 4.348612 3.109345 4.819151 4.571277 4.248745
ENSG00000083635.8.NUFIP1 26.50502 -0.8498701 0.2726964 -3.116543 0.0018299 0.9999176 4.807586 4.644792 4.728848 4.011653 4.338252 5.051766 5.983432 4.171147 4.970251 5.241519 5.648388 5.056001 5.862599 5.165836 4.718563 5.107418 4.928785 5.193916 5.043493
ENSG00000197978.9.GOLGA6L9 92.96471 -0.8726635 0.2800262 -3.116363 0.0018310 0.9999176 6.426414 5.516474 7.073732 5.929771 6.367914 6.570295 7.581668 6.550328 7.066006 6.869547 6.877288 6.423371 7.271051 6.899639 6.007433 4.899790 6.698430 7.047007 5.847820
ENSG00000187609.16.EXD3 203.10779 0.5618165 0.1828105 3.073219 0.0021176 0.9999176 7.301262 7.495767 7.938462 7.557649 7.796364 7.777810 7.263434 8.088059 7.777797 7.744521 7.240420 7.307863 7.528458 7.423227 8.093832 8.658078 7.570885 7.192513 7.955279
ENSG00000115457.10.IGFBP2 123.57068 1.4688315 0.4869031 3.016682 0.0025556 0.9999176 5.335983 7.291830 5.796926 9.616355 7.193878 7.002551 5.941524 6.315066 4.507041 6.650868 7.183988 6.609656 6.232722 6.251836 7.251573 6.224910 6.525868 5.921156 7.095623
dge3 <- dge
write.table(dge3,file="tear3.tsv",quote=FALSE,sep='\t')

# mitch
m3 <- mitch_import(dge3, DEtype="deseq2",geneTable=gt)
## The input is a single dataframe; one contrast only. Converting
##         it to a list for you.
## Note: Mean no. genes in input = 16536
## Note: no. genes in output = 16514
## Note: estimated proportion of input genes in output = 0.999
mres3 <- mitch_calc(m3, genesets, priority="effect")
## Note: Enrichments with large effect sizes may not be
##             statistically significant.
head(mres3$enrichment_result,20) %>%
  kbl(caption = "Top gene pathway differences between intact (ctrl) and torn (case) tendon.") %>%
  kable_paper("hover", full_width = F)
Top gene pathway differences between intact (ctrl) and torn (case) tendon.
set setSize pANOVA s.dist p.adjustANOVA
206 Cohesin Loading onto Chromatin 10 1.15e-05 -0.8011512 0.0001067
424 Formation of the ternary complex, and subsequently, the 43S complex 51 0.00e+00 -0.7765875 0.0000000
416 Formation of a pool of free 40S subunits 100 0.00e+00 -0.7415316 0.0000000
1093 SARS-CoV-1 modulates host translation machinery 36 0.00e+00 -0.7333583 0.0000000
1086 Ribosomal scanning and start codon recognition 58 0.00e+00 -0.7279035 0.0000000
1416 Viral mRNA Translation 88 0.00e+00 -0.7252485 0.0000000
848 Peptide chain elongation 88 0.00e+00 -0.7213675 0.0000000
461 GTP hydrolysis and joining of the 60S ribosomal subunit 111 0.00e+00 -0.7199721 0.0000000
1369 Translation initiation complex formation 58 0.00e+00 -0.7160432 0.0000000
1138 Selenocysteine synthesis 92 0.00e+00 -0.7141361 0.0000000
621 L13a-mediated translational silencing of Ceruloplasmin expression 110 0.00e+00 -0.7133881 0.0000000
52 Activation of the mRNA upon binding of the cap-binding complex and eIFs, and subsequent binding to 43S 59 0.00e+00 -0.7112021 0.0000000
373 Eukaryotic Translation Termination 92 0.00e+00 -0.7103501 0.0000000
371 Eukaryotic Translation Elongation 93 0.00e+00 -0.7030815 0.0000000
368 Establishment of Sister Chromatid Cohesion 10 1.23e-04 -0.7011997 0.0008410
780 Nonsense Mediated Decay (NMD) independent of the Exon Junction Complex (EJC) 94 0.00e+00 -0.6945513 0.0000000
154 Cap-dependent Translation Initiation 118 0.00e+00 -0.6893703 0.0000000
372 Eukaryotic Translation Initiation 118 0.00e+00 -0.6893703 0.0000000
828 PINK1-PRKN Mediated Mitophagy 21 1.00e-07 -0.6784032 0.0000011
1079 Response of EIF2AK4 (GCN2) to amino acid deficiency 100 0.00e+00 -0.6691056 0.0000000
m3top <- subset(mres3$enrichment_result,p.adjustANOVA<0.05)
m3up <- subset(m3top,s.dist>0)$set
m3dn <- subset(m3top,s.dist<0)$set

if (! file.exists("tear_mitchres3.html") ) {
  mitch_report(mres3,outfile="tear_mitchres3.html",overwrite=FALSE)
}

DE4. tear (intact) vs tear (torn).

colnames(x4) == rownames(ss4)
##  [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [16] TRUE TRUE TRUE TRUE
x4f <- x4[which(rowMeans(x4)>10),]
dim(x4)
## [1] 60651    19
dim(x4f)
## [1] 16462    19
ss4$tissue <- factor(ss4$Tissue,levels=c("tendon","tear"))
ss4$integrity <- factor(ss4$Tendon_integrity_2_years_post.op)

dds <- DESeqDataSetFromMatrix(countData = x4f , colData = ss4, design = ~ Age + Sex + integrity )
## 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.
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,20) %>%
  kbl(caption = "Top gene expression differences between intact (ctrl) and torn (case) tear.") %>%
  kable_paper("hover", full_width = F)
Top gene expression differences between intact (ctrl) and torn (case) tear.
baseMean log2FoldChange lfcSE stat pvalue padj 1.3_S93 10.3_S102 11.3_S103 14.3_S106 15.3_S107 16.3_S108 17.3_S109 18.3_S110 19.3_S111 20.3_S112 21.3_S113 23.3_S115 3.3_S95 4.3_S96 5.3_S97 6.3_S98 7.3_S99 8.3_S100 9.3_S101
ENSG00000160808.11.MYL3 292.03470 5.640668 0.7882517 7.155922 0e+00 0.0000000 12.015251 5.040094 5.447762 4.602719 4.765705 5.348479 10.151130 5.039428 4.686916 5.584445 5.858599 5.369543 4.893233 5.470333 5.455282 5.824088 5.107987 4.749442 4.352538
ENSG00000154358.23.OBSCN 535.03337 4.291105 0.6509957 6.591602 0e+00 0.0000003 12.715101 6.278577 6.855044 6.537729 6.192394 8.402272 10.817667 6.855135 7.047653 6.223473 6.227622 6.777732 6.212417 6.673548 7.273327 7.700741 7.372039 5.956808 5.997233
ENSG00000130598.16.TNNI2 188.59511 5.274715 0.8063469 6.541496 0e+00 0.0000003 11.282418 5.353189 3.870466 5.461623 4.600731 5.560983 9.802406 5.241439 4.612155 4.578215 5.178233 5.054253 4.646470 4.682696 4.894613 4.922054 5.591792 5.229181 4.700957
ENSG00000108515.18.ENO3 426.53843 4.585168 0.7448044 6.156205 0e+00 0.0000030 12.572473 6.261282 5.747611 6.553861 6.065882 6.388926 10.349496 6.355950 5.767234 5.738964 6.227622 5.900326 5.755349 5.871079 6.094762 5.216327 6.282344 5.509201 5.740993
ENSG00000163126.15.ANKRD23 281.00240 4.723716 0.8017283 5.891916 0e+00 0.0000123 11.955352 5.040094 5.646383 5.267410 5.703239 6.007473 9.901292 5.826145 5.099072 4.912275 5.595665 6.028537 5.484306 5.232525 5.417251 4.739598 6.302268 4.687394 5.720663
ENSG00000164309.15.CMYA5 571.59174 4.506435 0.7758916 5.808073 0e+00 0.0000170 12.983189 6.393962 5.908083 5.497114 6.065882 6.724226 10.603104 7.168243 6.964710 5.167364 7.216138 7.007944 6.394160 6.135957 6.641707 6.081237 7.334429 5.060725 7.122765
ENSG00000036448.10.MYOM2 176.05466 5.574517 0.9765226 5.708539 0e+00 0.0000254 11.488184 4.375692 4.357373 4.334825 5.091668 4.704909 8.479627 4.368493 4.531013 4.033026 5.346580 5.264143 4.495288 4.608167 4.450246 4.217480 5.412364 4.749442 5.031172
ENSG00000185482.8.STAC3 239.25638 3.901258 0.6854444 5.691575 0e+00 0.0000254 11.702834 6.393962 5.478086 6.147056 4.972494 6.491167 9.202979 5.883791 5.193673 5.128558 6.451212 5.264143 5.980211 6.113895 5.813077 5.452487 5.591792 5.790366 6.495200
ENSG00000214872.8.SMTNL1 59.41365 5.106018 0.9334413 5.470101 0e+00 0.0000807 9.626334 4.375692 4.869442 4.221376 4.278829 4.159550 8.260970 4.368493 4.342185 3.868646 4.220404 4.837829 4.408910 4.225095 4.096129 4.000754 4.829174 4.055743 4.193812
ENSG00000165887.12.ANKRD2 70.68061 4.454290 0.8182982 5.443358 1e-07 0.0000844 9.858939 4.605613 4.265873 5.180258 4.278829 4.159550 8.380178 5.287039 3.467455 4.702193 4.084522 4.710819 4.713946 4.225095 4.450246 5.340015 4.232306 4.472996 4.277470
ENSG00000101306.11.MYLK2 70.38820 5.092071 0.9503123 5.358313 1e-07 0.0001233 9.931606 4.375692 5.095141 4.221376 4.132793 4.264141 8.260970 3.467455 3.467455 5.046878 4.220404 4.325823 3.894437 4.225095 5.112265 4.516848 4.094349 4.185524 5.100391
ENSG00000163157.15.TMOD4 70.37804 4.699162 0.8809796 5.334020 1e-07 0.0001292 10.054092 4.459244 4.035576 4.522187 5.146958 4.815391 7.669797 4.860623 4.441855 4.157969 4.675422 4.392411 4.573950 4.608167 4.349771 4.000754 5.004587 3.467455 4.651254
ENSG00000196218.13.RYR1 387.75695 3.931141 0.7446007 5.279528 1e-07 0.0001522 12.319139 6.500519 4.869442 6.537729 5.770913 6.477011 10.241977 6.975951 6.456296 4.758803 6.144280 6.102935 7.038689 5.997906 5.563009 7.255457 6.587491 6.487995 6.879343
ENSG00000163395.17.IGFN1 68.20521 5.131902 0.9726908 5.275985 1e-07 0.0001522 9.655233 4.671000 3.870466 4.433714 4.278829 4.159550 8.733481 4.250861 3.467455 4.033026 4.432486 4.876976 3.467455 4.438414 4.234462 4.922054 5.778761 4.550098 4.277470
ENSG00000072954.7.TMEM38A 66.01269 4.138900 0.8229364 5.029428 5e-07 0.0005294 9.861859 4.605613 4.918370 4.676928 4.506211 5.091861 7.552611 4.645852 5.439987 4.509528 4.520856 5.489914 4.312410 4.935983 4.349771 5.002966 4.890813 3.884867 4.994936
ENSG00000124701.6.APOBEC2 49.38139 4.486345 0.8978211 4.996925 6e-07 0.0005688 9.573879 4.375692 4.265873 3.467455 4.400404 4.159550 6.664095 4.645852 5.281360 4.353450 4.333715 5.178672 4.312410 4.608167 4.697205 4.834731 4.949151 4.055743 4.277470
ENSG00000156219.17.ART3 35.24470 5.530251 1.1079266 4.991532 6e-07 0.0005688 9.247553 4.175519 4.161064 3.906010 3.939985 4.034329 5.931348 4.368493 4.227819 3.868646 3.467455 4.392411 3.467455 3.908207 4.234462 4.634654 4.693868 3.467455 3.467455
ENSG00000078814.17.MYH7B 197.54998 3.277687 0.6585170 4.977376 6e-07 0.0005780 11.175604 5.245074 6.776412 5.779147 6.435626 6.965037 9.042489 6.594262 6.621182 6.080328 6.122631 6.353801 6.047549 5.574314 5.868859 6.856111 6.554860 4.807947 5.980461
ENSG00000259768.6.AC004943.2 372.17415 4.429451 0.8945773 4.951446 7e-07 0.0006258 5.607887 5.420368 5.507706 6.309092 5.516991 5.767493 5.473861 6.068129 5.238308 6.594197 6.673589 4.797190 7.365020 6.157671 8.352681 12.559802 5.890203 5.629012 5.657723
ENSG00000140986.8.RPL3L 88.55836 5.731181 1.1604278 4.938852 8e-07 0.0006343 10.410749 4.459244 4.357373 3.906010 5.033628 4.264141 8.089585 4.470947 4.756437 4.157969 3.467455 4.392411 3.467455 4.225095 4.450246 5.216327 4.829174 3.467455 4.352538
dge4 <- dge
write.table(dge4,file="tear4.tsv",quote=FALSE,sep='\t')

# mitch
m4 <- mitch_import(dge4, DEtype="deseq2",geneTable=gt)
## The input is a single dataframe; one contrast only. Converting
##         it to a list for you.
## Note: Mean no. genes in input = 16462
## Note: no. genes in output = 16438
## Note: estimated proportion of input genes in output = 0.999
mres4 <- mitch_calc(m4, genesets, priority="effect")
## Note: Enrichments with large effect sizes may not be
##             statistically significant.
head(mres4$enrichment_result,20) %>%
  kbl(caption = "Top gene pathway differences between intact (ctrl) and torn (case) tear.") %>%
  kable_paper("hover", full_width = F)
Top gene pathway differences between intact (ctrl) and torn (case) tear.
set setSize pANOVA s.dist p.adjustANOVA
405 Folding of actin by CCT/TriC 10 0.0002124 -0.6763331 0.0014929
367 Establishment of Sister Chromatid Cohesion 11 0.0002019 -0.6471220 0.0014326
1443 mitochondrial fatty acid beta-oxidation of saturated fatty acids 10 0.0004410 0.6417336 0.0030129
120 Biotin transport and metabolism 11 0.0010470 0.5706957 0.0066843
205 Cohesin Loading onto Chromatin 10 0.0019163 -0.5666423 0.0110302
481 Gluconeogenesis 29 0.0000002 0.5608634 0.0000018
187 Chk1/Chk2(Cds1) mediated inactivation of Cyclin B:Cdk1 complex 12 0.0008126 -0.5582309 0.0052333
1245 Somitogenesis 50 0.0000000 -0.5547327 0.0000000
1061 Regulation of ornithine decarboxylase (ODC) 48 0.0000000 -0.5545302 0.0000000
489 Glycogen breakdown (glycogenolysis) 14 0.0003853 0.5479438 0.0026568
1047 Regulation of activated PAK-2p34 by proteasome mediated degradation 48 0.0000000 -0.5474502 0.0000000
762 Negative regulation of NOTCH4 signaling 54 0.0000000 -0.5372360 0.0000000
1113 SLBP independent Processing of Histone Pre-mRNAs 10 0.0036516 -0.5308376 0.0187982
100 Autodegradation of the E3 ubiquitin ligase COP1 49 0.0000000 -0.5282525 0.0000000
1400 Ubiquitin-dependent degradation of Cyclin D 50 0.0000000 -0.5272126 0.0000000
1399 Ubiquitin Mediated Degradation of Phosphorylated Cdc25A 49 0.0000000 -0.5268180 0.0000000
1448 p53-Independent DNA Damage Response 49 0.0000000 -0.5268180 0.0000000
1449 p53-Independent G1/S DNA damage checkpoint 49 0.0000000 -0.5268180 0.0000000
460 GSK3B and BTRC:CUL1-mediated-degradation of NFE2L2 52 0.0000000 -0.5262771 0.0000000
1112 SLBP Dependent Processing of Replication-Dependent Histone Pre-mRNAs 11 0.0026876 -0.5226152 0.0145531
m4top <- subset(mres4$enrichment_result,p.adjustANOVA<0.05)
m4up <- subset(m4top,s.dist>0)$set
m4dn <- subset(m4top,s.dist<0)$set

if (! file.exists("tear_mitchres4.html") ) {
  mitch_report(mres4,outfile="tear_mitchres4.html",overwrite=FALSE)
}

Session information

For reproducibility.

sessionInfo()
## R version 4.3.2 (2023-10-31)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 22.04.4 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
## 
## locale:
##  [1] LC_CTYPE=en_AU.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_AU.UTF-8        LC_COLLATE=en_AU.UTF-8    
##  [5] LC_MONETARY=en_AU.UTF-8    LC_MESSAGES=en_AU.UTF-8   
##  [7] LC_PAPER=en_AU.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_AU.UTF-8 LC_IDENTIFICATION=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] pkgload_1.3.3               GGally_2.2.0               
##  [3] beeswarm_0.4.0              gtools_3.9.5               
##  [5] echarts4r_0.4.5             kableExtra_1.3.4           
##  [7] topconfects_1.18.0          limma_3.58.1               
##  [9] eulerr_7.0.0                mitch_1.14.0               
## [11] MASS_7.3-60                 fgsea_1.28.0               
## [13] gplots_3.1.3                DESeq2_1.42.0              
## [15] SummarizedExperiment_1.32.0 Biobase_2.62.0             
## [17] MatrixGenerics_1.14.0       matrixStats_1.2.0          
## [19] GenomicRanges_1.54.1        GenomeInfoDb_1.38.5        
## [21] IRanges_2.36.0              S4Vectors_0.40.2           
## [23] BiocGenerics_0.48.1         reshape2_1.4.4             
## [25] lubridate_1.9.3             forcats_1.0.0              
## [27] stringr_1.5.1               dplyr_1.1.4                
## [29] purrr_1.0.2                 readr_2.1.4                
## [31] tidyr_1.3.0                 tibble_3.2.1               
## [33] ggplot2_3.4.4               tidyverse_2.0.0            
## [35] zoo_1.8-12                  R.utils_2.12.3             
## [37] R.oo_1.25.0                 R.methodsS3_1.8.2          
## 
## loaded via a namespace (and not attached):
##  [1] bitops_1.0-7            gridExtra_2.3           rlang_1.1.2            
##  [4] magrittr_2.0.3          compiler_4.3.2          systemfonts_1.0.5      
##  [7] vctrs_0.6.5             rvest_1.0.3             pkgconfig_2.0.3        
## [10] crayon_1.5.2            fastmap_1.1.1           XVector_0.42.0         
## [13] ellipsis_0.3.2          labeling_0.4.3          caTools_1.18.2         
## [16] utf8_1.2.4              promises_1.2.1          rmarkdown_2.25         
## [19] tzdb_0.4.0              xfun_0.41               cachem_1.0.8           
## [22] zlibbioc_1.48.0         jsonlite_1.8.8          highr_0.10             
## [25] later_1.3.2             DelayedArray_0.28.0     BiocParallel_1.36.0    
## [28] parallel_4.3.2          R6_2.5.1                bslib_0.6.1            
## [31] stringi_1.8.3           RColorBrewer_1.1-3      jquerylib_0.1.4        
## [34] assertthat_0.2.1        Rcpp_1.0.11             knitr_1.45             
## [37] httpuv_1.6.13           Matrix_1.6-4            timechange_0.2.0       
## [40] tidyselect_1.2.0        yaml_2.3.8              rstudioapi_0.15.0      
## [43] abind_1.4-5             codetools_0.2-19        lattice_0.22-5         
## [46] plyr_1.8.9              shiny_1.8.0             withr_2.5.2            
## [49] evaluate_0.23           ggstats_0.5.1           xml2_1.3.6             
## [52] pillar_1.9.0            KernSmooth_2.23-22      generics_0.1.3         
## [55] RCurl_1.98-1.13         hms_1.1.3               munsell_0.5.0          
## [58] scales_1.3.0            xtable_1.8-4            glue_1.6.2             
## [61] tools_4.3.2             data.table_1.14.10      webshot_0.5.5          
## [64] locfit_1.5-9.8          fastmatch_1.1-4         cowplot_1.1.2          
## [67] grid_4.3.2              colorspace_2.1-0        GenomeInfoDbData_1.2.11
## [70] cli_3.6.2               fansi_1.0.6             viridisLite_0.4.2      
## [73] S4Arrays_1.2.0          svglite_2.1.3           gtable_0.3.4           
## [76] sass_0.4.8              digest_0.6.33           SparseArray_1.2.3      
## [79] farver_2.1.1            htmlwidgets_1.6.4       htmltools_0.5.7        
## [82] lifecycle_1.0.4         httr_1.4.7              statmod_1.5.0          
## [85] mime_0.12