-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1192 from smehringer/alignmentIO_cigar_string
Add CIGAR string support to alignment IO
- Loading branch information
Showing
15 changed files
with
558 additions
and
458 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#include <fstream> | ||
|
||
#include <seqan3/std/filesystem> | ||
|
||
struct write_file_dummy_struct | ||
{ | ||
write_file_dummy_struct() | ||
{ | ||
|
||
auto file_raw = R"//![sam_file]( | ||
@HD VN:1.6 SO:coordinate | ||
@SQ SN:ref LN:45 | ||
r001 99 ref 7 30 8M2I4M1D3M = 37 39 TTAGATAAAGGATACTG * | ||
r003 0 ref 9 30 5S6M * 0 0 GCCTAAGCTAA * SA:Z:ref,29,-,6H5M,17,0; | ||
r004 0 ref 16 30 6M14N5M * 0 0 ATAGCTTCAGC * | ||
r003 2064 ref 29 17 5M * 0 0 TAGGC * SA:Z:ref,9,+,5S6M,30,1; | ||
r001 147 ref 37 30 9M = 7 -39 CAGCGGCAT * NM:i:1 | ||
)//![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> | ||
|
||
using namespace seqan3; | ||
|
||
int main() | ||
{ | ||
std::filesystem::path tmp_dir = std::filesystem::temp_directory_path(); // get the temp directory | ||
|
||
alignment_file_input fin{tmp_dir/"my.sam", fields<field::CIGAR>{}}; | ||
|
||
for (auto & [cigar] : fin) | ||
debug_stream << cigar << std::endl; | ||
} | ||
//![code] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.