Error in R Script
1
0
Entering edit mode
8.6 years ago
786 ▴ 50

Hi I was performing my work on GSE71416 and got the following kind of error. Can anyone please pinpoint what does this error mean..

> rmaData = rma(gse71416preset) 

Background correcting
Normalizing
Calculating Expression
Warning message:
package ‘hgu133plus2cdf’ was built under R version 2.15.1 
> gse71416eset= exprs(rmaData) 
> groups = paste(pData(phenoData(gse71416dat[[1]]))$characteristics_ch1.1,pData(phenoData(gse71416dat[[1]]))$characteristics_ch1.2, sep=".")
> groups[groups=="Gene expression from OAT_obese and non-diabetic subjects"]="control"
> groups[groups=="Gene expression from OAT_obese and diabetic subjects"]="diabetic"
> f = factor(groups, levels=c("control","diabetic"))

Error:

> design_gse71416 = model.matrix(~0+f)
Warning message:
In is.na(rows) : is.na() applied to non-(list or vector) of type 'NULL'

It'll be very helpful if anyone can help me to remove the error..

R limma affy bioconductor • 2.6k views
ADD COMMENT
0
Entering edit mode
8.6 years ago

This is a warning, probably something is wrong. You may want to check whether your variable (f) is what you think it is.

ADD COMMENT
0
Entering edit mode

Thannx alot I've removed it out now again there is error can u help me correcting it please it'll be very helpful fr me...

> study1 = "GSE71416" 
> gse71416dat = getGEO('GSE71416') 
Found 1 file(s)
GSE71416_series_matrix.txt.gz
trying URL 'ftp://ftp.ncbi.nlm.nih.gov/pub/geo/DATA/SeriesMatrix/GSE71416/GSE71416_series_matrix.txt.gz'
ftp data connection made, file length 3862808 bytes
opened URL
downloaded 3.7 Mb

File stored at: 
C:\Users\NADAMU~1\AppData\Local\Temp\RtmpSMMQry/GPL570.soft
> gse71416raw= getGEOSuppFiles(study1) 
[1] "ftp://ftp.ncbi.nlm.nih.gov/pub/geo/DATA/supplementary/series/GSE71416/"
trying URL 'ftp://ftp.ncbi.nlm.nih.gov/pub/geo/DATA/supplementary/series/GSE71416//GSE71416_RAW.tar'
ftp data connection made, file length 92989440 bytes
opened URL
downloaded 88.7 Mb

trying URL 'ftp://ftp.ncbi.nlm.nih.gov/pub/geo/DATA/supplementary/series/GSE71416//filelist.txt'
ftp data connection made, file length 3638 bytes
opened URL
downloaded 3638 bytes

> tarfile <- grep("\\.tar$", rownames(gse71416raw), value = TRUE)
> untar(tarfile, exdir="study1")
> celFiles <- unlist(list.files("study1", pattern = "\\.CEL.gz", full.names = TRUE)) 
> gse71416preset = ReadAffy(filenames = celFiles)
> rmaData = rma(gse71416preset) 

Background correcting
Normalizing
Calculating Expression
Warning message:
package ‘hgu133plus2cdf’ was built under R version 2.15.1 
> gse71416eset= exprs(rmaData)
> groups = pData(phenoData(gse71416dat[[1]]))$source_name_ch1
> groups=as.character(groups) 
> groups[groups=="OAT_Obese and non-diabetic"]="control"
> groups[groups=="OAT_Obese and diabetic"]="diabetic"
> f = factor(groups, levels=c("control","diabetic")) 
> design_gse71416 = model.matrix(~0+f) 
> colnames(design_gse71416) = levels(f) 
> cont.matrix = makeContrasts(diabetic-control, levels=design_gse71416)



Error:
> fit = lmFit(gse71416eset, design_gse71416)
Coefficients not estimable: control diabetic 
Error in lm.fit(design, t(M)) : 0 (non-NA) cases
ADD REPLY
0
Entering edit mode

Could you print out the variables f and design_gse71416? To get an idea if everything is as it should be.

ADD REPLY
0
Entering edit mode

how can I print out variables f?Please let me know bcoz I'm naive in R.

ADD REPLY
0
Entering edit mode

You can just type

f

and press enter. Maybe it would be good to follow an introduction/tutorial in R, that would make the rest of your analysis less painful and easier to understand (e.g. http://swirlstats.com/)

ADD REPLY
0
Entering edit mode

after typing f I received this what does it mean please can u explain it...

> f
 [1] <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
[16] <NA> <NA> <NA> <NA> <NA>
Levels: control diabetic
ADD REPLY
0
Entering edit mode

Had to download some data to reproduce your problem, turns out the 'groups' are not what you think they are. Have a look at the groups variable after you do:

groups = pData(phenoData(gse71416dat[[1]]))$source_name_ch1

There is nothing like 'OAT_Obese and non-diabetic" or "OAT_Obese and diabetic".

I checked the variable 'pData(phenoData(gse71416dat[[1]]))' and what you need is:

groups = pData(phenoData(gse71416dat[[1]]))$title

Good luck, and I suggest to make yourself comfortable with R before proceeding.

ADD REPLY
0
Entering edit mode

Thank u fr your help I just changed the above command but getting the same error. Can u please help me out..

> groups = pData(phenoData(gse71416dat[[1]]))$title
> groups=as.character(groups)
> groups[groups=="OAT_Obese and diabetic"]="diabetic"
> groups[groups=="OAT_Obese and non-diabetic"]="nondiabetic"
> f = factor(groups, levels=c("nondiabetic","diabetic"))
> design_gse71416 = model.matrix(~0+f) 
> colnames(design_gse71416) = levels(f)
> cont.matrix = makeContrasts(diabetic-nondiabetic, levels=design_gse71416)

> fit = lmFit(gse71416eset, design_gse71416)
Coefficients not estimable: nondiabetic diabetic 
Error in lm.fit(design, t(M)) : 0 (non-NA) cases
> f
 [1] <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
[16] <NA> <NA> <NA> <NA> <NA>
Levels: nondiabetic diabetic
ADD REPLY
0
Entering edit mode

Check your variables if something goes wrong.

The titles look like this:

OAT_Obese and diabetic [OM032007]

OAT_Obese non-diabetic [Lot OM101707]

Therefore, groups[groups=="OAT_Obese and diabetic"]="diabetic" groups[groups=="OAT_Obese and non-diabetic"]="nondiabetic" don't work because that value is not present in groups

what you need is:

groups = pData(phenoData(gse71416dat[[1]]))$title
groups=as.character(groups)
groups <- sapply(groups, substr, 1, 22)
groups[groups=="OAT_Obese and diabetic"]="diabetic"
groups[groups=="OAT_Obese non-diabetic"]="nondiabetic"
f = factor(groups, levels=c("nondiabetic","diabetic"))

In addition, you wrote "and non-diabetic" which is incorrect.

ADD REPLY

Login before adding your answer.

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