NAME

FASTX::PE - A Paired-End FASTQ files reader, based on FASTX::Reader.

VERSION

version 0.82

SYNOPSIS

use FASTX::PE;
my $filepath = '/path/to/assembly_R1.fastq';
# Will automatically open "assembly_R2.fastq"
my $fq_reader = FASTX::Reader->new({
  filename => "$filepath",
});

while (my $seq = $fasta_reader->getRead() ) {
  print $seq->{name}, "\t", $seq->{seq1}, "\t", $seq->{qual1}, "\n";
  print $seq->{name}, "\t", $seq->{seq2}, "\t", $seq->{qual2}, "\n";
}

BUILD TEST

Each GitHub release of the module is tested by Travis-CI using multiple Perl versions (5.14 to 5.28).

In addition to this, every CPAN release is tested by the CPAN testers grid.

METHODS

new()

Initialize a new FASTX::Reader object passing 'filename' argument. Will open a filehandle stored as $object->{fh}.

my $seq_from_file = FASTX::Reader->({ filename => "$file" });

To read from STDIN either pass {{STDIN}} as filename, or don't pass a filename at all:

my $seq_from_stdin = FASTX::Reader->();

The parameter loadseqs will preload all sequences in a hash having the sequence name as key and its sequence as value.

my $seq_from_file = FASTX::Reader->({
  filename => "$file",
  loadseqs => 1,
});

getReads()

Will return the next sequences in the FASTA / FASTQ file. The returned object has these attributes:

name

header of the sequence (identifier)

comment1 and comment2

any string after the first whitespace in the header, for the first and second paired read respectively.

seq1 and seq2

DNA sequence for the first and the second pair, respectively

qual1 and qual2

quality for the first and the second pair, respectively

SEE ALSO

FASTX::Reader

The FASTA/FASTQ parser this module is based on.

AUTHOR

Andrea Telatin <andrea@telatin.com>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2019 by Andrea Telatin.

This is free software, licensed under:

The MIT (X11) License