On Tue, Feb 17, 2009 at 6:57 PM, Sally <sagoldes@shaw.ca> wrote:

> Hello,
>
> I am using Limma for microarray analysis.  Ultimately I want to
> add/combine/append (not sure what word is correct) a file named MGL.txt
> (mastergene list) to fit2 so that when topTable prints it will have the
> annotation information for each gene.  The first few lines of MGL.txt looks
> like this (there are blank cells/missing data).  There are 17,328 rows and 6
> columns in this file.
>
>    well accession bitscore evalue symbol
>     U179971039 GFP
>     empty1 Blank Well
>     empty2 Blank Well
>     empty3 Blank Well
>     empty4 Blank Well
>     empty5 Blank Well
>     empty6 Blank Well
>     empty7 Blank Well
>     empty8 Blank Well
>     CA054869 UNKNOWN
>     CB490276 G2/mitotic-specific cyclin-B2 Q60FX9 524.24 3.58E-148 ccnb2
>     CA769480 Endothelial differentiation-related factor 1 homolog Q6PBY3
> 214.16 8.45E-55 edf1
>
>
>
> MGL.txt was read in with:
>
> MGLnew<-read.table(file="MGL.txt",sep="\t",header=TRUE,na.strings="",fill=TRUE,row.names=1)
> When MGLnew is printed on screen it looks like this (first few lines)
>
>             accession bitscore    evalue      symbol
> U179971039         <NA>       NA        NA        <NA>
> empty1             <NA>       NA        NA        <NA>
> empty2             <NA>       NA        NA        <NA>
> empty3             <NA>       NA        NA        <NA>
> empty4             <NA>       NA        NA        <NA>
> empty5             <NA>       NA        NA        <NA>
> empty6             <NA>       NA        NA        <NA>
> empty7             <NA>       NA        NA        <NA>
> empty8             <NA>       NA        NA        <NA>
> CA054869           <NA>       NA        NA        <NA>
> CB490276         Q60FX9   524.24 3.58e-148       ccnb2
> CA769480         Q6PBY3   214.16  8.45e-55        edf1
>
>
> When I then check the # of rows using nrow(MGLnew) it says there are 3312
> rows, even though the original file had 17,328 rows.
> Also it doesn't include the column "well" in MGLnew.
>
>
> Why are these two things happening?
>

It looks like you might want to set row.names=FALSE.  Does that fix the
column name problem?

As for the other, try setting quote="",comment.char="" and see if that helps
in the read.table.  Sometimes, a character in the file ends up causing R to
parse the line in a manner that you didn't expect.

Sean



>
>
>
>
> ----- Original Message ----- From: "john seers (IFR)" <
> john.seers@bbsrc.ac.uk>
> To: "Sally" <sagoldes@shaw.ca>; <bioconductor@stat.math.ethz.ch>
> Sent: Tuesday, February 17, 2009 8:35 AM
> Subject: RE: [BioC] Adding annotations to fit2
>
>
>
>
> Hi Sally
>
> Is fit2 by any chance the output from limma fitting a linear model? If
> not this is not relevant.
>
> If it is so I think you may be able to do something like
>
> fit2$genes<-cbind(fit2$genes, MGLnew)
>
> If that does not work, if you are using topTable a bit later, you can do
> something like this:
>
>      tt<-topTable(eb, number=ngenes, genelist=cbind(eb$genes, MGLnew))
>
>
>      Regards
>      John
>
>
> ---
>
> -----Original Message-----
> From: bioconductor-bounces@stat.math.ethz.ch
> [mailto:bioconductor-bounces@stat.math.ethz.ch] On Behalf Of Sally
> Sent: 17 February 2009 03:35
> To: bioconductor@stat.math.ethz.ch
> Cc: Sally
> Subject: [BioC] Adding annotations to fit2
>
> I want merge fit2 with a txt file I'll call MGL (mastergenelist) which
> contains gene id information.  I am using a custom cDNA array.  The
> reason is that I want the gene ID information along-side the rownames
> (which are the accession IDs).  Both have identical row names.  MGL has
> missing data.
>
> I have tried:
>
> MGLnew<-read.table(file="MGL.txt",sep="\t",header=TRUE,na.strings="",fil
> l=TRUE)  #WORKS
> write.table(MGLnew,file="MGLnew.txt",sep="\t") #WORKS
> fit2<-merge(fit2,MGLnew,by="row.names")  #NOT WORKING
>
> When I run this I get the following error message:
>
> Error in dim(data) <- dim : attempt to set an attribute on NULL
>
> What does this error message mean?  How do I fix the problem?
>
> Sally Goldes
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor@stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor@stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor
>

	[[alternative HTML version deleted]]

