runCNV | R Documentation |
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, ...)
object |
An object of class |
ref_annotation |
A data.frame in which the row names refer to the barcodes of
the reference matrix provided in argument Defaults to the data.frame stored in slot If you provide your own reference, make sure that barcodes of the reference
input do not overlap with barcodes of the |
ref_mtr |
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 Defaults to the count matrix stored in slot If you provide your own reference, make sure that barcodes of the reference
input do not overlap with barcodes of the |
ref_regions |
A data.frame that contains information about chromosome positions. Defaults to the data.frame stored in slot If you provide your own regions reference, make sure that the data.frame has equal column names and row names as the default input. |
gene_pos_df |
Either NULL or a data.frame. If data.frame, it replaces
the output of If NULL the data.frame is created via Defaults to the SPATA2 intern data.frame |
directory_cnv_folder |
Character value. A directory that leads to the folder in which to store temporary files, the infercnv-object as well as the output heatmap. |
cnv_prefix |
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. |
save_infercnv_object |
Logical value. If set to TRUE the infercnv-object
is stored in the folder denoted in argument |
verbose |
Logical. If (Warning messages will always be printed.) |
CreateInfercnvObject |
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 |
require_above_min_mean_expr_cutoff |
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 |
require_above_min_cells_ref |
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 |
normalize_counts_by_seq_depth |
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 |
anscombe_transform |
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 |
log2xplus1 |
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 |
apply_max_threshold_bounds |
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 |
smooth_by_chromosome |
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 |
center_cell_expr_across_chromosome |
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 |
subtract_ref_expr_from_obs |
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 |
invert_log2 |
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 |
clear_noise_via_ref_mean_sd |
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 |
remove_outliers_norm |
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 |
define_signif_tumor_subclusters |
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 |
plot_cnv |
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 |
... |
Used to absorb deprecated arguments or functions. |
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.
An updated SPATA2
object containg the results in the respective slot.
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.