def genericImportAnnotator( infiles, outfile, table, workspace, slice, subset, fdr_method ):

    infile = " ".join(infiles)
    x, suffix = os.path.splitext( infiles[0] )

    tmpfilename = P.getTempFilename()

    statement = '''
	python %(scriptsdir)s/annotator.py \
		--method=fdr-table \
		--fdr-method=%(fdr_method)s \
		--log=%(outfile)s.log \
                --regex-id="(.*)%(suffix)s" \
                %(infile)s > %(tmpfilename)s
        '''
    P.run()

    tmpfile = P.getTempFile()
    
    for line in open( tmpfilename, "r" ):
        if line.startswith("id"):
            line = "subset\tworkspace\tslice\t" + re.sub("^id", "track", line)
        else:
            line = "%s\t%s\t%s\t%s" % (subset, workspace, slice, line)
        tmpfile.write(line)
    tmpfile.close()
    tmpfilename2 = tmpfile.name
        
    statement = '''
   python %(scriptsdir)s/csv2db.py %(csv2db_options)s \
            --table=%(table)s 
    < %(tmpfilename2)s > %(outfile)s'''

    P.run()
    os.unlink( tmpfilename )
    os.unlink( tmpfilename2 )

############################################################
############################################################
############################################################
##
############################################################
generic import of annotator results.
dataset/ETHPy150Open CGATOxford/cgat/obsolete/pipeline_vitaminD_annotator.py/genericImportAnnotator