Mercurial > repos > peterjc > tmhmm_and_signalp
comparison tools/protein_analysis/seq_analysis_utils.py @ 23:e1996f0f4e85 draft default tip
"v0.2.13 - Python 3 fix for raising StopIteration"
author | peterjc |
---|---|
date | Thu, 17 Jun 2021 17:59:33 +0000 |
parents | 238eae32483c |
children |
comparison
equal
deleted
inserted
replaced
22:e1afa4b0b682 | 23:e1996f0f4e85 |
---|---|
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, |