function meaning(on.index <- which(filter$on == 1))
1
0
Entering edit mode
@ed_isfahani-12190
Last seen 7.4 years ago

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

 

metarnaseq Jaccard index htsfilter • 1.1k views
ADD COMMENT
1
Entering edit mode
andrea.rau ▴ 80
@andrearau-7032
Last seen 2.7 years 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.

ADD COMMENT

Login before adding your answer.

Traffic: 795 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

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

Powered by the version 2.3.6