@MainWrapper<EOL>def main(mash_output, hash_cutoff, sample_id, assembly_file):
input_f = open(mash_output, "<STR_LIT:r>")<EOL>master_dict = {}<EOL>for line in input_f:<EOL><INDENT>tab_split = line.split("<STR_LIT:\t>")<EOL>current_seq = tab_split[<NUM_LIT:1>].strip()<EOL>ref_accession = "<STR_LIT:_>".join(tab_split[<NUM_LIT:0>].strip().split("<STR_LIT:_>")[<NUM_LIT:0>:<NUM_LIT:3>])<EOL>mash_dist = tab_split[<NUM_LIT:2>].strip()<EOL>hashes_list = tab_split[-<NUM_LIT:1>].strip().split("<STR_LIT:/>")<EOL>perc_hashes = float(hashes_list[<NUM_LIT:0>]) / float(hashes_list[<NUM_LIT:1>])<EOL>if ref_accession in master_dict.keys():<EOL><INDENT>current_seq += "<STR_LIT>".format(master_dict[ref_accession][-<NUM_LIT:1>])<EOL><DEDENT>if perc_hashes > float(hash_cutoff):<EOL><INDENT>master_dict[ref_accession] = [<EOL>round(<NUM_LIT:1> - float(mash_dist), <NUM_LIT:2>),<EOL>round(perc_hashes, <NUM_LIT:2>),<EOL>current_seq<EOL>]<EOL><DEDENT><DEDENT>send_to_output(master_dict, mash_output, sample_id, assembly_file)<EOL>
Main function that allows to dump a mash dist txt file to a json file

Parameters
----------
mash_output: str
    A string with the input file.
hash_cutoff: str
    the percentage cutoff for the percentage of shared hashes between query
    and plasmid in database that is allowed for the plasmid to be reported
    to the results outputs
sample_id: str
    The name of the sample.