@follows( mkdir("overlapped_genes") )
@transform( loadGenesetCapseqOverlap, regex(r"(\S+).replicated.genes_capseq_overlap.load"), r"overlapped_genes/\1.overlapped_genes_50.genelist" )
def getGenesetCapseqOverlapList50( infile, outfile ):
    # Connect to DB
    dbhandle = sqlite3.connect( PARAMS["database"] )
    track = P.snip( os.path.basename( infile ), ".replicated.genes_capseq_overlap.load" ).replace("-","_").replace(".","_")
    geneset_name = PARAMS["geneset_name"]
    cc = dbhandle.cursor()
    statement = "ATTACH DATABASE '%s' AS annotations; "  % (PARAMS["geneset_database"])
    cc.execute(statement)
    # Extract data from db
    query = '''select distinct o.gene_id 
               from %(track)s_replicated_%(geneset_name)s_genes_capseq_overlap o, annotations.transcript_info i
               where capseq_pover1>50
               and o.gene_id=i.gene_id
               and o.length > 1000
               order by length desc''' % locals()
    cc.execute( query )
    # Write to file
    outs = open( outfile, "w")
    for result in cc:
        pre = ""
        for r in result:
            outs.write("%s%s" % (pre, str(r)) )
            pre = "\t"
        outs.write("\n")
    cc.close()
    outs.close()
        
############################################################
Get every wd from self._wmd if its path is under the path of
dataset/ETHPy150Open CGATOxford/cgat/obsolete/pipeline_proj007.py/getGenesetCapseqOverlapList50--crossover with--dataset/ETHPy150Open seb-m/pyinotify/python2/pyinotify.py/WatchManager.__get_sub_rec