Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read_fasta_file_short_names crashes when chromosome name does not have spaces #38

Open
guilhermesena1 opened this issue Jul 3, 2021 · 1 comment
Labels

Comments

@guilhermesena1
Copy link
Contributor

read_fasta_file_short_names under smithlab_os.cpp uses the find_first_of function to call a substring of the chromosome name. When the name doesn't contain spaces it returns string::npos and it throws a runtime error because the end iterator is before the start iterator (which we add 1 because of the > character).

@guilhermesena1
Copy link
Contributor Author

I pushed a fix at 17d21f3 , which checks if there is a space and depending on whether or not it finds it, pushes the entire name or takes just the first word. Since this check is only made when we see the chromosome character (>) this should not make the function any slower. Every program that uses this function probably should be updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant