Skip to content

Commit

Permalink
Fixed issue related to CDS counting when it is not possible to predic…
Browse files Browse the repository at this point in the history
…t CDSs for one or more inputs.
  • Loading branch information
rfm-targa committed Jul 15, 2024
1 parent 9d09e09 commit 0192c79
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions CHEWBBACA/AlleleCall/allele_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -1990,9 +1990,9 @@ def allele_calling(fasta_files, schema_directory, temp_directory,
print('Make sure that Pyrodigal runs in meta mode (--pm meta) '
'if any input file has less than 100kbp.')
if len(cds_fastas) == 0:
sys.exit(f'\n{ct.CANNOT_PREDICT}')
sys.exit(f'{ct.CANNOT_PREDICT}')

print(f'\nExtracted a total of {total_extracted} CDSs from {len(fasta_files)} inputs.')
print(f'\nExtracted a total of {total_extracted} CDSs from {len(fasta_files)-len(failed)} inputs.')
# Inputs are Fasta files with the predicted CDSs
else:
# Rename the CDSs in each file based on the input unique identifiers
Expand Down Expand Up @@ -2042,7 +2042,7 @@ def allele_calling(fasta_files, schema_directory, temp_directory,
template_dict['int_to_unique'] = int_to_unique

# Change to unique integer identifiers
cds_counts = {unique_to_int[k]: v for k, v in cds_counts.items()}
cds_counts = {unique_to_int[k]: v for k, v in cds_counts.items() if k in unique_to_int}
template_dict['cds_counts'] = cds_counts

# Concatenate subgroups of FASTA files before deduplication
Expand Down
2 changes: 1 addition & 1 deletion CHEWBBACA/utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@
# e.g. files only contain sequence headers, contain invalid
# sequences/chars or pyrodigal cannot predict any genes
CANNOT_PREDICT = ('Could not predict CDSs from any of the input files.'
'\nPlease provide input files in the accepted FASTA format.')
'\nPlease verify the format of the input files.')

INVALID_BSR = ('\nBSR value is not contained in the [0.0, 1.0] interval.')
INVALID_BSR_TYPE = ('\nInvalid BSR value of {0}. BSR value must be contained in the [0.0, 1.0] interval.')
Expand Down

0 comments on commit 0192c79

Please sign in to comment.