allpy
changeset 326:01547d8d5c36
save_fasta: always prepend space before description, even if no name is given
author | Daniil Alexeyevsky <me.dendik@gmail.com> |
---|---|
date | Fri, 17 Dec 2010 00:57:35 +0300 |
parents | 6fdc4406e2fd |
children | 0435d9cc18d3 |
files | allpy/fasta.py |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line diff
1.1 --- a/allpy/fasta.py Fri Dec 17 00:57:06 2010 +0300 1.2 +++ b/allpy/fasta.py Fri Dec 17 00:57:35 2010 +0300 1.3 @@ -20,8 +20,9 @@ 1.4 Splits long lines to substrings of length=long_line 1.5 To prevent this, set long_line=None 1.6 """ 1.7 - header = " ".join(filter(None, [name, description])) 1.8 - out_file.write(">%s\n" % header) 1.9 + if description: 1.10 + name += " " + description 1.11 + out_file.write(">%s\n" % name) 1.12 if long_line: 1.13 for i in range(0, len(string) // long_line + 1): 1.14 out_file.write("%s \n" % string[i*long_line : i*long_line + long_line])