-
Notifications
You must be signed in to change notification settings - Fork 116
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
Misuse of rstrip in make_variants_long_table.py script #277
Labels
bug
Something isn't working
Comments
drpatelh
added a commit
to drpatelh/nf-core-viralrecon
that referenced
this issue
Feb 15, 2022
Hi @fmaguire ! Thanks for reporting! Created a patch release for v2.3.1 that I will get out today. A single word change turned into a bit of a 🐰 🕳️ and I have updated a bunch of other stuff too. |
Hah, cheers! I figured it might (e.g., which python version is used etc) despite being a seeming trivial fix, that is why I didn't just submit a quick PR. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi folks.
There is a problem with the use of rstrip to remove file suffixes at https://github.com/nf-core/viralrecon/blob/master/bin/make_variants_long_table.py#L47 that can cause issues (and a workflow failure) for some sample names.
rstrip
doesn't remove a specified substring from the end of string.It actually removes any characters (and any number of them) regardless of order in the substring from the end of string.
rstrip
only stops when it encounters a character in the string not in the specified substring.e.g.,
This means sample names containing characters in the suffix being removed get mangled:
Replacing rstrip with
removesuffix
should fix this in python >=3.9 (alternatively replace should be fine although a simple regex would be better!).The text was updated successfully, but these errors were encountered: