Question: error in macs2 usage
1
gravatar for Sara
2.3 years ago by
Sara30
Sara30 wrote:

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?

next-gen • 1.3k views
ADD COMMENTlink modified 14 months ago by jshireman50 • written 2.3 years ago by Sara30

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' ...?

ADD REPLYlink modified 2.3 years ago • written 2.3 years ago by dariober10.0k
macs2 2.1.1.20160309

 866992_part.bam -c 866991_part.bam -f BAM --nomodel -g hs -n example -B -q 0.01 --outdir ~/peakCall
INFO  @ Mon, 02 Jan 2017 10:49:21: 
# Command line: callpeak -t 866992_part.bam -c 866991_part.bam -f BAM --nomodel -g hs -n example -B -q 0.01 --outdir /home/peakCall
# ARGUMENTS LIST:
# name = example
# format = BAM
# ChIP-seq file = ['866992_part.bam']
# control file = ['866991_part.bam']
# effective genome size = 2.70e+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: 1000 bps and 10000 bps
# Broad region calling is off
# Paired-End mode is off

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 "build/bdist.linux-x86_64/egg/MACS2/callpeak_cmd.py", line 68, in run
AttributeError: 'Namespace' object has no attribute 'tempdir'
b
ADD REPLYlink modified 2.3 years ago • written 2.3 years ago by Sara30

I tried what is mentioned in the link you sent and got the same error

ADD REPLYlink written 2.3 years ago by Sara30

Try macs2 callpeak -t 866992_part.bam -c 866991_part.bam -f BAM --nomodel -g hs -n example -B -q 0.01 --outdir peakCall

ADD REPLYlink written 2.3 years ago by Sinji2.8k
0
gravatar for phosphodiester_bond
23 months ago by
phosphodiester_bond30 wrote:

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.

ADD COMMENTlink written 23 months ago by phosphodiester_bond30
0
gravatar for phosphodiester_bond
23 months ago by
phosphodiester_bond30 wrote:

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...

ADD COMMENTlink modified 23 months ago • written 23 months ago by phosphodiester_bond30

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.

ADD REPLYlink written 23 months ago by Sinji2.8k
0
gravatar for jshireman5
14 months ago by
jshireman50
jshireman50 wrote:

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'

ADD COMMENTlink modified 14 months ago • written 14 months ago by jshireman50
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1042 users visited in the last hour