一丶利用R语言GDCRNATools包进行下载
安装GDCRNATools包
首先在Rstudio里设置清华镜像。
BiocManager::install("GDCRNATools")
#有可能一次装不成功,需要安装许多依赖包
#我的例子
a <- c('rjson', 'DESeq2', 'clusterProfiler', 'DOSE', 'survminer', 'pathview', 'gplots', 'GenomicDataCommons')
install.package(a)
#检查还有什么包没有安装成功
b <- c('DESeq2', 'clusterProfiler', 'DOSE', 'pathview', 'GenomicDataCommons')
BiocManager::install(b)
#检查还有什么包没有安装成功
#剩下的包一个个安装,可以在bioconductor(http://www.bioconductor.org/)复制下载链接
url <- "https://bioconductor.org/packages/3.11/bioc/src/contrib/Archive/DOSE/DOSE_3.13.2.tar.gz"
install.packages(url, repos=NULL, type="source")
#最后再重新下载GDCRNATools
BiocManager::install("GDCRNATools")
然后再用GDCRNATools的gdc-client下载RNAseq,实例如下:
library(GDCRNATools)
project <- 'TCGA-LUSC'
rnadir <- paste(project, 'RNAseq', sep='/')
gdcRNADownload(project.id = 'TCGA-LUSC',
data.type = 'RNAseq',
write.manifest = FALSE,
method = 'gdc-client',
directory = rnadir)
注意这里报错
QQ图片20200616102151.png
ERROR: str returned non-string (type Error) ] ETA: --:--:-- 0.00 B/s
ERROR: An unexpected error has occurred during normal operation of the client. Please report the following exception to GDC support support@nci-gdc.datacommons.io.
ERROR: 'NoneType' object has no attribute 'status_code'... ...
经过一番排查发现是gdc-client的问题
QQ图片20200616102118.png
可以看到这里在工作目录下安装的是1.3版本,而1.3版本的gdc-client在git-bash上下载TCGA数据也是同样的报错
解决办法Ⅰ
- 这里我从官网下载https://gdc.cancer.gov/access-data/gdc-data-transfer-tool
QQ图片20200616102851.png - 解压后将1.5版本的gdc-client替换工作目录下1.3版本的gdc-client
- 重新运行下载命令
library(GDCRNATools)
project <- 'TCGA-LUSC'
rnadir <- paste(project, 'RNAseq', sep='/')
gdcRNADownload(project.id = 'TCGA-LUSC',
data.type = 'RNAseq',
write.manifest = FALSE,
method = 'gdc-client',
directory = rnadir)
可以看到运行成功了!!!
QQ图片20200616103452.png
解决办法Ⅱ
需要升级R,这里我没试,不知道有没有用。
参照github:https://github.com/Jialab-UCR/GDCRNATools/issues/11
二丶可以直接用gdc-client在TCGA上下载
- 首先需要下载或者自己弄一个manifest文件
linux系统参考以下文章:
https://www.jianshu.com/p/c3f045bcb9b9 - manifest文件下载同上
windows系统:
在上文已经说了gdc-client-1.5的下载方法,下载成功并解压,然后打开git-bash
cd命令切换到gdc-client.exe所在的目录
用以下命令进行下载
gdc-client.exe download -m gdc_manifest.2020-06-15.txt
可以看到下载成功。
QQ图片20200616104715.png