limma: read.maimages possibility to warn the user?
2
0
Entering edit mode
@gordon-smyth
Last seen 48 minutes ago
WEHI, Melbourne, Australia
Dear Bjoern, >Date: Mon, 31 Jul 2006 12:43:00 +0200 >From: Bj?rn Usadel <usadel at="" mpimp-golm.mpg.de=""> >Subject: [BioC] limma: read.maimages possibility to warn the user? >To: bioconductor at stat.math.ethz.ch > >Dear list, > >when using read.maimages from limma with a "broken" file (tabs replaced >by ":", two extra tabs added at the end of row e) >limma reads the table fine > >table: >:R:G:RB:GB >a:1:2:0.5:0.5 >b:2:4:1:1 >c:3:6:1.5:1.5 >d:4:8:2:2 >e:5:10:2.5:2.5:: >f:6:12:3:3 >g:7:14:3.5:3.5 > >code: >RG<-read.maimages(files="test.txt", path="C://cpan//",columns=list(Gf="G", > Rf="R", > Gb="GB", > Rb="RB" > )) > >But I get NA values added in all columns thus changing the order of >probes in this particular arrayfile >$G > test >[1,] 2 >[2,] 4 >[3,] 6 >[4,] 8 >[5,] 10 >[6,] NA <- >[7,] 12 >[8,] 14 This unfortunate behaviour is due to (what I believe to be) a bug in the R function read.table. (I've sent a post to R-devel today to discuss it.) You can prevent it simply by adding the argument flush=TRUE to your read.maimages() call. This will result in the spurious delimiters at the of the end of the lines being ignored. Perhaps I will add flush=TRUE to the limma read by default. >Marray on the other hand, complains using the following syntax and >refuses to read in the offending file. >RG2<-read.marrayRaw(fnames="test.txt",path="C://cpan//", name.Gf="G", > name.Rf="R", > name.Gb="GB", > name.Rb="RB" > ) > >"Error in scan(file = file, what = what, sep = sep, quote = quote, dec = >dec, : line 5 did not have 5 elements" This is something of an accident. If there had been five extra tab characters at the end of the line instead of two, then marray would have done exactly the same as limma. The difference between the two packages is that limma is using fill=TRUE in the read while marray is not. This allows limma to read incomplete lines. Best wishes Gordon >Even though I appreciate, that limma reads the data fine without the >usual read.table hazzle and realize that the data should have been >checked before reading it in anyway, I think at least a little warning >could greatly help. >But maybe I missed something important (not being a two color type anyway)? > >(The broken files result from an MS Excel export and this happens on >R2.2 with limma 2.4.13 and on R 2.3.1 with limma 2.6.2) > > >Cheers, >Bj?rn > > >-- >-+-+-+-+-+-+-+-+-+-+-+- >Bj?rn Usadel, PhD > >Max Planck Institute of Molecular Plant Physiology >System Regulation Group > >Am M?hlenberg 1 >D-14476 Golm >Germany > >Tel (+49 331) 567-8114 > >Email usadel at mpimp-golm.mpg.de >WWW mapman.mpimp-golm.mpg.de
limma marray limma marray • 1.3k views
ADD COMMENT
0
Entering edit mode
Jay Shin ▴ 30
@jay-shin-1820
Last seen 9.6 years ago
An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/bioconductor/attachments/20060802/ a3d00a61/attachment.pl
ADD COMMENT
0
Entering edit mode
Hi, member[2] - member[3] is going to give an error os the binary operator "-" cannot operate on strings, > member[2] - member[3] Error in member[2] - member[3] : non-numeric argument to binary operator try, design <- diag(3)[rep(1:3, each=2),] colnames(design) <- member member <- LETTERS[1:3] difference <- paste(member[2],"-",member[3], sep="") makeContrasts(difference,levels=design) Marcus On 8/2/06 7:00 PM, "Jay Shin" <jay.shin at="" pharma.ethz.ch=""> wrote: > Hello, > I am trying to run a makeConstrasts() function to compute eBayes t- > test with the following design list (six hybridizations and three > samples -in duplicates): > A B C > 1 1 0 0 > 2 1 0 0 > 3 0 1 0 > 4 0 1 0 > 5 0 0 1 > 6 0 0 1 > > I would like to compare sample "B-C", so when I run: >> contrasts.matrix<-makeContrasts(B-C, levels=design) > it works great! > > However, I have B and C stored in 'member' (e.g. member[1] = B, member > [2] = C). > So, when I try to run: >> member1<-member[1] >> member2<-member[2] >> contrasts.matrix<-makeContrasts(member1-member2, levels=design) > > I get a following error message: > Error in eval(expr, envir, enclos) : object "member1" not found > > Can you please help me how I can directly compare the content of the > 'member' in makeContrasts() function? > Thank you, > Jay > > On Aug 2, 2006, at 4:40 AM, Gordon Smyth wrote: > >> Dear Bjoern, >> >>> Date: Mon, 31 Jul 2006 12:43:00 +0200 >>> From: Bj?rn Usadel <usadel at="" mpimp-golm.mpg.de=""> >>> Subject: [BioC] limma: read.maimages possibility to warn the user? >>> To: bioconductor at stat.math.ethz.ch >>> >>> Dear list, >>> >>> when using read.maimages from limma with a "broken" file (tabs >>> replaced >>> by ":", two extra tabs added at the end of row e) >>> limma reads the table fine >>> >>> table: >>> :R:G:RB:GB >>> a:1:2:0.5:0.5 >>> b:2:4:1:1 >>> c:3:6:1.5:1.5 >>> d:4:8:2:2 >>> e:5:10:2.5:2.5:: >>> f:6:12:3:3 >>> g:7:14:3.5:3.5 >>> >>> code: >>> RG<-read.maimages(files="test.txt", path="C://cpan//",columns=list >>> (Gf="G", >>> Rf="R", >>> Gb="GB", >>> Rb="RB" >>> )) >>> >>> But I get NA values added in all columns thus changing the order of >>> probes in this particular arrayfile >>> $G >>> test >>> [1,] 2 >>> [2,] 4 >>> [3,] 6 >>> [4,] 8 >>> [5,] 10 >>> [6,] NA <- >>> [7,] 12 >>> [8,] 14 >> >> This unfortunate behaviour is due to (what I believe to be) a bug in >> the R function read.table. (I've sent a post to R-devel today to >> discuss it.) You can prevent it simply by adding the argument >> flush=TRUE to your read.maimages() call. This will result in the >> spurious delimiters at the of the end of the lines being ignored. >> >> Perhaps I will add flush=TRUE to the limma read by default. >> >>> Marray on the other hand, complains using the following syntax and >>> refuses to read in the offending file. >>> RG2<-read.marrayRaw(fnames="test.txt",path="C://cpan//", name.Gf="G", >>> name.Rf="R", >>> name.Gb="GB", >>> name.Rb="RB" >>> ) >>> >>> "Error in scan(file = file, what = what, sep = sep, quote = quote, >>> dec = >>> dec, : line 5 did not have 5 elements" >> >> This is something of an accident. If there had been five extra tab >> characters at the end of the line instead of two, then marray would >> have done exactly the same as limma. The difference between the two >> packages is that limma is using fill=TRUE in the read while marray is >> not. This allows limma to read incomplete lines. >> >> Best wishes >> Gordon >> >>> Even though I appreciate, that limma reads the data fine without the >>> usual read.table hazzle and realize that the data should have been >>> checked before reading it in anyway, I think at least a little >>> warning >>> could greatly help. >>> But maybe I missed something important (not being a two color type >>> anyway)? >>> >>> (The broken files result from an MS Excel export and this happens on >>> R2.2 with limma 2.4.13 and on R 2.3.1 with limma 2.6.2) >>> >>> >>> Cheers, >>> Bj?rn >>> >>> >>> -- >>> -+-+-+-+-+-+-+-+-+-+-+- >>> Bj?rn Usadel, PhD >>> >>> Max Planck Institute of Molecular Plant Physiology >>> System Regulation Group >>> >>> Am M?hlenberg 1 >>> D-14476 Golm >>> Germany >>> >>> Tel (+49 331) 567-8114 >>> >>> Email usadel at mpimp-golm.mpg.de >>> WWW mapman.mpimp-golm.mpg.de >> >> _______________________________________________ >> 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 > > ________________________________________________________ > ETH Zurich > Jay W. Shin > Institute of Pharmaceutical Sciences > HCI H394 > Wolfgang-Paulistrasse 10 > 8093 Zurich, Switzerland > > jay.shin at pharma.ethz.ch > www.pharma.ethz.ch > > ++41 44 633 73 68 phone > ++41 44 633 13 64 fax > > > > [[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 ______________________________________________________ The contents of this e-mail are privileged and/or confidenti...{{dropped}}
ADD REPLY
0
Entering edit mode
An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/bioconductor/attachments/20060803/ 3e58a50c/attachment.pl
ADD REPLY
0
Entering edit mode
Björn Usadel ▴ 250
@bjorn-usadel-1492
Last seen 9.6 years ago
Dear Gordon, thanks for you reply. Using your fix flush =TRUE did the trick. Having it by default or adding a second warning in the help, would -at least for me- be good, since when reading a batch of arrays with one being broken can have some strange side-effects. Apart from that, for my own purposes I added a perl script to validate the files, before using. Kind regards, Bj?rn Gordon Smyth wrote: > Dear Bjoern, > >> Date: Mon, 31 Jul 2006 12:43:00 +0200 >> From: Bj?rn Usadel <usadel at="" mpimp-golm.mpg.de=""> >> Subject: [BioC] limma: read.maimages possibility to warn the user? >> To: bioconductor at stat.math.ethz.ch >> >> Dear list, >> >> when using read.maimages from limma with a "broken" file (tabs replaced >> by ":", two extra tabs added at the end of row e) >> limma reads the table fine >> >> table: >> :R:G:RB:GB >> a:1:2:0.5:0.5 >> b:2:4:1:1 >> c:3:6:1.5:1.5 >> d:4:8:2:2 >> e:5:10:2.5:2.5:: >> f:6:12:3:3 >> g:7:14:3.5:3.5 >> >> code: >> RG<-read.maimages(files="test.txt", >> path="C://cpan//",columns=list(Gf="G", >> Rf="R", >> Gb="GB", >> Rb="RB" >> )) >> >> But I get NA values added in all columns thus changing the order of >> probes in this particular arrayfile >> $G >> test >> [1,] 2 >> [2,] 4 >> [3,] 6 >> [4,] 8 >> [5,] 10 >> [6,] NA <- >> [7,] 12 >> [8,] 14 > > This unfortunate behaviour is due to (what I believe to be) a bug in the > R function read.table. (I've sent a post to R-devel today to discuss > it.) You can prevent it simply by adding the argument flush=TRUE to your > read.maimages() call. This will result in the spurious delimiters at the > of the end of the lines being ignored. > > Perhaps I will add flush=TRUE to the limma read by default. > >> Marray on the other hand, complains using the following syntax and >> refuses to read in the offending file. >> RG2<-read.marrayRaw(fnames="test.txt",path="C://cpan//", name.Gf="G", >> name.Rf="R", >> name.Gb="GB", >> name.Rb="RB" >> ) >> >> "Error in scan(file = file, what = what, sep = sep, quote = quote, dec = >> dec, : line 5 did not have 5 elements" > > This is something of an accident. If there had been five extra tab > characters at the end of the line instead of two, then marray would have > done exactly the same as limma. The difference between the two packages > is that limma is using fill=TRUE in the read while marray is not. This > allows limma to read incomplete lines. > > Best wishes > Gordon > >> Even though I appreciate, that limma reads the data fine without the >> usual read.table hazzle and realize that the data should have been >> checked before reading it in anyway, I think at least a little warning >> could greatly help. >> But maybe I missed something important (not being a two color type >> anyway)? >> >> (The broken files result from an MS Excel export and this happens on >> R2.2 with limma 2.4.13 and on R 2.3.1 with limma 2.6.2) >> >> >> Cheers, >> Bj?rn >> >> >> -- >> -+-+-+-+-+-+-+-+-+-+-+- >> Bj?rn Usadel, PhD >> >> Max Planck Institute of Molecular Plant Physiology >> System Regulation Group >> >> Am M?hlenberg 1 >> D-14476 Golm >> Germany >> >> Tel (+49 331) 567-8114 >> >> Email usadel at mpimp-golm.mpg.de >> WWW mapman.mpimp-golm.mpg.de > -- -+-+-+-+-+-+-+-+-+-+-+- Bj?rn Usadel, PhD Max Planck Institute of Molecular Plant Physiology System Regulation Group Am M?hlenberg 1 D-14476 Golm Germany Tel (+49 331) 567-8114 Email usadel at mpimp-golm.mpg.de WWW mapman.mpimp-golm.mpg.de
ADD COMMENT

Login before adding your answer.

Traffic: 941 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6