Add sorting by average quality to seqkit sort
#482
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello!
This PR adds a new feature to the
seqkit sortcommand, allowing sequences to be sorted by their average Phred quality. The following options have been introduced:-qor--by-avg-qual--qual-ascii-baseWith the implementation of quality estimation, I tried to follow the approach used in the
fx2tabcommand.However, the code currently won't work because the
StringCounttype (which was used for storing sequence length) cannot be used for storing average quality. Therefore, a new type (e.g.,StringFloat), probably should be added toutil/stringutil.Could you please confirm that this is a useful feature and, if so, review the code?
PS. For the short ASCII base flag,
-bis already occupied by--by-basesoption, so it is not consistent with-binfx2tab.