This is a tad convoluted and would cause a `StopIteration` error if no gene matches. Why not:

```python
for r in ranked_genes:
    if r.get('symbol', '').lower() == gene.lower():
        break
else:
    log.debug('...')
    # etc.
```