Skip to content

Commit

Permalink
fixup! Add BAM output option to vc-gatk4-hc
Browse files Browse the repository at this point in the history
  • Loading branch information
marcellevstek committed Dec 10, 2024
1 parent ac9e29c commit 9170a0e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Unreleased
Added
-----
- Add filtering ``Variant`` by ``VariantExperiment`` and ``VariantCall``
- Add BAM output option to ``vc-gatk4-hc``
- Add ``--bam-output`` input argument to ``vc-gatk4-hc``

Changed
-------
Expand Down
7 changes: 6 additions & 1 deletion resolwe_bio/processes/variant_calling/gatk4_hc.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ class Output:

vcf = FileField(label="VCF file")
tbi = FileField(label="Tabix index")
bam = FileField(label="BAM file", required=False)
bam = FileField(label="Alignment file", required=False)
bai = FileField(label="BAM file index", required=False)
species = StringField(label="Species")
build = StringField(label="Build")

Expand Down Expand Up @@ -216,4 +217,8 @@ def run(self, inputs, outputs):
outputs.species = inputs.alignment.output.species
outputs.build = inputs.alignment.output.build
if inputs.advanced.bam_out:
output_bai = Path(name + ".gatkHC.bai")
renamed_bai = output_bai.with_suffix(".bam.bai")
output_bai.rename(renamed_bai)
outputs.bam = output_bam
outputs.bai = str(renamed_bai)
Binary file not shown.
3 changes: 3 additions & 0 deletions resolwe_bio/tests/processes/test_variant_calling.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ def test_gatk_haplotypecaller(self):
self.assertFile(
gatk_rnaseq, "bam", output_folder / "56GSID_10k.rna-seq.gatkHC.bam"
)
self.assertFile(
gatk_rnaseq, "bai", output_folder / "56GSID_10k.rna-seq.gatkHC.bam.bai"
)

@tag_process("snpeff", "snpeff-single")
def test_snpeff(self):
Expand Down

0 comments on commit 9170a0e

Please sign in to comment.