@transform( sharedIntervals, suffix(".merged.shared.bed"), ".merged.shared.bed.load")
def loadSharedIntervals(infile, outfile):
    track = P.snip( os.path.basename( infile ), ".shared.bed" ).replace(".","_").replace("-","_")
    header = "contig,start,stop,interval_id,fold"
    statement = '''cat %(infile)s | python %(scriptsdir)s/csv2db.py
                      --table=%(track)s_shared_intervals
                      --header=%(header)s
                      --index=contig,start
                      --index=interval_id
                   > %(outfile)s '''
    P.run()

############################################################    
############################################################        
############################################################
## Annotate intervals
Process a Query that is used within a lazy loader.
dataset/ETHPy150Open CGATOxford/cgat/obsolete/pipeline_proj012_chipseq.py/loadSharedIntervals--crossover with--dataset/ETHPy150Open zzzeek/sqlalchemy/examples/dogpile_caching/caching_query.py/RelationshipCache.process_query_conditionally