问题描述
更新:主题 FTP 服务器已停用:[讨论] (https://github.com/ewels/sra-explorer/issues/14)
还有别的选择吗?
我想通过 .sra
下载 .fastq
文件并将它们转换为 Python
文件。
在实现到 PyCharm 应用程序之前,我正在通过 Google Colaboratory
运行它。
import wget
import sys
import os
sra_id = "SRX10360832"
url = 'ftp://ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByRun/sra/' + sra_id[:3] + '/' + sra_id[:6] + '/' + sra_id + '/' + sra_id + '.sra'
print(url)
print("Downloading... please wait!!")
filename = wget.download(url) # !
if filename:
print("\nDownload Complete "+ sra_id)
print("\nConverting...")
cmd = 'fastq-dump ' + sra_id + '.sra'
os.system(cmd)
在线 filename = wget.download(url)
是我收到以下错误的地方:
error_perm: 550 sra/sra-instant/reads/ByRun/sra/SRX/SRX103/SRX10360832: No such file or directory
During handling of the above exception,another exception occurred:
URLError: <urlopen error ftp error: error_perm('550 sra/sra-instant/reads/ByRun/sra/SRX/SRX103/SRX10360832: No such file or directory')>
在 url 末尾包含 .gz
时发生同样的错误。
这是基于 Git repo 但使用旧版本的 Python
这一点的重要性在于下载 .sra
文件。 ftp://
并将它们转换为 .fastq
可读格式,无需 Linux
。 Python 不处理原始 .sra
文件。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)