[BioC] Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,

Henrik Bengtsson hb at stat.berkeley.edu
Tue Jan 22 03:52:27 CET 2008


On Jan 21, 2008 5:24 PM, Sally <sagoldes at shaw.ca> wrote:
> I am using limma and am trying to set up an ExpressionSet.  When I use the following script to read in a table  of expression data (17,329 rows x 29 columns, tab delimited):
>
> exprdata<-read.table("exprsData.txt", header=TRUE)

If it is a tab-delimited file, it is safer it you specify that
explicitly, i.e. use argument sep="\t".  The default recognizes any
white space, e.g. if you have a "feature" with a space in the name it
will not work.

>
> I get the following error message:
>
> Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,  :
>   line 304 did not have 29 elements
>
>
>
> I looked at line 304 and it looks fine.  All 29 columns have data.

Typically the error messages are useful, so treat it as if there
indeed is a problem on that line.  There might be empty spaces/tabs
etc at the end of that line.  See ?read.table for options.  See
especially arguments 'strip.white', 'fill', and 'comment.char'.

Also, try to read data from the first 303 rows using argument
nrow=303.  Do you get what you expect?

>
> I have also set options(expressions=400000)
>
> Have I reached some maximum # of expressions that can be read in, or is it another problem?  If I have reached a maximum #, is there a fix?

That option has nothing to do with gene expression data.  It deals
with syntactical R expression (think programming language).

/Henrik

>
>
> My exprsData.txt file looks like this (note this is not the whole spreadsheet)
>
>       Feature c0M1 c0M2 c0M3 c0M4
>       U179971 -4.7472 -4.43814 -4.3977 -2.97843
>       e1 -0.24565 -0.53124 0.109064 -0.01936
>       e2 -0.71906 0.035403 -0.16786 0.528748
>       e3 -0.17362 0.32998 -0.0791 -0.50046
>       e4 0.065989 0.003221 -0.30596 -0.42857
>       e5 0.269098 -0.34523 -0.98694 -0.57842
>       e6 0.038301 -0.09612 0.190023 -0.10283
>       e7 -0.06462 -0.56698 -0.34373 0.285194
>       e8 -1.10146 -0.06621 0.337491 -0.1891
>       CA054869 -0.83861 0.145514 -0.40484 -0.18785
>       CB490276 -0.71377 0.569419 -0.99984 -0.51384
>
>
> Thank you
>
> Sally Goldes
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
>



More information about the Bioconductor mailing list