Creating data matrix in Deseq2 from tximport data invalid class SummarizedExperiment object
1
0
Entering edit mode
@hemantcnaik-23771
Last seen 5 months ago
India

I want run deseq2 from tximport data. for sample dataset I can able to create deseq2 matrix file but for own data getting error i have kept same row(15) and column(15) name in condition and count data still getting error i have seen many already available question mentioned to update the versions after updating the version getting same error

please help

Thank you


library(DESeq2)
library(tximport)

dir <- "counting"
samples = read.table('Sample.txt', sep="\t", header = T, row.names = 1)
tx2gene = read.table('Transcript_gene_id.txt', sep = '\t', header = T)

files <- file.path(dir, "", samples$Path, "quant.sf")
names(files) <- row.names(samples)
all(file.exists(files))
txi = tximport(files = files, type = 'salmon', tx2gene = tx2gene)

rownames(samples ) <- colnames(txi$counts)

all(colnames(txi$counts) %in% rownames(samples))
all(colnames(txi$counts) == rownames(samples))

dds <- DESeqDataSetFromMatrix(txi, samples, ~Type1)


Error in validObject(.Object) :
  invalid class SummarizedExperiment object: 
    nb of cols in assay(1) must equal nb of rows in colData(15)

sessionInfo( )

R version 4.2.0 (2022-04-22)
Platform: x86_64-conda-linux-gnu (64-bit)
Running under: Ubuntu 22.04.4 LTS

Matrix products: default
BLAS/LAPACK: /media/anaconda3/lib/libopenblasp-r0.3.21.so

locale:
 [1] LC_CTYPE=en_IN.UTF-8       LC_NUMERIC=C               LC_TIME=en_IN.UTF-8        LC_COLLATE=en_IN.UTF-8    
 [5] LC_MONETARY=en_IN.UTF-8    LC_MESSAGES=en_IN.UTF-8    LC_PAPER=en_IN.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_IN.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats4    stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] tximport_1.26.1             DESeq2_1.38.3               SummarizedExperiment_1.28.0 Biobase_2.58.0             
 [5] MatrixGenerics_1.10.0       matrixStats_1.2.0           GenomicRanges_1.50.2        GenomeInfoDb_1.34.9        
 [9] IRanges_2.32.0              S4Vectors_0.36.2            BiocGenerics_0.44.0        

loaded via a namespace (and not attached):
 [1] KEGGREST_1.38.0        locfit_1.5-9.9         tidyselect_1.2.1       lattice_0.22-5         generics_0.1.3        
 [6] colorspace_2.1-0       vctrs_0.6.5            utf8_1.2.4             blob_1.2.4             XML_3.99-0.14         
[11] rlang_1.1.3            pillar_1.9.0           glue_1.7.0             DBI_1.2.2              BiocParallel_1.32.6   
[16] bit64_4.0.5            RColorBrewer_1.1-3     GenomeInfoDbData_1.2.9 lifecycle_1.0.4        zlibbioc_1.44.0       
[21] Biostrings_2.66.0      munsell_0.5.0          gtable_0.3.4           codetools_0.2-19       memoise_2.0.1         
[26] geneplotter_1.76.0     fastmap_1.1.1          parallel_4.2.0         fansi_1.0.6            AnnotationDbi_1.60.2  
[31] Rcpp_1.0.12            xtable_1.8-4           scales_1.3.0           BiocManager_1.30.22    cachem_1.0.8          
[36] DelayedArray_0.24.0    jsonlite_1.8.8         annotate_1.76.0        XVector_0.38.0         bit_4.0.5             
[41] ggplot2_3.5.0          png_0.1-8              dplyr_1.1.4            grid_4.2.0             cli_3.6.2             
[46] tools_4.2.0            bitops_1.0-7           magrittr_2.0.3         RCurl_1.98-1.14        RSQLite_2.3.5         
[51] tibble_3.2.1           pkgconfig_2.0.3        crayon_1.5.2           Matrix_1.6-5           httr_1.4.7            
[56] rstudioapi_0.15.0      R6_2.5.1               compiler_4.2.0
DESeq2 tximport • 483 views
ADD COMMENT
2
Entering edit mode
ATpoint ★ 4.6k
@atpoint-13662
Last seen 9 hours ago
Germany

You're using the wrong function to read tximport data. Read the manual please: https://bioconductor.org/packages/release/bioc/vignettes/DESeq2/inst/doc/DESeq2.html#transcript-abundance-files-and-tximport-tximeta

ADD COMMENT

Login before adding your answer.

Traffic: 817 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6