@transform( getCapseqSpecificIntervals, suffix(".cap_only.bed"), ".cap_only.bed.load")
def loadCapseqSpecificIntervals(infile, outfile):
    track = P.snip( os.path.basename( infile ), ".cap_only.bed" ).replace(".","_").replace("-","_")
    header = "contig,start,stop,interval_id"
    statement = '''cat %(infile)s | awk 'OFS="\\t" {print $1,$2,$3,$4}' | python %(scriptsdir)s/csv2db.py
                      --database=%(database)s
                      --table=%(track)s_cap_not_predicted_cgi
                      --index=contig,start
                      --index=interval_id
                      --header=%(header)s
                      --allow-empty
                   > %(outfile)s '''
    P.run()

############################################################
Load intervals not overlapping CGI into database
dataset/ETHPy150Open CGATOxford/cgat/obsolete/pipeline_proj007.py/loadCapseqSpecificIntervals