biopython/biopython — pull request #53 by bow (2012-07-14 20:35:08+00:00)
Title: Improvements and additions to amino acid handling functions in SeqUtils 

This pull request updates the `SeqUtils.seq3` function and adds a new `SeqUtils.seq1` function.

The updated `SeqUtils.seq3` function now accepts two more extra arguments:

* `term_map`, which is a mapping of custom amino acid termination character (e.g. `{'*': '***'}`

* `undef_code`, which is a string for undefined characters

I've kept the previously hard coded values as the defaults for these two values, so this shouldn't introduce any bugs.

The new `SeqUtils.seq1` function is basically the reverse of `seq3`; it transforms a string of three-letter amino acid codes into a string of containing single codes.

I stumbled on this when creating the parser for Exonerate. It uses three-letter AA codes (which I'm trying to turn into one-letter codes), and I thought it would be more useful if the three-to-one AA transformation code is made available Biopython-wide.

I've also updated the docstrings, and all doctests pass.