# HG changeset patch # User davidvanzessen # Date 1444832310 14400 # Node ID c89d9e89423b2edae196e3c7e2fb53d3eb496af4 # Parent 43ce3ebfc9b574807c680197bdecffc81e82098f Uploaded diff -r 43ce3ebfc9b5 -r c89d9e89423b RScript.r --- 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("", sep=""), file="multiple_matches.html", append=T) +cat(paste("
", sep=""), file="multiple_matches.html", append=T) +cat(paste("
", 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("", 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("", sep=""), file="single_matches.html", append=T) + } else { + cat(paste("", sep=""), file="single_matches.html", append=T) } } - if(nrow(first.rows) > 1 | nrow(second.rows) > 1){ - cat(paste("", sep=""), file="multiple_matches.html", append=T) - } - } else { patient.fuzzy = patient.fuzzy[-1,] }
", patient, " row ", 1:nrow(tmp.rows), "", tmp.rows$Sample, ":", tmp.rows$Clone_Sequence, "", tmp.rows$normalized_read_count, "
", patient, " row ", 1:nrow(tmp.rows), "", tmp.rows$Sample, ":", tmp.rows$Clone_Sequence, "", tmp.rows$normalized_read_count, "
", patient, " row ", 1:nrow(tmp.rows), "", tmp.rows$Sample, ":", tmp.rows$Clone_Sequence, "", tmp.rows$normalized_read_count, "
", patient, ": ", nrow(first.rows), " ", nrow(second.rows), " ", first.clone.sequence, "