@T.timeit<EOL><INDENT>def place(self, reverse_pipe, seqs_list, resolve_placements, files, args,<EOL>slash_endings, tax_descr, clusterer):<DEDENT>
trusted_placements = {}<EOL>files_to_delete = []<EOL>alias_hash = self.alignment_merger(seqs_list, files.comb_aln_fa())<EOL>files_to_delete += seqs_list<EOL>files_to_delete.append(files.comb_aln_fa())<EOL>if os.path.getsize(files.comb_aln_fa()) == <NUM_LIT:0>:<EOL><INDENT>logging.debug("<STR_LIT>")<EOL>to_return = {}<EOL>for idx, file in enumerate(seqs_list):<EOL><INDENT>base_file=os.path.basename(file).replace('<STR_LIT>', '<STR_LIT>')<EOL>to_return[base_file] = {}<EOL><DEDENT>return to_return<EOL><DEDENT>jplace = self.pplacer(files.jplace_output_path(), args.output_directory, files.comb_aln_fa(), args.threads)<EOL>files_to_delete.append(jplace)<EOL>logging.info("<STR_LIT>")<EOL>logging.info("<STR_LIT>")<EOL>classifications=Classify(tax_descr).assignPlacement(<EOL>jplace,<EOL>args.placements_cutoff,<EOL>resolve_placements<EOL>)<EOL>logging.info("<STR_LIT>")<EOL>for idx, file in enumerate(seqs_list):<EOL><INDENT>if reverse_pipe:<EOL><INDENT>base_file=os.path.basename(file).replace('<STR_LIT>', '<STR_LIT>')<EOL>forward_gup=classifications.pop(sorted(classifications.keys())[<NUM_LIT:0>])<EOL>reverse_gup=classifications.pop(sorted(classifications.keys())[<NUM_LIT:0>])<EOL>seqs_list.pop(idx+<NUM_LIT:1>)<EOL>placements_hash = Compare().compare_placements(<EOL>forward_gup,<EOL>reverse_gup,<EOL>args.placements_cutoff,<EOL>slash_endings,<EOL>base_file<EOL>)<EOL>trusted_placements[base_file]=placements_hash['<STR_LIT>']<EOL><DEDENT>else: <EOL><INDENT>base_file=os.path.basename(file).replace('<STR_LIT>', '<STR_LIT>')<EOL>trusted_placements[base_file]={}<EOL>if str(idx) in classifications:<EOL><INDENT>for read, entry in classifications[str(idx)].items():<EOL><INDENT>trusted_placements[base_file][read] = entry['<STR_LIT>']<EOL><DEDENT><DEDENT><DEDENT><DEDENT>with open(jplace) as f: jplace_json = json.load(f)<EOL>cluster_dict = self.convert_cluster_dict_keys_to_aliases(clusterer.seq_library,<EOL>alias_hash)<EOL>hash_with_placements = self.jplace_split(jplace_json,<EOL>cluster_dict)<EOL>for file_alias, placement_entries_list in hash_with_placements.items():<EOL><INDENT>alias_hash[file_alias]['<STR_LIT>'] = placement_entries_list<EOL><DEDENT>for k in alias_hash.keys():<EOL><INDENT>if '<STR_LIT>' not in alias_hash[k]:<EOL><INDENT>alias_hash[k]['<STR_LIT>'] = []<EOL><DEDENT><DEDENT>self.write_jplace(jplace_json,<EOL>alias_hash)<EOL>self.hk.delete(files_to_delete)<EOL>return trusted_placements<EOL>
placement - This is the placement pipeline in GraftM, in aligned reads
            are placed into phylogenetic trees, and the results interpreted.
            If reverse reads are used, this is where the comparisons are made
            between placements, for the summary tables to be build in the
            next stage.

Parameters
----------
reverse_pipe : bool
    True: reverse reads are placed separately
    False: no reverse reads to place.
seqs_list : list
    list of paths to alignment fastas to be placed into the tree
resolve_placements : bool
    True:resolve placements to their most trusted taxonomy
    False: classify reads to their most trusted taxonomy, until the
           confidence cutoff is reached.
files : list
    graftM output file name object
args : obj
    argparse object
Returns
-------
trusted_placements : dict
    dictionary of reads and their trusted placements