library('rjson')
result<- fromJSON(file = './metadata.cart.RNA.json')
tcga_barcode<- unlist(lapply(result,function(x){x[[12]][[1]][[3]]}))
tcga_barcode
[1] "TCGA-44-6148-11A-01R-1858-07" "TCGA-62-8395-01A-11R-2326-07" "TCGA-50-6595-11A-01R-1858-07"
[4] "TCGA-55-8208-01A-11R-2241-07" "TCGA-55-6980-11A-01R-1949-07" "TCGA-05-4403-01A-01R-1206-07"
[7] "TCGA-05-4382-01A-01R-1206-07" "TCGA-44-7670-01A-11R-2066-07" "TCGA-49-AARN-01A-21R-A41B-07"
理解list
充分理解list构成,包含了13个list,其中barcode是第12个list中的第1个list下面的第三个,最后list转为data.frame只需要一句话
网友评论