This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Length of 'dimnames' [1] not equal to array extent

Dear Utents, I am running fitGAM function using a PseudotimeOrdering object from a single-cell dataset. Dimnames of both datasets are two lists of characters, while different results for dimnames specifying [1]. I attached the results in R below. I ran this code last week and it works. I do not know what I have changed.

#Counts matrix of my single cell object. 
sce_filtered_matrix <- as.matrix(logcounts(sce_filtered))
sce_filtered_trade <- fitGAM(sce_filtered_matrix, sce_filtered$slingshot, nknots = 6)

#View my PseudotimeOrdering object
sce_filtered$slingshot[1]
class: PseudotimeOrdering 
dim: 1 4 
metadata(4): lineages mst slingParams curves
pathStats(2): pseudotime weights
cellnames(1): OEP01_N704_S507
cellData names(2): reducedDim clusterLabels
pathnames(4): Lineage1 Lineage2 Lineage3 Lineage4
pathData names(0):

# my problematic code and its corresponding output 
dimnames(sce_filtered$slingshot[1])
[[1]]
[1] "OEP01_N704_S507"

[[2]]
[1] "Lineage1" "Lineage2" "Lineage3" "Lineage4"


dimnames(sce_filtered_matrix[1])
NULL

Error in value[[3L]](cond) : 
  'assay(<PseudotimeOrdering>, i="character", ...)' invalid subscript 'I'
length of 'dimnames' [1] not equal to array extent
singlecellexperiment

0 answers

No answers yet.

Log in to answer this question.