Closed HeldLab closed 1 year ago
Dear HeldLab,
your issue might arise from the input data not undergoing any prior normalization. Usually, ComBat / limma - and therefore the HarmonizR algorithm - expect some kind of normalized data (for example using the log() function in R on the data prior).
Note: Since using the natural logarithm of zero turns to -inf in R, all zeroes must be turned to NA prior to this. Therefore, you do not have to set them to zero in the first place. The HarmonizR does expect NAs. Zeroes will not be treated as missing, but as a valid, measured expression of a numerical 0. This is due to there being a difference between technical and biological zeroes for example in single-cell RNA-seq data. I would have included the normalization steps in the HarmonizR already, but I can never be sure about the specific user input given :)
So basically, to fix the issue:
This is the plot I get when I applied the steps to your data: HeldLab.pdf
The plot Error occured, since HarmonizR tries to reverse a log-normalization on the data (just for the plotting!). So it calculated 2^dataframe for a dataframe with already high values, which led to inf values, which could not be plotted.
I hope I could help with the issue. If it persists, please feel free to contact me again!
Best regards
Simon
Thanks! Got everything working, and I'm very impressed with clustering/normalization. But, another question. What if I have metadata (rows) in the results I want to Harmonize (see attached, rows 2-6)? Is this dealwithable (I'm getting an error, pasted below)? I tend to work in python and then hop over to R for Harmonizer, and then hop back over to python. There are solutions to this problem, but I wanted to see if there were approaches to deal with metadata rows in Harmonizer more seamlessly.
Error: Error in read.table(data_source, sep = "\t", header = TRUE, row.names = 1, : duplicate 'row.names' are not allowed Traceback:
Unfortunately, there curretly is no functionality implemented to account for metadata. HarmonizR simply checks the rows for numerical value presence and treats them all as Features (proteins/genes/etc.). Other data types get casted to numeric if possible and turn to NaN elsewise.
(The error occurs, since the metadata row.names appear to be empty strings (as far as I saw). Usually all Protein/Gene entries differ in name or identifier (their row.names). Here, the underlying adjustment gets duplicate row.names.)
Best regards
Simon
Hi-
I'm new to harmonizR, but giving it a test. A question and a (perhaps) related issue. Thanks in advance! -Jason
1) I have LFQ data and have already imputed 0 for missing values prior to Harmonizer. Is that how you recommend handling data, or should I leave missing LFQ values empty?
2) When I run my data (imputed as above) through HarmonizR I'm getting this plotting error. I've attached my input files. Any thoughts?
[1] "Reading the files..." [1] "Preparing..." [1] "Splitting the data using ComBat adjustment..." Found 5 genes with uniform expression within a single batch (all zeros); these will not be adjusted for batch.
Found2batches
Adjusting for0covariate(s) or covariate level(s)
Found91935Missing Data Values
Standardizing Data across genes
Fitting L/S model and finding priors
Finding parametric adjustments
Adjusting the Data
[1] "Rebuilding..." [1] "Visualizing sample means..."
Warning message in min(x): “no non-missing arguments to min; returning Inf” Warning message in max(x): “no non-missing arguments to max; returning -Inf” Warning message in min(x): “no non-missing arguments to min; returning Inf” Warning message in max(x): “no non-missing arguments to max; returning -Inf”
Error in plot.window(xlim = xlim, ylim = ylim, log = log, yaxs = pars$yaxs): need finite 'ylim' values Traceback:
dfMerged.txt dfMerged_description.csv