Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #68 +/- ##
===========================================
+ Coverage 71.66% 71.83% +0.17%
===========================================
Files 19 19
Lines 1969 1985 +16
Branches 779 776 -3
===========================================
+ Hits 1411 1426 +15
+ Misses 443 427 -16
- Partials 115 132 +17
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes
🚀 New features to boost your workflow:
|
| // SAM stores quality as Phred+33 ASCII, but kIlluminaBinning is | ||
| // indexed by the Phred VALUE. Without the -33 every lookup lands 33 | ||
| // slots too far right | ||
| int phred = static_cast<unsigned char>(qual[i]) - 33; |
There was a problem hiding this comment.
warning: variable 'phred' is not initialized [cppcoreguidelines-init-variables]
| int phred = static_cast<unsigned char>(qual[i]) - 33; | |
| int phred = 0 = static_cast<unsigned char>(qual[i]) - 33; |
| // slots too far right | ||
| int phred = static_cast<unsigned char>(qual[i]) - 33; | ||
| if (phred < 0) | ||
| phred = 0; |
There was a problem hiding this comment.
warning: use std::max instead of < [readability-use-std-min-max]
| phred = 0; | |
| phred = std::max(phred, 0); |
| if (phred < 0) | ||
| phred = 0; | ||
| if (phred > 93) | ||
| phred = 93; // SAM's maximum; also keeps us inside the initialised table |
There was a problem hiding this comment.
warning: use std::min instead of > [readability-use-std-min-max]
| phred = 93; // SAM's maximum; also keeps us inside the initialised table | |
| phred = std::min(phred, 93); // SAM's maximum; also keeps us inside the initialised table |
| auto roundTrip = [&](int q) { | ||
| binRecord.SetQUAL(phred(q)); | ||
| const std::string out = binRecord.GetQUAL(); | ||
| EXPECT_EQ(out.size(), 2u); |
There was a problem hiding this comment.
warning: integer literal has suffix 'u', which is not uppercase [readability-uppercase-literal-suffix]
| EXPECT_EQ(out.size(), 2u); | |
| EXPECT_EQ(out.size(), 2U); |
| return static_cast<int>(static_cast<unsigned char>(out[0])) - 33; | ||
| }; | ||
|
|
||
| struct { |
There was a problem hiding this comment.
warning: do not declare C-style arrays, use std::array<> instead [cppcoreguidelines-avoid-c-arrays]
struct { int in; int want; } kBins[] = {
^| RAMNTupleRecord losslessRecord; | ||
| losslessRecord.SetQUAL("*"); | ||
| EXPECT_EQ(losslessRecord.GetQUAL(), "*"); | ||
|
|
There was a problem hiding this comment.
warning: integer literal has suffix 'u', which is not uppercase [readability-uppercase-literal-suffix]
| EXPECT_EQ(binRecord.GetQUAL().size(), 10U); |
| return static_cast<int>(static_cast<unsigned char>(out[0])) - 33; | ||
| }; | ||
|
|
||
| struct { |
There was a problem hiding this comment.
warning: do not declare C-style arrays, use std::array<> instead [cppcoreguidelines-avoid-c-arrays]
struct {
^|
|
||
| // Length must be preserved for real quality strings. | ||
| binRecord.SetQUAL("IIIIIIIIII"); | ||
| EXPECT_EQ(binRecord.GetQUAL().size(), 10u); |
There was a problem hiding this comment.
warning: integer literal has suffix 'u', which is not uppercase [readability-uppercase-literal-suffix]
| EXPECT_EQ(binRecord.GetQUAL().size(), 10u); | |
| EXPECT_EQ(binRecord.GetQUAL().size(), 10U); |
| // index inside the initialised part of the table (entries 110..255 | ||
| // are zero-filled, so an out-of-range value would silently decode as | ||
| // Q0 -- the opposite error, but still an error). | ||
| const int phred = std::clamp(static_cast<int>(static_cast<unsigned char>(qual[i])) - 33, 0, 93); |
There was a problem hiding this comment.
warning: variable 'phred' is not initialized [cppcoreguidelines-init-variables]
| const int phred = std::clamp(static_cast<int>(static_cast<unsigned char>(qual[i])) - 33, 0, 93); | |
| const int phred = 0 = std::clamp(static_cast<int>(static_cast<unsigned char>(qual[i])) - 33, 0, 93); |
| // index inside the initialised part of the table (entries 110..255 | ||
| // are zero-filled, so an out-of-range value would silently decode as | ||
| // Q0 -- the opposite error, but still an error). | ||
| const int phred = 0 = std::clamp(static_cast<int>(static_cast<unsigned char>(qual[i])) - 33, 0, 93); |
There was a problem hiding this comment.
warning: variable 'phred' is not initialized [cppcoreguidelines-init-variables]
| const int phred = 0 = std::clamp(static_cast<int>(static_cast<unsigned char>(qual[i])) - 33, 0, 93); | |
| const int phred = 0 = 0 = std::clamp(static_cast<int>(static_cast<unsigned char>(qual[i])) - 33, 0, 93); |
Fixes #67.