QRscore is an R package designed for analysis of differentially expressed genes (DEGs) and differentially dispersed genes (DDGs). The workflow is shown in the following figure.
QRscore requires the following packages to run effectively:
if (!requireNamespace("BiocManager", quietly = TRUE)) {
install.packages("BiocManager")
}
if (!requireNamespace("DESeq2", quietly = TRUE)) {
BiocManager::install("DESeq2")
}
if (!requireNamespace("BiocParallel", quietly = TRUE)) {
BiocManager::install("BiocParallel")
}
if (!requireNamespace("devtools", quietly = TRUE)) {
install.packages("devtools")
}
devtools::install_github("Fanding-Zhou/QRscore")
After installation, load QRscore and its dependencies:
library(QRscore)
library(DESeq2)
library(BiocParallel)
Here’s a brief example of how to use QRscore in your analysis pipeline:
- Preparing Data: QRscore takes in RNA-seq count matrix and group labels as input and perform prefiltering and normalization.
data("example_dataset_raw_3000_genes")
bulk_sparse_mat = example_dataset_raw_3000_genes$COUNTS
ages = example_dataset_raw_3000_genes$METADATA$AGE
## filter out low expressed genes
col_means <- colMeans(bulk_sparse_mat, na.rm = TRUE)
col_zeros <- colMeans(bulk_sparse_mat==0, na.rm = TRUE)
col_ids <- which(col_means>5&col_zeros<0.2) # The threshold can be modified
## normalization
bulk_df = bulk_sparse_mat[,col_ids]
bulk_df_inv = t(bulk_df)
coldata = data.frame(age = ages)
dds <- DESeqDataSetFromMatrix(countData = bulk_df_inv,
colData = coldata,
design = ~ age)
dds = estimateSizeFactors(dds)
normalized_mat <- counts(dds, normalized=TRUE)
- Running Analysis: Example code for setting up and performing the QRscore analysis.
kept_samples = coldata$age %in% c("40-49", "60-69")
normalized_mat = normalized_mat[, kept_samples]
coldata = coldata[kept_samples,]
results <- QRscore.genetest(normalized_mat_1, coldata_1, pairwise_test = TRUE, pairwise_logFC = TRUE, test_mean = TRUE, test_dispersion = TRUE, num_cores = 4, approx = "asymptotic")
- Interpreting Results: QRscore outputs include differential expression and differential dispersion p-values, together with log Fold Change and log Variance Change.
GPL (>= 3)
For more information and detailed usage, refer to the QRscore vignette, documentation and package help files.