You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add get_X_cibersort function and update deconvolve_cellularity for improved reference handling
- Introduced get_X_cibersort function to load and return the Cibersort reference matrix for cell type deconvolution.
- Updated deconvolve_cellularity to utilize get_X_cibersort for default reference handling, enhancing flexibility.
- Revised documentation for both functions to clarify usage and examples.
- Adjusted NAMESPACE to export the new function and removed obsolete imports.
Copy file name to clipboardExpand all lines: R/data.R
-5Lines changed: 0 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -2,25 +2,20 @@
2
2
#'
3
3
#' @references Newman, A. M., Liu, C. L., Green, M. R., Gentles, A. J., Feng, W., Xu, Y., Hoang, C. D., Diehn, M., & Alizadeh, A. A. (2015). Robust enumeration of cell subsets from tissue expression profiles. Nature Methods, 12(5), 453–457. https://doi.org/10.1038/nmeth.3337
4
4
#'
5
-
#'
6
5
"X_cibersort"
7
6
8
7
#' Needed for vignette vignette_manuscript_signature_tsne
9
8
#'
10
-
#'
11
9
"vignette_manuscript_signature_tsne"
12
10
13
11
#' Needed for vignette vignette_manuscript_signature_boxplot
14
12
#'
15
-
#'
16
13
"vignette_manuscript_signature_boxplot"
17
14
18
15
#' Needed for vignette vignette_manuscript_signature_tsne2
19
16
#'
20
-
#'
21
17
"vignette_manuscript_signature_tsne2"
22
18
23
19
#' Needed for tests tximeta_summarizeToGene_object, It is SummarizedExperiment from tximeta
Copy file name to clipboardExpand all lines: R/deconvolve_cellularity.R
+33-7Lines changed: 33 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,26 @@
1
+
#' Get Cibersort reference data
2
+
#'
3
+
#' @description This function loads and returns the X_cibersort reference matrix used for
4
+
#' cell type deconvolution with the Cibersort and LLSR methods. The reference matrix
5
+
#' contains gene expression signatures for 22 immune cell types.
6
+
#'
7
+
#' @return The X_cibersort reference matrix with genes as rows and cell types as columns
8
+
#' @export
9
+
#'
10
+
#' @examples
11
+
#' # Get the default Cibersort reference matrix
12
+
#' ref_matrix <- get_X_cibersort()
13
+
#'
14
+
#' # Use with deconvolve_cellularity
15
+
#' # se |> deconvolve_cellularity(reference = get_X_cibersort(), method = "cibersort")
16
+
#'
17
+
#' @references Newman, A. M., Liu, C. L., Green, M. R., Gentles, A. J., Feng, W., Xu, Y., Hoang, C. D., Diehn, M., & Alizadeh, A. A. (2015). Robust enumeration of cell subsets from tissue expression profiles. Nature Methods, 12(5), 453-457. doi:10.1038/nmeth.3337
18
+
get_X_cibersort<-function() {
19
+
# Load the data object
20
+
data(X_cibersort, envir= environment())
21
+
return(X_cibersort)
22
+
}
23
+
1
24
#' Get cell type proportions from samples
2
25
#'
3
26
#' `r lifecycle::badge("maturing")`
@@ -15,7 +38,7 @@
15
38
#'
16
39
#' @param .data A `tbl` (with at least three columns for sample, feature and transcript abundance) or `SummarizedExperiment` (more convenient if abstracted to tibble with library(tidySummarizedExperiment))
17
40
#' @param .abundance The name of the transcript/gene abundance column
18
-
#' @param reference A data frame. The methods cibersort and llsr can accept a custom rectangular dataframe with genes as rows names, cell types as column names and gene-transcript abundance as values. For exampler tidybulk::X_cibersort. The transcript/cell_type data frame of integer transcript abundance. If NULL, the default reference for each algorithm will be used. For llsr will be LM22.
41
+
#' @param reference A data frame. The methods cibersort and llsr can accept a custom rectangular dataframe with genes as rows names, cell types as column names and gene-transcript abundance as values. If NULL, the default reference for each algorithm will be used. For cibersort and llsr, the default is obtained via `get_X_cibersort()`. For llsr will be LM22.
19
42
#' @param method A character string. The method to be used. Available methods: "cibersort", "llsr", "epic", "mcp_counter", "quantiseq", "xcell". If a vector is provided, an error will be thrown. Default is all available methods.
20
43
#' @param prefix A character string. The prefix you would like to add to the result columns. It is useful if you want to reshape data.
21
44
#' @param feature_column A character string. The name of a column in rowData to use as feature names instead of rownames. If NULL (default), rownames are used.
#' Mangiola, S., Molania, R., Dong, R., Doyle, M. A., & Papenfuss, A. T. (2021). tidybulk: an R tidy framework for modular transcriptomic data analysis. Genome Biology, 22(1), 42. doi:10.1186/s13059-020-02233-7
0 commit comments