@follows(mkdir("metaphlan.dir"))
@transform(preprocessReads, regex("(\S+)/(\S+).fa"), r"metaphlan.dir/\2.readmap")
def buildMetaphlanReadmap(infile, outfile):
    '''
    metaphlan is a program used in metagenomics. It assigns
    reads to clades based on specific genetic markers via 
    blastn searching
    '''
    to_cluster = True

    # at present the pipeline will take a set of files
    # and compute the abundances of different taxonomic groups
    # based on ALL reads i.e. paired data are combined into
    # a single file for analysis
    if PARAMS["metaphlan_executable"] == "bowtie2":
        assert os.path.exists(
            PARAMS["metaphlan_db"] + ".1.bt2"), "missing file %s: Are you sure you have the correct database for bowtie2?" % PARAMS["metaphlan_db"] + ".1.bt2"
        method = "--bowtie2db"
    elif PARAMS["metaphlan_executable"] == "blast":
        assert os.path.exists(
            PARAMS["metaphlan_db"] + "nin"), "missing file %s: Are you sure you have the correct database for blast?" % PARAMS["metaphlan_db"] + "nin"
        method = "--blastdb"
    statement = PipelineMetagenomeAssembly.Metaphlan().build(
        infile, method="read_map")
    P.run()

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