• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

broadinstitute / catch / 280 / 3
94%
master: 94%

Build:
DEFAULT BRANCH: master
Ran 11 Jan 2019 01:56AM UTC
Files 63
Run time 7s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

11 Jan 2019 01:22AM UTC coverage: 95.124% (+0.02%) from 95.106%
280.3

push

travis-ci-com

haydenm
Fix bug when a sequence is shorter than k-mer length

A bug was introduced by allowing design when sequences are
shorter than the probe length (c09c4f6). If a sequence is
shorter than the k-mer length (k) used for finding probe
coverage in the sequence, then probe.find_probe_covers_in_sequence()
could crash.

In particular, it could compute a bounds_size that is 0 (or
even negative), and then the line that follows:
  for start in range(0, len(sequence) - k + 1, bounds_size):
would fail because the step size is 0 (or lead to undefined
behavior if the end of the range, len(sequence)-k+1, is <0
and bounds_size<0 as well).

This can happen for two reasons: (1) if a sequence is extremely
small (e.g., <20 nt). (2) k is sufficiently high so that
len(sequence) < k. The latter can happen, for example, if
the number of mismatches to tolerate is set to 0 and then
probe._construct_pigeonholed_kmer_probe_map() sets k to be
equal to the probe length, but the input sequence is
shorter than the probe length.

This commit fixes this bug by inserting a check for this
special case, and simply not attempting to cover the sequence
(returning that no probes cover it) if it is true.

This commit also adds a unit test that failed before the fix,
but passes with the fix.

1576 of 1759 branches covered (89.6%)

4858 of 5107 relevant lines covered (95.12%)

0.95 hits per line

Source Files on job 280.3
  • Tree
  • List 0
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 67
  • Travis Job 280.3
  • d33fda12 on github
  • Prev Job for on master (#279.1)
  • Next Job for on master (#282.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc