jpiper / pyDNase

Python module for the easy handling and analysis of DNase-seq data
http://jpiper.github.io/pyDNase
MIT License
37 stars 24 forks source link

IndexError using wellington_footprints.py with Python 2.7.14 #23

Closed jma1991 closed 6 years ago

jma1991 commented 6 years ago

I have encountered the following error:

Reading BED File...
[################################] 0/34484 - 00:00:00
Traceback (most recent call last):
  File "/home/s1437643/conda/envs/py27/bin/wellington_footprints.py", line 95, in <module>
    regions = pyDNase.GenomicIntervalSet(clargs.regions)
  File "/home/s1437643/conda/envs/py27/lib/python2.7/site-packages/pyDNase/__init__.py", line 246, in __init__
    self.loadBEDFile(filename)
  File "/home/s1437643/conda/envs/py27/lib/python2.7/site-packages/pyDNase/__init__.py", line 283, in loadBEDFile
    if not self.__isBEDHeader(line):
  File "/home/s1437643/conda/envs/py27/lib/python2.7/site-packages/pyDNase/__init__.py", line 307, in __isBEDHeader
    if string[0] == "#":
IndexError: string index out of range

The command I used was:

wellington_footprints.py -fdr 0.05 -o ESC_Rep0 -p 24 -A <(cut -f 1,2,3 Results/Peaks/IDR/ESC_Rep0/ESC_Rep0_optimal.narrowPeak) Data/Samples/ESC_Rep0/ESC_Rep0_filtered.bam Results/Footprints/pyDNase/ESC_Rep0

I built pyDNase from the latest GitHub code (2017-11-17) using this command:

pip install git+git://github.com/jpiper/pyDNase.git

The version of Python I am using:

$ python --version
Python 2.7.14
jpiper commented 6 years ago

It looks like there's an empty newline at the end of your BED file. I'll put a fix in for this, but you can remove the empty line and that should fix it!