scripts/processing/infernal_2_pdb_full_region.py
def convert_tblout_2_pdb_full_region(tblout_file, dest_dir=None):
    """
    Converts Infernal's tblout file to pdb_full_region txt dump
    for direct import to the rfam_live database

    tblout_file: Infernal's tblout file

    return: Void
    """

    if dest_dir is None:
        dest_dir = os.getcwd()

    # Rfam website hex colours to randomly choose from
    hex_colours = ["1fc01f", "c00f0f", "bdc000", "c008ae", "00bac0", "8484c0",
                   "93c090", "c0af92", "8e2511", "f29242", "8585e6", "ff87fa",
                   "008700", "454545", "0003c0", "ebeb30", "ff87a4", "0064f4"]

    rand_hex_colour = random.choice(hex_colours)

    fp_in = open(tblout_file, 'r')

    # create a new pdb_full_region output file and mark the date it has been generated
    fp_out = open(os.path.join(dest_dir, "pdb_full_region_" + str(datetime.date.today()) + ".txt"), 'w')

    new_line = ''

    for line in fp_in:
        # skips comment lines
        if line[0] != '#':

            columns = [x for x in line.strip().split(' ') if x != '']

            pdb_info = columns[2].partition('_')

            new_line = '\t'.join((columns[1], pdb_info[0], pdb_info[2],
                                  columns[7], columns[8], columns[14],
                                  columns[15], columns[5], columns[6],
                                  rand_hex_colour, '1'))

            fp_out.write(new_line+'\n')

    fp_in.close()
    fp_out.close()

    Converts Infernal's tblout file to pdb_full_region txt dump
    for direct import to the rfam_live database

    tblout_file: Infernal's tblout file

    return: Void
    
Converts Infernal's tblout file to pdb_full_region txt dump
for direct import to the rfam_live database

Infernal's tblout file

Void
Converts Infernal ' s tblout file to pdb_full_region txt dump for direct import to the rfam_live database Infernal ' s tblout file Void
def convert_tblout_2_pdb_full_region(tblout_file, dest_dir=None):
    if dest_dir is None:
        dest_dir = os.getcwd()
    hex_colours = ["1fc01f", "c00f0f", "bdc000", "c008ae", "00bac0", "8484c0",
                   "93c090", "c0af92", "8e2511", "f29242", "8585e6", "ff87fa",
                   "008700", "454545", "0003c0", "ebeb30", "ff87a4", "0064f4"]
    rand_hex_colour = random.choice(hex_colours)
    fp_in = open(tblout_file, 'r')
    fp_out = open(os.path.join(dest_dir, "pdb_full_region_" + str(datetime.date.today()) + ".txt"), 'w')
    new_line = ''
    for line in fp_in:
        if line[0] != '#':
            columns = [x for x in line.strip().split(' ') if x != '']
            pdb_info = columns[2].partition('_')
            new_line = '\t'.join((columns[1], pdb_info[0], pdb_info[2],
                                  columns[7], columns[8], columns[14],
                                  columns[15], columns[5], columns[6],
                                  rand_hex_colour, '1'))
            fp_out.write(new_line+'\n')
    fp_in.close()
    fp_out.close()
def convert_tblout_2_pdb_full_region ( tblout_file , dest_dir = None ) : if dest_dir is None : dest_dir = os . getcwd ( ) hex_colours = [ "1fc01f" , "c00f0f" , "bdc000" , "c008ae" , "00bac0" , "8484c0" , "93c090" , "c0af92" , "8e2511" , "f29242" , "8585e6" , "ff87fa" , "008700" , "454545" , "0003c0" , "ebeb30" , "ff87a4" , "0064f4" ] rand_hex_colour = random . choice ( hex_colours ) fp_in = open ( tblout_file , 'r' ) fp_out = open ( os . path . join ( dest_dir , "pdb_full_region_" + str ( datetime . date . today ( ) ) + ".txt" ) , 'w' ) new_line = '' for line in fp_in : if line [ 0 ] != '#' : columns = [ x for x in line . strip ( ) . split ( ' ' ) if x != '' ] pdb_info = columns [ 2 ] . partition ( '_' ) new_line = '\t' . join ( ( columns [ 1 ] , pdb_info [ 0 ] , pdb_info [ 2 ] , columns [ 7 ] , columns [ 8 ] , columns [ 14 ] , columns [ 15 ] , columns [ 5 ] , columns [ 6 ] , rand_hex_colour , '1' ) ) fp_out . write ( new_line + '\n' ) fp_in . close ( ) fp_out . close ( )
Converts Infernal's tblout file to pdb_full_region txt dump
for direct import to the rfam_live database
Converts Infernal ' s tblout file to pdb_full_region txt dump for direct import to the rfam_live database
"""
    Converts Infernal's tblout file to pdb_full_region txt dump
    for direct import to the rfam_live database

    tblout_file: Infernal's tblout file

    return: Void
    """ # Rfam website hex colours to randomly choose from # create a new pdb_full_region output file and mark the date it has been generated # skips comment lines
tblout_file
dest_dir