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

Introduction

What is the relationship between metabolic syndrome (visceral obesity, hypertension, elevated fasting glucose, and dyslipidaemia) and the transcriptomic profile of shoulder OA when comparing bone biopsies between patients with cuff arthropathy and primary osteoarthritis? For the above analyses to be effective, we will need to adjust for age, sex and CRP. Patients are classified as having metabolic syndrome = YES, or not = No, giving us a discrete variable which takes into account BMI, Fasting glucose, Cholesterol and Blood pressure in accordance with the international diabetes federation definition.

Also I will conduct a comparison of cuff arth to primary OA control for age sex and CRP.

Load libraries and custom plot functions.

Packages.

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")
})

Functions.

maplot <- function(de,contrast_name) {
  sig <-subset(de, padj < 0.05 )
  up <-rownames(subset(de, padj < 0.05 & log2FoldChange > 0))
  dn <-rownames(subset(de, padj < 0.05 & log2FoldChange < 0))
  GENESUP <- length(up)
  GENESDN <- length(dn)
  DET=nrow(de)
  SUBHEADER = paste(GENESUP, "up, ", GENESDN, "down", DET, "detected")
  ns <-subset(de, padj > 0.05 )
  plot(log2(de$baseMean),de$log2FoldChange, 
       xlab="log2 basemean", ylab="log2 foldchange",
       pch=19, cex=0.5, col="dark gray",
       main=contrast_name, cex.main=1)
  points(log2(sig$baseMean),sig$log2FoldChange,
         pch=19, cex=0.5, col="red")
  mtext(SUBHEADER,cex = 1)
}

make_volcano <- function(de,name) {
    sig <- subset(de,padj<0.05)
    N_SIG=nrow(sig)
    N_UP=nrow(subset(sig,log2FoldChange>0))
    N_DN=nrow(subset(sig,log2FoldChange<0))
    DET=nrow(de)
    HEADER=paste(N_SIG,"@5%FDR,", N_UP, "up", N_DN, "dn", DET, "detected")
    plot(de$log2FoldChange,-log10(de$pval),cex=0.5,pch=19,col="darkgray",
        main=name, xlab="log2 FC", ylab="-log10 pval")
    mtext(HEADER)
    grid()
    points(sig$log2FoldChange,-log10(sig$pval),cex=0.5,pch=19,col="red")
}

make_heatmap <- function(de,name,groups,mx,n=30){

  colfunc <- colorRampPalette(c("blue", "white", "red"))
  values <- groups
  f <- colorRamp(c("yellow", "orange"))
  rr <- range(values)
  svals <- (values-rr[1])/diff(rr)
  colcols <- rgb(f(svals)/255)
  mxn <- mx/rowSums(mx)*1000000
  x <- mxn[which(rownames(mxn) %in% rownames(head(de,n))),]
  heatmap.2(as.matrix(x),trace="none",col=colfunc(25),scale="row", margins = c(10,15), cexRow=0.5, 
    main=paste("Top ranked",n,"genes in",name) , ColSideColors = colcols  )

}

Sample sheet

./samplesheets/pheno_data.tsv

ss <- read.table("samplesheets/pheno_data.tsv",header=TRUE)
rownames(ss) <- sapply(strsplit(ss$fastq,"_R1_"),"[[",1)
rownames(ss) <- gsub("_L001","",rownames(ss))
rownames(ss) <- gsub("-",".",rownames(ss))

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

ss %>%
  kbl(caption = "sample sheet") %>%
  kable_paper("hover", full_width = F)
sample sheet
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
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.0 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 AD-CAB_3001 RC 53 tendon 1-2_S67_L001_R1_001.fastq.gz NA 67 M NA NA NA Left 177.80 120.0 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 AD-CAB_3001 RC 53 tear 1-3_S93_L001_R1_001.fastq.gz NA 67 M NA NA NA Left 177.80 120.0 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
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.0 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 AD-CAB_3010 RC 62 tendon 10-2_S76_L001_R1_001.fastq.gz NA 58 M NA NA NA Left 179.00 98.0 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 AD-CAB_3010 RC 62 tear 10-3_S102_L001_R1_001.fastq.gz NA 58 M NA NA NA Left 179.00 98.0 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
10B_S21 AD-CAB_4010 OA 90 bone 10B_S21_L001_R1_001.fastq.gz pvt 80 F No Yes Reverse Left 161.00 72.0 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 AD-CAB_4010 OA 90 capsule 10C_S35_L001_R1_001.fastq.gz pvt 80 F No Yes Reverse Left 161.00 72.0 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
10S_S49 AD-CAB_4010 OA 90 synovium 10S_S49_L001_R1_001.fastq.gz pvt 80 F No Yes Reverse Left 161.00 72.0 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
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.0 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 AD-CAB_3011 RC 63 tendon 11-2_S77_L001_R1_001.fastq.gz NA 50 M NA NA NA Right 180.00 82.0 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 AD-CAB_3011 RC 63 tear 11-3_S103_L001_R1_001.fastq.gz NA 50 M NA NA NA Right 180.00 82.0 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
11B_S22 AD-CAB_4011 OA 87 bone 11B_S22_L001_R1_001.fastq.gz pub 76 M Yes No Reverse Right 180.00 92.0 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 AD-CAB_4011 OA 87 capsule 11C_S36_L001_R1_001.fastq.gz pub 76 M Yes No Reverse Right 180.00 92.0 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
11S_S50 AD-CAB_4011 OA 87 synovium 11S_S50_L001_R1_001.fastq.gz pub 76 M Yes No Reverse Right 180.00 92.0 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
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.0 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.2_S78 AD-CAB_3012 RC 64 tendon 12-2_S78_L001_R1_001.fastq.gz NA 72 M NA NA NA Left 173.00 87.0 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.3_S104 AD-CAB_3012 RC 64 tear 12-3_S104_L001_R1_001.fastq.gz NA 72 M NA NA NA Left 173.00 87.0 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
12B_S23 AD-CAB_4012 OA 91 bone 12B_S23_L001_R1_001.fastq.gz pub 71 F Yes No Anatomic Right 163.00 83.0 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 AD-CAB_4012 OA 91 capsule 12C_S37_L001_R1_001.fastq.gz pub 71 F Yes No Anatomic Right 163.00 83.0 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
12S_S51 AD-CAB_4012 OA 91 synovium 12S_S51_L001_R1_001.fastq.gz pub 71 F Yes No Anatomic Right 163.00 83.0 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
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.0 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.2_S79 AD-CAB_3013 RC 65 tendon 13-2_S79_L001_R1_001.fastq.gz NA 68 F NA NA NA Right 161.00 104.0 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.3_S105 AD-CAB_3013 RC 65 tear 13-3_S105_L001_R1_001.fastq.gz NA 68 F NA NA NA Right 161.00 104.0 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
13B_S24 AD-CAB_4013 OA 89 bone 13B_S24_L001_R1_001.fastq.gz pvt 69 F No Yes Reverse Left 170.00 89.0 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 AD-CAB_4013 OA 89 capsule 13C_S38_L001_R1_001.fastq.gz pvt 69 F No Yes Reverse Left 170.00 89.0 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
13S_S52 AD-CAB_4013 OA 89 synovium 13S_S52_L001_R1_001.fastq.gz pvt 69 F No Yes Reverse Left 170.00 89.0 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
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.0 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 AD-CAB_3014 RC 66 tendon 14-2_S80_L001_R1_001.fastq.gz NA 70 M NA NA NA Left 1.77 100.0 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 AD-CAB_3014 RC 66 tear 14-3_S106_L001_R1_001.fastq.gz NA 70 M NA NA NA Left 1.77 100.0 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
14B_S25 AD-CAB_4014 OA 92 bone 14B_S25_L001_R1_001.fastq.gz pvt 71 M Yes No Reverse Right 170.00 99.0 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 AD-CAB_4014 OA 92 capsule 14C_S39_L001_R1_001.fastq.gz pvt 71 M Yes No Reverse Right 170.00 99.0 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
14S_S53 AD-CAB_4014 OA 92 synovium 14S_S53_L001_R1_001.fastq.gz pvt 71 M Yes No Reverse Right 170.00 99.0 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
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.0 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 AD-CAB_3015 RC 69 tendon 15-2_S81_L001_R1_001.fastq.gz NA 66 M NA NA NA Left 175.00 95.0 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 AD-CAB_3015 RC 69 tear 15-3_S107_L001_R1_001.fastq.gz NA 66 M NA NA NA Left 175.00 95.0 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
15B_S26 AD-CAB_4015 OA 93 bone 15B_S26_L001_R1_001.fastq.gz pvt 76 M Yes No Anatomic Left 183.00 95.0 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 AD-CAB_4015 OA 93 capsule 15C_S40_L001_R1_001.fastq.gz pvt 76 M Yes No Anatomic Left 183.00 95.0 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
15S_S54 AD-CAB_4015 OA 93 synovium 15S_S54_L001_R1_001.fastq.gz pvt 76 M Yes No Anatomic Left 183.00 95.0 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
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.0 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 AD-CAB_3016 RC 71 tendon 16-2_S82_L001_R1_001.fastq.gz NA 68 M NA NA NA Left 180.00 88.0 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 AD-CAB_3016 RC 71 tear 16-3_S108_L001_R1_001.fastq.gz NA 68 M NA NA NA Left 180.00 88.0 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
16B_S27 AD-CAB_4016 OA 99 bone 16B_S27_L001_R1_001.fastq.gz pvt 76 F Yes No Anatomic Left 167.00 54.0 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 AD-CAB_4016 OA 99 capsule 16C_S41_L001_R1_001.fastq.gz pvt 76 F Yes No Anatomic Left 167.00 54.0 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
16S_S55 AD-CAB_4016 OA 99 synovium 16S_S55_L001_R1_001.fastq.gz pvt 76 F Yes No Anatomic Left 167.00 54.0 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
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.0 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 AD-CAB_3017 RC 70 tendon 17-2_S83_L001_R1_001.fastq.gz NA 60 M NA NA NA Left 166.00 80.0 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 AD-CAB_3017 RC 70 tear 17-3_S109_L001_R1_001.fastq.gz NA 60 M NA NA NA Left 166.00 80.0 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
17B_S28 AD-CAB_4017 OA 96 bone 17B_S28_L001_R1_001.fastq.gz pvt 79 F Yes No Reverse Right 155.00 75.0 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 AD-CAB_4017 OA 96 capsule 17C_S42_L001_R1_001.fastq.gz pvt 79 F Yes No Reverse Right 155.00 75.0 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
17S_S56 AD-CAB_4017 OA 96 synovium 17S_S56_L001_R1_001.fastq.gz pvt 79 F Yes No Reverse Right 155.00 75.0 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
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.0 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 AD-CAB_3018 RC 72 tendon 18-2_S84_L001_R1_001.fastq.gz NA 72 M NA NA NA Right 170.00 85.0 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 AD-CAB_3018 RC 72 tear 18-3_S110_L001_R1_001.fastq.gz NA 72 M NA NA NA Right 170.00 85.0 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
18B_S29 AD-CAB_4018 OA 97 bone 18B_S29_L001_R1_001.fastq.gz pvt 73 F Yes No Anatomic Right 167.00 85.0 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 AD-CAB_4018 OA 97 capsule 18C_S43_L001_R1_001.fastq.gz pvt 73 F Yes No Anatomic Right 167.00 85.0 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
18S_S57 AD-CAB_4018 OA 97 synovium 18S_S57_L001_R1_001.fastq.gz pvt 73 F Yes No Anatomic Right 167.00 85.0 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
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.0 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 AD-CAB_3019 RC 73 tendon 19-2_S85_L001_R1_001.fastq.gz NA 45 F NA NA NA Right 163.00 98.0 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 AD-CAB_3019 RC 73 tear 19-3_S111_L001_R1_001.fastq.gz NA 45 F NA NA NA Right 163.00 98.0 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
19B_S30 AD-CAB_4019 OA 95 bone 19B_S30_L001_R1_001.fastq.gz pvt 65 F Yes No Anatomic Left 170.00 62.0 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 AD-CAB_4019 OA 95 capsule 19C_S44_L001_R1_001.fastq.gz pvt 65 F Yes No Anatomic Left 170.00 62.0 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
19S_S58 AD-CAB_4019 OA 95 synovium 19S_S58_L001_R1_001.fastq.gz pvt 65 F Yes No Anatomic Left 170.00 62.0 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
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.0 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 AD-CAB_3002 RC 54 tendon 2-2_S68_L001_R1_001.fastq.gz NA 58 M NA NA NA Right 179.00 79.0 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 AD-CAB_3002 RC 54 tear 2-3_S94_L001_R1_001.fastq.gz NA 58 M NA NA NA Right 179.00 79.0 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
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.0 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 AD-CAB_3020 RC 67 tendon 20-2_S86_L001_R1_001.fastq.gz NA 61 M NA NA NA Right 180.00 92.0 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 AD-CAB_3020 RC 67 tear 20-3_S112_L001_R1_001.fastq.gz NA 61 M NA NA NA Right 180.00 92.0 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
20B_S31 AD-CAB_4020 OA 98 bone 20B_S31_L001_R1_001.fastq.gz pvt 62 M Yes No Anatomic Left 180.00 117.0 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 AD-CAB_4020 OA 98 capsule 20C_S45_L001_R1_001.fastq.gz pvt 62 M Yes No Anatomic Left 180.00 117.0 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
20S_S59 AD-CAB_4020 OA 98 synovium 20S_S59_L001_R1_001.fastq.gz pvt 62 M Yes No Anatomic Left 180.00 117.0 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
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.0 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 AD-CAB_3021 RC 68 tendon 21-2_S87_L001_R1_001.fastq.gz NA 46 M NA NA NA Right 180.00 88.0 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 AD-CAB_3021 RC 68 tear 21-3_S113_L001_R1_001.fastq.gz NA 46 M NA NA NA Right 180.00 88.0 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
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.2_S88 AD-CAB_3022 RC 74 tendon 22-2_S88_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.3_S114 AD-CAB_3022 RC 74 tear 22-3_S114_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
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.0 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 AD-CAB_3023 RC 75 tendon 23-2_S89_L001_R1_001.fastq.gz NA 58 M NA NA NA Right 179.00 81.0 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 AD-CAB_3023 RC 75 tear 23-3_S115_L001_R1_001.fastq.gz NA 58 M NA NA NA Right 179.00 81.0 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
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.0 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.2_S90 AD-CAB_3024 RC 76 tendon 24-2_S90_L001_R1_001.fastq.gz NA 52 F NA NA NA Right 153.00 70.0 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.3_S116 AD-CAB_3024 RC 76 tear 24-3_S116_L001_R1_001.fastq.gz NA 52 F NA NA NA Right 153.00 70.0 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
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.0 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 AD-CAB_3025 RC 77 tendon 25-2_S91_L001_R1_001.fastq.gz NA 62 F NA NA NA Left 157.00 95.0 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 AD-CAB_3025 RC 77 tear 25-3_S117_L001_R1_001.fastq.gz NA 62 F NA NA NA Left 157.00 95.0 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
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.0 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.2_S92 AD-CAB_3026 RC 79 tendon 26-2_S92_L001_R1_001.fastq.gz NA 59 M NA NA NA Right 176.00 104.0 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.3_S118 AD-CAB_3026 RC 79 tear 26-3_S118_L001_R1_001.fastq.gz NA 59 M NA NA NA Right 176.00 104.0 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
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.0 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 AD-CAB_3003 RC 55 tendon 3-2_S69_L001_R1_001.fastq.gz NA 56 M NA NA NA Left 179.00 85.0 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 AD-CAB_3003 RC 55 tear 3-3_S95_L001_R1_001.fastq.gz NA 56 M NA NA NA Left 179.00 85.0 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
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.0 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 AD-CAB_3004 RC 56 tendon 4-2_S70_L001_R1_001.fastq.gz NA 68 M NA NA NA Right 185.00 95.0 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 AD-CAB_3004 RC 56 tear 4-3_S96_L001_R1_001.fastq.gz NA 68 M NA NA NA Right 185.00 95.0 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
4001.41B AD-CAB_4001 OA 84 bone 4001-41B_R1_001.fastq.gz pvt 69 F Yes No Anatomic Left 158.00 89.0 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 AD-CAB_4001 OA 84 capsule 4001-41C_R1_001.fastq.gz pvt 69 F Yes No Anatomic Left 158.00 89.0 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.41S AD-CAB_4001 OA 84 synovium 4001-41S_R1_001.fastq.gz pvt 69 F Yes No Anatomic Left 158.00 89.0 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
4002.42B AD-CAB_4002 OA 80 bone 4002-42B_R1_001.fastq.gz pvt 59 M Yes No Anatomic Left 182.00 106.0 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 AD-CAB_4002 OA 80 capsule 4002-42C_R1_001.fastq.gz pvt 59 M Yes No Anatomic Left 182.00 106.0 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.42S AD-CAB_4002 OA 80 synovium 4002-42S_R1_001.fastq.gz pvt 59 M Yes No Anatomic Left 182.00 106.0 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
4003.43B AD-CAB_4003 OA 81 bone 4003-43B_R1_001.fastq.gz pvt 74 F No Yes Reverse Right 153.00 87.0 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 AD-CAB_4003 OA 81 capsule 4003-43C_R1_001.fastq.gz pvt 74 F No Yes Reverse Right 153.00 87.0 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.43S AD-CAB_4003 OA 81 synovium 4003-43S_R1_001.fastq.gz pvt 74 F No Yes Reverse Right 153.00 87.0 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
4004.44B AD-CAB_4004 OA 82 bone 4004-44B_R1_001.fastq.gz pvt 69 F Yes No Anatomic Left 165.00 85.0 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 AD-CAB_4004 OA 82 capsule 4004-44C_R1_001.fastq.gz pvt 69 F Yes No Anatomic Left 165.00 85.0 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.44S AD-CAB_4004 OA 82 synovium 4004-44S_R1_001.fastq.gz pvt 69 F Yes No Anatomic Left 165.00 85.0 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
4005.45B AD-CAB_4005 OA 83 bone 4005-45B_R1_001.fastq.gz pvt 74 F Yes No Anatomic Left 169.00 75.0 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 AD-CAB_4005 OA 83 capsule 4005-45C_R1_001.fastq.gz pvt 74 F Yes No Anatomic Left 169.00 75.0 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.45S AD-CAB_4005 OA 83 synovium 4005-45S_R1_001.fastq.gz pvt 74 F Yes No Anatomic Left 169.00 75.0 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
4006.46B AD-CAB_4006 OA 78 bone 4006-46B_R1_001.fastq.gz pvt 81 F Yes No Anatomic Right 150.00 54.0 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 AD-CAB_4006 OA 78 capsule 4006-46C_R1_001.fastq.gz pvt 81 F Yes No Anatomic Right 150.00 54.0 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.46S AD-CAB_4006 OA 78 synovium 4006-46S_R1_001.fastq.gz pvt 81 F Yes No Anatomic Right 150.00 54.0 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
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.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.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
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.0 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 AD-CAB_3006 RC 58 tendon 6-2_S72_L001_R1_001.fastq.gz NA 65 M NA NA NA Left 172.00 78.0 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 AD-CAB_3006 RC 58 tear 6-3_S98_L001_R1_001.fastq.gz NA 65 M NA NA NA Left 172.00 78.0 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
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.0 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 AD-CAB_3007 RC 59 tendon 7-2_S73_L001_R1_001.fastq.gz NA 63 F NA NA NA Right 163.00 57.0 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 AD-CAB_3007 RC 59 tear 7-3_S99_L001_R1_001.fastq.gz NA 63 F NA NA NA Right 163.00 57.0 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
7B_S18 AD-CAB_4007 OA 85 bone 7B_S18_L001_R1_001.fastq.gz pvt 72 M Yes No Anatomic Right 184.00 118.0 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 AD-CAB_4007 OA 85 capsule 7C_S32_L001_R1_001.fastq.gz pvt 72 M Yes No Anatomic Right 184.00 118.0 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
7S_S46 AD-CAB_4007 OA 85 synovium 7S_S46_L001_R1_001.fastq.gz pvt 72 M Yes No Anatomic Right 184.00 118.0 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
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.0 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 AD-CAB_3008 RC 60 tendon 8-2_S74_L001_R1_001.fastq.gz NA 70 M NA NA NA Left 167.00 71.0 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 AD-CAB_3008 RC 60 tear 8-3_S100_L001_R1_001.fastq.gz NA 70 M NA NA NA Left 167.00 71.0 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
8B_S19 AD-CAB_4008 OA 86 bone 8B_S19_L001_R1_001.fastq.gz pub 70 M Yes No Anatomic Right 172.00 86.0 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 AD-CAB_4008 OA 86 capsule 8C_S33_L001_R1_001.fastq.gz pub 70 M Yes No Anatomic Right 172.00 86.0 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
8S_S47 AD-CAB_4008 OA 86 synovium 8S_S47_L001_R1_001.fastq.gz pub 70 M Yes No Anatomic Right 172.00 86.0 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
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.0 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 AD-CAB_3009 RC 61 tendon 9-2_S75_L001_R1_001.fastq.gz NA 68 M NA NA NA Right 182.00 83.0 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 AD-CAB_3009 RC 61 tear 9-3_S101_L001_R1_001.fastq.gz NA 68 M NA NA NA Right 182.00 83.0 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
9B_S20 AD-CAB_4009 OA 88 bone 9B_S20_L001_R1_001.fastq.gz pvt 72 M No Yes Reverse Right 167.00 80.0 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 AD-CAB_4009 OA 88 capsule 9C_S34_L001_R1_001.fastq.gz pvt 72 M No Yes Reverse Right 167.00 80.0 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
9S_S48 AD-CAB_4009 OA 88 synovium 9S_S48_L001_R1_001.fastq.gz pvt 72 M No Yes Reverse Right 167.00 80.0 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
SL2.08Re_S60 AD-CAB_4014 OA 92 bone SL2-08Re_S60_L001_R1_001.fastq.gz pvt 71 M Yes No Reverse Right 170.00 99.0 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
SM.027_S26 AD-CAB_2001 Insta 27 capsule SM-027_S26_L001_R1_001.fastq.gz pub 18 M NA NA NA Left 188.00 80.0 22.60 2 Ever_smoker No No No No 5.2 87 90 3.9 4.9 5.4 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
SM.028_S27 AD-CAB_2002 Insta 28 capsule SM-028_S27_L001_R1_001.fastq.gz pub 22 F NA NA NA Right 164.00 73.0 27.10 1 Never_smoker No No No No 2.9 58 90 3.6 3.4 4.8 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
SM.029_S28 AD-CAB_2003 Insta 29 capsule SM-029_S28_L001_R1_001.fastq.gz pvt 21 M NA NA NA Right 178.00 105.0 33.00 1 Ever_smoker No NA No Yes 3.0 85 90 5.8 4.3 5.1 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
SM.030_S29 AD-CAB_2004 Insta 30 capsule SM-030_S29_L001_R1_001.fastq.gz pvt 19 M NA NA NA Left 181.00 94.5 29.00 1 Never_smoker No No No Normal 2.9 69 90 5.7 4.8 5.4 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
SM.031_S30 AD-CAB_2005 Insta 31 capsule SM-031_S30_L001_R1_001.fastq.gz NA 27 M NA NA NA Right NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
SM.032_S31 AD-CAB_2006 Insta 32 capsule SM-032_S31_L001_R1_001.fastq.gz pub 19 F NA NA NA Left 160.00 47.0 18.40 1 Ever_smoker No No No No 8.2 79 90 3.8 4.2 4.9 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
SM.033_S32 AD-CAB_2007 Insta 33 capsule SM-033_S32_L001_R1_001.fastq.gz pub 18 M NA NA NA Right 180.00 74.0 22.80 1 Never_smoker No NA No Yes 2.9 81 90 5.5 6.6 4.9 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
SM.034_S33 AD-CAB_2008 Insta 34 capsule SM-034_S33_L001_R1_001.fastq.gz pub 21 M NA NA NA Right 195.00 129.0 33.90 1 Never_smoker No No No No 2.9 96 90 5.9 4.9 4.7 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
SM.035_S34 AD-CAB_2009 Insta 35 capsule SM-035_S34_L001_R1_001.fastq.gz pub 18 M NA NA NA Right 192.00 98.0 26.60 2 Ever_smoker No No No No 2.9 82 90 4.1 4.6 5.7 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
SM.036_S35 AD-CAB_2010 Insta 36 capsule SM-036_S35_L001_R1_001.fastq.gz pub 21 M NA NA NA Left 180.00 115.0 35.50 2 Ever_smoker No No No No 3.2 84 90 5.4 4.4 5.3 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
SM.037_S36 AD-CAB_2011 Insta 37 capsule SM-037_S36_L001_R1_001.fastq.gz pub 30 M NA NA NA Left 178.00 82.0 25.90 1 Ever_smoker No No No No 2.9 94 90 8.2 5.1 5.3 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
SM.038_S37 AD-CAB_2012 Insta 38 capsule SM-038_S37_L001_R1_001.fastq.gz pvt 35 M NA NA NA Left 188.00 75.0 21.20 1 Never_smoker No NA No No 2.9 106 78 4.7 5.4 5.2 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
SM.039_S38 AD-CAB_2013 Insta 39 capsule SM-039_S38_L001_R1_001.fastq.gz pub 21 M NA NA NA Left 175.00 96.0 31.30 1 Never_smoker No No No No NA 93 90 4.1 4.6 4.9 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
SM.040_S39 AD-CAB_2014 Insta 40 capsule SM-040_S39_L001_R1_001.fastq.gz pub 29 M NA NA NA Right 185.00 105.0 30.70 1 Never_smoker No No No No 2.9 81 90 6.5 5.0 4.6 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
SM.041_S40 AD-CAB_2015 Insta 41 capsule SM-041_S40_L001_R1_001.fastq.gz pub 23 M NA NA NA Left 175.00 82.0 26.80 1 Ever_smoker No No No No 2.9 94 90 4.5 4.1 4.9 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
SM.042_S41 AD-CAB_2016 Insta 42 capsule SM-042_S41_L001_R1_001.fastq.gz pvt 35 M NA NA NA Right 187.00 80.0 22.90 1 Never_smoker No No No No 2.9 103 81 4.9 4.5 5.0 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
SM.043_S42 AD-CAB_2017 Insta 43 capsule SM-043_S42_L001_R1_001.fastq.gz pub 19 M NA NA NA Right 195.00 118.0 31.00 2 Never_smoker No No No No 2.9 95 90 6.2 4.2 4.5 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
SM.044_S43 AD-CAB_2018 Insta 44 capsule SM-044_S43_L001_R1_001.fastq.gz pub 27 M NA NA NA Right 170.00 82.0 28.40 1 Never_smoker No No No No NA 95 90 6.2 5.4 5.5 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
SM.045_S44 AD-CAB_2019 Insta 45 capsule SM-045_S44_L001_R1_001.fastq.gz pub 27 M NA NA NA Left 180.00 76.0 23.50 1 Ever_smoker No NA No No 2.9 65 90 6.9 4.5 4.9 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
SM.046_S45 AD-CAB_2020 Insta 46 capsule SM-046_S45_L001_R1_001.fastq.gz pub 20 M NA NA NA Left 181.00 85.0 25.90 1 Never_smoker No No No No 2.9 105 86 5.8 4.4 5.0 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
SM.047_S46 AD-CAB_2021 Insta 47 capsule SM-047_S46_L001_R1_001.fastq.gz pub 18 M NA NA NA Left 176.00 65.0 21.00 1 Never_smoker No No No No 2.9 68 90 4.5 4.3 4.8 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
SM.048_S47 AD-CAB_2022 Insta 48 capsule SM-048_S47_L001_R1_001.fastq.gz pvt 32 F NA NA NA Left 166.00 66.0 24.00 1 Never_smoker No NA No Yes 2.9 52 90 3.1 4.1 5.3 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
SM.049_S48 AD-CAB_2023 Insta 49 capsule SM-049_S48_L001_R1_001.fastq.gz pvt 27 F NA NA NA Left 170.00 66.0 22.80 1 Never_smoker No No No No 2.9 91 75 5.5 4.3 4.9 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
SM.050_S49 AD-CAB_2024 Insta 50 capsule SM-050_S49_L001_R1_001.fastq.gz pvt 21 M NA NA NA Right 189.00 83.0 23.20 1 Never_smoker No NA No No 2.9 87 90 3.9 4.7 4.9 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
SM.051_S50 AD-CAB_2025 Insta 51 capsule SM-051_S50_L001_R1_001.fastq.gz pvt 21 M NA NA NA Right 173.00 92.0 31.00 1 Ever_smoker No NA No No 2.9 71 90 4.1 4.7 5.8 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
SM.052_S51 AD-CAB_2026 Insta 52 capsule SM-052_S51_L001_R1_001.fastq.gz pub 23 F NA NA NA Left 169.00 57.0 20.00 2 Ever_smoker No No No Yes 2.9 68 90 4.5 4.6 5.1 No NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA

Import read counts

Importing osteoarthritis (OA) and shoulder instability (SI) data separately. Aggregate Lanes together.

if ( !file.exists("counts.rds") ) {
  tmp <- read.table("../fastq/3col.tsv.gz",header=F)
  x <- as.matrix(acast(tmp, V2~V1, value.var="V3", fun.aggregate = sum))
  x <- as.data.frame(x)
  accession <- sapply((strsplit(rownames(x),"\\|")),"[[",2)
  symbol<-sapply((strsplit(rownames(x),"\\|")),"[[",6)
  x$geneid <- paste(accession,symbol)
  xx <- aggregate(. ~ geneid,x,sum)
  rownames(xx) <- xx$geneid
  #colnames <- gsub("T0R","T0",colnames(xx))
  xx$geneid = NULL
  xx <- round(xx)
  txx <- data.frame(t(xx))
  txx$sample <- gsub("_L001","",rownames(txx))
  txx$sample <- gsub("_L002","",txx$sample)
  txx2 <- aggregate(. ~ sample,txx,sum)
  rownames(txx2) <- txx2$sample
  txx2$sample = NULL
  axx <- data.frame(t(txx2))
  axx <- axx[,order(colnames(axx))]
  colnames(axx) <- gsub("^X","",colnames(axx))
  axx <- axx[,order(colnames(axx))]
  remove(tmp,x,xx,txx,txx2)
  gc()
  saveRDS(axx,"counts.rds")
} else {
  axx <- readRDS("counts.rds")
}

Running some checks to ensure that the sample sheet matches the list of datasets.

message("Dimesions of sample sheet:")
## Dimesions of sample sheet:
dim(ss)
## [1] 165  48
message("Dimesions of count matrix:")
## Dimesions of count matrix:
dim(axx)
## [1] 60651   179
message("Number of duplicated samples in the count matrix:")
## Number of duplicated samples in the count matrix:
length(which(duplicated(colnames(axx))))
## [1] 0
message("sample sheet entries with matching datasets")
## sample sheet entries with matching datasets
length(which(rownames(ss) %in% colnames(axx)))
## [1] 165
message("datasets not found in sample sheet")
## datasets not found in sample sheet
colnames(axx)[!colnames(axx) %in% rownames(ss)]
##  [1] "4001.41F"     "4001.41M"     "4002.42F"     "4002.42M"     "4003.43F"    
##  [6] "4003.43M"     "4004.44F"     "4004.44M"     "4005.45F"     "4005.45M"    
## [11] "4006.46F"     "4006.46M"     "SL2.29Re_S61" "SL2.31Re_S62"

There are some datasets not included in the sample sheet so I will ask Sam to get those clinical data so they can be included in future.

QC analysis

Here I’ll look at a few different quality control measures.

par(mar=c(5,8,3,1))
barplot(colSums(axx),horiz=TRUE,las=1,xlab="OA num reads")

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

Some of those read counts are quite low.

MDS plot

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

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

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

dim(axx)
## [1] 60651   179
unique(ss$Tissue)
## [1] "capsule"  "tendon"   "tear"     "bone"     "synovium"
axx2 <- axx[,colnames(axx) %in% rownames(ss)]
mds <- cmdscale(dist(t(axx2)))

factor(ss$Tissue)
##   [1] capsule  tendon   tear     capsule  tendon   tear     bone     capsule 
##   [9] synovium capsule  tendon   tear     bone     capsule  synovium capsule 
##  [17] tendon   tear     bone     capsule  synovium capsule  tendon   tear    
##  [25] bone     capsule  synovium capsule  tendon   tear     bone     capsule 
##  [33] synovium capsule  tendon   tear     bone     capsule  synovium capsule 
##  [41] tendon   tear     bone     capsule  synovium capsule  tendon   tear    
##  [49] bone     capsule  synovium capsule  tendon   tear     bone     capsule 
##  [57] synovium capsule  tendon   tear     bone     capsule  synovium capsule 
##  [65] tendon   tear     capsule  tendon   tear     bone     capsule  synovium
##  [73] capsule  tendon   tear     capsule  tendon   tear     capsule  tendon  
##  [81] tear     capsule  tendon   tear     capsule  tendon   tear     capsule 
##  [89] tendon   tear     capsule  tendon   tear     capsule  tendon   tear    
##  [97] bone     capsule  synovium bone     capsule  synovium bone     capsule 
## [105] synovium bone     capsule  synovium bone     capsule  synovium bone    
## [113] capsule  synovium capsule  tendon   tear     capsule  tendon   tear    
## [121] capsule  tendon   tear     bone     capsule  synovium capsule  tendon  
## [129] tear     bone     capsule  synovium capsule  tendon   tear     bone    
## [137] capsule  synovium bone     capsule  capsule  capsule  capsule  capsule 
## [145] capsule  capsule  capsule  capsule  capsule  capsule  capsule  capsule 
## [153] capsule  capsule  capsule  capsule  capsule  capsule  capsule  capsule 
## [161] capsule  capsule  capsule  capsule  capsule 
## Levels: bone capsule synovium tear tendon
ss$tis <- as.numeric(factor(ss$Tissue)) +1

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

legend("topright", legend=c("bone", "capsule", "synovium", "tear", "tendon"),
       col=2:6, pch=19, cex=1.2)

plot(mds, xlab="Coordinate 1", ylab="Coordinate 2",
  type = "p",bty="n",pch=19, cex=3 ,col=ss$tis)
#text(mds, labels=rownames(mds), cex=0.7 )

legend("topright", legend=c("bone", "capsule", "synovium", "tear", "tendon"),
       col=2:6, pch=19, cex=1.2)

Compare cuff arth to primary OA control for age sex and CRP in bone

Need to:

  • select Cuff and OA samples

  • select bone datasets only

ss0 <- subset(ss,Cuff_Arthropathy=="Yes" | Primary_OA=="Yes")

ss0b <- subset(ss0,Tissue=="bone")

ss0b %>%
  kbl(caption = "sample sheet for cuff arth vs OA (bone)") %>%
  kable_paper("hover", full_width = F)
sample sheet for cuff arth vs OA (bone)
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 tis
10B_S21 AD-CAB_4010 OA 90 bone 10B_S21_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 2
11B_S22 AD-CAB_4011 OA 87 bone 11B_S22_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 2
12B_S23 AD-CAB_4012 OA 91 bone 12B_S23_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 2
13B_S24 AD-CAB_4013 OA 89 bone 13B_S24_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 2
14B_S25 AD-CAB_4014 OA 92 bone 14B_S25_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 2
15B_S26 AD-CAB_4015 OA 93 bone 15B_S26_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 2
16B_S27 AD-CAB_4016 OA 99 bone 16B_S27_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 2
17B_S28 AD-CAB_4017 OA 96 bone 17B_S28_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 2
18B_S29 AD-CAB_4018 OA 97 bone 18B_S29_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 2
19B_S30 AD-CAB_4019 OA 95 bone 19B_S30_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 2
20B_S31 AD-CAB_4020 OA 98 bone 20B_S31_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 2
4001.41B AD-CAB_4001 OA 84 bone 4001-41B_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 2
4002.42B AD-CAB_4002 OA 80 bone 4002-42B_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 2
4003.43B AD-CAB_4003 OA 81 bone 4003-43B_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 2
4004.44B AD-CAB_4004 OA 82 bone 4004-44B_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 2
4005.45B AD-CAB_4005 OA 83 bone 4005-45B_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 2
4006.46B AD-CAB_4006 OA 78 bone 4006-46B_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 2
7B_S18 AD-CAB_4007 OA 85 bone 7B_S18_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 2
8B_S19 AD-CAB_4008 OA 86 bone 8B_S19_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 2
9B_S20 AD-CAB_4009 OA 88 bone 9B_S20_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 2
SL2.08Re_S60 AD-CAB_4014 OA 92 bone SL2-08Re_S60_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 2
message("Metabolic syndrome classification")
## Metabolic syndrome classification
ss0b$Metabolic_Syndrome
##  [1] "No"  "No"  "Yes" "Yes" "Yes" "No"  "No"  "No"  "No"  "No"  "Yes" "Yes"
## [13] "Yes" "Yes" "Yes" "No"  "No"  "Yes" "No"  "No"  "Yes"
message("Age data")
## Age data
ss0b$Age
##  [1] 80 76 71 69 71 76 76 79 73 65 62 69 59 74 69 74 81 72 70 72 71
message("Sex data")
## Sex data
ss0b$Sex
##  [1] "F" "M" "F" "F" "M" "M" "F" "F" "F" "F" "M" "F" "M" "F" "F" "F" "F" "M" "M"
## [20] "M" "M"
x0b <- axx[,colnames(axx) %in% rownames(ss0b)]
message("count matrix dimensions before filtering out low genes")
## count matrix dimensions before filtering out low genes
dim(x0b)
## [1] 60651    21
message("count matrix dimensions after filtering out low genes")
## count matrix dimensions after filtering out low genes
x0b <- x0b[which(rowMeans(x0b)>=10),]
dim(x0b)
## [1] 18383    21
x0b <- x0b[,order(colnames(x0b))]
ss0b <- ss0b[order(rownames(ss0b)),]

ss0b %>%
  kbl(caption = "sample sheet") %>%
  kable_paper("hover", full_width = F)
sample sheet
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 tis
10B_S21 AD-CAB_4010 OA 90 bone 10B_S21_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 2
11B_S22 AD-CAB_4011 OA 87 bone 11B_S22_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 2
12B_S23 AD-CAB_4012 OA 91 bone 12B_S23_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 2
13B_S24 AD-CAB_4013 OA 89 bone 13B_S24_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 2
14B_S25 AD-CAB_4014 OA 92 bone 14B_S25_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 2
15B_S26 AD-CAB_4015 OA 93 bone 15B_S26_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 2
16B_S27 AD-CAB_4016 OA 99 bone 16B_S27_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 2
17B_S28 AD-CAB_4017 OA 96 bone 17B_S28_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 2
18B_S29 AD-CAB_4018 OA 97 bone 18B_S29_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 2
19B_S30 AD-CAB_4019 OA 95 bone 19B_S30_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 2
20B_S31 AD-CAB_4020 OA 98 bone 20B_S31_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 2
4001.41B AD-CAB_4001 OA 84 bone 4001-41B_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 2
4002.42B AD-CAB_4002 OA 80 bone 4002-42B_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 2
4003.43B AD-CAB_4003 OA 81 bone 4003-43B_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 2
4004.44B AD-CAB_4004 OA 82 bone 4004-44B_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 2
4005.45B AD-CAB_4005 OA 83 bone 4005-45B_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 2
4006.46B AD-CAB_4006 OA 78 bone 4006-46B_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 2
7B_S18 AD-CAB_4007 OA 85 bone 7B_S18_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 2
8B_S19 AD-CAB_4008 OA 86 bone 8B_S19_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 2
9B_S20 AD-CAB_4009 OA 88 bone 9B_S20_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 2
SL2.08Re_S60 AD-CAB_4014 OA 92 bone SL2-08Re_S60_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 2
poa <- (as.numeric(factor(ss0b$Primary_OA)) +1 )*2
mds <- plotMDS(x0b,col=poa,pch=19,cex=2)
text(mds,labels=colnames(x0b),cex=0.8)
mtext("blue=ctrl, purple=OA")

pdf("mds0b.pdf")
mds <- plotMDS(x0b,col=poa,pch=19,cex=2)
text(mds,labels=colnames(x0b),cex=0.8)
mtext("blue=ctrl, purple=OA")
dev.off()
## X11cairo 
##        2
message("here is the model spec:")
## here is the model spec:
dds <- DESeqDataSetFromMatrix(countData = x0b , colData = ss0b, design = ~ Primary_OA)
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
## -- replacing outliers and refitting for 352 genes
## -- DESeq argument 'minReplicatesForReplace' = 7 
## -- original counts are preserved in counts(dds)
## estimating dispersions
## fitting model and testing
z<- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])

dge[1:20,1:6] %>%
  kbl(caption = "Top DEGs in bone between cuff arthropathy and OA patients (not correcting for age and sex)") %>%
  kable_paper("hover", full_width = F)
Top DEGs in bone between cuff arthropathy and OA patients (not correcting for age and sex)
baseMean log2FoldChange lfcSE stat pvalue padj
ENSG00000231475.3.IGHV4.31 113.354037 6.9274367 1.3009571 5.324877 0.0000001 0.0018396
ENSG00000160221.18.GATD3A 70.673997 -3.0178695 0.5807588 -5.196425 0.0000002 0.0018498
ENSG00000226065.1.ZBTB45P2 13.633349 5.6825934 1.2070574 4.707807 0.0000025 0.0151990
ENSG00000231187.3.AL356056.2 11.902012 5.4870840 1.1911387 4.606587 0.0000041 0.0186349
ENSG00000184923.12.NUTM2A 20.418626 3.8952646 0.9541063 4.082632 0.0000445 0.1050535
ENSG00000204176.14.SYT15 59.723331 1.4876952 0.3645375 4.081049 0.0000448 0.1050535
ENSG00000237541.4.HLA.DQA2 102.838822 3.4494118 0.8453578 4.080416 0.0000450 0.1050535
ENSG00000233937.7.CTC.338M12.4 33.402510 2.1079769 0.5222860 4.036059 0.0000544 0.1050535
ENSG00000280071.4.GATD3B 437.645856 0.7596460 0.1882586 4.035120 0.0000546 0.1050535
ENSG00000109063.15.MYH3 43.805709 1.1627971 0.2891045 4.022066 0.0000577 0.1050535
ENSG00000115128.7.SF3B6 289.582072 -0.9178741 0.2328682 -3.941604 0.0000809 0.1339901
ENSG00000254395.1.IGHV4.55 72.919096 3.6203414 0.9264473 3.907768 0.0000932 0.1413590
ENSG00000279873.2.LINC01126 9.619567 3.1775559 0.8260587 3.846647 0.0001197 0.1581870
ENSG00000229391.7.HLA.DRB6 26.108495 3.1380284 0.8165895 3.842847 0.0001216 0.1581870
ENSG00000152380.10.FAM151B 26.094286 -1.0863202 0.2952610 -3.679186 0.0002340 0.2667778
ENSG00000083099.11.LYRM2 158.613971 -0.7606543 0.2070305 -3.674117 0.0002387 0.2667778
ENSG00000275464.5.FP565260.1 152.484720 1.1697572 0.3206695 3.647859 0.0002644 0.2667778
ENSG00000105258.9.POLR2I 111.099706 -0.7580720 0.2085126 -3.635616 0.0002773 0.2667778
ENSG00000242861.1.AL591895.1 22.734813 1.7209944 0.4749699 3.623376 0.0002908 0.2667778
ENSG00000169288.18.MRPL1 118.368539 -1.1394894 0.3172411 -3.591872 0.0003283 0.2667778
message("here is the model spec:")
## here is the model spec:
dds <- DESeqDataSetFromMatrix(countData = x0b , colData = ss0b, design = ~ Age + Sex + CRP + Primary_OA )
## 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),])

dge[1:20,1:6] %>%
  kbl(caption = "Top DEGs in bone between cuff arthropathy and OA patients adjusted for age, sex and CRP.") %>%
  kable_paper("hover", full_width = F)
Top DEGs in bone between cuff arthropathy and OA patients adjusted for age, sex and CRP.
baseMean log2FoldChange lfcSE stat pvalue padj
ENSG00000231475.3.IGHV4.31 113.35404 7.691303 1.3877002 5.542482 0.00e+00 0.0005410
ENSG00000280411.1.IGHV1.69D 352.87638 4.073358 0.7512319 5.422238 1.00e-07 0.0005410
ENSG00000160221.18.GATD3A 70.67400 -3.070696 0.5790845 -5.302673 1.00e-07 0.0006993
ENSG00000261796.1.ISY1.RAB43 122.47263 2.575174 0.5688546 4.526946 6.00e-06 0.0244115
ENSG00000211966.2.IGHV5.51 379.90156 4.437549 0.9857874 4.501528 6.70e-06 0.0244115
ENSG00000226065.1.ZBTB45P2 13.63335 5.661125 1.2688283 4.461695 8.10e-06 0.0244115
ENSG00000280071.4.GATD3B 437.64586 0.842649 0.1920091 4.388589 1.14e-05 0.0244115
ENSG00000270550.1.IGHV3.30 929.74531 3.974320 0.9076084 4.378893 1.19e-05 0.0244115
ENSG00000231187.3.AL356056.2 11.90201 5.391960 1.2314707 4.378472 1.20e-05 0.0244115
ENSG00000167476.10.JSRP1 69.52245 2.933264 0.6760584 4.338774 1.43e-05 0.0263392
ENSG00000211970.3.IGHV4.61 204.01512 4.750504 1.1310091 4.200235 2.67e-05 0.0445601
ENSG00000211951.2.IGHV2.26 54.88153 4.409251 1.0601240 4.159184 3.19e-05 0.0473066
ENSG00000236778.8.INTS6.AS1 53.12222 -1.213004 0.2923899 -4.148582 3.35e-05 0.0473066
ENSG00000237541.4.HLA.DQA2 102.83882 3.544540 0.8638749 4.103071 4.08e-05 0.0535342
ENSG00000206341.7.HLA.H 42.42260 2.875753 0.7047631 4.080453 4.49e-05 0.0550853
ENSG00000228049.7.POLR2J2 30.45304 2.618078 0.6458746 4.053539 5.04e-05 0.0579623
ENSG00000211962.2.IGHV1.46 159.03236 3.745840 0.9313057 4.022138 5.77e-05 0.0623642
ENSG00000254395.1.IGHV4.55 72.91910 3.875863 0.9673194 4.006808 6.15e-05 0.0628543
ENSG00000211945.2.IGHV1.18 237.89449 4.064690 1.0220687 3.976924 6.98e-05 0.0643239
ENSG00000184923.12.NUTM2A 20.41863 4.137140 1.0404373 3.976347 7.00e-05 0.0643239
dge0b <- dge

maplot(dge0b,"cuff arthropathy vs OA in bone")

make_volcano(dge0b,"cuff arthropathy vs OA in bone")

make_heatmap(dge0b,"cuff arthropathy vs OA in bone",groups=as.numeric(factor(ss0b$Primary_OA)),x0b,n=50)

Now for cuff arthropathy vs OA in capsule.

ss0 <- subset(ss,Cuff_Arthropathy=="Yes" | Primary_OA=="Yes")

ss0c <- subset(ss0,Tissue=="capsule")

ss0c %>%
  kbl(caption = "sample sheet for cuff arth vs OA (capsule)") %>%
  kable_paper("hover", full_width = F)
sample sheet for cuff arth vs OA (capsule)
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 tis
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 3
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 3
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 3
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 3
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 3
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 3
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 3
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 3
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 3
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 3
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 3
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 3
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 3
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 3
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 3
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 3
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 3
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 3
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 3
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 3
message("Metabolic syndrome classification")
## Metabolic syndrome classification
ss0c$Metabolic_Syndrome
##  [1] "No"  "No"  "Yes" "Yes" "Yes" "No"  "No"  "No"  "No"  "No"  "Yes" "Yes"
## [13] "Yes" "Yes" "Yes" "No"  "No"  "Yes" "No"  "No"
message("Age data")
## Age data
ss0c$Age
##  [1] 80 76 71 69 71 76 76 79 73 65 62 69 59 74 69 74 81 72 70 72
message("Sex data")
## Sex data
ss0c$Sex
##  [1] "F" "M" "F" "F" "M" "M" "F" "F" "F" "F" "M" "F" "M" "F" "F" "F" "F" "M" "M"
## [20] "M"
x0c <- axx[,colnames(axx) %in% rownames(ss0c)]
message("count matrix dimensions before filtering out low genes")
## count matrix dimensions before filtering out low genes
dim(x0c)
## [1] 60651    20
x0c <- x0c[which(rowMeans(x0c)>=10),]
message("count matrix dimensions after filtering out low genes")
## count matrix dimensions after filtering out low genes
dim(x0c)
## [1] 17340    20
x0c <- x0c[,order(colnames(x0c))]
ss0c <- ss0c[order(rownames(ss0c)),]

plotMDS(x0c)

poa <- (as.numeric(factor(ss0c$Primary_OA)) +1 )*2
mds <- plotMDS(x0c,col=poa,pch=19,cex=2)
text(mds,labels=colnames(x0c),cex=0.8)
mtext("blue=ctrl, purple=OA")

pdf("mds0c.pdf")
mds <- plotMDS(x0c,col=poa,pch=19,cex=2)
text(mds,labels=colnames(x0c),cex=0.8)
mtext("blue=ctrl, purple=OA")
dev.off()
## X11cairo 
##        2
message("here is the model spec:")
## here is the model spec:
dds <- DESeqDataSetFromMatrix(countData = x0c , colData = ss0c, design = ~ Primary_OA)
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
## -- replacing outliers and refitting for 120 genes
## -- DESeq argument 'minReplicatesForReplace' = 7 
## -- original counts are preserved in counts(dds)
## estimating dispersions
## fitting model and testing
z<- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])
dge[1:20,1:6] %>%
  kbl(caption = "Top DEGs in bone between cuff arthropathy and OA patients (not correcting for age and sex)") %>%
  kable_paper("hover", full_width = F)
Top DEGs in bone between cuff arthropathy and OA patients (not correcting for age and sex)
baseMean log2FoldChange lfcSE stat pvalue padj
ENSG00000275464.5.FP565260.1 204.637204 1.1575723 0.2314933 5.000458 0.0000006 0.0066934
ENSG00000002745.13.WNT16 38.834851 -5.1913921 1.0505248 -4.941713 0.0000008 0.0066934
ENSG00000237541.4.HLA.DQA2 260.107022 5.1185260 1.1058763 4.628480 0.0000037 0.0209470
ENSG00000101198.15.NKAIN4 10.813675 3.4147964 0.7470064 4.571308 0.0000048 0.0209470
ENSG00000205054.8.LINC01121 10.112682 -2.0623020 0.4592136 -4.490943 0.0000071 0.0245160
ENSG00000229391.7.HLA.DRB6 38.352632 3.3800505 0.7695016 4.392519 0.0000112 0.0299599
ENSG00000154645.14.CHODL 9.613827 -3.9819846 0.9101245 -4.375209 0.0000121 0.0299599
ENSG00000168010.11.ATG16L2 616.886068 0.9339491 0.2230942 4.186345 0.0000283 0.0612571
ENSG00000280411.1.IGHV1.69D 12.480899 5.6086773 1.4107607 3.975640 0.0000702 0.1348196
ENSG00000211644.3.IGLV1.51 8.002735 5.1943864 1.3581213 3.824685 0.0001309 0.2099633
ENSG00000166233.15.ARIH1 389.560824 -0.4047333 0.1059589 -3.819720 0.0001336 0.2099633
ENSG00000103507.14.BCKDK 275.790648 0.6700369 0.1769645 3.786278 0.0001529 0.2202944
ENSG00000101246.20.ARFRP1 395.864550 0.4096844 0.1105328 3.706452 0.0002102 0.2794948
ENSG00000087152.15.ATXN7L3 456.537477 0.4315753 0.1182275 3.650380 0.0002619 0.3113290
ENSG00000178927.18.CYBC1 724.759196 0.5182235 0.1422765 3.642368 0.0002701 0.3113290
ENSG00000102383.14.ZDHHC15 33.594477 -0.8235692 0.2272006 -3.624855 0.0002891 0.3123798
ENSG00000213983.12.AP1G2 418.592735 0.5891596 0.1636295 3.600571 0.0003175 0.3228798
ENSG00000254415.3.SIGLEC14 28.581547 2.0853711 0.5865130 3.555541 0.0003772 0.3463340
ENSG00000250579.2.CTD.2297D10.2 17.042668 2.8158810 0.7952587 3.540836 0.0003989 0.3463340
ENSG00000127561.15.SYNGR3 12.517528 3.0752735 0.8688120 3.539631 0.0004007 0.3463340
message("here is the model spec:")
## here is the model spec:
dds <- DESeqDataSetFromMatrix(countData = x0c , colData = ss0c, design = ~ Age + Sex + CRP + Primary_OA )
## 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
## 2 rows did not converge in beta, labelled in mcols(object)$betaConv. Use larger maxit argument with nbinomWaldTest
z<- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])

dge[1:20,1:6] %>%
  kbl(caption = "Top DEGs in bone between cuff arthropathy and OA patients adjusted for age, sex and CRP.") %>%
  kable_paper("hover", full_width = F)
Top DEGs in bone between cuff arthropathy and OA patients adjusted for age, sex and CRP.
baseMean log2FoldChange lfcSE stat pvalue padj
ENSG00000211973.2.IGHV1.69 13.803131 22.0625344 3.8975388 5.660632 0.0000000 0.0002615
ENSG00000237541.4.HLA.DQA2 260.107022 5.6246872 1.1617163 4.841705 0.0000013 0.0111609
ENSG00000280071.4.GATD3B 468.234722 0.8091452 0.1731051 4.674301 0.0000029 0.0129562
ENSG00000275464.5.FP565260.1 204.637204 1.1939259 0.2555715 4.671592 0.0000030 0.0129562
ENSG00000133063.16.CHIT1 316.450024 -5.4778414 1.2028631 -4.554002 0.0000053 0.0182537
ENSG00000002745.13.WNT16 38.834851 -4.3718246 0.9886702 -4.421924 0.0000098 0.0282716
ENSG00000229391.7.HLA.DRB6 38.352632 3.5495334 0.8266659 4.293794 0.0000176 0.0435098
ENSG00000280411.1.IGHV1.69D 12.480899 5.7879468 1.3718539 4.219069 0.0000245 0.0525154
ENSG00000205054.8.LINC01121 10.112682 -2.1164083 0.5044773 -4.195250 0.0000273 0.0525154
ENSG00000160221.18.GATD3A 82.776968 -2.7166420 0.6543569 -4.151621 0.0000330 0.0538235
ENSG00000101198.15.NKAIN4 10.813675 3.2600905 0.7867194 4.143905 0.0000341 0.0538235
ENSG00000228021.7.AL158835.1 31.289387 -3.5427015 0.9022244 -3.926630 0.0000861 0.1232797
ENSG00000168010.11.ATG16L2 616.886068 0.8387859 0.2145416 3.909665 0.0000924 0.1232797
ENSG00000151303.11.AL136982.1 49.251371 -1.5553588 0.4042022 -3.847972 0.0001191 0.1475134
ENSG00000211644.3.IGLV1.51 8.002735 5.3030077 1.4035335 3.778326 0.0001579 0.1825160
ENSG00000084764.12.MAPRE3 165.958699 0.8034945 0.2139299 3.755878 0.0001727 0.1872014
ENSG00000103507.14.BCKDK 275.790648 0.7115538 0.1937068 3.673355 0.0002394 0.2332436
ENSG00000204677.13.FAM153CP 26.629313 -2.5524506 0.6954049 -3.670453 0.0002421 0.2332436
ENSG00000242512.9.LINC01206 67.215419 -3.0092269 0.8249050 -3.647968 0.0002643 0.2412291
ENSG00000254415.3.SIGLEC14 28.581547 2.2637657 0.6364971 3.556600 0.0003757 0.2886297
dge0c <- dge

maplot(dge0c,"cuff arthropathy vs OA in capsule")

make_volcano(dge0c,"cuff arthropathy vs OA in capsule")

make_heatmap(dge0c,"cuff arthropathy vs OA in capsule",groups=as.numeric(factor(ss0b$Primary_OA)),x0b,n=50)

The effect of metabolic syndrome in OA

Need to:

  • select bone datasets only

  • select OA samples only

  • look at the effect of metabolic syndrome in OA (ss1).

ss1 <- subset(ss,Primary_OA=="Yes")

ss1b <- subset(ss1,Tissue=="bone")

message("Metabolic syndrome classification")
## Metabolic syndrome classification
ss1b$Metabolic_Syndrome
##  [1] "No"  "Yes" "Yes" "No"  "No"  "No"  "No"  "No"  "Yes" "Yes" "Yes" "Yes"
## [13] "No"  "No"  "Yes" "No"  "Yes"
message("Age data")
## Age data
ss1b$Age
##  [1] 76 71 71 76 76 79 73 65 62 69 59 69 74 81 72 70 71
message("Sex data")
## Sex data
ss1b$Sex
##  [1] "M" "F" "M" "M" "F" "F" "F" "F" "M" "F" "M" "F" "F" "F" "M" "M" "M"
x1b <- axx[,colnames(axx) %in% rownames(ss1b)]
message("count matrix dimensions before filtering out low genes")
## count matrix dimensions before filtering out low genes
dim(x1b)
## [1] 60651    17
x1b <- x1b[which(rowMeans(x1b)>=10),]
message("count matrix dimensions after filtering out low genes")
## count matrix dimensions after filtering out low genes
dim(x1b)
## [1] 18412    17
x1b <- x1b[,order(colnames(x1b))]
ss1b <- ss1b[order(rownames(ss1b)),]

ss1b %>%
  kbl(caption = "sample sheet") %>%
  kable_paper("hover", full_width = F)
sample sheet
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 tis
11B_S22 AD-CAB_4011 OA 87 bone 11B_S22_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 2
12B_S23 AD-CAB_4012 OA 91 bone 12B_S23_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 2
14B_S25 AD-CAB_4014 OA 92 bone 14B_S25_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 2
15B_S26 AD-CAB_4015 OA 93 bone 15B_S26_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 2
16B_S27 AD-CAB_4016 OA 99 bone 16B_S27_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 2
17B_S28 AD-CAB_4017 OA 96 bone 17B_S28_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 2
18B_S29 AD-CAB_4018 OA 97 bone 18B_S29_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 2
19B_S30 AD-CAB_4019 OA 95 bone 19B_S30_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 2
20B_S31 AD-CAB_4020 OA 98 bone 20B_S31_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 2
4001.41B AD-CAB_4001 OA 84 bone 4001-41B_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 2
4002.42B AD-CAB_4002 OA 80 bone 4002-42B_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 2
4004.44B AD-CAB_4004 OA 82 bone 4004-44B_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 2
4005.45B AD-CAB_4005 OA 83 bone 4005-45B_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 2
4006.46B AD-CAB_4006 OA 78 bone 4006-46B_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 2
7B_S18 AD-CAB_4007 OA 85 bone 7B_S18_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 2
8B_S19 AD-CAB_4008 OA 86 bone 8B_S19_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 2
SL2.08Re_S60 AD-CAB_4014 OA 92 bone SL2-08Re_S60_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 2
plotMDS(x1b)

poa <- (as.numeric(factor(ss1b$Metabolic_Syndrome)) +1 )*2
mds <- plotMDS(x1b,col=poa,pch=19,cex=2)
text(mds,labels=colnames(x1b),cex=0.8)
mtext("blue=ctrl, purple=MS")

pdf("mds1b.pdf")
mds <- plotMDS(x1b,col=poa,pch=19,cex=2)
text(mds,labels=colnames(x1b),cex=0.8)
mtext("blue=ctrl, purple=MS")
dev.off()
## X11cairo 
##        2
message("here is the model spec:")
## here is the model spec:
dds <- DESeqDataSetFromMatrix(countData = x1b , colData = ss1b, design = ~ Metabolic_Syndrome )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
## -- replacing outliers and refitting for 220 genes
## -- DESeq argument 'minReplicatesForReplace' = 7 
## -- original counts are preserved in counts(dds)
## estimating dispersions
## fitting model and testing
z<- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])

dge[1:20,1:6] %>%
  kbl(caption = "Top DEGs in bone between OA patients with and without metabolic syndrome.") %>%
  kable_paper("hover", full_width = F)
Top DEGs in bone between OA patients with and without metabolic syndrome.
baseMean log2FoldChange lfcSE stat pvalue padj
ENSG00000185269.12.NOTUM 21.84588 4.9570549 0.6003943 8.256332 0 0.00e+00
ENSG00000182600.9.SNORC 80.88169 4.4220506 0.6359907 6.953011 0 0.00e+00
ENSG00000167123.19.CERCAM 872.63471 2.2353965 0.3375271 6.622864 0 2.00e-07
ENSG00000138028.16.CGREF1 171.46614 2.5876088 0.3921460 6.598585 0 2.00e-07
ENSG00000142552.8.RCN3 954.08139 1.6072791 0.2467885 6.512779 0 3.00e-07
ENSG00000184471.8.C1QTNF8 27.80265 3.6632986 0.5911882 6.196501 0 1.70e-06
ENSG00000130600.19.H19 2387.16438 2.7108388 0.4584606 5.912915 0 8.30e-06
ENSG00000111199.12.TRPV4 163.35305 2.7838090 0.4741709 5.870898 0 9.40e-06
ENSG00000183010.17.PYCR1 297.80178 1.6239497 0.2790084 5.820433 0 1.13e-05
ENSG00000106415.13.GLCCI1 203.22265 -0.9088876 0.1570326 -5.787891 0 1.18e-05
ENSG00000139219.19.COL2A1 3398.50699 4.9972080 0.8647172 5.779008 0 1.18e-05
ENSG00000138316.11.ADAMTS14 115.57690 2.1902355 0.3820337 5.733094 0 1.42e-05
ENSG00000113739.11.STC2 44.58732 3.1362855 0.5483919 5.719058 0 1.43e-05
ENSG00000136457.10.CHAD 3017.47160 2.9434500 0.5195108 5.665811 0 1.77e-05
ENSG00000157766.19.ACAN 819.95444 3.4146378 0.6034953 5.658102 0 1.77e-05
ENSG00000137441.8.FGFBP2 596.89753 3.6004791 0.6416477 5.611302 0 2.18e-05
ENSG00000183196.10.CHST6 92.17133 3.0945377 0.5555569 5.570154 0 2.60e-05
ENSG00000204248.11.COL11A2 345.76660 1.8920244 0.3442054 5.496788 0 3.73e-05
ENSG00000281990.1.IGHV1.69.2 19.94618 -6.2076100 1.1364487 -5.462288 0 4.11e-05
ENSG00000141756.19.FKBP10 1435.20660 2.1650418 0.3970311 5.453079 0 4.11e-05
message("here is the model spec:")
## here is the model spec:
dds <- DESeqDataSetFromMatrix(countData = x1b , colData = ss1b, design = ~ Age + Sex + CRP + Metabolic_Syndrome )
## 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),])

dge[1:20,1:6] %>%
  kbl(caption = "Top DEGs in bone between OA patients with and without metabolic syndrome, adjusted for age, sex and CRP.") %>%
  kable_paper("hover", full_width = F)
Top DEGs in bone between OA patients with and without metabolic syndrome, adjusted for age, sex and CRP.
baseMean log2FoldChange lfcSE stat pvalue padj
ENSG00000182600.9.SNORC 80.88169 4.230058 0.6478397 6.529482 0.0e+00 0.0000012
ENSG00000164106.8.SCRG1 226.95372 3.418468 0.5460675 6.260156 0.0e+00 0.0000034
ENSG00000186205.13.MTARC1 317.46675 -1.235527 0.2028669 -6.090332 0.0e+00 0.0000066
ENSG00000185269.12.NOTUM 21.84588 4.631073 0.8011534 5.780507 0.0e+00 0.0000330
ENSG00000171724.3.VAT1L 23.44098 2.034787 0.3672300 5.540906 0.0e+00 0.0001065
ENSG00000120885.22.CLU 12652.00431 3.397077 0.6201743 5.477615 0.0e+00 0.0001272
ENSG00000157766.19.ACAN 1526.34053 4.245406 0.7803309 5.440520 1.0e-07 0.0001343
ENSG00000113739.11.STC2 44.58732 3.653243 0.6766548 5.398976 1.0e-07 0.0001470
ENSG00000198892.7.SHISA4 70.95831 2.167296 0.4028929 5.379336 1.0e-07 0.0001470
ENSG00000176971.4.FIBIN 147.94606 3.109228 0.5850656 5.314325 1.0e-07 0.0001846
ENSG00000177106.16.EPS8L2 130.25154 2.131447 0.4020335 5.301665 1.0e-07 0.0001846
ENSG00000137441.8.FGFBP2 596.89753 3.549677 0.6814744 5.208819 2.0e-07 0.0002803
ENSG00000102313.9.ITIH6 38.89310 5.202700 1.0050249 5.176688 2.0e-07 0.0003075
ENSG00000130600.19.H19 2387.16438 3.035993 0.5916548 5.131359 3.0e-07 0.0003636
ENSG00000261857.7.MIA 115.03440 3.796352 0.7423445 5.114003 3.0e-07 0.0003721
ENSG00000154143.3.PANX3 13.86380 4.118535 0.8083243 5.095152 3.0e-07 0.0003854
ENSG00000260428.3.SCX 38.97017 1.833260 0.3620791 5.063149 4.0e-07 0.0004293
ENSG00000111199.12.TRPV4 163.35305 2.907016 0.5843121 4.975109 7.0e-07 0.0006412
ENSG00000237172.4.B3GNT9 151.84508 1.733289 0.3547989 4.885270 1.0e-06 0.0009621
ENSG00000188338.15.SLC38A3 26.63005 3.328527 0.6874609 4.841769 1.3e-06 0.0010543
dge1b <- dge

Now run a mitch analysis.

gnames <- sapply(strsplit(sub("\\."," ",sub("\\."," ",rownames(axx))) ," "),"[[",3)
gt <- data.frame(rownames(axx),gnames)

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

dge1b$gn <- sapply(strsplit( sub("\\.","_", ( sub("\\.","_",rownames(dge1b)) ) ), "_"),"[[",3)

m <- mitch_import(x=dge1b,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 = 18412
## Note: no. genes in output = 18383
## Note: estimated proportion of input genes in output = 0.998
mres1b <- mitch_calc(x=m,genesets=gs,cores=16,priority="effect")
## Note: Enrichments with large effect sizes may not be
##             statistically significant.
head(mres1b$enrichment_result,20) %>%
  kbl(caption = "Top Reactomes for dge1b") %>%
  kable_paper("hover", full_width = F)
Top Reactomes for dge1b
set setSize pANOVA s.dist p.adjustANOVA
1435 Unwinding of DNA 12 0.0000111 -0.7324588 0.0000819
535 Heme biosynthesis 13 0.0000059 -0.7252711 0.0000480
897 Polo-like kinase mediated events 16 0.0000006 -0.7201162 0.0000067
53 Activation of the pre-replicative complex 32 0.0000000 -0.7168206 0.0000000
375 Establishment of Sister Chromatid Cohesion 11 0.0000412 -0.7139125 0.0002624
450 G0 and Early G1 27 0.0000000 -0.6991396 0.0000000
373 Erythropoietin activates Phosphoinositide-3-kinase (PI3K) 11 0.0000671 -0.6940304 0.0004081
236 Crosslinking of collagen fibrils 17 0.0000010 0.6853905 0.0000100
1376 Transcription of E2F targets under negative control by DREAM complex 19 0.0000003 -0.6823648 0.0000032
211 Collagen biosynthesis and modifying enzymes 63 0.0000000 0.6812591 0.0000000
734 Mitotic Telophase/Cytokinesis 13 0.0000230 -0.6781123 0.0001532
310 Diseases associated with glycosaminoglycan metabolism 36 0.0000000 0.6672814 0.0000000
1377 Transcription of E2F targets under negative control by p107 (RBL1) and p130 (RBL2) in complex with HDAC1 16 0.0000045 -0.6621590 0.0000372
454 G1/S-Specific Transcription 29 0.0000000 -0.6543232 0.0000000
219 Condensation of Prometaphase Chromosomes 11 0.0001717 -0.6541872 0.0009479
264 DNA strand elongation 32 0.0000000 -0.6485682 0.0000000
670 MET activates PTK2 signaling 29 0.0000000 0.6460041 0.0000000
220 Condensation of Prophase Chromosomes 24 0.0000001 -0.6412840 0.0000007
36 Activation of ATR in response to replication stress 37 0.0000000 -0.6377618 0.0000000
145 CS/DS degradation 11 0.0002557 0.6366308 0.0013469
mitch_report(res=mres1b,outfile="mitch1boa_report.html",overwrite=TRUE)
## Note: overwriting existing report
## Dataset saved as " /tmp/RtmpzRQXCe/mitch1boa_report.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/RtmpzRQXCe/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/RtmpzRQXCe/rmarkdown-str3c50ce431e51d3.html
## 
## Output created: /tmp/RtmpzRQXCe/mitch_report.html
## [1] TRUE

The effect of metabolic syndrome in cuff arthropathy - consider all tissues

Need to:

  • select cuff arthropathy samples only

  • look at the effect of metabolic syndrome in OA (ss1).

  • consider tissues as “batches” to correct for.

  • Unfortunately it isn’t possible to correct for participant “batches” at the same time.

ss1 <- subset(ss,Cuff_Arthropathy=="Yes")

message("Metabolic syndrome classification")
## Metabolic syndrome classification
ss1$Metabolic_Syndrome
##  [1] "No"  "No"  "No"  "Yes" "Yes" "Yes" "Yes" "Yes" "Yes" "No"  "No"  "No"
message("Age data")
## Age data
ss1$Age
##  [1] 80 80 80 69 69 69 74 74 74 72 72 72
message("Sex data")
## Sex data
ss1$Sex
##  [1] "F" "F" "F" "F" "F" "F" "F" "F" "F" "M" "M" "M"
x1 <- axx[,colnames(axx) %in% rownames(ss1)]
message("count matrix dimensions before filtering out low genes")
## count matrix dimensions before filtering out low genes
dim(x1)
## [1] 60651    12
x1 <- x1[which(rowMeans(x1)>=10),]
message("count matrix dimensions after filtering out low genes")
## count matrix dimensions after filtering out low genes
dim(x1)
## [1] 18057    12
x1 <- x1[,order(colnames(x1))]
ss1 <- ss1[order(rownames(ss1)),]

ss1 %>%
  kbl(caption = "sample sheet") %>%
  kable_paper("hover", full_width = F)
sample sheet
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 tis
10B_S21 AD-CAB_4010 OA 90 bone 10B_S21_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 2
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 3
10S_S49 AD-CAB_4010 OA 90 synovium 10S_S49_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 4
13B_S24 AD-CAB_4013 OA 89 bone 13B_S24_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 2
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 3
13S_S52 AD-CAB_4013 OA 89 synovium 13S_S52_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 4
4003.43B AD-CAB_4003 OA 81 bone 4003-43B_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 2
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 3
4003.43S AD-CAB_4003 OA 81 synovium 4003-43S_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 4
9B_S20 AD-CAB_4009 OA 88 bone 9B_S20_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 2
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 3
9S_S48 AD-CAB_4009 OA 88 synovium 9S_S48_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 4
plotMDS(x1)

poa <- (as.numeric(factor(ss1$Metabolic_Syndrome)) +1 )*2
mds <- plotMDS(x1,col=poa,pch=19,cex=2)
text(mds,labels=colnames(x1),cex=0.8)
mtext("blue=ctrl, purple=MS")

pdf("mds1.pdf")
mds <- plotMDS(x1,col=poa,pch=19,cex=2)
text(mds,labels=colnames(x1),cex=0.8)
mtext("blue=ctrl, purple=MS")
dev.off()
## X11cairo 
##        2
message("here is the model spec:")
## here is the model spec:
dds <- DESeqDataSetFromMatrix(countData = x1 , colData = ss1, design = ~ Tissue + Metabolic_Syndrome )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
z<- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])

dge[1:20,1:6] %>%
  kbl(caption = "Top DEGs that are altered in all tissues by metabolic syndrome.") %>%
  kable_paper("hover", full_width = F)
Top DEGs that are altered in all tissues by metabolic syndrome.
baseMean log2FoldChange lfcSE stat pvalue padj
ENSG00000071859.15.FAM50A 3275.63089 -3.313534 0.4217011 -7.857541 0.00e+00 0.0000000
ENSG00000269900.3.RMRP 90.76500 -6.844663 1.1003447 -6.220472 0.00e+00 0.0000045
ENSG00000153266.13.FEZF2 41.79653 -3.935528 0.6761155 -5.820793 0.00e+00 0.0000353
ENSG00000129988.6.LBP 101.95985 -2.821571 0.5562538 -5.072453 4.00e-07 0.0017728
ENSG00000134986.14.NREP 342.77870 1.281298 0.2560067 5.004937 6.00e-07 0.0020181
ENSG00000137273.6.FOXF2 112.71367 -4.151288 0.8712950 -4.764504 1.90e-06 0.0052207
ENSG00000185201.17.IFITM2 782.82753 -1.916603 0.4052575 -4.729347 2.30e-06 0.0052207
ENSG00000100376.12.FAM118A 613.97757 -2.180688 0.4616234 -4.723956 2.30e-06 0.0052207
ENSG00000142178.9.SIK1 132.47797 -4.013108 0.8610831 -4.660535 3.20e-06 0.0063277
ENSG00000171798.18.KNDC1 18.23312 -3.387779 0.7427371 -4.561209 5.10e-06 0.0091838
ENSG00000156076.10.WIF1 348.42844 -4.063176 0.9070569 -4.479516 7.50e-06 0.0117156
ENSG00000112210.12.RAB23 181.25519 1.103059 0.2467146 4.470993 7.80e-06 0.0117156
ENSG00000253797.2.UTP14C 39.30691 5.197104 1.1684911 4.447705 8.70e-06 0.0120555
ENSG00000277150.2.F8A3 19.70937 -6.270547 1.4272981 -4.393299 1.12e-05 0.0143996
ENSG00000138135.7.CH25H 23.70900 -2.761223 0.6309556 -4.376255 1.21e-05 0.0145342
ENSG00000225972.1.MTND1P23 54.99000 -3.311966 0.7746222 -4.275589 1.91e-05 0.0205515
ENSG00000267059.2.AC005943.1 11.13888 5.243257 1.2272738 4.272280 1.93e-05 0.0205515
ENSG00000101282.9.RSPO4 19.23996 -3.765845 0.8898295 -4.232098 2.32e-05 0.0215438
ENSG00000142512.15.SIGLEC10 64.31866 -1.523410 0.3601835 -4.229538 2.34e-05 0.0215438
ENSG00000274419.6.TBC1D3D 10.09950 6.111693 1.4464511 4.225302 2.39e-05 0.0215438
message("here is the model spec:")
## here is the model spec:
#dds <- DESeqDataSetFromMatrix(countData = x1 , colData = ss1, design = ~ Age + Sex + CRP + Metabolic_Syndrome )

dds <- DESeqDataSetFromMatrix(countData = x1 , colData = ss1, design = ~ Sex + CRP + Metabolic_Syndrome )
## converting counts to integer mode
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
##   the design formula contains one or more numeric variables that have mean or
##   standard deviation larger than 5 (an arbitrary threshold to trigger this message).
##   Including numeric variables with large mean can induce collinearity with the intercept.
##   Users should center and scale numeric variables in the design to improve GLM convergence.
res <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
z<- results(res)
vsd <- vst(dds, blind=FALSE)
zz <- cbind(as.data.frame(z),assay(vsd))
dge <- as.data.frame(zz[order(zz$pvalue),])

dge[1:20,1:6] %>%
  kbl(caption = "Top DEGs in bone between cuff arthropathy patients with and without metabolic syndrome, adjusted for age, sex and CRP.") %>%
  kable_paper("hover", full_width = F)
Top DEGs in bone between cuff arthropathy patients with and without metabolic syndrome, adjusted for age, sex and CRP.
baseMean log2FoldChange lfcSE stat pvalue padj
ENSG00000259768.6.AC004943.2 3015.91271 -12.134645 0.7998716 -15.170741 0 0.0e+00
ENSG00000163884.4.KLF15 892.39287 -12.844827 1.2586006 -10.205641 0 0.0e+00
ENSG00000264462.1.MIR3648.2 100.16187 -14.149627 1.5004269 -9.430401 0 0.0e+00
ENSG00000275708.1.MIR3648.1 100.16187 -14.149627 1.5004269 -9.430401 0 0.0e+00
ENSG00000116985.12.BMP8B 532.63279 -8.086153 1.0992555 -7.356027 0 0.0e+00
ENSG00000012817.16.KDM5D 188.73875 -9.467558 1.2933749 -7.320041 0 0.0e+00
ENSG00000227195.11.MIR663AHG 209.92727 -6.447585 0.9075283 -7.104556 0 0.0e+00
ENSG00000196436.8.NPIPB15 30.68865 -13.395948 1.9697602 -6.800802 0 0.0e+00
ENSG00000256642.1.LINC00273 56.04456 -8.853471 1.3323274 -6.645117 0 1.0e-07
ENSG00000067048.17.DDX3Y 192.61128 -17.237417 2.6361462 -6.538870 0 1.0e-07
ENSG00000131126.19.TEX101 97.54802 -15.134627 2.3764322 -6.368634 0 3.0e-07
ENSG00000263006.6.ROCK1P1 202.06888 -8.992729 1.4350145 -6.266647 0 5.0e-07
ENSG00000284554.2.AL022318.4 13.23748 -17.002945 2.7706420 -6.136825 0 1.1e-06
ENSG00000198914.5.POU3F3 23.38140 -9.665296 1.5770128 -6.128863 0 1.1e-06
ENSG00000105409.19.ATP1A3 157.92066 -13.047982 2.1407620 -6.095018 0 1.2e-06
ENSG00000099725.14.PRKY 68.96114 -6.887272 1.1301320 -6.094219 0 1.2e-06
ENSG00000224058.2.AC006509.1 206.93816 -11.271679 1.8503336 -6.091701 0 1.2e-06
ENSG00000169181.13.GSG1L 24.95038 -8.259330 1.4072285 -5.869217 0 4.3e-06
ENSG00000129824.16.RPS4Y1 530.91911 -16.472236 2.8201649 -5.840877 0 4.8e-06
ENSG00000102109.9.PCSK1N 82.35303 -11.735891 2.0235649 -5.799612 0 5.8e-06
dge1 <- dge

Now run a mitch analysis.

gnames <- sapply(strsplit(sub("\\."," ",sub("\\."," ",rownames(axx))) ," "),"[[",3)
gt <- data.frame(rownames(axx),gnames)

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

dge1$gn <- sapply(strsplit( sub("\\.","_", ( sub("\\.","_",rownames(dge1)) ) ), "_"),"[[",3)

m <- mitch_import(x=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 = 18057
## Note: no. genes in output = 18029
## Note: estimated proportion of input genes in output = 0.998
mres1 <- mitch_calc(x=m,genesets=gs,cores=16,priority="effect")
## Note: Enrichments with large effect sizes may not be
##             statistically significant.
head(mres1$enrichment_result,20) %>%
  kbl(caption = "Top Reactomes for dge1b") %>%
  kable_paper("hover", full_width = F)
Top Reactomes for dge1b
set setSize pANOVA s.dist p.adjustANOVA
1105 Response to metal ions 11 0.0000424 -0.7128124 0.0002257
1118 SARS-CoV-1 modulates host translation machinery 36 0.0000000 0.6578145 0.0000000
414 Formation of ATP by chemiosmotic coupling 16 0.0000064 0.6514392 0.0000381
1449 Viral mRNA Translation 87 0.0000000 0.6505893 0.0000000
722 Mitochondrial translation initiation 88 0.0000000 0.6439985 0.0000000
723 Mitochondrial translation termination 88 0.0000000 0.6439440 0.0000000
868 Peptide chain elongation 87 0.0000000 0.6425096 0.0000000
720 Mitochondrial translation 94 0.0000000 0.6413681 0.0000000
380 Eukaryotic Translation Termination 91 0.0000000 0.6409856 0.0000000
721 Mitochondrial translation elongation 88 0.0000000 0.6391721 0.0000000
1143 SRP-dependent cotranslational protein targeting to membrane 110 0.0000000 0.6319762 0.0000000
413 Folding of actin by CCT/TriC 10 0.0005683 0.6293246 0.0024167
798 Nonsense Mediated Decay (NMD) independent of the Exon Junction Complex (EJC) 93 0.0000000 0.6287433 0.0000000
1124 SARS-CoV-2 modulates host translation machinery 49 0.0000000 0.6284239 0.0000000
378 Eukaryotic Translation Elongation 92 0.0000000 0.6236296 0.0000000
423 Formation of a pool of free 40S subunits 99 0.0000000 0.6218470 0.0000000
191 Chk1/Chk2(Cds1) mediated inactivation of Cyclin B:Cdk1 complex 13 0.0001180 0.6166570 0.0005756
1165 Selenocysteine synthesis 91 0.0000000 0.6165951 0.0000000
382 Expression and translocation of olfactory receptors 31 0.0000000 -0.6162083 0.0000000
1102 Response of EIF2AK4 (GCN2) to amino acid deficiency 99 0.0000000 0.6160253 0.0000000
mitch_report(res=mres1,outfile="mitch1_report.html",overwrite=TRUE)
## Note: overwriting existing report
## Dataset saved as " /tmp/RtmpzRQXCe/mitch1_report.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/RtmpzRQXCe/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/RtmpzRQXCe/rmarkdown-str3c50ce1f40c02e.html
## 
## Output created: /tmp/RtmpzRQXCe/mitch_report.html
## [1] TRUE

The effect of metabolic syndrome in rotator cuff

Need to:

  • Select rotator cuff

  • look at the effect of metabolic syndrome.

ss2 <- subset(ss,Case=="RC")

ss2c <- subset(ss2,Tissue=="capsule")

message("Metabolic syndrome classification")
## Metabolic syndrome classification
ss2c$Metabolic_Syndrome
##  [1] "Yes" "No"  "No"  "No"  "Yes" "Yes" "Yes" "No"  "No"  "No"  "Yes" "No" 
## [13] "No"  "No"  NA    "No"  "No"  "Yes" "Yes" "No"  "No"  NA    "No"  "No" 
## [25] "No"  "No"
message("Age data")
## Age data
ss2c$Age
##  [1] 67 58 50 72 68 70 66 68 60 72 45 58 61 46 39 58 52 62 59 56 68 59 65 63 70
## [26] 68
message("Sex data")
## Sex data
ss2c$Sex
##  [1] "M" "M" "M" "M" "F" "M" "M" "M" "M" "M" "F" "M" "M" "M" "F" "M" "F" "F" "M"
## [20] "M" "M" "F" "M" "F" "M" "M"
x2c <- axx[,colnames(axx) %in% rownames(ss2c)]
message("count matrix dimensions before filtering out low genes")
## count matrix dimensions before filtering out low genes
dim(x2c)
## [1] 60651    26
x2c <- x2c[which(rowMeans(x2c)>=10),]
message("count matrix dimensions after filtering out low genes")
## count matrix dimensions after filtering out low genes
dim(x2c)
## [1] 16169    26
x2c <- x2c[,order(colnames(x2c))]
ss2c <- ss2c[order(rownames(ss2c)),]

ss2c <- subset(ss2c,Metabolic_Syndrome=="No" | Metabolic_Syndrome=="Yes")
x2c <- x2c[,colnames(x2c) %in% rownames(ss2c)]

ss2c %>%
  kbl(caption = "sample sheet") %>%
  kable_paper("hover", full_width = F)
sample sheet
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 tis
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 3
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 3
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 3
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 3
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 3
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 3
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 3
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 3
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 3
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 3
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 3
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 3
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 3
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 3
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 3
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 3
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 3
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 3
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
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 3
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 3
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 3
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 3
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 3
plotMDS(x2c)

poa <- (as.numeric(factor(ss2c$Metabolic_Syndrome)) +1 )*2
mds <- plotMDS(x2c,col=poa,pch=19,cex=2)
text(mds,labels=colnames(x2c),cex=0.8)
mtext("blue=ctrl, purple=OA")

pdf("mds2c.pdf")
mds <- plotMDS(x2c,col=poa,pch=19,cex=2)
text(mds,labels=colnames(x2c),cex=0.8)
mtext("blue=ctrl, purple=MS")
dev.off()
## X11cairo 
##        2
message("here is the model spec:")
## here is the model spec:
dds <- DESeqDataSetFromMatrix(countData = x2c , colData = ss2c, design = ~ Age + Sex + Metabolic_Syndrome )
## 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),])

dge[1:20,1:6] %>%
  kbl(caption = "Top DEGs in capsule between RC patients with and without metabolic syndrome.") %>%
  kable_paper("hover", full_width = F)
Top DEGs in capsule between RC patients with and without metabolic syndrome.
baseMean log2FoldChange lfcSE stat pvalue padj
ENSG00000203812.2.H2AC18 15.61564 -3.9010306 0.9263541 -4.211166 0.0000254 0.4104532
ENSG00000197614.11.MFAP5 1259.04222 -2.5068148 0.6332143 -3.958872 0.0000753 0.6083095
ENSG00000198121.13.LPAR1 765.32020 -0.6662140 0.1745208 -3.817389 0.0001349 0.6255534
ENSG00000287286.1.AC024560.5 13.29192 -3.3780136 0.9145029 -3.693825 0.0002209 0.6255534
ENSG00000145113.22.MUC4 14.16622 -1.9818044 0.5404158 -3.667184 0.0002452 0.6255534
ENSG00000135916.16.ITM2C 307.48864 -1.5101725 0.4135695 -3.651557 0.0002607 0.6255534
ENSG00000162545.6.CAMK2N1 75.26906 -1.6038568 0.4404365 -3.641516 0.0002710 0.6255534
ENSG00000267339.7.LINC00906 10.54983 -2.3568631 0.6633982 -3.552712 0.0003813 0.6910479
ENSG00000218336.9.TENM3 19.03004 1.3566231 0.3821275 3.550185 0.0003850 0.6910479
ENSG00000148357.16.HMCN2 551.37442 -1.7044676 0.4899756 -3.478679 0.0005039 0.8140891
ENSG00000133063.16.CHIT1 19.87184 2.6044350 0.7666590 3.397123 0.0006810 0.9999804
ENSG00000140254.12.DUOXA1 13.41342 -1.9084883 0.5853997 -3.260146 0.0011135 0.9999804
ENSG00000159063.14.ALG8 112.93939 0.3323802 0.1024597 3.244010 0.0011786 0.9999804
ENSG00000171533.12.MAP6 26.74399 -1.0291686 0.3193044 -3.223158 0.0012679 0.9999804
ENSG00000172020.13.GAP43 235.62709 -1.3725239 0.4339196 -3.163084 0.0015611 0.9999804
ENSG00000125726.11.CD70 38.93859 -1.7704418 0.5617950 -3.151402 0.0016249 0.9999804
ENSG00000149090.12.PAMR1 323.14328 -2.2069636 0.7052207 -3.129465 0.0017512 0.9999804
ENSG00000101144.13.BMP7 25.11222 -1.7210234 0.5510064 -3.123418 0.0017876 0.9999804
ENSG00000183072.10.NKX2.5 12.38402 -2.2926770 0.7341754 -3.122792 0.0017914 0.9999804
ENSG00000103540.16.CCP110 121.13915 0.2906640 0.0932682 3.116431 0.0018305 0.9999804
message("here is the model spec:")
## here is the model spec:
dds <- DESeqDataSetFromMatrix(countData = x2c , colData = ss2c, design = ~ Age + Sex + CRP + Metabolic_Syndrome )
## 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),])

dge[1:20,1:6] %>%
  kbl(caption = "Top DEGs in bone between OA patients with and without metabolic syndrome, adjusted for age, sex and CRP.") %>%
  kable_paper("hover", full_width = F)
Top DEGs in bone between OA patients with and without metabolic syndrome, adjusted for age, sex and CRP.
baseMean log2FoldChange lfcSE stat pvalue padj
ENSG00000203812.2.H2AC18 15.61564 -4.4182659 1.0336522 -4.274422 0.0000192 0.3098525
ENSG00000135480.16.KRT7 26.26632 -2.0953587 0.5318943 -3.939427 0.0000817 0.4412672
ENSG00000198121.13.LPAR1 765.32020 -0.7242177 0.1843492 -3.928510 0.0000855 0.4412672
ENSG00000260266.1.PPIAP46 28.56331 1.4338041 0.3726096 3.848006 0.0001191 0.4412672
ENSG00000133063.16.CHIT1 19.87184 2.9820708 0.7914467 3.767873 0.0001646 0.4412672
ENSG00000181634.8.TNFSF15 99.83771 1.4552388 0.3889060 3.741878 0.0001827 0.4412672
ENSG00000109472.14.CPE 197.99383 1.2409169 0.3326334 3.730584 0.0001910 0.4412672
ENSG00000197614.11.MFAP5 1259.04222 -2.4854321 0.6815676 -3.646641 0.0002657 0.5369949
ENSG00000218336.9.TENM3 19.03004 1.4454954 0.4010120 3.604619 0.0003126 0.5616233
ENSG00000181195.11.PENK 41.98586 2.5020799 0.7244314 3.453854 0.0005526 0.8356608
ENSG00000162545.6.CAMK2N1 75.26906 -1.6312015 0.4761735 -3.425645 0.0006133 0.8356608
ENSG00000148357.16.HMCN2 551.37442 -1.7818720 0.5227430 -3.408696 0.0006527 0.8356608
ENSG00000274422.1.AC245060.5 487.41427 1.4959447 0.4407833 3.393832 0.0006892 0.8356608
ENSG00000183688.4.RFLNB 145.76873 -1.6084987 0.4758178 -3.380492 0.0007236 0.8356608
ENSG00000267339.7.LINC00906 10.54983 -2.4460215 0.7334720 -3.334853 0.0008534 0.8662719
ENSG00000135916.16.ITM2C 307.48864 -1.4756737 0.4451913 -3.314696 0.0009174 0.8662719
ENSG00000124214.21.STAU1 498.95136 -0.2358579 0.0711775 -3.313658 0.0009208 0.8662719
ENSG00000159063.14.ALG8 112.93939 0.3588266 0.1087116 3.300720 0.0009644 0.8662719
ENSG00000169071.15.ROR2 25.21287 2.1959724 0.6696037 3.279510 0.0010399 0.8849325
ENSG00000145113.22.MUC4 14.16622 -1.8667078 0.5818057 -3.208473 0.0013344 0.9499071
dge2c <- dge

Session information

For reproducibility.

sessionInfo()
## R version 4.4.1 (2024-06-14)
## Platform: x86_64-pc-linux-gnu
## Running under: Ubuntu 24.04.1 LTS
## 
## Matrix products: default
## BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.12.0 
## LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.12.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.4.0               GGally_2.2.1               
##  [3] beeswarm_0.4.0              gtools_3.9.5               
##  [5] echarts4r_0.4.5             kableExtra_1.4.0           
##  [7] topconfects_1.20.0          limma_3.60.4               
##  [9] eulerr_7.0.2                mitch_1.16.0               
## [11] MASS_7.3-61                 fgsea_1.30.0               
## [13] gplots_3.1.3.1              DESeq2_1.44.0              
## [15] SummarizedExperiment_1.34.0 Biobase_2.64.0             
## [17] MatrixGenerics_1.16.0       matrixStats_1.4.1          
## [19] GenomicRanges_1.56.1        GenomeInfoDb_1.40.1        
## [21] IRanges_2.38.1              S4Vectors_0.42.1           
## [23] BiocGenerics_0.50.0         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.5                
## [31] tidyr_1.3.1                 tibble_3.2.1               
## [33] ggplot2_3.5.1               tidyverse_2.0.0            
## [35] zoo_1.8-12                  R.utils_2.12.3             
## [37] R.oo_1.26.0                 R.methodsS3_1.8.2          
## 
## loaded via a namespace (and not attached):
##  [1] bitops_1.0-8            gridExtra_2.3           rlang_1.1.4            
##  [4] magrittr_2.0.3          compiler_4.4.1          systemfonts_1.1.0      
##  [7] vctrs_0.6.5             pkgconfig_2.0.3         crayon_1.5.3           
## [10] fastmap_1.2.0           XVector_0.44.0          caTools_1.18.3         
## [13] utf8_1.2.4              promises_1.3.0          rmarkdown_2.28         
## [16] tzdb_0.4.0              UCSC.utils_1.0.0        xfun_0.47              
## [19] zlibbioc_1.50.0         cachem_1.1.0            jsonlite_1.8.8         
## [22] highr_0.11              later_1.3.2             DelayedArray_0.30.1    
## [25] BiocParallel_1.38.0     parallel_4.4.1          R6_2.5.1               
## [28] bslib_0.8.0             stringi_1.8.4           RColorBrewer_1.1-3     
## [31] jquerylib_0.1.4         assertthat_0.2.1        Rcpp_1.0.13            
## [34] knitr_1.48              httpuv_1.6.15           Matrix_1.7-0           
## [37] timechange_0.3.0        tidyselect_1.2.1        rstudioapi_0.16.0      
## [40] abind_1.4-5             yaml_2.3.10             codetools_0.2-20       
## [43] lattice_0.22-6          plyr_1.8.9              shiny_1.9.1            
## [46] withr_3.0.1             evaluate_0.24.0         ggstats_0.6.0          
## [49] xml2_1.3.6              pillar_1.9.0            KernSmooth_2.23-24     
## [52] generics_0.1.3          hms_1.1.3               munsell_0.5.1          
## [55] scales_1.3.0            xtable_1.8-4            glue_1.7.0             
## [58] tools_4.4.1             data.table_1.16.0       locfit_1.5-9.10        
## [61] fastmatch_1.1-4         cowplot_1.1.3           grid_4.4.1             
## [64] colorspace_2.1-1        GenomeInfoDbData_1.2.12 cli_3.6.3              
## [67] fansi_1.0.6             viridisLite_0.4.2       S4Arrays_1.4.1         
## [70] svglite_2.1.3           gtable_0.3.5            sass_0.4.9             
## [73] digest_0.6.37           SparseArray_1.4.8       htmlwidgets_1.6.4      
## [76] htmltools_0.5.8.1       lifecycle_1.0.4         httr_1.4.7             
## [79] statmod_1.5.0           mime_0.12