def read_target_positions(file_path, filter_chromosomes):
    """
    reads a bed file and returns a list of tuples containing genomic coordinates
    """
    if filter_chromosomes==None:
        filter_chromosomes = []
    else:
        print('filtering out: ' + ' '.join(filter_chromosomes))
    with open(file_path) as f:
        data = f.readlines()
    filter_chromosomes = set(filter_chromosomes)
    positions = []
    if data[0].strip()[0] == '#':
        data = data[1:]
    for line in data:
        tokens = line.strip().split()
        chrom = tokens[0]
        start = int(tokens[1])
        end = int(tokens[2])
        #name = tokens[3]
        if not chrom in filter_chromosomes:
            if not 'chrUn' in chrom and not 'random' in chrom and not 'alt' in chrom:
                positions.append([chrom, start, end])
    return positions