Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use GDC API to view and download TCGA data

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces "how to use GDC API to view and download TCGA data". In daily operation, I believe many people have doubts about how to use GDC API to view and download TCGA data. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the questions of "how to use GDC API to view and download TCGA data". Next, please follow the editor to study!

API is an application programming interface. Many websites have corresponding API to facilitate programs to grab data, such as NCBI, EBI, KEGG and so on. GDC also has corresponding API, which can easily query and download TCGA data. The URL of API is as follows.

Https://gdc.cancer.gov/developers/gdc-application-programming-interface-api

API has a base url. Through base url and built-in instructions, you can access and download specific data sets. The base url of GDC API is as follows

Https://api.gdc.cancer.gov/

Https://api.gdc.cancer.gov/legacy/

The first one accesses and manipulates GDC harmonized database, and the second accesses and manipulates GDC legacy archive. Endpoint is a built-in instruction, and the supported instructions are as follows

From the function, it can be divided into three parts: query, download and submit data. the commonly used functions include query and download.

1. Query

Data exchange is carried out through the format of JSON. Taking files as an example and its corresponding uuid as an example, the usage of query is as follows

Curl https://api.gdc.cancer.gov/files/5891556e-0b86-42bd-aa0e-a319471dc574

The data returned is as follows

This format is JSON, which can be compared with the query results on the website. The link is as follows.

Https://portal.gdc.cancer.gov/files/5891556e-0b86-42bd-aa0e-a319471dc574

You can see that the information returned by API contains the basic information provided on the web page. In practical use, it is more likely to search according to certain conditions, and there are many related parameters, so we will not expand it here.

two。 download

Specified by download, it can be downloaded according to the uuid of the file, in both GET and POST ways. GET is suitable for downloading several files at the same time, and POST is suitable for mass downloads.

The usage of downloading in GET is as follows

Curl-remote-name-remote-header-name 'https://api.gdc.cancer.gov/data/5891556e-0b86-42bd-aa0e-a319471dc574'

If you have more than one file uuid, connect with a comma, as shown below

Curl-remote-name-remote-header-name 'https://api.gdc.cancer.gov/data/e3228020-1c54-4521-9182-1ea14c5dc0f7,18e1e38e-0f0a-4a0e-918f-08e6201ea140'

To download in POST mode, you need to prepare a file and record the uuid number of the file to be downloaded. The file can be in two formats. The first is as follows

Ids=556e5e3f-0ab9-4b6c-aa62-c42f6a6cf20c&ids=e0de63e2-02f3-4309-9b24-69f4c24e85fc

Suppose the file name is uuids, and the download command is

Curl-- remote-name-- remote-header-name-- request POST 'https://api.gdc.cancer.gov/data'-- data @ uuids

The second indication is as follows

The command to download this file is as follows

Curl-- remote-name\

-- remote-header-name\

-- request POST\

-- header 'Content-Type: application/json'\

-- data @ uuids\

'https://api.gdc.cancer.gov/data'

The above are just the basic uses of GDC API. For more uses, please refer to the official documentation. The link is as follows.

Https://docs.gdc.cancer.gov/API/Users_Guide/Getting_Started/

Through the proficient use of API, the program can automatically download TCGA data, there are a lot of TCGA data download R package, is through the call to API to achieve the corresponding function.

At this point, the study on "how to use GDC API to view and download TCGA data" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report