Skip to content

Commit ba2facc

Browse files
authored
Merge pull request #41 from broadinstitute/hm-fix-no-candidate-probes
Improve handling of the case when there are no candidate probes
2 parents 8d42266 + e0f8080 commit ba2facc

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

catch/filter/probe_designer.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,16 @@ def _design_for_genomes(self, genomes, filters):
174174
allow_small_seqs=self.allow_small_seqs,
175175
seq_length_to_skip=self.seq_length_to_skip)
176176

177+
if len(candidates) == 0:
178+
# There are no candidate probes, possibly because all input
179+
# sequences in genomes were skipped
180+
logger.warning(("There are no candidate probes for a grouping of "
181+
"genomes; it is possible that --small-seq-skip or "
182+
"--small-seq-min are incompatible with the input sequence "
183+
"lengths, especially if --cluster-and-design-separately is "
184+
"set small. Skipping this grouping and returning no probes."))
185+
return ([], [])
186+
177187
probes = self._pass_through_filters(candidates, genomes, filters)
178188
return (candidates, probes)
179189

catch/probe.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,9 @@ def construct(kmer_probe_map):
693693
ValueError if k-mers have different lengths or the kmer_probe_map
694694
does not include positions
695695
"""
696+
if len(kmer_probe_map) == 0:
697+
raise ValueError(("kmer_probe_map is empty"))
698+
696699
# Find the k-mer length k, check that all k-mers in the map are
697700
# of length k, and check that the k-mers in the map come with
698701
# positions

0 commit comments

Comments
 (0)