2020-01-06 TCGA数据下载相关

学习资料:TCGA.GDC数据处理系列

跟着小洁老师学TCGA

第一步是数据下载

1.从数据库下载manifest文件

数据存放网站:https://portal.gdc.cancer.gov/Repository勾选自己需要的casefile类型

(1)选cases

image.png

(2)选files
需要下载三个文件,分别存放了miRNAisoformclinical信息
mirna:

  • Data Category--transcriptome profilling
  • Data Type-- miRNA Expression Quantification
  • Experimental Strategy-- miRNA-Seq
    Manifest -- gdc....-miRNA.txt , save

isoform:

  • Data Category--transcriptome profilling
  • Data Type-- Isoform Expression Quantification
  • Experimental Strategy-- miRNA-Seq
    Manifest -- gdc....-isoform.txt , save

临床数据

  • Data category -- clinical
  • 选 bcr xml格式
    Manifest -- gdc....-clinical.txt , save

2.了解数据

统计下载的三个文件的行数,也就是各自的样本数量+1(+1是因为有一行是行名)。

$ wc -l gdc_manifest.2020-01-06*
     117 gdc_manifest.2020-01-06-clinical.txt
     117 gdc_manifest.2020-01-06-isoform.txt
     117 gdc_manifest.2020-01-06-miRNA.txt
     351 total

3.学习下载工具

https://gdc.cancer.gov/access-data/gdc-data-transfer-tool

Binary Distributions

Links to the binary distributions for supported platforms are provided below.

使用官网提供的工具gdc-client ,下载自己电脑对应的版本,存放于工作目录下并解压好。
查看帮助文档

$ ./gdc-client --help
usage: gdc-client [-h] [--version] {download,upload,settings} ...

The Genomic Data Commons Command Line Client

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit

commands:
  {download,upload,settings}
                        for more information, specify -h after a command
    download            download data from the GDC
    upload              upload data to the GDC
    settings            display default settings

该软件有三个子命令,我们需要的是download。
查看download的帮助文档:

./gdc-client download --help
usage: gdc-client download [-h] [--debug] [--log-file LOG_FILE] [--color_off]
                           [-t TOKEN_FILE] [-d DIR] [-s server]
                           [--no-segment-md5sums] [--no-file-md5sum]
                           [-n N_PROCESSES]
                           [--http-chunk-size HTTP_CHUNK_SIZE]
                           [--save-interval SAVE_INTERVAL] [--no-verify]
                           [--no-related-files] [--no-annotations]
                           [--no-auto-retry] [--retry-amount RETRY_AMOUNT]
                           [--wait-time WAIT_TIME] [--latest] [--config FILE]
                           [-u] [-m MANIFEST]
                           [file_id [file_id ...]]

positional arguments:
  file_id               The GDC UUID of the file(s) to download

optional arguments:
  -h, --help            show this help message and exit
  --debug               Enable debug logging. If a failure occurs, the program
                        will stop.
  --log-file LOG_FILE   Save logs to file. Amount logged affected by --debug
  --color_off           Disable colored output
  -t TOKEN_FILE, --token-file TOKEN_FILE
                        GDC API auth token file
  -d DIR, --dir DIR     Directory to download files to. Defaults to current
                        directory
  -s server, --server server
                        The TCP server address server[:port]
  --no-segment-md5sums  Do not calculate inbound segment md5sums and/or do not
                        verify md5sums on restart
  --no-file-md5sum      Do not verify file md5sum after download
  -n N_PROCESSES, --n-processes N_PROCESSES
                        Number of client connections.
  --http-chunk-size HTTP_CHUNK_SIZE, -c HTTP_CHUNK_SIZE
                        Size in bytes of standard HTTP block size.
  --save-interval SAVE_INTERVAL
                        The number of chunks after which to flush state file.
                        A lower save interval will result in more frequent
                        printout but lower performance.
  --no-verify           Perform insecure SSL connection and transfer
  --no-related-files    Do not download related files.
  --no-annotations      Do not download annotations.
  --no-auto-retry       Ask before retrying to download a file
  --retry-amount RETRY_AMOUNT
                        Number of times to retry a download
  --wait-time WAIT_TIME
                        Amount of seconds to wait before retrying
  --latest              Download latest version of a file if it exists
  --config FILE         Path to INI-type config file
  -u, --udt             Use the UDT protocol.
  -m MANIFEST, --manifest MANIFEST
                        GDC download manifest file

可以找到两个有用的参数:-d和-m。-d是设置下载目录,-m是下载指令。
所以下载命令是:

mkdir clinical
mkdir mirna
mkdir isoform
./gdc-client download -m gdc_manifest.2020-01-06-clinical.txt -d clinical
./gdc-client download -m gdc_manifest.2020-01-06-miRNA.txt -d mirna
./gdc-client download -m gdc_manifest.2020-01-06-isoform.txt -d isoform

第一条命令完成结果如下:

(base) Cheng-MacBook-Pro:Downloads chelsea$ mkdir clinical
(base) Cheng-MacBook-Pro:Downloads chelsea$ mkdir mirna
(base) Cheng-MacBook-Pro:Downloads chelsea$ mkdir isoform
(base) Cheng-MacBook-Pro:Downloads chelsea$ ./gdc-client download -m gdc_manifest.2020-01-06-clinical.txt -d clinical
100% [##############################################] Time: 0:00:06   0.15  B/s 
100% [##############################################] Time: 0:00:07   0.13  B/s 
100% [##############################################] Time: 0:00:07   0.13  B/s 
100% [##############################################] Time: 0:00:08   0.12  B/s 
100% [##############################################] Time: 0:00:03   0.28  B/s 
100% [##############################################] Time: 0:00:02  15.51 kB/s 
100% [##############################################] Time: 0:00:01  23.08 kB/s 
100% [##############################################] Time: 0:00:02  11.91 kB/s 
100% [##############################################] Time: 0:00:02  16.33 kB/s 
100% [##############################################] Time: 0:00:01  32.72 kB/s 
100% [##############################################] Time: 0:00:02  16.35 kB/s 
Successfully downloaded: 116

关于xml小洁老师写了后面的的记录。
一个是哈德雷大神写的包xml2:
https://blog.rstudio.com/2015/04/21/xml2/
一个是R包TCGAbiolinks,可以处理tcga中下载的xml文件,从中获取信息。
参考TCGA数据处理系列。

参考资料链接:
作者:小洁忘了怎么分身
链接:https://www.jianshu.com/p/559d9604fcdf

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 216,744评论 6 502
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 92,505评论 3 392
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 163,105评论 0 353
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,242评论 1 292
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,269评论 6 389
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,215评论 1 299
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,096评论 3 418
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,939评论 0 274
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,354评论 1 311
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,573评论 2 333
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,745评论 1 348
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,448评论 5 344
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,048评论 3 327
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,683评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,838评论 1 269
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,776评论 2 369
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,652评论 2 354

推荐阅读更多精彩内容

  • 当更肆意的青春如约而至 是否原来有着秋叶的凋落 当一切都不在挽留 你是否能依然握紧自己的双手 在这里变老的是谁呢 ...
    影汀月阅读 334评论 0 3
  • 原来事情是这样的:三年前,小猫出生在秘密山洞了,有一天三宝从秘密山洞里跑出去玩,看到了一只蝴蝶,于是跟着那只蝴...
    Yuki朵儿阅读 300评论 1 2
  • 今天像往常一样来到班里,有些疲惫的眼睛让班里的宝贝们敏锐的看到了,“老师,你生病了吗?记得休息啊”“老师,我...
    初心云儿阅读 121评论 0 2
  • 《P.E.T父母效能训练》 ​清晰的判断太重要了,无论对孩子和父母来说,我们都是人,可是我们却总想在孩子面前当神,...
    花叽阅读 84评论 0 0
  • 如果你身处淤泥,每当你深吸一口气,开始准备静心学习的时候,——总会有那么尖酸得几个人在你身边嚷嚷,“学什...
    陆吾又英招阅读 836评论 0 2