G::Tools

GlimmerM

Summary Included libraries Package variables Synopsis Description General documentation Methods

Summary
G::IO::Annotation
Package variables top
Globals (from use vars definitions)
$AUTOLOAD
@INC
@EXPORT
$VERSION
@EXPORT_OK
Included modulestop
G::Messenger
G::Skyline
strict
Inherit top
AutoLoader Exporter
Synopsistop
    use G::Tools::GlimmerM;
Descriptiontop
 Annotates the genome sequence. 


Methodstop
DESTROYNo descriptionCode
annotate_with_glimmerMNo descriptionCode
run_glimmerMNo descriptionCode

Methods description


Methods code

DESTROYdescriptiontopprevnext
sub DESTROY {
    my $self = shift;

    undef %{$self};
}
annotate_with_glimmerMdescriptiontopprevnext
sub annotate_with_glimmerM {
    my $file = shift;
    my $out = shift;

    my $this = new G::Skyline("blessed");    
    open (FASTA, $file);
    while(<FASTA>){
	if (/^\>/){
	    s/\>//;
	    my @hoge = split;
	    $this->{LOCUS}->{id} = $hoge[0];
	    next;
	}else{
	    s/[^a-zA-Z]//g;
	    $this->{SEQ} .= lc($_);
	}
    }
    close(FASTA);

    $this->{"CDS0"}->{dummy} = 1;
    $this->{"FEATURE0"}->{dummy} = 1;

    my $count = 0;
    my $first = 0;
    open (GLIMMER, $out) || die();
    while(<GLIMMER>){last if (/\#/);}
    while(<GLIMMER>){
	chomp;
	s/^\s+//g;
	if ($_ eq ''){
	    $count ++;
	    $first = 1;
	}else{
	    my @line = split;
	    if ($first){
		$first = 0;
		$this->{"CDS$count"}->{feature} = $count;
		$this->{"FEATURE$count"}->{cds} = $count;
		$this->{"FEATURE$count"}->{type} = 'CDS';
		$this->{"CDS$count"}->{on} = 1;
		$this->{"FEATURE$count"}->{on} = 1;
		$this->{"FEATURE$count"}->{direction} = 'direct';
		$this->{"CDS$count"}->{direction} = 'direct';
		$this->{"FEATURE$count"}->{gene} = sprintf "gene%05d", $count;
		$this->{"CDS$count"}->{gene} = sprintf "gene%05d", $count;

		if($line[2] eq '-'){
		    $this->{"FEATURE$count"}->{direction} = 'complement';
		    $this->{"CDS$count"}->{direction} = 'complement';
		}
	    }

	    if ($line[3] eq 'Initial' || $line[3] eq 'Single'){
		$this->{"CDS$count"}->{start} = $line[4];
		$this->{"FEATURE$count"}->{start} = $line[4];
	    }
	    if ($line[3] eq 'Terminal' || $line[3] eq 'Single'){
		$this->{"CDS$count"}->{end} = $line[5];
		$this->{"FEATURE$count"}->{end} = $line[5];
	    }
	    $this->{"CDS$count"}->{join} .= sprintf "%d..%d,", $line[4], $line[5]
		unless($line[3] eq 'Single');
	    $this->{"FEATURE$count"}->{join} .= sprintf "%d..%d,", $line[4], $line[5]
		unless($line[3] eq 'Single');
	}
    }
    close(GLIMMER);

    return $this;
}
run_glimmerMdescriptiontopprevnext
sub run_glimmerM {
    my $this = shift;
    my $file = shift;
    my $out = shift;
    my $program = shift || 'bin/glimmer_linux';
    my $train = shift || 'train/';

    system("./$program $file orfs -d $train > $out");
}

General documentation

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