From 9a580ca7a06ef997e85132e4b2c41d9c6cf2b897 Mon Sep 17 00:00:00 2001 From: Shixiang Wang Date: Fri, 8 Jan 2021 15:12:47 +0800 Subject: [PATCH] Fix CRAN note --- CRAN-RELEASE | 2 +- R/data.R | 2 +- R/read_vcf.R | 23 ++++++++++++------- R/scoring.R | 2 +- man/read_xena_variants.Rd | 2 ++ man/scoring.Rd | 2 +- man/simulated_catalogs.Rd | 2 +- .../test-roxytest-testexamples-read_vcf.R | 4 +++- 8 files changed, 25 insertions(+), 14 deletions(-) diff --git a/CRAN-RELEASE b/CRAN-RELEASE index b343459c..bb50f96f 100644 --- a/CRAN-RELEASE +++ b/CRAN-RELEASE @@ -1,2 +1,2 @@ This package was submitted to CRAN on 2021-01-08. -Once it is accepted, delete this file and tag the release (commit c5a40bb). +Once it is accepted, delete this file and tag the release (commit 719ddf9). diff --git a/R/data.R b/R/data.R index 0d0f3ac9..17395a2a 100644 --- a/R/data.R +++ b/R/data.R @@ -120,7 +120,7 @@ NULL #' A List of Simulated SBS-96 Catalog Matrix #' -#' Data from . +#' Data from \doi{10.1038/s43018-020-0027-5}. #' 5 simulated mutation catalogs are used by the paper but only 4 are available. #' The data are simulated from COSMIC mutational signatures 1, 2, 3, 5, 6, 8, #' 12, 13, 17 and 18. Each sample is a linear combination of 5 randomly selected diff --git a/R/read_vcf.R b/R/read_vcf.R index 6bf8fe15..7307ad8f 100644 --- a/R/read_vcf.R +++ b/R/read_vcf.R @@ -108,6 +108,7 @@ read_vcf <- function(vcfs, samples = NULL, genome_build = c("hg19", "hg38"), kee #' @export #' #' @examples +#' \donttest{ #' if (requireNamespace("UCSCXenaTools")) { #' library(UCSCXenaTools) #' options(use_hiplot = TRUE) @@ -119,6 +120,7 @@ read_vcf <- function(vcfs, samples = NULL, genome_build = c("hg19", "hg38"), kee #' y <- sig_tally(x) #' y #' } +#' } #' @testexamples #' if (requireNamespace("UCSCXenaTools")) { #' expect_is(y, "list") @@ -132,14 +134,19 @@ read_xena_variants <- function(path) { data.table::setnames( dt, - old = c(detect_name("Sample_ID", "sample", colnames(dt)), - "gene", - detect_name("chrom", "chr", colnames(dt)), - "start", "end", - detect_name("ref", "reference", colnames(dt)), - "alt"), - new = c("Tumor_Sample_Barcode", "Hugo_Symbol", "Chromosome", - "Start_Position", "End_Position", "Reference_Allele", "Tumor_Seq_Allele2")) + old = c( + detect_name("Sample_ID", "sample", colnames(dt)), + "gene", + detect_name("chrom", "chr", colnames(dt)), + "start", "end", + detect_name("ref", "reference", colnames(dt)), + "alt" + ), + new = c( + "Tumor_Sample_Barcode", "Hugo_Symbol", "Chromosome", + "Start_Position", "End_Position", "Reference_Allele", "Tumor_Seq_Allele2" + ) + ) dt$Variant_Type <- dplyr::case_when( nchar(dt$Reference_Allele) == 1L & nchar(dt$Tumor_Seq_Allele2) == 1L ~ "SNP", diff --git a/R/scoring.R b/R/scoring.R index c4ad0437..bb0e3643 100644 --- a/R/scoring.R +++ b/R/scoring.R @@ -42,7 +42,7 @@ #' - sTDP_size: sTDP region size (Mb). #' - lTDP_size: lTDP region size(Mb). #' - Chromoth_state: chromothripsis state score, -#' according to reference , +#' according to reference \doi{10.1016/j.cell.2013.02.023}, #' chromothripsis frequently leads to massive loss of segments on #' the affected chromosome with segmental losses being interspersed with regions displaying #' normal (disomic) copy-number (e.g., copy-number states oscillating between diff --git a/man/read_xena_variants.Rd b/man/read_xena_variants.Rd index aa30466f..cdbff2a5 100644 --- a/man/read_xena_variants.Rd +++ b/man/read_xena_variants.Rd @@ -16,6 +16,7 @@ a \code{MAF} object. Read UCSC Xena Variant Format Data as MAF Object } \examples{ +\donttest{ if (requireNamespace("UCSCXenaTools")) { library(UCSCXenaTools) options(use_hiplot = TRUE) @@ -28,3 +29,4 @@ if (requireNamespace("UCSCXenaTools")) { y } } +} diff --git a/man/scoring.Rd b/man/scoring.Rd index 9ddb23c6..9baafe90 100644 --- a/man/scoring.Rd +++ b/man/scoring.Rd @@ -46,7 +46,7 @@ TD represents segment with copy number greater than 2. \item sTDP_size: sTDP region size (Mb). \item lTDP_size: lTDP region size(Mb). \item Chromoth_state: chromothripsis state score, -according to reference \url{http://dx.doi.org/10.1016/j.cell.2013.02.023}, +according to reference \doi{10.1016/j.cell.2013.02.023}, chromothripsis frequently leads to massive loss of segments on the affected chromosome with segmental losses being interspersed with regions displaying normal (disomic) copy-number (e.g., copy-number states oscillating between diff --git a/man/simulated_catalogs.Rd b/man/simulated_catalogs.Rd index d50a4106..0b41a569 100644 --- a/man/simulated_catalogs.Rd +++ b/man/simulated_catalogs.Rd @@ -11,7 +11,7 @@ A list of matrix Generate from code under data_raw/ } \description{ -Data from \url{https://doi.org/10.1038/s43018-020-0027-5}. +Data from \doi{10.1038/s43018-020-0027-5}. 5 simulated mutation catalogs are used by the paper but only 4 are available. The data are simulated from COSMIC mutational signatures 1, 2, 3, 5, 6, 8, 12, 13, 17 and 18. Each sample is a linear combination of 5 randomly selected diff --git a/tests/testthat/test-roxytest-testexamples-read_vcf.R b/tests/testthat/test-roxytest-testexamples-read_vcf.R index dad5127d..467b47ce 100644 --- a/tests/testthat/test-roxytest-testexamples-read_vcf.R +++ b/tests/testthat/test-roxytest-testexamples-read_vcf.R @@ -2,7 +2,8 @@ context("File R/read_vcf.R: @testexamples") -test_that("Function read_xena_variants() @ L126", { +test_that("Function read_xena_variants() @ L128", { + if (requireNamespace("UCSCXenaTools")) { library(UCSCXenaTools) @@ -15,6 +16,7 @@ test_that("Function read_xena_variants() @ L126", { y <- sig_tally(x) y } + if (requireNamespace("UCSCXenaTools")) { expect_is(y, "list") }