Description Usage Arguments Value Randomizations Poly-Enrich Weighting Options Examples
This function is used to create the *_peaks and *_peaks-per-gene files This way one does not need to remake these files whenever one just wants to test enrichment methods.
1 2 3 4 | peaks2genes(peaks, out_name = "readyToEnrich", out_path = getwd(),
genome = supported_genomes(), locusdef = "nearest_tss",
weighting = NULL, mappability = NULL, qc_plots = TRUE,
num_peak_threshold = 1, randomization = NULL)
|
peaks |
Either a file path or a |
out_name |
Prefix string to use for naming output files. This should not
contain any characters that would be illegal for the system being used (Unix,
Windows, etc.) The default value is "polyenrich", and a file "polyenrich_results.tab"
is produced. If |
out_path |
Directory to which results files will be written out. Defaults
to the current working directory as returned by |
genome |
One of the |
locusdef |
One of: 'nearest_tss', 'nearest_gene', 'exon', 'intron', '1kb',
'1kb_outside', '1kb_outside_upstream', '5kb', '5kb_outside', '5kb_outside_upstream',
'10kb', '10kb_outside', '10kb_outside_upstream'. For a description of each,
see the vignette or |
weighting |
(Poly-Enrich only) character string specifying the weighting method if method is chosen to be 'polyenrich_weighted'. Current options are: 'signalValue', 'logsignalValue', and 'multiAssign'. |
mappability |
One of |
qc_plots |
A logical variable that enables the automatic generation of plots for quality control. |
num_peak_threshold |
(ChIP-Enrich only) Sets the threshold for how many peaks a gene must have to be considered as having a peak. Defaults to 1. Only relevant for Fisher's exact test and ChIP-Enrich methods. |
randomization |
One of |
A list, containing the following items:
opts |
A data frame containing the arguments/values passed to |
peaks |
A data frame containing peak assignments to genes. Peaks which do not overlap a gene locus are not included. Each peak that was assigned to a gene is listed, along with the peak midpoint or peak interval coordinates (depending on which was used), the gene to which the peak was assigned, the locus start and end position of the gene, and the distance from the peak to the TSS. The columns are:
|
peaks_per_gene |
A data frame of the count of peaks per gene. The columns are:
|
Randomization of locus definitions allows for the assessment of Type I Error under the null hypothesis. The randomization codes are:
NULL
:No randomizations, the default.
Shuffle the gene_id
and symbol
columns of the
locusdef
together, without regard for the chromosome location, or locus length.
The null hypothesis is that there is no true gene set enrichment.
Shuffle the gene_id
and symbol
columns of the
locusdef
together within bins of 100 genes sorted by locus length. The null
hypothesis is that there is no true gene set enrichment, but with preserved locus
length relationship.
Shuffle the gene_id
and symbol
columns of the
locusdef
together within bins of 50 genes sorted by genomic location. The null
hypothesis is that there is no true gene set enrichment, but with preserved
genomic location.
The return value with a selected randomization is the same list as without.
To assess the Type I error, the alpha
level for the particular data set
can be calculated by dividing the total number of gene sets with p-value < alpha
by the total number of tests. Users may want to perform multiple randomizations
for a set of peaks and take the median of the alpha
values.
Poly-Enrich also allows weighting of individual peaks. Currently the options are:
weighs each peak based on the Signal Value given in the narrowPeak format or a user-supplied column, normalized to have mean 1.
weighs each peak based on the log Signal Value given in the narrowPeak format or a user-supplied column, normalized to have mean 1.
weighs each peak by the inverse of the number of genes it is assigned to.
1 2 3 4 5 6 7 8 9 | # Run peaks2genes using an example dataset, assigning peaks to the nearest TSS
data(peaks_E2F4, package = 'chipenrich.data')
peaks_E2F4 = subset(peaks_E2F4, peaks_E2F4$chrom == 'chr1')
gs_path = system.file('extdata', package='chipenrich')
results = peaks2genes(peaks_E2F4, locusdef='nearest_tss',
genome = 'hg19', out_name=NULL)
# Get the list of peaks that were assigned to genes.
assigned_peaks = results$peaks
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.