Skip to contents

Returns the index for a given gene based on the internal gene mapping. This is used for the single cell-related classes and methods.

Usage

get_gene_indices(x, gene_ids, rust_index)

## S7 method for class <bixverse::MetaCells>
get_gene_indices(x, gene_ids, rust_index)

# S3 method for class 'ScMap'
get_gene_indices(x, gene_ids, rust_index)

## S7 method for class <bixverse::SingleCells>
get_gene_indices(x, gene_ids, rust_index)

## S7 method for class <bixverse::SingleCellsSubset>
get_gene_indices(x, gene_ids, rust_index)

Arguments

x

An object to get the gene index from.

gene_ids

String vector. The gene ids to search for.

rust_index

Bool. Shall Rust-based indexing be returned.

Value

The indices of the genes

Examples

# R-based positions of two genes
sc <- demo_single_cells(prepped = FALSE)
get_gene_indices(sc, c("gene_01", "gene_02"), rust_index = FALSE)
#> [1] 1 2

unlink(sc@dir_data, recursive = TRUE, force = TRUE)