Package 'bulkdeconv'

Title: Cell-Type Deconvolution of Tumor Bulk RNA-Seq Through One Function
Description: Runs published cell-type deconvolution and cell-abundance methods for bulk RNA-seq of tumor tissue (human or mouse) through a single function, bulkdeconv(data, expr, species, method). Each method runs in a separate R process from its own isolated library at a pinned version, so methods with conflicting dependencies can coexist. Input is checked before anything runs, a registry records what each method needs and how its output can be compared, and results come back in one standard layout with metadata and quality information. Only methods that need no registration are included. Fifteen methods are implemented in the package itself.
Authors: Daiki Kumakura [aut, cre]
Maintainer: Daiki Kumakura <[email protected]>
License: GPL-3
Version: 0.1.0
Built: 2026-11-14 14:10:56 UTC
Source: https://github.com/DaikiKumakura/bulkdeconv

Help Index


Cell-type deconvolution of tumor bulk RNA-seq with one function

Description

Runs one published deconvolution or cell-abundance method on a gene-by-sample table. The input layout is the one rsemverse::rsem_read() returns: the first column holds gene symbols and every other column is one sample. The method runs in a separate R process. External methods use the original package at the version recorded in the registry (see bulkdeconv_install()).

Usage

bulkdeconv(data, expr, species, method, ...)

Arguments

data

A data frame whose first column is the gene symbol (character) and whose other columns are samples (numeric). A numeric matrix with gene symbols as row names is also accepted. Gene symbols must be unique and every sample must contain at least one nonzero value.

expr

"count" or "tpm": the scale of the values in data. Each method accepts one scale (see expr_accepted in bulkdeconv_methods()): "count" for seqimmucc, "tpm" for the others. The wrong one is refused with a message that says so.

species

"human" or "mouse".

method

A method ID; see bulkdeconv_methods().

...

Method-specific options, named: preset (xcell2), cancer_type (consensus_tme; required for timer), tissue (immucellai2, ssmd), n_permutations and seed (base). Unknown or invalid options are errors.

Details

Use bulkdeconv_methods() to check the input scale, minimum sample count and output class. Scores from different methods can have different units. Cohort-dependent scores are interpreted within the run.

All reference data the methods need are installed with the package.

Value

An object of class bulkdeconv_result, a list with

  • score: numeric matrix, samples in rows, features in columns;

  • metadata: method, species, expr, options, what kind of value the method returns (output_class) and how it can be compared (comparability), licence, package versions, runtime;

  • qc: gene and sample counts, signature coverage when the method exposes its genes, and the notes and warnings raised.

Examples

## Not run: 
# df: first column gene symbols, other columns samples (TPM)
res <- bulkdeconv(df, expr = "tpm", species = "human", method = "quantiseq")
res$score

## End(Not run)

Install the packages a method needs into the private library

Description

Installs the original method packages at the versions recorded in the registry (GitHub packages at a fixed commit) into a private library, so they do not touch your normal library. Interactively it asks before installing.

Usage

bulkdeconv_install(method, lib = NULL, ask = interactive())

Arguments

method

One or more method IDs, or "all" for every usable method.

lib

Library directory. Default: the first path of the option bulkdeconv.lib, else a per-user directory (see Details).

ask

Ask for confirmation first. Default: interactive().

Details

The default library is tools::R_user_dir("bulkdeconv", "data") plus ⁠lib/R-<major.minor>⁠. Set options(bulkdeconv.lib = "path") to use another place. The packages remotes and BiocManager are needed for the installation itself.

Value

Invisibly, the library path used.

Examples

## Not run: 
bulkdeconv_install("quantiseq")
bulkdeconv_install("all")

## End(Not run)

List the methods bulkdeconv can run

Description

Returns the registry: one row per method, with the species it supports, the expression scale it accepts, what it needs, how its output can be compared, its licence, and whether it is installed in the private library.

Usage

bulkdeconv_methods(species = NULL, usable = TRUE)

Arguments

species

Optional. "human" or "mouse"; keeps only methods that support it.

usable

If TRUE (default), drops methods that cannot be run (status unavailable or excluded).

Value

A data frame with one row per method. installed is TRUE when every package the method needs is found in the private library or in the normal library paths.

Examples

bulkdeconv_methods()
bulkdeconv_methods("mouse")[, c("method", "output_class", "installed")]