You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please provide example datasets and the code you use. It will help me to understand your problem and help you!
I'm not sure what could be causing this issue since I am using a script that worked previously and the issue just developed. Basically, when I use ColorRamp2 to assign the colors to my gene expression values (cell_wall_genes) it doesn't seem to work correctly, so when I add the colors to the heatmap it causes an error.
Color assigning lines:
col = colorRamp2(c(-3, 0, 3), c("blue", "white", "red"))
cols1 <- brewer.pal(11, "Paired")
Short segment of dataset for reference:
Index,GeneID,Cell_wall_function,Notes,product_name,log2_FC,pvalue
7534,gene_7038,Other,,Fasciclin and related adhesion glycoproteins,5.164,0
10546,gene_9853,Chitin,,Chitin synthase-domain containing protein,-4.0,4.54E-10
Color assigning lines:
col = colorRamp2(c(-3, 0, 3), c("blue", "white", "red"))
cols1 <- brewer.pal(11, "Paired")
Short segment of dataset for reference:
Index,GeneID,Cell_wall_function,Notes,product_name,log2_FC,pvalue
7534,gene_7038,Other,,Fasciclin and related adhesion glycoproteins,5.164,0
10546,gene_9853,Chitin,,Chitin synthase-domain containing protein,-4.0,4.54E-10
Heatmap code:
log2FC2 <- as.matrix(subset(cell_wall_genes,select=c(Cell_wall_function,log2_FC)))
GeneID2 <- as.matrix(subset(cell_wall_genes,select=c(GeneID)))
rownames(log2FC2) = GeneID2
ht1 = Heatmap(log2FC2,Log2FC, name = "Expression",
row_order = sort(Cell_wall_function),
col = col,
row_km = 5,
show_row_names = TRUE,
show_column_names = FALSE)
draw(ht1, row_title = "Genes", column_title = "DEGs associated with cell wall remodeling (p<0.05)")
Error text comes up when I run the ht1= line:
Error in col2rgb(na_col, alpha = TRUE) :
numerical color values must be >= 0, found -4
The text was updated successfully, but these errors were encountered: