Included libraries | Package variables | General documentation | Methods |
DESTROY | No description | Code |
getnucs | No description | Code |
new | No description | Code |
next_locus | No description | Code |
open_gb | No description | Code |
read_locus | No description | Code |
DESTROY | description | prev | next | Top |
if(exists $_[0]->{INSTANCE} && $FH{$_[0]->{INSTANCE}}){ close ($FH{$_[0]->{INSTANCE}}); delete($FH{$_[0]->{INSTANCE}}); }}
getnucs | description | prev | next | Top |
my $this = shift; my $fh = $FH{$this->{INSTANCE}}; while(<$fh>){ $this->{PREVLINE} = $_; last if (/^\s*\n$/ || /^>/); s/[^A-Za-z]//g; $this->{SEQ} .= lc($_); }}
new | description | prev | next | Top |
my $pkg = shift; my $this = {}; bless $this; return $this;}
next_locus | description | prev | next | Top |
my $this = shift; my $msg = shift; my $file = $this->{FILENAME}; my $prev = $this->{PREVLINE}; my $inst = $this->{INSTANCE}; undef %$this; $this->{FILENAME} = $file; $this->{PREVLINE} = $prev; $this->{INSTANCE} = $inst; $this->read_locus(); $this->getnucs(); if (defined($this->{SEQ})){ $this->seq_info() unless($msg); return 1; }elsif(defined($this->{LOCUS}->{id})){ carp('No sequence found for ' . $this->{LOCUS}->{id}); return -1; }else{ return 0; }}
open_gb | description | prev | next | Top |
my $this = shift; my $filename = shift; $this->{PREVLINE} = ''; $this->{FILENAME} = $filename; $this->{INSTANCE} = $filename . '-' . time() . '-' . rand(); if($filename =~ /\.gz$/){ $FH{$this->{INSTANCE}} = new IO::Zlib; $FH{$this->{INSTANCE}}->open($filename, 'rb') or croak("Error at G::IO::FastaI: $!\n");; }else{ $FH{$this->{INSTANCE}} = new IO::File; open($FH{$this->{INSTANCE}}, $filename) or croak("Error at G::IO::FastaI: $!\n"); } return $FH{$this->{INSTANCE}};}
read_locus | description | prev | next | Top |
my $this = shift; if($this->{PREVLINE} =~ /^>(.*)$/){ $this->{LOCUS}->{id} = $1; return; } my $fh = $FH{$this->{INSTANCE}}; while(<$fh>){ chomp; if (/^>(.*)$/){ $this->{LOCUS}->{id} = $1; last; } }}