[Bioc-devel] Bug in frmaTools
Ryan C. Thompson
rct at thompsonclan.org
Mon Jul 6 21:21:12 CEST 2015
Hello,
I just encountered a bug in frmaTools that makes it impossible to use on
certain array platforms. The following lines in makeVectorsAffyBatch
fail on an AffyBatch object on the hthgu133pluspm platform:
pms <- pm(object)
pns <- probeNames(object)
pmi <- unlist(pmindex(object))
if (!identical(as.character(pmi), rownames(pms)))
stop("Mismatch between pmindex and rownames of pms")
I isolated the problem to five probes:
> i <- which(as.character(pmi) != rownames(pms))
> pmi[i]
1564498_PM_at9 205398_PM_s_at8 217695_PM_x_at7 223446_PM_s_at7
237802_PM_at3
3e+05 5e+05 2e+05 1e+05 4e+05
> rownames(pms)[i]
[1] "300000" "500000" "200000" "100000" "400000"
> as.character(pmi)[i]
[1] "3e+05" "5e+05" "2e+05" "1e+05" "4e+05"
As you can see, the problem is that as.character will happily use
scientific notation when it feels like it, which then fails a test for
string equality. I believe the solution is to replace that test with:
all(sprintf("%i", pmi) == rownames(pms))
-Ryan
More information about the Bioc-devel
mailing list