runCNV.Rd
This functions integrates large-scale copy number variations analysis
using the inferncnv
package. For more detailed information about infercnv works
visit https://github.com/broadinstitute/inferCNV/wiki.
runCNV(
object,
ref_annotation = cnv_ref[["annotation"]],
ref_mtr = cnv_ref[["mtr"]],
ref_regions = cnv_ref[["regions"]],
gene_pos_df = SPATA2::gene_pos_df,
directory_cnv_folder = "data-development/cnv-results",
directory_regions_df = NA,
cnv_prefix = "Chr",
save_infercnv_object = TRUE,
verbose = NULL,
CreateInfercnvObject = list(ref_group_names = "ref"),
require_above_min_mean_expr_cutoff = list(min_mean_expr_cutoff = 0.1),
require_above_min_cells_ref = list(min_cells_per_gene = 3),
normalize_counts_by_seq_depth = list(),
anscombe_transform = list(),
log2xplus1 = list(),
apply_max_threshold_bounds = list(),
smooth_by_chromosome = list(window_length = 101, smooth_ends = TRUE),
center_cell_expr_across_chromosome = list(method = "median"),
subtract_ref_expr_from_obs = list(inv_log = TRUE),
invert_log2 = list(),
clear_noise_via_ref_mean_sd = list(sd_amplifier = 1.5),
remove_outliers_norm = list(),
define_signif_tumor_subclusters = list(p_val = 0.05, hclust_method = "ward.D2",
cluster_by_groups = TRUE, partition_method = "qnorm"),
plot_cnv = list(k_obs_groups = 5, cluster_by_groups = TRUE, output_filename =
"infercnv.outliers_removed", color_safe_pal = FALSE, x.range = "auto", x.center = 1,
output_format = "pdf", title = "Outliers Removed")
)
runCnvAnalysis(object, ...)
An object of class SPATA2
or, in case of S4 generics,
objects of classes for which a method has been defined.
A data.frame in which the row names refer to the barcodes of
the reference matrix provided in argument ref_mtr
and
and a column named sample that refers to the reference group names.
Defaults to the data.frame stored in slot $annotation
of list SPATA2::cnv_ref
.
If you provide your own reference, make sure that barcodes of the reference
input do not overlap with barcodes of the SPATA2
object. (e.g. by suffixing as
exemplified in the default list SPATA2::cnv_ref
.)
The count matrix that is supposed to be used as the reference.
Row names must refer to the gene names and column names must refer to
the barcodes. Barcodes must be identical to the row names of the data.frame
provided in argument ref_annotation.
Defaults to the count matrix stored in slot $mtr
of list SPATA2::cnv_ref
.
If you provide your own reference, make sure that barcodes of the reference
input do not overlap with barcodes of the SPATA2
object. (e.g. by suffixing as
exemplified in the default list SPATA2::cnv_ref
.)
A data.frame that contains information about chromosome positions.
Defaults to the data.frame stored in slot $regions
of list SPATA2::cnv_ref
.
If you provide your own regions reference, make sure that the data.frame has equal column names and row names as the default input.
Either NULL or a data.frame. If data.frame, it replaces
the output of CONICsmat::getGenePositions()
. Must contain three
character variables ensembl_gene_id, hgnc_symbol, chromosome_name
and two numeric variables start_position and end_position..
If NULL the data.frame is created via CONICsmat::getGenePositions()
using
all gene names that appear in the count matrix and in the reference matrix.
Defaults to the SPATA2 intern data.frame SPATA2::gene_pos_df
.
Character value. A directory that leads to the folder in which to store temporary files, the infercnv-object as well as the output heatmap.
Character value. Denotes the string with which the the feature variables in which the information about the chromosomal gains and losses are stored are prefixed.
Logical value. If set to TRUE the infercnv-object
is stored in the folder denoted in argument directory_cnv_folder
under
'infercnv-object.RDS.
Logical. If TRUE
, informative messages regarding
the computational progress will be printed.
(Warning messages will always be printed.)
A list of arguments with which the function is supposed
to be called. Make sure that your input does not conflict with downstream function
calls. Input for argument infercnv_obj
must not be specified.
A list of arguments with which the function is supposed
to be called. Make sure that your input does not conflict with downstream function
calls. Input for argument infercnv_obj
must not be specified.
A list of arguments with which the function is supposed
to be called. Make sure that your input does not conflict with downstream function
calls. Input for argument infercnv_obj
must not be specified.
A list of arguments with which the function is supposed
to be called. Make sure that your input does not conflict with downstream function
calls. Input for argument infercnv_obj
must not be specified.
A list of arguments with which the function is supposed
to be called. Make sure that your input does not conflict with downstream function
calls. Input for argument infercnv_obj
must not be specified.
A list of arguments with which the function is supposed
to be called. Make sure that your input does not conflict with downstream function
calls. Input for argument infercnv_obj
must not be specified.
A list of arguments with which the function is supposed
to be called. Make sure that your input does not conflict with downstream function
calls. Input for argument infercnv_obj
must not be specified.
A list of arguments with which the function is supposed
to be called. Make sure that your input does not conflict with downstream function
calls. Input for argument infercnv_obj
must not be specified.
A list of arguments with which the function is supposed
to be called. Make sure that your input does not conflict with downstream function
calls. Input for argument infercnv_obj
must not be specified.
A list of arguments with which the function is supposed
to be called. Make sure that your input does not conflict with downstream function
calls. Input for argument infercnv_obj
must not be specified.
A list of arguments with which the function is supposed
to be called. Make sure that your input does not conflict with downstream function
calls. Input for argument infercnv_obj
must not be specified.
A list of arguments with which the function is supposed
to be called. Make sure that your input does not conflict with downstream function
calls. Input for argument infercnv_obj
must not be specified.
A list of arguments with which the function is supposed
to be called. Make sure that your input does not conflict with downstream function
calls. Input for argument infercnv_obj
must not be specified.
A list of arguments with which the function is supposed
to be called. Make sure that your input does not conflict with downstream function
calls. Input for argument infercnv_obj
must not be specified.
A list of arguments with which the function is supposed
to be called. Make sure that your input does not conflict with downstream function
calls. Input for argument infercnv_obj
and must not be specified. Input for argument
out_dir
is taken from argument directory_cnv_folder
.
Used to absorb deprecated arguments or functions.
An updated SPATA2
object containg the results in the respective slot.
runCnvAnalysis()
is a wrapper around all functions the infercnv-pipeline
is composed of. Argument directory_cnv_folder
should lead to an empty folder as
temporary files as well as the output heatmap and the infercnv-object are stored
there without asking for permission which can lead to overwriting due to naming issues.
Results (including a PCA) are stored in the slot @cnv of the SPATA2
object
which can be obtained via getCnvResults()
. Additionally, the variables
that store the copy-number-variations for each barcode-spot are added to
the SPATA2
object's feature data. The corresponding feature variables are named according
to the chromosome's number and the prefix denoted with the argument cnv_prefix.
Regarding the reference data:
In the list SPATA2::cnv_ref
we offer reference data including a count matrix
that results from stRNA-seq of healthy human brain tissue, an annotation data.frame as
well as a data.frame containing information regarding the chromosome positions.
You can choose to provide your own reference data by specifying the ref_*
-arguments.
Check out the content of list SPATA2::cnv_ref
and make sure that your own
reference input is of similiar structure regarding column names, rownames, etc.
runCnvAnalysis()
has been deprecated in favor of runCNV()
.
library(SPATA2)
data("example_data")
object <- example_data$object_UKF269T_diet
# make sure that "/my_cnv_folder" exists
dir.exists("my_cnv_folder")
# this can take some time
object <- runCNV(object, directory_cnv_folder = "my_cnv_folder")
plotCnvHeatmap(object, across = "histology")
# chromosomal alterations are immediately added to the objects
# meta features
getFeatureNames(object)
plotSurface(object, color_by = "Chr7", pt_clrsp = "Reds 3")