Mercurial > repos > davidvanzessen > mutation_analysis
comparison mutation_analysis.r @ 120:613278c1bde0 draft
Uploaded
| author | davidvanzessen |
|---|---|
| date | Tue, 16 Aug 2016 09:10:50 -0400 |
| parents | 626a956f3811 |
| children | 0453ea4d9f14 |
comparison
equal
deleted
inserted
replaced
| 119:626a956f3811 | 120:613278c1bde0 |
|---|---|
| 278 | 278 |
| 279 if(!all(transition2$value == 0)){ #having rows of data but a transition table filled with 0 is bad | 279 if(!all(transition2$value == 0)){ #having rows of data but a transition table filled with 0 is bad |
| 280 | 280 |
| 281 print("Plotting stacked transition") | 281 print("Plotting stacked transition") |
| 282 | 282 |
| 283 print(transition2) | |
| 284 | |
| 285 png(filename=paste("transitions_stacked_", name, ".png", sep="")) | 283 png(filename=paste("transitions_stacked_", name, ".png", sep="")) |
| 286 p = ggplot(transition2, aes(factor(reorder(id, order.x)), y=value, fill=factor(reorder(variable, order.y)))) + geom_bar(position="fill", stat="identity") #stacked bar | 284 p = ggplot(transition2, aes(factor(reorder(id, order.x)), y=value, fill=factor(reorder(variable, order.y)))) + geom_bar(position="fill", stat="identity") #stacked bar |
| 287 p = p + xlab("From base") + ylab("To base") + ggtitle("Mutations frequency from base to base") + guides(fill=guide_legend(title=NULL)) | 285 p = p + xlab("From base") + ylab("To base") + ggtitle("Mutations frequency from base to base") + guides(fill=guide_legend(title=NULL)) |
| 288 print(p) | 286 print(p) |
| 289 dev.off() | 287 dev.off() |
