FASTX::Reader - A lightweight FASTA and FASTQ parser
version 0.01
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 $seq->{name}, "\t", $seq->{seq}, "\t", $seq->{qual}, "\n"; }
FASTX::Reader - a lightweight module to parse FASTA and FASTQ files, using Heng Li's readfq() method https://github.com/lh3/readfq, packaged in an object oriented parser.
Initialize a new FASTX::Reader object passing 'filename' argument. Will open a filehandle stored as $object->{fh}.
Will return the next sequence in the FASTA / FASTQ file using Heng Li's implementation of the readfq() algorithm. The returned object has these attributes:
If the file is FASTQ, this method returns the same read object as getRead() but with a faster parser. Attributes of the returned object:
This subroutine returns 'fasta', 'fastq' or <undef> for a given filepath (this is not a method of the instantiated object)
Fabrizio Levorin has substantially contributed to the development of this module, and is a collaborator in the GitHub repository
Andrea Telatin <andrea.telatin@quadram.ac.uk>
This software is Copyright (c) 2019 by Andrea Telatin.
This is free software, licensed under:
The MIT (X11) License
To install FASTX::Reader, copy and paste the appropriate command in to your terminal.
cpanm
cpanm FASTX::Reader
CPAN shell
perl -MCPAN -e shell install FASTX::Reader
For more information on module installation, please visit the detailed CPAN module installation guide.