[Bioperl-l] ClustalW Score?

Jason Stajich jason at bioperl.org
Wed May 30 18:54:20 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.

-jason
On May 30, 2007, at 10:18 AM, Ryan Golhar wrote:

> Did you see Kevin's response?  That's one possible solution that  
> could be
> implemented...
>
>
> -----Original Message-----
> From: Jason Stajich [mailto:jason.stajich at gmail.com] On Behalf Of  
> Jason
> Stajich
> Sent: Wednesday, May 30, 2007 12:05 PM
> To: golharam at umdnj.edu
> Subject: Re: [Bioperl-l] ClustalW Score?
>
>
> Nope it isn't parsed since it is part of the STDOUT from the  
> program not the
> alignment.  If you want to add parsing of the STDOUT from Clustalw  
> someone
> will need to refactor how the program is run and capture and parse the
> STDOUT. The score can be added to the score field of the  
> SimpleAlign object,
> but again since there is no where for it to be stored in a clustalw
> alignment file it won't be round tripped anywhere. I think  
> stockholm will
> manage it for you though.
>
> Do you know what the score represents - can it be computed from the
> alignment itsself?
>
> -jason
>
> On May 30, 2007, at 8:40 AM, Ryan Golhar wrote:
>
>
> How do I get the clustalw score from a clustalw alignment?  I'm  
> using the
> following code to align my sequences:
>
> $aln_factory = Bio::Tools::Run::Alignment::Clustalw->new();
>
> $seq[0] = ...
> $seq[1] = ...
> $seq[2] = ...
> $seq[3] = ...
>
> $aln = $aln_factory->align(\@seq);
>
> I can get the percentage identity from the Bio::SimpleAlign object,  
> but
> there is no score.  I looked into it further and it doesn't look  
> like the
> score is being captured anywhere.  So, how does one get the score from
> ClustalW using this method?
>
> Ryan
>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>
>
> --
> Jason Stajich
> jason at bioperl.org
> http://jason.open-bio.org/
>
>

--
Jason Stajich
jason at bioperl.org
http://jason.open-bio.org/





More information about the Bioperl-l mailing list