Drop all occurrences of 'N' from prefix and suffix nucleotide strings
    by trimming.

def trim_N_nucleotides(prefix, suffix):
    """
    Drop all occurrences of 'N' from prefix and suffix nucleotide strings
    by trimming.
    """
    if 'N' in prefix:
        # trim prefix to exclude all occurrences of N
        rightmost_index = prefix.rfind('N')
        logger.debug(
            "Trimming %d nucleotides from read prefix '%s'",
            rightmost_index + 1, prefix)
        prefix = prefix[rightmost_index + 1:]

    if 'N' in suffix:
        leftmost_index = suffix.find('N')
        logger.debug(
            "Trimming %d nucleotides from read suffix '%s'",
            len(suffix) - leftmost_index,
            suffix)
        suffix = suffix[:leftmost_index]

    return prefix, suffix