Skip to content

Commit

Permalink
Merge pull request #55 from adrientaudiere/dev
Browse files Browse the repository at this point in the history
Merge pull request #54 from adrientaudiere/master
  • Loading branch information
adrientaudiere authored Dec 12, 2023
2 parents 39d431d + b17e816 commit 6c5c90e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,7 @@ jobs:
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
args: 'c("--no-tests", "--no-examples", "--no-vignettes", "--no-build-vignettes", "--no-manual")'
#Character vector of arguments to pass to ⁠R CMD check⁠.
args: 'c("--as-cran", , "--no-tests", "--no-vignettes", "--no-build-vignettes", "--ignore-vignettes")'
#Character vector of arguments to pass to ⁠R CMD build.
build_args: 'c("--no-build-vignettes", "--no-manual")'
17 changes: 12 additions & 5 deletions R/miscellanous.R
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ perc <- function(x, y = NULL, accuracy = 0, add_symbol = FALSE) {
#' @author Adrien Taudière
#' @export
#' @examples
#' count_seq(file_path = system.file("extdata", "ex.fasta", package = "MiscMetabar", mustWork = TRUE))
#' count_seq(file_path = system.file("extdata", "ex.fasta",
#' package = "MiscMetabar", mustWork = TRUE))
#' count_seq(folder_path = "extdata/", pattern = "*.fasta")
count_seq <- function(file_path = NULL, folder_path = NULL, pattern = NULL) {
if (is.null(file_path) && is.null(folder_path)) {
Expand Down Expand Up @@ -283,15 +284,20 @@ funky_color <-
#' @export
#' @examples
#' \dontrun{
#' subsample_fastq(system.file("extdata", "ex_R1_001.fastq.gz", package = "MiscMetabar", mustWork = TRUE)), "your_path_to_output")
#' subsample_fastq(system.file("extdata", "
#' ex_R1_001.fastq.gz", package = "MiscMetabar", mustWork = TRUE)),
#' "your_path_to_output")
#' subsample_fastq(list_fastq_files("extdata"), "your_path_to_output", n = 10)
#' }
subsample_fastq <- function(fastq_files, folder_output = "subsample", n_seq = 1000) {
subsample_fastq <- function(fastq_files,
folder_output = "subsample",
n_seq = 1000) {
for (f in unlist(fastq_files)) {
if (!dir.exists(folder_output)) {
dir.create(folder_output)
}
writeLines(readLines(f, n = n_seq * 4), con = paste0(folder_output, "/", basename(f)))
writeLines(readLines(f, n = n_seq * 4), con = paste0(folder_output, "/",
basename(f)))
}
}

Expand Down Expand Up @@ -319,7 +325,8 @@ subsample_fastq <- function(fastq_files, folder_output = "subsample", n_seq = 10
#' \dontrun{
#' install_pkg_needed("ggVennDiagram")
#' }
install_pkg_needed <- function(pkg, use_pak = TRUE, bioconductor_pkg = FALSE, github_pkg = FALSE, verbose = FALSE) {
install_pkg_needed <- function(pkg, use_pak = TRUE, bioconductor_pkg = FALSE,
github_pkg = FALSE, verbose = FALSE) {
if (!requireNamespace(pkg, quietly = TRUE)) {
if (verbose) {
message(paste0("Installation of the package : ", pkg))
Expand Down

0 comments on commit 6c5c90e

Please sign in to comment.