flowcraft.templates.mashdist2json module¶
Purpose¶
This module is intended to generate a json output for mash dist results that can be imported in pATLAS.
Expected input¶
The following variables are expected whether using NextFlow or the
main()
executor.
mash_output
: String with the name of the mash screen output file.- e.g.:
'fastaFileA_mashdist.txt'
- e.g.:
Code documentation¶
-
flowcraft.templates.mashdist2json.
send_to_output
(master_dict, mash_output, sample_id, assembly_file)[source]¶ Send dictionary to output json file This function sends master_dict dictionary to a json file if master_dict is populated with entries, otherwise it won’t create the file
Parameters: - master_dict: dict
dictionary that stores all entries for a specific query sequence in multi-fasta given to mash dist as input against patlas database
- last_seq: str
string that stores the last sequence that was parsed before writing to file and therefore after the change of query sequence between different rows on the input file
- mash_output: str
the name/path of input file to main function, i.e., the name/path of the mash dist output txt file.
- sample_id: str
The name of the sample being parse to .report.json file