pheval-exomiser 0.3.4__tar.gz → 0.4.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pheval_exomiser-0.3.4 → pheval_exomiser-0.4.1}/PKG-INFO +2 -2
- {pheval_exomiser-0.3.4 → pheval_exomiser-0.4.1}/pyproject.toml +2 -2
- {pheval_exomiser-0.3.4 → pheval_exomiser-0.4.1}/src/pheval_exomiser/post_process/post_process.py +2 -2
- {pheval_exomiser-0.3.4 → pheval_exomiser-0.4.1}/src/pheval_exomiser/post_process/post_process_results_format.py +129 -9
- {pheval_exomiser-0.3.4 → pheval_exomiser-0.4.1}/src/pheval_exomiser/prepare/create_batch_commands.py +33 -9
- {pheval_exomiser-0.3.4 → pheval_exomiser-0.4.1}/src/pheval_exomiser/prepare/tool_specific_configuration_options.py +2 -2
- {pheval_exomiser-0.3.4 → pheval_exomiser-0.4.1}/src/pheval_exomiser/run/run.py +40 -19
- {pheval_exomiser-0.3.4 → pheval_exomiser-0.4.1}/src/pheval_exomiser/runner.py +2 -0
- {pheval_exomiser-0.3.4 → pheval_exomiser-0.4.1}/README.md +0 -0
- {pheval_exomiser-0.3.4 → pheval_exomiser-0.4.1}/src/pheval_exomiser/__init__.py +0 -0
- {pheval_exomiser-0.3.4 → pheval_exomiser-0.4.1}/src/pheval_exomiser/cli.py +0 -0
- {pheval_exomiser-0.3.4 → pheval_exomiser-0.4.1}/src/pheval_exomiser/constants.py +0 -0
- {pheval_exomiser-0.3.4 → pheval_exomiser-0.4.1}/src/pheval_exomiser/post_process/__init__.py +0 -0
- {pheval_exomiser-0.3.4 → pheval_exomiser-0.4.1}/src/pheval_exomiser/prepare/__init__.py +0 -0
- {pheval_exomiser-0.3.4 → pheval_exomiser-0.4.1}/src/pheval_exomiser/prepare/write_application_properties.py +0 -0
- {pheval_exomiser-0.3.4 → pheval_exomiser-0.4.1}/src/pheval_exomiser/run/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pheval_exomiser
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.1
|
|
4
4
|
Summary:
|
|
5
5
|
Author: Yasemin Bridges
|
|
6
6
|
Author-email: y.bridges@qmul.ac.uk
|
|
@@ -17,7 +17,7 @@ Requires-Dist: google (>=3.0.0,<4.0.0)
|
|
|
17
17
|
Requires-Dist: numpy (<2)
|
|
18
18
|
Requires-Dist: oaklib (>=0.5.12,<0.6.0)
|
|
19
19
|
Requires-Dist: phenopackets (>=2.0.2,<3.0.0)
|
|
20
|
-
Requires-Dist: pheval (>=0.6.
|
|
20
|
+
Requires-Dist: pheval (>=0.6.7,<0.7.0)
|
|
21
21
|
Requires-Dist: pyaml (>=21.10.1,<22.0.0)
|
|
22
22
|
Requires-Dist: pydantic (>=2.7.1,<3.0.0)
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "pheval_exomiser"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.4.1"
|
|
4
4
|
description = ""
|
|
5
5
|
authors = ["Yasemin Bridges <y.bridges@qmul.ac.uk>",
|
|
6
6
|
"Julius Jacobsen <j.jacobsen@qmul.ac.uk>",
|
|
@@ -19,7 +19,7 @@ oaklib = "^0.5.12"
|
|
|
19
19
|
docker = "^6.0.1"
|
|
20
20
|
pydantic = "^2.7.1"
|
|
21
21
|
numpy = "<2"
|
|
22
|
-
pheval = "^0.6.
|
|
22
|
+
pheval = "^0.6.7"
|
|
23
23
|
|
|
24
24
|
[tool.poetry.dev-dependencies]
|
|
25
25
|
pytest = "^7.1.2"
|
{pheval_exomiser-0.3.4 → pheval_exomiser-0.4.1}/src/pheval_exomiser/post_process/post_process.py
RENAMED
|
@@ -12,9 +12,9 @@ def post_process_result_format(
|
|
|
12
12
|
variant_analysis: bool,
|
|
13
13
|
gene_analysis: bool,
|
|
14
14
|
disease_analysis: bool,
|
|
15
|
+
exomiser_version: str,
|
|
15
16
|
):
|
|
16
17
|
"""Standardise Exomiser json format to separated gene and variant results."""
|
|
17
|
-
print("...standardising results format...")
|
|
18
18
|
create_standardised_results(
|
|
19
19
|
result_dir=raw_results_dir,
|
|
20
20
|
output_dir=output_dir,
|
|
@@ -24,5 +24,5 @@ def post_process_result_format(
|
|
|
24
24
|
gene_analysis=gene_analysis,
|
|
25
25
|
disease_analysis=disease_analysis,
|
|
26
26
|
variant_analysis=variant_analysis,
|
|
27
|
+
exomiser_version=exomiser_version,
|
|
27
28
|
)
|
|
28
|
-
print("done")
|
|
@@ -4,6 +4,7 @@ from pathlib import Path
|
|
|
4
4
|
|
|
5
5
|
import click
|
|
6
6
|
import polars as pl
|
|
7
|
+
from packaging import version
|
|
7
8
|
from pheval.post_processing.post_processing import (
|
|
8
9
|
SortOrder,
|
|
9
10
|
generate_disease_result,
|
|
@@ -15,10 +16,15 @@ from pheval.utils.file_utils import files_with_suffix
|
|
|
15
16
|
|
|
16
17
|
class ModeOfInheritance(Enum):
|
|
17
18
|
AUTOSOMAL_DOMINANT = 1
|
|
19
|
+
AD = 1
|
|
18
20
|
AUTOSOMAL_RECESSIVE = 2
|
|
21
|
+
AR = 2
|
|
19
22
|
X_DOMINANT = 1
|
|
23
|
+
XD = 1
|
|
20
24
|
X_RECESSIVE = 2
|
|
25
|
+
XR = 2
|
|
21
26
|
MITOCHONDRIAL = 3
|
|
27
|
+
MT = 3
|
|
22
28
|
|
|
23
29
|
|
|
24
30
|
def trim_exomiser_result_filename(exomiser_result_path: Path) -> Path:
|
|
@@ -38,6 +44,18 @@ def extract_gene_results_from_json(
|
|
|
38
44
|
).drop_nulls()
|
|
39
45
|
|
|
40
46
|
|
|
47
|
+
def extract_gene_results_from_parquet(
|
|
48
|
+
exomiser_parquet_result: pl.DataFrame, score_name: str
|
|
49
|
+
) -> pl.DataFrame:
|
|
50
|
+
return exomiser_parquet_result.select(
|
|
51
|
+
[
|
|
52
|
+
pl.col("geneSymbol").alias("gene_symbol"),
|
|
53
|
+
pl.col("ensemblGeneId").alias("gene_identifier"),
|
|
54
|
+
pl.col(score_name).fill_null(0).round(4).alias("score"),
|
|
55
|
+
]
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
|
|
41
59
|
def extract_disease_results_from_json(exomiser_json_result: pl.DataFrame) -> pl.DataFrame:
|
|
42
60
|
return (
|
|
43
61
|
exomiser_json_result.select(
|
|
@@ -55,6 +73,18 @@ def extract_disease_results_from_json(exomiser_json_result: pl.DataFrame) -> pl.
|
|
|
55
73
|
)
|
|
56
74
|
|
|
57
75
|
|
|
76
|
+
def extract_disease_results_from_parquet(exomiser_parquet_result: pl.DataFrame) -> pl.DataFrame:
|
|
77
|
+
return (
|
|
78
|
+
exomiser_parquet_result.select(pl.col("diseaseMatches"))
|
|
79
|
+
.explode("diseaseMatches")
|
|
80
|
+
.select(
|
|
81
|
+
pl.col("diseaseMatches").struct.field("diseaseId").alias("disease_identifier"),
|
|
82
|
+
pl.col("diseaseMatches").struct.field("score").alias("score"),
|
|
83
|
+
)
|
|
84
|
+
.drop_nulls()
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
|
|
58
88
|
def extract_variant_results_from_json(
|
|
59
89
|
exomiser_json_result: pl.DataFrame, score_name: str
|
|
60
90
|
) -> pl.DataFrame:
|
|
@@ -124,6 +154,67 @@ def extract_variant_results_from_json(
|
|
|
124
154
|
)
|
|
125
155
|
|
|
126
156
|
|
|
157
|
+
def extract_variant_results_from_parquet(
|
|
158
|
+
exomiser_parquet_result: pl.DataFrame, score_name: str
|
|
159
|
+
) -> pl.DataFrame:
|
|
160
|
+
contributing_variant_only = exomiser_parquet_result.filter(
|
|
161
|
+
pl.col("isContributingVariant") == True # noqa
|
|
162
|
+
)
|
|
163
|
+
return (
|
|
164
|
+
contributing_variant_only.select(
|
|
165
|
+
[
|
|
166
|
+
pl.col("geneSymbol"),
|
|
167
|
+
pl.col("contigName").alias("chrom").cast(pl.String),
|
|
168
|
+
pl.col("start").cast(pl.Int64),
|
|
169
|
+
pl.col("end").cast(pl.Int64),
|
|
170
|
+
pl.col("ref"),
|
|
171
|
+
pl.col("alt"),
|
|
172
|
+
pl.col(score_name).alias("score"),
|
|
173
|
+
pl.col("moi")
|
|
174
|
+
.map_elements(lambda moi: ModeOfInheritance[moi].value, return_dtype=pl.Int8)
|
|
175
|
+
.alias("moi_enum"),
|
|
176
|
+
]
|
|
177
|
+
)
|
|
178
|
+
.with_columns(
|
|
179
|
+
[
|
|
180
|
+
(pl.col("moi_enum") == 2).alias("is_recessive"),
|
|
181
|
+
pl.when(pl.col("moi_enum") == 2)
|
|
182
|
+
.then(
|
|
183
|
+
pl.format(
|
|
184
|
+
"recessive|{}|{}|{}",
|
|
185
|
+
pl.col("geneSymbol"),
|
|
186
|
+
pl.col("score"),
|
|
187
|
+
pl.col("moi_enum"),
|
|
188
|
+
)
|
|
189
|
+
)
|
|
190
|
+
.otherwise(
|
|
191
|
+
pl.format(
|
|
192
|
+
"dominant|{}|{}|{}|{}|{}|{}",
|
|
193
|
+
pl.col("chrom"),
|
|
194
|
+
pl.col("start"),
|
|
195
|
+
pl.col("end"),
|
|
196
|
+
pl.col("ref"),
|
|
197
|
+
pl.col("alt"),
|
|
198
|
+
pl.col("score"),
|
|
199
|
+
)
|
|
200
|
+
)
|
|
201
|
+
.alias("group_key"),
|
|
202
|
+
]
|
|
203
|
+
)
|
|
204
|
+
.with_columns(
|
|
205
|
+
[
|
|
206
|
+
pl.col("group_key")
|
|
207
|
+
.rank("dense")
|
|
208
|
+
.cast(pl.UInt32)
|
|
209
|
+
.map_elements(
|
|
210
|
+
lambda i: str(uuid.uuid5(uuid.NAMESPACE_DNS, str(i))), return_dtype=pl.String
|
|
211
|
+
)
|
|
212
|
+
.alias("grouping_id")
|
|
213
|
+
]
|
|
214
|
+
)
|
|
215
|
+
)
|
|
216
|
+
|
|
217
|
+
|
|
127
218
|
def create_standardised_results(
|
|
128
219
|
result_dir: Path,
|
|
129
220
|
output_dir: Path,
|
|
@@ -133,36 +224,55 @@ def create_standardised_results(
|
|
|
133
224
|
gene_analysis: bool,
|
|
134
225
|
disease_analysis: bool,
|
|
135
226
|
variant_analysis: bool,
|
|
227
|
+
exomiser_version: str,
|
|
136
228
|
):
|
|
137
229
|
sort_order = SortOrder.ASCENDING if sort_order.lower() == "ascending" else SortOrder.DESCENDING
|
|
138
|
-
|
|
139
|
-
|
|
230
|
+
use_parquet = True if version.parse(exomiser_version) >= version.parse("15.0.0") else False
|
|
231
|
+
read_result = pl.read_parquet if use_parquet else pl.read_json
|
|
232
|
+
result_files = (
|
|
233
|
+
files_with_suffix(result_dir, ".parquet")
|
|
234
|
+
if use_parquet
|
|
235
|
+
else files_with_suffix(result_dir, ".json")
|
|
236
|
+
)
|
|
237
|
+
for exomiser_result_path in result_files:
|
|
238
|
+
exomiser_result = read_result(exomiser_result_path)
|
|
140
239
|
if gene_analysis:
|
|
141
|
-
gene_results =
|
|
240
|
+
gene_results = (
|
|
241
|
+
extract_gene_results_from_parquet(exomiser_result, score_name)
|
|
242
|
+
if use_parquet
|
|
243
|
+
else extract_gene_results_from_json(exomiser_result, score_name)
|
|
244
|
+
)
|
|
142
245
|
generate_gene_result(
|
|
143
246
|
results=gene_results,
|
|
144
247
|
sort_order=sort_order,
|
|
145
248
|
output_dir=output_dir,
|
|
146
|
-
result_path=trim_exomiser_result_filename(
|
|
249
|
+
result_path=trim_exomiser_result_filename(exomiser_result_path),
|
|
147
250
|
phenopacket_dir=phenopacket_dir,
|
|
148
251
|
)
|
|
149
252
|
if disease_analysis:
|
|
150
|
-
disease_results =
|
|
253
|
+
disease_results = (
|
|
254
|
+
extract_disease_results_from_parquet(exomiser_result)
|
|
255
|
+
if use_parquet
|
|
256
|
+
else extract_disease_results_from_json(exomiser_result)
|
|
257
|
+
)
|
|
151
258
|
generate_disease_result(
|
|
152
259
|
results=disease_results,
|
|
153
260
|
sort_order=sort_order,
|
|
154
261
|
output_dir=output_dir,
|
|
155
|
-
result_path=trim_exomiser_result_filename(
|
|
262
|
+
result_path=trim_exomiser_result_filename(exomiser_result_path),
|
|
156
263
|
phenopacket_dir=phenopacket_dir,
|
|
157
264
|
)
|
|
158
|
-
|
|
159
265
|
if variant_analysis:
|
|
160
|
-
variant_results =
|
|
266
|
+
variant_results = (
|
|
267
|
+
extract_variant_results_from_parquet(exomiser_result, score_name)
|
|
268
|
+
if use_parquet
|
|
269
|
+
else extract_variant_results_from_json(exomiser_result, score_name)
|
|
270
|
+
)
|
|
161
271
|
generate_variant_result(
|
|
162
272
|
results=variant_results,
|
|
163
273
|
sort_order=sort_order,
|
|
164
274
|
output_dir=output_dir,
|
|
165
|
-
result_path=trim_exomiser_result_filename(
|
|
275
|
+
result_path=trim_exomiser_result_filename(exomiser_result_path),
|
|
166
276
|
phenopacket_dir=phenopacket_dir,
|
|
167
277
|
)
|
|
168
278
|
|
|
@@ -228,6 +338,14 @@ def create_standardised_results(
|
|
|
228
338
|
default=False,
|
|
229
339
|
help="Specify whether to create PhEval disease results.",
|
|
230
340
|
)
|
|
341
|
+
@click.option(
|
|
342
|
+
"--version",
|
|
343
|
+
"-v",
|
|
344
|
+
required=True,
|
|
345
|
+
help="Exomiser version used to generate results.",
|
|
346
|
+
default="15.0.0",
|
|
347
|
+
show_default=True,
|
|
348
|
+
)
|
|
231
349
|
def post_process_exomiser_results(
|
|
232
350
|
output_dir: Path,
|
|
233
351
|
results_dir: Path,
|
|
@@ -237,6 +355,7 @@ def post_process_exomiser_results(
|
|
|
237
355
|
gene_analysis: bool,
|
|
238
356
|
variant_analysis: bool,
|
|
239
357
|
disease_analysis: bool,
|
|
358
|
+
version: str,
|
|
240
359
|
):
|
|
241
360
|
"""Post-process Exomiser json results into PhEval gene and variant outputs."""
|
|
242
361
|
(
|
|
@@ -263,4 +382,5 @@ def post_process_exomiser_results(
|
|
|
263
382
|
variant_analysis=variant_analysis,
|
|
264
383
|
gene_analysis=gene_analysis,
|
|
265
384
|
disease_analysis=disease_analysis,
|
|
385
|
+
exomiser_version=version,
|
|
266
386
|
)
|
{pheval_exomiser-0.3.4 → pheval_exomiser-0.4.1}/src/pheval_exomiser/prepare/create_batch_commands.py
RENAMED
|
@@ -4,6 +4,7 @@ from pathlib import Path
|
|
|
4
4
|
from typing import List, Optional
|
|
5
5
|
|
|
6
6
|
import click
|
|
7
|
+
from packaging import version
|
|
7
8
|
from phenopackets import Family, Phenopacket
|
|
8
9
|
from pheval.prepare.custom_exceptions import MutuallyExclusiveOptionError
|
|
9
10
|
from pheval.utils.file_utils import all_files, files_with_suffix
|
|
@@ -89,6 +90,7 @@ class CommandCreator:
|
|
|
89
90
|
),
|
|
90
91
|
raw_results_dir=Path(RAW_RESULTS_TARGET_DIRECTORY_DOCKER),
|
|
91
92
|
output_formats=self.output_formats,
|
|
93
|
+
analysis_yaml=self.analysis_yaml,
|
|
92
94
|
)
|
|
93
95
|
elif self.environment == "local":
|
|
94
96
|
return ExomiserCommandLineArguments(
|
|
@@ -97,6 +99,7 @@ class CommandCreator:
|
|
|
97
99
|
output_options_file=output_options_file,
|
|
98
100
|
raw_results_dir=self.results_dir,
|
|
99
101
|
output_formats=self.output_formats,
|
|
102
|
+
analysis_yaml=self.analysis_yaml,
|
|
100
103
|
)
|
|
101
104
|
raise ValueError(f"Unknown environment: {self.environment}")
|
|
102
105
|
|
|
@@ -189,9 +192,10 @@ def create_command_arguments(
|
|
|
189
192
|
class CommandsWriter:
|
|
190
193
|
"""Write a command to file."""
|
|
191
194
|
|
|
192
|
-
def __init__(self, file: Path, variant_analysis: bool):
|
|
195
|
+
def __init__(self, file: Path, variant_analysis: bool, exomiser_version: str):
|
|
193
196
|
self.file = open(file, "w")
|
|
194
197
|
self.variant_analysis = variant_analysis
|
|
198
|
+
self.exomiser_version = exomiser_version
|
|
195
199
|
|
|
196
200
|
def write_basic_analysis_command(self, command_arguments: ExomiserCommandLineArguments):
|
|
197
201
|
"""Write basic analysis command for Exomiser"""
|
|
@@ -246,6 +250,14 @@ class CommandsWriter:
|
|
|
246
250
|
self, command_arguments: ExomiserCommandLineArguments
|
|
247
251
|
) -> None:
|
|
248
252
|
"""Write a phenotype-only command out for exomiser ≥13.2.0 to run."""
|
|
253
|
+
if command_arguments.analysis_yaml is None:
|
|
254
|
+
phenotype_only_statement = (
|
|
255
|
+
" --preset phenotype-only"
|
|
256
|
+
if version.parse(self.exomiser_version) < version.parse("15.0.0")
|
|
257
|
+
else " --preset phenotype_only"
|
|
258
|
+
)
|
|
259
|
+
else:
|
|
260
|
+
phenotype_only_statement = f" --analysis {str(command_arguments.analysis_yaml)}"
|
|
249
261
|
self.file.write(
|
|
250
262
|
"--sample "
|
|
251
263
|
+ str(command_arguments.sample)
|
|
@@ -253,8 +265,7 @@ class CommandsWriter:
|
|
|
253
265
|
+ str(command_arguments.raw_results_dir)
|
|
254
266
|
+ " --output-filename "
|
|
255
267
|
+ f"{Path(command_arguments.sample).stem}-exomiser"
|
|
256
|
-
+
|
|
257
|
-
+ "phenotype-only"
|
|
268
|
+
+ phenotype_only_statement
|
|
258
269
|
)
|
|
259
270
|
|
|
260
271
|
def write_phenotype_only_command(self, command_arguments: ExomiserCommandLineArguments):
|
|
@@ -290,11 +301,13 @@ class BatchFileWriter:
|
|
|
290
301
|
variant_analysis: bool,
|
|
291
302
|
output_dir: Path,
|
|
292
303
|
batch_prefix: str,
|
|
304
|
+
exomiser_version: str,
|
|
293
305
|
):
|
|
294
306
|
self.command_arguments_list = command_arguments_list
|
|
295
307
|
self.variant_analysis = variant_analysis
|
|
296
308
|
self.output_dir = output_dir
|
|
297
309
|
self.batch_prefix = batch_prefix
|
|
310
|
+
self.exomiser_version = exomiser_version
|
|
298
311
|
|
|
299
312
|
def write_commands(self, commands_writer: CommandsWriter) -> None:
|
|
300
313
|
"""Write command arguments to a file."""
|
|
@@ -305,7 +318,9 @@ class BatchFileWriter:
|
|
|
305
318
|
def write_temp_file(self) -> str:
|
|
306
319
|
"""Write commands out to a temporary file."""
|
|
307
320
|
temp = tempfile.NamedTemporaryFile(delete=False)
|
|
308
|
-
commands_writer = CommandsWriter(
|
|
321
|
+
commands_writer = CommandsWriter(
|
|
322
|
+
Path(temp.name), self.variant_analysis, self.exomiser_version
|
|
323
|
+
)
|
|
309
324
|
self.write_commands(commands_writer)
|
|
310
325
|
return temp.name
|
|
311
326
|
|
|
@@ -314,6 +329,7 @@ class BatchFileWriter:
|
|
|
314
329
|
commands_writer = CommandsWriter(
|
|
315
330
|
Path(self.output_dir).joinpath(self.batch_prefix + "-exomiser-batch.txt"),
|
|
316
331
|
self.variant_analysis,
|
|
332
|
+
self.exomiser_version,
|
|
317
333
|
)
|
|
318
334
|
self.write_commands(commands_writer)
|
|
319
335
|
|
|
@@ -349,6 +365,7 @@ def create_batch_file(
|
|
|
349
365
|
max_jobs: int,
|
|
350
366
|
variant_analysis: bool,
|
|
351
367
|
results_dir: Path,
|
|
368
|
+
exomiser_version: str,
|
|
352
369
|
output_options_dir: Path = None,
|
|
353
370
|
output_options_file: Path = None,
|
|
354
371
|
output_formats: List[str] = None,
|
|
@@ -367,10 +384,7 @@ def create_batch_file(
|
|
|
367
384
|
)
|
|
368
385
|
(
|
|
369
386
|
BatchFileWriter(
|
|
370
|
-
command_arguments,
|
|
371
|
-
variant_analysis,
|
|
372
|
-
output_dir,
|
|
373
|
-
batch_prefix,
|
|
387
|
+
command_arguments, variant_analysis, output_dir, batch_prefix, exomiser_version
|
|
374
388
|
).write_all_commands()
|
|
375
389
|
if max_jobs == 0
|
|
376
390
|
else BatchFileWriter(
|
|
@@ -378,6 +392,7 @@ def create_batch_file(
|
|
|
378
392
|
variant_analysis,
|
|
379
393
|
output_dir,
|
|
380
394
|
batch_prefix,
|
|
395
|
+
exomiser_version,
|
|
381
396
|
).create_split_batch_files(max_jobs)
|
|
382
397
|
)
|
|
383
398
|
|
|
@@ -411,7 +426,6 @@ def create_batch_file(
|
|
|
411
426
|
@click.option(
|
|
412
427
|
"--vcf-dir",
|
|
413
428
|
"-v",
|
|
414
|
-
# required=True,
|
|
415
429
|
metavar="PATH",
|
|
416
430
|
type=Path,
|
|
417
431
|
help="Path to VCF directory.",
|
|
@@ -456,6 +470,14 @@ def create_batch_file(
|
|
|
456
470
|
required=False,
|
|
457
471
|
help="Results directory for Exomiser results - compatible with versions 13.2.0 onwards.",
|
|
458
472
|
)
|
|
473
|
+
@click.option(
|
|
474
|
+
"--exomiser-version",
|
|
475
|
+
"-v",
|
|
476
|
+
required=True,
|
|
477
|
+
help="Exomiser version used to generate results.",
|
|
478
|
+
default="15.0.0",
|
|
479
|
+
show_default=True,
|
|
480
|
+
)
|
|
459
481
|
@click.option(
|
|
460
482
|
"--output-options-dir",
|
|
461
483
|
"-O",
|
|
@@ -492,6 +514,7 @@ def prepare_exomiser_batch(
|
|
|
492
514
|
batch_prefix: str,
|
|
493
515
|
max_jobs: int,
|
|
494
516
|
variant_analysis: bool,
|
|
517
|
+
exomiser_version: str,
|
|
495
518
|
output_options_dir: Path = None,
|
|
496
519
|
output_options_file: Path = None,
|
|
497
520
|
output_formats: List[str] = None,
|
|
@@ -511,4 +534,5 @@ def prepare_exomiser_batch(
|
|
|
511
534
|
output_options_dir=output_options_dir,
|
|
512
535
|
output_options_file=output_options_file,
|
|
513
536
|
output_formats=list(output_formats),
|
|
537
|
+
exomiser_version=exomiser_version,
|
|
514
538
|
)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
|
-
from typing import List, Optional
|
|
2
|
+
from typing import List, Optional, Union
|
|
3
3
|
|
|
4
4
|
from pydantic import BaseModel, Field
|
|
5
5
|
|
|
@@ -61,7 +61,7 @@ class ExomiserConfigurations(BaseModel):
|
|
|
61
61
|
|
|
62
62
|
environment: str = Field(...)
|
|
63
63
|
exomiser_software_directory: Path = Field(...)
|
|
64
|
-
analysis_configuration_file: Path = Field(...)
|
|
64
|
+
analysis_configuration_file: Union[Path | None] = Field(...)
|
|
65
65
|
max_jobs: int = Field(...)
|
|
66
66
|
application_properties: ApplicationProperties = Field(...)
|
|
67
67
|
output_formats: Optional[List[str]] = Field(None)
|
|
@@ -27,18 +27,24 @@ def prepare_batch_files(
|
|
|
27
27
|
tool_input_commands_dir: Path,
|
|
28
28
|
raw_results_dir: Path,
|
|
29
29
|
variant_analysis: bool,
|
|
30
|
+
exomiser_version: str,
|
|
30
31
|
) -> None:
|
|
31
32
|
"""Prepare the exomiser batch files"""
|
|
32
33
|
print("...preparing batch files...")
|
|
33
34
|
vcf_dir_name = Path(testdata_dir).joinpath("vcf")
|
|
34
|
-
|
|
35
|
-
config.output_formats
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
if version.parse(exomiser_version) >= version.parse("15.0.0"):
|
|
36
|
+
if "PARQUET" not in config.output_formats:
|
|
37
|
+
config.output_formats.append("PARQUET")
|
|
38
|
+
elif version.parse(exomiser_version) < version.parse("15.0.0"):
|
|
39
|
+
if "JSON" not in config.output_formats:
|
|
40
|
+
config.output_formats.append("JSON")
|
|
39
41
|
create_batch_file(
|
|
40
42
|
environment=config.environment,
|
|
41
|
-
analysis=
|
|
43
|
+
analysis=(
|
|
44
|
+
input_dir.joinpath(config.analysis_configuration_file)
|
|
45
|
+
if config.analysis_configuration_file
|
|
46
|
+
else None
|
|
47
|
+
),
|
|
42
48
|
phenopacket_dir=Path(testdata_dir).joinpath("phenopackets"),
|
|
43
49
|
vcf_dir=vcf_dir_name if variant_analysis else None,
|
|
44
50
|
output_dir=tool_input_commands_dir,
|
|
@@ -48,7 +54,8 @@ def prepare_batch_files(
|
|
|
48
54
|
output_options_dir=None,
|
|
49
55
|
results_dir=raw_results_dir,
|
|
50
56
|
variant_analysis=variant_analysis,
|
|
51
|
-
output_formats=output_formats,
|
|
57
|
+
output_formats=config.output_formats,
|
|
58
|
+
exomiser_version=exomiser_version,
|
|
52
59
|
)
|
|
53
60
|
|
|
54
61
|
|
|
@@ -121,18 +128,32 @@ def run_exomiser_local(
|
|
|
121
128
|
][0]
|
|
122
129
|
exomiser_jar_file_path = config.exomiser_software_directory.joinpath(exomiser_jar_file)
|
|
123
130
|
for file in batch_files:
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
131
|
+
if version.parse(exomiser_version) < version.parse("15.0.0"):
|
|
132
|
+
subprocess.run(
|
|
133
|
+
[
|
|
134
|
+
"java",
|
|
135
|
+
"-Xmx4g",
|
|
136
|
+
"-jar",
|
|
137
|
+
exomiser_jar_file_path,
|
|
138
|
+
"--batch",
|
|
139
|
+
file,
|
|
140
|
+
f"--spring.config.location={Path(input_dir).joinpath('application.properties')}",
|
|
141
|
+
],
|
|
142
|
+
shell=False,
|
|
143
|
+
)
|
|
144
|
+
elif version.parse(exomiser_version) >= version.parse("15.0.0"):
|
|
145
|
+
subprocess.run(
|
|
146
|
+
[
|
|
147
|
+
"java",
|
|
148
|
+
"-Xmx4g",
|
|
149
|
+
f"-Dspring.config.location={str(Path(input_dir).joinpath('application.properties'))}",
|
|
150
|
+
"-jar",
|
|
151
|
+
exomiser_jar_file_path,
|
|
152
|
+
"batch",
|
|
153
|
+
file,
|
|
154
|
+
],
|
|
155
|
+
shell=False,
|
|
156
|
+
)
|
|
136
157
|
if version.parse(exomiser_version) < version.parse("13.1.0"):
|
|
137
158
|
os.rename(
|
|
138
159
|
f"{output_dir}/results",
|
|
@@ -45,6 +45,7 @@ class ExomiserPhEvalRunner(PhEvalRunner):
|
|
|
45
45
|
tool_input_commands_dir=self.tool_input_commands_dir,
|
|
46
46
|
raw_results_dir=self.raw_results_dir,
|
|
47
47
|
variant_analysis=self.input_dir_config.variant_analysis,
|
|
48
|
+
exomiser_version=self.version,
|
|
48
49
|
)
|
|
49
50
|
run_exomiser(
|
|
50
51
|
input_dir=self.input_dir,
|
|
@@ -71,4 +72,5 @@ class ExomiserPhEvalRunner(PhEvalRunner):
|
|
|
71
72
|
variant_analysis=self.input_dir_config.variant_analysis,
|
|
72
73
|
gene_analysis=self.input_dir_config.gene_analysis,
|
|
73
74
|
disease_analysis=self.input_dir_config.disease_analysis,
|
|
75
|
+
exomiser_version=self.version,
|
|
74
76
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pheval_exomiser-0.3.4 → pheval_exomiser-0.4.1}/src/pheval_exomiser/post_process/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|