diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ef9e157 --- /dev/null +++ b/.gitignore @@ -0,0 +1,16 @@ +.Rproj.user +.Rprofile +.Rhistory +.RDataTmp +*.RData +*.rda +*.pdf +*.rds +*.png +*.svg +.Ruserdata +results/* +renv/* +slurm* +run* +data/* \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..828bb6a --- /dev/null +++ b/README.md @@ -0,0 +1,28 @@ +# Repository for scripts used in *Gene- and transcript-level analyses reveal sex-specific trancriptional alterations in prefrontal cortex in Major Depressive Disorder*. + +## Requisites + +We use Miniconda (or Anaconda) for environment management (See `environment.yml` file). To create the environment: +`conda env create -f environment.yml` + +We use R version 4.1.2 and Bioconductor version 3.14. + +Here, we use multiple R packages. We use `renv` to track R package versions (see `renv.lock` file). + +Clone this repository to your local machine and open the project through `mdd.Rproj` to install required packages. + +## Overall project structure + +This project is organized in the following directories: + + - `data/`: Holds the RNA-seq processed data, study metadata, and genome references; + - `scripts/`: Holds all the scripts used in the analyses; + - `results/`: Holds results from each step analysis. + + In each directory, there is detailed description of files. + + + + + + diff --git a/environment.yml b/environment.yml new file mode 100644 index 0000000..037613c --- /dev/null +++ b/environment.yml @@ -0,0 +1,100 @@ +name: mdd-env +channels: + - conda-forge + - defaults +dependencies: + - _libgcc_mutex=0.1=conda_forge + - _openmp_mutex=4.5=1_gnu + - _r-mutex=1.0.1=anacondar_1 + - binutils_impl_linux-64=2.36.1=h193b22a_2 + - binutils_linux-64=2.36=hf3e587d_3 + - bwidget=1.9.14=ha770c72_1 + - bzip2=1.0.8=h7f98852_4 + - c-ares=1.18.1=h7f98852_0 + - ca-certificates=2021.10.8=ha878542_0 + - cairo=1.16.0=ha00ac49_1009 + - curl=7.80.0=h494985f_1 + - font-ttf-dejavu-sans-mono=2.37=hab24e00_0 + - font-ttf-inconsolata=3.000=h77eed37_0 + - font-ttf-source-code-pro=2.038=h77eed37_0 + - font-ttf-ubuntu=0.83=hab24e00_0 + - fontconfig=2.13.1=hba837de_1005 + - fonts-conda-ecosystem=1=0 + - fonts-conda-forge=1=0 + - freetype=2.10.4=h0708190_1 + - fribidi=1.0.10=h36c2ea0_0 + - gcc_impl_linux-64=9.4.0=h03d3576_11 + - gcc_linux-64=9.4.0=h391b98a_3 + - gettext=0.19.8.1=h73d1719_1008 + - gfortran_impl_linux-64=9.4.0=h0003116_11 + - gfortran_linux-64=9.4.0=hf0ab688_3 + - graphite2=1.3.13=h58526e2_1001 + - gsl=2.7=he838d99_0 + - gxx_impl_linux-64=9.4.0=h03d3576_11 + - gxx_linux-64=9.4.0=h0316aca_3 + - harfbuzz=3.2.0=hb4a5f5f_0 + - icu=69.1=h9c3ff4c_0 + - jbig=2.1=h7f98852_2003 + - jpeg=9d=h36c2ea0_0 + - kernel-headers_linux-64=2.6.32=he073ed8_15 + - krb5=1.19.2=h48eae69_3 + - ld_impl_linux-64=2.36.1=hea4e1c9_2 + - lerc=3.0=h9c3ff4c_0 + - libblas=3.9.0=12_linux64_openblas + - libcblas=3.9.0=12_linux64_openblas + - libcurl=7.80.0=h494985f_1 + - libdeflate=1.8=h7f98852_0 + - libedit=3.1.20191231=he28a2e2_2 + - libev=4.33=h516909a_1 + - libffi=3.4.2=h7f98852_5 + - libgcc-devel_linux-64=9.4.0=hd854feb_11 + - libgcc-ng=11.2.0=h1d223b6_11 + - libgfortran-ng=11.2.0=h69a702a_11 + - libgfortran5=11.2.0=h5c6108e_11 + - libglib=2.70.2=h174f98d_1 + - libgomp=11.2.0=h1d223b6_11 + - libiconv=1.16=h516909a_0 + - liblapack=3.9.0=12_linux64_openblas + - libnghttp2=1.43.0=ha19adfc_1 + - libopenblas=0.3.18=pthreads_h8fe5266_0 + - libpng=1.6.37=h21135ba_2 + - libsanitizer=9.4.0=h79bfe98_11 + - libssh2=1.10.0=ha35d2d1_2 + - libstdcxx-devel_linux-64=9.4.0=hd854feb_11 + - libstdcxx-ng=11.2.0=he4da1e4_11 + - libtiff=4.3.0=h6f004c6_2 + - libuuid=2.32.1=h7f98852_1000 + - libwebp-base=1.2.1=h7f98852_0 + - libxcb=1.13=h7f98852_1004 + - libxml2=2.9.12=h885dcf4_1 + - libzlib=1.2.11=h36c2ea0_1013 + - lz4-c=1.9.3=h9c3ff4c_1 + - make=4.3=hd18ef5c_1 + - ncurses=6.2=h58526e2_4 + - openssl=3.0.0=h7f98852_2 + - pango=1.48.10=h54213e6_2 + - pcre=8.45=h9c3ff4c_0 + - pcre2=10.37=h032f7d1_0 + - pixman=0.40.0=h36c2ea0_0 + - pthread-stubs=0.4=h36c2ea0_1001 + - r-base=4.1.2=hde4fec0_0 + - readline=8.1=h46c0cb4_0 + - sed=4.8=he412f7d_0 + - sysroot_linux-64=2.12=he073ed8_15 + - tk=8.6.11=h27826a3_1 + - tktable=2.10=hb7b940f_3 + - xorg-kbproto=1.0.7=h7f98852_1002 + - xorg-libice=1.0.10=h7f98852_0 + - xorg-libsm=1.2.3=hd9c2040_1000 + - xorg-libx11=1.7.2=h7f98852_0 + - xorg-libxau=1.0.9=h7f98852_0 + - xorg-libxdmcp=1.1.3=h7f98852_0 + - xorg-libxext=1.3.4=h7f98852_1 + - xorg-libxrender=0.9.10=h7f98852_1003 + - xorg-libxt=1.2.1=h7f98852_2 + - xorg-renderproto=0.11.1=h7f98852_1002 + - xorg-xextproto=7.3.0=h7f98852_1002 + - xorg-xproto=7.0.31=h7f98852_1007 + - xz=5.2.5=h516909a_1 + - zlib=1.2.11=h36c2ea0_1013 + - zstd=1.5.1=ha95c52a_0 diff --git a/mdd.Rproj b/mdd.Rproj new file mode 100644 index 0000000..8e3c2eb --- /dev/null +++ b/mdd.Rproj @@ -0,0 +1,13 @@ +Version: 1.0 + +RestoreWorkspace: Default +SaveWorkspace: Default +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: Sweave +LaTeX: pdfLaTeX diff --git a/renv.lock b/renv.lock new file mode 100644 index 0000000..6d05c59 --- /dev/null +++ b/renv.lock @@ -0,0 +1,3827 @@ +{ + "R": { + "Version": "4.1.2", + "Repositories": [ + { + "Name": "CRAN", + "URL": "https://cran.rstudio.com" + } + ] + }, + "Bioconductor": { + "Version": "3.14" + }, + "Packages": { + "AnnotationDbi": { + "Package": "AnnotationDbi", + "Version": "1.56.2", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/AnnotationDbi", + "git_branch": "RELEASE_3_14", + "git_last_commit": "13fdc4a", + "git_last_commit_date": "2021-11-09", + "Hash": "ae553c2779c85946f1452919cc3e71e3", + "Requirements": [ + "Biobase", + "BiocGenerics", + "DBI", + "IRanges", + "KEGGREST", + "RSQLite", + "S4Vectors" + ] + }, + "AnnotationFilter": { + "Package": "AnnotationFilter", + "Version": "1.18.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/AnnotationFilter", + "git_branch": "RELEASE_3_14", + "git_last_commit": "60a9b66", + "git_last_commit_date": "2021-10-26", + "Hash": "968c1f39bb264ad9d03e6d58eca88450", + "Requirements": [ + "GenomicRanges", + "lazyeval" + ] + }, + "AnnotationHub": { + "Package": "AnnotationHub", + "Version": "3.2.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/AnnotationHub", + "git_branch": "RELEASE_3_14", + "git_last_commit": "873fb33", + "git_last_commit_date": "2021-10-26", + "Hash": "d22c20229f638ef04edc26f753c602bb", + "Requirements": [ + "AnnotationDbi", + "BiocFileCache", + "BiocGenerics", + "BiocManager", + "BiocVersion", + "RSQLite", + "S4Vectors", + "curl", + "dplyr", + "httr", + "interactiveDisplayBase", + "rappdirs", + "yaml" + ] + }, + "BH": { + "Package": "BH", + "Version": "1.78.0-0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "4e348572ffcaa2fb1e610e7a941f6f3a", + "Requirements": [] + }, + "BSgenome": { + "Package": "BSgenome", + "Version": "1.62.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/BSgenome", + "git_branch": "RELEASE_3_14", + "git_last_commit": "9b1859e", + "git_last_commit_date": "2021-10-26", + "Hash": "9faf5e6c3172d92e6671484c70be1e97", + "Requirements": [ + "BiocGenerics", + "Biostrings", + "GenomeInfoDb", + "GenomicRanges", + "IRanges", + "Rsamtools", + "S4Vectors", + "XVector", + "matrixStats", + "rtracklayer" + ] + }, + "Biobase": { + "Package": "Biobase", + "Version": "2.54.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/Biobase", + "git_branch": "RELEASE_3_14", + "git_last_commit": "8215d76", + "git_last_commit_date": "2021-10-26", + "Hash": "767057b0e2897e2a43b59718be888ccd", + "Requirements": [ + "BiocGenerics" + ] + }, + "BiocFileCache": { + "Package": "BiocFileCache", + "Version": "2.2.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/BiocFileCache", + "git_branch": "RELEASE_3_14", + "git_last_commit": "5637b78", + "git_last_commit_date": "2021-10-26", + "Hash": "037277ba19acdb5cf4573532dfb20f76", + "Requirements": [ + "DBI", + "RSQLite", + "curl", + "dbplyr", + "dplyr", + "filelock", + "httr", + "rappdirs" + ] + }, + "BiocGenerics": { + "Package": "BiocGenerics", + "Version": "0.40.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/BiocGenerics", + "git_branch": "RELEASE_3_14", + "git_last_commit": "0bc1e0e", + "git_last_commit_date": "2021-10-26", + "Hash": "ddc1d29bbe66aaef34b0d17620b61a69", + "Requirements": [] + }, + "BiocIO": { + "Package": "BiocIO", + "Version": "1.4.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/BiocIO", + "git_branch": "RELEASE_3_14", + "git_last_commit": "c335932", + "git_last_commit_date": "2021-10-26", + "Hash": "10f50bd6daf34cd11d222befa8829635", + "Requirements": [ + "BiocGenerics", + "S4Vectors" + ] + }, + "BiocManager": { + "Package": "BiocManager", + "Version": "1.30.16", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "2fdca0877debdd4668190832cdee4c31", + "Requirements": [] + }, + "BiocParallel": { + "Package": "BiocParallel", + "Version": "1.28.3", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/BiocParallel", + "git_branch": "RELEASE_3_14", + "git_last_commit": "2f9d88a", + "git_last_commit_date": "2021-12-07", + "Hash": "460c266560eefcf641c3d7c5169e5bb3", + "Requirements": [ + "BH", + "futile.logger", + "snow" + ] + }, + "BiocSingular": { + "Package": "BiocSingular", + "Version": "1.10.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/BiocSingular", + "git_branch": "RELEASE_3_14", + "git_last_commit": "6615ae8", + "git_last_commit_date": "2021-10-26", + "Hash": "075c2e9c722f3a98268ead15cff94b63", + "Requirements": [ + "BiocGenerics", + "BiocParallel", + "DelayedArray", + "Matrix", + "Rcpp", + "S4Vectors", + "ScaledMatrix", + "beachmat", + "irlba", + "rsvd" + ] + }, + "BiocVersion": { + "Package": "BiocVersion", + "Version": "3.14.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/BiocVersion", + "git_branch": "master", + "git_last_commit": "aa56d93", + "git_last_commit_date": "2021-05-19", + "Hash": "e57437f82a5c13263a9cf442b9796ba3", + "Requirements": [] + }, + "Biostrings": { + "Package": "Biostrings", + "Version": "2.62.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/Biostrings", + "git_branch": "RELEASE_3_14", + "git_last_commit": "53ed287", + "git_last_commit_date": "2021-10-26", + "Hash": "a2b71046a5e013f4929b85937392a1f9", + "Requirements": [ + "BiocGenerics", + "GenomeInfoDb", + "IRanges", + "S4Vectors", + "XVector", + "crayon" + ] + }, + "DBI": { + "Package": "DBI", + "Version": "1.1.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "dcd1743af4336156873e3ce3c950b8b9", + "Requirements": [] + }, + "DESeq2": { + "Package": "DESeq2", + "Version": "1.34.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/DESeq2", + "git_branch": "RELEASE_3_14", + "git_last_commit": "25d4f74", + "git_last_commit_date": "2021-10-26", + "Hash": "9f66edf50ad856a56a804a451ce7b3bc", + "Requirements": [ + "Biobase", + "BiocGenerics", + "BiocParallel", + "GenomicRanges", + "IRanges", + "Rcpp", + "RcppArmadillo", + "S4Vectors", + "SummarizedExperiment", + "genefilter", + "geneplotter", + "ggplot2", + "locfit" + ] + }, + "DEXSeq": { + "Package": "DEXSeq", + "Version": "1.40.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/DEXSeq", + "git_branch": "RELEASE_3_14", + "git_last_commit": "7d2d639", + "git_last_commit_date": "2021-10-26", + "Hash": "9e1913461bc39664d39f4ba1b74a9a4f", + "Requirements": [ + "AnnotationDbi", + "Biobase", + "BiocGenerics", + "BiocParallel", + "DESeq2", + "GenomicRanges", + "IRanges", + "RColorBrewer", + "Rsamtools", + "S4Vectors", + "SummarizedExperiment", + "biomaRt", + "genefilter", + "geneplotter", + "hwriter", + "statmod", + "stringr" + ] + }, + "DEoptimR": { + "Package": "DEoptimR", + "Version": "1.0-10", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "455af0b32e7e45047cf7f495d462e456", + "Requirements": [] + }, + "DO.db": { + "Package": "DO.db", + "Version": "2.9", + "Source": "Bioconductor", + "Hash": "7d05e00472158bda5f124df351af0a49", + "Requirements": [ + "AnnotationDbi" + ] + }, + "DOSE": { + "Package": "DOSE", + "Version": "3.20.1", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/DOSE", + "git_branch": "RELEASE_3_14", + "git_last_commit": "bf434f2", + "git_last_commit_date": "2021-11-17", + "Hash": "a774b8bba3755015ff83e724fe3a1f58", + "Requirements": [ + "AnnotationDbi", + "BiocParallel", + "DO.db", + "GOSemSim", + "fgsea", + "ggplot2", + "qvalue", + "reshape2" + ] + }, + "DRIMSeq": { + "Package": "DRIMSeq", + "Version": "1.22.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/DRIMSeq", + "git_branch": "RELEASE_3_14", + "git_last_commit": "a22c59b", + "git_last_commit_date": "2021-10-26", + "Hash": "cb8aba06b2232fffb0aa2ea1d1eefe4b", + "Requirements": [ + "BiocGenerics", + "BiocParallel", + "GenomicRanges", + "IRanges", + "MASS", + "S4Vectors", + "edgeR", + "ggplot2", + "limma", + "reshape2" + ] + }, + "DT": { + "Package": "DT", + "Version": "0.20", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "0163cd2ce6c7995005a0fc363d570963", + "Requirements": [ + "crosstalk", + "htmltools", + "htmlwidgets", + "jquerylib", + "jsonlite", + "magrittr", + "promises" + ] + }, + "DelayedArray": { + "Package": "DelayedArray", + "Version": "0.20.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/DelayedArray", + "git_branch": "RELEASE_3_14", + "git_last_commit": "829b529", + "git_last_commit_date": "2021-10-26", + "Hash": "8400bc4ac5cf78a44eefa2395a2ed782", + "Requirements": [ + "BiocGenerics", + "IRanges", + "Matrix", + "MatrixGenerics", + "S4Vectors" + ] + }, + "DelayedMatrixStats": { + "Package": "DelayedMatrixStats", + "Version": "1.16.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/DelayedMatrixStats", + "git_branch": "RELEASE_3_14", + "git_last_commit": "d44a3d7", + "git_last_commit_date": "2021-10-26", + "Hash": "9ae660d2827845adeaa2fbdc3e6ad468", + "Requirements": [ + "DelayedArray", + "IRanges", + "Matrix", + "MatrixGenerics", + "S4Vectors", + "matrixStats", + "sparseMatrixStats" + ] + }, + "GO.db": { + "Package": "GO.db", + "Version": "3.14.0", + "Source": "Bioconductor", + "Hash": "ed4177b5fca84cd5833e33615b115382", + "Requirements": [ + "AnnotationDbi" + ] + }, + "GOSemSim": { + "Package": "GOSemSim", + "Version": "2.20.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/GOSemSim", + "git_branch": "RELEASE_3_14", + "git_last_commit": "fa82442", + "git_last_commit_date": "2021-10-26", + "Hash": "a90b1805395d561aa48d49c98e53056a", + "Requirements": [ + "AnnotationDbi", + "GO.db", + "Rcpp" + ] + }, + "GenomeInfoDb": { + "Package": "GenomeInfoDb", + "Version": "1.30.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/GenomeInfoDb", + "git_branch": "RELEASE_3_14", + "git_last_commit": "8f1b851", + "git_last_commit_date": "2021-10-26", + "Hash": "60675b8b38328ccf13406f136c0cf1ee", + "Requirements": [ + "BiocGenerics", + "GenomeInfoDbData", + "IRanges", + "RCurl", + "S4Vectors" + ] + }, + "GenomeInfoDbData": { + "Package": "GenomeInfoDbData", + "Version": "1.2.7", + "Source": "Bioconductor", + "Hash": "89e8144e21da34e26b7c05945cefa3ca", + "Requirements": [] + }, + "GenomicAlignments": { + "Package": "GenomicAlignments", + "Version": "1.30.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/GenomicAlignments", + "git_branch": "RELEASE_3_14", + "git_last_commit": "9046119", + "git_last_commit_date": "2021-10-26", + "Hash": "e1e27b5fac829942cf1359555dfbed9a", + "Requirements": [ + "BiocGenerics", + "BiocParallel", + "Biostrings", + "GenomeInfoDb", + "GenomicRanges", + "IRanges", + "Rsamtools", + "S4Vectors", + "SummarizedExperiment" + ] + }, + "GenomicFeatures": { + "Package": "GenomicFeatures", + "Version": "1.46.3", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/GenomicFeatures", + "git_branch": "RELEASE_3_14", + "git_last_commit": "b646ba6", + "git_last_commit_date": "2021-12-23", + "Hash": "9abd7e60363a6a772816a32bf0171086", + "Requirements": [ + "AnnotationDbi", + "Biobase", + "BiocGenerics", + "BiocIO", + "Biostrings", + "DBI", + "GenomeInfoDb", + "GenomicRanges", + "IRanges", + "RCurl", + "RSQLite", + "S4Vectors", + "XVector", + "biomaRt", + "rtracklayer" + ] + }, + "GenomicRanges": { + "Package": "GenomicRanges", + "Version": "1.46.1", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/GenomicRanges", + "git_branch": "RELEASE_3_14", + "git_last_commit": "e422642", + "git_last_commit_date": "2021-11-16", + "Hash": "4d9cdd0c25e0c40075a2756aa78f4960", + "Requirements": [ + "BiocGenerics", + "GenomeInfoDb", + "IRanges", + "S4Vectors", + "XVector" + ] + }, + "HDInterval": { + "Package": "HDInterval", + "Version": "0.2.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "3b986a53325a1d95610b8d86a284dac0", + "Requirements": [] + }, + "IRanges": { + "Package": "IRanges", + "Version": "2.28.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/IRanges", + "git_branch": "RELEASE_3_14", + "git_last_commit": "d85ee90", + "git_last_commit_date": "2021-10-26", + "Hash": "8299b0f981c924a2b824be548f836e9d", + "Requirements": [ + "BiocGenerics", + "S4Vectors" + ] + }, + "IsoformSwitchAnalyzeR": { + "Package": "IsoformSwitchAnalyzeR", + "Version": "1.16.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/IsoformSwitchAnalyzeR", + "git_branch": "RELEASE_3_14", + "git_last_commit": "5eb5b2b", + "git_last_commit_date": "2021-10-26", + "Hash": "ce3f5525d045528df3dc7c7ab5609aaf", + "Requirements": [ + "BSgenome", + "Biobase", + "BiocGenerics", + "Biostrings", + "DBI", + "DEXSeq", + "DRIMSeq", + "GenomeInfoDb", + "GenomicRanges", + "IRanges", + "RColorBrewer", + "RCurl", + "VennDiagram", + "XVector", + "dplyr", + "edgeR", + "futile.logger", + "ggplot2", + "gridExtra", + "limma", + "magrittr", + "plyr", + "readr", + "reshape2", + "rtracklayer", + "stringr", + "tibble", + "tximeta", + "tximport" + ] + }, + "KEGGREST": { + "Package": "KEGGREST", + "Version": "1.34.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/KEGGREST", + "git_branch": "RELEASE_3_14", + "git_last_commit": "2056750", + "git_last_commit_date": "2021-10-26", + "Hash": "01d7ab3deeee1307b7dfa8eafae2a106", + "Requirements": [ + "Biostrings", + "httr", + "png" + ] + }, + "KernSmooth": { + "Package": "KernSmooth", + "Version": "2.23-20", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "8dcfa99b14c296bc9f1fd64d52fd3ce7", + "Requirements": [] + }, + "MASS": { + "Package": "MASS", + "Version": "7.3-54", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "0e59129db205112e3963904db67fd0dc", + "Requirements": [] + }, + "Matrix": { + "Package": "Matrix", + "Version": "1.4-0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "130c0caba175739d98f2963c6a407cf6", + "Requirements": [ + "lattice" + ] + }, + "MatrixGenerics": { + "Package": "MatrixGenerics", + "Version": "1.6.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/MatrixGenerics", + "git_branch": "RELEASE_3_14", + "git_last_commit": "4588a60", + "git_last_commit_date": "2021-10-26", + "Hash": "506b92cb263d9e014a391b41939badcf", + "Requirements": [ + "matrixStats" + ] + }, + "PCAtools": { + "Package": "PCAtools", + "Version": "2.6.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/PCAtools", + "git_branch": "RELEASE_3_14", + "git_last_commit": "9c497b5", + "git_last_commit_date": "2021-10-26", + "Hash": "dea9883f12c63849b9ee9fa54824e61e", + "Requirements": [ + "BH", + "BiocParallel", + "BiocSingular", + "DelayedArray", + "DelayedMatrixStats", + "Matrix", + "Rcpp", + "beachmat", + "cowplot", + "dqrng", + "ggplot2", + "ggrepel", + "lattice", + "reshape2" + ] + }, + "ProtGenerics": { + "Package": "ProtGenerics", + "Version": "1.26.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/ProtGenerics", + "git_branch": "RELEASE_3_14", + "git_last_commit": "2033289", + "git_last_commit_date": "2021-10-26", + "Hash": "00fb5dbafc94b13ff52e5af4a32a5f5a", + "Requirements": [] + }, + "R6": { + "Package": "R6", + "Version": "2.5.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "470851b6d5d0ac559e9d01bb352b4021", + "Requirements": [] + }, + "RColorBrewer": { + "Package": "RColorBrewer", + "Version": "1.1-2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "e031418365a7f7a766181ab5a41a5716", + "Requirements": [] + }, + "RCurl": { + "Package": "RCurl", + "Version": "1.98-1.5", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "5cc50d9d40a284cb8b1c8604901acf89", + "Requirements": [ + "bitops" + ] + }, + "RSQLite": { + "Package": "RSQLite", + "Version": "2.2.9", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "10d7d118b5ad61a9a02b5cbf36119ac4", + "Requirements": [ + "DBI", + "Rcpp", + "bit64", + "blob", + "memoise", + "pkgconfig", + "plogr" + ] + }, + "Rcpp": { + "Package": "Rcpp", + "Version": "1.0.7", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "dab19adae4440ae55aa8a9d238b246bb", + "Requirements": [] + }, + "RcppArmadillo": { + "Package": "RcppArmadillo", + "Version": "0.10.7.5.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "14ad1fed2ee50fbfdfd52ace20eb02d0", + "Requirements": [ + "Rcpp" + ] + }, + "RcppEigen": { + "Package": "RcppEigen", + "Version": "0.3.3.9.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "ddfa72a87fdf4c80466a20818be91d00", + "Requirements": [ + "Matrix", + "Rcpp" + ] + }, + "RcppParallel": { + "Package": "RcppParallel", + "Version": "5.1.5", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "f3e94e34ff656a7c8336ce01207bc2b8", + "Requirements": [] + }, + "RedeR": { + "Package": "RedeR", + "Version": "1.42.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/RedeR", + "git_branch": "RELEASE_3_14", + "git_last_commit": "1bd8c6a", + "git_last_commit_date": "2021-10-26", + "Hash": "d9054c973585fbf7d5b9656cfc946889", + "Requirements": [ + "igraph" + ] + }, + "Rhtslib": { + "Package": "Rhtslib", + "Version": "1.26.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/Rhtslib", + "git_branch": "RELEASE_3_14", + "git_last_commit": "f5b20e9", + "git_last_commit_date": "2021-10-26", + "Hash": "b88f760ac9993107b94388100f136f43", + "Requirements": [ + "zlibbioc" + ] + }, + "Rsamtools": { + "Package": "Rsamtools", + "Version": "2.10.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/Rsamtools", + "git_branch": "RELEASE_3_14", + "git_last_commit": "b19738e", + "git_last_commit_date": "2021-10-26", + "Hash": "55e8c5ccea90dfc370e4abdbc5a01cb9", + "Requirements": [ + "BiocGenerics", + "BiocParallel", + "Biostrings", + "GenomeInfoDb", + "GenomicRanges", + "IRanges", + "Rhtslib", + "S4Vectors", + "XVector", + "bitops", + "zlibbioc" + ] + }, + "Rttf2pt1": { + "Package": "Rttf2pt1", + "Version": "1.3.9", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "da6ab407fa2e5e498ac980f92798cfed", + "Requirements": [] + }, + "S4Vectors": { + "Package": "S4Vectors", + "Version": "0.32.3", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/S4Vectors", + "git_branch": "RELEASE_3_14", + "git_last_commit": "ad90e78", + "git_last_commit_date": "2021-11-18", + "Hash": "7c01112d4a7528159c335b486a046101", + "Requirements": [ + "BiocGenerics" + ] + }, + "ScaledMatrix": { + "Package": "ScaledMatrix", + "Version": "1.2.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/ScaledMatrix", + "git_branch": "RELEASE_3_14", + "git_last_commit": "d0573e1", + "git_last_commit_date": "2021-10-26", + "Hash": "cbfb8a57fa1ee80e29bd822e8597e9a2", + "Requirements": [ + "DelayedArray", + "Matrix", + "S4Vectors" + ] + }, + "StanHeaders": { + "Package": "StanHeaders", + "Version": "2.21.0-7", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "0459d4dd7a8c239be18469a30c23dd4b", + "Requirements": [ + "RcppEigen", + "RcppParallel" + ] + }, + "SummarizedExperiment": { + "Package": "SummarizedExperiment", + "Version": "1.24.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/SummarizedExperiment", + "git_branch": "RELEASE_3_14", + "git_last_commit": "d37f193", + "git_last_commit_date": "2021-10-26", + "Hash": "619feb3635b27a198477316a033b1ea8", + "Requirements": [ + "Biobase", + "BiocGenerics", + "DelayedArray", + "GenomeInfoDb", + "GenomicRanges", + "IRanges", + "Matrix", + "MatrixGenerics", + "S4Vectors" + ] + }, + "UpSetR": { + "Package": "UpSetR", + "Version": "1.4.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "f6ef89503aaff474873f8bc1823894e1", + "Requirements": [ + "ggplot2", + "gridExtra", + "plyr", + "scales" + ] + }, + "VennDiagram": { + "Package": "VennDiagram", + "Version": "1.7.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "162475e02c384b61b708b48bee52c95b", + "Requirements": [ + "futile.logger" + ] + }, + "XML": { + "Package": "XML", + "Version": "3.99-0.8", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "d493b952a9073c62f72392a673d7c548", + "Requirements": [] + }, + "XVector": { + "Package": "XVector", + "Version": "0.34.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/XVector", + "git_branch": "RELEASE_3_14", + "git_last_commit": "06adb25", + "git_last_commit_date": "2021-10-26", + "Hash": "9830cb6fc09640591c2f6436467af3c5", + "Requirements": [ + "BiocGenerics", + "IRanges", + "S4Vectors", + "zlibbioc" + ] + }, + "abind": { + "Package": "abind", + "Version": "1.4-5", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "4f57884290cc75ab22f4af9e9d4ca862", + "Requirements": [] + }, + "annotate": { + "Package": "annotate", + "Version": "1.72.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/annotate", + "git_branch": "RELEASE_3_14", + "git_last_commit": "67ac76a", + "git_last_commit_date": "2021-10-26", + "Hash": "885c32b60eab51236e4afe8921049ff1", + "Requirements": [ + "AnnotationDbi", + "Biobase", + "BiocGenerics", + "DBI", + "XML", + "httr", + "xtable" + ] + }, + "ape": { + "Package": "ape", + "Version": "5.6", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "f301abb98dffa27f7a961e7f95ab8197", + "Requirements": [ + "Rcpp", + "lattice", + "nlme" + ] + }, + "aplot": { + "Package": "aplot", + "Version": "0.1.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "b93cc2a180e844dba48c25d754e46980", + "Requirements": [ + "ggfun", + "ggplot2", + "ggplotify", + "magrittr", + "patchwork", + "yulab.utils" + ] + }, + "arrayhelpers": { + "Package": "arrayhelpers", + "Version": "1.1-0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "3d4e52d458784c335af3846f2de64f75", + "Requirements": [ + "svUnit" + ] + }, + "askpass": { + "Package": "askpass", + "Version": "1.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "e8a22846fff485f0be3770c2da758713", + "Requirements": [ + "sys" + ] + }, + "assertthat": { + "Package": "assertthat", + "Version": "0.2.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "50c838a310445e954bc13f26f26a6ecf", + "Requirements": [] + }, + "backports": { + "Package": "backports", + "Version": "1.4.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "c39fbec8a30d23e721980b8afb31984c", + "Requirements": [] + }, + "base64enc": { + "Package": "base64enc", + "Version": "0.1-3", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "543776ae6848fde2f48ff3816d0628bc", + "Requirements": [] + }, + "beachmat": { + "Package": "beachmat", + "Version": "2.10.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/beachmat", + "git_branch": "RELEASE_3_14", + "git_last_commit": "b7cc532", + "git_last_commit_date": "2021-10-26", + "Hash": "f58f6f48893416211092b9600ddeba67", + "Requirements": [ + "BiocGenerics", + "DelayedArray", + "Matrix", + "Rcpp" + ] + }, + "benchmarkme": { + "Package": "benchmarkme", + "Version": "1.0.7", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "9213add5a4904660aeaf207bb62e515e", + "Requirements": [ + "Matrix", + "benchmarkmeData", + "doParallel", + "dplyr", + "foreach", + "httr", + "tibble" + ] + }, + "benchmarkmeData": { + "Package": "benchmarkmeData", + "Version": "1.0.4", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "03127f8e60281ab3c52f96bb98056dcb", + "Requirements": [ + "dplyr", + "tibble" + ] + }, + "biomaRt": { + "Package": "biomaRt", + "Version": "2.50.1", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/biomaRt", + "git_branch": "RELEASE_3_14", + "git_last_commit": "d0de544", + "git_last_commit_date": "2021-11-19", + "Hash": "86179e7db40b1081f4a8a0ac9434142a", + "Requirements": [ + "AnnotationDbi", + "BiocFileCache", + "XML", + "digest", + "httr", + "progress", + "rappdirs", + "stringr", + "xml2" + ] + }, + "bit": { + "Package": "bit", + "Version": "4.0.4", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "f36715f14d94678eea9933af927bc15d", + "Requirements": [] + }, + "bit64": { + "Package": "bit64", + "Version": "4.0.5", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "9fe98599ca456d6552421db0d6772d8f", + "Requirements": [ + "bit" + ] + }, + "bitops": { + "Package": "bitops", + "Version": "1.0-7", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "b7d8d8ee39869c18d8846a184dd8a1af", + "Requirements": [] + }, + "blob": { + "Package": "blob", + "Version": "1.2.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "dc5f7a6598bb025d20d66bb758f12879", + "Requirements": [ + "rlang", + "vctrs" + ] + }, + "brio": { + "Package": "brio", + "Version": "1.1.3", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "976cf154dfb043c012d87cddd8bca363", + "Requirements": [] + }, + "broom": { + "Package": "broom", + "Version": "0.7.11", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "e4487657db580ae1fe0f85237a88ff1f", + "Requirements": [ + "backports", + "dplyr", + "ellipsis", + "generics", + "ggplot2", + "glue", + "purrr", + "rlang", + "stringr", + "tibble", + "tidyr" + ] + }, + "bslib": { + "Package": "bslib", + "Version": "0.3.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "56ae7e1987b340186a8a5a157c2ec358", + "Requirements": [ + "htmltools", + "jquerylib", + "jsonlite", + "rlang", + "sass" + ] + }, + "caTools": { + "Package": "caTools", + "Version": "1.18.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "34d90fa5845004236b9eacafc51d07b2", + "Requirements": [ + "bitops" + ] + }, + "cachem": { + "Package": "cachem", + "Version": "1.0.6", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "648c5b3d71e6a37e3043617489a0a0e9", + "Requirements": [ + "fastmap", + "rlang" + ] + }, + "callr": { + "Package": "callr", + "Version": "3.7.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "461aa75a11ce2400245190ef5d3995df", + "Requirements": [ + "R6", + "processx" + ] + }, + "cellranger": { + "Package": "cellranger", + "Version": "1.1.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "f61dbaec772ccd2e17705c1e872e9e7c", + "Requirements": [ + "rematch", + "tibble" + ] + }, + "checkmate": { + "Package": "checkmate", + "Version": "2.0.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "a667800d5f0350371bedeb8b8b950289", + "Requirements": [ + "backports" + ] + }, + "cli": { + "Package": "cli", + "Version": "3.1.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "66a3834e54593c89d8beefb312347e58", + "Requirements": [ + "glue" + ] + }, + "clipr": { + "Package": "clipr", + "Version": "0.7.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "ebaa97ac99cc2daf04e77eecc7b781d7", + "Requirements": [] + }, + "clusterProfiler": { + "Package": "clusterProfiler", + "Version": "4.2.1", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/clusterProfiler", + "git_branch": "RELEASE_3_14", + "git_last_commit": "2bd52c6", + "git_last_commit_date": "2021-12-13", + "Hash": "e330050506dafd2d4766d2e1914f8573", + "Requirements": [ + "AnnotationDbi", + "DOSE", + "GO.db", + "GOSemSim", + "downloader", + "dplyr", + "enrichplot", + "magrittr", + "plyr", + "qvalue", + "rlang", + "tidyr", + "yulab.utils" + ] + }, + "coda": { + "Package": "coda", + "Version": "0.19-4", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "24b6d006b8b2343876cf230687546932", + "Requirements": [ + "lattice" + ] + }, + "codetools": { + "Package": "codetools", + "Version": "0.2-18", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "019388fc48e48b3da0d3a76ff94608a8", + "Requirements": [] + }, + "colorspace": { + "Package": "colorspace", + "Version": "2.0-2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "6baccb763ee83c0bd313460fdb8b8a84", + "Requirements": [] + }, + "commonmark": { + "Package": "commonmark", + "Version": "1.7", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "0f22be39ec1d141fd03683c06f3a6e67", + "Requirements": [] + }, + "concatenate": { + "Package": "concatenate", + "Version": "1.0.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "94b165d30bf16386c2f096409d502463", + "Requirements": [] + }, + "cowplot": { + "Package": "cowplot", + "Version": "1.1.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "b418e8423699d11c7f2087c2bfd07da2", + "Requirements": [ + "ggplot2", + "gtable", + "rlang", + "scales" + ] + }, + "cpp11": { + "Package": "cpp11", + "Version": "0.4.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "fa53ce256cd280f468c080a58ea5ba8c", + "Requirements": [] + }, + "crayon": { + "Package": "crayon", + "Version": "1.4.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "0a6a65d92bd45b47b94b84244b528d17", + "Requirements": [] + }, + "crosstalk": { + "Package": "crosstalk", + "Version": "1.2.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "6aa54f69598c32177e920eb3402e8293", + "Requirements": [ + "R6", + "htmltools", + "jsonlite", + "lazyeval" + ] + }, + "curl": { + "Package": "curl", + "Version": "4.3.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "022c42d49c28e95d69ca60446dbabf88", + "Requirements": [] + }, + "data.table": { + "Package": "data.table", + "Version": "1.14.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "36b67b5adf57b292923f5659f5f0c853", + "Requirements": [] + }, + "dbplyr": { + "Package": "dbplyr", + "Version": "2.1.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "1f37fa4ab2f5f7eded42f78b9a887182", + "Requirements": [ + "DBI", + "R6", + "assertthat", + "blob", + "dplyr", + "ellipsis", + "glue", + "lifecycle", + "magrittr", + "purrr", + "rlang", + "tibble", + "tidyselect", + "vctrs", + "withr" + ] + }, + "desc": { + "Package": "desc", + "Version": "1.4.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "28763d08fadd0b733e3cee9dab4e12fe", + "Requirements": [ + "R6", + "crayon", + "rprojroot" + ] + }, + "dichromat": { + "Package": "dichromat", + "Version": "2.0-0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "fe1a3788cf243db3eca07ae661860793", + "Requirements": [] + }, + "diffobj": { + "Package": "diffobj", + "Version": "0.3.5", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "bcaa8b95f8d7d01a5dedfd959ce88ab8", + "Requirements": [ + "crayon" + ] + }, + "digest": { + "Package": "digest", + "Version": "0.6.29", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "cf6b206a045a684728c3267ef7596190", + "Requirements": [] + }, + "directlabels": { + "Package": "directlabels", + "Version": "2021.1.13", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "dd27110dd3d729cca5fa4b2bf52a2040", + "Requirements": [ + "quadprog" + ] + }, + "distributional": { + "Package": "distributional", + "Version": "0.3.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "1cba2656c1cab717a3ddea79664cc534", + "Requirements": [ + "digest", + "ellipsis", + "farver", + "generics", + "ggplot2", + "lifecycle", + "numDeriv", + "rlang", + "scales", + "vctrs" + ] + }, + "doParallel": { + "Package": "doParallel", + "Version": "1.0.16", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "2dc413572eb42475179bfe0afabd2adf", + "Requirements": [ + "foreach", + "iterators" + ] + }, + "downloader": { + "Package": "downloader", + "Version": "0.4", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "f4f2a915e0dedbdf016a83b63477349f", + "Requirements": [ + "digest" + ] + }, + "dplyr": { + "Package": "dplyr", + "Version": "1.0.7", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "36f1ae62f026c8ba9f9b5c9a08c03297", + "Requirements": [ + "R6", + "ellipsis", + "generics", + "glue", + "lifecycle", + "magrittr", + "pillar", + "rlang", + "tibble", + "tidyselect", + "vctrs" + ] + }, + "dqrng": { + "Package": "dqrng", + "Version": "0.3.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "3ce2af5ead3b01c518fd453c7fe5a51a", + "Requirements": [ + "BH", + "Rcpp", + "sitmo" + ] + }, + "dtplyr": { + "Package": "dtplyr", + "Version": "1.2.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "f62678f8c708f10ee8f419862b9b008e", + "Requirements": [ + "crayon", + "data.table", + "dplyr", + "ellipsis", + "glue", + "lifecycle", + "rlang", + "tibble", + "tidyselect", + "vctrs" + ] + }, + "edgeR": { + "Package": "edgeR", + "Version": "3.36.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/edgeR", + "git_branch": "RELEASE_3_14", + "git_last_commit": "c7db03a", + "git_last_commit_date": "2021-10-26", + "Hash": "670b85ad64219de76ff7e539a41b58a6", + "Requirements": [ + "Rcpp", + "limma", + "locfit" + ] + }, + "ellipsis": { + "Package": "ellipsis", + "Version": "0.3.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "bb0eec2fe32e88d9e2836c2f73ea2077", + "Requirements": [ + "rlang" + ] + }, + "enrichplot": { + "Package": "enrichplot", + "Version": "1.14.1", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/enrichplot", + "git_branch": "RELEASE_3_14", + "git_last_commit": "ccf3a6d", + "git_last_commit_date": "2021-10-31", + "Hash": "0795ea7dc0ddd00551c7f37d10250a7a", + "Requirements": [ + "DOSE", + "GOSemSim", + "RColorBrewer", + "aplot", + "ggplot2", + "ggraph", + "ggtree", + "igraph", + "magrittr", + "plyr", + "purrr", + "reshape2", + "scatterpie", + "shadowtext", + "yulab.utils" + ] + }, + "ensembldb": { + "Package": "ensembldb", + "Version": "2.18.2", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/ensembldb", + "git_branch": "RELEASE_3_14", + "git_last_commit": "a633cec", + "git_last_commit_date": "2021-11-08", + "Hash": "0265e4299270a721399d249bfe1d68f5", + "Requirements": [ + "AnnotationDbi", + "AnnotationFilter", + "Biobase", + "BiocGenerics", + "Biostrings", + "DBI", + "GenomeInfoDb", + "GenomicFeatures", + "GenomicRanges", + "IRanges", + "ProtGenerics", + "RSQLite", + "Rsamtools", + "S4Vectors", + "curl", + "rtracklayer" + ] + }, + "evaluate": { + "Package": "evaluate", + "Version": "0.14", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "ec8ca05cffcc70569eaaad8469d2a3a7", + "Requirements": [] + }, + "extrafont": { + "Package": "extrafont", + "Version": "0.17", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "7f2f50e8f998a4bea4b04650fc4f2ca8", + "Requirements": [ + "Rttf2pt1", + "extrafontdb" + ] + }, + "extrafontdb": { + "Package": "extrafontdb", + "Version": "1.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "a861555ddec7451c653b40e713166c6f", + "Requirements": [] + }, + "fansi": { + "Package": "fansi", + "Version": "0.5.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "d447b40982c576a72b779f0a3b3da227", + "Requirements": [] + }, + "farver": { + "Package": "farver", + "Version": "2.1.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "c98eb5133d9cb9e1622b8691487f11bb", + "Requirements": [] + }, + "fastmap": { + "Package": "fastmap", + "Version": "1.1.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "77bd60a6157420d4ffa93b27cf6a58b8", + "Requirements": [] + }, + "fastmatch": { + "Package": "fastmatch", + "Version": "1.1-3", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "dabc225759a2c2b241e60e42bf0e8e54", + "Requirements": [] + }, + "fgsea": { + "Package": "fgsea", + "Version": "1.20.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/fgsea", + "git_branch": "RELEASE_3_14", + "git_last_commit": "b704f81", + "git_last_commit_date": "2021-10-26", + "Hash": "a4913104166e73957fa32d2e595cceef", + "Requirements": [ + "BH", + "BiocParallel", + "Matrix", + "Rcpp", + "data.table", + "fastmatch", + "ggplot2", + "gridExtra" + ] + }, + "filelock": { + "Package": "filelock", + "Version": "1.0.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "38ec653c2613bed60052ba3787bd8a2c", + "Requirements": [] + }, + "fontawesome": { + "Package": "fontawesome", + "Version": "0.2.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "55624ed409e46c5f358b2c060be87f67", + "Requirements": [ + "htmltools", + "rlang" + ] + }, + "forcats": { + "Package": "forcats", + "Version": "0.5.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "81c3244cab67468aac4c60550832655d", + "Requirements": [ + "ellipsis", + "magrittr", + "rlang", + "tibble" + ] + }, + "foreach": { + "Package": "foreach", + "Version": "1.5.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "e32cfc0973caba11b65b1fa691b4d8c9", + "Requirements": [ + "codetools", + "iterators" + ] + }, + "formatR": { + "Package": "formatR", + "Version": "1.11", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "2590a6a868515a69f258640a51b724c9", + "Requirements": [] + }, + "fs": { + "Package": "fs", + "Version": "1.5.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "7c89603d81793f0d5486d91ab1fc6f1d", + "Requirements": [] + }, + "furrr": { + "Package": "furrr", + "Version": "0.2.3", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "2aba4ab06e8707ac054c6683cb6fed56", + "Requirements": [ + "ellipsis", + "future", + "globals", + "lifecycle", + "purrr", + "rlang", + "vctrs" + ] + }, + "futile.logger": { + "Package": "futile.logger", + "Version": "1.4.3", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "99f0ace8c05ec7d3683d27083c4f1e7e", + "Requirements": [ + "futile.options", + "lambda.r" + ] + }, + "futile.options": { + "Package": "futile.options", + "Version": "1.0.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "0d9bf02413ddc2bbe8da9ce369dcdd2b", + "Requirements": [] + }, + "future": { + "Package": "future", + "Version": "1.23.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "7bf6fbed7f00cae876901fd70c04f3a4", + "Requirements": [ + "digest", + "globals", + "listenv", + "parallelly" + ] + }, + "gargle": { + "Package": "gargle", + "Version": "1.2.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "9d234e6a87a6f8181792de6dc4a00e39", + "Requirements": [ + "cli", + "fs", + "glue", + "httr", + "jsonlite", + "rappdirs", + "rlang", + "rstudioapi", + "withr" + ] + }, + "genefilter": { + "Package": "genefilter", + "Version": "1.76.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/genefilter", + "git_branch": "RELEASE_3_14", + "git_last_commit": "8d630fd", + "git_last_commit_date": "2021-10-26", + "Hash": "0ef8e3dec95ba3b7499e8758a2415619", + "Requirements": [ + "AnnotationDbi", + "Biobase", + "BiocGenerics", + "annotate", + "survival" + ] + }, + "geneplotter": { + "Package": "geneplotter", + "Version": "1.72.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/geneplotter", + "git_branch": "RELEASE_3_14", + "git_last_commit": "57a1d83", + "git_last_commit_date": "2021-10-26", + "Hash": "58dd1ac308d099f502a0eebe5bf714fa", + "Requirements": [ + "AnnotationDbi", + "Biobase", + "BiocGenerics", + "RColorBrewer", + "annotate", + "lattice" + ] + }, + "generics": { + "Package": "generics", + "Version": "0.1.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "3f6bcfb0ee5d671d9fd1893d2faa79cb", + "Requirements": [] + }, + "ggdist": { + "Package": "ggdist", + "Version": "3.0.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "1667dc859397c6ea01a39382a4cdf4ee", + "Requirements": [ + "HDInterval", + "distributional", + "dplyr", + "ggplot2", + "rlang", + "scales", + "tibble", + "tidyselect", + "vctrs", + "withr" + ] + }, + "ggforce": { + "Package": "ggforce", + "Version": "0.3.3", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "4c64a588b497f8c088e1d308ddd40bc6", + "Requirements": [ + "MASS", + "Rcpp", + "RcppEigen", + "ggplot2", + "gtable", + "polyclip", + "rlang", + "scales", + "tidyselect", + "tweenr", + "withr" + ] + }, + "ggfun": { + "Package": "ggfun", + "Version": "0.0.4", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "e274c8e45bac263256ae345e867527df", + "Requirements": [ + "ggplot2", + "rlang" + ] + }, + "ggh4x": { + "Package": "ggh4x", + "Version": "0.2.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "5e0b1591bf8489cfacdb5aecf1697626", + "Requirements": [ + "ggplot2", + "gtable", + "rlang", + "scales", + "vctrs" + ] + }, + "ggnewscale": { + "Package": "ggnewscale", + "Version": "0.4.5", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "5d2d9029aa89360eb283e3d10ab8bf42", + "Requirements": [ + "ggplot2" + ] + }, + "ggplot2": { + "Package": "ggplot2", + "Version": "3.3.5", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "d7566c471c7b17e095dd023b9ef155ad", + "Requirements": [ + "MASS", + "digest", + "glue", + "gtable", + "isoband", + "mgcv", + "rlang", + "scales", + "tibble", + "withr" + ] + }, + "ggplotify": { + "Package": "ggplotify", + "Version": "0.1.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "acbcedf783cdb8710168aa0edba42ac0", + "Requirements": [ + "ggplot2", + "gridGraphics", + "yulab.utils" + ] + }, + "ggraph": { + "Package": "ggraph", + "Version": "2.0.5", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "bb52a023e912142b8970ba883dd3b706", + "Requirements": [ + "MASS", + "Rcpp", + "digest", + "dplyr", + "ggforce", + "ggplot2", + "ggrepel", + "graphlayouts", + "gtable", + "igraph", + "rlang", + "scales", + "tidygraph", + "viridis", + "withr" + ] + }, + "ggrepel": { + "Package": "ggrepel", + "Version": "0.9.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "08ab869f37e6a7741a64ab9069bcb67d", + "Requirements": [ + "Rcpp", + "ggplot2", + "rlang", + "scales" + ] + }, + "ggtree": { + "Package": "ggtree", + "Version": "3.2.1", + "Source": "Bioconductor", + "Remotes": "GuangchuangYu/treeio", + "git_url": "https://git.bioconductor.org/packages/ggtree", + "git_branch": "RELEASE_3_14", + "git_last_commit": "d3747e6", + "git_last_commit_date": "2021-11-14", + "Hash": "f156c85173024c88e2fdfd63ccca3fd7", + "Requirements": [ + "ape", + "aplot", + "dplyr", + "ggfun", + "ggplot2", + "magrittr", + "purrr", + "rlang", + "scales", + "tidyr", + "tidytree", + "treeio", + "yulab.utils" + ] + }, + "ggvenn": { + "Package": "ggvenn", + "Version": "0.1.9", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "317f65bef864edb843b67fbdcd14da85", + "Requirements": [ + "dplyr", + "ggplot2" + ] + }, + "globals": { + "Package": "globals", + "Version": "0.14.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "eca8023ed5ca6372479ebb9b3207f5ae", + "Requirements": [ + "codetools" + ] + }, + "glue": { + "Package": "glue", + "Version": "1.6.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "b8bb7aaf248e45bac08ebed86f3a0aa4", + "Requirements": [] + }, + "googledrive": { + "Package": "googledrive", + "Version": "2.0.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "c3a25adbbfbb03f12e6f88c5fb1f3024", + "Requirements": [ + "cli", + "gargle", + "glue", + "httr", + "jsonlite", + "lifecycle", + "magrittr", + "pillar", + "purrr", + "rlang", + "tibble", + "uuid", + "vctrs", + "withr" + ] + }, + "googlesheets4": { + "Package": "googlesheets4", + "Version": "1.0.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "9a6564184dc4a81daea4f1d7ce357c6a", + "Requirements": [ + "cellranger", + "cli", + "curl", + "gargle", + "glue", + "googledrive", + "httr", + "ids", + "magrittr", + "purrr", + "rematch2", + "rlang", + "tibble", + "vctrs" + ] + }, + "gplots": { + "Package": "gplots", + "Version": "3.1.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "e65e5d5dea4cbb9ba822dcd782b2ee1f", + "Requirements": [ + "KernSmooth", + "caTools", + "gtools" + ] + }, + "graphlayouts": { + "Package": "graphlayouts", + "Version": "0.8.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "83ebd459dbc288ee4f7ef5f7d52594a9", + "Requirements": [ + "Rcpp", + "RcppArmadillo", + "igraph" + ] + }, + "gridExtra": { + "Package": "gridExtra", + "Version": "2.3", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "7d7f283939f563670a697165b2cf5560", + "Requirements": [ + "gtable" + ] + }, + "gridGraphics": { + "Package": "gridGraphics", + "Version": "0.5-1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "5b79228594f02385d4df4979284879ae", + "Requirements": [] + }, + "gtable": { + "Package": "gtable", + "Version": "0.3.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "ac5c6baf7822ce8732b343f14c072c4d", + "Requirements": [] + }, + "gtools": { + "Package": "gtools", + "Version": "3.9.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "2ace6c4a06297d0b364e0444384a2b82", + "Requirements": [] + }, + "gwasrapidd": { + "Package": "gwasrapidd", + "Version": "0.99.12", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "56be6fbe33e1892fea54591d36881510", + "Requirements": [ + "assertthat", + "concatenate", + "dplyr", + "glue", + "httr", + "jsonlite", + "lubridate", + "magrittr", + "pingr", + "plyr", + "progress", + "purrr", + "rlang", + "stringr", + "testthat", + "tibble", + "tidyr", + "urltools" + ] + }, + "haven": { + "Package": "haven", + "Version": "2.4.3", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "10bec8a8264f3eb59531e8c4c0303f96", + "Requirements": [ + "cpp11", + "forcats", + "hms", + "readr", + "rlang", + "tibble", + "tidyselect", + "vctrs" + ] + }, + "hms": { + "Package": "hms", + "Version": "1.1.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "5b8a2dd0fdbe2ab4f6081e6c7be6dfca", + "Requirements": [ + "ellipsis", + "lifecycle", + "pkgconfig", + "rlang", + "vctrs" + ] + }, + "htmltools": { + "Package": "htmltools", + "Version": "0.5.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "526c484233f42522278ab06fb185cb26", + "Requirements": [ + "base64enc", + "digest", + "fastmap", + "rlang" + ] + }, + "htmlwidgets": { + "Package": "htmlwidgets", + "Version": "1.5.4", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "76147821cd3fcd8c4b04e1ef0498e7fb", + "Requirements": [ + "htmltools", + "jsonlite", + "yaml" + ] + }, + "httpuv": { + "Package": "httpuv", + "Version": "1.6.5", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "97fe71f0a4a1c9890e6c2128afa04bc0", + "Requirements": [ + "R6", + "Rcpp", + "later", + "promises" + ] + }, + "httr": { + "Package": "httr", + "Version": "1.4.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "a525aba14184fec243f9eaec62fbed43", + "Requirements": [ + "R6", + "curl", + "jsonlite", + "mime", + "openssl" + ] + }, + "hwriter": { + "Package": "hwriter", + "Version": "1.3.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "fd39c53c2fff477e78557114b5ff873b", + "Requirements": [] + }, + "ids": { + "Package": "ids", + "Version": "1.0.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "99df65cfef20e525ed38c3d2577f7190", + "Requirements": [ + "openssl", + "uuid" + ] + }, + "igraph": { + "Package": "igraph", + "Version": "1.2.11", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "1d10cd31c2979f9c819ffe4d16b9dc2b", + "Requirements": [ + "Matrix", + "magrittr", + "pkgconfig" + ] + }, + "inline": { + "Package": "inline", + "Version": "0.3.19", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "1deaf1de3eac7e1d3377954b3a283652", + "Requirements": [] + }, + "interactiveDisplayBase": { + "Package": "interactiveDisplayBase", + "Version": "1.32.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/interactiveDisplayBase", + "git_branch": "RELEASE_3_14", + "git_last_commit": "0f88b2a", + "git_last_commit_date": "2021-10-26", + "Hash": "011d5724a7ccdd3c3e8788701242666d", + "Requirements": [ + "BiocGenerics", + "DT", + "shiny" + ] + }, + "irlba": { + "Package": "irlba", + "Version": "2.3.5", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "066c11bb9bc75b343f3de1ecaf3b7ba2", + "Requirements": [ + "Matrix" + ] + }, + "isoband": { + "Package": "isoband", + "Version": "0.2.5", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "7ab57a6de7f48a8dc84910d1eca42883", + "Requirements": [] + }, + "iterators": { + "Package": "iterators", + "Version": "1.0.13", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "64778782a89480e9a644f69aad9a2877", + "Requirements": [] + }, + "jquerylib": { + "Package": "jquerylib", + "Version": "0.1.4", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "5aab57a3bd297eee1c1d862735972182", + "Requirements": [ + "htmltools" + ] + }, + "jsonlite": { + "Package": "jsonlite", + "Version": "1.7.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "98138e0994d41508c7a6b84a0600cfcb", + "Requirements": [] + }, + "labeling": { + "Package": "labeling", + "Version": "0.4.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "3d5108641f47470611a32d0bdf357a72", + "Requirements": [] + }, + "lambda.r": { + "Package": "lambda.r", + "Version": "1.2.4", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "b1e925c4b9ffeb901bacf812cbe9a6ad", + "Requirements": [ + "formatR" + ] + }, + "later": { + "Package": "later", + "Version": "1.3.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "7e7b457d7766bc47f2a5f21cc2984f8e", + "Requirements": [ + "Rcpp", + "rlang" + ] + }, + "lattice": { + "Package": "lattice", + "Version": "0.20-45", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "b64cdbb2b340437c4ee047a1f4c4377b", + "Requirements": [] + }, + "lazyeval": { + "Package": "lazyeval", + "Version": "0.2.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "d908914ae53b04d4c0c0fd72ecc35370", + "Requirements": [] + }, + "lifecycle": { + "Package": "lifecycle", + "Version": "1.0.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "a6b6d352e3ed897373ab19d8395c98d0", + "Requirements": [ + "glue", + "rlang" + ] + }, + "limma": { + "Package": "limma", + "Version": "3.50.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/limma", + "git_branch": "RELEASE_3_14", + "git_last_commit": "657b19b", + "git_last_commit_date": "2021-10-26", + "Hash": "25679c54c2737e06835c5484682990b5", + "Requirements": [] + }, + "listenv": { + "Package": "listenv", + "Version": "0.8.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "0bde42ee282efb18c7c4e63822f5b4f7", + "Requirements": [] + }, + "locfit": { + "Package": "locfit", + "Version": "1.5-9.4", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "760b5b542e8435237d1b3c253bfe18e7", + "Requirements": [ + "lattice" + ] + }, + "loo": { + "Package": "loo", + "Version": "2.4.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "cb08bd08c899e7d68661714d699c42e4", + "Requirements": [ + "checkmate", + "matrixStats" + ] + }, + "lubridate": { + "Package": "lubridate", + "Version": "1.8.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "2ff5eedb6ee38fb1b81205c73be1be5a", + "Requirements": [ + "cpp11", + "generics" + ] + }, + "magrittr": { + "Package": "magrittr", + "Version": "2.0.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "41287f1ac7d28a92f0a286ed507928d3", + "Requirements": [] + }, + "mapproj": { + "Package": "mapproj", + "Version": "1.2.7", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "74ed0ace54e00d9bc60614b220653b7e", + "Requirements": [ + "maps" + ] + }, + "maps": { + "Package": "maps", + "Version": "3.4.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "b3d98a967ec17c80f795719529812fa0", + "Requirements": [] + }, + "matrixStats": { + "Package": "matrixStats", + "Version": "0.61.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "b8e6221fc11247b12ab1b055a6f66c27", + "Requirements": [] + }, + "memoise": { + "Package": "memoise", + "Version": "2.0.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "e2817ccf4a065c5d9d7f2cfbe7c1d78c", + "Requirements": [ + "cachem", + "rlang" + ] + }, + "mgcv": { + "Package": "mgcv", + "Version": "1.8-38", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "be3c61ffbb1e3d3b3df214d192ac5444", + "Requirements": [ + "Matrix", + "nlme" + ] + }, + "mice": { + "Package": "mice", + "Version": "3.14.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "437fa44664cf8e2dd07b9a70ec65d969", + "Requirements": [ + "Rcpp", + "broom", + "cpp11", + "dplyr", + "generics", + "lattice", + "rlang", + "tidyr", + "withr" + ] + }, + "mime": { + "Package": "mime", + "Version": "0.12", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "18e9c28c1d3ca1560ce30658b22ce104", + "Requirements": [] + }, + "modelr": { + "Package": "modelr", + "Version": "0.1.8", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "9fd59716311ee82cba83dc2826fc5577", + "Requirements": [ + "broom", + "magrittr", + "purrr", + "rlang", + "tibble", + "tidyr", + "tidyselect", + "vctrs" + ] + }, + "munsell": { + "Package": "munsell", + "Version": "0.5.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "6dfe8bf774944bd5595785e3229d8771", + "Requirements": [ + "colorspace" + ] + }, + "mvtnorm": { + "Package": "mvtnorm", + "Version": "1.1-3", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "7a7541cc284cb2ba3ba7eae645892af5", + "Requirements": [] + }, + "nlme": { + "Package": "nlme", + "Version": "3.1-153", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "2d632e0d963a653a0329756ce701ecdd", + "Requirements": [ + "lattice" + ] + }, + "numDeriv": { + "Package": "numDeriv", + "Version": "2016.8-1.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "df58958f293b166e4ab885ebcad90e02", + "Requirements": [] + }, + "openssl": { + "Package": "openssl", + "Version": "1.4.6", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "69fdf291af288f32fd4cd93315084ea8", + "Requirements": [ + "askpass" + ] + }, + "org.Hs.eg.db": { + "Package": "org.Hs.eg.db", + "Version": "3.14.0", + "Source": "Bioconductor", + "Hash": "c2973e555d388f8aca8857c314bfbd2e", + "Requirements": [ + "AnnotationDbi" + ] + }, + "pals": { + "Package": "pals", + "Version": "1.7", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "3b059988394323a280ad6f82f9cef7a7", + "Requirements": [ + "colorspace", + "dichromat", + "mapproj", + "maps" + ] + }, + "parallelly": { + "Package": "parallelly", + "Version": "1.30.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "67db13907a9cea89c118cf82d448799f", + "Requirements": [] + }, + "patchwork": { + "Package": "patchwork", + "Version": "1.1.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "c446b30cb33ec125ff02588b60660ccb", + "Requirements": [ + "ggplot2", + "gtable" + ] + }, + "pcaPP": { + "Package": "pcaPP", + "Version": "1.9-74", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "837a1ed779730048dead15f31c00b359", + "Requirements": [ + "mvtnorm" + ] + }, + "pheatmap": { + "Package": "pheatmap", + "Version": "1.0.12", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "db1fb0021811b6693741325bbe916e58", + "Requirements": [ + "RColorBrewer", + "gtable", + "scales" + ] + }, + "pillar": { + "Package": "pillar", + "Version": "1.6.4", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "60200b6aa32314ac457d3efbb5ccbd98", + "Requirements": [ + "cli", + "crayon", + "ellipsis", + "fansi", + "lifecycle", + "rlang", + "utf8", + "vctrs" + ] + }, + "pingr": { + "Package": "pingr", + "Version": "2.0.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "e293e79be42ffd336d938937fd3017fb", + "Requirements": [ + "processx" + ] + }, + "pkgbuild": { + "Package": "pkgbuild", + "Version": "1.3.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "66d2adfed274daf81ccfe77d974c3b9b", + "Requirements": [ + "R6", + "callr", + "cli", + "crayon", + "desc", + "prettyunits", + "rprojroot", + "withr" + ] + }, + "pkgconfig": { + "Package": "pkgconfig", + "Version": "2.0.3", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "01f28d4278f15c76cddbea05899c5d6f", + "Requirements": [] + }, + "pkgload": { + "Package": "pkgload", + "Version": "1.2.4", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "7533cd805940821bf23eaf3c8d4c1735", + "Requirements": [ + "cli", + "crayon", + "desc", + "rlang", + "rprojroot", + "rstudioapi", + "withr" + ] + }, + "plogr": { + "Package": "plogr", + "Version": "0.2.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "09eb987710984fc2905c7129c7d85e65", + "Requirements": [] + }, + "plyr": { + "Package": "plyr", + "Version": "1.8.6", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "ec0e5ab4e5f851f6ef32cd1d1984957f", + "Requirements": [ + "Rcpp" + ] + }, + "png": { + "Package": "png", + "Version": "0.1-7", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "03b7076c234cb3331288919983326c55", + "Requirements": [] + }, + "polyclip": { + "Package": "polyclip", + "Version": "1.10-0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "cb167f328b3ada4ec5cf67a7df4c900a", + "Requirements": [] + }, + "posterior": { + "Package": "posterior", + "Version": "1.2.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "eee1bf053666bd7fe8410c6f8298ea74", + "Requirements": [ + "abind", + "checkmate", + "distributional", + "matrixStats", + "pillar", + "rlang", + "tensorA", + "tibble", + "vctrs" + ] + }, + "ppcseq": { + "Package": "ppcseq", + "Version": "1.2.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/ppcseq", + "git_branch": "RELEASE_3_14", + "git_last_commit": "91373e3", + "git_last_commit_date": "2021-10-26", + "Hash": "d86cad932685e0cec1d6b40774e0ae07", + "Requirements": [ + "BH", + "Rcpp", + "RcppEigen", + "StanHeaders", + "benchmarkme", + "dplyr", + "edgeR", + "foreach", + "furrr", + "future", + "ggplot2", + "lifecycle", + "magrittr", + "purrr", + "rlang", + "rstan", + "rstantools", + "tibble", + "tidybayes", + "tidyr" + ] + }, + "praise": { + "Package": "praise", + "Version": "1.0.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "a555924add98c99d2f411e37e7d25e9f", + "Requirements": [] + }, + "prettyunits": { + "Package": "prettyunits", + "Version": "1.1.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "95ef9167b75dde9d2ccc3c7528393e7e", + "Requirements": [] + }, + "processx": { + "Package": "processx", + "Version": "3.5.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "0cbca2bc4d16525d009c4dbba156b37c", + "Requirements": [ + "R6", + "ps" + ] + }, + "progress": { + "Package": "progress", + "Version": "1.2.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "14dc9f7a3c91ebb14ec5bb9208a07061", + "Requirements": [ + "R6", + "crayon", + "hms", + "prettyunits" + ] + }, + "promises": { + "Package": "promises", + "Version": "1.2.0.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "4ab2c43adb4d4699cf3690acd378d75d", + "Requirements": [ + "R6", + "Rcpp", + "later", + "magrittr", + "rlang" + ] + }, + "ps": { + "Package": "ps", + "Version": "1.6.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "32620e2001c1dce1af49c49dccbb9420", + "Requirements": [] + }, + "purrr": { + "Package": "purrr", + "Version": "0.3.4", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "97def703420c8ab10d8f0e6c72101e02", + "Requirements": [ + "magrittr", + "rlang" + ] + }, + "quadprog": { + "Package": "quadprog", + "Version": "1.5-8", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "5f919ae5e7f83a6f91dcf2288943370d", + "Requirements": [] + }, + "qvalue": { + "Package": "qvalue", + "Version": "2.26.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/qvalue", + "git_branch": "RELEASE_3_14", + "git_last_commit": "6d7410d", + "git_last_commit_date": "2021-10-26", + "Hash": "a701708b518dc3b7d68be91493275ef0", + "Requirements": [ + "ggplot2", + "reshape2" + ] + }, + "rappdirs": { + "Package": "rappdirs", + "Version": "0.3.3", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "5e3c5dc0b071b21fa128676560dbe94d", + "Requirements": [] + }, + "readr": { + "Package": "readr", + "Version": "2.1.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "e9df4b445fca203653f04ece2f97d51e", + "Requirements": [ + "R6", + "cli", + "clipr", + "cpp11", + "crayon", + "hms", + "lifecycle", + "rlang", + "tibble", + "tzdb", + "vroom" + ] + }, + "readxl": { + "Package": "readxl", + "Version": "1.3.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "63537c483c2dbec8d9e3183b3735254a", + "Requirements": [ + "Rcpp", + "cellranger", + "progress", + "tibble" + ] + }, + "rematch": { + "Package": "rematch", + "Version": "1.0.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "c66b930d20bb6d858cd18e1cebcfae5c", + "Requirements": [] + }, + "rematch2": { + "Package": "rematch2", + "Version": "2.1.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "76c9e04c712a05848ae7a23d2f170a40", + "Requirements": [ + "tibble" + ] + }, + "renv": { + "Package": "renv", + "Version": "0.15.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "36c1a644e5b0ba8050f40f07ea1dae62", + "Requirements": [] + }, + "reprex": { + "Package": "reprex", + "Version": "2.0.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "911d101becedc0fde495bd910984bdc8", + "Requirements": [ + "callr", + "cli", + "clipr", + "fs", + "glue", + "rlang", + "rmarkdown", + "rstudioapi", + "withr" + ] + }, + "reshape2": { + "Package": "reshape2", + "Version": "1.4.4", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "bb5996d0bd962d214a11140d77589917", + "Requirements": [ + "Rcpp", + "plyr", + "stringr" + ] + }, + "restfulr": { + "Package": "restfulr", + "Version": "0.0.13", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "48d7ce4ee04cef63ae75d87bbb94b1f7", + "Requirements": [ + "RCurl", + "S4Vectors", + "XML", + "rjson", + "yaml" + ] + }, + "rjson": { + "Package": "rjson", + "Version": "0.2.20", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "7d597f982ee6263716b6a2f28efd29fa", + "Requirements": [] + }, + "rlang": { + "Package": "rlang", + "Version": "0.4.12", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "0879f5388fe6e4d56d7ef0b7ccb031e5", + "Requirements": [] + }, + "rmarkdown": { + "Package": "rmarkdown", + "Version": "2.11", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "320017b52d05a943981272b295750388", + "Requirements": [ + "evaluate", + "htmltools", + "jquerylib", + "jsonlite", + "stringr", + "tinytex", + "xfun", + "yaml" + ] + }, + "robustbase": { + "Package": "robustbase", + "Version": "0.93-9", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "e7b310bebca9aca51848b0a366a427cf", + "Requirements": [ + "DEoptimR" + ] + }, + "rprojroot": { + "Package": "rprojroot", + "Version": "2.0.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "249d8cd1e74a8f6a26194a91b47f21d1", + "Requirements": [] + }, + "rrcov": { + "Package": "rrcov", + "Version": "1.6-0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "2c84a58e990d66cf1e6cbf7c2b6e7ea0", + "Requirements": [ + "lattice", + "mvtnorm", + "pcaPP", + "robustbase" + ] + }, + "rstan": { + "Package": "rstan", + "Version": "2.21.3", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "8fa400c2cf6409067a4515581ae4d99b", + "Requirements": [ + "BH", + "Rcpp", + "RcppEigen", + "RcppParallel", + "StanHeaders", + "ggplot2", + "gridExtra", + "inline", + "loo", + "pkgbuild" + ] + }, + "rstantools": { + "Package": "rstantools", + "Version": "2.1.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "c91e0f20c967e246cb6f2efe8c60e15b", + "Requirements": [ + "Rcpp", + "RcppParallel", + "desc" + ] + }, + "rstudioapi": { + "Package": "rstudioapi", + "Version": "0.13", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "06c85365a03fdaf699966cc1d3cf53ea", + "Requirements": [] + }, + "rsvd": { + "Package": "rsvd", + "Version": "1.0.5", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "b462187d887abc519894874486dbd6fd", + "Requirements": [ + "Matrix" + ] + }, + "rtracklayer": { + "Package": "rtracklayer", + "Version": "1.54.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/rtracklayer", + "git_branch": "RELEASE_3_14", + "git_last_commit": "04cdd75", + "git_last_commit_date": "2021-10-26", + "Hash": "fcd0a6d7691bb3aefb4608e6e0996095", + "Requirements": [ + "BiocGenerics", + "BiocIO", + "Biostrings", + "GenomeInfoDb", + "GenomicAlignments", + "GenomicRanges", + "IRanges", + "RCurl", + "Rsamtools", + "S4Vectors", + "XML", + "XVector", + "restfulr", + "zlibbioc" + ] + }, + "rvest": { + "Package": "rvest", + "Version": "1.0.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "bb099886deffecd6f9b298b7d4492943", + "Requirements": [ + "httr", + "lifecycle", + "magrittr", + "rlang", + "selectr", + "tibble", + "xml2" + ] + }, + "sass": { + "Package": "sass", + "Version": "0.4.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "50cf822feb64bb3977bda0b7091be623", + "Requirements": [ + "R6", + "fs", + "htmltools", + "rappdirs", + "rlang" + ] + }, + "scales": { + "Package": "scales", + "Version": "1.1.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "6f76f71042411426ec8df6c54f34e6dd", + "Requirements": [ + "R6", + "RColorBrewer", + "farver", + "labeling", + "lifecycle", + "munsell", + "viridisLite" + ] + }, + "scatterpie": { + "Package": "scatterpie", + "Version": "0.1.7", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "f4d12f5fdf169e10739fe554e7705159", + "Requirements": [ + "ggforce", + "ggfun", + "ggplot2", + "rlang", + "tidyr" + ] + }, + "selectr": { + "Package": "selectr", + "Version": "0.4-2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "3838071b66e0c566d55cc26bd6e27bf4", + "Requirements": [ + "R6", + "stringr" + ] + }, + "shadowtext": { + "Package": "shadowtext", + "Version": "0.1.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "8c4c6bf138a9c487cf4404255c8e57ae", + "Requirements": [ + "ggplot2", + "scales" + ] + }, + "shiny": { + "Package": "shiny", + "Version": "1.7.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "00344c227c7bd0ab5d78052c5d736c44", + "Requirements": [ + "R6", + "bslib", + "cachem", + "commonmark", + "crayon", + "ellipsis", + "fastmap", + "fontawesome", + "glue", + "htmltools", + "httpuv", + "jsonlite", + "later", + "lifecycle", + "mime", + "promises", + "rlang", + "sourcetools", + "withr", + "xtable" + ] + }, + "sitmo": { + "Package": "sitmo", + "Version": "2.0.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "c956d93f6768a9789edbc13072b70c78", + "Requirements": [ + "Rcpp" + ] + }, + "snow": { + "Package": "snow", + "Version": "0.4-4", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "40b74690debd20c57d93d8c246b305d4", + "Requirements": [] + }, + "sourcetools": { + "Package": "sourcetools", + "Version": "0.1.7", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "947e4e02a79effa5d512473e10f41797", + "Requirements": [] + }, + "sparseMatrixStats": { + "Package": "sparseMatrixStats", + "Version": "1.6.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/sparseMatrixStats", + "git_branch": "RELEASE_3_14", + "git_last_commit": "78627a8", + "git_last_commit_date": "2021-10-26", + "Hash": "f8dd82d2581115df0ea380c91ed8b9f6", + "Requirements": [ + "Matrix", + "MatrixGenerics", + "Rcpp", + "matrixStats" + ] + }, + "stageR": { + "Package": "stageR", + "Version": "1.16.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/stageR", + "git_branch": "RELEASE_3_14", + "git_last_commit": "816d3b2", + "git_last_commit_date": "2021-10-26", + "Hash": "2a1212c6f4a034212ed36b7cc72c3e36", + "Requirements": [ + "SummarizedExperiment" + ] + }, + "statmod": { + "Package": "statmod", + "Version": "1.4.36", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "67924522fc37b515396de7d9e2408cc2", + "Requirements": [] + }, + "stringi": { + "Package": "stringi", + "Version": "1.7.6", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "bba431031d30789535745a9627ac9271", + "Requirements": [] + }, + "stringr": { + "Package": "stringr", + "Version": "1.4.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "0759e6b6c0957edb1311028a49a35e76", + "Requirements": [ + "glue", + "magrittr", + "stringi" + ] + }, + "survival": { + "Package": "survival", + "Version": "3.2-13", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "6f0a0fadc63bc6570fe172770f15bbc4", + "Requirements": [ + "Matrix" + ] + }, + "svUnit": { + "Package": "svUnit", + "Version": "1.0.6", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "894d0aff9585344af4ab78e2b4d60ab7", + "Requirements": [] + }, + "sys": { + "Package": "sys", + "Version": "3.4", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "b227d13e29222b4574486cfcbde077fa", + "Requirements": [] + }, + "tensorA": { + "Package": "tensorA", + "Version": "0.36.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "fd792ceac77f96b647fa8d6e1788969a", + "Requirements": [] + }, + "testthat": { + "Package": "testthat", + "Version": "3.1.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "2a5c5646456762131ce40272964599d3", + "Requirements": [ + "R6", + "brio", + "callr", + "cli", + "crayon", + "desc", + "digest", + "ellipsis", + "evaluate", + "jsonlite", + "lifecycle", + "magrittr", + "pkgload", + "praise", + "processx", + "ps", + "rlang", + "waldo", + "withr" + ] + }, + "tibble": { + "Package": "tibble", + "Version": "3.1.6", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "8a8f02d1934dfd6431c671361510dd0b", + "Requirements": [ + "ellipsis", + "fansi", + "lifecycle", + "magrittr", + "pillar", + "pkgconfig", + "rlang", + "vctrs" + ] + }, + "tidybayes": { + "Package": "tidybayes", + "Version": "3.0.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "d501501261b724f35ec9f2b80f4421b5", + "Requirements": [ + "arrayhelpers", + "coda", + "dplyr", + "ggdist", + "ggplot2", + "magrittr", + "posterior", + "rlang", + "tibble", + "tidyr", + "tidyselect", + "vctrs", + "withr" + ] + }, + "tidygraph": { + "Package": "tidygraph", + "Version": "1.2.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "5375980d0787633ca62c265b28bedb41", + "Requirements": [ + "R6", + "Rcpp", + "dplyr", + "igraph", + "magrittr", + "pillar", + "rlang", + "tibble", + "tidyr" + ] + }, + "tidyr": { + "Package": "tidyr", + "Version": "1.1.4", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "c8fbdbd9fcac223d6c6fe8e406f368e1", + "Requirements": [ + "cpp11", + "dplyr", + "ellipsis", + "glue", + "lifecycle", + "magrittr", + "purrr", + "rlang", + "tibble", + "tidyselect", + "vctrs" + ] + }, + "tidyselect": { + "Package": "tidyselect", + "Version": "1.1.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "7243004a708d06d4716717fa1ff5b2fe", + "Requirements": [ + "ellipsis", + "glue", + "purrr", + "rlang", + "vctrs" + ] + }, + "tidytree": { + "Package": "tidytree", + "Version": "0.3.6", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "eee60ec6cf6fbab1189409a345e5405d", + "Requirements": [ + "ape", + "dplyr", + "lazyeval", + "magrittr", + "rlang", + "tibble", + "tidyr", + "tidyselect", + "yulab.utils" + ] + }, + "tidyverse": { + "Package": "tidyverse", + "Version": "1.3.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "fc4c72b6ae9bb283416bd59a3303bbab", + "Requirements": [ + "broom", + "cli", + "crayon", + "dbplyr", + "dplyr", + "dtplyr", + "forcats", + "ggplot2", + "googledrive", + "googlesheets4", + "haven", + "hms", + "httr", + "jsonlite", + "lubridate", + "magrittr", + "modelr", + "pillar", + "purrr", + "readr", + "readxl", + "reprex", + "rlang", + "rstudioapi", + "rvest", + "stringr", + "tibble", + "tidyr", + "xml2" + ] + }, + "tinytex": { + "Package": "tinytex", + "Version": "0.36", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "130fe4c61e55b271a2655b3a284a205f", + "Requirements": [ + "xfun" + ] + }, + "treeio": { + "Package": "treeio", + "Version": "1.18.1", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/treeio", + "git_branch": "RELEASE_3_14", + "git_last_commit": "a06b6b3", + "git_last_commit_date": "2021-11-12", + "Hash": "835f0ab27ea0cfcad448397568fdf4d1", + "Requirements": [ + "ape", + "dplyr", + "jsonlite", + "magrittr", + "rlang", + "tibble", + "tidytree" + ] + }, + "triebeard": { + "Package": "triebeard", + "Version": "0.3.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "847a9d113b78baca4a9a8639609ea228", + "Requirements": [ + "Rcpp" + ] + }, + "tweenr": { + "Package": "tweenr", + "Version": "1.0.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "6cc663f970a529dbf776f11d5bcd1a2e", + "Requirements": [ + "Rcpp", + "farver", + "magrittr", + "rlang" + ] + }, + "tximeta": { + "Package": "tximeta", + "Version": "1.12.4", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/tximeta", + "git_branch": "RELEASE_3_14", + "git_last_commit": "78d1a79", + "git_last_commit_date": "2021-12-20", + "Hash": "c6906407740d1408fa8b4c15c1e810de", + "Requirements": [ + "AnnotationDbi", + "AnnotationHub", + "BiocFileCache", + "Biostrings", + "GenomeInfoDb", + "GenomicFeatures", + "GenomicRanges", + "IRanges", + "Matrix", + "S4Vectors", + "SummarizedExperiment", + "ensembldb", + "jsonlite", + "tibble", + "tximport" + ] + }, + "tximport": { + "Package": "tximport", + "Version": "1.22.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/tximport", + "git_branch": "RELEASE_3_14", + "git_last_commit": "335213b", + "git_last_commit_date": "2021-10-26", + "Hash": "59f0784f1489e8e18d13cab597d7d813", + "Requirements": [] + }, + "tzdb": { + "Package": "tzdb", + "Version": "0.2.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "5e069fb033daf2317bd628d3100b75c5", + "Requirements": [ + "cpp11" + ] + }, + "urltools": { + "Package": "urltools", + "Version": "1.7.3", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "e86a704261a105f4703f653e05defa3e", + "Requirements": [ + "Rcpp", + "triebeard" + ] + }, + "utf8": { + "Package": "utf8", + "Version": "1.2.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "c9c462b759a5cc844ae25b5942654d13", + "Requirements": [] + }, + "uuid": { + "Package": "uuid", + "Version": "1.0-3", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "2097822ba5e4440b81a0c7525d0315ce", + "Requirements": [] + }, + "vctrs": { + "Package": "vctrs", + "Version": "0.3.8", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "ecf749a1b39ea72bd9b51b76292261f1", + "Requirements": [ + "ellipsis", + "glue", + "rlang" + ] + }, + "viridis": { + "Package": "viridis", + "Version": "0.6.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "ee96aee95a7a563e5496f8991e9fde4b", + "Requirements": [ + "ggplot2", + "gridExtra", + "viridisLite" + ] + }, + "viridisLite": { + "Package": "viridisLite", + "Version": "0.4.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "55e157e2aa88161bdb0754218470d204", + "Requirements": [] + }, + "vroom": { + "Package": "vroom", + "Version": "1.5.7", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "976507b5a105bc3bdf6a5a5f29e0684f", + "Requirements": [ + "bit64", + "cli", + "cpp11", + "crayon", + "glue", + "hms", + "lifecycle", + "progress", + "rlang", + "tibble", + "tidyselect", + "tzdb", + "vctrs", + "withr" + ] + }, + "waldo": { + "Package": "waldo", + "Version": "0.3.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "ad8cfff5694ac5b3c354f8f2044bd976", + "Requirements": [ + "cli", + "diffobj", + "fansi", + "glue", + "rematch2", + "rlang", + "tibble" + ] + }, + "withr": { + "Package": "withr", + "Version": "2.4.3", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "a376b424c4817cda4920bbbeb3364e85", + "Requirements": [] + }, + "xfun": { + "Package": "xfun", + "Version": "0.29", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "e2e5fb1a74fbb68b27d6efc5372635dc", + "Requirements": [] + }, + "xml2": { + "Package": "xml2", + "Version": "1.3.3", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "40682ed6a969ea5abfd351eb67833adc", + "Requirements": [] + }, + "xtable": { + "Package": "xtable", + "Version": "1.8-4", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "b8acdf8af494d9ec19ccb2481a9b11c2", + "Requirements": [] + }, + "yaml": { + "Package": "yaml", + "Version": "2.2.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "2826c5d9efb0a88f657c7a679c7106db", + "Requirements": [] + }, + "yulab.utils": { + "Package": "yulab.utils", + "Version": "0.0.4", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "922e11dcf40bb5dfcf3fe5e714d0dc35", + "Requirements": [] + }, + "zlibbioc": { + "Package": "zlibbioc", + "Version": "1.40.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/zlibbioc", + "git_branch": "RELEASE_3_14", + "git_last_commit": "3f116b3", + "git_last_commit_date": "2021-10-26", + "Hash": "3598bf6c766b0d2c15d1eefefa26d9ef", + "Requirements": [] + } + } +} diff --git a/scripts/ISA/isoformPass1_Cg25.R b/scripts/ISA/isoformPass1_Cg25.R new file mode 100644 index 0000000..ad927fe --- /dev/null +++ b/scripts/ISA/isoformPass1_Cg25.R @@ -0,0 +1,72 @@ +# WARNING: This script follows "Example Workflow" described in the IsoformSwitchAnalyzeR vignette, if you wish +# to do a more in-depth analysis or, rather, don't want to use default values, please read the package's vignette + +#Loading library +library(IsoformSwitchAnalyzeR) +library(data.table) +library(dplyr) + +#Importing kallisto .tsv data +kallQuant <- importIsoformExpression( + parentDir = "data/kallisto/Cg25/" +) + +#Loading annotation data and making conditions +ann <- fread('data/kallisto/annotation.txt') +ann <- ann[, c("Run", "phenotype", "gender", "age", "tissue", "rin", "pmi", "ph","Cause_of_death" ,"Organism")] +ann <- ann[ann$Organism == "Homo sapiens"] + +ann <- ann %>% + mutate(region = case_when( + tissue == "Orbitofrontal (OFC; BA11)" ~ "OFC", + tissue == "Dorsolateral prefrontal cortex (dlPFC; BA8/9)" ~ "dlPFC", + tissue == "Cingulate gyrus 25 (Cg25)" ~ "Cg25", + tissue == "Anterior Insula (aINS)" ~ "aINS", + tissue == "Nucleus Accumbens (Nac)" ~ "Nac", + tissue == "Subiculum (Sub)" ~ "Sub" + )) + +ann$condition <- paste(ann$region, ann$phenotype, ann$gender, sep = "_") +ann <- ann[ann$region=="Cg25",] +ann <- ann[ann$Run != 'SRR5961797',] + +#Case-control dataframe +myDesign <- data.frame( + sampleID = colnames(kallQuant$abundance)[-1], + condition = ann$group, + rin = ann$rin +) +rm(ann) + +#Importing count, normalized count, design dataframe, gtf and cdna file +#It is important to choose the correct gtf file, as instructed by the isAnalyzeR vignette, +aSwitchList <- importRdata( + isoformCountMatrix = kallQuant$counts, + isoformRepExpression = kallQuant$abundance, + designMatrix = myDesign, + isoformExonAnnoation = "data/kallisto/Homo_sapiens.GRCh38.97.chr_patch_hapl_scaff.gtf.gz", + isoformNtFasta = "data/kallisto/Homo_sapiens.GRCh38.cdna.all.fa.gz", + showProgress = TRUE +) + +#Filtering isoform data +aSwitchList <- preFilter( + switchAnalyzeRlist = aSwitchList, + geneExpressionCutoff = 1, + isoformExpressionCutoff = 0, + removeSingleIsoformGenes = TRUE +) + +#Running first step +SwitchList_1 <- isoformSwitchAnalysisPart1( + switchAnalyzeRlist = aSwitchList, + dIFcutoff = 0.1, # Cutoff for finding switches - set high for short runtime and less stringency + pathToOutput = 'results/ISA/objects/Cg25/', + outputSequences = TRUE, + prepareForWebServers = FALSE # change to TRUE if you will use webservers for external sequence analysis +) + +#Now you should run the external sequence analysis tools with the output fasta files from isoformSwitchAnalysisPart1 +#Running second step + +save(SwitchList_1, file = "results/ISA/objects/pass1/Cg25_pass1_0.1.rds") diff --git a/scripts/ISA/isoformPass1_Nac.R b/scripts/ISA/isoformPass1_Nac.R new file mode 100644 index 0000000..4874861 --- /dev/null +++ b/scripts/ISA/isoformPass1_Nac.R @@ -0,0 +1,72 @@ +# WARNING: This script follows "Example Workflow" described in the IsoformSwitchAnalyzeR vignette, if you wish +# to do a more in-depth analysis or, rather, don't want to use default values, please read the package's vignette + +#Loading library +library(IsoformSwitchAnalyzeR) +library(data.table) +library(dplyr) + +#Importing kallisto .tsv data +kallQuant <- importIsoformExpression( + parentDir = "data/kallisto/Nac/" +) + +#Loading annotation data and making conditions +ann <- fread('data/kallisto/annotation.txt') +ann <- ann[, c("Run", "phenotype", "gender", "age", "tissue", "rin", "pmi", "ph","Cause_of_death" ,"Organism")] +ann <- ann[ann$Organism == "Homo sapiens"] + +ann <- ann %>% + mutate(region = case_when( + tissue == "Orbitofrontal (OFC; BA11)" ~ "OFC", + tissue == "Dorsolateral prefrontal cortex (dlPFC; BA8/9)" ~ "dlPFC", + tissue == "Cingulate gyrus 25 (Cg25)" ~ "Cg25", + tissue == "Anterior Insula (aINS)" ~ "aINS", + tissue == "Nucleus Accumbens (Nac)" ~ "Nac", + tissue == "Subiculum (Sub)" ~ "Sub" + )) + +ann$condition <- paste(ann$region, ann$phenotype, ann$gender, sep = "_") +ann <- ann[ann$region=="Nac",] +ann <- ann[ann$Run != 'SRR5961797',] + +#Case-control dataframe +myDesign <- data.frame( + sampleID = colnames(kallQuant$abundance)[-1], + condition = ann$group, + rin = ann$rin +) +rm(ann) + +#Importing count, normalized count, design dataframe, gtf and cdna file +#It is important to choose the correct gtf file, as instructed by the isAnalyzeR vignette, +aSwitchList <- importRdata( + isoformCountMatrix = kallQuant$counts, + isoformRepExpression = kallQuant$abundance, + designMatrix = myDesign, + isoformExonAnnoation = "data/kallisto/Homo_sapiens.GRCh38.97.chr_patch_hapl_scaff.gtf.gz", + isoformNtFasta = "data/kallisto/Homo_sapiens.GRCh38.cdna.all.fa.gz", + showProgress = TRUE +) + +#Filtering isoform data +aSwitchList <- preFilter( + switchAnalyzeRlist = aSwitchList, + geneExpressionCutoff = 1, + isoformExpressionCutoff = 0, + removeSingleIsoformGenes = TRUE +) + +#Running first step +SwitchList_1 <- isoformSwitchAnalysisPart1( + switchAnalyzeRlist = aSwitchList, + dIFcutoff = 0.1, # Cutoff for finding switches - set high for short runtime and less stringency + pathToOutput = 'results/ISA/objects/Nac/', + outputSequences = TRUE, + prepareForWebServers = FALSE # change to TRUE if you will use webservers for external sequence analysis +) + +#Now you should run the external sequence analysis tools with the output fasta files from isoformSwitchAnalysisPart1 +#Running second step + +save(SwitchList_1, file = "results/ISA/objects/pass1/Nac_pass1_0.1.rds") diff --git a/scripts/ISA/isoformPass1_OFC.R b/scripts/ISA/isoformPass1_OFC.R new file mode 100644 index 0000000..5bd399b --- /dev/null +++ b/scripts/ISA/isoformPass1_OFC.R @@ -0,0 +1,72 @@ +# WARNING: This script follows "Example Workflow" described in the IsoformSwitchAnalyzeR vignette, if you wish +# to do a more in-depth analysis or, rather, don't want to use default values, please read the package's vignette + +#Loading library +library(IsoformSwitchAnalyzeR) +library(data.table) +library(dplyr) + +#Importing kallisto .tsv data +kallQuant <- importIsoformExpression( + parentDir = "data/kallisto/OFC/" +) + +#Loading annotation data and making conditions +ann <- fread('data/kallisto/annotation.txt') +ann <- ann[, c("Run", "phenotype", "gender", "age", "tissue", "rin", "pmi", "ph","Cause_of_death" ,"Organism")] +ann <- ann[ann$Organism == "Homo sapiens"] + +ann <- ann %>% + mutate(region = case_when( + tissue == "Orbitofrontal (OFC; BA11)" ~ "OFC", + tissue == "Dorsolateral prefrontal cortex (dlPFC; BA8/9)" ~ "dlPFC", + tissue == "Cingulate gyrus 25 (Cg25)" ~ "Cg25", + tissue == "Anterior Insula (aINS)" ~ "aINS", + tissue == "Nucleus Accumbens (Nac)" ~ "Nac", + tissue == "Subiculum (Sub)" ~ "Sub" + )) + +ann$condition <- paste(ann$region, ann$phenotype, ann$gender, sep = "_") +ann <- ann[ann$region=="OFC",] +ann <- ann[ann$Run != 'SRR5961797',] + +#Case-control dataframe +myDesign <- data.frame( + sampleID = colnames(kallQuant$abundance)[-1], + condition = ann$group, + rin = ann$rin +) +rm(ann) + +#Importing count, normalized count, design dataframe, gtf and cdna file +#It is important to choose the correct gtf file, as instructed by the isAnalyzeR vignette, +aSwitchList <- importRdata( + isoformCountMatrix = kallQuant$counts, + isoformRepExpression = kallQuant$abundance, + designMatrix = myDesign, + isoformExonAnnoation = "data/kallisto/Homo_sapiens.GRCh38.97.chr_patch_hapl_scaff.gtf.gz", + isoformNtFasta = "data/kallisto/Homo_sapiens.GRCh38.cdna.all.fa.gz", + showProgress = TRUE +) + +#Filtering isoform data +aSwitchList <- preFilter( + switchAnalyzeRlist = aSwitchList, + geneExpressionCutoff = 1, + isoformExpressionCutoff = 0, + removeSingleIsoformGenes = TRUE +) + +#Running first step +SwitchList_1 <- isoformSwitchAnalysisPart1( + switchAnalyzeRlist = aSwitchList, + dIFcutoff = 0.1, # Cutoff for finding switches - set high for short runtime and less stringency + pathToOutput = 'results/ISA/objects/OFC/', + outputSequences = TRUE, + prepareForWebServers = FALSE # change to TRUE if you will use webservers for external sequence analysis +) + +#Now you should run the external sequence analysis tools with the output fasta files from isoformSwitchAnalysisPart1 +#Running second step + +save(SwitchList_1, file = "results/ISA/objects/pass1/OFC_pass1_0.1.rds") diff --git a/scripts/ISA/isoformPass1_Sub.R b/scripts/ISA/isoformPass1_Sub.R new file mode 100644 index 0000000..0fa0806 --- /dev/null +++ b/scripts/ISA/isoformPass1_Sub.R @@ -0,0 +1,72 @@ +# WARNING: This script follows "Example Workflow" described in the IsoformSwitchAnalyzeR vignette, if you wish +# to do a more in-depth analysis or, rather, don't want to use default values, please read the package's vignette + +#Loading library +library(IsoformSwitchAnalyzeR) +library(data.table) +library(dplyr) + +#Importing kallisto .tsv data +kallQuant <- importIsoformExpression( + parentDir = "data/kallisto/Sub/" +) + +#Loading annotation data and making conditions +ann <- fread('data/kallisto/annotation.txt') +ann <- ann[, c("Run", "phenotype", "gender", "age", "tissue", "rin", "pmi", "ph","Cause_of_death" ,"Organism")] +ann <- ann[ann$Organism == "Homo sapiens"] + +ann <- ann %>% + mutate(region = case_when( + tissue == "Orbitofrontal (OFC; BA11)" ~ "OFC", + tissue == "Dorsolateral prefrontal cortex (dlPFC; BA8/9)" ~ "dlPFC", + tissue == "Cingulate gyrus 25 (Cg25)" ~ "Cg25", + tissue == "Anterior Insula (aINS)" ~ "aINS", + tissue == "Nucleus Accumbens (Nac)" ~ "Nac", + tissue == "Subiculum (Sub)" ~ "Sub" + )) + +ann$condition <- paste(ann$region, ann$phenotype, ann$gender, sep = "_") +ann <- ann[ann$region=="Sub",] +ann <- ann[ann$Run != 'SRR5961797',] + +#Case-control dataframe +myDesign <- data.frame( + sampleID = colnames(kallQuant$abundance)[-1], + condition = ann$group, + rin = ann$rin +) +rm(ann) + +#Importing count, normalized count, design dataframe, gtf and cdna file +#It is important to choose the correct gtf file, as instructed by the isAnalyzeR vignette, +aSwitchList <- importRdata( + isoformCountMatrix = kallQuant$counts, + isoformRepExpression = kallQuant$abundance, + designMatrix = myDesign, + isoformExonAnnoation = "data/kallisto/Homo_sapiens.GRCh38.97.chr_patch_hapl_scaff.gtf.gz", + isoformNtFasta = "data/kallisto/Homo_sapiens.GRCh38.cdna.all.fa.gz", + showProgress = TRUE +) + +#Filtering isoform data +aSwitchList <- preFilter( + switchAnalyzeRlist = aSwitchList, + geneExpressionCutoff = 1, + isoformExpressionCutoff = 0, + removeSingleIsoformGenes = TRUE +) + +#Running first step +SwitchList_1 <- isoformSwitchAnalysisPart1( + switchAnalyzeRlist = aSwitchList, + dIFcutoff = 0.1, # Cutoff for finding switches - set high for short runtime and less stringency + pathToOutput = 'results/ISA/objects/Sub/', + outputSequences = TRUE, + prepareForWebServers = FALSE # change to TRUE if you will use webservers for external sequence analysis +) + +#Now you should run the external sequence analysis tools with the output fasta files from isoformSwitchAnalysisPart1 +#Running second step + +save(SwitchList_1, file = "results/ISA/objects/pass1/Sub_pass1_0.1.rds") diff --git a/scripts/ISA/isoformPass1_aINS.R b/scripts/ISA/isoformPass1_aINS.R new file mode 100644 index 0000000..99b7cc3 --- /dev/null +++ b/scripts/ISA/isoformPass1_aINS.R @@ -0,0 +1,72 @@ +# WARNING: This script follows "Example Workflow" described in the IsoformSwitchAnalyzeR vignette, if you wish +# to do a more in-depth analysis or, rather, don't want to use default values, please read the package's vignette + +#Loading library +library(IsoformSwitchAnalyzeR) +library(data.table) +library(dplyr) + +#Importing kallisto .tsv data +kallQuant <- importIsoformExpression( + parentDir = "data/kallisto/aINS/" +) + +#Loading annotation data and making conditions +ann <- fread('data/kallisto/annotation.txt') +ann <- ann[, c("Run", "phenotype", "gender", "age", "tissue", "rin", "pmi", "ph","Cause_of_death" ,"Organism")] +ann <- ann[ann$Organism == "Homo sapiens"] + +ann <- ann %>% + mutate(region = case_when( + tissue == "Orbitofrontal (OFC; BA11)" ~ "OFC", + tissue == "Dorsolateral prefrontal cortex (dlPFC; BA8/9)" ~ "dlPFC", + tissue == "Cingulate gyrus 25 (Cg25)" ~ "Cg25", + tissue == "Anterior Insula (aINS)" ~ "aINS", + tissue == "Nucleus Accumbens (Nac)" ~ "Nac", + tissue == "Subiculum (Sub)" ~ "Sub" + )) + +ann$condition <- paste(ann$region, ann$phenotype, ann$gender, sep = "_") +ann <- ann[ann$region=="aINS",] +ann <- ann[ann$Run != 'SRR5961797',] + +#Case-control dataframe +myDesign <- data.frame( + sampleID = colnames(kallQuant$abundance)[-1], + condition = ann$group, + rin = ann$rin +) +rm(ann) + +#Importing count, normalized count, design dataframe, gtf and cdna file +#It is important to choose the correct gtf file, as instructed by the isAnalyzeR vignette, +aSwitchList <- importRdata( + isoformCountMatrix = kallQuant$counts, + isoformRepExpression = kallQuant$abundance, + designMatrix = myDesign, + isoformExonAnnoation = "data/kallisto/Homo_sapiens.GRCh38.97.chr_patch_hapl_scaff.gtf.gz", + isoformNtFasta = "data/kallisto/Homo_sapiens.GRCh38.cdna.all.fa.gz", + showProgress = TRUE +) + +#Filtering isoform data +aSwitchList <- preFilter( + switchAnalyzeRlist = aSwitchList, + geneExpressionCutoff = 1, + isoformExpressionCutoff = 0, + removeSingleIsoformGenes = TRUE +) + +#Running first step +SwitchList_1 <- isoformSwitchAnalysisPart1( + switchAnalyzeRlist = aSwitchList, + dIFcutoff = 0.1, # Cutoff for finding switches - set high for short runtime and less stringency + pathToOutput = 'results/ISA/objects/aINS/', + outputSequences = TRUE, + prepareForWebServers = FALSE # change to TRUE if you will use webservers for external sequence analysis +) + +#Now you should run the external sequence analysis tools with the output fasta files from isoformSwitchAnalysisPart1 +#Running second step + +save(SwitchList_1, file = "results/ISA/objects/pass1/aINS_pass1_0.1.rds") diff --git a/scripts/ISA/isoformPass1_dlpfc.R b/scripts/ISA/isoformPass1_dlpfc.R new file mode 100644 index 0000000..0ed9008 --- /dev/null +++ b/scripts/ISA/isoformPass1_dlpfc.R @@ -0,0 +1,72 @@ +# WARNING: This script follows "Example Workflow" described in the IsoformSwitchAnalyzeR vignette, if you wish +# to do a more in-depth analysis or, rather, don't want to use default values, please read the package's vignette + +#Loading library +library(IsoformSwitchAnalyzeR) +library(data.table) +library(dplyr) + +#Importing kallisto .tsv data +kallQuant <- importIsoformExpression( + parentDir = "data/kallisto/dlPFC/" +) + +#Loading annotation data and making conditions +ann <- fread('data/kallisto/annotation.txt') +ann <- ann[, c("Run", "phenotype", "gender", "age", "tissue", "rin", "pmi", "ph","Cause_of_death" ,"Organism")] +ann <- ann[ann$Organism == "Homo sapiens"] + +ann <- ann %>% + mutate(region = case_when( + tissue == "Orbitofrontal (OFC; BA11)" ~ "OFC", + tissue == "Dorsolateral prefrontal cortex (dlPFC; BA8/9)" ~ "dlPFC", + tissue == "Cingulate gyrus 25 (Cg25)" ~ "Cg25", + tissue == "Anterior Insula (aINS)" ~ "aINS", + tissue == "Nucleus Accumbens (Nac)" ~ "Nac", + tissue == "Subiculum (Sub)" ~ "Sub" + )) + +ann$condition <- paste(ann$region, ann$phenotype, ann$gender, sep = "_") +ann <- ann[ann$region=="dlPFC",] +ann <- ann[ann$Run != 'SRR5961797',] + +#Case-control dataframe +myDesign <- data.frame( + sampleID = colnames(kallQuant$abundance)[-1], + condition = ann$group, + rin = ann$rin +) +rm(ann) + +#Importing count, normalized count, design dataframe, gtf and cdna file +#It is important to choose the correct gtf file, as instructed by the isAnalyzeR vignette, +aSwitchList <- importRdata( + isoformCountMatrix = kallQuant$counts, + isoformRepExpression = kallQuant$abundance, + designMatrix = myDesign, + isoformExonAnnoation = "data/kallisto/Homo_sapiens.GRCh38.97.chr_patch_hapl_scaff.gtf.gz", + isoformNtFasta = "data/kallisto/Homo_sapiens.GRCh38.cdna.all.fa.gz", + showProgress = TRUE +) + +#Filtering isoform data +aSwitchList <- preFilter( + switchAnalyzeRlist = aSwitchList, + geneExpressionCutoff = 1, + isoformExpressionCutoff = 0, + removeSingleIsoformGenes = TRUE +) + +#Running first step +SwitchList_1 <- isoformSwitchAnalysisPart1( + switchAnalyzeRlist = aSwitchList, + dIFcutoff = 0.1, # Cutoff for finding switches - set high for short runtime and less stringency + pathToOutput = 'results/ISA/objects/dlPFC/', + outputSequences = TRUE, + prepareForWebServers = FALSE # change to TRUE if you will use webservers for external sequence analysis +) + +#Now you should run the external sequence analysis tools with the output fasta files from isoformSwitchAnalysisPart1 +#Running second step + +save(SwitchList_1, file = "results/ISA/objects/pass1/dlPFC_pass1_0.1.rds") diff --git a/scripts/ISA/isoformPass2_Cg25.R b/scripts/ISA/isoformPass2_Cg25.R new file mode 100644 index 0000000..964c2f2 --- /dev/null +++ b/scripts/ISA/isoformPass2_Cg25.R @@ -0,0 +1,20 @@ +#Load Pass1 Data +load('results/ISA/objects/pass1/Cg25_pass1_0.1.rds') + +#Now you should run the external sequence analysis tools with the output fasta files from isoformSwitchAnalysisPart1 +#Running second step +SwitchList_2 <- isoformSwitchAnalysisPart2( + switchAnalyzeRlist = SwitchList_1, + dIFcutoff = 0.1, + n = NA, + removeNoncodinORFs = FALSE, + pathToCPATresultFile = "results/ISA/objects/Cg25/cg25_cpat.txt", + pathToNetSurfP2resultFile = "results/ISA/objects/Cg25/cg25_netsurf.csv", + pathToPFAMresultFile = "results/ISA/objects/Cg25/cg25_pfam.txt", + pathToSignalPresultFile = 'results/ISA/objects/Cg25/cg25_spres_summary.signalp5', + codingCutoff = 0.725, + outputPlots = T, + pathToOutput = "." +) + +save(SwitchList_2, file="results/ISA/objects/pass2/cg25_pass2.rds") diff --git a/scripts/ISA/isoformPass2_Nac.R b/scripts/ISA/isoformPass2_Nac.R new file mode 100644 index 0000000..f948eed --- /dev/null +++ b/scripts/ISA/isoformPass2_Nac.R @@ -0,0 +1,20 @@ +#Load Pass1 Data +load('results/ISA/objects/pass1/Nac_pass1_0.1.rds') + +#Now you should run the external sequence analysis tools with the output fasta files from isoformSwitchAnalysisPart1 +#Running second step +SwitchList_2 <- isoformSwitchAnalysisPart2( + switchAnalyzeRlist = SwitchList_1, + dIFcutoff = 0.1, + n = NA, + removeNoncodinORFs = FALSE, + pathToCPATresultFile = "results/ISA/objects/Nac/nac_cpat.txt", + pathToNetSurfP2resultFile = "results/ISA/objects/Nac/nac_netsurf.csv", + pathToPFAMresultFile = "results/ISA/objects/Nac/nac_pfam.txt", + pathToSignalPresultFile = 'results/ISA/objects/Nac/nac_spres_summary.signalp5', + codingCutoff = 0.725, + outputPlots = T, + pathToOutput = "." +) + +save(SwitchList_2, file="results/ISA/objects/pass2/Nac_pass2.rds") diff --git a/scripts/ISA/isoformPass2_Sub.R b/scripts/ISA/isoformPass2_Sub.R new file mode 100644 index 0000000..c90e30c --- /dev/null +++ b/scripts/ISA/isoformPass2_Sub.R @@ -0,0 +1,20 @@ +#Load Pass1 Data +load('results/ISA/objects/pass1/Sub_pass1_0.1.rds') + +#Now you should run the external sequence analysis tools with the output fasta files from isoformSwitchAnalysisPart1 +#Running second step +SwitchList_2 <- isoformSwitchAnalysisPart2( + switchAnalyzeRlist = SwitchList_1, + dIFcutoff = 0.1, + n = NA, + removeNoncodinORFs = FALSE, + pathToCPATresultFile = "results/ISA/objects/Sub/sub_cpat.txt", + pathToNetSurfP2resultFile = "results/ISA/objects/Sub/sub_netsurf.csv", + pathToPFAMresultFile = "results/ISA/objects/Sub/sub_pfam.txt", + pathToSignalPresultFile = 'results/ISA/objects/Sub/sub_spres_summary.signalp5', + codingCutoff = 0.725, + outputPlots = T, + pathToOutput = "." +) + +save(SwitchList_2, file="results/ISA/objects/pass2/Sub_pass2.rds") diff --git a/scripts/ISA/isoformPass2_aINS.R b/scripts/ISA/isoformPass2_aINS.R new file mode 100644 index 0000000..70becf2 --- /dev/null +++ b/scripts/ISA/isoformPass2_aINS.R @@ -0,0 +1,20 @@ +#Load Pass1 Data +load('results/ISA/objects/pass1/aINS_pass1_0.1.rds') + +#Now you should run the external sequence analysis tools with the output fasta files from isoformSwitchAnalysisPart1 +#Running second step +SwitchList_2 <- isoformSwitchAnalysisPart2( + switchAnalyzeRlist = SwitchList_1, + dIFcutoff = 0.1, + n = NA, + removeNoncodinORFs = FALSE, + pathToCPATresultFile = "results/ISA/objects/aINS/ains_cpat.txt", + pathToNetSurfP2resultFile = "results/ISA/objects/aINS/ains_netsurf.csv", + pathToPFAMresultFile = "results/ISA/objects/aINS/ains_pfam.txt", + pathToSignalPresultFile = 'results/ISA/objects/aINS/ains_spres_summary.signalp5', + codingCutoff = 0.725, + outputPlots = T, + pathToOutput = "." +) + +save(SwitchList_2, file="results/ISA/objects/pass2/ains_pass2.rds") diff --git a/scripts/ISA/isoformPass2_dlpfc.R b/scripts/ISA/isoformPass2_dlpfc.R new file mode 100644 index 0000000..de3da01 --- /dev/null +++ b/scripts/ISA/isoformPass2_dlpfc.R @@ -0,0 +1,20 @@ +#Load Pass1 Data +load('results/ISA/objects/pass1/dlPFC_pass1_0.1.rds') + +#Now you should run the external sequence analysis tools with the output fasta files from isoformSwitchAnalysisPart1 +#Running second step +SwitchList_2 <- isoformSwitchAnalysisPart2( + switchAnalyzeRlist = SwitchList_1, + dIFcutoff = 0.1, + n = NA, + removeNoncodinORFs = FALSE, + pathToCPATresultFile = "results/ISA/objects/dlPFC/dlpfc_cpat.txt", + pathToNetSurfP2resultFile = "results/ISA/objects/dlPFC/dlpfc_netsurf.csv", + pathToPFAMresultFile = "results/ISA/objects/dlPFC/dlpfc_pfam.txt", + pathToSignalPresultFile = 'results/ISA/objects/dlPFC/dlpfc_spres_summary.signalp5', + codingCutoff = 0.725, + outputPlots = T, + pathToOutput = "." +) + +save(SwitchList_2, file="results/ISA/objects/pass2/dlPFC_pass2.rds") diff --git a/scripts/ISA/isoformPass2_ofc.R b/scripts/ISA/isoformPass2_ofc.R new file mode 100644 index 0000000..e251398 --- /dev/null +++ b/scripts/ISA/isoformPass2_ofc.R @@ -0,0 +1,20 @@ +#Load Pass1 Data +load('results/ISA/objects/pass1/OFC_sex_pass1_0.1.rds') + +#Now you should run the external sequence analysis tools with the output fasta files from isoformSwitchAnalysisPart1 +#Running second step +SwitchList_2 <- isoformSwitchAnalysisPart2( + switchAnalyzeRlist = SwitchList_1, + dIFcutoff = 0.1, + n = NA, + removeNoncodinORFs = FALSE, + pathToCPATresultFile = "results/ISA/objects/OFC/ofc_cpat.txt", + pathToNetSurfP2resultFile = "results/ISA/objects/OFC/ofc_netsurf.csv", + pathToPFAMresultFile = "results/ISA/objects/OFC/ofc_pfam.txt", + pathToSignalPresultFile = 'results/ISA/objects/OFC/ofc_spres_summary.signalp5', + codingCutoff = 0.725, + outputPlots = T, + pathToOutput = "." +) + +save(SwitchList_2, file="results/ISA/objects/pass2/OFC_pass2.rds") diff --git a/scripts/diff_tx_correct.R b/scripts/diff_tx_correct.R new file mode 100644 index 0000000..dea68a1 --- /dev/null +++ b/scripts/diff_tx_correct.R @@ -0,0 +1,99 @@ +# Perform gene-wise pvalue correction with stageR ------------------------- + +library(dplyr) +library(stageR) +library(GenomicFeatures) + +# Load TX data from differential expression +load("results/diff_exp/tx_rin_ph_diff.rda") +df_res <- df_edger_ph_rin_group_tx +colnames(df_res)[1] <- "tx" + +# remove transcript version +df_res$tx <- gsub("\\.+\\d+", "", rownames(df_res)) + +# Load transcript-gene info ----------------------------------------------- +# gtf <- "data/genome/Homo_sapiens.GRCh38.97.gtf.gz" +# txdb.filename <- "data/genome/Homo_sapiens.GRCh38.97.gtf.sqlite" +gtf <- "Homo_sapiens.GRCh38.97.gtf.gz" +txdb.filename <- "Homo_sapiens.GRCh38.97.gtf.sqlite" + +# Load db +txdb <- loadDb(txdb.filename) +txdf <- AnnotationDbi::select(txdb, keys(txdb, "GENEID"), "TXNAME", "GENEID") +tab <- table(txdf$GENEID) +txdf$ntx <- tab[match(txdf$GENEID, names(tab))] +tx2gene <- data.frame(tx = txdf$TXNAME, gene = txdf$GENEID, stringsAsFactors = F) + +# Filter by the transcripts annotated in the gtf +df_res1 <- df_res[df_res$tx %in% tx2gene$tx,] + +# Set regions and gender variables +regions <- unique(sapply(strsplit(df_edger_ph_rin_group_tx$group, split = "_"), "[[", 1)) +gender <- unique(sapply(strsplit(df_edger_ph_rin_group_tx$group, split = "_"), "[[", 2)) + +# Correct p-values for each contrast +ls_res <- list() +for (i in 1:length(regions)) { + ls_temp <- list() + for (j in 1:length(gender)) { + + # Create a subset for each region/gender + tmp <- df_res1[df_res1$group %in% paste(regions[i], gender[j], sep = "_"),] + tx2gene_tmp <- unique(merge(tmp, tx2gene, by = "tx")[, c("tx", "gene")]) + tx2gene_tmp <- tx2gene_tmp[order(tx2gene_tmp$gene),] + + tmp <- tmp[match(tx2gene_tmp$tx, tmp$tx),] + + stopifnot(identical(tmp$tx, tx2gene_tmp$tx)) + + # Check if all transcripts are in the annotation df + if (all(tx2gene_tmp$tx %in% tmp$tx)) { + print("All ok!") + } else { + print("Check annotation") + } + + # Perform stageR gene-wise p-value correction + # pScreen and pConfirmation with padj + pScreen <- tmp$FDR + names(pScreen) <- tx2gene_tmp$gene + pConfirmationTx <- matrix(tmp$PValue, ncol = 1) + rownames(pConfirmationTx) <- tmp$tx + + # Create stageR object + stageRObj <- stageRTx(pScreen = pScreen, + pConfirmation = pConfirmationTx, + tx2gene = data.frame(transcripts = tx2gene_tmp$tx, genes = tx2gene_tmp$gene, stringsAsFactors = F), + pScreenAdjusted = T) + + # Correct p-values with gene-wise approach + stageRObj <- stageWiseAdjustment(object = stageRObj, method = "dte", alpha = 0.05) + + # Get the corrected values + padj <- getAdjustedPValues(stageRObj, order = TRUE, onlySignificantGenes = T) + padj <- padj[!padj$transcript == 0,] + + if (nrow(padj) == 0) { + ls_temp[[j]] <- NULL + } else { + padj$group <- paste(regions[i], gender[j], sep = "_") + ls_temp[[j]] <- padj + } + } + + df_temp <- do.call(rbind, ls_temp) + ls_res[[i]] <- df_temp +} + +df_res_padj_tx <- do.call(rbind, ls_res) + +if(!dir.exists("results/diff_exp/")) { + dir.create("results/diff_exp/") +} + +# Save results +save(df_res_padj, file = "results/diff_exp/diff_tx_corrected.rda") + + + diff --git a/scripts/edger_diff_gene.R b/scripts/edger_diff_gene.R new file mode 100644 index 0000000..c7c2ea9 --- /dev/null +++ b/scripts/edger_diff_gene.R @@ -0,0 +1,77 @@ +# DESEQ2 DIFFERENTIAL EXPRESSION ANALYSIS + +# GENE +library(edgeR) + +# Load metadata ----------------------------------------------------------- +load("results/important_variables/ann.rda") + +# Set comparisons +comp <- paste(rep(unique(ann$region), each = 2), unique(ann$gender), sep = "_") + +# Load gene counts -------------------------------------------------------- +load("results/txi/txi_gene.rda") + +# Differential expression ------------------------------------------------- + +# Creating dds object with design matrix including the selected covariate ('rin' and 'ph') +y <- DGEList(counts = txi$counts, + group = ann$group) + +# Design matrix +design <- model.matrix(~ 0 + ph + rin + group, data = ann) +colnames(design)[3:ncol(design)] <- gsub("group", "", colnames(design)[3:ncol(design)]) + +ct <- makeContrasts( + aINS_female = aINS_MDD_female-aINS_CTRL_female, + aINS_male = aINS_MDD_male-aINS_CTRL_male, + Cg25_female = Cg25_MDD_female-Cg25_CTRL_female, + Cg25_male = Cg25_MDD_male-Cg25_CTRL_male, + dlPFC_female = dlPFC_MDD_female-dlPFC_CTRL_female, + dlPFC_male = dlPFC_MDD_male-dlPFC_CTRL_male, + Nac_female = Nac_MDD_female-Nac_CTRL_female, + Nac_male = Nac_MDD_male-Nac_CTRL_male, + OFC_female = OFC_MDD_female-OFC_CTRL_female, + OFC_male = OFC_MDD_male-OFC_CTRL_male, + Sub_female = Sub_MDD_female-Sub_CTRL_female, + Sub_male = Sub_MDD_male-Sub_CTRL_male, + levels = design +) + +# Filter low expression genes +keep <- filterByExpr(y, group = y$samples$group) +y <- y[keep, , keep.lib.sizes = FALSE] + +# TMM normalization +y <- calcNormFactors(y) + +# Estimate dispersions with +y <- estimateGLMRobustDisp(y, design = design, verbose = T) + +# Fit +fit <- glmFit(y, design = design) + +# Extract results for each comparison + +# Summary dataframe +map_df(comp, function(c) { + + cat("Comparison: ", c) + + lrt <- glmLRT(fit, contrast = ct[, c]) + df <- topTags(lrt, n = Inf, adjust.method = "BH", p.value = 0.05)$table + if(!is.null(df)) { + df %>% + mutate(group = c, + gene = rownames(df)) %>% + relocate(gene) + } +}) -> df_edger_ph_rin_group_gene + +# LRT DGElist objects for each comparison +map(comp, function(c) { + lrt <- glmLRT(fit, contrast = ct[, c]) +}) -> lrt_comp +names(lrt_comp) <- comp + +save(df_edger_ph_rin_group_gene, lrt_comp, file = "results/diff_exp/edger_gene_rin_ph_diff.rda") \ No newline at end of file diff --git a/scripts/edger_diff_tx.R b/scripts/edger_diff_tx.R new file mode 100644 index 0000000..2bfb8da --- /dev/null +++ b/scripts/edger_diff_tx.R @@ -0,0 +1,82 @@ +# DESEQ2 DIFFERENTIAL EXPRESSION ANALYSIS + +# GENE + +library(edgeR) +library(tidyverse) + +# Load metadata ----------------------------------------------------------- + +load("results/important_variables/ann.rda") + +# Set comparisons +comp <- paste(rep(unique(ann$region), each = 2), unique(ann$gender), sep = "_") + +# Load gene counts -------------------------------------------------------- +load("results/txi/txi_tx.rda") + +# Differential expression ------------------------------------------------- + +# Creating dds object with design matrix including the selected covariate ('rin' and 'ph') +y <- DGEList(counts = txi$counts, + group = ann$group) + +# Design matrix +design <- model.matrix(~ 0 + ph + rin + group, data = ann) +colnames(design)[3:ncol(design)] <- gsub("group", "", colnames(design)[3:ncol(design)]) + +ct <- makeContrasts( + aINS_female = aINS_MDD_female-aINS_CTRL_female, + aINS_male = aINS_MDD_male-aINS_CTRL_male, + Cg25_female = Cg25_MDD_female-Cg25_CTRL_female, + Cg25_male = Cg25_MDD_male-Cg25_CTRL_male, + dlPFC_female = dlPFC_MDD_female-dlPFC_CTRL_female, + dlPFC_male = dlPFC_MDD_male-dlPFC_CTRL_male, + Nac_female = Nac_MDD_female-Nac_CTRL_female, + Nac_male = Nac_MDD_male-Nac_CTRL_male, + OFC_female = OFC_MDD_female-OFC_CTRL_female, + OFC_male = OFC_MDD_male-OFC_CTRL_male, + Sub_female = Sub_MDD_female-Sub_CTRL_female, + Sub_male = Sub_MDD_male-Sub_CTRL_male, + levels = design +) + +# Filter low expression genes +keep <- filterByExpr(y, group = y$samples$group) +y <- y[keep, , keep.lib.sizes = FALSE] + +# TMM normalization +y <- calcNormFactors(y) + +# Estimate dispersions with +y <- estimateGLMRobustDisp(y, design = design, verbose = T) + +# Test +fit <- glmFit(y, design = design) + +# Extract results for each comparison + +# Summary dataframe +map_df(comp, function(c) { + + cat("Comparison: ", c) + + lrt <- glmLRT(fit, contrast = ct[, c]) + df <- topTags(lrt, n = Inf, adjust.method = "BH")$table + if(!is.null(df)) { + df %>% + mutate(group = c, + gene = rownames(df)) %>% + dplyr::relocate(gene) + } +}) -> df_edger_ph_rin_group_tx + +# LRT DGElist objects for each comparison +map(comp, function(c) { + lrt <- glmLRT(fit, contrast = ct[, c]) +}) -> lrt_comp +names(lrt_comp) <- comp + +save(df_edger_ph_rin_group_tx, lrt_comp, file = "results/diff_exp/edger_tx_rin_ph_diff.rda") + + diff --git a/scripts/enrichment.R b/scripts/enrichment.R new file mode 100644 index 0000000..2492244 --- /dev/null +++ b/scripts/enrichment.R @@ -0,0 +1,166 @@ +# ENRICHMENT ANALYSIS ----------------------------------------------------- + +library(tidyverse) +library(clusterProfiler) +library(enrichplot) +library(cowplot) +library(patchwork) + +# CREATE FUNCTIONS + +# Convert IDS +convert_id <- function(data, col) { + data %>% + pull({{col}}) %>% + unique() %>% + bitr(fromType = "ENSEMBL", + toType = "ENTREZID", + OrgDb = "org.Hs.eg.db") %>% + mutate(group = data$group[1]) %>% + mutate(sex = data$sex[1]) +} + +# Enrichment with enrichGO function +enrich <- function(entrezgenes, col, id) { + + res <- enrichGO(gene = entrezgenes[[col]], + OrgDb = org.Hs.eg.db, + keyType = id, + ont = "BP", + pAdjustMethod = "BH", + qvalueCutoff = 0.05, + readable = TRUE) # Uncomment to change ENSEMBL id to SYMBOL +} + +# Save plots +create_plots <- function(enrichment, annotation, directory){ + names(enrichment) <- lapply(annotation, function(x){ + unique(as.vector(x$group)) + }) %>% unlist() %>% unname() + + if(!dir.exists(directory)) { + dir.create(directory, recursive = T) + } + + for(i in 1:12){ + if(is.null(enrichment[i][[1]])){ + message(paste(names(enrichment)[i], "is NULL", sep= ' ')) + next() + } + else if(sum(enrichment[[i]]@result$p.adjust < 0.05) == 0){ + message(paste(names(enrichment)[i], "doesn't have enriched terms", sep= ' ')) + next() + } else{ + suppressMessages(dotplot(enrichment[[i]], showCategory=20) + scale_color_viridis_c()) + ggsave(filename = paste0(directory, "enrichment_", names(enrichment)[i], ".pdf"), + width=12, height=8, plot = last_plot()) + } + } + + return(enrichment) + } + +# Transform results to Dataframe +transform_to_df <- function(enrichment, padj_cutoff = 0.05){ + list_of_df <- list() + for(i in 1:12){ + if(is.null(enrichment[i][[1]])){ + print(NULL) + } else{ + enrichment_df <- as_tibble(enrichment[[i]]@result) %>% filter(p.adjust < padj_cutoff) %>% + mutate(group = names(enrichment)[i]) %>% list() + list_of_df <- append(list_of_df, enrichment_df) + } + } + return(list_of_df) +} + +# Save dataframes to csv files +save_df <- function(enrichment, file){ + enrichment %>% + bind_rows() %>% + write_csv(file=file) +} + + +# ENRICHMENT OF DIFFERENTIAL GENES --------------------------------------- +load("results/diff_exp/diff_df.rda") + +split_genes <- diff_df %>% group_split(group, .keep = T) + +converted <- lapply(split_genes, convert_id, col = "gene") + +enriched <- lapply(converted, enrich, col = "ENTREZID", id = "ENTREZID") + +enriched_ann <- create_plots(enrichment = enriched, directory = 'results/tx_enrich/', annotation = converted) + +enriched_df_diff <- transform_to_df(enriched_ann) + +save_df(enriched_df_diff, file = 'results/tx_enrich/go_terms.csv') + +save(enriched_df_diff, file = "results/tx_enrich/go_terms_tx_by_group.rda") + + +# ## INTERSECTION --------------------------------------------------------------- +# load("results/intersects/intersects.rda") +# +# split_genes <- genes_by_sex %>% +# group_split(intersect) +# +# converted <- lapply(split_genes, convert_id, col = "genes") +# +# enriched <- lapply(converted, enrich, col = "ENTREZID", id = "ENTREZID") +# +# enriched_ann <- create_plots(enrichment = enriched, directory = 'results/tx_enrich/intersection_by_sex/', annotation = converted) +# +# enriched_df_by_sex <- transform_to_df(enriched_ann) +# +# names(enriched_df_by_sex) <- c('female', 'female:male', 'male') +# +# save_df(enriched_df_by_sex, file = 'results/tx_enrich/intersection_by_sex/go_terms_by_sex.csv') +# +# save(enriched_df_by_sex, file = "results/tx_enrich/intersection_by_sex/go_terms_by_sex.rda") + +# PLOTS ------------------------------------------------------------------- + +map(enriched_df_diff, ~ { + if(nrow(.x) > 0) { + .x %>% + mutate(gr = Count/as.numeric(sapply(strsplit(GeneRatio, "/"), "[", 2))) %>% + separate(group, into = c("region", "sex"), sep = "_") %>% + mutate(sex = str_to_title(sex)) -> df + + ggplot(df, aes(y = Description, x = factor(1), size = Count, color = gr)) + + geom_point() + + scale_color_viridis_c(limits = c(0, 0.4)) + + scale_size_continuous(limits = c(3, 30), breaks = seq(3, 30, 5)) + + labs(x = "", y = "", color = "Gene ratio") + + theme_bw() + + labs(title = paste(unique(df$region), unique(df$sex), sep = " ")) + + theme( + axis.text.x = element_blank(), + axis.text.y = element_text(size = 8), + panel.grid = element_blank(), + panel.border = element_blank(), + axis.line = element_blank(), + axis.ticks = element_blank(), + strip.background = element_rect(fill = "white", color = NA), + legend.position = "right", + strip.text = element_text(size = 12), + panel.spacing.y = unit(2, "lines") + ) + } +}) -> ls # # List of plots + +# Order plots by the number of terms +ls <- ls[sapply(ls, function(x) !is.null(x))] +or <- map(enriched_df_diff, ~ if(nrow(.x) > 0) nrow(.x)) +or <- order(unlist(or[sapply(or, function(x) !is.null(x))]), decreasing = T) +ls <- ls[or] + +# Plot grid +combined <- wrap_plots(ls) & theme(legend.position = "right") +combined + plot_layout(guides = "collect", heights = c(1, 0.3)) + +# Save +ggsave("results/tx_enrich/enrichment_diff_regions.pdf", height = 18 , width = 12) \ No newline at end of file diff --git a/scripts/gwas_intersections.R b/scripts/gwas_intersections.R new file mode 100644 index 0000000..88c651b --- /dev/null +++ b/scripts/gwas_intersections.R @@ -0,0 +1,38 @@ +library(dplyr) +library(readr) +library(gwasrapidd) + +load("results/diff_exp/diff_df.rda") + +get_study_variants <- function(study_id) { + + variants <- get_variants(study_id = study_id) + + var_ensg_ids <- variants@ensembl_ids + var_variantinfo <- variants@variants %>% + select(variant_id, functional_class) + + var_ensg_ids %>% + left_join(var_variantinfo, by = "variant_id") %>% + mutate(study = study_id) + +} + +wray2018 <- 'GCST005839' +howard2018 <- 'GCST005902' +howard2019 <- 'GCST007342' +hyde2016 <- 'GCST006041' + +studies <- c(wray2018, howard2018, howard2019, hyde2016) + +gwas_mdd <- lapply(studies, get_study_variants) %>% + bind_rows() + +intersection <- diff_df %>% + inner_join(gwas_mdd, by = c("gene" = "ensembl_id")) %>% + unique() + +intersection %>% + write_csv("results/tables/gwas_intersection.csv") + +save(intersection, file = "results/diff_exp/gwas_intersections.rda") diff --git a/scripts/impute_meta.R b/scripts/impute_meta.R new file mode 100644 index 0000000..2be92e5 --- /dev/null +++ b/scripts/impute_meta.R @@ -0,0 +1,91 @@ + +# Variables correlation study --------------------------------------------- + +library(tidyverse) +library(mice) +library(lattice) +library(directlabels) +library(PCAtools) +library(magrittr) + +# Read and organize table +ann <- read.table("data/meta/SraRunTable.txt", header = T, stringsAsFactors = F, sep = ",") +colnames(ann) <- tolower(colnames(ann)) +ann <- ann %>% + dplyr::select(run, age, alcool, drugs, drug_type, gender, medication, medication_type, + organism, smoking, ph, phenotype, pmi, rin, tissue) %>% + filter(organism == "Homo sapiens") %>% + mutate(region = case_when( + tissue == "Orbitofrontal (OFC; BA11)" ~ "OFC", + tissue == "Dorsolateral prefrontal cortex (dlPFC; BA8/9)" ~ "dlPFC", + tissue == "Cingulate gyrus 25 (Cg25)" ~ "Cg25", + tissue == "Anterior Insula (aINS)" ~ "aINS", + tissue == "Nucleus Accumbens (Nac)" ~ "Nac", + tissue == "Subiculum (Sub)" ~ "Sub" + ), + group = paste(region, phenotype, gender, sep = "_")) %>% + dplyr::rename(sample_id = run) + +# Start analysis of important variables ----------------------------------- + +# Transform categorical data into numeric for imputation steps +invisible(lapply(seq_along(ann), function(i) { + if(colnames(ann)[i] %in% c("alcool", "drugs", "drug_type", "medication", "medication_type", "smoking")) { + ann[,i] <<- as.character(tolower(ann[,i])) + ann[,i] <<- as.numeric(as.factor(ann[,i])) + } +})) + +# Check how many NA values are there in each category +sapply(ann, function(i) sum(is.na(i)) ) +ann_miss <- VIM::aggr(ann, col = mdc(1:2), numbers = TRUE, sortVars = TRUE, + labels = names(ann), cex.axis = 0.7, gap = 3, + ylab = c("Proportion of missingness", "Missingness Pattern")) + +# Predict imput values (5 predictions) +ann_imputed <- mice(ann, m = 5, maxit = 40, method = "pmm", seed = 500) + +# Check predicted values +xyplot(ann_imputed, alcool ~ drugs | .imp, pch = 20, cex = 1.4, alpha = 0.4) +direct.label(densityplot(x = ann_imputed, data = ~ alcool + drugs + medication + medication_type)) + +# Choose dataset 2 (one can choose any) +ann_complete <- mice::complete(ann_imputed, 2) + +# Remove column +ann_complete <- ann_complete %>% + dplyr::select(-tissue, -drug_type, -medication_type) + +# Check the number of missing values +sum(sapply(ann_complete, function(i) sum(is.na(i)) )) == 0 + +# Scale continuos variables +ann_complete$age <- scale(ann_complete$age) +ann_complete$pmi <- scale(ann_complete$pmi) +ann_complete$rin <- scale(ann_complete$rin) +ann_complete$ph <- scale(ann_complete$ph) + +# Transform categorical data +ann_complete$gender <- as.numeric(as.factor(ann_complete$gender)) +ann_complete$region <- as.numeric(as.factor(ann_complete$region)) +ann_complete$phenotype <- as.numeric(as.factor(ann_complete$phenotype)) + +# Remove sample names +rownames(ann_complete) <- ann_complete$sample_id +ann_complete$sample_id <- NULL +ann_complete %<>% + tibble::rownames_to_column("run") + +# Remove outliers +ann_complete %<>% + filter(!(run %in% c("SRR5961961", "SRR5961809"))) + +# Save +if(!dir.exists("results/important_variables")) { + dir.create("results/important_variables/", recursive = T) +} + +save(ann_complete, file = "results/important_variables/ann_complete.rda") + + + diff --git a/scripts/intersection_analysis.R b/scripts/intersection_analysis.R new file mode 100644 index 0000000..b55520c --- /dev/null +++ b/scripts/intersection_analysis.R @@ -0,0 +1,157 @@ + +# Quantitative analysis --------------------------------------------------- + +library(DESeq2) +library(IsoformSwitchAnalyzeR) +library(tidyverse) +library(UpSetR) +library(gplots) + +# Load results from DGE, DTE and DTU -------------------------------------- +load("results/diff_exp/diff_df.rda") + +diff_df %<>% + separate(col = "group", into = c("region", "sex"), sep = "_", remove = F) + +# Intersections ----------------------------------------------------------- +# Create intersections between all possible comparisons + +# By analysis type +pdf("results/intersects/genes_by_type.pdf", height = 5, width = 10) +l_type <- lapply(split(diff_df$gene, diff_df$type), unique) +upset(fromList(l_type), text.scale = c(1.5, 2, 1, 1.5, 2, 3), point.size = 5, nintersects = NA) +dev.off() + +# By groups in each sex +pdf("results/intersects/genes_by_group_female.pdf", height = 7, width = 15) +l_group_female <- lapply(split(diff_df$gene[diff_df$sex == "female"], diff_df$group[diff_df$sex == "female"]), unique) +upset(fromList(l_group_female), nsets = length(l_group_female), text.scale = c(1.5, 1.5, 1, 1, 2, 2), + point.size = 3, nintersects = NA) +dev.off() + +pdf("results/intersects/genes_by_group_male.pdf", height = 7, width = 15) +l_group_male <- lapply(split(diff_df$gene[diff_df$sex == "male"], diff_df$group[diff_df$sex == "male"]), unique) +upset(fromList(l_group_male), nsets = length(l_group_male), text.scale = c(1.5, 1.5, 1, 1, 2, 2), + point.size = 3, nintersects = NA) +dev.off() + +# By regions +pdf("results/intersects/genes_by_regions.pdf", height = 7, width = 15) +l_regions <- lapply(split(diff_df$gene, diff_df$region), unique) +upset(fromList(l_regions), nsets = length(l_regions), text.scale = c(1.5, 1.5, 1, 1, 2, 2), + point.size = 3, nintersects = NA) +dev.off() + +# By sex +pdf("results/intersects/genes_by_sex.pdf", height = 5, width = 10) +l_sex <- lapply(split(diff_df$gene, diff_df$sex), unique) +upset(fromList(l_sex), nsets = length(l_sex), text.scale = c(1.5, 2, 1, 1.5, 2, 3)) +dev.off() + +# Get the list of genes for each intersection +get_intersect_genes <- function(ls) { + tmp <- gplots::venn(ls, show.plot = F) + tmp <- attr(tmp, "intersections") + df <- data.frame(intersect = rep(names(tmp), sapply(tmp, length)), genes = unlist(tmp)) + rownames(df) <- NULL + return(df) +} +genes_by_sex <- get_intersect_genes(l_sex) +genes_by_type <- get_intersect_genes(l_type) +genes_by_regions <- get_intersect_genes(l_regions) +genes_by_group_female <- get_intersect_genes(l_group_female) +genes_by_group_male <- get_intersect_genes(l_group_male) + +if(!dir.exists("results/intersects")) { + dir.create("results/intersects", recursive = T) +} +save(list = ls()[grep("genes_by", ls())], file = "results/intersects/intersects.rda") + +# Save csv files for each comparison +lapply(c( + "genes_by_sex", + "genes_by_type", + "genes_by_regions", + "genes_by_group_female", + "genes_by_group_male" + ), +function(x) { + write.csv(get(x), file = paste0("results/intersects/", x, ".csv"), row.names = F, quote = F) +}) + +# Number of genes --------------------------------------------------------- +# Plot number of genes in each female group +diff_df %>% + filter(sex == "female") %>% + group_by(region, type) %>% + dplyr::count(name = "n") %>% +ggplot(aes(x = type, y = n, fill = type)) + + geom_bar(stat = "identity") + + facet_grid(. ~ region) + + scale_y_continuous(name = "Number of genes", limits = c(0, 250)) + + scale_fill_manual(name = "", values = c("DGE" = "#008000ff", "DTE" = "#04009eff", "DTU" = "#ff6600ff")) + + scale_x_discrete(name = "") + + ggtitle("Expression analysis for female regions") + + guides(fill = F) + + theme_bw() +ggsave("results/intersects/number_of_genes_by_sex_female.pdf", width = 7, height = 3) +ggsave("results/intersects/number_of_genes_by_sex_female.png", width = 7, height = 3) + +# Plot number of genes in each male group +diff_df %>% + filter(sex == "male") %>% + group_by(region, type) %>% + dplyr::count(name = "n") %>% + ggplot(aes(x = type, y = n, fill = type)) + + geom_bar(stat = "identity") + + facet_grid(. ~ region) + + scale_y_continuous(name = "Number of genes", limits = c(0, 250)) + + scale_fill_manual(name = "", values = c("DGE" = "#008000ff", "DTE" = "#04009eff", "DTU" = "#ff6600ff")) + + scale_x_discrete(name = "") + + ggtitle("Expression analysis for male regions") + + guides(fill = F) + + theme_bw() +ggsave("results/intersects/number_of_genes_by_sex_male.pdf", width = 7, height = 3) +ggsave("results/intersects/number_of_genes_by_sex_male.png", width = 7, height = 3) + +# Gather the number of significant genes in male and female for each group +diff_df %>% + group_by(sex, region, type) %>% + dplyr::count(name = "n") %>% + ggplot(aes(x = type, y = n, fill = type)) + + geom_bar(stat = "identity") + + facet_grid(sex ~ region, scales = "free_y") + + scale_y_continuous(name = "Number of genes", limits = c(0, 250)) + + scale_fill_manual(name = "", values = c("DGE" = "#008000ff", "DTE" = "#04009eff", "DTU" = "#ff6600ff")) + + scale_x_discrete(name = "") + + guides(fill = F) + + theme_bw() +ggsave("results/intersects/number_of_genes_by_sex.pdf", width = 9, height = 5) +ggsave("results/intersects/number_of_genes_by_sex.png", width = 9, height = 5) + +# Raw number of altered genes in each analysis +diff_df %>% + dplyr::select(gene, type) %>% + group_by(type) %>% + unique() %>% + dplyr::count(name = "n") %>% + ggplot(aes(x = type, y = n, fill = type)) + + geom_bar(stat = "identity") + + scale_y_continuous(name = "Number of genes", limits = c(0, 700)) + + scale_fill_manual(name = "", values = c("DGE" = "#008000ff", "DTE" = "#04009eff", "DTU" = "#ff6600ff")) + + scale_x_discrete(name = "") + + guides(fill = F) + + ggtitle("Raw number of genes for each analysis") + + theme_bw() +ggsave("results/intersects/number_of_genes_by_type.pdf", width = 6, height = 3) +ggsave("results/intersects/number_of_genes_by_type.png", width = 6, height = 3) + + + + + + + + + + diff --git a/scripts/metadata.R b/scripts/metadata.R new file mode 100644 index 0000000..2793e2c --- /dev/null +++ b/scripts/metadata.R @@ -0,0 +1,34 @@ +# Based on the results from rank_variables.R analysis, we decided to include only +# the first 2 covariates: 'rin' and 'ph'. + +library(dplyr) + +# Read and select the covariates +ann <- read.csv("data/meta/SraRunTable.txt", stringsAsFactors = F, header = T) +colnames(ann) <- tolower(colnames(ann)) +ann <- ann %>% + dplyr::select(run, ph, rin, phenotype, gender, tissue, organism) %>% + filter(organism == "Homo sapiens") %>% + mutate(region = case_when( + tissue == "Orbitofrontal (OFC; BA11)" ~ "OFC", + tissue == "Dorsolateral prefrontal cortex (dlPFC; BA8/9)" ~ "dlPFC", + tissue == "Cingulate gyrus 25 (Cg25)" ~ "Cg25", + tissue == "Anterior Insula (aINS)" ~ "aINS", + tissue == "Nucleus Accumbens (Nac)" ~ "Nac", + tissue == "Subiculum (Sub)" ~ "Sub" + ), + group = paste(region, phenotype, gender, sep = "_")) %>% + dplyr::rename(sample_id = run) %>% + dplyr::select(sample_id, ph, rin, phenotype, gender, region, group) + +# Scale ph and rin +ann$ph <- scale(ann$ph) +ann$rin <- scale(ann$rin) +rownames(ann) <- ann$sample_id +ann$sample_id <- NULL + +# Save (this metadata will be used in all future models) +save(ann, file = "results/important_variables/ann.rda") + + + diff --git a/scripts/network.R b/scripts/network.R new file mode 100644 index 0000000..c9dc4c8 --- /dev/null +++ b/scripts/network.R @@ -0,0 +1,126 @@ + +# PPI networks for each group --------------------------------------------- + +library(biomaRt) +library(tidyverse) +library(igraph) +library(tidygraph) +library(scatterpie) +library(ggraph) +library(magrittr) +library(RedeR) + +# ------------------ GET GENES AND INTERACTIONS ------------------------- +# Load diff genes table +load("results/diff_exp/diff_df.rda") +gwas_intersections <- read_csv("results/tables/gwas_intersection.csv") + +# FUNCTIONS --------------------------------------------------------------- + +# Get interaction network from string database +get_map <- function(ids) { + s_map <- read.table( + text = RCurl::postForm( + "https://string-db.org/api/tsv/network" + ,identifiers = ids + ,echo_query = "1" + ,required_score = "0" + ,show_query_node_labels = "1" + ,species = "9606" + )[[1]], sep = "\t", header = T) +} + +# Function to combine scores from different channels +combinescores <- function(dat, evidences = "all", confLevel = 0.4){ + + if(evidences[1] == "all"){ + edat <- dat[, -c(1, 2, ncol(dat))] + } else { + if(!all(evidences %in% colnames(dat))) { + stop("NOTE: one or more 'evidences' not listed in 'dat' colnames!") + } + edat <- dat[, evidences] + } + edat <- edat/1000 + + edat <- 1 - edat + sc <- apply(X = edat, MARGIN = 1, FUN = function(x) 1 - prod(x)) + dat <- cbind(dat[, c(1, 2)], combined_score = sc) + idx <- dat$combined_score >= confLevel + dat <- dat[idx,] + return(dat) + +} + +# Get interaction network +identifiers <- paste0(unique(diff_df$hgnc_symbol), collapse = "%0d") +s_map <- get_map(identifiers) + +# Select channels (from experimental data, coexpression, and database) and combine their scores +s_map %>% + mutate(across(contains("score"), function(i) round(i * 1000, digits = 0))) %>% + dplyr::select(contains("preferredName"), contains("score")) %>% + combinescores(evidences = c("escore", "ascore", "dscore"), confLevel = 0.4) %>% + unique() -> int + +# RedeR + +# Here we select proper coordinates to our network +g <- graph_from_edgelist(as.matrix(int[,1:2]), directed = F) +rdp <- RedeR::RedPort() +calld(rdp) +addGraph(rdp, g) + +# Using REDER, we selected the best visualization for our network. +# Nodes and edges coordinates are saved as nodes2 and edges2 in 'results/networks' directory. + +# Plot network layoout ---------------------------------------------------- + +nodes <- read_tsv("results/networks/nodes2") +edges <- read_delim("results/networks/edges2", delim = "\t") + + +# Mark nodes as GWAS +nodes %<>% + mutate(gwas = ifelse(alias %in% gwas_genes, "gwas", "not_gwas")) + +# Plot +g <- graph_from_data_frame(edges, nodes, directed = F) + +V(g)$x <- nodes$x +V(g)$y <- nodes$y +V(g)$size <- 1 +V(g)$a <- ifelse(V(g)$alias %in% unique(diff_df$hgnc_symbol[diff_df$type == "DGE"]), 1, 0) +V(g)$b <- ifelse(V(g)$alias %in% unique(diff_df$hgnc_symbol[diff_df$type == "DTE"]), 1, 0) +V(g)$c <- ifelse(V(g)$alias %in% unique(diff_df$hgnc_symbol[diff_df$type == "DTU"]), 1, 0) + +ggraph(g, x = x, y = y) + + geom_edge_link0(edge_color = "gray", alpha = 0.7, width = 0.4) + + geom_scatterpie( + cols = c("a", "b", "c"), + data = as_data_frame(g, "vertices") %>% filter(gwas == "gwas"), + colour = NA, + n = 5, + pie_scale = 1, + show.legend = F) + + geom_scatterpie( + cols = c("a", "b", "c"), + data = as_data_frame(g, "vertices") %>% filter(gwas == "not_gwas"), + colour = NA, + pie_scale = 0.18, + show.legend = F + ) + + geom_node_text(aes(label = alias), size = 1.5, nudge_x = 10, nudge_y = 10) + + #geom_node_label(aes(label = alias)) + + scale_fill_manual(values = c("#0ac80aff", "#4f4affff", "#ff822fff")) + + coord_fixed() + + theme_graph() -> p + +# Save +svg(filename = "results/plots_paper/rede2.svg", height = 20, width = 20) +print(p) +dev.off() + +# Percentage of total genes in the network: 49,43%% +n_distinct(nodes$alias) / n_distinct(diff_df$hgnc_symbol) + diff --git a/scripts/network_sex.R b/scripts/network_sex.R new file mode 100644 index 0000000..9fbbe1c --- /dev/null +++ b/scripts/network_sex.R @@ -0,0 +1,210 @@ + +# PPI networks for each group --------------------------------------------- + +library(biomaRt) +library(tidyverse) +library(igraph) +library(tidygraph) +library(scatterpie) +library(ggraph) +library(magrittr) + +# ------------------ GET GENES AND INTERACTIONS ------------------------- +# Load diff genes table +load("results/diff_exp/diff_df.rda") +gwas_intersections <- read_csv("results/tables/gwas_intersection.csv") + +diff_df %<>% + separate(group, into = c("region", "sex"), sep = "_") + +gwas_genes <- unique(gwas_intersections$gene_name) + +# FUNCTIONS --------------------------------------------------------------- + +# Get interaction network from string database +get_map <- function(ids) { + s_map <- read.table( + text = RCurl::postForm( + "https://string-db.org/api/tsv/network" + ,identifiers = ids + ,echo_query = "1" + ,required_score = "0" + ,show_query_node_labels = "1" + ,species = "9606" + )[[1]], sep = "\t", header = T) +} + +# Function to combine scores from different channels +combinescores <- function(dat, evidences = "all", confLevel = 0.4){ + + if(evidences[1] == "all"){ + edat <- dat[, -c(1, 2, ncol(dat))] + } else { + if(!all(evidences %in% colnames(dat))) { + stop("NOTE: one or more 'evidences' not listed in 'dat' colnames!") + } + edat <- dat[, evidences] + } + edat <- edat/1000 + + edat <- 1 - edat + sc <- apply(X = edat, MARGIN = 1, FUN = function(x) 1 - prod(x)) + dat <- cbind(dat[, c(1, 2)], combined_score = sc) + idx <- dat$combined_score >= confLevel + dat <- dat[idx,] + return(dat) + +} + +# FEMALE ------------------------------------------------------------------ + +# Select the female altered genes +diff_df_female <- diff_df %>% filter(sex == "female") + +# Get interaction network +ids_female <- paste0(unique(diff_df_female$hgnc_symbol), collapse = "%0d") +s_map_female <- get_map(ids_female) + +# Select channels (from experimental data, coexpression, and database) and combine their scores +s_map_female %>% + mutate(across(contains("score"), function(i) round(i * 1000, digits = 0))) %>% + dplyr::select(contains("preferredName"), contains("score")) %>% + combinescores(evidences = c("escore", "ascore", "dscore"), confLevel = 0.4) %>% + unique() -> int_female + +# RedeR +# Here we select proper coordinates to our network +# This a manual task, we choose the best layout to the network +g <- graph_from_edgelist(as.matrix(int_female[,1:2]), directed = F) +rdp <- RedeR::RedPort() +calld(rdp) +addGraph(rdp, g) + +# Using RedeR interface, we save the network layout and used it in the next steps + +# Plot network layoout ---------------------------------------------------- + +# nodes <- read_tsv("data/nodes1") +# edges <- read_delim("data/edges1", delim = "\t") + +nodes <- read_tsv("~/Área de trabalho/redes/v3/node_female1") +edges <- read_delim("~/Área de trabalho/redes/v3/edge_female1", delim = "\t") + +nodes %<>% + mutate(gwas = ifelse(alias %in% gwas_genes, "gwas", "not_gwas")) + +g <- graph_from_data_frame(edges, nodes, directed = F) + +V(g)$x <- nodes$x +V(g)$y <- nodes$y +V(g)$size <- 1 +V(g)$a <- ifelse(V(g)$alias %in% unique(diff_df$hgnc_symbol[diff_df$type == "DGE"]), 1, 0) +V(g)$b <- ifelse(V(g)$alias %in% unique(diff_df$hgnc_symbol[diff_df$type == "DTE"]), 1, 0) +V(g)$c <- ifelse(V(g)$alias %in% unique(diff_df$hgnc_symbol[diff_df$type == "DTU"]), 1, 0) + +ggraph(g, x = x, y = y) + + geom_edge_link0(edge_color = "gray", alpha = 0.7, width = 0.4) + + geom_scatterpie( + cols = c("a", "b", "c"), + data = as_data_frame(g, "vertices") %>% filter(gwas == "gwas"), + colour = NA, + n = 5, + pie_scale = 1.5, + show.legend = F) + + geom_scatterpie( + cols = c("a", "b", "c"), + data = as_data_frame(g, "vertices") %>% filter(gwas == "not_gwas"), + colour = NA, + pie_scale = 0.22, + show.legend = F + ) + + geom_node_text(aes(label = alias), size = 1, nudge_x = 20, nudge_y = 20) + + scale_fill_manual(values = c("#0ac80aff", "#4f4affff", "#ff822fff")) + + coord_fixed() + + theme_graph() -> p + +# ggsave(p, filename = "~/Área de trabalho/redes/v3/rede2.pdf", +# height = 20, width = 20, device = cairo_pdf, dpi = 300, units = "cm") + +svg(filename = "~/Área de trabalho/redes/v3/rede_female.svg", height = 10, width = 10) +print(p) +dev.off() + +# Percentage of total genes in the network: 41,17%% +n_distinct(nodes$alias) / n_distinct(diff_df_female$hgnc_symbol) + +# MALE -------------------------------------------------------------------- + +diff_df_male <- diff_df %>% filter(sex == "male") + +# Get interaction network +ids_male <- paste0(unique(diff_df_male$hgnc_symbol), collapse = "%0d") +s_map_male <- get_map(ids_male) + +# Select channels (from experimental data, coexpression, and database) and combine their scores +s_map_male %>% + mutate(across(contains("score"), function(i) round(i * 1000, digits = 0))) %>% + dplyr::select(contains("preferredName"), contains("score")) %>% + combinescores(evidences = c("escore", "ascore", "dscore"), confLevel = 0.4) %>% + unique() -> int_male + +# RedeR +g <- graph_from_edgelist(as.matrix(int_male[,1:2]), directed = F) +rdp <- RedeR::RedPort() +calld(rdp) +addGraph(rdp, g) + +# Using REDER, we selected the best visualization for our network. +# Nodes and edges coordinates are saved as nodes18 and edges18. + +# Plot network layout ---------------------------------------------------- + +# nodes <- read_tsv("data/nodes1") +# edges <- read_delim("data/edges1", delim = "\t") + +nodes <- read_tsv("~/Área de trabalho/redes/v3/nodes_male1") +edges <- read_delim("~/Área de trabalho/redes/v3/edges_male1", delim = "\t") + +nodes %<>% + mutate(gwas = ifelse(alias %in% gwas_genes, "gwas", "not_gwas")) + +g <- graph_from_data_frame(edges, nodes, directed = F) + +V(g)$x <- nodes$x +V(g)$y <- nodes$y +V(g)$size <- 1 +V(g)$a <- ifelse(V(g)$alias %in% unique(diff_df$hgnc_symbol[diff_df$type == "DGE"]), 1, 0) +V(g)$b <- ifelse(V(g)$alias %in% unique(diff_df$hgnc_symbol[diff_df$type == "DTE"]), 1, 0) +V(g)$c <- ifelse(V(g)$alias %in% unique(diff_df$hgnc_symbol[diff_df$type == "DTU"]), 1, 0) + +ggraph(g, x = x, y = y) + + geom_edge_link0(edge_color = "gray", alpha = 0.7, width = 0.4) + + geom_scatterpie( + cols = c("a", "b", "c"), + data = as_data_frame(g, "vertices") %>% filter(gwas == "gwas"), + colour = NA, + n = 5, + pie_scale = 1.5, + show.legend = F) + + geom_scatterpie( + cols = c("a", "b", "c"), + data = as_data_frame(g, "vertices") %>% filter(gwas == "not_gwas"), + colour = NA, + pie_scale = 0.22, + show.legend = F + ) + + geom_node_text(aes(label = alias), size = 1, nudge_x = 20, nudge_y = 20) + + #geom_node_label(aes(label = alias)) + + scale_fill_manual(values = c("#0ac80aff", "#4f4affff", "#ff822fff")) + + coord_fixed() + + theme_graph() -> p + +# ggsave(p, filename = "~/Área de trabalho/redes/v3/rede2.pdf", +# height = 20, width = 20, device = cairo_pdf, dpi = 300, units = "cm") + +svg(filename = "~/Área de trabalho/redes/v3/rede_male.svg", height = 10, width = 10) +print(p) +dev.off() + +# Percentage of total genes in the network: 40,18%% +n_distinct(nodes$alias) / n_distinct(diff_df_male$hgnc_symbol) diff --git a/scripts/organize_dge_dte_after_filtering.R b/scripts/organize_dge_dte_after_filtering.R new file mode 100644 index 0000000..0eeac6b --- /dev/null +++ b/scripts/organize_dge_dte_after_filtering.R @@ -0,0 +1,38 @@ +library(tidyverse) +library(edgeR) + +load("results/diff_exp/diff_tx_corrected.rda") +load("results/diff_exp/outliers_samples_dge.rda") +load("results/diff_exp/outliers_samples_dte.rda") + +# Organize DTE data ------------------------------------------------------- + +# Get logFC data +# This information is not stored because the stageR step requires only the p-values +load("edger_tx_rin_ph_diff.rda") +imap_dfr(lrt_comp, function(x, y) { + df <- topTags(x, n = Inf)$table + df <- df %>% + tibble::rownames_to_column("tx") %>% + mutate(tx = gsub("\\.+\\d+", "", tx), + group = y) %>% + select(tx, logFC, group) + return(df) +}) -> logFC_tx + +df_res_padj_tx <- inner_join(df_res_padj_tx, logFC_tx, by = c("txID" = "tx", "group")) + +# Filter out the outliers identified by ppcseq +df_res_padj_tx_out_filtered <- anti_join(df_res_padj_tx, outliers_samples_dte, by = c("txID" = "tx", "group")) + +# Organize DGE data ------------------------------------------------------- + +load("edger_gene_rin_ph_diff.rda") +df_res_padj_gene_out_filtered <- anti_join(df_edger_ph_rin_group_gene, outliers_samples_dge, by = c("gene", "group")) + +save(df_res_padj_gene_out_filtered, df_res_padj_tx_out_filtered, file = "df_res_dge_dte.rda") + + + + + diff --git a/scripts/organize_original_paper_data.R b/scripts/organize_original_paper_data.R new file mode 100644 index 0000000..a26557b --- /dev/null +++ b/scripts/organize_original_paper_data.R @@ -0,0 +1,46 @@ + +library(readxl) +library(tidyverse) +library(magrittr) + +# organize data from original paper + +tm <- read_excel("data/meta/41591_2017_BFnm4386_MOESM3_ESM.xlsx") %>% + mutate(sex = "male") + +tf <- read_excel("data/meta/41591_2017_BFnm4386_MOESM4_ESM.xlsx") %>% + mutate(sex = "female") + +df_paper <- tm %>% bind_rows(tf) %>% + rename(region = `Brain Region`, gene_name = `Gene name`, + pvalue = `p-value` ) %>% + mutate( + updown = case_when( + logFC < 0 ~ "down", + logFC > 0 ~ "up" + ), + region = case_when( + region == "Anterior Insula" ~ "aINS", + region == "BA11" ~ "OFC", + region == "BA25" ~ "Cg25", + region == "BA8/9" ~ "dlPFC", + region == "Subic" ~ "Sub", + ), + group = paste(region, sex, sep = "_") + ) %>% + select(-`Gene Name`) %>% + group_by(group) %>% + mutate(padj = p.adjust(pvalue, method = "BH")) + +save(df_paper , file = "results/diff_exp/df_original_paper.rda") + +# # Load edgeR DE results +# load("~/edger_gene_rin_ph_diff.rda") +# +# df_edger_ph_rin_group_gene %<>% +# mutate(updown = case_when( +# logFC < 0 ~ "down", +# logFC > 0 ~ "up" +# )) +# +# a <- inner_join(df_edger_ph_rin_group_gene,df_paper, by = c("gene" = "ENSG", "group")) diff --git a/scripts/outliers_edge_ppcseq_gene.R b/scripts/outliers_edge_ppcseq_gene.R new file mode 100644 index 0000000..4744c10 --- /dev/null +++ b/scripts/outliers_edge_ppcseq_gene.R @@ -0,0 +1,105 @@ +library(edgeR) +library(ppcseq) +library(tidyverse) +library(magrittr) + +# Differentially expressed genes from edgeR ------------------------------- + +load("results/diff_exp/edger_gene_rin_ph_diff.rda") + +# Sample annotation ------------------------------------------------------ + +load("results/important_variables/ann.rda") + +# Counts for each gene normalized in TMM ---------------------------------- + +load("results/txi/txi_gene.rda") + +# PPCSEQ has methods to normalize counts, use raw estimates +counts <- txi$counts + +########################################################################## + +# Identify outliers genes in each comparison group + +comp <- paste(rep(unique(ann$region), each = 2), unique(ann$gender), sep = "_") + +map(comp, function(c) { + + # Diff genes for this comparison + diff_genes <- df_edger_ph_rin_group_gene %>% + filter(group == c) %>% + pull(gene) + + # Select information for each region/sex + ann2 <- ann %>% + mutate(group = paste(region, gender, sep = "_")) %>% + filter(group == c) %>% + dplyr::select(run, group, ph, rin, phenotype) %>% + mutate(phenotype = as.factor(phenotype)) + + # Select counts of diff expressed genes from sex/region comparison + counts2 <- counts %>% + as.data.frame() %>% + filter(rownames(.) %in% diff_genes) + + # Transform count data + counts2 <- counts2 %>% + as.data.frame() %>% + tibble::rownames_to_column("gene") %>% + gather(key = "run", value = "count", -gene) + + # Join data and annotation info + counts2 <- inner_join(counts2, ann2, by = "run") + + # Results from edgeR analysis + df_res <- df_edger_ph_rin_group_gene %>% + filter(group == c) %>% + dplyr::select(gene, pval = PValue) + + ppc_table <- inner_join(counts2, df_res, by = "gene") %>% + dplyr::select(run, gene, count, phenotype, ph, rin, pval) %>% + filter(!is.na(pval)) + + counts.ppc <- ppc_table %>% + mutate(is_significant = pval < 0.05, + count = as.integer(count+1)) %>% # Adding 1 to prevent division by 0 + identify_outliers( + formula = ~ phenotype, + .sample = run, + .transcript = gene, + .abundance = count, + .significance = pval, + .do_check = is_significant, + percent_false_positive_genes = 5, + approximate_posterior_inference = FALSE, + cores = 8 + ) + + return(counts.ppc) + +}) -> ppc_outliers + +names(ppc_outliers) <- comp + +# Select only the genes with outliers for further removal +imap_dfr(ppc_outliers, function(x, y) { + + idx <- which(x[["tot_deleterious_outliers"]] != 0) + + if(length(idx) > 0) { + + res <- x %>% + slice(idx) %>% + select(gene, sample_wise_data) %>% + unnest(cols = sample_wise_data) %>% + select(gene, run, deleterious_outliers) %>% + filter(deleterious_outliers) %>% + mutate(group = y) %>% + select(gene, run, group) + + } + +}) -> outliers_samples_dge + +save(outliers_samples, file = "results/diff_exp/outliers_samples_dge.rda") diff --git a/scripts/outliers_edge_ppcseq_tx.R b/scripts/outliers_edge_ppcseq_tx.R new file mode 100644 index 0000000..0da8a07 --- /dev/null +++ b/scripts/outliers_edge_ppcseq_tx.R @@ -0,0 +1,116 @@ +library(edgeR) +library(ppcseq) +library(tidyverse) +library(magrittr) + + +# Differentially expressed genes from edgeR ------------------------------- + +load("results/diff_exp/diff_tx_corrected.rda") + +# Sample annotation ------------------------------------------------------ + +load("results/important_variables/ann.rda") + +# Counts for each gene normalized in TMM ---------------------------------- + +load("results/txi/txi_tx.rda") + +counts <- txi$counts +rownames(counts) <- gsub("\\.\\d+", "", rownames(counts)) + +########################################################################## + +comp <- paste(rep(unique(ann$region), each = 2), unique(ann$gender), sep = "_") + +map(comp, function(c) { + + cat("comparison: ", c, "\n") + + # Diff genes for this comparison - step 1 + diff_tx <- df_res_padj_tx %>% + filter(group == c, transcript <= 0.05) %>% + unique() %>% + pull(txID) + cat("Step 1 done \n") + + # Select information for each region/sex - Step 2 + ann2 <- ann %>% + # tibble::rownames_to_column("sample") %>% + mutate(group = paste(region, gender, sep = "_")) %>% + filter(group == c) %>% + dplyr::select(run, group, ph, rin, phenotype) %>% + mutate(phenotype = as.factor(phenotype)) + cat("Step 2 done \n") + + # Select counts of diff expressed genes from sex/region comparison - Step 3 + counts2 <- counts %>% + as.data.frame() %>% + filter(rownames(.) %in% diff_tx) + cat("Step 3 done \n") + + # Transform count data - Step 4 + counts2 <- counts2 %>% + as.data.frame() %>% + tibble::rownames_to_column("tx") %>% + gather(key = "run", value = "count", -tx) + cat("Step 4 done \n") + + # Join data and annotation info - Step 5 + counts2 <- inner_join(counts2, ann2, by = "run") + cat("Step 5 done \n") + + # Results from edgeR analysis - Step 6 + df_res <- df_res_padj_tx %>% + filter(group == c) %>% + dplyr::select(tx = txID, pval = transcript) #Pvalue + + ppc_table <- inner_join(counts2, df_res, by = "tx") %>% + dplyr::select(run, tx, count, phenotype, ph, rin, pval) %>% + filter(!is.na(pval)) + cat("Step 6 done \n") + + # PPCSEQ - step 7 + counts.ppc <- ppc_table %>% + mutate(is_significant = pval < 0.05, + count = as.integer(count+1)) %>% + identify_outliers( + formula = ~ phenotype, + .sample = run, + .transcript = tx, + .abundance = count, + .significance = pval, + .do_check = is_significant, + percent_false_positive_genes = 5, + approximate_posterior_inference = FALSE, + cores = 8 + ) + cat("Step 7 done \n") + + return(counts.ppc) + +}) -> ppc_outliers_tx + +names(ppc_outliers_tx) <- comp + +# Select only the genes with outliers for further removal +imap_dfr(ppc_outliers_tx, function(x, y) { + + idx <- which(x[["tot_deleterious_outliers"]] != 0) + + if(length(idx) > 0) { + + res <- x %>% + dplyr::slice(idx) %>% + dplyr::select(tx, sample_wise_data) %>% + unnest(cols = sample_wise_data) %>% + dplyr::select(tx, run, deleterious_outliers) %>% + filter(deleterious_outliers) %>% + mutate(group = y) %>% + dplyr::select(tx, run, group) + + } + +}) -> outliers_samples_dte + +save(outliers_samples, file = "results/diff_exp/outliers_samples_dge.rda") diff --git a/scripts/plot_dtu.R b/scripts/plot_dtu.R new file mode 100644 index 0000000..1bc8dce --- /dev/null +++ b/scripts/plot_dtu.R @@ -0,0 +1,114 @@ + +library(purrr) +library(IsoformSwitchAnalyzeR) +library(patchwork) + +# PLOT DTU TRANSCRIPTS ---------------------------------------------------- + +# Get all rds files from ISA step 2 +files <- list.files("results/ISA", pattern = "pass2", recursive = T, full.names = T) +regions <- sapply(strsplit(files, split = "\\/"), "[[", 3) + +# Load files +ls_isa <- map(files, ~ { + load(.x) + SwitchList_2 +}) +names(ls_isa) <- regions + + +# DTU recurrently altered in each sex ----------------------------------- + +# SLX1A +slx1a_cg25 <- switchPlotTranscript( + ls_isa$Cg25, + gene = "SLX1A", + condition1 = "Cg25_CTRL_female", + condition2 = "Cg25_MDD_female" +) + + +slx1a_ofc <- switchPlotTranscript( + ls_isa$OFC, + gene = "SLX1A", + condition1 = "OFC_CTRL_female", + condition2 = "OFC_MDD_female" +) + +# TOX2 +tox2_cg25 <- switchPlotTranscript( + ls_isa$Cg25, + gene = "TOX2", + condition1 = "Cg25_CTRL_female", + condition2 = "Cg25_MDD_female" +) + + +tox2_sub <- switchPlotTranscript( + ls_isa$Sub, + gene = "TOX2", + condition1 = "Sub_CTRL_female", + condition2 = "Sub_MDD_female" +) + + +p1 <- wrap_plots(slx1a_cg25, slx1a_ofc, ncol = 1, nrow = 2) +ggsave(p1, filename = "results/plots_paper/dtu_female_slx1a.svg", width = 7, height = 5) + +p2 <- wrap_plots(tox2_cg25, tox2_sub, ncol = 1, nrow = 2) +ggsave(p2, filename = "results/plots_paper/dtu_female_tox2.svg", width = 7, height = 5) + + +# DTU in the intersection with GWAS --------------------------------------- + +# BTN3A2 +btn3a2 <- switchPlotTranscript( + ls_isa$Cg25, + gene = "BTN3A2", + condition1 = "Cg25_CTRL_female", + condition2 = "Cg25_MDD_female" +) + +# SEZ6 +sez6 <- switchPlotTranscript( + ls_isa$Cg25, + gene = "SEZ6", + condition1 = "Cg25_CTRL_male", + condition2 = "Cg25_MDD_male" +) + +# GNRH +gnrh1 <- switchPlotTranscript( + ls_isa$dlPFC, + gene = "GNRH1", + condition1 = "dlPFC_CTRL_male", + condition2 = "dlPFC_MDD_male" +) + +# PANX2 +panx2 <- switchPlotTranscript( + ls_isa$Nac, + gene = "PANX2", + condition1 = "Nac_CTRL_male", + condition2 = "Nac_MDD_male" +) + +# CARM1P1 +carm1p1 <- switchPlotTranscript( + ls_isa$OFC, + gene = "CARM1P1", + condition1 = "OFC_CTRL_female", + condition2 = "OFC_MDD_female" +) + +# XRCC3 +xrcc3 <- switchPlotTranscript( + ls_isa$OFC, + gene = "XRCC3", + condition1 = "OFC_CTRL_female", + condition2 = "OFC_MDD_female" +) + + + + diff --git a/scripts/plots.rmd b/scripts/plots.rmd new file mode 100644 index 0000000..efc1804 --- /dev/null +++ b/scripts/plots.rmd @@ -0,0 +1,556 @@ +--- +title: "Paper figures" +output: html_document +--- + +```{r setup, include=FALSE} +knitr::opts_chunk$set(echo = TRUE, dev = c('pdf', 'png'), pdf.options(encoding = "ISOLatin9.enc")) +``` + + +Load required packages: + +```{r, warning=FALSE, message=FALSE} +library(tidyverse) +library(patchwork) +library(UpSetR) +library(ggnewscale) +library(pals) +library(magrittr) +library(ggh4x) +library(AnnotationDbi) +library(org.Hs.eg.db) +library(xlsx) +library(extrafont) +library(VennDiagram) +library(ggvenn) + +if(!dir.exists("results/tables")) { + dir.create("results/tables") +} +``` + + +Load results: + +```{r, warning=FALSE, message=FALSE} +load("results/diff_exp/diff_df.rda") +load("results/important_variables/ann.rda") +load("results/intersects/intersects.rda") +gwas_intersections <- read.csv("results/tables/gwas_intersection.csv") +``` + +# Figures in the main paper + +## Figure 1A + +```{r} +# Color scale for gene type +color_scale <- c("DGE" = "#0ac80aff", "DTE" = "#4f4affff", "DTU" = "#ff822fff") + +diff_df %>% + dplyr::select(gene, type) %>% + unique() %>% + dplyr::count(type) %>% + mutate(col = "col", + type = factor(type, levels = c("DTU", "DTE", "DGE"))) %>% + ggplot(aes(x = col, y = n, fill = type)) + + geom_bar(position = "stack", stat = "identity") + + labs(x = "", y = "Number of transcriptionally altered genes", fill = "") + + scale_y_continuous(limits = c(0, 1500), breaks = seq(0, 1500, 200)) + + scale_fill_manual(values = color_scale) + + theme_classic() + + theme( + axis.text.x = element_blank(), + axis.ticks.x = element_blank(), + axis.line.x = element_blank() + ) + +ggsave(file = "results/plots_paper/number_of_genes.pdf", height = 4, width = 2) +ggsave(file = "results/plots_paper/number_of_genes.png", height = 4, width = 2) +``` + + +Figure 1B was produced as described at the 'network.R' in 'scripts' directory. + +## Figure 2A + +```{r, warning=FALSE, message=FALSE} +# Split columns +diff_df %<>% + separate(group, into = c("region", "sex"), sep = "_", remove = F) + +# Funcion to identify significant genes common to male and female groups +count_int <- function(tbl) { + tbl %>% + group_by_at(vars(gene, type, region2)) %>% + dplyr::count(name = "int") +} + +# Filter only the common genes +diff_df %>% + mutate(region2 = region) %>% + group_by(region) %>% + group_map(~ count_int(.x)) %>% + bind_rows() %>% + dplyr::filter(int == 2) -> common_genes + +# Classify genes in I (intersection) and NI (not intersection) +diff_df %>% + left_join(common_genes, by = c("gene", "type", "region" = "region2")) %>% + mutate(int = ifelse(is.na(int), "NI", "I"), + cols = paste(type, int, sep = "_")) %>% + ungroup() -> df_intersection + +# Count the number of gene in Intersection categories +# NI = Not intersection, I = intersection +df_intersection %>% + group_by(region, sex, type, int) %>% + dplyr::count(name = "c") %>% + ungroup() %>% + spread(key = "int", value = "c") %>% + mutate(I = ifelse(is.na(I), 0, I), + y = I + NI, + cols = paste(type, ifelse(I == 0, "NI", "I"), sep = "_"), + I = ifelse(I == 0, NA, I)) -> df_text + +# By regions plot +# Compute the number of genes in NI and I. +df_intersection %>% + group_by(sex, region, int, type) %>% + dplyr::count(name = "n") %>% + group_by(sex, region, type) %>% + mutate(n2 = sum(n), + n = case_when( + int == "I" ~ n, + int == "NI" ~ n2, + ) + ) %>% + ungroup() -> tmp + +# Organize dataframes +# NI - not in the intersection +tmp %>% + filter(int == "NI") %>% + dplyr::select(region, x_axis = sex, type, n) %>% + unique -> df1 + +# I - in the intersection +tmp %>% + filter(int == "I") %>% + dplyr::select(region, x_axis = int, type, n) %>% + unique() -> df2 + +# Create dataframe to plot +df_plot <- bind_rows(df1, df2) %>% + mutate(x_axis = factor(x_axis, levels = c("female", "male", "I"), + labels = c("Female", "Male", "Intersection"))) + +# Plot +df_plot %>% +ggplot(aes(x = as.numeric(x_axis), y = n, fill = type)) + + geom_bar(stat = "identity", position = "stack") + + facet_grid(cols = vars(region)) + + scale_y_continuous(name = "Number of transcriptionally altered genes", limits = c(0, 500), breaks = seq(0, 500, 50), minor_breaks = F) + + #facet_zoom(x = x_axis %in% c("Female", "Male", "Intersection")) + + scale_fill_manual(name = "", values = color_scale) + + scale_x_continuous("", + breaks = 1:length(levels(df_plot$x_axis)), + label = levels(df_plot$x_axis)) + + theme_bw() + + theme( + panel.grid = element_blank(), + strip.background = element_rect(fill = "white"), + axis.text.x = element_text(angle = 45, hjust = 1) + ) + +ggsave("results/plots_paper/fig1A.pdf", height = 4, width = 7) +ggsave("results/plots_paper/fig1A.png", height = 4, width = 7) +``` + +## Figure 2B + +```{r} +# Create datafame to plot +loadfonts() +diff_df %>% + mutate(sex = case_when( + sex == "female" ~ "Female", + sex == "male" ~ "Male" + )) -> tmp8 + +# Create list of genes in female, in male, and in both sexes +l_genes <- split(tmp8$gene, tmp8$sex) + +# Plot Venn diagram +cairo_pdf(file = "results/plots_paper/fig2B.pdf", width = 4, height = 4) +draw.pairwise.venn(area1 = n_distinct(l_genes$Female), + area2 = n_distinct(l_genes$Male), + cross.area = n_distinct(intersect(l_genes$Female, l_genes$Male)), + rotation.degree = 270, + fill = c("#FA9B41", "#BEE346")) +dev.off() +``` + +## Figure 2C + +```{r} +# Create function to count intersections +overlap_list <- function(gene_ls) { + genes <- unique(unlist(gene_ls)) + res <- as.data.frame(sapply(gene_ls, function(x) { + sapply(genes, function(y) { + as.integer(y %in% x) + }) + })) + return(res) +} + +# Organize df with intersections +l_group_female <- lapply(split(diff_df$gene[diff_df$sex == "female"], + diff_df$group[diff_df$sex == "female"]), + unique) +l_group_male <- lapply(split(diff_df$gene[diff_df$sex == "male"], + diff_df$group[diff_df$sex == "male"]), + unique) + +df_intersect_female <- overlap_list(l_group_female) +df_intersect_male <- overlap_list(l_group_male) + +df_intersect_female %<>% + mutate(exclusive = rowSums(across(where(is.numeric)))) + +df_intersect_male %<>% + mutate(exclusive = rowSums(across(where(is.numeric)))) + +# Create temporary dataframes with the number of regions in each intersection +# For females +df_intersect_female %>% + gather(region, value, 1:6) %>% + filter(value == 1) %>% + mutate( + exclusive = case_when( + exclusive == 1 ~ "Exclusive", + exclusive == 2 ~ "2", + exclusive == 3 ~ "3", + exclusive == 4 ~ "4", + exclusive == 5 ~ "5", + ), + ) %>% + separate(region, into = c("region", "sex"), sep = "_") %>% + dplyr::select(-value) %>% + dplyr::count(sex, region, exclusive) -> tmp_1 + +# For males +df_intersect_male %>% + gather(region, value, 1:6) %>% + filter(value == 1) %>% + mutate( + exclusive = case_when( + exclusive == 1 ~ "Exclusive", + exclusive == 2 ~ "2", + exclusive == 3 ~ "3", + exclusive == 4 ~ "4", + exclusive == 5 ~ "5", + ), + ) %>% + separate(region, into = c("region", "sex"), sep = "_") %>% + dplyr::select(-value) %>% + dplyr::count(sex, region, exclusive) -> tmp_2 + +# Combine the two dataframes +df_plot2 <- bind_rows(tmp_1, tmp_2) +df_plot2 %<>% + mutate(exclusive = factor(exclusive, + levels = c("2", "3", + "4", "5", + "Exclusive")), + sex = factor(sex, + levels = c("female", "male"), labels = c("Female", "Male")) + ) %>% + group_by(sex, region) %>% + mutate(p = n / sum(n)) + +# Compute the number of genes in male and female intersections. +# 'tmp_5' and 'tmp_6' +df_plot %>% # df_plot contains the number of TAG in each region for males and females + filter(x_axis == "Intersection") %>% + group_by(region) %>% + summarise(n_intersection = sum(n)) -> tmp_5 + +df_plot2 %>% + group_by(sex, region) %>% + summarise(n_total = sum(n)) -> tmp_6 + +# df_plot3 holds the number of genes in the intersection of females and males in each region +df_plot3 <- inner_join(tmp_6, tmp_5, by = "region") +df_plot3 %<>% + mutate(p_intersect = n_intersection/n_total) + +# Join exclusivity information and intersection information +df_plot2 <- inner_join(df_plot2, df_plot3, by = c("region", "sex")) + +# Dataframe to plt the red line which represents the intersection percentage in each region for each sex +tmp7 <- data.frame(sex = c("Female", "Male"), + xmin = c(0.65,1.65), + xmax = c(1.35,2.35)) + +df_plot2 <- inner_join(df_plot2, tmp7, by = "sex") + +# Define colors to each intersection +cols_intersects <- c( + "2" = "grey80", + "3" = "grey60", + "4" = "grey40", + "5" = "black", + "Exclusive" = "#8a0cb1ff" +) + +# Plot with total number of genes in each intersection +ggplot(df_plot2, aes(x = sex, y = n, fill = exclusive)) + + geom_bar(stat = "identity") + + facet_grid(.~ region) + + scale_fill_manual("Number of intersections among regions", values = cols_intersects) + + labs(x = "", y = "Number of significant genes") + + scale_y_continuous(limits = c(0,450), breaks = seq(0, 450, 50)) + + geom_linerange(aes(xmin = xmin, xmax = xmax, y = n_intersection), lty = 3) + + theme_bw() + + theme( + strip.background = element_rect(fill = "white"), + axis.text.x = element_text(angle = 45, hjust = 1), + legend.position = "bottom", + legend.box = "horizontal" + ) + + guides(fill = guide_legend(title.position = "top", title.hjust = 0.5)) + +ggsave("results/plots_paper/fig2C_1.pdf", height = 4, width = 5) +ggsave("results/plots_paper/fig2C_1.png", height = 4, width = 5, dpi = 300) + +# Plot the percentage in each intersection +ggplot(df_plot2, aes(x = sex, y = p, fill = exclusive)) + + geom_bar(stat = "identity", width = 0.8) + + facet_grid(.~region) + + scale_fill_manual("Number of intersections between regions", values = cols_intersects) + + scale_x_discrete(labels = c("Female" = expression("\u2640"), "Male" = expression("\u2642")))+ + scale_y_continuous(breaks = seq(0,1,0.2), labels = scales::percent(seq(0,1,0.2))) + + geom_linerange(aes(xmin = xmin, xmax = xmax, y = p_intersect), lty = 1, lwd = 0.8, col = "red") + + labs(x = "", y = "% of transcriptionally altered genes") + + force_panelsizes(cols = grid::unit(1.2, "cm"))+ + theme_bw() + + theme( + strip.background = element_rect(fill = "white"), + axis.text.x = element_text(size = 15, colour = "black"), + axis.ticks.x = element_blank(), + legend.position = "bottom", + panel.grid = element_blank(), + legend.box = "horizontal" + ) + + guides(fill = guide_legend(title.position = "top", title.hjust = 0.5)) + +ggsave("results/plots_paper/fig2C_2.pdf", height = 4, width = 5, device = cairo_pdf, dpi = 300) +ggsave("results/plots_paper/fig2C_2.png", height = 4, width = 5, dpi = 300) + +``` + +## Figure 3 + +Enrichment plot was built as described in `enrichment.R` in `script` directory. + +## Figure 4 and 5 + +Figures 4 and 5 were built as described in `plot_dtu.R` in `script` directory. + +# Supplementary Figures + +## Supplementary Figure 1 + +Supplementary Figure 1 was plotted as described in `robust_pca.R` in `scripts` directory. + +## Supplementary Figure 2 + +Supplementary Figure 2 was plotted as described in `rank_variables.R` in `scripts` directory. + +## Supplementary Figures 3 and 5 + +Supplementary Figure 3 and 5 were plotted as described in `intersection_analysis.R` in `scripts` directory. + +## Supplementary Figure 4 + +```{r} +# Plot transcriptionally altered genes (TAG) at gene- (DGE) and transcript-level (DTE and DTU) +diff_df %>% + group_by(sex, region) %>% + group_map( ~ { + gl <- setdiff(unique(.x$gene[.x$type == "DGE"]), + unique(.x$gene[.x$type %in% c("DTE", "DTU")])) + .x$gt <- ifelse(.x$gene %in% gl, "G", "T") + .x + }, .keep = T) %>% + bind_rows() %>% + group_by(gt, region, sex) %>% + dplyr::count(name = "n") %>% + group_by(region, sex) %>% + mutate(p_gt = n/sum(n)) %>% + ggplot(aes(x = sex, y = p_gt, fill = gt)) + + geom_bar(stat = "identity") + + facet_grid(.~ region) + + scale_y_continuous(breaks = seq(0,1,0.2), + labels = scales::percent(seq(0,1,0.2))) + + scale_x_discrete(labels = c("female" = expression("\u2640"), + "male" = expression("\u2642"))) + + scale_fill_manual(values = c("G" = "#5E835Fff", "T" = "#85587C"), + labels = c("G" = "Genes", "T" = "Transcripts")) + + labs(x = "", y = "Pergentage of transcriptionally altered genes", fill = "") + + theme_bw() + + theme( + strip.background = element_rect(fill = "white"), + axis.text.x = element_text(size = 15, colour = "black"), + axis.ticks.x = element_blank(), + panel.grid = element_blank() + ) + +ggsave("results/plots_paper/percentage_gt.pdf", height = 5, width = 10, device = cairo_pdf) +ggsave("results/plots_paper/percentage_gt.png", height = 5, width = 10) +``` + +# Supplementary Figure 6 + +Intersection among the different methods used (DGE, DTE and DTU). +```{r} + +# Load intersection information saved in 'intersection_analysis.R' +load("results/intersects/intersects.rda") + +# Create dictionary +dc <- diff_df %>% dplyr::select(genes = gene, hgnc_symbol) %>% unique() + +# Create gene SYMBOL column +lapply(c( + "genes_by_group_female", "genes_by_group_male", + "genes_by_regions", "genes_by_sex", "genes_by_type" +), function(x) { + assign(x, base::unique(inner_join(get(x, envir = .GlobalEnv), dc, by = "genes")), + envir = .GlobalEnv) +}) + +# Create dataframe with gwas infos +df <- data.frame(hgnc_symbol = unique(gwas_intersections$gene_name), gwas = "gwas") + +# Join gwas info with intersections info +tmp <- inner_join(genes_by_sex, diff_df, by = c("hgnc_symbol")) +tmp <- inner_join(tmp, genes_by_type, by = "hgnc_symbol") +tmp <- left_join(tmp, df, by = "hgnc_symbol") +tmp$gwas <- ifelse(is.na(tmp$gwas), "not_gwas", tmp$gwas) + +# Plot for sex intersections by type +tmp %>% + dplyr::select(hgnc_symbol, intersect.x, intersect.y) %>% + unique() %>% + group_by(intersect.x, intersect.y) %>% + dplyr::count(name = "n") %>% + ggplot(aes(x = intersect.x, y = n, fill = intersect.y)) + + geom_bar(stat = "identity") + + scale_fill_brewer(type = "qual", palette = "Set1") + + labs(x = "Intersections by sex", y = "Number of transcriptionally altered genes", + fill = "Intersections by type") + + theme_bw() +ggsave("results/plots_paper/intersect_sex_by_type2.pdf", width = 5, height = 4) +ggsave("results/plots_paper/intersect_sex_by_type2.png", width = 5, height = 4) + + +# Plot for sex intersections by gwas +tmp %>% + dplyr::select(hgnc_symbol, intersect.x, gwas) %>% + unique() %>% + group_by(intersect.x, gwas) %>% + dplyr::count(name = "n") %>% + ggplot(aes(x = intersect.x, y = n, fill = gwas)) + + geom_bar(stat = "identity") + + scale_fill_brewer(type = "qual", palette = "Set1") + + labs(x = "Intersections by sex", y = "Number of transcriptionally altered genes", + fill = "GWAS") + + theme_bw() + +ggsave("results/plots_paper/intersect_sex_by_gwas.pdf", width = 5, height = 4) +ggsave("results/plots_paper/intersect_sex_by_gwas.png", width = 5, height = 4) +``` + + +# Supplementary Tables + +## Supplementary Table 1 + +```{r} +load("results/important_variables/ann.rda") + +ann %>% + dplyr::select(run, phenotype, gender, region) %>% + count(phenotype, gender, region, name = "number_of_samples") %>% + arrange(gender, region) %>% + write.xlsx(file = "results/tables/number_of_samples.xlsx", row.names = F) +``` + +## Supplementary Table 2 + +```{r} +diff_df %>% + write.xlsx(file = "results/tables/TAG.xlsx", row.names = F) +``` + +## Supplementary Table 3 + +```{r} +genes_by_group_female %>% + write.xlsx(file = "results/tables/intersection_tables.xlsx", row.names = F, sheetName = "Female_Intersections") + +genes_by_group_male %>% + write.xlsx(file = "results/tables/intersection_tables.xlsx", row.names = F, sheetName = "Male_Intersections", + append = T) + +genes_by_sex %>% + write.xlsx(file = "results/tables/intersection_tables.xlsx", row.names = F, sheetName = "Sex_Intersections", + append = T) + +genes_by_regions %>% + write.xlsx(file = "results/tables/intersection_tables.xlsx", row.names = F, sheetName = "Regions_Intersections", + append = T) + +``` + + +Save intersection tables for further consulting. +```{r} +# Save tables +gene_name <- AnnotationDbi::select(org.Hs.eg.db, + keys = diff_df$gene, + keytype = "ENSEMBL", + columns = c("ENSEMBL", "GENENAME", "SYMBOL")) + +tmp %>% + # left_join(gene_name, by = c("genes" = "ENSEMBL")) %>% + unique() %>% + write_csv("results/tables/intersect_by_type_and_gwas.csv", quote_escape = "none") %>% + write.xlsx(file = "results/tables/intersect_by_type_and_gwas.xlsx", row.names = F, showNA = F) + +overlap_list(l_group_female) %>% + tibble::rownames_to_column("gene") %>% + left_join(gene_name, by = c("gene" = "ENSEMBL")) %>% + mutate(exclusive = rowSums(across(where(is.numeric)))) %>% + arrange(desc(exclusive)) %>% + unique() %>% + write_csv("results/tables/intersect_regions_by_sex_female.csv", quote_escape = "none") %>% + write.xlsx(file = "results/tables/intersect_regions_by_sex_female.xlsx", row.names = F, showNA = F) + +overlap_list(l_group_male) %>% + tibble::rownames_to_column("gene") %>% + left_join(gene_name, by = c("gene" = "ENSEMBL")) %>% + mutate(exclusive = rowSums(across(where(is.numeric)))) %>% + arrange(desc(exclusive)) %>% + unique() %>% + write_csv("results/tables/intersect_regions_by_sex_male.csv", quote_escape = "none") %>% + write.xlsx(file = "results/tables/intersect_regions_by_sex_male.xlsx", row.names = F, showNA = F) + +``` + + + diff --git a/scripts/rank_variables.R b/scripts/rank_variables.R new file mode 100644 index 0000000..bdea6cc --- /dev/null +++ b/scripts/rank_variables.R @@ -0,0 +1,193 @@ +library(tidyverse) +library(PCAtools) +library(DESeq2) +library(pals) +library(pheatmap) +library(RColorBrewer) +# library(animation) +# library(gganimate) +# library(magick) +# library(ExpressionNormalizationWorkflow) +# library(PoiClaClu) + +# Load predicted metadata +load("results/important_variables/ann_complete.rda") + +# Organize predicted metadata +ann_regression <- ann_complete +ann_pca <- ann_complete +lapply(seq_along(ann_pca), function(i) { + if(colnames(ann_pca)[i] %in% c("alcool", "drugs", "medication", "smoking")) { + ann_pca[,i] <<- factor(ann_pca[,i], levels = c("1", "2"), labels = c("no", "yes")) + } +}) +ann_pca$phenotype <- factor(ann_pca$phenotype, levels = c("1", "2"), labels = c("CTRL", "MDD")) +ann_pca$region <- sapply(strsplit(ann_pca$group, split = "_"), "[[", 1) +ann_pca$gender <- factor(ann_pca$gender, levels = c("1", "2"), labels = c("female", "male")) + +rm("ann_complete") + +# Load counts from kallisto +load("results/txi/txi_gene.rda") + +# Exploratory analysis ---------------------------------------------------- + +# DESeq2 object +dds <- DESeqDataSetFromTximport(txi = txi, + colData = ann_pca, + design = ~ group) + +# Filter genes that do not have a count value lesser than 10 in at least 3 samples +keep <- rowSums(counts(dds) >= 10) >= 3 +dds <- dds[keep,] + +# VST normalization - See DESeq workflow for details +vds <- vst(dds, blind = T) + +# Plot PCA individually based on the 500 genes with highest variance +get_plots <- function(n_genes) { + vsd_data <- DESeq2::plotPCA(vds, intgroup = "group", returnData = T, ntop = n_genes) + vsd_data$n <- n_genes + return(vsd_data) +} + +# # Plot animation +# df <- do.call(rbind, lapply(c(500, 2000, 5000, 10000, 20000, nrow(vds)), get_plots)) +# df$gender <- sapply(strsplit(as.character(df$group), split = "_"), "[[", 3) +# df$group <- paste(ann_pca$region, ann_pca$phenotype, sep = "_") +# df$n <- as.factor(df$n) +# +# anim1 <- ggplot(df, aes(x = PC1, y = PC2, col = group, shape = gender)) + +# geom_point(size = 2.5) + +# transition_states(n, transition_length = 3, state_length = 1) + +# labs(title = "PCA with the {closest_state} genes with highest variance") +# +# anim2 <- animate(anim1, width = 800, height = 500) +# +# if(!dir.exists("results/rank_plots/")) { +# dir.create("results/rank_plots/") +# } +# anim_save(filename = "results/rank_plots/pca_high_var_genes.gif", animation = anim2) + +# PCA analysis of variants ------------------------------------------------ + +# Compute and plot PCA +rownames(ann_regression) <- ann_regression$run +p_kallisto <- pca(assay(vds), metadata = ann_regression) + +df <- data.frame(PC1 = p_kallisto$rotated[,1], + PC2 = p_kallisto$rotated[,2], + gender = ann_pca$gender, + group = paste(ann_pca$region, ann_pca$phenotype, sep = "_"), + stringsAsFactors = F) +cols <- brewer.paired(12) +cols[11] <- "#e0e05cf8" +names(cols) <- unique(df$group)[order(sapply(strsplit(unique(df$group), split = "_"), "[[", 1))] +ggplot(df, aes(x = PC1, y = PC2, col = group, shape = gender)) + + geom_point(size = 2.5) + + scale_color_manual(values = cols, name = "Group") + + scale_shape_manual(name = "Gender", values = c(15, 17), labels = c("female" = "Female", "male" = "Male")) + + labs(x = paste0("PC1", " (", round(p_kallisto$variance[1], 2), "%)"), + y = paste0("PC2", " (", round(p_kallisto$variance[2], 2), "%)")) + + guides(colour = guide_legend(override.aes = list(size = 3)), + shape = guide_legend(override.aes = list(size = 3))) + + theme_bw() + + theme(legend.key.size = unit(10, units = "mm"), + legend.text = element_text(size = 12), + legend.title = element_text(size = 12)) +ggsave("results/rank_plots/pca_vst.pdf", width = 10, height = 7) + +# Screeplot +pdf("results/rank_plots/screeplot_pca.pdf", width = 10, height = 7) +screeplot(p_kallisto, vline = findElbowPoint(p_kallisto$variance), components = 1:20) +dev.off() + +# Eigenplot - spearman correlation between variables and principal components +pdf("results/rank_plots/eigercorplot_kallisto.pdf", width = 10, height = 7) +eigencorplot(p_kallisto, corFUN = "spearman", + corUSE = 'pairwise.complete.obs', + metavars = c("age", "alcool", "drugs", "ph", "medication", + "gender", "region", "pmi", "rin", "phenotype")) +dev.off() + +# # Poisson distance - See similarities between regions +# poisd <- PoissonDistance(t(counts(dds))) +# samplePoisDistMatrix <- as.matrix(poisd$dd) +# rownames(samplePoisDistMatrix) <- ann_pca$group +# colnames(samplePoisDistMatrix) <- NULL +# colors <- colorRampPalette(rev(brewer.pal(9, "Blues")))(255) +# +# pdf("results/rank_plots/poisson_dist.pdf", height = 20, width = 10) +# pheatmap(samplePoisDistMatrix, +# clustering_distance_rows = poisd$dd, +# clustering_distance_cols = poisd$dd, +# col = colors, +# fontsize_row = 5, +# cellwidth = 1, cellheight = 5, legend = F) +# dev.off() + +# # Principal Variance Component Analysis ----------------------------------- +# # From ExpressionNormalizationWorkflow package +# rownames(ann_pca) <- ann_pca$run +# inpData <- expSetobj(assay(vds), ann_pca) +# cvrts_eff_var <- c("age", "alcool", "drugs", "ph", "medication", +# "gender", "region", "pmi", "rin", "phenotype") +# pct_thrsh <- 0.95 +# pdf("results/rank_plots/pvca.pdf", width = 10, height = 7) +# pvcAnaly(inpData, pct_thrsh, cvrts_eff_var) +# dev.off() + +# Rank variables by their correlation to each components ------------------ +vars <- c("age", "alcool", "drugs", "ph", "medication", "smoking", + "gender", "region", "pmi", "rin", "phenotype") +m_cor <- matrix(0, nrow = length(vars), ncol = length(p_kallisto$rotated)) + +# Create correlation matrix +for (i in 1:nrow(m_cor)) { + for (j in 1:ncol(m_cor)) { + m_cor[i, j] <- cor.test(x = ann_regression[, vars[i] ], + y = p_kallisto$rotated[,j], + method = "spearman")$p.value + } +} +m_cor <- m_cor[,1:10] +dimnames(m_cor) <- list(vars, paste0("PC", 1:10)) + +# Rank variables by PCs +ls <- list() +for (i in 1:nrow(m_cor)) { + temp <- 0 + for (j in 1:ncol(m_cor)) { + if (m_cor[i,j] <= 0.05) { + temp[j] <- p_kallisto$variance[j] + ls[[i]] <- temp + } else { + temp[j] <- NA + ls[[i]] <- temp + } + } +} +names(ls) <- vars +df_vars <- as.data.frame(do.call(rbind, ls)) +df_vars$vars <- vars +names(df_vars)[1:10] <- paste0("PC", 1:10) +df_vars <- gather(df_vars, key = "component", value = "value", PC1:PC10) +df_vars <- df_vars[complete.cases(df_vars),] +df_vars$vars <- factor(df_vars$vars, levels = names(sort(sapply(ls, sum, na.rm = T), decreasing = T)), + labels = names(sort(sapply(ls, sum, na.rm = T), decreasing = T))) +df_vars$component <- as.numeric(gsub("PC", "", df_vars$component)) + +# Plot cumulative importance for each significantly correlated variable +ggplot(df_vars, aes(x = vars, y = value, fill = factor(component))) + + geom_bar(stat = "identity") + + scale_fill_manual(values = unname(polychrome())[3:12], labels = as.factor(1:10)) + + labs(x = "", y = "Cumulative variance of correlated components %", fill = "PC") + + ggtitle("Variance explained by the cumulative sum of components correlated to each variable", + subtitle = paste0("Variance explained by the first 10 components = ", + round(sum(p_kallisto$variance[1:10]), 2), "%")) + + theme_bw() + + theme(axis.text.x = element_text(size = 16, angle = 45, hjust = 1, vjust = 1), + axis.text.y = element_text(size = 14), + axis.title.y = element_text(size = 14)) +ggsave("results/rank_plots/rank_vars.pdf", width = 10, height = 7) + diff --git a/scripts/remove_outliers_samples.R b/scripts/remove_outliers_samples.R new file mode 100644 index 0000000..1dbdaba --- /dev/null +++ b/scripts/remove_outliers_samples.R @@ -0,0 +1,29 @@ + +# Samples removal after robust pca analysis ------------------------------- + +library(dplyr) + +# Load annotation +load("results/important_variables/ann.rda") + +outliers <- c("SRR5961961", "SRR5961809") + +# Remove the 2 outliers samples from robust pca +ann %>% + tibble::rownames_to_column("run") %>% + filter(!(run %in% outliers)) -> ann +save(ann, file = "results/important_variables/ann.rda") + +# Load txi information: gene +load("results/txi/txi_gene.rda") +txi$abundance <- txi$abundance[, !(colnames(txi$abundance) %in% outliers)] +txi$counts <- txi$counts[, !(colnames(txi$counts) %in% outliers)] +txi$length <- txi$length[, !(colnames(txi$length) %in% outliers)] +save(txi, file = "results/txi/txi_gene.rda") + +# Load txi information: tx +load("results/txi/txi_tx.rda") +txi$abundance <- txi$abundance[, !(colnames(txi$abundance) %in% outliers)] +txi$counts <- txi$counts[, !(colnames(txi$counts) %in% outliers)] +txi$length <- txi$length[, !(colnames(txi$length) %in% outliers)] +save(txi, file = "results/txi/txi_tx.rda") diff --git a/scripts/robust_pca.R b/scripts/robust_pca.R new file mode 100644 index 0000000..6d6edf4 --- /dev/null +++ b/scripts/robust_pca.R @@ -0,0 +1,35 @@ + +# ROBUST PCA ANALYSIS ----------------------------------------------------- + +# Here we aim to identify outlier samples that are not obviously seen in common PCA. +# We use the methodology implemented in the 'rrcov' package. + +library(rrcov) +library(DESeq2) + +# Load count table and annotation data +load("results/txi/txi_gene.rda") +load("results/important_variables/ann.rda") + +# DESeq2 object +dds <- DESeqDataSetFromTximport(txi, + colData = ann, + design = ~ group) + +v <- vst(dds, blind = F) +v <- t(assay(v)) +pc1 <- PcaGrid(v, 5) + +# Plot rPCA +pdf("results/plots_paper/robust_pca.pdf") +plot(pc1) +dev.off() + +# The SRR5961961 sample is identified as divergent from others, and for this reason is excluded from +# downstream analyses. + +# plot(pc1$scores[,1], pc1$od) +# text(pc1$scores[pc1$od > 80, 1], pc1$od[pc1$od > 80]+2, labels = rownames(pc1$scores)[which(pc1$od > 80)]) +# pc2 <- PcaHubert(v, 5) +# plot(pc2$scores[,1], pc2$od) +# text(pc2$scores[pc2$od > 90, 1], pc2$od[pc2$od > 90]-2, labels = rownames(pc2$scores)[which(pc2$od > 90)]) diff --git a/scripts/summarise_results_dge_dte_dtu.R b/scripts/summarise_results_dge_dte_dtu.R new file mode 100644 index 0000000..8ed2de8 --- /dev/null +++ b/scripts/summarise_results_dge_dte_dtu.R @@ -0,0 +1,117 @@ + +# Load DGE/DTE/DTU results ------------------------------------------------ + +library(tidyverse) +library(IsoformSwitchAnalyzeR) +library(biomaRt) +library(magrittr) + +# Dictionary of IDs (ensembl_transcript_id, ensembl_gene_id, and gene name) ---- +ensembl <- useMart("ENSEMBL_MART_ENSEMBL") +ensembl <- useDataset(dataset = "hsapiens_gene_ensembl", mart = ensembl) +tx2gene <- getBM(attributes = c("ensembl_gene_id", "ensembl_transcript_id", "hgnc_symbol"), + mart = ensembl) + +tx2gene$hgnc_symbol <- ifelse(tx2gene$hgnc_symbol == "", NA, tx2gene$hgnc_symbol) +tx2gene$ensembl_gene_id <- ifelse(tx2gene$ensembl_gene_id == "", NA, tx2gene$ensembl_gene_id) +tx2gene$ensembl_transcript_id <- ifelse(tx2gene$ensembl_transcript_id == "", NA, tx2gene$ensembl_transcript_id) + +tx2gene <- tx2gene[complete.cases(tx2gene), ] + +rm(ensembl) + +# DGE and DTE results ---- +load("results/diff_exp/df_res_dge_dte.rda") + +df_res_padj_gene_out_filtered %<>% + inner_join( + tx2gene %>% dplyr::select(ensembl_gene_id, hgnc_symbol) %>% unique(), + by = c("gene" = "ensembl_gene_id")) + +df_res_padj_tx_out_filtered %<>% + inner_join( + tx2gene %>% dplyr::select(ensembl_gene_id, hgnc_symbol) %>% unique(), + by = c("geneID" = "ensembl_gene_id")) %>% + unique() + +# DTU results ---- + +# Load 2 step object from ISA +files <- list.files("results/ISA/", pattern = "pass2", recursive = T, full.names = T) +isa_df <- map_dfr(files, ~ { + load(.x) + SwitchList_2$isoformFeatures +}) + +# Conditions to filter results: +condition_1_male <- grepl("CTRL_male", isa_df$condition_1) +condition_2_male <- grepl("MDD_male", isa_df$condition_2) +condition_1_female <- grepl("CTRL_female", isa_df$condition_1) +condition_2_female <- grepl("MDD_female", isa_df$condition_2) + +isa_df <- isa_df[(condition_1_male & condition_2_male) | + (condition_1_female & condition_2_female),] + +# Organize df +isa_df %<>% + mutate(gene_id = gsub("\\.\\d+", "", gene_id), + isoform_id = gsub("\\.\\d+", "", isoform_id)) %>% + filter(isoform_switch_q_value <= 0.05) %>% + dplyr::select(isoform_id, gene_id, condition_1) %>% + inner_join( + tx2gene %>% dplyr::select(ensembl_transcript_id, ensembl_gene_id) %>% unique(), + by = c("isoform_id" = "ensembl_transcript_id") + ) %>% + mutate(condition_1 = gsub("_CTRL", "", condition_1)) %>% + dplyr::select(gene = ensembl_gene_id, tx = isoform_id, hgnc_symbol = gene_id, group = condition_1) %>% + unique() + +# Filter out transcripts that were identified as outliers by ppcseq analysis ---- + +load("results/diff_exp/outliers_samples_dte.rda") +isa_df %<>% anti_join(outliers_samples_dte, by = "tx") + +# Combine all 3 analyses -------------------------------------------------- + +dge <- df_res_padj_gene_out_filtered %>% + dplyr::select(gene, hgnc_symbol, group) %>% + unique() %>% + mutate(type = "DGE") +dte <- df_res_padj_tx_out_filtered %>% + dplyr::select(gene = geneID, hgnc_symbol, group) %>% + unique() %>% + mutate(type = "DTE") +dtu <- isa_df %>% + dplyr::select(gene, hgnc_symbol, group) %>% + unique() %>% + mutate(type = "DTU") + +# Main dataframe used in downstream analysis +diff_df <- purrr::reduce(list(dge, dte, dtu), bind_rows) + +# Function to count genes in each analysis +count_genes <- function(diff_df, col_filter = "type", col_value, by, id) { + + diff_df %>% + dplyr::filter(.data[[col_filter]] == col_value) %>% + dplyr::select({{id}}, {{by}}) %>% + unique() %>% + group_by(.data[[by]]) %>% + summarise(n_genes = n()) + +} + +# Number of altered genes in each analysis +count_genes(diff_df, col_filter = "type", col_value = "DGE", by = "group", id = "gene") +count_genes(diff_df, col_filter = "type", col_value = "DTE", by = "group", id = "gene") +count_genes(diff_df, col_filter = "type", col_value = "DTU", by = "group", id = "gene") + +# Number of genes in each analysis +diff_df %>% + dplyr::select(type, gene) %>% + unique() %>% + dplyr::count(type) + +save(diff_df, file = "results/diff_exp/diff_df.rda") + + diff --git a/scripts/tx_gene.R b/scripts/tx_gene.R new file mode 100644 index 0000000..44a6d6a --- /dev/null +++ b/scripts/tx_gene.R @@ -0,0 +1,36 @@ + +# Read and summarise transcript to gene level ----------------------------- + +library(tximport) +library(GenomicFeatures) + +# Load annotation +load("results/important_variables/ann.rda") + +# Load counts from kallisto ----------------------------------------------- +gtf <- "data/genome/Homo_sapiens.GRCh38.97.gtf.gz" +txdb.filename <- "data/genome/Homo_sapiens.GRCh38.97.gtf.sqlite" + +if(!("Homo_sapiens.GRCh38.97.gtf.sqlite" %in% list.files("data/genome"))) { + txdb <- makeTxDbFromGFF(gtf, format = "gtf") + saveDb(txdb, txdb.filename) +} + +# Load db +txdb <- loadDb(txdb.filename) +txdf <- AnnotationDbi::select(txdb, keys(txdb, "GENEID"), "TXNAME", "GENEID") +tab <- table(txdf$GENEID) +txdf$ntx <- tab[match(txdf$GENEID, names(tab))] +tx2gene <- data.frame(tx = txdf$TXNAME, gene = txdf$GENEID, stringsAsFactors = F) + +# Read files +files <- list.files(path = "data/kallisto", pattern="tsv", recursive = TRUE, full.names = TRUE) +files <- files[sapply(rownames(ann), function(x) grep(x, files))] +names(files) <- rownames(ann) +txi <- tximport(files = files, type = "kallisto", tx2gene = tx2gene, ignoreTxVersion = T) + +# Save +if(!dir.exists("results/txi")) { + dir.create("results/txi") +} +save(txi, file = "results/txi/txi_gene.rda") diff --git a/scripts/tx_tx.R b/scripts/tx_tx.R new file mode 100644 index 0000000..049e46a --- /dev/null +++ b/scripts/tx_tx.R @@ -0,0 +1,21 @@ + +# Read transcript counts -------------------------------------------------- + +library(tximport) + +# Load annotation +load("results/important_variables/ann.rda") + +# Load counts from kallisto ----------------------------------------------- + +# Read files +files <- list.files(path = "data/kallisto/", pattern="tsv", recursive = TRUE, full.names = TRUE) +files <- files[sapply(rownames(ann), function(x) grep(x, files))] +names(files) <- rownames(ann) +txi <- tximport(files = files, type = "kallisto", txOut = T) + +# Save +if(!dir.exists("results/txi")) { + dir.create("results/txi") +} +save(txi, file = "results/txi/txi_tx.rda")