Skip to content

Commit

Permalink
minor edits
Browse files Browse the repository at this point in the history
  • Loading branch information
elswob committed Jul 27, 2015
1 parent ead2c06 commit fc8bb2f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion R/pam50_correlation_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ multiplot <- function(..., plotlist=NULL, file, cols=1, layout=NULL) {
#' @param p50 The PAM50 results text file
#' @param id The ID of the samples to extract
#' @param name The name to represent the samples
cor_plot = function(p,id,name){
cor_plot = function(p,id,name,outDir){
print(paste0("Generating correlation plots - ",id," - ",name))
p$X=rownames(p)
print(head(p))
Expand Down
2 changes: 1 addition & 1 deletion R/subtypePrediction_distributed.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pam50_wrapper=function(outDir,inputFile,short){
# begin analyses

# only need train data for visualizations
print(paste0("reading trainFile - ",trainFile))
#print(paste0("reading trainFile - ",trainFile))
x<-readarray(trainFile,hr=2)
print(summary(x))
x$xd<-standardize(medianCtr(x$xd))
Expand Down
4 changes: 2 additions & 2 deletions R/subtype_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ run_p50=function(pamCC,remove_lc){
print(head(m)[,0:5])

#inputFile="pam50_median_normalised_10_each.txt"
inputFile<-paste0(outDir,"/pam50_median_normalised.txt")
inputFile<-paste0(outDir,"/pam50_un-normalised.txt")

### Run PAM50
print("Running PAM50")
Expand Down Expand Up @@ -383,7 +383,7 @@ run_p50=function(pamCC,remove_lc){
dev.off()

#plot the correlation coefficients
cor_plot(pam.res,".",short)
cor_plot(pam.res,".",short,outDir)
}

################# SCMGENE #######################
Expand Down
9 changes: 8 additions & 1 deletion R/subtype_summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,19 @@ plot_summary=function(m,outDir){
print(head(m))
mm<-melt(m,id.vars=1,measure.var=c(5:9))
mm$value=factor(mm$value,levels=sort(levels(mm$value)))
pdf(paste0(outDir,"/subtype_summary.pdf"))
pdf(paste0(outDir,"/subtype_summary_pc.pdf"))
g = ggplot(data = mm, aes(x = sub("_.*","",Sample), fill = value)) + geom_bar(position="fill")
g = g + labs(title = "Classification counts", y = "Classification Percentage", x = "Sample", fill = "PAM50 Subtype")
g = g + theme(text = element_text(size=10), axis.text.x = element_text(angle = 90, hjust = 1, size=4))
print(g)
dev.off()

pdf(paste0(outDir,"/subtype_summary_counts.pdf"))
g = ggplot(data = mm, aes(x = sub("_.*","",Sample), fill = value)) + geom_bar()
g = g + labs(title = "Classification counts", y = "Classification Counts", x = "Sample", fill = "PAM50 Subtype")
g = g + theme(text = element_text(size=10), axis.text.x = element_text(angle = 90, hjust = 1, size=4))
print(g)
dev.off()
}

#m=read.delim('subtype_summary.tsv')
Expand Down

0 comments on commit fc8bb2f

Please sign in to comment.