Mercurial > repos > davidvanzessen > shm_csr
diff sequence_overview.r @ 32:4c5ba6b5d10d draft
Uploaded
author | davidvanzessen |
---|---|
date | Thu, 15 Dec 2016 09:21:54 -0500 |
parents | fe44a905aee9 |
children | 22fabe161cf3 |
line wrap: on
line diff
--- a/sequence_overview.r Tue Dec 13 10:06:49 2016 -0500 +++ b/sequence_overview.r Thu Dec 15 09:21:54 2016 -0500 @@ -83,10 +83,10 @@ } cat("<tr>", file=main.html, append=T) -cat("<th>Sequence</th><th>Functionality</th><th>ca1</th><th>ca2</th><th>cg1</th><th>cg2</th><th>cg3</th><th>cg4</th><th>cm</th><th>un</th>", file=main.html, append=T) -cat("<th>total CA</th><th>total CG</th><th>number of subclasses</th><th>present in both Ca and Cg</th><th>Ca1+Ca2</th>", file=main.html, append=T) -cat("<th>Cg1+Cg2</th><th>Cg1+Cg3</th><th>Cg1+Cg4</th><th>Cg2+Cg3</th><th>Cg2+Cg4</th><th>Cg3+Cg4</th>", file=main.html, append=T) -cat("<th>Cg1+Cg2+Cg3</th><th>Cg2+Cg3+Cg4</th><th>Cg1+Cg2+Cg4</th><th>Cg1+Cg3+Cg4</th><th>Cg1+Cg2+Cg3+Cg4</th>", file=main.html, append=T) +cat("<th>Sequence</th><th>Functionality</th><th>IGA1</th><th>IGA2</th><th>IGG1</th><th>IGG2</th><th>IGG3</th><th>IGG4</th><th>IGM</th><th>IGE</th><th>UN</th>", file=main.html, append=T) +cat("<th>total IGA</th><th>total IGG</th><th>total IGE</th><th>total IGM</th><th>number of subclasses</th><th>present in both IGA and IGG</th><th>present in IGA, IGG and IGM</th><th>present in IGA, IGG and IGE</th><th>present in IGA, IGG, IGM and IGE</th><th>IGA1+IGA2</th>", file=main.html, append=T) +cat("<th>IGG1+IGG2</th><th>IGG1+IGG3</th><th>IGG1+IGG4</th><th>IGG2+IGG3</th><th>IGG2+IGG4</th><th>IGG3+IGG4</th>", file=main.html, append=T) +cat("<th>IGG1+IGG2+IGG3</th><th>IGG2+IGG3+IGG4</th><th>IGG1+IGG2+IGG4</th><th>IGG1+IGG3+IGG4</th><th>IGG1+IGG2+IGG3+IGG4</th>", file=main.html, append=T) cat("</tr>", file=main.html, append=T) @@ -112,8 +112,11 @@ cm = IDs[IDs$seq_conc == dat[i,c("seq_conc")] & grepl("^IGM", IDs$best_match),] + ce = IDs[IDs$seq_conc == dat[i,c("seq_conc")] & grepl("^IGE", IDs$best_match),] + un = IDs[IDs$seq_conc == dat[i,c("seq_conc")] & grepl("^unmatched", IDs$best_match),] - allc = rbind(ca1, ca2, cg1, cg2, cg3, cg4, cm, un) + + allc = rbind(ca1, ca2, cg1, cg2, cg3, cg4, cm, ce, un) ca1.n = nrow(ca1) ca2.n = nrow(ca2) @@ -125,9 +128,11 @@ cm.n = nrow(cm) + ce.n = nrow(ce) + un.n = nrow(un) - classes = c(ca1.n, ca2.n, cg1.n, cg2.n, cg3.n, cg4.n, cm.n, un.n) + classes = c(ca1.n, ca2.n, cg1.n, cg2.n, cg3.n, cg4.n, cm.n, ce.n, un.n) classes.sum = sum(classes) @@ -145,7 +150,7 @@ matched = matched + in.classes #count in how many subclasses the sequence occurs. - if(any(classes == classes.sum)){ + if(any(classes == classes.sum)){ multiple.in.one = multiple.in.one + 1 } else if (un.n > 0) { some.unmatched = some.unmatched + 1 @@ -187,6 +192,10 @@ cat(tbl(cm), file=paste("IGM_", id, ".html", sep="")) } + if(ce.n > 0){ + cat(tbl(ce), file=paste("IGE_", id, ".html", sep="")) + } + if(un.n > 0){ cat(tbl(un), file=paste("un_", id, ".html", sep="")) } @@ -201,6 +210,8 @@ cm.html = make.link(id, "IGM", cm.n) + ce.html = make.link(id, "IGE", ce.n) + un.html = make.link(id, "un", un.n) #extra columns @@ -212,6 +223,12 @@ in.ca.cg = (ca.n > 0 & cg.n > 0) + in.ca.cg.cm = (ca.n > 0 & cg.n > 0 & cm.n > 0) + + in.ca.cg.ce = (ca.n > 0 & cg.n > 0 & ce.n > 0) + + in.ca.cg.cm.ce = (ca.n > 0 & cg.n > 0 & cm.n > 0 & ce.n > 0) + in.ca1.ca2 = (ca1.n > 0 & ca2.n > 0) in.cg1.cg2 = (cg1.n > 0 & cg2.n > 0) @@ -232,8 +249,8 @@ #rw = c(as.character(dat[i,"seq_conc"]), functionality, ca1.html, ca2.html, cg1.html, cg2.html, cg3.html, cg4.html, cm.html, un.html) - rw = c(as.character(dat[i,"seq_conc"]), functionality, ca1.html, ca2.html, cg1.html, cg2.html, cg3.html, cg4.html, cm.html, un.html) - rw = c(rw, ca.n, cg.n, in.classes, in.ca.cg, in.ca1.ca2, in.cg1.cg2, in.cg1.cg3, in.cg1.cg4, in.cg2.cg3, in.cg2.cg4, in.cg3.cg4, in.cg1.cg2.cg3, in.cg2.cg3.cg4, in.cg1.cg2.cg4, in.cg1.cg3.cg4, in.cg.all) + rw = c(as.character(dat[i,"seq_conc"]), functionality, ca1.html, ca2.html, cg1.html, cg2.html, cg3.html, cg4.html, cm.html, ce.html, un.html) + rw = c(rw, ca.n, cg.n, cm.n, ce.n, in.classes, in.ca.cg, in.ca.cg.cm, in.ca.cg.ce, in.ca.cg.cm.ce, in.ca1.ca2, in.cg1.cg2, in.cg1.cg3, in.cg1.cg4, in.cg2.cg3, in.cg2.cg4, in.cg3.cg4, in.cg1.cg2.cg3, in.cg2.cg3.cg4, in.cg1.cg2.cg4, in.cg1.cg3.cg4, in.cg.all) cat(tr(rw), file=main.html, append=T)