Question: function meaning(on.index <- which(filter$on == 1)) 0 2.4 years ago by ed_isfahani0 wrote: Hi, what is the meaning of this function " on.index <- which(filter$on == 1)"?

it is a part of metaRNAseq for filter data:

## Filter using Jaccard index for each study

filter <- HTSFilter(cds, plot=FALSE)
+ cds.filter <- filter$filteredData + on.index <- which(filter$on == 1)
+ cat("# genes passing filter", studyname, ":", dim(cds.filter)[1], "\n")
+ res <- as.data.frame(matrix(NA, nrow = nrow(cds), ncol=ncol(cds)))
+ nbT <- nbinomTest(cds.filter, cond1totest, cond2totest)
+ colnames(res) <- colnames(nbT)
+ res[on.index,] <- nbT

Answer: function meaning(on.index <- which(filter$on == 1)) 1 2.4 years ago by andrea.rau60 INRA / Jouy en Josas, France andrea.rau60 wrote: In this code, the HTSFilter package is being used to filter the data (contained in the cds object) to remove genes with relatively low counts across samples using a data-driven filtering threshold. The HTSFilter function returns both the filtered data themselves (contained in filter$filteredData, which will have a number of rows less than or equal to the number of rows in cds) as well as a binary vector (contained in filter\$on) of the same length as the number of rows in cds indicating whether a gene was retained after the filtering (1) or not (0). So on.index will just provide the indices of genes retained after filtering -- as you can see, above it is used to fill in the appropriate rows of the res data.frame with the results from the DESeq function nbinomTest.