From 9586e68e273d7f41fcc73947cbbb0a0a3fd1d550 Mon Sep 17 00:00:00 2001 From: Alex Kearsey <44373764+kearseya@users.noreply.github.com> Date: Tue, 17 Oct 2023 11:32:04 +0100 Subject: [PATCH 1/6] Update main.py fix output path bug when streaming in bam file --- dysgu/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dysgu/main.py b/dysgu/main.py index 6714c90..a47f754 100644 --- a/dysgu/main.py +++ b/dysgu/main.py @@ -245,7 +245,7 @@ def run_pipeline(ctx, **kwargs): dest = os.path.expanduser(kwargs["working_directory"]) logging.info(f"Destination: {dest}") bname = os.path.splitext(os.path.basename(kwargs["bam"]))[0] - tmp_file_name = f"{dest}/{bname if bname != '-' else dest}.{pfix}.bam" + tmp_file_name = f"{dest}/{bname if bname != '-' else os.path.basename(kwargs["working_directory"])}.{pfix}.bam" ctx.obj["output"] = tmp_file_name ctx.obj["reads"] = "None" max_cov_value = sv2bam.process(ctx.obj) From 340d45e6df7e459cfd7e9d43fb2e553e5e8bb227 Mon Sep 17 00:00:00 2001 From: Alex Kearsey <44373764+kearseya@users.noreply.github.com> Date: Tue, 17 Oct 2023 12:04:29 +0100 Subject: [PATCH 2/6] Update main.py --- dysgu/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dysgu/main.py b/dysgu/main.py index a47f754..35bedd3 100644 --- a/dysgu/main.py +++ b/dysgu/main.py @@ -245,7 +245,7 @@ def run_pipeline(ctx, **kwargs): dest = os.path.expanduser(kwargs["working_directory"]) logging.info(f"Destination: {dest}") bname = os.path.splitext(os.path.basename(kwargs["bam"]))[0] - tmp_file_name = f"{dest}/{bname if bname != '-' else os.path.basename(kwargs["working_directory"])}.{pfix}.bam" + tmp_file_name = f"{dest}/{bname if kwargs["bam"] != '-' else os.path.basename(kwargs["working_directory"])}.{pfix}.bam" ctx.obj["output"] = tmp_file_name ctx.obj["reads"] = "None" max_cov_value = sv2bam.process(ctx.obj) From da1fa947ff137e8b1bbacb6ebe456ec32dd41bdb Mon Sep 17 00:00:00 2001 From: Alex Kearsey <44373764+kearseya@users.noreply.github.com> Date: Tue, 17 Oct 2023 12:59:35 +0100 Subject: [PATCH 3/6] Update main.py --- dysgu/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dysgu/main.py b/dysgu/main.py index 35bedd3..bf328ab 100644 --- a/dysgu/main.py +++ b/dysgu/main.py @@ -245,7 +245,7 @@ def run_pipeline(ctx, **kwargs): dest = os.path.expanduser(kwargs["working_directory"]) logging.info(f"Destination: {dest}") bname = os.path.splitext(os.path.basename(kwargs["bam"]))[0] - tmp_file_name = f"{dest}/{bname if kwargs["bam"] != '-' else os.path.basename(kwargs["working_directory"])}.{pfix}.bam" + tmp_file_name = f"{dest}/{bname if bname != '-' else os.path.basename(kwargs['working_directory'])}.{pfix}.bam" ctx.obj["output"] = tmp_file_name ctx.obj["reads"] = "None" max_cov_value = sv2bam.process(ctx.obj) From 5c324aa84995235c4a4f01f6c3e560d5dbb43d4b Mon Sep 17 00:00:00 2001 From: Alex Kearsey <44373764+kearseya@users.noreply.github.com> Date: Tue, 17 Oct 2023 13:25:10 +0100 Subject: [PATCH 4/6] Update setup.py updated version to 1.6.2 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 1fa3e74..1e87c30 100644 --- a/setup.py +++ b/setup.py @@ -164,7 +164,7 @@ def get_extra_args(): url="https://github.com/kcleal/dysgu", description="Structural variant calling", license="MIT", - version='1.6.1', + version='1.6.2', python_requires='>=3.7', install_requires=[ # runtime requires 'setuptools>=63.0', From a2ff963b5433b9c433df8ecf89116f44ec28b89e Mon Sep 17 00:00:00 2001 From: Alex Kearsey <44373764+kearseya@users.noreply.github.com> Date: Tue, 17 Oct 2023 13:30:33 +0100 Subject: [PATCH 5/6] Update README.rst added normal bam explaination of use to readme --- README.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.rst b/README.rst index 4ddea58..f411760 100644 --- a/README.rst +++ b/README.rst @@ -164,6 +164,12 @@ Re-label events with probability >= 0.3 as PASS:: dysgu filter --pass-prob 0.3 input.vcf > output.vcf +Use normal bams to filter common/germline structural variants:: + + dysgu filter input.vcf /path/to/normal/normal.bam > output.vcf + dysgu filter input.vcf /path/to/normals/*.bam > output.vcf + dysgu filter input.vcf list_of_normals.txt > output.vcf + ➕ Merging SVs -------------- From fb226c47b01f8f3e1606cb0385a6ae5345ceec00 Mon Sep 17 00:00:00 2001 From: Alex Kearsey <44373764+kearseya@users.noreply.github.com> Date: Tue, 17 Oct 2023 13:37:34 +0100 Subject: [PATCH 6/6] Update README.rst --- README.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index f411760..a19c837 100644 --- a/README.rst +++ b/README.rst @@ -166,8 +166,8 @@ Re-label events with probability >= 0.3 as PASS:: Use normal bams to filter common/germline structural variants:: - dysgu filter input.vcf /path/to/normal/normal.bam > output.vcf - dysgu filter input.vcf /path/to/normals/*.bam > output.vcf + dysgu filter input.vcf normal.bam > output.vcf + dysgu filter input.vcf normals/*.bam > output.vcf dysgu filter input.vcf list_of_normals.txt > output.vcf @@ -207,6 +207,7 @@ cohort SVs can be merged using `dysgu merge`, before filtering to get unique SVs dysgu merge *.vcf > merged.vcf dysgu filter --normal-vcf merged.vcf sample1.vcf *.bam > sample1_unique.vcf + dysgu filter --normal-vcf merged.vcf sample1.vcf list_of_normals.txt > sample1_unique.vcf Here, sample1.vcf and merged.vcf can contain multiple samples, although if sample1.vcf is multi-sample, you must provide '--target-sample' to indicate which sample to filter. The output sample1_somatic.vcf will be a single sample vcf containing unique SVs.