# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+use warnings;
use warnings;
use strict;
use vars qw( @ISA @EXPORT );
sysseek $fh, 0, 0;
- $signature = &unpack_32bit( $fh );
- $version = &unpack_32bit( $fh );
- $seq_count = &unpack_32bit( $fh );
- $reserved = &unpack_32bit( $fh );
+ $signature = unpack_32bit( $fh );
+ $version = unpack_32bit( $fh );
+ $seq_count = unpack_32bit( $fh );
+ $reserved = unpack_32bit( $fh );
- &Maasha::Common::error( qq(2bit file signature didn't match - inverse bit order?) ) if $signature != 0x1A412743;
+ Maasha::Common::error( qq(2bit file signature didn't match - inverse bit order?) ) if $signature != 0x1A412743;
for ( $i = 0; $i < $seq_count; $i++ )
{
- $seq_name_size = &unpack_8bit( $fh );
+ $seq_name_size = unpack_8bit( $fh );
sysread $fh, $string, $seq_name_size;
$seq_name = unpack( "A$seq_name_size", $string );
- $offset = &unpack_32bit( $fh );
+ $offset = unpack_32bit( $fh );
push @AoA, [ $seq_name, $offset ];
}
sysseek $fh, $offset, 0;
- $seq_len = &unpack_32bit( $fh );
+ $seq_len = unpack_32bit( $fh );
$sub_len = $seq_len if $sub_len > $seq_len;
- $n_count = &unpack_32bit( $fh );
+ $n_count = unpack_32bit( $fh );
- map { push @n_begs, &unpack_32bit( $fh ) } 1 .. $n_count;
- map { push @n_sizes, &unpack_32bit( $fh ) } 1 .. $n_count;
+ map { push @n_begs, unpack_32bit( $fh ) } 1 .. $n_count;
+ map { push @n_sizes, unpack_32bit( $fh ) } 1 .. $n_count;
- $m_count = &unpack_32bit( $fh );
+ $m_count = unpack_32bit( $fh );
- map { push @m_begs, &unpack_32bit( $fh ) } 1 .. $m_count;
- map { push @m_sizes, &unpack_32bit( $fh ) } 1 .. $m_count;
+ map { push @m_begs, unpack_32bit( $fh ) } 1 .. $m_count;
+ map { push @m_sizes, unpack_32bit( $fh ) } 1 .. $m_count;
- $reserved = &unpack_32bit( $fh );
+ $reserved = unpack_32bit( $fh );
$offset += 4 + 4 + $n_count * 8 + 4 + $m_count * 8 + 4;
- $seq = &unpack_dna( $fh, $offset, $sub_beg, $sub_len );
+ $seq = unpack_dna( $fh, $offset, $sub_beg, $sub_len );
for ( $n = 0; $n < $n_count; $n++ )
{
$seq_offset = 0; # offset for reading sequence from FASTA file
$offset = 16; # offset starting after header line which is 16 bytes
- while ( $entry = &Maasha::Fasta::get_entry( $fh_in ) )
+ while ( $entry = Maasha::Fasta::get_entry( $fh_in ) )
{
$seq_len = length $entry->[ SEQ ];
$seq_name_len = length $entry->[ SEQ_NAME ];
- $mask_index = &mask_locate( $entry->[ SEQ ], $mask );
+ $mask_index = mask_locate( $entry->[ SEQ ], $mask );
$pack_len = ( $seq_len + ( 4 - ( $seq_len ) % 4 ) ) / 4;
$seq = uc $seq;
$seq =~ tr/RYWSMKHDVBN/TTTTTTTTTTT/;
- $bin .= &pack_dna( $seq );
+ $bin .= pack_dna( $seq );
print $fh_out $bin;
}