Getting error Creating SingleCellExperiment instances "all assays must have the same nrow and ncol"
1
0
Entering edit mode
Lucky • 0
@lucky-24920
Last seen 7 weeks ago
India

Hello I am trying to add my data to class SingleCellExperiment while doing so getting an error, When am trying add metadata info please help me is it a bug or I am doing anything wrong even though i have same number names as columns still getting a error

Thank you

tpm_count <- read.table("TPM.tsv", sep="\t", header=T, row.names=1)
dim(tpm_count)
[1] 24285   179

meta<-read.table("Cell_info.tsv", header=T, sep="\t")
dim(meta)
[1] 179   3

cell.labels <- meta$Stage2
length(cell.labels)

[1] 179

sce <- SummarizedExperiment(
  assays = list(counts = as.matrix(tpm_count), colData=DataFrame(label=cell.labels)
  )
)

**Error in method(object) : all assays must have the same nrow and ncol**




sessionInfo( )

R version 4.1.3 (2022-03-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.4 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/atlas/libblas.so.3.10.3
LAPACK: /usr/lib/x86_64-linux-gnu/atlas/liblapack.so.3.10.3

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

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

other attached packages:
 [1] RColorBrewer_1.1-3          circlize_0.4.14             ComplexHeatmap_2.8.0        scater_1.20.1               ggplot2_3.3.5               umap_0.2.8.0               
 [7] magrittr_2.0.3              dplyr_1.0.8                 scran_1.20.1                scuttle_1.2.1               SingleCellExperiment_1.14.1 SummarizedExperiment_1.22.0
[13] Biobase_2.52.0              GenomicRanges_1.44.0        GenomeInfoDb_1.28.4         IRanges_2.26.0              S4Vectors_0.30.2            BiocGenerics_0.38.0        
[19] MatrixGenerics_1.4.3        matrixStats_0.61.0         

loaded via a namespace (and not attached):
 [1] bitops_1.0-7              doParallel_1.0.17         tools_4.1.3               utf8_1.2.2                R6_2.5.1                  irlba_2.3.5               vipor_0.4.5              
 [8] DBI_1.1.2                 colorspace_2.0-3          GetoptLong_1.0.5          withr_2.5.0               tidyselect_1.1.2          gridExtra_2.3             compiler_4.1.3           
[15] cli_3.2.0                 BiocNeighbors_1.10.0      Cairo_1.5-15              DelayedArray_0.18.0       scales_1.1.1              askpass_1.1               digest_0.6.29            
[22] XVector_0.32.0            pkgconfig_2.0.3           sparseMatrixStats_1.4.2   limma_3.48.3              rlang_1.0.2               GlobalOptions_0.1.2       DelayedMatrixStats_1.14.3
[29] shape_1.4.6               generics_0.1.2            jsonlite_1.8.0            BiocParallel_1.26.2       RCurl_1.98-1.6            BiocSingular_1.8.1        GenomeInfoDbData_1.2.6   
[36] Matrix_1.4-1              Rcpp_1.0.8.3              ggbeeswarm_0.6.0          munsell_0.5.0             fansi_1.0.3               reticulate_1.24           viridis_0.6.2            
[43] lifecycle_1.0.1           edgeR_3.34.1              zlibbioc_1.38.0           dqrng_0.3.0               crayon_1.5.1              lattice_0.20-45           beachmat_2.8.1           
[50] locfit_1.5-9.5            metapod_1.0.0             pillar_1.7.0              igraph_1.3.0              rjson_0.2.21              codetools_0.2-18          ScaledMatrix_1.0.0       
[57] glue_1.6.2                png_0.1-7                 vctrs_0.4.0               foreach_1.5.2             gtable_0.3.0              openssl_2.0.0             purrr_0.3.4              
[64] clue_0.3-60               assertthat_0.2.1          rsvd_1.0.5                RSpectra_0.16-0           viridisLite_0.4.0         tibble_3.1.6              iterators_1.0.14         
[71] beeswarm_0.4.0            cluster_2.1.2             bluster_1.2.1             statmod_1.4.36            ellipsis_0.3.2
SingleCellExperiment scran scater • 1.4k views
ADD COMMENT
2
Entering edit mode
Basti ▴ 780
@7d45153c
Last seen 2 days ago
France

Pay attention to your parenthesis, your arguments are not correct, it should be :

sce <- SummarizedExperiment(
  assays = list(counts = as.matrix(tpm_count)), colData=DataFrame(label=cell.labels)
)
ADD COMMENT

Login before adding your answer.

Traffic: 708 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