-
Notifications
You must be signed in to change notification settings - Fork 82
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
Unsupported SAM header tag in @HD: pb #3215
Comments
Hey @notestaff, once again, thank you for finding flaws in our documentation! It should definitely not say that it throws. It's probably a leftover from when we amended the alignment file parsing to be a bit less strict. Do you have an example SAM/BAM file? Just the header section and one record/entry should be enough. We can also just add the In general, What would be a solution you are looking for? It would be possible to redirect Some option to ignore/warn/error would also be possible, but would require code restructuring. |
The first header line reads |
It's now possible to ignore the warnings: https://docs.seqan.de/seqan3/main_user/structseqan3_1_1sam__file__input__options.html#a0ddbdbedd6183dc583d9195917a6ef26 |
Great, thanks a lot! Just in time for external release of our seqan3-based tool :) |
But, this fix suppresses ALL warnings -- a way to suppress specific ones would be better. Also, the SAM spec says "you can freely add new tags for further data fields. Tags containing lowercase letters are reserved for local use". So I'm not sure this should be a warning at all, at least by default, especially for lowercase tags like in our example. |
It's currently the only warning we emit ("Unsupported SAM header tag in [...]"). It's also a bit more flexible than just on/off in that you can postprocess the warning, e.g., void filter()
{
auto fin = get_sam_file_input();
std::ostringstream stream{};
fin.options.stream_warnings_to = std::addressof(stream);
auto it = fin.begin();
for (auto && warning : stream.view() | std::views::split('\n'))
{
if (std::string_view sv{warning.data(), warning.size()}; !sv.empty() && !sv.ends_with("pb"))
std::cerr << sv << '\n';
}
} Would be nicer to overload
I did miss this one sentence in the spec multiple times :) |
Platform
Linux bpb23-acc 5.4.0-136-generic #153-Ubuntu SMP Thu Nov 24 15:56:58 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Question
Is there a way to suppress the message
Unsupported SAM header tag in @HD: pb
when reading PacBio bam files?Relatedly, the documentation says
seqan3/include/seqan3/io/sam_file/detail/format_sam_base.hpp
Line 272 in 57b9924
The text was updated successfully, but these errors were encountered: