Differential abundance analysis at gene level

ToxA vs Control

# Create a list of genes with sgRNA indices to use in fry test index argument
genesymbols <- yy.norm$genes[, 1]
genesymbollist <- list()
unq <- unique(genesymbols)
unq <- unq[!is.na(unq)]
for (i in unq) {
    sel <- genesymbols == i & !is.na(genesymbols)
    if (sum(sel) > 3)
        genesymbollist[[i]] <- which(sel)
}

fry.res <- fry(yy.norm, index = genesymbollist, design, contrast = "groupToxA")
datatable(format(fry.res, format = "e", digits = 3))

ToxB vs Control

genesymbols <- yy.norm$genes[, 1]
genesymbollist <- list()
unq <- unique(genesymbols)
unq <- unq[!is.na(unq)]
for (i in unq) {
    sel <- genesymbols == i & !is.na(genesymbols)
    if (sum(sel) > 3)
        genesymbollist[[i]] <- which(sel)
}

fry.res <- fry(yy.norm, index = genesymbollist, design, contrast = "groupToxB")
datatable(format(fry.res, format = "e", digits = 3))