How to retrieve sample barcode from patient barcode using R?
Thanks with regards in advance.
5 answers
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
There is a bioconductor package called tcgaBiolinks. I've never used but it should have the function you are looking for.
I have retrived patient barcode.Now i just want to convert these patient barcode into sample barcode.If u know share me please. Thanks with regards in advance...
Hii, i have a barcode TCGA-3C-AALK.But i need a barcode like this TCGA-A7-A13G-01A-11R-A13P-13.How to get this??is it possible to get barcode(TCGA-A7-A13G-01A-11R-A13P-13) from patient barcode(TCGA-3C-AALK).
hii, I have created rda file by using this code. query.exp.hg38 <- GDCquery(project = "TCGA-GBM", data.category = "Transcriptome Profiling", data.type = "Gene Expression Quantification", workflow.type = "HTSeq - FPKM-UQ", barcode = c("TCGA-14-0736-02A-01R-2005-01", "TCGA-06-0211-02A-02R-2005-01")) GDCdownload(query.exp.hg38) expdat <- GDCprepare(query = query.exp.hg38, save = TRUE, save.filename = "exp.rda") while trying to open that rda file,i am getting primitive error. load("exp.rda") show(exp) function (x) .Primitive("exp") how to save a file like this?? save(dataBRCA, geneInfo , file = "dataGeneExpression.rda") If anybody knows please post the answer.
Log in to answer this question.
-----------------------------------------
-----------------------------------------
3rd May 2018
An updated answer using R: Sample names for TCGA data from GDC-legacy archive
--------------------------------------------
--------------------------------------------
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