[Bioperl-l] Simple Align, remove columns

Shawn shawnh@fugu-sg.org
10 Dec 2002 00:08:27 +0800


Hi Folks,
	I couldn't find a way to remove certain columns from a SimpleAlign
object say for example mismatches which would be useful to do before
passing it to some tree building program. I have added a little method
remove_column that does the following:

use Bio::AlignIO;


my $aio = Bio::AlignIO->new(-file=>$ARGV[0],-format=>"phylip");
my $aln = $aio->next_aln;

my $aln = $aln->remove_column(['weak','mismatch']);
my $aio = Bio::AlignIO->new(-fh=>\*STDOUT,-format=>"phylip");
$aio->write_aln($aln);

remove_column takes in either 'weak'|'mismatch'|'match'|'strong'
as specified by the match_line method and basically returns a new
SimpleAlign object with the columns removed.

Any comments welcomed..if there are no problems with this being part of
SimpleAlign, I will commit the code.


shawn