Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add store_bdg, SPMR, broad parameters for calling peaks using MACS3 #329

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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])]
Loading