Last updated: 2023-09-04

Checks: 5 1

Knit directory: RA_Tcell_omics/analysis/

This reproducible R Markdown analysis was created with workflowr (version 1.7.0). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20221110) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Tracking code development and connecting the code version to the results is critical for reproducibility. To start using Git, open the Terminal and type git init in your project directory.


This project is not being versioned with Git. To obtain the full reproducibility benefits of using workflowr, please see ?wflow_start.


Load libraries

Global variables

Load and preprocess datasets

Load omics data

Only keep probes on X chromose

How many samples


Control      RA 
      3       2 

Only 3 controls and 2 RA samples. The results may be unreliable

Get unique symbol

Remove CpGs not associated with known genes

Correlation between average methylation level and phenotype


    Two Sample t-test

data:  meanMethylation by group
t = -1.5878, df = 3, p-value = 0.2105
alternative hypothesis: true difference in means between group Control and group RA is not equal to 0
95 percent confidence interval:
 -0.06167598  0.02061802
sample estimates:
mean in group Control      mean in group RA 
            0.4510691             0.4715981 

On the overall methylation level, there’s no strong trend that RA samples have higher methylation.

PCA analysis

Calculate PCA

PCA plots

PC1 versus PC2

PC2 versus PC3

Associate PCs with disease

# A tibble: 5 × 3
# Groups:   pc [5]
  pc     estimate p.value
  <chr>     <dbl>   <dbl>
1 PC1   -1.95e+ 0   0.211
2 PC5    4.38e-17   0.217
3 PC2    9.23e- 1   0.372
4 PC4    4.77e- 1   0.444
5 PC3   -3.10e- 1   0.663

The first three principal components can separate RA with control samples, to some degree.

Differentially methylated CpGs

Prepare data

Process methylation dataset

[1] 34  5

Differential methylation using limma

Add mean difference of beta values

Save the full table as excel file

diffMeth_table_onlyChrY.xlsx

Number of hypermethylation and hypomethylation

Visualize results

associated probes

Only 1 probe

Visualize the significant associations


R version 4.2.0 (2022-04-22)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur/Monterey 10.16

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats4    stats     graphics  grDevices utils     datasets  methods  
[8] base     

other attached packages:
 [1] forcats_0.5.1               stringr_1.4.1              
 [3] dplyr_1.0.9                 purrr_0.3.4                
 [5] readr_2.1.2                 tidyr_1.2.0                
 [7] tibble_3.1.8                ggplot2_3.4.1              
 [9] tidyverse_1.3.2             pheatmap_1.0.12            
[11] SummarizedExperiment_1.26.1 Biobase_2.56.0             
[13] GenomicRanges_1.48.0        GenomeInfoDb_1.32.2        
[15] IRanges_2.30.0              S4Vectors_0.34.0           
[17] BiocGenerics_0.42.0         MatrixGenerics_1.8.1       
[19] matrixStats_0.62.0          limma_3.52.2               

loaded via a namespace (and not attached):
  [1] ggbeeswarm_0.6.0       googledrive_2.0.0      colorspace_2.0-3      
  [4] ellipsis_0.3.2         rprojroot_2.0.3        XVector_0.36.0        
  [7] fs_1.5.2               rstudioapi_0.13        farver_2.1.1          
 [10] DT_0.23                ggrepel_0.9.1          bit64_4.0.5           
 [13] AnnotationDbi_1.58.0   fansi_1.0.3            lubridate_1.8.0       
 [16] xml2_1.3.3             splines_4.2.0          cachem_1.0.6          
 [19] knitr_1.39             jsonlite_1.8.3         workflowr_1.7.0       
 [22] broom_1.0.0            annotate_1.74.0        dbplyr_2.2.1          
 [25] png_0.1-7              compiler_4.2.0         httr_1.4.3            
 [28] backports_1.4.1        assertthat_0.2.1       Matrix_1.5-4          
 [31] fastmap_1.1.0          gargle_1.2.0           cli_3.4.1             
 [34] later_1.3.0            htmltools_0.5.4        tools_4.2.0           
 [37] gtable_0.3.0           glue_1.6.2             GenomeInfoDbData_1.2.8
 [40] Rcpp_1.0.9             cellranger_1.1.0       jquerylib_0.1.4       
 [43] vctrs_0.5.2            Biostrings_2.64.0      writexl_1.4.0         
 [46] crosstalk_1.2.0        xfun_0.31              rvest_1.0.2           
 [49] lifecycle_1.0.3        XML_3.99-0.10          googlesheets4_1.0.0   
 [52] zlibbioc_1.42.0        scales_1.2.0           hms_1.1.1             
 [55] promises_1.2.0.1       RColorBrewer_1.1-3     yaml_2.3.5            
 [58] memoise_2.0.1          sass_0.4.2             stringi_1.7.8         
 [61] RSQLite_2.2.15         highr_0.9              genefilter_1.78.0     
 [64] rlang_1.0.6            pkgconfig_2.0.3        bitops_1.0-7          
 [67] evaluate_0.15          lattice_0.20-45        htmlwidgets_1.5.4     
 [70] labeling_0.4.2         cowplot_1.1.1          bit_4.0.4             
 [73] tidyselect_1.1.2       magrittr_2.0.3         R6_2.5.1              
 [76] generics_0.1.3         DelayedArray_0.22.0    DBI_1.1.3             
 [79] pillar_1.8.0           haven_2.5.0            withr_2.5.0           
 [82] survival_3.4-0         KEGGREST_1.36.3        RCurl_1.98-1.7        
 [85] modelr_0.1.8           crayon_1.5.2           utf8_1.2.2            
 [88] tzdb_0.3.0             rmarkdown_2.14         grid_4.2.0            
 [91] readxl_1.4.0           blob_1.2.3             git2r_0.30.1          
 [94] reprex_2.0.1           digest_0.6.30          xtable_1.8-4          
 [97] httpuv_1.6.6           munsell_0.5.0          beeswarm_0.4.0        
[100] vipor_0.4.5            bslib_0.4.1