comparison imgt_loader/imgt_loader.r @ 39:bad6a9a53ae7 draft

Uploaded
author davidvanzessen
date Mon, 24 Apr 2017 09:39:59 -0400
parents 3a76faa53c59
children 106275b54470
comparison
equal deleted inserted replaced
38:b6936fb52ab9 39:bad6a9a53ae7
10 summ = read.table(summ.file, sep="\t", header=T, quote="", fill=T) 10 summ = read.table(summ.file, sep="\t", header=T, quote="", fill=T)
11 sequences = read.table(sequences.file, sep="\t", header=T, quote="", fill=T) 11 sequences = read.table(sequences.file, sep="\t", header=T, quote="", fill=T)
12 aa = read.table(aa.file, sep="\t", header=T, quote="", fill=T) 12 aa = read.table(aa.file, sep="\t", header=T, quote="", fill=T)
13 gapped.aa = read.table(gapped.aa.file, sep="\t", header=T, quote="", fill=T) 13 gapped.aa = read.table(gapped.aa.file, sep="\t", header=T, quote="", fill=T)
14 junction = read.table(junction.file, sep="\t", header=T, quote="", fill=T) 14 junction = read.table(junction.file, sep="\t", header=T, quote="", fill=T)
15
16 fix_column_names = function(df){
17 if("V.DOMAIN.Functionality" %in% names(df)){
18 names(df)[names(df) == "V.DOMAIN.Functionality"] = "Functionality"
19 print("found V.DOMAIN.Functionality, changed")
20 }
21 if("V.DOMAIN.Functionality.comment" %in% names(df)){
22 names(df)[names(df) == "V.DOMAIN.Functionality.comment"] = "Functionality.comment"
23 print("found V.DOMAIN.Functionality.comment, changed")
24 }
25 return(df)
26 }
27
28 summ = fix_column_names(summ)
29 sequences = fix_column_names(sequences)
30 aa = fix_column_names(aa)
31 gapped.aa = fix_column_names(gapped.aa)
32 junction = fix_column_names(junction)
15 33
16 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') 34 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')
17 old_sequence_columns=c('CDR1.IMGT','CDR2.IMGT','CDR3.IMGT') 35 old_sequence_columns=c('CDR1.IMGT','CDR2.IMGT','CDR3.IMGT')
18 old_junction_columns=c('JUNCTION') 36 old_junction_columns=c('JUNCTION')
19 37