Skip to content

Commit

Permalink
Update makeblobplot.R
Browse files Browse the repository at this point in the history
Added fix by https://github.com/hobrien to relabel least frequent as "other". (i.e. keep the top 13 most frequent taxa, as there are 13 usable colours in the colour scheme)

Maybe that should be the only filtering applied (rather than removing taxa that appear less than a certain proportion...
  • Loading branch information
sujaikumar committed Feb 6, 2014
1 parent 3d42272 commit ff9ca58
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions makeblobplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ numcols=length(cov_colnames)
taxlevel=arg_taxlevel;

m<-melt(orig,id.vars=c("seqid","len","gc",taxlevel),measure.vars=cov_colnames, variable.name="read_set", value.name="cov")

# there aren't many colours available, so to restrict the plot to only 13 colours:
# (thanks to https://github.com/hobrien for the fix)
if (length(levels(m[,taxlevel])) > 14) {
levels(d[,taxlevel])[which(table(d[,taxlevel])<=sort(as.numeric(table(d[,taxlevel])), decreasing=T)[13])]<-"other"
}

mfilt<-clean.blobs(m,arg_ignore_below_prop,taxlevel)
taxnames=names(sort(table(mfilt[,taxlevel]),decreasing=TRUE))
taxnames=c("Not annotated", taxnames[taxnames != "Not annotated"])
Expand Down

0 comments on commit ff9ca58

Please sign in to comment.