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))