@transform( buildPolyphenInput, suffix(".input"), ".features")
def buildPolyphenFeatures( infile, outfile ):
    
    nsnps = len([ x for x in open(infile)])

    to_cluster = True
    stepsize = max( int(nsnps / 200000.0), 1000 )
    job_array=(0, nsnps, stepsize)
    E.info("running array jobs on %i snps" % nsnps )

    scratchdir = os.path.join(os.path.abspath("."), "scratch")
    try:
        os.mkdir( scratchdir )
    except OSError:
        pass

    resultsdir = outfile + ".dir"
    try:
        os.mkdir( resultsdir )
    except OSError:
        pass

    statement = '''
    /net/cpp-group/tools/polyphen-2.0.18/bin/run_pph_cpp.pl
       -s %(peptides)s
       -b %(polyphen_blastdb)s
       -d %(scratchdir)s
       %(infile)s > %(resultsdir)s/%(outfile)s.$SGE_TASK_ID 2> %(resultsdir)s/%(outfile)s.err.$SGE_TASK_ID
    '''
    P.run()

    to_cluster = False
    job_array=None

    statement = '''find %(resultsdir)s -name "*.err.*" -exec cat {} \; > %(outfile)s.log'''
    P.run()

    statement = '''find %(resultsdir)s -not -name "*.err.*" -exec cat {} \; > %(outfile)s'''
    P.run()

###################################################################
###################################################################
###################################################################
Publish message to a channel
dataset/ETHPy150Open CGATOxford/cgat/obsolete/pipeline_snps.py/buildPolyphenFeatures--crossover with--dataset/ETHPy150Open jookies/jasmin/jasmin/vendor/txredisapi.py/RedisProtocol.publish