Skip to content

Commit

Permalink
fixy fixy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zouter committed May 8, 2020
1 parent 3f121fb commit 0aca64d
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 41 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ BugReports: https://github.com/dynverse/dynnormaliser/issues
Depends:
R (>= 3.0.0)
Imports:
Matrix
Matrix,
methods
Suggests:
testthat
17 changes: 2 additions & 15 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
# Generated by roxygen2: do not edit by hand

export(normalise_filter_counts)
import(dplyr)
import(ggplot2)
import(tibble)
import(tidyr)
importFrom(magrittr,"%$%")
importFrom(magrittr,"%<>%")
importFrom(purrr,"%>%")
importFrom(purrr,keep)
importFrom(purrr,map)
importFrom(purrr,map_chr)
importFrom(purrr,map_dbl)
importFrom(purrr,map_df)
importFrom(purrr,map_int)
importFrom(purrr,map_lgl)
importFrom(purrr,set_names)
import(Matrix)
importFrom(methods,as)
6 changes: 5 additions & 1 deletion R/normalisation.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#' Normalisation
#'
#' @param counts The counts matrix, with features in columns
#' @import Matrix
#' @export
normalise_filter_counts <- function(
counts
) {
as(log2(counts + 1), "dgCMatrix")
list(
counts = counts,
expression = as(log2(counts + 1), "dgCMatrix")
)
}
10 changes: 3 additions & 7 deletions R/package.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
#' Helper functions
#' Helper functions for normalisation
#'
#' @import dplyr
#' @import tidyr
#' @import tibble
#' @import ggplot2
#' @importFrom purrr %>% map map_df map_chr map_lgl map_int map_dbl keep set_names
#' @importFrom magrittr %<>% %$%
#' Normalisation
#'
#' @docType package
#' @name dynnormaliser
#' @importFrom methods as
NULL
5 changes: 4 additions & 1 deletion man/dynnormaliser.Rd

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

18 changes: 2 additions & 16 deletions tests/testthat/test-normalisation.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,7 @@ test_that("Testing normalise function", {
sink(tmpfile)
pdf(tmpfile)
normd <- normalise_filter_counts(
counts = counts,
verbose = TRUE,
nmads = 3,
min_ave_expression = 0.05,
filter_hvg = TRUE,
hvg_fdr = 0.05,
hvg_bio = 0.5,
min_variable_fraction = 0.1
counts = counts
)
dev.off()
sink()
Expand All @@ -51,14 +44,7 @@ test_that("Also test for when there are no Mt genes", {
sink(tmpfile)
pdf(tmpfile)
normd <- normalise_filter_counts(
counts = counts,
verbose = TRUE,
nmads = 3,
min_ave_expression = 0.05,
filter_hvg = TRUE,
hvg_fdr = 0.05,
hvg_bio = 0.5,
min_variable_fraction = 0.1
counts = counts
)
dev.off()
sink()
Expand Down

0 comments on commit 0aca64d

Please sign in to comment.