0

I'm trying to load IDATs using the bioconductor methylumi package, with a script that has worked for previous files, but am coming across the below unfamiliar error when I use methylumIDAT

>mset450k <- methylumIDAT(sampleSheet$Basename, idatPath=idatPath)
0 HumanMethylation27 samples found
48 HumanMethylation450 samples found
Error in readBin(con, what = "integer", n = n, size = 4, endian = "little",  : 
   invalid 'n' argument

I'm unsure which n this is referring to, and how to resolve it. Searching for information on readBin arguments hasn't helped me understand it in this context.

The closest question I could find on here was this one about an audio file where the problem appears to be file size: Invalid 'n' argument error in readBin() when trying to load a large (4GB+ audio file)

I'm not using a larger data set then previous times - in fact, when I run the script with a different folder of idats (same number of files) and different sample sheet (same format) it works fine so I don't think file size is the issue here.

Below is the full script

> idatPath<-c("idats2")
> sampleSheet<-read.csv("CrestarSampleSheet2.csv", stringsAsFactors = FALSE)
> sampleSheet<-cbind(paste(sampleSheet$CHIP.ID, sampleSheet$CHIP.Location, 
                     sep = "_"), sampleSheet) 
> colnames(sampleSheet)[1]<-"Basename"
> mset450k <- methylumIDAT(sampleSheet$Basename, idatPath=idatPath)
Community
  • 1
  • 1

1 Answers1

0

I have since solved this. The problem was that one of the idat files in my folder had not been downloaded fully prior to loading (my computer crashed during downloading).

I figured out which one it was by loading files with individual file names (in large batches, then gradually smaller batches) e.g.

mset450k <- methylumIDAT(c("200397870043_R01C02", "200397870043_R02C02",      
                           "200397870043_R03C02", "200397870043_R03C01")
                            ,idatPath=idatPath)