-
Notifications
You must be signed in to change notification settings - Fork 0
Recording/displaying metadata with EMMA #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
94 commits
Select commit
Hold shift + click to select a range
28e090d
update description file
NajlaAbassi 18696db
update the main function EMMA_run
NajlaAbassi 2b3ea7f
update the functions EMMA_show, EMMA_freeze and EMMA_explain with pro…
NajlaAbassi e5ea209
update man
NajlaAbassi ef2b2d3
update namespace
NajlaAbassi f500394
add example data
NajlaAbassi 50cb3ed
add helper functions to capture metadata base on the call passed to E…
NajlaAbassi 1c4eef1
setup tests
NajlaAbassi 52cdd99
update vignette
NajlaAbassi 78bb115
add getEMMARecord to fetch the captured info from the attr (in raw st…
NajlaAbassi ca71983
fix the printing of the call in EMMA_show()
NajlaAbassi 8b03865
add news
NajlaAbassi a52d979
fix typo in man page
NajlaAbassi 9e54d5d
update description
NajlaAbassi cf184b0
add returned value by EMMA_show
NajlaAbassi b85ee3b
adding more tests
NajlaAbassi 1bb2682
add more tests
NajlaAbassi 8eadb42
update vignette to reflect the state/content of the package
NajlaAbassi 5078c9e
update workflow
NajlaAbassi c74d859
update description with pkg for vignettes and tests
NajlaAbassi 7d1d8ec
initial implementation of EMMA_explain
NajlaAbassi 8644053
update documentation
NajlaAbassi 2fe47a2
remove the dot for all unexported functions
NajlaAbassi 7ed84e5
add more tests
NajlaAbassi 896add0
update vignette
NajlaAbassi 04bc8f5
fixing the odd implementation of EMMA_build_record
NajlaAbassi 77234d2
updating documentation
NajlaAbassi 3e9441f
add code to EMMA_explain
NajlaAbassi 1ad7ee3
update pkg version
NajlaAbassi 9ec20d8
add news
NajlaAbassi 5cf683c
update readme
NajlaAbassi f8dd505
update EMMA_show
NajlaAbassi b7ab703
update getEMMARecord
NajlaAbassi 98d2130
add EMMA_add_custom_metadata to give the user possibility to modify t…
NajlaAbassi 136d4d6
update man
NajlaAbassi 0ff0442
update namespace
NajlaAbassi 075eb80
adding tests
NajlaAbassi 3947e09
update vignette
NajlaAbassi 0e1718a
updating EMMA_run to handle wrappers/custom functions
NajlaAbassi 848c99d
typos fixed
federicomarini c8dd29a
spacing in the examples
federicomarini ee0455a
suppress all messages in setup of tests
federicomarini 44f92df
update build ignore
NajlaAbassi 2349b55
update description file
NajlaAbassi cc8d933
update man page
NajlaAbassi 91064d2
expending vignette
NajlaAbassi 5cfe8f2
adding toy fea created with EMMA_run
NajlaAbassi 61cf847
beautify msgs with cli
NajlaAbassi f57080f
upding the internal functions nomenclature to use the dot before the …
NajlaAbassi 7812a81
updating tests
NajlaAbassi 55d9841
remove unused pkg from import
NajlaAbassi 0cb4185
update pkg version
NajlaAbassi b0718a6
update example data
NajlaAbassi 9b7d274
fix EMMA_show to display the number of pathways/FEAs correctly, and u…
NajlaAbassi 3a31b23
rename getEMMARecord to EMMA_get_record
NajlaAbassi a9f5be9
updating documentation, arg names, and example for EMMA_run
NajlaAbassi d47c5ad
add EMMA_freeze
NajlaAbassi 3d8f2db
update EMMA_explain to return also citation
NajlaAbassi 2d2eeb8
update example and fun name
NajlaAbassi 7b8b76c
update namespace
NajlaAbassi 32a0543
update the news
NajlaAbassi df6d1cb
fix conflicts
NajlaAbassi 864dd6b
adding minimal pkgdown yaml
NajlaAbassi 3ad1685
minimal fixes on the indentation
federicomarini b9ecd18
removing the extra links
federicomarini 3b595bd
adding citation to DeeDeeExp
federicomarini 098175b
bibtex updated
federicomarini c614baf
some styling for pkgdown landing page added
federicomarini 2df7bdd
fixed the spot with correct citation
federicomarini 6f1e4f9
structuring a bit differently the vignette
federicomarini 33c3afe
scollout & smaller css tricks are in
federicomarini 49a3014
remove "redundancy" in doi + cit + links
federicomarini c4fca5b
update title in the README
federicomarini 5222d39
updating the readme content
NajlaAbassi 0059c90
Merge branch 'EMMAResult' of github.com:imbeimainz/EMMA into EMMAResult
NajlaAbassi ca9df8b
updating the code of conduct
NajlaAbassi dacaff2
adding bg genes for the first example and remove it from the second
NajlaAbassi ba994b5
updating internal documentation
NajlaAbassi 627ba5d
adding more tests
NajlaAbassi 17e6758
adding workflow figure and updating vignette
NajlaAbassi 3ecb343
adding reference to tidylog and omicslog
NajlaAbassi 18a9a77
removing unecessary installations from gha yaml
NajlaAbassi f5e8873
update the universe data name and fix comments
NajlaAbassi 4f7d289
update EMMA figure
NajlaAbassi 6dcf8f9
add indentation in examples
NajlaAbassi 84b2a23
updating the news before submission
NajlaAbassi dca216c
adding the current supported functions ... we can update it further w…
NajlaAbassi e35c6c8
update man page
NajlaAbassi 808656d
update examples and tests to match the universe new name
NajlaAbassi 723f28c
add supported methods and future extensions section
NajlaAbassi e58c66b
update version
NajlaAbassi 11bb212
fix spaces in EMMA_show()
NajlaAbassi d1cb7f9
update tests
NajlaAbassi 73983e5
add workflow example with lapply in the vignette
NajlaAbassi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,3 +7,5 @@ | |
| ^_pkgdown\.yml$ | ||
| ^docs$ | ||
| ^pkgdown$ | ||
| ^\.positai$ | ||
| ^\.claude$ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,28 +1,146 @@ | ||
| # Workflow derived from https://github.com/r-lib/actions/tree/master/examples | ||
| # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | ||
| on: | ||
| push: | ||
| branches: [main, master] | ||
| pull_request: | ||
| branches: [main, master] | ||
| branches: | ||
| - devel | ||
| schedule: | ||
| - cron: '0 8 * * 5' | ||
|
|
||
| name: R-CMD-check | ||
|
|
||
| jobs: | ||
| R-CMD-check: | ||
| runs-on: ubuntu-latest | ||
| runs-on: ${{ matrix.config.os }} | ||
| container: ${{ matrix.config.image }} | ||
|
|
||
| name: ${{ matrix.config.os }} (${{ matrix.config.bioc }} - ${{ matrix.config.image }}) | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| config: | ||
| - { os: windows-latest, bioc: 'devel'} | ||
| - { os: macOS-latest, bioc: 'devel', curlConfigPath: '/usr/bin/'} | ||
| - { os: ubuntu-latest, bioc: 'devel'} | ||
| # - { os: ubuntu-latest, bioc: 'devel', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"} | ||
| - { os: ubuntu-latest, image: 'bioconductor/bioconductor_docker:devel'} | ||
|
|
||
| env: | ||
| R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | ||
| CRAN: ${{ matrix.config.cran }} | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
| R_KEEP_PKG_SOURCE: yes | ||
| CURL_CONFIG: ${{ matrix.config.curlConfigPath }}curl-config | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Check out repo | ||
| uses: actions/checkout@v2 | ||
|
|
||
| - uses: r-lib/actions/setup-r@v1 | ||
| - name: Set up R and install BiocManager | ||
| uses: grimbough/bioc-actions/setup-bioc@v1 | ||
| if: matrix.config.image == null | ||
| with: | ||
| use-public-rspm: true | ||
| bioc-version: ${{ matrix.config.bioc }} | ||
|
|
||
| - name: Set up pandoc | ||
| uses: r-lib/actions/setup-pandoc@v2 | ||
| if: matrix.config.image == null | ||
|
|
||
| - name: Install remotes | ||
| run: | | ||
| install.packages('remotes') | ||
| shell: Rscript {0} | ||
|
|
||
| - uses: r-lib/actions/setup-r-dependencies@v1 | ||
| - name: Query dependencies | ||
| run: | | ||
| saveRDS(remotes::dev_package_deps(dependencies = TRUE, repos = c(getOption('repos'), BiocManager::repositories())), 'depends.Rds', version = 2) | ||
| shell: Rscript {0} | ||
|
|
||
| - name: Cache R packages | ||
| if: runner.os != 'Windows' && matrix.config.image == null | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ${{ env.R_LIBS_USER }} | ||
| key: ${{ runner.os }}-bioc-${{ matrix.config.bioc }}-${{ hashFiles('depends.Rds') }} | ||
| restore-keys: ${{ runner.os }}-bioc-${{ matrix.config.bioc }}- | ||
|
|
||
| - name: Install system dependencies | ||
| if: runner.os == 'Linux' | ||
| env: | ||
| RHUB_PLATFORM: linux-x86_64-ubuntu-gcc | ||
| uses: r-lib/actions/setup-r-dependencies@v2 | ||
| with: | ||
| extra-packages: rcmdcheck | ||
| extra-packages: any::rcmdcheck | ||
| pak-version: devel | ||
|
|
||
| - name: Install system dependencies (macOS) | ||
| if: runner.os == 'macOS' | ||
| run: | | ||
| brew install cairo | ||
| brew install --cask xquartz | ||
| brew install harfbuzz | ||
| brew install fribidi | ||
| brew install fftw | ||
|
|
||
| # - name: Set up gfortran symlinks (macOS) | ||
| # if: runner.os == 'macOS' | ||
| # run: | | ||
| # set -x | ||
| # sudo ln -s /usr/local/Cellar/gcc@11/*/lib/gcc/11 /usr/local/gfortran/lib | ||
| # gfortran --version | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| local_deps <- remotes::local_package_deps(dependencies = TRUE) | ||
| deps <- remotes::dev_package_deps(dependencies = TRUE, repos = BiocManager::repositories()) | ||
| BiocManager::install(local_deps[local_deps %in% deps$package[deps$diff != 0]], Ncpu = 2L) | ||
| remotes::install_cran('rcmdcheck', Ncpu = 2L) | ||
| shell: Rscript {0} | ||
|
|
||
| - name: Session info | ||
| run: | | ||
| options(width = 100) | ||
| pkgs <- installed.packages()[, "Package"] | ||
| sessioninfo::session_info(pkgs, include_base = TRUE) | ||
| shell: Rscript {0} | ||
|
|
||
| - name: Build, Install, Check | ||
| uses: grimbough/bioc-actions/build-install-check@v1 | ||
|
|
||
| - name: Run BiocCheck | ||
| uses: grimbough/bioc-actions/run-BiocCheck@v1 | ||
| with: | ||
| arguments: '--no-check-bioc-views --no-check-bioc-help' | ||
| error-on: 'error' | ||
|
|
||
| # - name: Upload check results | ||
| # if: failure() | ||
| # uses: actions/upload-artifact@master | ||
| # with: | ||
| # name: ${{ runner.os }}-r${{ matrix.config.r }}-results | ||
| # path: check | ||
|
|
||
| - name: Show testthat output | ||
| if: always() | ||
| run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true | ||
| shell: bash | ||
|
|
||
| - name: Upload check results | ||
| if: failure() | ||
| uses: actions/upload-artifact@master | ||
| with: | ||
| name: ${{ runner.os }}-bioc-${{ matrix.config.bioc }}-results | ||
| path: check | ||
|
|
||
| - name: Test coverage | ||
| if: matrix.config.os == 'macOS-latest' | ||
| run: | | ||
| install.packages("covr") | ||
| covr::codecov(token = "${{secrets.CODECOV_TOKEN}}") | ||
| shell: Rscript {0} | ||
|
|
||
| - uses: r-lib/actions/check-r-package@v1 | ||
| - name: Deploy | ||
| if: github.event_name == 'push' && github.ref == 'refs/heads/devel' && matrix.config.os == 'macOS-latest' | ||
| run: | | ||
| R CMD INSTALL . | ||
| Rscript -e "remotes::install_dev('pkgdown'); pkgdown::deploy_to_branch(new_process = FALSE)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,12 @@ | ||
| # Generated by roxygen2: do not edit by hand | ||
|
|
||
| export(EMMA_add_custom_metadata) | ||
| export(EMMA_explain) | ||
| export(EMMA_freeze) | ||
| export(EMMA_get_record) | ||
| export(EMMA_run) | ||
| export(EMMA_show) | ||
| importFrom(AnnotationDbi,metadata) | ||
| importFrom(cli,cli_alert_info) | ||
| importFrom(utils,packageVersion) | ||
| importFrom(utils,sessionInfo) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| #' A sample `data.frame` containing Differential Expression Analysis, generated | ||
| #' with `DESeq2` | ||
| #' | ||
| #' @details This `data.frame` object contains the results of a Differential | ||
| #' Expression Analysis performed on data from the `macrophage` package, more | ||
| #' precisely contrasting the counts from naive macrophage to those associated | ||
| #' with IFNg. | ||
| #' | ||
| #' The code to create said object can be found in the folder `/inst/scripts` in | ||
| #' the EMMA package, the file is called `create_datasets_examples.R`. | ||
| #' | ||
| #' @return A sample `data.frame` object, extracted from `DESeq2` results | ||
| #' | ||
| #' @format A `data.frame` object | ||
| #' | ||
| #' @references Alasoo, et al. "Shared genetic effects on chromatin and gene | ||
| #' expression indicate a role for enhancer priming in immune response", | ||
| #' Nature Genetics, January 2018 doi: 10.1038/s41588-018-0046-7. | ||
| #' | ||
| #' @name de_res_IFNg_vs_naive | ||
| #' @docType data | ||
| NULL | ||
|
|
||
| #' A sample `character vector` containing the background gene list used to | ||
| #' perform FEA on the `macrophage` dataset | ||
| #' | ||
| #' @details This `character vector` object contains the assay's `rownames` | ||
| #' of the `macrophage` data | ||
| #' | ||
| #' The code to create said object can be found in the folder `/inst/scripts` in | ||
| #' the EMMA package, the file is called `create_datasets_examples.R`. | ||
| #' | ||
| #' @return A sample `character vector` containing the assay's `rownames` | ||
| #' of the `macrophage` data | ||
| #' | ||
| #' @format A `character vector` | ||
| #' | ||
| #' | ||
| #' @references Alasoo, et al. "Shared genetic effects on chromatin and gene | ||
| #' expression indicate a role for enhancer priming in immune response", | ||
| #' Nature Genetics, January 2018 doi: 10.1038/s41588-018-0046-7. | ||
| #' | ||
| #' @name gene_universe | ||
| #' @docType data | ||
| NULL | ||
|
|
||
| #' A sample `list` containing Functional Enrichment Analysis results, | ||
| #' generated with `gprofiler2` | ||
| #' | ||
| #' @details This `list` object contains the result table and metadata of the | ||
| #' functional enrichment analysis (FEA) performed on the `macrophage` data, | ||
| #' specifically using the `gost()` function from the `gprofiler2` package, and | ||
| #' wrapped in `EMMA_run()` | ||
| #' | ||
| #' The code to create said object can be found in the folder `/inst/scripts` in | ||
| #' the EMMA package, the file is called `create_datasets_examples.R`. | ||
| #' | ||
| #' @return A sample `list` containing the FEA results `result` and `metadata`. | ||
| #' This results object has the `EMMA_record` attribute. | ||
| #' | ||
| #' @format A `list` | ||
| #' | ||
| #' | ||
| #' @references Alasoo, et al. "Shared genetic effects on chromatin and gene | ||
| #' expression indicate a role for enhancer priming in immune response", | ||
| #' Nature Genetics, January 2018 doi: 10.1038/s41588-018-0046-7. | ||
| #' | ||
| #' @name fea_res | ||
| #' @docType data | ||
| NULL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,8 +3,9 @@ | |
| #' EMMA stands for Enrichment Methods Matter. | ||
| #' And EMMA stands to help you in realizing it. | ||
| #' | ||
| #' | ||
| #' @importFrom utils packageVersion | ||
| #' @importFrom AnnotationDbi metadata | ||
| #' @importFrom utils packageVersion sessionInfo | ||
| #' @importFrom cli cli_alert_info | ||
|
Comment on lines
+6
to
+8
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. clean, compact, neat! |
||
| #' @name EMMA-pkg | ||
| #' @docType package | ||
| "_PACKAGE" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| #' EMMA_add_custom_metadata | ||
| #' | ||
| #' Append or replace the `extra` field in the `EMMA_record` attribute | ||
| #' of a result object returned by `EMMA_run()`. This allows users to manually | ||
| #' provide additional annotation or contextual information that could not be | ||
| #' captured automatically | ||
| #' | ||
| #' @param res A functional enrichment analysis results object as returned by | ||
| #' `EMMA_run()` | ||
| #' @param extra A named list of user-defined metadata elements to store in | ||
| #' the `extra` field | ||
| #' | ||
| #' @returns The input result object with updated `EMMA_record` attribute | ||
| #' @export | ||
| #' | ||
| #' @examples | ||
| #' data("fea_res", package = "EMMA") | ||
| #' fea_res <- EMMA_add_custom_metadata(fea_res, extra = | ||
| #' list(note = "The background gene set list was all expressed genes in the assay")) | ||
| EMMA_add_custom_metadata <- function(res, | ||
| extra = list()) { | ||
|
|
||
| if (!is.list(extra)) { | ||
| stop("`extra` must be a list!") | ||
| } | ||
|
|
||
| if (length(extra) > 0L && is.null(names(extra))) { | ||
| stop("`extra` must be a named list!") | ||
| } | ||
|
|
||
| emma_rec <- EMMA_get_record(res = res) | ||
|
|
||
| emma_rec$extra <- extra | ||
|
|
||
| # update | ||
| attr(res, "EMMA_record") <- emma_rec | ||
|
|
||
| return(res) | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.