Entering edit mode
Hi All,
I'm trying to use DEXSeq for differential splice variant usage on my SGseq results.
After creating the DEXSeqDataSet and estimated size factor, I continued with dispersion estimation. However, I don't know why it received the following error message. I checked the previous questions regarding the same error I updated my R but couldn't find how to solve it.
dx <- estimateDispersions(dx, formula = FullModel) #Dispersion estimation
Error in `$<-.data.frame`(`*tmp*`, "dispersion", value = NA) :
replacement has 1 row, data has 0
May you please help me to solve it?
Many thanks in advance!
Here is my code:
sgvc <- readRDS("sgvc-analyzevariants.rds")
si_complete <- read.csv("si_complete.csv")
sgv.counts <- counts(sgvc) #analogously to per-exon counts
vid <- as.character(variantID(sgvc)) #analogously to exon identifiers
eid <- as.character(variantID(sgvc)) #analogously to gene identifiers
sample_info <- data.frame(sample= si_complete$sample_name, condition=si_complete$condition, Sex=si_complete$Sex, Age= si_complete$Age,PC1= si_complete$PC1, PC2= si_complete$PC2, PC3= si_complete$PC3)
FullModel= ~ sample + exon + condition:exon + Sex:exon+ Age:exon + PC1:exon + PC2:exon + PC3:exon
ReducedModel = ~ sample + exon + Sex:exon+ Age:exon + PC1:exon + PC2:exon + PC3:exon
dx<- DEXSeqDataSet(sgv.counts, featureID = vid, groupID = eid ,sample_info, design = FullModel)
# test for differential exon usage
dx <- estimateSizeFactors(dx) #normalization
dx <- estimateDispersions(dx, formula = FullModel) #Dispersion estimation
Error in `$<-.data.frame`(`*tmp*`, "dispersion", value = NA) :
replacement has 1 row, data has 0
> sessionInfo()
R version 4.4.0 (2024-04-24 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 10 x64 (build 19043)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.utf8 LC_CTYPE=English_United States.utf8 LC_MONETARY=English_United States.utf8 LC_NUMERIC=C
[5] LC_TIME=English_United States.utf8
time zone: Europe/Paris
tzcode source: internal
attached base packages:
[1] stats4 stats graphics grDevices utils datasets methods base
other attached packages:
[1] DEXSeq_1.50.0 RColorBrewer_1.1-3 AnnotationDbi_1.66.0 DESeq2_1.44.0 BiocParallel_1.38.0
[6] SGSeq_1.38.0 SummarizedExperiment_1.34.0 Biobase_2.64.0 MatrixGenerics_1.16.0 matrixStats_1.3.0
[11] Rsamtools_2.20.0 Biostrings_2.72.0 XVector_0.44.0 GenomicRanges_1.56.0 GenomeInfoDb_1.40.1
[16] IRanges_2.38.0 S4Vectors_0.42.0 BiocGenerics_0.50.0
loaded via a namespace (and not attached):
[1] tidyselect_1.2.1 dplyr_1.1.4 blob_1.2.4 filelock_1.0.3 bitops_1.0-7 fastmap_1.2.0
[7] RCurl_1.98-1.14 BiocFileCache_2.12.0 GenomicAlignments_1.40.0 digest_0.6.35 XML_3.99-0.16.1 lifecycle_1.0.4
[13] statmod_1.5.0 survival_3.6-4 KEGGREST_1.44.0 RSQLite_2.3.7 genefilter_1.86.0 magrittr_2.0.3
[19] compiler_4.4.0 rlang_1.1.3 progress_1.2.3 tools_4.4.0 igraph_2.0.3 utf8_1.2.4
[25] yaml_2.3.8 rtracklayer_1.64.0 prettyunits_1.2.0 S4Arrays_1.4.1 bit_4.0.5 curl_5.2.1
[31] DelayedArray_0.30.1 xml2_1.3.6 abind_1.4-5 hwriter_1.3.2.1 grid_4.4.0 fansi_1.0.6
[37] xtable_1.8-4 colorspace_2.1-0 ggplot2_3.5.1 scales_1.3.0 biomaRt_2.60.0 cli_3.6.2
[43] crayon_1.5.2 generics_0.1.3 httr_1.4.7 rjson_0.2.21 RUnit_0.4.33 DBI_1.2.2
[49] cachem_1.1.0 stringr_1.5.1 splines_4.4.0 zlibbioc_1.50.0 parallel_4.4.0 BiocManager_1.30.23
[55] restfulr_0.0.15 vctrs_0.6.5 Matrix_1.7-0 jsonlite_1.8.8 geneplotter_1.82.0 hms_1.1.3
[61] bit64_4.0.5 GenomicFeatures_1.56.0 locfit_1.5-9.9 annotate_1.82.0 glue_1.7.0 codetools_0.2-20
[67] stringi_1.8.4 gtable_0.3.5 BiocIO_1.14.0 UCSC.utils_1.0.0 munsell_0.5.1 tibble_3.2.1
[73] pillar_1.9.0 rappdirs_0.3.3 GenomeInfoDbData_1.2.12 dbplyr_2.5.0 R6_2.5.1 httr2_1.0.1
[79] lattice_0.22-6 png_0.1-8 memoise_2.0.1 Rcpp_1.0.12 SparseArray_1.4.5 pkgconfig_2.0.3