Add a gene score matrix from fragment data
add_gene_score_matrix.RdComputes gene activity scores using ArchR's distance-weighted model.
Wraps BPCells::gene_score_archr(). See that function for
algorithmic details.
Usage
# S3 method for class 'MarchRDataset'
add_gene_score_matrix(
proj,
frags_name = NULL,
output_assay_name = "GeneScoreMatrix",
genome = NULL,
genes = NULL,
gene_name_column = "gene_name",
blacklist = TRUE,
chrom_sizes = NULL,
exclude_chr = c("chrY", "chrM"),
tile_width = 500,
tile_max_count = 4,
scale_factor = 10000,
addArchRBug = FALSE,
overwrite = FALSE,
return_matrix = FALSE
)
# S3 method for class 'MarchRProject'
add_gene_score_matrix(
proj,
frags_name = NULL,
dataset_names = character(0),
output_assay_name = "GeneScoreMatrix",
genes = NULL,
gene_name_column = "gene_name",
blacklist = TRUE,
chrom_sizes = NULL,
exclude_chr = c("chrY", "chrM"),
tile_width = 500,
tile_max_count = 4,
scale_factor = 10000,
addArchRBug = FALSE,
overwrite = FALSE,
return_matrix = FALSE
)Arguments
- proj
(MarchRProject or MarchRDataset) Object containing fragments.
- frags_name
(character) Fragment assay name. Auto-selected if only one exists.
- output_assay_name
(character) Assay name for gene scores. Default:
"GeneScoreMatrix".- genome
(Genome; optional) Genome object for gene annotations, chromosome sizes, and blacklist. Required for MarchRDataset when these are not provided explicitly.
- genes
(data.frame; optional) Gene coordinates with columns
chr,start,end,strand, and a gene name column. If not provided, uses the stored"genes"annotations from genome/project.- gene_name_column
(character) Column in
genesfor gene names. Default:"gene_name".- blacklist
(logical, data.frame, or GRanges) Blacklist regions.
TRUEretrieves from genome/project;FALSEskips.- chrom_sizes
(data.frame; optional) Chromosome sizes. If not provided, uses genome/project chromosome sizes.
- exclude_chr
(character) Chromosomes to exclude. Default:
c("chrY", "chrM").- tile_width
(numeric) Tile width for binning insertions. Default: 500.
- tile_max_count
(numeric) Per-tile count ceiling. Default: 4.
- scale_factor
(numeric) Depth normalization factor. Default: 10000.
- addArchRBug
(logical) Replicate ArchR's nested gene handling. Default:
FALSE. SeeBPCells::gene_score_weights_archr().- overwrite
(logical) Overwrite existing assay. Default:
FALSE.- return_matrix
(logical) If
TRUE, returns the matrix directly.- dataset_names
(character) Datasets to compute gene scores for. Defaults to all datasets with fragments.