def getSnpIndicesWithinGeneWindow(snp_chrom,snp_pos,gene_chrom,gene_start,gene_stop=None,window=0):
    """
    computes for a given gene, a boolean vector indicating which SNPs are close to the gene

    input:
    snp_chrom    :    chromosomal position [F]
    snp_pos      :    position [F]
    gene_chrom   :    gene chromosome (scalar)
    gene_start   :    start of the gene (scalar)
    gene_stop     :    end of the gene (scalar), if not given, gene_start is used
    window       :    window around gene (scalar)
    """
    
    if gene_stop is None: gene_stop = gene_start
    idx = snp_chrom==gene_chrom
    idx*= gene_start - window <= snp_pos
    idx*= snp_pos <= gene_stop + window
    return idx