[Bioperl-l] ClustalW Score?

Kevin Brown Kevin.M.Brown at asu.edu
Wed May 30 19:52:01 UTC 2007


> You can do it without redirecting STDOUT or creating a new 
> file, just change the system call to:
> 
> Here is the code for running in _run in the module:
>     my $commandstring = $self->executable."$instring"."$param_string";
>      $self->debug( "clustal command = $commandstring");
>      my $status = system($commandstring);
>       unless( $status == 0 ) {
>            $self->warn( "Clustalw call ($commandstring) crashed: $?  
> \n");
>            return undef;
>       }
> 
> Do something like:
> 
> my $fh;
> open($fh, "$commandstring |");
> my $score;
> while(<$fh>) {
>    $score = $1 if ($_ =~ /Score:(\d+)/); } close($fh);
> 
> ... then at the bottom after the alignment is created do:
> 
> $aln->score($score);
> 
> 
> There may be some more debugging b/c if you invoke the quiet 
> => 1 parameter there may be an automatic ">& /dev/null" 
> appended to the end of the parameter string that you'll need 
> to figure out how to override.
> 
> Sorry I don't have more time to help; I hope this gets you started.

I did it my way as I was doing it without modifying the Bioperl code (in
case I later updated to a new version and forgot about the changes I had
put into it).  So that code just sits in my perl script where it calls
the Bioperl module to create the Clustal alignment object.




More information about the Bioperl-l mailing list