diff --git a/methscan/cli.py b/methscan/cli.py index 312e3ce..3467f53 100755 --- a/methscan/cli.py +++ b/methscan/cli.py @@ -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", @@ -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, @@ -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 diff --git a/methscan/diff.py b/methscan/diff.py index 539db06..e0f503b 100755 --- a/methscan/diff.py +++ b/methscan/diff.py @@ -238,6 +238,7 @@ def calc_tstat_peaks( chrom_len, index, min_cells, + bridge_gaps, threshold_datatype, window_tstat_groups, genomic_positions, @@ -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 @@ -389,6 +390,7 @@ def diff( stepsize, threshold, min_cells, + bridge_gaps, threads=-1, write_header=False, debug=False, @@ -526,6 +528,7 @@ def diff( chrom_len, perm_idx, min_cells, + bridge_gaps, threshold_datatype, window_tstat_groups, genomic_positions,