问题
I have an R markdown code chunk that looks like this ( it is a small part of an extremely large code).
filterLowExpressedGenes <- function(sce, cutoffCell, cutoffTranscript){
apply(
counts(sce[ , colData(sce)$use]),
1,
function(x) length(x[x > cutoffTranscript]) >= cutoffCell)
}
```
```{r include=T}
for (i in seq_along(sce_list))
{
print(rowData(sce_list[[i]])$use <- filterLowExpressedGenes(sce_list[[i]], 3, 5))
}
```
{r include=T}
for (i in seq_along(sce_list))
{
print(table(rowData(sce_list[[i]])$use))
}
Till here all works fine and the output is:
## [1] "sce_1"
##
## FALSE TRUE
## 31852 1842
## [1] "sce_2"
##
## FALSE TRUE
## 31009 2685
## [1] "sce_3"
##
## FALSE TRUE
## 31560 2134
## [1] "sce_4"
##
## FALSE TRUE
## 31697 1997
The next chunk that operates on the information processed in the previous chunks throws up error:
code:
```{r include=T}
for (i in seq_along(sce_list))
{
sce_list[[i]]$qc = sce_list[[i]][rowData(sce_list[[i]]$use), colData(sce_list[[i]]$use)]
}
```
The error that I get is:
Quitting from lines 331-345 (prototype.Rmd)
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function 'rowData' for signature '"logical"'
Calls: <Anonymous> ... withVisible -> eval -> eval -> [ -> rowData -> <Anonymous>
Execution halted
I am sorry, I cannot provide you the sample workable data. As this is somewhat in between coding portion and that means that data has already gone under some sort of processing.
I am fully aware that it will require some guess work or hit and trial to figure out the solution. But any help/suggestion to make this work is welcome.
Thank you in advance.
来源:https://stackoverflow.com/questions/53456853/unable-to-find-an-inherited-method-for-function-rowdata-for-signature-logica