[Bioperl-l] Interface of the method

Jun Yin jun.yin at ucd.ie
Thu Jun 17 10:24:50 UTC 2010


Hi,

 

I am think of updating the methods in Bio::SimpleAlign to a more usable
form.

 

For example, the current method for remove_columns is:

$aln->remove_columns([0,0],[6,8]); #remove the 1st, and 6th to 8th columns

Or $aln->remove_columns(['mismatch','weak']); #remove the mismatched and
weak columns

 

And, select columns is by:

$aln2 = $aln->slice(20,30); #select the 20th to 30th columns

 

You may notice that even similar methods have difference ways to use, (the
first uses references and the second only defines $start and $end).

This may cause some confusion.So I propose that we should use a more
consistent way for similar functions.

For example, the methods of

select_Seq

select_columns

remove_Seq

remove_columns

mask_columns

.

should have the same interface.

 

One solution is 

$new_aln=$aln->select_Seq(1,3,5..10,15); #the user can select the first,
third, fifth to tenth and fifteenth sequences at the same time

But the problem is that it is hard to distinguish optional parameters from
the method call.


So I suggest, we can do 

$new_aln=$aln->select_Seq([1,3,5..10,15],"toggle")

Or

$new_aln=$aln->select_columns([2.25,34,52..60])

 

So that all the selections are based on an array reference, and the
parameters are strings, thus easy to control the method.

 

As the package is community based, I am glad to hear your suggestions before
I change the Bio::SimpleAlign package.

 

Cheers,

Jun Yin

Ph.D. student in U.C.D.

 

Bioinformatics Laboratory

Conway Institute

University College Dublin

 




More information about the Bioperl-l mailing list