Retrieve barcodes from TCGA using R
5
0
Entering edit mode
7.2 years ago

How to retrieve sample barcode from patient barcode using R?

Thanks with regards in advance.

R TCGA • 3.4k views
ADD COMMENT
0
Entering edit mode

Update, 12th May 2018

Since this post was made, a rapid way to interrogate the GDC data for the purposes of converting UUIDs to TCGA Barcodes was found using R Programming Language. See the thread here: Sample names for TCGA data from GDC-legacy archive

Kevin

ADD REPLY
3
Entering edit mode
7.2 years ago
Chun-Jie Liu ▴ 280

TCGA provide API to get the barcode from UUID. I wrote a python script to map file UUID barcode. Just input the manifest to the script.

Now, then. You want to use r to access GDC API, is the same as python. Use httr package in the r to post filters to return your result.

A simple example using file ID to retrieve info from GDC (GDC provides other end point, you can check it.)

require(httr)

files_endpt = "https://gdc-api.nci.nih.gov/files"

body = list("filters" = list("op" = "in", "content" = list('field'='files.file_id', 'value'='af5085c1-5b4e-4b88-9f5f-3c049cdd981f')), 'format' = 'TSV', 'fields'="file_id,file_name,cases.case_id,cases.submitter_id,cases.samples.sample_id,cases.samples.submitter_id,cases.samples.portions.analytes.aliquots.aliquot_id,cases.samples.portions.analytes.aliquots.submitter_id,cases.samples.sample_type,cases.samples.tissue_type,data_category,data_type", 'size' = 1)

r <- POST(url = files_endpt, body = body, encode = 'json')

content(r, 'parsed')

content(r)$cases_0_submitter_id
ADD COMMENT
1
Entering edit mode
7.2 years ago

There is a bioconductor package called tcgaBiolinks. I've never used but it should have the function you are looking for.

ADD COMMENT

Login before adding your answer.

Traffic: 1852 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6