Question: Converting narrowPeak to bed
2
gravatar for Spacebio
3.2 years ago by
Spacebio180
Spacebio180 wrote:

Hi all,

I am trying to convert a regular narrowPeak file into a BED file for use with diffBind... any ideas?

Thanks.

narrowpeak bed • 5.1k views
ADD COMMENTlink modified 5 months ago by deepak.tyagi23260 • written 3.2 years ago by Spacebio180

I know this is an old ticket however I am not able to create a DBA object with a narrowPeak file as it complains about the first line in the narrow peak file not having 10 columns which is true because it has a header like this:

track type=narrowPeak visibility=3 db=hg19 name="nPk" description="ENCODE narrowPeak Example"
browser position chr1:9356000-9365000
chr1    9356548 9356648 .       0       .       182     5.0945  -1  50
chr1    9358722 9358822 .       0       .       91      4.6052  -1  40
chr1    9361082 9361182 .       0       .       182     9.2103  -1  75

Only after removing the header, I was able to load it. Is this okay or something is off about my peak calling? Here's the code snippet

allsamples <- read.csv('meta/allsamples.csv')
gpparestTestbeta <- dba(sampleSheet=allsamples)
ADD REPLYlink modified 5 months ago by _r_am30k • written 5 months ago by deepak.tyagi23260

Please do not add an answer unless you're answering the top level question. You have a related question, which is best posted as either a comment on the top level question or as a new question referencing the existing question.

Also, please use the formatting bar (especially the code option) to present your post better. You can use backticks for inline code (`text` becomes text), or select a chunk of text and use the highlighted button to format it as a code block. I've done it for you this time.
code_formatting

ADD REPLYlink written 5 months ago by _r_am30k
2
gravatar for h.mon
3.2 years ago by
h.mon31k
Brazil
h.mon31k wrote:

Do you really need to convert? narrowPeak already is in bed 6+4 format, see here, here and here.

edit: in case DiffBind if very strict, use this solution:

cut -f 1-6 macs_output.narrowPeak > macs_output.bed
ADD COMMENTlink modified 3.2 years ago • written 3.2 years ago by h.mon31k

I tried but it is not working, any other suggestion? Thanks for your help!

ADD REPLYlink written 3.2 years ago by Spacebio180

Yes, describe how it is not working. What have you been trying? Errors you got?

ADD REPLYlink written 3.2 years ago by h.mon31k

the sample sheet is the more likely problem....the narrowPeak file doesnt need any editing.

ADD REPLYlink written 3.2 years ago by YaGalbi1.5k

But then how can I obtain the count matrix? For that reason I wanted to convert the narrowPeak to bed because i already established the pipeline in that way. Any suggestion is very appreciated.

ADD REPLYlink written 3.2 years ago by Spacebio180
2
gravatar for Rory Stark
3.2 years ago by
Rory Stark880
University of Cambridge, Cancer Research UK - Cambridge Institute
Rory Stark880 wrote:

DiffBind supports narrowPeak format directly, Just specify "narrow" as the value for PeakCaller in your samplesheet.

-Rory

ADD COMMENTlink written 3.2 years ago by Rory Stark880

I have the narrowPeak files, I want to extract the counts to use the matrix with DESeq or EdgeR. That is why I was trying to convert the narrowPeak files into bed files. Any suggestion?

ADD REPLYlink modified 3.2 years ago • written 3.2 years ago by Spacebio180
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1062 users visited in the last hour