1 Introduction

Having established that the TMRC2 macrophage data looks robust and illustrative of a couple of interesting questions, let us perform a couple of differential analyses of it.

1.1 Human data

1.1.1 Primary queries

There is a series of initial questions which make some intuitive sense to me, but these do not necessarily match the set of questions which are intuitive for Olga. I am hoping to pull both of these sets of queries in one.

Before extracting these groups of queries, let us invoke the all_pairwise() function and get all of the likely contrasts along with one or more extras that might prove useful (the ‘extra’ argument).

extra <- "z23drugnodrug_vs_z22drugnodrug = (infsbz23 - infz23) - (infsbz22 - infz22)"
new_conditions <- paste0(pData(hs_macrophage)[["macrophagetreatment"]], "_",
                         pData(hs_macrophage)[["macrophagezymodeme"]])
hs_macrophage <- set_expt_conditions(hs_macrophage, fact = new_conditions)

hs_macrophage_de <- all_pairwise(hs_macrophage, model_batch="svaseq", filter=TRUE,
                                 extra_contrasts = extra)
## This DE analysis will perform all pairwise comparisons among:
## 
##   inf_sb_z2.2   inf_sb_z2.3      inf_z2.2      inf_z2.3    uninf_none 
##             6             6             6             6             2 
## uninf_sb_none 
##             2
## This analysis will include surrogate estimates from: svaseq.
## This will pre-filter the input data using normalize_expt's: TRUE argument.
## Removing 0 low-count genes (11460 remaining).
## Setting 757 low elements to zero.
## transform_counts: Found 757 values equal to 0, adding 1 to the matrix.
## Finished running DE analyses, collecting outputs.
## Comparing analyses.
## Used reverse contrast for deseq.
## Used reverse contrast for edger.
## Used reverse contrast for deseq.
## Used reverse contrast for basic.

1.1.1.1 Primary query contrasts

The final contrast in this list is interesting because it depends on the extra contrasts applied to the all_pairwise() above. In my way of thinking, the primary comparisons to consider are either cross-drug or cross-strain, but not both. However I think in at least a few instances Olga is interested in strain+drug / uninfected+nodrug.

tmrc2_human_keepers <- list(
    "z23nosb_vs_uninf" = c("infz23", "uninfnone"),
    "z22nosb_vs_uninf" = c("infz22", "uninfnone"),
    "z23nosb_vs_z22nosb" = c("infz23", "infz22"),
    "z23sb_vs_z22sb" = c("infsbz23", "infsbz22"),
    "z23sb_vs_z23nosb" = c("infsbz23", "infz23"),
    "z22sb_vs_z22nosb" = c("infsbz22", "infz22"),
    "z23sb_vs_sb" = c("infz23", "uninfsbnone"),
    "z22sb_vs_sb" = c("infz22", "uninfsbnone"),
    "z23sb_vs_uninf" = c("infsbz23", "uninfnone"),
    "z22sb_vs_uninf" = c("infsbz22", "uninfnone"),
    "sb_vs_uninf" = c("uninfsbnone", "uninfnone"),
    "extra" = c("z23drugnodrug", "z22drugnodrug"))

1.1.1.2 Write contrast results

Now let us write out the xlsx file containing the above contrasts. The file with the suffix _table-version will therefore contain all genes and the file with the suffix _sig-version will contain only those deemed significant via our default criteria of DESeq2 |logFC| >= 1.0 and adjusted p-value <= 0.05.

hs_macrophage_table <- combine_de_tables(
    hs_macrophage_de,
    keepers = tmrc2_human_keepers,
    excel=glue::glue("excel/macrophage_human_table-v{ver}.xlsx"))
## Deleting the file excel/macrophage_human_table-v202209.xlsx before writing the tables.
## Warning in combine_single_de_table(li = limma, ed = edger, eb = ebseq, de =
## deseq, : The deseq table seems to be missing.
## Warning in combine_single_de_table(li = limma, ed = edger, eb = ebseq, de =
## deseq, : The basic table seems to be missing.
## Unable to find the table in the set of possible tables.
## The possible tables are: infsbz23_vs_infsbz22, infz22_vs_infsbz22, infz23_vs_infsbz22, uninfnone_vs_infsbz22, uninfsbnone_vs_infsbz22, infz22_vs_infsbz23, infz23_vs_infsbz23, uninfnone_vs_infsbz23, uninfsbnone_vs_infsbz23, infz23_vs_infz22, uninfnone_vs_infz22, uninfsbnone_vs_infz22, uninfnone_vs_infz23, uninfsbnone_vs_infz23, uninfsbnone_vs_uninfnone
hs_macrophage_sig <- extract_significant_genes(
    hs_macrophage_table,
    excel=glue::glue("excel/macrophage_human_sig-v{ver}.xlsx"))
## Deleting the file excel/macrophage_human_sig-v202209.xlsx before writing the tables.
## Unable to find the table in the set of possible tables.
## The possible tables are: infsbz23_vs_infsbz22, infz22_vs_infsbz22, infz23_vs_infsbz22, uninfnone_vs_infsbz22, uninfsbnone_vs_infsbz22, infz22_vs_infsbz23, infz23_vs_infsbz23, uninfnone_vs_infsbz23, uninfsbnone_vs_infsbz23, infz23_vs_infz22, uninfnone_vs_infz22, uninfsbnone_vs_infz22, uninfnone_vs_infz23, uninfsbnone_vs_infz23, uninfsbnone_vs_uninfnone
## Unable to find the table in the set of possible tables.
## The possible tables are: infsbz23_vs_infsbz22, infz22_vs_infsbz22, infz23_vs_infsbz22, uninfnone_vs_infsbz22, uninfsbnone_vs_infsbz22, infz22_vs_infsbz23, infz23_vs_infsbz23, uninfnone_vs_infsbz23, uninfsbnone_vs_infsbz23, infz23_vs_infz22, uninfnone_vs_infz22, uninfsbnone_vs_infz22, uninfnone_vs_infz23, uninfsbnone_vs_infz23, uninfsbnone_vs_uninfnone

1.1.2 Plot contrasts of interest

One suggestion I received recently was to set the axes for these volcano plots to be static rather than let ggplot choose its own. I am assuming this is only relevant for pairs of contrasts, but that might not be true.

1.1.2.1 Individual zymodemes vs. uninfected

z23nosb_vs_uninf_volcano <- plot_volcano_de(
    table = hs_macrophage_table[["data"]][["z23nosb_vs_uninf"]],
    fc_col = "deseq_logfc", p_col = "deseq_adjp",
    shapes_by_state = FALSE, color_by = "fc",  label = 10, label_column = "hgncsymbol")
## The color list must have 4, setting it to the default.
plotly::ggplotly(z23nosb_vs_uninf_volcano$plot)
## Warning: `gather_()` was deprecated in tidyr 1.2.0.
## Please use `gather()` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.
## Warning in geom2trace.default(dots[[1L]][[2L]], dots[[2L]][[1L]], dots[[3L]][[1L]]): geom_GeomTextRepel() has yet to be implemented in plotly.
##   If you'd like to see this geom implemented,
##   Please open an issue with your example code at
##   https://github.com/ropensci/plotly/issues

## Warning in geom2trace.default(dots[[1L]][[2L]], dots[[2L]][[1L]], dots[[3L]][[1L]]): geom_GeomTextRepel() has yet to be implemented in plotly.
##   If you'd like to see this geom implemented,
##   Please open an issue with your example code at
##   https://github.com/ropensci/plotly/issues
z22nosb_vs_uninf_volcano <- plot_volcano_de(
    table = hs_macrophage_table[["data"]][["z22nosb_vs_uninf"]],
    fc_col = "deseq_logfc", p_col = "deseq_adjp",
    shapes_by_state = FALSE, color_by = "fc",  label = 10, label_column = "hgncsymbol")
## The color list must have 4, setting it to the default.
plotly::ggplotly(z22nosb_vs_uninf_volcano$plot)
## Warning in geom2trace.default(dots[[1L]][[3L]], dots[[2L]][[1L]], dots[[3L]][[1L]]): geom_GeomTextRepel() has yet to be implemented in plotly.
##   If you'd like to see this geom implemented,
##   Please open an issue with your example code at
##   https://github.com/ropensci/plotly/issues
## Warning in geom2trace.default(dots[[1L]][[3L]], dots[[2L]][[1L]], dots[[3L]][[1L]]): geom_GeomTextRepel() has yet to be implemented in plotly.
##   If you'd like to see this geom implemented,
##   Please open an issue with your example code at
##   https://github.com/ropensci/plotly/issues

## Warning in geom2trace.default(dots[[1L]][[3L]], dots[[2L]][[1L]], dots[[3L]][[1L]]): geom_GeomTextRepel() has yet to be implemented in plotly.
##   If you'd like to see this geom implemented,
##   Please open an issue with your example code at
##   https://github.com/ropensci/plotly/issues
z23nosb_vs_uninf_volcano$plot +
  xlim(-10, 25) +
  ylim(0, 40)
## Warning: Removed 1 rows containing missing values (geom_point).
## Warning: Removed 1 rows containing missing values (geom_text_repel).

z22nosb_vs_uninf_volcano$plot +
  xlim(-10, 25) +
  ylim(0, 40)
## Warning: ggrepel: 16 unlabeled data points (too many overlaps). Consider
## increasing max.overlaps

Note to self: There is an error in my volcano plot code which takes effect when the numerator and denominator of the all_pairwise contrasts are different than those in combine_de_tables. It is putting the ups/downs on the correct sides of the plot, but calling the down genes ‘up’ and vice-versa. The reason for this is that I did a check for this happening, but used the wrong argument to handle it.

A likely bit of text for these volcano plots:

The set of genes differentially expressed between the zymodeme 2.3 and uninfected samples without druge treatment was quantified with DESeq2 and included surrogate estimates from SVA. Given the criteria of significance of a abs(logFC) >= 1.0 and false discovery rate adjusted p-value <= 0.05, 670 genes were observed as significantly increased between the infected and uninfected samples and 386 were observed as decreased. The most increased genes from the uninfected samples include some which are potentially indicative of a strong innate immune response and the inflammatory response.

In contrast, when the set of genes differentially expressed between the zymodeme 2.2 and uninfected samples was visualized, only 7 genes were observed as decreased and 435 increased. The inflammatory response was significantly less apparent in this set, but instead included genes related to transporter activity and oxidoreductases.

1.1.2.2 Direct zymodeme comparisons

An orthogonal comparison to that performed above is to directly compare the zymodeme 2.3 and 2.2 samples with and without antimonial treatment.

z23nosb_vs_z22nosb_volcano <- plot_volcano_de(
    table = hs_macrophage_table[["data"]][["z23nosb_vs_z22nosb"]],
    fc_col = "deseq_logfc", p_col = "deseq_adjp",
    shapes_by_state = FALSE, color_by = "fc",  label = 10, label_column = "hgncsymbol")
## The color list must have 4, setting it to the default.
plotly::ggplotly(z23nosb_vs_z22nosb_volcano$plot)
## Warning in geom2trace.default(dots[[1L]][[2L]], dots[[2L]][[1L]], dots[[3L]][[1L]]): geom_GeomTextRepel() has yet to be implemented in plotly.
##   If you'd like to see this geom implemented,
##   Please open an issue with your example code at
##   https://github.com/ropensci/plotly/issues

## Warning in geom2trace.default(dots[[1L]][[2L]], dots[[2L]][[1L]], dots[[3L]][[1L]]): geom_GeomTextRepel() has yet to be implemented in plotly.
##   If you'd like to see this geom implemented,
##   Please open an issue with your example code at
##   https://github.com/ropensci/plotly/issues
z23sb_vs_z22sb_volcano <- plot_volcano_de(
    table = hs_macrophage_table[["data"]][["z23sb_vs_z22sb"]],
    fc_col = "deseq_logfc", p_col = "deseq_adjp",
    shapes_by_state = FALSE, color_by = "fc",  label = 10, label_column = "hgncsymbol")
## The color list must have 4, setting it to the default.
plotly::ggplotly(z23sb_vs_z22sb_volcano$plot)
## Warning in geom2trace.default(dots[[1L]][[2L]], dots[[2L]][[1L]], dots[[3L]][[1L]]): geom_GeomTextRepel() has yet to be implemented in plotly.
##   If you'd like to see this geom implemented,
##   Please open an issue with your example code at
##   https://github.com/ropensci/plotly/issues

## Warning in geom2trace.default(dots[[1L]][[2L]], dots[[2L]][[1L]], dots[[3L]][[1L]]): geom_GeomTextRepel() has yet to be implemented in plotly.
##   If you'd like to see this geom implemented,
##   Please open an issue with your example code at
##   https://github.com/ropensci/plotly/issues
z23nosb_vs_z22nosb_volcano$plot +
  xlim(-10, 10) +
  ylim(0, 60)
## Warning: ggrepel: 4 unlabeled data points (too many overlaps). Consider
## increasing max.overlaps

z23sb_vs_z22sb_volcano$plot +
  xlim(-10, 10) +
  ylim(0, 60)
## Warning: ggrepel: 8 unlabeled data points (too many overlaps). Consider
## increasing max.overlaps

shared <- Vennerable::Venn(list("drug" = rownames(hs_macrophage_sig[["deseq"]][["ups"]][["z23sb_vs_z22sb"]]),
                                "nodrug" = rownames(hs_macrophage_sig[["deseq"]][["ups"]][["z23nosb_vs_z22nosb"]])))
pp(file="images/drug_nodrug_venn_up.png")
Vennerable::plot(shared)
dev.off()
## png 
##   2
Vennerable::plot(shared)

shared <- Vennerable::Venn(list("drug" = rownames(hs_macrophage_sig[["deseq"]][["downs"]][["z23sb_vs_z22sb"]]),
                                "nodrug" = rownames(hs_macrophage_sig[["deseq"]][["downs"]][["z23nosb_vs_z22nosb"]])))
pp(file="images/drug_nodrug_venn_down.png")
Vennerable::plot(shared)
dev.off()
## png 
##   2

A slightly different way of looking at the differences between the two zymodeme infections is to directly compare the infected samples with and without drug. Thus, when a volcano plot showing the comparison of the zymodeme 2.3 vs. 2.2 samples was plotted, 484 genes were observed as increased and 422 decreased; these groups include many of the same inflammatory (up) and membrane (down) genes.

Similar patterns were observed when the antimonial was included. Thus, when a Venn diagram of the two sets of increased genes was plotted, a significant number of the genes was observed as increased (313) and decreased (244) in both the untreated and antimonial treated samples.

1.1.2.3 Drug effects on each zymodeme infection

Another likely question is to directly compare the treated vs untreated samples for each zymodeme infection in order to visualize the effects of antimonial.

z23sb_vs_z23nosb_volcano <- plot_volcano_de(
    table = hs_macrophage_table[["data"]][["z23sb_vs_z23nosb"]],
    fc_col = "deseq_logfc", p_col = "deseq_adjp",
    shapes_by_state = FALSE, color_by = "fc",  label = 10, label_column = "hgncsymbol")
## The color list must have 4, setting it to the default.
plotly::ggplotly(z23sb_vs_z23nosb_volcano$plot)
## Warning in geom2trace.default(dots[[1L]][[2L]], dots[[2L]][[1L]], dots[[3L]][[1L]]): geom_GeomTextRepel() has yet to be implemented in plotly.
##   If you'd like to see this geom implemented,
##   Please open an issue with your example code at
##   https://github.com/ropensci/plotly/issues

## Warning in geom2trace.default(dots[[1L]][[2L]], dots[[2L]][[1L]], dots[[3L]][[1L]]): geom_GeomTextRepel() has yet to be implemented in plotly.
##   If you'd like to see this geom implemented,
##   Please open an issue with your example code at
##   https://github.com/ropensci/plotly/issues
z22sb_vs_z22nosb_volcano <- plot_volcano_de(
    table = hs_macrophage_table[["data"]][["z22sb_vs_z22nosb"]],
    fc_col = "deseq_logfc", p_col = "deseq_adjp",
    shapes_by_state = FALSE, color_by = "fc",  label = 10, label_column = "hgncsymbol")
## The color list must have 4, setting it to the default.
plotly::ggplotly(z22sb_vs_z22nosb_volcano$plot)
## Warning in geom2trace.default(dots[[1L]][[2L]], dots[[2L]][[1L]], dots[[3L]][[1L]]): geom_GeomTextRepel() has yet to be implemented in plotly.
##   If you'd like to see this geom implemented,
##   Please open an issue with your example code at
##   https://github.com/ropensci/plotly/issues

## Warning in geom2trace.default(dots[[1L]][[2L]], dots[[2L]][[1L]], dots[[3L]][[1L]]): geom_GeomTextRepel() has yet to be implemented in plotly.
##   If you'd like to see this geom implemented,
##   Please open an issue with your example code at
##   https://github.com/ropensci/plotly/issues
z23sb_vs_z23nosb_volcano$plot +
  xlim(-8, 8) +
  ylim(0, 210)

z22sb_vs_z22nosb_volcano$plot +
  xlim(-8, 8) +
  ylim(0, 210)
## Warning: ggrepel: 3 unlabeled data points (too many overlaps). Consider
## increasing max.overlaps

shared <- Vennerable::Venn(list("z23" = rownames(hs_macrophage_sig[["deseq"]][["ups"]][["z23sb_vs_z23nosb"]]),
                                "z22" = rownames(hs_macrophage_sig[["deseq"]][["ups"]][["z22sb_vs_z22nosb"]])))
pp(file="images/z23_z22_drug_venn_up.png")
Vennerable::plot(shared)
dev.off()
## png 
##   2
Vennerable::plot(shared)

shared <- Vennerable::Venn(list("z23" = rownames(hs_macrophage_sig[["deseq"]][["downs"]][["z23sb_vs_z23nosb"]]),
                                "z22" = rownames(hs_macrophage_sig[["deseq"]][["downs"]][["z22sb_vs_z22nosb"]])))
pp(file="images/z23_z22_drug_venn_down.png")
Vennerable::plot(shared)
dev.off()
## png 
##   2
Vennerable::plot(shared)

1.2 Parasite

lp_macrophage_de <- all_pairwise(lp_macrophage,
                                 model_batch="svaseq", filter=TRUE)
## This DE analysis will perform all pairwise comparisons among:
## 
## z2.2 z2.3 
##    5    6
## This analysis will include surrogate estimates from: svaseq.
## This will pre-filter the input data using normalize_expt's: TRUE argument.
## Removing 0 low-count genes (8522 remaining).
## Setting 45 low elements to zero.
## transform_counts: Found 45 values equal to 0, adding 1 to the matrix.
## Finished running DE analyses, collecting outputs.
## Comparing analyses.
tmrc2_parasite_keepers <- list(
    "z23nosb_vs_z22nosb" = c("z23", "z22"))
lp_macrophage_table <- combine_de_tables(
  lp_macrophage_de, keepers = tmrc2_parasite_keepers,
  excel=glue::glue("excel/macrophage_parasite_infection_de-v{ver}.xlsx"))
## Deleting the file excel/macrophage_parasite_infection_de-v202209.xlsx before writing the tables.
lp_macrophage_sig <- extract_significant_genes(
    lp_macrophage_table,
    excel=glue::glue("excel/macrophage_parasite_sig-v{ver}.xlsx"))
## Deleting the file excel/macrophage_parasite_sig-v202209.xlsx before writing the tables.
pp(file="images/lp_macrophage_z23_z22.png", image=lp_macrophage_table[["plots"]][["z23nosb_vs_z22nosb"]][["deseq_vol_plots"]][["plot"]])
## Warning in pp(file = "images/lp_macrophage_z23_z22.png", image =
## lp_macrophage_table[["plots"]][["z23nosb_vs_z22nosb"]][["deseq_vol_plots"]]
## [["plot"]]): There is no device to shut down.
up_genes <- lp_macrophage_sig[["deseq"]][["ups"]][[1]]
dim(up_genes)
## [1] 40 58
down_genes <- lp_macrophage_sig[["deseq"]][["downs"]][[1]]
dim(down_genes)
## [1] 75 58

2 Over representation searches

all_gp <- all_gprofiler(hs_macrophage_sig)
## Redirecting to simple_gprofiler2().
## If you wish to roll the bones with the previous function, try:
## simple_gprofiler_old().
## Performing gProfiler GO search of 670 against hsapiens.
## GO search found 691 hits.
## Performing gProfiler KEGG search of 670 against hsapiens.
## KEGG search found 11 hits.
## Performing gProfiler REAC search of 670 against hsapiens.
## REAC search found 12 hits.
## Performing gProfiler WP search of 670 against hsapiens.
## WP search found 12 hits.
## Performing gProfiler TF search of 670 against hsapiens.
## TF search found 111 hits.
## Performing gProfiler MIRNA search of 670 against hsapiens.
## MIRNA search found 1 hits.
## Performing gProfiler HPA search of 670 against hsapiens.
## HPA search found 0 hits.
## Performing gProfiler CORUM search of 670 against hsapiens.
## CORUM search found 0 hits.
## Performing gProfiler HP search of 670 against hsapiens.
## HP search found 0 hits.
## Redirecting to simple_gprofiler2().
## If you wish to roll the bones with the previous function, try:
## simple_gprofiler_old().
## Performing gProfiler GO search of 386 against hsapiens.
## GO search found 61 hits.
## Performing gProfiler KEGG search of 386 against hsapiens.
## KEGG search found 0 hits.
## Performing gProfiler REAC search of 386 against hsapiens.
## REAC search found 1 hits.
## Performing gProfiler WP search of 386 against hsapiens.
## WP search found 0 hits.
## Performing gProfiler TF search of 386 against hsapiens.
## TF search found 30 hits.
## Performing gProfiler MIRNA search of 386 against hsapiens.
## MIRNA search found 0 hits.
## Performing gProfiler HPA search of 386 against hsapiens.
## HPA search found 0 hits.
## Performing gProfiler CORUM search of 386 against hsapiens.
## CORUM search found 0 hits.
## Performing gProfiler HP search of 386 against hsapiens.
## HP search found 0 hits.
## Redirecting to simple_gprofiler2().
## If you wish to roll the bones with the previous function, try:
## simple_gprofiler_old().
## Performing gProfiler GO search of 435 against hsapiens.
## GO search found 189 hits.
## Performing gProfiler KEGG search of 435 against hsapiens.
## KEGG search found 0 hits.
## Performing gProfiler REAC search of 435 against hsapiens.
## REAC search found 4 hits.
## Performing gProfiler WP search of 435 against hsapiens.
## WP search found 2 hits.
## Performing gProfiler TF search of 435 against hsapiens.
## TF search found 62 hits.
## Performing gProfiler MIRNA search of 435 against hsapiens.
## MIRNA search found 0 hits.
## Performing gProfiler HPA search of 435 against hsapiens.
## HPA search found 0 hits.
## Performing gProfiler CORUM search of 435 against hsapiens.
## CORUM search found 0 hits.
## Performing gProfiler HP search of 435 against hsapiens.
## HP search found 0 hits.
## Redirecting to simple_gprofiler2().
## If you wish to roll the bones with the previous function, try:
## simple_gprofiler_old().
## Performing gProfiler GO search of 7 against hsapiens.
## GO search found 3 hits.
## Performing gProfiler KEGG search of 7 against hsapiens.
## KEGG search found 0 hits.
## Performing gProfiler REAC search of 7 against hsapiens.
## REAC search found 0 hits.
## Performing gProfiler WP search of 7 against hsapiens.
## WP search found 0 hits.
## Performing gProfiler TF search of 7 against hsapiens.
## TF search found 0 hits.
## Performing gProfiler MIRNA search of 7 against hsapiens.
## MIRNA search found 0 hits.
## Performing gProfiler HPA search of 7 against hsapiens.
## HPA search found 0 hits.
## Performing gProfiler CORUM search of 7 against hsapiens.
## CORUM search found 2 hits.
## Performing gProfiler HP search of 7 against hsapiens.
## HP search found 0 hits.
## Redirecting to simple_gprofiler2().
## If you wish to roll the bones with the previous function, try:
## simple_gprofiler_old().
## Performing gProfiler GO search of 529 against hsapiens.
## GO search found 557 hits.
## Performing gProfiler KEGG search of 529 against hsapiens.
## KEGG search found 8 hits.
## Performing gProfiler REAC search of 529 against hsapiens.
## REAC search found 13 hits.
## Performing gProfiler WP search of 529 against hsapiens.
## WP search found 12 hits.
## Performing gProfiler TF search of 529 against hsapiens.
## TF search found 109 hits.
## Performing gProfiler MIRNA search of 529 against hsapiens.
## MIRNA search found 1 hits.
## Performing gProfiler HPA search of 529 against hsapiens.
## HPA search found 0 hits.
## Performing gProfiler CORUM search of 529 against hsapiens.
## CORUM search found 0 hits.
## Performing gProfiler HP search of 529 against hsapiens.
## HP search found 0 hits.
## Redirecting to simple_gprofiler2().
## If you wish to roll the bones with the previous function, try:
## simple_gprofiler_old().
## Performing gProfiler GO search of 730 against hsapiens.
## GO search found 225 hits.
## Performing gProfiler KEGG search of 730 against hsapiens.
## KEGG search found 0 hits.
## Performing gProfiler REAC search of 730 against hsapiens.
## REAC search found 1 hits.
## Performing gProfiler WP search of 730 against hsapiens.
## WP search found 0 hits.
## Performing gProfiler TF search of 730 against hsapiens.
## TF search found 63 hits.
## Performing gProfiler MIRNA search of 730 against hsapiens.
## MIRNA search found 0 hits.
## Performing gProfiler HPA search of 730 against hsapiens.
## HPA search found 0 hits.
## Performing gProfiler CORUM search of 730 against hsapiens.
## CORUM search found 0 hits.
## Performing gProfiler HP search of 730 against hsapiens.
## HP search found 0 hits.
## Redirecting to simple_gprofiler2().
## If you wish to roll the bones with the previous function, try:
## simple_gprofiler_old().
## Performing gProfiler GO search of 484 against hsapiens.
## GO search found 624 hits.
## Performing gProfiler KEGG search of 484 against hsapiens.
## KEGG search found 11 hits.
## Performing gProfiler REAC search of 484 against hsapiens.
## REAC search found 13 hits.
## Performing gProfiler WP search of 484 against hsapiens.
## WP search found 17 hits.
## Performing gProfiler TF search of 484 against hsapiens.
## TF search found 104 hits.
## Performing gProfiler MIRNA search of 484 against hsapiens.
## MIRNA search found 1 hits.
## Performing gProfiler HPA search of 484 against hsapiens.
## HPA search found 0 hits.
## Performing gProfiler CORUM search of 484 against hsapiens.
## CORUM search found 2 hits.
## Performing gProfiler HP search of 484 against hsapiens.
## HP search found 0 hits.
## Redirecting to simple_gprofiler2().
## If you wish to roll the bones with the previous function, try:
## simple_gprofiler_old().
## Performing gProfiler GO search of 422 against hsapiens.
## GO search found 60 hits.
## Performing gProfiler KEGG search of 422 against hsapiens.
## KEGG search found 0 hits.
## Performing gProfiler REAC search of 422 against hsapiens.
## REAC search found 1 hits.
## Performing gProfiler WP search of 422 against hsapiens.
## WP search found 0 hits.
## Performing gProfiler TF search of 422 against hsapiens.
## TF search found 3 hits.
## Performing gProfiler MIRNA search of 422 against hsapiens.
## MIRNA search found 0 hits.
## Performing gProfiler HPA search of 422 against hsapiens.
## HPA search found 0 hits.
## Performing gProfiler CORUM search of 422 against hsapiens.
## CORUM search found 0 hits.
## Performing gProfiler HP search of 422 against hsapiens.
## HP search found 0 hits.
## Redirecting to simple_gprofiler2().
## If you wish to roll the bones with the previous function, try:
## simple_gprofiler_old().
## Performing gProfiler GO search of 555 against hsapiens.
## GO search found 141 hits.
## Performing gProfiler KEGG search of 555 against hsapiens.
## KEGG search found 4 hits.
## Performing gProfiler REAC search of 555 against hsapiens.
## REAC search found 85 hits.
## Performing gProfiler WP search of 555 against hsapiens.
## WP search found 4 hits.
## Performing gProfiler TF search of 555 against hsapiens.
## TF search found 25 hits.
## Performing gProfiler MIRNA search of 555 against hsapiens.
## MIRNA search found 0 hits.
## Performing gProfiler HPA search of 555 against hsapiens.
## HPA search found 2 hits.
## Performing gProfiler CORUM search of 555 against hsapiens.
## CORUM search found 0 hits.
## Performing gProfiler HP search of 555 against hsapiens.
## HP search found 0 hits.
## Redirecting to simple_gprofiler2().
## If you wish to roll the bones with the previous function, try:
## simple_gprofiler_old().
## Performing gProfiler GO search of 780 against hsapiens.
## GO search found 743 hits.
## Performing gProfiler KEGG search of 780 against hsapiens.
## KEGG search found 6 hits.
## Performing gProfiler REAC search of 780 against hsapiens.
## REAC search found 12 hits.
## Performing gProfiler WP search of 780 against hsapiens.
## WP search found 1 hits.
## Performing gProfiler TF search of 780 against hsapiens.
## TF search found 201 hits.
## Performing gProfiler MIRNA search of 780 against hsapiens.
## MIRNA search found 0 hits.
## Performing gProfiler HPA search of 780 against hsapiens.
## HPA search found 5 hits.
## Performing gProfiler CORUM search of 780 against hsapiens.
## CORUM search found 0 hits.
## Performing gProfiler HP search of 780 against hsapiens.
## HP search found 0 hits.
## Redirecting to simple_gprofiler2().
## If you wish to roll the bones with the previous function, try:
## simple_gprofiler_old().
## Performing gProfiler GO search of 454 against hsapiens.
## GO search found 118 hits.
## Performing gProfiler KEGG search of 454 against hsapiens.
## KEGG search found 5 hits.
## Performing gProfiler REAC search of 454 against hsapiens.
## REAC search found 88 hits.
## Performing gProfiler WP search of 454 against hsapiens.
## WP search found 8 hits.
## Performing gProfiler TF search of 454 against hsapiens.
## TF search found 30 hits.
## Performing gProfiler MIRNA search of 454 against hsapiens.
## MIRNA search found 1 hits.
## Performing gProfiler HPA search of 454 against hsapiens.
## HPA search found 15 hits.
## Performing gProfiler CORUM search of 454 against hsapiens.
## CORUM search found 0 hits.
## Performing gProfiler HP search of 454 against hsapiens.
## HP search found 0 hits.
## Redirecting to simple_gprofiler2().
## If you wish to roll the bones with the previous function, try:
## simple_gprofiler_old().
## Performing gProfiler GO search of 986 against hsapiens.
## GO search found 835 hits.
## Performing gProfiler KEGG search of 986 against hsapiens.
## KEGG search found 1 hits.
## Performing gProfiler REAC search of 986 against hsapiens.
## REAC search found 8 hits.
## Performing gProfiler WP search of 986 against hsapiens.
## WP search found 2 hits.
## Performing gProfiler TF search of 986 against hsapiens.
## TF search found 258 hits.
## Performing gProfiler MIRNA search of 986 against hsapiens.
## MIRNA search found 1 hits.
## Performing gProfiler HPA search of 986 against hsapiens.
## HPA search found 2 hits.
## Performing gProfiler CORUM search of 986 against hsapiens.
## CORUM search found 0 hits.
## Performing gProfiler HP search of 986 against hsapiens.
## HP search found 0 hits.
## Redirecting to simple_gprofiler2().
## If you wish to roll the bones with the previous function, try:
## simple_gprofiler_old().
## Performing gProfiler GO search of 1081 against hsapiens.
## GO search found 1038 hits.
## Performing gProfiler KEGG search of 1081 against hsapiens.
## KEGG search found 15 hits.
## Performing gProfiler REAC search of 1081 against hsapiens.
## REAC search found 17 hits.
## Performing gProfiler WP search of 1081 against hsapiens.
## WP search found 12 hits.
## Performing gProfiler TF search of 1081 against hsapiens.
## TF search found 166 hits.
## Performing gProfiler MIRNA search of 1081 against hsapiens.
## MIRNA search found 1 hits.
## Performing gProfiler HPA search of 1081 against hsapiens.
## HPA search found 0 hits.
## Performing gProfiler CORUM search of 1081 against hsapiens.
## CORUM search found 0 hits.
## Performing gProfiler HP search of 1081 against hsapiens.
## HP search found 0 hits.
## Redirecting to simple_gprofiler2().
## If you wish to roll the bones with the previous function, try:
## simple_gprofiler_old().
## Performing gProfiler GO search of 701 against hsapiens.
## GO search found 84 hits.
## Performing gProfiler KEGG search of 701 against hsapiens.
## KEGG search found 0 hits.
## Performing gProfiler REAC search of 701 against hsapiens.
## REAC search found 1 hits.
## Performing gProfiler WP search of 701 against hsapiens.
## WP search found 0 hits.
## Performing gProfiler TF search of 701 against hsapiens.
## TF search found 56 hits.
## Performing gProfiler MIRNA search of 701 against hsapiens.
## MIRNA search found 0 hits.
## Performing gProfiler HPA search of 701 against hsapiens.
## HPA search found 0 hits.
## Performing gProfiler CORUM search of 701 against hsapiens.
## CORUM search found 0 hits.
## Performing gProfiler HP search of 701 against hsapiens.
## HP search found 0 hits.
## Redirecting to simple_gprofiler2().
## If you wish to roll the bones with the previous function, try:
## simple_gprofiler_old().
## Performing gProfiler GO search of 1025 against hsapiens.
## GO search found 659 hits.
## Performing gProfiler KEGG search of 1025 against hsapiens.
## KEGG search found 0 hits.
## Performing gProfiler REAC search of 1025 against hsapiens.
## REAC search found 4 hits.
## Performing gProfiler WP search of 1025 against hsapiens.
## WP search found 0 hits.
## Performing gProfiler TF search of 1025 against hsapiens.
## TF search found 188 hits.
## Performing gProfiler MIRNA search of 1025 against hsapiens.
## MIRNA search found 1 hits.
## Performing gProfiler HPA search of 1025 against hsapiens.
## HPA search found 0 hits.
## Performing gProfiler CORUM search of 1025 against hsapiens.
## CORUM search found 0 hits.
## Performing gProfiler HP search of 1025 against hsapiens.
## HP search found 0 hits.
## Redirecting to simple_gprofiler2().
## If you wish to roll the bones with the previous function, try:
## simple_gprofiler_old().
## Performing gProfiler GO search of 427 against hsapiens.
## GO search found 65 hits.
## Performing gProfiler KEGG search of 427 against hsapiens.
## KEGG search found 0 hits.
## Performing gProfiler REAC search of 427 against hsapiens.
## REAC search found 56 hits.
## Performing gProfiler WP search of 427 against hsapiens.
## WP search found 2 hits.
## Performing gProfiler TF search of 427 against hsapiens.
## TF search found 31 hits.
## Performing gProfiler MIRNA search of 427 against hsapiens.
## MIRNA search found 0 hits.
## Performing gProfiler HPA search of 427 against hsapiens.
## HPA search found 0 hits.
## Performing gProfiler CORUM search of 427 against hsapiens.
## CORUM search found 0 hits.
## Performing gProfiler HP search of 427 against hsapiens.
## HP search found 0 hits.
## Redirecting to simple_gprofiler2().
## If you wish to roll the bones with the previous function, try:
## simple_gprofiler_old().
## Performing gProfiler GO search of 910 against hsapiens.
## GO search found 351 hits.
## Performing gProfiler KEGG search of 910 against hsapiens.
## KEGG search found 4 hits.
## Performing gProfiler REAC search of 910 against hsapiens.
## REAC search found 87 hits.
## Performing gProfiler WP search of 910 against hsapiens.
## WP search found 7 hits.
## Performing gProfiler TF search of 910 against hsapiens.
## TF search found 86 hits.
## Performing gProfiler MIRNA search of 910 against hsapiens.
## MIRNA search found 1 hits.
## Performing gProfiler HPA search of 910 against hsapiens.
## HPA search found 1 hits.
## Performing gProfiler CORUM search of 910 against hsapiens.
## CORUM search found 0 hits.
## Performing gProfiler HP search of 910 against hsapiens.
## HP search found 0 hits.
## Redirecting to simple_gprofiler2().
## If you wish to roll the bones with the previous function, try:
## simple_gprofiler_old().
## Performing gProfiler GO search of 983 against hsapiens.
## GO search found 392 hits.
## Performing gProfiler KEGG search of 983 against hsapiens.
## KEGG search found 0 hits.
## Performing gProfiler REAC search of 983 against hsapiens.
## REAC search found 0 hits.
## Performing gProfiler WP search of 983 against hsapiens.
## WP search found 1 hits.
## Performing gProfiler TF search of 983 against hsapiens.
## TF search found 217 hits.
## Performing gProfiler MIRNA search of 983 against hsapiens.
## MIRNA search found 1 hits.
## Performing gProfiler HPA search of 983 against hsapiens.
## HPA search found 7 hits.
## Performing gProfiler CORUM search of 983 against hsapiens.
## CORUM search found 0 hits.
## Performing gProfiler HP search of 983 against hsapiens.
## HP search found 5 hits.
## Redirecting to simple_gprofiler2().
## If you wish to roll the bones with the previous function, try:
## simple_gprofiler_old().
## Performing gProfiler GO search of 572 against hsapiens.
## GO search found 160 hits.
## Performing gProfiler KEGG search of 572 against hsapiens.
## KEGG search found 4 hits.
## Performing gProfiler REAC search of 572 against hsapiens.
## REAC search found 83 hits.
## Performing gProfiler WP search of 572 against hsapiens.
## WP search found 7 hits.
## Performing gProfiler TF search of 572 against hsapiens.
## TF search found 21 hits.
## Performing gProfiler MIRNA search of 572 against hsapiens.
## MIRNA search found 0 hits.
## Performing gProfiler HPA search of 572 against hsapiens.
## HPA search found 1 hits.
## Performing gProfiler CORUM search of 572 against hsapiens.
## CORUM search found 0 hits.
## Performing gProfiler HP search of 572 against hsapiens.
## HP search found 0 hits.
## Redirecting to simple_gprofiler2().
## If you wish to roll the bones with the previous function, try:
## simple_gprofiler_old().
## Performing gProfiler GO search of 644 against hsapiens.
## GO search found 586 hits.
## Performing gProfiler KEGG search of 644 against hsapiens.
## KEGG search found 8 hits.
## Performing gProfiler REAC search of 644 against hsapiens.
## REAC search found 5 hits.
## Performing gProfiler WP search of 644 against hsapiens.
## WP search found 0 hits.
## Performing gProfiler TF search of 644 against hsapiens.
## TF search found 152 hits.
## Performing gProfiler MIRNA search of 644 against hsapiens.
## MIRNA search found 1 hits.
## Performing gProfiler HPA search of 644 against hsapiens.
## HPA search found 11 hits.
## Performing gProfiler CORUM search of 644 against hsapiens.
## CORUM search found 0 hits.
## Performing gProfiler HP search of 644 against hsapiens.
## HP search found 0 hits.
## Redirecting to simple_gprofiler2().
## If you wish to roll the bones with the previous function, try:
## simple_gprofiler_old().
## Performing gProfiler GO search of 362 against hsapiens.
## GO search found 177 hits.
## Performing gProfiler KEGG search of 362 against hsapiens.
## KEGG search found 4 hits.
## Performing gProfiler REAC search of 362 against hsapiens.
## REAC search found 84 hits.
## Performing gProfiler WP search of 362 against hsapiens.
## WP search found 9 hits.
## Performing gProfiler TF search of 362 against hsapiens.
## TF search found 24 hits.
## Performing gProfiler MIRNA search of 362 against hsapiens.
## MIRNA search found 0 hits.
## Performing gProfiler HPA search of 362 against hsapiens.
## HPA search found 1 hits.
## Performing gProfiler CORUM search of 362 against hsapiens.
## CORUM search found 0 hits.
## Performing gProfiler HP search of 362 against hsapiens.
## HP search found 0 hits.
## Redirecting to simple_gprofiler2().
## If you wish to roll the bones with the previous function, try:
## simple_gprofiler_old().
## Performing gProfiler GO search of 503 against hsapiens.
## GO search found 449 hits.
## Performing gProfiler KEGG search of 503 against hsapiens.
## KEGG search found 4 hits.
## Performing gProfiler REAC search of 503 against hsapiens.
## REAC search found 3 hits.
## Performing gProfiler WP search of 503 against hsapiens.
## WP search found 1 hits.
## Performing gProfiler TF search of 503 against hsapiens.
## TF search found 30 hits.
## Performing gProfiler MIRNA search of 503 against hsapiens.
## MIRNA search found 3 hits.
## Performing gProfiler HPA search of 503 against hsapiens.
## HPA search found 6 hits.
## Performing gProfiler CORUM search of 503 against hsapiens.
## CORUM search found 0 hits.
## Performing gProfiler HP search of 503 against hsapiens.
## HP search found 0 hits.
pp(file="images/z23_uninf_reactome_up.png", image=all_gp[["z23nosb_vs_uninf_up"]][["pvalue_plots"]][["reactome_plot_over"]], height=12, width=9)
all_gp[["z23nosb_vs_uninf_up"]][["pvalue_plots"]][["kegg_plot_over"]]
## NULL
all_gp[["z23nosb_vs_uninf_up"]][["pvalue_plots"]][["mfp_plot_over"]]
## NULL
all_gp[["z23nosb_vs_uninf_up"]][["pvalue_plots"]][["tf_plot_over"]]
## NULL
pp(file="images/z22_uninf_reactome_up.png", image=all_gp[["z22nosb_vs_uninf_up"]][["pvalue_plots"]][["REAC"]], height=12, width=9)
## Warning in pp(file = "images/z22_uninf_reactome_up.png", image =
## all_gp[["z22nosb_vs_uninf_up"]][["pvalue_plots"]][["REAC"]], : There is no
## device to shut down.
all_gp[["z22nosb_vs_uninf_up"]][["pvalue_plots"]][["MF"]]
all_gp[["z22nosb_vs_uninf_up"]][["pvalue_plots"]][["TF"]]
all_gp[["z22nosb_vs_uninf_down"]][["pvalue_plots"]][["MF"]]

all_gp[["z23sb_vs_z22sb_up"]][["pvalue_plots"]][["reactome_plot_over"]]
## NULL
all_gp[["z23sb_vs_z22sb_up"]][["pvalue_plots"]][["kegg_plot_over"]]
## NULL
all_gp[["z23sb_vs_z22sb_up"]][["pvalue_plots"]][["mfp_plot_over"]]
## NULL
all_gp[["z23sb_vs_z22sb_up"]][["pvalue_plots"]][["tf_plot_over"]]
## NULL
all_gp[["z23nosb_vs_z22nosb_up"]][["pvalue_plots"]][["REAC"]]
all_gp[["z23nosb_vs_z22nosb_down"]][["pvalue_plots"]][["REAC"]]
all_gp[["z23sb_vs_z22sb_up"]][["pvalue_plots"]][["REAC"]]
all_gp[["z23sb_vs_z22sb_down"]][["pvalue_plots"]][["REAC"]]

all_gp[["z23sb_vs_z23nosb_up"]][["pvalue_plots"]][["reactome_plot_over"]]
## NULL
all_gp[["z23sb_vs_z23nosb_up"]][["pvalue_plots"]][["kegg_plot_over"]]
## NULL
all_gp[["z23sb_vs_z23nosb_up"]][["pvalue_plots"]][["mfp_plot_over"]]
## NULL
all_gp[["z23sb_vs_z23nosb_up"]][["pvalue_plots"]][["tf_plot_over"]]
## NULL
all_gp[["z22sb_vs_z22nosb_up"]][["pvalue_plots"]][["reactome_plot_over"]]
## NULL
all_gp[["z22sb_vs_z22nosb_up"]][["pvalue_plots"]][["kegg_plot_over"]]
## NULL
all_gp[["z22sb_vs_z22nosb_up"]][["pvalue_plots"]][["mfp_plot_over"]]
## NULL
all_gp[["z22sb_vs_z22nosb_up"]][["pvalue_plots"]][["tf_plot_over"]]
## NULL
up_goseq <- simple_goseq(up_genes, go_db=lp_go, length_db=lp_lengths)
## Found 11 go_db genes and 40 length_db genes out of 40.
## Testing that go categories are defined.
## Removing undefined categories.
## Gathering synonyms.
## Gathering category definitions.
## The score column is null, defaulting to score.
## Possible columns are:
## [1] "category"                 "over_represented_pvalue" 
## [3] "under_represented_pvalue" "numDEInCat"              
## [5] "numInCat"                 "term"                    
## [7] "ontology"                 "qvalue"
## The score column is null, defaulting to score.
## Possible columns are:
## [1] "category"                 "over_represented_pvalue" 
## [3] "under_represented_pvalue" "numDEInCat"              
## [5] "numInCat"                 "term"                    
## [7] "ontology"                 "qvalue"
## The score column is null, defaulting to score.
## Possible columns are:
## [1] "category"                 "over_represented_pvalue" 
## [3] "under_represented_pvalue" "numDEInCat"              
## [5] "numInCat"                 "term"                    
## [7] "ontology"                 "qvalue"
## View categories over represented in the 2.3 samples
up_goseq$pvalue_plots$bpp_plot_over

down_goseq <- simple_goseq(down_genes, go_db=lp_go, length_db=lp_lengths)
## Found 21 go_db genes and 75 length_db genes out of 75.
## Testing that go categories are defined.
## Removing undefined categories.
## Gathering synonyms.
## Gathering category definitions.
## The score column is null, defaulting to score.
## Possible columns are:
## [1] "category"                 "over_represented_pvalue" 
## [3] "under_represented_pvalue" "numDEInCat"              
## [5] "numInCat"                 "term"                    
## [7] "ontology"                 "qvalue"
## The score column is null, defaulting to score.
## Possible columns are:
## [1] "category"                 "over_represented_pvalue" 
## [3] "under_represented_pvalue" "numDEInCat"              
## [5] "numInCat"                 "term"                    
## [7] "ontology"                 "qvalue"
## The score column is null, defaulting to score.
## Possible columns are:
## [1] "category"                 "over_represented_pvalue" 
## [3] "under_represented_pvalue" "numDEInCat"              
## [5] "numInCat"                 "term"                    
## [7] "ontology"                 "qvalue"
## View categories over represented in the 2.2 samples
down_goseq$pvalue_plots$bpp_plot_over

3 GSVA

hs_infected <- subset_expt(hs_macrophage, subset="macrophagetreatment!='uninf'") %>%
  subset_expt(subset="macrophagetreatment!='uninf_sb'")
## subset_expt(): There were 28, now there are 26 samples.
## subset_expt(): There were 26, now there are 24 samples.
hs_gsva_c2 <- simple_gsva(hs_infected)
## Converting the rownames() of the expressionset to ENTREZID.
## 1622 ENSEMBL ID's didn't have a matching ENTEREZ ID. Dropping them now.
## Before conversion, the expressionset has 21481 entries.
## After conversion, the expressionset has 20013 entries.
hs_gsva_c7 <- simple_gsva(hs_infected, signature_category = "c7")
## Converting the rownames() of the expressionset to ENTREZID.
## 1622 ENSEMBL ID's didn't have a matching ENTEREZ ID. Dropping them now.
## Before conversion, the expressionset has 21481 entries.
## After conversion, the expressionset has 20013 entries.
hs_gsva_c2_sig <- get_sig_gsva_categories(hs_gsva_c2, excel = "excel/hs_macrophage_gsva_c2_sig.xlsx")
## Starting limma pairwise comparison.
## libsize was not specified, this parameter has profound effects on limma's result.
## Using the libsize from expt$libsize.
## Limma step 1/6: choosing model.
## Choosing the non-intercept containing model.
## Assuming this data is similar to a micro array and not performign voom.
## Limma step 3/6: running lmFit with method: ls.
## Limma step 4/6: making and fitting contrasts with no intercept. (~ 0 + factors)
## Limma step 5/6: Running eBayes with robust = FALSE and trend = FALSE.
## Limma step 6/6: Writing limma outputs.
## Limma step 6/6: 1/6: Creating table: infsbz23_vs_infsbz22.  Adjust = BH
## Limma step 6/6: 2/6: Creating table: infz22_vs_infsbz22.  Adjust = BH
## Limma step 6/6: 3/6: Creating table: infz23_vs_infsbz22.  Adjust = BH
## Limma step 6/6: 4/6: Creating table: infz22_vs_infsbz23.  Adjust = BH
## Limma step 6/6: 5/6: Creating table: infz23_vs_infsbz23.  Adjust = BH
## Limma step 6/6: 6/6: Creating table: infz23_vs_infz22.  Adjust = BH
## Limma step 6/6: 1/4: Creating table: infsbz22.  Adjust = BH
## Limma step 6/6: 2/4: Creating table: infsbz23.  Adjust = BH
## Limma step 6/6: 3/4: Creating table: infz22.  Adjust = BH
## Limma step 6/6: 4/4: Creating table: infz23.  Adjust = BH
## The factor inf_sb_z2.2 has 6 rows.
## The factor inf_sb_z2.3 has 6 rows.
## The factor inf_z2.2 has 6 rows.
## The factor inf_z2.3 has 6 rows.
## Testing each factor against the others.
## Scoring inf_sb_z2.2 against everything else.
## Scoring inf_sb_z2.3 against everything else.
## Scoring inf_z2.2 against everything else.
## Scoring inf_z2.3 against everything else.
## Deleting the file excel/hs_macrophage_gsva_c2_sig.xlsx before writing the tables.
hs_gsva_c2_sig$raw_plot

hs_gsva_c7_sig <- get_sig_gsva_categories(hs_gsva_c7, excel = "excel/hs_macrophage_gsva_c7_sig.xlsx")
## Starting limma pairwise comparison.
## libsize was not specified, this parameter has profound effects on limma's result.
## Using the libsize from expt$libsize.
## Limma step 1/6: choosing model.
## Choosing the non-intercept containing model.
## Assuming this data is similar to a micro array and not performign voom.
## Limma step 3/6: running lmFit with method: ls.
## Limma step 4/6: making and fitting contrasts with no intercept. (~ 0 + factors)
## Limma step 5/6: Running eBayes with robust = FALSE and trend = FALSE.
## Limma step 6/6: Writing limma outputs.
## Limma step 6/6: 1/6: Creating table: infsbz23_vs_infsbz22.  Adjust = BH
## Limma step 6/6: 2/6: Creating table: infz22_vs_infsbz22.  Adjust = BH
## Limma step 6/6: 3/6: Creating table: infz23_vs_infsbz22.  Adjust = BH
## Limma step 6/6: 4/6: Creating table: infz22_vs_infsbz23.  Adjust = BH
## Limma step 6/6: 5/6: Creating table: infz23_vs_infsbz23.  Adjust = BH
## Limma step 6/6: 6/6: Creating table: infz23_vs_infz22.  Adjust = BH
## Limma step 6/6: 1/4: Creating table: infsbz22.  Adjust = BH
## Limma step 6/6: 2/4: Creating table: infsbz23.  Adjust = BH
## Limma step 6/6: 3/4: Creating table: infz22.  Adjust = BH
## Limma step 6/6: 4/4: Creating table: infz23.  Adjust = BH
## The factor inf_sb_z2.2 has 6 rows.
## The factor inf_sb_z2.3 has 6 rows.
## The factor inf_z2.2 has 6 rows.
## The factor inf_z2.3 has 6 rows.
## Testing each factor against the others.
## Scoring inf_sb_z2.2 against everything else.
## Scoring inf_sb_z2.3 against everything else.
## Scoring inf_z2.2 against everything else.
## Scoring inf_z2.3 against everything else.
## Deleting the file excel/hs_macrophage_gsva_c7_sig.xlsx before writing the tables.
hs_gsva_c7_sig$raw_plot

4 Try out a new tool

Two reasons: Najib loves him some PCA, this uses wikipathways, which is something I think is neat.

Ok, I spent some time looking through the code and I have some problems with some of the design decisions.

Most importantly, it requires a data.frame() which has the following format:

  1. No rownames, instead column #1 is the sample ID.
  2. Columns 2-m are the categorical/survival/etc metrics.
  3. Columns m-n are 1 gene-per-column with log2 values.

But when I think about it I think I get the idea, they want to be able to do modelling stuff more easily with response factors.

library(pathwayPCA)
library(rWikiPathways)

downloaded <- downloadPathwayArchive(organism = "Homo sapiens", format = "gmt")
data_path <- system.file("extdata", package="pathwayPCA")
wikipathways <- read_gmt(paste0(data_path, "/wikipathways_human_symbol.gmt"), description=TRUE)

expt <- subset_expt(hs_macrophage, subset="macrophagetreatment!='uninf'") %>%
  subset_expt(subset="macrophagetreatment!='uninf_sb'")
expt <- set_expt_conditions(expt, fact="macrophagezymodeme")

symbol_vector <- fData(expt)[[symbol_column]]
names(symbol_vector) <- rownames(fData(expt))
symbol_df <- as.data.frame(symbol_vector)

assay_df <- merge(symbol_df, as.data.frame(exprs(expt)), by = "row.names")
assay_df[["Row.names"]] <- NULL
rownames(assay_df) <- make.names(assay_df[["symbol_vector"]], unique = TRUE)
assay_df[["symbol_vector"]] <- NULL
assay_df <- as.data.frame(t(assay_df))
assay_df[["SampleID"]] <- rownames(assay_df)
assay_df <- dplyr::select(assay_df, "SampleID", everything())

factor_df <- as.data.frame(pData(expt))
factor_df[["SampleID"]] <- rownames(factor_df)
factor_df <- dplyr::select(factor_df, "SampleID", everything())
factor_df <- factor_df[, c("SampleID", factors)]

tt <- CreateOmics(
    assayData_df = assay_df,
    pathwayCollection_ls = wikipathways,
    response = factor_df,
    respType = "categorical",
    minPathSize=5)

super <- AESPCA_pVals(
    object = tt,
    numPCs = 2,
    parallel = FALSE,
    numCores = 8,
    numReps = 2,
    adjustment = "BH")
if (!isTRUE(get0("skip_load"))) {
  pander::pander(sessionInfo())
  message(paste0("This is hpgltools commit: ", get_git_commit()))
  message(paste0("Saving to ", savefile))
  tmp <- sm(saveme(filename = savefile))
}
## If you wish to reproduce this exact build of hpgltools, invoke the following:
## > git clone http://github.com/abelew/hpgltools.git
## > git reset ac8dd60d02c958ad58bae9b99aceddf9788d4ff1
## This is hpgltools commit: Mon Sep 26 15:57:54 2022 -0400: ac8dd60d02c958ad58bae9b99aceddf9788d4ff1
## Saving to tmrc2_macrophage_visualization_202209.rda.xz
tmp <- loadme(filename = savefile)
LS0tCnRpdGxlOiAiTC4gcGFuYW1lbnNpcyAyMDIyMDk6IFRNUkMyIE1hY3JvcGhhZ2UgRGlmZmVyZW50aWFsIEV4cHJlc3Npb24uIgphdXRob3I6ICJhdGIgYWJlbGV3QGdtYWlsLmNvbSIKZGF0ZTogImByIFN5cy5EYXRlKClgIgpvdXRwdXQ6CiBodG1sX2RvY3VtZW50OgogIGNvZGVfZG93bmxvYWQ6IHRydWUKICBjb2RlX2ZvbGRpbmc6IHNob3cKICBmaWdfY2FwdGlvbjogdHJ1ZQogIGZpZ19oZWlnaHQ6IDcKICBmaWdfd2lkdGg6IDcKICBoaWdobGlnaHQ6IGRlZmF1bHQKICBrZWVwX21kOiBmYWxzZQogIG1vZGU6IHNlbGZjb250YWluZWQKICBudW1iZXJfc2VjdGlvbnM6IHRydWUKICBzZWxmX2NvbnRhaW5lZDogdHJ1ZQogIHRoZW1lOiByZWFkYWJsZQogIHRvYzogdHJ1ZQogIHRvY19mbG9hdDoKICAgY29sbGFwc2VkOiBmYWxzZQogICBzbW9vdGhfc2Nyb2xsOiBmYWxzZQotLS0KCjxzdHlsZT4KICBib2R5IC5tYWluLWNvbnRhaW5lciB7CiAgICBtYXgtd2lkdGg6IDE2MDBweDsKICB9Cjwvc3R5bGU+CgpgYGB7ciBvcHRpb25zLCBpbmNsdWRlID0gRkFMU0V9CmxpYnJhcnkoZ2dwbG90MikKbGlicmFyeShIZWF0cGx1cykKbGlicmFyeShocGdsdG9vbHMpCnR0IDwtIGRldnRvb2xzOjpsb2FkX2FsbCgifi9ocGdsdG9vbHMiKQprbml0cjo6b3B0c19rbml0JHNldChwcm9ncmVzcyA9IFRSVUUsCiAg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