Skip to content

[FASTX::Reader] Perl module to parse FASTQ files, without depending on BioPerl

Notifications You must be signed in to change notification settings

telatin/FASTX-Reader

Repository files navigation

FASTX::Reader

CPAN Version Tests Kwalitee Bioconda Ubuntu_18

A Perl module to parse FASTA and FASTQ files

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.

Installation

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

Citing 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

Using 'fqc'

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.

Using the module

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";
}

About

[FASTX::Reader] Perl module to parse FASTQ files, without depending on BioPerl

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages