Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
maxibor committed May 16, 2021
1 parent cb95935 commit 0dab360
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 14 deletions.
6 changes: 0 additions & 6 deletions pydamage/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,6 @@ def cli(ctx, outdir):
@click.option(
"-f", "--force", is_flag=True, help="Force overwriting of results directory"
)
@click.option(
"-r",
"--count_reverse",
is_flag=True,
help="Also count GtoA mutations in reverse reads",
)
@click.option(
"-g",
"--group",
Expand Down
3 changes: 1 addition & 2 deletions pydamage/damage.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def check_model_fit(model_dict, wlen, verbose):
return model_dict


def test_damage(ref, bam, mode, wlen, show_al, count_reverse, process, verbose):
def test_damage(ref, bam, mode, wlen, show_al, process, verbose):
"""Prepare data and run LRtest to test for damage
Args:
Expand All @@ -182,7 +182,6 @@ def test_damage(ref, bam, mode, wlen, show_al, count_reverse, process, verbose):
mode (str): opening mode of alignment file
wlen (int): window length
show_al (bool): Show alignment representations
count_reverse(bool): count reverse alignments as well
process (int): Number of process for parallelization
verbose (bool): Run in verbose mode
Returns:
Expand Down
6 changes: 2 additions & 4 deletions pydamage/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,26 @@ def pydamage_analyze(
process=1,
outdir="",
plot=False,
count_reverse=False,
verbose=False,
force=False,
group=False,
):

if group:
pydamage_analyze_group(
bam, wlen, show_al, count_reverse, process, outdir, plot, verbose, force
bam, wlen, show_al, process, outdir, plot, verbose, force
)

else:
pydamage_analyze_multi(
bam, wlen, show_al, count_reverse, process, outdir, plot, verbose, force
bam, wlen, show_al, process, outdir, plot, verbose, force
)


def pydamage_analyze_multi(
bam,
wlen=30,
show_al=False,
count_reverse=False,
process=1,
outdir="",
plot=False,
Expand Down
2 changes: 0 additions & 2 deletions pydamage/model_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,10 @@ def fit_models(
# Likelihood for model A - Damage Model
binom_p_damage = model_A.fit(c_sites, **optim_A)
LA = binom.logpmf(k=binom_k, n=binom_n, p=binom_p_damage)
sigma_damage = np.sqrt(binom_n * binom_p_damage * 1 - binom_p_damage)

# Likelihood for model B - Null Model
binom_p_null = model_B.fit(c_sites, **optim_B)
LB = binom.logpmf(k=binom_k, n=binom_n, p=binom_p_null)
sigma_null = np.sqrt(binom_n * binom_p_null * 1 - binom_p_null)

# Difference of number of paramters between model A and model B
pdiff = len(model_A.kwds) - len(model_B.kwds)
Expand Down

0 comments on commit 0dab360

Please sign in to comment.