Mercurial > repos > davidvanzessen > shm_csr
diff pattern_plots.r @ 38:05c62efdc393 draft
Uploaded
author | davidvanzessen |
---|---|
date | Tue, 20 Dec 2016 09:03:15 -0500 |
parents | 81453585dfc3 |
children | a24f8c93583a |
line wrap: on
line diff
--- a/pattern_plots.r Fri Dec 16 10:17:16 2016 -0500 +++ b/pattern_plots.r Tue Dec 20 09:03:15 2016 -0500 @@ -47,6 +47,11 @@ names(data1) = c("Class", "Type", "value") +chk = is.na(data1$value) +if(any(chk)){ + data1[chk, "value"] = 0 +} + data1 = data1[order(data1$Type),] write.table(data1, plot1.txt, quote=F, sep="\t", na="", row.names=F, col.names=T) @@ -79,6 +84,11 @@ names(data2) = c("Class", "Type", "value") +chk = is.na(data2$value) +if(any(chk)){ + data2[chk, "value"] = 0 +} + data2 = data2[order(data2$Type),] write.table(data2, plot2.txt, quote=F, sep="\t", na="", row.names=F, col.names=T) @@ -94,9 +104,6 @@ data3 = data3[,names(data3)[grepl("\\.x", names(data3))]] names(data3) = gsub(".x", "", names(data3)) -data3[is.na(data3)] = 0 -#data3[is.infinite(data3)] = 0 - data3["G/C transitions",] = round(data3["Transitions at G C (%)",] / (data3["C",] + data3["G",]) * 100, 1) data3["G/C transversions",] = round((data3["Targeting of G C (%)",] - data3["Transitions at G C (%)",]) / (data3["C",] + data3["G",]) * 100, 1) @@ -115,6 +122,11 @@ data3 = melt(t(data3[8:10,])) names(data3) = c("Class", "Type", "value") +chk = is.na(data1$data3) +if(any(chk)){ + data3[chk, "value"] = 0 +} + data3 = data3[order(data3$Type),] write.table(data3, plot3.txt, quote=F, sep="\t", na="", row.names=F, col.names=T)