{"id":816,"date":"2024-10-30T10:37:52","date_gmt":"2024-10-30T02:37:52","guid":{"rendered":"https:\/\/linguopeng.top\/?p=816"},"modified":"2024-10-30T10:37:52","modified_gmt":"2024-10-30T02:37:52","slug":"linux%e7%99%be%e5%ba%a6%e7%bd%91%e7%9b%98%e4%b8%8a%e4%bc%a0%e4%b8%8b%e8%bd%bdbypy","status":"publish","type":"post","link":"https:\/\/linguopeng.top\/?p=816","title":{"rendered":"linux\u767e\u5ea6\u7f51\u76d8\u4e0a\u4f20\u4e0b\u8f7d(bypy)"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>\n#\u672c\u793a\u4f8b\u662f\u76f4\u63a5\u5b89\u88c5\u5728\u5df2\u6709\u7684\u865a\u62df\u73af\u5883\u91cc\u9762\u4e86\uff0c\u5982\u6709\u9700\u8981\u53ef\u4ee5\u81ea\u884c\u521b\u5efa\u65b0\u7684\u865a\u62df\u73af\u5883\npip3 install bypy\n\nbypy info\n# \u8fd0\u884c\u8be5\u547d\u4ee4\u4f1a\u4ea7\u751f\u4e00\u4e2a\u7f51\u5740\u94fe\u63a5\uff0c\u628a\u94fe\u63a5\u590d\u5236\u5230\u6d4f\u89c8\u5668\u4e2d\uff0c\u68c0\u6d4b\u5230\u5df2\u767b\u5f55\u7684\u767e\u5ea6\u4e91\n# \u76d8\u7684\u8d26\u6237\uff0c\u800c\u4ea7\u751f\u4e00\u4e2a\u548c\u8d26\u6237\u6388\u6743\u7801\u3002\u8f93\u5165\u8be5\u6388\u6743\u7801\u540e\u5c31\u53ef\u4ee5\u5bf9\u8be5\u8d26\u6237\u4e0b\u7684\u6570\u636e\u8fdb\n# \u884c\u64cd\u4f5c\u4e86\u3002\u8be5\u6388\u6743\u7801\u8f93\u5165\u4e00\u6b21\u540e\u7535\u8111\u4e0b\u7684\u64cd\u4f5c\u5c31\u4e0d\u7528\u91cd\u590d\u8f93\u5165\u3002\n#\u4e0a\u4f20\u6587\u4ef6test.txt (\u9ed8\u8ba4\u4e0a\u4f20\u5230 \u6211\u7684\u5e94\u7528\u6570\u636e\/bypy \u6587\u4ef6\u5939\u4e0b\u9762\uff09\nbypy upload test.txt \n\n\n#\u4e0b\u8f7d\u6587\u4ef6test.txt\n# \u6ce8\u610f\u53ea\u80fd\u8bfb\u53d6 \u6211\u7684\u5e94\u7528\u6570\u636e\/bypy \u6587\u4ef6\u5939\u4e0b\u7684\u6570\u636e\nbypy downfile test.txt\n# \u4e0b\u8f7d\u6587\u4ef6\u5939\nbypy downdir\n\nbypy --help\n\n# \u9700\u8981\u4e00\u4e2atxt\u6587\u4ef6\uff0c\u91cc\u9762\u5305\u542b\u4e0b\u8f7d\u94fe\u63a5\uff0c\u793a\u4f8b\u5982\u4e0b\nfasp.sra.ebi.ac.uk:\/vol1\/fastq\/SRR393\/005\/SRR3934355\/SRR3934355_1.fastq.gz;fasp.sra.ebi.ac.uk:\/vol1\/fastq\/SRR393\/005\/SRR3934355\/SRR3934355_2.fastq.gz   SRR3934355\nfasp.sra.ebi.ac.uk:\/vol1\/fastq\/SRR393\/008\/SRR3934358\/SRR3934358_1.fastq.gz;fasp.sra.ebi.ac.uk:\/vol1\/fastq\/SRR393\/008\/SRR3934358\/SRR3934358_2.fastq.gz   SRR3934358\n...\n# \u5c06\u5176\u547d\u540d\u4e3adownload.txt\n\n# \u4e0b\u8f7d\u811a\u672cdownload.sh\n#!\/bin\/bash\ncat download.txt | while IFS=$'\\t' read -r urls folder; do\n  # \u521b\u5efa\u76ee\u6807\u6587\u4ef6\u5939\n    mkdir -p \"$folder\"\n\n      # \u4f7f\u7528\u5206\u53f7\u5206\u5272\u94fe\u63a5\n        IFS=';' read -ra url_list &lt;&lt;&lt; \"$urls\"\n\n  # \u5faa\u73af\u4e0b\u8f7d\u6587\u4ef6\u4f7f\u7528Aspera\uff0c\u540c\u65f6\u6307\u5b9a\u76ee\u6807\u6587\u4ef6\u5939\n  for url in \"${url_list&#91;@]}\"; do\n    filename=$(basename \"$url\")\n    ascp -v -k 1 -T -l 200m -P 33001 -i \/home\/shh\/miniconda3\/envs\/marvel_plate\/etc\/asperaweb_id_dsa.openssh era-fasp@\"$url\" \".\/$folder\"\n  done\n\n  # \u4f7f\u7528bypy\u4e0a\u4f20\u6587\u4ef6\u5939\uff08\u5047\u8bbe\u4f60\u5df2\u7ecf\u914d\u7f6e\u597dbypy\uff09\n  bypy upload \"$folder\"\n\n  # \u6587\u4ef6\u4e0a\u4f20\u5b8c\u6bd5\u540e\u663e\u793a\u6d88\u606f\n  echo \"\u6587\u4ef6\u4e0a\u4f20\u5b8c\u6bd5: $folder\"\n\n  # \u5220\u9664\u6587\u4ef6\u5939\n  rm -rf \"$folder\"\ndone\necho \"PREFIXaa\u5b8c\u6210\"\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-816","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/linguopeng.top\/index.php?rest_route=\/wp\/v2\/posts\/816","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linguopeng.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linguopeng.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linguopeng.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linguopeng.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=816"}],"version-history":[{"count":1,"href":"https:\/\/linguopeng.top\/index.php?rest_route=\/wp\/v2\/posts\/816\/revisions"}],"predecessor-version":[{"id":817,"href":"https:\/\/linguopeng.top\/index.php?rest_route=\/wp\/v2\/posts\/816\/revisions\/817"}],"wp:attachment":[{"href":"https:\/\/linguopeng.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=816"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linguopeng.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=816"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linguopeng.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=816"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}