Skip to content

Commit

Permalink
fixed test error
Browse files Browse the repository at this point in the history
  • Loading branch information
ajitjohnson committed Dec 25, 2020
1 parent 42954b6 commit c00517e
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 23 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: imsig
Type: Package
Title: Immune Cell Gene Signatures for Profiling the Microenvironment of Solid Tumours
Version: 1.1.0
Version: 1.1.1
Author: Ajit Johnson Nirmal
Maintainer: Ajit Johnson Nirmal <[email protected]>
Description: Estimate the relative abundance of tissue-infiltrating immune subpopulations abundances using gene expression data.
Expand All @@ -17,5 +17,5 @@ Imports:
ggplot2 (>= 2.2),
gridExtra (>= 2.3),
survival (>= 2.4)
RoxygenNote: 6.0.1
RoxygenNote: 7.1.1
Suggests: testthat
2 changes: 1 addition & 1 deletion R/imsig.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' @param sort_by Can be used to sort the samples by predicted abundance of a particular cell type. All other cell types follow this sorting. By default it is sorted by `T cells`
#' @return Relative abundance of immune cells across samples. Returns a dataframe.
#' @examples
#' cell_abundance = imsig (exp = example_data, r = 0.7)
#' cell_abundance = imsig (exp = example_data, r = 0.7, sort=TRUE, sort_by='T cells')
#' head(cell_abundance)
#' @seealso \code{\link{feature_select}}, \code{\link{example_data}}
#' @export
Expand Down
4 changes: 2 additions & 2 deletions R/imsig_survival.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' @param r Use a value between 0 and 1. Default is 0.6. This is a user defined correlation cut-off to perform feature selection (\code{\link{feature_select}}). Feature selection aids to enrich the prediction of relative abundance of immune cells by filtering off poorly correlated ImSig genes. To get an idea of what cut-off to use check the results of (\code{\link{gene_stat}}) and choose a cut-off that displays high median correlation and maintains a high proportion of genes after feature selection.
#' @return Hazard Ratio
#' @examples \donttest{
#' survival = imsig_survival (exp = example_data)
#' survival = imsig_survival (exp = example_data, cli = example_cli)
#' head(survival)
#' }
#' @import survival
Expand All @@ -25,7 +25,7 @@ imsig_survival <- function(exp, cli, time = 'time', status= 'status', r = 0.6){
for (i in 1: length(levels(sig$cell))){
cell_ordered <- cell_cli[sort.list(cell_cli[,i]),]
cell_ordered$group <- ifelse(cell_ordered[,i] <= median(cell_cli[,i]), "low", "high")
cox <- coxph(Surv(time, status) ~ group, cell_ordered)
cox <- survival::coxph(Surv(time, status) ~ group, cell_ordered)
x <- summary(cox)[8]
HR.OS <- data.frame(log2(x[[1]][1]))
HR.UP <- data.frame(log2(x[[1]][4]))
Expand Down
2 changes: 1 addition & 1 deletion man/corr_matrix.Rd

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

4 changes: 3 additions & 1 deletion man/example_cli.Rd

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

4 changes: 3 additions & 1 deletion man/example_data.Rd

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

2 changes: 1 addition & 1 deletion man/feature_select.Rd

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

2 changes: 1 addition & 1 deletion man/gene_stat.Rd

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

10 changes: 7 additions & 3 deletions man/imsig.Rd

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

4 changes: 2 additions & 2 deletions man/imsig_survival.Rd

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

2 changes: 1 addition & 1 deletion man/plot_abundance.Rd

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

16 changes: 12 additions & 4 deletions man/plot_network.Rd

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

2 changes: 1 addition & 1 deletion man/plot_survival.Rd

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

4 changes: 3 additions & 1 deletion man/sig.Rd

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

2 changes: 1 addition & 1 deletion tests/testthat/test_imsig.R
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
cell_abundance = imsig (exp = example_data, r = 0.7)
cell_abundance = imsig (exp = example_data, r = 0.7, sort=TRUE, sort_by='T cells')
head(cell_abundance)

0 comments on commit c00517e

Please sign in to comment.