Skip to content

Commit

Permalink
Import column_to_rownames from tibble
Browse files Browse the repository at this point in the history
  • Loading branch information
manszamore committed Sep 30, 2024
1 parent 42c53a1 commit 646e839
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ importFrom(readr,read_tsv)
importFrom(readr,write_tsv)
importFrom(stats,median)
importFrom(tibble,as_tibble)
importFrom(tibble,column_to_rownames)
importFrom(tidyr,pivot_longer)
importFrom(tidyr,pivot_wider)
importFrom(withr,with_tempdir)
8 changes: 4 additions & 4 deletions R/deconvolute.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#' \item Other algorithms supported by the `immunedeconv` package.
#' }
#'
#' @importFrom dplyr column_to_rownames
#' @importFrom tibble column_to_rownames
#' @importFrom immunedeconv deconvolute
#' @export
deconvolute <- function(algorithm, data, signature_matrix = NULL, ...) {
Expand All @@ -29,7 +29,7 @@ deconvolute <- function(algorithm, data, signature_matrix = NULL, ...) {
return(deconvolute_cibersort(data, signature_matrix))
}

data <- data |> column_to_rownames("Genes")
data <- data |> tibble::column_to_rownames("Genes")

if (algorithm == "epic") {
return(deconvolute_epic(data, signature_matrix, ...))
Expand Down Expand Up @@ -135,8 +135,8 @@ deconvolute_cibersortx <- function(data, signature_matrix, perm = 1, rmbatch_S_m

deconvolute_cibersort <- function(data, signature_matrix, ...) {
cibersort_result <- immunedeconv::deconvolute_cibersort_custom(
data |> column_to_rownames(colnames(data)[1]),
signature_matrix |> column_to_rownames(colnames(signature_matrix)[1])
data |> tibble::column_to_rownames(colnames(data)[1]),
signature_matrix |> tibble::column_to_rownames(colnames(signature_matrix)[1])
)
tibble::as_tibble(cibersort_result |> t(), rownames = "Mixture") |> convert_cibersortx_output()
}
Expand Down

0 comments on commit 646e839

Please sign in to comment.