This is a test version of Biostars. For the public version, visit https://www.biostars.org.
TCGA retrieving file id from submitter_aliquot_ids using the files endpoint

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

0 answers

No answers yet.

Log in to answer this question.