error while assigning value to list of list
I have an R code that looks like this:
r <- rowData(sce_list[[1]])
c <- colData(sce_list[[1]])
t <- sce_list[[1]][r$use,c$use]
Till here all runs smoothly. However, when I try to assign the value of t to another object like the following I run into error.
sce_list[[1]]$qc = t
Error in `[[<-`(`*tmp*`, name, value = <S4 object of class "SingleCellExperiment">) :
1842 elements in value to replace 5586 elements
where sce_list is a list of sce.
EDIT:
output of str(t)
Formal class 'SingleCellExperiment' [package "SingleCellExperiment"] with 10 slots
..@ int_elementMetadata:Formal class 'DataFrame' [package "S4Vectors"] with 6 slots
.. .. ..@ rownames : NULL
.. .. ..@ nrows : int 1842
.. .. ..@ listData :List of 2
.. .. .. ..$ is_spike_MT: logi [1:1842] FALSE FALSE FALSE FALSE FALSE FALSE ...
.. .. .. ..$ is_spike : logi [1:1842] FALSE FALSE FALSE FALSE FALSE FALSE ...
.. .. ..@ elementType : chr "ANY"
.. .. ..@ elementMetadata: NULL
.. .. ..@ metadata : list()
..@ int_colData :Formal class 'DataFrame' [package "S4Vectors"] with 6 slots
.. .. ..@ rownames : NULL
.. .. ..@ nrows : int 3973
.. .. ..@ listData : Named list()
.. .. ..@ elementType : chr "ANY"
.. .. ..@ elementMetadata: NULL
.. .. ..@ metadata : list()
..@ int_metadata :List of 2
.. ..$ version :Classes 'package_version', 'numeric_version' hidden list of 1
.. .. ..$ : int [1:3] 1 0 0
.. ..$ spike_names: chr "MT"
..@ reducedDims :Formal class 'SimpleList' [package "S4Vectors"] with 4 slots
.. .. ..@ listData : Named list()
.. .. ..@ elementType : chr "ANY"
.. .. ..@ elementMetadata: NULL
.. .. ..@ metadata : list()
..@ rowRanges :Formal class 'GRangesList' [package "GenomicRanges"] with 5 slots
.. .. ..@ unlistData :Formal class 'GRanges' [package "GenomicRanges"] with 6 slots
.. .. .. .. ..@ seqnames :Formal class 'Rle' [package "S4Vectors"] with 4 slots
.. .. .. .. .. .. ..@ values : Factor w/ 0 levels:
.. .. .. .. .. .. ..@ lengths : int(0)
.. .. .. .. .. .. ..@ elementMetadata: NULL
.. .. .. .. .. .. ..@ metadata : list()
.. .. .. .. ..@ ranges :Formal class 'IRanges' [package "IRanges"] with 6 slots
.. .. .. .. .. .. ..@ start : int(0)
.. .. .. .. .. .. ..@ width : int(0)
.. .. .. .. .. .. ..@ NAMES : NULL
.. .. .. .. .. .. ..@ elementType : chr "integer"
.. .. .. .. .. .. ..@ elementMetadata: NULL
.. .. .. .. .. .. ..@ metadata : list()
.. .. .. .. ..@ strand :Formal class 'Rle' [package "S4Vectors"] with 4 slots
.. .. .. .. .. .. ..@ values : Factor w/ 3 levels "+","-","*":
.. .. .. .. .. .. ..@ lengths : int(0)
.. .. .. .. .. .. ..@ elementMetadata: NULL
.. .. .. .. .. .. ..@ metadata : list()
.. .. .. .. ..@ elementMetadata:Formal class 'DataFrame' [package "S4Vectors"] with 6 slots
.. .. .. .. .. .. ..@ rownames : NULL
.. .. .. .. .. .. ..@ nrows : int 0
.. .. .. .. .. .. ..@ listData : Named list()
.. .. .. .. .. .. ..@ elementType : chr "ANY"
.. .. .. .. .. .. ..@ elementMetadata: NULL
.. .. .. .. .. .. ..@ metadata : list()
.. .. .. .. ..@ seqinfo :Formal class 'Seqinfo' [package "GenomeInfoDb"] with 4 slots
.. .. .. .. .. .. ..@ seqnames : chr(0)
.. .. .. .. .. .. ..@ seqlengths : int(0)
.. .. .. .. .. .. ..@ is_circular: logi(0)
.. .. .. .. .. .. ..@ genome : chr(0)
.. .. .. .. ..@ metadata : list()
.. .. ..@ elementMetadata:Formal class 'DataFrame' [package "S4Vectors"] with 6 slots
.. .. .. .. ..@ rownames : NULL
.. .. .. .. ..@ nrows : int 1842
.. .. .. .. ..@ listData :List of 12
.. .. .. .. .. ..$ id : chr [1:1842] "ENSG00000187608" "ENSG00000186891" "ENSG00000186827" "ENSG00000175756" ...
.. .. .. .. .. ..$ symbol : chr [1:1842] "ISG15" "TNFRSF18" "TNFRSF4" "AURKAIP1" ...
.. .. .. .. .. ..$ is_feature_control : logi [1:1842] FALSE FALSE FALSE FALSE FALSE FALSE ...
.. .. .. .. .. ..$ is_feature_control_MT: logi [1:1842] FALSE FALSE FALSE FALSE FALSE FALSE ...
.. .. .. .. .. ..$ mean_counts : num [1:1842] 5.067 0.166 0.162 0.639 0.719 ...
.. .. .. .. .. ..$ log10_mean_counts : num [1:1842] 0.783 0.0669 0.0651 0.2146 0.2353 ...
.. .. .. .. .. ..$ rank_counts : num [1:1842] 33536 30766 30710 32857 32945 ...
.. .. .. .. .. ..$ n_cells_counts : int [1:1842] 4580 516 458 2376 2578 2153 2277 5388 3604 4131 ...
.. .. .. .. .. ..$ pct_dropout_counts : num [1:1842] 18 90.8 91.8 57.5 53.8 ...
.. .. .. .. .. ..$ total_counts : num [1:1842] 28305 930 904 3569 4017 ...
.. .. .. .. .. ..$ log10_total_counts : num [1:1842] 4.45 2.97 2.96 3.55 3.6 ...
.. .. .. .. .. ..$ use : Named logi [1:1842] TRUE TRUE TRUE TRUE TRUE TRUE ...
.. .. .. .. .. .. ..- attr(*, "names")= chr [1:1842] "ENSG00000187608" "ENSG00000186891" "ENSG00000186827" "ENSG00000175756" ...
.. .. .. .. ..@ elementType : chr "ANY"
.. .. .. .. ..@ elementMetadata: NULL
.. .. .. .. ..@ metadata : list()
.. .. ..@ partitioning :Formal class 'PartitioningByEnd' [package "IRanges"] with 5 slots
.. .. .. .. ..@ end : int [1:1842] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. .. ..@ NAMES : chr [1:1842] "ENSG00000187608" "ENSG00000186891" "ENSG00000186827" "ENSG00000175756" ...
.. .. .. .. ..@ elementType : chr "integer"
.. .. .. .. ..@ elementMetadata: NULL
.. .. .. .. ..@ metadata : list()
.. .. ..@ elementType : chr "GRanges"
.. .. ..@ metadata : list()
..@ colData :Formal class 'DataFrame' [package "S4Vectors"] with 6 slots
.. .. ..@ rownames : chr [1:3973] "AAACCTGAGAAGGTTT-1" "AAACCTGAGCGTTCCG-1" "AAACCTGAGTACGTAA-1" "AAACCTGGTCCATGAT-1" ...
.. .. ..@ nrows : int 3973
.. .. ..@ listData :List of 32
.. .. .. ..$ dataset : int [1:3973] 1 1 1 1 1 1 1 1 1 1 ...
.. .. .. ..$ barcode : chr [1:3973] "AAACCTGAGAAGGTTT-1" "AAACCTGAGCGTTCCG-1" "AAACCTGAGTACGTAA-1" "AAACCTGGTCCATGAT-1" ...
.. .. .. ..$ total_features : int [1:3973] 1373 1837 2259 2601 1967 1236 1642 1153 1078 2682 ...
.. .. .. ..$ log10_total_features : num [1:3973] 3.14 3.26 3.35 3.42 3.29 ...
.. .. .. ..$ total_counts : num [1:3973] 3380 7332 10099 12184 7352 ...
.. .. .. ..$ log10_total_counts : num [1:3973] 3.53 3.87 4 4.09 3.87 ...
.. .. .. ..$ pct_counts_top_50_features : num [1:3973] 33.1 38.9 42.5 42.2 42.8 ...
.. .. .. ..$ pct_counts_top_100_features : num [1:3973] 45 54.8 59.2 53.5 52.4 ...
.. .. .. ..$ pct_counts_top_200_features : num [1:3973] 57.5 66.9 69 64.7 63.5 ...
.. .. .. ..$ pct_counts_top_500_features : num [1:3973] 74.2 79.2 79.4 76.8 76.6 ...
.. .. .. ..$ total_features_endogenous : int [1:3973] 1373 1837 2259 2601 1967 1236 1642 1153 1078 2682 ...
.. .. .. ..$ log10_total_features_endogenous : num [1:3973] 3.14 3.26 3.35 3.42 3.29 ...
.. .. .. ..$ total_counts_endogenous : num [1:3973] 3380 7332 10099 12184 7352 ...
.. .. .. ..$ log10_total_counts_endogenous : num [1:3973] 3.53 3.87 4 4.09 3.87 ...
.. .. .. ..$ pct_counts_endogenous : num [1:3973] 100 100 100 100 100 100 100 100 100 100 ...
.. .. .. ..$ pct_counts_top_50_features_endogenous : num [1:3973] 33.1 38.9 42.5 42.2 42.8 ...
.. .. .. ..$ pct_counts_top_100_features_endogenous: num [1:3973] 45 54.8 59.2 53.5 52.4 ...
.. .. .. ..$ pct_counts_top_200_features_endogenous: num [1:3973] 57.5 66.9 69 64.7 63.5 ...
.. .. .. ..$ pct_counts_top_500_features_endogenous: num [1:3973] 74.2 79.2 79.4 76.8 76.6 ...
.. .. .. ..$ total_features_feature_control : int [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ log10_total_features_feature_control : num [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ total_counts_feature_control : num [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ log10_total_counts_feature_control : num [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ pct_counts_feature_control : num [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ total_features_MT : int [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ log10_total_features_MT : num [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ total_counts_MT : num [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ log10_total_counts_MT : num [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ pct_counts_MT : num [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ is_cell_control : logi [1:3973] FALSE FALSE FALSE FALSE FALSE FALSE ...
.. .. .. ..$ use : logi [1:3973] TRUE TRUE TRUE TRUE TRUE TRUE ...
.. .. .. ..$ outlier : logi [1:3973] FALSE FALSE FALSE FALSE FALSE FALSE ...
.. .. ..@ elementType : chr "ANY"
.. .. ..@ elementMetadata: NULL
.. .. ..@ metadata : list()
..@ assays :Reference class 'ShallowSimpleListAssays' [package "SummarizedExperiment"] with 1 field
.. ..$ data: NULL
.. ..and 14 methods.
..@ NAMES : NULL
..@ elementMetadata :Formal class 'DataFrame' [package "S4Vectors"] with 6 slots
.. .. ..@ rownames : NULL
.. .. ..@ nrows : int 1842
.. .. ..@ listData : Named list()
.. .. ..@ elementType : chr "ANY"
.. .. ..@ elementMetadata: NULL
.. .. ..@ metadata : list()
..@ metadata :List of 1
.. ..$ name: chr "iMates-1"
and of
class(sce_list[[1]])
[1] "SingleCellExperiment"
attr(,"package")
[1] "SingleCellExperiment"
Could anyone of the R gurus here help me in solving this problem.
r
add a comment |
I have an R code that looks like this:
r <- rowData(sce_list[[1]])
c <- colData(sce_list[[1]])
t <- sce_list[[1]][r$use,c$use]
Till here all runs smoothly. However, when I try to assign the value of t to another object like the following I run into error.
sce_list[[1]]$qc = t
Error in `[[<-`(`*tmp*`, name, value = <S4 object of class "SingleCellExperiment">) :
1842 elements in value to replace 5586 elements
where sce_list is a list of sce.
EDIT:
output of str(t)
Formal class 'SingleCellExperiment' [package "SingleCellExperiment"] with 10 slots
..@ int_elementMetadata:Formal class 'DataFrame' [package "S4Vectors"] with 6 slots
.. .. ..@ rownames : NULL
.. .. ..@ nrows : int 1842
.. .. ..@ listData :List of 2
.. .. .. ..$ is_spike_MT: logi [1:1842] FALSE FALSE FALSE FALSE FALSE FALSE ...
.. .. .. ..$ is_spike : logi [1:1842] FALSE FALSE FALSE FALSE FALSE FALSE ...
.. .. ..@ elementType : chr "ANY"
.. .. ..@ elementMetadata: NULL
.. .. ..@ metadata : list()
..@ int_colData :Formal class 'DataFrame' [package "S4Vectors"] with 6 slots
.. .. ..@ rownames : NULL
.. .. ..@ nrows : int 3973
.. .. ..@ listData : Named list()
.. .. ..@ elementType : chr "ANY"
.. .. ..@ elementMetadata: NULL
.. .. ..@ metadata : list()
..@ int_metadata :List of 2
.. ..$ version :Classes 'package_version', 'numeric_version' hidden list of 1
.. .. ..$ : int [1:3] 1 0 0
.. ..$ spike_names: chr "MT"
..@ reducedDims :Formal class 'SimpleList' [package "S4Vectors"] with 4 slots
.. .. ..@ listData : Named list()
.. .. ..@ elementType : chr "ANY"
.. .. ..@ elementMetadata: NULL
.. .. ..@ metadata : list()
..@ rowRanges :Formal class 'GRangesList' [package "GenomicRanges"] with 5 slots
.. .. ..@ unlistData :Formal class 'GRanges' [package "GenomicRanges"] with 6 slots
.. .. .. .. ..@ seqnames :Formal class 'Rle' [package "S4Vectors"] with 4 slots
.. .. .. .. .. .. ..@ values : Factor w/ 0 levels:
.. .. .. .. .. .. ..@ lengths : int(0)
.. .. .. .. .. .. ..@ elementMetadata: NULL
.. .. .. .. .. .. ..@ metadata : list()
.. .. .. .. ..@ ranges :Formal class 'IRanges' [package "IRanges"] with 6 slots
.. .. .. .. .. .. ..@ start : int(0)
.. .. .. .. .. .. ..@ width : int(0)
.. .. .. .. .. .. ..@ NAMES : NULL
.. .. .. .. .. .. ..@ elementType : chr "integer"
.. .. .. .. .. .. ..@ elementMetadata: NULL
.. .. .. .. .. .. ..@ metadata : list()
.. .. .. .. ..@ strand :Formal class 'Rle' [package "S4Vectors"] with 4 slots
.. .. .. .. .. .. ..@ values : Factor w/ 3 levels "+","-","*":
.. .. .. .. .. .. ..@ lengths : int(0)
.. .. .. .. .. .. ..@ elementMetadata: NULL
.. .. .. .. .. .. ..@ metadata : list()
.. .. .. .. ..@ elementMetadata:Formal class 'DataFrame' [package "S4Vectors"] with 6 slots
.. .. .. .. .. .. ..@ rownames : NULL
.. .. .. .. .. .. ..@ nrows : int 0
.. .. .. .. .. .. ..@ listData : Named list()
.. .. .. .. .. .. ..@ elementType : chr "ANY"
.. .. .. .. .. .. ..@ elementMetadata: NULL
.. .. .. .. .. .. ..@ metadata : list()
.. .. .. .. ..@ seqinfo :Formal class 'Seqinfo' [package "GenomeInfoDb"] with 4 slots
.. .. .. .. .. .. ..@ seqnames : chr(0)
.. .. .. .. .. .. ..@ seqlengths : int(0)
.. .. .. .. .. .. ..@ is_circular: logi(0)
.. .. .. .. .. .. ..@ genome : chr(0)
.. .. .. .. ..@ metadata : list()
.. .. ..@ elementMetadata:Formal class 'DataFrame' [package "S4Vectors"] with 6 slots
.. .. .. .. ..@ rownames : NULL
.. .. .. .. ..@ nrows : int 1842
.. .. .. .. ..@ listData :List of 12
.. .. .. .. .. ..$ id : chr [1:1842] "ENSG00000187608" "ENSG00000186891" "ENSG00000186827" "ENSG00000175756" ...
.. .. .. .. .. ..$ symbol : chr [1:1842] "ISG15" "TNFRSF18" "TNFRSF4" "AURKAIP1" ...
.. .. .. .. .. ..$ is_feature_control : logi [1:1842] FALSE FALSE FALSE FALSE FALSE FALSE ...
.. .. .. .. .. ..$ is_feature_control_MT: logi [1:1842] FALSE FALSE FALSE FALSE FALSE FALSE ...
.. .. .. .. .. ..$ mean_counts : num [1:1842] 5.067 0.166 0.162 0.639 0.719 ...
.. .. .. .. .. ..$ log10_mean_counts : num [1:1842] 0.783 0.0669 0.0651 0.2146 0.2353 ...
.. .. .. .. .. ..$ rank_counts : num [1:1842] 33536 30766 30710 32857 32945 ...
.. .. .. .. .. ..$ n_cells_counts : int [1:1842] 4580 516 458 2376 2578 2153 2277 5388 3604 4131 ...
.. .. .. .. .. ..$ pct_dropout_counts : num [1:1842] 18 90.8 91.8 57.5 53.8 ...
.. .. .. .. .. ..$ total_counts : num [1:1842] 28305 930 904 3569 4017 ...
.. .. .. .. .. ..$ log10_total_counts : num [1:1842] 4.45 2.97 2.96 3.55 3.6 ...
.. .. .. .. .. ..$ use : Named logi [1:1842] TRUE TRUE TRUE TRUE TRUE TRUE ...
.. .. .. .. .. .. ..- attr(*, "names")= chr [1:1842] "ENSG00000187608" "ENSG00000186891" "ENSG00000186827" "ENSG00000175756" ...
.. .. .. .. ..@ elementType : chr "ANY"
.. .. .. .. ..@ elementMetadata: NULL
.. .. .. .. ..@ metadata : list()
.. .. ..@ partitioning :Formal class 'PartitioningByEnd' [package "IRanges"] with 5 slots
.. .. .. .. ..@ end : int [1:1842] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. .. ..@ NAMES : chr [1:1842] "ENSG00000187608" "ENSG00000186891" "ENSG00000186827" "ENSG00000175756" ...
.. .. .. .. ..@ elementType : chr "integer"
.. .. .. .. ..@ elementMetadata: NULL
.. .. .. .. ..@ metadata : list()
.. .. ..@ elementType : chr "GRanges"
.. .. ..@ metadata : list()
..@ colData :Formal class 'DataFrame' [package "S4Vectors"] with 6 slots
.. .. ..@ rownames : chr [1:3973] "AAACCTGAGAAGGTTT-1" "AAACCTGAGCGTTCCG-1" "AAACCTGAGTACGTAA-1" "AAACCTGGTCCATGAT-1" ...
.. .. ..@ nrows : int 3973
.. .. ..@ listData :List of 32
.. .. .. ..$ dataset : int [1:3973] 1 1 1 1 1 1 1 1 1 1 ...
.. .. .. ..$ barcode : chr [1:3973] "AAACCTGAGAAGGTTT-1" "AAACCTGAGCGTTCCG-1" "AAACCTGAGTACGTAA-1" "AAACCTGGTCCATGAT-1" ...
.. .. .. ..$ total_features : int [1:3973] 1373 1837 2259 2601 1967 1236 1642 1153 1078 2682 ...
.. .. .. ..$ log10_total_features : num [1:3973] 3.14 3.26 3.35 3.42 3.29 ...
.. .. .. ..$ total_counts : num [1:3973] 3380 7332 10099 12184 7352 ...
.. .. .. ..$ log10_total_counts : num [1:3973] 3.53 3.87 4 4.09 3.87 ...
.. .. .. ..$ pct_counts_top_50_features : num [1:3973] 33.1 38.9 42.5 42.2 42.8 ...
.. .. .. ..$ pct_counts_top_100_features : num [1:3973] 45 54.8 59.2 53.5 52.4 ...
.. .. .. ..$ pct_counts_top_200_features : num [1:3973] 57.5 66.9 69 64.7 63.5 ...
.. .. .. ..$ pct_counts_top_500_features : num [1:3973] 74.2 79.2 79.4 76.8 76.6 ...
.. .. .. ..$ total_features_endogenous : int [1:3973] 1373 1837 2259 2601 1967 1236 1642 1153 1078 2682 ...
.. .. .. ..$ log10_total_features_endogenous : num [1:3973] 3.14 3.26 3.35 3.42 3.29 ...
.. .. .. ..$ total_counts_endogenous : num [1:3973] 3380 7332 10099 12184 7352 ...
.. .. .. ..$ log10_total_counts_endogenous : num [1:3973] 3.53 3.87 4 4.09 3.87 ...
.. .. .. ..$ pct_counts_endogenous : num [1:3973] 100 100 100 100 100 100 100 100 100 100 ...
.. .. .. ..$ pct_counts_top_50_features_endogenous : num [1:3973] 33.1 38.9 42.5 42.2 42.8 ...
.. .. .. ..$ pct_counts_top_100_features_endogenous: num [1:3973] 45 54.8 59.2 53.5 52.4 ...
.. .. .. ..$ pct_counts_top_200_features_endogenous: num [1:3973] 57.5 66.9 69 64.7 63.5 ...
.. .. .. ..$ pct_counts_top_500_features_endogenous: num [1:3973] 74.2 79.2 79.4 76.8 76.6 ...
.. .. .. ..$ total_features_feature_control : int [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ log10_total_features_feature_control : num [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ total_counts_feature_control : num [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ log10_total_counts_feature_control : num [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ pct_counts_feature_control : num [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ total_features_MT : int [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ log10_total_features_MT : num [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ total_counts_MT : num [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ log10_total_counts_MT : num [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ pct_counts_MT : num [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ is_cell_control : logi [1:3973] FALSE FALSE FALSE FALSE FALSE FALSE ...
.. .. .. ..$ use : logi [1:3973] TRUE TRUE TRUE TRUE TRUE TRUE ...
.. .. .. ..$ outlier : logi [1:3973] FALSE FALSE FALSE FALSE FALSE FALSE ...
.. .. ..@ elementType : chr "ANY"
.. .. ..@ elementMetadata: NULL
.. .. ..@ metadata : list()
..@ assays :Reference class 'ShallowSimpleListAssays' [package "SummarizedExperiment"] with 1 field
.. ..$ data: NULL
.. ..and 14 methods.
..@ NAMES : NULL
..@ elementMetadata :Formal class 'DataFrame' [package "S4Vectors"] with 6 slots
.. .. ..@ rownames : NULL
.. .. ..@ nrows : int 1842
.. .. ..@ listData : Named list()
.. .. ..@ elementType : chr "ANY"
.. .. ..@ elementMetadata: NULL
.. .. ..@ metadata : list()
..@ metadata :List of 1
.. ..$ name: chr "iMates-1"
and of
class(sce_list[[1]])
[1] "SingleCellExperiment"
attr(,"package")
[1] "SingleCellExperiment"
Could anyone of the R gurus here help me in solving this problem.
r
4
What isclass(sce_list[[1]])
? Andstr(t)
? Your first few lines of code don't tell us much of anything since you haven't provided any information about the objects involved. What package defines the classSingleCellExperiment
? Any chance you could construct a minimal reproducible example?
– Gregor
Nov 26 '18 at 14:52
add a comment |
I have an R code that looks like this:
r <- rowData(sce_list[[1]])
c <- colData(sce_list[[1]])
t <- sce_list[[1]][r$use,c$use]
Till here all runs smoothly. However, when I try to assign the value of t to another object like the following I run into error.
sce_list[[1]]$qc = t
Error in `[[<-`(`*tmp*`, name, value = <S4 object of class "SingleCellExperiment">) :
1842 elements in value to replace 5586 elements
where sce_list is a list of sce.
EDIT:
output of str(t)
Formal class 'SingleCellExperiment' [package "SingleCellExperiment"] with 10 slots
..@ int_elementMetadata:Formal class 'DataFrame' [package "S4Vectors"] with 6 slots
.. .. ..@ rownames : NULL
.. .. ..@ nrows : int 1842
.. .. ..@ listData :List of 2
.. .. .. ..$ is_spike_MT: logi [1:1842] FALSE FALSE FALSE FALSE FALSE FALSE ...
.. .. .. ..$ is_spike : logi [1:1842] FALSE FALSE FALSE FALSE FALSE FALSE ...
.. .. ..@ elementType : chr "ANY"
.. .. ..@ elementMetadata: NULL
.. .. ..@ metadata : list()
..@ int_colData :Formal class 'DataFrame' [package "S4Vectors"] with 6 slots
.. .. ..@ rownames : NULL
.. .. ..@ nrows : int 3973
.. .. ..@ listData : Named list()
.. .. ..@ elementType : chr "ANY"
.. .. ..@ elementMetadata: NULL
.. .. ..@ metadata : list()
..@ int_metadata :List of 2
.. ..$ version :Classes 'package_version', 'numeric_version' hidden list of 1
.. .. ..$ : int [1:3] 1 0 0
.. ..$ spike_names: chr "MT"
..@ reducedDims :Formal class 'SimpleList' [package "S4Vectors"] with 4 slots
.. .. ..@ listData : Named list()
.. .. ..@ elementType : chr "ANY"
.. .. ..@ elementMetadata: NULL
.. .. ..@ metadata : list()
..@ rowRanges :Formal class 'GRangesList' [package "GenomicRanges"] with 5 slots
.. .. ..@ unlistData :Formal class 'GRanges' [package "GenomicRanges"] with 6 slots
.. .. .. .. ..@ seqnames :Formal class 'Rle' [package "S4Vectors"] with 4 slots
.. .. .. .. .. .. ..@ values : Factor w/ 0 levels:
.. .. .. .. .. .. ..@ lengths : int(0)
.. .. .. .. .. .. ..@ elementMetadata: NULL
.. .. .. .. .. .. ..@ metadata : list()
.. .. .. .. ..@ ranges :Formal class 'IRanges' [package "IRanges"] with 6 slots
.. .. .. .. .. .. ..@ start : int(0)
.. .. .. .. .. .. ..@ width : int(0)
.. .. .. .. .. .. ..@ NAMES : NULL
.. .. .. .. .. .. ..@ elementType : chr "integer"
.. .. .. .. .. .. ..@ elementMetadata: NULL
.. .. .. .. .. .. ..@ metadata : list()
.. .. .. .. ..@ strand :Formal class 'Rle' [package "S4Vectors"] with 4 slots
.. .. .. .. .. .. ..@ values : Factor w/ 3 levels "+","-","*":
.. .. .. .. .. .. ..@ lengths : int(0)
.. .. .. .. .. .. ..@ elementMetadata: NULL
.. .. .. .. .. .. ..@ metadata : list()
.. .. .. .. ..@ elementMetadata:Formal class 'DataFrame' [package "S4Vectors"] with 6 slots
.. .. .. .. .. .. ..@ rownames : NULL
.. .. .. .. .. .. ..@ nrows : int 0
.. .. .. .. .. .. ..@ listData : Named list()
.. .. .. .. .. .. ..@ elementType : chr "ANY"
.. .. .. .. .. .. ..@ elementMetadata: NULL
.. .. .. .. .. .. ..@ metadata : list()
.. .. .. .. ..@ seqinfo :Formal class 'Seqinfo' [package "GenomeInfoDb"] with 4 slots
.. .. .. .. .. .. ..@ seqnames : chr(0)
.. .. .. .. .. .. ..@ seqlengths : int(0)
.. .. .. .. .. .. ..@ is_circular: logi(0)
.. .. .. .. .. .. ..@ genome : chr(0)
.. .. .. .. ..@ metadata : list()
.. .. ..@ elementMetadata:Formal class 'DataFrame' [package "S4Vectors"] with 6 slots
.. .. .. .. ..@ rownames : NULL
.. .. .. .. ..@ nrows : int 1842
.. .. .. .. ..@ listData :List of 12
.. .. .. .. .. ..$ id : chr [1:1842] "ENSG00000187608" "ENSG00000186891" "ENSG00000186827" "ENSG00000175756" ...
.. .. .. .. .. ..$ symbol : chr [1:1842] "ISG15" "TNFRSF18" "TNFRSF4" "AURKAIP1" ...
.. .. .. .. .. ..$ is_feature_control : logi [1:1842] FALSE FALSE FALSE FALSE FALSE FALSE ...
.. .. .. .. .. ..$ is_feature_control_MT: logi [1:1842] FALSE FALSE FALSE FALSE FALSE FALSE ...
.. .. .. .. .. ..$ mean_counts : num [1:1842] 5.067 0.166 0.162 0.639 0.719 ...
.. .. .. .. .. ..$ log10_mean_counts : num [1:1842] 0.783 0.0669 0.0651 0.2146 0.2353 ...
.. .. .. .. .. ..$ rank_counts : num [1:1842] 33536 30766 30710 32857 32945 ...
.. .. .. .. .. ..$ n_cells_counts : int [1:1842] 4580 516 458 2376 2578 2153 2277 5388 3604 4131 ...
.. .. .. .. .. ..$ pct_dropout_counts : num [1:1842] 18 90.8 91.8 57.5 53.8 ...
.. .. .. .. .. ..$ total_counts : num [1:1842] 28305 930 904 3569 4017 ...
.. .. .. .. .. ..$ log10_total_counts : num [1:1842] 4.45 2.97 2.96 3.55 3.6 ...
.. .. .. .. .. ..$ use : Named logi [1:1842] TRUE TRUE TRUE TRUE TRUE TRUE ...
.. .. .. .. .. .. ..- attr(*, "names")= chr [1:1842] "ENSG00000187608" "ENSG00000186891" "ENSG00000186827" "ENSG00000175756" ...
.. .. .. .. ..@ elementType : chr "ANY"
.. .. .. .. ..@ elementMetadata: NULL
.. .. .. .. ..@ metadata : list()
.. .. ..@ partitioning :Formal class 'PartitioningByEnd' [package "IRanges"] with 5 slots
.. .. .. .. ..@ end : int [1:1842] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. .. ..@ NAMES : chr [1:1842] "ENSG00000187608" "ENSG00000186891" "ENSG00000186827" "ENSG00000175756" ...
.. .. .. .. ..@ elementType : chr "integer"
.. .. .. .. ..@ elementMetadata: NULL
.. .. .. .. ..@ metadata : list()
.. .. ..@ elementType : chr "GRanges"
.. .. ..@ metadata : list()
..@ colData :Formal class 'DataFrame' [package "S4Vectors"] with 6 slots
.. .. ..@ rownames : chr [1:3973] "AAACCTGAGAAGGTTT-1" "AAACCTGAGCGTTCCG-1" "AAACCTGAGTACGTAA-1" "AAACCTGGTCCATGAT-1" ...
.. .. ..@ nrows : int 3973
.. .. ..@ listData :List of 32
.. .. .. ..$ dataset : int [1:3973] 1 1 1 1 1 1 1 1 1 1 ...
.. .. .. ..$ barcode : chr [1:3973] "AAACCTGAGAAGGTTT-1" "AAACCTGAGCGTTCCG-1" "AAACCTGAGTACGTAA-1" "AAACCTGGTCCATGAT-1" ...
.. .. .. ..$ total_features : int [1:3973] 1373 1837 2259 2601 1967 1236 1642 1153 1078 2682 ...
.. .. .. ..$ log10_total_features : num [1:3973] 3.14 3.26 3.35 3.42 3.29 ...
.. .. .. ..$ total_counts : num [1:3973] 3380 7332 10099 12184 7352 ...
.. .. .. ..$ log10_total_counts : num [1:3973] 3.53 3.87 4 4.09 3.87 ...
.. .. .. ..$ pct_counts_top_50_features : num [1:3973] 33.1 38.9 42.5 42.2 42.8 ...
.. .. .. ..$ pct_counts_top_100_features : num [1:3973] 45 54.8 59.2 53.5 52.4 ...
.. .. .. ..$ pct_counts_top_200_features : num [1:3973] 57.5 66.9 69 64.7 63.5 ...
.. .. .. ..$ pct_counts_top_500_features : num [1:3973] 74.2 79.2 79.4 76.8 76.6 ...
.. .. .. ..$ total_features_endogenous : int [1:3973] 1373 1837 2259 2601 1967 1236 1642 1153 1078 2682 ...
.. .. .. ..$ log10_total_features_endogenous : num [1:3973] 3.14 3.26 3.35 3.42 3.29 ...
.. .. .. ..$ total_counts_endogenous : num [1:3973] 3380 7332 10099 12184 7352 ...
.. .. .. ..$ log10_total_counts_endogenous : num [1:3973] 3.53 3.87 4 4.09 3.87 ...
.. .. .. ..$ pct_counts_endogenous : num [1:3973] 100 100 100 100 100 100 100 100 100 100 ...
.. .. .. ..$ pct_counts_top_50_features_endogenous : num [1:3973] 33.1 38.9 42.5 42.2 42.8 ...
.. .. .. ..$ pct_counts_top_100_features_endogenous: num [1:3973] 45 54.8 59.2 53.5 52.4 ...
.. .. .. ..$ pct_counts_top_200_features_endogenous: num [1:3973] 57.5 66.9 69 64.7 63.5 ...
.. .. .. ..$ pct_counts_top_500_features_endogenous: num [1:3973] 74.2 79.2 79.4 76.8 76.6 ...
.. .. .. ..$ total_features_feature_control : int [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ log10_total_features_feature_control : num [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ total_counts_feature_control : num [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ log10_total_counts_feature_control : num [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ pct_counts_feature_control : num [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ total_features_MT : int [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ log10_total_features_MT : num [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ total_counts_MT : num [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ log10_total_counts_MT : num [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ pct_counts_MT : num [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ is_cell_control : logi [1:3973] FALSE FALSE FALSE FALSE FALSE FALSE ...
.. .. .. ..$ use : logi [1:3973] TRUE TRUE TRUE TRUE TRUE TRUE ...
.. .. .. ..$ outlier : logi [1:3973] FALSE FALSE FALSE FALSE FALSE FALSE ...
.. .. ..@ elementType : chr "ANY"
.. .. ..@ elementMetadata: NULL
.. .. ..@ metadata : list()
..@ assays :Reference class 'ShallowSimpleListAssays' [package "SummarizedExperiment"] with 1 field
.. ..$ data: NULL
.. ..and 14 methods.
..@ NAMES : NULL
..@ elementMetadata :Formal class 'DataFrame' [package "S4Vectors"] with 6 slots
.. .. ..@ rownames : NULL
.. .. ..@ nrows : int 1842
.. .. ..@ listData : Named list()
.. .. ..@ elementType : chr "ANY"
.. .. ..@ elementMetadata: NULL
.. .. ..@ metadata : list()
..@ metadata :List of 1
.. ..$ name: chr "iMates-1"
and of
class(sce_list[[1]])
[1] "SingleCellExperiment"
attr(,"package")
[1] "SingleCellExperiment"
Could anyone of the R gurus here help me in solving this problem.
r
I have an R code that looks like this:
r <- rowData(sce_list[[1]])
c <- colData(sce_list[[1]])
t <- sce_list[[1]][r$use,c$use]
Till here all runs smoothly. However, when I try to assign the value of t to another object like the following I run into error.
sce_list[[1]]$qc = t
Error in `[[<-`(`*tmp*`, name, value = <S4 object of class "SingleCellExperiment">) :
1842 elements in value to replace 5586 elements
where sce_list is a list of sce.
EDIT:
output of str(t)
Formal class 'SingleCellExperiment' [package "SingleCellExperiment"] with 10 slots
..@ int_elementMetadata:Formal class 'DataFrame' [package "S4Vectors"] with 6 slots
.. .. ..@ rownames : NULL
.. .. ..@ nrows : int 1842
.. .. ..@ listData :List of 2
.. .. .. ..$ is_spike_MT: logi [1:1842] FALSE FALSE FALSE FALSE FALSE FALSE ...
.. .. .. ..$ is_spike : logi [1:1842] FALSE FALSE FALSE FALSE FALSE FALSE ...
.. .. ..@ elementType : chr "ANY"
.. .. ..@ elementMetadata: NULL
.. .. ..@ metadata : list()
..@ int_colData :Formal class 'DataFrame' [package "S4Vectors"] with 6 slots
.. .. ..@ rownames : NULL
.. .. ..@ nrows : int 3973
.. .. ..@ listData : Named list()
.. .. ..@ elementType : chr "ANY"
.. .. ..@ elementMetadata: NULL
.. .. ..@ metadata : list()
..@ int_metadata :List of 2
.. ..$ version :Classes 'package_version', 'numeric_version' hidden list of 1
.. .. ..$ : int [1:3] 1 0 0
.. ..$ spike_names: chr "MT"
..@ reducedDims :Formal class 'SimpleList' [package "S4Vectors"] with 4 slots
.. .. ..@ listData : Named list()
.. .. ..@ elementType : chr "ANY"
.. .. ..@ elementMetadata: NULL
.. .. ..@ metadata : list()
..@ rowRanges :Formal class 'GRangesList' [package "GenomicRanges"] with 5 slots
.. .. ..@ unlistData :Formal class 'GRanges' [package "GenomicRanges"] with 6 slots
.. .. .. .. ..@ seqnames :Formal class 'Rle' [package "S4Vectors"] with 4 slots
.. .. .. .. .. .. ..@ values : Factor w/ 0 levels:
.. .. .. .. .. .. ..@ lengths : int(0)
.. .. .. .. .. .. ..@ elementMetadata: NULL
.. .. .. .. .. .. ..@ metadata : list()
.. .. .. .. ..@ ranges :Formal class 'IRanges' [package "IRanges"] with 6 slots
.. .. .. .. .. .. ..@ start : int(0)
.. .. .. .. .. .. ..@ width : int(0)
.. .. .. .. .. .. ..@ NAMES : NULL
.. .. .. .. .. .. ..@ elementType : chr "integer"
.. .. .. .. .. .. ..@ elementMetadata: NULL
.. .. .. .. .. .. ..@ metadata : list()
.. .. .. .. ..@ strand :Formal class 'Rle' [package "S4Vectors"] with 4 slots
.. .. .. .. .. .. ..@ values : Factor w/ 3 levels "+","-","*":
.. .. .. .. .. .. ..@ lengths : int(0)
.. .. .. .. .. .. ..@ elementMetadata: NULL
.. .. .. .. .. .. ..@ metadata : list()
.. .. .. .. ..@ elementMetadata:Formal class 'DataFrame' [package "S4Vectors"] with 6 slots
.. .. .. .. .. .. ..@ rownames : NULL
.. .. .. .. .. .. ..@ nrows : int 0
.. .. .. .. .. .. ..@ listData : Named list()
.. .. .. .. .. .. ..@ elementType : chr "ANY"
.. .. .. .. .. .. ..@ elementMetadata: NULL
.. .. .. .. .. .. ..@ metadata : list()
.. .. .. .. ..@ seqinfo :Formal class 'Seqinfo' [package "GenomeInfoDb"] with 4 slots
.. .. .. .. .. .. ..@ seqnames : chr(0)
.. .. .. .. .. .. ..@ seqlengths : int(0)
.. .. .. .. .. .. ..@ is_circular: logi(0)
.. .. .. .. .. .. ..@ genome : chr(0)
.. .. .. .. ..@ metadata : list()
.. .. ..@ elementMetadata:Formal class 'DataFrame' [package "S4Vectors"] with 6 slots
.. .. .. .. ..@ rownames : NULL
.. .. .. .. ..@ nrows : int 1842
.. .. .. .. ..@ listData :List of 12
.. .. .. .. .. ..$ id : chr [1:1842] "ENSG00000187608" "ENSG00000186891" "ENSG00000186827" "ENSG00000175756" ...
.. .. .. .. .. ..$ symbol : chr [1:1842] "ISG15" "TNFRSF18" "TNFRSF4" "AURKAIP1" ...
.. .. .. .. .. ..$ is_feature_control : logi [1:1842] FALSE FALSE FALSE FALSE FALSE FALSE ...
.. .. .. .. .. ..$ is_feature_control_MT: logi [1:1842] FALSE FALSE FALSE FALSE FALSE FALSE ...
.. .. .. .. .. ..$ mean_counts : num [1:1842] 5.067 0.166 0.162 0.639 0.719 ...
.. .. .. .. .. ..$ log10_mean_counts : num [1:1842] 0.783 0.0669 0.0651 0.2146 0.2353 ...
.. .. .. .. .. ..$ rank_counts : num [1:1842] 33536 30766 30710 32857 32945 ...
.. .. .. .. .. ..$ n_cells_counts : int [1:1842] 4580 516 458 2376 2578 2153 2277 5388 3604 4131 ...
.. .. .. .. .. ..$ pct_dropout_counts : num [1:1842] 18 90.8 91.8 57.5 53.8 ...
.. .. .. .. .. ..$ total_counts : num [1:1842] 28305 930 904 3569 4017 ...
.. .. .. .. .. ..$ log10_total_counts : num [1:1842] 4.45 2.97 2.96 3.55 3.6 ...
.. .. .. .. .. ..$ use : Named logi [1:1842] TRUE TRUE TRUE TRUE TRUE TRUE ...
.. .. .. .. .. .. ..- attr(*, "names")= chr [1:1842] "ENSG00000187608" "ENSG00000186891" "ENSG00000186827" "ENSG00000175756" ...
.. .. .. .. ..@ elementType : chr "ANY"
.. .. .. .. ..@ elementMetadata: NULL
.. .. .. .. ..@ metadata : list()
.. .. ..@ partitioning :Formal class 'PartitioningByEnd' [package "IRanges"] with 5 slots
.. .. .. .. ..@ end : int [1:1842] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. .. ..@ NAMES : chr [1:1842] "ENSG00000187608" "ENSG00000186891" "ENSG00000186827" "ENSG00000175756" ...
.. .. .. .. ..@ elementType : chr "integer"
.. .. .. .. ..@ elementMetadata: NULL
.. .. .. .. ..@ metadata : list()
.. .. ..@ elementType : chr "GRanges"
.. .. ..@ metadata : list()
..@ colData :Formal class 'DataFrame' [package "S4Vectors"] with 6 slots
.. .. ..@ rownames : chr [1:3973] "AAACCTGAGAAGGTTT-1" "AAACCTGAGCGTTCCG-1" "AAACCTGAGTACGTAA-1" "AAACCTGGTCCATGAT-1" ...
.. .. ..@ nrows : int 3973
.. .. ..@ listData :List of 32
.. .. .. ..$ dataset : int [1:3973] 1 1 1 1 1 1 1 1 1 1 ...
.. .. .. ..$ barcode : chr [1:3973] "AAACCTGAGAAGGTTT-1" "AAACCTGAGCGTTCCG-1" "AAACCTGAGTACGTAA-1" "AAACCTGGTCCATGAT-1" ...
.. .. .. ..$ total_features : int [1:3973] 1373 1837 2259 2601 1967 1236 1642 1153 1078 2682 ...
.. .. .. ..$ log10_total_features : num [1:3973] 3.14 3.26 3.35 3.42 3.29 ...
.. .. .. ..$ total_counts : num [1:3973] 3380 7332 10099 12184 7352 ...
.. .. .. ..$ log10_total_counts : num [1:3973] 3.53 3.87 4 4.09 3.87 ...
.. .. .. ..$ pct_counts_top_50_features : num [1:3973] 33.1 38.9 42.5 42.2 42.8 ...
.. .. .. ..$ pct_counts_top_100_features : num [1:3973] 45 54.8 59.2 53.5 52.4 ...
.. .. .. ..$ pct_counts_top_200_features : num [1:3973] 57.5 66.9 69 64.7 63.5 ...
.. .. .. ..$ pct_counts_top_500_features : num [1:3973] 74.2 79.2 79.4 76.8 76.6 ...
.. .. .. ..$ total_features_endogenous : int [1:3973] 1373 1837 2259 2601 1967 1236 1642 1153 1078 2682 ...
.. .. .. ..$ log10_total_features_endogenous : num [1:3973] 3.14 3.26 3.35 3.42 3.29 ...
.. .. .. ..$ total_counts_endogenous : num [1:3973] 3380 7332 10099 12184 7352 ...
.. .. .. ..$ log10_total_counts_endogenous : num [1:3973] 3.53 3.87 4 4.09 3.87 ...
.. .. .. ..$ pct_counts_endogenous : num [1:3973] 100 100 100 100 100 100 100 100 100 100 ...
.. .. .. ..$ pct_counts_top_50_features_endogenous : num [1:3973] 33.1 38.9 42.5 42.2 42.8 ...
.. .. .. ..$ pct_counts_top_100_features_endogenous: num [1:3973] 45 54.8 59.2 53.5 52.4 ...
.. .. .. ..$ pct_counts_top_200_features_endogenous: num [1:3973] 57.5 66.9 69 64.7 63.5 ...
.. .. .. ..$ pct_counts_top_500_features_endogenous: num [1:3973] 74.2 79.2 79.4 76.8 76.6 ...
.. .. .. ..$ total_features_feature_control : int [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ log10_total_features_feature_control : num [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ total_counts_feature_control : num [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ log10_total_counts_feature_control : num [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ pct_counts_feature_control : num [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ total_features_MT : int [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ log10_total_features_MT : num [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ total_counts_MT : num [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ log10_total_counts_MT : num [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ pct_counts_MT : num [1:3973] 0 0 0 0 0 0 0 0 0 0 ...
.. .. .. ..$ is_cell_control : logi [1:3973] FALSE FALSE FALSE FALSE FALSE FALSE ...
.. .. .. ..$ use : logi [1:3973] TRUE TRUE TRUE TRUE TRUE TRUE ...
.. .. .. ..$ outlier : logi [1:3973] FALSE FALSE FALSE FALSE FALSE FALSE ...
.. .. ..@ elementType : chr "ANY"
.. .. ..@ elementMetadata: NULL
.. .. ..@ metadata : list()
..@ assays :Reference class 'ShallowSimpleListAssays' [package "SummarizedExperiment"] with 1 field
.. ..$ data: NULL
.. ..and 14 methods.
..@ NAMES : NULL
..@ elementMetadata :Formal class 'DataFrame' [package "S4Vectors"] with 6 slots
.. .. ..@ rownames : NULL
.. .. ..@ nrows : int 1842
.. .. ..@ listData : Named list()
.. .. ..@ elementType : chr "ANY"
.. .. ..@ elementMetadata: NULL
.. .. ..@ metadata : list()
..@ metadata :List of 1
.. ..$ name: chr "iMates-1"
and of
class(sce_list[[1]])
[1] "SingleCellExperiment"
attr(,"package")
[1] "SingleCellExperiment"
Could anyone of the R gurus here help me in solving this problem.
r
r
edited Nov 26 '18 at 15:42
Angelo
asked Nov 26 '18 at 14:42
AngeloAngelo
1,65262345
1,65262345
4
What isclass(sce_list[[1]])
? Andstr(t)
? Your first few lines of code don't tell us much of anything since you haven't provided any information about the objects involved. What package defines the classSingleCellExperiment
? Any chance you could construct a minimal reproducible example?
– Gregor
Nov 26 '18 at 14:52
add a comment |
4
What isclass(sce_list[[1]])
? Andstr(t)
? Your first few lines of code don't tell us much of anything since you haven't provided any information about the objects involved. What package defines the classSingleCellExperiment
? Any chance you could construct a minimal reproducible example?
– Gregor
Nov 26 '18 at 14:52
4
4
What is
class(sce_list[[1]])
? And str(t)
? Your first few lines of code don't tell us much of anything since you haven't provided any information about the objects involved. What package defines the class SingleCellExperiment
? Any chance you could construct a minimal reproducible example?– Gregor
Nov 26 '18 at 14:52
What is
class(sce_list[[1]])
? And str(t)
? Your first few lines of code don't tell us much of anything since you haven't provided any information about the objects involved. What package defines the class SingleCellExperiment
? Any chance you could construct a minimal reproducible example?– Gregor
Nov 26 '18 at 14:52
add a comment |
1 Answer
1
active
oldest
votes
I figured out a way around to solve this problem. It is not the most elegant answer but it does solve the problem.So here it is:
for (i in seq_along(sce_list))
{
r <- rowData(sce_list[[i]])$use
c <- colData(sce_list[[i]])$use
tt=(sce_list[[i]])[r,c]
assign(paste0("sce_",i,".qc"),tt)
}
Yes, I have put this in a loop as I want this to run in a loop. :)
If someone has an elegant way of doing this please post it and I will try it out.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53483510%2ferror-while-assigning-value-to-list-of-list%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I figured out a way around to solve this problem. It is not the most elegant answer but it does solve the problem.So here it is:
for (i in seq_along(sce_list))
{
r <- rowData(sce_list[[i]])$use
c <- colData(sce_list[[i]])$use
tt=(sce_list[[i]])[r,c]
assign(paste0("sce_",i,".qc"),tt)
}
Yes, I have put this in a loop as I want this to run in a loop. :)
If someone has an elegant way of doing this please post it and I will try it out.
add a comment |
I figured out a way around to solve this problem. It is not the most elegant answer but it does solve the problem.So here it is:
for (i in seq_along(sce_list))
{
r <- rowData(sce_list[[i]])$use
c <- colData(sce_list[[i]])$use
tt=(sce_list[[i]])[r,c]
assign(paste0("sce_",i,".qc"),tt)
}
Yes, I have put this in a loop as I want this to run in a loop. :)
If someone has an elegant way of doing this please post it and I will try it out.
add a comment |
I figured out a way around to solve this problem. It is not the most elegant answer but it does solve the problem.So here it is:
for (i in seq_along(sce_list))
{
r <- rowData(sce_list[[i]])$use
c <- colData(sce_list[[i]])$use
tt=(sce_list[[i]])[r,c]
assign(paste0("sce_",i,".qc"),tt)
}
Yes, I have put this in a loop as I want this to run in a loop. :)
If someone has an elegant way of doing this please post it and I will try it out.
I figured out a way around to solve this problem. It is not the most elegant answer but it does solve the problem.So here it is:
for (i in seq_along(sce_list))
{
r <- rowData(sce_list[[i]])$use
c <- colData(sce_list[[i]])$use
tt=(sce_list[[i]])[r,c]
assign(paste0("sce_",i,".qc"),tt)
}
Yes, I have put this in a loop as I want this to run in a loop. :)
If someone has an elegant way of doing this please post it and I will try it out.
answered Nov 27 '18 at 10:37
AngeloAngelo
1,65262345
1,65262345
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53483510%2ferror-while-assigning-value-to-list-of-list%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
4
What is
class(sce_list[[1]])
? Andstr(t)
? Your first few lines of code don't tell us much of anything since you haven't provided any information about the objects involved. What package defines the classSingleCellExperiment
? Any chance you could construct a minimal reproducible example?– Gregor
Nov 26 '18 at 14:52