[Bioperl-l] ClustalW Score?

Kevin Brown Kevin.M.Brown at asu.edu
Wed May 30 17:16:49 UTC 2007


> 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?


        open(OUTCOPY, ">&STDOUT")  or die "Couldn't dup STDOUT: $!";
        open(STDOUT,  ">log.test") or die "Couldn't open log.test: $!";
        push @aln, $factory->align(\@seq);
        close STDOUT;
        open(STDOUT, ">&OUTCOPY");
        open(TEMP,   "log.test");
        while (<TEMP>)
        {

                if ($_ =~ /Score:(\d+)/)
                {
                        $aln->score($1);
                        print "Found score of $1\n";
                }
        }
        close TEMP;
        unlink("log.test");




More information about the Bioperl-l mailing list