Description Usage Format Value Constructor Methods Examples
This class will allow to load, convert and normalize alignments and regions files/data. Once the data is ready, the user can then chose to produce metagene plots on the data (or a subset of the data).
1 |
A metagene experiment manager
metagene$new
returns a metagene
object which contains the
normalized coverage values for every regions and for every BAM files.
mg <- metagene$new(regions, bam_files, padding_size = 0,
cores = SerialParam(), verbose = FALSE,
force_seqlevels = FALSE, paired_end = FALSE,
assay = 'chipseq'))
Either a vector
of BED, narrowPeak or broadPeak
filenames, a GRanges
object or a
GRangesList
object.
A vector
of BAM filenames. The BAM files must be
indexed. i.e.: if a file is named file.bam, there must
be a file named file.bam.bai or file.bai in the same
directory.
The regions will be extended on each side by the value of this parameter. The padding_size must be a non-negative integer. Default = 0.
The number of cores available to parallelize the analysis.
Either a positive integer or a BiocParallelParam
.
Default: SerialParam()
.
Print progression of the analysis. A logical constant.
Default: FALSE
.
If TRUE
, Remove regions that are not found
in bam file header. Default: FALSE
. TRUE and FALSE
respectively correspond to pruning.mode = "coarse"
and "error" in ?seqinfo.
If TRUE
, metagene will deal with paired-ended
data. If FALSE
, single-ended data are expected.
Default: FALSE
'chipseq'
or 'rnaseq'
, the two available
options. Default: 'chipseq'
metagene$new
returns a metagene
object that contains the
coverages for every BAM files in the regions from the regions
param.
mg$plot(region_names = NULL, design_names = NULL,
title = NULL, x_label = NULL)
The names of the regions to extract. If NULL
,
all the regions are returned. Default: NULL
.
The names of the experiments to extract. If a design
was added to the metagene
object, design_names
correspond to the column names in the design, otherwise
design_names
corresponds to the BAM name or the BAM
filename. If NULL
, all the experiments are
returned. Default: NULL
.
A title to add to the graph. If NULL
, will be
automatically created. Default: NULL
X-axis label to add to the metagene plot. If NULL
,
metagene will use generic label. Default: NULL
.
mg$produce_table(design, bin_count, noise_removal,
normalization, flip_regions, bin_size = NULL
A data.frame
that describe to experiment to plot.
see plot
function for more details. NA
can
be used keep previous design value. Default: NA
.
The number of bin to create. NA
can be used to
keep previous bin_count value. A bin_count value of 100
will be used if no value is specified. Default:
NA
.
The algorithm to use to remove control(s). Possible
values are NA
, NULL
or "NCIS". By
default, value is NULL
. Use NA
keep
previous noise_removal
value (i.e. if
produce_table
was called before). See
Liand and Keles 2012 for the NCIS algorithm.
The algorithm to use to normalize samples. Possible
default, value is NULL
and no normalization
will be performed. Use NA
keep
previous normalization
value (i.e. if
produce_table
was called before).
Should regions on negative strand be flip_regions?
Default: FALSE
.
Deprecated.
mg$produce_data_frame(alpha = 0.05, sample_count = 1000,
avoid_gaps = FALSE, gaps_threshold = 0)
The range of the estimation to be shown with the ribbon.
1 - alpha / 2
and alpha / 2
will be used.
Default: 0.05.
The number of draw to do in the bootstrap calculation. Default: 1000.
Provide the possibility to remove values = 0 and refit
the data_frame for this suppression.
Default : FALSE
.
It works with avoid_gaps argument. It lets to remove values <= at gaps_threshold. Default : 0.
mg$get_params()
mg$get_design()
mg$get_regions(region_names = NULL)
The names of the regions to extract. If NULL
,
all the regions are returned. Default: NULL
.
mg$get_table = function()
mg$get_matrices = function()
mg$get_data_frame(region_names = NULL, design_names = NULL)
The names of the regions to extract. If NULL
,
all the regions are returned. Default: NULL
.
The names of the experiments to extract. If a design
was added to the metagene
object, design_names
correspond to the column names in the design, otherwise
design_names
corresponds to the BAM name or the BAM
filename. If NULL
, all the experiments are
returned. Default: NULL
.
get_plot = function()
get_raw_coverages = function(filenames)
The name of the file to extract raw coverages. Can be
the filename with the extension of the name of the bam
file (if a named bam files was used during the creation
of the metagene object). If NULL
, returns the
coverage of every bam files. Default: NULL
.
get_normalized_coverages = function(filenames)
The name of the file to extract normalized coverages
(in RPM). Can be the filename with the extension of
the name of the bam file (if a named bam files was used during
the creation of the metagene object). If NULL
,
returns the coverage every bam files. Default:
NULL
.
mg$export(bam_file, region, file)
The name of the bam file to export.
The name of the region to export.
The name of the ouput file.
mg$add_design(design = NULL, check_bam_files = FALSE)
A data.frame
that describe to experiment to plot.
See plot
function for more details. NA
can be
used keep previous design value. Default: NA
.
Force check that all the bam files from the first
columns of the design are present in current
metagene object. Default: FALSE
mg$unflip_regions()
mg$flip_regions()
mg$unflip_regions()
1 2 3 4 5 6 7 | region <- get_demo_regions()[1]
bam_file <- get_demo_bam_files()[1]
mg <- metagene$new(regions = region, bam_files = bam_file)
## Not run:
df <- metagene$plot()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.