comparison imgt_loader/imgt_loader.r @ 20:9185c3dfc679 draft

Uploaded
author davidvanzessen
date Fri, 27 Jan 2017 03:44:18 -0500
parents afe85eb6572e
children 798b62942b4b
comparison
equal deleted inserted replaced
19:3ef457aa5df6 20:9185c3dfc679
1 args <- commandArgs(trailingOnly = TRUE) 1 args <- commandArgs(trailingOnly = TRUE)
2 2
3 summ.file = args[1] 3 summ.file = args[1]
4 aa.file = args[2] 4 sequences.file = args[2]
5 junction.file = args[3] 5 aa.file = args[3]
6 out.file = args[4] 6 junction.file = args[4]
7 out.file = args[5]
7 8
8 summ = read.table(summ.file, sep="\t", header=T, quote="", fill=T) 9 summ = read.table(summ.file, sep="\t", header=T, quote="", fill=T)
10 sequences = read.table(sequences.file, sep="\t", header=T, quote="", fill=T)
9 aa = read.table(aa.file, sep="\t", header=T, quote="", fill=T) 11 aa = read.table(aa.file, sep="\t", header=T, quote="", fill=T)
10 junction = read.table(junction.file, sep="\t", header=T, quote="", fill=T) 12 junction = read.table(junction.file, sep="\t", header=T, quote="", fill=T)
11 13
12 old_summary_columns=c('Sequence.ID','JUNCTION.frame','V.GENE.and.allele','D.GENE.and.allele','J.GENE.and.allele','CDR1.IMGT.length','CDR2.IMGT.length','CDR3.IMGT.length','Orientation') 14 old_summary_columns=c('Sequence.ID','JUNCTION.frame','V.GENE.and.allele','D.GENE.and.allele','J.GENE.and.allele','CDR1.IMGT.length','CDR2.IMGT.length','CDR3.IMGT.length','Orientation')
13 old_sequence_columns=c('CDR1.IMGT','CDR2.IMGT','CDR3.IMGT') 15 old_sequence_columns=c('CDR1.IMGT','CDR2.IMGT','CDR3.IMGT')
28 out[,"CDR2.Length"] = summ[,"CDR2.IMGT.length"] 30 out[,"CDR2.Length"] = summ[,"CDR2.IMGT.length"]
29 31
30 out[,"CDR3.Seq"] = aa[,"CDR3.IMGT"] 32 out[,"CDR3.Seq"] = aa[,"CDR3.IMGT"]
31 out[,"CDR3.Length"] = summ[,"CDR3.IMGT.length"] 33 out[,"CDR3.Length"] = summ[,"CDR3.IMGT.length"]
32 34
33 out[,"CDR3.Seq.DNA"] = junction[,"JUNCTION"] 35 out[,"CDR3.Seq.DNA"] = sequences[,"CDR3.IMGT"]
34 out[,"CDR3.Length.DNA"] = nchar(as.character(junction[,"JUNCTION"])) 36 out[,"CDR3.Length.DNA"] = nchar(as.character(sequences[,"CDR3.IMGT"]))
35 out[,"Strand"] = summ[,"Orientation"] 37 out[,"Strand"] = summ[,"Orientation"]
36 out[,"CDR3.Found.How"] = "a" 38 out[,"CDR3.Found.How"] = "a"
37 39
38 out[,added_summary_columns] = summ[,added_summary_columns] 40 out[,added_summary_columns] = summ[,added_summary_columns]
39 41