def find_orf_distribution(orf_file_dict):
<EOL>orf_dist_dict = dict()<EOL>for file_name, orf_report in orf_file_dict.items():<EOL><INDENT>total_orfs = <NUM_LIT:0><EOL>over_3000 = <NUM_LIT:0><EOL>over_1000 = <NUM_LIT:0><EOL>over_500 = <NUM_LIT:0><EOL>other = <NUM_LIT:0><EOL>with open(orf_report, '<STR_LIT:r>') as orfreport:<EOL><INDENT>for line in orfreport:<EOL><INDENT>if line.startswith('<STR_LIT:>>'):<EOL><INDENT>contig, start, stop, direction = line.split('<STR_LIT:_>')<EOL>size = int(stop) - int(start)<EOL>total_orfs += <NUM_LIT:1><EOL>if size > <NUM_LIT>:<EOL><INDENT>over_3000 += <NUM_LIT:1><EOL><DEDENT>elif size > <NUM_LIT:1000>:<EOL><INDENT>over_1000 += <NUM_LIT:1><EOL><DEDENT>elif size > <NUM_LIT>:<EOL><INDENT>over_500 += <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>other += <NUM_LIT:1><EOL><DEDENT><DEDENT><DEDENT><DEDENT>orf_dist_dict[file_name] = (total_orfs,<EOL>over_3000,<EOL>over_1000,<EOL>over_500,<EOL>other)<EOL>try:<EOL><INDENT>os.remove(orf_report)<EOL><DEDENT>except IOError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>return orf_dist_dict<EOL>
Parse the prodigal outputs to determine the frequency of ORF size ranges for each strain
:param orf_file_dict: dictionary of strain name: /sequencepath/prodigal results.sco
:return: orf_dist_dict: dictionary of strain name: tuple of ORF size range distribution frequencies