@merge( GeneListStats, "genelist_stats.load" )
def loadGeneListStats( infiles, outfile ):

    tablename = P.toTable( outfile )
    outf = open("genelist_stats.txt","w")

    first = True
    for f in infiles:
        track = P.snip( os.path.basename(f), ".genelist.stats" )
        if not os.path.exists( f ): 
            E.warn( "File %s missing" % f )
            continue
        lines = [ x for x in open( f, "r").readlines() if not x.startswith("#") and x.strip() ]
        if first: outf.write( "%s\t%s" % ("track", lines[0] ) )
        first = False
        outf.write( "%s\t%s" % (track,lines[1] ))
    outf.close()
    tmpfilename = outf.name

    statement = '''cat %(tmpfilename)s
                   | python %(scriptsdir)s/csv2db.py
                      --index=track
                      --table=%(tablename)s 
                   > %(outfile)s '''
    P.run()

############################################################
Patch the L{ls} module's time function so the results of L{lsLine} are
dataset/ETHPy150Open CGATOxford/cgat/obsolete/pipeline_species_conservation.py/loadGeneListStats--crossover with--dataset/ETHPy150Open twisted/twisted/twisted/conch/test/test_cftp.py/ListingTests.setUp