Skip to content

Commit

Permalink
address R CHECK warnings round 1
Browse files Browse the repository at this point in the history
  • Loading branch information
grst committed Nov 20, 2018
1 parent 6bb2762 commit 92b5bb2
Show file tree
Hide file tree
Showing 19 changed files with 58 additions and 23 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
language: R
sudo: false
cache: packages
warnings_are_errors: false
2 changes: 2 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Imports:
e1071 (>= 1.6),
parallel (>= 3.4),
BiocInstaller,
BiocParallel,
preprocessCore,
Biobase,
GSVA,
Expand All @@ -33,6 +34,7 @@ Suggests:
pkgdown
Remotes:
bioc::BiocInstaller,
bioc::BiocParallel,
bioc::preprocessCore,
bioc::Biobase,
bioc::GSVA,
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ roxygenize: | .dev_deps_installed
Rscript -e "library(methods); library(devtools); document()"

.PHONY: check
check: | roxygenize
check: | roxygenize docs
Rscript -e 'devtools::check()'

.PHONY: install
Expand Down
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ export(set_cibersort_mat)
export(timer_available_cancers)
export(xCell.data)
import(dplyr)
import(limSolve)
import(magrittr)
import(methods)
import(preprocessCore)
import(readr)
import(sva)
importFrom(BiocParallel,bpparam)
importFrom(EPIC,EPIC)
importFrom(dplyr,select)
importFrom(testit,assert)
importFrom(tibble,as_tibble)
Expand Down
12 changes: 9 additions & 3 deletions R/immune_deconvolution_methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#' @importFrom testit assert
#' @import readr
#' @importFrom tibble as_tibble
#' @importFrom EPIC EPIC
NULL


Expand Down Expand Up @@ -40,6 +41,8 @@ xCell.data = xCell::xCell.data
#' CIBERSORT is only freely available to academic users.
#' A license an the binary can be obtained from https://cibersort.stanford.edu.
#'
#' @param path path to cibersort R script.
#'
#' @export
set_cibersort_binary = function(path) {
assign("cibersort_binary", path, envir=config_env)
Expand All @@ -50,6 +53,8 @@ set_cibersort_binary = function(path) {
#' CIBERSORT is only freely available to academic users.
#' A license an the binary can be obtained from https://cibersort.stanford.edu.
#'
#' @param path path to cibersort matrix.
#'
#' @export
set_cibersort_mat = function(path) {
assign("cibersort_mat", path, envir=config_env)
Expand All @@ -75,8 +80,6 @@ set_cibersort_mat = function(path) {
#' 'lihc', 'luad', 'lusc', 'prad', 'sarc', 'pcpg', 'paad', 'tgct',
#' 'ucec', 'ov', 'skcm', 'dlbc', 'kirc', 'acc', 'meso', 'thca',
#' 'uvm', 'ucs', 'thym', 'esca', 'stad', 'read', 'coad', 'chol'
#' @param tumor ignored for this method
#' @param arrays ignored for this method
deconvolute_timer = function(gene_expression_matrix, indications=NULL) {
indications = tolower(indications)
assert("indications fit to mixture matrix", length(indications) == ncol(gene_expression_matrix))
Expand Down Expand Up @@ -152,7 +155,10 @@ deconvolute_cibersort = function(gene_expression_matrix,

#' Annotate unified cell_type names
#'
#' (map the cell_types of the different methods to a common name)
#' map the cell_types of the different methods to a common name
#'
#' @param result_table output of `deconvolute`
#' @param method one of `immune_deconvolution_methods`.
annotate_cell_type = function(result_table, method) {
cell_type_map %>%
filter(method_dataset == !!method) %>%
Expand Down
2 changes: 1 addition & 1 deletion R/quantiseq.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#' If TRUE, the "--rmgenes" parameter is set to "none".
#' @param signame name of the signature matrix. Currently only `TIL10` is available.
#' @param tumor specifies whether expression data are from tumor samples. If TRUE, signature genes
#' with high expression in tumor samples are removed (see [1]).
#' with high expression in tumor samples are removed.
#' Default: FALSE.
#' @param mRNAscale specifies whether cell fractions must be scaled to account for cell-type-specific
#' mRNA content.
Expand Down
5 changes: 2 additions & 3 deletions R/quantiseq_helper.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#' Source code from https://github.com/FFinotello/quanTIseq
#'
#' @name quantiseq_helper
#'
#' @import limSolve
NULL

fixMixture<-function(mix.mat, arrays=FALSE) {
Expand Down Expand Up @@ -146,9 +148,6 @@ quanTIseq<-function(currsig, currmix, scaling, method) {
}

DClsei<-function(b,A,G,H,scaling) {

library(limSolve)

sc<-norm(A,"2")
A<-A/sc
b<-b/sc
Expand Down
2 changes: 1 addition & 1 deletion R/single_cell_simulation.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ make_random_bulk = function(eset, cell_fractions, n_cells=500, combine=mean) {
#' @param eset `Biobase::ExpressionSet` with a `cell_type` column in `pData`.
#' @param cell_fractions n x n_cell_types dataframe with the fraction for each
#' sample in each row.
#' @param n_cell number of single cells to use in each sample
#' @param n_cells number of single cells to use in each sample
#' @param combine callback function used to aggregate the counts.
#'
#' @seealso make_random_bulk
Expand Down
11 changes: 8 additions & 3 deletions R/timer.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
#' again is an adapted version of the original TIMER source code
#' from http://cistrome.org/TIMER/download.html.
#'
#' The method is described in Li et al. Genome Biology 2016;17(1):174. [PMID 27549193].
#' The method is described in Li et al. Genome Biology 2016;17(1):174., PMID 27549193.
#'
#' @import sva
#' @importFrom BiocParallel bpparam
#'
#' @name timer
NULL
Expand Down Expand Up @@ -108,6 +109,8 @@ RemoveBatchEffect <- function(cancer.exp, immune.exp, immune.cellType) {


#' process batch table and check cancer types.
#'
#' @param args environment
check_cancer_types <- function(args) {
if (length(args$batch) != 0) {
TimerINFO("Enter batch mode\n")
Expand All @@ -128,9 +131,11 @@ check_cancer_types <- function(args) {


#' Constrained regression method implemented in Abbas et al., 2009
#'
#' @param XX immume expression data
#' @param YY cancer expression data
#' @param w ?
GetFractions.Abbas <- function(XX, YY, w=NA){
## XX is immune expression data
## YY is cancer expression data
ss.remove=c()
ss.names=colnames(XX)
while(T){
Expand Down
7 changes: 7 additions & 0 deletions man/GetFractions.Abbas.Rd

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

7 changes: 6 additions & 1 deletion man/annotate_cell_type.Rd

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

3 changes: 3 additions & 0 deletions man/check_cancer_types.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/deconvolute_quantiseq.default.Rd

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

4 changes: 0 additions & 4 deletions man/deconvolute_timer.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/make_bulk_eset.Rd

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

3 changes: 3 additions & 0 deletions man/set_cibersort_binary.Rd

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

3 changes: 3 additions & 0 deletions man/set_cibersort_mat.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/timer.Rd

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

6 changes: 5 additions & 1 deletion vignettes/immunedeconv.Rmd
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
---
title: "Getting started with `immunedeconv`"
output: html_document
bibliography: references.bib
biblio-style: apalike
link-citations: yes
colorlinks: yes
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Vignette Title}
%\VignetteEngine{knitr::rmarkdown}
\usepackage[utf8]{inputenc}
---

```{r setup, include=FALSE}
Expand Down

0 comments on commit 92b5bb2

Please sign in to comment.