shao-lab / MAnorm

A robust model for quantitative comparison of ChIP-Seq data sets.
http://manorm.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
21 stars 6 forks source link

0 peaks are loaded #2

Closed chiefcat closed 6 years ago

chiefcat commented 6 years ago

Dear Developer,

I'am facing error when using the python version of MAnorm. I'm using 3-columns bed files for peaks input since the peaks are broad peaks called by MACS2, no summit coordinates can be obtained.

Error message:

/Users/kylie_coding/miniconda3/envs/MAnorm_env/lib/python2.7/site-packages/statsmodels/compat/pandas.py:56: FutureWarning: The pandas.core.datetools module is deprecated and will be removed in a future version. Please use the pandas.tseries module instead.
  from pandas.core import datetools
INFO     02/02/2018 11:56: # MAnorm Arguments:
INFO     02/02/2018 11:56: # Name of sample1 = T1-D0-J2b_vs_D0_I
INFO     02/02/2018 11:56: # Name of sample2 = T1-D2-J2b_vs_D2_I
INFO     02/02/2018 11:56: # Peaks file of sample1 = T1-D0-J2b_vs_D0_I_peaks_merged.bed
INFO     02/02/2018 11:56: # Peaks file of sample2 = T1-D2-J2b_vs_D2_I_peaks_merged.bed
INFO     02/02/2018 11:56: # Reads file of sample1 = T1-D0-J2b.dup.removed.sort.bam.bed
INFO     02/02/2018 11:56: # Reads file of sample2 = T1-D2-J2b.dup.removed.sort.bam.bed
INFO     02/02/2018 11:56: # Reads shift size of sample1 = 71
INFO     02/02/2018 11:56: # Reads shift size of sample2 = 71
INFO     02/02/2018 11:56: # Peak width to extend from summit = 1000
INFO     02/02/2018 11:56: # Summit-to-summit distance cutoff = 500
INFO     02/02/2018 11:56: # Output directory = /Volumes/SharedFolders/AllFiles/Users/kyliehm/Documents/Study/MPhil/HKU/Reserach_project/NGS/ChIP-seq./Data_analysis/Called_peak/MAnorm/Replicate_unpolled/diff_D0-J2b_vs_D2-J2b/
INFO     02/02/2018 11:56: Step1: Loading input data
INFO     02/02/2018 11:56: 0 peaks are loaded from T1-D0-J2b_vs_D0_I_peaks_merged.bed
INFO     02/02/2018 11:56: 0 peaks are loaded from T1-D2-J2b_vs_D2_I_peaks_merged.bed
INFO     02/02/2018 11:59: 57252590 reads are loaded from T1-D0-J2b.dup.removed.sort.bam.bed
INFO     02/02/2018 12:01: 38587656 reads are loaded from T1-D2-J2b.dup.removed.sort.bam.bed
INFO     02/02/2018 12:01: Step2: Classifying peaks by overlap
INFO     02/02/2018 12:01: T1-D0-J2b_vs_D0_I: 0(unique) 0(common)
INFO     02/02/2018 12:01: T1-D2-J2b_vs_D2_I: 0(unique) 0(common)
INFO     02/02/2018 12:01: Merged common peaks: 0
INFO     02/02/2018 12:01: Step3: Performing overlap enrichment test
INFO     02/02/2018 12:01: Overlapping peaks in random simulation: mean:1.0 std:0.0
INFO     02/02/2018 12:01: Fold Change: 0.0
INFO     02/02/2018 12:01: Step4: Calculating the read densities
INFO     02/02/2018 12:01: Step5: Fitting normalization model
Traceback (most recent call last):
  File "/Users/kylie_coding/miniconda3/envs/MAnorm_env/bin/manorm", line 6, in <module>
    sys.exit(manorm.cmdline.main())
  File "/Users/kylie_coding/miniconda3/envs/MAnorm_env/lib/python2.7/site-packages/manorm/cmdline.py", line 95, in main
    full_output=full_output, name1=name1, name2=name2, output_name=output_name)
  File "/Users/kylie_coding/miniconda3/envs/MAnorm_env/lib/python2.7/site-packages/manorm/workflow.py", line 56, in main
    ma.fit_model(summit_dis_cutoff)
  File "/Users/kylie_coding/miniconda3/envs/MAnorm_env/lib/python2.7/site-packages/manorm/core.py", line 103, in fit_model
    x = sm.add_constant(a_values[mask])
  File "/Users/kylie_coding/miniconda3/envs/MAnorm_env/lib/python2.7/site-packages/statsmodels/tools/tools.py", line 279, in add_constant
    is_nonzero_const = np.ptp(x, axis=0) == 0
  File "/Users/kylie_coding/miniconda3/envs/MAnorm_env/lib/python2.7/site-packages/numpy/core/fromnumeric.py", line 2171, in ptp
    return _wrapfunc(a, 'ptp', axis=axis, out=out)
  File "/Users/kylie_coding/miniconda3/envs/MAnorm_env/lib/python2.7/site-packages/numpy/core/fromnumeric.py", line 57, in _wrapfunc
    return getattr(obj, method)(*args, **kwds)
ValueError: zero-size array to reduction operation maximum which has no identity
(MAnorm_env) 

Packages in the python environment:

$ conda list -n MAnorm_env
# packages in environment at /Users/kylie_coding/miniconda3/envs/MAnorm_env:
#
backports                 1.0                      py27_1    conda-forge
backports.functools_lru_cache 1.4                      py27_1    conda-forge
backports_abc             0.5                      py27_0    conda-forge
ca-certificates           2017.11.5                     0    conda-forge
certifi                   2017.11.5                py27_0    conda-forge
cycler                    0.10.0                   py27_0    conda-forge
freetype                  2.8.1                         0    conda-forge
functools32               3.2.3.2                  py27_1    conda-forge
libpng                    1.6.34                        0    conda-forge
manorm                    1.1.3                    py27_0    bioconda
matplotlib                2.1.2                    py27_0    conda-forge
mkl                       2017.0.3                      0  
ncurses                   5.9                          10    conda-forge
numpy                     1.13.1                   py27_0  
openssl                   1.0.2n                        0    conda-forge
pandas                    0.22.0                   py27_0    conda-forge
patsy                     0.5.0                    py27_0    conda-forge
pip                       9.0.1                    py27_1    conda-forge
pyparsing                 2.2.0                    py27_0    conda-forge
python                    2.7.14                        4    conda-forge
python-dateutil           2.3                      py27_0    bioconda
pytz                      2017.3                     py_2    conda-forge
readline                  7.0                           0    conda-forge
scipy                     0.19.1              np113py27_0  
setuptools                38.4.0                   py27_0    conda-forge
singledispatch            3.4.0.3                  py27_0    conda-forge
six                       1.11.0                   py27_1    conda-forge
sqlite                    3.20.1                        2    conda-forge
ssl_match_hostname        3.5.0.1                  py27_1    conda-forge
statsmodels               0.8.0                    py27_0    conda-forge
subprocess32              3.2.7                    py27_0    conda-forge
tk                        8.6.7                         0    conda-forge
tornado                   4.5.3                    py27_0    conda-forge
wheel                     0.30.0                   py27_2    conda-forge
zlib                      1.2.11                        0    conda-forge
(MAnorm_env) 

Hoping very much for your help, thanks!!

Kylie

chiefcat commented 6 years ago

Hi Developer,

It seems that I've got the problem solved after deleting the header from the peak bed files.

Kylie

hongduosun commented 6 years ago

@chiefcat Currently, lines starts with '#' are ignored in bed files whereas header line is not, I will add some regular expression to handle this, thanks!