diff --git a/preprocessor/cactus_sanitizeFastaHeaders.c b/preprocessor/cactus_sanitizeFastaHeaders.c index c73294117..8f69a2119 100644 --- a/preprocessor/cactus_sanitizeFastaHeaders.c +++ b/preprocessor/cactus_sanitizeFastaHeaders.c @@ -128,6 +128,17 @@ void addUniqueFastaPrefix(void* destination, const char *fastaHeader, const char clipped_header = prefixed_header; } + // sanity check + int64_t n = strlen(string); + for (int64_t i = 0; i < n; ++i) { + char c = tolower(string[i]); + if (c != 'a' && c != 'c' && c != 'g' && c != 't' && c != 'n') { + fprintf(stderr, "Error: Non-ACGTN character '%c' found at position %" PRIi64 " of FASTA sequence %s in event %s\n", + c, i, fastaHeader, eventName); + exit(1); + } + } + fastaWrite((char*)string, clipped_header, stdout); free(clipped_header); } diff --git a/submodules/paffy b/submodules/paffy index 5a71703d2..115c01abc 160000 --- a/submodules/paffy +++ b/submodules/paffy @@ -1 +1 @@ -Subproject commit 5a71703d2f0ee0f592e6c2bbf40a00ec6c9ee5ef +Subproject commit 115c01abcfe01bfb7a7a03317b32ca6d88d84e69