Skip to content

Commit

Permalink
Add store_bdg, SPMR, broad parameters for calling peaks using MACS3
Browse files Browse the repository at this point in the history
  • Loading branch information
beyondpie committed Aug 27, 2024
1 parent 65065b4 commit 80858a4
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions snapatac2-python/python/snapatac2/tools/_call_peaks.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ def macs3(
min_len: int | None = None,
blacklist: Path | None = None,
key_added: str = 'macs3',
broad: bool = False,
store_bdg: bool = False,
SPMR: bool = False,
tempdir: Path | None = None,
inplace: bool = True,
n_jobs: int = 8,
Expand Down Expand Up @@ -68,6 +71,12 @@ def macs3(
removed.
key_added
`.uns` key under which to add the peak information.
broad:
Call broad peak or not (by default False)
store_bdg:
Store bedgraph file or not (by default False). Note: this will capture large storage on disk.
SPMR:
Use signal per million reads for fragment pileup profiles (by default False), an option for storing bedgraph.
tempdir
If provided, a temporary directory will be created in the directory.
Otherwise, a temporary directory will be created in the system default temporary directory.
Expand Down Expand Up @@ -105,8 +114,8 @@ def macs3(
options.bdg_control = 'c'
options.cutoff_analysis = False
options.cutoff_analysis_file = 'a'
options.store_bdg = False
options.do_SPMR = False
options.store_bdg = store_bdg
options.do_SPMR = SPMR
options.trackline = False
options.log_pvalue = None
options.log_qvalue = log(qvalue, 10) * -1
Expand All @@ -120,7 +129,7 @@ def macs3(
options.smalllocal = 1000
options.largelocal = 10000
options.call_summits = True
options.broad = False
options.broad = broad
options.fecutoff = 1.0
options.d = extsize
options.scanwindow = 2 * options.d
Expand Down Expand Up @@ -238,4 +247,4 @@ def _par_map(mapper, args, nprocs):
remaining.append((i, job))
jobs = remaining
time.sleep(0.5)
return [x for _,x in sorted(results, key=lambda x: x[0])]
return [x for _,x in sorted(results, key=lambda x: x[0])]

0 comments on commit 80858a4

Please sign in to comment.