scripts/support/merge_all_tbl_files.py
def merge_batch_search_tbls(result_dir, filename = None):
    """
    Merges all infernal tbl files produced by a genome_scanner batch search

    result_dir: The path to the result directory

    return: void
    """

    fp_out = open(os.path.join(result_dir, "full_region.tbl"), 'w')

    subdirs = [x for x in os.listdir(result_dir) if
                os.path.isdir(os.path.join(result_dir, x))]

    # list 24 support subdirs
    for subdir in subdirs:
        subdir_loc = os.path.join(result_dir, subdir)
        umgs_dirs = os.listdir(subdir_loc)

        # list umgs dirs
        for umgs_dir in umgs_dirs:
            umgs_dir_loc = os.path.join(subdir_loc, umgs_dir)

            # list all tbl files
            tbl_files = [x for x in os.listdir(umgs_dir_loc) if x.endswith(".tbl")]

            for tbl_file in tbl_files:
                tbl_file_loc = os.path.join(umgs_dir_loc, tbl_file)
                fp_in = open(tbl_file_loc, 'r')
                tbl_lines = fp_in.readlines()
                fp_out.writelines(tbl_lines)
                fp_in.close()

    fp_out.close()

    Merges all infernal tbl files produced by a genome_scanner batch search

    result_dir: The path to the result directory

    return: void
    
Merges all infernal tbl files produced by a genome_scanner batch search
result_dir: The path to the result directory

void
Merges all infernal tbl files produced by a genome_scanner batch search result_dir : The path to the result directory void
def merge_batch_search_tbls(result_dir, filename = None):
    fp_out = open(os.path.join(result_dir, "full_region.tbl"), 'w')
    subdirs = [x for x in os.listdir(result_dir) if
                os.path.isdir(os.path.join(result_dir, x))]
    for subdir in subdirs:
        subdir_loc = os.path.join(result_dir, subdir)
        umgs_dirs = os.listdir(subdir_loc)
        for umgs_dir in umgs_dirs:
            umgs_dir_loc = os.path.join(subdir_loc, umgs_dir)
            tbl_files = [x for x in os.listdir(umgs_dir_loc) if x.endswith(".tbl")]
            for tbl_file in tbl_files:
                tbl_file_loc = os.path.join(umgs_dir_loc, tbl_file)
                fp_in = open(tbl_file_loc, 'r')
                tbl_lines = fp_in.readlines()
                fp_out.writelines(tbl_lines)
                fp_in.close()
    fp_out.close()
def merge_batch_search_tbls ( result_dir , filename = None ) : fp_out = open ( os . path . join ( result_dir , "full_region.tbl" ) , 'w' ) subdirs = [ x for x in os . listdir ( result_dir ) if os . path . isdir ( os . path . join ( result_dir , x ) ) ] for subdir in subdirs : subdir_loc = os . path . join ( result_dir , subdir ) umgs_dirs = os . listdir ( subdir_loc ) for umgs_dir in umgs_dirs : umgs_dir_loc = os . path . join ( subdir_loc , umgs_dir ) tbl_files = [ x for x in os . listdir ( umgs_dir_loc ) if x . endswith ( ".tbl" ) ] for tbl_file in tbl_files : tbl_file_loc = os . path . join ( umgs_dir_loc , tbl_file ) fp_in = open ( tbl_file_loc , 'r' ) tbl_lines = fp_in . readlines ( ) fp_out . writelines ( tbl_lines ) fp_in . close ( ) fp_out . close ( )
Merges all infernal tbl files produced by a genome_scanner batch search
result_dir: The path to the result directory
Merges all infernal tbl files produced by a genome_scanner batch search result_dir : The path to the result directory
"""
    Merges all infernal tbl files produced by a genome_scanner batch search

    result_dir: The path to the result directory

    return: void
    """ # list 24 support subdirs # list umgs dirs # list all tbl files
result_dir
filename