G::IO

FastaI

Summary Included libraries Package variables Synopsis Description General documentation Methods

Summary
G::IO::FastaI
Package variables top
Globals (from use vars definitions)
$AUTOLOAD
@INC
$VERSION = '1.0'
Privates (from my definitions)
$infile = ''
Included modulestop
G
G::Messenger
strict
Inherit top
G::IO::GenBankO G::Prelude
Synopsistop
 use G::IO::FastaI;
@ISA = (G::IO::FastaI);
Descriptiontop
 Fasta input parser.
Intended for internal use only.


Methodstop
close_gbNo descriptionCode
filepathNo descriptionCode
getnucsNo descriptionCode
goto_originNo descriptionCode
newNo descriptionCode
next_locusNo descriptionCode
open_gbNo descriptionCode
read_featuresNo descriptionCode
read_headerNo descriptionCode
read_locusNo descriptionCode

Methods description


Methods code

close_gbdescriptiontopprevnext
sub close_gb {
    my $this = shift;
    close(FASTA);
}
filepathdescriptiontopprevnext
sub filepath {
    my $this = shift;

    return $infile;
}
getnucsdescriptiontopprevnext
sub getnucs {
    my $this = shift;

    while(<FASTA>){
	last if (/^\s*\n$/);
	s/[^A-Za-z]//g;
	$this->{"SEQ"} .= lc($_);
    }
}
goto_origindescriptiontopprevnext
sub goto_origin {
    my $this = shift;
}
newdescriptiontopprevnext
sub new {
    my $pkg = shift;
    my $filename = shift;
    my $option = shift;
    my $this = new G("blessed");

    bless $this;

    return $this;
}
next_locusdescriptiontopprevnext
sub next_locus {
    my $this = shift;
    my $msg = shift;
    undef %{$this};
    $this->read_locus();
    $this->getnucs();

    if (length($this->{SEQ}) > 0){
	$this->seq_info() unless($msg);
	return 1;
    }else{
	return 0;
    }
}
open_gbdescriptiontopprevnext
sub open_gb {
    my $this = shift;
    my $filename = shift;
    $infile = $filename;
    
    open(FASTA, $filename) || die("Error at G::IO::FastaI: $!\n");
    return *FASTA;
}
read_featuresdescriptiontopprevnext
sub read_features {
    my $this = shift;
}
read_headerdescriptiontopprevnext
sub read_header {
    my $this = shift;
}
read_locusdescriptiontopprevnext
sub read_locus {
    my $this = shift;
    local($_);

    while(<FASTA>){
	chomp;
	if (/^>(.*)$/){
	    $this->{LOCUS}->{id} = $1;
	    last;
	}
    }
}

General documentation

AUTHOR top
Kazuharu Gaou Arakawa, gaou@g-language.org
SEE ALSO top
perl(1).