diff --git a/fake_vcf/vcf_faker.py b/fake_vcf/vcf_faker.py index adf2945..f744a01 100644 --- a/fake_vcf/vcf_faker.py +++ b/fake_vcf/vcf_faker.py @@ -37,21 +37,21 @@ def __init__( '##INFO=', '##INFO=', '##FORMAT=', + "", ] ) # VCF file format header if self.large_format: - "\n".join( + self.header += "\n".join( [ '##FORMAT=', '##FORMAT=', '##FORMAT=', '##FORMAT=', + "", ] ) - self.header += "\n" - if num_samples < 1 or num_rows < 1: raise ValueError(f"Nr of samples and rows must be greater or equal to 1") @@ -154,7 +154,10 @@ def _generate_vcf_row(self): qual = f"{self.random.randint(10, 100)}" filt = self.random.choice(["PASS"]) info = f"DP=10;AF=0.5;NS={self.num_samples}" - fmt = "GT" + if self.large_format: + fmt = "GT:AD:DP:GQ:PL" + else: + fmt = "GT" # Generate random values for each sample by rotating the sample list randomly max_rotation = ( diff --git a/tests/test_example/test_vcf_validator.py b/tests/test_example/test_vcf_validator.py index 52df21f..f1c49e0 100644 --- a/tests/test_example/test_vcf_validator.py +++ b/tests/test_example/test_vcf_validator.py @@ -57,6 +57,7 @@ def run_vcf_validator(vcf_file_path, result_path): (["-r", "10", "--no-large-format"],), (["-r", "50", "--no-large-format"],), (["-r", "100", "--no-large-format"],), + (["-r", "10", "--large-format"],), ], ) def test_vcf_file_validation(cli_args: list, tmp_path):