Skip to content

Commit

Permalink
Support -c/--contig also on single sample calling
Browse files Browse the repository at this point in the history
  • Loading branch information
Hermann Romanek committed May 6, 2024
1 parent 97fb29b commit 2291ca5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/sniffles/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/sniffles/sniffles
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 2291ca5

Please sign in to comment.