Skip to content

Commit

Permalink
fixed plot problem
Browse files Browse the repository at this point in the history
  • Loading branch information
VascoElbrecht committed May 19, 2016
1 parent 2260a2a commit a1f3256
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions PrimerMiner/R/plot_alignments.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ meep <- start:end
for (h in 1:nrow(padd)){
s <- 1
temp <- list[[s]][meep[h], 2:5]
if(length(files)>1){
if(length(files)>1){ # more than one file, add other values as well
for (s in 2:length(files)){
temp <- rbind(temp+list[[s]][meep[h], 2:5])
}
Expand All @@ -92,12 +92,17 @@ p <- temp / sum(temp)

#make plot

padd <- cbind(0, p*2)
m <- 5

padd <- c(0, p*2)
for (m in 2:5){
rect(h-0.5, sum(padd[1:m-1])+1.75, h+0.5, sum(padd[1:m])+1.75, col=plotcol[m-1])}


rect(h-0.5, 0, h+0.5, 0.6, col= plotcol[which.max(p)], border=NA)
text(h, 0.3, names(as.data.frame(p))[which.max(p)], cex=0.75)
text(h, 0.3, names(p)[which.max(p)], cex=0.75) # write cons nucleotide

# need to add wobble base consensus options at some point!

# plot nucleotide cov boxes
rect(h-0.5, 0.8, h+0.5, 1.4, col= covcol[length(which(p>threshold))], border=NA)
Expand Down

0 comments on commit a1f3256

Please sign in to comment.