文章目录
通过 url 访问服务器数据
在使用 IGV 或者 UCSC track hub 可视化时,往往需要将数据放置在本地,但考虑到生信数据往往直接放置在服务器上,且文件大小可能高达几GB,此时可以将数据存放到可以接受外部访问的服务器上,然后通过 url 上传数据完成可视化,此处推荐的工具为 CyVerse(https://de.cyverse.org/dashboard)。
CyVerse 可以直接网页上传文件,或者通过软件来将数据传入和传出 Data Store。
参考文档:https://learning.cyverse.org/ds/gocommands/
官网:https://github.com/cyverse/gocommands
(一)网页上传
CyVerse 网站注册登录后可直接通过如下网页操作完成本地文件的上传,如果文件上传失败可能需要重新上传。
(二)服务器上传
CyVerse 可以通过软件来将数据传入和传出 Data Store,建议 Mac 和 Windows 用户使用 Cyberduck,Linux 用户使用 iCommands 或 GoCommands,但由于 iCommands 的安装需要有 root 或者 sudo 权限,此处选择了使用 GoCommands。
1. 安装 GoCommands
(1)安装
- 方式一:使用 conda 安装(推荐)
conda create -n gocommands
conda activate gocommands
conda config --add channels conda-forge
conda config --set channel_priority strict
conda install gocommands
- 方式二:使用源码安装,具体可参考官网
(2)配置(iCommands)
此处使用的是 iCommands
的配置,也可以使用 YAML 配置文件或直接设置环境变量,具体可参考官网。
# 创建 iCommands 的配置文件,如果已有可以不用此步骤
gocmd init
# 检查载入的配置文件
gocmd env
gocmd ls
2. 使用
(1)上传本地文件到 Data Store
gocmd put /local_directory /iplant/home/cyverse_username/destination_folder
注意:当将数据上传到数据存储时,不应上传名称中包含空格或特殊字符(如 ~''!@#$%^&*( )+={}[]|:;"'<>,?/\
)的文件;对于较长的文件/文件夹名称,建议使用下划线而不是空格。
参数说明:
gocmd put -R # for specifying resource server
gocmd put --progress # to display the progress of the upload
gocmd put -f # to force the upload and overwrite
gocmd put --encrypt file1.txt # file encryption
(2)下载 Data Store 文件到本地
gocmd get /iplant/home/cyverse_username/target_file /local_destination
参数说明:
gocmd get -R # for specifying resource server
gocmd get --progress # to display the progress of the download
gocmd get -f # to force the download and overwrite
3. 更新
GoCommands 可以自行升级,运行命令以升级到可用的最新版本的 GoCommands
gocmd upgrade # check a new release and upgrade the gocmd binary
/gocmd upgrade --check # just check a new release and display
(三)外部访问权限
通过网页界面点击 public link(s) 授予文件可被外部访问权限,此处不能直接赋予文件夹可访问权限,通过复制 public link(s) 即可以外部访问该文件,可以通过直接上传该 url 至 IGV 或 UCSC track hub 完成可视化。
补充 1:galaxy
对于比较小如几 mb 的文件可以直接本地上传 track,但 bigwig 文件往往几百 mb,此时也可以上传至 Galaxy(https://usegalaxy.org/),可以暂时存储数据,但过段时间可能会失效。
注册登录完成后可根据如下网页操作完成本地数据上传。
补充 2:通过 url 查看服务器的文件
URL,统一资源定位器,指向互联网上的“资源”,可协议名、主机、端口和资源组成
如: http://username:password@host:8080/directory/file?query#ref
Component | Example value | Also known as |
---|---|---|
Protocol | http | Scheme |
Authority | username:password@host:8080 | |
User Info | username:password | |
Host | host | |
Port | 8080 | |
File | /directory/file?query | |
Path | /directory/file | |
Query | query | |
Ref | ref | fragment |
此处提出了一种方法可以直接在浏览器中输入 url 网址查看服务器上较小的文件,如 .txt
或者 .pdf
文件。
# 示例,此处的 files 对应登录后的目录,
http://username:password@host:8080/files/path/to/file.txt
参考
- Transferring Data with GoCommands and Command Line - CyVerse Learning Home:https://learning.cyverse.org/ds/gocommands/#run-gocommands-using-a-yaml-configuration-file
- cyverse/gocommands: iRODS Command-line Tools written in Go (github.com):https://github.com/cyverse/gocommands
- 生信小白之路02-bw/bed等文件导入UCSC查看track:https://zhuanlan.zhihu.com/p/618938328
- 访问带有用户名、密码保护的 URL_客户端请求的 url 带有 user username pass、 password、sesion、jse-优快云 博客:https://blog.youkuaiyun.com/u010439291/article/details/46336527