def buildAnnotatorDistanceAnnotations( annotations = "expression" ):

    tmpfile = P.getTempFile( "." )
    tmpfilename = tmpfile.name 

    if annotations == "expression":
        dbhandle = sqlite3.connect( PARAMS["database"] )
        cc = dbhandle.cursor()

        statement = """
        SELECT gene_id,
        CASE WHEN %(annodist_master_expression_select)s THEN 'responsive' ELSE 'nonresponsive' END
        FROM probeset2transcript AS e,
        %(annodist_master_expression)s AS d 
        WHERE d.cluster_id = e.cluster_id
        """ % dict( locals().items() + PARAMS.items() )

        data = cc.execute( statement ).fetchall()
        tmpfile.write("gene_id\tlabel\n" )
        for gene_id, label in data: tmpfile.write("%s\t%s\n" % (gene_id, label ) )
        tmpfile.close()

    return tmpfilename

############################################################
############################################################
############################################################
##
############################################################
build an annotations file for annotator_distance.
dataset/ETHPy150Open CGATOxford/cgat/obsolete/pipeline_vitaminD_annotator.py/buildAnnotatorDistanceAnnotations