[Bioperl-l] Recoding Bio::SimpleAlign

Jun Yin jun.yin at ucd.ie
Mon Jul 19 06:43:50 EDT 2010


Thx for all your comments.

1. About each_seq(each_Seq)
As Chris Fields says, we tend to capitalize the method name which returns
objects. each_Seq actually returns a list of Bio::LocatableSeq objects, so
it is better to use a capitalized name as each_Seq.
But as Hilmar Lapp mentioned, each_XXX is not a clear name either, because
it may be confused with the each() function in Core. So it may need to be
renamed to next_Seq eventually.

Usually, what I do for the old method is:

sub each_seq {
    my $self = shift;
    $self->deprecated("each_seq - deprecated method. Use each_Seq()

Thus, if you call the old method, it will still continue to run, but give a
deprecated warning. This is done on all deprecated methods.

2. To Bernd Web, " So the change here is that now the default values are
actually set in new, instead of setting a the default by calling gap_char."

Yes, gap_char has a default value "-" now, so is missing_char "?" and
match_char ".".

3. To Bernd Web and Chris Fields,
remove_redundant_Seqs() is just an alias for purge(). 
However, splice_by_seq_pos() is reimplemented and merged with the old
remove_gaps(), because these two methods are actually doing similar things.
The new remove_gaps() is:

Title     : remove_gaps
 Usage     : $aln2 = $aln->remove_gaps(-reference=>5)
 Function  : Creates an aligment with gaps removed
 Returns   : a Bio::SimpleAlign object
 Args      : -GAPCHAR a gap character(optional) if none specified taken
                from $self->gap_char,
             -ALLGAPCOL $all_gaps_columns flag (1 or 0, default is 0)
                 indicates that only all-gaps columns should be deleted
             -REFERENCE splices all aligned sequences where the specified 
                 sequence has gaps.

If you call the old splice_by_seq_pos(), it will be redirected to
remove_gaps() by:
sub splice_by_seq_pos{
    my $self = shift;
    $self->deprecated("splice_by_seq_pos - deprecated method. Use
remove_gaps() instead.");

When I finally finish the recoding for Bio::SimpleAlign, I will write an
online HOWTO. 
Plus, I think I will include an update log, to show which method is renamed
and which is reimplemented, thus to make things clearer.

Jun Yin
Ph.D. student in U.C.D.

Bioinformatics Laboratory
Conway Institute
University College Dublin


__________ Information from ESET Smart Security, version of virus signature
database 5291 (20100719) __________

The message was checked by ESET Smart Security.


More information about the Bioperl-l mailing list