diff new_imgt.r @ 55:6cd12c71c3d3 draft

Uploaded
author davidvanzessen
date Wed, 14 Jun 2017 11:14:00 -0400
parents fe44a905aee9
children cb779a45537b
line wrap: on
line diff
--- a/new_imgt.r	Tue May 30 07:40:15 2017 -0400
+++ b/new_imgt.r	Wed Jun 14 11:14:00 2017 -0400
@@ -8,15 +8,15 @@
 
 if(gene != "-"){
 	merged = merged[grepl(paste("^", gene, sep=""), merged$best_match),]
-} else {
+}
+
+if("best_match" %in% names(merged)){
 	merged = merged[!grepl("unmatched", merged$best_match),]
 }
 
-merged = merged[!grepl("unmatched", merged$best_match),]
-
 for(f in list.files(imgt.dir, pattern="*.txt$")){
 	#print(paste("filtering", f))
-	path = paste(imgt.dir, f, sep="")
+	path = file.path(imgt.dir, f)
 	dat = read.table(path, header=T, sep="\t", fill=T, quote="", stringsAsFactors=F, check.names=FALSE, comment.char="")
 	
 	dat = dat[dat[,"Sequence ID"] %in% merged$Sequence.ID,]