comparison RScript.r @ 31:ce8bd23d0335 draft

Uploaded
author davidvanzessen
date Tue, 02 Jun 2015 05:26:52 -0400
parents 45554fd15511
children dde5ec847549
comparison
equal deleted inserted replaced
30:45554fd15511 31:ce8bd23d0335
286 product = data.frame("Titles"=rep(Titles, each=length(interval)), "interval"=rep(interval, times=10), "V_Segments"=rep(V_Segments, each=length(interval)), "J_Segments"=rep(J_Segments, each=length(interval))) 286 product = data.frame("Titles"=rep(Titles, each=length(interval)), "interval"=rep(interval, times=10), "V_Segments"=rep(V_Segments, each=length(interval)), "J_Segments"=rep(J_Segments, each=length(interval)))
287 lapply(patients, FUN=patientCountOnColumn, product = product, interval=interval, on="normalized_read_count") 287 lapply(patients, FUN=patientCountOnColumn, product = product, interval=interval, on="normalized_read_count")
288 288
289 cat("</table></html>", file=logfile, append=T) 289 cat("</table></html>", file=logfile, append=T)
290 290
291 scales = 10^(0:ceiling(log10(max(single_patients$normalized_read_count)))) 291 scales = 10^(0:6) #(0:ceiling(log10(max(scatterplot_locus_data$normalized_read_count))))
292 p = ggplot(single_patients, aes(Rearrangement, normalized_read_count)) + scale_y_log10(breaks=scales,labels=scales) 292 p = ggplot(single_patients, aes(Rearrangement, normalized_read_count)) + scale_y_log10(breaks=scales,labels=scales)
293 p = p + geom_point(aes(colour=type), position="jitter") 293 p = p + geom_point(aes(colour=type), position="jitter")
294 p = p + xlab("In one or both samples") + ylab("Reads") 294 p = p + xlab("In one or both samples") + ylab("Reads")
295 p = p + facet_grid(.~Patient) + ggtitle("Scatterplot of the reads of the patients with a single sample") 295 p = p + facet_grid(.~Patient) + ggtitle("Scatterplot of the reads of the patients with a single sample")
296 png("singles_reads_scatterplot.png", width=640 * length(unique(single_patients$Patient)), height=1080) 296 png("singles_reads_scatterplot.png", width=640 * length(unique(single_patients$Patient)), height=1080)
445 scatterplot_locus_data[not_in_one,]$type = "In multiple" 445 scatterplot_locus_data[not_in_one,]$type = "In multiple"
446 } 446 }
447 p = NULL 447 p = NULL
448 if(nrow(scatterplot_locus_data) != 0){ 448 if(nrow(scatterplot_locus_data) != 0){
449 if(on == "normalized_read_count"){ 449 if(on == "normalized_read_count"){
450 scales = 10^(0:ceiling(log10(max(scatterplot_locus_data$normalized_read_count)))) 450 scales = 10^(0:6) #(0:ceiling(log10(max(scatterplot_locus_data$normalized_read_count))))
451 p = ggplot(scatterplot_locus_data, aes(type, normalized_read_count)) + scale_y_log10(breaks=scales,labels=scales) 451 p = ggplot(scatterplot_locus_data, aes(type, normalized_read_count)) + scale_y_log10(breaks=scales,labels=scales)
452 } else { 452 } else {
453 p = ggplot(scatterplot_locus_data, aes(type, Frequency)) 453 p = ggplot(scatterplot_locus_data, aes(type, Frequency))
454 } 454 }
455 p = p + geom_point(aes(colour=type), position="jitter") 455 p = p + geom_point(aes(colour=type), position="jitter")