[Bioperl-l] extract overhangs from Clustalw

Roy Chaudhuri roy.chaudhuri at gmail.com
Tue Feb 15 12:19:00 UTC 2011


Hi Rondon,

I'm assuming you mean "how do I remove columns with gaps at either end 
of the alignment?" (since your alignment should be flush if it has come 
from ClustalW). In future, when you ask questions on the list please try 
and give as much information as possible, that way we do not have to 
guess at what you mean.

If those are the only gaps in the alignment, then this will work:

my $gapfree=$aln->remove_gaps;

However, if there are gaps in the central region that you want to keep, 
then try something like this:

$aln->gap_line=~/^(-*).*[^-](-*)$/;
my $endgapfree=$aln->remove_columns([0,length($1)-1], 
[$aln->length-length($2), $aln->length-1]);

This will not work correctly if there aren't gaps at both ends of the 
alignment, so you may have to add in a few checks if you can't make that 
assumption.

Cheers,
Roy.

On 14/02/2011 20:52, Jordi Durban wrote:
> What do you mean by "overhangs"?
> Have ypu heard about Extending Bio::Tools::Run::Clustalw?
> hope this helps.
> 2011/2/14 Rondon Neto<rondonbio at yahoo.com.br>
>
>> How to extract overhangs from Clustalw alignments and return the aln file
>> without the overhangs? I'm trying to use Bio::AlignIO, but Im confused.
>> Thank you very much.
>>
>> Rondon
>>
>>
>>
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>>
>
>
>




More information about the Bioperl-l mailing list