ScreenR 1.15.16
New
plot_volcano(): every gene with the mean log2 fold change of its barcodes and its -log10 FDR, from the table of one method or ofsummarise_hits()(with the barcode statistics); the most significant hits are labelled andgenescircles the genes to follow. Used in Tutorials 3 and 4.New ScreenR app,
run_screenr_app(): the analysis of a screen in the web browser without writing code, for the people who did the experiment. It loads an example screen, a count table or a MAGeCK count file, describes the samples, shows the quality control, finds the hits with FRY, CAMERA and the Z-score tests, and shows each hit at the level of its barcodes; tables and an R script that repeats the analysis can be downloaded. It needs shiny, bslib and DT (suggested packages). See Tutorial 5.New design of the pkgdown site: frosted glass panels and a floating navbar over a soft colour field, with a light that follows the cursor and a light/dark/auto switch. The home page has highlights and buttons, the tutorials a progress indicator with previous/next links, the articles a reading progress bar; figures can be enlarged, Cmd/Ctrl + K opens the search, the reference index is grouped in cards, and a pair of scissors cuts the DNA of the logo. Animations stop with the reduced motion setting of the system, and the site has a card for links shared on social media.
The README, the pkgdown home page, the DESCRIPTION and the package help describe shRNA and CRISPR-Cas9 screens. The README quick start uses a sample table, palettes,
theme_set(), FRY, CAMERA and the empirical null, and adds a CRISPR dropout example; its method table follows Tutorial 3. The workflow diagram shows the CRISPR steps and the tests across time points.plot_mds()andplot_pca()leave room for the labels of the samples at the edges of the plot.plot_treatment_separation()plots a time course: whencondition_columnandtime_columnare the same variable (for example “Day” in a dropout screen),treatmentcan be several time points and each is compared with thecontroltime point, with every time point on the x axis. Previously this found no shared stage and gave an error. With realtimethe labels of the first and last time points are no longer clipped.compute_metrics(condition_column = "Day")compares two time points (control = "T0", treatment = "T18"), for dropout screens without a treatment;dayis then not used. The default compares a treatment and a control at the time pointday, as before.Dropout screens (Tutorial 4, the empirical null and the MAGeCK benchmark vignettes, the examples) are described with the time points in the Daya column and a single Treatment,
"Untreated", for all the samples.Tutorial 4 checks the lost sgRNAs (
barcode_lost(),plot_barcode_lost(),plot_barcode_lost_for_gene()), compares the time points withplot_zscore_distribution(),compute_slope()andplot_treatment_separation(), usesfind_common_hit()andfind_consistent_hit(), and inspects the sgRNAs of ten hits withplot_barcode_hit(),plot_barcode_trend(),plot_barcode_heatmap(),find_discordant_barcodes()andfilter_by_variance().Tutorial 4 estimates the efficiency of the sgRNAs from the depletion of the core essential genes, checks that it is reproducible between independent cultures and relates it to the GC content and the nucleotide next to the PAM.
Tutorial 3 (finding and validating hits) uses the current functions: a sample table and palettes at creation,
theme_set(), TMM normalization, FRY as the recommended test, the empirical null,plot_common_hit()with any number of methods (UpSet plot),find_consistent_hit(),find_time_hit()with real times, andplot_trend(color_by = ),plot_treatment_separation()andplot_barcode_heatmap()to check the candidates.Tutorial 4 (CRISPR-Cas9 screens) uses palettes,
theme_set(), the trend of the reference genes over the real days, their sgRNAs withplot_barcode_heatmap(), the overlap of the methods withplot_common_hit(), and explains how the baseline of the normalization affects the self-contained tests.plot_treatment_separation()plots descriptive treatment/control abundance ratios for any two condition labels and configurable time metadata. It retains all selected stages, supports real times and sample subsets, and inherits the user theme. Missing comparisons are never assigned zero effects.plot_trend(color_by = "Treatment")overlays separate condition trends with biological sample points and lines joining time-point means. The original ungrouped regression remains the default without color_by;trend = "lm"explicitly fits separate regressions. Object palettes are used, andreference_groupsshows shared baselines once as neutral points.connect_referencejoins the shared reference history to condition means;highlight_differenceshades the observed gap between two conditions. No theme is applied by these new plots; usetheme_set()in user code.plot_barcode_heatmap()shows individual barcode abundances across samples, with gene and sample-variable panels. Display log2 normalized counts, barcode-centered values or values relative to explicit reference samples.Model designs now carry sample identifiers and are checked against the object before fitting. Custom designs must have sample identifiers as row names in object order. Named contrast vectors and one-column contrast matrices are aligned to coefficient names; missing, duplicated and unknown names are rejected. Unnamed numeric contrast vectors remain positional.
Package checks, coverage and website builds now run on pushes and pull requests to devel. Website builds on devel do not deploy GitHub Pages.
find_consistent_hit()tests directional effects shared by all supplied contrasts using FRY, ROAST, CAMERA or gene-level Z-scores (random or empirical reference).combine_consistent_hits()accepts complete one-sided gene-level p-value tables, combines their raw p-values with an intersection-union test and applies BH or BY correction across genes. Missing or duplicated genes and invalid p-values are errors.find_camera_hit()andfind_roast_hit()gainkeep_all = TRUEto retain opposite observed directions with their requested one-sided p-values; defaults are unchanged. The longitudinal vignette uses the built-in consistency test.Palettes:
create_screenr_object(palettes = )and the newset_palettes()/get_palettes()store colors for the values of the sample variables (Treatment, Group, Day, Sample, …), checked against the object and kept when it is subset. Every plot that colors the samples by one of these variables uses them:plot_mapped_reads(),plot_mapped_reads_distribution(),plot_barcode_lost(),plot_barcode_lost_for_gene(),plot_gini(),plot_mds(),plot_pca()andplot_boxplot(). An explicitpaletteargument replaces the palette of the object.plot_mds()andplot_pca()accept the name of a sample variable ingroups(for examplegroups = "Treatment").plot_zscore_distribution(), which receives the tables ofcompute_metrics()rather than the object, has a newpaletteargument (for examplepalette = get_palettes(object)$Day).The longitudinal vignette sets palettes at the creation of the object and uses TMM normalization throughout.
plot_common_hit()has been rewritten: it takes the results of any number of methods, from any hit-finding function of ScreenR (find_gene_zscore_hit(),find_camera_hit(),find_roast_hit(),find_time_hit(),find_zscore_hit(), …) or vectors of gene names, as separate arguments or as one named list, with an optionalfdrthreshold for results computed withfdr = 1. Up to three methods give a Venn diagram, more an UpSet plot (typechooses). Both are drawn with ggplot2 and patchwork and apply no theme, so ScreenR no longer depends on ggvenn. Barcode-level tables are refused. Calls of previous versions keep working (unnamed results are now labelled with the expression given, excepthit_zscore,hit_cameraandhit_roast, which keep their labels).find_common_hit()takes the same input asplot_common_hit(): any number of methods, withcommon_in(all the methods by default) andfdr.The longitudinal vignette compares five methods at each time point with UpSet plots, ranks the candidates with explicit rules (agreement of the self-contained tests, number of shRNAs, discordant shRNAs, dependence on one replicate, fitness, time trend) and ends with the hits to validate and their plots at T3 and T4. It sets the ggplot2 theme with
theme_set().find_time_hit()has a new argumenttime, the real time of each time point (for exampletime = c(Time3 = 7, Time4 = 14)), validated as incompute_slope()andplot_trend(). The model is then fitted against the actual time andLog2FCis the change of the treatment effect per unit of time. By default (time = NULL) the time points are numbered 0, 1, 2, … as before, so existing results do not change; with two time points the p-values are the same with or without real times.compute_slope(),filter_by_slope()andplot_trend()reject times that are not finite.New vignette “Analysis of a longitudinal screen: from counts to treatment-specific hits”, a complete analysis of the example screen (T0, post-puromycin baseline, control and treated cultures at two time points with three replicates): quality control, one normalization for the whole analysis, one edgeR model with all the samples, treatment effects at each time point, the difference between depletion at both time points (intersection-union test), on average and changing over time (
find_time_hit()), fitness genes shared by all the cultures, evidence at the level of the shRNAs, a sensitivity analysis and the current limitations of ScreenR for longitudinal designs.
One source of truth for the data
- The ScreenR object stores each piece of information once, in its SummarizedExperiment parts: the raw counts in
assay(object, "counts")(one row per barcode, one column per sample, the barcode identifiers as row names), the annotation of the barcodes in the rowData, the sample information, groups and per-sample replicate labels in the colData. The normalized counts and the data table are no longer stored: they are computed from these parts when needed, so they cannot get out of date.compute_data_table()only checks that the object is normalized and is no longer necessary. - Barcode identifiers are always character and never become count columns: numeric identifiers are converted to their decimal form (10208 and “10208” are the same barcode, 1e5 is “100000”), in the count table, the annotation and the control barcodes.
- Stricter input checks in
create_screenr_object()andset_count_table(): missing identifiers, and missing, infinite or negative counts are errors; duplicated barcodes are an error unlessduplicate_barcodes = "sum"or"first"(the examplecount_tablehas three “*” rows: remove them, as the tutorials do); barcodes annotated more than once with different values are an error unlessduplicate_annotation = "first"(exact copies are merged). - The object is checked (validity method): unique identifiers, a Barcode column of the rowData equal to the row names, valid counts and a complete normalization.
assay<-,assays<-,rowData<-,colData<-(and$<-) anddimnames<-keep these rules (see?"screenr_object-replace"). - Changes propagate: replacing the counts with different values (with
set_count_table()orassay<-) removes the normalization; normalizing again changes every view at once; replacing the annotation (set_annotation_table()orrowData<-) changes the gene of each barcode in all the following analyses; subsetting and reordering keep the barcodes, the annotation and the samples aligned by identifier. -
get_annotation_table()returns the annotation of the barcodes of the object (rowData) followed by the annotation rows of barcodes that are not in the count table, which are kept apart.barcodes_per_gene()counts the barcodes of the object. -
set_data_table()is deprecated: the data table cannot be replaced (it only accepts the current data table, with a warning).set_normalized_count_table()only accepts tables that scale each sample by one factor, stored as effective library sizes (method “custom”).
One normalization for the whole analysis
-
normalize_data()no longer stores normalized counts: it records the effective library size of each sample incolData(object)$EffectiveLibSizeand the method, the control barcodes and the provenance inmetadata(object)$normalization(see the newget_normalization()). The raw counts are never changed. - The same normalization is used everywhere: the normalized counts, the data table and everything computed from it (
compute_metrics(), the plots,compute_slope(), …),plot_mds(),plot_pca(),plot_explained_variance(),plot_replicate_correlation()and the edgeR and limma models.create_edger_obj(), used byfind_camera_hit(),find_roast_hit()(ROAST and FRY),compute_barcode_statistics(),find_time_hit(),filter_by_variance()andplot_barcode_hit(), builds the DGEList from the raw counts with the effective library sizes as library sizes (normalization factors 1), so the offsets of the models are the same normalization as the plots and TMM is applied once. - Before, the edgeR/limma based methods always used the total counts of the object (CPM), whatever the method of
normalize_data(), andplot_replicate_correlation()used CPM too. Results change withmethod = "tmm"or"control": in the HAP1 screen (day 18 vs T0) FRY calls 694 genes with TMM and 979 with the non-essential sgRNAs as controls at 5% FDR, where it called 721 with any method before. With the default"cpm"the results are unchanged, except when the object was subset after normalization: the models now use the library sizes of the normalization instead of the totals of the retained barcodes (small changes, at most 0.09 in log10 p-value in a test on 300 genes). - Operations that need normalized counts (data table, metrics, trend and sample plots, statistical methods) stop with an informative error when the object is not normalized, instead of using empty tables or normalizing silently (
plot_mds(),plot_pca()andplot_explained_variance()used CPM silently). Raw-count quality control (compute_gini(),mapped_reads(),barcode_lost(), …) does not need normalization. - Zero library sizes, and control barcodes that are missing (all of them) or have no reads in a sample, are errors in
normalize_data(); control barcodes partly missing give a warning. -
?normalize_dataexplains that TMM corrects only part of the compositional bias when many barcodes change in the same direction (about half in a simulation with 20% of the genes depleted 8 times), while control barcodes remove it.
Objects of older versions
-
update_screenr_object()(called by all the functions) converts objects created before 1.15.8 and objects of versions 1.15.8 to 1.15.15. Their normalized counts and data table are not kept, because their normalization was not recorded: runnormalize_data()on the converted object (a message says so). The internal example object has been converted and normalized with “cpm” (its normalized counts are identical to the old ones).
ScreenR 1.15.15
- New tutorial “Tutorial 4: CRISPR-Cas9 screens”: installing CRISPRcleanR, describing a time-course dropout screen, choosing the sgRNA thresholds, checking the screen with reference genes, correcting copy-number bias with
correct_crispr_bias(), finding the hits with the non-essential genes as reference, and positive-selection screens. - New datasets
hap1_count_tableandhap1_annotation_table: a subset of the HAP1 TKOv3 CRISPR-Cas9 knockout screen of Hart et al. (2017), with the genomic position of each sgRNA. -
correct_crispr_bias()documents that CRISPRcleanR must be run on the complete genome-wide library: on a subset of genes enriched in hits it removes real signal. - Tutorial 4 adds FRY (
find_roast_hit()) to the comparison of the methods (with a single T0 sample it works, as the variability is estimated from the replicates of the other time points), shows how conservative the methods without reference are on this subset enriched in essential genes, and explains the positive fold change of the non-essential genes after CPM normalization (normalizing to their sgRNAs puts them back at 0). -
find_discordant_barcodes()documents that it is for inspecting the hits, not for filtering the barcodes before finding them: the filter is circular and, in the K562 screen, finds fewer essential and more non-essential genes. - Tutorial 4 shows the general quality control plots on the HAP1 screen (
plot_mapped_reads(),plot_mapped_reads_distribution(),plot_mds(),plot_explained_variance()andplot_boxplot()). -
plot_boxplot()orders the fill legend as the samples (T0, T3, T18), not alphabetically (T0, T18, T3). -
plot_barcode_hit()is drawn with ggplot2 instead oflimma::barcodeplot()and returns a ggplot object (it returned NULL), so it can be saved, themed and combined with other plots. No theme is applied. It has the same enrichment line and barcode strip, the barcodes are colored by their log2 fold change, and a new panel (show_log2fc, TRUE by default) shows the log2 fold change of all the barcodes with those of the gene. -
plot_reference_separation()no longer appliestheme_bw(): set the theme withggplot2::theme_set()or by adding it to the plot. - Clearer axis labels: “Explained variance” and “Principal component” in
plot_explained_variance()(it said “Expressed Variance”), the dimensions ofplot_mds()with the share of variance they explain, “Mapped reads” inplot_mapped_reads(), “Reads per barcode” inplot_mapped_reads_distribution(), “Lost barcodes” inplot_barcode_lost()andplot_barcode_lost_for_gene(), “Normalized counts” inplot_boxplot()and “Mean normalized counts” inplot_trend()(they said “Frequency”). -
plot_trend()andplot_barcode_trend()uselinewidthinstead of thesizeaesthetic deprecated in ggplot2 3.4.0, so they no longer give a deprecation warning. - New
plot_pca(): the samples on two principal components (PC1 and PC2 by default,componentsselects others), with the share of the variance on the axes. -
plot_explained_variance()computed the principal components on the raw counts, so the first component mostly followed the sequencing depth of the samples (correlation 0.995 in the HAP1 screen). The principal components, and the MDS ofplot_mds(), are now computed on the log2 normalized counts, with the normalization chosen innormalize_data()(“cpm”, “tmm” or “control”; counts per million when the counts have not been normalized). -
plot_barcode_lost()drew the bars twice, an opaque layer under the one withalpha, soalphahad no visible effect; the bars are drawn once. -
plot_trend()draws the samples at their time point instead of one position per sample, so replicates share the same time and the line is the one ofcompute_slope()(used byfilter_by_slope()); before, the line was fitted along the order of the samples. New arguments ofplot_trend(),compute_slope()andfilter_by_slope():time_column(the column with the time points, “Day” by default) andtime(the real times of the time points, for examplec(T0 = 0, T3 = 3, T18 = 18); by default they are equally spaced, as before). -
plot_trend()andplot_boxplot()failed with several genes unlessnroworncolwas given; by default ggplot2 now chooses the layout. -
find_gene_zscore_hit(reference = "empirical"): the gene scores are compared with an empirical null, the distribution of the genes without effect estimated from the centre of the distribution of the gene statistics (empirical_fit = "central", default, or"one-sided"). Newplot_empirical_null()shows the fit. The random barcode sets of the default reference are conservative in dropout screens (the hits widen the null) and ignore that the barcodes of a gene vary together, which gives too small p-values in shRNA screens. In the genome-wide HAP1 CRISPR screen the empirical null found 90% (central) and 94% (one-sided) of the core essential genes at 5% FDR, against 58% with the default reference; in the K562 shRNA screen it kept the share of non-essential genes with a p-value below 0.05 under 4%, where the random barcodes reached 13% (default, with genome-wide proportions of essential genes) and 20% (non-essential genes ascontrol_genes). Seebenchmark/realdata/empirical_null.R. - New vignette “Choosing the reference of the gene-level test”, which suggests
reference = "empirical"and shows why on the HAP1 and K562 screens. The default offind_gene_zscore_hit()is stillreference = "random", so existing results do not change.
ScreenR 1.15.14
CRISPR screens
ScreenR works with CRISPR-Cas9 screens (tested on the HAP1 TKOv3 screen of Hart et al. 2017, see the benchmark folder of the repository). New functions make it easier:
-
barcodes_per_gene()counts the barcodes (shRNAs or sgRNAs) of each gene.find_camera_hit(),find_roast_hit(),find_time_hit(),plot_barcode_hit(),find_gene_zscore_hit(),find_zscore_hit()andfind_robust_zscore_hit()now warn when their threshold on the number of barcodes per gene (number_barcodeormin_barcodes) excludes more than 20% of the genes, and suggest a value that fits the library (for example with 4 sgRNAs per gene). The defaults and the results do not change. -
compute_screen_quality()measures how well a screen separates essential from non-essential reference genes (NNMD, Cohen’s d, ROC AUC);plot_reference_separation()plots it;scale_by_reference()scales the fold changes so that non-essential genes are at 0 and essential genes at -1. New datasethart_reference_genes: the CEGv2 core essential and NEGv1 non-essential genes of Hart et al. -
correct_crispr_bias()corrects copy-number and proximity bias of CRISPR-Cas9 screens with the CRISPRcleanR package (Iorio et al. 2018), which must be installed separately (it is not on CRAN or Bioconductor:BiocManager::install("francescojm/CRISPRcleanR")); ScreenR only wraps it.crisprcleanr_available()tells whether it is installed.
Documentation
- The vignette “Benchmark against MAGeCK and other tools” adds BAGEL2, gscreend and two plain edgeR/limma workflows to the comparison, a CRISPR-Cas9 screen (HAP1, TKOv3) and the quality check of the K562 screen with the reference genes. Its claims are toned down to match the results: ScreenR controls the FDR and ranks the hits as well as the best tools, but is more conservative at a fixed FDR.
Other changes
- Removed the use of
.datain tidyselect arguments ofcompute_data_table()andcompute_metrics()(deprecated in tidyselect 1.2.0); results unchanged.
ScreenR 1.15.13
- Enriched genes: every hit-finding method accepts
direction = "Up".find_zscore_hit()andfind_robust_zscore_hit()gain adirectionargument (default"Down", same results as before);find_camera_hit()andfind_roast_hit()now checkdirectionand give an error for a value other than"Down"or"Up"(a typo such as"up"used to return no genes silently). - New tests check that every method finds enriched and depleted genes without mixing them.
ScreenR 1.15.12
Documentation
- Every help page has been rewritten: clearer titles and descriptions, all arguments with their defaults, the columns of the returned tables, links between related functions and runnable examples. Several descriptions that did not match the code were corrected, for example
number_barcode(genes need more thannumber_barcodebarcodes to be tested), the return values ofplot_common_hit(),plot_mapped_reads_distribution(),filter_by_variance()andfilter_by_slope(), andgroup_varinplot_trend(),plot_boxplot()andfilter_by_slope(). - The
screenr_objectclass has its own help page (?"screenr_object-class"). - New README and package website, with a quick start, a guide to the hit-finding methods and the benchmark against MAGeCK.
Other changes
-
compute_metrics()is about 40 times faster (same results). -
get_count_table(),get_annotation_table(),get_normalized_count_table()andget_data_table()report the size of the table withmessage()instead of printing it, so it can be silenced withsuppressMessages().
ScreenR 1.15.11
Documentation
- New vignette “Benchmark against MAGeCK”: compares the ScreenR methods with MAGeCK RRA and MLE on simulated screens and on the K562 screen. MAGeCK and simulation results are precomputed in
inst/extdata/benchmark; the ScreenR methods are run in the vignette. The scripts are in thebenchmarkfolder of the GitHub repository. -
find_gene_zscore_hit(): the documentation no longer calls control genes the best reference. Non-targeting shRNAs are often not a good model of a gene without effect (in the K562 screen they made hundreds of non-essential genes look depleted); check them before usingcontrol_genes. -
find_roast_hit(): the documentation explains that ROAST and FRY need replicates in both groups and find almost no hits with a single control sample.
ScreenR 1.15.10
Calibrated p-values
A benchmark on simulated screens showed that the p-values of some methods were too conservative (with no true hits, fewer than 5% of the genes had p < 0.05).
-
find_camera_hit(),find_roast_hit()andfind_time_hit()now report one-sided p-values for the requested direction. camera and roast report two-sided p-values, which ScreenR used as they were: they were twice too large. The FDR is computed from the one-sided p-values over all the genes. -
find_gene_zscore_hit()is now a permutation test: the mean (or median,statistic) Z-score of the barcodes of each gene is compared with random sets of barcodes of the same size. The previous binomial test on the number of barcodes below a threshold had only a few possible p-values and was very conservative. The argumentszscore_thresholdand the columnNBarcodesHitare replaced bystatistic,n_permutations,seedand the columnScore. -
find_gene_zscore_hit(control_genes = )draws the random barcodes from control genes (for example non-targeting shRNAs), the best reference since it cannot contain true hits. -
find_roast_hit(method = "fry")useslimma::fry(), an exact and fast version of ROAST without the limit of 1 / (nrot + 1) on the p-values. -
fdr_method = "storey"infind_camera_hit(),find_roast_hit(),find_time_hit()andfind_gene_zscore_hit()estimates the proportion of genes without effect and is less conservative than Benjamini-Hochberg when many genes have an effect. - The description of ROAST is corrected: it is a self-contained test, not a competitive one.
ScreenR 1.15.9
New dataset
-
k562_count_table,k562_annotation_tableandk562_reference_genes: a subset of a published genome-wide shRNA essentiality screen in K562 cells (Morgens et al. 2016, Nat Biotechnol) with the reference core essential and non-essential genes of Hart et al. Since the true hits (the essential genes) are known, the dataset can be used to evaluate methods. The script that builds it is ininst/scriptsand the licenses of the original data ininst/LICENSES_data.txt.
ScreenR 1.15.8
The ScreenR object is now a SummarizedExperiment
- The
screenr_objectclass now extendsSummarizedExperiment: the raw and normalized counts are the assayscountsandnormalized, the barcode annotation is inrowData()and Sample, Day, Treatment and Group are incolData(). The object can be used with the Bioconductor tools that accept aSummarizedExperimentand subset like one (object[barcodes, samples]), keeping counts, normalized counts and data table consistent. - All the ScreenR functions, including the
get_andset_functions, return the same results as before: every exported function was run on the example data with the previous and the new class and gave identical outputs. - Objects saved with older versions are converted automatically;
update_screenr_object()converts them explicitly. - Code that reads the old slots directly needs to use the
get_functions:object@count_table->get_count_table(object),object@normalized_count_table->get_normalized_count_table(object),object@groups->get_groups(object). The slotsdata_tableandannotation_tableare unchanged. - New dependencies: SummarizedExperiment and S4Vectors.
ScreenR 1.15.6
Bug fixes (found by an independent review of 1.15.4)
-
find_time_hit()now includes a main effect for the treatment (log(abundance) = a + b * time + d * treated + c * time * treated), so thatcmeasures how much the treatment effect changes over time. Previously the model assumed that treated and control samples start from the same level, so a constant treatment effect was reported as a growing one. The control and baseline samples must now cover at least two time points. - The documentation of
summarise_hits()and the vignette no longer claim that the list of genes withMaxFDR <= alphakeeps the FDR:MaxFDRis a per-gene level-alpha intersection-union test and a ranking score, but the combined list has no guaranteed false discovery rate. - The examples of
plot_barcode_hit()andfilter_by_variance()(and some tests) combinedmodel.matrix(~ groups)withmakeContrasts(Treated - Control), which subtracts the intercept; they now usecreate_design_matrix()andcreate_contrast(). - Several examples called
compute_metrics()with treatment and control swapped; they now usetreatment = "TRT". -
find_camera_hit()andfind_time_hit()no longer fail when only one gene can be tested, and give a clear error when no gene has more thannumber_barcodebarcodes (alsofind_roast_hit()). -
find_roast_hit(seed = )restores the random number state of the session. -
compute_metrics()warns when the MAD of the log2 fold changes is 0;find_discordant_barcodes()reports the barcodes of genes with MAD 0 that differ from the median. -
find_time_hit()returnsDirectionas a factor, like the other methods.
Changes not listed in 1.15.4
-
find_camera_hit(),find_roast_hit(),plot_barcode_hit()andfilter_by_variance()take the genes from theGenecolumn of the annotation instead of its first column, and check that the contrast matches the design matrix. - The hit tables have new columns (
Log2FC); code that selects their columns by position may need to be updated.
Vignette
- The new vignette shows the overlap of the methods with
plot_common_hit().
ScreenR 1.15.5
More general input
-
create_screenr_object()accepts tables with any column names:barcode_columnandgene_columngive the names of the barcode and gene columns, which are renamed internally toBarcodeandGene.get_column_names()returns the original names. When a column is not found the error suggests the most similar column and the argument to use. - The Day and Treatment of each sample can be given with
sample_table(andsample_columnsfor its column names) instead of relying on sample names of the formDay_Treatment_Replicate.get_sample_table()shows how the samples are interpreted; a message is given when sample names do not follow the convention. - The input is checked when the object is created:
groupsmust have one value for each sample; sample columns stored as text are converted to numbers; other non-numeric columns of the count table are removed with a message; duplicated barcodes and barcodes missing from the annotation give a warning; duplicated barcodes in the annotation are reduced to their first row. - The annotation columns
Sequence,LibraryandGene_IDare now optional. - New
show()method, so that objects saved with older versions of ScreenR can still be printed.
New features
-
plot_gini()plots the Gini index computed bycompute_gini().
ScreenR 1.15.4
Bug fixes in the vignette
- The design matrix of the example analysis was built with
model.matrix(~ groups)and its columns renamed withunique(groups), which does not match the column order: the contrast “Time3_TRT” actually compared the Time3 control samples with the baseline. The vignette now usescreate_design_matrix()andcreate_contrast()to compare treated and control samples of the same time point. - The “at least 2 methods” common hits used
roast_hit_TRT$Day3and$Day6, which do not exist, so ROAST was ignored.
Changes that affect the results
-
find_camera_hit()gainsfdr = 0.05and returns only the genes with FDR <= fdr (previously all the genes with the requested direction). Usefdr = 1for the previous behaviour. -
find_roast_hit()gainsfdr = 0.05and filters on the FDR; the raw p-value cut offp_valis now optional (defaultNULL, previously 0.05). -
compute_metrics()gainspseudocount = 0.5: the log2 fold change islog2((Treated + pseudocount) / (Control + pseudocount))instead oflog2(Treated / Control + 1e-7), and only barcodes with zero reads in both treated and control are removed (previously all barcodes with zero control reads).
New features
-
create_design_matrix()andcreate_contrast()build the design matrix and the contrasts by group name.find_camera_hit(),find_roast_hit(),plot_barcode_hit()andfilter_by_variance()accept a column name, a contrast vector or alimma::makeContrasts()matrix. -
find_camera_hit()andfind_roast_hit()reportLog2FC, the median log2 fold change of the barcodes of each gene;find_roast_hit()gainsseed. -
normalize_data()gainsmethod = "tmm"(edgeR TMM factors) andmethod = "control"(normalization to control barcodes). -
find_gene_zscore_hit(): gene-level binomial test with FDR for the Z-score method. -
compute_barcode_statistics(): replicate-aware barcode statistics with the edgeR quasi-likelihood F-test. -
find_time_hit(): one model for the whole time course, testing whether the treatment effect changes over time. -
summarise_hits(): combines the FDR of several methods (MaxFDR, intersection-union test). - Quality control:
plot_replicate_correlation(),compute_gini()andfind_discordant_barcodes(). - New vignette “Improved statistical analysis with ScreenR”.
- edgeR >= 4.0.0 is now required.
ScreenR 1.15.3
Changes
-
find_zscore_hit()now checks themetricargument ("median", the default, or"mean") and gives a clear error for any other value. -
find_robust_zscore_hit()now has a defaultnumber_barcode = 6, the same asfind_zscore_hit(), and returns an ungrouped tibble like the other hit functions. - The
threshandlfcarguments offind_camera_hit()are deprecated. They never had an effect on the result; passing them now gives a warning. Filter the returned table on itsFDRcolumn instead. - Removed the stray
README.knit.mdfile from the package. - Added tests for these changes and for the 1.15.2 bug fixes.
ScreenR 1.15.2
Bug fixes (these change the results of some analyses)
-
create_edger_obj()now builds the edgeR object from the raw counts instead of the CPM-normalized counts, so edgeR uses the real library sizes. The annotation is matched to the counts byBarcode, and an error is raised when barcodes are missing from the annotation. This affectsfind_camera_hit(),find_roast_hit(),filter_by_variance()andplot_barcode_hit(). - The
number_barcodeargument offind_camera_hit()andfind_roast_hit()is now applied: only genes with more thannumber_barcodebarcodes are tested. Previously every gene was tested. -
compute_metrics()now computes the standard robust Z-score,(Log2FC - median(Log2FC)) / mad(Log2FC). This changes the ZscoreRobust values (and their plots); the hits offind_robust_zscore_hit()do not change, since its rule only depends on the order of the scores. -
compute_slope()(used byfilter_by_slope()) now regresses frequencies on the time points, with replicates sharing the same time point, instead of on the row number. -
plot_barcode_hit()now uses the design matrix to estimate the dispersion and honours itsnumber_barcodeargument. -
filter_by_slope()no longer prints the control slopes.
ScreenR 1.15.1
- Fixed the vignette build failure with recent edgeR versions (
DPOTRFerror code -4 infind_camera_hit()).
ScreenR 0.99.53
Changes in version 0.99.53:
Update to the documentation for the example dataset as requested by the reviewer
Pushed to Bioconductor
Changes in version 0.99.52:
Pushed to Bioconductor
Changes in version 0.99.51:
Pushed to Bioconductor
-
Changes in version 0.99.5:
- Now ScreenR uses R 4.2 or above
- Lazy data is set to FALSE
- In the DESCRIPTION is now present a BugReport link
- Now all the function are imported using importFrom
- The vignette has now the BiocStyle
- All chunks of code of the vignette are set to show warnings
- Implemented the set and get function for the ScreenR object
