Skip to content

Commit

Permalink
Merge pull request macs3-project#97 from daler/master
Browse files Browse the repository at this point in the history
add option to specify tempdir from command line. Related to macs3-project#105.
  • Loading branch information
taoliu committed Dec 23, 2015
2 parents 33b57e5 + 0a8fa57 commit 24f4b75
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion MACS2/callpeak_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import sys
import logging
from time import strftime
import tempfile

# ------------------------------------
# own python modules
Expand Down Expand Up @@ -63,7 +64,9 @@ def run( args ):
options.PE_MODE = options.format in ('BAMPE',)
if options.PE_MODE: tag = 'fragment' # call things fragments not tags
else: tag = 'tag'


tempfile.tempdir = options.tempdir

#1 Read tag files
info("#1 read %s files...", tag)
if options.PE_MODE: (treat, control) = load_frag_files_options (options)
Expand Down
3 changes: 3 additions & 0 deletions bin/macs2
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ the distribution).
import os
import sys
import argparse as ap
import tempfile

# ------------------------------------
# own python modules
Expand Down Expand Up @@ -252,6 +253,8 @@ def add_callpeak_parser( subparsers ):
help = "When set, random sampling method will scale down the bigger sample. By default, MACS uses linear scaling. Warning: This option will make your result unstable and irreproducible since each time, random reads would be selected. Consider to use 'randsample' script instead. <not implmented>If used together with --SPMR, 1 million unique reads will be randomly picked.</not implemented> Caution: due to the implementation, the final number of selected reads may not be as you expected! DEFAULT: False" )
group_callpeak.add_argument( "--seed", dest = "seed", type = int, default = -1,
help = "Set the random seed while down sampling data. Must be a non-negative integer in order to be effective. DEFAULT: not set" )
group_callpeak.add_argument( "--tempdir", dest="tempdir", default=tempfile.gettempdir(),
help = "Optional directory to store temp files. DEFAULT: %(default)s")
group_callpeak.add_argument( "--nolambda", dest = "nolambda", action = "store_true",
help = "If True, MACS will use fixed background lambda as local lambda for every peak region. Normally, MACS calculates a dynamic local lambda to reflect the local bias due to potential chromatin structure. ",
default = False )
Expand Down

0 comments on commit 24f4b75

Please sign in to comment.