[Bioperl-l] Bio::AlignIO::Mase

Tristan Lefebure tristan.lefebure at gmail.com
Wed Jun 8 12:45:22 UTC 2011


Hi there,

I have some weird alignments with some numerical code stored 
within the sequence strings (eg. frameshift genewise code). 
Most AlignIO module I have tried eat them without any 
trouble except for Bio::AlignIO::Mase.

The following patch seems to do the trick:

diff -u mase.pm mase_mod.pm
--- mase.pm     2011-06-08 14:08:58.558033996 +0200
+++ mase_mod.pm 2011-06-08 14:09:20.388066014 +0200
@@ -109,7 +109,7 @@
 
        while( $entry = $self->_readline) {
            $entry =~ /^;/ && last;
-           $entry =~ s/[^A-Za-z\.\-]//g;
+           $entry =~ s/[^A-Za-z0-9\.\-]//g;
            $seq .= $entry;
        }
        if( $end == -1) {

But I am left with the feeling that I don't really 
understand why this works (which I don't quite like before 
pushing a patch...)

Why doing a s///g instead of a simple m//, and why doing 
'/[^' and not '/^['... Is that linked to that fact that $/ 
was modified to read chunks of files? BTW where is $/ set? I 
searched in Bio::Root::IO but didn't find it... 

Oh so many questions...

Thanks!

--
Tristan






More information about the Bioperl-l mailing list