diff --git a/man/calcDivIndexes.Rd b/man/calcDivIndexes.Rd index dae2ffa..b959be7 100644 --- a/man/calcDivIndexes.Rd +++ b/man/calcDivIndexes.Rd @@ -4,10 +4,12 @@ \alias{calcDivIndexes} \title{Calculate diversity indices for barcode samples} \usage{ -calcDivIndexes(dat) +calcDivIndexes(counts, group = NULL) } \arguments{ -\item{dat}{dataframe of raw or normalised counts with samples as columns and observations/barcodes as rows} +\item{counts}{dataframe of raw or normalised counts with samples as columns and observations/barcodes as rows} + +\item{group}{vector of sample group metadata, assumes the same sample order as counts} } \value{ Returns a data-frame containing the calculated diversity indices per sample @@ -23,5 +25,5 @@ calcDivIndexes Calculates common diversity indices per sample in a dataframe of counts } \examples{ -indexes <- calcDivIndexes(dat = test.counts) +indexes <- calcDivIndexes(counts = test.dge$counts) } diff --git a/man/compareAbundance.Rd b/man/compareAbundance.Rd index 47449f5..9dd129a 100644 --- a/man/compareAbundance.Rd +++ b/man/compareAbundance.Rd @@ -4,29 +4,49 @@ \alias{compareAbundance} \title{Barcode abundance comparison} \usage{ -compareAbundance(counts, condition, condition_names) +compareAbundance( + dge.obj, + meta, + condition1, + condition2, + pval.cutoff = 0.05, + logFC.cutoff = 2, + filename = NULL +) } \arguments{ -\item{counts}{dataframe containing raw counts of barcodes} +\item{dge.obj}{DGElist list object with counts and samples dataframe} -\item{condition}{sample condition of interest} +\item{meta}{Name of metadata field of interest for the comparison} -\item{condition_names}{names of possible conditions in experiment} +\item{condition1}{Name of reference condition in meta} + +\item{condition2}{Name of second condition in meta} + +\item{pval.cutoff}{Pvalue threshold for the volcano plot} + +\item{logFC.cutoff}{logFC threshold for the volcano plot} + +\item{filename}{Filename for the results of the likelihood ratio test} } \value{ -Returns a text file +Returns a volcano plot and a csv file with differentially abundant +barcode results } \description{ -Takes a dataframe of barcode counts, -computes the mean abundance of each barcode for two specific conditions, -then do a line plot for both conditions +Takes a DGElist list object with counts and samples dataframe. +Finds differentially abundant barcodes between two experimental conditions, +using the likelihood ratio test (LRT) based on the fitted generalized linear +model (GLM) to compare two nested models, typically a reduced model and a +full model, to determine if the additional terms in the full model +significantly improve the model fit. Additionally, it computes the p-values +associated with the test statistic for each barcode. +It save the results in a csv file and returns a volcano plot. } \details{ compareAbundance - -Compare barcode abundance between 2 conditions using EdgeR } \examples{ data(test.dge) -compareAbundance(test.dge, test.dge$samples$group, c("T0","10_High_dose")) +compareAbundance(test.dge,"Treatment", "Vehicle","Low_dose",0.01,2) } diff --git a/man/figures/README-example-1.png b/man/figures/README-example-1.png new file mode 100644 index 0000000..9c7e2fc Binary files /dev/null and b/man/figures/README-example-1.png differ diff --git a/man/figures/README-example-2.png b/man/figures/README-example-2.png new file mode 100644 index 0000000..cf980c0 Binary files /dev/null and b/man/figures/README-example-2.png differ diff --git a/man/figures/README-example-3.png b/man/figures/README-example-3.png new file mode 100644 index 0000000..77a735f Binary files /dev/null and b/man/figures/README-example-3.png differ diff --git a/man/figures/README-example-4.png b/man/figures/README-example-4.png new file mode 100644 index 0000000..c7e3e79 Binary files /dev/null and b/man/figures/README-example-4.png differ diff --git a/man/normaliseCounts.Rd b/man/normaliseCounts.Rd index cdc1b7b..34e2223 100644 --- a/man/normaliseCounts.Rd +++ b/man/normaliseCounts.Rd @@ -4,12 +4,12 @@ \alias{normaliseCounts} \title{Normalise barcode counts} \usage{ -normaliseCounts(dge, method = "cpm", threshold = 0) +normaliseCounts(dge, method = "CPM", threshold = 0) } \arguments{ \item{dge}{DGEList object containing raw barcode counts to be normalised} -\item{method}{method of normalisation} +\item{method}{method of normalization. One of cpm, tmm, tmmwsp, upperquartile or rle. see edgeR::calcNormFactors()} \item{threshold}{Threshold to apply to counts before normalisation} } @@ -21,6 +21,6 @@ Normalise barcode counts within a DGEList object } \examples{ data(test.dge) -normaliseCounts(test.dge, method = "cpm", threshold = 0) +normaliseCounts(test.dge, method = "CPM", threshold = 0) } diff --git a/man/plotBarcodeBoxplot.Rd b/man/plotBarcodeBoxplot.Rd index 92edb7f..948cfc1 100644 --- a/man/plotBarcodeBoxplot.Rd +++ b/man/plotBarcodeBoxplot.Rd @@ -4,14 +4,30 @@ \alias{plotBarcodeBoxplot} \title{Boxplot of selected barcodes} \usage{ -plotBarcodeBoxplot(dge.obj, barcodes, condition = NULL) +plotBarcodeBoxplot( + dge.obj, + barcodes = NULL, + group = NULL, + conditions = NULL, + trans = NULL, + point = FALSE, + violin = FALSE +) } \arguments{ \item{dge.obj}{DGE object containing counts and sample information} -\item{barcodes}{vector of barcodes to be plotted} +\item{barcodes}{a vector of barcodes to be plotted} -\item{condition}{specific metadata condition to be plotted} +\item{group}{metadata field to facet data on} + +\item{conditions}{specific levels of group to be plotted. If NULL all levels are plotted} + +\item{trans}{From ggplot2. For continuous scales, the name of a transformation object or the object itself.} + +\item{point}{From ggplot2. Include plot points?} + +\item{violin}{From ggplot2. Include violin plot?} } \value{ Returns a boxplot @@ -28,7 +44,6 @@ Boxplot of selected barcodes } \examples{ data(test.dge) -barcodes <- sample(rownames(test.dge), 10) -plotBarcodeBoxplot(test.dge, barcodes) -plotBarcodeBoxplot(test.dge, barcodes, condition = c("T0", "T0b")) +plotBarcodeBoxplot(test.dge, barcodes = "BC_190202", group = "Treatment", +conditions = c("Vehicle", "Low_dose", "High_dose")) } diff --git a/man/plotBarcodeBubble.Rd b/man/plotBarcodeBubble.Rd index 3f7e97a..fc46e75 100644 --- a/man/plotBarcodeBubble.Rd +++ b/man/plotBarcodeBubble.Rd @@ -27,7 +27,6 @@ Returns a bubbleplot of barcodes represented by proportion of total pool Generate proportional bubbleplots from raw count object with barcodes labelled above a specified threshold } \examples{ -data(test.counts) -plotBarcodeBubble(test.counts, labels = TRUE, proportion.cutoff = 10) -plotBarcodeBubble(test.counts, labels = FALSE, proportion.cutoff = 10) +plotBarcodeBubble(test.dge$counts, labels = TRUE, proportion.cutoff = 10) +plotBarcodeBubble(test.dge$counts, labels = FALSE, proportion.cutoff = 10) } diff --git a/man/plotBarcodeCounts.Rd b/man/plotBarcodeCounts.Rd index b36ee51..77942fb 100644 --- a/man/plotBarcodeCounts.Rd +++ b/man/plotBarcodeCounts.Rd @@ -20,8 +20,7 @@ Returns a plot of the read counts per barcode (row) in a data frame Simple plot of total read counts per barcode in library } \examples{ -data(test.counts) -plotBarcodeCounts(test.counts) -plotBarcodeCounts(test.counts, order = TRUE) -plotBarcodeCounts(test.counts, order = TRUE, log10 = TRUE) +plotBarcodeCounts(test.dge$counts) +plotBarcodeCounts(test.dge$counts, order = TRUE) +plotBarcodeCounts(test.dge$counts, order = TRUE, log10 = TRUE) } diff --git a/man/plotBarcodeCumSum.Rd b/man/plotBarcodeCumSum.Rd index 0659733..d6eff96 100644 --- a/man/plotBarcodeCumSum.Rd +++ b/man/plotBarcodeCumSum.Rd @@ -27,6 +27,5 @@ plotBarcodeCumSum Plot the cumulative sum of barcode cpm counts for a list of samples against and ordered by sample1. } \examples{ -data(test.counts) -plotBarcodeCumSum(counts = test.counts, sample1 = 'T0-1', samples = c('T0-1','S9-1', 'S8-1')) +plotBarcodeCumSum(counts = test.dge$counts, sample1 = 'T0-1', samples = c('T0-1','S9-1', 'S8-1')) } diff --git a/man/plotBarcodeDistance.Rd b/man/plotBarcodeDistance.Rd index def8151..cf29a26 100644 --- a/man/plotBarcodeDistance.Rd +++ b/man/plotBarcodeDistance.Rd @@ -30,6 +30,5 @@ Returns a heatmap of sample distances using desired clustering Plot sample distances between barcode sets / samples } \examples{ -test.mat <- matrix(rnorm(10*10,mean=0,sd=2), 10, 10) -plotBarcodeDistance(test.mat) +plotBarcodeDistance(test.dge$counts) } diff --git a/man/plotBarcodeHeatmap.Rd b/man/plotBarcodeHeatmap.Rd index febcf92..c65824b 100644 --- a/man/plotBarcodeHeatmap.Rd +++ b/man/plotBarcodeHeatmap.Rd @@ -4,16 +4,36 @@ \alias{plotBarcodeHeatmap} \title{Plot barcode heatmap} \usage{ -plotBarcodeHeatmap(counts, N, name = "CPM", show_bc = FALSE) +plotBarcodeHeatmap( + counts, + N, + name = "CPM", + show_bc = FALSE, + samples = NULL, + group = NULL, + col_annot = NULL, + discrete = F, + discrete_threshold = 1 +) } \arguments{ \item{counts}{Dataframe containing cpm counts} -\item{N}{String of sample 1 name (used to ranked barcode abundance)} +\item{N}{Number of top barcodes per sample} \item{name}{String of the heatmap scale name} \item{show_bc}{Boolean to show barcode names on the heatmap} + +\item{samples}{Dataframe containing sample metadata sheet} + +\item{group}{metadata fields to annotate samples} + +\item{col_annot}{list of vectors assigning colours to each level of metadata} + +\item{discrete}{Boolean to show presence/absence of barcodes instead of abundance} + +\item{discrete_threshold}{Threshold for presence of barcode in samples} } \value{ Returns a heatmap @@ -29,6 +49,5 @@ plotBarcodeHeatmap Plot a heatmap of the N most abundant barcodes per sample } \examples{ -data(test.counts) -plotBarcodeHeatmap(test.counts, 10,'Counts',FALSE) +plotBarcodeHeatmap(counts = cpm(test.dge$counts),N = 5,show_bc = TRUE,samples = test.dge$samples) } diff --git a/man/plotBarcodeHistogram.Rd b/man/plotBarcodeHistogram.Rd index 9d38020..f3e75e1 100644 --- a/man/plotBarcodeHistogram.Rd +++ b/man/plotBarcodeHistogram.Rd @@ -27,6 +27,5 @@ Returns a barcode histogram plot of barcodes represented by proportion of total Generate stacked barcode plots showing proportion from raw count object. } \examples{ -data(test.counts) -plotBarcodeHistogram(test.counts, sample = "T0-1", top = 10, name = "Barcode Histogram") +plotBarcodeHistogram(test.dge$counts, sample = "T0-1", top = 10, name = "Barcode Histogram") } diff --git a/man/plotBarcodePCA.Rd b/man/plotBarcodePCA.Rd index c50fbbf..20c299e 100644 --- a/man/plotBarcodePCA.Rd +++ b/man/plotBarcodePCA.Rd @@ -40,6 +40,5 @@ plotBarcodePCA Plot the first two principal components of the barcode dataset } \examples{ -data(test.dge) -plotBarcodePCA(test.dge, intgroup = "group", ntop = 500, returnData = FALSE, batch = NULL) +plotBarcodePCA(test.dge, intgroup = "Treatment", ntop = 500, returnData = FALSE, batch = NULL) } diff --git a/man/plotBarcodeTimeseries.Rd b/man/plotBarcodeTimeseries.Rd index 2bb185e..069fe6e 100644 --- a/man/plotBarcodeTimeseries.Rd +++ b/man/plotBarcodeTimeseries.Rd @@ -23,5 +23,5 @@ Generate proportional timeseries plot from raw / normalised barcode count object } \examples{ data(test.counts) -plotBarcodeTimeseries(test.counts[,1:4], name = "Proportional Timeseries Plot", seed = 5, top = 10) +plotBarcodeTimeseries(test.dge$counts[,1:4], name = "Proportional Timeseries Plot", seed = 5) } diff --git a/man/plotCellsInClusters.Rd b/man/plotCellsInClusters.Rd new file mode 100644 index 0000000..15b2a5f --- /dev/null +++ b/man/plotCellsInClusters.Rd @@ -0,0 +1,40 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/plotCellsinClusters.R +\name{plotCellsInClusters} +\alias{plotCellsInClusters} +\title{Plot cells per ident class} +\usage{ +plotCellsInClusters( + sc.obj, + group = NULL, + factor = NULL, + idents = NULL, + plot.pct = T, + plot = T +) +} +\arguments{ +\item{sc.obj}{single cell object in Seurat or SingleCellExperiment format containing idents and group metadata} + +\item{group}{a column of metadata} + +\item{factor}{a level of group to plot per level of idents} + +\item{idents}{a column of metadata defining the cluster identities of each cell. default = "seurat_clusters"} + +\item{plot.pct}{Logical. Plot percentages (TRUE) or raw numbers (FALSE). default = TRUE} + +\item{plot}{Logical. Plot or return raw data. default = TRUE} +} +\value{ +Returns a histogram or underlying plot data +} +\description{ +Takes a single cell object, a grouping variable, a factor within the group to test, +and an ident class (i.e. clusters). Plots percentage or raw number of cells within factor +present per level of ident (i.e. per cluster) +} +\details{ +Plot number or percentage of a group per level of ident in a single +cell object +} diff --git a/man/plotCellsPerGroup.Rd b/man/plotCellsPerGroup.Rd new file mode 100644 index 0000000..b6032d8 --- /dev/null +++ b/man/plotCellsPerGroup.Rd @@ -0,0 +1,45 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/plotCellsPerGroup.R +\name{plotCellsPerGroup} +\alias{plotCellsPerGroup} +\title{Plot of cells per barcode} +\usage{ +plotCellsPerGroup( + sc.obj = NULL, + group = NULL, + order = TRUE, + trans = NULL, + threshold = 100, + plot = TRUE, + label = TRUE +) +} +\arguments{ +\item{sc.obj}{single cell object in Seurat or SingleCellExperiment format containing group metadata} + +\item{group}{a column of metadata in sc.obj} + +\item{order}{Logical. Rank order levels of group by cell number} + +\item{trans}{From ggplot2. For continuous scales, the name of a transformation object or the object itself.} + +\item{threshold}{threshold number of cells above which labels for group levels will appear} + +\item{plot}{Logical. Plot results or return data.} + +\item{label}{Logical. Label group levels above cell number threshold. if ggrepel is installed will use geom_text_repel +instead of geom_text} +} +\value{ +Returns a plot of cell number by barcode test results or underlying plot data +} +\description{ +Takes a single cell object, a grouping variable, a factor within the group to test, +and an ident class (i.e. clusters). Per level of ident performs hypergeometric testing +for enrichment of group factor +} +\details{ +plotCellsPerGroup + +Plots number of cells for each detected barcode in a single cell dataset +} diff --git a/man/plotClusterEnrichment.Rd b/man/plotClusterEnrichment.Rd new file mode 100644 index 0000000..4865f13 --- /dev/null +++ b/man/plotClusterEnrichment.Rd @@ -0,0 +1,45 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/plotClusterEnrichment.R +\name{plotClusterEnrichment} +\alias{plotClusterEnrichment} +\title{Hypergeometric test for cluster enrichment} +\usage{ +plotClusterEnrichment( + sc.obj = NULL, + group = NULL, + factor = NULL, + idents = "seurat_clusters", + threshold = 0.01, + order = TRUE, + plot = TRUE +) +} +\arguments{ +\item{sc.obj}{single cell object in Seurat or SingleCellExperiment format containing idents and group metadata} + +\item{group}{a column of metadata} + +\item{factor}{a level of group to test for enrichment per level of ident} + +\item{idents}{a column of metadata defining the cluster identities of each cell. default = "seurat_clusters"} + +\item{threshold}{P-value threshold for phyper test. default = 0.01} + +\item{order}{Logical. Order levels of idents in plot by -log10 P-value} + +\item{plot}{Logical. Plot hypergeometric test results or return plot data.} +} +\value{ +Returns a histogram of hypergeometric test results or underlying plot data +} +\description{ +Takes a single cell object, a grouping variable, a factor within the group to test, +and an ident class (i.e. clusters). Per level of ident performs hypergeometric testing +for enrichment of group factor +} +\details{ +plotClusterEnrichment + +Hypergeometric test for enrichment of specific classes of cells in +single cell RNA-seq clusters +} diff --git a/man/plotDetectedBarcodes.Rd b/man/plotDetectedBarcodes.Rd index 9380086..2d95541 100644 --- a/man/plotDetectedBarcodes.Rd +++ b/man/plotDetectedBarcodes.Rd @@ -33,7 +33,6 @@ Returns a histogram plot of the number of detected barcodes per sample. Plot the total number of barcodes detected in a sample } \examples{ -data(test.dge) plotDetectedBarcodes(test.dge, percentile = .95) plotDetectedBarcodes(test.dge, plot = FALSE) } diff --git a/man/plotDivIndexes.Rd b/man/plotDivIndexes.Rd new file mode 100644 index 0000000..fd8a2a0 --- /dev/null +++ b/man/plotDivIndexes.Rd @@ -0,0 +1,39 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/plotDivIndexes.R +\name{plotDivIndexes} +\alias{plotDivIndexes} +\title{Plot diversity indices across barcode samples} +\usage{ +plotDivIndexes( + counts, + div = NULL, + metric = "shannon", + type = "bar", + group = NULL +) +} +\arguments{ +\item{counts}{dataframe of raw or normalised counts with samples as columns and observations/barcodes as rows} + +\item{div}{dataframe of diversity metrics as columns and samples as rows} + +\item{metric}{diversity metric to plot. one of "shannon", "simpson", "invsimpson" or "gini"} + +\item{type}{plot as bar graph or point} + +\item{group}{a character vector of containing grouping information. Must be equal the number of columns of counts. Can pass a metadata column from DGEList object.} +} +\value{ +Returns a plot of calculated diversity index per sample +} +\description{ +Plots a dataframe of diversity indices per sample +} +\details{ +plotDivIndexes + +Plots common diversity indices per sample +} +\examples{ +plotDivIndexes(counts = test.dge$counts) +} diff --git a/man/plotMetrics.Rd b/man/plotMetrics.Rd new file mode 100644 index 0000000..f0eeb07 --- /dev/null +++ b/man/plotMetrics.Rd @@ -0,0 +1,40 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/plotMetrics.R +\name{plotMetrics} +\alias{plotMetrics} +\title{Violin plot of selected metric per group variable} +\usage{ +plotMetrics( + sc.obj = NULL, + group = NULL, + trans = NULL, + factor = NULL, + threshold = 100, + plot = TRUE +) +} +\arguments{ +\item{sc.obj}{single cell object in Seurat or SingleCellExperiment format containing group metadata} + +\item{group}{a column of metadata in sc.obj containing grouping information} + +\item{trans}{From ggplot2. For continuous scales, the name of a transformation object or the object itself.} + +\item{factor}{a metadata field to plot per level of group} + +\item{threshold}{threshold number of cells per level of group to plot} + +\item{plot}{Logical. Plot results or return data.} +} +\value{ +Returns a plot of cell number by barcode test results or underlying plot data +} +\description{ +Takes a single cell object, a grouping variable and a metadata variable. +Plots distribution of factor per level of group with total number of cells above threshold +} +\details{ +plotMetrics + +Plots metric distribution for selected groups in a single cell dataset +} diff --git a/man/plotOrderedBubble.Rd b/man/plotOrderedBubble.Rd index 263ecef..ea45848 100644 --- a/man/plotOrderedBubble.Rd +++ b/man/plotOrderedBubble.Rd @@ -9,8 +9,14 @@ plotOrderedBubble( labels = T, name = "Proportional Bubble Plot", orderSample = NULL, + samples = NULL, + group = NULL, + displaySamples = NULL, + displayBarcodes = NULL, proportion.cutoff = 10, - colorDominant = FALSE + colorDominant = FALSE, + filterLow = FALSE, + filter.cutoff = 0.001 ) } \arguments{ @@ -22,9 +28,21 @@ plotOrderedBubble( \item{orderSample}{name of sample to order by} +\item{samples}{Dataframe containing sample metadata sheet} + +\item{group}{metadata field to annotate samples on bubble plot} + +\item{displaySamples}{vector of samples to display - keep the order of vector} + +\item{displayBarcodes}{vector of barcodes to display} + \item{proportion.cutoff}{barcodes represented at a percentage within any sample above this threshold will be labelled} \item{colorDominant}{only color clones with frequency above proportion.cutoff. Others colored grey} + +\item{filterLow}{Boolean to filter low barcodes in orderSample} + +\item{filter.cutoff}{barcodes below this threshold in orderSample will be filtered in all samples} } \value{ Returns a bubbleplot of barcodes represented by proportion of total pool @@ -33,6 +51,5 @@ Returns a bubbleplot of barcodes represented by proportion of total pool Generate ordered proportional bubbleplots from raw count object with barcodes labelled above a specified threshold } \examples{ -data(test.counts) -plotOrderedBubble(test.counts, orderSample = "T0-1") +plotOrderedBubble(test.dge$counts, orderSample = "T0-1") } diff --git a/man/plotReadCounts.Rd b/man/plotReadCounts.Rd index 25e20e6..c98fd3f 100644 --- a/man/plotReadCounts.Rd +++ b/man/plotReadCounts.Rd @@ -30,7 +30,6 @@ Returns a plot of the read counts per column (sample) in a data frame Simple plot of total read counts per sample } \examples{ -data(test.counts) -plotReadCounts(test.dge$counts, group = test.dge$samples$Group) +plotReadCounts(test.dge$counts, group = test.dge$samples$Treatment) } diff --git a/man/processBarcodeLibrary.Rd b/man/processBarcodeLibrary.Rd index 61bf4a5..d23ca95 100644 --- a/man/processBarcodeLibrary.Rd +++ b/man/processBarcodeLibrary.Rd @@ -29,7 +29,3 @@ returns data frame containing barcode and read count in reference \description{ process barcode reference file from raw sequencing datasets } -\examples{ -load(system.file("extdata", "test_raw_lib.rda", package = "bartools")) -processBarcodeLibrary(file = test.raw.lib, samplename = "Barcode", outdir = tempdir()) -} diff --git a/man/proportionalBubbleplot.Rd b/man/proportionalBubbleplot.Rd new file mode 100644 index 0000000..33a91e5 --- /dev/null +++ b/man/proportionalBubbleplot.Rd @@ -0,0 +1,31 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/proportionalBubbleplot.R +\name{proportionalBubbleplot} +\alias{proportionalBubbleplot} +\title{proportionalBubbleplot} +\usage{ +proportionalBubbleplot( + counts.obj, + labels = TRUE, + proportion.cutoff = 10, + name = "Proportional Bubble Plot" +) +} +\arguments{ +\item{counts.obj}{dataframe containing raw counts of barcodes. assumes barcodes as rownames.} + +\item{labels}{Boolean. print barcode labels?} + +\item{proportion.cutoff}{barcodes represented at a percentage within any sample above this threshold will be labelled} + +\item{name}{desired plot title} +} +\value{ +Returns a bubbleplot of barcodes represented by proportion of total pool +} +\description{ +Generate proportional bubbleplots from raw count object with barcodes labelled above a specified threshold +} +\examples{ +proportionalBubbleplot(test.dge$counts, name = "Proportional Bubble Plot", proportion.cutoff = 10) +} diff --git a/man/test.sce.Rd b/man/test.sce.Rd new file mode 100644 index 0000000..d416a0c --- /dev/null +++ b/man/test.sce.Rd @@ -0,0 +1,17 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{test.sce} +\alias{test.sce} +\title{Test barcode SCE object} +\format{ +A SCE object with 100 rows and 100 variables: +} +\usage{ +test.sce +} +\description{ +A SingleCellExperiment object containing single cell RNA-seq data for 100 cells +and 100 features +} +\keyword{datasets} diff --git a/man/thresholdCounts.Rd b/man/thresholdCounts.Rd index e0b2c21..736aaf9 100644 --- a/man/thresholdCounts.Rd +++ b/man/thresholdCounts.Rd @@ -4,22 +4,35 @@ \alias{thresholdCounts} \title{Threshold counts} \usage{ -thresholdCounts(df, threshold = 20, plot = FALSE) +thresholdCounts( + dge, + threshold = 10, + type = "absolute", + min.samps = 1, + plot = FALSE, + group = NULL +) } \arguments{ -\item{df}{Dataframe to be thresholded.} +\item{dge}{DGEList object to be thresholded.} -\item{threshold}{The threshold to use. Rows with count below this will be removed.} +\item{threshold}{The threshold to use. If type = "relative", must a float between 0 & 1. Default = 10} -\item{plot}{Logical. Draw plots of dataset?} +\item{type}{Threshold type to use. Must be one of "absolute" or "relative". Default = "absolute".} + +\item{min.samps}{Minimum number of samples a barcode must meet threshold to remain in dataset. Default = 1.} + +\item{plot}{Logical. Draw plots of dataset? Default = F} + +\item{group}{DGEList metadata field to color samples by} } \value{ -Returns a thresholded data-frame +Returns a filtered DGEList object. } \description{ -Threshold dataframe to a given level and return number of barcodes meeting threshold in each -sample. +Filter barcodes meeting a given absolute (total read count) or relative (proportion based) abundance level +Optionally plot number of barcodes detected using this threshold in each sample. } \examples{ -thresholdCounts(test.counts, threshold = 20, plot = FALSE) +thresholdCounts(test.dge, type = "absolute", threshold = 10, plot = FALSE) }