def extract_umis(reads, umi_locs, umi_lens, umi_pos):
    """
    (list, list, list, list) -> list
    :param reads: A list of read sequences
    :param umi_locs: A list of 1-based indices indicating which read sequences have the umis.
     (eg umi_locs = [1]: umi is located in 1st read of reads, reads[0])
    :param umi_lens: A list with umi lengths for each location
    :param umi_pos: A list of umi_positions (1-based) within reads
    
    
    Returns a return a list of umi sequences
    Pre-condition: umi_locs, umi_lens and umi_pos have same length
    """
    umis = []
    for umi_loc, umi_len, pos in zip(umi_locs, umi_lens, umi_pos):
        read = reads[int(umi_loc) - 1]
        pos = pos - 1
        umis.append(read[pos:pos + int(umi_len)])
    return umis
