@follows( liverTestesVenn )
@files( "liver_vs_testes/*.liver.testes.unique.bed", "liver_vs_testes/liver.testes.chromatin.log" )    
def liverTestesUniqueChromatinProfile(infiles, outfile):
    chromatin = P.asList(PARAMS["bigwig_chromatin"])
    if len(chromatin[0]) > 0:
        for infile in infiles:
            track = P.snip( os.path.basename(infile), ".liver.testes.unique.bed" )
            outtemp = P.getTempFile()
            tmpfilename = outtemp.name
            for bw in chromatin:
                chromatin_track = P.snip( os.path.basename(bw), ".bam" )
                ofp = "liver_vs_testes/" + track + "." + chromatin_track + ".profile"    
                statement = '''cat %(infile)s | python %(scriptsdir)s/bed2gff.py --as-gtf | gzip > %(tmpfilename)s.gtf.gz;
                               python %(scriptsdir)s/bam2geneprofile.py 
                               --bamfile=%(bw)s 
                               --gtffile=%(tmpfilename)s.gtf.gz
                               --output-filename-pattern=%(ofp)s
                               --reporter=gene
                               --method=intervalprofile
                               --log=%(outfile)s
                               --normalization=total-sum
                               --normalize-profile=area
                               --normalize-profile=counts
                               --normalize-profile=none'''
                P.run() 
    else:
        statement = '''touch %(outfile)s '''
        P.run()
                     
############################################################
############################################################
## Export gene lists
If a blockdevice associated to a dataset exists, but the dataset
dataset/ETHPy150Open CGATOxford/cgat/obsolete/pipeline_proj007.py/liverTestesUniqueChromatinProfile--crossover with--dataset/ETHPy150Open ClusterHQ/flocker/flocker/node/agents/test/test_blockdevice.py/BlockDeviceDeployerDiscoverStateTests.test_unregistered