macs3-project / MACS

MACS -- Model-based Analysis of ChIP-Seq
https://macs3-project.github.io/MACS/
BSD 3-Clause "New" or "Revised" License
710 stars 268 forks source link

Problem when using --trackline argument when control file absent #51

Closed adeschen closed 10 years ago

adeschen commented 10 years ago

When macs2 is used without a control file and with the --trackline argument, the application crashes at the call peaks step (#3 step).

Version: macs2 2.1.0.20140616 (installed using python package)

Operating system: CentOS 6

Reproduce steps: Use this command line with a valid BAM file

macs2 callpeak -t VALID_BAM_FILE.bam  -f BAM --gsize 3.3e9 -q 0.01 -n output_file  --trackline -B --SPMR 

Output example:

[user@ls32]$ macs2 callpeak -t HI.1943.008.Index_14.LCC9_CTRL_MED1_ChIP8_GB_rep1.bam  -f BAM --gsize 3.3e9 -q 0.01 -n output_file  --trackline -B --SPMR
INFO  @ Fri, 15 Aug 2014 10:49:25: 
# Command line: callpeak -t HI.1943.008.Index_14.LCC9_CTRL_MED1_ChIP8_GB_rep1.bam -f BAM --gsize 3.3e9 -q 0.01 -n output_file --trackline -B --SPMR
# ARGUMENTS LIST:
# name = output_file
# format = BAM
# ChIP-seq file = ['HI.1943.008.Index_14.LCC9_CTRL_MED1_ChIP8_GB_rep1.bam']
# control file = None
# effective genome size = 3.30e+09
# band width = 300
# model fold = [5, 50]
# qvalue cutoff = 1.00e-02
# Larger dataset will be scaled towards smaller dataset.
# Range for calculating regional lambda is: 10000 bps
# Broad region calling is off
# MACS will save fragment pileup signal per million reads
INFO  @ Fri, 15 Aug 2014 10:49:25: #1 read tag files... 
INFO  @ Fri, 15 Aug 2014 10:49:25: #1 read treatment tags... 
INFO  @ Fri, 15 Aug 2014 10:49:30:  1000000 
... 
INFO  @ Fri, 15 Aug 2014 10:51:12:  25000000 
INFO  @ Fri, 15 Aug 2014 10:51:13: #1 tag size is determined as 50 bps 
INFO  @ Fri, 15 Aug 2014 10:51:13: #1 tag size = 50 
INFO  @ Fri, 15 Aug 2014 10:51:13: #1  total tags in treatment: 22592117 
INFO  @ Fri, 15 Aug 2014 10:51:13: #1 user defined the maximum tags... 
INFO  @ Fri, 15 Aug 2014 10:51:13: #1 filter out redundant tags at the same location and the same strand by allowing at most 1 tag(s) 
INFO  @ Fri, 15 Aug 2014 10:51:16: #1  tags after filtering in treatment: 21510983 
INFO  @ Fri, 15 Aug 2014 10:51:16: #1  Redundant rate of treatment: 0.05 
INFO  @ Fri, 15 Aug 2014 10:51:16: #1 finished! 
INFO  @ Fri, 15 Aug 2014 10:51:16: #2 Build Peak Model... 
INFO  @ Fri, 15 Aug 2014 10:51:24: #2 number of paired peaks: 37367 
INFO  @ Fri, 15 Aug 2014 10:51:24: start model_add_line... 
INFO  @ Fri, 15 Aug 2014 10:51:52: start X-correlation... 
INFO  @ Fri, 15 Aug 2014 10:51:52: end of X-cor 
INFO  @ Fri, 15 Aug 2014 10:51:52: #2 finished! 
INFO  @ Fri, 15 Aug 2014 10:51:52: #2 predicted fragment length is 165 bps 
INFO  @ Fri, 15 Aug 2014 10:51:52: #2 alternative fragment length(s) may be 165 bps 
INFO  @ Fri, 15 Aug 2014 10:51:52: #2.2 Generate R script for model : output_file_model.r 
INFO  @ Fri, 15 Aug 2014 10:51:52: #3 Call peaks... 
Traceback (most recent call last):
  File "/lustredirect/commonSoftware/python/python-2.7.8/bin/macs2", line 559, in <module>
    main()
  File "/lustredirect/commonSoftware/python/python-2.7.8/bin/macs2", line 56, in main
    run( args )
  File "/lustredirect/commonSoftware/python/python-2.7.8/lib/python2.7/site-packages/MACS2/callpeak.py", line 261, in run
    peakdetect.call_peaks()
  File "cPeakDetect.pyx", line 110, in MACS2.cPeakDetect.PeakDetect.call_peaks (MACS2/cPeakDetect.c:1714)
  File "cPeakDetect.pyx", line 334, in MACS2.cPeakDetect.PeakDetect.__call_peaks_wo_control (MACS2/cPeakDetect.c:3939)
AttributeError: 'NoneType' object has no attribute 'enable_trackline'
taoliu commented 10 years ago

Fixed in 8b2ad81. Thanks!