安装客户端
使用pip:
sudo pip3 install pyega3
使用conda:
conda config --add channels bioconda
conda install pyega3
配置
在客户端要运行的目录下创建一个名为CREDENTIALS_FILE
的文件,使用JSON格式,参考如下:
{
"username": "my.email@domain",
"password": "mypassword",
"client_secret":"AMenuDLjVdVo4BSwi0QD54LL6NeVDEZRzEQUJ7hJOM3g4imDZBHHX0hNfKHPeQIGkskhtCmqAJtt_jm7EKq-rWw"
}
模板可以点击这里下载。
填入EGA用户名和密码,密码不是必需的,如果没有填入程序运行时会要求输入。
运行
USAGE:
pyega3 [-h] [-d] -cf CREDENTIALS_FILE [-c CONNECTIONS] {datasets,files,fetch} ...
Download from EMBL EBI's EGA (European Genome-phenome Archive)
positional arguments:
{datasets,files,fetch}
subcommands
datasets List authorized datasets
files List files in a specified dataset
fetch Fetch a dataset or file
optional arguments:
-h, --help show this help message and exit
-d, --debug Extra debugging messages
-cf CREDENTIALS_FILE, --credentials-file CREDENTIALS_FILE
JSON file containing credentials
e.g.{'username':'user1','password':'toor'}
-c CONNECTIONS, --connections CONNECTIONS
Download using specified number of connections
常见操作
显示数据集
pyega3 -cf CREDENTIALS_FILE datasets
显示数据集文件
pyega3 -cf CREDENTIALS_FILE files EGAD00001000951 <output>
下载数据集文件
pyega3 -cf CREDENTIALS_FILE fetch EGAD00001000951 <output>
下载单个文件
pyega3 -cf CREDENTIALS_FILE fetch EGAF00000585895 <output>
使用4个文本流下载文件或数据集
pyega3 -c 4 -cf CREDENTIALS_FILE fetch EGAF00001412793 <output>
更多:
网友评论