0
|
1 arg = commandArgs(TRUE)
|
|
2 summaryfile = arg[1]
|
|
3 gappedfile = arg[2]
|
|
4 selection = arg[3]
|
|
5 output = arg[4]
|
|
6 print(paste("selection = ", selection))
|
|
7
|
|
8
|
|
9 summarydat = read.table(summaryfile, header=T, sep="\t", fill=T, stringsAsFactors=F)
|
|
10 gappeddat = read.table(gappedfile, header=T, sep="\t", fill=T, stringsAsFactors=F)
|
|
11
|
|
12 #dat = data.frame(merge(gappeddat, summarydat, by="Sequence.ID", all.x=T))
|
|
13
|
|
14 dat = cbind(gappeddat, summarydat$AA.JUNCTION)
|
|
15
|
|
16 colnames(dat)[length(dat)] = "AA.JUNCTION"
|
|
17
|
|
18 dat$VGene = gsub("^Homsap ", "", dat$V.GENE.and.allele)
|
|
19 dat$VGene = gsub("[*].*", "", dat$VGene)
|
|
20
|
|
21 dat$DGene = gsub("^Homsap ", "", dat$D.GENE.and.allele)
|
|
22 dat$DGene = gsub("[*].*", "", dat$DGene)
|
|
23
|
|
24 dat$JGene = gsub("^Homsap ", "", dat$J.GENE.and.allele)
|
|
25 dat$JGene = gsub("[*].*", "", dat$JGene)
|
|
26
|
|
27 #print(str(dat))
|
|
28
|
|
29 dat$past = do.call(paste, c(dat[unlist(strsplit(selection, ","))], sep = ":"))
|
|
30
|
|
31 dat = dat[!duplicated(dat$past), ]
|
|
32
|
|
33 dat = dat[dat$Functionality != "No results" & dat$Functionality != "unproductive",]
|
|
34
|
|
35 write.table(x=dat, file=output, sep="\t",quote=F,row.names=F,col.names=T)
|