|
5 | 5 | import subprocess
|
6 | 6 | import platform
|
7 | 7 | import uuid
|
8 |
| -from platform import python_version |
9 | 8 |
|
10 |
| -from .utils import set_up_logger |
| 9 | +from .utils import set_up_logger, check_file_for_error_message |
11 | 10 |
|
12 | 11 | logger = set_up_logger()
|
13 | 12 |
|
@@ -183,28 +182,48 @@ def setup(module, verbose=True, out=None):
|
183 | 182 |
|
184 | 183 | # Check if files are present
|
185 | 184 | if os.path.exists(elm_instances_fasta):
|
| 185 | + # Check that file does not just contain an error message |
| 186 | + check_file_for_error_message( |
| 187 | + elm_instances_fasta, |
| 188 | + "ELM instances fasta file", |
| 189 | + ELM_INSTANCES_FASTA_DOWNLOAD, |
| 190 | + ) |
186 | 191 | if verbose:
|
187 | 192 | logger.info(f"ELM sequences file present.")
|
188 | 193 | else:
|
189 | 194 | logger.error("ELM FASTA file missing.")
|
190 | 195 |
|
191 | 196 | if os.path.exists(elm_classes_tsv):
|
| 197 | + # Check that file does not just contain an error message |
| 198 | + check_file_for_error_message( |
| 199 | + elm_classes_tsv, "ELM classes tsv file", ELM_CLASSES_TSV_DOWNLOAD |
| 200 | + ) |
192 | 201 | if verbose:
|
193 | 202 | logger.info("ELM classes file present.")
|
194 | 203 | else:
|
195 | 204 | logger.error("ELM classes file missing.")
|
196 | 205 |
|
197 | 206 | if os.path.exists(elm_instances_tsv):
|
| 207 | + # Check that file does not just contain an error message |
| 208 | + check_file_for_error_message( |
| 209 | + elm_instances_tsv, "ELM instances tsv file", ELM_INSTANCES_TSV_DOWNLOAD |
| 210 | + ) |
198 | 211 | if verbose:
|
199 | 212 | logger.info("ELM instances file present.")
|
200 | 213 | else:
|
201 | 214 | logger.error("ELM instances file missing.")
|
202 | 215 |
|
203 | 216 | if os.path.exists(elm_intdomains_tsv):
|
| 217 | + # Check that file does not just contain an error message |
| 218 | + check_file_for_error_message( |
| 219 | + elm_intdomains_tsv, |
| 220 | + "ELM interaction domains tsv file", |
| 221 | + ELM_INTDOMAINS_TSV_DOWNLOAD, |
| 222 | + ) |
204 | 223 | if verbose:
|
205 |
| - logger.info("ELM interactions domains file present.") |
| 224 | + logger.info("ELM interaction domains file present.") |
206 | 225 | else:
|
207 |
| - logger.error("ELM interactions domains file missing.") |
| 226 | + logger.error("ELM interaction domains file missing.") |
208 | 227 |
|
209 | 228 | elif module == "alphafold":
|
210 | 229 | if platform.system() == "Windows":
|
|
0 commit comments