I can guarantee that the tempdir argument does exist, I use it in my current pipeline. You need at least version macs2 2.1.1.20160309.
I am working with macs2 to find the peaks. I used this command to get .narrowpeak file:
macs2 callpeak -t 866992_part.bam -c 866991_part.bam -f BAM --nomodel -g hs -n example -B -q 0.01 --outdir peakCall
but bave this error:
AttributeError: 'Namespace' object has no attribute 'tempdir'
if I try this command:
macs2 callpeak -t 866992_part.bam -c 866991_part.bam -f BAM --nomodel -g hs -n example -B -q 0.01 --outdir /peakCall
, will gives this error:
Output directory (/peakCall) could not be created. Terminating program.
do you know how I can resolve this problem?
3 answers
Have you figured this one out, Sara? I'm running into the exact same issue (using build 2.1.1.20160309). My command looks like:
macs2 callpeak --nomodel --format SAM -t /path/to/somefile.sam --shift -100 --extsize 200 -B --broad --outdir /the/output/dir/
I've also tried without --outdir, but no luck.
BTW, looks like a bug but I'm waiting on the author to confirm. I didn't see where that variable is used anywhere else, so I just changed that line cited in the error message to hardcode the temp directory in my cluster:
tempfile.tempdir = '/tmp/'
Maybe this was intended to have a --tempdir argument that hasn't been implemented yet. So far, it's running...
was this ever resolved im getting the same error today and i cant find a post with the solution
Traceback (most recent call last): File "/usr/bin/macs2", line 614, in <module> main() File "/usr/bin/macs2", line 56, in main run( args ) File "/usr/local/lib/python2.7/dist-packages/MACS2/callpeak_cmd.py", line 68, in run tempfile.tempdir = options.tempdir AttributeError: 'Namespace' object has no attribute 'tempdir'
Log in to answer this question.
The second command probably fails because you try to write to the root directory
/where you don't have permission as a regular user (I assume you are on a Unix system).The error from the first command is trickier to troubleshoot from here... This issue seems related https://github.com/taoliu/MACS/issues/61 . What version of macs2 are you using (i.e. what is the output of
macs2 --version)?Also, can you post the full output you see on screen i.e. not just the line
AttributeError: 'Namespace' ...?I tried what is mentioned in the link you sent and got the same error
Try
macs2 callpeak -t 866992_part.bam -c 866991_part.bam -f BAM --nomodel -g hs -n example -B -q 0.01 --outdir peakCall