changeset 56:c89d9e89423b draft

Uploaded
author davidvanzessen
date Wed, 14 Oct 2015 10:18:30 -0400
parents 43ce3ebfc9b5
children 6562c81d6583
files RScript.r
diffstat 1 files changed, 13 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/RScript.r	Tue Oct 13 09:20:16 2015 -0400
+++ b/RScript.r	Wed Oct 14 10:18:30 2015 -0400
@@ -67,7 +67,8 @@
 
 patient.merge.list = list() #cache the 'both' table, 2x speedup for more memory...
 patient.merge.list.second = list()
-cat(paste("<table border='0'>", sep=""), file="multiple_matches.html", append=T)
+cat(paste("<table border='0' style='font-family:courier;'>", sep=""), file="multiple_matches.html", append=T)
+cat(paste("<table border='0' style='font-family:courier;'>", sep=""), file="single_matches.html", append=T)
 patientCountOnColumn <- function(x, product, interval, on, appendtxt=F){
   if (!is.data.frame(x) & is.list(x)){
     x = x[[1]]
@@ -261,17 +262,20 @@
         hidden.clone.sequences = c(first.rows[-1,"Clone_Sequence"], second.rows[second.rows$Clone_Sequence != first.clone.sequence,"Clone_Sequence"])
         merge.list[["second"]] = append(merge.list[["second"]], hidden.clone.sequences)
 
-        if(sum(first.match.filter) == 1 & sum(second.match.filter) == 1){
-          second.clone.sequence = patient.fuzzy[second.match.filter, "Clone_Sequence"]
-          if(first.clone.sequence != second.clone.sequence){
-            #merge.list[["second"]] = append(merge.list[["second"]], second.clone.sequence)
+        tmp.rows = rbind(first.rows, second.rows)
+        tmp.rows = tmp.rows[order(nchar(tmp.rows$Clone_Sequence)),]
+
+        if (nrow(first.rows) > 1 | nrow(second.rows) > 1) {
+          cat(paste("<tr><td>", patient, " row ", 1:nrow(tmp.rows), "</td><td>", tmp.rows$Sample, ":</td><td>", tmp.rows$Clone_Sequence, "</td><td>", tmp.rows$normalized_read_count, "</td></tr>", sep=""), file="multiple_matches.html", append=T)
+        } else {
+          second.clone.sequence = second.rows[1,"Clone_Sequence"]
+          if(nchar(first.clone.sequence) != nchar(second.clone.sequence)){
+            cat(paste("<tr bgcolor='#DDD'><td>", patient, " row ", 1:nrow(tmp.rows), "</td><td>", tmp.rows$Sample, ":</td><td>", tmp.rows$Clone_Sequence, "</td><td>", tmp.rows$normalized_read_count, "</td></tr>", sep=""), file="single_matches.html", append=T)
+          } else {
+            cat(paste("<tr><td>", patient, " row ", 1:nrow(tmp.rows), "</td><td>", tmp.rows$Sample, ":</td><td>", tmp.rows$Clone_Sequence, "</td><td>", tmp.rows$normalized_read_count, "</td></tr>", sep=""), file="single_matches.html", append=T)
           }
         }
 
-        if(nrow(first.rows) > 1 | nrow(second.rows) > 1){
-          cat(paste("<tr><td>", patient, ": ", nrow(first.rows), " ", nrow(second.rows), " ", first.clone.sequence,  "</td></tr>", sep=""), file="multiple_matches.html", append=T)
-        }
-
       } else {
         patient.fuzzy = patient.fuzzy[-1,]
       }