Mercurial > repos > davidvanzessen > shm_csr
diff new_imgt.r @ 57:cb779a45537b draft
Uploaded
author | davidvanzessen |
---|---|
date | Tue, 18 Jul 2017 04:28:11 -0400 |
parents | 6cd12c71c3d3 |
children | dc06e94bc1e3 |
line wrap: on
line diff
--- a/new_imgt.r Mon Jul 17 10:44:40 2017 -0400 +++ b/new_imgt.r Tue Jul 18 04:28:11 2017 -0400 @@ -14,6 +14,8 @@ merged = merged[!grepl("unmatched", merged$best_match),] } +nrow_dat = 0 + for(f in list.files(imgt.dir, pattern="*.txt$")){ #print(paste("filtering", f)) path = file.path(imgt.dir, f) @@ -21,9 +23,13 @@ dat = dat[dat[,"Sequence ID"] %in% merged$Sequence.ID,] + nrow_dat = nrow(dat) + if(nrow(dat) > 0 & grepl("^8_", f)){ #change the FR1 columns to 0 in the "8_..." file dat[,grepl("^FR1", names(dat))] = 0 } write.table(dat, path, quote=F, sep="\t", row.names=F, col.names=T, na="") } + +print(paste("Creating new zip for ", gene, "with", nrow_dat, "sequences"))