Skip to content
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

Dev #131

Merged
merged 73 commits into from
Jul 18, 2024
Merged

Dev #131

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
fdcb941
Merge pull request #82 from FertigLab/dev
jmitchell81 Feb 5, 2024
56bba96
removal of pkgdown files
jmitchell81 Feb 5, 2024
c81d091
update files
actions-user May 9, 2024
e95fbba
manual update from master
jmitchell81 May 9, 2024
94ed4f2
Merge branch 'master' into bioconductor
jmitchell81 May 20, 2024
f873189
remove pkgdown documentation from master merge
jmitchell81 May 20, 2024
9572eba
Merge branch 'master' into bioconductor
jmitchell81 May 20, 2024
b112ea4
move data from sysdata.rda to data/
dimalvovs Jun 20, 2024
a0928b6
rework examples
dimalvovs Jun 22, 2024
e5ccbce
rm *_alt and dom_ls_tiny as not needed anymore
dimalvovs Jun 22, 2024
ca9400e
rm tiny_differential_linkage_c2 as it was not used
dimalvovs Jun 22, 2024
8af93ff
move differential_linkages from tiny data to examples
dimalvovs Jun 22, 2024
8247f1e
fix convenience_fxns tests
dimalvovs Jun 22, 2024
175890b
move linkage_summary to mock fun
dimalvovs Jun 22, 2024
bf24a0f
fully remove mockdata
dimalvovs Jun 22, 2024
f8e44b0
bugfix mock_linkage_summary
dimalvovs Jun 23, 2024
3a37324
fixing broken links and other rmarkdown rendering issues
kjkrishnan Jun 25, 2024
064f9b8
adding ... argument documentation to print method
kjkrishnan Jun 25, 2024
840d468
updating links for reference file and fixing versioning
kjkrishnan Jun 25, 2024
8130d79
Update documentation
kjkrishnan Jun 25, 2024
5bf6447
Merge pull request #127 from FertigLab/krishnan_rmd_fix_134
jmitchell81 Jun 25, 2024
a561d77
merge pkgdown changes
dimalvovs Jul 1, 2024
4c6f1ad
make mocker fun not internal
dimalvovs Jul 1, 2024
0b1ec6c
adjust test data for test-import_fxns.R
dimalvovs Jul 1, 2024
ecf48bb
add separate regression tests
dimalvovs Jul 1, 2024
36df44a
rm the redundant test
dimalvovs Jul 1, 2024
cf27467
bump version
dimalvovs Jul 1, 2024
190b731
restore github actions
jmitchell81 Jul 1, 2024
389578b
restore nojekyll
jmitchell81 Jul 1, 2024
f0cfd99
restore articles
jmitchell81 Jul 1, 2024
45e81fc
restore docs
jmitchell81 Jul 1, 2024
a4a09dd
restore news
jmitchell81 Jul 1, 2024
c0305b3
restore pkgdown
jmitchell81 Jul 1, 2024
55e7bc3
restore reference
jmitchell81 Jul 1, 2024
8433b22
rerun devtool document
jmitchell81 Jul 1, 2024
80b5cb0
remove extranious Rd files
jmitchell81 Jul 1, 2024
23e4368
add data docs back
dimalvovs Jul 2, 2024
95a9490
add @usage header to try fix check
dimalvovs Jul 2, 2024
b577a50
Merge pull request #128 from FertigLab/123-triple-col-is-bad-for-exam…
jmitchell81 Jul 2, 2024
da461df
export testing data
jmitchell81 Jul 2, 2024
fa0906f
Revert "export testing data"
jmitchell81 Jul 2, 2024
8a0f52f
internal data objects
jmitchell81 Jul 3, 2024
7502381
keywords internal tag
jmitchell81 Jul 3, 2024
9109e4e
Update documentation
jmitchell81 Jul 3, 2024
463f5ab
revert internal keywords
jmitchell81 Jul 3, 2024
edb41c0
Merge branch 'testdata_in_pkgdown_yml' of https://github.com/FertigLa…
jmitchell81 Jul 3, 2024
e2db2ab
Update documentation
jmitchell81 Jul 3, 2024
e8a3f12
pkgdown_yml topics for internal test function
jmitchell81 Jul 3, 2024
ce95ef3
Merge branch 'testdata_in_pkgdown_yml' of https://github.com/FertigLa…
jmitchell81 Jul 3, 2024
e515e6e
dedicated data section in pkgdown references
jmitchell81 Jul 3, 2024
e42fc50
spelling mistake in issues URL
jmitchell81 Jul 3, 2024
39bbcc3
summarize_linkage example cluster assignment
jmitchell81 Jul 3, 2024
43d0a34
Update documentation
jmitchell81 Jul 3, 2024
9473fa9
Update summarize_linkages.Rd
jmitchell81 Jul 3, 2024
5ccff39
Merge branch 'testdata_in_pkgdown_yml' of https://github.com/FertigLa…
jmitchell81 Jul 3, 2024
2bc835a
Merge pull request #129 from FertigLab/testdata_in_pkgdown_yml
jmitchell81 Jul 9, 2024
46f5fdb
news update for vignettes and testing data
jmitchell81 Jul 9, 2024
a5ad633
non-list tf_targets as message
jmitchell81 Jul 10, 2024
57cf606
exact=FALSE cor test
jmitchell81 Jul 10, 2024
c7e4b40
remove redundant data call in test
jmitchell81 Jul 10, 2024
3463f73
Disable example echoes
jmitchell81 Jul 10, 2024
2c16ae4
document silenced examples
jmitchell81 Jul 10, 2024
2f5adb4
Merge branch 'v0_99_3_news_update' into minimize_domino_create_warnings
jmitchell81 Jul 10, 2024
80fb6d4
update news
jmitchell81 Jul 10, 2024
21b358b
Merge pull request #130 from FertigLab/minimize_domino_create_warnings
jmitchell81 Jul 16, 2024
4497b44
eexample plot parameters
jmitchell81 Jul 17, 2024
ff8331f
test example verbose toggle
jmitchell81 Jul 17, 2024
9fb1ddd
Update documentation
jmitchell81 Jul 17, 2024
766eb57
revert verbose false
jmitchell81 Jul 17, 2024
7d237ef
disable verbose create_domino example
jmitchell81 Jul 17, 2024
35930aa
circos example colors
jmitchell81 Jul 17, 2024
720829a
do not expect dom_clusters to return a factor
jmitchell81 Jul 17, 2024
dd974de
Update NEWS.md
jmitchell81 Jul 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 13 additions & 15 deletions .github/copy_to_branch.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# Designate desired directories and files
FILES=(
'data-raw/'*
'man/'*
'R/'*
'tests/'*
'vignettes/'*
'DESCRIPTION'
'NAMESPACE'
'NEWS.md'
'README.md'
'inst/CITATION'
)
SRC_FOLDER_PATHS=(data-raw man R tests vignettes)
SRC_FILE_PATHS=(DESCRIPTION LICENSE NAMESPACE NEWS.md README.md inst/CITATION)

# Get files from directories
FILES=$(find "${SRC_FOLDER_PATHS[@]}" -type f)

# Add indicated individual files
for F in "${SRC_FILE_PATHS[@]}"
do
FILES+=" ${F}"
done

echo "${FILES[@]}"

Expand All @@ -22,9 +21,8 @@ git fetch
# Checkout target branch
git checkout $TARGET_BRANCH
# copy files from the branch the action is being run upon
for F in ${FILES}; do
git checkout $SRC_BRANCH -- ${F}
done
SRC_BRANCH=$(git symbolic-ref --short HEAD)
git checkout $SRC_BRANCH -- $FILES
# Commit to the repository (ignore if no changes)
git add -A
git diff-index --quiet HEAD || git commit -am "update files"
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/bioc_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
- uses: actions/checkout@v2
- name: copy
env:
SRC_BRANCH: 'master'
TARGET_BRANCH: 'bioconductor'
TARGET_BRANCH: 'master'
run: .github/copy_to_branch.sh
shell: bash
4 changes: 2 additions & 2 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand All @@ -41,7 +41,7 @@ jobs:

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.4.1
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
clean: false
branch: gh-pages
Expand Down
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: dominoSignal
Title: Cell Communication Analysis for Single Cell RNA Sequencing
Version: 0.99.2
Version: 0.99.3
Authors@R: c(
person("Christopher", "Cherry", role = c("aut"), email = "[email protected]", comment = c(ORCID = "0000-0002-5481-0055")),
person("Jacob T", "Mitchell", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0002-5370-9692")),
Expand All @@ -11,7 +11,7 @@ Authors@R: c(
person("Jennifer", "Elisseeff", role = "ctb", email = "[email protected]", comment = c(ORCID = "0000-0002-5066-1996"))
)
Description:
dominoSignal is a package developed to analyze cell signaling through ligand - receptor - transcription factor networks in scRNAseq data. It takes as input information transcriptomic data, requiring counts, z-scored counts, and cluster labels, as well as information on transcription factor activation (such as from SCENIC) and a database of ligand and receptor pairings (such as from cellphoneDB). This package creates an object storing ligand - receptor - transcription factor linkages by cluster and provides several methods for exploring, summarizing, and visualizing the analysis.
dominoSignal is a package developed to analyze cell signaling through ligand - receptor - transcription factor networks in scRNAseq data. It takes as input information transcriptomic data, requiring counts, z-scored counts, and cluster labels, as well as information on transcription factor activation (such as from SCENIC) and a database of ligand and receptor pairings (such as from CellPhoneDB). This package creates an object storing ligand - receptor - transcription factor linkages by cluster and provides several methods for exploring, summarizing, and visualizing the analysis.
BugReports: https://github.com/FertigLab/dominoSignal/issues
Depends:
R(>= 4.2.0),
Expand All @@ -31,7 +31,7 @@ Imports:
License: GPL-3 | file LICENSE
Encoding: UTF-8
LazyData: false
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
biocViews:
SystemsBiology,
SingleCell,
Expand Down
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export(feat_heatmap)
export(gene_network)
export(incoming_signaling_heatmap)
export(mean_ligand_expression)
export(mock_linkage_summary)
export(plot_differential_linkages)
export(rename_clusters)
export(signaling_heatmap)
Expand All @@ -32,6 +33,8 @@ export(summarize_linkages)
export(test_differential_linkages)
exportClasses(domino)
exportClasses(linkage_summary)
exportMethods(print)
exportMethods(show)
import(ComplexHeatmap)
import(biomaRt)
import(circlize)
Expand Down
34 changes: 28 additions & 6 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# dominoSignal v0.99.3

## create_domino Function Warnings

- Disabled exact p-value computation for the correlation test between receptor expression and features to prevent repeated warning messages due to tied ranks during Spearman correlation calculation

## Vignettes

- Updated non-functional links to functional URLs
- All vignettes explicitly state the seed used when executing their code
- The dominoSignal Object vignette states the purpose of the code used to download and import data from a BioFileCache to demonstrate applications of the domino objects on a real data object that is too large to include inside the package

## Testing Data

- Data used for examples and unit tests is now stored in the package's data/ directory.
- All usage of the triple colon operator to access internal data from sysdata have been replaced with usage of data()
- Linkage summaries for demonstrating differential linkage testing and plotting are generated within unit test scripts rather than being stored within the package.
- Examples are run with echo = FALSE to cut down on lines of code printed in example pages.
- Examples for create_domino are run with verbose = FALSE
- Fixed example of changing colors for circos_ligand_receptor
- Fixed example of boolean representation of cor_heatmap

# dominoSignal v0.99.2

## Package Name
Expand All @@ -6,9 +28,9 @@

## Bioconductor Standards

- Update to Vignettes presenting application of the DominoSignal pipeline on data formatted as a SingleCellExperiment object
- Update to vignettes presenting application of the DominoSignal pipeline on data formatted as a SingleCellExperiment object
- Implemented caching of example data by BiocCache to meet package size limits
- Removal of depreciated scripts for running SCENIC. Tutorials for running SCENIC are still present in vignettes
- Removal of deprecated scripts for running SCENIC. Tutorials for running SCENIC are still present in vignettes
- Corrected BiocCheck notes pertaining to coding practices including paste in conditional statements, functions with dontrun examples, usage of seq_len or seq_along in place of seq, and usage of vapply in place of sapply


Expand All @@ -24,17 +46,17 @@
- Plotting function for differential linkages

## Package structure
- Adjustments made to meet BioConductor standards
- Adjustments made to meet Bioconductor standards

# dominoSignal v0.2.1

## Updates to domino object construction
- Uniform formats for inputs of receptor-ligand interaction databases, transcription factor activity features, and regulon gene lists for operability with alternative databases and transcription factor activation inference methods
- Uniform formats for inputs of receptor - ligand interaction databases, transcription factor activity features, and regulon gene lists for operability with alternative databases and transcription factor activation inference methods
- Helper functions for reformatting pySCENIC outputs and CellPhoneDB database files to domino-readable uniform formats
- Assessment of transcription factor linkage with receptors that function as a heteromeric complex based on correlation between transcription factor activity and all receptor component genes
- Assessment of complex ligand expression as the mean of component gene expression for plotting functions
- Minimum threshold for the percentage of cells in a cluster expressing a receptor gene for the receptor to be called active within the cluster
- Additional linkage slots for active receptors in each cluster, transcription factor-receptor linkages for each cluster, and incoming ligands for active receptors on each cluster
- Additional linkage slots for active receptors in each cluster, transcription factor - receptor linkages for each cluster, and incoming ligands for active receptors on each cluster

## Plotting functions
- Chord plot of ligand expression targeting a specified receptor where chord widths correspond to the quantity of ligand expression by each cell cluster
Expand All @@ -43,7 +65,7 @@

## Bugfixes
- Added host option for gene ortholog conversions using `{biomaRt}` for access to maintained mirrors
- Transcription factor-target linkages are now properly stored so that receptors in a transcription factor's regulon are excluded from linkage
- Transcription factor - target linkages are now properly stored so that receptors in a transcription factor's regulon are excluded from linkage
- Ligand nodes sizes in gene networks correspond to quantity of ligand expression
- `create_domino()` can be run without providing a regulon list
- References to the host GitHub repository have been updated to [Elisseeff-Lab](https://github.com/Elisseeff-Lab/domino)
43 changes: 22 additions & 21 deletions R/class_definitions.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
#' @importClassesFrom Matrix dgCMatrix
#'
NULL
#' The domino Class
#' The domino class
#'
#' The domino class contains all information necessary to calculate receptor-ligand
#' signaling. It contains z-scored expression, cell cluster labels, feature values,
#' and a referenced receptor-ligand database formatted as a receptor-ligand map.
#' Calculated intermediate values are also stored.
#'
#' @slot db_info List of data sets from lr database.
#' @slot db_info List of data sets from ligand - receptor database
#' @slot counts Raw count gene expression data
#' @slot z_scores Matrix of z-scored expression data with cells as columns
#' @slot clusters Named factor with cluster identity of each cell
#' @slot features Matrix of features to correlate receptor-ligand expression with. Cells are columns and features are rows.
#' @slot features Matrix of features (TFs) to correlate receptor - ligand expression with. Cells are columns and features are rows.
#' @slot cor Correlation matrix of receptor expression to features.
#' @slot linkages List of lists containing info linking cluster->tf->rec->lig
#' @slot clust_de Data frame containing differential expression results for features by cluster.
Expand All @@ -23,7 +23,7 @@ NULL
#' @name domino-class
#' @rdname domino-class
#' @exportClass domino
#' @return an instance of class `domino `
#' @return An instance of class `domino `
#'
domino <- methods::setClass(
Class = "domino",
Expand Down Expand Up @@ -74,22 +74,24 @@ linkage_summary <- setClass(
#'
#' Prints a summary of a domino object
#'
#' @param x Domino object
#' @return a printed description of the number of cell clusters in the object
#' @keywords internal
#' @param x A domino object
#' @param ... Additional arguments to be passed to other methods
#' @return A printed description of the number of cells and clusters in the domino object
#' @export
#' @examples
#' print(dominoSignal:::pbmc_dom_built_tiny)
#'
#' example(build_domino, echo = FALSE)
#' print(pbmc_dom_built_tiny)
#'
setMethod("print", "domino", function(x, ...) {
if (x@misc$build) {
message(
"A domino object of ", length(x@clusters), " cells
Contains signaling between",
length(levels(x@clusters)), "clusters
Built with a maximum of", as.integer(x@misc$build_vars["max_tf_per_clust"]),
"TFs per cluster
and a maximum of", as.integer(x@misc$build_vars["max_rec_per_tf"]),
"receptors per TF\n"
Contains signaling between ",
length(levels(x@clusters)), " clusters
Built with a maximum of ", x@misc$build_vars["max_tf_per_clust"],
" TFs per cluster
and a maximum of ", x@misc$build_vars["max_rec_per_tf"],
" receptors per TF\n"
)
} else {
message(c("A domino object of ", length(x@clusters), " cells\n", "A signaling network has not been built\n"),
Expand All @@ -101,13 +103,12 @@ setMethod("print", "domino", function(x, ...) {
#'
#' Shows content overview of domino object
#'
#' @param object Domino object
#' @return a printed description of the number of cells in a domino object and its build status
#' @keywords internal
#' @param object A domino object
#' @return A printed description of cell numbers and clusters in the object
#' @export
#' @examples
#' dominoSignal:::pbmc_dom_built_tiny
#'
#' show(dominoSignal:::pbmc_dom_built_tiny)
#' example(build_domino, echo = FALSE)
#' show(pbmc_dom_built_tiny)
#'
setMethod("show", "domino", function(object) {
if (object@misc$build) {
Expand Down
31 changes: 13 additions & 18 deletions R/convenience_fxns.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,18 @@ NULL

#' Renames clusters in a domino object
#'
#' This function reads in a receptor ligand signaling database, cell level
#' features of some kind (ie. output from pySCENIC), z-scored single cell data,
#' and cluster id for single cell data, calculates a correlation matrix between
#' receptors and other features (this is transcription factor module scores if
#' using pySCENIC), and finds features enriched by cluster. It will return a
#' domino object prepared for [build_domino()], which will calculate a signaling
#' network.
#' This function renames the clusters used to build a domino object
#'
#' @param dom Domino object to rename clusters in
#' @param clust_conv Named vector of conversions from old to new clusters. Values are taken as new clusters IDs and names as old cluster IDs.
#' @param warning Logical. If TRUE, will warn if a cluster is not found in the conversion table. Default is FALSE.
#' @param dom a domino object to rename clusters in
#' @param clust_conv named vector of conversions from old to new clusters. Values are taken as new clusters IDs and names as old cluster IDs.
#' @param warning logical. If TRUE, will warn if a cluster is not found in the conversion table. Default is FALSE.
#' @return A domino object with clusters renamed in all applicable slots.
#' @export
#' @examples
#' example(build_domino, echo = FALSE)
#' new_clust <- c("CD8_T_cell" = "CD8+ T Cells",
#' "CD14_monocyte" = "CD14+ Monocytes", "B_cell" = "B Cells")
#' pbmc_dom_built_tiny <- rename_clusters(dominoSignal:::pbmc_dom_built_tiny, new_clust)
#' pbmc_dom_built_tiny <- rename_clusters(pbmc_dom_built_tiny, new_clust)
#'
rename_clusters <- function(dom, clust_conv, warning = FALSE) {
if (is.null(dom@clusters)) {
Expand Down Expand Up @@ -73,17 +68,17 @@ rename_clusters <- function(dom, clust_conv, warning = FALSE) {
}


#' Convert Genes Using Table
#' Convert genes using a table
#'
#' Takes a vector of gene inputs and a conversion table and returns a
#' Takes a vector of gene inputs and a conversion table and returns a
#' converted gene table
#'
#' @param genes The genes to convert.
#' @param from Gene symbol type of the input (ENSG, ENSMUSG, HGNC, MGI)
#' @param to Desired gene symbol type for the output (HGNC, MGI)
#' @param conversion_table A data.frame with column names corresponding to gene symbol types (mm.ens, hs.ens, mgi, hgnc)
#' @param genes the genes to convert
#' @param from gene symbol type of the input (ENSG, ENSMUSG, HGNC, MGI)
#' @param to desired gene symbol type for the output (HGNC, MGI)
#' @param conversion_table a data frame with column names corresponding to gene symbol types (mm.ens, hs.ens, mgi, hgnc)
#' and rows corresponding to the gene symbols themselves
#' @return Data frame of genes with original and corresponding converted symbols
#' @return A data frame of genes with original and corresponding converted symbols
#' @keywords internal
#'
table_convert_genes <- function(genes, from, to, conversion_table) {
Expand Down
47 changes: 47 additions & 0 deletions R/data.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#' SCENIC AUC subset
#'
#' A subset of SCENIC AUCs as applied to PBMC data.
#'
#' @format A list of:
#' \describe{
#' \item{auc_tiny}{A subset of SCENIC AUCs}
#' \item{regulons_tiny}{A subset of SCENIC regulons}
#' }
#'
#' @source <https://zenodo.org/records/10951634/files>
#' @usage data("SCENIC")
"SCENIC"


#' PBMC RNAseq data subset
#'
#' A subset of the results of PBMC RNA-seq data.
#'
#' @format A list of::
#' \describe{
#' \item{RNA_count_tiny}{A subset of PBMC RNA-seq data: counts assay}
#' \item{RNA_zscore_tiny}{A subset of PBMC RNA-seq data: zscore assay}
#' \item{clusters_tiny}{A subset of PBMC RNA-seq data: clusters as defined by cell_type}
#' }
#'
#' @source <https://zenodo.org/records/10951634/files/pbmc3k_sce.rds>
#' @usage data("PBMC")
"PBMC"


#' CellPhoneDB subset
#'
#' A list of four subsets of CellPhoneDB data.
#'
#'
#' @format A list of:
#' \describe{
#' \item{genes_tiny}{A subet of CellPhoneDB gene_input.csv}
#' \item{proteins_tiny}{A subset of CellPhoneDB protein_input.csv}
#' \item{complexes_tiny}{A subset of CellPhoneDB complex_input.csv}
#' \item{interactions_tiny}{A subset of CellPhoneDB interaction_input.csv}
#' }
#'
#' @source <https://github.com/ventolab/cellphonedb-data/archive/refs/tags/v4.0.0.tar.gz>
#' @usage data("CellPhoneDB")
"CellPhoneDB"
Loading
Loading