forked from duty-machine/duty-machine
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
15 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
title: "使用aspera加速从中国的GSA数据库下载测序文件" | ||
date: 2024-11-24T23:12:23Z | ||
draft: ["false"] | ||
tags: [ | ||
"fetched", | ||
"生信技能树" | ||
] | ||
categories: ["Acdemic"] | ||
--- | ||
使用aspera加速从中国的GSA数据库下载测序文件 by 生信技能树 | ||
------ | ||
<div><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com"><blockquote data-tool="mdnice编辑器"><span></span><p>中国的GSA(国家基因组科学数据中心)数据库,即国家基因组科学数据中心(China National GeneBank Database),是一个存储和共享基因组数据的国家级平台。该数据库收录了大量的基因组序列数据,包括但不限于基因组组装、转录组数据、表观遗传学数据等。</p></blockquote><p data-tool="mdnice编辑器">值得注意的是人类的数据跟其它物种在的GSA(国家基因组科学数据中心)数据库的存储有不一样的规则:</p><h3 data-tool="mdnice编辑器"><span></span><span>首先如果是小鼠测序数据</span><span></span></h3><p data-tool="mdnice编辑器">比如《食管癌病人的PDX小鼠模型6个样品之CRA010501》:</p><ul data-tool="mdnice编辑器"><li><section>https://ngdc.cncb.ac.cn/bioproject/browse/PRJCA016013</section></li><li><section>https://ngdc.cncb.ac.cn/gsa/browse/CRA010501</section></li></ul><p data-tool="mdnice编辑器">再比如《小鼠耳蜗单细胞转录组数据》:</p><ul data-tool="mdnice编辑器"><li><section>https://ngdc.cncb.ac.cn/bioproject/browse/PRJCA006213</section></li><li><section>https://ngdc.cncb.ac.cn/gsa/browse/CRA004814</section></li></ul><p data-tool="mdnice编辑器">可以直接安装和使用这个edgeturbo软件即可:</p><pre data-tool="mdnice编辑器"><span></span><code>mkdir -p ~/biosoft/<br><span>cd</span> ~/biosoft/<br>wget https://ngdc.cncb.ac.cn/ettrans/download/edgeturbo-client.linux.latest.cncb.tar.gz<br>tar -zxvf edgeturbo-client.linux.latest.cncb.tar.gz<br> ~/biosoft/edgeturbo-client/edgeturbo --<span>help</span> <br><br> ~/biosoft/edgeturbo-client/edgeturbo dl /gsa2/CRA010501/<br> ~/biosoft/edgeturbo-client/edgeturbo dl /gsa2/CRA004814/<br></code></pre><p data-tool="mdnice编辑器">使用edgeturbo软件,这个速度本来就很快,无需加速。</p><h3 data-tool="mdnice编辑器"><span></span><span>如果是人类测序数据会存放在gsa-human</span><span></span></h3><p data-tool="mdnice编辑器">比如:</p><ul data-tool="mdnice编辑器"><li><section>https://ngdc.cncb.ac.cn/bioproject/browse/PRJCA012607</section></li><li><section>https://ngdc.cncb.ac.cn/gsa-human/browse/HRA003340</section></li></ul><p data-tool="mdnice编辑器">每个项目都有一个 Excel文件可以下载,里面蕴含全部的样品的测序信息,包括fq文件地址:</p><p><img data-galleryid="" data-imgfileid="100051608" data-ratio="0.9453836150845254" data-s="300,640" data-src="https://mmbiz.qpic.cn/mmbiz_png/cZNhZQ6j4wz23piaccZ8cvUKIBVuVYJd7vRexLljiclPqlJVfkaoLvG9E3dSmIj0JdUHPo1Dxniaua5WN7I03OFFw/640?wx_fmt=png&from=appmsg" data-type="png" data-w="1538" src="https://mmbiz.qpic.cn/mmbiz_png/cZNhZQ6j4wz23piaccZ8cvUKIBVuVYJd7vRexLljiclPqlJVfkaoLvG9E3dSmIj0JdUHPo1Dxniaua5WN7I03OFFw/640?wx_fmt=png&from=appmsg"></p><figure data-tool="mdnice编辑器"><figcaption>全部的样品的测序信息,包括fq文件地址</figcaption></figure><p data-tool="mdnice编辑器">打开Excel可以看到类似的ftp路径地址:</p><pre data-tool="mdnice编辑器"><span></span><code>head fq.txt <br>ftp://download.big.ac.cn/gsa-human/HRA003340/HRR798195/HRR798195_f1.fastq.gz<br>ftp://download.big.ac.cn/gsa-human/HRA003340/HRR798194/HRR798194_f1.fastq.gz<br>ftp://download.big.ac.cn/gsa-human/HRA003340/HRR798193/HRR798193_f1.fastq.gz<br>ftp://download.big.ac.cn/gsa-human/HRA003340/HRR798192/HRR798192_f1.fastq.gz<br>ftp://download.big.ac.cn/gsa-human/HRA003340/HRR798191/HRR798191_f1.fastq.gz<br>ftp://download.big.ac.cn/gsa-human/HRA003340/HRR798190/HRR798190_f1.fastq.gz<br>ftp://download.big.ac.cn/gsa-human/HRA003340/HRR798189/HRR798189_f1.fastq.gz<br>ftp://download.big.ac.cn/gsa-human/HRA003340/HRR798188/HRR798188_f1.fastq.gz<br>ftp://download.big.ac.cn/gsa-human/HRA003340/HRR798203/HRR798203_f1.fastq.gz<br>ftp://download.big.ac.cn/gsa-human/HRA003340/HRR798202/HRR798202_f1.fastq.gz<br></code></pre><p data-tool="mdnice编辑器">这个时候已经是可以简单的wget或者curl命令行下载,或者axel加速,但是都不够。我们可以使用aspera加速从中国的GSA数据库下载测序文件。因为可以页面的看到Aspera命令行: 帮助 信息,如下所示 :</p><p><img data-galleryid="" data-imgfileid="100051607" data-ratio="0.9067357512953368" data-s="300,640" data-src="https://mmbiz.qpic.cn/mmbiz_png/cZNhZQ6j4wz23piaccZ8cvUKIBVuVYJd7qiaoHCwzV9t7q5LicCv8asLpjHpLHlVpDDDvJqPWibibO3XZEsgsz5Q4xA/640?wx_fmt=png&from=appmsg" data-type="png" data-w="1158" src="https://mmbiz.qpic.cn/mmbiz_png/cZNhZQ6j4wz23piaccZ8cvUKIBVuVYJd7qiaoHCwzV9t7q5LicCv8asLpjHpLHlVpDDDvJqPWibibO3XZEsgsz5Q4xA/640?wx_fmt=png&from=appmsg"></p><figure data-tool="mdnice编辑器"><figcaption>Aspera命令行: 帮助</figcaption></figure><p data-tool="mdnice编辑器">可以看到这个aspera01.openssh 里面的内容如下所示(未来有可能会更新,所以还是自己下载这个aspera01.openssh 文件吧 ):</p><pre data-tool="mdnice编辑器"><span></span><code>cat aspera01.openssh <br>-----BEGIN RSA PRIVATE KEY-----<br>MIIEogIBAAKCAQEA2ZwvCa5s/iDOZdt47Z+81WiNFwY+FvMDP0zRixuiTbVeudyI<br>6KtHITsVxSl2gA0RDAujwbswUm3m5vt+xsZGMPsIZdaEDeq0PsgkZQngSjjKnIbw<br>04J0r9DDtvsgZTEK9cWQ9074mSuEo5VVUBZWWltrqEE0Mb2z4nM4G3KJw7DaAB5x<br>azmYQwhVq3hj4jhdFhGqWQdtjk65Ib7gGbnPD5P9LBz9xeSystGpxDDSG+2TCBrz<br>wCqgFtOaFEvu99iEI6rUYFTwJi7iFlmSTo5DyWqTEZ8n5xoLNNLMlJaK9vwLI0v8<br>GpYWZjSTDhCLNcQ+Ox2h4vAFJOqdnaAHHarGxwIDAQABAoIBAG0LuAKI9rMuK1+d<br>aG7jMhRbDQCxryF+62yoCQVFdsKsFWjb23uEgONlIVaonWozogxANPJa5C8aRbAP<br>7QqcxwW6dg3aPlhe+a3QS3SaS1vGM7nWYQ4MfH6yBbFHDIfI2K4qL6fOWgMfbJsw<br>tQyp9OHYmA07h3U5k8/xXvdaITD/HGuANKHz8k6jAc8LGB/xbyLaDcvvfFkpsMM9<br>4MGPW/y0O3fWEzTcSzM8WI17fDhlZuSGiAOI43HDhwNHoFTf+kDaePGmzRdMkmKu<br>O/yf0FEZbGX7Fq9nHeqOLdcDSebHTvJcaRvn/AfRX7COh6dCsB7GVFC6vHE4uMFD<br>4phVwWkCgYEA+0DpR9nNbHb7krWQRIsNhj0aB/9ROa4CTCYtHOE4YbYMsiCzovww<br>WZfd9IaB9IEaKpIkGNvWlnUg7oBSVhOgQ17/IA4pX0Vw3jll5fndXyw9kDYq9Zfi<br>Im3lC/JkfwWRRAh0su1BmyCpfcbISFhrZS5ezvo8waCjYqzGtskzj6UCgYEA3biR<br>sob+9Y/QfHIFiDtFoWjfLv+FE1OQnD7AKsKUc2fyoXv6Eis/t4AO9CApoDAXCVBf<br>cinsirLI+0zk2387OtBnj5be5R5/eCoebJ1P4A/yE3krRpCu+DzEW3OEaSQhb3t5<br>db9HDw2oJbAQEH5+QvNsXcFlk3rCVMgjQHEWMPsCgYBXIUiEwTQqxAwz8UDJdEtJ<br>XREU6uZ5ES38yFRmqnfJ8r7uWsbQ45HE0BSJgse4SbkQQEPCVyJQZOf5rYhgD0hJ<br>dL0WmbKhNkyQ0+jRWtf49DeZNh+psXUbKW7/uJw/LGgW5rPJhNt2d1ovouq7o+YC<br>XZVFQ6QkJZfjVTVIF/gIfQKBgCZdZXiKu1sqQ10FLcfg2a+QQe4T8KbjcsZWZVIA<br>0UcW2XjvxtmV+jR6SBwd5JX/PD00Vw+eCXwGa5hwOblxToJixUinRnJG0K+uOg15<br>OvT+TVjpQn+3UU9K1H8ugd7fjZmIt/+T1WvZZRsAWAdCm/5huIKQkE7wkuewqcjg<br>yII5AoGAW+UYcTuWd1aTP6hObznA5Urmf4RGNEOieOgvuxxFx3m4Z7jx6J6hLWzG<br>hgFVibMsgcRPM8ok8hzmiQ+u0v7Dol3kdxLBz/PwDSX8KIg9w5gZAbXZyxd2QB5V<br>Z2rKkpsDFrIf/iIYJUoAqhAiuO28u8v5toC2WX1qFHUxeaZ+8d8=<br>-----END RSA PRIVATE KEY-----<br></code></pre><p data-tool="mdnice编辑器">很简单的构建命令行测试一下单独的下载一个文件看看 :</p><pre data-tool="mdnice编辑器"><span></span><code>ascp -P33001 -i aspera01.openssh -QT -l100m -k1 -d [email protected]:gsa-human/HRA003340/HRR798256/HRR798256_r2.fastq.gz ./ <br><br><span>### HRR798256_r2.fastq.gz 61.6Mb/s </span><br></code></pre><p data-tool="mdnice编辑器">所以写一个批量函数:</p><pre data-tool="mdnice编辑器"><span></span><code>sed <span>'s|ftp://download.big.ac.cn/|[email protected]:|g'</span> fq.txt > tmp<br>mv tmp fq.txt <br>cat fq.txt |<span>while</span> <span>read</span> id<br><span>do</span><br>ascp -QT -l 300m -P33001 -k 1 -i aspera01.openssh <span>$id</span> .<br><span>done</span><br><span># mamba activate download </span><br><span># nohup bash step1-aspera.sh 1>step1-aspera.log 2>&1 &</span><br><span># which ascp </span><br></code></pre><p data-tool="mdnice编辑器">当然了,<span><strong>这样的超高速下载如果是单个样品通常是没什么意外,但是如果要下载成百上千个文件,很容易因为网络波动导致其中的某几个失败,就需要重新针对失败的样品进行独立的下载。</strong></span></p><p data-tool="mdnice编辑器">可以看到的是每个10x技术的单细胞转录组样品其实会有很多fq文件,如下所示</p><pre data-tool="mdnice编辑器"><span></span><code>$ ls -lh raw/*f1*gz |cut -d<span>" "</span> -f5-<br>6.9G 11月 21 01:56 raw/HRR798188_f1.fastq.gz<br>6.5G 11月 21 00:33 raw/HRR798189_f1.fastq.gz<br>5.6G 11月 20 23:36 raw/HRR798190_f1.fastq.gz<br>6.3G 11月 20 23:28 raw/HRR798191_f1.fastq.gz<br>141M 11月 20 23:10 raw/HRR798192_f1.fastq.gz<br>137M 11月 20 23:10 raw/HRR798193_f1.fastq.gz<br>115M 11月 20 23:10 raw/HRR798194_f1.fastq.gz<br>128M 11月 22 19:00 raw/HRR798195_f1.fastq.gz<br><br>5.8G 11月 21 05:06 raw/HRR798196_f1.fastq.gz<br>5.6G 11月 21 04:31 raw/HRR798197_f1.fastq.gz<br>6.7G 11月 23 01:03 raw/HRR798198_f1.fastq.gz<br>6.1G 11月 21 03:16 raw/HRR798199_f1.fastq.gz<br>401M 11月 21 02:05 raw/HRR798200_f1.fastq.gz<br>391M 11月 21 02:02 raw/HRR798201_f1.fastq.gz<br>455M 11月 22 19:02 raw/HRR798202_f1.fastq.gz<br>416M 11月 21 01:59 raw/HRR798203_f1.fastq.gz<br></code></pre><p data-tool="mdnice编辑器">需要自己去找到对应的关系,然后进行文件名修改 :</p><pre data-tool="mdnice编辑器"><span></span><code>HRX584075 HRR798195_f1.fastq.gz<br>HRX584075 HRR798194_f1.fastq.gz<br>HRX584075 HRR798193_f1.fastq.gz<br>HRX584075 HRR798192_f1.fastq.gz<br>HRX584075 HRR798191_f1.fastq.gz<br>HRX584075 HRR798190_f1.fastq.gz<br>HRX584075 HRR798189_f1.fastq.gz<br>HRX584075 HRR798188_f1.fastq.gz<br>HRX584076 HRR798203_f1.fastq.gz<br>HRX584076 HRR798202_f1.fastq.gz<br>HRX584076 HRR798201_f1.fastq.gz<br>HRX584076 HRR798200_f1.fastq.gz<br>HRX584076 HRR798199_f1.fastq.gz<br>HRX584076 HRR798198_f1.fastq.gz<br>HRX584076 HRR798197_f1.fastq.gz<br>HRX584076 HRR798196_f1.fastq.gz<br></code></pre><p data-tool="mdnice编辑器">首先呢,上面的这些fastq文件名字是需要改名的。。。。如果你熟悉10x单细胞转录组数据,就知道:</p><ul data-tool="mdnice编辑器"><li><section>首先,1-26个cycle就是测序得到了26个碱基,先是16个Barcode碱基,然后是10个UMI碱基;通常是R1文件</section></li><li><section>然后,27-34这8个cycle得到了8个碱基,就是i7的sample index;通常是I1文件</section></li><li><section>最后35-132个cycle得到了98个碱基,就是转录本reads(目前很多测序仪都是150bp了),通常是R2文件</section></li></ul><p data-tool="mdnice编辑器">也就是说R2 文件是真正的测序reads,肯定是文件最大。而且I1文件是可以省略的。。。</p><p data-tool="mdnice编辑器">眼尖的小伙伴们肯定是发现了下面的r1和r2文件其实没什么文件大小差异,是因为虽然是r1是可以碱基数量很少但是如果作者并没有处理它其实它仍然是测序仪设置的100bp或者150bp这样的初始化长度,所以就跟r2文件是一样的大小了。</p><pre data-tool="mdnice编辑器"><span></span><code>128M 11月 22 19:00 raw/HRX584075_S1_L001_R1_001.fastq.gz<br>115M 11月 20 23:10 raw/HRX584075_S2_L001_R1_001.fastq.gz<br>137M 11月 20 23:10 raw/HRX584075_S3_L001_R1_001.fastq.gz<br>141M 11月 20 23:10 raw/HRX584075_S4_L001_R1_001.fastq.gz<br>6.3G 11月 20 23:28 raw/HRX584075_S5_L001_R1_001.fastq.gz<br>5.6G 11月 20 23:36 raw/HRX584075_S6_L001_R1_001.fastq.gz<br>6.5G 11月 21 00:33 raw/HRX584075_S7_L001_R1_001.fastq.gz<br>6.9G 11月 21 01:56 raw/HRX584075_S8_L001_R1_001.fastq.gz<br>416M 11月 21 01:59 raw/HRX584076_S1_L001_R1_001.fastq.gz<br>455M 11月 22 19:02 raw/HRX584076_S2_L001_R1_001.fastq.gz<br>391M 11月 21 02:02 raw/HRX584076_S3_L001_R1_001.fastq.gz<br>401M 11月 21 02:05 raw/HRX584076_S4_L001_R1_001.fastq.gz<br>6.1G 11月 21 03:16 raw/HRX584076_S5_L001_R1_001.fastq.gz<br>6.7G 11月 23 01:03 raw/HRX584076_S6_L001_R1_001.fastq.gz<br>5.6G 11月 21 04:31 raw/HRX584076_S7_L001_R1_001.fastq.gz<br>5.8G 11月 21 05:06 raw/HRX584076_S8_L001_R1_001.fastq.gz<br></code></pre><p data-tool="mdnice编辑器">这样的名字就是符合cellranger定量程序的规则啦, 接下来就完完全全参考 <a href="https://mp.weixin.qq.com/s?__biz=MzAxMDkxODM1Ng==&mid=2247522953&idx=1&sn=9e86346a6de21d02bc0c770f3d2734a6&scene=21#wechat_redirect" data-linktype="2">小鼠的5个样品的10x技术单细胞转录组上游定量(文末赠送全套代码)</a>,走<strong>cellranger</strong>流程即可。正常走cellranger的定量流程即可,代码我已经是多次分享了。参考:</p><ul data-tool="mdnice编辑器"><li><section><a href="http://mp.weixin.qq.com/s?__biz=MzAxMDkxODM1Ng==&mid=2247512340&idx=3&sn=1b9609a8870a0209dd27ffdcbc3cac87&chksm=9b4bf1afac3c78b90674678fcec66365b9faaa275ff4b0a2255e0a05fa8b905e15222a643bea&scene=21#wechat_redirect" data-linktype="2">10X单细胞转录组原始测序数据的Cell Ranger流程(仅需800元)</a></section></li><li><section><a href="https://mp.weixin.qq.com/s?__biz=MzAxMDkxODM1Ng==&mid=2247496813&idx=1&sn=4151bf2265618eff4e0123722c50e569&scene=21#wechat_redirect" data-linktype="2">10X的单细胞转录组原始数据也可以在EBI下载</a></section></li><li><section><a href="http://mp.weixin.qq.com/s?__biz=MzAxMDkxODM1Ng==&mid=2247510920&idx=1&sn=c4561d34e984406693c014cdfe236c0f&chksm=9b4beb33ac3c622542d894344c323ff7cca52f69119d02fc7aa4636af0cbe7df4b6c63dd5ba9&scene=21#wechat_redirect" data-linktype="2">一个10x单细胞转录组项目从fastq到细胞亚群</a></section></li><li><section><a href="https://mp.weixin.qq.com/s?__biz=MzAxMDkxODM1Ng==&mid=2247513565&idx=1&sn=092e637017d176c43f00a295d3210592&scene=21#wechat_redirect" data-linktype="2">一文打通单细胞上游:从软件部署到上游分析</a></section></li><li><section><a href="http://mp.weixin.qq.com/s?__biz=MzAxMDkxODM1Ng==&mid=2247513605&idx=1&sn=e86a329c887745c6d00d3ededa39dcda&chksm=9b4bf6beac3c7fa8523cef4e7189fb20b914460ddb61e6cd1dd520b5928e1b59a8b7827ce783&scene=21#wechat_redirect" data-linktype="2">PRJNA713302这个10x单细胞fastq实战</a></section></li><li><section><a href="https://mp.weixin.qq.com/s?__biz=MzAxMDkxODM1Ng==&mid=2247513968&idx=1&sn=f5a44a7bea0bdacd8af1a20c177763e5&scene=21#wechat_redirect" data-linktype="2">一次曲折且昂贵的单细胞公共数据获取与上游处理</a></section></li><li><section><a href="https://mp.weixin.qq.com/s?__biz=MzAxMDkxODM1Ng==&mid=2247514146&idx=1&sn=b9721433d49a2d963eeaab1ad47fc91b&scene=21#wechat_redirect" data-linktype="2">只能下载bam文件的10x单细胞转录组项目数据处理</a></section></li><li><section><a href="https://mp.weixin.qq.com/s?__biz=MzAxMDkxODM1Ng==&mid=2247511452&idx=2&sn=83ec97cbc3334a6095e6d63e05e9fd6e&scene=21#wechat_redirect" data-linktype="2">不知道10x单细胞转录组样品和fastq文件的对应关系</a></section></li><li><section><a href="https://mp.weixin.qq.com/s?__biz=MzAxMDkxODM1Ng==&mid=2247508521&idx=2&sn=2cf3158e74d37b3a741908d8bfc8f02f&scene=21#wechat_redirect" data-linktype="2">10X单细胞转录组测序数据的 SRA转fastq踩坑那些事</a></section></li><li><section><a href="https://mp.weixin.qq.com/s?__biz=MzAxMDkxODM1Ng==&mid=2247514395&idx=2&sn=96c505b76ae87dd0efa737c4c44e2270&scene=21#wechat_redirect" data-linktype="2">10x的单细胞转录组fastq文件的R1和R2不能弄混哦</a></section></li></ul><p data-tool="mdnice编辑器">差不多几个小时就可以完成全部的样品的cellranger的定量流程。</p><h3 data-tool="mdnice编辑器"><span></span><span>学徒作业</span><span></span></h3><p data-tool="mdnice编辑器">完成上面的HRA003340项目的单细胞转录组测序fq文件的下载以及cellranger的定量流程。</p></section><p><br></p><p><mp-style-type data-value="3"></mp-style-type></p></div> | ||
<hr> | ||
<a href="https://mp.weixin.qq.com/s/SDRrYT1DAUWo3kktLBQnXw",target="_blank" rel="noopener noreferrer">原文链接</a> |