def makeAnnotatorArchitecture( infile, outfile, **kwargs ):
    
    tmpdir = tempfile.mkdtemp( dir = os.getcwd() )

    track = infile[:-len(".bed")]

    if kwargs:
        segments = buildAnnotatorSegmentsFromDatabase( tmpdir,
                                                                 track, outfile,
                                                                 **kwargs )
    else:
        segments = buildAnnotatorSegments( tmpdir, infile, outfile )


    workspaces, synonyms = buildAnnotatorWorkSpace( tmpdir, outfile,
                                                    workspaces = ("mappable","genomic"),
                                                    gc_control=True )
    
    
    annotations = buildAnnotatorAnnotations( tmpdir, outfile, annotations="architecture" )
    
    runAnnotator( tmpdir, outfile, annotations, segments, workspaces, synonyms )

    shutil.rmtree( tmpdir )

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