[Bioc-devel] C function is wrong under Windows 7.
Evarist Planet
evarist.planet at irbbarcelona.org
Mon Oct 24 14:04:56 CEST 2011
Dear mailing list,
I have a C function that gives me a wrong result when I run it under Windows
7.
This is the code under Linux (RHEL5):
> library(phenoTest)
> data(epheno)
> sign <- sample(featureNames(epheno))[1:20]
> score <- getFc(epheno)[,1]
> head(score)
1007_s_at 1053_at 117_at 121_at 1255_g_at 1294_at
-1.183019 1.113544 1.186186 -1.034779 -1.044456 -1.023471
> s <- which(names(score) %in% sign)
> es.c <- .Call('getEs',score,s,PACKAGE='phenoTest')
> head(es.c)
[1] -0.001020408 -0.002040816 -0.003061224 -0.004081633 -0.005102041
[6] -0.006122449
> es.c <- .Call('getEs',score,s,PACKAGE='phenoTest')
> head(es.c)
[1] -0.001020408 -0.002040816 -0.003061224 -0.004081633 -0.005102041
[6] -0.006122449
As you see es.c is correct. I checked it doing the same computation with
R. It runs without problems under Mac. I run valgrind on the same piece of
code and got no errors.
This is the same piece of code under Windows 7:
> library(phenoTest)
> data(epheno)
> sign <- sample(featureNames(epheno))[1:20]
> score <- getFc(epheno)[,1]
> head(score)
1007_s_at 1053_at 117_at 121_at 1255_g_at 1294_at
-1.183019 1.113544 1.186186 -1.034779 -1.044456 -1.023471
> s <- which(names(score) %in% sign)
> es.c <- .Call('getEs',score,s,PACKAGE='phenoTest')
> head(es.c)
[1] 1.447208e+215 1.447208e+215 1.447208e+215 1.447208e+215 1.447208e+215
1.447208e+215
> es.c <- .Call('getEs',score,s,PACKAGE='phenoTest')
> head(es.c)
[1] 3.176615e+170 3.176615e+170 3.176615e+170 3.176615e+170 3.176615e+170
3.176615e+170
es.c is not correct under Windows. It also gives a different result when i
rerun the same function.
I attached the C code.
Could you please help me to find out what I am doing wrong?
Many thanks in advance,
--
Evarist Planet
Research officer, Bioinformatics and Biostatistics unit
IRB Barcelona
Tel (+34) 93 402 0553
Fax (+34) 93 402 0257
evarist.planet at irbbarcelona.org
http://www.irbbarcelona.org/bioinformatics
More information about the Bioc-devel
mailing list