Last updated: 2024-06-07

Checks: 7 0

Knit directory: PPP/

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


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

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(20240521) 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.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version 69df7f0. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .DS_Store
    Ignored:    .RData
    Ignored:    .Rhistory
    Ignored:    code/.DS_Store
    Ignored:    code/TieDIE-devel/.DS_Store
    Ignored:    code/TieDIE-devel/examples/.DS_Store
    Ignored:    code/TieDIE-tiedie2/.DS_Store
    Ignored:    code/TieDIE-tiedie2/examples/.DS_Store
    Ignored:    data/.DS_Store
    Ignored:    data/Phosphoproteome_BCM_GENCODE_v34_harmonized_v1/.DS_Store
    Ignored:    data/Phosphoproteome_BCM_GENCODE_v34_harmonized_v1/README/.DS_Store
    Ignored:    data/Proteome_BCM_GENCODE_v34_harmonized_v1/.DS_Store
    Ignored:    data/Proteome_BCM_GENCODE_v34_harmonized_v1/README/.DS_Store
    Ignored:    output/.DS_Store
    Ignored:    output/cnv/.DS_Store
    Ignored:    output/phos_processed/
    Ignored:    output/phos_regul_object/
    Ignored:    output/regulon/.DS_Store

Unstaged changes:
    Modified:   output/phos/hnsc/phos.txt
    Modified:   output/phos/kirc/phos.txt
    Modified:   output/phos/luad/phos.txt
    Modified:   output/phos/lusc/phos.txt
    Modified:   output/phos/paad/phos.txt

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/viper_4.Rmd) and HTML (docs/viper_4.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
Rmd 69df7f0 Zhen Zuo 2024-06-07 update viper pipeline
html 69df7f0 Zhen Zuo 2024-06-07 update viper pipeline
Rmd 52f24e5 Zhen Zuo 2024-06-07 add more omics
html 52f24e5 Zhen Zuo 2024-06-07 add more omics
Rmd 97292dd Zhen Zuo 2024-05-31 update rds
html 97292dd Zhen Zuo 2024-05-31 update rds

Load packages

library(viper)
library(aracne.networks)
library(dplyr)
library(plyr)
library(stringr)
library(Biobase)
library(EnsDb.Hsapiens.v86)
library(foreach)
library(doParallel)
dir.create("output/methy/",showWarnings = F)

Define functions

contains_special_characters <- function(strings) {
    # Define a regular expression pattern to match special characters
    pattern <- "[^A-Za-z0-9 ]"

    # Check if any string in the input vector contains special
    # characters
    contains_special <- grepl(pattern, strings)

    return(contains_special)
}

Extract and process phosphopeptides data

df <- read.csv("data/omics_regulon_pairs.csv")
for (i in 1:nrow(df)) {
    exprsFile <- df$methy[i]
    exprs <- as.matrix(read.table(exprsFile, header = TRUE, sep = "\t",
        row.names = 1, as.is = TRUE))
    rownames(exprs) <- sub("\\..*$", "", rownames(exprs))
    exprs <- exprs[!duplicated(rownames(exprs)),]
    geneID <- ensembldb::select(EnsDb.Hsapiens.v86, keys = rownames(exprs),
        keytype = "GENEID", columns = c("SYMBOL", "ENTREZID", "GENEID"))
    rownames(exprs) <- plyr::mapvalues(rownames(exprs), from = geneID$GENEID,
        to = geneID$SYMBOL, warn_missing = FALSE)
    exprs <- exprs[!sapply(rownames(exprs), function(x) startsWith(x, "ENSG")),
        ]
    # Identify duplicated row names
    duplicated_rows <- duplicated(rownames(exprs))
    # Remove rows with duplicated row names
    cleaned_exprs <- exprs[!duplicated_rows,]
    cleaned_exprs <- cleaned_exprs[!contains_special_characters(rownames(cleaned_exprs)),]
    saveRDS(cleaned_exprs, paste("output/methy/count_matrix_", df$Lable[i], ".RDS", sep = ""))
}

sessionInfo()
R version 4.4.0 (2024-04-24)
Platform: aarch64-apple-darwin20
Running under: macOS Sonoma 14.5

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRblas.0.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.0

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

time zone: America/New_York
tzcode source: internal

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

other attached packages:
 [1] doParallel_1.0.17         iterators_1.0.14         
 [3] foreach_1.5.2             EnsDb.Hsapiens.v86_2.99.0
 [5] ensembldb_2.28.0          AnnotationFilter_1.28.0  
 [7] GenomicFeatures_1.56.0    AnnotationDbi_1.66.0     
 [9] GenomicRanges_1.56.0      GenomeInfoDb_1.40.0      
[11] IRanges_2.38.0            S4Vectors_0.42.0         
[13] stringr_1.5.1             plyr_1.8.9               
[15] dplyr_1.1.4               aracne.networks_1.30.0   
[17] viper_1.38.0              Biobase_2.64.0           
[19] BiocGenerics_0.50.0       workflowr_1.7.1          

loaded via a namespace (and not attached):
  [1] rstudioapi_0.16.0           jsonlite_1.8.8             
  [3] magrittr_2.0.3              rmarkdown_2.27             
  [5] fs_1.6.4                    BiocIO_1.14.0              
  [7] zlibbioc_1.50.0             vctrs_0.6.5                
  [9] memoise_2.0.1               Rsamtools_2.20.0           
 [11] RCurl_1.98-1.14             htmltools_0.5.8.1          
 [13] S4Arrays_1.4.1              curl_5.2.1                 
 [15] SparseArray_1.4.1           sass_0.4.9                 
 [17] KernSmooth_2.23-24          bslib_0.7.0                
 [19] htmlwidgets_1.6.4           plotly_4.10.4              
 [21] cachem_1.1.0                GenomicAlignments_1.40.0   
 [23] whisker_0.4.1               lifecycle_1.0.4            
 [25] pkgconfig_2.0.3             Matrix_1.7-0               
 [27] R6_2.5.1                    fastmap_1.2.0              
 [29] GenomeInfoDbData_1.2.12     MatrixGenerics_1.16.0      
 [31] digest_0.6.35               colorspace_2.1-0           
 [33] ps_1.7.6                    rprojroot_2.0.4            
 [35] RSQLite_2.3.6               fansi_1.0.6                
 [37] httr_1.4.7                  abind_1.4-5                
 [39] compiler_4.4.0              proxy_0.4-27               
 [41] bit64_4.0.5                 BiocParallel_1.38.0        
 [43] DBI_1.2.2                   MASS_7.3-60.2              
 [45] DelayedArray_0.30.0         rjson_0.2.21               
 [47] tools_4.4.0                 httpuv_1.6.15              
 [49] glue_1.7.0                  restfulr_0.0.15            
 [51] callr_3.7.6                 nlme_3.1-164               
 [53] promises_1.3.0              grid_4.4.0                 
 [55] getPass_0.2-4               generics_0.1.3             
 [57] gtable_0.3.5                class_7.3-22               
 [59] tidyr_1.3.1                 data.table_1.15.4          
 [61] utf8_1.2.4                  XVector_0.44.0             
 [63] pillar_1.9.0                later_1.3.2                
 [65] splines_4.4.0               lattice_0.22-6             
 [67] survival_3.6-4              rtracklayer_1.64.0         
 [69] bit_4.0.5                   tidyselect_1.2.1           
 [71] Biostrings_2.72.0           knitr_1.46                 
 [73] git2r_0.33.0                ProtGenerics_1.36.0        
 [75] SummarizedExperiment_1.34.0 xfun_0.44                  
 [77] mixtools_2.0.0              matrixStats_1.3.0          
 [79] stringi_1.8.4               UCSC.utils_1.0.0           
 [81] lazyeval_0.2.2              yaml_2.3.8                 
 [83] evaluate_0.23               codetools_0.2-20           
 [85] kernlab_0.9-32              tibble_3.2.1               
 [87] cli_3.6.2                   segmented_2.1-0            
 [89] munsell_0.5.1               processx_3.8.4             
 [91] jquerylib_0.1.4             Rcpp_1.0.12                
 [93] png_0.1-8                   XML_3.99-0.16.1            
 [95] ggplot2_3.5.1               blob_1.2.4                 
 [97] bitops_1.0-7                viridisLite_0.4.2          
 [99] scales_1.3.0                e1071_1.7-14               
[101] purrr_1.0.2                 crayon_1.5.2               
[103] rlang_1.1.3                 KEGGREST_1.44.0