{"id":2892,"date":"2025-01-29T02:12:29","date_gmt":"2025-01-28T17:12:29","guid":{"rendered":"https:\/\/home.hiroshima-u.ac.jp\/~tigawa\/?p=2892"},"modified":"2025-02-08T15:19:10","modified_gmt":"2025-02-08T06:19:10","slug":"bioinfonanopore-read%e3%81%ae%e6%9c%80%e7%b5%82%e7%9a%84%e3%81%aabasecalling%e6%b3%95-250129-ver","status":"publish","type":"post","link":"https:\/\/home.hiroshima-u.ac.jp\/~tigawa\/?p=2892","title":{"rendered":"[bioinfo]nanopore read\u306e\u7cbe\u5ea6\u5411\u4e0a\u306e\u305f\u3081\u306ebasecalling\u6cd5 (250129 ver.)"},"content":{"rendered":"\n<ol class=\"wp-block-list\">\n<li><a href=\"#one\">Obtain pod5 data by Minknow\uff08Minknow\u3067pod5\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\uff09<\/a><\/li>\n\n\n\n<li><a href=\"#two\">Basecall using latest version of dorado and the model with &#8211;emit-moves\uff08dorado\u3067&#8211;emit-moves\u3092\u4ed8\u3051\u3066\u30d9\u30fc\u30b9\u30b3\u30fc\u30eb\u3059\u308b\uff09<\/a><\/li>\n\n\n\n<li><a href=\"#three\">Identify duplex reads by duplex_tools\uff08duplex_tools\u3067duplex read\u3092\u5224\u5225\u3059\u308b\uff09<\/a><\/li>\n\n\n\n<li><a href=\"#four\">Basecall duplex reads by using dorado\uff08dorado\u3067duplex basecall\u3092\u884c\u3046\uff09<\/a><\/li>\n\n\n\n<li><a href=\"#five\">Split fused template and complement reads by duplex_tools&#8217;s split-pair\uff08\u9023\u7d9a\u3057\u3066\u30dd\u30a2\u306b\u5165\u3063\u305fduplex read\u3092\u5206\u5272\u3059\u308b\uff09<\/a><\/li>\n\n\n\n<li><a href=\"#six\">Basecall duplex reads by using dorado\uff08split\u3057\u305fread\u306b\u3064\u3044\u3066dorado\u3067duplex basecall\u3092\u884c\u3046\uff09<\/a><\/li>\n\n\n\n<li><a href=\"#seven\">Convert unmapped bam to fastq of simplex reads\uff08unmapped bam\u304b\u3089fastq\u306b\u5909\u63db\uff09<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/eight\">Purge duplex reads and low quality reads from simplex fastq data and concatenate\uff08simplex\u30c7\u30fc\u30bf\u304b\u3089\u30af\u30aa\u30ea\u30c6\u30a3\u304c\u4f4e\u3044\u30c7\u30fc\u30bf\u3068duplex read\u3092\u6392\u9664\u3057\u3066\u7d50\u5408\u3059\u308b\uff09<\/a><\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator aligncenter has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<p id=\"one\"><strong>1. Obtain pod5 data by Minknow\uff08Minknow\u3067pod5\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\uff09<\/strong><br>\u3000\u666e\u901a\u306b\u30b7\u30fc\u30b1\u30f3\u30b9\u30e9\u30f3\u3092\u884c\u3046\u3001\u30d9\u30fc\u30b9\u30b3\u30fc\u30eb\u306f\u3057\u306a\u304f\u3066\u3082\u826f\u3044\u304c\u30c7\u30fc\u30bf\u306e\u6982\u8981\u306f\u3057\u305f\u65b9\u304c\u6b63\u78ba\u306b\u308f\u304b\u308b\u3002<\/p>\n\n\n\n<p id=\"two\"><strong>2. Basecall using latest version of dorado and the model with &#8211;emit-moves\uff08dorado\u3067&#8211;emit-moves\u3092\u4ed8\u3051\u3066\u30d9\u30fc\u30b9\u30b3\u30fc\u30eb\u3059\u308b\uff09<\/strong><br>\u3000duplex_tools\u306e\u89e3\u8aac\u3067\u306fhac\u3067\u30d9\u30fc\u30b9\u30b3\u30fc\u30eb\u3059\u308b\u3068\u3042\u308b\u304c\u3001\u7d50\u5c40\u6700\u65b0\u7248\u306e\u30e2\u30c7\u30eb\u3067\u30d9\u30fc\u30b9\u30b3\u30fc\u30eb\u3057\u305f\u65b9\u304csimplex\u30ea\u30fc\u30c9\u306e\u6b63\u78ba\u6027\u304c\u9ad8\u3044\u305f\u3081\u3001GPU\u306e\u4f59\u88d5\u304c\u3042\u308c\u3070sup\u3067\u30d9\u30fc\u30b9\u30b3\u30fc\u30eb\u3059\u308b&#8221;sup&#8221;\u3068\u66f8\u304f\u3060\u3051\u3067pod5\u30c7\u30fc\u30bf\u304b\u3089\u9069\u3057\u305f\u30e2\u30c7\u30eb\u3092\u81ea\u52d5\u7684\u306b\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u30d9\u30fc\u30b9\u30b3\u30fc\u30eb\u3057\u3066\u304f\u308c\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dorado basecaller sup -r .\/ --emit-moves > unmapped_reads_with_moves.bam<\/code><\/pre>\n\n\n\n<p id=\"three\"><strong>3. Identify duplex reads by duplex_tools\uff08duplex_tools\u3067duplex read\u3092\u5224\u5225\u3059\u308b\uff09<\/strong><br> duplex_tools\u306fpython 3.10\u4e0b\u4ee5\u5916\u3067\u306f\u30a8\u30e9\u30fc\u304c\u751f\u3058\u308b\u70ba\u3001conda\u3067python 3.10\u74b0\u5883\u3092\u4f5c\u3063\u305f\u4e0a\u3067\u3001pip\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#create python 3.10 env\nconda create -n python310 python=3.10\nconda activate python310\n#install duplex_tools\npython -m venv venv --prompt duplex\n. venv\/bin\/activate\npip install duplex_tools\n#judge duplex reads using duplex_tools\nduplex_tools pair --output_dir pairs_from_bam unmapped_reads_with_moves.bam<\/code><\/pre>\n\n\n\n<p id=\"four\"><strong>4. Basecall duplex reads by using dorado\uff08dorado\u3067duplex basecall\u3092\u884c\u3046\uff09<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#basecall all accessible pod5 data under sequence data folder\ndorado duplex sup -r .\/ --pairs pairs_from_bam\/pair_ids_filtered.txt &gt; duplex_orig.sam<\/code><\/pre>\n\n\n\n<p id=\"five\"><strong>5. Split fused template and complement reads by duplex_tools&#8217;s split-pair\uff08\u9023\u7d9a\u3057\u3066\u30dd\u30a2\u306b\u5165\u3063\u305fduplex read\u3092\u5206\u5272\u3059\u308b\uff09<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>duplex_tools split_pairs unmapped_reads_with_moves.bam .\/ pod5_splitduplex\/\n#concat extracted split ids\ncat pod5_splitduplex\/*_pair_ids.txt &gt; split_duplex_pair_ids.txt<\/code><\/pre>\n\n\n\n<p id=\"six\"><strong>6. Basecall duplex reads by using dorado\uff08split\u3057\u305fread\u306b\u3064\u3044\u3066dorado\u3067duplex basecall\u3092\u884c\u3046\uff09<\/strong><br>\u3000\u4eca\u5ea6\u306fsplit\u3057\u305fread\u306e\u30d9\u30fc\u30b9\u30b3\u30fc\u30eb\u3092\u884c\u3046\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dorado duplex sup pod5_splitduplex\/ --pairs split_duplex_pair_ids.txt > duplex_splitduplex.sam<\/code><\/pre>\n\n\n\n<p id=\"seven\"><strong>7. Convert unmapped bam to fastq of simplex reads\uff08unmapped bam\u304b\u3089fastq\u306b\u5909\u63db\uff09<\/strong><br>gatk\u3092\u4f7f\u3063\u3066sam\u3042\u308b\u3044\u306fbam\u304b\u3089fastq\u306b\u5909\u63db\u3059\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gatk SamToFastq -I unmapped_reads_with_moves.bam -FASTQ unmapped_reads_with_moves.fastq\ngatk SamToFastq -I duplex_orig.sam -FASTQ duplex_orig.fastq\ngatk SamToFastq -I duplex_splitduplex.sam -FASTQ duplex_splitduplex.fastq<\/code><\/pre>\n\n\n\n<p id=\"eight\"><strong>8. Purge duplex reads and low quality reads from simplex fastq data and concatenate\uff08simplex\u30c7\u30fc\u30bf\u304b\u3089\u30af\u30aa\u30ea\u30c6\u30a3\u304c\u4f4e\u3044\u30c7\u30fc\u30bf\u3068duplex read\u3092\u6392\u9664\u3057\u3066\u7d50\u5408\u3059\u308b\uff09<\/strong><br> NanoFilt\u3068seqkit grep\u3092\u4f7f\u3063\u3066\u30af\u30aa\u30ea\u30c6\u30a3\u304c\u4f4e\u3044\u30ea\u30fc\u30c9\u3068\u91cd\u8907\u3057\u305f\u30ea\u30fc\u30c9\u3092\u6392\u9664\u3059\u308b\u3002\u30af\u30aa\u30ea\u30c6\u30a3\u304c\u4f4e\u3044\u30ea\u30fc\u30c9\u304c\u5165\u308b\u306e\u306f\u3059\u3079\u3066\u306epod5\u3082\u5165\u308c\u3066\u30d9\u30fc\u30b9\u30b3\u30fc\u30eb\u3057\u3066\u3044\u308b\u305f\u3081\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#convert space of list file to change row for seqkit\nsed 's\/ \/\\n\/g' pairs_from_bam\/pair_ids_filtered.txt &gt; pairs_from_bam\/pair_ids_filtered+.txt\nsed 's\/ \/\\n\/g' split_duplex_pair_ids.txt &gt; split_duplex_pair_ids+.txt\n\n#concatenate duplex read list\ncat pairs_from_bam\/pair_ids_filtered+.txt split_duplex_pair_ids+.txt &gt; duplex_list.txt\n\n#purge duplex reads from simplex basecall data\nseqkit grep -f duplex_list.txt -v unmapped_reads_with_moves.fastq -o unmapped_reads_with_moves_only_simplex.fastq\n\n#concatenate after quality filtration\ncat unmapped_reads_with_moves_only_simplex.fastq duplex_orig.fastq duplex_splitduplex.fastq | NanoFilt -q 10 &gt; simplex+duplex.fastq<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Obtain pod5 data <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","_locale":"ja","_original_post":"https:\/\/home.hiroshima-u.ac.jp\/~tigawa\/?p=2892","footnotes":""},"categories":[7],"tags":[],"class_list":["post-2892","post","type-post","status-publish","format-standard","hentry","category-protocol","ja"],"_links":{"self":[{"href":"https:\/\/home.hiroshima-u.ac.jp\/~tigawa\/index.php?rest_route=\/wp\/v2\/posts\/2892","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/home.hiroshima-u.ac.jp\/~tigawa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/home.hiroshima-u.ac.jp\/~tigawa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/home.hiroshima-u.ac.jp\/~tigawa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/home.hiroshima-u.ac.jp\/~tigawa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2892"}],"version-history":[{"count":6,"href":"https:\/\/home.hiroshima-u.ac.jp\/~tigawa\/index.php?rest_route=\/wp\/v2\/posts\/2892\/revisions"}],"predecessor-version":[{"id":2902,"href":"https:\/\/home.hiroshima-u.ac.jp\/~tigawa\/index.php?rest_route=\/wp\/v2\/posts\/2892\/revisions\/2902"}],"wp:attachment":[{"href":"https:\/\/home.hiroshima-u.ac.jp\/~tigawa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2892"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/home.hiroshima-u.ac.jp\/~tigawa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2892"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/home.hiroshima-u.ac.jp\/~tigawa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2892"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}