Entering edit mode
minyaaa9058
▴
30
@minyaaa9058-22760
Last seen 4.8 years ago
Hi!
I'm using coseq to cluster my RNAseq data processed with Tximport and then DESeq. I have followed the post from https://support.bioconductor.org/p/118586/#118671 to modify my code so everything was running smoothly. However, when I tried to plot my coseq result, I got an error message and I couldn't figure out how to fix it (sorry I'm still a beginner in R). My code was:
# my input data dds.raw was generated using Tximport:
# dds.raw <- DESeqDataSetFromTximport(txi.kallisto, colData=sampleTable, design=~condition)
>dds <- DESeq(dds.raw, test = "LRT", reduced = ~1)
estimating size factors
using 'avgTxLength' from assays(dds), correcting for library size
estimating dispersions
gene-wise dispersion estimates
mean-dispersion relationship
final dispersion estimates
fitting model and testing
-- replacing outliers and refitting for 132 genes
-- DESeq argument 'minReplicatesForReplace' = 7
-- original counts are preserved in counts(dds)
estimating dispersions
fitting model and testing
> res <- results(dds, independentFiltering=FALSE)
> run <- coseq(counts(dds, norm=TRUE)[which(res$padj < 0.05),],
+ normFactors = "DESeq", transformation = "logclr",
+ model = "kmeans", parallel = TRUE, meanFilterCutoff = 5, K=2:30)
****************************************
coseq analysis: kmeans approach & logclr transformation
K = 2 to 30
Use set.seed() prior to running coseq for reproducible results.
****************************************
Running K = 2 ...
Running K = 3 ...
Running K = 4 ...
Running K = 5 ...
...
Running K = 28 ...
Running K = 29 ...
Running K = 30 ...
> run
An object of class coseqResults
4382 features by 32 samples.
Models fit: K = 2 ... 30
Chosen clustering model: K = 16
> plot(run, graphs="boxplots")
Error in as.vector(x, mode = "numeric") :
no method for coercing this S4 class to a vector
Thank you very much!
Hi!
Thanks for your question. I haven't been able to reproduce your error on my end, so I could use a little more detail from you to figure this out.
Specifically, here's a fully reproducible example that runs with no error for me using some of the tximportData kallisto format example data (I'm guessing that's the pipeline you used given the commented-out first line of your code above?):
Otherwise, the only thing I've changed with respect to your code is that I removed the filter on padj < 5% in coseq given that this is an artificial example and there are not very many DE genes. Could you run that and let me know whether it works for you? Also, the full output of sessionInfo() would be useful to know what versions of packages you're working with.
If you do still see an error, it would also be immensely helpful to me if you could send a fully reproducible example for me to test out on my end.
Thanks! Andrea (coseq developer)
Thank you for your quick response!
I was able to make the plot following your code, and even with adding [which(res$padj < 0.05),]
The only difference between today’s run and yesterday’s (which produced error) is that yesterday I was directly loading a .RData, which is saved from dds.raw <- DESeqDataSetFromTximport(txi.kallisto, colData=sampleTable, design=~condition) But today I went through the whole process without loading the data, and I think it’s very likely that problem. I’m sorry I should have tried that yesterday before I asked about the error.
Ok, thanks for letting me know! Don't hesitate to submit another question if you run into other issues.