Cannot able to find a particular column in R
0
0
Entering edit mode
3.6 years ago
xxxxxxxx ▴ 20

While importing data from a database(ArrayExpress) using this -

anno_AE <- getAE("accessionid", path = raw_data_dir, type = "raw")
sdrf_location <- file.path(raw_data_dir, "accessionid.sdrf.txt")
SDRF <- read.delim(sdrf_location, stringsAsFactors = FALSE)
rownames(SDRF) <- SDRF$Array.Data.File

After this-

SDRF <- AnnotatedDataFrame(SDRF)

Cannot able to find column 'Array.data.file' in SDRF

How to solve this issue?

dataframe r bioconductor microarray • 1.7k views
ADD COMMENT
0
Entering edit mode

can you post output from colnames(SDRF) here?

I am confused after finding similar question on https://stackoverflow.com/questions/67514240/gpr-txt-really-a-cel-file-error-in-read-celfile-headerx by xyzzz. This post has different input for rownames(SDRF) compared to here, but rest of the content is same.

in this post: rownames(SDRF) <- SDRF$Array.Data.File

In SO post; rownames(SDRF) <- make.unique(SDRF$Array.Data.File)

Please note that the volunteers here spend their time to address an issue and please respect their time.

ADD REPLY
0
Entering edit mode
colnames(SDRF) <- SDRF$Array.Data.File

Error in names(x) <- value : 'names' attribute [192] must be the same length as the vector [41]

ADD REPLY
0
Entering edit mode
SDRF <- read.delim(sdrf_location, stringsAsFactors = FALSE)
colnames(SDRF)

Please post the output from colnames(SDRF)

ADD REPLY
0
Entering edit mode
colnames(SDRF)



[1] "Source.Name"                                    
 [2] "Characteristics..Organism."                     
 [3] "Term.Source.REF"                                
 [4] "Term.Accession.Number"                          
 [5] "Characteristics..CellLine."                     
 [6] "Term.Source.REF.1"                              
 [7] "Term.Accession.Number.1"                        
 [8] "Characteristics..TargetedCellType."             
 [9] "Protocol.REF"                                   
[10] "Protocol.REF.1"                                 
[11] "Sample.Name"                                    
[12] "Protocol.REF.2"                                 
[13] "Parameter.Value..Amplification."                
[14] "Parameter.Value..Extracted.product."            
[15] "Protocol.REF.3"                                 
[16] "Extract.Name"                                   
[17] "Material.Type"                                  
[18] "Protocol.REF.4"                                 
[19] "Parameter.Value..Amplification..1"              
[20] "Parameter.Value..Label.used."                   
[21] "Labeled.Extract.Name"                           
[22] "Label"                                          
[23] "Material.Type.1"                                
[24] "Protocol.REF.5"                                 
[25] "Parameter.Value..Chamber.type."                 
[26] "Parameter.Value..Quantity.of.label.target.used."
[27] "Unit..MassUnit."                                
[28] "Parameter.Value..temperature."                  
[29] "Unit..TemperatureUnit."                         
[30] "Hybridization.Name"                             
[31] "Array.Design.REF"                               
[32] "Protocol.REF.6"                                 
[33] "Factor.Value..infect."                          
[34] "Factor.Value..time."                            
[35] "Unit..TimeUnit."                                
[36] "Scan.Name"                                      
[37] "Array.Data.File"                                
[38] "Comment..ArrayExpress.FTP.file."                
[39] "Protocol.REF.7"                                 
[40] "Derived.Array.Data.Matrix.File"                 
[41] "Comment..Derived.ArrayExpress.FTP.file."        
> 
ADD REPLY
1
Entering edit mode

Maybe check the spelling you have [37] "Array.Data.File", and it expects "Array.data.file"

ADD REPLY
0
Entering edit mode

when I am trying to write this -

raw_data <- oligo::read.celfiles(filenames = file.path(raw_data_dir, SDRF$

after $ when I click on tab it is not showing the colnames?

ADD REPLY
0
Entering edit mode

Thanks for posting the colnames output. can you post output from SDRF$Array.Data.File here? Btw, is there any reason why AnnotatedDataframe is built from only one dataframe unless you are supplying phenodata elsewhere? My understanding is that it is created from data frame and corresponding metadata. In addition open your accessionid.sdrf.txt and check the entries under Array.Data.File column. They must all be cel files. If you have checked the E-MTAB-2967.sdrf.txt mentioned in the tutorial you are following, you would find only cel files in that column.

ADD REPLY

Login before adding your answer.

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