function meaning(on.index <- which(filter$on == 1))
Entering edit mode
Last seen 4.2 years ago


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 <-, nrow = nrow(cds), ncol=ncol(cds)))
+ nbT <- nbinomTest(cds.filter, cond1totest, cond2totest)
+ colnames(res) <- colnames(nbT)
+ res[on.index,] <- nbT


metarnaseq Jaccard index htsfilter • 444 views
Entering edit mode
andrea.rau ▴ 80
Last seen 9 months ago
INRAE / Jouy en Josas, France

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.


Login before adding your answer.

Traffic: 251 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6