yiluyucheng / dnaMethyAge

Predict epigenetic age from DNA methylation data
40 stars 11 forks source link

Error in plot.window() and beta value input #11

Open vylyny opened 6 months ago

vylyny commented 6 months ago

Hi, Thank you for creating this great and user-friendly package for DNAm age! I have two questions:

  1. I am running into an issue when running this code for PCGrimAge: PCGrim=methyAge(beta_raw, clock="PCGrimAge",age_info = info,fit_method='Linear', do_plot=TRUE) Error in plot.window(...) : need finite 'ylim' values

Is there a way I can fix this? I also noticed if I subset my data to only about 10 samples, the code seems to work. Currently I have about 1000 samples.

  1. If I understand correctly, the package asks for raw beta values (without any normalization). Is this correct? Is there any internal normalization step performed downstream (Except for the for the HorvathS2013 clock and ZhangQ2019)?
yiluyucheng commented 6 months ago

Thanks for your feedback!

  1. The issue seems to have arisen during plotting, there may be some problems with some of your input samples, please try the following code to identify which samples have weird mAge predictions: PCGrim=methyAge(beta_raw, clock="PCGrimAge",age_info = info,fit_method='Linear', do_plot=FALSE)
  2. There is no recommended normalization step, my advice is to use the same normalization method if you want to compare mAge prediction between clocks.
vylyny commented 6 months ago

Hi, Thanks so much for your help! I tried do_plot=FALSE and got a different kind of error: _Error in $<-.data.frame(*tmp*, "AgeAcceleration", value = c(1 = -2.06246174972107, : replacement has 1027 rows, data has 1039

I double checked and both the "beta_raw" and "info" data frames have 1,039 observations. The same code worked for other clock (eg Hannum), either with do_plot=TRUE or FALSE...

yiluyucheng commented 6 months ago

If you do not mind, please send me a subset of your input data so I can do better troubleshooting.

wangyucheng511@gmail.com

vylyny commented 6 months ago

Turned out there were some NA values in the CpG sites. It is working now after dropping NA. Thank you!