subsample_fastq: Subsample a fastq file copying the n_seq first sequences in a...

View source: R/miscellanous.R

subsample_fastqR Documentation

Subsample a fastq file copying the n_seq first sequences in a given folder

Description

lifecycle-experimental

Useful to test a pipeline on small fastq files.

Usage

subsample_fastq(fastq_files, folder_output = "subsample", nb_seq = 1000)

Arguments

fastq_files

The path to one fastq file or a list of fastq files (see examples)

folder_output

The path to a folder for output files

nb_seq

(int; default 1000) : Number of sequences kept (every sequence spread across 4 lines)

Value

Nothing, create subsampled fastq files in a folder

Author(s)

Adrien Taudière

Examples


ex_file <- system.file("extdata", "ex_R1_001.fastq.gz",
  package = "MiscMetabar",
  mustWork = TRUE
)
subsample_fastq(ex_file, paste0(tempdir(), "/output_fastq"))
subsample_fastq(list_fastq_files("extdata"), paste0(tempdir(), "/output_fastq"), n = 10)
unlink(paste0(tempdir(), "/output_fastq"), recursive = TRUE)


MiscMetabar documentation built on Oct. 8, 2024, 1:07 a.m.