Note: I also posted this issue (with less context) in the bioconductor support site: https://support.bioconductor.org/p/97424/
I'm working on a snakemake workflow that identifies various small RNA species in C. elegans small RNA-seq libraries. Some are endogenous siRNAs supposedly generated from RNA templates (through RNA-dependant RNA polymerases (RdRP)) that can be variously classified (protein-coding genes, transposons, and other repeat types).
I count such small RNA reads in a set of libraries and try to identify differentially producing sources. For this, I use DESeq2 (that I run using rpy2 from within snakemake).
I'm not sure DESeq2 is always appropriate for this kind of data, but so far, the analyses would at least complete. However, I recently added new potential types of small RNA source (simple repeats and satellites), and these happen to have low counts. I'm not 100% sure, but I suspect these low counts are the reason for failures during DESeq2 analyses (for debugging purposes, I ran this manually in R):
> dds <- DESeq(dds, betaPrior=T)
estimating size factors
estimating dispersions
gene-wise dispersion estimates
mean-dispersion relationship
-- note: fitType='parametric', but the dispersion trend was not well captured by the
function: y = a/x + b, and a local regression fit was automatically substituted.
specify fitType='local' or 'mean' to avoid this message next time.
Error in lfproc(x, y, weights = weights, cens = cens, base = base, geth = geth, :
newsplit: out of vertex space
In addition: There were 12 warnings (use warnings() to see them)
> warnings()
Warning messages:
1: In lfproc(x, y, weights = weights, cens = cens, base = base, ... :
procv: no points with non-zero weight
2: In lfproc(x, y, weights = weights, cens = cens, base = base, ... :
procv: no points with non-zero weight
3: In lfproc(x, y, weights = weights, cens = cens, base = base, ... :
procv: no points with non-zero weight
4: In lfproc(x, y, weights = weights, cens = cens, base = base, ... :
procv: no points with non-zero weight
5: In lfproc(x, y, weights = weights, cens = cens, base = base, ... :
procv: no points with non-zero weight
6: In lfproc(x, y, weights = weights, cens = cens, base = base, ... :
procv: no points with non-zero weight
7: In lfproc(x, y, weights = weights, cens = cens, base = base, ... :
procv: no points with non-zero weight
8: In lfproc(x, y, weights = weights, cens = cens, base = base, ... :
procv: no points with non-zero weight
9: In lfproc(x, y, weights = weights, cens = cens, base = base, ... :
procv: no points with non-zero weight
10: In lfproc(x, y, weights = weights, cens = cens, base = base, ... :
procv: no points with non-zero weight
11: In lfproc(x, y, weights = weights, cens = cens, base = base, ... :
procv: no points with non-zero weight
12: In lfproc(x, y, weights = weights, cens = cens, base = base, ... :
procv: no points with non-zero weight
The count matrix indeed contains a high proportion of zeroes, the rest are mostly ones, but there are some sources that seem a little more significantly producing small RNAs:
> mean(counts_data == 0)
[1] 0.7488889
> mean(counts_data == 1)
[1] 0.1507407
> max(counts_data)
[1] 34
How would you recommend handling such kind of data?
Should I for instance discard rows without enough counts? If so, what would be a reasonable threshold?
Edits: trying to get a dispersion plot:
The same error occurs when trying to estimate dispersion:
> dds <- estimateSizeFactors(dds)
> dds <- estimateDispersions(dds)
gene-wise dispersion estimates
mean-dispersion relationship
-- note: fitType='parametric', but the dispersion trend was not well captured by the
function: y = a/x + b, and a local regression fit was automatically substituted.
specify fitType='local' or 'mean' to avoid this message next time.
Error in lfproc(x, y, weights = weights, cens = cens, base = base, geth = geth, :
newsplit: out of vertex space
In addition: There were 12 warnings (use warnings() to see them)
This seems to prevent the generation of dispersion plots:
> plotDispEsts(dds)
Error in min(py[py > 0], na.rm = TRUE) :
invalid 'type' (list) of argument
In addition: Warning message:
In structure(x, class = unique(c("AsIs", oldClass(x)))) :
Calling 'structure(NULL, *)' is deprecated, as NULL cannot have attributes.
Consider 'structure(list(), *)' instead.
Using fitType="local"
also fails:
> dds <- DESeq(dds, betaPrior=T, fitType="local")
using pre-existing size factors
estimating dispersions
gene-wise dispersion estimates
mean-dispersion relationship
Error in lfproc(x, y, weights = weights, cens = cens, base = base, geth = geth, :
newsplit: out of vertex space
In addition: There were 12 warnings (use warnings() to see them)
But fitType="mean"
works:
> dds <- DESeq(dds, betaPrior=T, fitType="mean")
estimating size factors
estimating dispersions
gene-wise dispersion estimates
mean-dispersion relationship
final dispersion estimates
fitting model and testing
The dispersion plot then looks as follows:
What do these fitType
options mean, and are there good reasons why they would have to be changed in order to accomodate for low counts?