[Biopython] suggestion for a little change in the ACE cookbook

David WInter winda002 at student.otago.ac.nz
Mon Jul 6 19:31:12 EDT 2009


Fungazid wrote:
> Hi,
>
> About the cookbook here
> http://biopython.org/wiki/ACE_contig_to_alignment
>
> instead of:
>
> def cut_ends(read, start, end):
>   return (start-1) * '-' + read[start-1:end] + (end +1) * '-'
>
> I think it is better to write:
>
> def cut_ends(self,read, start, end):
>     return (start-1) * 'x' + read[start-1:end-1] + (len(read)-end) * 'x'
>   

Yep, well spotted. It seems I'd also put an ugly hack in the 'pad_ends' 
function to deal with the problem (cutting the read to length before 
returning it) so we can get rid to that too ;) I've changed the code on 
the wiki.

As for adding 'x's instead of '-'s - I think this is really going to be 
a case by case thing - the contigs I had to play with had asterisks for 
gaps in the reads so I could tell the difference (and for some strange 
reason I'm squeamish about using letters to represent a gap even if 'x' 
is not an ambiguity code). Do you want to add something to the recipe to 
make it clear that someone could change the 'pad character' to suit the 
assembly you are using?

Cheers,
David








More information about the Biopython mailing list