### Install and load required packages Source: https://github.com/wubingzhang/mageckflute/blob/master/vignettes/MAGeCKFlute.Rmd Install MAGeCKFlute, clusterProfiler, and ggplot2 if not already installed, then load them. Use this setup before running any MAGeCKFlute analysis. ```R if(!"MAGeCKFlute" %in% installed.packages()) BiocManager::install("MAGeCKFlute") if(!"clusterProfiler" %in% installed.packages()) BiocManager::install("clusterProfiler") if(!"ggplot2" %in% installed.packages()) BiocManager::install("ggplot2") library(MAGeCKFlute) library(clusterProfiler) library(ggplot2) ``` -------------------------------- ### ConsistencyView example Source: https://github.com/wubingzhang/mageckflute/blob/master/man/ConsistencyView.Rd Example of using ConsistencyView with a data file read by ReadBeta, specifying control and treatment sample names. ```r file3 = file.path(system.file("extdata", package = "MAGeCKFlute"), "testdata/mle.gene_summary.txt") dd = ReadBeta(file3) ConsistencyView(dd, ctrlname = "Pmel1_Ctrl", treatname = "Pmel1") ``` -------------------------------- ### ViolinView example: ReadBeta and ViolinView Source: https://github.com/wubingzhang/mageckflute/blob/master/man/ViolinView.Rd Loads example data from the MAGeCKFlute package and creates a violin plot. The example reads a gene summary file using ReadBeta and then calls ViolinView on all columns except the first. ```r file3 = file.path(system.file("extdata", package = "MAGeCKFlute"), "testdata/mle.gene_summary.txt") dd = ReadBeta(file3) ViolinView(dd[, -1]) ``` -------------------------------- ### Run EnrichAnalyzer with example gene list Source: https://github.com/wubingzhang/mageckflute/blob/master/man/EnrichAnalyzer.Rd Loads the example geneList from the DOSE package and runs EnrichAnalyzer on the first 500 genes using the entrez keytype. The result is stored in keggA and the head of the result is displayed. This example is wrapped in \dontrun{} so it is not executed during package checks. ```r data(geneList, package = "DOSE") \dontrun{ keggA = EnrichAnalyzer(geneList[1:500], keytype = "entrez") head(keggA@result) } ``` -------------------------------- ### Run FluteRRA pipeline with example data Source: https://github.com/wubingzhang/mageckflute/blob/master/man/FluteRRA.Rd Example from the FluteRRA documentation. First, define file paths to the example gene summary and sgRNA summary files. Then, run the FluteRRA pipeline with the specified parameters, including proj="Pmel", organism="hsa", incorporateDepmap=FALSE, scale_cutoff=1, and outdir="./". The pipeline call is wrapped in \dontrun{}. ```r file1 = file.path(system.file("extdata", package = "MAGeCKFlute"), "testdata/rra.gene_summary.txt") file2 = file.path(system.file("extdata", package = "MAGeCKFlute"), "testdata/rra.sgrna_summary.txt") ``` ```r # Run the FluteRRA pipeline FluteRRA(file1, file2, proj="Pmel", organism="hsa", incorporateDepmap = FALSE, scale_cutoff = 1, outdir = "./") ``` -------------------------------- ### Install and load MAGeCKFlute and ggplot2 Source: https://github.com/wubingzhang/mageckflute/blob/master/vignettes/MAGeCKFlute_enrichment.Rmd Installs MAGeCKFlute and ggplot2 if not already installed, then loads both libraries. ```r if(!"MAGeCKFlute" %in% installed.packages()) BiocManager::install("MAGeCKFlute") if(!"ggplot2" %in% installed.packages()) BiocManager::install("ggplot2") library(MAGeCKFlute) library(ggplot2) ``` -------------------------------- ### Install MAGeCKFlute and dependencies in R Source: https://github.com/wubingzhang/mageckflute/blob/master/README.md Installs required R packages and MAGeCKFlute from Bioconductor or GitHub. The first two lines install dependencies, the third installs the released version, and the fourth installs the development version from GitHub. ```R > install.packages(c("devtools", "BiocManager"), repos = "https://cloud.r-project.org") > BiocManager::install(c("pathview", "biomaRt", "msigdbr", "dendextend", "pheatmap", "sva", "ggrepel", "knitr", "clusterProfiler", "depmap")) > BiocManager::install("MAGeCKFlute") # Released version # Or > devtools::install_github("liulab-dfci/MAGeCKFlute") ``` -------------------------------- ### getOrtAnn example Source: https://github.com/wubingzhang/mageckflute/blob/master/man/getOrtAnn.Rd Retrieves ortholog annotation from mouse (mmu) to human (hsa) and displays the first rows. The example is wrapped in \dontrun, so it is not executed during package checks. ```r ann = getOrtAnn("mmu", "hsa") head(ann) ``` -------------------------------- ### arrangePathview example: Read test data and call function Source: https://github.com/wubingzhang/mageckflute/blob/master/man/arrangePathview.Rd Loads example gene summary data using ReadBeta and renames columns to 'Control' and 'Treatment'. The actual arrangePathview call is commented out, showing the expected usage with pathway 'hsa00534' and organism 'hsa'. ```r file3 = file.path(system.file("extdata", package = "MAGeCKFlute"), "testdata/mle.gene_summary.txt") dd = ReadBeta(file3) colnames(dd)[2:3] = c("Control", "Treatment") # arrangePathview(dd, c("hsa00534"), title=NULL, sub=NULL, organism="hsa") ``` -------------------------------- ### Run FluteMLE with MAGeCK-MLE gene summary Source: https://github.com/wubingzhang/mageckflute/blob/master/man/FluteMLE.Rd Loads the example gene summary file path and runs FluteMLE with treatment sample 'Pmel1' and control sample 'Pmel1_Ctrl', setting the project name to 'Pmel1'. The example is wrapped in \dontrun{} so it is not executed during package checks. ```R file3 = file.path(system.file("extdata", package = "MAGeCKFlute"), "testdata/mle.gene_summary.txt") \dontrun{ # functional analysis for MAGeCK MLE results FluteMLE(file3, treatname = "Pmel1", ctrlname = "Pmel1_Ctrl", proj = "Pmel1") } ``` -------------------------------- ### enrich.GSE usage and example Source: https://github.com/wubingzhang/mageckflute/blob/master/man/enrich.GSE.Rd The usage section shows the function signature with all parameters. The example demonstrates running enrich.GSE on the DOSE geneList dataset with keytype 'entrez' and viewing the results. The example is wrapped in a dontrun block, indicating it should not be executed automatically. ```R enrich.GSE( geneList, keytype = "Symbol", type = "GOBP", organism = "hsa", pvalueCutoff = 1, limit = c(2, 100), gmtpath = NULL, by = "fgsea", verbose = TRUE, ... ) ``` ```R data(geneList, package = "DOSE") \dontrun{ enrichRes = enrich.GSE(geneList, keytype = "entrez") head(slot(enrichRes, "result")) } ``` -------------------------------- ### LoadDepmap example Source: https://github.com/wubingzhang/mageckflute/blob/master/man/loadDepmap.Rd Loads processed Depmap data into a variable named depmapDat. This example is wrapped in \dontrun{} and will not be executed during R CMD check. ```R \dontrun{ depmapDat = LoadDepmap() } ``` -------------------------------- ### Run EnrichedView on enrich.GSE results Source: https://github.com/wubingzhang/mageckflute/blob/master/man/EnrichedView.Rd Loads the geneList example data from the DOSE package, then runs an enrichment analysis with enrich.GSE and visualizes the top and bottom 5 enriched terms using EnrichedView. The example is wrapped in \dontrun{} so it is not executed during package checks. ```r data(geneList, package = "DOSE") \dontrun{ enrichRes = enrich.GSE(geneList, organism="hsa") EnrichedView(enrichRes, top = 5, bottom = 5) } ``` -------------------------------- ### normalize.loess example Source: https://github.com/wubingzhang/mageckflute/blob/master/man/normalize.loess.Rd Example usage of normalize.loess on a beta matrix read from a test data file. ```r file3 = file.path(system.file("extdata", package = "MAGeCKFlute"), "testdata/mle.gene_summary.txt") dd = ReadBeta(file3) beta_loess = normalize.loess(dd[,-1]) ``` -------------------------------- ### HeatmapView example: ReadBeta and correlation heatmap Source: https://github.com/wubingzhang/mageckflute/blob/master/man/HeatmapView.Rd Loads a gene summary file, computes the correlation matrix, and draws a heatmap with display_numbers = TRUE. The example uses the built-in test data from the MAGeCKFlute package. ```R file3 = file.path(system.file("extdata", package = "MAGeCKFlute"), "testdata/mle.gene_summary.txt") dd = ReadBeta(file3) gg = cor(dd[,2:ncol(dd)]) HeatmapView(gg, display_numbers = TRUE) ``` -------------------------------- ### Write GMT file example Source: https://github.com/wubingzhang/mageckflute/blob/master/man/writeGMT.Rd Example usage of writeGMT: assigns a data frame from gsGetter and shows a commented-out call to writeGMT. ```R gene2path = gsGetter(type = "Complex") # writeGMT(gene2path, "Protein_complex.gmt") ``` -------------------------------- ### SquareView example: Create a 9-quadrant scatter plot Source: https://github.com/wubingzhang/mageckflute/blob/master/man/SquareView.Rd This example loads a sample gene summary file and creates a SquareView plot. It uses the ReadBeta function to read the data and then calls SquareView with control and treatment sample names, labeling genes by the 'Gene' column. ```R file3 = file.path(system.file("extdata", package = "MAGeCKFlute"), "testdata/mle.gene_summary.txt") dd = ReadBeta(file3) SquareView(dd, ctrlname = "Pmel1_Ctrl", treatname = "Pmel1", label = "Gene") ``` -------------------------------- ### MapRatesView example Source: https://github.com/wubingzhang/mageckflute/blob/master/man/MapRatesView.Rd Loads a count summary file from the MAGeCKFlute package and calls MapRatesView to plot the mapping ratio. ```R file4 = file.path(system.file("extdata", package = "MAGeCKFlute"), "testdata/countsummary.txt") countsummary = read.delim(file4, check.names = FALSE) MapRatesView(countsummary) ``` -------------------------------- ### Install libxml2 dependency for MAGeCKFlute Source: https://github.com/wubingzhang/mageckflute/blob/master/README.md Installs the libxml2 package via conda, which is required by the R package XML. ```bash conda install -c anaconda libxml2 ``` -------------------------------- ### View sgRNA rank with sgRankView Source: https://github.com/wubingzhang/mageckflute/blob/master/man/sgRankView.Rd Loads example sgRNA summary data from the MAGeCKFlute package and calls sgRankView to plot the rank. The example uses the built-in test data file 'rra.sgrna_summary.txt'. ```R file2 = file.path(system.file("extdata", package = "MAGeCKFlute"), "testdata/rra.sgrna_summary.txt") sgrra = ReadsgRRA(file2) sgRankView(sgrra) ``` -------------------------------- ### ScatterView basic example with auto_cut and group labeling Source: https://github.com/wubingzhang/mageckflute/blob/master/man/ScatterView.Rd Loads test data with ReadBeta and creates a scatter plot comparing Pmel1_Ctrl vs Pmel1, labeling genes based on auto_cut=1 and highlighting the topright group with top 5 labels, displaying cutoff lines. ```R file3 = file.path(system.file("extdata", package = "MAGeCKFlute"), "testdata/mle.gene_summary.txt") dd = ReadBeta(file3) ScatterView(dd, x = "Pmel1_Ctrl", y = "Pmel1", label = "Gene", auto_cut = 1, groups = "topright", top = 5, display_cut = TRUE) ``` -------------------------------- ### ResembleDepmap usage example Source: https://github.com/wubingzhang/mageckflute/blob/master/man/ResembleDepmap.Rd Loads example gene summary data with ReadRRA, then in a dontrun block omits common essential genes with OmitCommonEssential and computes Depmap similarity with ResembleDepmap, printing the first rows of the result. ```r file1 = file.path(system.file("extdata", package = "MAGeCKFlute"), "testdata/rra.gene_summary.txt") gdata = ReadRRA(file1) \dontrun{ rra.omit = OmitCommonEssential(gdata) depmap_similarity = ResembleDepmap(rra.omit) head(depmap_similarity) } ``` -------------------------------- ### Configure conda channels for MAGeCKFlute installation Source: https://github.com/wubingzhang/mageckflute/blob/master/README.md Adds the conda-forge, bioconda, and r channels as package sources for conda, required before installing MAGeCKFlute. ```bash $ conda config --add channels conda-forge $ conda config --add channels bioconda $ conda config --add channels r ``` -------------------------------- ### hclustView example with USArrests Source: https://github.com/wubingzhang/mageckflute/blob/master/man/hclustView.Rd Clusters the USArrests dataset using the default agglomeration method and displays the dendrogram with colored labels and bars. The label_cols and bar_cols are set to the row names of the dataset. ```r label_cols = rownames(USArrests) hclustView(dist(USArrests), label_cols=label_cols, bar_cols=label_cols) ``` -------------------------------- ### BatchRemove example Source: https://github.com/wubingzhang/mageckflute/blob/master/man/BatchRemove.Rd Creates a simulated expression matrix with 1000 genes and 4 samples, constructs a batch matrix with sample names and batch labels (two batches of two samples each), applies BatchRemove, and prints the pca plot object. ```R edata = matrix(c(rnorm(2000, 5), rnorm(2000, 8)), 1000) colnames(edata) = paste0("s", 1:4) batchMat = data.frame(sample = colnames(edata), batch = rep(1:2, each = 2)) edata1 = BatchRemove(edata, batchMat) print(edata1$p) ``` -------------------------------- ### NormalizeBeta with cell_cycle method (mmu) Source: https://github.com/wubingzhang/mageckflute/blob/master/man/NormalizeBeta.Rd Performs cell_cycle normalization on the read beta data with organism set to 'mmu'. The example is wrapped in \dontrun because it may require additional interaction or time. Displays the head of the normalized result. ```R \dontrun{ #Cell Cycle normalization dd_essential = NormalizeBeta(dd, method="cell_cycle", org = "mmu") head(dd_essential) } ``` -------------------------------- ### enrich.HGT example Source: https://github.com/wubingzhang/mageckflute/blob/master/man/enrich.HGT.Rd Example usage of enrich.HGT with a gene list from the DOSE package, specifying KEGG pathway enrichment and using Entrez gene identifiers. ```r data(geneList, package = "DOSE") genes <- geneList[1:300] enrichRes <- enrich.HGT(genes, type = "KEGG", keytype = "entrez") head(slot(enrichRes, "result")) ``` -------------------------------- ### Generate a density plot of beta score deviation Source: https://github.com/wubingzhang/mageckflute/blob/master/man/DensityDiffView.Rd This example demonstrates how to read a gene summary file and visualize the distribution of score differences between control and treatment groups using DensityDiffView. ```R file3 = file.path(system.file("extdata", package = "MAGeCKFlute"), "testdata/mle.gene_summary.txt") dd = ReadBeta(file3) # Density plot of beta score deviation between control and treatment DensityDiffView(dd, ctrlname = "Pmel1_Ctrl", treatname = "Pmel1") ``` -------------------------------- ### Create a bar plot with BarView Source: https://github.com/wubingzhang/mageckflute/blob/master/man/BarView.Rd Creates a bar plot from a data frame. The example uses a data frame with groups and counts, then calls BarView with x and y arguments. ```R mdata = data.frame(group=letters[1:5], count=sample(1:100,5)) BarView(mdata, x = "group", y = "count") ``` -------------------------------- ### Get KEGG code and annotation package for human Source: https://github.com/wubingzhang/mageckflute/blob/master/man/getOrg.Rd Calls getOrg with the argument "human" and prints the annotation package name from the returned list. The default organism is "hsa" and can also be "human" (case insensitive). ```r ann = getOrg("human") print(ann$pkg) ``` -------------------------------- ### Create a volcano plot with VolcanoView for MAGeCKFlute data Source: https://github.com/wubingzhang/mageckflute/blob/master/man/VolcanoView.Rd The example first locates an example data file from the MAGeCKFlute package and reads it with ReadRRA, then generates a volcano plot using VolcanoView, specifying the x-axis as 'Score', the y-axis as 'FDR', and the gene identifiers as 'id'. Graphics parameters like x_cutoff and y_cutoff are not overridden, so defaults are used. ```R file1 = file.path(system.file("extdata", package = "MAGeCKFlute"), "testdata/rra.gene_summary.txt") gdata = ReadRRA(file1) VolcanoView(gdata, x = "Score", y = "FDR", Label = "id") ``` -------------------------------- ### Visualization for GSEA enriched categories Source: https://github.com/wubingzhang/mageckflute/blob/master/vignettes/MAGeCKFlute_enrichment.Rmd Shows GSEA results for one pathway using gseaplot and for multiple pathways using gseaplot2. The example selects the first positive NES pathway and the top three positive NES pathways. ```R ```{r gseaplot2, fig.height=5, fig.width=7, dpi=150} # show GSEA results of one pathway idx = which(gseRes1$NES>0)[1] gseaplot(gseRes1, geneSetID = idx, title = gseRes1$Description[idx]) # show GSEA results of multiple pathways gseaplot2(gseRes1, geneSetID = which(gseRes1$NES>0)[1:3]) ``` ``` -------------------------------- ### Select signatures with Selector function Source: https://github.com/wubingzhang/mageckflute/blob/master/man/Selector.Rd Example usage of Selector: creates a random matrix of 1000 genes and 30 samples, then selects signatures with a 0.68 proportion threshold. The result is stored in 'hits' and the ggplot object is printed. ```R mat = matrix(rnorm(1000*30), 1000, 30) rownames(mat) = paste0("Gene", 1:1000) colnames(mat) = paste0("Sample", 1:30) hits = Selector(mat, select = 0.68) print(hits$p) ``` -------------------------------- ### Run EnrichedGeneView with DOSE geneList Source: https://github.com/wubingzhang/mageckflute/blob/master/man/EnrichedGeneView.Rd Loads the example geneList from the DOSE package and, inside a \dontrun block, runs enrichment with enrich.GSE using Entrez keytype, then calls EnrichedGeneView with the enrichment result slot and the geneList. The \dontrun wrapper means the code is not executed during package checks. ```r data(geneList, package = "DOSE") \dontrun{ enrichRes <- enrich.GSE(geneList, keytype = "Entrez") EnrichedGeneView(enrichment=slot(enrichRes, "result"), geneList, keytype = "Entrez") } ``` -------------------------------- ### Read count summary data with read.delim Source: https://github.com/wubingzhang/mageckflute/blob/master/vignettes/MAGeCKFlute.Rmd Reads the count summary file from the MAGeCKFlute example dataset using read.delim. The file path is constructed with system.file and file.path. The resulting data frame is stored as countsummary and the first rows are displayed with head(). ```R file4 = file.path(system.file("extdata", package = "MAGeCKFlute"), "testdata/countsummary.txt") countsummary = read.delim(file4, check.names = FALSE) head(countsummary) ``` -------------------------------- ### Run over-representation enrichment on top 100 genes from DOSE geneList Source: https://github.com/wubingzhang/mageckflute/blob/master/man/enrich.ORT.Rd Loads the example geneList from the DOSE package, takes the first 100 genes as a numeric vector, runs enrich.ORT with Entrez keytype, and prints the head of the result slot. ```R data(geneList, package = "DOSE") genes <- geneList[1:100] enrichedRes <- enrich.ORT(genes, keytype = "entrez") head(slot(enrichedRes, "result")) ``` -------------------------------- ### Visualize QC results with BarView and MapRatesView Source: https://github.com/wubingzhang/mageckflute/blob/master/vignettes/MAGeCKFlute.Rmd Creates three quality control plots: Gini index bar chart, missed sgRNAs bar chart (log10 of zero counts), and read mapping visualization. The mapping plot uses MapRatesView or a custom stacked bar chart with manual color scaling. The code uses the countsummary data frame from the previous example. ```R # Gini index BarView(countsummary, x = "Label", y = "GiniIndex", ylab = "Gini index", main = "Evenness of sgRNA reads") # Missed sgRNAs countsummary$Missed = log10(countsummary$Zerocounts) BarView(countsummary, x = "Label", y = "Missed", fill = "#394E80", ylab = "Log10 missed gRNAs", main = "Missed sgRNAs") # Read mapping MapRatesView(countsummary) # Or countsummary$Unmapped = countsummary$Reads - countsummary$Mapped gg = reshape2::melt(countsummary[, c("Label", "Mapped", "Unmapped")], id.vars = "Label") gg$variable = factor(gg$variable, levels = c("Unmapped", "Mapped")) gg = gg[order(gg$Label, gg$variable), ] p = BarView(gg, x = "Label", y = "value", fill = "variable", position = "stack", xlab = NULL, ylab = "Reads", main = "Map ratio") p + scale_fill_manual(values = c("#9BC7E9", "#1C6DAB")) ``` -------------------------------- ### Limit gene set size with EnrichAnalyzer Source: https://github.com/wubingzhang/mageckflute/blob/master/vignettes/MAGeCKFlute_enrichment.Rmd Use EnrichAnalyzer with the 'limit' parameter to restrict the size of gene sets (e.g., c(2, 80)) for testing, focusing on core pathway genes. The example uses the first 200 genes from 'genelist' with type 'GOBP' and organism 'mmu', then visualizes the top 5 enriched pathways with EnrichedView. ```R enrich = EnrichAnalyzer(genelist[1:200], type = "GOBP", limit = c(2, 80), organism = "mmu") EnrichedView(enrich, top = 5) ``` -------------------------------- ### Read MAGeCK-RRA gene and sgRNA summary files Source: https://github.com/wubingzhang/mageckflute/blob/master/vignettes/MAGeCKFlute.Rmd Reads the RRA gene summary and sgRNA summary files from the example dataset using ReadRRA and ReadsgRRA functions. The file paths are constructed with system.file and file.path. The first rows of each data frame are displayed with head(). ```R file1 = file.path(system.file("extdata", package = "MAGeCKFlute"), "testdata/rra.gene_summary.txt") gdata = ReadRRA(file1) head(gdata) file2 = file.path(system.file("extdata", package = "MAGeCKFlute"), "testdata/rra.sgrna_summary.txt") sdata = ReadsgRRA(file2) head(sdata) ``` -------------------------------- ### Batch effect removal with HeatmapView and BatchRemove Source: https://github.com/wubingzhang/mageckflute/blob/master/vignettes/MAGeCKFlute.Rmd Checks for batch effects using a correlation heatmap and removes them with BatchRemove when samples cluster by batch. The example creates a synthetic expression matrix, visualizes the correlation, then applies BatchRemove with a batch matrix and prints the adjusted data and p-value. ```R ##Before batch removal edata = matrix(c(rnorm(2000, 5), rnorm(2000, 8)), 1000) colnames(edata) = paste0("s", 1:4) HeatmapView(cor(edata)) ## After batch removal batchMat = data.frame(sample = colnames(edata), batch = rep(1:2, each = 2)) edata1 = BatchRemove(edata, batchMat) head(edata1$data) print(edata1$p) ``` -------------------------------- ### getGeneAnn example: retrieve and inspect annotations Source: https://github.com/wubingzhang/mageckflute/blob/master/man/getGeneAnn.Rd Example usage of getGeneAnn with the default organism 'hsa'. The function returns a data frame of gene annotations. The example is wrapped in \dontrun{} to prevent execution during package checks. ```r ann = getGeneAnn("hsa") head(ann) ``` -------------------------------- ### OmitCommonEssential example (dontrun) Source: https://github.com/wubingzhang/mageckflute/blob/master/man/OmitCommonEssential.Rd Example usage of OmitCommonEssential. It reads a gene summary file using ReadRRA, then applies OmitCommonEssential to remove common essential genes. The example is wrapped in \dontrun and is not executed during R CMD check. ```R file1 = file.path(system.file("extdata", package = "MAGeCKFlute"), "testdata/rra.gene_summary.txt") gdata = ReadRRA(file1) dim(gdata) rra.omit = OmitCommonEssential(gdata) dim(rra.omit) ``` -------------------------------- ### EnrichedFilter example with enrich.HGT and geneList Source: https://github.com/wubingzhang/mageckflute/blob/master/man/EnrichedFilter.Rd Example usage of EnrichedFilter. It first runs enrichment analysis with enrich.HGT on the geneList data from the DOSE package, then applies EnrichedFilter to simplify the results. The example is wrapped in \dontrun{} to prevent execution during package checks. ```r data(geneList, package = "DOSE") \dontrun{ enrichRes <- enrich.HGT(geneList, keytype = "entrez") EnrichedFilter(enrichRes) } ``` -------------------------------- ### Create density plot with DensityView Source: https://github.com/wubingzhang/mageckflute/blob/master/man/DensityView.Rd Loads a sample gene summary file with ReadBeta and creates a density plot for selected samples. The commented alternative plots all columns except the first. ```R file3 = file.path(system.file("extdata", package = "MAGeCKFlute"), "testdata/mle.gene_summary.txt") dd = ReadBeta(file3) DensityView(dd, samples=c("Pmel1_Ctrl", "Pmel1")) #or DensityView(dd[,-1]) ``` -------------------------------- ### Set up knitr options Source: https://github.com/wubingzhang/mageckflute/blob/master/vignettes/MAGeCKFlute_enrichment.Rmd Configures knitr chunk options for the vignette, including tidy=FALSE, cache=TRUE, dev='png', and message=FALSE. ```r knitr::opts_chunk$set(tidy=FALSE, cache=TRUE, dev="png", message=FALSE, error=FALSE, warning=TRUE) ``` -------------------------------- ### ConsistencyView usage Source: https://github.com/wubingzhang/mageckflute/blob/master/man/ConsistencyView.Rd Function signature for ConsistencyView, showing its parameters: dat, ctrlname, treatname, main, filename, width, height, and ... ```r ConsistencyView( dat, ctrlname, treatname, main = NULL, filename = NULL, width = 5, height = 4, ... ) ``` -------------------------------- ### Run FluteRRA pipeline with gene and sgRNA summary files Source: https://github.com/wubingzhang/mageckflute/blob/master/vignettes/MAGeCKFlute.Rmd Use this snippet to run the FluteRRA pipeline with the required gene summary file and optional sgRNA summary file. It sets up file paths and calls FluteRRA with either only the gene summary or both files. The output is saved to the current directory with project name 'Pmel1' and organism 'mmu'. ```R ## path to the gene summary file (required) file1 = file.path(system.file("extdata", package = "MAGeCKFlute"), "testdata/rra.gene_summary.txt") ## path to the sgRNA summary file (optional) file2 = file.path(system.file("extdata", package = "MAGeCKFlute"), "testdata/rra.sgrna_summary.txt") # Run FluteRRA with only gene summary file FluteRRA(file1, proj="Pmel1", organism="mmu", outdir = "./") # Run FluteRRA with both gene summary file and sgRNA summary file FluteRRA(file1, file2, proj="Pmel1", organism="mmu", outdir = "./") ```