Error in champ.load() function
1
0
Entering edit mode
Monalisa • 0
@b19066c8
Last seen 18 months ago
India

I was trying to analyse a breast cancer dataset GSE212370. I have made a pd file for that in the prescribed format of ChAMP document which contains column headers as follows (showing only first 3 rows of pd file):

Sample_Name Sample_Plate    Sample_Group    Pool_ID Project Sample_Well Array   Slide   Basename    Filename
NT1 NA  NormalTissue    NA  NA  NA  R03C01  201247470004    201247470004_R03C01 201247470004_R03C01
NT2 NA  NormalTissue    NA  NA  NA  R08C01  200861300050    200861300050_R08C01 200861300050_R08C01
NT3 NA  NormalTissue    NA  NA  NA  R03C01  200959030050    200959030050_R03C01 200959030050_R03C01

But when I run the following code in R studio, myload<-champ.load("C://Users//Monalisa//Downloads//GSE212370")

it gave me following error,

[<<<< ChAMP.IMPORT START >>>>>]
-----------------------------

[ Section 1: Read PD Files Start ]
  CSV Directory: C://Users//Monalisa//Downloads//GSE212370/GSE212370_pd_edited_new.csv
  Find CSV Success
  Reading CSV File
  Your pd file contains NO Array(Sentrix_Position) information.
  Your pd file contains NO Slide(Sentrix_ID) information.
Error in champ.import(directory, arraytype = arraytype) : 
    Error Match between pd file and Green Channel IDAT file.

Please tell me how to resolve this.

ChAMP • 942 views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 12 hours ago
United States

The error you are getting is from a test of the pd names you supplied and the ones that can actually be found. I should also note that the code you provide (using champ.load) is not correct, as you are actually using champ.import. Anyway, the test is this

files.I.can.find <- dir(".", recursive = TRUE, full.names = TRUE)
expected.files <- with(pd, paste(Slide, Array, sep = "_"))
files.that.match <- grep(expected.files, files.I.can.find, value = TRUE)
identical(expected.files, names(files.that.match))

And the files that match are not identical to the files that can be found. This could be due to a few missing files, or you might not have started R in the correct working directory. You will have to figure that part out for yourself.

ADD COMMENT
0
Entering edit mode

In R, I have set the working directory to "C://Users//Monalisa//Downloads//GSE212370". GSE212370 is the folder where I have all the IDAT files along with the pd file named "GSE212370_pd_test.csv". I have run your code in R as follows:

files.I.can.find <- dir(".", recursive = TRUE, full.names = TRUE)
expected.files <- with(GSE212370_pd_test, paste(Slide, Array, sep = ","))
files.that.match <- grep(expected.files, files.I.can.find, value = TRUE)
identical(expected.files, names(files.that.match))

It is giving me,

identical(expected.files, names(files.that.match))
[1] FALSE

What should I do now?

ADD REPLY
0
Entering edit mode

Two things. First, when you post code, please highlight and then click on the CODE button that is over the input window (or place triple-backticks before and after the code, where the backtick button is the top left key on a QWERTY keyboard). You can see if you have correctly done so by inspecting the preview window that appears right below the input window. If what you see in the preview window is not very legible, that's a cue that you should fix things.

Second, you just ran code to see if two things are identical and the result was FALSE. The next logical step is to look at the two and see what's different. Being able to self-diagnose problems is an invaluable skill if you are planning to use R or any Open Source software. The sooner you start cultivating that skill, the better off you will be.

ADD REPLY

Login before adding your answer.

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