Entering edit mode
annkolman78
•
0
@annkolman78-21980
Last seen 5.2 years ago
Hi,
I have my data in a SummarizedExperiment format. I would like to filter out reads that have less than 1 read count (exp_count<1)
data
data class: RangedSummarizedExperiment
dim: 56756 100
metadata(0):
assays(10): exp_count TPM ...
FPKM
FPKM_CO
rownames(57736): ENSG00000000003
ENSG00000000005 ... ENSG00000273492
ENSG00000273493
rowData names(9): gene hgncl ...
colnames(100): 1 1 ...
99 100
colData names(13): ID SAMPLE
I have tried:
data_matrix <- data@assays[[1]]
data_filtered <- data_matrix[rowSums(count(data_matrix))>1,]
but got an error:
Error in count(data_matrix) :
Argument 'x' must be a vector: numeric
and
data_filtered <- data[rowSums(count(data@assays[[1]]))>1,]
Error in count(data@assays[[1]]) :
Argument 'x' must be a vector: numeric
Thank you.
Please NEVER use direct slot access
@
and instead use accessors,assay()
orassays(data)[[1]]
.Hi,
Thank you for your reply. I have modified it. What is the reason? But, unfortunatelly it didn't solve the problem.
Thank you
'Accessors' define how the object is to be manipulated by the user, allowing the developer to chose representations that are efficient for them. For instance, in the Biostrings package
there is no obvious relationship between operations the user might like to perform and the slots used by the developer to represent the data.