INNER CODE UNIT · Python
concurrent_mode
PharmGKB/PharmCAT · preprocessor/pcat/preprocess.py:52
concurrent_mode: bool = False, max_processes: int = 1, verbose: int = 0) -> list[Path]:
"""
Normalize and prepare the input VCF for PharmCAT.
"""
if len(vcf_files) == 0:
raise ReportableException('Missing VCF input')
# make sure we have samples
if samples is None or len(samples) == 0:
samples = util.read_vcf_samples(vcf_files[0], verbose=verbose)
else:
# make sure samples are in the vcf file
vcf_samples = util.read_vcf_samples(vcf_files[0], verbose=verbose)
for sample in samples:
if sample not in vcf_samples:
raise ReportableException('Sample "%s" not in VCF' % sample)
basename = output_basename or input_basename