def extract_barcode_pos(reads, start, stop, header):
    """
    Extract sequence of adaptator from pos.

    params: seq
    params: start
    params: stop
    params: header
    """
    stop = stop + 1
    if header:
        if start == 0:
            seq = reads.header[-stop:]
            return {'seq': seq, 'qual': [(40) for x in range(len(seq))]}
        seq = reads.header[-stop:-start]
        return {'seq': seq, 'qual': [(40) for x in range(len(seq))]}
    if start == 0:
        return {'seq': reads.seq[:stop], 'qual': reads.qual[:stop]}
    stop = stop - 1
    return {'seq': reads.seq[start:stop], 'qual': reads.qual[start:stop]}
