{"id":276,"date":"2018-12-23T15:02:00","date_gmt":"2018-12-23T07:02:00","guid":{"rendered":"https:\/\/www.next-bioinfo.tw\/?p=276"},"modified":"2023-09-23T15:57:47","modified_gmt":"2023-09-23T07:57:47","slug":"%e3%80%90ngs-%e8%bb%9f%e9%ab%94%e9%96%8b%e7%99%bc%e3%80%91%e4%bd%bf%e7%94%a8seqan3-%e8%ae%80%e5%8f%96fastq%e6%a0%bc%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/www.next-bioinfo.tw\/en\/2018\/12\/%e3%80%90ngs-%e8%bb%9f%e9%ab%94%e9%96%8b%e7%99%bc%e3%80%91%e4%bd%bf%e7%94%a8seqan3-%e8%ae%80%e5%8f%96fastq%e6%a0%bc%e5%bc%8f\/","title":{"rendered":"\u3010NGS Software Development\u3011Using SeqAn3 to Read FASTQ Format"},"content":{"rendered":"<p>SeqAn3 was a library that supports modern C++ for data preprocessing of NGS data. In this article, we will explain how to use SeqAn3 to read raw data (FASTQ) from disk using C++.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_54_1 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" >Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\" role=\"button\"><label for=\"item-6a6d40d08066f\" ><span class=\"\"><span style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewbox=\"0 0 24 24\" version=\"1.2\" baseprofile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input aria-label=\"Toggle\" type=\"checkbox\"  id=\"item-6a6d40d08066f\"><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.next-bioinfo.tw\/en\/2018\/12\/%e3%80%90ngs-%e8%bb%9f%e9%ab%94%e9%96%8b%e7%99%bc%e3%80%91%e4%bd%bf%e7%94%a8seqan3-%e8%ae%80%e5%8f%96fastq%e6%a0%bc%e5%bc%8f\/#Seqan3%E5%87%BD%E5%BC%8F%E5%BA%AB%E7%9A%84Hello_World\" title=\"The Hello World of Seqan3\">The Hello World of Seqan3<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.next-bioinfo.tw\/en\/2018\/12\/%e3%80%90ngs-%e8%bb%9f%e9%ab%94%e9%96%8b%e7%99%bc%e3%80%91%e4%bd%bf%e7%94%a8seqan3-%e8%ae%80%e5%8f%96fastq%e6%a0%bc%e5%bc%8f\/#Seqan3%E5%87%BD%E5%BC%8F%E5%BA%AB%E8%AE%80%E5%8F%96fastq\" title=\"Seqan3\u51fd\u5f0f\u5eab\u8b80\u53d6fastq\">Seqan3\u51fd\u5f0f\u5eab\u8b80\u53d6fastq<\/a><\/li><\/ul><\/nav><\/div>\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Seqan3%E5%87%BD%E5%BC%8F%E5%BA%AB%E7%9A%84Hello_World\"><\/span>The Hello World of Seqan3<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>After installation, we can use the debug_stream method to see if everything worked correctly. Here\u2019s a sample test code:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:8.4375px;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0\">C++<\/span><span role=\"button\" tabindex=\"0\" data-code=\"#include &lt;seqan3\/core\/debug_stream.hpp&gt;  int main(){    seqan3::debug_stream &lt;&lt; &quot;Hello World!&quot;;}\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewbox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #5E81AC; font-weight: bold\">#<\/span><span style=\"color: #81A1C1\">include<\/span><span style=\"color: #5E81AC\"> <\/span><span style=\"color: #ECEFF4\">&lt;<\/span><span style=\"color: #A3BE8C\">seqan3\/core\/debug_stream.hpp<\/span><span style=\"color: #ECEFF4\">&gt;<\/span><span style=\"color: #5E81AC\"> <\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"> <\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">int<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">main<\/span><span style=\"color: #ECEFF4\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    seqan3<\/span><span style=\"color: #ECEFF4\">::<\/span><span style=\"color: #D8DEE9FF\">debug_stream <\/span><span style=\"color: #81A1C1\">&lt;&lt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">Hello World!<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>After compiling the source code and run, we will get:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"Hello World\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewbox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9FF\">Hello World<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Seqan3%E5%87%BD%E5%BC%8F%E5%BA%AB%E8%AE%80%E5%8F%96fastq\"><\/span>Seqan3\u51fd\u5f0f\u5eab\u8b80\u53d6fastq<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>seqan3\u8b80\u53d6\u8cc7\u6599\u7684\u65b9\u5f0f\u70ba\u4f7f\u7528\u5efa\u69cb\u5b50\u5efa\u7acb\u4e00\u500bsequence_file_input\u7684\u7269\u4ef6(seqan3::sequence_file_input fin{std :: cin, format_fasta{}}; )\uff0c\u4e4b\u5f8c\u5c31\u53ef\u4ee5\u7528\u8fed\u4ee3\u5668\u4f86\u53d6\u5f97\u6bcf\u4e00\u7b46read\u3002\u9019\u88e1\u793a\u7bc4\u5982\u4e0b\uff0c\u7528seqan3::sequence_file_input fin{&#8220;R1.fastq&#8221;};\u8b80\u53d6\u6a94\u6848R1.fastq\uff0c\u7136\u5f8c\u7528\u8fed\u4ee3\u5668\u8d70\u8a2a\u6bcf\u500bread\u3002\u6bcf\u500bread\u6703\u6709id\uff0csequence\uff0c\u4ee5\u53cabase_qualities\u4e09\u500b\u4e3b\u8981\u7684\u5c6c\u6027\u53ef\u4ee5\u5b58\u53d6\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:16.859375px;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0\">C++<\/span><span role=\"button\" tabindex=\"0\" data-code=\"#include &lt;iostream&gt;#include &lt;seqan3\/core\/debug_stream.hpp&gt;#include &lt;seqan3\/io\/sequence_file\/input.hpp&gt;#include &lt;string&gt;int main() { seqan3::sequence_file_input fin{&quot;R1.fastq&quot;}; for (auto&amp; read : fin) {   seqan3::debug_stream &lt;&lt; &quot;id:  &quot; &lt;&lt; read.id() &lt;&lt; std::endl;   seqan3::debug_stream &lt;&lt; &quot;sequence: &quot; &lt;&lt; read.sequence() &lt;&lt; std::endl;   seqan3::debug_stream &lt;&lt; &quot;base qualities: &quot; &lt;&lt; read.base_qualities() &lt;&lt; std::endl; } return 0;}\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewbox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #5E81AC; font-weight: bold\">#<\/span><span style=\"color: #81A1C1\">include<\/span><span style=\"color: #5E81AC\"> <\/span><span style=\"color: #ECEFF4\">&lt;<\/span><span style=\"color: #A3BE8C\">iostream<\/span><span style=\"color: #ECEFF4\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #5E81AC; font-weight: bold\">#<\/span><span style=\"color: #81A1C1\">include<\/span><span style=\"color: #5E81AC\"> <\/span><span style=\"color: #ECEFF4\">&lt;<\/span><span style=\"color: #A3BE8C\">seqan3\/core\/debug_stream.hpp<\/span><span style=\"color: #ECEFF4\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #5E81AC; font-weight: bold\">#<\/span><span style=\"color: #81A1C1\">include<\/span><span style=\"color: #5E81AC\"> <\/span><span style=\"color: #ECEFF4\">&lt;<\/span><span style=\"color: #A3BE8C\">seqan3\/io\/sequence_file\/input.hpp<\/span><span style=\"color: #ECEFF4\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #5E81AC; font-weight: bold\">#<\/span><span style=\"color: #81A1C1\">include<\/span><span style=\"color: #5E81AC\"> <\/span><span style=\"color: #ECEFF4\">&lt;<\/span><span style=\"color: #A3BE8C\">string<\/span><span style=\"color: #ECEFF4\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">int<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">main<\/span><span style=\"color: #ECEFF4\">()<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"> seqan3<\/span><span style=\"color: #ECEFF4\">::<\/span><span style=\"color: #D8DEE9FF\">sequence_file_input fin<\/span><span style=\"color: #ECEFF4\">{<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">R1.fastq<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">}<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">for<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #81A1C1\">auto&amp;<\/span><span style=\"color: #D8DEE9FF\"> read <\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> fin<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">   seqan3<\/span><span style=\"color: #ECEFF4\">::<\/span><span style=\"color: #D8DEE9FF\">debug_stream <\/span><span style=\"color: #81A1C1\">&lt;&lt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">id:  <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">&lt;&lt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">read<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">id<\/span><span style=\"color: #ECEFF4\">()<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">&lt;&lt;<\/span><span style=\"color: #D8DEE9FF\"> std<\/span><span style=\"color: #ECEFF4\">::<\/span><span style=\"color: #D8DEE9FF\">endl<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">   seqan3<\/span><span style=\"color: #ECEFF4\">::<\/span><span style=\"color: #D8DEE9FF\">debug_stream <\/span><span style=\"color: #81A1C1\">&lt;&lt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">sequence: <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">&lt;&lt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">read<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">sequence<\/span><span style=\"color: #ECEFF4\">()<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">&lt;&lt;<\/span><span style=\"color: #D8DEE9FF\"> std<\/span><span style=\"color: #ECEFF4\">::<\/span><span style=\"color: #D8DEE9FF\">endl<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">   seqan3<\/span><span style=\"color: #ECEFF4\">::<\/span><span style=\"color: #D8DEE9FF\">debug_stream <\/span><span style=\"color: #81A1C1\">&lt;&lt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">base qualities: <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">&lt;&lt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">read<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">base_qualities<\/span><span style=\"color: #ECEFF4\">()<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">&lt;&lt;<\/span><span style=\"color: #D8DEE9FF\"> std<\/span><span style=\"color: #ECEFF4\">::<\/span><span style=\"color: #D8DEE9FF\">endl<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">return<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">0<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">}<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u53e6\u5916\uff0c\u4e5f\u53ef\u4ee5\u7701\u7565auto&amp; read\uff0c\u76f4\u63a5\u7528\u985e\u4f3ctuple\u7684\u65b9\u5f0f\u5beb\uff1a<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:16.859375px;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0\">C++<\/span><span role=\"button\" tabindex=\"0\" data-code=\"#include &lt;iostream&gt;#include &lt;seqan3\/core\/debug_stream.hpp&gt;#include &lt;seqan3\/io\/sequence_file\/input.hpp&gt;#include &lt;string&gt;int main() { seqan3::sequence_file_input fin{&quot;R1.fastq&quot;}; for (auto&amp; [seq , id, bqual] : fin) {   seqan3::debug_stream &lt;&lt; &quot;id:  &quot; &lt;&lt; id &lt;&lt; std::endl;   seqan3::debug_stream &lt;&lt; &quot;sequence: &quot; &lt;&lt; seq&lt;&lt; std::endl;   seqan3::debug_stream &lt;&lt; &quot;base qualities: &quot; &lt;&lt; bqual &lt;&lt; std::endl; } return 0;}\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewbox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #5E81AC; font-weight: bold\">#<\/span><span style=\"color: #81A1C1\">include<\/span><span style=\"color: #5E81AC\"> <\/span><span style=\"color: #ECEFF4\">&lt;<\/span><span style=\"color: #A3BE8C\">iostream<\/span><span style=\"color: #ECEFF4\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #5E81AC; font-weight: bold\">#<\/span><span style=\"color: #81A1C1\">include<\/span><span style=\"color: #5E81AC\"> <\/span><span style=\"color: #ECEFF4\">&lt;<\/span><span style=\"color: #A3BE8C\">seqan3\/core\/debug_stream.hpp<\/span><span style=\"color: #ECEFF4\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #5E81AC; font-weight: bold\">#<\/span><span style=\"color: #81A1C1\">include<\/span><span style=\"color: #5E81AC\"> <\/span><span style=\"color: #ECEFF4\">&lt;<\/span><span style=\"color: #A3BE8C\">seqan3\/io\/sequence_file\/input.hpp<\/span><span style=\"color: #ECEFF4\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #5E81AC; font-weight: bold\">#<\/span><span style=\"color: #81A1C1\">include<\/span><span style=\"color: #5E81AC\"> <\/span><span style=\"color: #ECEFF4\">&lt;<\/span><span style=\"color: #A3BE8C\">string<\/span><span style=\"color: #ECEFF4\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">int<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">main<\/span><span style=\"color: #ECEFF4\">()<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"> seqan3<\/span><span style=\"color: #ECEFF4\">::<\/span><span style=\"color: #D8DEE9FF\">sequence_file_input fin<\/span><span style=\"color: #ECEFF4\">{<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">R1.fastq<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">}<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">for<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #81A1C1\">auto&amp;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">[<\/span><span style=\"color: #D8DEE9FF\">seq <\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> id<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> bqual<\/span><span style=\"color: #ECEFF4\">]<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> fin<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">   seqan3<\/span><span style=\"color: #ECEFF4\">::<\/span><span style=\"color: #D8DEE9FF\">debug_stream <\/span><span style=\"color: #81A1C1\">&lt;&lt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">id:  <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">&lt;&lt;<\/span><span style=\"color: #D8DEE9FF\"> id <\/span><span style=\"color: #81A1C1\">&lt;&lt;<\/span><span style=\"color: #D8DEE9FF\"> std<\/span><span style=\"color: #ECEFF4\">::<\/span><span style=\"color: #D8DEE9FF\">endl<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">   seqan3<\/span><span style=\"color: #ECEFF4\">::<\/span><span style=\"color: #D8DEE9FF\">debug_stream <\/span><span style=\"color: #81A1C1\">&lt;&lt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">sequence: <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">&lt;&lt;<\/span><span style=\"color: #D8DEE9FF\"> seq<\/span><span style=\"color: #81A1C1\">&lt;&lt;<\/span><span style=\"color: #D8DEE9FF\"> std<\/span><span style=\"color: #ECEFF4\">::<\/span><span style=\"color: #D8DEE9FF\">endl<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">   seqan3<\/span><span style=\"color: #ECEFF4\">::<\/span><span style=\"color: #D8DEE9FF\">debug_stream <\/span><span style=\"color: #81A1C1\">&lt;&lt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">base qualities: <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">&lt;&lt;<\/span><span style=\"color: #D8DEE9FF\"> bqual <\/span><span style=\"color: #81A1C1\">&lt;&lt;<\/span><span style=\"color: #D8DEE9FF\"> std<\/span><span style=\"color: #ECEFF4\">::<\/span><span style=\"color: #D8DEE9FF\">endl<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">return<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">0<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">}<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>SeqAn3\u662f\u4e00\u500b\u652f\u63f4\u73fe\u4ee3C++\u7684NGS Data \u4e0a\u6e38\u8655\u7406\u7684\u51fd\u5f0f\u5eab\u3002\u9019\u88e1\u4ecb\u7d39\u5982\u4f55\u4f7f\u7528\u5b83\u4f86\u8b80\u53d6\u525b\u4e0b\u6a5f\u7684\u539f\u59cb\u8cc7\u6599 [&hellip;]<\/p>","protected":false},"author":1,"featured_media":279,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"site-container-style":"default","site-container-layout":"default","site-sidebar-layout":"default","site-transparent-header":"default","disable-article-header":"default","disable-site-header":"default","disable-site-footer":"default","disable-content-area-spacing":"default","footnotes":""},"categories":[32],"tags":[17,4,33],"_links":{"self":[{"href":"https:\/\/www.next-bioinfo.tw\/en\/wp-json\/wp\/v2\/posts\/276"}],"collection":[{"href":"https:\/\/www.next-bioinfo.tw\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.next-bioinfo.tw\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.next-bioinfo.tw\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.next-bioinfo.tw\/en\/wp-json\/wp\/v2\/comments?post=276"}],"version-history":[{"count":1,"href":"https:\/\/www.next-bioinfo.tw\/en\/wp-json\/wp\/v2\/posts\/276\/revisions"}],"predecessor-version":[{"id":280,"href":"https:\/\/www.next-bioinfo.tw\/en\/wp-json\/wp\/v2\/posts\/276\/revisions\/280"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.next-bioinfo.tw\/en\/wp-json\/wp\/v2\/media\/279"}],"wp:attachment":[{"href":"https:\/\/www.next-bioinfo.tw\/en\/wp-json\/wp\/v2\/media?parent=276"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.next-bioinfo.tw\/en\/wp-json\/wp\/v2\/categories?post=276"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.next-bioinfo.tw\/en\/wp-json\/wp\/v2\/tags?post=276"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}