BioX-Seq

 view release on metacpan or  search on metacpan

lib/BioX/Seq/Stream.pm  view on Meta::CPAN

use constant MAGIC_BZIP => 'BZh';
use constant MAGIC_FQZC => '.fqz';
use constant MAGIC_BAM  => pack('C4', 0x42, 0x41, 0x4d, 0x01);
use constant MAGIC_2BIT => pack('C4', 0x1a, 0x41, 0x27, 0x43);
use constant MAGIC_ZSTD => pack('C4', 0x28, 0xB5, 0x2F, 0xFD);

sub new {

    my ($class,$fn) = @_;

    my $self = bless {} => $class;

    if (defined $fn) {

        my $fh = openhandle($fn); # can pass filehandle too;
        if (! defined $fh) { # otherwise assume filename
            
            #if passed a filename, try to determine if compressed
            open $fh, '<', $fn or die "Error opening $fn for reading\n";

            #read first four bytes as raw

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.981 second using v1.00-cache-1.14-grep-28634ff-cpan-207214f8fbd )