  while (m_iterator != FastqIterator{} && chromosome != m_sequence.name())
    m_sequence = ++m_iterator;

  if (m_iterator == FastqIterator{})
    throw new ChromosomeNotFoundException{chromosome};

  if (one_based_location > static_cast<const int>(m_sequence.sequence().size()))
    throw new ChromosomeSizeException{chromosome, m_sequence.sequence().size(), one_based_location};

  return m_sequence.sequence()[one_based_location-1];
}

} // namespace gamgee

