Skip to content

Commit

Permalink
Completed merge
Browse files Browse the repository at this point in the history
  • Loading branch information
ekatsevi committed Jan 30, 2025
2 parents 52b14c7 + 082a104 commit ef052ab
Show file tree
Hide file tree
Showing 283 changed files with 58,568 additions and 2,540 deletions.
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
64 changes: 64 additions & 0 deletions .github/workflows/check-standard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# 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: ['*'] # Run CI on all branches to allow pre-PR testing
pull_request:
branches: [main, dev]

name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v2

- name: Install system dependencies
run: |
if [[ "$RUNNER_OS" == "Linux" ]]; then
sudo apt-get update
sudo apt-get install -y build-essential libhdf5-dev libcurl4-openssl-dev libxml2-dev libssl-dev
elif [[ "$RUNNER_OS" == "macOS" ]]; then
brew update
brew install hdf5 curl libxml2 openssl
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.zshrc
else
echo "Unsupported OS: $RUNNER_OS"
exit 1
fi
- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- name: Install ondisc R package (macOS only)
if: ${{ matrix.config.os == 'macOS-latest' }}
run: |
Rscript -e "if (!requireNamespace('remotes', quietly = TRUE)) install.packages('remotes')"
Rscript -e "remotes::install_github('timothy-barry/ondisc')"
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: rcmdcheck

- uses: r-lib/actions/check-r-package@v2
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: sceptre
Title: Analysis of Single-Cell CRISPR Screen Data
Version: 0.10.0
Version: 0.10.2
Authors@R:
c(person(given = "Timothy",
family = "Barry",
Expand Down Expand Up @@ -39,15 +39,15 @@ Depends:
R (>= 4.1)
Suggests:
ondisc,
R.utils,
sessioninfo,
sceptredata,
rmarkdown,
knitr,
parallel,
testthat (>= 3.0.0),
magrittr,
MASS
Remotes: github::timothy-barry/ondisc, github::katsevich-lab/sceptredata
Remotes: github::timothy-barry/ondisc
VignetteBuilder: knitr
Config/testthat/edition: 3
URL: https://timothy-barry.github.io/sceptre-book/, https://github.com/Katsevich-Lab/sceptre
Expand Down
12 changes: 12 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# sceptre 0.10.2 (2025-01-17)

Version 0.10.2 is a minor update in which we replaced the larger, real example
data by smaller, simulated example data. Furthermore, the example data now live
in the `sceptre` package, rather than in the external `sceptredata` package.
Finally, the R-CMD-CHECK badge was restored on the website.

# sceptre 0.10.1 (2024-04-30)

Version 0.10.1 includes minor updates to v0.10.0. A new gene position data frame
`gene_position_data_frame_grch37` was added.

# sceptre 0.10.0 (2024-04-02)

Version 0.10.0 is a major update to the `sceptre` package. This version provides support for the analysis of large-scale single-cell CRISPR screen data. It also includes several other, minor updates.
Expand Down
40 changes: 40 additions & 0 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,43 @@
#' @rdname gene_position_data_frame_grch38
#' @usage data(gene_position_data_frame_grch37)
"gene_position_data_frame_grch37"

#' Example high-MOI data
#'
#' The example high-MOI CRISPRi data are a small simulated dataset modeled on
#' that of "A genome-wide framework for mapping gene regulation via cellular
#' genetic screens" by Gasperini et al., 2019. These data contain perturbations
#' both of gene transcription start sites (TSSs) and enhancers, as well as non-
#' targeting perturbations.
#'
#' The example data are stored in a list containing the following components:
#' - `response_matrix`: the gene-by-cell expression matrix
#' - `grna_matrix`: the gRNA-by-cell expression matrix
#' - `extra_covariates`: a data frame containing a single column, `batch`, specifying the batch in which each cell was sequenced (`batch_1` or `batch_2`)
#' - `gene_names`: the human-readable name of each gene
#'
#' @usage data(highmoi_example_data)
"highmoi_example_data"

#' gRNA target data frame
#'
#' The gRNA target data frame corresponding to the example high MOI data. The data frame contains the columns `grna_id` (ID of an individual gRNA), `grna_target` (genomic target of the gRNA), `chr` (target chromosome), `start` (start coordinate of target location), and `end` (end coordinate of target location).
#' @usage data(grna_target_data_frame_highmoi)
"grna_target_data_frame_highmoi"

#' Example low-MOI data
#'
#' The example low-MOI data are a small simulated dataset modeled on that in the
#' paper "Characterizing the molecular regulation of inhibitory immune
#' checkpoints with multimodal single-cell screens" by Papalexi et al., 2021.
#' This dataset includes gene-targeting CRISPRko perturbations as well as non-
#' targeting perturbations.
#'
#' The example data are stored in a list containing four components:
#' - `response_matrix`: the gene-by-cell expression matrix
#' - `grna_matrix`: the gRNA-by-cell expression matrix
#' - `grna_target_data_frame`: a data frame containing the columns `grna_id` (ID of an individual gRNA) and `grna_target` (genomic target of the gRNA)
#' - `extra_covariates`: a data frame with a single column, `batch`, specifying the batch in which each cell was sequenced (`batch_1` or `batch_2`)
#'
#' @usage data(lowmoi_example_data)
"lowmoi_example_data"
3 changes: 1 addition & 2 deletions R/getters_and_setters.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#' @export
#' @examples
#' # 1. create a sceptre_object
#' library(sceptredata)
#'
#' data(highmoi_example_data)
#' data(grna_target_data_frame_highmoi)
#' sceptre_object <- import_data(
Expand Down Expand Up @@ -62,7 +62,6 @@ get_cell_covariates <- function(sceptre_object) {
#' @return a sparse logical matrix containing the gRNA-to-cell assignments
#' @export
#' @examples
#' library(sceptredata)
#' data(highmoi_example_data)
#' data(grna_target_data_frame_highmoi)
#' # import data
Expand Down
6 changes: 2 additions & 4 deletions R/import_functs.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#' @return an initialized `sceptre_object`
#' @export
#' @examples
#' library(sceptredata)
#' data("lowmoi_example_data")
#' # 1. initialize a standard sceptre_object from R objects
#' sceptre_object <- import_data(
Expand Down Expand Up @@ -142,10 +141,9 @@ import_data_use_ondisc <- function(response_matrix, grna_matrix, grna_target_dat
#' @return an initialized `sceptre_object`
#' @export
#' @examples
#' library(sceptredata)
#' data(grna_target_data_frame_highmoi)
#' directories <- paste0(
#' system.file("extdata", package = "sceptredata"),
#' system.file("extdata", package = "sceptre"),
#' "/highmoi_example/gem_group_", c(1, 2)
#' )
#'
Expand Down Expand Up @@ -372,7 +370,7 @@ import_data_from_cellranger_use_ondisc <- function(directories, moi, grna_target
#'
#' @examples
#' directory <- paste0(
#' system.file("extdata", package = "sceptredata"),
#' system.file("extdata", package = "sceptre"),
#' "/parse_example/"
#' )
#' gene_mat_fp <- paste0(directory, "gene_mat.mtx")
Expand Down
1 change: 0 additions & 1 deletion R/ondisc_functs.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#' @return `write_ondisc_backed_sceptre_object()` returns NULL, and `read_ondisc_backed_sceptre_object()` returns an `ondisc`-backed `sceptre_object`
#' @export
#' @examples
#' library(sceptredata)
#' data(lowmoi_example_data)
#' # 1. create ondisc-backed sceptre_object
#' sceptre_object <- import_data(
Expand Down
3 changes: 0 additions & 3 deletions R/pair_constructor_functs.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#' @return a data frame with columns `grna_target` and `response_id` containing the *cis* pairs
#' @export
#' @examples
#' library(sceptredata)
#' data(highmoi_example_data)
#' data(grna_target_data_frame_highmoi)
#' # import data
Expand Down Expand Up @@ -91,7 +90,6 @@ construct_cis_pairs <- function(sceptre_object, positive_control_pairs = data.fr
#' @return a data frame with columns `grna_target` and `response_id` containing the *trans* discovery set
#' @export
#' @examples
#' library(sceptredata)
#' # 1. low-moi, gene-targeting screen
#' data("lowmoi_example_data")
#' sceptre_object <- import_data(
Expand Down Expand Up @@ -158,7 +156,6 @@ construct_trans_pairs <- function(sceptre_object, positive_control_pairs = data.
#' @return a data frame with columns `grna_target` and `response_id` containing the positive control pairs
#' @export
#' @examples
#' library(sceptredata)
#' data(highmoi_example_data)
#' data(grna_target_data_frame_highmoi)
#' # import data
Expand Down
12 changes: 2 additions & 10 deletions R/plotting_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ get_my_theme <- function(element_text_size = 11) {
#' @return a single \code{ggplot2} plot
#' @export
#' @examples
#' library(sceptredata)
#' data(highmoi_example_data)
#' data(grna_target_data_frame_highmoi)
#' import_data(
Expand Down Expand Up @@ -148,7 +147,6 @@ plot_grna_count_distributions <- function(sceptre_object, n_grnas_to_plot = 4L,
#' @return a single \code{cowplot} object containing the combined panels (if \code{return_indiv_plots} is set to \code{TRUE}) or a list of the individual panels (if \code{return_indiv_plots} is set to \code{FALSE})
#' @export
#' @examples
#' library(sceptredata)
#' data(highmoi_example_data)
#' data(grna_target_data_frame_highmoi)
#' import_data(
Expand Down Expand Up @@ -298,7 +296,6 @@ plot_assign_grnas <- function(sceptre_object, n_grnas_to_plot = 3L, grnas_to_plo
#' @export
#'
#' @examples
#' library(sceptredata)
#' data(highmoi_example_data)
#' data(grna_target_data_frame_highmoi)
#' # import data
Expand Down Expand Up @@ -496,7 +493,6 @@ make_volcano_plot <- function(discovery_result, p_thresh, x_limits = c(-1.5, 1.5
#'
#' @export
#' @examples
#' library(sceptredata)
#' data(highmoi_example_data)
#' data(grna_target_data_frame_highmoi)
#' # import data
Expand Down Expand Up @@ -611,7 +607,6 @@ plot_run_discovery_analysis <- function(sceptre_object, x_limits = c(-1.5, 1.5),
#' @return a single \code{cowplot} object containing the combined panels (if \code{return_indiv_plots} is set to \code{TRUE}) or a list of the individual panels (if \code{return_indiv_plots} is set to \code{FALSE})
#' @export
#' @examples
#' library(sceptredata)
#' data(highmoi_example_data)
#' data(grna_target_data_frame_highmoi)
#' import_data(
Expand Down Expand Up @@ -685,7 +680,6 @@ plot_covariates <- function(sceptre_object,
#'
#' @export
#' @examples
#' library(sceptredata)
#' data(highmoi_example_data)
#' data(grna_target_data_frame_highmoi)
#' # import data
Expand Down Expand Up @@ -808,7 +802,6 @@ plot_pairwise_qc <- function(sceptre_object, downsample_pairs = 10000L, point_si
#' @return a single \code{ggplot2} plot
#' @export
#' @examples
#' library(sceptredata)
#' data(highmoi_example_data)
#' data(grna_target_data_frame_highmoi)
#' # import data
Expand Down Expand Up @@ -904,7 +897,6 @@ downsample_result_data_frame <- function(result_df, downsample_pairs = 1000) {
#' @return a violin plot
#' @export
#' @examples
#' library(sceptredata)
#' data(highmoi_example_data)
#' data(grna_target_data_frame_highmoi)
#' # import data
Expand All @@ -930,8 +922,8 @@ downsample_result_data_frame <- function(result_df, downsample_pairs = 1000) {
#' n_processors = 2
#' ) |>
#' plot_response_grna_target_pair(
#' response_id = "ENSG00000136938",
#' grna_target = "candidate_enh_20"
#' response_id = "ENSG00000211641",
#' grna_target = "candidate_enh_15"
#' )
plot_response_grna_target_pair <- function(sceptre_object, response_id, grna_target) {
# check that grnas have been assigned and qc has been called
Expand Down
3 changes: 0 additions & 3 deletions R/s4_analysis_functs_1.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#'
#' @export
#' @examples
#' library(sceptredata)
#' data(highmoi_example_data)
#' data(grna_target_data_frame_highmoi)
#' # import data
Expand Down Expand Up @@ -162,7 +161,6 @@ set_analysis_parameters <- function(sceptre_object,
#' @return an updated `sceptre_object` in which the gRNA assignments have been carried out
#' @export
#' @examples
#' library(sceptredata)
#' data("lowmoi_example_data")
#' # 1. import data, set default analysis parameters
#' sceptre_object <- import_data(
Expand Down Expand Up @@ -248,7 +246,6 @@ assign_grnas <- function(sceptre_object, method = "default", print_progress = TR
#' @return an updated `sceptre_object` in which cellwise and pairwise QC have been applied
#' @export
#' @examples
#' library(sceptredata)
#' data(highmoi_example_data)
#' data(grna_target_data_frame_highmoi)
#' # import data
Expand Down
5 changes: 0 additions & 5 deletions R/s4_analysis_functs_2.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#'
#' @export
#' @examples
#' library(sceptredata)
#' data(highmoi_example_data)
#' data(grna_target_data_frame_highmoi)
#' # import data
Expand Down Expand Up @@ -146,7 +145,6 @@ process_calibration_result <- function(result, sceptre_object) {
#'
#' @export
#' @examples
#' library(sceptredata)
#' data(highmoi_example_data)
#' data(grna_target_data_frame_highmoi)
#' # import data
Expand Down Expand Up @@ -227,7 +225,6 @@ run_power_check <- function(sceptre_object, output_amount = 1, print_progress =
#'
#' @export
#' @examples
#' library(sceptredata)
#' data(highmoi_example_data)
#' data(grna_target_data_frame_highmoi)
#' # import data
Expand Down Expand Up @@ -512,7 +509,6 @@ add_num_cells_to_result <- function(result, sceptre_object, is_calibration_check
#' @returns a data frame containing the results of the analysis
#' @export
#' @examples
#' library(sceptredata)
#' data(highmoi_example_data)
#' data(grna_target_data_frame_highmoi)
#' # import data
Expand Down Expand Up @@ -560,7 +556,6 @@ get_result <- function(sceptre_object, analysis) {
#' @return the value NULL
#' @export
#' @examples
#' library(sceptredata)
#' data(highmoi_example_data)
#' data(grna_target_data_frame_highmoi)
#' # import data
Expand Down
4 changes: 2 additions & 2 deletions R/s4_helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ setMethod("show", signature = signature("sceptre_object"), function(object) {
#' @return the value NULL
#' @export
#' @examples
#' library(sceptredata)
#'
#' data(highmoi_example_data)
#' data(grna_target_data_frame_highmoi)
#' # import data
Expand Down Expand Up @@ -158,7 +158,7 @@ setMethod("print", signature = signature("sceptre_object"), function(x) {
#'
#' @export
#' @examples
#' library(sceptredata)
#'
#' data(highmoi_example_data)
#' data(grna_target_data_frame_highmoi)
#' # import data
Expand Down
Loading

0 comments on commit ef052ab

Please sign in to comment.