This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to normalize data for heat

I was given the task of generating a heatmap with a dataset but as I entered data into R, it told me I cannot have repeating rows (which would be in my case the genes that are expressed). Does anyone know how I can normalize that data? Thanks

expression-data dataset r heatmap

1 answer

Reproducible example?
If it just the rownames, make them unique.

Ex: rownames(data)=paste(rep("Row",nrow(data))) or check make.unique function

I tried that make.unique function:

make.unique("Gene.Symbol", sep=",")
[1] "Gene.Symbol"

Followed by:

 row.names(PDR) <- PDR$Gene.Symbol
Error in `row.names<-.data.frame`(`*tmp*`, value = c(1L, 1L, 1L, 1L, 1L,  : 
  duplicate 'row.names' are not allowed
In addition: Warning message:
non-unique values when setting 'row.names': 'BCL11A', 'BCL2', 'CCL5', 'CCR2', 'EED', 'EZH2',

But this error came up. Trying to have the Gene Symbols appear on the Y axis of the heatmap instead of the numbers. Thanks.

Input to make.unique is a variable containing the names, not a single character value.

make.unique(PDR$Gene.Symbol, sep=",")

Log in to answer this question.