hatchet.utils.solve package

Submodules

hatchet.utils.solve.cd module

class hatchet.utils.solve.cd.CoordinateDescent(f_a, f_b, n, mu, d, cn_max, cn, w, purities, ampdel=True)

Bases: object

Methods

run

run(solver_type='gurobi', max_iters=10, max_convergence_iters=2, n_seed=400, j=8, random_seed=None, timelimit=None)
class hatchet.utils.solve.cd.CoordinateDescentSplit(f_a, f_b, n, mu, d, cn_max, cn, binsA, binsB, lengths, ampdel=True)

Bases: CoordinateDescent

Methods

run

class hatchet.utils.solve.cd.Worker(ilp, solver)

Bases: object

Methods

run

run(cA, cB, u, max_iters, max_convergence_iters, tol=0.001, timelimit=None)

hatchet.utils.solve.ilp_subset module

class hatchet.utils.solve.ilp_subset.ILPSubset(n, cn_max, d, mu, ampdel, copy_numbers, f_a, f_b, w, purities)

Bases: object

Attributes:
M
base
optimized_cA
optimized_cB
optimized_u

Methods

build_random_u

build_symmetry_breaking

create_model

first_hot_start

fix_c

fix_given_cn

fix_u

hot_start

run

symmCoeff

property M
property base
build_random_u(random_seed=None)
build_symmetry_breaking(model)
create_model(pprint=False)
first_hot_start()
fix_c(cA, cB)
fix_given_cn(model)
fix_u(u)
hot_start(f_a=None, f_b=None)
property optimized_cA
property optimized_cB
property optimized_u
run(solver_type='gurobi', timelimit=None, write_path=None)
static symmCoeff(i)
class hatchet.utils.solve.ilp_subset.ILPSubsetSplit(n, cn_max, d, mu, ampdel, copy_numbers, f_a, f_b, binsA, binsB, lengths)

Bases: ILPSubset

Attributes:
M
base
optimized_cA
optimized_cB
optimized_u

Methods

build_random_u

build_symmetry_breaking

create_model

first_hot_start

fix_c

fix_given_cn

fix_u

hot_start

run

symmCoeff

create_model(pprint=False)

hatchet.utils.solve.utils module

class hatchet.utils.solve.utils.Random(seed=None)

Bases: object

A context manager that pushes a random seed to the stack for reproducible results, and pops it on exit.

hatchet.utils.solve.utils.parse_clonal(clonal)
hatchet.utils.solve.utils.scale_rdr(rdr, copy_numbers, purity_tol=0.05)
hatchet.utils.solve.utils.segmentation(cA, cB, u, cluster_ids, sample_ids, bbc_file, bbc_out_file=None, seg_out_file=None)

Module contents

hatchet.utils.solve.solve(clonal, bbc_file, seg_file, n, solver='gurobi', solve_mode='cd', d=-1, cn_max=-1, mu=0.01, diploid_threshold=0.1, ampdel=True, n_seed=400, n_worker=8, random_seed=None, max_iters=None, timelimit=None, binwise=False, purities=None)
hatchet.utils.solve.solver_available(solver=None)