def encode(sequence, converter):
    """convert a sequence to numbers using a given converter list"""
    newSeq = []
    for filename in sequence:
        if filename not in converter:
            newSeq.append(1)
        else:
            newSeq.append(converter.index(filename))
    return newSeq
