2022年3月3号编辑的
印象笔记直接复制的,原文
https://app.yinxiang.com/fx/008ecd93-e71d-4a6a-80bd-95b2efb066ec
1.download
下新版本,ncbi的Download里找/github,我的是Ubuntu的
01. Downloading SRA Toolkit · ncbi/sra-tools Wiki (github.com)
2.方式:要么在lunix里用wget命令下,
wget -c https://ftp-trace.ncbi.nlm.nih.gov/sra/sdk/3.0.0/sratoolkit.3.0.0-ubuntu64.tar.gz
要么(嫌lunix网速慢),在windows里下,然后用xftp给转过去,(有IDM+脚本,Windows也能很快)
3.解压
[chenl@cpu1 ~/tools]$ tar xzvf sratoolkit.3.0.0-ubuntu64.tar.gz
4.
解压缩之后就可以通过绝对路径使用,但为了以后使用方便,可以直接用程序名调用,最好配置一下环境变量。
vi ~/.bashrc
PATH=/home/chenl/tools:$PATH
PATH=/home/chenl/tools/sratoolkit.3.0.0-ubuntu64/bin:$PATH
退出来
source ~/.bashrc
重置环境变量
看路径要对得上,基本上出错就出在这
5.if出现
This sra toolkit installation has not been configured.
Before continuing, please run: vdb-config --interactive
For more information, see https://www.ncbi.nlm.nih.gov/sra/docs/sra-cloud/
vdb-config --interactive
出现彩色屏幕,别慌,按X
就Ok了
6.
prefetch SRR13436206 #SRR号是你自己需要去找的,这是下一个
prefetch -O output --option-file SRR_Acc_List.txt #批量下,SRA-allruns-Accession list-SRR_Acc_List.txt
如果用wget -c 链接,SRA-SRR-SRR1482463-Data access-链接
用SRAtoolkit的srapath 命令可快速找到链接
srapath SRR1482463
#结果如下
https://sra-downloadb.be-md.ncbi.nlm.nih.gov/sos1/sra-pub-run-5/SRR1482463/SRR1482463.2
nohup prefetch SRR824846 & #一直跑,你关了电脑也跑
时间会很漫长
jobs -l #可以查看当前终端生效的进程
top #查看所有用户的运行进程,也可以看到自己的进程号
ps -ef|grep urname ##只查看自己的进程记录
ps -ef #看所有人进程
ps -u ##也是只查看自己的进程记录
长的想把它停了
kill -9 进程号
2022-03-03T01:02:08 prefetch.3.0.0 warn: lock exists while copying file - Lock file /home/chenl/ncbi/public/sra/SRR13436206.sra.lock exists: download canceled
2022-03-03T01:02:08 prefetch.3.0.0: 1) failed to download 'SRR13436206': RC(rcExe,rcFile,rcCopying,rcLock,rcExists)
7.安装Python3
python --version #查看当前Python目录
#结果
Python 2.7.12
7.没有下载完成直接kill了,第二天继续下载发现
2022-03-03T01:02:08 prefetch.3.0.0: 1) Downloading 'SRR13436206'...
2022-03-03T01:02:08 prefetch.3.0.0 warn: lock exists while copying file - Lock file /home/chenl/ncbi/public/sra/SRR13436206.sra.lock exists: download canceled
2022-03-03T01:02:08 prefetch.3.0.0: 1) failed to download 'SRR13436206': RC(rcExe,rcFile,rcCopying,rcLock,rcExists)
找到这三个文件,临时tmp,project feature就是.prf文件,
Lock文件表明一个应用程序中某个资源在锁释放之前是不能被应用的
8.使用nohup
nohup prefetch SRR13436206 &
#[1] 45171
nohup: ignoring input and appending output to 'nohup.out'
[chenl@cpu4 ~/ncbi/public/sra]$ nohup prefetch SRR17421838 &
[2] 45320 #进程号
[1] Exit 3 nohup prefetch SRR13436206
[chenl@cpu4 ~/ncbi/public/sra]$ nohup: ignoring input and appending output to 'nohup.out'
#回车
[2]+ Done nohup prefetch SRR17421838
#可以去查看nohup.out文件,看日志