import pandas as pd import statsmodels.api as sm import argparse
defget_args():
parser = argparse.ArgumentParser(description='Perform lowess smooth on bedgraph.') parser.add_argument('--input', '-i', help='Input bedgraph file.', required=True) parser.add_argument('--output', '-o', help='Output smoothed bedgraph file.', required=True) parser.add_argument('--span', help='Span size of loess smoothing.', type=int, required=True) parser.add_argument("--chr", required=True, help="The chrom to input. e.g. 1-22,X,Y") args = parser.parse_args()
return args
defparse_range(value): result = [] for part in value.split(','): if'-'in part: start, end = part.split('-') result.extend(range(int(start), int(end) + 1)) else: result.append(int(part)) return result