G::Tools
Alignment
G::Tools::Alignment - Perl extension for blah blah blah
|
Globals (from use vars definitions) |
@EXPORT |
$VERSION |
@EXPORT_OK |
use G::Tools::Alignment; blah blah blah
|
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.
|
DESTROY | No description | Code |
_clustalw | No description | Code |
new | No description | Code |
Methods description
Methods code
sub DESTROY
{ my $self = shift;
}
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);
}
sub new
{ my $pkg = shift;
my $filename = shift;
my $option = shift;
my $this;
return $this;
}
General documentation