Question: ChipSeq: merge bam file before peak calling
0
gravatar for Mike
14 months ago by
Mike880
UK
Mike880 wrote:

Hi all,

I have chipseq data for 6 samples (treatment/control), with replicate (so total 12 bam files). Now I am looking for peak calling using MACS2, I have doubt on handling replicates in macs2, so anyone please clear my doubt on handling replicates,

should I merge replicate before peak calling or analyse separately??

Thanks in advance.

chip-seq macs2 genome • 1.1k views
ADD COMMENTlink modified 14 months ago by Constantine150 • written 14 months ago by Mike880
3
gravatar for Devon Ryan
14 months ago by
Devon Ryan73k
Freiburg, Germany
Devon Ryan73k wrote:

I assume that your replicates are biological replicates. If they're technical then just merge the BAM files. Anyway, call peaks on each sample individually. You can then merge the peaks after filtering them and continue with whatever downstream processing is appropriate for your experiment.

ADD COMMENTlink written 14 months ago by Devon Ryan73k
1

Hi Devon,

You can then merge the peaks after filtering them

This is what I usually do but it opens up another can of worms about filtering peaks and defining a consensus set of peaks. One can call peaks at high stringency then get the union of all peaks, or lower stringency then accept peaks found in n out m files etc. (In practice I go for the solution the gives a consensus set that gives sensible results after some visual inspection with IGV).

ADD REPLYlink written 14 months ago by dariober8.2k

Thanks Devon,

my replicates are technical, so I should just merge the BAM files.

Is this command Ok?

samtools merge  WTCHG_112.bam WTCHG_223245_112.bam WTCHG_223246_112.bam
ADD REPLYlink written 14 months ago by Mike880
1

FWIW, you can provide multiple BAMs to macs2 and it'll merge them for you, avoiding the extra step and extra storage.

ADD REPLYlink written 14 months ago by Ryan Dale4.6k

Thanks Ryan, also looks good idea.

But how to use multiple files in macs2 command:

macs2 callpeak -t ChIP.bam -c Control.bam -f BAM -g hs -n test -B -q 0.01
ADD REPLYlink written 14 months ago by Mike880

Provide them as space-separated values. From macs2 callpeak -h:

Input files arguments:
  -t TFILE [TFILE ...], --treatment TFILE [TFILE ...]
                        ChIP-seq treatment file. If multiple files are given
                        as '-t A B C', then they will all be read and pooled
                        together. REQUIRED.
  -c [CFILE [CFILE ...]], --control [CFILE [CFILE ...]]
                        Control file. If multiple files are given as '-c A B
                        C', they will be pooled to estimate ChIP-seq
                        background noise.
ADD REPLYlink written 14 months ago by Ryan Dale4.6k

Yup, that should work :)

ADD REPLYlink written 14 months ago by Devon Ryan73k
1
gravatar for Constantine
14 months ago by
Constantine150
Germany
Constantine150 wrote:

You can use a peakcaller that accepts biological replicates

I personally use PePr and I'm really happy with it. It has really high sensitivity and works very well both for sharp and broad regions

ADD COMMENTlink written 14 months ago by Constantine150

Thanks Constantine,

looks good, I will try..

ADD REPLYlink written 14 months ago by Mike880

Hi , I am using PePr , using following command but I got errors, could you please help me, what is wrong?

python PePr.py -c Chip_R1.bam -i Input_R1.bam –n R1_sample1 –f bam --peaktype=sharp

error:

Traceback (most recent call last):
  File "PePr.py", line 57, in <module>
    try: main(sys.argv)
  File "PePr.py", line 25, in main
    parameter, readData = optParser.process_opt(opt)
  File "optParser.py", line 84, in process_opt
    parameter = Parameters(opt)
  File "classDef.py", line 124, in __init__
    self.process_command_line_option(opt)
  File "classDef.py", line 142, in process_command_line_option
    self.file_format = opt.file_format.lower()
AttributeError: 'NoneType' object has no attribute 'lower'
ADD REPLYlink written 14 months ago by Mike880
1

Sorry for the late reply

you need to parse replicates. For example

python PePr.py -c Chip_R1.bam,ChIP_R2.bam -i Input_R1.bam,Input_R2.bam –n R1_sample1 –f bam --peaktype=sharp

ADD REPLYlink written 14 months ago by Constantine150
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: 1665 users visited in the last hour