count_seq: Count sequences in fasta or fastq file

View source: R/miscellanous.R

count_seqR Documentation

Count sequences in fasta or fastq file

Description

lifecycle-experimental

Use grep to count the number of line with only one '+' (fastq, fastq.gz) or lines starting with a '>' (fasta) to count sequences.

Usage

count_seq(file_path = NULL, folder_path = NULL, pattern = NULL)

Arguments

file_path

The path to a fasta, fastq or fastq.gz file

folder_path

The path to a folder with fasta, fastq or fastq.gz files

pattern

A pattern to filter files in a folder. E.g. R2

Value

the number of sequences

Author(s)

Adrien Taudière

Examples


count_seq(file_path = system.file(
  "extdata",
  "ex.fasta",
  package = "MiscMetabar",
  mustWork = TRUE
))
count_seq(
  folder_path = system.file("extdata", package = "MiscMetabar"),
  pattern = "*.fasta"
)


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