This is a package built using Heng Li's readfq() subroutine (link). For updated documentation, please visit Meta::CPAN.
The FASTX::Reader module also ships fqc (FASTQ counter), a program to quickly count the number of sequences in a set of FASTA/FASTQ files, also .gz compressed.
With CPAN minus:
cpanm FASTX::Reader
If you don't have CPAN minus, you can install it with:
cpan App::cpanminus
With Miniconda:
conda install -c bioconda perl-fastx-reader
Telatin A, Fariselli P, Birolo G. SeqFu: A Suite of Utilities for the Robust and Reproducible Manipulation of Sequence Files. Bioengineering 2021, 8, 59. doi.org/10.3390/bioengineering8050059
fqc [options] FILE1 FILE2 ... FILEn
The output is simply filename/read counts, but can be expanded with: -t
for TSV, -c
for CSV, -j
for JSON, -x
to print in ASCII table.
Type fqc --help
for full manual.
use FASTX::Reader;
my $filepath = '/path/to/assembly.fastq';
die "Input file not found: $filepath\n" unless (-e "$filepath");
my $fasta_reader = FASTX::Reader->new({ filename => "$filepath" });
while (my $seq = $fasta_reader->getRead() ) {
print STEDRR "Printing ", $seq->{name}, ' (', $seq->{comment}, ")\n";
print $seq->{name}, "\t", $seq->{seq}, "\t", $seq->{qual}, "\n";
}