@transform(runBlastOnRawSequences, suffix(".blast.gz"), ".lca.gz")
def runLCA(infile, outfile):
    '''
    run the lowest common ancestor algorithm
    on the blast output to assign reads to
    taxa - from mtools. Runs with defaults at
    the moment. At this point we also build
    the functional profile using KEGG - this 
    comes with mtools package
    '''
    track = P.snip(outfile, ".lca.gz")
    outf_tax = P.snip(outfile, ".gz")
    outf_kegg = P.snip(outfile, ".lca.gz") + ".kegg.gz"
    statement = '''lcamapper.sh 
                   -k
                   -i %(infile)s
                   -o %(outf_tax)s > %(outfile)s.log
                   ; gzip %(track)s.blast-kegg.txt
                   ; gzip %(outf_tax)s
                   ; mv %(track)s.blast-kegg.txt.gz %(outf_kegg)s'''
    P.run()

###################################################################
###################################################################
###################################################################
dataset/ETHPy150Open CGATOxford/cgat/obsolete/pipeline_metagenomecommunities.py/runLCA/original