Skip to content

Commit

Permalink
Adding everything to make structural plots.
Browse files Browse the repository at this point in the history
  • Loading branch information
ausmeyer committed Mar 6, 2015
1 parent c197da2 commit dbc0fc6
Show file tree
Hide file tree
Showing 12 changed files with 540 additions and 0 deletions.
Binary file added HA/dNdS/distances/correlations_violin_HA.idraw
Binary file not shown.
Binary file modified HA/dNdS/distances/correlations_violin_HA.pdf
Binary file not shown.
Binary file not shown.
Binary file added HA/dNdS/distances/scale.idraw
Binary file not shown.
Binary file added HA/dNdS/distances/scale.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
512 changes: 512 additions & 0 deletions NA/dNdS/distances/correlations/.Rhistory

Large diffs are not rendered by default.

Binary file added NA/dNdS/distances/correlations_violin_NA.idraw
Binary file not shown.
Binary file modified NA/dNdS/distances/correlations_violin_NA.pdf
Binary file not shown.
Binary file not shown.
Binary file added NA/dNdS/distances/scale.idraw
Binary file not shown.
Binary file added NA/dNdS/distances/scale.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions cor_violin.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
rm(list = ls())

library(ggplot2)
library(grid)
library(cowplot)

make.plot <- function(protein) {
correlations <- data.frame(ID=numeric(), correlation=numeric())

count <- 0
for(file in list.files()) {
count <- count + 1
tmp.cor <- read.table(file, head=F)$V1
correlations <- rbind(correlations, data.frame(ID=rep(count, length(tmp.cor)), correlation=tmp.cor))
}

p <- ggplot(correlations, aes(factor(ID), correlation)) + geom_violin(fill = 'gray') +
xlab('Time (Months)') +
ylab('Distribution of Correlations')

ggsave(filename=paste('../correlations_violin_', protein, '.pdf', sep=''), height=5, width=15, useDingbats=F)
}

setwd('~/Google Drive/Data/influenza_pH1N1_timecourse/HA/dNdS/distances/correlations/')
make.plot('HA')

setwd('~/Google Drive/Data/influenza_pH1N1_timecourse/NA/dNdS/distances/correlations/')
make.plot('NA')

0 comments on commit dbc0fc6

Please sign in to comment.