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

Introduction

Predict gene expression profile in capsular tissue biopsies of patients undergoing rotator cuff repair (AD-CAB 3001 to AD-CAB 3026) using capsular tissue biopsies in patients undergoing shoulder replacement for primary OA (AD-CAB 4001-4020, ‘Yes’ column 10 ‘Primary OA’) or Rotator cuff arthropathy (AD-CAB 4001-4020, ‘Yes’ column 11 ‘Cuff arthropathy’)? (adjusting for age and sex also).

  • First step, do a PCA of these 3 groups (RCR, OA, RCA) and comparison expression profiles.
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

caps_rcr= capsule rotator cuff repair.

caps_oa= capsule of primary OA

caps_rca= capsule rotator cuff arthropathy

caps_all= includes all three above groups.

x <- readRDS("counts.rds")

ss <- read.table("samplesheets/pheno_data.tsv",header=TRUE)
head(ss,3)
##   Participant_ID Case Redcap_ID Tissue                    fastq pvt.pub Age Sex
## 1    AD-CAB_4001   OA        84   bone 4001-41B_R1_001.fastq.gz     pvt  69   F
## 2    AD-CAB_4002   OA        80   bone 4002-42B_R1_001.fastq.gz     pvt  59   M
## 3    AD-CAB_4003   OA        81   bone 4003-43B_R1_001.fastq.gz     pvt  74   F
##   Primary_OA Cuff_Arthropathy Prosthesis Affected_Side Height_cm Weight_kg BMI
## 1        Yes               No   Anatomic          Left       158        89  36
## 2        Yes               No   Anatomic          Left       182       106  32
## 3         No              Yes    Reverse         Right       153        87  37
##   ASA      Smoking Diabetes Hypercholesterolaemia Hypertension Thyroid CRP
## 1   2 Never_smoker       No                   Yes          Yes     Yes 2.9
## 2   1  Ever_smoker       No                   Yes           No      No 9.3
## 3   2  Ever_smoker       No                   Yes          Yes      No 6.9
##   Creat eGFR Urea Fast_Glucose hba1c Metabolic_Syndrome
## 1    66   82  5.2          5.7   6.1                Yes
## 2    69   90  4.3          6.2   5.4                Yes
## 3    77   66  5.0          5.4   5.4                Yes
##   Tendon_integrity_2_years_post.op ASES_2_years_post.op_Pain
## 1                             <NA>                        NA
## 2                             <NA>                        NA
## 3                             <NA>                        NA
##   ASES_2_years_post.op_ADL ASES_2_years_post.op_Total Oxford_Baseline
## 1                       NA                         NA              NA
## 2                       NA                         NA              NA
## 3                       NA                         NA              NA
##   Oxford_3_month Oxford_12_month Oxford_24_month QuickDASH_ QuickDASH_3_month
## 1             NA              NA              NA         NA                NA
## 2             NA              NA              NA         NA                NA
## 3             NA              NA              NA         NA                NA
##   QuickDASH_12_month QuickDASH_24_month EQ.5D.3L_Baseline EQ.5D.3L_3_month
## 1                 NA                 NA                NA               NA
## 2                 NA                 NA                NA               NA
## 3                 NA                 NA                NA               NA
##   EQ.5D.3L_12_month EQ.5D.3L_24_month EQVAS_Baseline EQVAS_3_month
## 1                NA                NA             NA            NA
## 2                NA                NA             NA            NA
## 3                NA                NA             NA            NA
##   EQVAS_12_month EQVAS_24_month
## 1             NA             NA
## 2             NA             NA
## 3             NA             NA
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 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 TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [121] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [136] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [151] TRUE TRUE TRUE 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

caps <- subset(ss,Tissue=="capsule")
head(caps,2)
##          Participant_ID Case Redcap_ID  Tissue                    fastq pvt.pub
## 4001.41C    AD-CAB_4001   OA        84 capsule 4001-41C_R1_001.fastq.gz     pvt
## 4002.42C    AD-CAB_4002   OA        80 capsule 4002-42C_R1_001.fastq.gz     pvt
##          Age Sex Primary_OA Cuff_Arthropathy Prosthesis Affected_Side Height_cm
## 4001.41C  69   F        Yes               No   Anatomic          Left       158
## 4002.42C  59   M        Yes               No   Anatomic          Left       182
##          Weight_kg BMI ASA      Smoking Diabetes Hypercholesterolaemia
## 4001.41C        89  36   2 Never_smoker       No                   Yes
## 4002.42C       106  32   1  Ever_smoker       No                   Yes
##          Hypertension Thyroid CRP Creat eGFR Urea Fast_Glucose hba1c
## 4001.41C          Yes     Yes 2.9    66   82  5.2          5.7   6.1
## 4002.42C           No      No 9.3    69   90  4.3          6.2   5.4
##          Metabolic_Syndrome Tendon_integrity_2_years_post.op
## 4001.41C                Yes                             <NA>
## 4002.42C                Yes                             <NA>
##          ASES_2_years_post.op_Pain ASES_2_years_post.op_ADL
## 4001.41C                        NA                       NA
## 4002.42C                        NA                       NA
##          ASES_2_years_post.op_Total Oxford_Baseline Oxford_3_month
## 4001.41C                         NA              NA             NA
## 4002.42C                         NA              NA             NA
##          Oxford_12_month Oxford_24_month QuickDASH_ QuickDASH_3_month
## 4001.41C              NA              NA         NA                NA
## 4002.42C              NA              NA         NA                NA
##          QuickDASH_12_month QuickDASH_24_month EQ.5D.3L_Baseline
## 4001.41C                 NA                 NA                NA
## 4002.42C                 NA                 NA                NA
##          EQ.5D.3L_3_month EQ.5D.3L_12_month EQ.5D.3L_24_month EQVAS_Baseline
## 4001.41C               NA                NA                NA             NA
## 4002.42C               NA                NA                NA             NA
##          EQVAS_3_month EQVAS_12_month EQVAS_24_month     data
## 4001.41C            NA             NA             NA 4001.41C
## 4002.42C            NA             NA             NA 4002.42C
dim(caps)
## [1] 72 49
caps_rcr <- caps[grep("_30",caps$Participant_ID),]
head(caps_rcr,3)
##         Participant_ID Case Redcap_ID  Tissue                        fastq
## 1.1_S41    AD-CAB_3001   RC        53 capsule 1-1_S41_L001_R1_001.fastq.gz
## 2.1_S42    AD-CAB_3002   RC        54 capsule 2-1_S42_L001_R1_001.fastq.gz
## 3.1_S43    AD-CAB_3003   RC        55 capsule 3-1_S43_L001_R1_001.fastq.gz
##         pvt.pub Age Sex Primary_OA Cuff_Arthropathy Prosthesis Affected_Side
## 1.1_S41    <NA>  67   M       <NA>             <NA>       <NA>          Left
## 2.1_S42    <NA>  58   M       <NA>             <NA>       <NA>         Right
## 3.1_S43    <NA>  56   M       <NA>             <NA>       <NA>          Left
##         Height_cm Weight_kg   BMI ASA      Smoking Diabetes
## 1.1_S41     177.8       120 37.90   2  Ever_smoker       No
## 2.1_S42     179.0        79 25.00   1 Never_smoker       No
## 3.1_S43     179.0        85 26.52   1 Never_smoker       No
##         Hypercholesterolaemia Hypertension Thyroid CRP Creat eGFR Urea
## 1.1_S41                   Yes          Yes      No 2.9    83   84  7.0
## 2.1_S42                    No           No      No 0.7    70   90  6.9
## 3.1_S43                   Yes         <NA>      No 2.9    72   90  4.3
##         Fast_Glucose hba1c Metabolic_Syndrome Tendon_integrity_2_years_post.op
## 1.1_S41          5.2   5.6                Yes                             Torn
## 2.1_S42          5.4   5.3                 No                             Torn
## 3.1_S43          5.2   5.4                 No                           Intact
##         ASES_2_years_post.op_Pain ASES_2_years_post.op_ADL
## 1.1_S41                        NA                       NA
## 2.1_S42                        NA                       NA
## 3.1_S43                        50                       50
##         ASES_2_years_post.op_Total Oxford_Baseline Oxford_3_month
## 1.1_S41                         NA              25             41
## 2.1_S42                         NA              33             NA
## 3.1_S43                        100              38             38
##         Oxford_12_month Oxford_24_month QuickDASH_ QuickDASH_3_month
## 1.1_S41              46              NA       38.6              13.6
## 2.1_S42              48              NA       29.5                NA
## 3.1_S43              44              48       29.5              27.3
##         QuickDASH_12_month QuickDASH_24_month EQ.5D.3L_Baseline
## 1.1_S41               13.6                 NA             11222
## 2.1_S42                0.0                 NA             11111
## 3.1_S43                9.1                  0             11221
##         EQ.5D.3L_3_month EQ.5D.3L_12_month EQ.5D.3L_24_month EQVAS_Baseline
## 1.1_S41            11123             21222                NA             90
## 2.1_S42               NA             11111                NA             90
## 3.1_S43            11121             11111             22222             80
##         EQVAS_3_month EQVAS_12_month EQVAS_24_month    data
## 1.1_S41            50             60             NA 1.1_S41
## 2.1_S42            NA             90             NA 2.1_S42
## 3.1_S43            70             80             60 3.1_S43
dim(caps_rcr)
## [1] 26 49
caps_rcr$group="rcr"
caps_rcr %>% kbl(caption = "Capsule samples of rotator cuff repair group") %>% kable_paper("hover", full_width = F)
Capsule samples of rotator cuff repair 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 group
1.1_S41 AD-CAB_3001 RC 53 capsule 1-1_S41_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.1_S41 rcr
2.1_S42 AD-CAB_3002 RC 54 capsule 2-1_S42_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.1_S42 rcr
3.1_S43 AD-CAB_3003 RC 55 capsule 3-1_S43_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.1_S43 rcr
4.1_S44 AD-CAB_3004 RC 56 capsule 4-1_S44_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.1_S44 rcr
5.1_S45 AD-CAB_3005 RC 57 capsule 5-1_S45_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.1_S45 rcr
6.1_S46 AD-CAB_3006 RC 58 capsule 6-1_S46_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.1_S46 rcr
7.1_S47 AD-CAB_3007 RC 59 capsule 7-1_S47_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.1_S47 rcr
8.1_S48 AD-CAB_3008 RC 60 capsule 8-1_S48_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.1_S48 rcr
9.1_S49 AD-CAB_3009 RC 61 capsule 9-1_S49_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.1_S49 rcr
10.1_S50 AD-CAB_3010 RC 62 capsule 10-1_S50_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.1_S50 rcr
11.1_S51 AD-CAB_3011 RC 63 capsule 11-1_S51_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.1_S51 rcr
12.1_S52 AD-CAB_3012 RC 64 capsule 12-1_S52_L001_R1_001.fastq.gz NA 72 M NA NA NA Left 173.00 87 29.00 3 Never_smoker Yes Yes Yes No 2.9 108 59 4.8 6.1 6.6 No NA 50 48 98 29 32 48 42 68.2 0.0 4.5 18.2 12221 11111 11111 11111 70 90 80 90 12.1_S52 rcr
13.1_S53 AD-CAB_3013 RC 65 capsule 13-1_S53_L001_R1_001.fastq.gz NA 68 F NA NA NA Right 161.00 104 40.00 3 Never_smoker Yes No Yes No 6.3 64 86 6.8 9.2 7.1 Yes NA 45 45 90 19 34 48 46 75.0 50.0 6.8 2.3 11222 11221 22221 21231 89 78 50 50 13.1_S53 rcr
14.1_S54 AD-CAB_3014 RC 66 capsule 14-1_S54_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.1_S54 rcr
15.1_S55 AD-CAB_3015 RC 69 capsule 15-1_S55_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.1_S55 rcr
16.1_S56 AD-CAB_3016 RC 71 capsule 16-1_S56_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.1_S56 rcr
17.1_S57 AD-CAB_3017 RC 70 capsule 17-1_S57_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.1_S57 rcr
18.1_S58 AD-CAB_3018 RC 72 capsule 18-1_S58_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.1_S58 rcr
19.1_S59 AD-CAB_3019 RC 73 capsule 19-1_S59_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.1_S59 rcr
20.1_S60 AD-CAB_3020 RC 67 capsule 20-1_S60_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.1_S60 rcr
21.1_S61 AD-CAB_3021 RC 68 capsule 21-1_S61_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.1_S61 rcr
22.1_S62 AD-CAB_3022 RC 74 capsule 22-1_S62_L001_R1_001.fastq.gz NA 39 F NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 25 NA NA NA 47.7 NA NA NA 12222 NA NA NA 30 NA NA NA 22.1_S62 rcr
23.1_S63 AD-CAB_3023 RC 75 capsule 23-1_S63_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.1_S63 rcr
24.1_S64 AD-CAB_3024 RC 76 capsule 24-1_S64_L001_R1_001.fastq.gz NA 52 F NA NA NA Right 153.00 70 28.00 2 Never_smoker No Yes Yes Yes 3.0 64 57 7.8 5.6 6.4 No NA NA NA NA 26 23 NA NA 56.8 45.5 NA NA 12222 12221 NA NA 30 60 NA NA 24.1_S64 rcr
25.1_S65 AD-CAB_3025 RC 77 capsule 25-1_S65_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.1_S65 rcr
26.1_S66 AD-CAB_3026 RC 79 capsule 26-1_S66_L001_R1_001.fastq.gz NA 59 M NA NA NA Right 176.00 104 33.70 2 Ever_smoker No Yes Yes No 2.9 62 57 4.2 3.6 5.3 Yes NA NA NA NA 30 42 44 NA 38.6 25.0 22.7 NA 12222 11222 11221 NA 70 90 90 NA 26.1_S66 rcr
caps_oa <- subset(caps,Primary_OA=="Yes")
head(caps_oa,3)
##          Participant_ID Case Redcap_ID  Tissue                    fastq pvt.pub
## 4001.41C    AD-CAB_4001   OA        84 capsule 4001-41C_R1_001.fastq.gz     pvt
## 4002.42C    AD-CAB_4002   OA        80 capsule 4002-42C_R1_001.fastq.gz     pvt
## 4004.44C    AD-CAB_4004   OA        82 capsule 4004-44C_R1_001.fastq.gz     pvt
##          Age Sex Primary_OA Cuff_Arthropathy Prosthesis Affected_Side Height_cm
## 4001.41C  69   F        Yes               No   Anatomic          Left       158
## 4002.42C  59   M        Yes               No   Anatomic          Left       182
## 4004.44C  69   F        Yes               No   Anatomic          Left       165
##          Weight_kg BMI ASA      Smoking Diabetes Hypercholesterolaemia
## 4001.41C        89  36   2 Never_smoker       No                   Yes
## 4002.42C       106  32   1  Ever_smoker       No                   Yes
## 4004.44C        85  32   2 Never_smoker       No                   Yes
##          Hypertension Thyroid CRP Creat eGFR Urea Fast_Glucose hba1c
## 4001.41C          Yes     Yes 2.9    66   82  5.2          5.7   6.1
## 4002.42C           No      No 9.3    69   90  4.3          6.2   5.4
## 4004.44C          Yes     Yes 3.9    61   89  5.8          5.8   5.6
##          Metabolic_Syndrome Tendon_integrity_2_years_post.op
## 4001.41C                Yes                             <NA>
## 4002.42C                Yes                             <NA>
## 4004.44C                Yes                             <NA>
##          ASES_2_years_post.op_Pain ASES_2_years_post.op_ADL
## 4001.41C                        NA                       NA
## 4002.42C                        NA                       NA
## 4004.44C                        NA                       NA
##          ASES_2_years_post.op_Total Oxford_Baseline Oxford_3_month
## 4001.41C                         NA              NA             NA
## 4002.42C                         NA              NA             NA
## 4004.44C                         NA              NA             NA
##          Oxford_12_month Oxford_24_month QuickDASH_ QuickDASH_3_month
## 4001.41C              NA              NA         NA                NA
## 4002.42C              NA              NA         NA                NA
## 4004.44C              NA              NA         NA                NA
##          QuickDASH_12_month QuickDASH_24_month EQ.5D.3L_Baseline
## 4001.41C                 NA                 NA                NA
## 4002.42C                 NA                 NA                NA
## 4004.44C                 NA                 NA                NA
##          EQ.5D.3L_3_month EQ.5D.3L_12_month EQ.5D.3L_24_month EQVAS_Baseline
## 4001.41C               NA                NA                NA             NA
## 4002.42C               NA                NA                NA             NA
## 4004.44C               NA                NA                NA             NA
##          EQVAS_3_month EQVAS_12_month EQVAS_24_month     data
## 4001.41C            NA             NA             NA 4001.41C
## 4002.42C            NA             NA             NA 4002.42C
## 4004.44C            NA             NA             NA 4004.44C
dim(caps_oa)
## [1] 16 49
caps_oa$group="oa"
caps_oa %>% kbl(caption = "Capsule samples of primary OA group") %>% kable_paper("hover", full_width = F)
Capsule samples of primary OA 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 group
4001.41C AD-CAB_4001 OA 84 capsule 4001-41C_R1_001.fastq.gz pvt 69 F Yes No Anatomic Left 158 89 36 2 Never_smoker No Yes Yes Yes 2.9 66 82 5.2 5.7 6.1 Yes NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 4001.41C oa
4002.42C AD-CAB_4002 OA 80 capsule 4002-42C_R1_001.fastq.gz pvt 59 M Yes No Anatomic Left 182 106 32 1 Ever_smoker No Yes No No 9.3 69 90 4.3 6.2 5.4 Yes NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 4002.42C oa
4004.44C AD-CAB_4004 OA 82 capsule 4004-44C_R1_001.fastq.gz pvt 69 F Yes No Anatomic Left 165 85 32 2 Never_smoker No Yes Yes Yes 3.9 61 89 5.8 5.8 5.6 Yes NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 4004.44C oa
4005.45C AD-CAB_4005 OA 83 capsule 4005-45C_R1_001.fastq.gz pvt 74 F Yes No Anatomic Left 169 75 26 2 Ever_smoker No Yes Yes No 2.9 90 72 6.6 5.2 5.7 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 4005.45C oa
4006.46C AD-CAB_4006 OA 78 capsule 4006-46C_R1_001.fastq.gz pvt 81 F Yes No Anatomic Right 150 54 24 3 Never_smoker No Yes Yes No 2.9 105 43 10.5 5.6 6.0 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 4006.46C oa
7C_S32 AD-CAB_4007 OA 85 capsule 7C_S32_L001_R1_001.fastq.gz pvt 72 M Yes No Anatomic Right 184 118 35 2 Ever_smoker No Yes Yes No 12.7 66 90 5.8 5.6 5.6 Yes NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 7C_S32 oa
8C_S33 AD-CAB_4008 OA 86 capsule 8C_S33_L001_R1_001.fastq.gz pub 70 M Yes No Anatomic Right 172 86 29 2 Never_smoker No No Yes No 2.9 103 64 7.9 5.6 5.6 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 8C_S33 oa
11C_S36 AD-CAB_4011 OA 87 capsule 11C_S36_L001_R1_001.fastq.gz pub 76 M Yes No Reverse Right 180 92 28 2 Never_smoker No Yes Yes No 4.0 75 85 7.0 6.0 6.0 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 11C_S36 oa
12C_S37 AD-CAB_4012 OA 91 capsule 12C_S37_L001_R1_001.fastq.gz pub 71 F Yes No Anatomic Right 163 83 31 2 Never_smoker No Yes Yes No 2.9 73 72 4.8 6.3 5.7 Yes NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 12C_S37 oa
14C_S39 AD-CAB_4014 OA 92 capsule 14C_S39_L001_R1_001.fastq.gz pvt 71 M Yes No Reverse Right 170 99 34 2 Ever_smoker No Yes No Yes 2.9 69 90 7.0 7.0 7.1 Yes NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 14C_S39 oa
15C_S40 AD-CAB_4015 OA 93 capsule 15C_S40_L001_R1_001.fastq.gz pvt 76 M Yes No Anatomic Left 183 95 28 2 Ever_smoker No Yes Yes No 5.6 90 71 6.6 5.5 5.0 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 15C_S40 oa
16C_S41 AD-CAB_4016 OA 99 capsule 16C_S41_L001_R1_001.fastq.gz pvt 76 F Yes No Anatomic Left 167 54 19 3 Ever_smoker No No No Yes 2.9 60 86 11.0 4.7 5.3 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 16C_S41 oa
17C_S42 AD-CAB_4017 OA 96 capsule 17C_S42_L001_R1_001.fastq.gz pvt 79 F Yes No Reverse Right 155 75 31 2 Never_smoker No No No No 9.2 71 70 4.5 5.5 5.1 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 17C_S42 oa
18C_S43 AD-CAB_4018 OA 97 capsule 18C_S43_L001_R1_001.fastq.gz pvt 73 F Yes No Anatomic Right 167 85 30 3 Ever_smoker No Yes No No 1.5 78 65 7.3 5.4 5.9 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 18C_S43 oa
19C_S44 AD-CAB_4019 OA 95 capsule 19C_S44_L001_R1_001.fastq.gz pvt 65 F Yes No Anatomic Left 170 62 21 2 Never_smoker No No Yes No 2.9 103 49 11.0 5.3 5.2 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 19C_S44 oa
20C_S45 AD-CAB_4020 OA 98 capsule 20C_S45_L001_R1_001.fastq.gz pvt 62 M Yes No Anatomic Left 180 117 36 2 Never_smoker No Yes No No 2.9 80 90 4.9 6.9 5.9 Yes NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 20C_S45 oa
caps_rca <- subset(caps,Cuff_Arthropathy=="Yes")
head(caps_rca,3)
##          Participant_ID Case Redcap_ID  Tissue                        fastq
## 4003.43C    AD-CAB_4003   OA        81 capsule     4003-43C_R1_001.fastq.gz
## 9C_S34      AD-CAB_4009   OA        88 capsule  9C_S34_L001_R1_001.fastq.gz
## 10C_S35     AD-CAB_4010   OA        90 capsule 10C_S35_L001_R1_001.fastq.gz
##          pvt.pub Age Sex Primary_OA Cuff_Arthropathy Prosthesis Affected_Side
## 4003.43C     pvt  74   F         No              Yes    Reverse         Right
## 9C_S34       pvt  72   M         No              Yes    Reverse         Right
## 10C_S35      pvt  80   F         No              Yes    Reverse          Left
##          Height_cm Weight_kg BMI ASA      Smoking Diabetes
## 4003.43C       153        87  37   2  Ever_smoker       No
## 9C_S34         167        80  29   3  Ever_smoker       No
## 10C_S35        161        72  28   2 Never_smoker       No
##          Hypercholesterolaemia Hypertension Thyroid  CRP Creat eGFR Urea
## 4003.43C                   Yes          Yes      No  6.9    77   66  5.0
## 9C_S34                     Yes          Yes      No  2.9   107   59  6.7
## 10C_S35                    Yes           No     Yes 11.2    54   86  8.5
##          Fast_Glucose hba1c Metabolic_Syndrome Tendon_integrity_2_years_post.op
## 4003.43C          5.4   5.4                Yes                             <NA>
## 9C_S34            5.8   5.5                 No                             <NA>
## 10C_S35           7.3   5.6                 No                             <NA>
##          ASES_2_years_post.op_Pain ASES_2_years_post.op_ADL
## 4003.43C                        NA                       NA
## 9C_S34                          NA                       NA
## 10C_S35                         NA                       NA
##          ASES_2_years_post.op_Total Oxford_Baseline Oxford_3_month
## 4003.43C                         NA              NA             NA
## 9C_S34                           NA              NA             NA
## 10C_S35                          NA              NA             NA
##          Oxford_12_month Oxford_24_month QuickDASH_ QuickDASH_3_month
## 4003.43C              NA              NA         NA                NA
## 9C_S34                NA              NA         NA                NA
## 10C_S35               NA              NA         NA                NA
##          QuickDASH_12_month QuickDASH_24_month EQ.5D.3L_Baseline
## 4003.43C                 NA                 NA                NA
## 9C_S34                   NA                 NA                NA
## 10C_S35                  NA                 NA                NA
##          EQ.5D.3L_3_month EQ.5D.3L_12_month EQ.5D.3L_24_month EQVAS_Baseline
## 4003.43C               NA                NA                NA             NA
## 9C_S34                 NA                NA                NA             NA
## 10C_S35                NA                NA                NA             NA
##          EQVAS_3_month EQVAS_12_month EQVAS_24_month     data
## 4003.43C            NA             NA             NA 4003.43C
## 9C_S34              NA             NA             NA   9C_S34
## 10C_S35             NA             NA             NA  10C_S35
dim(caps_rca)
## [1]  4 49
caps_rca$group="rca"
caps_rca %>% kbl(caption = "Capsule samples of rotator cuff arthropathy group") %>% kable_paper("hover", full_width = F)
Capsule samples of rotator cuff arthropathy 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 group
4003.43C AD-CAB_4003 OA 81 capsule 4003-43C_R1_001.fastq.gz pvt 74 F No Yes Reverse Right 153 87 37 2 Ever_smoker No Yes Yes No 6.9 77 66 5.0 5.4 5.4 Yes NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 4003.43C rca
9C_S34 AD-CAB_4009 OA 88 capsule 9C_S34_L001_R1_001.fastq.gz pvt 72 M No Yes Reverse Right 167 80 29 3 Ever_smoker No Yes Yes No 2.9 107 59 6.7 5.8 5.5 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 9C_S34 rca
10C_S35 AD-CAB_4010 OA 90 capsule 10C_S35_L001_R1_001.fastq.gz pvt 80 F No Yes Reverse Left 161 72 28 2 Never_smoker No Yes No Yes 11.2 54 86 8.5 7.3 5.6 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 10C_S35 rca
13C_S38 AD-CAB_4013 OA 89 capsule 13C_S38_L001_R1_001.fastq.gz pvt 69 F No Yes Reverse Left 170 89 31 2 Never_smoker No Yes Yes No 2.9 81 85 5.1 5.4 5.9 Yes NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 13C_S38 rca
caps_all <- rbind(caps_rcr,caps_oa,caps_rca)

xcaps <- x[,which(colnames(x) %in% rownames(caps_all) )]

dim(xcaps)
## [1] 60651    46
dim(caps_all) # matches OK
## [1] 46 50
caps_all %>% kbl(caption = "Capsule samples") %>% kable_paper("hover", full_width = F)
Capsule 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 group
1.1_S41 AD-CAB_3001 RC 53 capsule 1-1_S41_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.1_S41 rcr
2.1_S42 AD-CAB_3002 RC 54 capsule 2-1_S42_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.1_S42 rcr
3.1_S43 AD-CAB_3003 RC 55 capsule 3-1_S43_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.1_S43 rcr
4.1_S44 AD-CAB_3004 RC 56 capsule 4-1_S44_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.1_S44 rcr
5.1_S45 AD-CAB_3005 RC 57 capsule 5-1_S45_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.1_S45 rcr
6.1_S46 AD-CAB_3006 RC 58 capsule 6-1_S46_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.1_S46 rcr
7.1_S47 AD-CAB_3007 RC 59 capsule 7-1_S47_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.1_S47 rcr
8.1_S48 AD-CAB_3008 RC 60 capsule 8-1_S48_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.1_S48 rcr
9.1_S49 AD-CAB_3009 RC 61 capsule 9-1_S49_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.1_S49 rcr
10.1_S50 AD-CAB_3010 RC 62 capsule 10-1_S50_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.1_S50 rcr
11.1_S51 AD-CAB_3011 RC 63 capsule 11-1_S51_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.1_S51 rcr
12.1_S52 AD-CAB_3012 RC 64 capsule 12-1_S52_L001_R1_001.fastq.gz NA 72 M NA NA NA Left 173.00 87 29.00 3 Never_smoker Yes Yes Yes No 2.9 108 59 4.8 6.1 6.6 No NA 50 48 98 29 32 48 42 68.2 0.0 4.5 18.2 12221 11111 11111 11111 70 90 80 90 12.1_S52 rcr
13.1_S53 AD-CAB_3013 RC 65 capsule 13-1_S53_L001_R1_001.fastq.gz NA 68 F NA NA NA Right 161.00 104 40.00 3 Never_smoker Yes No Yes No 6.3 64 86 6.8 9.2 7.1 Yes NA 45 45 90 19 34 48 46 75.0 50.0 6.8 2.3 11222 11221 22221 21231 89 78 50 50 13.1_S53 rcr
14.1_S54 AD-CAB_3014 RC 66 capsule 14-1_S54_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.1_S54 rcr
15.1_S55 AD-CAB_3015 RC 69 capsule 15-1_S55_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.1_S55 rcr
16.1_S56 AD-CAB_3016 RC 71 capsule 16-1_S56_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.1_S56 rcr
17.1_S57 AD-CAB_3017 RC 70 capsule 17-1_S57_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.1_S57 rcr
18.1_S58 AD-CAB_3018 RC 72 capsule 18-1_S58_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.1_S58 rcr
19.1_S59 AD-CAB_3019 RC 73 capsule 19-1_S59_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.1_S59 rcr
20.1_S60 AD-CAB_3020 RC 67 capsule 20-1_S60_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.1_S60 rcr
21.1_S61 AD-CAB_3021 RC 68 capsule 21-1_S61_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.1_S61 rcr
22.1_S62 AD-CAB_3022 RC 74 capsule 22-1_S62_L001_R1_001.fastq.gz NA 39 F NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 25 NA NA NA 47.7 NA NA NA 12222 NA NA NA 30 NA NA NA 22.1_S62 rcr
23.1_S63 AD-CAB_3023 RC 75 capsule 23-1_S63_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.1_S63 rcr
24.1_S64 AD-CAB_3024 RC 76 capsule 24-1_S64_L001_R1_001.fastq.gz NA 52 F NA NA NA Right 153.00 70 28.00 2 Never_smoker No Yes Yes Yes 3.0 64 57 7.8 5.6 6.4 No NA NA NA NA 26 23 NA NA 56.8 45.5 NA NA 12222 12221 NA NA 30 60 NA NA 24.1_S64 rcr
25.1_S65 AD-CAB_3025 RC 77 capsule 25-1_S65_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.1_S65 rcr
26.1_S66 AD-CAB_3026 RC 79 capsule 26-1_S66_L001_R1_001.fastq.gz NA 59 M NA NA NA Right 176.00 104 33.70 2 Ever_smoker No Yes Yes No 2.9 62 57 4.2 3.6 5.3 Yes NA NA NA NA 30 42 44 NA 38.6 25.0 22.7 NA 12222 11222 11221 NA 70 90 90 NA 26.1_S66 rcr
4001.41C AD-CAB_4001 OA 84 capsule 4001-41C_R1_001.fastq.gz pvt 69 F Yes No Anatomic Left 158.00 89 36.00 2 Never_smoker No Yes Yes Yes 2.9 66 82 5.2 5.7 6.1 Yes NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 4001.41C oa
4002.42C AD-CAB_4002 OA 80 capsule 4002-42C_R1_001.fastq.gz pvt 59 M Yes No Anatomic Left 182.00 106 32.00 1 Ever_smoker No Yes No No 9.3 69 90 4.3 6.2 5.4 Yes NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 4002.42C oa
4004.44C AD-CAB_4004 OA 82 capsule 4004-44C_R1_001.fastq.gz pvt 69 F Yes No Anatomic Left 165.00 85 32.00 2 Never_smoker No Yes Yes Yes 3.9 61 89 5.8 5.8 5.6 Yes NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 4004.44C oa
4005.45C AD-CAB_4005 OA 83 capsule 4005-45C_R1_001.fastq.gz pvt 74 F Yes No Anatomic Left 169.00 75 26.00 2 Ever_smoker No Yes Yes No 2.9 90 72 6.6 5.2 5.7 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 4005.45C oa
4006.46C AD-CAB_4006 OA 78 capsule 4006-46C_R1_001.fastq.gz pvt 81 F Yes No Anatomic Right 150.00 54 24.00 3 Never_smoker No Yes Yes No 2.9 105 43 10.5 5.6 6.0 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 4006.46C oa
7C_S32 AD-CAB_4007 OA 85 capsule 7C_S32_L001_R1_001.fastq.gz pvt 72 M Yes No Anatomic Right 184.00 118 35.00 2 Ever_smoker No Yes Yes No 12.7 66 90 5.8 5.6 5.6 Yes NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 7C_S32 oa
8C_S33 AD-CAB_4008 OA 86 capsule 8C_S33_L001_R1_001.fastq.gz pub 70 M Yes No Anatomic Right 172.00 86 29.00 2 Never_smoker No No Yes No 2.9 103 64 7.9 5.6 5.6 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 8C_S33 oa
11C_S36 AD-CAB_4011 OA 87 capsule 11C_S36_L001_R1_001.fastq.gz pub 76 M Yes No Reverse Right 180.00 92 28.00 2 Never_smoker No Yes Yes No 4.0 75 85 7.0 6.0 6.0 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 11C_S36 oa
12C_S37 AD-CAB_4012 OA 91 capsule 12C_S37_L001_R1_001.fastq.gz pub 71 F Yes No Anatomic Right 163.00 83 31.00 2 Never_smoker No Yes Yes No 2.9 73 72 4.8 6.3 5.7 Yes NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 12C_S37 oa
14C_S39 AD-CAB_4014 OA 92 capsule 14C_S39_L001_R1_001.fastq.gz pvt 71 M Yes No Reverse Right 170.00 99 34.00 2 Ever_smoker No Yes No Yes 2.9 69 90 7.0 7.0 7.1 Yes NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 14C_S39 oa
15C_S40 AD-CAB_4015 OA 93 capsule 15C_S40_L001_R1_001.fastq.gz pvt 76 M Yes No Anatomic Left 183.00 95 28.00 2 Ever_smoker No Yes Yes No 5.6 90 71 6.6 5.5 5.0 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 15C_S40 oa
16C_S41 AD-CAB_4016 OA 99 capsule 16C_S41_L001_R1_001.fastq.gz pvt 76 F Yes No Anatomic Left 167.00 54 19.00 3 Ever_smoker No No No Yes 2.9 60 86 11.0 4.7 5.3 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 16C_S41 oa
17C_S42 AD-CAB_4017 OA 96 capsule 17C_S42_L001_R1_001.fastq.gz pvt 79 F Yes No Reverse Right 155.00 75 31.00 2 Never_smoker No No No No 9.2 71 70 4.5 5.5 5.1 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 17C_S42 oa
18C_S43 AD-CAB_4018 OA 97 capsule 18C_S43_L001_R1_001.fastq.gz pvt 73 F Yes No Anatomic Right 167.00 85 30.00 3 Ever_smoker No Yes No No 1.5 78 65 7.3 5.4 5.9 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 18C_S43 oa
19C_S44 AD-CAB_4019 OA 95 capsule 19C_S44_L001_R1_001.fastq.gz pvt 65 F Yes No Anatomic Left 170.00 62 21.00 2 Never_smoker No No Yes No 2.9 103 49 11.0 5.3 5.2 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 19C_S44 oa
20C_S45 AD-CAB_4020 OA 98 capsule 20C_S45_L001_R1_001.fastq.gz pvt 62 M Yes No Anatomic Left 180.00 117 36.00 2 Never_smoker No Yes No No 2.9 80 90 4.9 6.9 5.9 Yes NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 20C_S45 oa
4003.43C AD-CAB_4003 OA 81 capsule 4003-43C_R1_001.fastq.gz pvt 74 F No Yes Reverse Right 153.00 87 37.00 2 Ever_smoker No Yes Yes No 6.9 77 66 5.0 5.4 5.4 Yes NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 4003.43C rca
9C_S34 AD-CAB_4009 OA 88 capsule 9C_S34_L001_R1_001.fastq.gz pvt 72 M No Yes Reverse Right 167.00 80 29.00 3 Ever_smoker No Yes Yes No 2.9 107 59 6.7 5.8 5.5 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 9C_S34 rca
10C_S35 AD-CAB_4010 OA 90 capsule 10C_S35_L001_R1_001.fastq.gz pvt 80 F No Yes Reverse Left 161.00 72 28.00 2 Never_smoker No Yes No Yes 11.2 54 86 8.5 7.3 5.6 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 10C_S35 rca
13C_S38 AD-CAB_4013 OA 89 capsule 13C_S38_L001_R1_001.fastq.gz pvt 69 F No Yes Reverse Left 170.00 89 31.00 2 Never_smoker No Yes Yes No 2.9 81 85 5.1 5.4 5.9 Yes NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 13C_S38 rca

QC analysis

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

par(mar=c(5,8,3,1))
barplot(colSums(xcaps),horiz=TRUE,las=1,xlab="Capsule reads")

sums <- colSums(xcaps)
sums <- sums[order(sums)]
barplot(sums,horiz=TRUE,las=1,xlab="Capsule reads")
abline(v=15000000,col="red")

MDS plot

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

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

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

rcr1 <- as.numeric(colnames(xcaps) %in% rownames(caps_rcr))*1
oa2 <- as.numeric(colnames(xcaps) %in% rownames(caps_oa))*2
rca3 <- as.numeric(colnames(xcaps) %in% rownames(caps_rca))*3

mycols <- gsub("3","gray",gsub("2","pink",gsub("1","lightblue",as.character(rcr1+oa2+rca3))))

plot(mds, xlab="Coordinate 1", ylab="Coordinate 2",
  type = "p",bty="n",pch=19, cex=4 ,col=mycols)
text(mds, labels=rownames(mds) )
mtext("RCR=lightblue, OA=pink, RCA=grey")

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)

Primary OA vs Rotator cuff arthropathy

ss1 <- rbind(caps_oa,caps_rca)
ss1 <- ss1[order(rownames(ss1)),]

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

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
x1f <- x1[which(rowMeans(x1)>10),]
dim(x1)
## [1] 60651    20
dim(x1f)
## [1] 17320    20
dds <- DESeqDataSetFromMatrix(countData = x1f , colData = ss1, design = ~ Age +Sex + Cuff_Arthropathy )
## 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 OA (ctrl) and Rotator cuff arthropathy (case)") %>%
  kable_paper("hover", full_width = F)
Top gene expression differences between OA (ctrl) and Rotator cuff arthropathy (case)
baseMean log2FoldChange lfcSE stat pvalue padj 10C_S35 11C_S36 12C_S37 13C_S38 14C_S39 15C_S40 16C_S41 17C_S42 18C_S43 19C_S44 20C_S45 4001.41C 4002.42C 4003.43C 4004.44C 4005.45C 4006.46C 7C_S32 8C_S33 9C_S34
ENSG00000237541.4.HLA.DQA2 260.110807 -5.7542931 1.1206766 -5.134660 0.0000003 0.0048956 4.886017 5.047695 8.701297 4.739816 9.447974 8.862121 6.666200 10.131204 7.439342 7.469456 6.966987 7.849253 7.647561 4.329657 7.306233 8.021589 4.550543 9.591056 9.642943 6.059449
ENSG00000133063.16.CHIT1 316.413226 5.7790813 1.1636789 4.966216 0.0000007 0.0059123 6.211761 7.704650 5.394606 5.464211 8.269533 6.024971 5.739692 6.356210 6.347096 5.571036 6.075669 4.948037 8.106576 12.385902 5.808181 5.111196 5.768824 5.440711 5.170406 5.202797
ENSG00000275464.5.FP565260.1 204.636968 -1.1807921 0.2449152 -4.821229 0.0000014 0.0082372 7.083534 7.330945 8.434623 6.950281 8.055274 7.734842 8.285886 8.426757 8.366033 7.842061 7.590137 8.409162 7.924618 7.152445 7.804173 7.704498 7.813557 8.285409 8.467569 7.304273
ENSG00000002745.13.WNT16 38.840675 4.2957828 0.9442171 4.549571 0.0000054 0.0232761 6.520765 4.329657 4.329657 9.383508 5.094109 4.329657 4.880711 4.689958 4.864712 5.302621 4.873308 4.688492 5.258311 5.354730 5.072126 5.990612 4.868113 4.688822 4.329657 5.202797
ENSG00000229391.7.HLA.DRB6 38.352617 -3.5605721 0.8021207 -4.438948 0.0000090 0.0313144 5.008993 4.839979 6.582845 4.329657 6.751347 6.484565 5.641965 7.149764 6.373227 6.063562 6.401728 6.163247 6.194656 4.735771 5.349321 6.615720 4.711501 6.931740 6.801082 5.415188
ENSG00000101198.15.NKAIN4 10.813567 -3.2944360 0.7653338 -4.304574 0.0000167 0.0482961 4.329657 5.840759 5.685480 4.739816 5.209055 5.467214 4.880711 5.268737 5.654565 5.401022 5.625241 5.571372 5.691091 4.587013 5.309242 5.719665 4.987255 5.541145 4.928301 4.906181
ENSG00000280411.1.IGHV1.69D 12.480475 -5.7748090 1.3582000 -4.251810 0.0000212 0.0524671 4.329657 4.329657 5.394606 4.739816 5.918871 4.680731 6.195769 5.905537 5.168638 4.985013 4.329657 4.792124 4.725299 4.329657 5.099518 6.719868 5.579444 6.146381 4.676930 4.329657
ENSG00000172602.11.RND1 46.190425 2.6005315 0.6213823 4.185075 0.0000285 0.0612747 8.630991 6.265003 5.726806 6.514488 6.580533 6.082192 6.130897 5.127215 5.788727 5.749688 6.744568 5.286273 5.930144 5.578762 5.604564 5.044521 5.200771 6.374027 5.633103 6.453955
ENSG00000205054.8.LINC01121 10.113086 2.0669291 0.4968712 4.159889 0.0000318 0.0612747 5.601000 5.596432 4.691803 6.243837 4.774432 4.824941 5.412854 5.044789 5.317017 5.248834 4.993563 5.012165 5.010736 5.453485 5.245327 5.008515 5.022175 5.124749 5.019296 6.059449
ENSG00000280071.4.GATD3B 468.236776 -0.7197878 0.1826198 -3.941456 0.0000810 0.1402719 9.220647 8.784552 9.303387 8.099893 8.948378 9.094952 9.566582 9.116585 9.269716 8.952068 8.731232 8.997821 9.052475 8.262399 8.885076 9.247737 8.929471 9.203230 9.007683 8.203705
ENSG00000211644.3.IGLV1.51 8.002484 -5.3084911 1.3556423 -3.915849 0.0000901 0.1418452 4.329657 4.329657 4.691803 4.329657 4.956221 4.329657 5.104369 5.389386 5.830020 5.248834 5.674673 4.537186 4.887453 4.511756 5.072126 6.189200 5.878898 5.386169 4.819604 4.329657
ENSG00000168010.11.ATG16L2 616.884160 -0.8038562 0.2070006 -3.883352 0.0001030 0.1450043 8.614326 9.094488 9.551476 8.286163 10.304948 9.572188 9.015437 9.280737 8.980726 9.345596 9.603424 9.364020 10.075704 8.858129 9.781076 9.522612 9.022952 9.332323 9.303665 8.691548
ENSG00000160221.18.GATD3A 82.778829 2.6174458 0.6763432 3.869996 0.0001088 0.1450043 5.926352 8.377775 5.979610 8.402775 6.419102 5.515178 5.641965 6.151497 5.082125 5.749688 6.427594 5.910968 5.723966 8.105793 5.731305 7.026018 5.838875 5.675012 5.885891 8.581185
ENSG00000103507.14.BCKDK 275.789567 -0.6994989 0.1850484 -3.780086 0.0001568 0.1939519 7.951191 8.554545 8.306499 7.645144 8.455838 8.068535 8.479004 8.468568 8.544727 8.006073 8.012512 8.585949 8.659730 7.804080 8.404579 8.936205 8.284902 8.170391 8.021933 7.861898
ENSG00000166233.15.ARIH1 389.566025 0.4240808 0.1133701 3.740676 0.0001835 0.2027201 9.183525 8.583597 8.450521 9.132993 8.837118 8.615369 8.701681 8.499144 8.384333 8.833378 8.741029 8.727771 8.681334 8.797936 8.780207 8.508204 8.758744 8.777735 8.573640 9.016163
ENSG00000105639.20.JAK3 216.338437 -0.9913523 0.2658921 -3.728402 0.0001927 0.2027201 6.706876 8.176070 7.389891 7.133563 8.965184 8.074988 7.289153 7.960700 8.175908 7.641284 8.136852 7.864931 8.498648 6.840915 8.205246 8.052215 8.330243 8.465532 7.884797 8.051943
ENSG00000228021.7.AL158835.1 31.291981 3.2610502 0.8765522 3.720315 0.0001990 0.2027201 7.209350 5.641254 4.953684 7.520695 7.448468 5.467214 5.412854 5.127215 5.554552 4.898414 6.841707 4.980944 4.653033 5.093787 4.949491 4.723993 5.117042 6.173822 5.296095 5.505013
ENSG00000211892.4.IGHG4 55.311071 -4.0385483 1.1007085 -3.669044 0.0002435 0.2342615 4.724274 4.329657 7.134466 5.804448 7.542032 4.680731 5.641965 8.197161 7.810251 5.531252 6.292706 6.899070 6.237144 4.873098 4.949491 7.290447 5.678375 6.277896 4.819604 4.329657
ENSG00000286647.1.AC008459.1 22.973302 2.7680012 0.7616661 3.634140 0.0002789 0.2542481 6.749609 5.204701 5.336118 7.280025 6.419102 5.646524 4.880711 5.331162 5.246227 5.489790 6.803685 4.792124 5.010736 5.208687 4.914533 4.837700 5.117042 5.999041 5.235711 5.315586
ENSG00000254415.3.SIGLEC14 28.581734 -2.1844359 0.6074907 -3.595834 0.0003234 0.2602930 5.545167 5.130441 6.521276 4.739816 7.202307 6.053922 6.062388 5.939228 5.654565 5.844182 5.181894 6.190270 5.674266 5.324392 5.526768 5.951872 5.852374 6.374027 6.484659 4.993925
dge1 <- dge
write.table(dge1,file="rc1.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 = 17320
## Note: no. genes in output = 17294
## Note: estimated proportion of input genes in output = 0.998
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 OA (ctrl) and Rotator cuff arthropathy (case)") %>%
  kable_paper("hover", full_width = F)
Top gene pathway differences between OA (ctrl) and Rotator cuff arthropathy (case)
set setSize pANOVA s.dist p.adjustANOVA
1107 SARS-CoV-1 modulates host translation machinery 36 0.00e+00 0.7525882 0.0000000
859 Peptide chain elongation 87 0.00e+00 0.7319562 0.0000000
373 Eukaryotic Translation Elongation 92 0.00e+00 0.7227762 0.0000000
202 Classical antibody-mediated complement activation 13 7.30e-06 -0.7183568 0.0002075
1435 Viral mRNA Translation 87 0.00e+00 0.7165976 0.0000000
1153 Selenocysteine synthesis 91 0.00e+00 0.6979264 0.0000000
418 Formation of a pool of free 40S subunits 99 0.00e+00 0.6967911 0.0000000
375 Eukaryotic Translation Termination 91 0.00e+00 0.6736475 0.0000000
789 Nonsense Mediated Decay (NMD) independent of the Exon Junction Complex (EJC) 93 0.00e+00 0.6644531 0.0000000
627 L13a-mediated translational silencing of Ceruloplasmin expression 109 0.00e+00 0.6547640 0.0000000
426 Formation of the ternary complex, and subsequently, the 43S complex 51 0.00e+00 0.6478002 0.0000000
1091 Response of EIF2AK4 (GCN2) to amino acid deficiency 99 0.00e+00 0.6435562 0.0000000
464 GTP hydrolysis and joining of the 60S ribosomal subunit 110 0.00e+00 0.6427755 0.0000000
385 FCGR activation 20 7.00e-07 -0.6394929 0.0000259
230 Creation of C4 and C2 activators 16 1.28e-05 -0.6300064 0.0003294
154 Cap-dependent Translation Initiation 117 0.00e+00 0.6027057 0.0000000
374 Eukaryotic Translation Initiation 117 0.00e+00 0.6027057 0.0000000
1113 SARS-CoV-2 modulates host translation machinery 49 0.00e+00 0.5997420 0.0000000
377 Expression and translocation of olfactory receptors 22 1.30e-06 0.5952145 0.0000452
1385 Translation initiation complex formation 58 0.00e+00 0.5895779 0.0000000
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("mitchres1.html") ) {
  mitch_report(mres1,outfile="mitchres1.html",overwrite=FALSE)
}

Primary OA vs Rotator cuff repair

ss2 <- rbind(caps_oa,caps_rcr)
ss2 <- ss2[order(rownames(ss2)),]

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

colnames(x2) == rownames(ss2)
##  [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
x2f <- x2[which(rowMeans(x2)>10),]
dim(x2)
## [1] 60651    42
dim(x2f)
## [1] 16705    42
dds <- DESeqDataSetFromMatrix(countData = x2f , colData = ss2, design = ~ Age +Sex + 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.
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 OA (ctrl) and Rotator cuff repair (case)") %>%
  kable_paper("hover", full_width = F)
Top gene expression differences between OA (ctrl) and Rotator cuff repair (case)
baseMean log2FoldChange lfcSE stat pvalue padj 1.1_S41 10.1_S50 11.1_S51 11C_S36 12.1_S52 12C_S37 13.1_S53 14.1_S54 14C_S39 15.1_S55 15C_S40 16.1_S56 16C_S41 17.1_S57 17C_S42 18.1_S58 18C_S43 19.1_S59 19C_S44 2.1_S42 20.1_S60 20C_S45 21.1_S61 22.1_S62 23.1_S63 24.1_S64 25.1_S65 26.1_S66 3.1_S43 4.1_S44 4001.41C 4002.42C 4004.44C 4005.45C 4006.46C 5.1_S45 6.1_S46 7.1_S47 7C_S32 8.1_S48 8C_S33 9.1_S49
ENSG00000244734.4.HBB 26408.94502 -8.2936234 0.6585287 -12.594171 0 0 7.730444 6.927829 11.621816 13.489814 7.219295 15.120179 7.548888 7.805550 18.527603 8.247311 7.144760 9.488205 18.464709 7.970497 13.440368 9.529654 13.383956 11.157503 14.585356 9.397367 8.401227 16.734362 9.037870 9.582985 7.858982 9.351362 8.654512 8.972151 8.134942 7.156709 10.927358 13.849817 15.250202 14.414646 11.926372 7.253820 8.745659 8.046384 14.991733 8.106168 15.297268 8.475798
ENSG00000206172.8.HBA1 10920.84090 -8.4039577 0.6789623 -12.377649 0 0 6.562396 6.509066 10.169887 12.471916 6.065446 13.898980 5.689224 6.627469 17.330149 7.628291 6.185332 8.356115 16.984877 6.615640 12.133089 8.709734 12.577189 10.210002 13.479130 8.280685 7.585887 15.762876 7.970713 8.295039 6.520014 8.213778 7.349010 7.716573 7.186652 6.436943 9.957020 12.254096 13.845039 13.226695 10.534764 6.141612 6.466155 6.464266 13.763317 7.413908 13.897577 7.286260
ENSG00000188536.13.HBA2 26063.87177 -8.2897130 0.6758775 -12.265112 0 0 6.928521 6.430872 11.280813 13.588013 7.293541 14.934003 7.274720 7.243443 18.513988 8.475975 6.810039 9.522945 18.256560 7.814664 13.475089 10.111754 13.531072 11.141565 14.607189 9.371972 8.672923 16.697968 9.060085 9.225316 7.435567 8.970028 7.941837 8.342638 7.719731 7.246738 11.338812 14.312059 16.160145 15.156067 12.091832 6.891973 7.900007 6.985447 14.770785 8.350251 15.005138 8.516101
ENSG00000174938.14.SEZ6L2 45.93974 -3.3486520 0.2747392 -12.188478 0 0 5.247585 4.996285 5.445648 8.170560 5.217043 7.528467 5.445101 5.246118 6.580348 5.559294 7.495945 5.551482 6.622243 5.172915 7.095451 5.491022 7.629733 4.998798 6.291728 5.200387 5.355622 6.391939 5.122106 4.891005 4.895681 5.169769 5.092211 5.270740 5.412091 5.180123 6.487020 7.107261 6.778602 7.709299 7.188658 4.998052 5.652699 5.665120 7.350030 5.106497 7.267883 5.351438
ENSG00000116741.8.RGS2 365.02624 -3.1699720 0.3208617 -9.879558 0 0 6.648952 6.546451 7.255122 10.494124 6.577132 9.325546 7.348473 7.123032 10.043022 6.761161 8.925678 7.125627 9.504432 7.801936 9.233823 7.406640 8.064719 6.922921 7.904148 6.614388 6.310196 9.073214 6.823259 6.557512 7.181198 8.785071 7.529591 7.353566 6.898714 7.284946 8.193371 11.275590 9.950858 9.866536 9.541740 6.863090 6.757606 6.800694 10.057074 6.608250 9.699622 7.303370
ENSG00000004939.15.SLC4A1 40.21098 -5.7550054 0.6028427 -9.546446 0 0 4.817946 5.158806 4.868790 6.262094 5.074732 6.628867 4.427155 4.427155 8.542511 5.399125 5.611020 5.115879 7.222594 4.734430 6.009051 5.072058 6.121939 5.293024 8.367161 4.427155 5.134091 8.755695 4.427155 4.891005 4.999739 5.227839 4.849992 4.965195 4.705232 4.737455 5.157617 5.643287 7.204590 5.983029 5.609324 4.758190 4.427155 4.745582 7.208637 4.859173 6.211422 5.017641
ENSG00000163464.8.CXCR1 37.73675 -5.9810773 0.6323897 -9.457898 0 0 4.817946 4.892842 5.810236 5.362008 4.752975 6.838799 5.292408 4.765228 9.456941 4.919983 5.147172 5.025001 7.019435 4.427155 5.855005 4.427155 5.276607 4.998798 6.128580 5.082847 4.427155 6.988656 5.187004 5.495120 4.895681 4.955127 4.427155 5.027846 5.156235 4.737455 5.766331 7.253262 7.289637 5.670219 5.160048 4.427155 5.419887 4.745582 7.440131 4.733206 6.986560 5.017641
ENSG00000012223.13.LTF 55.59289 -6.4307966 0.6816492 -9.434173 0 0 4.817946 4.996285 4.967005 5.005815 4.886966 5.594417 4.818730 4.765228 6.077658 4.776480 5.275677 5.115879 6.173486 4.957388 6.219524 5.004920 6.871795 4.894908 8.563405 5.144224 4.427155 10.145293 4.740344 4.427155 4.427155 4.733110 4.849992 4.697342 4.705232 4.865148 5.654293 7.092275 8.731560 6.649414 5.875397 5.229426 4.902271 4.427155 6.465158 4.955292 5.422956 5.017641
ENSG00000163221.9.S100A12 27.02550 -7.3871268 0.7928509 -9.317170 0 0 4.703907 4.427155 4.967005 4.427155 4.427155 5.822131 5.101317 4.427155 7.638609 4.427155 4.885346 4.427155 6.922201 4.427155 5.162588 4.427155 5.783880 4.894908 7.230692 4.427155 4.427155 8.644925 4.869211 4.891005 4.427155 4.427155 4.726679 4.697342 4.705232 4.427155 5.267719 6.698915 7.150141 5.330895 5.187102 4.758190 5.007758 4.745582 7.478384 4.733206 5.872461 4.427155
ENSG00000144655.15.CSRNP1 193.09305 -2.7682463 0.2978173 -9.295115 0 0 6.441892 7.524271 6.899723 7.132172 6.726200 8.239647 7.114279 6.698243 7.462042 6.143683 8.145652 6.518744 8.431894 7.196215 8.188084 7.159275 7.511754 6.865719 7.656737 6.586109 6.257383 9.936302 6.555946 7.585161 6.038769 6.803777 7.008694 6.695462 6.947906 6.736367 8.563527 10.436840 8.417844 7.473084 8.867342 6.415960 6.724515 6.586263 9.745461 6.562131 8.437344 7.021409
ENSG00000158578.21.ALAS2 31.20546 -7.0046574 0.7555988 -9.270340 0 0 4.703907 4.996285 5.049330 5.689147 4.427155 6.713580 4.427155 4.765228 8.515193 4.427155 4.751823 4.427155 7.110202 4.427155 5.786817 4.717481 5.998500 4.998798 7.347827 4.843978 4.427155 8.555845 4.427155 4.427155 4.427155 5.106287 5.092211 4.697342 4.819812 4.427155 4.892076 5.766749 7.215984 6.635511 5.433906 4.427155 4.763868 4.427155 6.317240 4.859173 5.777364 4.723939
ENSG00000134686.18.PHC2 426.88885 -0.9603702 0.1050012 -9.146279 0 0 8.759710 8.471190 8.527033 9.318784 8.747636 9.270438 8.401966 8.200825 9.733041 8.253346 9.308842 8.223066 9.448991 9.028319 9.233823 8.255082 9.159555 8.758920 8.777655 8.502758 8.509892 9.347932 8.489057 8.881423 8.071772 8.461446 8.350425 8.567267 8.653419 8.465265 9.099309 9.305928 9.080320 9.534330 9.617479 8.286821 8.676592 8.446972 9.321597 8.367407 9.276618 8.449548
ENSG00000148344.11.PTGES 339.24592 -3.1352365 0.3497212 -8.964959 0 0 6.985552 6.162090 6.195403 10.906434 6.505003 7.988305 6.970920 7.693051 9.372142 6.846144 8.162372 7.310909 6.780627 6.365922 8.979636 6.868730 9.312711 6.288545 8.311401 6.721788 6.433227 7.842448 6.588472 6.319211 6.594012 7.272704 6.896973 7.783169 6.816078 7.146334 8.510842 10.501442 9.697151 10.962891 10.104212 6.588534 6.968864 6.057307 10.214713 7.336619 10.058311 6.624012
ENSG00000118785.14.SPP1 4063.95258 -6.4281549 0.7428395 -8.653491 0 0 9.269593 6.234961 7.394699 15.959092 6.117231 11.462537 7.536383 7.396175 11.604187 5.607052 14.738692 8.223066 14.103103 9.666102 10.754848 5.657199 9.188354 6.169030 8.358723 6.571736 6.144396 6.439838 6.218621 7.738627 5.231767 6.412461 6.084206 8.034710 7.094344 6.505966 7.210158 14.906413 12.316603 10.737821 12.014976 5.548010 8.741687 6.882986 11.126297 5.546180 12.693283 4.939413
ENSG00000163736.4.PPBP 15.23241 -7.1217351 0.8478957 -8.399306 0 0 4.427155 4.427155 4.967005 4.762731 4.427155 5.550844 4.427155 4.765228 7.625787 4.427155 4.427155 4.773961 6.046993 4.860894 4.758892 4.427155 6.092274 5.085823 5.276250 4.843978 4.929509 6.236200 4.740344 4.755850 4.427155 5.035692 4.427155 4.427155 4.427155 4.427155 5.025665 5.379899 6.719969 5.478311 5.160048 4.427155 4.427155 4.745582 6.930379 4.733206 7.601323 4.427155
ENSG00000159339.13.PADI4 20.49196 -5.1205161 0.6125957 -8.358719 0 0 4.817946 4.427155 4.967005 5.093873 4.752975 5.888267 5.101317 4.427155 7.137567 5.029303 4.427155 5.195396 6.341445 4.734430 5.635506 4.717481 6.179146 4.758627 6.610728 4.722404 4.427155 8.046011 5.049919 5.343381 4.895681 5.035692 4.944108 4.697342 4.427155 4.737455 5.246997 6.526815 6.926582 5.670219 4.967587 4.758190 4.902271 4.745582 7.138168 4.859173 5.987701 5.147890
ENSG00000008516.18.MMP25 88.10362 -4.1863176 0.5034849 -8.314683 0 0 5.477317 5.588019 6.415328 6.162758 5.217043 6.611249 6.012583 5.176392 10.906505 5.455767 5.650282 5.598944 7.992034 5.511446 7.155895 5.716505 5.743593 5.455745 6.418719 5.390120 5.628850 8.144642 5.122106 6.051614 5.551206 5.379120 5.485176 5.516714 5.770625 5.437514 6.240125 7.235268 7.623060 6.158545 5.862940 5.349721 6.059488 5.367636 8.007111 5.281869 7.257665 5.513717
ENSG00000162747.12.FCGR3B 94.39565 -4.6748316 0.5626624 -8.308414 0 0 5.572778 5.499201 6.195403 5.689147 4.989133 7.425087 6.090110 5.737081 10.142048 4.427155 5.482540 5.392333 9.076977 5.038288 6.195151 5.415153 6.804919 5.404939 7.321659 5.737060 4.427155 7.932154 5.981465 5.906534 4.759177 4.955127 5.154429 5.782721 5.547138 4.865148 6.293551 8.508504 8.623728 6.137979 6.089169 5.403692 5.939819 5.549107 8.706273 5.169998 8.387482 5.394965
ENSG00000187764.12.SEMA4D 99.58780 -1.6020488 0.1976566 -8.105211 0 0 6.928521 6.669447 6.679655 8.651039 6.559472 7.214933 6.872996 6.297946 8.812975 6.878686 7.888270 6.539377 7.754660 6.488507 7.571844 6.217129 6.981404 6.517035 6.984274 6.316812 6.114415 7.574452 6.572311 6.443918 6.291278 6.376826 6.189422 6.749392 6.633691 6.908060 6.747566 7.903067 7.520488 7.395306 7.014934 6.436321 6.982762 6.619114 7.774980 6.608250 7.679326 6.581228
ENSG00000105290.13.APLP1 28.07845 -3.1719254 0.3915249 -8.101465 0 0 5.201790 4.996285 5.608103 7.389846 5.217043 6.538304 4.818730 4.765228 6.464660 5.399125 6.480037 5.728949 7.222594 5.550457 6.065282 5.286830 7.054618 5.592948 6.106545 5.301029 5.215616 7.594661 5.049919 4.891005 5.406508 5.506978 5.264075 5.027846 5.103157 5.115789 5.823743 5.965523 6.365312 6.830126 5.875397 5.084966 4.763868 4.876575 6.615620 5.840483 5.959977 4.939413
dge2 <- dge
write.table(dge2,file="rc2.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 = 16705
## Note: no. genes in output = 16680
## 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 OA (ctrl) and Rotator cuff repair (case)") %>%
  kable_paper("hover", full_width = F)
Top gene pathway differences between OA (ctrl) and Rotator cuff repair (case)
set setSize pANOVA s.dist p.adjustANOVA
698 Microtubule-dependent trafficking of connexons from Golgi to the plasma membrane 13 0.0000156 -0.6918923 0.0001098
425 Formation of tubulin folding intermediates by CCT/TriC 21 0.0000002 -0.6558874 0.0000021
1394 Transport of connexons to the plasma membrane 14 0.0000442 -0.6303595 0.0002944
405 Folding of actin by CCT/TriC 10 0.0008713 -0.6079304 0.0043746
898 Prefoldin mediated transfer of substrate to CCT/TriC 25 0.0000002 -0.5974590 0.0000024
225 Cooperation of Prefoldin and TriC/CCT in actin and tubulin folding 28 0.0000001 -0.5883635 0.0000008
370 Eukaryotic Translation Elongation 92 0.0000000 -0.5802269 0.0000000
616 Josephin domain DUBs 10 0.0016906 -0.5733773 0.0078949
856 Peptide chain elongation 87 0.0000000 -0.5733431 0.0000000
1309 TP53 Regulates Transcription of Death Receptors and Ligands 10 0.0018380 -0.5688902 0.0085292
482 Gluconeogenesis 27 0.0000004 -0.5659819 0.0000034
1424 Viral mRNA Translation 87 0.0000000 -0.5654933 0.0000000
364 Erythrocytes take up carbon dioxide and release oxygen 10 0.0020114 -0.5640192 0.0091320
809 O2/CO2 exchange in erythrocytes 10 0.0020114 -0.5640192 0.0091320
619 Keratan sulfate biosynthesis 26 0.0000006 -0.5639209 0.0000060
372 Eukaryotic Translation Termination 91 0.0000000 -0.5528680 0.0000000
1126 STAT3 nuclear events downstream of ALK signaling 10 0.0028063 -0.5456989 0.0122132
1100 SARS-CoV-1 modulates host translation machinery 36 0.0000000 -0.5456821 0.0000002
415 Formation of a pool of free 40S subunits 99 0.0000000 -0.5421728 0.0000000
786 Nonsense Mediated Decay (NMD) independent of the Exon Junction Complex (EJC) 93 0.0000000 -0.5394904 0.0000000
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("mitchres2.html") ) {
  mitch_report(mres2,outfile="mitchres2.html",overwrite=FALSE)
}

Rotator cuff repair vs Rotator cuff arthropathy

ss3 <- rbind(caps_rcr,caps_rca)
ss3 <- ss3[order(rownames(ss3)),]

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

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 TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
x3f <- x3[which(rowMeans(x3)>10),]
dim(x3)
## [1] 60651    30
dim(x3f)
## [1] 16458    30
ss3$group <- factor(ss3$group,levels=c("rcr","rca"))
dds <- DESeqDataSetFromMatrix(countData = x3f , colData = ss3, design = ~ Age +Sex + 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.
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 Rotator cuff repair (ctrl) and Rotator cuff arthropathy (case)") %>%
  kable_paper("hover", full_width = F)
Top gene expression differences between Rotator cuff repair (ctrl) and Rotator cuff arthropathy (case)
baseMean log2FoldChange lfcSE stat pvalue padj 1.1_S41 10.1_S50 10C_S35 11.1_S51 12.1_S52 13.1_S53 13C_S38 14.1_S54 15.1_S55 16.1_S56 17.1_S57 18.1_S58 19.1_S59 2.1_S42 20.1_S60 21.1_S61 22.1_S62 23.1_S63 24.1_S64 25.1_S65 26.1_S66 3.1_S43 4.1_S44 4003.43C 5.1_S45 6.1_S46 7.1_S47 8.1_S48 9.1_S49 9C_S34
ENSG00000244734.4.HBB 8683.63048 8.609168 0.8354719 10.304558 0 0.0e+00 7.649190 6.801459 16.909440 11.574409 7.111538 7.457752 16.584890 7.718199 8.152491 9.422418 7.893024 9.476276 11.102239 9.331990 8.319315 8.978806 9.528001 7.774612 9.290159 8.582883 8.912174 8.062289 7.048427 12.071313 7.151403 8.685301 7.969273 8.028078 8.403013 14.431621
ENSG00000206172.8.HBA1 4363.08548 9.041692 0.9406335 9.612343 0 0.0e+00 6.431697 6.362347 15.795920 10.116895 5.897242 5.496608 15.742367 6.493754 7.518716 8.274806 6.485610 8.646111 10.150719 8.199086 7.484287 7.891734 8.221812 6.381651 8.135122 7.244827 7.630544 7.084279 6.293478 10.296412 5.981368 6.328613 6.324570 7.315836 7.181463 13.648784
ENSG00000188536.13.HBA2 8493.63274 8.629791 0.9383985 9.196297 0 0.0e+00 6.816730 6.279880 16.649254 11.232542 7.188595 7.173845 16.785358 7.137642 8.385340 9.457476 7.732990 10.062927 11.086252 9.306342 8.595658 9.001308 9.166686 7.338187 8.904327 7.855614 8.272119 7.636062 7.142003 12.131226 6.774111 7.821884 6.872454 8.277438 8.444045 14.510028
ENSG00000099860.9.GADD45B 389.63184 2.390950 0.3127038 7.646054 0 0.0e+00 7.852849 7.689409 11.375782 7.670646 8.033963 8.098846 9.906551 8.249055 7.602748 8.257815 8.603479 8.365735 8.256330 8.030420 7.686036 8.239017 8.437255 7.619060 7.600653 8.339220 8.088512 8.233730 8.364592 9.315684 8.553738 7.955316 7.812972 7.625244 7.994185 10.456176
ENSG00000012223.13.LTF 31.06759 5.951529 0.8234985 7.227128 0 0.0e+00 4.549438 4.740650 8.936273 4.710875 4.623201 4.549554 8.394691 4.490344 4.499948 4.871200 4.701609 4.753262 4.630957 4.902350 4.120228 4.463673 4.120228 4.120228 4.455033 4.582562 4.416542 4.425475 4.599786 5.399230 4.997887 4.641540 4.120228 4.698419 4.765918 7.095788
ENSG00000067048.17.DDX3Y 306.68759 8.531180 1.1880304 7.180944 0 0.0e+00 8.442575 8.745731 5.003288 9.192367 8.798102 4.120228 8.754476 9.084546 8.406157 8.789677 9.043086 8.752548 4.120228 9.128602 8.890513 9.139576 4.480416 9.037174 4.120228 4.120228 9.022616 8.983458 8.820268 4.120228 4.120228 8.325426 4.120228 9.014919 8.783129 8.983150
ENSG00000144655.15.CSRNP1 169.83167 3.493242 0.4892156 7.140497 0 0.0e+00 6.304200 7.420191 10.891134 6.779583 6.596652 7.006976 8.783124 6.568197 5.969734 6.374060 7.093526 7.053907 6.739148 6.445900 6.096775 6.421467 7.493471 5.870445 6.677891 6.891128 6.568448 6.835189 6.609085 7.344177 6.272929 6.601221 6.453439 6.426150 6.905975 9.769830
ENSG00000116985.12.BMP8B 132.15992 4.022540 0.5678857 7.083361 0 0.0e+00 5.731250 5.912744 9.464536 5.939761 7.017933 5.496608 9.565882 6.769727 6.215946 6.519271 6.578126 5.698272 6.290319 5.844237 6.509661 6.312833 6.301788 6.114997 6.372878 6.207917 6.067865 5.530099 5.613748 6.121467 6.294487 6.842785 6.159881 6.721318 5.780247 10.436216
ENSG00000163884.4.KLF15 142.42969 5.145061 0.7436502 6.918657 0 0.0e+00 5.405136 6.742483 10.251302 6.433930 5.868660 5.066712 9.648558 6.785251 6.288515 5.965115 6.141010 6.001914 6.450924 5.819858 5.944942 6.274531 5.995950 5.562988 5.686114 6.006808 5.310099 5.309533 5.677306 4.571587 5.866878 5.955212 5.430417 5.717653 6.629722 10.505859
ENSG00000071859.15.FAM50A 966.65910 2.980866 0.4484734 6.646695 0 0.0e+00 8.751667 9.221880 11.367731 8.917189 9.216197 8.688618 9.427706 9.196419 8.967753 9.128144 9.837886 9.176495 9.309319 9.023515 9.205086 8.912081 8.825339 8.932660 9.499784 9.349098 8.790144 8.838106 9.499406 9.590915 9.153879 8.759895 8.667734 9.250155 9.425933 13.475427
ENSG00000120875.9.DUSP4 24.03426 3.522494 0.5309708 6.634063 0 0.0e+00 5.821983 5.285488 6.566377 5.323207 4.909647 5.553304 7.904625 4.854540 4.655706 4.957550 5.696230 5.008572 4.921642 5.511224 5.259659 5.234125 5.762073 5.244778 5.207250 5.314314 5.241436 5.663778 5.546362 6.303859 4.997887 4.853571 5.091812 5.160267 5.176212 6.942869
ENSG00000229391.7.HLA.DRB6 70.55897 -4.158651 0.6456217 -6.441313 0 2.0e-07 6.445134 6.898948 4.808428 6.831666 6.383208 6.711693 4.120228 7.338135 7.732616 6.650291 5.754568 6.796550 7.052097 6.368465 6.966003 6.521883 7.439626 6.139445 5.339186 6.460892 6.792142 7.197794 7.048427 4.532538 6.875024 7.324586 7.019077 5.717653 6.916813 5.220494
ENSG00000167978.17.SRRM2 5450.17762 -1.114458 0.1770004 -6.296357 0 4.0e-07 12.644032 12.538822 11.187373 12.187812 12.802738 12.642544 11.158574 12.576434 12.549859 12.602248 12.505846 12.074802 12.358340 12.277562 11.885264 12.701578 12.492847 12.550421 12.289144 12.640733 12.632503 12.796057 12.384621 11.376923 12.439713 12.687976 12.905730 12.451482 12.644990 11.893257
ENSG00000158578.21.ALAS2 26.36758 7.216130 1.1574460 6.234529 0 5.0e-07 4.424283 4.740650 9.057838 4.800696 4.120228 4.120228 7.860327 4.490344 4.120228 4.120228 4.120228 4.438644 4.744139 4.575446 4.120228 4.120228 4.120228 4.120228 4.862348 4.846676 4.416542 4.551115 4.120228 4.956341 4.120228 4.489848 4.120228 4.593362 4.445087 6.464160
ENSG00000183878.15.UTY 59.87221 5.419066 0.8884171 6.099687 0 1.2e-06 6.722063 7.014970 5.291155 7.087578 6.877983 4.120228 6.614624 6.945380 6.855196 6.909532 6.930683 6.936320 4.120228 6.995008 6.873356 7.082489 4.120228 6.960983 4.120228 4.447844 6.782281 7.075807 6.468837 4.120228 4.120228 6.653078 4.120228 6.847907 6.642968 6.834842
ENSG00000153531.13.ADPRHL1 33.13265 3.481644 0.5818089 5.984171 0 2.2e-06 5.436400 5.509763 6.648538 5.484666 5.746984 4.725188 8.787843 5.207696 5.446126 5.342773 5.962889 5.462094 5.703222 5.256067 5.425424 5.184563 5.426365 5.562988 5.560346 5.314314 5.404853 5.236440 5.066702 5.300304 5.805306 5.584693 5.299664 5.160267 5.381830 7.043081
ENSG00000163221.9.S100A12 16.29996 7.139573 1.1965427 5.966835 0 2.3e-06 4.424283 4.120228 8.399572 4.710875 4.120228 4.858508 6.909092 4.120228 4.120228 4.120228 4.120228 4.120228 4.630957 4.120228 4.120228 4.604800 4.628305 4.120228 4.120228 4.447844 4.416542 4.425475 4.120228 4.729332 4.483124 4.757000 4.469410 4.455530 4.120228 6.676193
ENSG00000072310.17.SREBF1 684.59769 -1.181623 0.1993427 -5.927593 0 2.8e-06 9.939430 9.794358 8.794763 9.223640 9.769040 9.611393 8.100001 9.227244 9.702052 9.824583 9.375230 9.340813 9.224155 9.272098 9.037312 9.570255 9.572061 9.469366 9.488485 9.521757 9.540719 9.695443 9.537574 9.019595 9.766011 10.108805 9.858249 9.448417 9.714636 8.538025
ENSG00000203865.11.ATP1A1.AS1 57.51622 1.563173 0.2676147 5.841134 0 4.4e-06 6.211749 6.439959 7.116870 6.654609 6.439850 5.707819 7.209856 5.957400 6.334745 6.374060 6.706010 6.157274 6.373062 6.023439 6.401084 6.421467 7.015925 6.038691 6.389900 6.297771 6.801933 6.518075 6.090854 6.544122 6.086163 5.895872 6.362689 6.172034 6.397882 7.350490
ENSG00000173530.6.TNFRSF10D 88.78480 1.852497 0.3175053 5.834538 0 4.4e-06 6.886102 6.815815 7.973565 6.930275 6.476314 6.733478 8.801910 6.512755 6.582645 6.458964 7.182825 6.666051 6.676637 6.574880 6.774041 6.784834 6.459512 6.653526 6.471880 6.606215 6.497112 6.865183 6.681137 6.624155 6.510917 6.284656 6.554768 6.721318 6.264799 7.693592
dge3 <- dge
write.table(dge3,file="rc3.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 = 16458
## Note: no. genes in output = 16432
## Note: estimated proportion of input genes in output = 0.998
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 Rotator cuff repair (ctrl) and Rotator cuff arthropathy (case)") %>%
  kable_paper("hover", full_width = F)
Top gene pathway differences between Rotator cuff repair (ctrl) and Rotator cuff arthropathy (case)
set setSize pANOVA s.dist p.adjustANOVA
370 Eukaryotic Translation Elongation 91 0.0000000 0.7187456 0.0000000
850 Peptide chain elongation 87 0.0000000 0.7128821 0.0000000
1417 Viral mRNA Translation 87 0.0000000 0.7054757 0.0000000
414 Formation of a pool of free 40S subunits 99 0.0000000 0.6846973 0.0000000
1092 SARS-CoV-1 modulates host translation machinery 36 0.0000000 0.6824022 0.0000000
782 Nonsense Mediated Decay (NMD) independent of the Exon Junction Complex (EJC) 93 0.0000000 0.6767218 0.0000000
372 Eukaryotic Translation Termination 91 0.0000000 0.6730156 0.0000000
424 Formation of tubulin folding intermediates by CCT/TriC 20 0.0000002 0.6700768 0.0000034
1138 Selenocysteine synthesis 91 0.0000000 0.6671045 0.0000000
623 L13a-mediated translational silencing of Ceruloplasmin expression 109 0.0000000 0.6666942 0.0000000
461 GTP hydrolysis and joining of the 60S ribosomal subunit 110 0.0000000 0.6582827 0.0000000
404 Folding of actin by CCT/TriC 10 0.0003835 0.6484716 0.0026738
1117 SRP-dependent cotranslational protein targeting to membrane 110 0.0000000 0.6451939 0.0000000
891 Prefoldin mediated transfer of substrate to CCT/TriC 24 0.0000001 0.6362496 0.0000014
423 Formation of the ternary complex, and subsequently, the 43S complex 51 0.0000000 0.6352182 0.0000000
1078 Response of EIF2AK4 (GCN2) to amino acid deficiency 99 0.0000000 0.6332368 0.0000000
153 Cap-dependent Translation Initiation 117 0.0000000 0.6310039 0.0000000
371 Eukaryotic Translation Initiation 117 0.0000000 0.6310039 0.0000000
695 Microtubule-dependent trafficking of connexons from Golgi to the plasma membrane 12 0.0001573 0.6300041 0.0012061
226 Cooperation of Prefoldin and TriC/CCT in actin and tubulin folding 27 0.0000000 0.6285550 0.0000004
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("mitchres1.html") ) {
  mitch_report(mres3,outfile="mitchres3.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          caTools_1.18.2          utf8_1.2.4             
## [16] promises_1.2.1          rmarkdown_2.25          tzdb_0.4.0             
## [19] xfun_0.41               zlibbioc_1.48.0         cachem_1.0.8           
## [22] jsonlite_1.8.8          highr_0.10              later_1.3.2            
## [25] DelayedArray_0.28.0     BiocParallel_1.36.0     parallel_4.3.2         
## [28] R6_2.5.1                bslib_0.6.1             stringi_1.8.3          
## [31] RColorBrewer_1.1-3      jquerylib_0.1.4         assertthat_0.2.1       
## [34] Rcpp_1.0.11             knitr_1.45              httpuv_1.6.13          
## [37] Matrix_1.6-4            timechange_0.2.0        tidyselect_1.2.0       
## [40] rstudioapi_0.15.0       abind_1.4-5             yaml_2.3.8             
## [43] codetools_0.2-19        lattice_0.22-5          plyr_1.8.9             
## [46] shiny_1.8.0             withr_2.5.2             evaluate_0.23          
## [49] ggstats_0.5.1           xml2_1.3.6              pillar_1.9.0           
## [52] KernSmooth_2.23-22      generics_0.1.3          RCurl_1.98-1.13        
## [55] hms_1.1.3               munsell_0.5.0           scales_1.3.0           
## [58] xtable_1.8-4            glue_1.6.2              tools_4.3.2            
## [61] data.table_1.14.10      webshot_0.5.5           locfit_1.5-9.8         
## [64] fastmatch_1.1-4         cowplot_1.1.2           grid_4.3.2             
## [67] colorspace_2.1-0        GenomeInfoDbData_1.2.11 cli_3.6.2              
## [70] fansi_1.0.6             viridisLite_0.4.2       S4Arrays_1.2.0         
## [73] svglite_2.1.3           gtable_0.3.4            sass_0.4.8             
## [76] digest_0.6.33           SparseArray_1.2.3       htmlwidgets_1.6.4      
## [79] htmltools_0.5.7         lifecycle_1.0.4         httr_1.4.7             
## [82] statmod_1.5.0           mime_0.12