-
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
[IO] Change how seqan3::field::alignment works with SAM/BAM files #2907
Comments
Minimal example: seqan3::sam_file_input input_file{input_path};
for (auto & record : input_file)
{
seqan3::debug_stream << record << '\n';
} Will cause an error. |
This issue will be automatically solved once we remove the See related PRs:
|
is there a solve for this? I am trying to read a bam file and exctract its cigar information using this function, is there an alternative way to do it for now? this is returning the following error in my case:
this is my script, which is identical to the one mentioned in the documentation provided by the authors: #include <filesystem>
#include <seqan3/core/debug_stream.hpp>
#include <seqan3/io/sam_file/all.hpp>
int main()
{
auto filename = std::filesystem::current_path() / "mybam_file.bam";
std::cout << filename << std::endl;
seqan3::sam_file_input fin{filename}; // default fields
for (auto & record : fin){
seqan3::debug_stream << record.cigar_sequence() << '\n'; // access cigar vector
}
} the bamfile is tested to be working |
Hi @Lionward, your issue seems to something else. The error says that you are trying to read BAM, but there is no ZLIB available. Check that Zlib is installed on the system your have build seqan3.
Best, Svenja |
Currently,
seqan3::field::alignment
is a default field of SAM/BAM files. However, it requires a reference sequence in addition to the SAM/BAM input (if I'm understanding correctly). For the following case, this results in an error:There is an error when passing an input file of type
seqan3::sam_file_input
with default fields.The issue is that the default fields includes the
seqan3::field::alignment
field. So thedebug_stream
will try and print out the alignment for the records. However, there is no alignment actually stored.Solution: Remove the
seqan3::field::alignment
field from the default fields forsam_file_input/output
types.Additionally, it would be nice if there were a way to enforce that
seqan3::field::alignment
can only be provided alongside a reference sequence file. I don't think I see anything in the documentation about how that actually works. Or a "default" empty alignment should be stored, to not cause an error when accessing an empty alignment.The text was updated successfully, but these errors were encountered: