@@ -41,25 +41,27 @@ multi_heat <- function(tab, object, pheno.df=NULL, labrows=rownames(object), lab
4141 p.col <- paste0(contr , " .p" )
4242 rows.tmp <- rownames(tab )[order(tab [,p.col ])]
4343 object.tmp <- object [rows.tmp ,, drop = FALSE ]
44+ labrows.tmp <- labrows [rows.tmp ]
4445 if (only.contr.cols ){
4546 grps.tmp <- unlist(strsplit(contr , split = " (_|)vs(_|)" ))
4647 cols.tmp <- pheno.df %> % dplyr :: filter(!! rlang :: sym(grp.var ) %in% grps.tmp ) %> %
4748 rownames()
4849 if (length(cols.tmp ) == 0 ){
49- message(paste0(" only.contr.cols is true but no parts of " , contr , " matched pheno.df[" , grp.var , " , ]; so all columns plotted." ))
50+ message(paste0(" only.contr.cols is true but no parts of " , contr , " matched pheno.df[, " , grp.var , " ]; so all columns plotted." ))
5051 cols.tmp <- rownames(pheno.df )
5152 }
5253 # intersect appears to keep order of first input; labrows might be distinct from colnames(object), so shouldn't intersect
53- labcols <- labcols [match(cols.tmp , rownames(pheno.df ))]
54+ labcols.tmp <- labcols [match(cols.tmp , rownames(pheno.df ))]
5455 object.tmp <- object.tmp [, cols.tmp , drop = FALSE ]
55- pheno.df <- pheno.df [cols.tmp ,, drop = FALSE ]
56+ pheno.tmp <- pheno.df [cols.tmp ,, drop = FALSE ]
57+ } else {
58+ pheno.tmp <- pheno.df
59+ labcols.tmp <- labcols
5660 }
5761
58- labrows.tmp <- labrows [rows.tmp ]
59-
60- ret.lst [[contr ]] <- ezheat(object = object.tmp , labrows = labrows.tmp , pheno.df = pheno.df , main = main.tmp , sc = sc , clip = clip ,
62+ ret.lst [[contr ]] <- ezheat(object = object.tmp , labrows = labrows.tmp , pheno.df = pheno.tmp , main = main.tmp , sc = sc , clip = clip ,
6163 color.v = color.v , unique.rows = unique.rows , only.labrows = only.labrows , ntop = ntop ,
62- stat.tab = stat.tab , cutoff = cutoff , labcols = labcols , reorder_rows = reorder_rows ,
64+ stat.tab = stat.tab , cutoff = cutoff , labcols = labcols.tmp , reorder_rows = reorder_rows ,
6365 reorder_cols = reorder_cols , fontsize_row = fontsize_row , fontsize_col = fontsize_col ,
6466 na.lab = na.lab , plot = FALSE , verbose = verbose , name = NA )
6567 }
0 commit comments