Generating ExpressionSet Objects
1
1
Entering edit mode
rrcutler ▴ 70
@rrcutler-10667
Last seen 4.7 years ago

Hello all. I am trying to generate an ExpressionSet object using the ExpressionSet package. In the package it describes how to create an ExpressionSet object from a tab-delimited text file using the following commands. Manual Here

> dataDirectory <- system.file("extdata", package="Biobase") 
> exprsFile <- file.path(dataDirectory, "exprsData.txt") 
> exprs <- as.matrix(read.table(exprsFile, header=TRUE, sep="\t", + row.names=1, + as.is=TRUE))

When checking the head of the exprs object, I should get something that looks like this:

                  A         B        C       D        E 
AFFX-MurIL2_at 192.7420 85.75330 176.7570 135.5750 64.49390 
AFFX-MurIL10_at 97.1370 126.19600 77.9216 93.3713 24.39860 
AFFX-MurIL4_at 45.8192 8.83135 33.0632 28.7072 5.94492

Instead I am getting something that look like this, with my column names not lining up as above and the row names repeated:

                                                                              Control_1

42SP43|c.Taira201203kidney_X008044|JGIv7b.000075417_5391788-5397899+__chr9_10L        13

42SP50|c.XenBase_133737005|JGIv7b.000220448_3999398-4005758+__chr6L                   77

A1CF|c.Taira201203intestine_X005935|JGIv7b.000079772_4581973-4609884+__chr7L          60

A2LD1|c.Audic201207_X036188|JGIv7b.000115919_814037-825145-__chr2L                   533

A2M|c.Ueno201210st10_X000172|JGIv7b.000007045_3704835-3735363+__chr7S              74531

A4GNT|c.JGIL6RMv1_XeXenL6RMv10019937m|JGIv7b.000086205_247294-258571+__chr8L           0

                                                                               Control_2

42SP43|c.Taira201203kidney_X008044|JGIv7b.000075417_5391788-5397899+__chr9_10L        22

42SP50|c.XenBase_133737005|JGIv7b.000220448_3999398-4005758+__chr6L                   65

A1CF|c.Taira201203intestine_X005935|JGIv7b.000079772_4581973-4609884+__chr7L          97

A2LD1|c.Audic201207_X036188|JGIv7b.000115919_814037-825145-__chr2L                   683

A2M|c.Ueno201210st10_X000172|JGIv7b.000007045_3704835-3735363+__chr7S              78734

A4GNT|c.JGIL6RMv1_XeXenL6RMv10019937m|JGIv7b.000086205_247294-258571+__chr8L           0

I have been messing around with the read.table parameters, with no luck. It should also be noted that my input file looks exactly like the first table that I showed here. 

 
r expressionset subseq rnaseq • 1.2k views
ADD COMMENT
0
Entering edit mode
@martin-morgan-1513
Last seen 3 months ago
United States

This looks like R printing a matrix with very wide row labels, rather than an error -- it prints the row label and column(s) that fit in the width of the display, then prints the row labels and the next column(s) that fit in the display. If the row labels are meaningful in their long form, you should leave them as they are. Otherwise, you could trim them

splt = strsplit(rownames(exprs), "|", fixed=TRUE) 
rownames(exprs) = sapply(splt, "[", 1)

Here's an example where I adjust the width of R's notion of the display so that it triggers the behavior

> m = matrix(0, 5, 10, dimnames=list(letters[1:5], LETTERS[1:10]))
> m
  A B C D E F G H I J
a 0 0 0 0 0 0 0 0 0 0
b 0 0 0 0 0 0 0 0 0 0
c 0 0 0 0 0 0 0 0 0 0
d 0 0 0 0 0 0 0 0 0 0
e 0 0 0 0 0 0 0 0 0 0
> options(width=15)
> m
  A B C D E F
a 0 0 0 0 0 0
b 0 0 0 0 0 0
c 0 0 0 0 0 0
d 0 0 0 0 0 0
e 0 0 0 0 0 0
  G H I J
a 0 0 0 0
b 0 0 0 0
c 0 0 0 0
d 0 0 0 0
e 0 0 0 0

 

 

ADD COMMENT

Login before adding your answer.

Traffic: 584 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