From 2291ca594c646c06b85f86534a5b8dbc449bd81b Mon Sep 17 00:00:00 2001 From: Hermann Romanek Date: Mon, 6 May 2024 21:09:07 +0200 Subject: [PATCH] Support -c/--contig also on single sample calling --- src/sniffles/config.py | 2 +- src/sniffles/sniffles | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sniffles/config.py b/src/sniffles/config.py index 472ac4b..9b30bc7 100644 --- a/src/sniffles/config.py +++ b/src/sniffles/config.py @@ -109,7 +109,7 @@ def add_main_args(self, parser): main_args.add_argument("--tandem-repeats", metavar="IN.bed", type=str, help="(Optional) Input .bed file containing tandem repeat annotations for the reference genome.", default=None) main_args.add_argument("--phase", help="Determine phase for SV calls (requires the input alignments to be phased)", default=False, action="store_true") main_args.add_argument("-t", "--threads", metavar="N", type=int, help="Number of parallel threads to use (speed-up for multi-core CPUs)", default=4) - main_args.add_argument("-c", "--contig", default=None, type=str, help="(Optional) Only process the specified contigs. May be given more than once. Currently only applies to merging.", action="append") + main_args.add_argument("-c", "--contig", default=None, type=str, help="(Optional) Only process the specified contigs. May be given more than once.", action="append") minsupport: Union[str, int] minsvlen: int diff --git a/src/sniffles/sniffles b/src/sniffles/sniffles index beb2c4a..47f19c4 100755 --- a/src/sniffles/sniffles +++ b/src/sniffles/sniffles @@ -273,6 +273,10 @@ def Sniffles2_Main(processes: list[parallel.SnifflesWorker]): else: task_count = max(1, math.ceil(contig.mapped / float(task_max_reads))) contig_str = str(contig.contig) + + if config.contig and contig_str not in config.contig: + continue + contigs.append(contig_str) contig_length = bam_in.get_reference_length(contig_str) contig_lengths.append((contig_str, contig_length))