G::Tools

Alignment

Summary Included libraries Package variables Synopsis Description General documentation Methods

Summary
G::Tools::Alignment - Perl extension for blah blah blah
Package variables top
Globals (from use vars definitions)
@EXPORT
$VERSION
@EXPORT_OK
Included modulestop
G::Messenger
SubOpt
strict
Inherit top
AutoLoader Exporter
Synopsistop
  use G::Tools::Alignment;
blah blah blah
Descriptiontop
Stub documentation for G::Tools::Alignment was created by h2xs. It looks like the
author of the extension was negligent enough to leave the stub
unedited.

Blah blah blah.
Methodstop
DESTROYNo descriptionCode
_clustalwNo descriptionCode
newNo descriptionCode

Methods description


Methods code

DESTROYdescriptiontopprevnext
sub DESTROY {
    my $self = shift;
}
_clustalwdescriptiontopprevnext
sub _clustalw {
    &opt_default(input=>"file",alnfile=>"clustalw.aln",dndfile=>"clustalw.dnd",output=>"f");
    my @args=opt_get(@_);

    my $input=&opt_val("input");
    my $alnfile=&opt_val("alnfile");
    my $dndfile=&opt_val("dndfile");
    my $output=&opt_val("output");
    my $seq;
    my @param;
    my $file;
    my %opt;
    my @aln;
    my @dnd;
    my $tmp;

    if($input eq 'seq'){
	$seq=shift @args;
	open(FILE,'>/tmp/tmp.clw');
	foreach(keys(%{$seq})){
	    print FILE '>',"$_","\n";
	    print FILE ${$seq}{$_},"\n\n";
	}
	close(FILE);
	$file="/tmp/tmp.clw"; 
    }
    else{
	$file=shift @args;
    }

    foreach(sort keys(%opt)){
	next if($opt{$_} eq '');
	push(@param,'-'.$_);
	push(@param,$opt{$_});
    }

    system('clustalw',"$file",@param);

    if($input eq 'seq'){
        unlink('/tmp/tmp.clw');
	if($output eq 'n'){	    
	    open(FILE,'/tmp/tmp.aln');
	    @aln=<FILE>;
	    close(FILE);
	    open(FILE,'/tmp/tmp.dnd');
	    @dnd=<FILE>;
	    close(FILE);
	    unlink('/tmp/tmp.aln');
	    unlink('/tmp/tmp.dnd');
	    return (\@aln,\@dnd);
	}
	else{
	    system('cp','/tmp/tmp.aln',"\.\/$alnfile");
	    system('cp','/tmp/tmp.dnd',"\.\/$dndfile");
	    unlink('/tmp/tmp.aln');
	    unlink('/tmp/tmp.dnd');
	}
    } 
    else{
	if($output eq "n"){
	    $tmp=substr($file,0,rindex($file,'.')).'.aln';
	    open(FILE,$tmp);
	    @aln=<FILE>;
	    close(FILE);
	    unlink("$tmp");
	    $tmp=substr($file,0,rindex($file,'.')).'.dnd';
	    open(FILE,$tmp);
	    @dnd=<FILE>;
	    close(FILE);
	    unlink("$tmp");
	    return (\@aln,\@dnd);
	}
    }

    return $file.' '.join(' ',@param);
}
newdescriptiontopprevnext
sub new {
    my $pkg = shift;
    my $filename = shift;
    my $option = shift;
    my $this;

    return $this;
}

General documentation

AUTHOR top
A. U. Thor, a.u.thor@a.galaxy.far.far.away
SEE ALSO top
perl(1).