Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: cellNexus
Title: Queries the Human Cell Atlas
Version: 0.99.34
Version: 0.99.35
Authors@R: c(
person(
"Stefano",
Expand Down
1 change: 0 additions & 1 deletion R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
#' \item{self_reported_ethnicity}{Character vector of ethnicity labels}
#' \item{sex}{Character vector of sex labels}
#' \item{tissue}{Character vector of tissue types}
#' \item{tissue_groups}{Character vector of tissue group labels}
#' }
#'
#' @source Generated from cellNexus metadata
Expand Down
2 changes: 1 addition & 1 deletion R/dev.R
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ hdf5_to_anndata <- function(input_directory, output_directory) {
#' @param census_version Character scalar. Census LTS release in date format.
#' @return NULL
downsample_metadata <- function(
cellnexus_output = "sample_hca2024_v2.3.2.parquet",
cellnexus_output = "sample_hca2024_v2.4.0.parquet",
census_version = "2024-07-01"
) {
census_metadata <- get_census_metadata(census_version)
Expand Down
3 changes: 1 addition & 2 deletions R/interface_app.R
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,7 @@ create_interface_app <- function(ui_choices, return_as_list = FALSE) {
"self_reported_ethnicity",
"sex",
# "age_days",
"tissue",
"tissue_groups"
"tissue"
)

# Extract sample choices from pre-computed choices
Expand Down
10 changes: 4 additions & 6 deletions R/metadata.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ cache <- rlang::env(
#' @keywords internal
#' @noRd
metadata_aliases <- c(
hca_2024 = "hca2024_v2.3.2.parquet",
hca_2025 = "hca2025_v0.1.1.parquet"
hca_2024 = "hca2024_v2.4.0.parquet",
hca_2025 = "hca2025_v0.2.0.parquet"
)

#' Returns the URLs for all metadata files
Expand Down Expand Up @@ -62,7 +62,7 @@ get_metadata_url <- function(databases = c("hca_2024")) {
SAMPLE_DATABASE_URL <- c(
paste0(
"https://object-store.rc.nectar.org.au/v1/AUTH_06d6e008e3e642da99d806ba3ea629c5/",
"cellNexus-metadata/sample_hca2024_v2.3.2.parquet"
"cellNexus-metadata/sample_hca2024_v2.4.0.parquet"
)
)

Expand Down Expand Up @@ -96,7 +96,6 @@ SAMPLE_DATABASE_URL <- c(
#' filtered_metadata <- get_metadata(cloud_metadata = SAMPLE_DATABASE_URL) |>
#' filter(
#' imputed_ethnicity == "African" &
#' tissue_groups == "breast" &
#' cell_type_unified_ensemble %LIKE% "%cd14%"
#' )
#'
Expand Down Expand Up @@ -130,7 +129,6 @@ SAMPLE_DATABASE_URL <- c(
#'
#' `sample_id`: Sample identifier.
#' `age_days`: Donor age in days.
#' `tissue_groups`: Coarse tissue grouping for analysis.
#' `empty_droplet`: Whether a cell is called an empty droplet from expressed-gene count per sample (default threshold 200; targeted panels may differ).
#' `alive`: Whether a cell passes viability / mitochondrial QC.
#' `scDblFinder.class`: Doublet, singlet, or unknown (`scDblFinder` default parameters).
Expand All @@ -143,7 +141,7 @@ SAMPLE_DATABASE_URL <- c(
#' `high_mitochondrion`: TRUE if the cell’s mitochondrial percent exceeds the QC cutoff.
#' `high_ribosome`: TRUE if the cell’s ribosomal percent exceeds the QC cutoff.
#' `count_upper_bound`: Count capping threshold used in counts transformation.
#' `inverse_transform`: Transformation method used in pre-processing pipeline.
#' `inversed_inferred_distribution`: Transformation method used in pre-processing pipeline.
#' `nfeature_expressed_thresh`: Threshold of the number of expressed features per cell.
#' `is_immune`: Curated logical flag for immune-cell context.
#' `file_id_cellNexus_single_cell`: Internal file id for single-cell layers.
Expand Down
11 changes: 8 additions & 3 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,9 @@ duplicate_single_column_assay <- function(sce) {
#' @param doublet_col A string specifying the column name
#' that indicates doublets (default: `"scDblFinder.class"`).
#' Expected character vector: `"doublet"` and/or `"singlet"` and/or `"unknown"`.
#'
#' @param nfeature_col Column containing the number of detected features per dataset
#' @param min_features Minimum number of detected features required.
#'
#' @return A filtered data frame containing only cells that pass all QC checks.
#' @examples
#' get_metadata(cloud_metadata = SAMPLE_DATABASE_URL, cache_directory = tempdir()) |>
Expand All @@ -489,12 +491,15 @@ duplicate_single_column_assay <- function(sce) {
keep_quality_cells <- function(data,
empty_droplet_col = "empty_droplet",
alive_col = "alive",
doublet_col = "scDblFinder.class") {
doublet_col = "scDblFinder.class",
nfeature_col = "feature_count",
min_features = 5000L) {
data |>
filter(
!.data[[empty_droplet_col]],
.data[[alive_col]],
.data[[doublet_col]] != "doublet"
.data[[doublet_col]] != "doublet",
.data[[nfeature_col]] >= min_features
)
}

Expand Down
2 changes: 1 addition & 1 deletion R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#' \preformatted{
#' filtered_metadata <- metadata |>
#' dplyr::filter(
#' tissue_groups == "blood" &
#' imputed_ethnicity == "African" &
#' cell_type_unified_ensemble \%LIKE\% "\%cd4\%"
#' )
#'
Expand Down
Loading
Loading