Error in reading my csv file in minfi
0
0
Entering edit mode
Ana • 0
@076356c4
Last seen 5 months ago
Canada

Hi there,

I am new to methylation analyses and have been trying to load and read my idat data and csv. Below you can see a sample of my csv

``` Basename, Sample_Name, Sample_Group, Sentrix_ID, Sentrix_Position 206693320037_R01C01, 3707, AVM, 206693320037, R01C01 206693320037_R02C01, 3781, AVM, 206693320037, R02C01 206693320037_R03C01, 3661, AVM, 206693320037, R03C01 206693320037_R04C01, 3669, AVM, 206693320037, R04C01 206693320037_R05C01, 3820, AVM, 206693320037, R05C01 206693320037_R06C01, 4112, AVM, 206693320037, R06C01 206693320037_R07C01, 4114, AVM, 206693320037, R07C01 206693320037_R08C01, 4115, AVM, 206693320037, R08C01

The code I ran is the following (based off some help with ChatGPT...):

```> idatFiles <- list.files(idatPath, pattern = '.idat", full.names = TRUE')

idatPath <- "/Users/anamansur/Desktop/epigenomics/idat"

idatFiles <- list.files(idatPath, pattern = '.idat", full.names = TRUE')

sampleSheetPath <- "/Users/anamansur/Desktop/epigenomics/SampleSheet.csv"

sampleSheet <- read.csv(sampleSheetPath, header = TRUE)

methylationData <- read.metharray.exp(base = idatPath, targets = sampleSheet)

The error I get is: Error in read.metharray.exp(base = idatPath, targets = sampleSheet) : Need 'Basename' amongst the column names of 'targets'

I checked and Basename is a column though. I tried trimming

colnames(sampleSheet) <- trimws(colnames(sampleSheet))

and printing: but Basename is already there...

print(colnames(sampleSheet)) [1] "Basename..Sample_Name..Sample_Group..Sentrix_ID..Sentrix_Position"

I don't know how to get around this issue to move forward with preprocessing. Any tips? Thank you

minfiDataEPIC minfi • 304 views
ADD COMMENT
0
Entering edit mode

The file is not imported correctly because you only have a single column. I do not have access to your .csv file but it is possible read.csv(sampleSheetPath,header=T,sep=',') would work

ADD REPLY

Login before adding your answer.

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