Skip to content

Commit

Permalink
Metaquast: fixed bug with references with same names
Browse files Browse the repository at this point in the history
  • Loading branch information
almiheenko authored and alexeigurevich committed Mar 17, 2017
1 parent d28c640 commit e64e7ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions quast_libs/metautils.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,13 @@ def _proceed_seq(seq_name, seq, ref_name, ref_fasta_ext, total_references, ref_f
for ref_fname in ref_fnames:
ref_name, ref_fasta_ext = qutils.splitext_for_fasta_file(ref_fname)
ref_names.append(ref_name)
dupl_ref_names = [ref_name for ref_name in ref_names if ref_names.count(ref_name) > 1]

excluded_ref_fpaths = []
for ref_fpath in ref_fpaths:
ref_names = qutils.process_labels(ref_fpaths)
for ref_fpath, ref_name in zip(ref_fpaths, ref_names):
total_references = 0
ref_fname = os.path.basename(ref_fpath)
ref_name, ref_fasta_ext = qutils.splitext_for_fasta_file(ref_fname)
if ref_name in dupl_ref_names:
ref_name = qutils.get_label_from_par_dir_and_fname(ref_fpath)
_, ref_fasta_ext = qutils.splitext_for_fasta_file(ref_fname)

chromosomes_by_refs[ref_name] = []
used_seq_names = defaultdict(int)
Expand Down
2 changes: 1 addition & 1 deletion quast_libs/qutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ def get_labels_from_par_dirs(contigs_fpaths):
return labels


def process_labels(contigs_fpaths, labels, all_labels_from_dirs):
def process_labels(contigs_fpaths, labels=None, all_labels_from_dirs=False):
# 1. labels if the provided by -l options
if labels:
# process duplicates, empties
Expand Down

0 comments on commit e64e7ed

Please sign in to comment.