def makeAnnotatorROIGO( roi_class, outfile, gofile, workspace, overlap = None ):

    to_cluster = True
    # require 4Gb of free memory
    job_options = "-l mem_free=4000M"

    tmpdir = tempfile.mkdtemp( dir = os.getcwd() )

    segments = buildAnnotatorSegmentsROI( tmpdir, 
                                          roi_class,
                                          outfile, 
                                          overlap = overlap )

    if segments == None: 
        E.info("no segments for roi_class `%s` and overlap `%s` - no computation." %(roi_class,
                                                                                     overlap ))
        return
    annotations = buildAnnotatorAnnotations( tmpdir, 
                                             outfile, 
                                             annotations="go", 
                                             gofile = gofile )

    # take only those promotors with GO categories for workspace
    workspaces, synonyms = buildAnnotatorWorkSpace(
        tmpdir, outfile,
        workspaces = (workspace,),
        gc_control=True )
    
    # these are large segments, so increase bucket size
    runAnnotator( tmpdir, outfile, annotations, segments, workspaces, synonyms,
                  "-bucketsize 100" )

############################################################
############################################################
############################################################
##
############################################################
check statistical overlap between intervals and genomic
dataset/ETHPy150Open CGATOxford/cgat/obsolete/pipeline_vitaminD_annotator.py/makeAnnotatorROIGO