Skip to content

Commit

Permalink
add --bridge-gaps option to diff
Browse files Browse the repository at this point in the history
  • Loading branch information
LKremer committed Oct 7, 2024
1 parent 730aa7c commit 79535cc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
18 changes: 13 additions & 5 deletions methscan/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,11 +403,11 @@ def smooth_cli(**kwargs):
)
@click.option(
"--bridge-gaps",
metavar="INTEGER",
default=0,
type=int,
type=click.IntRange(min=0),
metavar="INTEGER",
help="Merge neighboring VMRs if they are within this distance in basepairs. Useful "
"to prevent fragmented VMRs separated only by small gaps. [default: off; x>=0]",
"to prevent fragmented VMRs separated only by small gaps. [default: off]",
)
@click.option(
"--threads",
Expand Down Expand Up @@ -503,6 +503,14 @@ def scan_cli(**kwargs):
"testing. For example, a value of 6 means that only regions with sequencing "
"coverage in at least 6 cells per group are considered.",
)
@click.option(
"--bridge-gaps",
default=0,
type=click.IntRange(min=0),
metavar="INTEGER",
help="Merge neighboring VMRs if they are within this distance in basepairs. Useful "
"to prevent fragmented VMRs separated only by small gaps. [default: off]",
)
@click.option(
"--threads",
default=-1,
Expand Down Expand Up @@ -637,14 +645,14 @@ def matrix_cli(**kwargs):
type=click.IntRange(min=1),
metavar="INTEGER",
help="The bed column number (1-indexed) denoting "
"the DNA strand of the region [optional].",
"the DNA strand of the region. [optional]",
)
@click.option(
"--label",
help="Specify a constant value to be added as a "
"column to the output table. This can be "
"useful to give each output a unique label when "
"you want to concatenate multiple outputs [optional].",
"you want to concatenate multiple outputs. [optional]",
)
def profile_cli(**kwargs):
from .profile import profile
Expand Down
5 changes: 4 additions & 1 deletion methscan/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ def calc_tstat_peaks(
chrom_len,
index,
min_cells,
bridge_gaps,
threshold_datatype,
window_tstat_groups,
genomic_positions,
Expand All @@ -252,7 +253,7 @@ def calc_tstat_peaks(
# merge overlapping windows with lowest and highest t-statistic,
# to get bigger regions of variable size
peak_starts, peak_ends = _find_peaks(
tstat_windows, genomic_positions, threshold_value, half_bw
tstat_windows, genomic_positions, threshold_value, half_bw, bridge_gaps
)

# for each big merged peak, re-calculate the t-statistic
Expand Down Expand Up @@ -389,6 +390,7 @@ def diff(
stepsize,
threshold,
min_cells,
bridge_gaps,
threads=-1,
write_header=False,
debug=False,
Expand Down Expand Up @@ -526,6 +528,7 @@ def diff(
chrom_len,
perm_idx,
min_cells,
bridge_gaps,
threshold_datatype,
window_tstat_groups,
genomic_positions,
Expand Down

0 comments on commit 79535cc

Please sign in to comment.