pheval-exomiser 0.3.2__py3-none-any.whl → 0.3.4__py3-none-any.whl
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/prepare/create_batch_commands.py +117 -101
- {pheval_exomiser-0.3.2.dist-info → pheval_exomiser-0.3.4.dist-info}/METADATA +4 -3
- {pheval_exomiser-0.3.2.dist-info → pheval_exomiser-0.3.4.dist-info}/RECORD +5 -5
- {pheval_exomiser-0.3.2.dist-info → pheval_exomiser-0.3.4.dist-info}/WHEEL +1 -1
- {pheval_exomiser-0.3.2.dist-info → pheval_exomiser-0.3.4.dist-info}/entry_points.txt +0 -0
|
@@ -23,13 +23,13 @@ class ExomiserCommandLineArguments:
|
|
|
23
23
|
"""Store command line arguments for each phenopacket to be run with Exomiser."""
|
|
24
24
|
|
|
25
25
|
sample: Path
|
|
26
|
-
analysis_yaml: Path
|
|
27
|
-
vcf_file: Path
|
|
28
|
-
vcf_assembly: str
|
|
29
|
-
raw_results_dir: Path
|
|
30
|
-
variant_analysis: bool
|
|
26
|
+
analysis_yaml: Optional[Path] = None
|
|
27
|
+
vcf_file: Optional[Path] = None
|
|
28
|
+
vcf_assembly: Optional[str] = None
|
|
29
|
+
raw_results_dir: Optional[Path] = None
|
|
30
|
+
variant_analysis: Optional[bool] = None
|
|
31
31
|
output_options_file: Optional[Path] = None
|
|
32
|
-
output_formats: List[str]
|
|
32
|
+
output_formats: Optional[List[str]] = None
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
def get_all_files_from_output_opt_directory(output_options_dir: Path) -> List[Path] or None:
|
|
@@ -80,39 +80,41 @@ class CommandCreator:
|
|
|
80
80
|
output_options_file = self.assign_output_options_file()
|
|
81
81
|
if self.environment == "docker":
|
|
82
82
|
return ExomiserCommandLineArguments(
|
|
83
|
-
sample=f"{PHENOPACKET_TARGET_DIRECTORY_DOCKER}{
|
|
83
|
+
sample=Path(f"{PHENOPACKET_TARGET_DIRECTORY_DOCKER}{self.phenopacket_path.name}"),
|
|
84
84
|
variant_analysis=self.variant_analysis,
|
|
85
85
|
output_options_file=(
|
|
86
|
-
f"{OUTPUT_OPTIONS_TARGET_DIRECTORY_DOCKER}{
|
|
87
|
-
if output_options_file
|
|
86
|
+
Path(f"{OUTPUT_OPTIONS_TARGET_DIRECTORY_DOCKER}{output_options_file.name}")
|
|
87
|
+
if output_options_file
|
|
88
88
|
else None
|
|
89
89
|
),
|
|
90
|
-
raw_results_dir=RAW_RESULTS_TARGET_DIRECTORY_DOCKER,
|
|
90
|
+
raw_results_dir=Path(RAW_RESULTS_TARGET_DIRECTORY_DOCKER),
|
|
91
91
|
output_formats=self.output_formats,
|
|
92
92
|
)
|
|
93
93
|
elif self.environment == "local":
|
|
94
94
|
return ExomiserCommandLineArguments(
|
|
95
|
-
sample=
|
|
95
|
+
sample=self.phenopacket_path,
|
|
96
96
|
variant_analysis=self.variant_analysis,
|
|
97
97
|
output_options_file=output_options_file,
|
|
98
98
|
raw_results_dir=self.results_dir,
|
|
99
99
|
output_formats=self.output_formats,
|
|
100
100
|
)
|
|
101
|
+
raise ValueError(f"Unknown environment: {self.environment}")
|
|
101
102
|
|
|
102
103
|
def add_variant_analysis_arguments(self, vcf_dir: Path) -> ExomiserCommandLineArguments:
|
|
103
|
-
|
|
104
|
-
PhenopacketUtil(self.phenopacket).vcf_file_data(
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
if vcf_dir.exists():
|
|
105
|
+
vcf_file_data = PhenopacketUtil(self.phenopacket).vcf_file_data(
|
|
106
|
+
self.phenopacket_path, vcf_dir
|
|
107
|
+
)
|
|
108
|
+
else:
|
|
109
|
+
vcf_file_data = next(
|
|
107
110
|
file
|
|
108
111
|
for file in self.phenopacket.files
|
|
109
112
|
if file.file_attributes["fileFormat"] == "vcf"
|
|
110
|
-
|
|
111
|
-
)
|
|
113
|
+
)
|
|
112
114
|
output_options_file = self.assign_output_options_file()
|
|
113
115
|
if self.environment == "local":
|
|
114
116
|
return ExomiserCommandLineArguments(
|
|
115
|
-
sample=
|
|
117
|
+
sample=self.phenopacket_path,
|
|
116
118
|
vcf_file=Path(vcf_file_data.uri),
|
|
117
119
|
vcf_assembly=vcf_file_data.file_attributes["genomeAssembly"],
|
|
118
120
|
output_options_file=output_options_file,
|
|
@@ -123,18 +125,24 @@ class CommandCreator:
|
|
|
123
125
|
)
|
|
124
126
|
elif self.environment == "docker":
|
|
125
127
|
return ExomiserCommandLineArguments(
|
|
126
|
-
sample=f"{PHENOPACKET_TARGET_DIRECTORY_DOCKER}{
|
|
127
|
-
vcf_file=f"{VCF_TARGET_DIRECTORY_DOCKER}{Path(vcf_file_data.uri).name}",
|
|
128
|
+
sample=Path(f"{PHENOPACKET_TARGET_DIRECTORY_DOCKER}{self.phenopacket_path.name}"),
|
|
129
|
+
vcf_file=Path(f"{VCF_TARGET_DIRECTORY_DOCKER}{Path(vcf_file_data.uri).name}"),
|
|
128
130
|
vcf_assembly=vcf_file_data.file_attributes["genomeAssembly"],
|
|
129
131
|
output_options_file=(
|
|
130
|
-
f"{OUTPUT_OPTIONS_TARGET_DIRECTORY_DOCKER}{
|
|
131
|
-
if output_options_file
|
|
132
|
+
Path(f"{OUTPUT_OPTIONS_TARGET_DIRECTORY_DOCKER}{output_options_file.name}")
|
|
133
|
+
if output_options_file
|
|
132
134
|
else None
|
|
133
135
|
),
|
|
134
136
|
variant_analysis=self.variant_analysis,
|
|
135
|
-
raw_results_dir=RAW_RESULTS_TARGET_DIRECTORY_DOCKER,
|
|
136
|
-
analysis_yaml=
|
|
137
|
+
raw_results_dir=Path(RAW_RESULTS_TARGET_DIRECTORY_DOCKER),
|
|
138
|
+
analysis_yaml=(
|
|
139
|
+
Path(f"{EXOMISER_YAML_TARGET_DIRECTORY_DOCKER}{self.analysis_yaml.name}")
|
|
140
|
+
if self.analysis_yaml
|
|
141
|
+
else None
|
|
142
|
+
),
|
|
143
|
+
output_formats=self.output_formats,
|
|
137
144
|
)
|
|
145
|
+
raise ValueError(f"Unknown environment: {self.environment}")
|
|
138
146
|
|
|
139
147
|
def add_command_line_arguments(self, vcf_dir: Path or None) -> ExomiserCommandLineArguments:
|
|
140
148
|
"""Return a dataclass of all the command line arguments corresponding to phenopacket sample."""
|
|
@@ -187,86 +195,77 @@ class CommandsWriter:
|
|
|
187
195
|
|
|
188
196
|
def write_basic_analysis_command(self, command_arguments: ExomiserCommandLineArguments):
|
|
189
197
|
"""Write basic analysis command for Exomiser"""
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
)
|
|
203
|
-
except IOError:
|
|
204
|
-
print("Error writing ", self.file)
|
|
198
|
+
self.file.write(
|
|
199
|
+
"--analysis "
|
|
200
|
+
+ str(command_arguments.analysis_yaml)
|
|
201
|
+
+ " --sample "
|
|
202
|
+
+ str(command_arguments.sample)
|
|
203
|
+
+ " --vcf "
|
|
204
|
+
+ str(command_arguments.vcf_file)
|
|
205
|
+
+ " --assembly "
|
|
206
|
+
+ command_arguments.vcf_assembly
|
|
207
|
+
+ " --output-filename "
|
|
208
|
+
+ f"{command_arguments.sample.stem}-exomiser"
|
|
209
|
+
)
|
|
205
210
|
|
|
206
211
|
def write_results_dir(self, command_arguments: ExomiserCommandLineArguments) -> None:
|
|
207
212
|
"""Write results directory for exomiser ≥13.2.0 to run."""
|
|
208
|
-
|
|
209
|
-
(
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
)
|
|
214
|
-
except IOError:
|
|
215
|
-
print("Error writing ", self.file)
|
|
213
|
+
(
|
|
214
|
+
self.file.write(" --output-directory " + str(command_arguments.raw_results_dir))
|
|
215
|
+
if command_arguments.raw_results_dir is not None
|
|
216
|
+
else None
|
|
217
|
+
)
|
|
216
218
|
|
|
217
219
|
def write_output_options(self, command_arguments: ExomiserCommandLineArguments) -> None:
|
|
218
220
|
"""Write a command out for exomiser ≤13.1.0 to run - including output option file specified."""
|
|
219
|
-
|
|
220
|
-
(
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
)
|
|
225
|
-
except IOError:
|
|
226
|
-
print("Error writing ", self.file)
|
|
221
|
+
(
|
|
222
|
+
self.file.write(" --output " + str(command_arguments.output_options_file))
|
|
223
|
+
if command_arguments.output_options_file is not None
|
|
224
|
+
else None
|
|
225
|
+
)
|
|
227
226
|
|
|
228
227
|
def write_output_format(self, command_arguments: ExomiserCommandLineArguments) -> None:
|
|
229
228
|
"""Write output formats for Exomiser raw result output."""
|
|
229
|
+
(
|
|
230
|
+
self.file.write(" --output-format " + ",".join(command_arguments.output_formats))
|
|
231
|
+
if command_arguments.output_formats is not None
|
|
232
|
+
else None
|
|
233
|
+
)
|
|
234
|
+
|
|
235
|
+
def write_analysis_command(self, command_arguments: ExomiserCommandLineArguments):
|
|
230
236
|
try:
|
|
231
|
-
(
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
)
|
|
237
|
+
self.write_basic_analysis_command(command_arguments)
|
|
238
|
+
self.write_results_dir(command_arguments)
|
|
239
|
+
self.write_output_options(command_arguments)
|
|
240
|
+
self.write_output_format(command_arguments)
|
|
241
|
+
self.file.write("\n")
|
|
236
242
|
except IOError:
|
|
237
243
|
print("Error writing ", self.file)
|
|
238
244
|
|
|
239
|
-
def write_analysis_command(self, command_arguments: ExomiserCommandLineArguments):
|
|
240
|
-
self.write_basic_analysis_command(command_arguments)
|
|
241
|
-
self.write_results_dir(command_arguments)
|
|
242
|
-
self.write_output_options(command_arguments)
|
|
243
|
-
self.write_output_format(command_arguments)
|
|
244
|
-
self.file.write("\n")
|
|
245
|
-
|
|
246
245
|
def write_basic_phenotype_only_command(
|
|
247
246
|
self, command_arguments: ExomiserCommandLineArguments
|
|
248
247
|
) -> None:
|
|
249
248
|
"""Write a phenotype-only command out for exomiser ≥13.2.0 to run."""
|
|
249
|
+
self.file.write(
|
|
250
|
+
"--sample "
|
|
251
|
+
+ str(command_arguments.sample)
|
|
252
|
+
+ " --output-directory "
|
|
253
|
+
+ str(command_arguments.raw_results_dir)
|
|
254
|
+
+ " --output-filename "
|
|
255
|
+
+ f"{Path(command_arguments.sample).stem}-exomiser"
|
|
256
|
+
+ " --preset "
|
|
257
|
+
+ "phenotype-only"
|
|
258
|
+
)
|
|
259
|
+
|
|
260
|
+
def write_phenotype_only_command(self, command_arguments: ExomiserCommandLineArguments):
|
|
250
261
|
try:
|
|
251
|
-
self.
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
+ str(command_arguments.raw_results_dir)
|
|
256
|
-
+ " --output-filename "
|
|
257
|
-
+ f"{Path(command_arguments.sample).stem}-exomiser"
|
|
258
|
-
+ " --preset "
|
|
259
|
-
+ "phenotype-only"
|
|
260
|
-
)
|
|
262
|
+
self.write_basic_phenotype_only_command(command_arguments)
|
|
263
|
+
self.write_output_options(command_arguments)
|
|
264
|
+
self.write_output_format(command_arguments)
|
|
265
|
+
self.file.write("\n")
|
|
261
266
|
except IOError:
|
|
262
267
|
print("Error writing ", self.file)
|
|
263
268
|
|
|
264
|
-
def write_phenotype_only_command(self, command_arguments: ExomiserCommandLineArguments):
|
|
265
|
-
self.write_basic_phenotype_only_command(command_arguments)
|
|
266
|
-
self.write_output_options(command_arguments)
|
|
267
|
-
self.write_output_format(command_arguments)
|
|
268
|
-
self.file.write("\n")
|
|
269
|
-
|
|
270
269
|
def write_local_commands(self, command_arguments: ExomiserCommandLineArguments):
|
|
271
270
|
(
|
|
272
271
|
self.write_analysis_command(command_arguments)
|
|
@@ -403,19 +402,19 @@ def create_batch_file(
|
|
|
403
402
|
)
|
|
404
403
|
@click.option(
|
|
405
404
|
"--phenopacket-dir",
|
|
406
|
-
"-
|
|
405
|
+
"-p",
|
|
407
406
|
required=True,
|
|
408
407
|
metavar="PATH",
|
|
409
408
|
type=Path,
|
|
410
|
-
help="Path to
|
|
409
|
+
help="Path to phenopacket directory.",
|
|
411
410
|
)
|
|
412
411
|
@click.option(
|
|
413
412
|
"--vcf-dir",
|
|
414
413
|
"-v",
|
|
415
|
-
required=True,
|
|
414
|
+
# required=True,
|
|
416
415
|
metavar="PATH",
|
|
417
416
|
type=Path,
|
|
418
|
-
help="Path to VCF
|
|
417
|
+
help="Path to VCF directory.",
|
|
419
418
|
)
|
|
420
419
|
@click.option(
|
|
421
420
|
"--batch-prefix",
|
|
@@ -437,15 +436,22 @@ def create_batch_file(
|
|
|
437
436
|
help="Number of jobs in each file.",
|
|
438
437
|
)
|
|
439
438
|
@click.option(
|
|
440
|
-
"--
|
|
439
|
+
"--variant-analysis",
|
|
441
440
|
type=bool,
|
|
442
441
|
default=False,
|
|
443
|
-
|
|
444
|
-
mutually_exclusive=["vcf_dir", "analysis_yaml"],
|
|
442
|
+
is_flag=True,
|
|
445
443
|
help="Run Exomiser with phenotype only preset - strongly recommended to run with versions 13.2.0 onwards.",
|
|
446
444
|
)
|
|
445
|
+
@click.option(
|
|
446
|
+
"--output-dir",
|
|
447
|
+
"-d",
|
|
448
|
+
type=Path,
|
|
449
|
+
required=False,
|
|
450
|
+
help="Results directory for Exomiser results - compatible with versions 13.2.0 onwards.",
|
|
451
|
+
)
|
|
447
452
|
@click.option(
|
|
448
453
|
"--results-dir",
|
|
454
|
+
"-r",
|
|
449
455
|
type=Path,
|
|
450
456
|
required=False,
|
|
451
457
|
help="Results directory for Exomiser results - compatible with versions 13.2.0 onwards.",
|
|
@@ -470,29 +476,39 @@ def create_batch_file(
|
|
|
470
476
|
type=Path,
|
|
471
477
|
help="Path to the output options file. ",
|
|
472
478
|
)
|
|
479
|
+
@click.option(
|
|
480
|
+
"--output-formats",
|
|
481
|
+
"-f",
|
|
482
|
+
multiple=True,
|
|
483
|
+
help="One or more output formats (e.g., --output-format vcf --output-format json).",
|
|
484
|
+
)
|
|
473
485
|
def prepare_exomiser_batch(
|
|
474
486
|
environment: str,
|
|
475
487
|
analysis_yaml: Path,
|
|
476
488
|
phenopacket_dir: Path,
|
|
477
489
|
vcf_dir: Path,
|
|
478
490
|
output_dir: Path,
|
|
491
|
+
results_dir: Path,
|
|
479
492
|
batch_prefix: str,
|
|
480
493
|
max_jobs: int,
|
|
481
|
-
|
|
494
|
+
variant_analysis: bool,
|
|
482
495
|
output_options_dir: Path = None,
|
|
483
496
|
output_options_file: Path = None,
|
|
497
|
+
output_formats: List[str] = None,
|
|
484
498
|
):
|
|
485
499
|
"""Generate Exomiser batch files."""
|
|
486
500
|
Path(output_dir).joinpath("tool_input_commands").mkdir(exist_ok=True)
|
|
487
501
|
create_batch_file(
|
|
488
|
-
environment,
|
|
489
|
-
analysis_yaml,
|
|
490
|
-
phenopacket_dir,
|
|
491
|
-
vcf_dir,
|
|
492
|
-
output_dir,
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
502
|
+
environment=environment,
|
|
503
|
+
analysis=analysis_yaml,
|
|
504
|
+
phenopacket_dir=phenopacket_dir,
|
|
505
|
+
vcf_dir=vcf_dir,
|
|
506
|
+
output_dir=output_dir,
|
|
507
|
+
results_dir=results_dir,
|
|
508
|
+
batch_prefix=batch_prefix,
|
|
509
|
+
max_jobs=max_jobs,
|
|
510
|
+
variant_analysis=variant_analysis,
|
|
511
|
+
output_options_dir=output_options_dir,
|
|
512
|
+
output_options_file=output_options_file,
|
|
513
|
+
output_formats=list(output_formats),
|
|
498
514
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: pheval_exomiser
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.4
|
|
4
4
|
Summary:
|
|
5
5
|
Author: Yasemin Bridges
|
|
6
6
|
Author-email: y.bridges@qmul.ac.uk
|
|
@@ -10,13 +10,14 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
10
10
|
Classifier: Programming Language :: Python :: 3.11
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.12
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.13
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
13
14
|
Requires-Dist: click (>=8.1.3,<9.0.0)
|
|
14
15
|
Requires-Dist: docker (>=6.0.1,<7.0.0)
|
|
15
16
|
Requires-Dist: google (>=3.0.0,<4.0.0)
|
|
16
17
|
Requires-Dist: numpy (<2)
|
|
17
18
|
Requires-Dist: oaklib (>=0.5.12,<0.6.0)
|
|
18
19
|
Requires-Dist: phenopackets (>=2.0.2,<3.0.0)
|
|
19
|
-
Requires-Dist: pheval (>=0.
|
|
20
|
+
Requires-Dist: pheval (>=0.6.1,<0.7.0)
|
|
20
21
|
Requires-Dist: pyaml (>=21.10.1,<22.0.0)
|
|
21
22
|
Requires-Dist: pydantic (>=2.7.1,<3.0.0)
|
|
22
23
|
Description-Content-Type: text/markdown
|
|
@@ -5,13 +5,13 @@ pheval_exomiser/post_process/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NM
|
|
|
5
5
|
pheval_exomiser/post_process/post_process.py,sha256=2vkwe60Ptf7UuPCR2ShcI80-kn-1WaPDa74cCBTUKF0,968
|
|
6
6
|
pheval_exomiser/post_process/post_process_results_format.py,sha256=8fmiPy4xJjhe6ajTlJEYx2na0EeJftkTuYQCzv5uIJk,8458
|
|
7
7
|
pheval_exomiser/prepare/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
-
pheval_exomiser/prepare/create_batch_commands.py,sha256=
|
|
8
|
+
pheval_exomiser/prepare/create_batch_commands.py,sha256=aQBg9k7d3lKQ6TGCtNbJcDrAx5EyjsMsmVNfLzyA3KA,17941
|
|
9
9
|
pheval_exomiser/prepare/tool_specific_configuration_options.py,sha256=4gedZ9iadRXK6tF9P-ju-dhj8-F2-fhrXVhfYIsAxFQ,2922
|
|
10
10
|
pheval_exomiser/prepare/write_application_properties.py,sha256=KmG7GvkQo8AhnhRyqohTFvqjfhEhbcs78UYYoigxJ3w,8933
|
|
11
11
|
pheval_exomiser/run/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
12
|
pheval_exomiser/run/run.py,sha256=bK_gL52zRl71Lxe-i-P6L4-dMstxFAG6SVNPO6G823o,7109
|
|
13
13
|
pheval_exomiser/runner.py,sha256=3-0kec2yzQoZNpqZXSBIWBD1QR24s_BmHGCLXmP4fos,2620
|
|
14
|
-
pheval_exomiser-0.3.
|
|
15
|
-
pheval_exomiser-0.3.
|
|
16
|
-
pheval_exomiser-0.3.
|
|
17
|
-
pheval_exomiser-0.3.
|
|
14
|
+
pheval_exomiser-0.3.4.dist-info/METADATA,sha256=wjNNiOaUKO17ZJOwJKlKxOpMtRROjj8QQ9_hYhBhoyE,7692
|
|
15
|
+
pheval_exomiser-0.3.4.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
16
|
+
pheval_exomiser-0.3.4.dist-info/entry_points.txt,sha256=lbZMu-x7ns8UrFveWSqEQ1UB5l33TbRMomqBUyGYIwI,131
|
|
17
|
+
pheval_exomiser-0.3.4.dist-info/RECORD,,
|
|
File without changes
|