How do I load a peak file in ChIPseeker?
1
0
Entering edit mode
4.6 years ago

I am new to ChIPseq data analysis and am wondering how is the syntax for loading a bed file in R package chipseeker; so far I just used sample data provided with the package. For example, if I write:

peak <- readPeakFile("file.bed")

An error occurs since it cannot open the connection and find such file.

chipseeker • 5.1k views
ADD COMMENT
0
Entering edit mode

Thank you, but I already found that page. It's not clear to me how the five files are found and loaded in R.

ADD REPLY
0
Entering edit mode

From the docs, if you look at the code

files <- getSampleFiles()
print(files)

files is a named list object with paths ti bed file. So you need to create such an object with your files.

ADD REPLY
0
Entering edit mode

How do I create such path to my bed files? I just replaced the example files with my bed file in GEO_sample_data folder.

ADD REPLY
1
Entering edit mode

May be, by learning basics of R?

ADD REPLY
1
Entering edit mode

Maybe consider not providing a reply if sarcasm is the best you can manage.

ADD REPLY
1
Entering edit mode

It may not be very helpful, but it's not sarcasm.

ADD REPLY
0
Entering edit mode

That is such a condescending and unnecessary response, if you're not going to help at all.

ADD REPLY
2
Entering edit mode
4.5 years ago
mossysuffi ▴ 20

Here's why you're having trouble. The manual linked by venu is not a good write up at all. The author failed to mention that getSampleFiles is actually a command that comes with the ChIPSeeker package to load up sample files.

What you need to do is load up bed files of your called peaks (.narrowPeak output from MACS2 is a special type of BED), into R-compatible GRanges object.

Here's a thread where one answer recommends the use of the package rtracklayer for this purpose. Also read this blogpost for a more insight on how special types of BED files can be massaged to be rtracklayer-compatible.

Hope this helps.

ADD COMMENT
0
Entering edit mode

The author failed to mention that getSampleFiles is actually a command that comes with the ChIPSeeker package to load up sample files

Based on that function name, what would you expect it to be?

If you look at that manual, you can see that the next step is readPeakFile to read a BED file.

ADD REPLY
0
Entering edit mode

that's a good idea, actually. I used ChIPpeakAnno::toGRanges() function to just convert a pre-imported bed table to the GRanges object

ADD REPLY

Login before adding your answer.

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