dariober / SICERpy

Python wrapper around the popular ChIP-Seq peak caller SICER
15 stars 3 forks source link

OSError with SICERpy #6

Closed gunjangala closed 7 years ago

gunjangala commented 7 years ago

Hi, I have used SICERpy before and it worked well. But, this time it gives me the following error.

$ inputBAM=test_alignments.bam
$ testBAM=input_alignments.bam
$ sampleNAME=test
$ SICER.py -t ${testBAM} -c ${inputBAM} -q 10 -fs 200 > ${sampleNAME}_SICER.bed

*** Preprocess raw files to remove reduntant reads
cd /SICER/tmp_sicer_L8kz2w/tmp_alignments.bam_dir
export PYTHONPATH=/local/apps/sicer/1.1/SICERpy/lib
/local/apps/python/2.7.3/bin/python /local/apps/sicer/1.1/SICERpy/src/remove_redundant_reads_bam.py -t 0 -b test_alignments.bam -o /SICER/tmp_sicer_L8kz2w/test_alignments.bam.removed.bam -f 0 -F 4 -q 10

Traceback (most recent call last):
  File "/local/apps/sicer/1.1/SICERpy/SICER.py", line 153, in <module>
    os.makedirs(tmpRedDir)
  File "/local/apps/python/2.7.3/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 17] File exists: '/SICER/tmp_sicer_L8kz2w/tmp_alignments.bam_dir'

There is no such file/folder 'tmp_sicer_L8kz2w/tmp_alignments.bam_dir' present. Can you please help me fix this?

Thanks, Gunjan

dariober commented 7 years ago

Hi - I can reproduce your error if the test and control files are the same:

~/git_repos/SICERpy/SICERpy/SICER.py -t control.bam -c control.bam  > /dev/null

*** Preprocess raw files to remove reduntant reads
cd /home/db291g/Tritume/ex/tmp_sicer_MKqMGM/tmp_control.bam_dir
export PYTHONPATH=/home/db291g/git_repos/SICERpy/SICERpy/lib
/home/db291g/python/bin/python /home/db291g/git_repos/SICERpy/SICERpy/src/remove_redundant_reads_bam.py -t 0 -b /home/db291g/Tritume/ex/control.bam -o /home/db291g/Tritume/ex/tmp_sicer_MKqMGM/control.bam.removed.bam -f 0 -F 4 -q 5

Traceback (most recent call last):
  File "/home/db291g/git_repos/SICERpy/SICERpy/SICER.py", line 153, in <module>
    os.makedirs(tmpRedDir)
  File "/home/db291g/python/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 17] File exists: '/home/db291g/Tritume/ex/tmp_sicer_MKqMGM/tmp_control.bam_dir'

This happens because the tmp directories are created after the input files. This is not great and I should change it, but typically it doesn't make sense to have such set up!

Can you check your test and control files happen to be the same?

EDIT: This happens even when file names are the same but live in different directories. Definitely, this should change.

Thanks for reporting this issue. Dario

dariober commented 7 years ago

Hi again- I just changed SICER.py to fix this bug. If you download the new script you should have this problem sorted. Let me know if there are more issues...

Dario

gunjangala commented 7 years ago

The file names were same though present in different directories. Changing them fixed the error. Thanks for pointing it out. -Gunjan

gunjangala commented 7 years ago

Oh great! I will try that and let you know. Thanks, Gunjan