FASTX::PE - A Paired-End FASTQ files reader, based on FASTX::Reader.
version 1.4.0
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"; }
Initialize a new FASTX::Reader object passing 'filename' argument for the first pairend, and optionally 'rev' for the second (otherwise can be guessed substituting 'R1' with 'R2' and '_1.' with '_2.')
my $pairend = FASTX::Reader->new({ filename => "$file_R1", rev => "$file_R2" });
To read from STDIN either pass {{STDIN}} as filename, or don't pass a filename at all. In this case the module will expect an interleaved pairedend file.
{{STDIN}}
my $seq_from_stdin = FASTX::Reader->new();
If a '_R2' file is not found, the module will try parsing as interleaved. This can be forced with:
my $seq_from_file = FASTX::Reader->new({ filename => "$file", interleaved => 1, });
Will return the next sequences in the FASTA / FASTQ file. The returned object has these attributes:
header of the sequence (identifier)
any string after the first whitespace in the header, for the first and second paired read respectively.
DNA sequence for the first and the second pair, respectively
quality for the first and the second pair, respectively
The FASTA/FASTQ parser this module is based on.
Andrea Telatin <andrea@telatin.com>
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.