View source: R/Deseq_analysis.R
Deseq_analysis | R Documentation |
This function performs a differential expression analysis using the DESeq2 package. It is designed to work with microbiome data and can handle paired or non-paired samples.
Deseq_analysis(
taxobj,
taxlevel,
comparison = NULL,
cutoff,
control_name,
paired = FALSE,
subject = NULL
)
taxobj |
Configured tax summary objects.See in |
taxlevel |
The taxonomic level for the analysis.Must be one of c("Domain","Phylum","Class","Order","Family","Genus","Species","Base") |
comparison |
A vector of conditions to compare. Default: NULL, all unique conditions are compared (only for Two groups). |
cutoff |
The log2 fold change cutoff for considering as differential taxon. |
control_name |
Character. The name of the control group for the comparison. |
paired |
Logical. Should the samples be treated as paired? Default: False |
subject |
Optional. The subject identifier for paired samples. Default: Null |
A data frame with the results of the differential expression analysis.
Regulation is judged by cutoff of q-value(adjust p value).Detail see in DESeq
For more than two groups in taxobj, the 'comparison' must be assigned.
The function requires the 'DESeq2', 'S4Vectors', and 'tibble' packages.
Wang Ningqi 2434066068@qq.com
DESeqDataSetFromMatrix
, DESeq
, DataFrame
, as_tibble
if (requireNamespace("DESeq2", quietly = TRUE) &&
requireNamespace("S4Vectors", quietly = TRUE) &&
requireNamespace("tibble", quietly = TRUE)) {
### Data preparation ###
data("Two_group")
### Deseq analysis ###
deseq_results <- Deseq_analysis(
taxobj = Two_group,
taxlevel = "Genus",
cutoff = 1,
control_name = "Control"
)
# Visualization of volcano plot ##
volcano_plot <- volcano_plot(
inputframe = deseq_results,
cutoff = 1,
aes_col = Two_group$configuration$treat_col
)
volcano_plot$FC_FDR
volcano_plot$Mean_FC
# Visualization of Manhattan plot ##
manhattan_object <- manhattan(
inputframe = deseq_results,
taxlevel = "Phylum",
control_name = "Control",
mode = "most",
top_n = 10,
rmprefix = "p__"
)
manhattan_object$manhattan # Tradition manhattan plot
manhattan_object$manhattan_circle # Circular manhattan plot
# For object with more than two groups
### Data preparation ###
data("Three_group")
# Specific comparison
deseq_results_BFCF <- Deseq_analysis(
taxobj = Three_group,
taxlevel = "Genus",
comparison = c("BF", "CF"),
cutoff = 1,
control_name = "CF"
)
volcano_plot <- volcano_plot(
inputframe = deseq_results_BFCF,
cutoff = 1,
aes_col = Three_group$configuration$treat_col
)
volcano_plot$FC_FDR
} else {
message(
"The 'DESeq2', 'S4Vectors', and/or 'tibble' package(s) are not installed. ",
"Please install them to use all features of Deseq_analysis."
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.