NA/NaN/Inf in foreign function call (arg 4)
hvalim opened this issue · comments
Hi there,
I am working on time series data (Illumina raw reads quantified using Salmon) and ran into the following error:
Error in dynGENIE3(TS.data2, time.points2) :
NA/NaN/Inf in foreign function call (arg 4)
I initially suspected this was related to a large number of zeros in my dataset, but this problem persists even when I remove all rows containing zeros from the analysis. If you have some input into this problem, I would greatly appreciate it!
Hi,
Have you checked that your data does not contain any NaNs?
Also, as your are using alpha="from.data"
(which is the default), you can check issue #6.
Hi, thank you for the reply! I have checked my data but not found any NaNs.
I am using the default alpha="from.data"
and have followed the advice in issue #6. However, setting alpha as a fixed value seems to spit out the same error as above NA/NaN/Inf in foreign function call (arg 4)
.
I have tried running alphas <- estimate.decay.rates(TS.data, time.points)
but even with the test data, I get the following error message:
Error in current.timeseries[, target.gene.name] : subscript out of bounds
I am getting the same error as @hvalim.
Error in { :
task 264 failed - "NA/NaN/Inf in foreign function call (arg 4)"
I am running this with 32 cores, and i am aware that the message with "task 264" is probably from Foreach package when one of the forked tasks fails. Since each task is probably fitting a model for one gene, I checked the 264th gene in my input data. Here is what I see:
> ts1[264,]
DRT_63 DRT_70 DRT_77 DRT_84 DRT_91 DRT_98 DRT_105 DRT_112 DRT_119
0 0 0 0 0 0 0 0 0
So clearly this gene has all zeros and is possibly causing problems. However, the reason I have not removed it because I have a second time series in which this 264th gene is NOT all zeros. When I run these together using TS.data = list(ts1, ts2) in the function call, I get the exact same error with task 264.
Do I need to remove any gene that has all zeros in one of the timeseries?
Hi @dkainer ,
The error arises because, when estimating the gene decay rate from the data, I assume that there is an exponential decay between the highest and lowest expression values of the gene. Since gene 264 has only zero values in one time series, the function estimating the decay rates will return a NaN for that time series.
I modified the function estimating the decay rates, so that it can handle genes having constant values. Let me know if it works, now!
@hvalim , I hope it will solve the problem for you too.