mutually add a tab in the beggining of the header to make it a valid RMA format
1
1
Entering edit mode
9.4 years ago
zizigolu ★ 4.3k

Hello friends, please help me

i entered these codes, but whenever i use the output as input to geworkbench, it says that" could not parse line #1, line should have 12 columns but has 13 columns, which need manually add a tab at the beggining of the header to make it a valid RMA format"

library(affy)

> data <- ReadAffy()
> exp <- rma(data)

Background correcting
Normalizing
Calculating Expression
> control <- grep("AFFX",rownames(exp))
> exp <- exp[-control,]
> e <- exprs(exp)
> e <- apply(e,1,function(x) x-median(x))
> e.scaled <- t(scale(t(e),center=FALSE))
> write.exprs(exp, file="output.txt", sep="\t")

where i did wrong please??

R software error • 2.5k views
ADD COMMENT
2
Entering edit mode

Hi Sarah, just a point: you've applied changes to exp and saved it to a new variable e.scaled, so write.exprs(exp, ... ) will not reflect either centreing on the median or the scaling you've done. For your output file to reflect these changes, you will need to do something to the effect of:

write.table(e.scaled,file="scaled.output.txt",sep="\t")
ADD REPLY
0
Entering edit mode

sorry Alexander I did so but the result was a messy output file in which nothing is arranged while I need a tab-delimited text file in which the first column is probsets, header are arrays name and in between there are measures but with

write.table(e.scaled,file="scaled.output.txt",sep="\t")

a format was produced that can't be used as text anymore..

ADD REPLY
0
Entering edit mode

anyway thank you

ADD REPLY
2
Entering edit mode
9.4 years ago

Change:

write.exprs(exp, file="output.txt", sep="\t")

to:

write.exprs(exp, file="output.txt", sep="\t", row.names=FALSE)
ADD COMMENT
0
Entering edit mode

sorry Sean, when I did so it said that:

> write.exprs(exp, file="damn.txt", sep="\t", row.names=FALSE)
Error in write.table(exprs(x), file = file, quote = quote, sep = sep,  :
  'col.names = NA' makes no sense when 'row.names = FALSE'
>
ADD REPLY
0
Entering edit mode

hey Sarah, you should type:

write.exprs(exp, file="output.txt", quote = FALSE, sep="\t", row.names=TRUE)

after that you should open output file and write a column name for column one for example write ID because the column 1 would not have any header that I don't know the reason yet!

ADD REPLY
1
Entering edit mode

Because the first column is considered the column for row names, R does not include a column name for it.

ADD REPLY

Login before adding your answer.

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