hic3defdr.analysis.alternatives module

Experimental module exposing variants of the HiC3DeFDR model for benchmarking purposes.

class hic3defdr.analysis.alternatives.Global3DeFDR(raw_npz_patterns, bias_patterns, chroms, design, outdir, dist_thresh_min=4, dist_thresh_max=200, bias_thresh=0.1, mean_thresh=1.0, loop_patterns=None, res=None)[source]

Bases: hic3defdr.analysis.constructor.HiC3DeFDR

estimate_disp(estimator='qcml', frac=None, auto_frac_factor=15.0, weighted_lowess=True, n_threads=-1)[source]

Estimates dispersion parameters.

Parameters:
  • estimator ('cml', 'qcml', 'mme', or a function) – Pass ‘cml’, ‘qcml’, ‘mme’ to use conditional maximum likelihood (CML), quantile-adjusted CML (qCML), or method of moments estimation (MME) to estimate the dispersion within each bin. Pass a function that takes in a (pixels, replicates) shaped array of data and returns a dispersion value to use that instead.
  • frac (float, optional) – The lowess smoothing fraction to use when fitting the distance vs dispersion trend. Pass None to choose a value automatically.
  • auto_frac_factor (float) – When frac is None, this factor scales the automatically determined fraction parameter.
  • weighted_lowess (bool) – Whether or not to use a weighted lowess fit when fitting the smoothed dispersion curve.
  • n_threads (int) – The number of threads (technically GIL-avoiding child processes) to use to process multiple distance scales in parallel. Pass -1 to use as many threads as there are CPUs. Pass 0 to process the distance scales serially.
class hic3defdr.analysis.alternatives.Poisson3DeFDR(raw_npz_patterns, bias_patterns, chroms, design, outdir, dist_thresh_min=4, dist_thresh_max=200, bias_thresh=0.1, mean_thresh=1.0, loop_patterns=None, res=None)[source]

Bases: hic3defdr.analysis.constructor.HiC3DeFDR

estimate_disp(estimator='qcml', frac=None, auto_frac_factor=15.0, weighted_lowess=True, n_threads=-1)[source]

Estimates dispersion parameters.

Parameters:
  • estimator ('cml', 'qcml', 'mme', or a function) – Pass ‘cml’, ‘qcml’, ‘mme’ to use conditional maximum likelihood (CML), quantile-adjusted CML (qCML), or method of moments estimation (MME) to estimate the dispersion within each bin. Pass a function that takes in a (pixels, replicates) shaped array of data and returns a dispersion value to use that instead.
  • frac (float, optional) – The lowess smoothing fraction to use when fitting the distance vs dispersion trend. Pass None to choose a value automatically.
  • auto_frac_factor (float) – When frac is None, this factor scales the automatically determined fraction parameter.
  • weighted_lowess (bool) – Whether or not to use a weighted lowess fit when fitting the smoothed dispersion curve.
  • n_threads (int) – The number of threads (technically GIL-avoiding child processes) to use to process multiple distance scales in parallel. Pass -1 to use as many threads as there are CPUs. Pass 0 to process the distance scales serially.
lrt(chrom=None, refit_mu=True, n_threads=-1, verbose=True)[source]

Runs the likelihood ratio test to test for differential interactions.

Parameters:
  • chrom (str) – The name of the chromosome to run the LRT for. Pass None to run for all chromosomes in series.
  • refit_mu (bool) – Pass True to refit the mean parameters in the NB models being compared in the LRT. Pass False to use the means across replicates directly, which is simpler and slightly faster but technically violates the assumptions of the LRT.
  • n_threads (int) – The number of threads (technically GIL-avoiding child processes) to use to process multiple chromosomes in parallel. Pass -1 to use as many threads as there are CPUs. Pass 0 to process the chromosomes serially.
  • verbose (bool) – Pass False to silence reporting of progress to stderr.
class hic3defdr.analysis.alternatives.Unsmoothed3DeFDR(raw_npz_patterns, bias_patterns, chroms, design, outdir, dist_thresh_min=4, dist_thresh_max=200, bias_thresh=0.1, mean_thresh=1.0, loop_patterns=None, res=None)[source]

Bases: hic3defdr.analysis.constructor.HiC3DeFDR

estimate_disp(estimator='qcml', frac=None, auto_frac_factor=15.0, weighted_lowess=True, n_threads=-1)[source]

Estimates dispersion parameters.

Parameters:
  • estimator ('cml', 'qcml', 'mme', or a function) – Pass ‘cml’, ‘qcml’, ‘mme’ to use conditional maximum likelihood (CML), quantile-adjusted CML (qCML), or method of moments estimation (MME) to estimate the dispersion within each bin. Pass a function that takes in a (pixels, replicates) shaped array of data and returns a dispersion value to use that instead.
  • frac (float, optional) – The lowess smoothing fraction to use when fitting the distance vs dispersion trend. Pass None to choose a value automatically.
  • auto_frac_factor (float) – When frac is None, this factor scales the automatically determined fraction parameter.
  • weighted_lowess (bool) – Whether or not to use a weighted lowess fit when fitting the smoothed dispersion curve.
  • n_threads (int) – The number of threads (technically GIL-avoiding child processes) to use to process multiple distance scales in parallel. Pass -1 to use as many threads as there are CPUs. Pass 0 to process the distance scales serially.
hic3defdr.analysis.alternatives.poisson_fit_mu_hat(raw, f)[source]
hic3defdr.analysis.alternatives.poisson_logpmf(x, mu)[source]
hic3defdr.analysis.alternatives.poisson_lrt(raw, f, design, refit_mu=True)[source]