-
Notifications
You must be signed in to change notification settings - Fork 2
/
uuid2barcode.r
35 lines (30 loc) · 958 Bytes
/
uuid2barcode.r
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
##########################Environment##########################
# R-3.6
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("TCGAutils")
#R-3.5
source("https://bioconductor.org/biocLite.R")
biocLite("TCGAutils")
##########################Process##########################
setwd("manifest/")
library("TCGAutils")
files=dir()
# UUID tbl -> barcod list
result=list()
label=NULL
for(i in 1:length(files)){
temp=unlist(strsplit(x=files[i],split="\\."))
label=c(label,temp[2])
d=read.table(files[i],sep="\t",header=T)
tf=NULL
for(j in 1:nrow(d)){
this_row=UUIDtoBarcode(d[j,"id"], id_type = "file_id")
tf=c(tf,this_row[,"cases.submitter_id"])
}
result[[i]]=tf
}
names(result)=label
unique(length(intersect(result[[3]],result[[2]])))
unique(length(intersect(result[[3]],result[[1]])))
unique(length(intersect(result[[2]],intersect(result[[3]],result[[1]]))