Skip to content

Commit

Permalink
Change locus to 'None' if no assembly pieces are found
Browse files Browse the repository at this point in the history
  • Loading branch information
rrwick committed Apr 18, 2023
1 parent 7d92cb0 commit 3ab6ada
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions kaptive.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,20 @@ def main():
assembly = Assembly(fasta_file)
best = get_best_locus_match(assembly, ref_seqs, refs, args.threads)
if best is None:
type_gene_results = {}
best = Locus('None', '', '', [])
else:
find_assembly_pieces(assembly, best, args)
assembly_pieces_fasta = save_assembly_pieces_to_file(best, assembly, args.out)
type_gene_results = type_gene_search(assembly_pieces_fasta, type_gene_names, args)
if args.no_seq_out and assembly_pieces_fasta is not None:
os.remove(assembly_pieces_fasta)
protein_blast(assembly, best, gene_seqs, args)
apply_special_logic(best, special_logic, ref_genes)
if best.type == 'unknown':
best.type = 'unknown (' + best.name + ')'

find_assembly_pieces(assembly, best, args)
if not best.assembly_pieces:
best = Locus('None', '', '', [])

assembly_pieces_fasta = save_assembly_pieces_to_file(best, assembly, args.out)
type_gene_results = type_gene_search(assembly_pieces_fasta, type_gene_names, args)
if args.no_seq_out and assembly_pieces_fasta is not None:
os.remove(assembly_pieces_fasta)
protein_blast(assembly, best, gene_seqs, args)
apply_special_logic(best, special_logic, ref_genes)
if best.type == 'unknown':
best.type = 'unknown (' + best.name + ')'

output(args.out, assembly, best, args, type_gene_names, type_gene_results,
json_list, output_table, output_json, all_gene_dict)
Expand Down

0 comments on commit 3ab6ada

Please sign in to comment.