Skip to content

Commit

Permalink
Fix CI trouble and problem with R3.5.1 (#6)
Browse files Browse the repository at this point in the history
* test travis with one core fore xcell

* fix problem with quantiseq rownames in R3.5

* fix docstring of deconvolute

* update man
  • Loading branch information
grst authored Jan 23, 2019
1 parent 6807539 commit 227e645
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ Roxygen: list(markdown = TRUE)
LazyData: true
URL: https://github.com/grst/immunedeconv
BugReports: https://github.com/grst/immunedeconv/issues
RoxygenNote: 6.0.1
RoxygenNote: 6.1.1
12 changes: 8 additions & 4 deletions R/immune_deconvolution_methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,15 @@ deconvolute_epic = function(gene_expression_matrix, tumor, scale_mrna, ...) {


deconvolute_quantiseq = function(gene_expresssion_matrix, tumor, arrays, scale_mrna) {
deconvolute_quantiseq.default(gene_expresssion_matrix, tumor=tumor, arrays=arrays, mRNAscale = scale_mrna) %>%
res = deconvolute_quantiseq.default(gene_expresssion_matrix, tumor=tumor, arrays=arrays, mRNAscale = scale_mrna)
sample_names = res$Sample
res_mat = res %>%
as_tibble() %>%
select(-Sample) %>%
as.matrix() %>%
t()
as.matrix()
rownames(res_mat) = sample_names

t(res_mat)
}

deconvolute_cibersort = function(gene_expression_matrix,
Expand Down Expand Up @@ -212,7 +216,7 @@ eset_to_matrix = function(eset, column) {
#' Use this to exclude e.g. noisy genes.
#' @param scale_mrna logical. If FALSE, disable correction for mRNA content of different cell types.
#' This is supported by methods that compute an absolute score (EPIC and quanTIseq)
#' @param expected_cell_types. Limit the anlysis to the cell types given in this list. If the cell
#' @param expected_cell_types Limit the anlysis to the cell types given in this list. If the cell
#' types present in the sample are known *a priori*, setting this can improve results for
#' xCell (see https://github.com/grst/immunedeconv/issues/1).
#' @param ... arguments passed to the respective method
Expand Down
6 changes: 3 additions & 3 deletions man/deconvolute.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions tests/testthat/test_deconvolution.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ test_that("generic deconvolution works for all methods", {
lapply(deconvolution_methods, function(method) {
# cibersort requires the binary path to be set, n/a in unittest.
if(!method %in% c("cibersort", "cibersort_abs")) {
print(paste0("method is ", method))
res = deconvolute(test_mat, method, indications=rep("brca", ncol(test_mat)),
tumor=TRUE, arrays=FALSE, rmgenes=c("ALB", "ERBB2"),
expected_cell_types=c("T cell CD4+", "T cell CD8+", "Macrophage", "NK cell"),
Expand All @@ -71,6 +72,7 @@ test_that("generic deconvolution works for all methods, without extra arguments"
lapply(deconvolution_methods, function(method) {
# cibersort requires the binary path to be set, n/a in unittest.
if(!method %in% c("cibersort", "cibersort_abs")) {
print(paste0("method is ", method))
res = deconvolute(test_mat, method, indications=rep("brca", ncol(test_mat)))
# matrix has the 'cell type' column -> +1
assert("matrix dimensions consistent", ncol(res) == ncol(test_mat) + 1)
Expand Down

0 comments on commit 227e645

Please sign in to comment.