1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
#include <fstream>
#include <seqan3/std/filesystem>
struct write_file_dummy_struct
{
write_file_dummy_struct()
{
auto file_raw = R"////![sam_file]";
std::ofstream file{std::filesystem::temp_directory_path()/"my.sam"};
std::string str{file_raw};
file << str.substr(1); // skip first newline
}
};
write_file_dummy_struct go{};
//![code]
#include <seqan3/core/debug_stream.hpp>
#include <seqan3/io/alignment_file/all.hpp>
#include <seqan3/std/filesystem>
int main()
{
std::filesystem::path tmp_dir = std::filesystem::temp_directory_path(); // get the temp directory
seqan3::alignment_file_input fin{tmp_dir/"my.sam"}; // default fields
for (auto & rec : fin)
seqan3::debug_stream << seqan3::get<seqan3::field::cigar>(rec) << '\n'; // access cigar vector
}
//![code]
|