impr_LOI_analysis is a wrapper function of symmetry_gof, imprinting_est, median_imprinting, final_filter, and LOItest_logreg performing maelstRom's entire (loss of) imprinting pipeline. It goes over the following steps:

  1. Prior filtering on basis of the allelefreq_prel column that should be present in the control dataframe, which it should be after running AllelicMeta_est.

  2. Prior filtering via symmetry_gof, see its documentation for more details.

  3. Running imprinting_est to detect imprinted loci and write results to impr_res; this includes a measure of median imprinting as returned by the function median_imprinting as well.

  4. Filter impr_res down to significantly and sufficiently imprinted loci using final_filter, then perform loss-of-imprinting detection using LOItest_logreg. LOI-detection results are written to LOI_res.

impr_LOI_analysis(
  DataList,
  SE,
  inbr,
  MinMinorAllelefreq = 0.15,
  sym_filt = 0.05,
  adj_p_filt = 0.05,
  gof_filt = 0.8,
  med_i_filt = 0.8,
  i_filt = 0.6
)

Arguments

DataList

A list containing two lists of dataframes, which in turn contain control- and case-data (in that order). Subsequent entries in both lists correspond to subsequent loci (lists must be the same size and named per-locus). Each of the dataframes should at least contain both a ref_count and var_count column; control dataframes should also contain the columns allelefreq_prel (from running AllelicMeta_est), locus_id, ref, var, and coverage (from running prior_filter).

SE

Number. Sequencing error rate, population metaparameter.

inbr

Number. Inbreeding coefficient, population metaparameter.

MinMinorAllelefreq

Number. Minimal allowed minor allele frequency as determinde via the estimated reference allele frequency by AllelicMeta_est to consider the locus for imprinting analysis.

sym_filt

Number. Minimum required symmetry statistic to consider the locus for imprinting analysis, see symmetry_gof.

adj_p_filt

Number. Required FDR-corrected significance level of imprinting for loci to be considered for loss-of-imprinting detection, see the function final_filter.

gof_filt

Number. Required minimum goodness-of-fit heuristic of imprinted loci to be considered for loss-of-imprinting detection, see the function final_filter.

med_i_filt

Number. Required minimum median imprinting of imprinted loci to be considered for loss-of-imprinting detection, see the functions median_imprinting and final_filter.

i_filt

Number. Required minimum estimated imprinting of imprinted loci to be considered for loss-of-imprinting detection, see the functions imprinting_est and final_filter.

Value

A list containing the following components:

impr_res

Results of the imprinting detection analysis, containing, for every locus:

  • positionThe locus' name, according to names(DataList)

  • LRTThe test statistic of the likelihood ratio test against no imprinting (see imprinting_est).

  • pThe p-value of the likelihood ratio test against no imprinting (see imprinting_est).

  • estimated.iThe estimated degree of imprinting (see imprinting_est).

  • allele.frequencyReference allele frequency as estimated by AllelicMeta_est, already given as input.

  • referenceReference allele nucleotide.

  • variantVariant allele nucleotide.

  • med_covMedian coverage (reference + variant) across the locus.

  • nr_samplesNumber of samples (with a total reference + variant read count of at least 1) covering the locus.

  • GOFGoodness-of-fit heuristic as determined by imprinting_est.

  • symmetrySymmetry statistic as determined by symmetry_gof.

  • med_imprMedian imprinting as determined by median_imprinting.

LOI_res

A dataframe containing, only for loci fitting well to maelstRom's imprinting model (see imprinting_est, determined by gof_filt) that are significantly (determined by the adj_p_filt input) and suffiently (determined by i_filt and med_i_filt) imprinted, the results of the differential imprinting analysis (which equals loss of imprinting if there's less imprinting in cases). This contains the same columns as impr_res, but supplemented with:

  • DI_pvalThe p-value testing for differential imprinting using logistic regression, see the documentation for LOItest_logreg for more details.