Question: TCGA retrieving file id from submitter_aliquot_ids using the files endpoint
0
gravatar for sahar850
15 months ago by
sahar8500
sahar8500 wrote:

Hi, i got a list of submitter_aliquot_ids and i am trying to retrieve there file id.

so far i manege to get some result using R code with cURL in the cases endpoint.

the data i get is too maccey to use.

does anyone know how to get this information with the files endpoint?

the code i am using to create the query file (in R):

aliquot_list = read.csv(file ='file_name.csv',as.is = TRUE)
id= toString(sprintf('"%s"',aliquot_list$submitter_aliquot_ids[1:62])) 
Part1= '{"filters":{"op":"in","content":{"field":"submitter_aliquot_ids","value":[ '
Part2= '] }},"format":"TSV", "fields":"case_id,files.file_id,cases.files.file_name,submitter_aliquot_ids","size":'
Part3= paste(shQuote(2000),"}",sep="")
Sentence= paste(Part1,id,Part2,Part3, collapse=" ")
write.table(Sentence,"Payload_metadata.txt",quote=F,col.names=F,row.names=F)

the query (with cURL in the cmd):

curl --request POST --header "Content-Type: application/json" --data @Payload_metadata.txt "https://api.gdc.cancer.gov/cases" > File_metadata.txt

basically i don't know what the "fields" value should be while using the files endpoint (https://api.gdc.cancer.gov/files).

i tried the following: files.submitter_id, files.cases.aliquot_ids,files.cases.submitter_id,files.cases.submitter_aliquot_ids. non of them worked.

tcga R • 366 views
ADD COMMENTlink modified 15 months ago • written 15 months ago by sahar8500
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2267 users visited in the last hour