diff --git a/pepmatch/matcher.py b/pepmatch/matcher.py index 028a581..6dd718f 100755 --- a/pepmatch/matcher.py +++ b/pepmatch/matcher.py @@ -12,8 +12,10 @@ from .hamming import hamming +NUM_OUTPUT_COLUMNS = 14 VALID_OUTPUT_FORMATS = ['dataframe', 'csv', 'tsv', 'xlsx', 'json', 'html'] + class Matcher: """ Object class that class takes in a query (either FASTA file or Python list) @@ -321,7 +323,7 @@ def _process_exact_matches( all_matches = [] if not matches: - all_matches.append((peptide,) + (np.nan,) * 13) + all_matches.append((peptide,) + (np.nan,) * NUM_OUTPUT_COLUMNS) else: for match in matches: protein_number = (match - (match % 1000000)) // 1000000 @@ -629,7 +631,7 @@ def _process_mismatch_matches( all_matches = [] if not matches: - all_matches.append((peptide,) + (np.nan,) * 13) + all_matches.append((peptide,) + (np.nan,) * NUM_OUTPUT_COLUMNS) else: for match in matches: metadata_key = (match[2] - (match[2] % 1000000)) // 1000000 @@ -760,7 +762,7 @@ def discontinuous_search(self) -> list: if not match: all_matches.append( - (', '.join([x[0] + str(x[1]) for x in dis_epitope]),) + (np.nan,) * 14 + (', '.join([x[0] + str(x[1]) for x in dis_epitope]),) + (np.nan,) * NUM_OUTPUT_COLUMNS ) return all_matches