INNER CODE UNIT · Python
create_mmseqs
BortonWrightonLabs/DRAM · bin/format_kegg_database.py:87
def create_mmseqs(fasta_loc, output_loc, threads):
"""Takes a fasta file and makes a mmseqs2 database for use in blast searching and hmm searching with mmseqs2."""
LOGGER.info(f"Creating MMseqs2 database for {fasta_loc}...")
subprocess.run(
["mmseqs", "createdb", fasta_loc, output_loc],
check=True,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
)
tmp_dir = path.join(path.dirname(output_loc), "tmp")
LOGGER.info(f"Created MMseqs2 database for {fasta_loc}... Now creating index")
subprocess.run(
["mmseqs", "createindex", output_loc, tmp_dir, "--threads", str(threads)],
check=True,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
)
LOGGER.info(f"MMseqs2 database created at {output_loc}")