G::Tools GlimmerM
Included librariesPackage variablesGeneral documentationMethods
Package variables
No package variables defined.
Included modules
G::Messenger
SelfLoader
Inherit
Exporter
Synopsis
No synopsis!
Description
No description!
Methods
annotate_with_glimmerM
No description
Code
run_glimmerM
No description
Code
Methods description
None available.
Methods code
annotate_with_glimmerMdescriptionprevnextTop
sub annotate_with_glimmerM {
    require G::IO;

    my $file = shift;
    my $out = shift;

    my $this = new G::IO("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_glimmerMdescriptionprevnextTop
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
No general documentation available.