Mercurial > repos > peterjc > tmhmm_and_signalp
comparison tools/protein_analysis/seq_analysis_utils.py @ 34:7a2e20baacee draft default tip
"v0.2.13 - Python 3 fix for raising StopIteration"
| author | peterjc |
|---|---|
| date | Thu, 17 Jun 2021 17:58:23 +0000 |
| parents | 20da7f48b56f |
| children |
comparison
equal
deleted
inserted
replaced
| 33:4fcc441269f5 | 34:7a2e20baacee |
|---|---|
| 17 from time import sleep | 17 from time import sleep |
| 18 | 18 |
| 19 if sys.version_info[0] < 3: | 19 if sys.version_info[0] < 3: |
| 20 range = xrange # noqa: F821 | 20 range = xrange # noqa: F821 |
| 21 | 21 |
| 22 __version__ = "0.0.4" | 22 __version__ = "0.0.5" |
| 23 | 23 |
| 24 try: | 24 try: |
| 25 from multiprocessing import cpu_count | 25 from multiprocessing import cpu_count |
| 26 except ImportError: | 26 except ImportError: |
| 27 # Must be under Python 2.5, this is copied from multiprocessing: | 27 # Must be under Python 2.5, this is copied from multiprocessing: |
| 106 raise ValueError( | 106 raise ValueError( |
| 107 "Sequence %s is length %i, max length %i" | 107 "Sequence %s is length %i, max length %i" |
| 108 % (title.split()[0], len(seq), max_len) | 108 % (title.split()[0], len(seq), max_len) |
| 109 ) | 109 ) |
| 110 yield title, seq | 110 yield title, seq |
| 111 raise StopIteration | |
| 112 | 111 |
| 113 | 112 |
| 114 def split_fasta( | 113 def split_fasta( |
| 115 input_filename, | 114 input_filename, |
| 116 output_filename_base, | 115 output_filename_base, |
