@transform(loadLiverTestesUnique, suffix(".unique.bed.load"), ".shared.cpg_obsexp")
def exportLiverTestesSharedCpGObsExp( infile, outfile ):
    track = P.snip( os.path.basename( infile ), ".liver.testes.unique.bed.load" ).replace(".","_").replace("-","_")
    geneset_name = PARAMS["geneset_name"]
    # Connect to DB
    dbhandle = sqlite3.connect( PARAMS["database"] )
    cc = dbhandle.cursor()
    # Extract data from db
    query = '''SELECT CpG_ObsExp
                FROM %(track)s_capseq_composition 
                EXCEPT
                SELECT CpG_ObsExp
                FROM %(track)s_capseq_composition c, %(track)s_intervals i, 
                %(track)s_liver_testes_unique_intervals s
                WHERE c.gene_id=i.interval_id
                AND i.contig=s.contig
                AND i.start=s.start''' % locals()
    cc.execute( query )
    E.info( query )
    # Write to file
    outs = open( outfile, "w")
    #outs.write("gene_id\n")
    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()

###########################################################
Quick check if crawling is finished. Called pretty often, please make sure calls are lightweight.
dataset/ETHPy150Open CGATOxford/cgat/obsolete/pipeline_proj007.py/exportLiverTestesSharedCpGObsExp--crossover with--dataset/ETHPy150Open scrapinghub/frontera/frontera/core/components.py/Backend.finished