Skip to content

Commit

Permalink
Purge subsampling test code.
Browse files Browse the repository at this point in the history
  • Loading branch information
hyunhwan-bcm committed Dec 7, 2019
1 parent 9ffb250 commit 0465145
Show file tree
Hide file tree
Showing 9 changed files with 4,914 additions and 28 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Description: Provides functions for hit gene identification and quantification
Details are in Jeong et al. (2019) <doi:10.1101/gr.245571.118> and Baggerly et al. (2003) <doi:10.1093/bioinformatics/btg173>.
Depends: R (>= 3.5.0)
License: MIT + file LICENSE
LazyData: true
Imports:
Rcpp (>= 0.12.16),
metap,
Expand Down
12 changes: 12 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Generated by roxygen2: do not edit by hand

export(calc_mappability)
export(fit_ab)
export(get_CPM)
export(measure_gene_stats)
export(measure_sgrna_stats)
export(plot_PCA)
export(plot_corr_heatmap)
export(plot_count_distribution)
export(plot_dotplot)
export(quant)
export(run_estimation)
export(run_sgrna_quant)
importFrom(Rcpp,evalCpp)
importFrom(dplyr,arrange_)
importFrom(dplyr,group_by)
Expand Down
10 changes: 10 additions & 0 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
#' \item{sg_stat}{The data.frame contains the sgRNA-level statistics.}
#' \item{gene_stat}{The data.frame contains the gene-level statistics.}
#' }
#'
#' @docType data
#'
#' @usage data(Evers_CRISPRn_RT112)
#'
#' @source \url{https://www.ncbi.nlm.nih.gov/pubmed/27111720}
"Evers_CRISPRn_RT112"

Expand All @@ -24,5 +29,10 @@
#' \item{ngenes}{The list of 927 non-essential genes used in Sanson et al.'s study.}
#' \item{design}{The data.frame contains study design.}
#' }
#'
#' @docType data
#'
#' @usage data(Sanson_CRISPRn_A375)
#'
#' @source \url{https://www.ncbi.nlm.nih.gov/pubmed/30575746}
"Sanson_CRISPRn_A375"
4,887 changes: 4,887 additions & 0 deletions inst/extdata/Shifrut_et_al_2018_Cell.csv

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion man/Evers_CRISPRn_RT112.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/Sanson_CRISPRn_A375.Rd

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

4 changes: 1 addition & 3 deletions man/quant.Rd

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

4 changes: 1 addition & 3 deletions man/run_sgrna_quant.Rd

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

20 changes: 0 additions & 20 deletions tests/testthat/test.toydata.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,6 @@ test_that("A very simple sanity check", {
})


test_that("Testing whether subsamplings with the same seed are identical.", {
set.seed(123)
cb2_count <- run_sgrna_quant(FASTA, df_design, sampling_ratio = 0.5)

set.seed(123)
cb2_count2 <- run_sgrna_quant(FASTA, df_design, sampling_ratio = 0.5)

expect_identical(cb2_count, cb2_count2)
})

test_that("Testing whether the subsampling code works as intended.", {
cb2_count_nosubs <- run_sgrna_quant(FASTA, df_design)

for( i in seq(0.1, 0.9, 0.1)) {
set.seed(123)
cb2_count <- run_sgrna_quant(FASTA, df_design, sampling_ratio = i)
expect_equal(sum(dplyr::between(cb2_count$total / cb2_count_nosubs$total, i-0.1, i+0.1)), length(cb2_count$total))
}
})

# test_that("The result has to be consistent to the publication", {
# data("Sanson_CRISPRn_A375")
# published <- read.csv("https://raw.githubusercontent.com/hyunhwaj/CB2-Experiments/master/01_gene-level-analysis/results/Sanson/CRISPRn-A375/FDR/CB2.csv")
Expand Down

0 comments on commit 0465145

Please sign in to comment.