[Bioperl-l] Perl/Tk and clustalw

Nathan Haigh nathanhaigh at ukonline.co.uk
Fri May 28 11:52:16 EDT 2004

I'm building a tool utilising Perl/Tk and BioPerl.

Part of my script (on the press of a button), retrieves sequences from a
text widget, converts them to an array of Bio::Seq objects, builds a
clustalw alignment factory and passes the factory a reference to the
Bio::Seq array for alignment. Then the display names are flattened and the
alignment displayed in another Tk text widget.

Here's part of the code that I refer to:

sub seq_align {
     my $factory = Bio::Tools::Run::Alignment::Clustalw->new(@params);
     my $aln = $factory->align($seq_array_ref);     # returns a simplealign
     $aln->set_displayname_flat();                  # don't include
start-stop in seq name
     $aln->map_chars('\.','-');                     # GCG uses . for gaps,
but the aln object has - set as gaps
     return $aln;

However I'm having a really annoying intermittent problem where sometimes
things work perfectly and other times I get an error saying:
'can't call method "set_displayname_flat" without a package or object
other times I get
'Couldn't open sequence file' error from clustalw

on repeated pressing of the button that does all this alignment, sometimes
it fails, other times it works!

I've used ActiveState Komodo to try and debug the problem, but i can't get
it to fail! 

Has anyone had a similar problem? It appears as though Tk might be trying to
execute the remaining script by doing ' $aln->set_displayname_flat ' before
clustalw has returned the alignment!
Any thoughts/ideas! This is really bugging!


More information about the Bioperl-l mailing list