1 Set some parameters which will be used later

## Adjusted p-value cutoff when working on the inclusion sets.
adjp_cutoff <- 0.1
default_fstring <- "~ 0 + condition"
## Allow 10 GO categories to be displayed when plotting.
go_categories <- 14
## Allow groups higher up in the tree for clusterProfiler results.
go_level <- 2
label_column <- "mgi_symbol" ## Set the column used to extract gene symbols rather than ENSG.....
## LogFC cutoff when working on the inclusion sets.
lfc_cutoff <- 0.1
## Increase the maximum allowed group size when working with clusterProfiler
## This should bring out some of the more general groups like 'cellbody'
max_groupsize <- 2000
## Speed up clusterProfiler by choosing the correct keytypes
orgdb_from <- "ENSEMBLTRANS"
## MA plot point outlines
outline <- FALSE
sample_sheet <- "sample_sheets/20240606_only_umd_sequenced_modified.xlsx"

2 Introduction

This document is a copy of the iprgc_analyses_202408.Rmd document, with a few important differences:

  1. I will not be spending time to compare the various (de)duplication methods/results.
  2. This will create, visualize, and analyze transcript-level abundances rather than genes.
  3. I have not yet decided, but I might play with the wt filtering to try to make it clearer.
  4. I will likely remove some comments and text describing what is going on.
  5. All output directories get a suffix ’_tx’

With that in mind, the goal is to repeat our gene-level analyses, but using the transcript quantifications derived from featureCounts. This is in response to a review who suggested that some genes have potentially interesting and variable transcripts. That is a simple enough query to address, so let us see what we get!

3 A note about implementation

I would like to improve this document by comparing/contrasting the methodologies performed by other groups and those performed by me in it. I never fully appreciated the suite of computational methods applied by previous groups when examining TRAP data; I instead simply followed Theresa’s notebook without considering other possibilities.

I therefore spent a little time stepping through her thesis and pulling out the relevant papers in the hopes of learning these various methods. I should therefore be able soon to compare/contrast the various methods employed by other labs in addition to copying Theresa’s logic.

3.1 The following block cannot work in the container

The following block assumes the full tree of preprocessed data with the logs from the trimmer, mapping, umi deduplication, counting, etc. As a result it cannot work in the container which has only the various count tables.

As a result, I am including a copy of this sheet after running the following block in my working tree. I suppose for the moment you will have to trust that it worked. (for right now, when testing out this container, I am just sending the R working directory to my tree for this block, then moving it back.

I will need to manually edit one column though, the symlink column from Theresa has a series of paths which do not work in the container.

umi_spec <- make_rnaseq_spec(umi = TRUE)
iprgc_2022_meta <- gather_preprocessing_metadata("sample_sheets/20240606_only_umd_sequenced.xlsx",
                                                 spec = umi_spec, species = "mm39_112", verbose = TRUE,
                                                 basedir = "preprocessing/umd_sequenced")
colnames(iprgc_2022_meta[["new_meta"]])
head(iprgc_2022_meta[["new_meta"]])
msigdb <- "reference/msigdb_v2024.1.Mm.db"
msig_data <- NULL
make_transparent <- function() {
  ggplot2::theme(
    panel.background = element_rect(fill = 'transparent'),
    plot.background = element_rect(fill = 'transparent', color = NA),
    panel.grid.major = element_blank(),
    panel.grid.minor = element_blank(),
    legend.background = element_rect(fill = 'transparent'),
    legend.box.background = element_rect(fill = 'transparent'))
}

4 Collect the count tables

I used salmon/featurecounts/etc with CDS/mRNA features on our compute cluster and used the above gather function to add a column to the metadata containing the filenames produced. The following reads that column and creates a tarball of the files. One thing I need to do: modify that to accept a vetor of columns so I can easily collect r1+r2 and stuff like that.

As the name suggests, these are mRNA counts following the deduplication marking and removal from the initial hisat alignments via umitools.

## all the input files are already xz compressed
mrna_counts <- tar_meta_column(sample_sheet, column = "umi_dedup_mrna_count", compress = NULL)

I will figure out if I can leave mSigDB M2 in this image; if not, then any analyses depending on those gene sets will fail.

m2_gsc <- try(load_gmt_signatures(signatures = msigdb,
                                  signature_category = "M2"), silent = TRUE)
## I do not think I have permission to load the msigdb in the container
## So, if this fails, just load it from GSVAData, oh wait no, GSVAdata is human.
if ("try-error" %in% class(m2_gsc)) {
  warning("Unable to load the M2 MsigDB data.")
}

5 Annotation data

I am pulling this from Theresa’s anxontrapR_pipeline.Rmd, primarily because it looks similar to the other documents, but was modified more recently. I will change it slightly, primarily because I grabbed a new mmusculus assembly and therefore I will pull the mmusculus annotations from a specific biomart (Smedley et al. (2009)) archive that should match it.

A note from the future: multiple ensembl archive servers have been taken offline since last I ran this. Let us see if Feb. 2023 still works.

5.1 An important note!

In the recent past, ensembl queries have become inconsistent, failing much more often than ever in the past. I do not think this is the fault of ensembl; but I think I need a fallback mechanism for collecting annotation information.

In the case of ensembl, it should be trivial (but less fun) to use a combination of the locally installed orgdb and txdb databases.

This does open a risk that the set of genes with annotations will be different depending on when the container is run due to differences between the orgdb/txdb instance and the Feb 2023 biomart. I am not sure there is much I can do about that except to bundle the set of annotations I downloaded in the container – since load_biomart_annotations() does save a rda copy of its download.

ok, I did both. If you, dear reader, wish to download your own annotations, and ensembl is having troubles, the following should work without a problem; in addition the rda annotations are in /data of the container and should get loaded.

tx_gene_map <- data.frame()
##mm_annot <- try(load_biomart_annotations(species = "mmusculus", year = "2023", month = "02", overwrite = TRUE))
mm_annot <- try(load_biomart_annotations(species = "mmusculus", archive = FALSE,
                                         symbol_columns = label_column))
## The biomart annotations file already exists, loading from it.
mm_tx_annot <- mm_annot[["annotation"]]
## yeah, the ID tag in my gff file has transcript: as a prefix, so the featureCounts outputs
## includes it...  I will fix that inpost.
rownames(mm_tx_annot) <- paste0("transcript:", mm_tx_annot[["ensembl_transcript_id"]])

#mm_orgdb <- load_orgdb_annotations(
#  orgdb = "Mus.musculus", keytype = "ACCNUM",
#  fields = c("TXNAME", "TXTYPE", "TXCHROM", "TXSTART", "TXEND", "TXID", "TXSTRAND", "MGID"))

6 Hisat2 summarizedExperiments by transcript

6.1 Color choices and reused parameters

color_choices <- list(
  "all" = list(
    "p08_het_dlgn" = "#E7298A",
    "p15_het_dlgn" = "#E7298A",
    "p08_het_retina" = "#238B45",
    "p15_het_retina" = "#238B45",
    "p08_het_scn" = "#4292C6",
    "p15_het_scn" = "#4292C6",
    "p08_ko_dlgn" = "#C994C7",
    "p15_ko_dlgn" = "#C994C7",
    "p08_ko_retina" = "#74c476",
    "p15_ko_retina" = "#74c476",
    "p08_ko_scn" = "#9BCAE1",
    "p15_ko_scn" = "#9BCAE1",
    "p08_wt_dlgn" = "#980043",
    "p15_wt_dlgn" = "#980043",
    "p08_wt_retina" = "#004008",
    "p15_wt_retina" = "#004008",
    "p08_wt_scn" = "#08519C",
    "p15_wt_scn" = "#08519C",
    "p60_wt_dlgn" = "#333333",
    "p60_wt_retina" = "#222222",
    "p60_wt_scn" = "#111111"),
  "geno_loc" = list(
    "het_dlgn" = "#E7298A",
    "het_retina" = "#238B45",
    "het_scn" = "#4292C6",
    "ko_dlgn" = "#C994C7",
    "ko_retina" = "#74c476",
    "ko_scn" = "#9BCAE1",
    "wt_dlgn" = "#980043",
    "wt_retina" = "#004008",
    "wt_scn" = "#08519C"),
  "location" = list(
    "retina" = "#004008",
    "dlgn" = "#980043",
    "scn" = "#08519C"),
  "genotype" = list(
    "wt" = "#74c476",
    "het" = "#238B45",
    "ko" = "#006D2C"),
  "time" = list(
    "p08" = "#5E104B",
    "p15" = "#4E9231"))
colors <- color_choices[["geno_loc"]]
time_colors <- list(
  "p08_het_dlgn" = "#E7298A",
  "p15_het_dlgn" = "#8a1852",
  "p08_het_retina" = "#238B45",
  "p15_het_retina" = "#155329",
  "p08_het_scn" = "#4292C6",
  "p15_het_scn" = "#275776",
  "p08_ko_dlgn" = "#C994C7",
  "p15_ko_dlgn" = "#785877",
  "p08_ko_retina" = "#74C476",
  "p15_ko_retina" = "#457546",
  "p08_ko_scn" = "#9BCAE1",
  "p15_ko_scn" = "#5d7987")

6.2 The Transcript abundances

This perhaps deserves a little bit of explanation: the process for using UMIs goes as follows:

  1. Examine all the raw reads, extract the UMI IDs, and add them as comments to the fastq file (or rewrite the read ID)
  2. Align all reads against the genome.
  3. Take the resulting bam file and find reads at the same location with the same ID(s) and filter the alignment so that there remains only 1 representative from each ID.
  4. Count up the features of interest.

I therefore invoked featureCounts on the umi deduplicated bam alignments (found in column ‘umi_dedup_output_bam’ BP in my copy of the automagically generated sample sheet) using the requisite mm38 gff file with transcript as the feature type and ID as the tag.

Oh, that reminds me, I need to re-key the annotations to use that and I might need to check that the IDs do or do not have a prefix like ‘transcript:’ or whatever…

mm38_hisat_tx <- create_se(sample_sheet, gene_info = mm_tx_annot,
                           file_column = "umi_dedup_mrna_count") |>
  set_conditions(fact = "geno_loc_atb") |>
  set_batches(fact = "time_atb") |>
  set_colors(color_choices[["geno_loc"]])
## Reading the sample metadata.
## Checking the state of the condition column.
## Checking the state of the batch column.
## Checking the condition factor.
## The sample definitions comprises: 69 rows(samples) and 54 columns(metadata fields).
## Warning in create_se(sample_sheet, gene_info = mm_tx_annot, file_column = "umi_dedup_mrna_count"): Some samples were removed when cross
## referencing the samples against the count data.
## Matched 65810 annotations and counts.
## Some annotations were lost in merging, setting them to 'undefined'.
## The final summarized experiment has 65883 rows and 54 columns.
## The numbers of samples by condition are:
## 
##   het_dlgn het_retina    het_scn    ko_dlgn  ko_retina     ko_scn    wt_dlgn  wt_retina     wt_scn 
##          7          7          7          6          6          6         11         11          7
## Setting colors with no pre-defined colors, using the Dark2 palette.
## The number of samples by batch are:
## 
## p08 p15 p60 
##  31  34   3
mm38_hisat_tx
## class: SummarizedExperiment 
## dim: 65883 68 
## metadata(7): notes title ... study researcher
## assays(1): ''
## rownames(65883): transcript:ENSMUST00000000001 transcript:ENSMUST00000000003 ... transcript:ENSMUST00020183811
##   transcript:ENSMUST00020183812
## rowData names(12): ensembl_gene_id ensembl_transcript_id ... end_position mgi_symbol
## colnames(68): iprgc_62 iprgc_63 ... iprgc_129 iprgc_130
## colData names(55): rownames sampleid ... umi_dedup_mrna_count color
## Now that we created the data structure with IDs that include the transcript: prefix,
## remove it...
new_ids <- gsub(x = rownames(assay(mm38_hisat_tx)), pattern = "^transcript:", replacement = "")
rownames(mm38_hisat_tx) <- new_ids
rownames(mm_tx_annot) <- gsub(x = rownames(mm_tx_annot), pattern = "^transcript:", replacement = "")
all_fact <- paste0(colData(mm38_hisat_tx)[["time_atb"]], "_",
                   colData(mm38_hisat_tx)[["geno_loc_atb"]])
colData(mm38_hisat_tx)[["time_geno_loc"]] <- all_fact
dim(assay(mm38_hisat_tx))
## [1] 65883    68
head(assay(mm38_hisat_tx))
##                    iprgc_62 iprgc_63 iprgc_64 iprgc_65 iprgc_66 iprgc_67 iprgc_68 iprgc_69 iprgc_70 iprgc_71 iprgc_72 iprgc_73 iprgc_74
## ENSMUST00000000001       27       22      169      202       53       42       16      183       22       29       40       34      181
## ENSMUST00000000003        0        0        0        0        0        0        0        0        0        0        0        0        0
## ENSMUST00000000010        0        0        0        0        0        0        0        0        0        0        0        0        0
## ENSMUST00000000028        0        0        0        0        0        0        0        0        0        0        0        0        0
## ENSMUST00000000033        0        0        0        0        0        0        0        0        0        0        0        0        0
## ENSMUST00000000049        0        0        0        0        0        0        0        1        0        0        0        0        0
##                    iprgc_75 iprgc_76 iprgc_77 iprgc_78 iprgc_79 iprgc_80 iprgc_81 iprgc_82 iprgc_83 iprgc_84 iprgc_85 iprgc_86 iprgc_87
## ENSMUST00000000001      201      311       27       70      187       62       17       74       82      322       33      259       40
## ENSMUST00000000003        0        0        0        0        0        0        0        0        0        0        0        0        0
## ENSMUST00000000010        0        0        0        0        0        0        0        0        0        0        0        0        0
## ENSMUST00000000028        0        0        0        0        0        0        0        0        0        0        0        0        0
## ENSMUST00000000033        0        0        0        0        0        0        0        0        0        0        0        0        0
## ENSMUST00000000049        0        2        0        0        0        0        0        1        0        0        0        0        0
##                    iprgc_88 iprgc_89 iprgc_90 iprgc_91 iprgc_92 iprgc_93 iprgc_94 iprgc_95 iprgc_96 iprgc_97 iprgc_98 iprgc_99 iprgc_100
## ENSMUST00000000001       74      160      577      344       67       30       31       53      141       51      140      247        97
## ENSMUST00000000003        0        0        0        0        0        0        0        0        0        0        0        0         0
## ENSMUST00000000010        0        0        0        0        0        0        0        0        0        0        0        0         0
## ENSMUST00000000028        0        0        0        0        0        0        0        0        0        0        0        0         0
## ENSMUST00000000033        0        0        0        0        0        0        0        0        0        0        0        0         0
## ENSMUST00000000049        0        0        1        0        0        0        0        0        0        0        0        0         0
##                    iprgc_101 iprgc_102 iprgc_104 iprgc_105 iprgc_106 iprgc_107 iprgc_108 iprgc_109 iprgc_110 iprgc_111 iprgc_112 iprgc_113
## ENSMUST00000000001       199        78        68       159       140        57       175       529        79       107       149        76
## ENSMUST00000000003         0         0         0         0         0         0         0         0         0         0         0         0
## ENSMUST00000000010         0         0         0         0         0         0         0         0         0         0         0         0
## ENSMUST00000000028         0         0         0         0         0         0         0         0         0         0         0         0
## ENSMUST00000000033         0         0         0         0         0         0         0         0         0         0         0         0
## ENSMUST00000000049         0         0         0         0         0         0         0         0         0         0         0         0
##                    iprgc_114 iprgc_115 iprgc_116 iprgc_117 iprgc_118 iprgc_119 iprgc_120 iprgc_121 iprgc_122 iprgc_123 iprgc_124 iprgc_125
## ENSMUST00000000001       214       413       259       480       434       231       451       332       249        41        56       158
## ENSMUST00000000003         0         0         0         0         0         0         0         0         0         0         0         0
## ENSMUST00000000010         0         0         0         0         0         0         0         0         0         0         0         0
## ENSMUST00000000028         0         0         0         0         0         0         0         0         0         0         0         0
## ENSMUST00000000033         0         0         0         0         0         0         0         0         0         0         0         0
## ENSMUST00000000049         0         0         0         0         0         0         0         0         0         0         0         0
##                    iprgc_126 iprgc_127 iprgc_128 iprgc_129 iprgc_130
## ENSMUST00000000001        68       147        64        42       132
## ENSMUST00000000003         0         0         0         0         0
## ENSMUST00000000010         0         0         0         0         0
## ENSMUST00000000028         0         0         0         0         0
## ENSMUST00000000033         0         0         0         0         0
## ENSMUST00000000049         0         0         0         0         1

7 Non-zero Counts per Sample

A neat little change I just made: when null set the y-intercept to the mean percentage of units observed (transcripts in this case).

tx_nonzero  <- plot_nonzero(mm38_hisat_tx)
## The following samples have less than 42823.95 features.
##  [1] "iprgc_62"  "iprgc_63"  "iprgc_64"  "iprgc_65"  "iprgc_66"  "iprgc_67"  "iprgc_68"  "iprgc_69"  "iprgc_70"  "iprgc_71"  "iprgc_72" 
## [12] "iprgc_73"  "iprgc_74"  "iprgc_75"  "iprgc_76"  "iprgc_77"  "iprgc_78"  "iprgc_79"  "iprgc_80"  "iprgc_81"  "iprgc_82"  "iprgc_83" 
## [23] "iprgc_84"  "iprgc_85"  "iprgc_86"  "iprgc_87"  "iprgc_88"  "iprgc_89"  "iprgc_90"  "iprgc_91"  "iprgc_92"  "iprgc_93"  "iprgc_94" 
## [34] "iprgc_95"  "iprgc_96"  "iprgc_97"  "iprgc_98"  "iprgc_99"  "iprgc_100" "iprgc_101" "iprgc_102" "iprgc_104" "iprgc_105" "iprgc_106"
## [45] "iprgc_107" "iprgc_108" "iprgc_109" "iprgc_110" "iprgc_111" "iprgc_112" "iprgc_113" "iprgc_114" "iprgc_115" "iprgc_116" "iprgc_117"
## [56] "iprgc_118" "iprgc_119" "iprgc_120" "iprgc_121" "iprgc_122" "iprgc_123" "iprgc_124" "iprgc_125" "iprgc_126" "iprgc_127" "iprgc_128"
## [67] "iprgc_129" "iprgc_130"
## Scale for colour is already present.
## Adding another scale for colour, which will replace the existing scale.
## Scale for fill is already present.
## Adding another scale for fill, which will replace the existing scale.
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## ℹ The deprecated feature was likely used in the hpgltools package.
##   Please report the issue to the authors.
## This warning is displayed once per session.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.
pp(file = "01diagnostic_images_tx/nonzero_tx_unfiltered.pdf", image = tx_nonzero[["plot"]])

tx_libsize <- plot_libsize(mm38_hisat_tx)
pp(file = "01diagnostic_images_tx/quantsize_unfiltered.pdf", image = tx_libsize[["plot"]])

7.1 Exclude p60

mm38_hisat_tx <- subset_se(mm38_hisat_tx, subset = "time_atb!='p60'")

7.2 Replot the nonzero gene plots

tx_nonzero_filt <- plot_nonzero(mm38_hisat_tx, plot_labels = FALSE)
## The following samples have less than 42823.95 features.
##  [1] "iprgc_62"  "iprgc_63"  "iprgc_64"  "iprgc_65"  "iprgc_66"  "iprgc_67"  "iprgc_68"  "iprgc_69"  "iprgc_70"  "iprgc_71"  "iprgc_72" 
## [12] "iprgc_73"  "iprgc_74"  "iprgc_75"  "iprgc_76"  "iprgc_77"  "iprgc_81"  "iprgc_82"  "iprgc_83"  "iprgc_84"  "iprgc_85"  "iprgc_86" 
## [23] "iprgc_87"  "iprgc_88"  "iprgc_89"  "iprgc_90"  "iprgc_91"  "iprgc_92"  "iprgc_93"  "iprgc_94"  "iprgc_95"  "iprgc_96"  "iprgc_97" 
## [34] "iprgc_98"  "iprgc_99"  "iprgc_100" "iprgc_101" "iprgc_102" "iprgc_104" "iprgc_105" "iprgc_106" "iprgc_107" "iprgc_108" "iprgc_109"
## [45] "iprgc_110" "iprgc_111" "iprgc_112" "iprgc_113" "iprgc_114" "iprgc_115" "iprgc_116" "iprgc_117" "iprgc_118" "iprgc_119" "iprgc_120"
## [56] "iprgc_121" "iprgc_122" "iprgc_123" "iprgc_124" "iprgc_125" "iprgc_126" "iprgc_127" "iprgc_128" "iprgc_129" "iprgc_130"
## Scale for colour is already present.
## Adding another scale for colour, which will replace the existing scale.
## Scale for fill is already present.
## Adding another scale for fill, which will replace the existing scale.
## Not putting labels on the plot.
pp(file = "01diagnostic_images_tx/nonzero_tx_filt.pdf", image = tx_nonzero_filt[["plot"]])

8 Quick PCA, then return to Theresa’s document

tx_norm <- normalize(mm38_hisat_tx, transform = "log2", convert = "cpm",
                     norm = "quant", filter = TRUE)
## Removing 52535 low-count genes (13348 remaining).
## transform_counts: Found 118930 values equal to 0, adding 1 to the matrix.
tx_norm_pca <- plot_pca(tx_norm)
pp(file = "01diagnostic_images_tx/tx_norm_pca.pdf", image = tx_norm_pca[["plot"]])

tx_loc_geno <- set_conditions(mm38_hisat_tx, fact = "location_atb",
                              colors = color_choices[["location"]]) |>
  set_batches(fact = "genotype_atb")
## The numbers of samples by condition are:
## 
##   dlgn retina    scn 
##     23     23     19
## The number of samples by batch are:
## 
## het  ko  wt 
##  21  18  26

8.1 The associated PCA

At different times, it appears to me that Theresa has preferred slightly different normalization methods, primarily a mix of TMM and quantile.

Thus I will use different suffix letters to denote various normalizations employed, and if they turn out the same I will pick one arbitrarily.

loc_geno_nq <- normalize(tx_loc_geno, transform = "log2", convert = "cpm",
                         filter = TRUE, norm = "quant")
## Removing 52535 low-count genes (13348 remaining).
## transform_counts: Found 118930 values equal to 0, adding 1 to the matrix.
location_genotype_pca <- plot_pca(loc_geno_nq)
pp(file = "01diagnostic_images_tx/location_genotype_norm_pca.pdf", image = location_genotype_pca[["plot"]])

loc_geno_nt <- normalize(tx_loc_geno, transform = "log2", convert = "cpm",
                         filter = TRUE, norm = "tmm")
## Removing 52535 low-count genes (13348 remaining).
## transform_counts: Found 224721 values equal to 0, adding 1 to the matrix.
location_genotype_tmm_pca <- plot_pca(loc_geno_nt)
pp(file = "01diagnostic_images_tx/location_genotype_tmm_pca.pdf", image = location_genotype_tmm_pca[["plot"]])

sample_sankey <- plot_meta_sankey(tx_loc_geno, color_choices = color_choices,
                                  factors = c("genotype_atb", "location_atb", "time_atb"))
## Warning: attributes are not identical across measure variables; they will be dropped
## Warning: The `size` argument of `element_rect()` is deprecated as of ggplot2 3.4.0.
## ℹ Please use the `linewidth` argument instead.
## ℹ The deprecated feature was likely used in the ggsankey package.
##   Please report the issue at <https://github.com/davidsjoberg/ggsankey/issues>.
## This warning is displayed once per session.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.
pp(file = "01diagnostic_images_tx/design_sankey.pdf", image = sample_sankey[["plot"]])

Re-purpose these expression plots to examine one Opn4 transcript. This will by some necessity be arbitrary.

It is at this moment that I realized (as I am almost certain I told myself when I started) using the hisat-derived tx counts is wrong because hisat->featureCounts has no good way to allocate multi-hits to multiple transcripts and will therefore discount them. If I want to do this in any sort of reliable way, I really need to re-extract the deduplicate reads from the umitools bam file and run salmon/kallisto. This is somewhat annoying because the various tools I have for extract bam reads really hate the way umitools formats the bam file and freak out. I can force it, but I think I will lose a potentially significant number of reads, let us go look…

(If you with to follow along, go back to the preprocessing document which I should have included in the singularity container) I will do one of the following:

  1. Use gatk or bamtools to create deduplicated fastq files and use them with salmon.
  2. Use salmon with the deduplicated bam files from hisat.

I am not sure right now which I want to do. I kind of like the idea of having deduplicated fastq files so that I can try some other stuff with them (kraken, for example)

## ggstatsplot has appeared and disappeared a few times from cran recently,
## I am not sure if it will work therefore, so figured I should disable this block
## for the moment.

## I did a search at ensembl for the various opn4 transcript IDs:
## ENSMUST00000022331, ENSMUST00000168444, ENSMUST00000226806
ids <- c("ENSMUST00000022331", "ENSMUST00000168444", "ENSMUST00000226806")
ids %in% rownames(loc_geno_nt)
ids <- c("ENSMUST00000022331", "ENSMUST00000168444")

opn4_exprs <- data.frame(combined = colData(loc_geno_nt)[["geno_loc_atb"]],
                         location = colData(loc_geno_nt)[["location_atb"]],
                         genotype = colData(loc_geno_nt)[["genotype_atb"]],
                         opn = assay(loc_geno_nt)[ids[1], ])

groupedstats::grouped_summary(opn4_exprs, location, opn)
opn4_location <- ggstatsplot::ggbetweenstats(data = opn4_exprs, x = location, y = opn)
pp(file = "images_tx/ggbetween_location.pdf")
opn4_location
plotted <- dev.off()
opn4_location

ok, so I plotted the question a bit differently, but got the same answer.

Here is the text of Theresa’s notebook following this analysis:

“Ugh oh, looks like there is at least one retina KO sample that has some melanopsin expression in it. Turns out ipRGC_07 is a bad egg which is supposed to be a KO but has melanopsin expression. It’s friends which were pooled from the same mice are iprgc_06 and iprgc_08, so we need to exclude all these samples.”

I am also seeing some knockout expression with some caveats: I do not have the affected samples in my dataset (iprgc_07) and the levels I am seeing are quite low – I will look in IGV to double check, but I strongly suspect that these are some piddly reads near the UTRs.

Onward!

9 PCA plots

9.1 PCA of all genes by location

Theresa’s first pca was of log2 cpm values. I might add quantile/tmm to this?

tx_location <- set_conditions(mm38_hisat_tx, fact = "location_atb") |>
  set_batches(fact = "genotype_atb") |>
  set_colors(color_choices[["location"]])
## The numbers of samples by condition are:
## 
##   dlgn retina    scn 
##     23     23     19
## Setting colors with no pre-defined colors, using the Dark2 palette.
## The number of samples by batch are:
## 
## het  ko  wt 
##  21  18  26
tx_location_norm <- normalize(tx_location, filter = TRUE, norm = "quant",
                                   transform = "log2", convert = "cpm")
## Removing 52535 low-count genes (13348 remaining).
## transform_counts: Found 118930 values equal to 0, adding 1 to the matrix.
tx_location_pca <- plot_pca(tx_location_norm)
pp(file = "01diagnostic_images_tx/tx_location_norm_pca.pdf")
tx_location_pca
## The result of performing a fast_svd dimension reduction.
## The x-axis is PC1 and the y-axis is PC2
## Colors are defined by dlgn, retina, scn
## Shapes are defined by het, ko, wt.
dev.off()
## png 
##   2
tx_location_pca
## The result of performing a fast_svd dimension reduction.
## The x-axis is PC1 and the y-axis is PC2
## Colors are defined by dlgn, retina, scn
## Shapes are defined by het, ko, wt.

Once again we see that samples iprgc_66 and iprgc_130 are likely actually DLGN and not SCN. I am therefore going to add a column to the sample sheet noting this, and remove them from the expressionset.

I will thus replot the data after removing those two. If we want to see what it looks like with the re-attributed locations, we can do so.

Theresa has a nice change to the PCA plotter in which she sets the alpha channel as an additional visual queue for a metadata factor…

mm38_hisat_tx <- subset_se(mm38_hisat_tx, subset="sampleid!='iprgc_130'") |>
  subset_se(subset="sampleid!='iprgc_66'")
tx_location <- set_conditions(mm38_hisat_tx, fact = "location_atb") |>
  set_batches(fact = "genotype_atb") |>
  set_colors(color_choices[["location"]])
## The numbers of samples by condition are:
## 
##   dlgn retina    scn 
##     23     23     17
## Setting colors with no pre-defined colors, using the Dark2 palette.
## The number of samples by batch are:
## 
## het  ko  wt 
##  20  18  25
tx_location_norm <- normalize(tx_location, filter = TRUE, norm = "quant",
                                   transform = "log2", convert = "cpm")
## Removing 52544 low-count genes (13339 remaining).
## transform_counts: Found 112002 values equal to 0, adding 1 to the matrix.
filtered_location_pca <- plot_pca(tx_location_norm)
pp(file = "02filtered_images_tx/filtered_location_pca.pdf")
## Warning in pp(file = "02filtered_images_tx/filtered_location_pca.pdf"): The directory: 02filtered_images_tx does not exist, will attempt to
## create it.
filtered_location_pca[["plot"]]
plotted <- dev.off()
filtered_location_pca
## The result of performing a fast_svd dimension reduction.
## The x-axis is PC1 and the y-axis is PC2
## Colors are defined by dlgn, retina, scn
## Shapes are defined by het, ko, wt.

removed_sankey <- plot_meta_sankey(tx_location, color_choices = color_choices,
                                   factors = c("genotype_atb", "location_atb", "time_atb"))
## Warning: attributes are not identical across measure variables; they will be dropped
pp(file = "02filtered_images_tx/filtered_sankey.pdf")
removed_sankey[["ggplot"]]
## NULL
plotted <- dev.off()
removed_sankey
## A sankey plot describing the metadata of 63 samples,
## including 30 out of 0 nodes and traversing metadata factors:
## genotype_atb, location_atb, time_atb.

Here is Theresa’s text, recall once again that I do not have some of these older samples (iprgc_62):

PC1 vs PC2 identifies retina vs axon is still the main component of variation. We do see though that in the PC2 direction, we see with the new samples added, we don’t see separation based on axonal targets (dLGN vs SCN). In the PC1 vs PC3 plot, we see that it’s PC3 where we start to see variation correlated with axonal compartment. Let’s look at PC1 vs PC2 colored by batch (when they were processed/sequenced) to see if that is what is contributing so much variation in PC2.

Side note: ipRGC 62 seems like an odd ball. This seems to me like it should have been a dLGN P08 sample. Is there any possibility this got mislabeled early on? I went back and double checked to see if all my processing is correct and it indeed was labeled an SCN P15 from the time I got the samples, and it is indeed.

10 DE

I now switched to Theresa’s document ‘WORKING_axonTRAP…’ and will start pulling sections from it. I am reasonably certain I have reasonably similar sample distributions, so I presume I can invoke similar/identical calls for DESeq and friends.

10.1 p8 retinas

In the block immediately before the DE analyses, Theresa created a subset expressionset of only p08 retinas. Thus this initial DE I assume will be used to subtract for the SCN/DLGN analyses that follow. (I guess I could read ahead and find out, but no! I want to be a blank slate)

Theresa’s primary workflow makes heavy use of DESeq2 (Love et al. (2014)) and sva ((leekSVAPackageRemoving2012?)). In some(most?) of Theresa’s invocations of the all_pairwise() function, she excludes the other methods that it performs. In this workbook, I left those methods on, thus we can evaluate the relative performance DESeq2 vs. some (all? I may have disabled EBSeq/dream because they were taking too long) of the following:

  • limma: (Ritchie et al. (2015)) (among other references) originally written for microarrays.
  • EdgeR: (Robinson et al. (2010)), which shares many assumptions with DESeq2.
  • EBSeq: (Leng et al. (2013)), because I have a soft spot for any Bayesian method.
  • Noiseq: (Tarazona et al. (2011)), which seeks to directly model variance in an RNASeq dataset and use that to improve the sensitivity of the result, much like:
  • Dream: ((hoffmanDreamPowerfulDifferential2020?)), written by the same authors (and uses very similar logic) as one of my favorite tools, variancePartition(Hoffman and Schadt (2016)).
mm38_p8_retina <- subset_se(mm38_hisat_tx, subset = "time_atb=='p08' & location_atb=='retina'")
mm_normal_p8_ret_de <- all_pairwise(mm38_p8_retina, model_svs = "svaseq",
                                    model_fstring = "~ 0 + condition", filter = TRUE)
## het_retina  ko_retina  wt_retina 
##          3          3          5
## Removing 56421 low-count genes (9462 remaining).
## Basic step 0/3: Normalizing data.
## Basic step 0/3: Converting data.
## I think this is failing? SummarizedExperiment
## Basic step 0/3: Transforming data.
## Setting 5313 entries to zero.
## This received a matrix of SVs.
## converting counts to integer mode
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## conditions
## het_retina  ko_retina  wt_retina 
##          3          3          5
## conditions
## het_retina  ko_retina  wt_retina 
##          3          3          5
## conditions
## het_retina  ko_retina  wt_retina 
##          3          3          5

mm_normal_p8_ret_de
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 3 comparisons.

There seems to be a discrepency with previous iterations of this. Let us simplify to just doing deseq and find what is causing it. In my previous iteration, I got 3632 genes in the unique(c()) or het+ko.

deseq_only <- deseq_pairwise(mm38_p8_retina, model_svs = "svaseq",
                             model_fstring = default_fstring, filter = TRUE)
## converting counts to integer mode
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
deseq_hetkeeper_tx <- deseq_only$all_tables$wt_retina_vs_het_retina |>
  filter(logFC <= -0.25 & adj.P.Val <= 0.05)
deseq_kokeeper_tx <- deseq_only$all_tables$wt_retina_vs_ko_retina |>
  filter(logFC <= -0.25 & adj.P.Val <= 0.05)
deseq_keepertx <- unique(c(rownames(deseq_hetkeeper_tx),
                        rownames(deseq_kokeeper_tx)))
length(deseq_keepertx)
## [1] 1806
deseq_pair_hetkeeper_tx <- mm_normal_p8_ret_de$deseq$all_tables$wt_retina_vs_het_retina |>
  filter(logFC <= -0.25 & adj.P.Val <= 0.05)
deseq_pair_kokeeper_tx <- mm_normal_p8_ret_de$deseq$all_tables$wt_retina_vs_ko_retina |>
  filter(logFC <= -0.25 & adj.P.Val <= 0.05)
deseq_pair_keepertx <- unique(c(rownames(deseq_pair_hetkeeper_tx),
                        rownames(deseq_pair_kokeeper_tx)))
length(deseq_pair_keepertx)
## [1] 1806

The following invocation performed by Theresa filters the wt/het comparison for only those genes which increased by at least 0.25 logFC with a significant adjusted p-value. I assume that this is to use the wt samples as a translational control for the ket/ko comparisons; I am therefore thinking that for my purposes, I will therefore separate the contrasts from all_pairwise do this in a stepwise fashion…

The block of code immediately following Theresa’s all_pairwise() invocation is a little confusing for me and warrants some explanation by me to me in the hopes that I do not misunderstand what is happening and the goals therein.

I think I can safely assume that the goal here is to pull out the IDs which increased in het with respect to wild type; even if by a small margin, as long as it is statistically significant vis a vis the adjusted p-value.

I am going to perform what I think is the same thing in a slightly different fashion so that I can share a copy of the results with whomever is interested. I will also repeat Theresa’s invocation and prove to myself that I understood and got the same answer.

wt_het_keeper <- list("het_vs_wt" = c("het_retina", "wt_retina"))
het_wt_table <- combine_de_tables(
  mm_normal_p8_ret_de, keepers = wt_het_keeper, label_column = label_column,
  excel = "03theresa_comparison_excel_tx/het_retina_control.xlsx")
## Looking for subscript invalid names, end of extract_keepers.
wanted_sig <- extract_significant_genes(
  het_wt_table, lfc = 0.25, according_to = "deseq",
  excel = "03theresa_comparison_excel_tx/het_retina_control-sig.xlsx")
wanted_het_increased <- wanted_sig[["deseq"]][["ups"]][["het_vs_wt"]]
increased_het_genes <- rownames(wanted_het_increased)

Here are Theresa’s next lines:

mm_de_normal_p8_ret <- mm_normal_p8_ret_de
hetkeeper_tx <- mm_de_normal_p8_ret$deseq$all_tables$wt_retina_vs_het_retina |>
  filter(logFC <= -0.25 & adj.P.Val <= 0.05)
kokeeper_tx <- mm_de_normal_p8_ret$deseq$all_tables$wt_retina_vs_ko_retina |>
  filter(logFC <= -0.25 & adj.P.Val <= 0.05)
keepertx <- unique(c(rownames(hetkeeper_tx),
                        rownames(kokeeper_tx)))
## We know a priori that Opn4 is ENSMUSG00000021799
## I do not expect to see it in this set, it should be higher in wt
## retina vs ko retina by a significant margin.
## "ENSMUSG00000021799" %in% keepertx
## Oooohhh but it _is_ higher in het vs. wt, as we saw in
## the violin plot earlier.

I think Rashmi made a compelling point which illustrates why we likely should expect the expression of Opn4 to significantly higher in the heterozygotes vs wild-type:

  1. Recall that the assay is using the immunopurification to extract the RNAs.
  2. The wt samples do not have the cre recombinase and therefore no HA and therefore everything we observe is due to non-specific binding.
  3. The set of genes observed due to non-specific binding is different than het/ko (presumably a larger number of relatively small values), therefore the divisor performed in the cpm is likely relativly large resulting in normalized values getting shifted down to some degree.
  4. On the other hand, the set of genes observed in het/ko are more likely to be only the specific binders and therefore smaller (I can test this) resulting in a smaller divisor and slight shifting up in the cpm values.

This makes me wonder if any normalization methods exist which do something like multiply the values by some value related to the proportion of observed genes; and/or if this is a good/bad/indifferent idea.

Also, just a note for me to remember: RPL22, not RPS22, for some reason I keep thinking the small subunit.

10.2 Prove I understood

hetkeeper_tx <- mm_normal_p8_ret_de$deseq$all_tables$wt_retina_vs_het_retina |>
  filter(logFC <= -0.25 & adj.P.Val <= 0.05)
testthat::expect_true(nrow(hetkeeper_tx) == length(increased_het_genes))
taa_keepers <- sort(rownames(hetkeeper_tx))
atb_keepers <- sort(increased_het_genes)
testthat::expect_equal(taa_keepers, atb_keepers)

Yay! I can read! Now let us repeat for the KO vs wt

wt_ko_keeper <- list("ko_vs_wt" = c("ko_retina", "wt_retina"))
ko_wt_table <- combine_de_tables(
  mm_normal_p8_ret_de, keepers = wt_ko_keeper, label_column = label_column,
  excel = "03theresa_comparison_excel_tx/ko_retina_control.xlsx")
## Looking for subscript invalid names, end of extract_keepers.
wanted_sig <- extract_significant_genes(
  ko_wt_table, lfc = 0.25, according_to = "deseq",
  excel = "03theresa_comparison_excel_tx/ko_retina_control-sig.xlsx")

wanted_ko_increased <- wanted_sig[["deseq"]][["ups"]][["ko_vs_wt"]]
increased_ko_genes <- rownames(wanted_ko_increased)

The next thing performed in Theresa’s document is a unique(concatenation of these two gene groups), thus sucking up every gene which was significantly higher in either the knockout or heterzyous samples with respect to wild-type.

This was followed by a couple of merge operations of a little bit of the annotation data; I am not sure I understand the goal yet…

Here is her code. I copied the annotation ‘mgi_symbol’ column to ‘external_gene_name’ so that I need not change any of her code. I am assuming this is the appropriate column of interest, I do not know this for certain, but it seems quite likely.

While I am at it, here is the set_sig_limma() function from Theresa’s helpers.R

set_sig_limma <- function(limma_tbl, factors = NULL) {
  if (is.null(factors)) {
    #set significance for plotting colors
    limma_tbl$Significance <- NA
    limma_tbl[abs(limma_tbl$logFC) < 1 | limma_tbl$adj.P.Val > .05, "Significance"] <- "Not \nEnriched"
    limma_tbl[limma_tbl$logFC >= 1  & limma_tbl$adj.P.Val <= .05, ][["Significance"]] <- "Disease \nUpregulated"
    limma_tbl[limma_tbl$logFC <= -1  & limma_tbl$adj.P.Val <= .05, ][["Significance"]] <- "Disease \nDownregulated"
    limma_tbl$Significance <- factor(limma_tbl$Significance, levels = c("Upregulated", "Downregulated",  "Not \nEnriched"))
  } else {
    limma_tbl$Significance <- NA
    limma_tbl[abs(limma_tbl$logFC) < 1 | limma_tbl$adj.P.Val > .05, "Significance"] <- "Not \nEnriched"
    if(nrow(limma_tbl[limma_tbl$logFC >= 1  & limma_tbl$adj.P.Val <= .05, ]) != 0) {
      limma_tbl[limma_tbl$logFC >= 1  & limma_tbl$adj.P.Val <= .05, ][["Significance"]] <- factors[1]
    }
    if (nrow(limma_tbl[limma_tbl$logFC <= -1  & limma_tbl$adj.P.Val <= .05, ]) != 0) {
      limma_tbl[limma_tbl$logFC <= -1  & limma_tbl$adj.P.Val <= .05, ][["Significance"]] <- factors[2]
    }
    limma_tbl$Significance <- factor(limma_tbl$Significance, levels = c(factors,  "Not \nEnriched"))
  }
  return(limma_tbl)
}

10.2.1 Combining het/wt and ko/wt

mm_tx_annot[["external_gene_name"]] <- mm_tx_annot[["mgi_symbol"]]
keepertx <- unique(c(rownames(hetkeeper_tx), rownames(kokeeper_tx)))
length(keepertx)
## [1] 1806
annots_to_merge <- mm_tx_annot |>
  select(ensembl_transcript_id, external_gene_name) |>
  filter(ensembl_transcript_id %in%
           rownames(mm_de_normal_p8_ret$deseq$all_tables$ko_retina_vs_het_retina)) |>
  distinct()
mm_de_normal_p8_ret[["deseq"]][["all_tables"]][["ko_retina_vs_het_retina"]] <- merge(
  mm_de_normal_p8_ret$deseq$all_tables$ko_retina_vs_het_retina, annots_to_merge,
  by.x = "row.names", by.y = "row.names", all.x = TRUE)
df <- mm_de_normal_p8_ret$deseq$all_tables$ko_retina_vs_het_retina |>
  dplyr::mutate(logFC = -logFC) |>
  set_sig_limma(factors = c("Het Enriched", "KO Enriched"))

My version of the above task makes use of the excludes option of combine_de_tabes. Given the set of unique gene IDs increased in the het/ko, I can ask to exlude anything not in that set. I could also have more parsimoniously directly excluded any gene ID increased in the wt samples. But, Theresa already provided the code to do the former, so it will be less typing/opportunity for silly mistakes to just do that.

both_increased_genes <- unique(c(increased_het_genes, increased_ko_genes))
## arbitrairly grab all genes from one of my data structures.
all_genes <- rownames(assay(mm38_hisat_tx))
exclude_idx <- all_genes %in% both_increased_genes
summary(exclude_idx)
##    Mode   FALSE    TRUE 
## logical   64077    1806
exclude_increased_genes <- all_genes[exclude_idx]
retina_keepers <- list(
  "het_vs_wt" = c("het_retina", "wt_retina"),
  "ko_vs_wt" = c("ko_retina", "wt_retina"),
  "ko_vs_het" = c("ko_retina", "het_retina"))
## A reminder to myself: there is also a parameter 'wanted_genes'
## which does effectively the same thing as excludes in this context;
## excludes was originally written to allow flexible, keyword-based
## exclusion.
p8_retina_tables <- combine_de_tables(
  mm_normal_p8_ret_de, keepers = retina_keepers,
  wanted_genes = both_increased_genes, label_column = label_column,
  excel = glue("03theresa_comparison_excel_tx/p8_retina_kept_tx_increased_in_wt_tables-v{ver}.xlsx"))
## Looking for subscript invalid names, end of extract_keepers.
p8_retina_sig <- extract_significant_genes(
  p8_retina_tables, according_to = "deseq",
  excel = glue("03theresa_comparison_excel_tx/p8_retina_kept_genes_increased_in_wt_sig-v{ver}.xlsx"))

opposite_p8_retina_tables <- combine_de_tables(
  mm_normal_p8_ret_de, keepers = retina_keepers,
  excludes = both_increased_genes, label_column = label_column,
  excel = glue("03theresa_comparison_excel_tx/p8_retina_removed_genes_increased_in_wt_tables-v{ver}.xlsx"))
## Looking for subscript invalid names, end of extract_keepers.
opposite_p8_retina_sig <- extract_significant_genes(
  p8_retina_tables, according_to = "deseq",
  excel = glue("03theresa_comparison_excel_tx/p8_retina_removed_genes_increased_in_wt_sig-v{ver}.xlsx"))

11 Filtering out non-specific genes and examining the results

The following is a copy/paste from Theresa containing the remaining tasks she performed and will provide the template for implementation of the final tasks.

This picks up with the lines from her notebook immediately following the invocation of ‘set_sig_limma(factors = c(“Het Enriched” …’.

For all of the remaining blocks I will copy in her code, turn off its evaluation, run the blocks manually, compare them to her notebook output, then enable each block as I ensure I understand it.

I will likely therefore introduce some small formatting changes and add some additional GSEA/enrichment tasks once the non-specific filtering is complete.

df <- df |>
  filter(Row.names %in% keepertx)
labels_ups <- df |>
  filter(adj.P.Val <= 0.05 & abs(logFC) > 1) |>
  arrange(logFC) |>
  head(n = 9)
labels_downs <- df |>
  filter(adj.P.Val <= 0.05 & abs(logFC) > 1) |>
  arrange(-logFC) |>
  head(n = 11)
labels <- rbind(labels_ups, labels_downs)
res_tbl <- df
DEplot <- ggplot(res_tbl, aes(x = logFC, y = -log10(adj.P.Val), label = external_gene_name)) +
  geom_point(aes(colour = Significance), size = 4) +
  geom_vline(xintercept = c(-1, 1)) +
  geom_hline(yintercept = -log10(0.05)) +
  theme_classic(base_size = 20) +
  xlab("log2(FC)") +
  ylab("-log10(p-value)") +
  theme(legend.position = "right") +
  scale_color_manual(values = c("#F8766D", "#00BFC4", "Grey")) +
  geom_label_repel(
    data = filter(df,
                  ## c('s5_het_dlgn', 's5_het_ret', 's5_het_scn')),
                  external_gene_name %in% labels$external_gene_name),
    ## nudge_x = -0.5,
    nudge_y = 3, max.overlaps = 15) +
  xlim(c(-3, 6))

pp(file = "03theresa_comparison_images_tx/p08_retina_DE_1312024.pdf")
DEplot
## Warning: Removed 1 row containing missing values or values outside the scale range
## (`geom_point()`).
## Warning: Removed 1 row containing missing values or values outside the scale range
## (`geom_label_repel()`).
plotted <- dev.off()
DEplot
## Warning: Removed 1 row containing missing values or values outside the scale range
## (`geom_point()`).
## Removed 1 row containing missing values or values outside the scale range
## (`geom_label_repel()`).

write_xlsx(df, excel = "excel_tx/retinahet_vs_retinako_WTfiltered.xlsx")
## Deleting the file excel_tx/retinahet_vs_retinako_WTfiltered.xlsx before writing the tables.
## write_xlsx() wrote excel_tx/retinahet_vs_retinako_WTfiltered.xlsx.
## The cursor is on sheet first, row: 1809 column: 14.

11.1 How many ups/downs

ko_enriched <- df |>
  filter(Significance == "KO Enriched")
nrow(ko_enriched)
## [1] 15
het_enriched <-  df |>
  filter(Significance == "Het Enriched")
nrow(het_enriched)
## [1] 47

11.2 category enrichment/GSEA

regulated_genes <- res_tbl |>
  filter(adj.P.Val <= 0.05) |>
  arrange(logFC) |>
  select(Row.names, logFC, adj.P.Val, external_gene_name, Significance) |>
  filter(abs(logFC) >= 1)
## gsea_result_ko <- gost(query = ko_genes$external_gene_name,
##                        organism = "mmusculus",
##                        evcodes = TRUE,
##                        ordered_query = TRUE)
gsea_result_het <- gost(query = het_enriched$external_gene_name,
                        organism = "mmusculus",
                        evcodes = TRUE,
                        ordered_query = TRUE)
##gsea_result_alldysregulated <- gost(query = alldysregulated_genes$external_gene_name,
##                                    organism = "mmusculus",
##                                    evcodes = TRUE,
##                                    ordered_query = TRUE)

I have a function in my package which seeks to make gProfiler queries a bit more complete and easy. Let us see how similar the result is…

rownames(alldysregulated_genes) <- alldysregulated_genes[["Row.names"]]
alldysregulated_genes[["Row.names"]] <- NULL

het_gp <- simple_gprofiler(rownames(alldysregulated_genes),
                           species = "mmusculus",
                           excel = glue("excel_tx/het_gprofiler-v{ver}.xlsx"))
het_gp
enrichplot::dotplot(het_gp[["BP_enrich"]])
gp_pair <- enrichplot::pairwise_termsim(het_gp[["BP_enrich"]])
enrichplot::emapplot(gp_pair)
enrichplot::ssplot(gp_pair)
enrichplot::treeplot(gp_pair)
upsetplot(het_gp[["BP_enrich"]])

enrichplot::dotplot(het_gp[["REAC_enrich"]])
gp_pair <- enrichplot::pairwise_termsim(het_gp[["REAC_enrich"]])
enrichplot::emapplot(gp_pair)
enrichplot::ssplot(gp_pair)
enrichplot::treeplot(gp_pair)
upsetplot(het_gp[["REAC_enrich"]])

I make a somewhat arbitrary distinction between the concepts of over-enrichment analyses and GSEA: the former (as performed by gprofiler) (Raudvere et al. (2019)) seeks to find groups of genes overrepresented in GO/reactome/etc. These groups of genes are taken exclusively from the top-n/bottom-n genes with respect to fold-change between conditions of interest; in this case most different than wt in the p08 retina ko or het samples.

With that in mind, I can invoke a similar function using the full table of DE results to get what I call the GSEA result using clusterProfiler (Yu (n.d.)). In the following block I will use the ‘all_cprofiler’ function on the data structures named ‘p8_retina_tables’ and ‘opposite_p8_retina_tables’ in order to get these GSEA results for each contrast performed (het/wt, ko/wt, het/ko). I will follow that up with ‘all_gprofiler’ which does the same, but uses gProfiler’s enrichment analyses (it will therefore include what we just looked at).

p08_retina_all_cp <- all_cprofiler(
  p8_retina_sig, p8_retina_tables, orgdb = "org.Mm.eg.db", orgdb_from = orgdb_from,
  excel = "03theresa_comparison_excel_tx/cprofiler_p08_retina.xlsx")
## There are 238 genes deemed significant out of 721.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (4.32% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : There were 5 pathways for which P-values were not
## calculated properly due to unbalanced (positive and negative) gene-level statistic values. For such pathways pval, padj, NES, log2err are set
## to NA. You can try to increase the value of the argument nPermSimple (for example set it nPermSimple = 10000)
## no term enriched under specific pvalueCutoff...
## Reading KEGG annotation online: "https://rest.kegg.jp/link/mmu/pathway"...
## Reading KEGG annotation online: "https://rest.kegg.jp/list/pathway/mmu"...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (4.34% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Loading required package: org.Mm.eg.db
## Loading required package: AnnotationDbi
## Loading required package: stats4
## Loading required package: BiocGenerics
## Loading required package: generics
## 
## Attaching package: 'generics'
## The following object is masked from 'package:dplyr':
## 
##     explain
## The following objects are masked from 'package:base':
## 
##     as.difftime, as.factor, as.ordered, intersect, is.element, setdiff, setequal, union
## 
## Attaching package: 'BiocGenerics'
## The following objects are masked from 'package:hpgltools':
## 
##     conditions, conditions<-, IQR, mad, sd, var
## The following object is masked from 'package:dplyr':
## 
##     combine
## The following objects are masked from 'package:stats':
## 
##     IQR, mad, sd, var, xtabs
## The following objects are masked from 'package:base':
## 
##     anyDuplicated, aperm, append, as.data.frame, basename, cbind, colnames, dirname, do.call, duplicated, eval, evalq, Filter,
##     Find, get, grep, grepl, is.unsorted, lapply, Map, mapply, match, mget, order, paste, pmax, pmax.int, pmin, pmin.int,
##     Position, rank, rbind, Reduce, rownames, sapply, saveRDS, table, tapply, unique, unsplit, which.max, which.min
## Loading required package: Biobase
## Welcome to Bioconductor
## 
##     Vignettes contain introductory material; view with 'browseVignettes()'. To cite Bioconductor, see 'citation("Biobase")',
##     and for packages 'citation("pkgname")'.
## 
## Attaching package: 'Biobase'
## The following objects are masked from 'package:hpgltools':
## 
##     exprs<-, notes, pData<-, sampleNames<-
## Loading required package: IRanges
## Loading required package: S4Vectors
## 
## Attaching package: 'S4Vectors'
## The following objects are masked from 'package:dplyr':
## 
##     first, rename
## The following object is masked from 'package:utils':
## 
##     findMatches
## The following objects are masked from 'package:base':
## 
##     expand.grid, I, unname
## 
## Attaching package: 'IRanges'
## The following objects are masked from 'package:dplyr':
## 
##     collapse, desc, slice
## 
## Attaching package: 'AnnotationDbi'
## The following object is masked from 'package:dplyr':
## 
##     select
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (4.32% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (4.32% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (4.32% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : There were 1 pathways for which P-values were not
## calculated properly due to unbalanced (positive and negative) gene-level statistic values. For such pathways pval, padj, NES, log2err are set
## to NA. You can try to increase the value of the argument nPermSimple (for example set it nPermSimple = 10000)
## leading edge analysis...
## done...
## Deleting the file 03theresa_comparison_excel_tx/cprofiler_p08_retina_het_vs_wt_up.xlsx before writing the tables.
## There are 2 genes deemed significant out of 721.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (4.32% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : There were 4 pathways for which P-values were not
## calculated properly due to unbalanced (positive and negative) gene-level statistic values. For such pathways pval, padj, NES, log2err are set
## to NA. You can try to increase the value of the argument nPermSimple (for example set it nPermSimple = 10000)
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : For some of the pathways the P-values were likely
## overestimated. For such pathways log2err is set to NA.
## leading edge analysis...
## done...
## --> No gene can be mapped....
## --> Expected input gene ID: 94215,20322,11522,70757,74147,435802
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (4.34% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## --> No gene can be mapped....
## --> Expected input gene ID: 18597,11848,16971,56453,17423,53897
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (4.32% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## No gene sets have size between 5 and 500 ...
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (4.32% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## --> No gene can be mapped....
## --> Expected input gene ID: 2297,399744,4300,10613,2629,400986
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (4.32% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : There were 1 pathways for which P-values were not
## calculated properly due to unbalanced (positive and negative) gene-level statistic values. For such pathways pval, padj, NES, log2err are set
## to NA. You can try to increase the value of the argument nPermSimple (for example set it nPermSimple = 10000)
## leading edge analysis...
## done...
## Deleting the file 03theresa_comparison_excel_tx/cprofiler_p08_retina_het_vs_wt_down.xlsx before writing the tables.
## There are insufficient significant results to plot.
## There are 266 genes deemed significant out of 721.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (4.87% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : There were 6 pathways for which P-values were not
## calculated properly due to unbalanced (positive and negative) gene-level statistic values. For such pathways pval, padj, NES, log2err are set
## to NA. You can try to increase the value of the argument nPermSimple (for example set it nPermSimple = 10000)
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : For some of the pathways the P-values were likely
## overestimated. For such pathways log2err is set to NA.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (4.9% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : For some of the pathways the P-values were likely overestimated. For such pathways log2err is set to NA.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (4.87% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : There were 8 pathways for which P-values were not
## calculated properly due to unbalanced (positive and negative) gene-level statistic values. For such pathways pval, padj, NES, log2err are set
## to NA. You can try to increase the value of the argument nPermSimple (for example set it nPermSimple = 10000)
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (4.87% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (4.87% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Deleting the file 03theresa_comparison_excel_tx/cprofiler_p08_retina_ko_vs_wt_up.xlsx before writing the tables.
## There are 7 genes deemed significant out of 721.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.67% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.82% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.67% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## No gene sets have size between 5 and 500 ...
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.67% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.67% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Deleting the file 03theresa_comparison_excel_tx/cprofiler_p08_retina_ko_vs_het_up.xlsx before writing the tables.
## There are 27 genes deemed significant out of 721.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.67% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.82% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.67% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## No gene sets have size between 5 and 500 ...
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.67% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.67% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Deleting the file 03theresa_comparison_excel_tx/cprofiler_p08_retina_ko_vs_het_down.xlsx before writing the tables.
enrichplot::dotplot(p08_retina_all_cp[["ko_vs_het_up"]][["go_data"]][["MF_enrich"]])

p08_topn_gsea <- plot_topn_gsea(p08_retina_all_cp)
## Starting: het_vs_wt_up.
## Starting: ko_vs_wt_up.
## Starting: ko_vs_het_up.
pp(file = "03theresa_comparison_images_tx/gsea_p08_retina_ko_vs_het_top_hit.pdf")
p08_topn_gsea[["GO_ko_vs_het_up"]][[1]]
dev.off()
## png 
##   2
p08_topn_gsea[["GO_ko_vs_het_up"]][[1]]

p08_topn_gsea[["GO_ko_vs_het_up"]][[2]]

p08_topn_gsea[["GO_ko_vs_het_up"]][[3]]

p08_topn_gsea[["GO_ko_vs_het_up"]][[4]]

p08_topn_gsea[["GO_ko_vs_het_up"]][[5]]

pp(file = "03theresa_comparison_images_tx/gsea_p08_retina_het_vs_wt_top_hit.pdf")
p08_topn_gsea[["GO_het_vs_wt_up"]][[1]]
## Error in `p08_topn_gsea[["GO_het_vs_wt_up"]][[1]]`:
## ! subscript out of bounds
dev.off()
## png 
##   2
#gsea_ko <-  gsea_result_ko[["result"]] |>
#    select(term_name, p_value, term_size, intersection_size, recall, source, intersection) |>
#    arrange(desc(recall)) |>
#    head(n = 10)
#  gsea_plots_ko <- ggplot(gsea_ko, aes(x = recall, y = reorder(term_name, recall), fill = p_value)) +
#  geom_bar(stat = "identity")+
#  scale_fill_continuous(low = "blue", high = "red") +
#  theme_bw()+
#  ylab("") +
#  xlab("GSEA Score")
gsea_het <-  gsea_result_het[["result"]] |>
  dplyr::select(term_name, p_value, term_size, intersection_size, recall, source, intersection) |>
  arrange(desc(recall)) |>
  head(n = 10)
gsea_plots_het <- ggplot(gsea_het, aes(x = recall, y = reorder(term_name, recall), fill = p_value)) +
  geom_bar(stat = "identity") +
  scale_fill_continuous(low = "blue", high = "red") +
  theme_bw() +
  ylab("") +
  xlab("Over Representation Score")
pp(file = "03theresa_comparison_images_tx/GSEA_p08_axontrap_retinahet_upregulated_vs_retinako.pdf")
gsea_plots_het
plotted <- dev.off()
gsea_plots_het

12 SCN Het vs KO

It is only now that I realized we are splitting the data by location for each set of comparisons. I think that, left to my own devices, I would prefer to keep the input data structure intact, perform the somewhat larger number of contrasts, and then split up the results. Ideally this will slightly improve the fidelity of the results returned by DESeq2 and friends. But, I will run the state of Theresa’s notebook with as few changes as possible first, then add this.

12.1 PCA

I am going to skip this PCA plot for a couple of reasons: I already did a superset of it, and the subset Theresa performed is not valid given the set of samples included in my sample sheet, and figuring out the actually corresponding subset will take me forever… In addition, I want to use my mm38_hisat_tx for everything…

scn_samples <- subset_se(mm38_hisat_tx,
                           subset = "location_atb == 'scn'") |>
  set_batches(fact = "location_atb") |>
  set_conditions(fact = "genotype_atb", colors = color_choices[["genotype"]])
## The number of samples by batch are:
## 
## scn 
##  17
## The numbers of samples by condition are:
## 
## het  ko  wt 
##   6   6   5
scn_norm <- normalize(scn_samples, filter = TRUE, convert = "cpm",
                           transform = "log2", batch = "svaseq")
## Removing 54027 low-count genes (11856 remaining).
## transform_counts: Found 11723 values less than 0.
## transform_counts: Found 11723 values equal to 0, adding 1 to the matrix.
scn_norm_pca <- plot_pca(scn_norm)
scn_norm_pca
## The result of performing a fast_svd dimension reduction.
## The x-axis is PC1 and the y-axis is PC2
## Colors are defined by het, ko, wt
## Shapes are defined by scn.

13 Library sizes post-deduplication

Theresa’s next operation was to perform libsize/nonzero plots. I already did the pre/post deduplication nonzero, here is the analagous libsize.

v2 is pre-deduplication and v3 is post.

post_filter_nonzero <- plot_quantreads(mm38_hisat_tx, text = FALSE)
pp(file = "01diagnostic_images_tx/post_all_filteres_nonzero.pdf")
post_filter_nonzero[["plot"]]
plotted <- dev.off()
post_filter_nonzero
## Library sizes of 63 samples, 
## ranging from 333,226 to 2,996,801.

Theresa also produced a density/sample plot, that might prove quite useful for these due to their significantly larger variance across samples (due to deduplication).

pp(file = "01diagnostic_images_tx/sample_density.pdf")
mm38_density <- plot_density(loc_geno_nt)
mm38_density[["plot"]] +
  theme(legend.position = "none")
plot_boxplot(loc_geno_nt)
## Plot describing the gene distribution from a dataset.
dev.off()
## png 
##   2
mm38_density[["plot"]] +
  theme(legend.position = "none")

box <- plot_boxplot(loc_geno_nt)
pp(file = "01diagnostic_images_tx/sample_boxplot.pdf")
box
## Plot describing the gene distribution from a dataset.
dev.off()
## png 
##   2
box
## Plot describing the gene distribution from a dataset.

There is some difference across sample densities, but it is not too crazytown.

14 Diverging a little

At this point in the document I read ahead a bit and came to the conclusion that it repeats the above logic of taking the union of wt comparisons to remove genes from the appropriate het/ko or p15/p08 or location comparisons. This seems quite reasonable to me, but I would prefer to not separate all the data, so I will attempt to duplicate and slightly streamline this logic on the full dataset. Thus I am going to skip down to the end and attempt to implement this.

15 My version of the global analysis

I want to have an invocation of all_pairwise() which uses all samples, in the following block I will set that up using a set of ‘keepers’ which will be named by time, location, then 2 letters for the numerator/denominator: w for WT, h for het, d for delta; thus “p08_retina_hw” is comparing the het/wt for the p08 retina samples.

If they are of interest, I will have a separate set which follows the same convention with names like “p08_ko_sr” to compare p08 deltas with SCN as the numerator and retina as the denominator.

15.1 Set up the exclusion dataset

The most peculiar aspect of this analysis resides in the choices around choosing which genes to consider when comparing the genotypes/locations/times. The general idea is pretty clear: find the genes which are non-specifically being pulled down in the WT samples and either exclude or discount them. The various potential methods for performing this are confusing:

  1. Which set of comparisons of wt/ko wt/het do we use to exclude/discount genes?
    1. Should it be a combination of all samples wt vs. x?
    2. Should it be only the ‘relevant’ comparison, e.g. if we are comparing p08_dlgn_het vs. p08_scn_het; do we remove genes observed in (p08_dlgn_het/wt && p08_scn_het/wt)
  2. Do we instead attempt to use this x/wt information to normalize the expression values in the other conditions and keep those genes?

Theresa’s current worksheet implements a version of 1b in which she separated the various input gene sets to define the exclusion genes. I am going to repeat this, but leave the starting data structure intact.

In this first iteration, I will do that by creating a simplified model of the data which combines the time/genotype/location and using sva. In my next iteration I will use a full statistical model containing each of those factors (and probably also using sva).

Note: my color choices are kind of garbage.

In addition, the exclusion dataset is the same as the analysis dataset, it is really only the contrasts which will be different.

tx_pairwise_input <- set_conditions(mm38_hisat_tx, fact = "time_geno_loc",
                                    colors = color_choices[["all"]])
## The numbers of samples by condition are:
## 
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
## Warning in set_colors(meta, colors = colors, color_column = color_column, : This list does not match the samples nor conditions.
## This function is intended to set the colors of a dataset.
## It was passed an object of type data.frame and does not know what to do.

15.2 A heatmap of specific genes across all conditions

all_cond_gene_heatmap_start <- normalize(tx_pairwise_input, filter = "simple",
                                         length_column = "cds_length",
                                         convert = "rpkm", transform = "log2")
## Removing 50190 low-count genes (15693 remaining).
## About to perform a RPKM conversion where NA lengths are set to: 1000.
## There appear to be 8 genes without a length.
## Setting the elements with NA length to 1000.
## transform_counts: Found 354582 values equal to 0, adding 1 to the matrix.
all_cond_gene_heatmap_input <- median_by_factor(all_cond_gene_heatmap_start)
## The factor p08_het_dlgn has 3 rows.
## The factor p08_het_retina has 3 rows.
## The factor p08_het_scn has 3 rows.
## The factor p08_ko_dlgn has 3 rows.
## The factor p08_ko_retina has 3 rows.
## The factor p08_ko_scn has 3 rows.
## The factor p08_wt_dlgn has 5 rows.
## The factor p08_wt_retina has 5 rows.
## The factor p08_wt_scn has 3 rows.
## The factor p15_het_dlgn has 4 rows.
## The factor p15_het_retina has 4 rows.
## The factor p15_het_scn has 3 rows.
## The factor p15_ko_dlgn has 3 rows.
## The factor p15_ko_retina has 3 rows.
## The factor p15_ko_scn has 3 rows.
## The factor p15_wt_dlgn has 5 rows.
## The factor p15_wt_retina has 5 rows.
## The factor p15_wt_scn has 2 rows.
all_cond_mtrx <- all_cond_gene_heatmap_input[["medians"]]
color_order <- colnames(all_cond_mtrx)
na_idx <- is.na(all_cond_mtrx)
all_cond_mtrx[na_idx] <- 0
variances <- matrixStats::rowVars(as.matrix(all_cond_mtrx))
variant_genes <- variances > 6.2
input_mtrx <- all_cond_mtrx[variant_genes, ]
cond_colors <- get_colors_by_condition(tx_pairwise_input, levels = color_order)
dim(input_mtrx)
## [1] 146  18
pp(file = "04inclusion_comparisons_tx/top_104_variant_rpkm_genes_heatmap.pdf")
gplots::heatmap.2(as.matrix(input_mtrx), scale = "none", trace = "none",
                  ColSideColors = cond_colors)
dev.off()
## png 
##   2

16 TODO: Change the above to subtract wt

Rashmi suggested we should do the above plot after subtracting the wt counts. This is a good idea, but it will have to wait until we finish the current set.

16.1 Set up the contrasts

In the following few blocks I will set up the various comparisons of interest. Starting with the set of genes to exclude because they were observed to bind non-specifically in the wt samples.

16.1.1 Inclusion contrasts

In each exclusion I will have the contrast first followed by the pair of contrasts which will be used to define the gene set to exclude.

  • p15_het_dlgn/p08_het_dlgn: p15_wt_dlgn/p15_het_dlgn, p08_wt_dlgn/p08_het_dlgn; remove the genes increased in wt.
  • p15_ko_scn/p08_ko_scn: p15_wt_scn/p15_ko_scn, p08_wt_scn/p15_ko_scn
  • p15_het_retina/p08_het_retina: I think you get it, wt/het for both p15 retinas and p08 retinas…

Put slightly differently, for every term of interest I will create a contrast with the wt as numerator and the desired term as denominator, then pull out the genes increased in wt.

inclusions <- list(
  ## I like alphabetizing things, start with dlgn
  "p15_het_dlgn" = c("p15_het_dlgn", "p15_wt_dlgn"),
  "p08_het_dlgn" = c("p08_het_dlgn", "p08_wt_dlgn"),
  "p15_ko_dlgn" = c("p15_ko_dlgn", "p15_wt_dlgn"),
  "p08_ko_dlgn" = c("p08_ko_dlgn", "p08_wt_dlgn"),
  ## Then retinas
  "p15_het_retina" = c("p15_het_retina", "p15_wt_retina"),
  "p08_het_retina" = c("p08_het_retina", "p08_wt_retina"),
  "p15_ko_retina" = c("p15_ko_retina", "p15_wt_retina"),
  "p08_ko_retina" = c("p08_ko_retina", "p08_wt_retina"),
  ## Then scn
  "p15_het_scn" = c("p15_het_scn", "p15_wt_scn"),
  "p08_het_scn" = c("p08_het_scn", "p08_wt_scn"),
  "p15_ko_scn" = c("p15_ko_scn", "p15_wt_scn"),
  "p08_ko_scn" = c("p08_ko_scn", "p08_wt_scn"))

16.1.2 Time contrasts

For each location/genotype of interest, let us compare p15/p08

time_keepers <- list(
  ## DLGN
  "t_het_dlgn" = c("p15_het_dlgn", "p08_het_dlgn"),
  "t_ko_dlgn" = c("p15_ko_dlgn", "p08_ko_dlgn"),
  ## Retina
  "t_het_retina" = c("p15_het_retina", "p08_het_retina"),
  "t_ko_retina" = c("p15_ko_retina", "p08_ko_retina"),
  ## SCN
  "t_het_scn" = c("p15_het_scn", "p08_het_scn"),
  "t_ko_scn" = c("p15_ko_scn", "p08_ko_scn"))

16.1.3 Location contrasts

Compare locations and keep time/genotype consistent. I will use the location initials to define numerator/denominator.

location_keepers <- list(
  ## dlgn/retina
  "dr_p08_het" = c("p08_het_dlgn", "p08_het_retina"),
  "dr_p15_het" = c("p15_het_dlgn", "p15_het_retina"),
  "dr_p08_ko" = c("p08_ko_dlgn", "p08_ko_retina"),
  "dr_p15_ko" = c("p15_ko_dlgn", "p15_ko_retina"),
  ## scn/retina
  "sr_p08_het" = c("p08_het_scn", "p08_het_retina"),
  "sr_p15_het" = c("p15_het_scn", "p15_het_retina"),
  "sr_p08_ko" = c("p08_ko_scn", "p08_ko_retina"),
  "sr_p15_ko" = c("p15_ko_scn", "p15_ko_retina"),
  ## dlgn/scn
  "ds_p08_het" = c("p08_het_dlgn", "p08_het_scn"),
  "ds_p15_het" = c("p15_het_dlgn", "p15_het_scn"),
  "ds_p08_ko" = c("p08_ko_dlgn", "p08_ko_scn"),
  "ds_p15_ko" = c("p15_ko_dlgn", "p15_ko_scn"))

16.1.4 Genotype contrasts

Compare ko/het while keeping time/location constant. Similarly, use the initials to denote numerator/denominator, which will always be kh.

genotype_keepers <- list(
  ## DLGN
  "kh_p08_dlgn" = c("p08_ko_dlgn", "p08_het_dlgn"),
  "kh_p15_dlgn" = c("p15_ko_dlgn", "p15_het_dlgn"),
  ## Retina
  "kh_p08_retina" = c("p08_ko_retina", "p08_het_retina"),
  "kh_p15_retina" = c("p15_ko_retina", "p15_het_retina"),
  ## SCN
  "kh_p08_scn" = c("p08_ko_scn", "p08_het_scn"),
  "kh_p15_scn" = c("p15_ko_scn", "p15_het_scn"))

16.2 Perform the exclusion comparison

My all_pairwise() function now has a parameter which allows me to choose which contrasts to perform instead of literally doing every possible comparison. That is well suited for these operations:

In a container, the following appears to fail with:

“error code 1 from Lapack routine ‘dgesdd’”

Running it manually outside the container results in it working without error. I assume therefore that the problem lies in the compilation flags of LAPACK in the container.

Note: This problem was fixed by removing some parallelization.

inclusion_de <- all_pairwise(
  tx_pairwise_input, filter = "simple", model_fstring = default_fstring,
  keepers = inclusions, model_svs = "svaseq")
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
## Removing 50190 low-count genes (15693 remaining).
## Basic step 0/3: Normalizing data.
## Basic step 0/3: Converting data.
## I think this is failing? SummarizedExperiment
## Basic step 0/3: Transforming data.
## Setting 393901 entries to zero.
## This received a matrix of SVs.
## converting counts to integer mode
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## conditions
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
## conditions
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
## conditions
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2

inclusion_de
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 12 comparisons.
inclusion_tables <- combine_de_tables(
  inclusion_de, keepers = inclusions, label_column = label_column,
  excel = glue("04inclusion_comparisons_tx/inclusion_tables-v{ver}.xlsx"))
## Looking for subscript invalid names, end of extract_keepers.
inclusion_tables
## A set of combined differential expression results.
##                              table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1      p15_het_dlgn_vs_p15_wt_dlgn         316           428         384           497         436           586
## 2      p08_het_dlgn_vs_p08_wt_dlgn          40           116          73           144         149           134
## 3       p15_ko_dlgn_vs_p15_wt_dlgn         566           652         623           785         540           668
## 4       p08_ko_dlgn_vs_p08_wt_dlgn         179           271         171           337         244           495
## 5  p15_het_retina_vs_p15_wt_retina          89            28         143            56          56            23
## 6  p08_het_retina_vs_p08_wt_retina         275           113         325           197         182            57
## 7   p15_ko_retina_vs_p15_wt_retina          31             8         100            44          21            10
## 8   p08_ko_retina_vs_p08_wt_retina         288            88         337           156         183            50
## 9        p15_het_scn_vs_p15_wt_scn           3             4          47            25          43           172
## 10       p08_het_scn_vs_p08_wt_scn           2             1          43            34          37            23
## 11        p15_ko_scn_vs_p15_wt_scn           1             3          38            37         246           208
## 12        p08_ko_scn_vs_p08_wt_scn           1             2          62            29          75            70
## Warning: `aes_string()` was deprecated in ggplot2 3.0.0.
## ℹ Please use tidy evaluation idioms with `aes()`.
## ℹ See also `vignette("ggplot2-in-packages")` for more information.
## ℹ The deprecated feature was likely used in the UpSetR package.
##   Please report the issue at <https://github.com/hms-dbmi/UpSetR/issues>.
## This warning is displayed once per session.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## Warning: The `size` argument of `element_line()` is deprecated as of ggplot2 3.4.0.
## ℹ Please use the `linewidth` argument instead.
## ℹ The deprecated feature was likely used in the UpSetR package.
##   Please report the issue at <https://github.com/hms-dbmi/UpSetR/issues>.
## This warning is displayed once per session.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## Plot describing unique/shared genes in a differential expression table.

## 202603: I successfully recapitulated previous non-container result.

inclusion_sig <- extract_significant_genes(
  inclusion_tables, lfc = lfc_cutoff, p = adjp_cutoff, according_to = "deseq",
  excel = glue("04inclusion_comparisons_tx/inclusion_sig-v{ver}.xlsx"))
inclusion_sig
## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 0.1 adj P cutoff: 0.1
##                deseq_up deseq_down
## p15_het_dlgn       1004       1041
## p08_het_dlgn        178        318
## p15_ko_dlgn        1341       1267
## p08_ko_dlgn         517        488
## p15_het_retina      213        100
## p08_het_retina      537        343
## p15_ko_retina        66         16
## p08_ko_retina       573        265
## p15_het_scn           6          6
## p08_het_scn          11          8
## p15_ko_scn            2          3
## p08_ko_scn            7          5

202505: A strange thing happened here in this iteration: the plot of the significant genes is the exact same as the previous iteration; but the table of numbers of genes looks different.

For example, the previous table showed: p15_het_dlgn with 2067 up and 2381 down. The plot shows exactly that; but the new table shows 607 up and 1229 down. Let us check the actual data structure and see what is up?

I think I get it: when we do the extract_significant_genes above, we explicitly set a non-standard p-value and logFC because we are explicitly attempting to use a very loose definition of the set of genes which are in greater abundance than their most similar wild-type. However, when I create the barplot of significant genes; those values are explicitly set to 0,1,2 logFCs and p-value 0.05. Therefore, what I need to do, in order to check consistency, is to repeat this call but with the default FC/p values and see what the numbers look like.

test_inclusion <- extract_significant_genes(
  inclusion_tables, according_to = "deseq", excel = "excel_tx/default_inclusion_sig.xlsx")
## Deleting the file excel_tx/default_inclusion_sig.xlsx before writing the tables.
test_inclusion
## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##                deseq_up deseq_down
## p15_het_dlgn        316        428
## p08_het_dlgn         40        116
## p15_ko_dlgn         566        652
## p08_ko_dlgn         179        271
## p15_het_retina       89         28
## p08_het_retina      275        113
## p15_ko_retina        31          8
## p08_ko_retina       288         88
## p15_het_scn           3          4
## p08_het_scn           2          1
## p15_ko_scn            1          3
## p08_ko_scn            1          2

Yeah, I think this makes sense; what I need to do: change the significant bar plot so that it uses the lfc cutoff argument as the second of its 3 cutoffs. That should ensure that these numbers are consistent across analyses and parameters provided.

dim(inclusion_sig$deseq$ups$p15_het_dlgn)
## [1] 1004   72
test_all_up <- inclusion_tables$data$p15_het_dlgn[["deseq_logfc"]] > 0.1 &
  inclusion_tables$data$p15_het_dlgn[["deseq_adjp"]] <= 0.1
summary(test_all_up)
##    Mode   FALSE    TRUE 
## logical   14689    1004

Ohh, I get it, when I was testing this out manually, I set the logFC to 1.0 instead of the very minimal 0.1 we have been using for this!

17 MA/Volcano plots of x vs wt

Rashmi asked to see the comparisons against wt; I will name each file xw to show that it is x vs wt. for whatever other parameters are being examined. It is likely that some colors will be wrong because this is my first time creating these plots and we are doing them manually.

17.1 p15_het_dlgn

allc <- color_choices[["all"]]
table_name <- "p15_het_dlgn"
table <- inclusion_tables[["data"]][[table_name]]
num <- "p15_het_dlgn"
denom <- "p15_wt_dlgn"
hw_p15_dlgn_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq_adjp", fill = "black",
  color_low = allc[[denom]], color_high = allc[[num]],
  label_column = "mgi_symbol", label = 10, alpha = 1.0,
  size = 4)

pp(file = "05inclusion_volcano_ma_tx/hw_p15_dlgn_volcano.pdf", width = 9, height = 9)
hw_p15_dlgn_volcano[["plot"]]
plotted <- dev.off()
hw_p15_dlgn_volcano[["plot"]]

hw_p15_dlgn_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = allc[[denom]], color_high = allc[[num]],
  p_col = "deseq_adjp", label_column = "mgi_symbol", outline = outline,
  label = 10)

pp(file = "05inclusion_volcano_ma_tx/hw_p15_dlgn_ma.pdf", width = 9, height = 9)
hw_p15_dlgn_ma[["plot"]]
plotted <- dev.off()
hw_p15_dlgn_ma[["plot"]]

17.2 p08_het_dlgn

table_name <- "p08_het_dlgn"
table <- inclusion_tables[["data"]][[table_name]]
num <- "p08_het_dlgn"
denom <- "p08_wt_dlgn"
hw_p08_dlgn_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq_adjp", fill = "black",
  color_low = allc[[denom]], color_high = allc[[num]],
  label_column = "mgi_symbol", label = 10, alpha = 1.0,
  size = 4)
pp(file = "05inclusion_volcano_ma_tx/hw_p08_dlgn_volcano.pdf", width = 9, height = 9)
hw_p08_dlgn_volcano[["plot"]]
plotted <- dev.off()
hw_p08_dlgn_volcano[["plot"]]

hw_p08_dlgn_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = allc[[denom]], color_high = allc[[num]],
  p_col = "deseq_adjp", label_column = "mgi_symbol", outline = outline,
  label = 10)
pp(file = "05inclusion_volcano_ma_tx/hw_p08_dlgn_ma.pdf", width = 9, height = 9)
hw_p08_dlgn_ma[["plot"]]
plotted <- dev.off()
hw_p08_dlgn_ma[["plot"]]

17.3 p15_ko_dlgn

table_name <- "p15_ko_dlgn"
table <- inclusion_tables[["data"]][[table_name]]
num <- "p15_ko_dlgn"
denom <- "p15_wt_dlgn"
kw_p15_dlgn_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq_adjp", fill = "black",
  color_low = allc[[denom]], color_high = allc[[num]],
  label_column = "mgi_symbol", label = 10, alpha = 1.0,
  size = 4)
pp(file = "05inclusion_volcano_ma_tx/kw_p15_dlgn_volcano.pdf", width = 9, height = 9)
kw_p15_dlgn_volcano[["plot"]]
plotted <- dev.off()
kw_p15_dlgn_volcano[["plot"]]

kw_p15_dlgn_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = allc[[denom]], color_high = allc[[num]],
  p_col = "deseq_adjp", label_column = "mgi_symbol", outline = outline,
  label = 10)
pp(file = "05inclusion_volcano_ma_tx/kw_p15_dlgn_ma.pdf", width = 9, height = 9)
kw_p15_dlgn_ma[["plot"]]
plotted <- dev.off()
kw_p15_dlgn_ma[["plot"]]

HERE

17.4 p08_ko_dlgn

table_name <- "p08_ko_dlgn"
table <- inclusion_tables[["data"]][[table_name]]
num <- "p08_ko_dlgn"
denom <- "p08_wt_dlgn"
kw_p08_dlgn_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq_adjp", fill = "black",
  color_low = allc[[denom]], color_high = allc[[num]],
  label_column = "mgi_symbol", label = 10, alpha = 1.0,
  size = 4)
pp(file = "05inclusion_volcano_ma_tx/kw_p08_dlgn_volcano.pdf", width = 9, height = 9)
kw_p08_dlgn_volcano[["plot"]]
plotted <- dev.off()
kw_p08_dlgn_volcano[["plot"]]

kw_p08_dlgn_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = allc[[denom]], color_high = allc[[num]],
  p_col = "deseq_adjp", label_column = "mgi_symbol", outline = outline,
  label = 10)
pp(file = "05inclusion_volcano_ma_tx/kw_p08_dlgn_ma.pdf", width = 9, height = 9)
kw_p08_dlgn_ma[["plot"]]
plotted <- dev.off()
kw_p08_dlgn_ma[["plot"]]

17.5 p15_het_retina

table_name <- "p15_het_retina"
table <- inclusion_tables[["data"]][[table_name]]
num <- "p15_het_retina"
denom <- "p15_wt_retina"
hw_p15_retina_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq_adjp", fill = "black",
  color_low = allc[[denom]], color_high = allc[[num]],
  label_column = "mgi_symbol", label = 10, alpha = 1.0,
  size = 4)
pp(file = "05inclusion_volcano_ma_tx/hw_p15_retina_volcano.pdf", width = 9, height = 9)
hw_p15_retina_volcano[["plot"]]
plotted <- dev.off()
hw_p15_retina_volcano[["plot"]]

hw_p15_retina_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = allc[[denom]], color_high = allc[[num]],
  p_col = "deseq_adjp", label_column = "mgi_symbol", outline = outline,
  label = 10)
pp(file = "05inclusion_volcano_ma_tx/hw_p15_retina_ma.pdf", width = 9, height = 9)
hw_p15_retina_ma[["plot"]]
plotted <- dev.off()
hw_p15_retina_ma[["plot"]]

17.6 p08_het_retina

table_name <- "p08_het_retina"
table <- inclusion_tables[["data"]][[table_name]]
num <- "p08_het_retina"
denom <- "p08_wt_retina"
hw_p08_retina_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq_adjp", fill = "black",
  color_low = allc[[denom]], color_high = allc[[num]],
  label_column = "mgi_symbol", label = 10, alpha = 1.0,
  size = 4)
pp(file = "05inclusion_volcano_ma_tx/hw_p08_retina_volcano.pdf", width = 9, height = 9)
hw_p08_retina_volcano[["plot"]]
plotted <- dev.off()
hw_p08_retina_volcano[["plot"]]

hw_p08_retina_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = allc[[denom]], color_high = allc[[num]],
  p_col = "deseq_adjp", label_column = "mgi_symbol", outline = outline,
  label = 10)
pp(file = "05inclusion_volcano_ma_tx/hw_p08_retina_ma.pdf", width = 9, height = 9)
hw_p08_retina_ma[["plot"]]
plotted <- dev.off()
hw_p08_retina_ma[["plot"]]

17.7 p15_ko_retina

table_name <- "p15_ko_retina"
table <- inclusion_tables[["data"]][[table_name]]
num <- "p15_ko_retina"
denom <- "p15_wt_retina"
kw_p15_retina_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq_adjp", fill = "black",
  color_low = allc[[denom]], color_high = allc[[num]],
  label_column = "mgi_symbol", label = 10, alpha = 1.0,
  size = 4)
pp(file = "05inclusion_volcano_ma_tx/kw_p15_retina_volcano.pdf", width = 9, height = 9)
kw_p15_retina_volcano[["plot"]]
plotted <- dev.off()
kw_p15_retina_volcano[["plot"]]

kw_p15_retina_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = allc[[denom]], color_high = allc[[num]],
  p_col = "deseq_adjp", label_column = "mgi_symbol", outline = outline,
  label = 10)
pp(file = "05inclusion_volcano_ma_tx/kw_p15_retina_ma.pdf", width = 9, height = 9)
kw_p15_retina_ma[["plot"]]
plotted <- dev.off()
kw_p15_retina_ma[["plot"]]

17.8 p08_ko_retina

table_name <- "p08_ko_retina"
table <- inclusion_tables[["data"]][[table_name]]
num <- "p08_ko_retina"
denom <- "p08_wt_retina"
kw_p08_retina_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq_adjp", fill = "black",
  color_low = allc[[denom]], color_high = allc[[num]],
  label_column = "mgi_symbol", label = 10, alpha = 1.0,
  size = 4)
pp(file = "05inclusion_volcano_ma_tx/kw_p08_retina_volcano.pdf", width = 9, height = 9)
kw_p08_retina_volcano[["plot"]]
plotted <- dev.off()
kw_p08_retina_volcano[["plot"]]

kw_p08_retina_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = allc[[denom]], color_high = allc[[num]],
  p_col = "deseq_adjp", label_column = "mgi_symbol", outline = outline,
  label = 10)
pp(file = "05inclusion_volcano_ma_tx/kw_p08_retina_ma.pdf", width = 9, height = 9)
kw_p08_retina_ma[["plot"]]
plotted <- dev.off()
kw_p08_retina_ma[["plot"]]

17.9 p15_het_scn

table_name <- "p15_het_scn"
table <- inclusion_tables[["data"]][[table_name]]
num <- "p15_het_scn"
denom <- "p15_wt_scn"
hw_p15_scn_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq_adjp", fill = "black",
  color_low = allc[[denom]], color_high = allc[[num]],
  label_column = "mgi_symbol", label = 10, alpha = 1.0,
  size = 4)
pp(file = "05inclusion_volcano_ma_tx/hw_p15_scn_volcano.pdf", width = 9, height = 9)
hw_p15_scn_volcano[["plot"]]
plotted <- dev.off()
hw_p15_scn_volcano[["plot"]]

hw_p15_scn_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = allc[[denom]], color_high = allc[[num]],
  p_col = "deseq_adjp", label_column = "mgi_symbol", outline = outline,
  label = 10)
pp(file = "05inclusion_volcano_ma_tx/hw_p15_scn_ma.pdf", width = 9, height = 9)
hw_p15_scn_ma[["plot"]]
plotted <- dev.off()
hw_p15_scn_ma[["plot"]]

17.10 p08_het_scn

table_name <- "p08_het_scn"
table <- inclusion_tables[["data"]][[table_name]]
num <- "p08_het_scn"
denom <- "p08_wt_scn"
hw_p08_scn_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq_adjp", fill = "black",
  color_low = allc[[denom]], color_high = allc[[num]],
  label_column = "mgi_symbol", label = 10, alpha = 1.0,
  size = 4)
pp(file = "05inclusion_volcano_ma_tx/hw_p08_scn_volcano.pdf", width = 9, height = 9)
hw_p08_scn_volcano[["plot"]]
plotted <- dev.off()
hw_p08_scn_volcano[["plot"]]

hw_p08_scn_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = allc[[denom]], color_high = allc[[num]],
  p_col = "deseq_adjp", label_column = "mgi_symbol", outline = outline,
  label = 10)
pp(file = "05inclusion_volcano_ma_tx/hw_p08_scn_ma.pdf", width = 9, height = 9)
hw_p08_scn_ma[["plot"]]
plotted <- dev.off()
hw_p08_scn_ma[["plot"]]

17.11 p15_ko_scn

table_name <- "p15_ko_scn"
table <- inclusion_tables[["data"]][[table_name]]
num <- "p15_ko_scn"
denom <- "p15_wt_scn"
kw_p15_scn_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq_adjp", fill = "black",
  color_low = allc[[denom]], color_high = allc[[num]],
  label_column = "mgi_symbol", label = 10, alpha = 1.0,
  size = 4)
pp(file = "05inclusion_volcano_ma_tx/kw_p15_scn_volcano.pdf", width = 9, height = 9)
kw_p15_scn_volcano[["plot"]]
plotted <- dev.off()
kw_p15_scn_volcano[["plot"]]

kw_p15_scn_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = allc[[denom]], color_high = allc[[num]],
  p_col = "deseq_adjp", label_column = "mgi_symbol", outline = outline,
  label = 10)
pp(file = "05inclusion_volcano_ma_tx/kw_p15_scn_ma.pdf", width = 9, height = 9)
kw_p15_scn_ma[["plot"]]
plotted <- dev.off()
kw_p15_scn_ma[["plot"]]

17.12 p08_ko_scn

table_name <- "p08_ko_scn"
table <- inclusion_tables[["data"]][[table_name]]
num <- "p08_ko_scn"
denom <- "p08_wt_scn"
kw_p08_scn_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq_adjp", fill = "black",
  color_low = allc[[denom]], color_high = allc[[num]],
  label_column = "mgi_symbol", label = 10, alpha = 1.0,
  size = 4)
pp(file = "05inclusion_volcano_ma_tx/kw_p08_scn_volcano.pdf", width = 9, height = 9)
kw_p08_scn_volcano[["plot"]]
plotted <- dev.off()
kw_p08_scn_volcano[["plot"]]

kw_p08_scn_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = allc[[denom]], color_high = allc[[num]],
  p_col = "deseq_adjp", label_column = "mgi_symbol", outline = outline,
  label = 10)
pp(file = "05inclusion_volcano_ma_tx/kw_p08_scn_ma.pdf", width = 9, height = 9)
kw_p08_scn_ma[["plot"]]
plotted <- dev.off()
kw_p08_scn_ma[["plot"]]

See the shared/unique genes in these sets.

inclusion_upsets <- upsetr_sig(inclusion_sig)
inclusion_intersects <- write_upset_groups(
  inclusion_upsets, excel = "04inclusion_comparison_tx/inclusion_gene_groups.xlsx")
## Deleting the file 04inclusion_comparison_tx/inclusion_gene_groups.xlsx before writing the tables.

17.12.1 Extract genes included for each set of contrasts

Now, using that function, pull out the gene IDs of genes we do not trust because they were too high in wt for every contrast we are likely to perform.

The following was a modified version of the inclusion function which is somewhat more restrictive.

extract_inclusions_strict <- function(inclusion_sig, inclusion_tables, inclusions, keepers,
                                      all_genes, according_to = "deseq", which = "ups") {
  retlist <- list()
  table_names <- names(inclusion_sig[[according_to]][[which]])
  for (c_num in seq_along(keepers)) {
    contrast <- names(keepers)[c_num]
    numerator_name <- keepers[[c_num]][1]
    denominator_name <- keepers[[c_num]][2]
    ## In my new branch I cleaned up the sanitizer function for contrasts so this is not needed.
    ## The following two lines are no longer needed because of the cleanups I performed.
    ##numerator_name <- gsub(x = numerator_name, pattern = "(het|ko|wt)", replacement = "_\\1_")
    ##denominator_name <- gsub(x = denominator_name, pattern = "(het|ko|wt)", replacement = "_\\1_")
    numerator_table <- inclusion_sig[[according_to]][[which]][[numerator_name]]
    numerator_genes <- rownames(numerator_table)
    denominator_table <- inclusion_sig[[according_to]][[which]][[denominator_name]]
    denominator_genes <- rownames(denominator_table)
    df_columns <- paste0("deseq_", c("logfc", "adjp", "den"))
    included_num <- inclusion_tables[["data"]][[numerator_name]][, df_columns]
    colnames(included_num) <- c("numerator_vs_wt_logfc", "numerator_vs_wt_adjp", "num_wt_mean_exprs")
    included_den <- inclusion_tables[["data"]][[denominator_name]][, df_columns]
    colnames(included_den) <- c("denominator_vs_wt_logfc", "denominator_vs_wt_adjp", "den_wt_mean_exprs")
    ## I think this is where things went wrong,
    ## compare this modified line to the original to prove it.
    included_df <- merge(included_num, included_den, by = "row.names")
    ## Previously, I did not specify the merge action, all = FALSE by default.
    ## This then will result in a difference in the rows observed
    ## included_df <- merge(included_num, included_den, by = "row.names", all = FALSE)
    rownames(included_df) <- included_df[["Row.names"]]
    included_df[["Row.names"]] <- NULL
    concatenated_genes <- c(numerator_genes, denominator_genes)
    both_gene_idx <- duplicated(concatenated_genes)
    genes_in_both <- concatenated_genes[both_gene_idx]
    message("The set of unique genes higher in ", numerator_name,
            " vs. wt is ", length(numerator_genes), ".")
    message("The set of unique genes higher in ", denominator_name,
            " vs. wt is ", length(denominator_genes), ".")
    message("The intersection of them is ", length(genes_in_both), " genes.")
    include_name <- paste0("inc_", contrast)
    include_idx <- all_genes %in% genes_in_both
    include_genes <- all_genes[include_idx]
    df_name <- paste0("df_", contrast)
    retlist[[df_name]] <- included_df
    written_inclusion <- write_xlsx(
      data = included_df,
      excel = glue("07included_strict_genes_excel_tx/{include_name}-v{ver}.xlsx"))
    retlist[[include_name]] <- include_genes
    retlist[[contrast]] <- include_genes
  }
  return(retlist)
}

This is the pre-202505 version of this function.

extract_inclusions <- function(inclusion_sig, inclusion_tables, inclusions, keepers, all_genes,
                               according_to = "deseq", which = "ups") {
  retlist <- list()
  table_names <- names(inclusion_sig[[according_to]][[which]])
  for (c_num in seq_along(keepers)) {
    contrast <- names(keepers)[c_num]
    numerator_name <- keepers[[c_num]][1]
    denominator_name <- keepers[[c_num]][2]
    ## In my new branch I cleaned up the sanitizer function for contrasts so this is not needed.
    ## The following two lines are no longer needed because of the cleanups I performed.
    ##numerator_name <- gsub(x = numerator_name, pattern = "(het|ko|wt)", replacement = "_\\1_")
    ##denominator_name <- gsub(x = denominator_name, pattern = "(het|ko|wt)", replacement = "_\\1_")
    numerator_table <- inclusion_sig[[according_to]][[which]][[numerator_name]]
    numerator_genes <- rownames(numerator_table)
    denominator_table <- inclusion_sig[[according_to]][[which]][[denominator_name]]
    denominator_genes <- rownames(denominator_table)
    df_columns <- paste0("deseq_", c("logfc", "adjp", "den"))
    included_num <- inclusion_tables[["data"]][[numerator_name]][, df_columns]
    colnames(included_num) <- c("numerator_vs_wt_logfc", "numerator_vs_wt_adjp", "num_wt_mean_exprs")
    included_den <- inclusion_tables[["data"]][[denominator_name]][, df_columns]
    colnames(included_den) <- c("denominator_vs_wt_logfc", "denominator_vs_wt_adjp", "den_wt_mean_exprs")
    included_df <- merge(included_num, included_den, by = "row.names")
    rownames(included_df) <- included_df[["Row.names"]]
    included_df[["Row.names"]] <- NULL
    include_genes <- unique(c(numerator_genes, denominator_genes))
    message("The set of unique genes higher in ", numerator_name,
            " vs. wt is ", length(numerator_genes), ".")
    message("The set of unique genes higher in ", denominator_name,
            " vs. wt is ", length(denominator_genes), ".")
    message("The unique union of them is ", length(include_genes), " genes.")
    include_name <- paste0("inc_", contrast)
    include_idx <- all_genes %in% include_genes
    include_genes <- all_genes[include_idx]
    df_name <- paste0("df_", contrast)
    retlist[[df_name]] <- included_df
    written_inclusion <- write_xlsx(data = included_df,
                                    excel = glue("included_genes_tx/{include_name}-v{ver}.xlsx"))
    retlist[[include_name]] <- include_genes
    retlist[[contrast]] <- include_genes
  }
  return(retlist)
}

18 ‘Normal’ Inclusion extraction

Here is the full set of gene IDs

all_genes <- rownames(assay(tx_pairwise_input))

In the following blocks I am including the union of genes observed higher than wt in either of the numerator or denominator for each contrast.

18.1 Time

time_inclusions <- extract_inclusions(inclusion_sig, inclusion_tables, inclusions,
                                      time_keepers, all_genes)
## The set of unique genes higher in p15_het_dlgn vs. wt is 1004.
## The set of unique genes higher in p08_het_dlgn vs. wt is 178.
## The unique union of them is 1045 genes.
## The set of unique genes higher in p15_ko_dlgn vs. wt is 1341.
## The set of unique genes higher in p08_ko_dlgn vs. wt is 517.
## The unique union of them is 1596 genes.
## The set of unique genes higher in p15_het_retina vs. wt is 213.
## The set of unique genes higher in p08_het_retina vs. wt is 537.
## The unique union of them is 605 genes.
## The set of unique genes higher in p15_ko_retina vs. wt is 66.
## The set of unique genes higher in p08_ko_retina vs. wt is 573.
## The unique union of them is 592 genes.
## The set of unique genes higher in p15_het_scn vs. wt is 6.
## The set of unique genes higher in p08_het_scn vs. wt is 11.
## The unique union of them is 17 genes.
## The set of unique genes higher in p15_ko_scn vs. wt is 2.
## The set of unique genes higher in p08_ko_scn vs. wt is 7.
## The unique union of them is 8 genes.

18.2 Location

location_inclusions <- extract_inclusions(inclusion_sig, inclusion_tables, inclusions,
                                          location_keepers, all_genes)
## The set of unique genes higher in p08_het_dlgn vs. wt is 178.
## The set of unique genes higher in p08_het_retina vs. wt is 537.
## The unique union of them is 693 genes.
## The set of unique genes higher in p15_het_dlgn vs. wt is 1004.
## The set of unique genes higher in p15_het_retina vs. wt is 213.
## The unique union of them is 1145 genes.
## The set of unique genes higher in p08_ko_dlgn vs. wt is 517.
## The set of unique genes higher in p08_ko_retina vs. wt is 573.
## The unique union of them is 1015 genes.
## The set of unique genes higher in p15_ko_dlgn vs. wt is 1341.
## The set of unique genes higher in p15_ko_retina vs. wt is 66.
## The unique union of them is 1391 genes.
## The set of unique genes higher in p08_het_scn vs. wt is 11.
## The set of unique genes higher in p08_het_retina vs. wt is 537.
## The unique union of them is 548 genes.
## The set of unique genes higher in p15_het_scn vs. wt is 6.
## The set of unique genes higher in p15_het_retina vs. wt is 213.
## The unique union of them is 219 genes.
## The set of unique genes higher in p08_ko_scn vs. wt is 7.
## The set of unique genes higher in p08_ko_retina vs. wt is 573.
## The unique union of them is 577 genes.
## The set of unique genes higher in p15_ko_scn vs. wt is 2.
## The set of unique genes higher in p15_ko_retina vs. wt is 66.
## The unique union of them is 67 genes.
## The set of unique genes higher in p08_het_dlgn vs. wt is 178.
## The set of unique genes higher in p08_het_scn vs. wt is 11.
## The unique union of them is 189 genes.
## The set of unique genes higher in p15_het_dlgn vs. wt is 1004.
## The set of unique genes higher in p15_het_scn vs. wt is 6.
## The unique union of them is 1010 genes.
## The set of unique genes higher in p08_ko_dlgn vs. wt is 517.
## The set of unique genes higher in p08_ko_scn vs. wt is 7.
## The unique union of them is 520 genes.
## The set of unique genes higher in p15_ko_dlgn vs. wt is 1341.
## The set of unique genes higher in p15_ko_scn vs. wt is 2.
## The unique union of them is 1342 genes.

18.3 Genotype

genotype_inclusions <- extract_inclusions(inclusion_sig, inclusion_tables, inclusions,
                                          genotype_keepers, all_genes)
## The set of unique genes higher in p08_ko_dlgn vs. wt is 517.
## The set of unique genes higher in p08_het_dlgn vs. wt is 178.
## The unique union of them is 589 genes.
## The set of unique genes higher in p15_ko_dlgn vs. wt is 1341.
## The set of unique genes higher in p15_het_dlgn vs. wt is 1004.
## The unique union of them is 1457 genes.
## The set of unique genes higher in p08_ko_retina vs. wt is 573.
## The set of unique genes higher in p08_het_retina vs. wt is 537.
## The unique union of them is 756 genes.
## The set of unique genes higher in p15_ko_retina vs. wt is 66.
## The set of unique genes higher in p15_het_retina vs. wt is 213.
## The unique union of them is 230 genes.
## The set of unique genes higher in p08_ko_scn vs. wt is 7.
## The set of unique genes higher in p08_het_scn vs. wt is 11.
## The unique union of them is 17 genes.
## The set of unique genes higher in p15_ko_scn vs. wt is 2.
## The set of unique genes higher in p15_het_scn vs. wt is 6.
## The unique union of them is 7 genes.

19 The strict ‘inclusion’ set

19.1 Time

time_inclusions_strict <- extract_inclusions_strict(inclusion_sig, inclusion_tables, inclusions,
                                                    time_keepers, all_genes)
## The set of unique genes higher in p15_het_dlgn vs. wt is 1004.
## The set of unique genes higher in p08_het_dlgn vs. wt is 178.
## The intersection of them is 137 genes.
## The set of unique genes higher in p15_ko_dlgn vs. wt is 1341.
## The set of unique genes higher in p08_ko_dlgn vs. wt is 517.
## The intersection of them is 262 genes.
## The set of unique genes higher in p15_het_retina vs. wt is 213.
## The set of unique genes higher in p08_het_retina vs. wt is 537.
## The intersection of them is 145 genes.
## The set of unique genes higher in p15_ko_retina vs. wt is 66.
## The set of unique genes higher in p08_ko_retina vs. wt is 573.
## The intersection of them is 47 genes.
## The set of unique genes higher in p15_het_scn vs. wt is 6.
## The set of unique genes higher in p08_het_scn vs. wt is 11.
## The intersection of them is 0 genes.
## The set of unique genes higher in p15_ko_scn vs. wt is 2.
## The set of unique genes higher in p08_ko_scn vs. wt is 7.
## The intersection of them is 1 genes.

19.2 Location

location_inclusions_strict <- extract_inclusions_strict(inclusion_sig, inclusion_tables, inclusions,
                                                        location_keepers, all_genes)
## The set of unique genes higher in p08_het_dlgn vs. wt is 178.
## The set of unique genes higher in p08_het_retina vs. wt is 537.
## The intersection of them is 22 genes.
## The set of unique genes higher in p15_het_dlgn vs. wt is 1004.
## The set of unique genes higher in p15_het_retina vs. wt is 213.
## The intersection of them is 72 genes.
## The set of unique genes higher in p08_ko_dlgn vs. wt is 517.
## The set of unique genes higher in p08_ko_retina vs. wt is 573.
## The intersection of them is 75 genes.
## The set of unique genes higher in p15_ko_dlgn vs. wt is 1341.
## The set of unique genes higher in p15_ko_retina vs. wt is 66.
## The intersection of them is 16 genes.
## The set of unique genes higher in p08_het_scn vs. wt is 11.
## The set of unique genes higher in p08_het_retina vs. wt is 537.
## The intersection of them is 0 genes.
## The set of unique genes higher in p15_het_scn vs. wt is 6.
## The set of unique genes higher in p15_het_retina vs. wt is 213.
## The intersection of them is 0 genes.
## The set of unique genes higher in p08_ko_scn vs. wt is 7.
## The set of unique genes higher in p08_ko_retina vs. wt is 573.
## The intersection of them is 3 genes.
## The set of unique genes higher in p15_ko_scn vs. wt is 2.
## The set of unique genes higher in p15_ko_retina vs. wt is 66.
## The intersection of them is 1 genes.
## The set of unique genes higher in p08_het_dlgn vs. wt is 178.
## The set of unique genes higher in p08_het_scn vs. wt is 11.
## The intersection of them is 0 genes.
## The set of unique genes higher in p15_het_dlgn vs. wt is 1004.
## The set of unique genes higher in p15_het_scn vs. wt is 6.
## The intersection of them is 0 genes.
## The set of unique genes higher in p08_ko_dlgn vs. wt is 517.
## The set of unique genes higher in p08_ko_scn vs. wt is 7.
## The intersection of them is 4 genes.
## The set of unique genes higher in p15_ko_dlgn vs. wt is 1341.
## The set of unique genes higher in p15_ko_scn vs. wt is 2.
## The intersection of them is 1 genes.

19.3 Genotype

genotype_inclusions_strict <- extract_inclusions_strict(inclusion_sig, inclusion_tables, inclusions,
                                                        genotype_keepers, all_genes)
## The set of unique genes higher in p08_ko_dlgn vs. wt is 517.
## The set of unique genes higher in p08_het_dlgn vs. wt is 178.
## The intersection of them is 106 genes.
## The set of unique genes higher in p15_ko_dlgn vs. wt is 1341.
## The set of unique genes higher in p15_het_dlgn vs. wt is 1004.
## The intersection of them is 888 genes.
## The set of unique genes higher in p08_ko_retina vs. wt is 573.
## The set of unique genes higher in p08_het_retina vs. wt is 537.
## The intersection of them is 354 genes.
## The set of unique genes higher in p15_ko_retina vs. wt is 66.
## The set of unique genes higher in p15_het_retina vs. wt is 213.
## The intersection of them is 49 genes.
## The set of unique genes higher in p08_ko_scn vs. wt is 7.
## The set of unique genes higher in p08_het_scn vs. wt is 11.
## The intersection of them is 1 genes.
## The set of unique genes higher in p15_ko_scn vs. wt is 2.
## The set of unique genes higher in p15_het_scn vs. wt is 6.
## The intersection of them is 1 genes.

19.3.1 Check vs Theresa’s filter

Up above Theresa performed a 0.25 log2FC and 0.05 adjp filter which provided a set of 2,640 genes observed higher in the p08 het retinas vs. wt retinas. I should see that in this inclusion_sig data structure.

There is an important caveat though: in Theresa’s filter above, she did a DE of only the retina samples but I did all samples. I expected that this would result in basically the same result (I actually assumed I would get a few more genes), but instead it appears to have retrieved a significantly smaller number of genes (about 1/2, happily they pretty much all appear in the previous filter). As a result, I am going to try relaxing my constraints slightly to see if I can recapitulate her filter (which would match Theresa’s later filter, though I guess that in turn will lead to a smaller set of genes compared to her later, relaxed 0.1 filter).

comparison <- inclusion_sig[["deseq"]][["ups"]][["p08_het_retina"]]
comp <- list(
  "taa" = taa_keepers,
  "new" = rownames(comparison))
test_comparison <- Vennerable::Venn(comp)
Vennerable::plot(test_comparison)

I want to have a little function which, given a contrast of interest, will extract the gene sets which should be included/excluded given the above.

write_all_cp <- function(all_cp, prefix = "12", suffix = "") {
  all_written <- list()
  for (g in seq_len(length(all_cp))) {
    name <- names(all_cp)[g]
    datum <- all_cp[[name]]
    filename <- glue("{prefix}enrichment_excel_tx/{name}_cprofiler{suffix}-v{ver}.xlsx")
    written <- sm(write_cp_data(datum, excel = filename))
    all_written[[g]] <- written
  }
  return(all_written)
}
write_all_gp <- function(all_gp, prefix = "13", suffix = "") {
  all_written <- list()
  for (g in seq_len(length(all_gp))) {
    name <- names(all_gp)[g]
    datum <- all_gp[[name]]
    filename <- glue("{prefix}enrichment_excel_tx/{name}_gprofiler{suffix}-v{ver}.xlsx")
    written <- sm(write_gprofiler_data(datum, excel = filename))
    all_written[[g]] <- written
  }
  return(all_written)
}
write_all_en <- function(all_en, prefix = "14", suffix = "") {
  all_written <- list()
  for (e in seq_len(length(all_en))) {
    name <- names(all_en)[e]
    datum <- all_en[[name]]
    filename <- glue("{prefix}enrichment_excel_tx/{name}_enricher{suffix}-v{ver}.xlsx")
    written <- sm(write_enricher_data(datum, excel = filename))
    all_written[[e]] <- written
  }
  return(all_written)
}

19.3.2 Extract genes included for each set of contrasts

Now, using that function, pull out the gene IDs of genes we do not trust because they were too high in wt for every contrast we are likely to perform.

all_genes <- rownames(assay(tx_pairwise_input))
time_inclusions <- extract_inclusions(inclusion_sig, inclusion_tables, inclusions,
                                      time_keepers, all_genes)
## The set of unique genes higher in p15_het_dlgn vs. wt is 1004.
## The set of unique genes higher in p08_het_dlgn vs. wt is 178.
## The unique union of them is 1045 genes.
## Deleting the file included_genes_tx/inc_t_het_dlgn-v20260812.xlsx before writing the tables.
## The set of unique genes higher in p15_ko_dlgn vs. wt is 1341.
## The set of unique genes higher in p08_ko_dlgn vs. wt is 517.
## The unique union of them is 1596 genes.
## Deleting the file included_genes_tx/inc_t_ko_dlgn-v20260812.xlsx before writing the tables.
## The set of unique genes higher in p15_het_retina vs. wt is 213.
## The set of unique genes higher in p08_het_retina vs. wt is 537.
## The unique union of them is 605 genes.
## Deleting the file included_genes_tx/inc_t_het_retina-v20260812.xlsx before writing the tables.
## The set of unique genes higher in p15_ko_retina vs. wt is 66.
## The set of unique genes higher in p08_ko_retina vs. wt is 573.
## The unique union of them is 592 genes.
## Deleting the file included_genes_tx/inc_t_ko_retina-v20260812.xlsx before writing the tables.
## The set of unique genes higher in p15_het_scn vs. wt is 6.
## The set of unique genes higher in p08_het_scn vs. wt is 11.
## The unique union of them is 17 genes.
## Deleting the file included_genes_tx/inc_t_het_scn-v20260812.xlsx before writing the tables.
## The set of unique genes higher in p15_ko_scn vs. wt is 2.
## The set of unique genes higher in p08_ko_scn vs. wt is 7.
## The unique union of them is 8 genes.
## Deleting the file included_genes_tx/inc_t_ko_scn-v20260812.xlsx before writing the tables.
location_inclusions <- extract_inclusions(inclusion_sig, inclusion_tables, inclusions,
                                          location_keepers, all_genes)
## The set of unique genes higher in p08_het_dlgn vs. wt is 178.
## The set of unique genes higher in p08_het_retina vs. wt is 537.
## The unique union of them is 693 genes.
## Deleting the file included_genes_tx/inc_dr_p08_het-v20260812.xlsx before writing the tables.
## The set of unique genes higher in p15_het_dlgn vs. wt is 1004.
## The set of unique genes higher in p15_het_retina vs. wt is 213.
## The unique union of them is 1145 genes.
## Deleting the file included_genes_tx/inc_dr_p15_het-v20260812.xlsx before writing the tables.
## The set of unique genes higher in p08_ko_dlgn vs. wt is 517.
## The set of unique genes higher in p08_ko_retina vs. wt is 573.
## The unique union of them is 1015 genes.
## Deleting the file included_genes_tx/inc_dr_p08_ko-v20260812.xlsx before writing the tables.
## The set of unique genes higher in p15_ko_dlgn vs. wt is 1341.
## The set of unique genes higher in p15_ko_retina vs. wt is 66.
## The unique union of them is 1391 genes.
## Deleting the file included_genes_tx/inc_dr_p15_ko-v20260812.xlsx before writing the tables.
## The set of unique genes higher in p08_het_scn vs. wt is 11.
## The set of unique genes higher in p08_het_retina vs. wt is 537.
## The unique union of them is 548 genes.
## Deleting the file included_genes_tx/inc_sr_p08_het-v20260812.xlsx before writing the tables.
## The set of unique genes higher in p15_het_scn vs. wt is 6.
## The set of unique genes higher in p15_het_retina vs. wt is 213.
## The unique union of them is 219 genes.
## Deleting the file included_genes_tx/inc_sr_p15_het-v20260812.xlsx before writing the tables.
## The set of unique genes higher in p08_ko_scn vs. wt is 7.
## The set of unique genes higher in p08_ko_retina vs. wt is 573.
## The unique union of them is 577 genes.
## Deleting the file included_genes_tx/inc_sr_p08_ko-v20260812.xlsx before writing the tables.
## The set of unique genes higher in p15_ko_scn vs. wt is 2.
## The set of unique genes higher in p15_ko_retina vs. wt is 66.
## The unique union of them is 67 genes.
## Deleting the file included_genes_tx/inc_sr_p15_ko-v20260812.xlsx before writing the tables.
## The set of unique genes higher in p08_het_dlgn vs. wt is 178.
## The set of unique genes higher in p08_het_scn vs. wt is 11.
## The unique union of them is 189 genes.
## Deleting the file included_genes_tx/inc_ds_p08_het-v20260812.xlsx before writing the tables.
## The set of unique genes higher in p15_het_dlgn vs. wt is 1004.
## The set of unique genes higher in p15_het_scn vs. wt is 6.
## The unique union of them is 1010 genes.
## Deleting the file included_genes_tx/inc_ds_p15_het-v20260812.xlsx before writing the tables.
## The set of unique genes higher in p08_ko_dlgn vs. wt is 517.
## The set of unique genes higher in p08_ko_scn vs. wt is 7.
## The unique union of them is 520 genes.
## Deleting the file included_genes_tx/inc_ds_p08_ko-v20260812.xlsx before writing the tables.
## The set of unique genes higher in p15_ko_dlgn vs. wt is 1341.
## The set of unique genes higher in p15_ko_scn vs. wt is 2.
## The unique union of them is 1342 genes.
## Deleting the file included_genes_tx/inc_ds_p15_ko-v20260812.xlsx before writing the tables.
genotype_inclusions <- extract_inclusions(inclusion_sig, inclusion_tables, inclusions,
                                          genotype_keepers, all_genes)
## The set of unique genes higher in p08_ko_dlgn vs. wt is 517.
## The set of unique genes higher in p08_het_dlgn vs. wt is 178.
## The unique union of them is 589 genes.
## Deleting the file included_genes_tx/inc_kh_p08_dlgn-v20260812.xlsx before writing the tables.
## The set of unique genes higher in p15_ko_dlgn vs. wt is 1341.
## The set of unique genes higher in p15_het_dlgn vs. wt is 1004.
## The unique union of them is 1457 genes.
## Deleting the file included_genes_tx/inc_kh_p15_dlgn-v20260812.xlsx before writing the tables.
## The set of unique genes higher in p08_ko_retina vs. wt is 573.
## The set of unique genes higher in p08_het_retina vs. wt is 537.
## The unique union of them is 756 genes.
## Deleting the file included_genes_tx/inc_kh_p08_retina-v20260812.xlsx before writing the tables.
## The set of unique genes higher in p15_ko_retina vs. wt is 66.
## The set of unique genes higher in p15_het_retina vs. wt is 213.
## The unique union of them is 230 genes.
## Deleting the file included_genes_tx/inc_kh_p15_retina-v20260812.xlsx before writing the tables.
## The set of unique genes higher in p08_ko_scn vs. wt is 7.
## The set of unique genes higher in p08_het_scn vs. wt is 11.
## The unique union of them is 17 genes.
## Deleting the file included_genes_tx/inc_kh_p08_scn-v20260812.xlsx before writing the tables.
## The set of unique genes higher in p15_ko_scn vs. wt is 2.
## The set of unique genes higher in p15_het_scn vs. wt is 6.
## The unique union of them is 7 genes.
## Deleting the file included_genes_tx/inc_kh_p15_scn-v20260812.xlsx before writing the tables.

19.4 Perform the DE analyses and exclude the target genes

19.4.1 Genotype

genotype_de <- all_pairwise(tx_pairwise_input, filter = TRUE, model_fstring = default_fstring,
                            keepers = genotype_keepers, model_svs = "svaseq")
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
## Removing 52544 low-count genes (13339 remaining).
## Basic step 0/3: Normalizing data.
## Basic step 0/3: Converting data.
## I think this is failing? SummarizedExperiment
## Basic step 0/3: Transforming data.
## Setting 250859 entries to zero.
## This received a matrix of SVs.
## converting counts to integer mode
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## conditions
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
## conditions
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
## conditions
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2

genotype_de
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 6 comparisons.

19.4.2 Location

location_de <- all_pairwise(tx_pairwise_input, filter = TRUE, model_fstring = default_fstring,
                            keepers = location_keepers, model_svs = "svaseq")
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
## Removing 52544 low-count genes (13339 remaining).
## Basic step 0/3: Normalizing data.
## Basic step 0/3: Converting data.
## I think this is failing? SummarizedExperiment
## Basic step 0/3: Transforming data.
## Setting 250859 entries to zero.
## This received a matrix of SVs.
## converting counts to integer mode
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## conditions
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
## conditions
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
## conditions
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2

location_de
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 12 comparisons.

19.4.3 Time

time_de <- all_pairwise(tx_pairwise_input, filter = TRUE, model_fstring = default_fstring,
                        keepers = time_keepers, model_svs = "svaseq")
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
## Removing 52544 low-count genes (13339 remaining).
## Basic step 0/3: Normalizing data.
## Basic step 0/3: Converting data.
## I think this is failing? SummarizedExperiment
## Basic step 0/3: Transforming data.
## Setting 250859 entries to zero.
## This received a matrix of SVs.
## converting counts to integer mode
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## conditions
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
## conditions
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
## conditions
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2

time_de
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 6 comparisons.

It is near here when the computer sometimes fails with no more tempfiles. In another window I am messing with tempfile() in R to try to understand where it is going off the rails…

19.5 Extract the relevant tables and include genes lower in wt

19.5.1 Genotype contrasts

I will start with the tables and no inclusions so I can check my work.

In this first block I will explain a little more thoroughly what is going on:

  1. Dump the full table of the contrasts I defined above comparing the 3 genotypes across time/location.
  2. Iterate over each of those contrasts and do the following:
    1. Extract the name of the contrast, ‘kh_p08_dlgn’ for example
    2. Yank out that specific entry from the keeper list and its name
    3. Yank out the corresponding set of genes to include from the inclusions data structure.
    4. Create a filename given the name in (a) above and the logFC cutoff chosen for the inclusions (I am assuming we may change this)
    5. Given (b), (c), and (d), extract the corresponding table from the differential expression analysis and include the appropriate genes.
    FIXME: my gprofiler function just assumes human and so if passed mmusculus will incorrectly attempt to connect to non-existant databases. Let us fix that now.
genotype_tables_full <- combine_de_tables(
  genotype_de, keepers = genotype_keepers, label_column = label_column,
  fancy = TRUE,
  excel = glue("08full_contrasts_excel_tx/genotype_full_tables-v{ver}.xlsx"))
## Looking for subscript invalid names, end of extract_keepers.
genotype_tables_full
## A set of combined differential expression results.
##                             table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1     p08_ko_dlgn_vs_p08_het_dlgn          27            11          57            45          35            46
## 2     p15_ko_dlgn_vs_p15_het_dlgn          35             1          69            16          35            11
## 3 p08_ko_retina_vs_p08_het_retina           9             2          30            30           3             2
## 4 p15_ko_retina_vs_p15_het_retina           3             6          30            41           1             4
## 5       p08_ko_scn_vs_p08_het_scn           5            19          43            88          32            20
## 6       p15_ko_scn_vs_p15_het_scn           4            18          29            57           9             6
## Plot describing unique/shared genes in a differential expression table.

genotype_sig_full <- extract_significant_genes(
  genotype_tables_full, according_to = "deseq",
  excel = glue("08full_contrasts_excel_tx/genotype_full_sig-v{ver}.xlsx"))
genotype_sig_full
## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##               deseq_up deseq_down
## kh_p08_dlgn         27         11
## kh_p15_dlgn         35          1
## kh_p08_retina        9          2
## kh_p15_retina        3          6
## kh_p08_scn           5         19
## kh_p15_scn           4         18

19.5.2 Search Enrichment of these sets

In this run, we will search the full set of genes, next we will only do the inclusions.

genotype_full_gp <- all_gprofiler(genotype_sig_full, species = "mmusculus",
                                  excel = "09full_contrasts_enrich_tx/genotype_full_gprofiler.xlsx")
genotype_full_cp <- all_cprofiler(genotype_sig_full, genotype_tables_full,
                                  orgdb = "org.Mm.eg.db", go_level = go_level, organism = "mouse",
                                  orgdb_from = orgdb_from, max_groupsize = max_groupsize,
                                  excel = "09full_contrasts_enrich_tx/genotype_full_cprofiler.xlsx")
## There are 7 genes deemed significant out of 4708.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (7.68% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (7.88% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (7.68% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (7.68% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (7.68% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Deleting the file 09full_contrasts_enrich_tx/genotype_full_cprofiler_kh_p08_dlgn_up.xlsx before writing the tables.
## There are 2 genes deemed significant out of 4708.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (7.68% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## no term enriched under specific pvalueCutoff...
## --> No gene can be mapped....
## --> Expected input gene ID: 18642,94284,19063,73458,26897,69080
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (7.88% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (7.68% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (7.68% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (7.68% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Deleting the file 09full_contrasts_enrich_tx/genotype_full_cprofiler_kh_p08_dlgn_down.xlsx before writing the tables.
## There are 17 genes deemed significant out of 4708.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (7.24% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : For some pathways, in reality P-values are less than
## 1e-10. You can set the `eps` argument to zero for better estimation.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (7.04% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (7.24% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (7.24% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (7.24% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Deleting the file 09full_contrasts_enrich_tx/genotype_full_cprofiler_kh_p15_dlgn_up.xlsx before writing the tables.
## Error in sig_genes_namedf[[orgdb_to]] : subscript out of bounds
## There are 3 genes deemed significant out of 4708.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (7.46% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (7.81% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (7.46% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (7.46% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (7.46% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Deleting the file 09full_contrasts_enrich_tx/genotype_full_cprofiler_kh_p08_retina_up.xlsx before writing the tables.
## dimensionality reduction failed with provided drfun; falling back to stats::cmdscale.
## Error in sig_genes_namedf[[orgdb_to]] : subscript out of bounds
## There are 2 genes deemed significant out of 4708.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (8.25% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (8.57% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (8.25% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (8.25% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (8.25% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Deleting the file 09full_contrasts_enrich_tx/genotype_full_cprofiler_kh_p15_retina_up.xlsx before writing the tables.
## dimensionality reduction failed with provided drfun; falling back to stats::cmdscale.
## There are 2 genes deemed significant out of 4708.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (8.25% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (8.57% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (8.25% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (8.25% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## --> No gene can be mapped....
## --> Expected input gene ID: 83699,91860,57169,6300,1281,196968
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (8.25% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Deleting the file 09full_contrasts_enrich_tx/genotype_full_cprofiler_kh_p15_retina_down.xlsx before writing the tables.
## There are 1 genes deemed significant out of 4708.
## There are 1 entries which match the search string: Mus musculus.
## No gene sets have size between 5 and 500 ...
## --> return NULL...
## No gene sets have size between 5 and 500 ...
## --> return NULL...
## No gene sets have size between 5 and 500 ...
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (9.21% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## no term enriched under specific pvalueCutoff...
## --> No gene can be mapped....
## --> Expected input gene ID: 13808,232449,75731,433182,68801,14635
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (9.48% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## --> No gene can be mapped....
## --> Expected input gene ID: 319625,20980,12499,56690,212555,20511
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (9.21% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## No gene sets have size between 5 and 2000 ...
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (9.21% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (9.21% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Deleting the file 09full_contrasts_enrich_tx/genotype_full_cprofiler_kh_p08_scn_up.xlsx before writing the tables.
## There are 2 genes deemed significant out of 4708.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (9.21% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (9.48% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (9.21% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (9.21% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (9.21% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Deleting the file 09full_contrasts_enrich_tx/genotype_full_cprofiler_kh_p08_scn_down.xlsx before writing the tables.
## Error in sig_genes_namedf[[orgdb_to]] : subscript out of bounds
## There are 7 genes deemed significant out of 4708.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (7.55% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (7.81% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (7.55% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (7.55% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (7.55% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Deleting the file 09full_contrasts_enrich_tx/genotype_full_cprofiler_kh_p15_scn_down.xlsx before writing the tables.
genotype_full_upset <- upsetr_sig(genotype_sig_full)
genotype_full_intersects <- write_upset_groups(genotype_full_upset,
                                               excel = "09full_contrasts_intersections_tx/genotype_full_gene_groups.xlsx")
## Deleting the file 09full_contrasts_intersections_tx/genotype_full_gene_groups.xlsx before writing the tables.

Now separate the various genotype tables and perform the inclusions of the genes with relatively low wt values.

19.5.2.1 Extract filtered genes and pass to gprofiler2/clusterprofiler

genotype_tables <- list()
genotype_sig <- list()
genotype_gp <- list()
genotype_cp <- list()
genotype_en <- list()
for (k in seq_along(genotype_keepers)) {
  name <- names(genotype_keepers)[k]
  message("Examining ", name)
  keeper <- genotype_keepers[name]
  include_name <- paste0("inc_", name)
  include_df_name <- paste0("df_", name)
  include_df <- genotype_inclusions[[include_df_name]]
  includes <- genotype_inclusions[[include_name]]
  summary(rownames(genotype_sig_full[["deseq"]][["ups"]][[name]]) %in% includes)
  include_filename <- glue("10genotype_contrasts_excel_tx/{name}_including_wt_{lfc_cutoff}_decreased_table-v{ver}.xlsx")
  include_sig_filename <- glue("10genotype_contrasts_excel_tx/{name}_including_wt_{lfc_cutoff}_decreased_sig-v{ver}.xlsx")
  genotype_tables[[name]] <- combine_de_tables(
    genotype_de, extra_annot = include_df,
    keepers = keeper, label_column = label_column,
    excel = include_filename, wanted_genes = includes)
  print(genotype_tables[[name]])
  genotype_sig[[name]] <- extract_significant_genes(
    genotype_tables[[name]], according_to = "deseq",
    excel = include_sig_filename)
  print(genotype_sig[[name]])
  num_rows <- nrow(genotype_sig[[name]][["deseq"]][["ups"]][[name]]) +
    nrow(genotype_sig[[name]][["deseq"]][["downs"]][[name]])
  message("There are ", num_rows, " significant up and down genes.")
  if (num_rows >= 10) {
    message("Performing gprofiler/clusterProfiler.")
    genotype_gp[[name]] <- all_gprofiler(genotype_sig[[name]], species = "mmusculus")
    genotype_cp[[name]] <- all_cprofiler(
      genotype_sig[[name]], genotype_tables[[name]],
      orgdb = "org.Mm.eg.db", orgdb_from = orgdb_from,
      go_level = go_level, max_groupsize = max_groupsize, organism = "mouse")
    #if (!is.null(get0("m2_gsc"))) {
    #  genotype_en[[name]] <- all_enricher(genotype_sig[[name]], gsc = m2_gsc,
    #                                      orgdb = "org.Mm.eg.db", from = "ENSEMBL", to = "SYMBOL")
    #}
    gp_written <- write_all_gp(genotype_gp[[name]], prefix = "11")
    cp_written <- write_all_cp(genotype_cp[[name]], prefix = "11")
    #en_written <- write_all_en(genotype_en[[name]])
  } else {
    warning("There are less than 10 genes up and down in the ", name, " comparison.")
    message("There are less than 10 genes up and down in the ", name, " comparison.")
  }
}
## Examining kh_p08_dlgn
## Looking for subscript invalid names, end of extract_keepers.
## A set of combined differential expression results.
##                         table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p08_ko_dlgn_vs_p08_het_dlgn          22             1          21             0           8             0
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.

## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##             deseq_up deseq_down
## kh_p08_dlgn       22          1

## There are 23 significant up and down genes.
## Performing gprofiler/clusterProfiler.
## There are 5 genes deemed significant out of 291.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.37% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.38% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.37% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.37% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.37% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Deleting the file excel/all_cp_kh_p08_dlgn_up.xlsx before writing the tables.
## Error in sig_genes_namedf[[orgdb_to]] : subscript out of bounds
## Examining kh_p15_dlgn
## Looking for subscript invalid names, end of extract_keepers.
## A set of combined differential expression results.
##                         table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p15_ko_dlgn_vs_p15_het_dlgn          33             0          48             0           2             0
## Only kh_p15_dlgn_up has information, cannot create an UpSet.
## Plot describing unique/shared genes in a differential expression table.
## NULL
## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##             deseq_up deseq_down
## kh_p15_dlgn       33          0

## There are 33 significant up and down genes.
## Performing gprofiler/clusterProfiler.
## There are 17 genes deemed significant out of 616.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.11% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : For some of the pathways the P-values were likely
## overestimated. For such pathways log2err is set to NA.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.16% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.11% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : There were 2 pathways for which P-values were not
## calculated properly due to unbalanced (positive and negative) gene-level statistic values. For such pathways pval, padj, NES, log2err are set
## to NA. You can try to increase the value of the argument nPermSimple (for example set it nPermSimple = 10000)
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : For some of the pathways the P-values were likely
## overestimated. For such pathways log2err is set to NA.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.11% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : For some pathways, in reality P-values are less than
## 1e-10. You can set the `eps` argument to zero for better estimation.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.11% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : There were 1 pathways for which P-values were not
## calculated properly due to unbalanced (positive and negative) gene-level statistic values. For such pathways pval, padj, NES, log2err are set
## to NA. You can try to increase the value of the argument nPermSimple (for example set it nPermSimple = 10000)
## leading edge analysis...
## done...
## Deleting the file excel/all_cp_kh_p15_dlgn_up.xlsx before writing the tables.
## Examining kh_p08_retina
## Looking for subscript invalid names, end of extract_keepers.
## A set of combined differential expression results.
##                             table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p08_ko_retina_vs_p08_het_retina           5             1           6             1           2             1
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.

## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##               deseq_up deseq_down
## kh_p08_retina        5          1

## There are 6 significant up and down genes.
## Warning: There are less than 10 genes up and down in the kh_p08_retina comparison.
## There are less than 10 genes up and down in the kh_p08_retina comparison.
## Examining kh_p15_retina
## Looking for subscript invalid names, end of extract_keepers.
## A set of combined differential expression results.
##                             table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p15_ko_retina_vs_p15_het_retina           2             5           2            10           0             3
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.

## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##               deseq_up deseq_down
## kh_p15_retina        2          5

## There are 7 significant up and down genes.
## Warning: There are less than 10 genes up and down in the kh_p15_retina comparison.
## There are less than 10 genes up and down in the kh_p15_retina comparison.
## Examining kh_p08_scn
## Looking for subscript invalid names, end of extract_keepers.
## The result table is too small for meaningful comparisons.
## The first table has only: 17.
## A set of combined differential expression results.
##                       table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p08_ko_scn_vs_p08_het_scn           0             4           1             4           0             1
## Only kh_p08_scn_down has information, cannot create an UpSet.
## Plot describing unique/shared genes in a differential expression table.
## NULL
## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##            deseq_up deseq_down
## kh_p08_scn        0          4

## There are 4 significant up and down genes.
## Warning: There are less than 10 genes up and down in the kh_p08_scn comparison.
## There are less than 10 genes up and down in the kh_p08_scn comparison.
## Examining kh_p15_scn
## Looking for subscript invalid names, end of extract_keepers.
## The result table is too small for meaningful comparisons.
## The first table has only: 7.
## A set of combined differential expression results.
##                       table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p15_ko_scn_vs_p15_het_scn           0             4           0             3           0             0
## Only kh_p15_scn_down has information, cannot create an UpSet.
## Plot describing unique/shared genes in a differential expression table.
## NULL
## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##            deseq_up deseq_down
## kh_p15_scn        0          4

## There are 4 significant up and down genes.
## Warning: There are less than 10 genes up and down in the kh_p15_scn comparison.
## There are less than 10 genes up and down in the kh_p15_scn comparison.

Plot the results separately.

for (k in seq_along(genotype_keepers)) {
  name <- names(genotype_keepers)[k]
  message("Examining ", name)
  keeper <- genotype_keepers[name]
  include_name <- paste0("inc_", name)
  include_df_name <- paste0("df_", name)
  include_df <- genotype_inclusions[[include_df_name]]
  includes <- genotype_inclusions[[include_name]]
  summary(rownames(genotype_sig_full[["deseq"]][["ups"]][[name]]) %in% includes)
  num_rows <- nrow(genotype_sig[[name]][["deseq"]][["ups"]][[name]]) +
    nrow(genotype_sig[[name]][["deseq"]][["downs"]][[name]])
  nrow(genotype_sig[[name]][["deseq"]][["ups"]][[name]])
  nrow(genotype_sig[[name]][["deseq"]][["downs"]][[name]])
  message("There are ", num_rows, " significant up and down genes.")
  ## #1 is up and #2 is down, avoiding typeos here.
  num_objects <- length(genotype_cp[[name]])
  if (num_objects == 0) {
    warning("Something went wrong in all_cprofiler.")
  } else {
    upp <- which(grepl(x = names(genotype_cp[[name]]), pattern = "_up$"))
    downp <- which(grepl(x = names(genotype_cp[[name]]), pattern = "_down$"))
    if (length(upp) > 0) {
      mf_sig <- genotype_cp[[name]][[upp]][["go_data"]][["MF_enrich"]]
      cc_sig <- genotype_cp[[name]][[upp]][["go_data"]][["CC_enrich"]]
      bp_sig <- genotype_cp[[name]][[upp]][["go_data"]][["BP_enrich"]]
      mf_plots_up <- plot_enrichresult(mf_sig)
      mf_tree_up_filename <- glue("12clusterProfiler_plots_tx/{name}_up_mf_sig_tree.pdf")
      pp(file = mf_tree_up_filename)
      try(print(mf_plots_up[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      mf_bar_up_filename <- glue("12clusterProfiler_plots_tx/{name}_up_mf_sig_bar.pdf")
      pp(file = mf_bar_up_filename)
      try(print(mf_plots_up[["bar"]]), silent = TRUE)
      plotted <- dev.off()
      cc_plots_up <- plot_enrichresult(cc_sig, showCategory = go_categories)
      cc_tree_up_filename <- glue("12clusterProfiler_plots_tx/{name}_up_cc_sig_tree.pdf")
      pp(file = cc_tree_up_filename)
      try(print(cc_plots_up[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      cc_bar_up_filename <- glue("12clusterProfiler_plots_tx/{name}_up_cc_sig_bar.pdf")
      pp(file = cc_bar_up_filename)
      try(print(cc_plots_up[["bar"]]), silent = TRUE)
      plotted <- dev.off()
      bp_plots_up <- plot_enrichresult(bp_sig, showCategory = go_categories)
      bp_tree_up_filename <- glue("12clusterProfiler_plots_tx/{name}_up_bp_sig_tree.pdf")
      pp(file = bp_tree_up_filename)
      try(print(bp_plots_up[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      bp_plots_up <- plot_enrichresult(bp_sig, showCategory = go_categories)
      bp_bar_up_filename <- glue("12clusterProfiler_plots_tx/{name}_up_bp_sig_bar.pdf")
      pp(file = bp_bar_up_filename)
      try(print(bp_plots_up[["bar"]]), silent = TRUE)
      plotted <- dev.off()
    }
    if (length(downp) > 0) {
      mf_sig <- genotype_cp[[name]][[downp]][["go_data"]][["MF_enrich"]]
      cc_sig <- genotype_cp[[name]][[downp]][["go_data"]][["CC_enrich"]]
      bp_sig <- genotype_cp[[name]][[downp]][["go_data"]][["BP_enrich"]]
      mf_plots_down <- plot_enrichresult(mf_sig, showCategory = go_categories)
      mf_tree_down_filename <- glue("12clusterProfiler_plots_tx/{name}_down_mf_sig_tree.pdf")
      pp(file = mf_tree_down_filename)
      try(print(mf_plots_down[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      mf_bar_down_filename <- glue("12clusterProfiler_plots_tx/{name}_down_mf_sig_bar.pdf")
      pp(file = mf_bar_down_filename)
      try(print(mf_plots_down[["bar"]]), silent = TRUE)
      plotted <- dev.off()
      cc_plots_down <- plot_enrichresult(cc_sig, showCategory = go_categories)
      cc_tree_down_filename <- glue("12clusterProfiler_plots_tx/{name}_down_cc_sig_tree.pdf")
      pp(file = cc_tree_down_filename)
      try(print(cc_plots_down[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      cc_bar_down_filename <- glue("12clusterProfiler_plots_tx/{name}_down_cc_sig_bar.pdf")
      pp(file = cc_bar_down_filename)
      try(print(cc_plots_down[["bar"]]), silent = TRUE)
      plotted <- dev.off()
      bp_plots_down <- plot_enrichresult(bp_sig, showCategory = go_categories)
      bp_tree_down_filename <- glue("12clusterProfiler_plots_tx/{name}_down_bp_sig_tree.pdf")
      pp(file = bp_tree_down_filename)
      try(print(bp_plots_down[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      bp_plots_down <- plot_enrichresult(bp_sig, cateogories = go_categories)
      bp_bar_down_filename <- glue("12clusterProfiler_plots_tx/{name}_down_bp_sig_bar.pdf")
      pp(file = bp_bar_down_filename)
      try(print(bp_plots_down[["bar"]]), silent = TRUE)
      plotted <- dev.off()
    }
  }
}
## Examining kh_p08_dlgn
## There are 23 significant up and down genes.
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in pp(file = mf_tree_up_filename): The directory: 12clusterProfiler_plots_tx does not exist, will attempt to create it.
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Examining kh_p15_dlgn
## There are 33 significant up and down genes.
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Examining kh_p08_retina
## There are 6 significant up and down genes.
## Warning: Something went wrong in all_cprofiler.
## Examining kh_p15_retina
## There are 7 significant up and down genes.
## Warning: Something went wrong in all_cprofiler.
## Examining kh_p08_scn
## There are 4 significant up and down genes.
## Warning: Something went wrong in all_cprofiler.
## Examining kh_p15_scn
## There are 4 significant up and down genes.
## Warning: Something went wrong in all_cprofiler.

A few specific plots of interest: Colenso asked to label a few genes for the knockout/het p08_retinas, p08_scn, and p08_dlgn: either the top-15 or all significant. I am pretty sure if I tell it 15 and there are not that many, it will just do the significant? Let us find out!

19.5.2.2 ko/het for p08 retinas

table_name <- "kh_p08_retina"
table_input <- genotype_tables[[table_name]]
table <- table_input[["data"]][[table_name]]
interesting <- c("Opn4", "Gm9008", "Lrr1", "Cnbd1")
kh_p08_retina_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq_adjp", fill = "black",
  color_low = colors[["het_retina"]], color_high = colors[["ko_retina"]],
  label_column = "mgi_symbol", label = interesting, alpha = 1.0,
  outline = outline, size = 4)
## Warning in ggrepel::geom_text_repel(data = df_subset, nudge_x = nudge_x, : Ignoring unknown parameters: `outline`
pp(file = "13genotype_ma_volcano_tx/kh_p08_retina_volcano.pdf", width = 9, height = 9)
## Warning in pp(file = "13genotype_ma_volcano_tx/kh_p08_retina_volcano.pdf", : The directory: 13genotype_ma_volcano_tx does not exist, will
## attempt to create it.
kh_p08_retina_volcano[["plot"]]
plotted <- dev.off()
kh_p08_retina_volcano[["plot"]]

kh_p08_retina_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = colors[["ko_retina"]], color_high = colors[["het_retina"]],
  p_col = "deseq_adjp", label_column = "mgi_symbol", outline = outline,
  label = interesting)
pp(file = "13genotype_ma_volcano_tx/kh_p08_retina_ma.pdf", width = 9, height = 9)
kh_p08_retina_ma[["plot"]]
plotted <- dev.off()
kh_p08_retina_ma[["plot"]]

19.5.2.3 ko/het p08 SCN

I am going to make an executive decision for this plot, 15 is too many and makes it crazy cluttered.

19.5.3 Repeat this with two sets of genes

table_name <- "kh_p08_scn"
table_input <- genotype_tables[[table_name]]
table <- table_input[["data"]][[table_name]]
interesting_genes <- c("Fign", "Nrn1", "Dpysl2", "Actb", "Fgf9", "Otx2", "Sec23",
                       "Ncam1", "Map4", "Sec22b", "Nlgn3", "Marcks", "Cd47",
                       "Dpysl3", "Lin7c", "Cadm1", "Snx12", "Rhoa", "Inpp5f",
                       "Atg12", "Set", "Gsk3b", "Pdcd4", "Gabra2", "Tmco1", "Anapc16")
kh_p08_scn_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq
_adjp",
  label_column = "mgi_symbol", label = interesting_genes, size = 4, alpha = 1.0,
  outline = outline, color_low = colors[["ko_scn"]], color_high = colors[["het_scn"]])
## Error in `plot_volcano_condition_de()`:
## ! Column: deseq
## _adjp is not in the table.
pp(file = "13genotype_ma_volcano_tx/kh_p08_scn_volcano.pdf", width = 9, height = 9)
kh_p08_scn_volcano[["plot"]]
## Error:
## ! object 'kh_p08_scn_volcano' not found
plotted <- dev.off()
kh_p08_scn_volcano[["plot"]]
## Error:
## ! object 'kh_p08_scn_volcano' not found
## why in the crap is it double-labelling!?
## My MA plotter isn't as smart as the volcano plotter, the genes are:
kh_p08_scn_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = colors[["ko_scn"]], color_high = colors[["het_scn"]],
  outline = outline, p_col = "deseq_adjp", label_column = "mgi_symbol", label = interesting_genes)
pp(file = "13genotype_ma_volcano_tx/kh_p08_scn_ma.pdf", width = 9, height = 9)
kh_p08_scn_ma[["plot"]]
plotted <- dev.off()
kh_p08_scn_ma[["plot"]]

19.5.3.1 Same plot but a different set of labeled genes

table_name <- "kh_p08_scn"
table_input <- genotype_tables[[table_name]]
table <- table_input[["data"]][[table_name]]
interesting_genes <- c(
  "Anapc16", "Gabra2", "Tmco1", "Sod2", "Fgf9", "Pdcd4", "Rhoa", "Gsk3b", "Foxp1",
  "Ncam1", "Marcks", "Fign", "Dpysl3", "Inpp5f", "Cadm1", "Map4", "Ugcg", "Elovl4",
  "Elavl1", "Cfl2", "Tnnt1", "Gnb1", "Impact", "Nrn1", "Nlgn3", "Actb", "Cd47",
  "Sec22b", "Slc17a7", "Vglut1", "Actb", "B4galt5", "Foxp1", "Otx2", "Lin7c",
  "Snx12", "Atg12", "Set")
kh_p08_scn_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq_adjp",
  color_low = colors[["ko_scn"]], color_high = colors[["het_scn"]],
  outline = outline, label_column = "mgi_symbol", label = interesting_genes, size = 4, alpha = 1.0)
## Warning in ggrepel::geom_text_repel(data = df_subset, nudge_x = nudge_x, : Ignoring unknown parameters: `outline`
pp(file = "13genotype_ma_volcano_tx/kh_p08_scn_volcano_v2.pdf", width = 9, height = 9)
kh_p08_scn_volcano[["plot"]]
plotted <- dev.off()
kh_p08_scn_volcano[["plot"]]

## why in the crap is it double-labelling!?
## My MA plotter isn't as smart as the volcano plotter, the genes are:
kh_p08_scn_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = colors[["ko_scn"]], color_high = colors[["het_scn"]],
  outline = outline, p_col = "deseq_adjp", label_column = "mgi_symbol", label = interesting_genes)
pp(file = "13genotype_ma_volcano_tx/kh_p08_scn_ma_v2.pdf", width = 9, height = 9)
kh_p08_scn_ma[["plot"]]
plotted <- dev.off()
kh_p08_scn_ma[["plot"]]

19.5.3.2 ko/het p08 dLGN

table_name <- "kh_p08_dlgn"
table_input <- genotype_tables[[table_name]]
table <- table_input[["data"]][[table_name]]
kh_p08_dlgn_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq_adjp",
  color_low = colors[["ko_dlgn"]], color_high = colors[["het_dlgn"]],
  outline = outline, label_column = "mgi_symbol", label = 10, size = 4, alpha = 1.0)
## Warning in ggrepel::geom_text_repel(data = df_subset, nudge_x = nudge_x, : Ignoring unknown parameters: `outline`
pp(file = "13genotype_ma_volcano_tx/kh_p08_dlgn_volcano.pdf", width = 9, height = 9)
kh_p08_dlgn_volcano[["plot"]]
plotted <- dev.off()
kh_p08_dlgn_volcano[["plot"]]

## My MA plotter isn't as smart as the volcano plotter, the genes are:
kh_p08_dlgn_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = colors[["ko_dlgn"]], color_high = colors[["het_dlgn"]],
  p_col = "deseq_adjp", label_column = "mgi_symbol", label = 10, outline = outline)
pp(file = "13genotype_ma_volcano_tx/kh_p08_dlgn_ma.pdf", width = 9, height = 9)
kh_p08_dlgn_ma[["plot"]]
plotted <- dev.off()
kh_p08_dlgn_ma[["plot"]]

19.5.3.3 ko/het for p15 retinas

When last I ran this manually, it did not double-label, hopefully that remains true in the container.

table_name <- "kh_p15_retina"
table_input <- genotype_tables[[table_name]]
table <- table_input[["data"]][[table_name]]
interesting <- c("Opn4", "Gm9008", "Lrr1", "Cnbd1")
kh_p15_retina_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq_adjp", fill = "black",
  color_low = colors[["ko_retina"]], color_high = colors[["het_retina"]],
  label_column = "mgi_symbol", label = interesting, alpha = 1.0,
  outline = outline, size = 4)
## Warning in ggrepel::geom_text_repel(data = df_subset, nudge_x = nudge_x, : Ignoring unknown parameters: `outline`
pp(file = "13genotype_ma_volcano_tx/kh_p15_retina_volcano.pdf", width = 9, height = 9)
kh_p15_retina_volcano[["plot"]]
plotted <- dev.off()
kh_p15_retina_volcano[["plot"]]

## why in the crap is it double-labelling!?
## My MA plotter isn't as smart as the volcano plotter, the genes are:
kh_p15_retina_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = colors[["ko_retina"]], color_high = colors[["het_retina"]],
  p_col = "deseq_adjp", label_column = "mgi_symbol", label = interesting, outline = outline)
pp(file = "13genotype_ma_volcano_tx/kh_p15_retina_ma.pdf", width = 9, height = 9)
kh_p15_retina_ma[["plot"]]
plotted <- dev.off()
kh_p15_retina_ma[["plot"]]

19.5.3.4 ko/het p15 SCN

19.5.4 Repeat this with two sets of genes

table_name <- "kh_p15_scn"
table_input <- genotype_tables[[table_name]]
table <- table_input[["data"]][[table_name]]
interesting_genes <- c("Fign", "Nrn1", "Dpysl2", "Actb", "Fgf9", "Otx2", "Sec23",
                       "Ncam1", "Map4", "Sec22b", "Nlgn3", "Marcks", "Cd47",
                       "Dpysl3", "Lin7c", "Cadm1", "Snx12", "Rhoa", "Inpp5f",
                       "Atg12", "Set", "Gsk3b", "Pdcd4", "Gabra2", "Tmco1", "Anapc16")
kh_p15_scn_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq_adjp",
  label_column = "mgi_symbol", size = 4, alpha = 1.0,
  outline = outline, color_low = colors[["ko_scn"]], color_high = colors[["het_scn"]])
pp(file = "13genotype_ma_volcano_tx/kh_p15_scn_volcano.pdf", width = 9, height = 9)
kh_p15_scn_volcano[["plot"]]
plotted <- dev.off()
kh_p15_scn_volcano[["plot"]]

kh_p15_scn_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = colors[["ko_scn"]], color_high = colors[["het_scn"]],
  p_col = "deseq_adjp", label_column = "mgi_symbol", label = interesting_genes, outline = outline)
pp(file = "13genotype_ma_volcano_tx/kh_p15_scn_ma.pdf", width = 9, height = 9)
kh_p15_scn_ma[["plot"]]
plotted <- dev.off()
kh_p15_scn_ma[["plot"]]

Round 2 with a separate gene set.

table_name <- "kh_p15_scn"
table_input <- genotype_tables[[table_name]]
table <- table_input[["data"]][[table_name]]
interesting_genes <- c(
  "Anapc16", "Gabra2", "Tmco1", "Sod2", "Fgf9", "Pdcd4", "Rhoa", "Gsk3b", "Foxp1",
  "Ncam1", "Marcks", "Fign", "Dpysl3", "Inpp5f", "Cadm1", "Map4", "Ugcg", "Elovl4",
  "Elavl1", "Cfl2", "Tnnt1", "Gnb1", "Impact", "Nrn1", "Nlgn3", "Actb", "Cd47",
  "Sec22b", "Slc17a7", "Vglut1", "Actb", "B4galt5", "Foxp1", "Otx2", "Lin7c",
  "Snx12", "Atg12", "Set")
kh_p15_scn_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq_adjp",
  color_low = colors[["ko_scn"]], color_high = colors[["het_scn"]],
  outline = outline, label_column = "mgi_symbol", label = interesting_genes, size = 4, alpha = 1.0)
## Warning in ggrepel::geom_text_repel(data = df_subset, nudge_x = nudge_x, : Ignoring unknown parameters: `outline`
pp(file = "13genotype_ma_volcano_tx/kh_p15_scn_volcano_v2.pdf", width = 9, height = 9)
kh_p15_scn_volcano[["plot"]]
plotted <- dev.off()
kh_p15_scn_volcano[["plot"]]

kh_p15_scn_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = colors[["ko_scn"]], color_high = colors[["het_scn"]],
  p_col = "deseq_adjp", label_column = "mgi_symbol", label = interesting_genes, outline = outline)
pp(file = "13genotype_ma_volcano_tx/kh_p15_scn_ma_v2.pdf", width = 9, height = 9)
kh_p15_scn_ma[["plot"]]
plotted <- dev.off()
kh_p15_scn_ma[["plot"]]

19.5.4.1 ko/het p15 dLGN

table_name <- "kh_p15_dlgn"
table_input <- genotype_tables[[table_name]]
table <- table_input[["data"]][[table_name]]
kh_p15_dlgn_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq_adjp",
  color_low = colors[["ko_dlgn"]], color_high = colors[["het_dlgn"]],
  outline = outline, label_column = "mgi_symbol", label = 10, size = 4, alpha = 1.0)
## Warning in ggrepel::geom_text_repel(data = df_subset, nudge_x = nudge_x, : Ignoring unknown parameters: `outline`
pp(file = "13genotype_ma_volcano_tx/kh_p15_dlgn_volcano.pdf", width = 9, height = 9)
kh_p15_dlgn_volcano[["plot"]]
plotted <- dev.off()
kh_p15_dlgn_volcano[["plot"]]

## My MA plotter isn't as smart as the volcano plotter, the genes are:
kh_p15_dlgn_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = colors[["ko_dlgn"]], color_high = colors[["het_dlgn"]],
  p_col = "deseq_adjp", label_column = "mgi_symbol", label = 10, outline = outline)
pp(file = "13genotype_ma_volcano_tx/kh_p15_dlgn_ma.pdf", width = 9, height = 9)
kh_p15_dlgn_ma[["plot"]]
plotted <- dev.off()
kh_p15_dlgn_ma[["plot"]]

A query from Rashmi:

“I was discussing with Dr. Speer about the dLGN data and we found mostly retinal genes in dLGN Het/KO or time point comparison. Please check if those are not retina samples.”

I checked the samples etc and everything looks ok to me; perhaps I can use the results to look at this question in another way:

I will therefore load the p08_het_dlgn/p08_ko_dlgn table and compare it to the p08_het_retina/p08_ko_retina table directly. I think that if these turn out to be identical, then the hypothesis suggested by this query is correct.

Note, in order to do this, I must use the full tables, not the post-inclusion tables because I cannot guarantee that they will have identical gene IDs.

retina_table <- genotype_tables_full[["data"]][["kh_p08_retina"]]
dlgn_table <- genotype_tables_full[["data"]][["kh_p08_dlgn"]]
retina_subset <- retina_table[, c("ensembl_gene_id", "deseq_logfc")]
colnames(retina_subset) <- c("ID", "retina_logfc")
dlgn_subset <- dlgn_table[, c("ensembl_gene_id", "deseq_logfc")]
colnames(dlgn_subset) <- c("ID", "dlgn_logfc")
merged <- merge(retina_subset, dlgn_subset, by = "ID")
rownames(merged) <- make.names(merged[["ID"]], unique = TRUE)
merged[["ID"]] <- NULL
plotted <- plot_linear_scatter(merged)
## Warning in plot_linear_scatter(merged): Model type robust failed, falling back to a default lm.
pp(file = "images_tx/kh_p08_retina_vs_dlgn_deseq_logfc_values.png")
## Warning in pp(file = "images_tx/kh_p08_retina_vs_dlgn_deseq_logfc_values.png"): The directory: images_tx does not exist, will attempt to
## create it.
plotted[["scatter"]]
dev.off()
## png 
##   2
plotted[["scatter"]]

Rashmi asked if we could also do the p15 for this comparison:

retina_table <- genotype_tables_full[["data"]][["kh_p15_retina"]]
dlgn_table <- genotype_tables_full[["data"]][["kh_p15_dlgn"]]
retina_subset <- retina_table[, c("ensembl_gene_id", "deseq_logfc")]
colnames(retina_subset) <- c("ID", "retina_logfc")
dlgn_subset <- dlgn_table[, c("ensembl_gene_id", "deseq_logfc")]
colnames(dlgn_subset) <- c("ID", "dlgn_logfc")
merged <- merge(retina_subset, dlgn_subset, by = "ID")
rownames(merged) <- make.names(merged[["ID"]], unique = TRUE)
merged[["ID"]] <- NULL
plotted <- plot_linear_scatter(merged)
## Warning in plot_linear_scatter(merged): Model type robust failed, falling back to a default lm.
pp(file = "images_tx/kh_p15_retina_vs_dlgn_deseq_logfc_values.png")
plotted[["scatter"]]
dev.off()
## png 
##   2
plotted[["scatter"]]

19.5.4.2 Repeat with the strict filter

genotype_strict_tables <- list()
genotype_strict_sig <- list()
genotype_strict_gp <- list()
genotype_strict_cp <- list()
genotype_strict_en <- list()
for (k in seq_along(genotype_keepers)) {
  name <- names(genotype_keepers)[k]
  message("Examining ", name)
  keeper <- genotype_keepers[name]
  include_name <- paste0("inc_", name)
  include_df_name <- paste0("df_", name)
  include_strict_df <- genotype_inclusions_strict[[include_df_name]]
  includes_strict <- genotype_inclusions_strict[[include_name]]
  summary(rownames(genotype_sig_full[["deseq"]][["ups"]][[name]]) %in% includes_strict)
  include_filename <- glue("14genotype_strict_contrasts_excel_tx/{name}_including_wt_{lfc_cutoff}_decreased_table-v{ver}.xlsx")
  include_sig_filename <- glue("14genotype_strict_contrasts_excel_tx/{name}_including_wt_{lfc_cutoff}_decreased_sig-v{ver}.xlsx")
  genotype_strict_tables[[name]] <- combine_de_tables(
    genotype_de, extra_annot = include_strict_df,
    keepers = keeper, label_column = label_column,
    excel = include_filename, wanted_genes = includes_strict)
  print(genotype_strict_tables[[name]])
  genotype_strict_sig[[name]] <- extract_significant_genes(
    genotype_strict_tables[[name]], according_to = "deseq",
    excel = include_sig_filename)
  print(genotype_strict_sig[[name]])
  num_rows <- nrow(genotype_strict_sig[[name]][["deseq"]][["ups"]][[name]]) +
    nrow(genotype_strict_sig[[name]][["deseq"]][["downs"]][[name]])
  message("There are ", num_rows, " significant up and down genes.")
  if (num_rows >= 10) {
    message("Performing gprofiler/clusterProfiler.")
    genotype_strict_gp[[name]] <- all_gprofiler(genotype_strict_sig[[name]], species = "mmusculus")
    genotype_strict_cp[[name]] <- all_cprofiler(
      genotype_strict_sig[[name]], genotype_strict_tables[[name]],
      orgdb = "org.Mm.eg.db", go_level = go_level,
      orgdb_from = orgdb_from, max_groupsize = max_groupsize, organism = "mouse")
    #if (!is.null(get0("m2_gsc"))) {
    #  genotype_strict_en[[name]] <- all_enricher(genotype_strict_sig[[name]], gsc = m2_gsc,
    #                                      orgdb = "org.Mm.eg.db", from = "ENSEMBL", to = "SYMBOL")
    #}
    gp_written <- write_all_gp(genotype_strict_gp[[name]], prefix = "15", suffix = "strict")
    cp_written <- write_all_cp(genotype_strict_cp[[name]], prefix = "15", suffix = "strict")
    #en_written <- write_all_en(genotype_strict_en[[name]])
  } else {
    warning("There are less than 10 genes up and down in the ", name, " comparison.")
    message("There are less than 10 genes up and down in the ", name, " comparison.")
  }
}
## Examining kh_p08_dlgn
## Looking for subscript invalid names, end of extract_keepers.
## A set of combined differential expression results.
##                         table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p08_ko_dlgn_vs_p08_het_dlgn           1             0           1             0           1             0
## Only kh_p08_dlgn_up has information, cannot create an UpSet.
## Plot describing unique/shared genes in a differential expression table.
## NULL
## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##             deseq_up deseq_down
## kh_p08_dlgn        1          0

## There are 1 significant up and down genes.
## Warning: There are less than 10 genes up and down in the kh_p08_dlgn comparison.
## There are less than 10 genes up and down in the kh_p08_dlgn comparison.
## Examining kh_p15_dlgn
## Looking for subscript invalid names, end of extract_keepers.
## A set of combined differential expression results.
##                         table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p15_ko_dlgn_vs_p15_het_dlgn           0             0           0             0           0             0
## Only  has information, cannot create an UpSet.
## Plot describing unique/shared genes in a differential expression table.
## NULL
## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##             deseq_up deseq_down
## kh_p15_dlgn        0          0
## There are 0 significant up and down genes.
## Warning: There are less than 10 genes up and down in the kh_p15_dlgn comparison.
## There are less than 10 genes up and down in the kh_p15_dlgn comparison.
## Examining kh_p08_retina
## Looking for subscript invalid names, end of extract_keepers.
## A set of combined differential expression results.
##                             table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p08_ko_retina_vs_p08_het_retina           1             0           1             0           0             0
## Only kh_p08_retina_up has information, cannot create an UpSet.
## Plot describing unique/shared genes in a differential expression table.
## NULL
## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##               deseq_up deseq_down
## kh_p08_retina        1          0

## There are 1 significant up and down genes.
## Warning: There are less than 10 genes up and down in the kh_p08_retina comparison.
## There are less than 10 genes up and down in the kh_p08_retina comparison.
## Examining kh_p15_retina
## Looking for subscript invalid names, end of extract_keepers.
## The result table is too small for meaningful comparisons.
## The first table has only: 49.
## A set of combined differential expression results.
##                             table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p15_ko_retina_vs_p15_het_retina           0             0           0             0           0             0
## Only  has information, cannot create an UpSet.
## Plot describing unique/shared genes in a differential expression table.
## NULL
## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##               deseq_up deseq_down
## kh_p15_retina        0          0
## There are 0 significant up and down genes.
## Warning: There are less than 10 genes up and down in the kh_p15_retina comparison.
## There are less than 10 genes up and down in the kh_p15_retina comparison.
## Examining kh_p08_scn
## Looking for subscript invalid names, end of extract_keepers.
## The result table is too small for meaningful comparisons.
## The first table has only: 1.
## A set of combined differential expression results.
##                       table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p08_ko_scn_vs_p08_het_scn           0             0           0             0           0             0
## Only  has information, cannot create an UpSet.
## Plot describing unique/shared genes in a differential expression table.
## NULL
## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##            deseq_up deseq_down
## kh_p08_scn        0          0
## There are 0 significant up and down genes.
## Warning: There are less than 10 genes up and down in the kh_p08_scn comparison.
## There are less than 10 genes up and down in the kh_p08_scn comparison.
## Examining kh_p15_scn
## Looking for subscript invalid names, end of extract_keepers.
## The result table is too small for meaningful comparisons.
## The first table has only: 1.
## A set of combined differential expression results.
##                       table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p15_ko_scn_vs_p15_het_scn           0             0           0             0           0             0
## Only  has information, cannot create an UpSet.
## Plot describing unique/shared genes in a differential expression table.
## NULL
## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##            deseq_up deseq_down
## kh_p15_scn        0          0
## There are 0 significant up and down genes.
## Warning: There are less than 10 genes up and down in the kh_p15_scn comparison.
## There are less than 10 genes up and down in the kh_p15_scn comparison.

20 Genotype Strict plots

for (k in seq_along(genotype_keepers)) {
  name <- names(genotype_keepers)[k]
  message("Examining ", name)
  keeper <- genotype_keepers[name]
  include_name <- paste0("inc_", name)
  include_df_name <- paste0("df_", name)
  include_strict_df <- genotype_inclusions_strict[[include_df_name]]
  includes_strict <- genotype_inclusions_strict[[include_name]]
  summary(rownames(genotype_sig_full[["deseq"]][["ups"]][[name]]) %in% includes_strict)
  num_rows <- nrow(genotype_strict_sig[[name]][["deseq"]][["ups"]][[name]]) +
    nrow(genotype_strict_sig[[name]][["deseq"]][["downs"]][[name]])
  nrow(genotype_strict_sig[[name]][["deseq"]][["ups"]][[name]])
  nrow(genotype_strict_sig[[name]][["deseq"]][["downs"]][[name]])
  message("There are ", num_rows, " significant up and down genes.")
  ## #1 is up and #2 is down, avoiding typeos here.
  num_objects <- length(genotype_strict_cp[[name]])
  if (num_objects == 0) {
    warning("Something went wrong in all_cprofiler.")
  } else {
    upp <- which(grepl(x = names(genotype_strict_cp[[name]]), pattern = "_up$"))
    downp <- which(grepl(x = names(genotype_strict_cp[[name]]), pattern = "_down$"))
    if (length(upp) > 0) {
      mf_sig <- genotype_strict_cp[[name]][[upp]][["go_data"]][["MF_enrich"]]
      cc_sig <- genotype_strict_cp[[name]][[upp]][["go_data"]][["CC_enrich"]]
      bp_sig <- genotype_strict_cp[[name]][[upp]][["go_data"]][["BP_enrich"]]
      mf_plots_up <- plot_enrichresult(mf_sig, showCategory = go_categories)
      mf_tree_up_filename <- glue("16clusterProfiler_plots_tx/{name}_up_mf_sig_tree.pdf")
      pp(file = mf_tree_up_filename)
      try(print(mf_plots_up[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      mf_bar_up_filename <- glue("16clusterProfiler_plots_tx/{name}_up_mf_sig_bar.pdf")
      pp(file = mf_bar_up_filename)
      try(print(mf_plots_up[["bar"]]), silent = TRUE)
      plotted <- dev.off()
      cc_plots_up <- plot_enrichresult(cc_sig, showCategory = go_categories)
      cc_tree_up_filename <- glue("16clusterProfiler_plots_tx/{name}_up_cc_sig_tree.pdf")
      pp(file = cc_tree_up_filename)
      try(print(cc_plots_up[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      cc_bar_up_filename <- glue("16clusterProfiler_plots_tx/{name}_up_cc_sig_bar.pdf")
      pp(file = cc_bar_up_filename)
      try(print(cc_plots_up[["bar"]]), silent = TRUE)
      plotted <- dev.off()
      bp_plots_up <- plot_enrichresult(bp_sig, showCategory = go_categories)
      bp_tree_up_filename <- glue("16clusterProfiler_plots_tx/{name}_up_bp_sig_tree.pdf")
      pp(file = bp_tree_up_filename)
      try(print(bp_plots_up[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      bp_plots_up <- plot_enrichresult(bp_sig, showCategory = go_categories)
      bp_bar_up_filename <- glue("16clusterProfiler_plots_tx/{name}_up_bp_sig_bar.pdf")
      pp(file = bp_bar_up_filename)
      try(print(bp_plots_up[["bar"]]), silent = TRUE)
      plotted <- dev.off()
    }
    if (length(downp) > 0) {
      mf_sig <- genotype_strict_cp[[name]][[downp]][["go_data"]][["MF_enrich"]]
      cc_sig <- genotype_strict_cp[[name]][[downp]][["go_data"]][["CC_enrich"]]
      bp_sig <- genotype_strict_cp[[name]][[downp]][["go_data"]][["BP_enrich"]]
      mf_plots_down <- plot_enrichresult(mf_sig, showCategory = go_categories)
      mf_tree_down_filename <- glue("16clusterProfiler_plots_tx/{name}_down_mf_sig_tree.pdf")
      pp(file = mf_tree_down_filename)
      try(print(mf_plots_down[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      mf_bar_down_filename <- glue("16clusterProfiler_plots_tx/{name}_down_mf_sig_bar.pdf")
      pp(file = mf_bar_down_filename)
      try(print(mf_plots_down[["bar"]]), silent = TRUE)
      plotted <- dev.off()
      cc_plots_down <- plot_enrichresult(cc_sig, showCategory = go_categories)
      cc_tree_down_filename <- glue("16clusterProfiler_plots_tx/{name}_down_cc_sig_tree.pdf")
      pp(file = cc_tree_down_filename)
      try(print(cc_plots_down[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      cc_bar_down_filename <- glue("16clusterProfiler_plots_tx/{name}_down_cc_sig_bar.pdf")
      pp(file = cc_bar_down_filename)
      try(print(cc_plots_down[["bar"]]), silent = TRUE)
      plotted <- dev.off()
      bp_plots_down <- plot_enrichresult(bp_sig, showCategory = go_categories)
      bp_tree_down_filename <- glue("16clusterProfiler_plots_tx/{name}_down_bp_sig_tree.pdf")
      pp(file = bp_tree_down_filename)
      try(print(bp_plots_down[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      bp_plots_down <- plot_enrichresult(bp_sig, cateogories = go_categories)
      bp_bar_down_filename <- glue("16clusterProfiler_plots_tx/{name}_down_bp_sig_bar.pdf")
      pp(file = bp_bar_down_filename)
      try(print(bp_plots_down[["bar"]]), silent = TRUE)
      plotted <- dev.off()
    }
  }
}
## Examining kh_p08_dlgn
## There are 1 significant up and down genes.
## Warning: Something went wrong in all_cprofiler.
## Examining kh_p15_dlgn
## There are 0 significant up and down genes.
## Warning: Something went wrong in all_cprofiler.
## Examining kh_p08_retina
## There are 1 significant up and down genes.
## Warning: Something went wrong in all_cprofiler.
## Examining kh_p15_retina
## There are 0 significant up and down genes.
## Warning: Something went wrong in all_cprofiler.
## Examining kh_p08_scn
## There are 0 significant up and down genes.
## Warning: Something went wrong in all_cprofiler.
## Examining kh_p15_scn
## There are 0 significant up and down genes.
## Warning: Something went wrong in all_cprofiler.

Given this stricter filter, I think no genes pass in the genome comparisons.

20.0.1 Location contrasts with genes removed/kept

We will now repeat the above tasks seeking location differences instead of genotype; essentially I copy/pasted the above with s/genotype/location/g.

location_tables_full <- combine_de_tables(
  location_de, keepers = location_keepers, label_column = label_column,
  excel = glue("17full_location_contrasts_tx/location_full_tables-v{ver}.xlsx"))
## Looking for subscript invalid names, end of extract_keepers.
location_tables_full
## A set of combined differential expression results.
##                             table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1  p08_het_dlgn_vs_p08_het_retina        1138          1074        1324          1127        1027           976
## 2  p15_het_dlgn_vs_p15_het_retina        1001          1314        1149          1479         969          1110
## 3    p08_ko_dlgn_vs_p08_ko_retina         960           914        1087           996         824           994
## 4    p15_ko_dlgn_vs_p15_ko_retina         882          1107        1042          1187         787           888
## 5   p08_het_scn_vs_p08_het_retina        1410          1414        1685          1516        1312          1239
## 6   p15_het_scn_vs_p15_het_retina        1383          1460        1641          1643        1362          1371
## 7     p08_ko_scn_vs_p08_ko_retina        1181          1184        1391          1265        1117          1103
## 8     p15_ko_scn_vs_p15_ko_retina         939          1135        1156          1346         976          1018
## 9     p08_het_dlgn_vs_p08_het_scn         443           483         513           612         402           478
## 10    p15_het_dlgn_vs_p15_het_scn        1127          1422        1231          1619        1268          1421
## 11      p08_ko_dlgn_vs_p08_ko_scn         446           483         501           573         529           746
## 12      p15_ko_dlgn_vs_p15_ko_scn        1237          1303        1427          1448        1267          1329
## Plot describing unique/shared genes in a differential expression table.

location_sig_full <- extract_significant_genes(
  location_tables_full, according_to = "deseq",
  excel = glue("17full_location_contrasts_tx/location_full_sig-v{ver}.xlsx"))
location_sig_full
## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##            deseq_up deseq_down
## dr_p08_het     1138       1074
## dr_p15_het     1001       1314
## dr_p08_ko       960        914
## dr_p15_ko       882       1107
## sr_p08_het     1410       1414
## sr_p15_het     1383       1460
## sr_p08_ko      1181       1184
## sr_p15_ko       939       1135
## ds_p08_het      443        483
## ds_p15_het     1127       1422
## ds_p08_ko       446        483
## ds_p15_ko      1237       1303

location_full_upset <- upsetr_sig(location_sig_full)
location_full_intersects <- write_upset_groups(
  location_full_upset,
  excel = "excel/17full_location_contrasts_tx/location_full_gene_groups.xlsx")
location_tables <- list()
location_sig <- list()
location_gp <- list()
location_cp <- list()
for (k in seq_along(location_keepers)) {
  name <- names(location_keepers)[k]
  message("Examining ", name)
  keeper <- location_keepers[name]
  includes <- location_inclusions[[name]]
  include_name <- paste0("inc_", name)
  include_df_name <- paste0("df_", name)
  include_df <- location_inclusions[[include_df_name]]
  includes <- location_inclusions[[include_name]]
  summary(rownames(location_sig_full[["deseq"]][["ups"]][[name]]) %in% includes)
  include_filename <- glue("18location_contrasts_tx/{name}_including_wt_{lfc_cutoff}_decreased_table-v{ver}.xlsx")
  include_sig_filename <- glue("18location_contrasts_tx/{name}_including_wt_{lfc_cutoff}_decreased_sig-v{ver}.xlsx")
  location_tables[[name]] <- combine_de_tables(
    location_de, extra_annot = include_df,
    keepers = keeper, label_column = label_column,
    excel = include_filename, wanted_genes = includes)
  print(location_tables[[name]])
  location_sig[[name]] <- extract_significant_genes(
    location_tables[[name]], according_to = "deseq",
    excel = include_sig_filename)
  print(location_sig[[name]])
  num_rows <- nrow(location_sig[[name]][["deseq"]][["ups"]][[name]]) +
    nrow(location_sig[[name]][["deseq"]][["downs"]][[name]])
  message("There are ", num_rows, " significant up and down genes.")
  if (num_rows > 10) {
    location_gp[[name]] <- all_gprofiler(location_sig[[name]], species = "mmusculus")
    location_cp[[name]] <- all_cprofiler(
      location_sig[[name]], location_tables[[name]],
      orgdb = "org.Mm.eg.db", go_level = go_level, orgdb_from = orgdb_from,
      max_groupsize = max_groupsize, organism = "mouse")
    cp_written <- write_all_cp(location_cp[[name]], prefix = "19")
    gp_written <- write_all_gp(location_gp[[name]], prefix = "19")
  }
}
## Examining dr_p08_het
## Looking for subscript invalid names, end of extract_keepers.
## A set of combined differential expression results.
##                            table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p08_het_dlgn_vs_p08_het_retina         110            96         124            90         109            81
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.

## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##            deseq_up deseq_down
## dr_p08_het      110         96

## There are 206 significant up and down genes.
## There are 48 genes deemed significant out of 310.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.27% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.27% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.27% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.27% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.27% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Deleting the file excel/all_cp_dr_p08_het_up.xlsx before writing the tables.
## There are 44 genes deemed significant out of 310.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.27% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.27% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.27% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.27% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.27% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Examining dr_p15_het
## Looking for subscript invalid names, end of extract_keepers.
## A set of combined differential expression results.
##                            table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p15_het_dlgn_vs_p15_het_retina         253            55         276            55         216            53
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.

## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##            deseq_up deseq_down
## dr_p15_het      253         55

## There are 308 significant up and down genes.
## There are 91 genes deemed significant out of 495.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.22% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : For some of the pathways the P-values were likely
## overestimated. For such pathways log2err is set to NA.
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.25% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.22% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.22% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.22% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Deleting the file excel/all_cp_dr_p15_het_up.xlsx before writing the tables.
## There are 23 genes deemed significant out of 495.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.22% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.25% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.22% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.22% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.22% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Examining dr_p08_ko
## Looking for subscript invalid names, end of extract_keepers.
## A set of combined differential expression results.
##                          table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p08_ko_dlgn_vs_p08_ko_retina         258            67         276            67         210            72
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.

## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##           deseq_up deseq_down
## dr_p08_ko      258         67

## There are 325 significant up and down genes.
## There are 122 genes deemed significant out of 440.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.59% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.6% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.59% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.59% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.59% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Deleting the file excel/all_cp_dr_p08_ko_up.xlsx before writing the tables.
## There are 28 genes deemed significant out of 440.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.59% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.6% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.59% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.59% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.59% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Examining dr_p15_ko
## Looking for subscript invalid names, end of extract_keepers.
## A set of combined differential expression results.
##                          table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p15_ko_dlgn_vs_p15_ko_retina         334            96         359           100         281            93
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.

## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##           deseq_up deseq_down
## dr_p15_ko      334         96

## There are 430 significant up and down genes.
## There are 125 genes deemed significant out of 598.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (3.52% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : For some of the pathways the P-values were likely overestimated. For such pathways log2err is set to NA.
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : For some pathways, in reality P-values are less than
## 1e-10. You can set the `eps` argument to zero for better estimation.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (3.59% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (3.52% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (3.52% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (3.52% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Deleting the file excel/all_cp_dr_p15_ko_up.xlsx before writing the tables.
## There are 38 genes deemed significant out of 598.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (3.52% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : For some of the pathways the P-values were likely
## overestimated. For such pathways log2err is set to NA.
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : For some pathways, in reality P-values are less than
## 1e-10. You can set the `eps` argument to zero for better estimation.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (3.59% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (3.52% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (3.52% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : For some pathways, in reality P-values are less than 1e-10. You can set the `eps` argument to zero for better estimation.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (3.52% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Examining sr_p08_het
## Looking for subscript invalid names, end of extract_keepers.
## A set of combined differential expression results.
##                           table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p08_het_scn_vs_p08_het_retina          80           111          90           105          85           100
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.

## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##            deseq_up deseq_down
## sr_p08_het       80        111

## There are 191 significant up and down genes.
## There are 31 genes deemed significant out of 224.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.45% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.45% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.45% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.45% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.45% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Deleting the file excel/all_cp_sr_p08_het_up.xlsx before writing the tables.
## There are 50 genes deemed significant out of 224.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.45% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.45% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.45% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.45% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.45% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Examining sr_p15_het
## Looking for subscript invalid names, end of extract_keepers.
## A set of combined differential expression results.
##                           table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p15_het_scn_vs_p15_het_retina          24            69          26            64          23            70
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.

## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##            deseq_up deseq_down
## sr_p15_het       24         69

## There are 93 significant up and down genes.
## There are 9 genes deemed significant out of 86.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## no term enriched under specific pvalueCutoff...
## Deleting the file excel/all_cp_sr_p15_het_up.xlsx before writing the tables.
## There are 29 genes deemed significant out of 86.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## no term enriched under specific pvalueCutoff...
## Examining sr_p08_ko
## Looking for subscript invalid names, end of extract_keepers.
## A set of combined differential expression results.
##                         table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p08_ko_scn_vs_p08_ko_retina         112            76         122            71         114            60
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.

## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##           deseq_up deseq_down
## sr_p08_ko      112         76

## There are 188 significant up and down genes.
## There are 51 genes deemed significant out of 219.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.46% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.46% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.46% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.46% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.46% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Deleting the file excel/all_cp_sr_p08_ko_up.xlsx before writing the tables.
## There are 32 genes deemed significant out of 219.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.46% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.46% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.46% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.46% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.46% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Examining sr_p15_ko
## Looking for subscript invalid names, end of extract_keepers.
## A set of combined differential expression results.
##                         table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p15_ko_scn_vs_p15_ko_retina          11            20          10            20          11            16
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.

## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##           deseq_up deseq_down
## sr_p15_ko       11         20

## There are 31 significant up and down genes.
## There are 6 genes deemed significant out of 28.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## no term enriched under specific pvalueCutoff...
## Deleting the file excel/all_cp_sr_p15_ko_up.xlsx before writing the tables.
## There are 6 genes deemed significant out of 28.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## no term enriched under specific pvalueCutoff...
## Examining ds_p08_het
## Looking for subscript invalid names, end of extract_keepers.
## A set of combined differential expression results.
##                         table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p08_het_dlgn_vs_p08_het_scn          39             6          39             7          32             7
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.

## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##            deseq_up deseq_down
## ds_p08_het       39          6

## There are 45 significant up and down genes.
## There are 23 genes deemed significant out of 103.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.91% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : For some of the pathways the P-values were likely
## overestimated. For such pathways log2err is set to NA.
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.94% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.91% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.91% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.91% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Deleting the file excel/all_cp_ds_p08_het_up.xlsx before writing the tables.
## There are 1 genes deemed significant out of 103.
## There are 1 entries which match the search string: Mus musculus.
## No gene sets have size between 5 and 500 ...
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.91% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : For some of the pathways the P-values were likely overestimated. For such pathways log2err is set to NA.
## no term enriched under specific pvalueCutoff...
## --> No gene can be mapped....
## --> Expected input gene ID: 11677,268756,257633,230163,56752,72141
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.94% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## --> No gene can be mapped....
## --> Expected input gene ID: 12865,74769,18477,67331,17717,16816
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.91% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## No gene sets have size between 5 and 2000 ...
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.91% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (2.91% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Examining ds_p15_het
## Looking for subscript invalid names, end of extract_keepers.
## A set of combined differential expression results.
##                         table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p15_het_dlgn_vs_p15_het_scn         611             2         610             3         558             2
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.

## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##            deseq_up deseq_down
## ds_p15_het      611          2

## There are 613 significant up and down genes.
## There are 272 genes deemed significant out of 441.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (5.67% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : There were 1 pathways for which P-values were not
## calculated properly due to unbalanced (positive and negative) gene-level statistic values. For such pathways pval, padj, NES, log2err are set
## to NA. You can try to increase the value of the argument nPermSimple (for example set it nPermSimple = 10000)
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : For some of the pathways the P-values were likely
## overestimated. For such pathways log2err is set to NA.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (5.76% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (5.67% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (5.67% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (5.67% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Deleting the file excel/all_cp_ds_p15_het_up.xlsx before writing the tables.
## Error in sig_genes_namedf[[orgdb_to]] : subscript out of bounds
## Examining ds_p08_ko
## Looking for subscript invalid names, end of extract_keepers.
## A set of combined differential expression results.
##                       table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p08_ko_dlgn_vs_p08_ko_scn         115             3         112             3          87             6
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.

## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##           deseq_up deseq_down
## ds_p08_ko      115          3

## There are 118 significant up and down genes.
## There are 59 genes deemed significant out of 257.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.39% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : There were 1 pathways for which P-values were not
## calculated properly due to unbalanced (positive and negative) gene-level statistic values. For such pathways pval, padj, NES, log2err are set
## to NA. You can try to increase the value of the argument nPermSimple (for example set it nPermSimple = 10000)
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.39% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.39% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.39% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.39% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Deleting the file excel/all_cp_ds_p08_ko_up.xlsx before writing the tables.
## There are 2 genes deemed significant out of 257.
## There are 1 entries which match the search string: Mus musculus.
## No gene sets have size between 5 and 500 ...
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.39% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## no term enriched under specific pvalueCutoff...
## --> No gene can be mapped....
## --> Expected input gene ID: 57874,235674,74205,75578,74559,71336
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.39% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## --> No gene can be mapped....
## --> Expected input gene ID: 72900,59015,74325,67727,117147,100017
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.39% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## No gene sets have size between 5 and 2000 ...
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.39% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.39% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Examining ds_p15_ko
## Looking for subscript invalid names, end of extract_keepers.
## A set of combined differential expression results.
##                       table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p15_ko_dlgn_vs_p15_ko_scn         755             2         796             1         641             0
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.

## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##           deseq_up deseq_down
## ds_p15_ko      755          2

## There are 757 significant up and down genes.
## There are 321 genes deemed significant out of 577.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (5.03% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : There were 6 pathways for which P-values were not
## calculated properly due to unbalanced (positive and negative) gene-level statistic values. For such pathways pval, padj, NES, log2err are set
## to NA. You can try to increase the value of the argument nPermSimple (for example set it nPermSimple = 10000)
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (5.14% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : All values in the stats vector are greater than zero and
## scoreType is "std", maybe you should switch to scoreType = "pos".
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (5.03% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (5.03% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (5.03% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Deleting the file excel/all_cp_ds_p15_ko_up.xlsx before writing the tables.
## Error in sig_genes_namedf[[orgdb_to]] : subscript out of bounds

Print out all the plots in a separate block.

for (k in seq_along(location_keepers)) {
  name <- names(location_keepers)[k]
  message("Examining ", name)
  keeper <- location_keepers[name]
  includes <- location_inclusions[[name]]
  include_name <- paste0("inc_", name)
  include_df_name <- paste0("df_", name)
  include_df <- location_inclusions[[include_df_name]]
  includes <- location_inclusions[[include_name]]
  summary(rownames(location_sig_full[["deseq"]][["ups"]][[name]]) %in% includes)
  num_rows <- nrow(location_sig[[name]][["deseq"]][["ups"]][[name]]) +
    nrow(location_sig[[name]][["deseq"]][["downs"]][[name]])
  nrow(location_sig[[name]][["deseq"]][["ups"]][[name]])
  nrow(location_sig[[name]][["deseq"]][["downs"]][[name]])
  message("There are ", num_rows, " significant up and down genes.")
  num_objects <- length(location_cp[[name]])
  if (num_objects == 0) {
    warning("Something went wrong in all_cprofiler.")
  } else {
    upp <- which(grepl(x = names(location_cp[[name]]), pattern = "_up$"))
    downp <- which(grepl(x = names(location_cp[[name]]), pattern = "_down$"))
    if (length(upp) > 0) {
      mf_sig <- location_cp[[name]][[upp]][["go_data"]][["MF_enrich"]]
      cc_sig <- location_cp[[name]][[upp]][["go_data"]][["CC_enrich"]]
      bp_sig <- location_cp[[name]][[upp]][["go_data"]][["BP_enrich"]]
      mf_plots_up <- plot_enrichresult(mf_sig, showCategory = go_categories)
      mf_tree_up_filename <- glue("19clusterProfiler_plots_tx/{name}_up_mf_sig_tree.pdf")
      pp(file = mf_tree_up_filename)
      try(print(mf_plots_up[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      mf_bar_up_filename <- glue("19clusterProfiler_plots_tx/{name}_up_mf_sig_bar.pdf")
      pp(file = mf_bar_up_filename)
      try(print(mf_plots_up[["bar"]]), silent = TRUE)
      plotted <- dev.off()
      cc_plots_up <- plot_enrichresult(cc_sig, showCategory = go_categories)
      cc_tree_up_filename <- glue("19clusterProfiler_plots_tx/{name}_up_cc_sig_tree.pdf")
      pp(file = cc_tree_up_filename)
      try(print(cc_plots_up[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      cc_bar_up_filename <- glue("19clusterProfiler_plots_tx/{name}_up_cc_sig_bar.pdf")
      pp(file = cc_bar_up_filename)
      try(print(cc_plots_up[["bar"]]), silent = TRUE)
      plotted <- dev.off()
      bp_plots_up <- plot_enrichresult(bp_sig, showCategory = go_categories)
      bp_tree_up_filename <- glue("19clusterProfiler_plots_tx/{name}_up_bp_sig_tree.pdf")
      pp(file = bp_tree_up_filename)
      try(print(bp_plots_up[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      bp_plots_up <- plot_enrichresult(bp_sig, showCategory = go_categories)
      bp_bar_up_filename <- glue("19clusterProfiler_plots_tx/{name}_up_bp_sig_bar.pdf")
      pp(file = bp_bar_up_filename)
      try(print(bp_plots_up[["bar"]]), silent = TRUE)
      plotted <- dev.off()
    }
    if (length(downp) > 0) {
      mf_sig <- location_cp[[name]][[downp]][["go_data"]][["MF_enrich"]]
      cc_sig <- location_cp[[name]][[downp]][["go_data"]][["CC_enrich"]]
      bp_sig <- location_cp[[name]][[downp]][["go_data"]][["BP_enrich"]]
      mf_plots_down <- plot_enrichresult(mf_sig, showCategory = go_categories)
      mf_tree_down_filename <- glue("19clusterProfiler_plots_tx/{name}_down_mf_sig_tree.pdf")
      pp(file = mf_tree_down_filename)
      try(print(mf_plots_down[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      mf_bar_down_filename <- glue("19clusterProfiler_plots_tx/{name}_down_mf_sig_bar.pdf")
      pp(file = mf_bar_down_filename)
      try(print(mf_plots_down[["bar"]]), silent = TRUE)
      plotted <- dev.off()
      cc_plots_down <- plot_enrichresult(cc_sig, showCategory = 12)
      cc_tree_down_filename <- glue("19clusterProfiler_plots_tx/{name}_down_cc_sig_tree.pdf")
      pp(file = cc_tree_down_filename)
      try(print(cc_plots_down[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      cc_bar_down_filename <- glue("19clusterProfiler_plots_tx/{name}_down_cc_sig_bar.pdf")
      pp(file = cc_bar_down_filename)
      try(print(cc_plots_down[["bar"]]), silent = TRUE)
      plotted <- dev.off()
      bp_plots_down <- plot_enrichresult(bp_sig, showCategory = go_categories)
      bp_tree_down_filename <- glue("19clusterProfiler_plots_tx/{name}_down_bp_sig_tree.pdf")
      pp(file = bp_tree_down_filename)
      try(print(bp_plots_down[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      bp_plots_down <- plot_enrichresult(bp_sig, showCategory = go_categories)
      bp_bar_down_filename <- glue("19clusterProfiler_plots_tx/{name}_down_bp_sig_bar.pdf")
      pp(file = bp_bar_down_filename)
      try(print(bp_plots_down[["bar"]]), silent = TRUE)
      plotted <- dev.off()
    }
  }
}
## Examining dr_p08_het
## There are 206 significant up and down genes.
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in pp(file = mf_tree_up_filename): The directory: 19clusterProfiler_plots_tx does not exist, will attempt to create it.
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Examining dr_p15_het
## There are 308 significant up and down genes.
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Examining dr_p08_ko
## There are 325 significant up and down genes.
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in max(idx1, idx2): no non-missing arguments to max; returning -Inf
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in max(idx1, idx2): no non-missing arguments to max; returning -Inf
## NULL
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Examining dr_p15_ko
## There are 430 significant up and down genes.
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Examining sr_p08_het
## There are 191 significant up and down genes.
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Examining sr_p15_het
## There are 93 significant up and down genes.
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Examining sr_p08_ko
## There are 188 significant up and down genes.
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Examining sr_p15_ko
## There are 31 significant up and down genes.
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Examining ds_p08_het
## There are 45 significant up and down genes.
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Examining ds_p15_het
## There are 613 significant up and down genes.
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Examining ds_p08_ko
## There are 118 significant up and down genes.
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Examining ds_p15_ko
## There are 757 significant up and down genes.
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?

Colenso sent a specific query of interest, comparing SCN vs. Retinas at p08 in the heterozygotes including a set of genes of particular interest. Perhaps I can use some of these as markers to quality control my work in the future?

Here are the genes:

Opn4, Eomes, Trpc7, Oprm1, Nr4a3, Tbx20, Irx6, AW551984, Pcdh19, Adcyap1, Baiap3, Chl1, Grin3a, Igf1, Gria1, Grin2d, Grin3a, Chrna6, Chrna3, Htr5a, Htr2a, Htr7, Irx4, PlxnC1, Sema6d, Sema4f, Sema4a, Sema6b, Lrrc4b, Lrrc58, Lrrc3b, Wnt4, Wnt9b, Ctxn3, Tenm1, Gna14, Rgs4, Rgs6, Rgs5

table_input <- location_tables[["sr_p08_het"]]
table_name <- "sr_p08_het"
table <- table_input[["data"]][[table_name]]
interesting_genes <- c("Opn4", "Eomes", "Trpc7", "Oprm1", "Nr4a3", "Tbx20",
                       "Irx6", "AW551984", "Pcdh19", "Adcyap1r1", "Baiap3",
                       "Chl1", "Grin3a", "Igf1", "Gria1", "Grin2d", "Grin3a",
                       "Chrna6", "Chrna3", "Htr5a", "Htr2a", "Htr7", "Irx4",
                       "PlxnC1", "Sema6d", "Sema4f", "Sema4a", "Sema6b", "Lrrc4b",
                       "Lrrc58", "Lrrc3b", "Wnt4", "Wnt9b", "Ctxn3", "Tenm1", "Gna14",
                       "Rgs4", "Rgs6", "Rgs5", "Pou4f2", "Chrnb3", "Bcan")
sr_p08_het_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq_adjp",
  color_low = colors[["het_retina"]], color_high = colors[["het_scn"]],
  label_column = "mgi_symbol", label = interesting_genes, alpha = 1.0,
  size = 4)
pp(file = "20location_ma_volcano_tx/sr_p08_het_volcano.pdf", width = 9, height = 9)
## Warning in pp(file = "20location_ma_volcano_tx/sr_p08_het_volcano.pdf", : The directory: 20location_ma_volcano_tx does not exist, will
## attempt to create it.
sr_p08_het_volcano[["plot"]]
plotted <- dev.off()
sr_p08_het_volcano[["plot"]]

sr_p08_het_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = colors[["het_retina"]], color_high = colors[["het_scn"]],
  p_col = "deseq_adjp", label_column = "mgi_symbol", label = interesting_genes, outline = outline)
pp(file = "20location_ma_volcano_tx/sr_p08_het_ma.pdf", width = 9, height = 9)
sr_p08_het_ma[["plot"]]
plotted <- dev.off()
sr_p08_het_ma[["plot"]]

20.0.2 Also the ko

table_input <- location_tables[["sr_p08_ko"]]
table_name <- "sr_p08_ko"
table <- table_input[["data"]][[table_name]]
sr_p08_ko_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq_adjp",
  color_low = colors[["ko_retina"]], color_high = colors[["ko_scn"]],
  label_column = "mgi_symbol", label = interesting_genes, alpha = 1.0,
  size = 4)
pp(file = "20location_ma_volcano_tx/sr_p08_ko_volcano.pdf", width = 9, height = 9)
sr_p08_ko_volcano[["plot"]]
plotted <- dev.off()
sr_p08_ko_volcano[["plot"]]

sr_p08_ko_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = colors[["ko_retina"]], color_high = colors[["ko_scn"]],
  p_col = "deseq_adjp", label_column = "mgi_symbol", label = interesting_genes, outline = outline)
pp(file = "20location_ma_volcano_tx/sr_p08_ko_ma.pdf", width = 9, height = 9)
sr_p08_ko_ma[["plot"]]
plotted <- dev.off()
sr_p08_ko_ma[["plot"]]

table_input <- location_tables[["sr_p15_het"]]
table_name <- "sr_p15_het"
table <- table_input[["data"]][[table_name]]
interesting_genes <- c("Opn4", "Eomes", "Trpc7", "Oprm1", "Nr4a3", "Tbx20",
                       "Irx6", "AW551984", "Pcdh19", "Adcyap1r1", "Baiap3",
                       "Chl1", "Grin3a", "Igf1", "Gria1", "Grin2d", "Grin3a",
                       "Chrna6", "Chrna3", "Htr5a", "Htr2a", "Htr7", "Irx4",
                       "PlxnC1", "Sema6d", "Sema4f", "Sema4a", "Sema6b", "Lrrc4b",
                       "Lrrc58", "Lrrc3b", "Wnt4", "Wnt9b", "Ctxn3", "Tenm1", "Gna14",
                       "Rgs4", "Rgs6", "Rgs5", "Pou4f2", "Chrnb3", "Bcan")
sr_p15_het_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq_adjp",
  color_low = colors[["het_retina"]], color_high = colors[["het_scn"]],
  label_column = "mgi_symbol", label = interesting_genes, alpha = 1.0,
  size = 4)
pp(file = "20location_ma_volcano_tx/sr_p15_het_volcano.pdf", width = 9, height = 9)
sr_p15_het_volcano[["plot"]]
plotted <- dev.off()
sr_p15_het_volcano[["plot"]]

sr_p15_het_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = colors[["het_retina"]], color_high = colors[["het_scn"]],
  p_col = "deseq_adjp", label_column = "mgi_symbol", label = interesting_genes, outline = outline)
pp(file = "20location_ma_volcano_tx/sr_p15_het_ma.pdf", width = 9, height = 9)
sr_p15_het_ma[["plot"]]
plotted <- dev.off()
sr_p15_het_ma[["plot"]]

20.0.3 Also the ko

table_input <- location_tables[["sr_p15_ko"]]
table_name <- "sr_p15_ko"
table <- table_input[["data"]][[table_name]]
sr_p15_ko_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq_adjp",
  color_low = colors[["ko_retina"]], color_high = colors[["ko_scn"]],
  label_column = "mgi_symbol", label = interesting_genes, alpha = 1.0,
  size = 4, min.segment.length = 0, point.padding = 0.2)
pp(file = "20location_ma_volcano_tx/sr_p15_ko_volcano.pdf", width = 12, height = 12)
sr_p15_ko_volcano[["plot"]]
plotted <- dev.off()
sr_p15_ko_volcano[["plot"]]

sr_p15_ko_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = colors[["ko_retina"]], color_high = colors[["ko_scn"]],
  p_col = "deseq_adjp", label_column = "mgi_symbol", label = interesting_genes, outline = outline)
pp(file = "20location_ma_volcano_tx/sr_p15_ko_ma.pdf", width = 9, height = 9)
sr_p15_ko_ma[["plot"]]
plotted <- dev.off()
sr_p15_ko_ma[["plot"]]

20.0.3.1 Test a specific location query for duplicated IDs

Let us see if any Ensembl gene IDs and/or MGI IDs are shared in the worksheet location_sr_p08_ko_including_wt_0.1_decreased_sig up/down.

test_table_up <- location_sig[["sr_p08_ko"]][["deseq"]][["ups"]][[1]]
test_table_down <- location_sig[["sr_p08_ko"]][["deseq"]][["downs"]][[1]]

query <- list("up" = rownames(test_table_up),
              "down" = rownames(test_table_down))
query_upset <- UpSetR::fromList(query)
UpSetR::upset(query_upset)
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?

query <- list("up" = test_table_up[["mgi_symbol"]],
              "down" = test_table_down[["mgi_symbol"]])
query_upset <- UpSetR::fromList(query)
UpSetR::upset(query_upset)
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?

## ok, good.

20.0.3.2 Repeat with the strict filter

location_strict_tables <- list()
location_strict_sig <- list()
location_strict_gp <- list()
location_strict_cp <- list()
for (k in seq_along(location_keepers)) {
  name <- names(location_keepers)[k]
  message("Examining ", name)
  keeper <- location_keepers[name]
  includes <- location_inclusions_strict[[name]]
  include_name <- paste0("inc_", name)
  include_df_name <- paste0("df_", name)
  include_df <- location_inclusions_strict[[include_df_name]]
  includes <- location_inclusions_strict[[include_name]]
  found_includes <- rownames(location_sig_full[["deseq"]][["ups"]][[name]]) %in% includes
  summary(found_includes)
  if (sum(found_includes) == 0) {
    next
  }
  include_filename <- glue("21location_strict_contrasts_tx/{name}_including_wt_{lfc_cutoff}_decreased_table-v{ver}.xlsx")
  include_sig_filename <- glue("21location_strict_contrasts_tx/{name}_including_wt_{lfc_cutoff}_decreased_sig-v{ver}.xlsx")
  location_strict_tables[[name]] <- combine_de_tables(
    location_de, extra_annot = include_df,
    keepers = keeper, label_column = label_column,
    excel = include_filename, wanted_genes = includes)
  print(location_strict_tables[[name]])
  location_strict_sig[[name]] <- extract_significant_genes(
    location_strict_tables[[name]], according_to = "deseq",
    excel = include_sig_filename)
  print(location_strict_sig[[name]])
  num_rows <- nrow(location_strict_sig[[name]][["deseq"]][["ups"]][[name]]) +
    nrow(location_strict_sig[[name]][["deseq"]][["downs"]][[name]])
  message("There are ", num_rows, " significant up and down genes.")
  if (num_rows > 10) {
    location_strict_gp[[name]] <- all_gprofiler(location_strict_sig[[name]], species = "mmusculus")
    location_strict_cp[[name]] <- all_cprofiler(
      location_strict_sig[[name]], location_strict_tables[[name]],
      orgdb = "org.Mm.eg.db", go_level = go_level, orgdb_from = orgdb_from,
      max_groupsize = max_groupsize, organism = "mouse")
    cp_written <- write_all_cp(location_strict_cp[[name]], prefix = "22", suffix = "strict")
    gp_written <- write_all_gp(location_strict_gp[[name]], prefix = "22", suffix = "strict")
  }
}
## Examining dr_p08_het
## Looking for subscript invalid names, end of extract_keepers.
## The result table is too small for meaningful comparisons.
## The first table has only: 22.
## A set of combined differential expression results.
##                            table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p08_het_dlgn_vs_p08_het_retina           6             2           6             1           6             1
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.

## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##            deseq_up deseq_down
## dr_p08_het        6          2

## There are 8 significant up and down genes.
## Examining dr_p15_het
## Looking for subscript invalid names, end of extract_keepers.
## A set of combined differential expression results.
##                            table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p15_het_dlgn_vs_p15_het_retina          19             1          21             1          17             1
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.

## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##            deseq_up deseq_down
## dr_p15_het       19          1

## There are 20 significant up and down genes.
## There are 9 genes deemed significant out of 28.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## No gene sets have size between 5 and 2000 ...
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## no term enriched under specific pvalueCutoff...
## Deleting the file excel/all_cp_dr_p15_het_up.xlsx before writing the tables.
## There are 1 genes deemed significant out of 28.
## There are 1 entries which match the search string: Mus musculus.
## No gene sets have size between 5 and 500 ...
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## no term enriched under specific pvalueCutoff...
## --> No gene can be mapped....
## --> Expected input gene ID: 217698,170768,22236,66646,74419,72094
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## no term enriched under specific pvalueCutoff...
## Deleting the file excel/all_cp_dr_p15_het_down.xlsx before writing the tables.
## Examining dr_p08_ko
## Looking for subscript invalid names, end of extract_keepers.
## A set of combined differential expression results.
##                          table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p08_ko_dlgn_vs_p08_ko_retina          36             1          38             1          27             1
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.

## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##           deseq_up deseq_down
## dr_p08_ko       36          1

## There are 37 significant up and down genes.
## There are 17 genes deemed significant out of 34.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## no term enriched under specific pvalueCutoff...
## Deleting the file excel/all_cp_dr_p08_ko_up.xlsx before writing the tables.
## There are 1 genes deemed significant out of 34.
## There are 1 entries which match the search string: Mus musculus.
## No gene sets have size between 5 and 500 ...
## --> return NULL...
## No gene sets have size between 5 and 500 ...
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## no term enriched under specific pvalueCutoff...
## --> No gene can be mapped....
## --> Expected input gene ID: 11522,18641,224530,230639,16591,171281
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## no term enriched under specific pvalueCutoff...
## --> No gene can be mapped....
## --> Expected input gene ID: 14079,11761,18719,19223,27377,100042295
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## no term enriched under specific pvalueCutoff...
## Deleting the file excel/all_cp_dr_p08_ko_down.xlsx before writing the tables.
## Examining dr_p15_ko
## Looking for subscript invalid names, end of extract_keepers.
## The result table is too small for meaningful comparisons.
## The first table has only: 16.
## A set of combined differential expression results.
##                          table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p15_ko_dlgn_vs_p15_ko_retina           5             0           6             0           3             0
## Only dr_p15_ko_up has information, cannot create an UpSet.
## Plot describing unique/shared genes in a differential expression table.
## NULL
## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##           deseq_up deseq_down
## dr_p15_ko        5          0

## There are 5 significant up and down genes.
## Examining sr_p08_het
## Examining sr_p15_het
## Examining sr_p08_ko
## Looking for subscript invalid names, end of extract_keepers.
## The result table is too small for meaningful comparisons.
## The first table has only: 3.
## A set of combined differential expression results.
##                         table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p08_ko_scn_vs_p08_ko_retina           2             0           2             0           2             0
## Only sr_p08_ko_up has information, cannot create an UpSet.
## Plot describing unique/shared genes in a differential expression table.
## NULL
## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##           deseq_up deseq_down
## sr_p08_ko        2          0

## There are 2 significant up and down genes.
## Examining sr_p15_ko
## Looking for subscript invalid names, end of extract_keepers.
## The result table is too small for meaningful comparisons.
## The first table has only: 1.
## A set of combined differential expression results.
##                         table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p15_ko_scn_vs_p15_ko_retina           1             0           1             0           1             0
## Only sr_p15_ko_up has information, cannot create an UpSet.
## Plot describing unique/shared genes in a differential expression table.
## NULL
## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##           deseq_up deseq_down
## sr_p15_ko        1          0

## There are 1 significant up and down genes.
## Examining ds_p08_het
## Examining ds_p15_het
## Examining ds_p08_ko
## Examining ds_p15_ko

Print out all the plots in a separate block.

for (k in seq_along(location_keepers)) {
  name <- names(location_keepers)[k]
  message("Examining ", name)
  keeper <- location_keepers[name]
  includes <- location_inclusions_strict[[name]]
  include_name <- paste0("inc_", name)
  include_df_name <- paste0("df_", name)
  include_df <- location_inclusions_strict[[include_df_name]]
  includes <- location_inclusions_strict[[include_name]]
  summary(rownames(location_sig_full[["deseq"]][["ups"]][[name]]) %in% includes)
  num_rows <- nrow(location_strict_sig[[name]][["deseq"]][["ups"]][[name]]) +
    nrow(location_strict_sig[[name]][["deseq"]][["downs"]][[name]])
  nrow(location_strict_sig[[name]][["deseq"]][["ups"]][[name]])
  nrow(location_strict_sig[[name]][["deseq"]][["downs"]][[name]])
  message("There are ", num_rows, " significant up and down genes.")
  num_objects <- length(location_strict_cp[[name]])
  if (num_objects == 0) {
    warning("Something went wrong in all_cprofiler.")
  } else {
    upp <- which(grepl(x = names(location_strict_cp[[name]]), pattern = "_up$"))
    downp <- which(grepl(x = names(location_strict_cp[[name]]), pattern = "_down$"))
    if (length(upp) > 0) {
      mf_sig <- location_strict_cp[[name]][[upp]][["go_data"]][["MF_enrich"]]
      cc_sig <- location_strict_cp[[name]][[upp]][["go_data"]][["CC_enrich"]]
      bp_sig <- location_strict_cp[[name]][[upp]][["go_data"]][["BP_enrich"]]
      mf_plots_up <- plot_enrichresult(mf_sig, showCategory = go_categories)
      mf_tree_up_filename <- glue("23clusterProfiler_plots_tx/{name}_up_mf_sig_tree.pdf")
      pp(file = mf_tree_up_filename)
      try(print(mf_plots_up[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      mf_bar_up_filename <- glue("23clusterProfiler_plots_tx/{name}_up_mf_sig_bar.pdf")
      pp(file = mf_bar_up_filename)
      try(print(mf_plots_up[["bar"]]), silent = TRUE)
      plotted <- dev.off()
      cc_plots_up <- plot_enrichresult(cc_sig, showCategory = go_categories)
      cc_tree_up_filename <- glue("23clusterProfiler_plots_tx/{name}_up_cc_sig_tree.pdf")
      pp(file = cc_tree_up_filename)
      try(print(cc_plots_up[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      cc_bar_up_filename <- glue("23clusterProfiler_plots_tx/{name}_up_cc_sig_bar.pdf")
      pp(file = cc_bar_up_filename)
      try(print(cc_plots_up[["bar"]]), silent = TRUE)
      plotted <- dev.off()
      bp_plots_up <- plot_enrichresult(bp_sig, showCategory = go_categories)
      bp_tree_up_filename <- glue("23clusterProfiler_plots_tx/{name}_up_bp_sig_tree.pdf")
      pp(file = bp_tree_up_filename)
      try(print(bp_plots_up[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      bp_plots_up <- plot_enrichresult(bp_sig, showCategory = go_categories)
      bp_bar_up_filename <- glue("23clusterProfiler_plots_tx/{name}_up_bp_sig_bar.pdf")
      pp(file = bp_bar_up_filename)
      try(print(bp_plots_up[["bar"]]), silent = TRUE)
      plotted <- dev.off()
    }
    if (length(downp) > 0) {
      mf_sig <- location_strict_cp[[name]][[downp]][["go_data"]][["MF_enrich"]]
      cc_sig <- location_strict_cp[[name]][[downp]][["go_data"]][["CC_enrich"]]
      bp_sig <- location_strict_cp[[name]][[downp]][["go_data"]][["BP_enrich"]]
      mf_plots_down <- plot_enrichresult(mf_sig, showCategory = go_categories)
      mf_tree_down_filename <- glue("23clusterProfiler_plots_tx/{name}_down_mf_sig_tree.pdf")
      pp(file = mf_tree_down_filename)
      try(print(mf_plots_down[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      mf_bar_down_filename <- glue("23clusterProfiler_plots_tx/{name}_down_mf_sig_bar.pdf")
      pp(file = mf_bar_down_filename)
      try(print(mf_plots_down[["bar"]]), silent = TRUE)
      plotted <- dev.off()
      cc_plots_down <- plot_enrichresult(cc_sig, showCategory = 12)
      cc_tree_down_filename <- glue("23clusterProfiler_plots_tx/{name}_down_cc_sig_tree.pdf")
      pp(file = cc_tree_down_filename)
      try(print(cc_plots_down[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      cc_bar_down_filename <- glue("23clusterProfiler_plots_tx/{name}_down_cc_sig_bar.pdf")
      pp(file = cc_bar_down_filename)
      try(print(cc_plots_down[["bar"]]), silent = TRUE)
      plotted <- dev.off()
      bp_plots_down <- plot_enrichresult(bp_sig, showCategory = go_categories)
      bp_tree_down_filename <- glue("23clusterProfiler_plots_tx/{name}_down_bp_sig_tree.pdf")
      pp(file = bp_tree_down_filename)
      try(print(bp_plots_down[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      bp_plots_down <- plot_enrichresult(bp_sig, showCategory = go_categories)
      bp_bar_down_filename <- glue("23clusterProfiler_plots_tx/{name}_down_bp_sig_bar.pdf")
      pp(file = bp_bar_down_filename)
      try(print(bp_plots_down[["bar"]]), silent = TRUE)
      plotted <- dev.off()
    }
  }
}
## Examining dr_p08_het
## There are 8 significant up and down genes.
## Warning: Something went wrong in all_cprofiler.
## Examining dr_p15_het
## There are 20 significant up and down genes.
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in pp(file = mf_tree_up_filename): The directory: 23clusterProfiler_plots_tx does not exist, will attempt to create it.
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Examining dr_p08_ko
## There are 37 significant up and down genes.
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Examining dr_p15_ko
## There are 5 significant up and down genes.
## Warning: Something went wrong in all_cprofiler.
## Examining sr_p08_het
## There are  significant up and down genes.
## Warning: Something went wrong in all_cprofiler.
## Examining sr_p15_het
## There are  significant up and down genes.
## Warning: Something went wrong in all_cprofiler.
## Examining sr_p08_ko
## There are 2 significant up and down genes.
## Warning: Something went wrong in all_cprofiler.
## Examining sr_p15_ko
## There are 1 significant up and down genes.
## Warning: Something went wrong in all_cprofiler.
## Examining ds_p08_het
## There are  significant up and down genes.
## Warning: Something went wrong in all_cprofiler.
## Examining ds_p15_het
## There are  significant up and down genes.
## Warning: Something went wrong in all_cprofiler.
## Examining ds_p08_ko
## There are  significant up and down genes.
## Warning: Something went wrong in all_cprofiler.
## Examining ds_p15_ko
## There are  significant up and down genes.
## Warning: Something went wrong in all_cprofiler.

Colenso sent a specific query of interest, comparing SCN vs. Retinas at p08 in the heterozygotes including a set of genes of particular interest. Perhaps I can use some of these as markers to quality control my work in the future?

Here are the genes:

Opn4, Eomes, Trpc7, Oprm1, Nr4a3, Tbx20, Irx6, AW551984, Pcdh19, Adcyap1, Baiap3, Chl1, Grin3a, Igf1, Gria1, Grin2d, Grin3a, Chrna6, Chrna3, Htr5a, Htr2a, Htr7, Irx4, PlxnC1, Sema6d, Sema4f, Sema4a, Sema6b, Lrrc4b, Lrrc58, Lrrc3b, Wnt4, Wnt9b, Ctxn3, Tenm1, Gna14, Rgs4, Rgs6, Rgs5

table_input <- location_strict_tables[["sr_p08_het"]]
table_name <- "sr_p08_het"
table <- table_input[["data"]][[table_name]]
interesting_genes <- c("Opn4", "Eomes", "Trpc7", "Oprm1", "Nr4a3", "Tbx20",
                       "Irx6", "AW551984", "Pcdh19", "Adcyap1r1", "Baiap3",
                       "Chl1", "Grin3a", "Igf1", "Gria1", "Grin2d", "Grin3a",
                       "Chrna6", "Chrna3", "Htr5a", "Htr2a", "Htr7", "Irx4",
                       "PlxnC1", "Sema6d", "Sema4f", "Sema4a", "Sema6b", "Lrrc4b",
                       "Lrrc58", "Lrrc3b", "Wnt4", "Wnt9b", "Ctxn3", "Tenm1", "Gna14",
                       "Rgs4", "Rgs6", "Rgs5", "Pou4f2", "Chrnb3", "Bcan")
sr_p08_het_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq_adjp",
  color_low = colors[["het_retina"]], color_high = colors[["het_scn"]],
  label_column = "mgi_symbol", label = interesting_genes, alpha = 1.0,
  size = 4)
## Error in `plot_volcano_condition_de()`:
## ! Column: deseq_logfc is not in the table.
pp(file = "24location_ma_volcano_strict_tx/sr_p08_het_volcano.pdf", width = 9, height = 9)
## Warning in pp(file = "24location_ma_volcano_strict_tx/sr_p08_het_volcano.pdf", : The directory: 24location_ma_volcano_strict_tx does not
## exist, will attempt to create it.
sr_p08_het_volcano[["plot"]]
plotted <- dev.off()
sr_p08_het_volcano[["plot"]]

sr_p08_het_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = colors[["het_retina"]], color_high = colors[["het_scn"]],
  p_col = "deseq_adjp", label_column = "mgi_symbol", label = interesting_genes, outline = outline)
## The column: mgi_symbol is not in the data, using rownames.
## Warning in max(newdf[["avg"]]): no non-missing arguments to max; returning -Inf
## Warning in plot_ma_condition_de(table, table_name, expr_col = "deseq_basemean", : NAs introduced by coercion
## Error in `[[<-.data.frame`:
## ! replacement has 1 row, data has 0
pp(file = "24location_ma_volcano_strict_tx/sr_p08_het_ma.pdf", width = 9, height = 9)
sr_p08_het_ma[["plot"]]
plotted <- dev.off()
sr_p08_het_ma[["plot"]]

20.0.4 Also the ko

table_input <- location_strict_tables[["sr_p08_ko"]]
table_name <- "sr_p08_ko"
table <- table_input[["data"]][[table_name]]
sr_p08_ko_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq_adjp",
  color_low = colors[["ko_retina"]], color_high = colors[["ko_scn"]],
  label_column = "mgi_symbol", label = interesting_genes, alpha = 1.0,
  size = 4)
pp(file = "24location_ma_volcano_strict_tx/sr_p08_ko_volcano.pdf", width = 9, height = 9)
sr_p08_ko_volcano[["plot"]]
plotted <- dev.off()
sr_p08_ko_volcano[["plot"]]

sr_p08_ko_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = colors[["ko_retina"]], color_high = colors[["ko_scn"]],
  p_col = "deseq_adjp", label_column = "mgi_symbol", label = interesting_genes, outline = outline)
pp(file = "24location_ma_volcano_strict_tx/sr_p08_ko_ma.pdf", width = 9, height = 9)
sr_p08_ko_ma[["plot"]]
plotted <- dev.off()
sr_p08_ko_ma[["plot"]]

20.0.5 Also the ko

table_input <- location_tables[["sr_p15_ko"]]
table_name <- "sr_p15_ko"
table <- table_input[["data"]][[table_name]]
sr_p15_ko_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq_adjp",
  color_low = colors[["ko_retina"]], color_high = colors[["ko_scn"]],
  label_column = "mgi_symbol", label = interesting_genes, alpha = 1.0,
  size = 4, min.segment.length = 0, point.padding = 0.2)
pp(file = "24location_ma_volcano_strict_tx/sr_p15_ko_volcano.pdf", width = 12, height = 12)
sr_p15_ko_volcano[["plot"]]
plotted <- dev.off()
sr_p15_ko_volcano[["plot"]]

sr_p15_ko_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = colors[["ko_retina"]], color_high = colors[["ko_scn"]],
  p_col = "deseq_adjp", label_column = "mgi_symbol", label = interesting_genes, outline = outline)
pp(file = "24location_ma_volcano_strict_tx/sr_p15_ko_ma.pdf", width = 9, height = 9)
sr_p15_ko_ma[["plot"]]
plotted <- dev.off()
sr_p15_ko_ma[["plot"]]

20.0.6 And time

time_tables_full <- combine_de_tables(
  time_de, keepers = time_keepers,
  label_column = label_column,
  excel = glue("25full_contrasts_time_tx/full_tables-v{ver}.xlsx"))
## Looking for subscript invalid names, end of extract_keepers.
time_sig_full <- extract_significant_genes(
  time_tables_full, according_to = "deseq",
  excel = glue("25full_contrasts_time_tx/full_sig-v{ver}.xlsx"))
time_tables <- list()
time_sig <- list()
time_gp <- list()
time_cp <- list()
for (k in seq_along(time_keepers)) {
  name <- names(time_keepers)[k]
  message("Examining ", name)
  keeper <- time_keepers[name]
  includes <- time_inclusions[[name]]
  include_name <- paste0("inc_", name)
  include_df_name <- paste0("df_", name)
  include_df <- time_inclusions[[include_df_name]]
  includes <- time_inclusions[[include_name]]
  summary(rownames(time_sig_full[["deseq"]][["ups"]][[name]]) %in% includes)
  include_filename <- glue("26time_contrasts_tx/{name}_including_wt_{lfc_cutoff}_decreased_table-v{ver}.xlsx")
  include_sig_filename <- glue("26time_contrasts_tx/{name}_including_wt_{lfc_cutoff}_decreased_sig-v{ver}.xlsx")
  time_tables[[name]] <- combine_de_tables(
    time_de, extra_annot = include_df,
    keepers = keeper, label_column = label_column,
    excel = include_filename, wanted_genes = includes)
  print(time_tables[[name]])
  time_sig[[name]] <- extract_significant_genes(
    time_tables[[name]], according_to = "deseq",
    excel = include_sig_filename)
  print(time_sig[[name]])
  num_rows <- nrow(time_sig[[name]][["deseq"]][["ups"]][[name]]) +
    nrow(time_sig[[name]][["deseq"]][["downs"]][[name]])
  message("There are ", num_rows, " significant up and down genes.")
  if (num_rows > 10) {
    time_gp[[name]] <- all_gprofiler(time_sig[[name]], species = "mmusculus")
    gp_written <- write_all_gp(time_gp[[name]])
    time_cp[[name]] <- all_cprofiler(
      time_sig[[name]], time_tables[[name]], orgdb = "org.Mm.eg.db", organism = "mouse",
      orgdb_from = orgdb_from, go_level = go_level, max_groupsize = max_groupsize)
    cp_written <- write_all_cp(time_cp[[name]], prefix = "27")
    gp_written <- write_all_gp(time_gp[[name]], prefix = "27")
  }
}
## Examining t_het_dlgn
## Looking for subscript invalid names, end of extract_keepers.
## A set of combined differential expression results.
##                          table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p15_het_dlgn_vs_p08_het_dlgn         281             9         255             9         197             8
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.

## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##            deseq_up deseq_down
## t_het_dlgn      281          9

## There are 290 significant up and down genes.
## There are 113 genes deemed significant out of 461.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (3.25% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : There were 4 pathways for which P-values were not
## calculated properly due to unbalanced (positive and negative) gene-level statistic values. For such pathways pval, padj, NES, log2err are set
## to NA. You can try to increase the value of the argument nPermSimple (for example set it nPermSimple = 10000)
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : For some of the pathways the P-values were likely
## overestimated. For such pathways log2err is set to NA.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (3.3% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : For some of the pathways the P-values were likely overestimated. For such pathways log2err is set to NA.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (3.25% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (3.25% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (3.25% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Deleting the file excel/all_cp_t_het_dlgn_up.xlsx before writing the tables.
## There are 4 genes deemed significant out of 461.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (3.25% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : There were 4 pathways for which P-values were not
## calculated properly due to unbalanced (positive and negative) gene-level statistic values. For such pathways pval, padj, NES, log2err are set
## to NA. You can try to increase the value of the argument nPermSimple (for example set it nPermSimple = 10000)
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : For some of the pathways the P-values were likely
## overestimated. For such pathways log2err is set to NA.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (3.3% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : For some of the pathways the P-values were likely overestimated. For such pathways log2err is set to NA.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (3.25% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (3.25% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (3.25% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Deleting the file excel/all_cp_t_het_dlgn_down.xlsx before writing the tables.
## Examining t_ko_dlgn
## Looking for subscript invalid names, end of extract_keepers.
## A set of combined differential expression results.
##                        table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p15_ko_dlgn_vs_p08_ko_dlgn         357            89         390            87         338            73
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.

## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##           deseq_up deseq_down
## t_ko_dlgn      357         89

## There are 446 significant up and down genes.
## There are 158 genes deemed significant out of 697.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.87% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : There were 25 pathways for which P-values were not
## calculated properly due to unbalanced (positive and negative) gene-level statistic values. For such pathways pval, padj, NES, log2err are set
## to NA. You can try to increase the value of the argument nPermSimple (for example set it nPermSimple = 10000)
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : For some of the pathways the P-values were likely
## overestimated. For such pathways log2err is set to NA.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.9% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.87% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.87% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.87% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Deleting the file excel/all_cp_t_ko_dlgn_up.xlsx before writing the tables.
## There are 49 genes deemed significant out of 697.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.87% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : There were 23 pathways for which P-values were not
## calculated properly due to unbalanced (positive and negative) gene-level statistic values. For such pathways pval, padj, NES, log2err are set
## to NA. You can try to increase the value of the argument nPermSimple (for example set it nPermSimple = 10000)
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : For some of the pathways the P-values were likely
## overestimated. For such pathways log2err is set to NA.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.9% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.87% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.87% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (1.87% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Deleting the file excel/all_cp_t_ko_dlgn_down.xlsx before writing the tables.
## Examining t_het_retina
## Looking for subscript invalid names, end of extract_keepers.
## A set of combined differential expression results.
##                              table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p15_het_retina_vs_p08_het_retina          30           103          30           116          24           102
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.

## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##              deseq_up deseq_down
## t_het_retina       30        103

## There are 133 significant up and down genes.
## There are 17 genes deemed significant out of 248.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## Deleting the file excel/all_cp_t_het_retina_up.xlsx before writing the tables.
## There are 38 genes deemed significant out of 248.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## Deleting the file excel/all_cp_t_het_retina_down.xlsx before writing the tables.
## Examining t_ko_retina
## Looking for subscript invalid names, end of extract_keepers.
## A set of combined differential expression results.
##                            table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p15_ko_retina_vs_p08_ko_retina          12           136          11           143           9           134
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.

## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##             deseq_up deseq_down
## t_ko_retina       12        136

## There are 148 significant up and down genes.
## There are 6 genes deemed significant out of 227.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.88% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.88% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.88% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.88% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.88% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Deleting the file excel/all_cp_t_ko_retina_up.xlsx before writing the tables.
## There are 45 genes deemed significant out of 227.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.88% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.88% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.88% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.88% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.88% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Deleting the file excel/all_cp_t_ko_retina_down.xlsx before writing the tables.
## Examining t_het_scn
## Looking for subscript invalid names, end of extract_keepers.
## The result table is too small for meaningful comparisons.
## The first table has only: 17.
## A set of combined differential expression results.
##                        table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p15_het_scn_vs_p08_het_scn           0             1           0             1           0             1
## Only t_het_scn_down has information, cannot create an UpSet.
## Plot describing unique/shared genes in a differential expression table.
## NULL
## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##           deseq_up deseq_down
## t_het_scn        0          1

## There are 1 significant up and down genes.
## Examining t_ko_scn
## Looking for subscript invalid names, end of extract_keepers.
## The result table is too small for meaningful comparisons.
## The first table has only: 8.
## A set of combined differential expression results.
##                      table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p15_ko_scn_vs_p08_ko_scn           0             0           0             0           0             0
## Only  has information, cannot create an UpSet.
## Plot describing unique/shared genes in a differential expression table.
## NULL
## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##          deseq_up deseq_down
## t_ko_scn        0          0
## There are 0 significant up and down genes.

Send the plots separately.

for (k in seq_along(time_keepers)) {
  name <- names(time_keepers)[k]
  message("Examining ", name)
  keeper <- time_keepers[name]
  includes <- time_inclusions[[name]]
  include_name <- paste0("inc_", name)
  include_df_name <- paste0("df_", name)
  include_df <- time_inclusions[[include_df_name]]
  includes <- time_inclusions[[include_name]]
  num_rows <- nrow(time_sig[[name]][["deseq"]][["ups"]][[name]]) +
    nrow(time_sig[[name]][["deseq"]][["downs"]][[name]])
  message("There are ", num_rows, " significant up and down genes.")
  num_objects <- length(time_cp[[name]])
  if (num_objects == 0) {
    warning("Something failed in all_cprofiler.")
  } else {
    upp <- which(grepl(x = names(time_cp[[name]]), pattern = "_up$"))
    downp <- which(grepl(x = names(time_cp[[name]]), pattern = "_down$"))
    if (length(upp) > 0) {
      mf_sig <- time_cp[[name]][[upp]][["go_data"]][["MF_enrich"]]
      cc_sig <- time_cp[[name]][[upp]][["go_data"]][["CC_enrich"]]
      bp_sig <- time_cp[[name]][[upp]][["go_data"]][["BP_enrich"]]
      mf_plots_up <- plot_enrichresult(mf_sig, showCategory = go_categories)
      mf_tree_up_filename <- glue("28clusterProfiler_plots_tx/{name}_up_mf_sig_tree.pdf")
      pp(file = mf_tree_up_filename)
      try(print(mf_plots_up[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      mf_bar_up_filename <- glue("28clusterProfiler_plots_tx/{name}_up_mf_sig_bar.pdf")
      pp(file = mf_bar_up_filename)
      try(print(mf_plots_up[["bar"]]), silent = TRUE)
      plotted <- dev.off()
      cc_plots_up <- plot_enrichresult(cc_sig, showCategory = go_categories)
      cc_tree_up_filename <- glue("28clusterProfiler_plots_tx/{name}_up_cc_sig_tree.pdf")
      pp(file = cc_tree_up_filename)
      try(print(cc_plots_up[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      cc_bar_up_filename <- glue("28clusterProfiler_plots_tx/{name}_up_cc_sig_bar.pdf")
      pp(file = cc_bar_up_filename)
      try(print(cc_plots_up[["bar"]]), silent = TRUE)
      plotted <- dev.off()
      bp_plots_up <- plot_enrichresult(bp_sig, showCategory = go_categories)
      bp_tree_up_filename <- glue("28clusterProfiler_plots_tx/{name}_up_bp_sig_tree.pdf")
      pp(file = bp_tree_up_filename)
      try(print(bp_plots_up[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      bp_plots_up <- plot_enrichresult(bp_sig, showCategory = go_categories)
      bp_bar_up_filename <- glue("28clusterProfiler_plots_tx/{name}_up_bp_sig_bar.pdf")
      pp(file = bp_bar_up_filename)
      try(print(bp_plots_up[["bar"]]), silent = TRUE)
      plotted <- dev.off()
    }
    if (length(downp) > 0) {
      mf_sig <- time_cp[[name]][[downp]][["go_data"]][["MF_enrich"]]
      cc_sig <- time_cp[[name]][[downp]][["go_data"]][["CC_enrich"]]
      bp_sig <- time_cp[[name]][[downp]][["go_data"]][["BP_enrich"]]
      mf_plots_down <- plot_enrichresult(mf_sig, showCategory = go_categories)
      mf_tree_down_filename <- glue("28clusterProfiler_plots_tx/{name}_down_mf_sig_tree.pdf")
      pp(file = mf_tree_down_filename)
      try(print(mf_plots_down[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      mf_bar_down_filename <- glue("28clusterProfiler_plots_tx/{name}_down_mf_sig_bar.pdf")
      pp(file = mf_bar_down_filename)
      try(print(mf_plots_down[["bar"]]), silent = TRUE)
      plotted <- dev.off()
      cc_plots_down <- plot_enrichresult(cc_sig, showCategory = go_categories)
      cc_tree_down_filename <- glue("28clusterProfiler_plots_tx/{name}_down_cc_sig_tree.pdf")
      pp(file = cc_tree_down_filename)
      try(print(cc_plots_down[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      cc_bar_down_filename <- glue("28clusterProfiler_plots_tx/{name}_down_cc_sig_bar.pdf")
      pp(file = cc_bar_down_filename)
      try(print(cc_plots_down[["bar"]]), silent = TRUE)
      plotted <- dev.off()
      bp_plots_down <- plot_enrichresult(bp_sig, showCategory = go_categories)
      bp_tree_down_filename <- glue("28clusterProfiler_plots_tx/{name}_down_bp_sig_tree.pdf")
      pp(file = bp_tree_down_filename)
      try(print(bp_plots_down[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      bp_plots_down <- plot_enrichresult(bp_sig, showCategory = go_categories)
      bp_bar_down_filename <- glue("28clusterProfiler_plots_tx/{name}_down_bp_sig_bar.pdf")
      pp(file = bp_bar_down_filename)
      try(print(bp_plots_down[["bar"]]), silent = TRUE)
      plotted <- dev.off()
    }
  }
}
## Examining t_het_dlgn
## There are 290 significant up and down genes.
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in pp(file = mf_tree_up_filename): The directory: 28clusterProfiler_plots_tx does not exist, will attempt to create it.
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Examining t_ko_dlgn
## There are 446 significant up and down genes.
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Examining t_het_retina
## There are 133 significant up and down genes.
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Examining t_ko_retina
## There are 148 significant up and down genes.
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Examining t_het_scn
## There are 1 significant up and down genes.
## Warning: Something failed in all_cprofiler.
## Examining t_ko_scn
## There are 0 significant up and down genes.
## Warning: Something failed in all_cprofiler.

20.1 Volcano plots by time

20.1.1 t_het_dlgn

table_name <- "t_het_dlgn"
table_input <- time_tables[[table_name]]
table <- table_input[["data"]][[table_name]]
t_het_dlgn_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq_adjp",
  color_low = time_colors[["p08_het_dlgn"]], color_high = time_colors[["p15_het_dlgn"]],
  label_column = "mgi_symbol", label = interesting_genes, alpha = 1.0,
  size = 4, min.segment.length = 0, point.padding = 0.2)
pp(file = "29time_ma_volcano_tx/t_het_dlgn_volcano.pdf", width = 12, height = 12)
## Warning in pp(file = "29time_ma_volcano_tx/t_het_dlgn_volcano.pdf", width = 12, : The directory: 29time_ma_volcano_tx does not exist, will
## attempt to create it.
t_het_dlgn_volcano[["plot"]]
plotted <- dev.off()
t_het_dlgn_volcano[["plot"]]

t_het_dlgn_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = time_colors[["p08_het_dlgn"]], color_high = time_colors[["p15_het_dlgn"]],
  p_col = "deseq_adjp", label_column = "mgi_symbol", label = interesting_genes, outline = outline)
pp(file = "29time_ma_volcano_tx/t_het_dlgn_ma.pdf", width = 9, height = 9)
t_het_dlgn_ma[["plot"]]
plotted <- dev.off()
t_het_dlgn_ma[["plot"]]

20.1.2 t_ko_dlgn

table_name <- "t_ko_dlgn"
table_input <- time_tables[[table_name]]
table <- table_input[["data"]][[table_name]]
t_ko_dlgn_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq_adjp",
  color_low = time_colors[["p08_het_dlgn"]], color_high = time_colors[["p15_het_dlgn"]],
  label_column = "mgi_symbol", label = interesting_genes, alpha = 1.0,
  size = 4, min.segment.length = 0, point.padding = 0.2)
pp(file = "29time_ma_volcano_tx/t_ko_dlgn_volcano.pdf", width = 12, height = 12)
t_ko_dlgn_volcano[["plot"]]
plotted <- dev.off()
t_ko_dlgn_volcano[["plot"]]

t_ko_dlgn_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = time_colors[["p08_het_dlgn"]], color_high = time_colors[["p15_het_dlgn"]],
  p_col = "deseq_adjp", label_column = "mgi_symbol", label = interesting_genes, outline = outline)
pp(file = "29time_ma_volcano_tx/t_ko_dlgn_ma.pdf", width = 9, height = 9)
t_ko_dlgn_ma[["plot"]]
plotted <- dev.off()
t_ko_dlgn_ma[["plot"]]

20.1.3 t_het_retina

table_name <- "t_het_retina"
table_input <- time_tables[[table_name]]
table <- table_input[["data"]][[table_name]]
t_het_retina_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq_adjp",
  color_low = time_colors[["p08_het_retina"]], color_high = time_colors[["p15_het_retina"]],
  label_column = "mgi_symbol", label = interesting_genes, alpha = 1.0,
  size = 4, min.segment.length = 0, point.padding = 0.2)
pp(file = "29time_ma_volcano_tx/t_het_retina_volcano.pdf", width = 12, height = 12)
t_het_retina_volcano[["plot"]]
plotted <- dev.off()
t_het_retina_volcano[["plot"]]

t_het_retina_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = time_colors[["p08_het_retina"]], color_high = time_colors[["p15_het_retina"]],
  p_col = "deseq_adjp", label_column = "mgi_symbol", label = interesting_genes, outline = outline)
pp(file = "29time_ma_volcano_tx/t_het_retina_ma.pdf", width = 9, height = 9)
t_het_retina_ma[["plot"]]
plotted <- dev.off()
t_het_retina_ma[["plot"]]

20.1.4 t_ko_retina

table_name <- "t_ko_retina"
table_input <- time_tables[[table_name]]
table <- table_input[["data"]][[table_name]]
t_ko_retina_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq_adjp",
  color_low = time_colors[["p08_het_dlgn"]], color_high = time_colors[["p15_het_dlgn"]],
  label_column = "mgi_symbol", label = interesting_genes, alpha = 1.0,
  size = 4, min.segment.length = 0, point.padding = 0.2)
pp(file = "29time_ma_volcano_tx/t_ko_retina_volcano.pdf", width = 12, height = 12)
t_ko_retina_volcano[["plot"]]
plotted <- dev.off()
t_ko_retina_volcano[["plot"]]

t_ko_retina_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = time_colors[["p08_het_dlgn"]], color_high = time_colors[["p15_het_dlgn"]],
  p_col = "deseq_adjp", label_column = "mgi_symbol", label = interesting_genes, outline = outline)
pp(file = "29time_ma_volcano_tx/t_ko_retina_ma.pdf", width = 9, height = 9)
t_ko_retina_ma[["plot"]]
plotted <- dev.off()
t_ko_retina_ma[["plot"]]

20.2 t_het_scn

table_name <- "t_het_scn"
table_input <- time_tables[[table_name]]
table <- table_input[["data"]][[table_name]]
t_het_scn_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq_adjp",
  color_low = time_colors[["p08_het_dlgn"]], color_high = time_colors[["p15_het_dlgn"]],
  label_column = "mgi_symbol", label = interesting_genes, alpha = 1.0,
  size = 4, min.segment.length = 0, point.padding = 0.2)
pp(file = "29time_ma_volcano_tx/t_het_scn_volcano.pdf", width = 12, height = 12)
t_het_scn_volcano[["plot"]]
plotted <- dev.off()
t_het_scn_volcano[["plot"]]

t_het_scn_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = time_colors[["p08_het_dlgn"]], color_high = time_colors[["p15_het_dlgn"]],
  p_col = "deseq_adjp", label_column = "mgi_symbol", label = interesting_genes, outline = outline)
pp(file = "29time_ma_volcano_tx/t_het_scn_ma.pdf", width = 9, height = 9)
t_het_scn_ma[["plot"]]
plotted <- dev.off()
t_het_scn_ma[["plot"]]

20.3 t_ko_scn

table_name <- "t_ko_scn"
table_input <- time_tables[[table_name]]
table <- table_input[["data"]][[table_name]]
t_ko_scn_volcano <- plot_volcano_condition_de(
  table, table_name, fc_col = "deseq_logfc", p_col = "deseq_adjp",
  color_low = time_colors[["p08_het_dlgn"]], color_high = time_colors[["p15_het_dlgn"]],
  label_column = "mgi_symbol", label = interesting_genes, alpha = 1.0,
  size = 4, min.segment.length = 0, point.padding = 0.2)
pp(file = "29time_ma_volcano_tx/t_ko_scn_volcano.pdf", width = 12, height = 12)
t_ko_scn_volcano[["plot"]]
plotted <- dev.off()
t_ko_scn_volcano[["plot"]]

t_ko_scn_ma <- plot_ma_condition_de(
  table, table_name, expr_col = "deseq_basemean", fc_col = "deseq_logfc",
  color_low = time_colors[["p08_het_dlgn"]], color_high = time_colors[["p15_het_dlgn"]],
  p_col = "deseq_adjp", label_column = "mgi_symbol", label = interesting_genes, outline = outline)
pp(file = "29time_ma_volcano_tx/t_ko_scn_ma.pdf", width = 9, height = 9)
t_ko_scn_ma[["plot"]]
plotted <- dev.off()
t_ko_scn_ma[["plot"]]

20.3.0.1 Repeat with the strict filter

time_strict_tables <- list()
time_strict_sig <- list()
time_strict_gp <- list()
time_strict_cp <- list()
time_strict_en <- list()
for (k in seq_along(time_keepers)) {
  name <- names(time_keepers)[k]
  message("Examining ", name)
  keeper <- time_keepers[name]
  include_name <- paste0("inc_", name)
  include_df_name <- paste0("df_", name)
  include_df <- time_inclusions_strict[[include_df_name]]
  includes <- time_inclusions_strict[[include_name]]
  found_includes <- rownames(time_sig_full[["deseq"]][["ups"]][[name]]) %in% includes
  summary(found_includes)
  if (sum(found_includes) == 0) {
    next
  }
  include_filename <- glue("30time_strict_contrasts_excel_tx/{name}_including_wt_{lfc_cutoff}_decreased_table-v{ver}.xlsx")
  include_sig_filename <- glue("30time_strict_contrasts_excel_tx/{name}_including_wt_{lfc_cutoff}_decreased_sig-v{ver}.xlsx")
  time_strict_tables[[name]] <- combine_de_tables(
    time_de, extra_annot = include_df,
    keepers = keeper, label_column = label_column,
    excel = include_filename, wanted_genes = includes)
  print(time_strict_tables[[name]])
  time_strict_sig[[name]] <- extract_significant_genes(
    time_strict_tables[[name]], according_to = "deseq",
    excel = include_sig_filename)
  print(time_strict_sig[[name]])
  num_rows <- nrow(time_strict_sig[[name]][["deseq"]][["ups"]][[name]]) +
    nrow(time_strict_sig[[name]][["deseq"]][["downs"]][[name]])
  message("There are ", num_rows, " significant up and down genes.")
  if (num_rows >= 10) {
    message("Performing gprofiler/clusterProfiler.")
    time_strict_gp[[name]] <- all_gprofiler(time_strict_sig[[name]], species = "mmusculus")
    time_strict_cp[[name]] <- all_cprofiler(
      time_strict_sig[[name]], time_strict_tables[[name]],
      orgdb = "org.Mm.eg.db", go_level = go_level, orgdb_from = orgdb_from,
      max_groupsize = max_groupsize, organism = "mouse")
    #if (!is.null(get0("m2_gsc"))) {
    #  time_strict_en[[name]] <- all_enricher(time_strict_sig[[name]], gsc = m2_gsc,
    #                                      orgdb = "org.Mm.eg.db", from = "ENSEMBL", to = "SYMBOL")
    #}
    gp_written <- write_all_gp(time_strict_gp[[name]], prefix = "31", suffix = "strict")
    cp_written <- write_all_cp(time_strict_cp[[name]], prefix = "31", suffix = "strict")
    #en_written <- write_all_en(time_strict_en[[name]])
  } else {
    warning("There are less than 10 genes up and down in the ", name, " comparison.")
    message("There are less than 10 genes up and down in the ", name, " comparison.")
  }
}
## Examining t_het_dlgn
## Looking for subscript invalid names, end of extract_keepers.
## A set of combined differential expression results.
##                          table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p15_het_dlgn_vs_p08_het_dlgn          17             1          16             1           9             2
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.

## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##            deseq_up deseq_down
## t_het_dlgn       17          1

## There are 18 significant up and down genes.
## Performing gprofiler/clusterProfiler.
## There are 15 genes deemed significant out of 78.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (3.85% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : There were 2 pathways for which P-values were not
## calculated properly due to unbalanced (positive and negative) gene-level statistic values. For such pathways pval, padj, NES, log2err are set
## to NA. You can try to increase the value of the argument nPermSimple (for example set it nPermSimple = 10000)
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (3.9% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (3.85% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (3.85% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (3.85% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Deleting the file excel/all_cp_t_het_dlgn_up.xlsx before writing the tables.
## There are 1 genes deemed significant out of 78.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (3.85% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : There were 3 pathways for which P-values were not
## calculated properly due to unbalanced (positive and negative) gene-level statistic values. For such pathways pval, padj, NES, log2err are set
## to NA. You can try to increase the value of the argument nPermSimple (for example set it nPermSimple = 10000)
## no term enriched under specific pvalueCutoff...
## --> No gene can be mapped....
## --> Expected input gene ID: 67834,75731,12894,11364,226265,16591
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (3.9% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (3.85% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## No gene sets have size between 5 and 2000 ...
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (3.85% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## --> No gene can be mapped....
## --> Expected input gene ID: 81689,6790,23560,928,81787,51639
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (3.85% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## leading edge analysis...
## done...
## Deleting the file excel/all_cp_t_het_dlgn_down.xlsx before writing the tables.
## dimensionality reduction failed with provided drfun; falling back to stats::cmdscale.
## Examining t_ko_dlgn
## Looking for subscript invalid names, end of extract_keepers.
## A set of combined differential expression results.
##                        table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p15_ko_dlgn_vs_p08_ko_dlgn          19             3          20             3          16             3
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.

## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##           deseq_up deseq_down
## t_ko_dlgn       19          3

## There are 22 significant up and down genes.
## Performing gprofiler/clusterProfiler.
## There are 15 genes deemed significant out of 137.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : For some of the pathways the P-values were likely
## overestimated. For such pathways log2err is set to NA.
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## Deleting the file excel/all_cp_t_ko_dlgn_up.xlsx before writing the tables.
## There are 3 genes deemed significant out of 137.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## Warning in fgseaMultilevel(pathways = pathways, stats = stats, minSize = minSize, : For some of the pathways the P-values were likely
## overestimated. For such pathways log2err is set to NA.
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## Deleting the file excel/all_cp_t_ko_dlgn_down.xlsx before writing the tables.
## Examining t_het_retina
## Looking for subscript invalid names, end of extract_keepers.
## A set of combined differential expression results.
##                              table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p15_het_retina_vs_p08_het_retina          10            11          10            12           8            12
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.

## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##              deseq_up deseq_down
## t_het_retina       10         11

## There are 21 significant up and down genes.
## Performing gprofiler/clusterProfiler.
## There are 4 genes deemed significant out of 57.
## There are 1 entries which match the search string: Mus musculus.
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## no term enriched under specific pvalueCutoff...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## no term enriched under specific pvalueCutoff...
## Deleting the file excel/all_cp_t_het_retina_up.xlsx before writing the tables.
## There are 2 genes deemed significant out of 57.
## There are 1 entries which match the search string: Mus musculus.
## No gene sets have size between 5 and 500 ...
## --> return NULL...
## No gene sets have size between 5 and 500 ...
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## no term enriched under specific pvalueCutoff...
## --> No gene can be mapped....
## --> Expected input gene ID: 11532,14120,69080,71336,230639,70757
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## --> No gene can be mapped....
## --> Expected input gene ID: 76898,13844,19088,16561,56356,320685
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## No gene sets have size between 5 and 2000 ...
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
## --> No gene can be mapped....
## --> Expected input gene ID: 3006,23256,64689,91445,440686,9325
## --> return NULL...
## using 'fgsea' for GSEA analysis, please cite Korotkevich et al (2019).
## preparing geneSet collections...
## GSEA analysis...
## no term enriched under specific pvalueCutoff...
## Deleting the file excel/all_cp_t_het_retina_down.xlsx before writing the tables.
## Examining t_ko_retina
## Looking for subscript invalid names, end of extract_keepers.
## The result table is too small for meaningful comparisons.
## The first table has only: 47.
## A set of combined differential expression results.
##                            table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup limma_sigdown
## 1 p15_ko_retina_vs_p08_ko_retina           3             3           3             3           2             3
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.

## A set of genes deemed significant according to deseq.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
##             deseq_up deseq_down
## t_ko_retina        3          3

## There are 6 significant up and down genes.
## Warning: There are less than 10 genes up and down in the t_ko_retina comparison.
## There are less than 10 genes up and down in the t_ko_retina comparison.
## Examining t_het_scn
## Examining t_ko_scn

Send the plots separately.

for (k in seq_along(time_keepers)) {
  name <- names(time_keepers)[k]
  message("Examining ", name)
  keeper <- time_keepers[name]
  includes <- time_inclusions[[name]]
  include_name <- paste0("inc_", name)
  include_df_name <- paste0("df_", name)
  include_df <- time_inclusions[[include_df_name]]
  includes <- time_inclusions[[include_name]]
  num_rows <- nrow(time_sig[[name]][["deseq"]][["ups"]][[name]]) +
    nrow(time_sig[[name]][["deseq"]][["downs"]][[name]])
  message("There are ", num_rows, " significant up and down genes.")
  num_objects <- length(time_cp[[name]])
  if (num_objects == 0) {
    warning("Something failed in all_cprofiler.")
  } else {
    upp <- which(grepl(x = names(time_cp[[name]]), pattern = "_up$"))
    downp <- which(grepl(x = names(time_cp[[name]]), pattern = "_down$"))
    if (length(upp) > 0) {
      mf_sig <- time_cp[[name]][[upp]][["go_data"]][["MF_enrich"]]
      cc_sig <- time_cp[[name]][[upp]][["go_data"]][["CC_enrich"]]
      bp_sig <- time_cp[[name]][[upp]][["go_data"]][["BP_enrich"]]
      mf_plots_up <- plot_enrichresult(mf_sig, showCategory = go_categories)
      mf_tree_up_filename <- glue("32cp_trees_tx/{name}_up_mf_sig_tree.pdf")
      pp(file = mf_tree_up_filename)
      try(print(mf_plots_up[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      mf_bar_up_filename <- glue("32cp_bar_tx/{name}_up_mf_sig_bar.pdf")
      pp(file = mf_bar_up_filename)
      try(print(mf_plots_up[["bar"]]), silent = TRUE)
      plotted <- dev.off()
      cc_plots_up <- plot_enrichresult(cc_sig, showCategory = go_categories)
      cc_tree_up_filename <- glue("32cp_trees_tx/{name}_up_cc_sig_tree.pdf")
      pp(file = cc_tree_up_filename)
      try(print(cc_plots_up[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      cc_bar_up_filename <- glue("32cp_bar_tx/{name}_up_cc_sig_bar.pdf")
      pp(file = cc_bar_up_filename)
      try(print(cc_plots_up[["bar"]]), silent = TRUE)
      plotted <- dev.off()
      bp_plots_up <- plot_enrichresult(bp_sig, showCategory = go_categories)
      bp_tree_up_filename <- glue("32cp_trees_tx/{name}_up_bp_sig_tree.pdf")
      pp(file = bp_tree_up_filename)
      try(print(bp_plots_up[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      bp_plots_up <- plot_enrichresult(bp_sig, showCategory = go_categories)
      bp_bar_up_filename <- glue("32cp_bar_tx/{name}_up_bp_sig_bar.pdf")
      pp(file = bp_bar_up_filename)
      try(print(bp_plots_up[["bar"]]), silent = TRUE)
      plotted <- dev.off()
    }
    if (length(downp) > 0) {
      mf_sig <- time_cp[[name]][[downp]][["go_data"]][["MF_enrich"]]
      cc_sig <- time_cp[[name]][[downp]][["go_data"]][["CC_enrich"]]
      bp_sig <- time_cp[[name]][[downp]][["go_data"]][["BP_enrich"]]
      mf_plots_down <- plot_enrichresult(mf_sig, showCategory = go_categories)
      mf_tree_down_filename <- glue("32cp_trees_tx/{name}_down_mf_sig_tree.pdf")
      pp(file = mf_tree_down_filename)
      try(print(mf_plots_down[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      mf_bar_down_filename <- glue("32cp_bar_tx/{name}_down_mf_sig_bar.pdf")
      pp(file = mf_bar_down_filename)
      try(print(mf_plots_down[["bar"]]), silent = TRUE)
      plotted <- dev.off()
      cc_plots_down <- plot_enrichresult(cc_sig, showCategory = go_categories)
      cc_tree_down_filename <- glue("32cp_trees_tx/{name}_down_cc_sig_tree.pdf")
      pp(file = cc_tree_down_filename)
      try(print(cc_plots_down[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      cc_bar_down_filename <- glue("32cp_bar_tx/{name}_down_cc_sig_bar.pdf")
      pp(file = cc_bar_down_filename)
      try(print(cc_plots_down[["bar"]]), silent = TRUE)
      plotted <- dev.off()
      bp_plots_down <- plot_enrichresult(bp_sig, showCategory = go_categories)
      bp_tree_down_filename <- glue("32cp_trees_tx/{name}_down_bp_sig_tree.pdf")
      pp(file = bp_tree_down_filename)
      try(print(bp_plots_down[["tree"]]), silent = TRUE)
      plotted <- dev.off()
      bp_plots_down <- plot_enrichresult(bp_sig, showCategory = go_categories)
      bp_bar_down_filename <- glue("32cp_bar_tx/{name}_down_bp_sig_bar.pdf")
      pp(file = bp_bar_down_filename)
      try(print(bp_plots_down[["bar"]]), silent = TRUE)
      plotted <- dev.off()
    }
  }
}
## Examining t_het_dlgn
## There are 290 significant up and down genes.
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in pp(file = mf_tree_up_filename): The directory: 32cp_trees_tx does not exist, will attempt to create it.
## Warning in pp(file = mf_bar_up_filename): The directory: 32cp_bar_tx does not exist, will attempt to create it.
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Examining t_ko_dlgn
## There are 446 significant up and down genes.
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Examining t_het_retina
## There are 133 significant up and down genes.
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Examining t_ko_retina
## There are 148 significant up and down genes.
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## Examining t_het_scn
## There are 1 significant up and down genes.
## Warning: Something failed in all_cprofiler.
## Examining t_ko_scn
## There are 0 significant up and down genes.
## Warning: Something failed in all_cprofiler.

21 Translatome queries

In conversation with Colenso, he spoke about a series of contrasts which would be interesting to attempt in order to query the changes across both locations and genotypes and/or both locations and time, thus:

(p08_het_scn / p08_het_retina) / (p08_ko_scn / p08_ko_retina)

as an example. We can definitely do these, but they do not work for all methods employed (I think they work best with limma and edgeR).

Lets find out!

21.1 Two scn/retina comparisons

  • (p08_het_scn / p08_het_retina) / (p08_ko_scn / p08_ko_retina)
  • (p15_het_scn / p15_het_retina) / (p15_ko_scn / p15_ko_retina)
scn_extra <- glue("\\
  p08het = (conditionp08_het_scn - conditionp08_het_retina), \\
  p08ko = (conditionp08_ko_scn - conditionp08_ko_retina), \\
  p08het_vs_p08ko = (conditionp08_het_scn - conditionp08_het_retina) - (conditionp08_ko_scn - conditionp08_ko_retina), \\
  p15het = (conditionp15_het_scn - conditionp15_het_retina), \\
  p15ko = (conditionp15_ko_scn - conditionp15_ko_retina), \\
  p15het_vs_p15ko = (conditionp15_het_scn - conditionp15_het_retina) - (conditionp15_ko_scn - conditionp15_ko_retina)")
scn_translatome_de_keepers <- list(
  "p08het" = c("p08_het_scn", "p08_het_retina"),
  "p08ko" = c("p08_ko_scn", "p08_ko_retina"),
  "p15het" = c("p15_het_scn", "p15_het_retina"),
  "p15ko" = c("p15_ko_scn", "p15_ko_retina"))
scn_translatome_keepers <- list(
  "p08het" = c("p08_het_scn", "p08_het_retina"),
  "p08ko" = c("p08_ko_scn", "p08_ko_retina"),
  "p08_scn_translatome" = c("p08het", "p08ko"),
  "p15het" = c("p15_het_scn", "p15_het_retina"),
  "p15ko" = c("p15_ko_scn", "p15_ko_retina"),
  "p15_scn_translatome" = c("p15het", "p15ko"))
filt <- normalize(tx_pairwise_input, filter = TRUE)
## Removing 52544 low-count genes (13339 remaining).
limma_test <- limma_pairwise(filt,
                             keepers = scn_translatome_de_keepers,
                             model_fstring = "~ 0 + condition",
                             model_svs = FALSE, extra_contrastrs = scn_extra)
## conditions
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
edger_test <- edger_pairwise(filt,
                             keepers = scn_translatome_de_keepers,
                             model_fstring = "~ 0 + condition",
                             model_svs = FALSE, extra_contrasts = scn_extra)
## conditions
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
scn_translatome_de <- all_pairwise(tx_pairwise_input, filter = TRUE,
                                   keepers = scn_translatome_de_keepers,
                                   model_svs = FALSE,
                                   model_fstring = "~ 0 + condition",
                                   do_basic = FALSE, do_dream = FALSE,
                                   do_noiseq = FALSE, do_ebseq = FALSE,
                                   extra_contrasts = scn_extra)
## Warning in all_pairwise(tx_pairwise_input, filter = TRUE, keepers = scn_translatome_de_keepers, : This will likely fail because of how the
## keepers and extra contrasts are evaluated.
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
## Removing 52544 low-count genes (13339 remaining).
## converting counts to integer mode
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## The contrast condition_NA_vs_p08het is not in the results.
## If this is not an extra contrast, then this is an error.
## The contrast condition_NA_vs_p08ko is not in the results.
## If this is not an extra contrast, then this is an error.
## The contrast condition_p08ko_vs_p08het is not in the results.
## If this is not an extra contrast, then this is an error.
## The contrast condition_NA_vs_p15het is not in the results.
## If this is not an extra contrast, then this is an error.
## The contrast condition_NA_vs_p15ko is not in the results.
## If this is not an extra contrast, then this is an error.
## The contrast condition_p15ko_vs_p15het is not in the results.
## If this is not an extra contrast, then this is an error.
## conditions
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
## conditions
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
## Warning in correlate_de_tables(results, annot_df = annot_df, extra_contrasts = extra_contrasts): The basic results are not of class
## hpgltools::basic_pairwise.
## Warning in correlate_de_tables(results, annot_df = annot_df, extra_contrasts = extra_contrasts): The dream results are not of class
## hpgltools::dream_pairwise.
## Warning in correlate_de_tables(results, annot_df = annot_df, extra_contrasts = extra_contrasts): The ebseq results are not of class
## hpgltools::ebseq_pairwise.
## Warning in correlate_de_tables(results, annot_df = annot_df, extra_contrasts = extra_contrasts): The noiseq results are not of class
## hpgltools::noiseq_pairwise.

scn_combined_test <- combine_de_tables(
  scn_translatome_de, keepers = scn_translatome_keepers,
  excel = glue("33translatome_xlsx_tx/test_scn_translatome_unfiltered_nosva-v{ver}.xlsx"))
## coefficient edger did not find conditionp08ko or conditionp08het.
## coefficient limma did not find p08ko or p08het.
## coefficient edger did not find conditionp15ko or conditionp15het.
## coefficient limma did not find p15ko or p15het.
## Looking for subscript invalid names, end of extract_keepers.
scn_translatome_de_sva <- all_pairwise(tx_pairwise_input, filter = TRUE,
                                       keepers = scn_translatome_de_keepers,
                                       model_svs = "svaseq",
                                       model_fstring = "~ 0 + condition",
                                       do_basic = FALSE, do_dream = FALSE,
                                       do_noiseq = FALSE, do_ebseq = FALSE,
                                       extra_contrasts = scn_extra)
## Warning in all_pairwise(tx_pairwise_input, filter = TRUE, keepers = scn_translatome_de_keepers, : This will likely fail because of how the
## keepers and extra contrasts are evaluated.
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
## Removing 52544 low-count genes (13339 remaining).
## This received a matrix of SVs.
## converting counts to integer mode
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## The contrast condition_NA_vs_p08het is not in the results.
## If this is not an extra contrast, then this is an error.
## The contrast condition_NA_vs_p08ko is not in the results.
## If this is not an extra contrast, then this is an error.
## The contrast condition_p08ko_vs_p08het is not in the results.
## If this is not an extra contrast, then this is an error.
## The contrast condition_NA_vs_p15het is not in the results.
## If this is not an extra contrast, then this is an error.
## The contrast condition_NA_vs_p15ko is not in the results.
## If this is not an extra contrast, then this is an error.
## The contrast condition_p15ko_vs_p15het is not in the results.
## If this is not an extra contrast, then this is an error.
## conditions
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
## conditions
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
## Warning in correlate_de_tables(results, annot_df = annot_df, extra_contrasts = extra_contrasts): The basic results are not of class
## hpgltools::basic_pairwise.
## Warning in correlate_de_tables(results, annot_df = annot_df, extra_contrasts = extra_contrasts): The dream results are not of class
## hpgltools::dream_pairwise.
## Warning in correlate_de_tables(results, annot_df = annot_df, extra_contrasts = extra_contrasts): The ebseq results are not of class
## hpgltools::ebseq_pairwise.
## Warning in correlate_de_tables(results, annot_df = annot_df, extra_contrasts = extra_contrasts): The noiseq results are not of class
## hpgltools::noiseq_pairwise.

scn_combined_test_sva <- combine_de_tables(
  scn_translatome_de_sva, keepers = scn_translatome_keepers,
  excel = glue("33translatome_xlsx_tx/test_scn_translatome_unfiltered_sva-v{ver}.xlsx"))
## coefficient edger did not find conditionp08ko or conditionp08het.
## coefficient limma did not find p08ko or p08het.
## coefficient edger did not find conditionp15ko or conditionp15het.
## coefficient limma did not find p15ko or p15het.
## Looking for subscript invalid names, end of extract_keepers.

21.1.1 Subtracting DESeq2 results: p08 scn het vs ko

p08_scn_combined_deseq <- subtract_deseq_results(
  first_table = scn_combined_test[["data"]][["p08het"]],
  second_table = scn_combined_test[["data"]][["p08ko"]],
  first_lfc = "deseq_logfc", second_lfc = "deseq_logfc",
  first_p = "deseq_adjp", second_p = "deseq_adjp",
  first_name = "het", second_name = "ko",
  excel = glue("33translatome_xlsx_tx/translatome_p08_scn_combined_deseq-v{ver}.xlsx"))
## Error in `subtract_deseq_results()`:
## ! could not find function "subtract_deseq_results"

21.1.2 Subtracting DESeq2 results: p15 scn het vs ko

p15_scn_combined_deseq <- subtract_deseq_results(
  first_table = scn_combined_test[["data"]][["p15het"]],
  second_table = scn_combined_test[["data"]][["p15ko"]],
  first_lfc = "deseq_logfc", second_lfc = "deseq_logfc",
  first_p = "deseq_adjp", second_p = "deseq_adjp",
  first_name = "het", second_name = "ko",
  excel = glue("34translatome_deseqsub_xlsx_tx/translatome_p15_scn_combined_deseq-v{ver}.xlsx"))
## Error in `subtract_deseq_results()`:
## ! could not find function "subtract_deseq_results"

21.2 One dlgn/retina comparison

  • (p08_het_dlgn / p08_het_retina) / (p08_ko_dlgn / p08_ko_retina)
p08_dlgn_extra <- "p08het_vs_p08ko = (conditionp08_het_dlgn - conditionp08_het_retina) - (conditionp08_ko_dlgn - conditionp08_ko_retina)"
p08_dlgn_translatome_de_keepers <- list(
  "p08het" = c("p08_het_dlgn", "p08_het_retina"),
  "p08ko" = c("p08_ko_dlgn", "p08_ko_retina"))
p08_dlgn_translatome_keepers <- list(
  "p08_het_dlgn_vs_retina" = c("p08_het_dlgn", "p08_het_retina"),
  "p08_ko_dlgn_vs_retina" = c("p08_ko_dlgn", "p08_ko_retina"),
  "p08_dlgn_translatome" = c("p08het", "p08ko"))
p08_dlgn_translatome_de <- all_pairwise(tx_pairwise_input, filter = TRUE,
                                        keepers = p08_dlgn_translatome_de_keepers,
                                        model_svs = FALSE,
                                        model_fstring = "~ 0 + condition",
                                        do_basic = FALSE, do_dream = FALSE,
                                        do_noiseq = FALSE, do_ebseq = FALSE,
                                        extra_contrasts = p08_dlgn_extra)
## Warning in all_pairwise(tx_pairwise_input, filter = TRUE, keepers = p08_dlgn_translatome_de_keepers, : This will likely fail because of how
## the keepers and extra contrasts are evaluated.
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
## Removing 52544 low-count genes (13339 remaining).
## converting counts to integer mode
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## This contrast put the denominator first.
## This contrast put the denominator first.
## The contrast condition_p08ko_vs_p08het is not in the results.
## If this is not an extra contrast, then this is an error.
## conditions
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
## conditions
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
## Warning in correlate_de_tables(results, annot_df = annot_df, extra_contrasts = extra_contrasts): The basic results are not of class
## hpgltools::basic_pairwise.
## Warning in correlate_de_tables(results, annot_df = annot_df, extra_contrasts = extra_contrasts): The dream results are not of class
## hpgltools::dream_pairwise.
## Warning in correlate_de_tables(results, annot_df = annot_df, extra_contrasts = extra_contrasts): The ebseq results are not of class
## hpgltools::ebseq_pairwise.
## Warning in correlate_de_tables(results, annot_df = annot_df, extra_contrasts = extra_contrasts): The noiseq results are not of class
## hpgltools::noiseq_pairwise.
p08_dlgn_combined_test <- combine_de_tables(
  p08_dlgn_translatome_de, keepers = p08_dlgn_translatome_keepers,
  label_column = label_column,
  excel = glue("33translatome_xlsx_tx/test_p08_dlgn_translatome_unfiltered_nosva-v{ver}.xlsx"))
## coefficient edger did not find conditionp08ko or conditionp08het.
## coefficient limma did not find p08ko or p08het.
## Looking for subscript invalid names, end of extract_keepers.
p08_dlgn_translatome_de_sva <- all_pairwise(tx_pairwise_input, filter = TRUE,
                                            keepers = p08_dlgn_translatome_de_keepers,
                                            model_svs = "svaseq",
                                            model_fstring = "~ 0 + condition",
                                            do_basic = FALSE, do_dream = FALSE,
                                            do_noiseq = FALSE, do_ebseq = FALSE,
                                            extra_contrasts = p08_dlgn_extra)
## Warning in all_pairwise(tx_pairwise_input, filter = TRUE, keepers = p08_dlgn_translatome_de_keepers, : This will likely fail because of how
## the keepers and extra contrasts are evaluated.
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
## Removing 52544 low-count genes (13339 remaining).
## This received a matrix of SVs.
## converting counts to integer mode
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## This contrast put the denominator first.
## This contrast put the denominator first.
## The contrast condition_p08ko_vs_p08het is not in the results.
## If this is not an extra contrast, then this is an error.
## conditions
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
## conditions
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
## Warning in correlate_de_tables(results, annot_df = annot_df, extra_contrasts = extra_contrasts): The basic results are not of class
## hpgltools::basic_pairwise.
## Warning in correlate_de_tables(results, annot_df = annot_df, extra_contrasts = extra_contrasts): The dream results are not of class
## hpgltools::dream_pairwise.
## Warning in correlate_de_tables(results, annot_df = annot_df, extra_contrasts = extra_contrasts): The ebseq results are not of class
## hpgltools::ebseq_pairwise.
## Warning in correlate_de_tables(results, annot_df = annot_df, extra_contrasts = extra_contrasts): The noiseq results are not of class
## hpgltools::noiseq_pairwise.
p08_dlgn_combined_test_sva <- combine_de_tables(
  p08_dlgn_translatome_de_sva, keepers = p08_dlgn_translatome_keepers,
  label_column = label_column,
  excel = glue("33translatome_xlsx_tx/test_p08_dlgn_translatome_unfiltered_sva-v{ver}.xlsx"))
## coefficient edger did not find conditionp08ko or conditionp08het.
## coefficient limma did not find p08ko or p08het.
## Looking for subscript invalid names, end of extract_keepers.

21.2.1 Subtracting the DESeq2 results

21.3 Two scn/retina comparisons (p15/p08 across het/ko)

  • (p15_het_scn / p15_het_retina) / (p08_het_scn / p08_het_retina)
  • (p15_ko_scn / p15_ko_retina) / (p08_ko_scn / p08_ko_retina)
time_scn_extra <- glue("\\
  p15het = (conditionp15_het_scn - conditionp15_het_retina), \\
  p08het = (conditionp08_het_scn - conditionp08_het_retina), \\
  p15het_vs_p08het = (conditionp15_het_scn - conditionp15_het_retina) - (conditionp08_het_scn - conditionp08_het_retina),
  p15ko = (conditionp15_ko_scn - conditionp15_ko_retina), \\
  p08ko = (conditionp08_ko_scn - conditionp08_ko_retina), \\
  p15ko_vs_p08ko = (conditionp15_ko_scn - conditionp15_ko_retina) - (conditionp08_ko_scn - conditionp08_ko_retina)")
time_scn_translatome_de_keepers <- list(
  "p15het" = c("p15_het_scn", "p15_het_retina"),
  "p08het" = c("p08_het_scn", "p08_het_retina"),
  "p15ko" = c("p15_ko_scn", "p15_ko_retina"),
  "p08ko" = c("p08_ko_scn", "p08_ko_retina"))
time_scn_translatome_keepers <- list(
  "p15het" = c("p15_het_scn", "p15_het_retina"),
  "p08het" = c("p08_het_scn", "p08_het_retina"),
  "p15ko" = c("p15_ko_scn", "p15_ko_retina"),
  "p08ko" = c("p08_ko_scn", "p08_ko_retina"),
  "p15_het_sc_vs_retina" = c("p15_het_scn", "p15_het_retina"),
  "p08_het_sc_vs_retina" = c("p08_het_scn", "p08_het_retina"),
  "scn_het_translatome" = c("p15het", "p08het"),
  "scn_ko_translatome" = c("p15ko", "p08ko"))
time_scn_translatome_de <- all_pairwise(tx_pairwise_input, filter = TRUE,
                                        keepers = time_scn_translatome_de_keepers,
                                        model_svs = FALSE,
                                        model_fstring = "~ 0 + condition",
                                        do_basic = FALSE, do_dream = FALSE,
                                        do_noiseq = FALSE, do_ebseq = FALSE,
                                        extra_contrasts = time_scn_extra)
## Warning in all_pairwise(tx_pairwise_input, filter = TRUE, keepers = time_scn_translatome_de_keepers, : This will likely fail because of how
## the keepers and extra contrasts are evaluated.
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
## Removing 52544 low-count genes (13339 remaining).
## converting counts to integer mode
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## The contrast condition_NA_vs_p15het is not in the results.
## If this is not an extra contrast, then this is an error.
## The contrast condition_NA_vs_p08het is not in the results.
## If this is not an extra contrast, then this is an error.
## The contrast condition_p08het_vs_p15het is not in the results.
## If this is not an extra contrast, then this is an error.
## The contrast condition_NA_vs_p15ko is not in the results.
## If this is not an extra contrast, then this is an error.
## The contrast condition_NA_vs_p08ko is not in the results.
## If this is not an extra contrast, then this is an error.
## The contrast condition_p08ko_vs_p15ko is not in the results.
## If this is not an extra contrast, then this is an error.
## conditions
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
## conditions
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
## Warning in correlate_de_tables(results, annot_df = annot_df, extra_contrasts = extra_contrasts): The basic results are not of class
## hpgltools::basic_pairwise.
## Warning in correlate_de_tables(results, annot_df = annot_df, extra_contrasts = extra_contrasts): The dream results are not of class
## hpgltools::dream_pairwise.
## Warning in correlate_de_tables(results, annot_df = annot_df, extra_contrasts = extra_contrasts): The ebseq results are not of class
## hpgltools::ebseq_pairwise.
## Warning in correlate_de_tables(results, annot_df = annot_df, extra_contrasts = extra_contrasts): The noiseq results are not of class
## hpgltools::noiseq_pairwise.

time_scn_translatome_test <- combine_de_tables(
  time_scn_translatome_de,
  keepers = time_scn_translatome_keepers,
  label_column = label_column,
  excel = glue("33translatome_xlsx_tx/test_time_scn_translatome_unfiltered_nosva-v{ver}.xlsx"))
## coefficient edger did not find conditionp08het or conditionp15het.
## coefficient limma did not find p08het or p15het.
## coefficient edger did not find conditionp08ko or conditionp15ko.
## coefficient limma did not find p08ko or p15ko.
## Looking for subscript invalid names, end of extract_keepers.
time_scn_translatome_de_sva <- all_pairwise(tx_pairwise_input, filter = TRUE,
                                            keepers = time_scn_translatome_de_keepers,
                                            model_svs = "svaseq",
                                            model_fstring = "~ 0 + condition",
                                            do_basic = FALSE, do_dream = FALSE,
                                            do_noiseq = FALSE, do_ebseq = FALSE,
                                            extra_contrasts = time_scn_extra)
## Warning in all_pairwise(tx_pairwise_input, filter = TRUE, keepers = time_scn_translatome_de_keepers, : This will likely fail because of how
## the keepers and extra contrasts are evaluated.
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
## Removing 52544 low-count genes (13339 remaining).
## This received a matrix of SVs.
## converting counts to integer mode
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## This contrast put the denominator first.
## The contrast condition_NA_vs_p15het is not in the results.
## If this is not an extra contrast, then this is an error.
## The contrast condition_NA_vs_p08het is not in the results.
## If this is not an extra contrast, then this is an error.
## The contrast condition_p08het_vs_p15het is not in the results.
## If this is not an extra contrast, then this is an error.
## The contrast condition_NA_vs_p15ko is not in the results.
## If this is not an extra contrast, then this is an error.
## The contrast condition_NA_vs_p08ko is not in the results.
## If this is not an extra contrast, then this is an error.
## The contrast condition_p08ko_vs_p15ko is not in the results.
## If this is not an extra contrast, then this is an error.
## conditions
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
## conditions
##   p08_het_dlgn p08_het_retina    p08_het_scn    p08_ko_dlgn  p08_ko_retina     p08_ko_scn    p08_wt_dlgn  p08_wt_retina     p08_wt_scn 
##              3              3              3              3              3              3              5              5              3 
##   p15_het_dlgn p15_het_retina    p15_het_scn    p15_ko_dlgn  p15_ko_retina     p15_ko_scn    p15_wt_dlgn  p15_wt_retina     p15_wt_scn 
##              4              4              3              3              3              3              5              5              2
## Warning in correlate_de_tables(results, annot_df = annot_df, extra_contrasts = extra_contrasts): The basic results are not of class
## hpgltools::basic_pairwise.
## Warning in correlate_de_tables(results, annot_df = annot_df, extra_contrasts = extra_contrasts): The dream results are not of class
## hpgltools::dream_pairwise.
## Warning in correlate_de_tables(results, annot_df = annot_df, extra_contrasts = extra_contrasts): The ebseq results are not of class
## hpgltools::ebseq_pairwise.
## Warning in correlate_de_tables(results, annot_df = annot_df, extra_contrasts = extra_contrasts): The noiseq results are not of class
## hpgltools::noiseq_pairwise.

time_scn_translatome_test_sva <- combine_de_tables(
  time_scn_translatome_de_sva,
  keepers = time_scn_translatome_keepers,
  label_column = label_column,
  excel = glue("33translatome_xlsx_tx/test_time_scn_translatome_unfiltered_sva-v{ver}.xlsx"))
## coefficient edger did not find conditionp08het or conditionp15het.
## coefficient limma did not find p08het or p15het.
## coefficient edger did not find conditionp08ko or conditionp15ko.
## coefficient limma did not find p08ko or p15ko.
## Looking for subscript invalid names, end of extract_keepers.

Next step: Perform the retina filter; need to think about the proper union/intersection of the retina/x expression values

In the previous block, we are making 2 global comparisons, here is one of them:

(p15hetscn/p15hetret)/(p08hetscn/p08hetret)

I therefore want to extract the most logical set of genes higher in some/all of these conditions with respect to the corresponding wt conditions. Previously, in section ‘Extract genes included for each set of contrasts’, I attempted to perform this operation for 2 specific wt conditions. When this was performed, it took the unique(union) of the two sets. Thus it stands to reason that I want to take the unique(union) of all 4 in this instance? e.g.:

(p15hetscn > p15wtscn) | (p15hetret > p15wtret) | (p08hetscn > p08wtscn) | (p08hetret > p08wtret)

I kind of think it should be:

((p15hetscn > p15wtscn) | (p15hetret > p15wtret)) & ((p08hetscn > p08wtscn) | (p08hetret > p08wtret))

gross, perhaps I should just do this manually, given that there are only a few putative translatomes to query?

22 Quick and dirty DESeq2 contrast of contrasts

In a fashion similar to how Hector handled the effect of phagocytosis with Laura and Najib a long time ago, I propose to do a simple subtraction of the results of our two contrasts which comprise the translatome query (I was thinking about this last week, thus the inclusion of them in the de tables above). Similarly to the phagocytosis effect, I will simply take the worst posible adjusted p-value. I will repeat this with limma/EdgeR and see how similar the final results are to what those methods provide in the (a/b)/(c/d) comparisons. I am reasonably certain that DESeq2’s results() function has the ability to perform these odd contrasts, but I have never figured out how; perhaps I will use this as a chance to revisit that…

Let us test this idea with the p08 dlgn query, which seeks to compare:

(p08_het_dlgn / p08_het_retina) / (p08_ko_dlgn / p08_ko_retina)

These are maintained in the de_table with the names ‘p08_het_dlgn_vs_retina’ and ‘p08_ko_dlgn_vs_retina’

22.1 p08 dlgn het vs ko

p08_dlgn_combined_deseq <- subtract_deseq_results(
  first_table = p08_dlgn_combined_test[["data"]][["p08_het_dlgn_vs_retina"]],
  second_table = p08_dlgn_combined_test[["data"]][["p08_ko_dlgn_vs_retina"]],
  first_lfc = "deseq_logfc", second_lfc = "deseq_logfc",
  first_p = "deseq_adjp", second_p = "deseq_adjp",
  first_name = "het", second_name = "ko",
  excel = glue("34translatome_deseqsub_xlsx_tx/translatome_p08_dlgn_combined_deseq-v{ver}.xlsx"))
## Error in `subtract_deseq_results()`:
## ! could not find function "subtract_deseq_results"

See how similar these results are to those obtained from limma/edger.

test_columns <- c("edger_logfc", "limma_logfc", "edger_adjp", "limma_adjp")
test_df <- p08_dlgn_combined_test[["data"]][["p08_dlgn_translatome"]][, test_columns]
test_df <- merge(test_df, p08_dlgn_combined_deseq, by = "row.names")
## Error in `h()`:
## ! error in evaluating the argument 'y' in selecting a method for function 'merge': object 'p08_dlgn_combined_deseq' not found
rownames(test_df) <- test_df[["Row.names"]]
test_df[["Row.names"]] <- NULL
cor.test(test_df[["limma_logfc"]], test_df[["het_vs_ko_logfc"]])
## Error in `cor.test.default()`:
## ! 'y' must be a numeric vector
cor.test(test_df[["edger_logfc"]], test_df[["het_vs_ko_logfc"]])
## Error in `cor.test.default()`:
## ! 'y' must be a numeric vector
tt <- plot_linear_scatter(test_df[, c("limma_logfc", "het_vs_ko_logfc")])
## Error in `h()`:
## ! error in evaluating the argument 'x' in selecting a method for function 'as.data.frame': undefined columns selected
tt[["scatter"]]
## NULL
tt <- plot_linear_scatter(test_df[, c("edger_adjp", "het_vs_ko_p")])
## Error in `h()`:
## ! error in evaluating the argument 'x' in selecting a method for function 'as.data.frame': undefined columns selected
tt[["scatter"]]
## NULL
## So, using the maximum p-value is a complete failure; but the extreme similarities
## between this and edgeR suggest to me that it is likely possible to use the results
## from edgeR without concern (or limma for that matter, it was also extremely similar)
## Or I can spend a little time and collect the numbers on each side of the division
## and calculate a t statistic myself.

23 Non-Specific filtering of the translatome data

I have on hand

  • p08het_vs_p08ko : (p08_het_scn - p08_het_retina) - (p08_ko_scn - p08_ko_retina)
  • p15het_vs_p15ko : (p15_het_scn - p15_het_retina) - (p15_ko_scn - p15_ko_retina)
  • p08het_vs_p08ko : (p08_het_dlgn - p08_het_retina) - (p08_ko_dlgn - p08_ko_retina)
  • p15het_vs_p08het : (p15_het_scn - p15_het_retina) - (p08_het_scn - p08_het_retina)
  • p15ko_vs_p08ko : (p15_ko_scn - p15_ko_retina) - (p08_ko_scn - p08_ko_retina)

I have gene sets up above which define the genes suitable for each of these pieces. There are only 5 comparisons, let us step through them.

23.1 SCN translatome het/ko at p08

The data for this contrast resides in scn_combined_test\(data\)p08_scn_translatome or the same slot of scn_combined_test_sva

  • p08_het_scn - p08_het_retina) - (p08_ko_scn - p08_ko_retina)

Thus, the inclusion_sig portions to extract are found in: inclusion_sig[[“deseq”]][[“ups”]], and are named exactly as written above!

p08_het_vs_ko_translatome_unfilt <- scn_combined_test[["data"]][["p08_scn_translatome"]]
num_union <- unique(c(rownames(inclusion_sig[["deseq"]][["ups"]][["p08_het_scn"]]),
                      rownames(inclusion_sig[["deseq"]][["ups"]][["p08_het_retina"]])))
length(num_union)
## [1] 548
den_union <- unique(c(rownames(inclusion_sig[["deseq"]][["ups"]][["p08_ko_scn"]]),
                      rownames(inclusion_sig[["deseq"]][["ups"]][["p08_ko_retina"]])))
length(den_union)
## [1] 577
both_union <- unique(c(num_union, den_union))
length(both_union)
## [1] 770
both_inter_idx <- num_union %in% den_union
both_inter <- num_union[both_inter_idx]
length(both_inter)
## [1] 355
keeper <- list("p08_scn_translatome" = c("p08het", "p08ko"))
p08_scn_translatome_union_filtered <- combine_de_tables(
  scn_translatome_de, keepers = keeper,
  label_column = label_column,
  excel = glue("35translatome_union_tx/p08_scn_translatome_union_filtered_nosva-v{ver}.xlsx"),
  wanted_genes = both_union)
## coefficient edger did not find conditionp08ko or conditionp08het.
## coefficient limma did not find p08ko or p08het.
## Looking for subscript invalid names, end of extract_keepers.
p08_scn_translatome_inter_filtered <- combine_de_tables(
  scn_translatome_de, keepers = keeper,
  label_column = label_column,
  excel = glue("35translatome_union_tx/p08_scn_translatome_intersect_filtered_nosva-v{ver}.xlsx"),
  wanted_genes = both_inter)
## coefficient edger did not find conditionp08ko or conditionp08het.
## coefficient limma did not find p08ko or p08het.
## Looking for subscript invalid names, end of extract_keepers.
p08_scn_translatome_union_filtered_sva <- combine_de_tables(
  scn_translatome_de_sva, keepers = keeper,
  label_column = label_column,
  excel = glue("35translatome_union_tx/p08_scn_translatome_union_filtered_sva-v{ver}.xlsx"),
  wanted_genes = both_union)
## coefficient edger did not find conditionp08ko or conditionp08het.
## coefficient limma did not find p08ko or p08het.
## Looking for subscript invalid names, end of extract_keepers.
p08_scn_translatome_union_filtered <- combine_de_tables(
  scn_translatome_de, keepers = keeper,
  label_column = label_column,
  excel = glue("35translatome_union_tx/p08_scn_translatome_intersect_filtered_sva-v{ver}.xlsx"),
  wanted_genes = both_inter)
## coefficient edger did not find conditionp08ko or conditionp08het.
## coefficient limma did not find p08ko or p08het.
## Looking for subscript invalid names, end of extract_keepers.

24 Venn/UpSet of Retina, SCN, and dLGN DE Genes

Here is a snippet from Rashmi which expresses nicely the DE-result comparisons she is most interested:

Since, I want to know the number of DEG expressed in Retina, SCN and dLGN with respect to genotype, Location and time. I prepared the venn diagram for these comparison:

  • Genotype: P8 Ret Het vs KO, P15 Ret Het vs KO, P8 SCN Het vs KO, P15 SCN Het vs KO, P8 dLGN Het vs KO, P15 dLGN Het vs KO
  • Location: P8_het Ret vs SCN, P8_KO Ret vs SCN, P15_het Ret vs SCN, P15_KO Ret vs SCN, P8_het Ret vs dLGN, P8_KO Ret vs dLGN, P15_het Ret vs dLGN, P15_KO Ret vs dLGN, P8_het SCN vs dLGN, P8_KO SCN vs dLGN, P15_het SCN vs dLGN, P15_KO SCN vs dLGN.

Since I was interested in understanding the change in local translatome according to Location for different developmental time points for Het and KO. Hence, I tried to generate a venn diagram for Location (Ret and SCN) at developmental time points P8 and P15 for genotype het and KO. So the venn diagram / upset plot will be for location where some genes will be shared/unique for P8_Ret_het, P8_SCN_Het, P15_Ret_HET, P15_SCN_HET. We can prepare an upset plot for P8_Ret_KO, P8_SCN_KO, P15_Ret_KO and P15_SCN_KO also. Or can generate an upset plot by combining both P8_Ret_het, P8_SCN_Het, P15_Ret_HET and P15_SCN_HET and P8_Ret_KO, P8_SCN_KO, P15_Ret_KO and P15_SCN_KO.

Ok, let us see if I can implement this, starting with the genotype query

  • Genotype: P8 Ret Het vs KO, P15 Ret Het vs KO, P8 SCN Het vs KO, P15 SCN Het vs KO, P8 dLGN Het vs KO, P15 dLGN Het vs KO

24.1 ko vs het; all locations and times

## The appropriate data structure is 'genotype_tables',
## and the tables of interest are:
table_names <- c("kh_p08_retina", "kh_p15_retina", "kh_p08_scn",
                 "kh_p15_scn", "kh_p08_dlgn", "kh_p15_dlgn")
table_names %in% names(genotype_sig)
## [1] TRUE TRUE TRUE TRUE TRUE TRUE
newsig <- genotype_sig[[1]]
for (sig in 2:length(table_names)) {
  name <- table_names[sig]
  newsig[["deseq"]][["ups"]][[name]] <- genotype_sig[[name]][["deseq"]][["ups"]][[name]]
  newsig[["deseq"]][["downs"]][[name]] <- genotype_sig[[name]][["deseq"]][["downs"]][[name]]
}
genotype_upsetr <- upsetr_sig(newsig)
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
genotype_upset_written <- write_upset_groups(genotype_upsetr, excel = "36upset_genotype_tx/genotype_upset_groups.xlsx")
genotype_upsetr[["all_plot"]]

pp(file = "36upset_genotype_tx/test_genotype_upset.pdf")
print(genotype_upsetr[["all_plot"]])
plotted <- dev.off()

Now let us try the location-specific comparisons

24.2 scn vs retina, p08

## The appropriate data structure is 'genotype_tables',
## and the tables of interest are:
table_names <- c("sr_p08_het", "sr_p08_ko")
table_names %in% names(location_sig)
## [1] TRUE TRUE
location_upset_input <- list()
first_table <- table_names[1]
newsig <- location_sig[[first_table]]
for (sig in 2:length(table_names)) {
  name <- table_names[sig]
  newsig[["deseq"]][["ups"]][[name]] <- location_sig[[name]][["deseq"]][["ups"]][[name]]
  newsig[["deseq"]][["downs"]][[name]] <- location_sig[[name]][["deseq"]][["downs"]][[name]]
}
location_upsetr <- upsetr_sig(newsig)
location_upset_written <- write_upset_groups(location_upsetr, excel = "36upset_genotype_tx/sr_p08_hetko_upset_groups.xlsx")
location_upsetr[["all_plot"]]

pp(file = "36upset_genotype_tx/test_location_sr_p08_hetko_upset.pdf")
print(location_upsetr[["all_plot"]])
plotted <- dev.off()

I am reasonably certain that Rashmi would like a table of the genes shared among increased scn ko and het in the above plot along with the increased retina (e.g. the 269 and 103 gene sets).

24.3 scn vs retina, p15

table_names <- c("sr_p15_het", "sr_p15_ko")
table_names %in% names(location_sig)
## [1] TRUE TRUE
location_upset_input <- list()
first_table <- table_names[1]
newsig <- location_sig[[first_table]]
for (sig in 2:length(table_names)) {
  name <- table_names[sig]
  newsig[["deseq"]][["ups"]][[name]] <- location_sig[[name]][["deseq"]][["ups"]][[name]]
  newsig[["deseq"]][["downs"]][[name]] <- location_sig[[name]][["deseq"]][["downs"]][[name]]
}
location_upsetr <- upsetr_sig(newsig)
location_upset_written <- write_upset_groups(location_upsetr, excel = "36upset_genotype_tx/sr_p15_hetko_upset_groups.xlsx")
location_upsetr[["all_plot"]]

print(scn_retina_p15_upset_result)
## Error:
## ! object 'scn_retina_p15_upset_result' not found
pp(file = "36upset_genotype_tx/test_location_sr_p15_hetko_upset.pdf")
print(location_upsetr[["all_plot"]])
plotted <- dev.off()

24.4 dlgn vs retina, p08

## The appropriate data structure is 'genotype_tables',
## and the tables of interest are:
table_names <- c("dr_p08_het", "dr_p08_ko")
location_upset_input <- list()
first_table <- table_names[1]
newsig <- location_sig[[first_table]]
for (sig in 2:length(table_names)) {
  name <- table_names[sig]
  newsig[["deseq"]][["ups"]][[name]] <- location_sig[[name]][["deseq"]][["ups"]][[name]]
  newsig[["deseq"]][["downs"]][[name]] <- location_sig[[name]][["deseq"]][["downs"]][[name]]
}
location_upsetr <- upsetr_sig(newsig)
location_upset_written <- write_upset_groups(location_upsetr, excel = "3upset_genotype_tx/dr_p08_hetko_upset_groups.xlsx")
location_upsetr[["all_plot"]]

pp(file = "36upset_genotype_tx/test_location_dr_p08_hetko_upset.pdf")
print(location_upsetr[["all_plot"]])
plotted <- dev.off()

24.5 dlgn vs retina, p15

## The appropriate data structure is 'genotype_tables',
## and the tables of interest are:
table_names <- c("dr_p15_het", "dr_p15_ko")
location_upset_input <- list()
first_table <- table_names[1]
newsig <- location_sig[[first_table]]
for (sig in 2:length(table_names)) {
  name <- table_names[sig]
  newsig[["deseq"]][["ups"]][[name]] <- location_sig[[name]][["deseq"]][["ups"]][[name]]
  newsig[["deseq"]][["downs"]][[name]] <- location_sig[[name]][["deseq"]][["downs"]][[name]]
}
location_upsetr <- upsetr_sig(newsig)
location_upset_written <- write_upset_groups(location_upsetr, excel = "37upset_location_tx/dr_p15_hetko_upset_groups.xlsx")
location_upsetr[["all_plot"]]

pp(file = "37upset_location_tx/test_location_dr_p15_hetko_upset.pdf")
print(location_upsetr[["all_plot"]])
plotted <- dev.off()

24.6 dlgn vs scn, p08

table_names <- c("ds_p08_het", "ds_p08_ko")
location_upset_input <- list()
first_table <- table_names[1]
newsig <- location_sig[[first_table]]
for (sig in 2:length(table_names)) {
  name <- table_names[sig]
  newsig[["deseq"]][["ups"]][[name]] <- location_sig[[name]][["deseq"]][["ups"]][[name]]
  newsig[["deseq"]][["downs"]][[name]] <- location_sig[[name]][["deseq"]][["downs"]][[name]]
}
location_upsetr <- upsetr_sig(newsig)
location_upset_written <- write_upset_groups(location_upsetr, excel = "37upset_location_tx/ds_p08_hetko_upset_groups.xlsx")
location_upsetr[["all_plot"]]

pp(file = "37upset_location_tx/test_location_ds_p08_hetko_upset.pdf")
print(location_upsetr[["all_plot"]])
plotted <- dev.off()

24.7 dlgn vs scn, p15

table_names <- c("ds_p15_het", "ds_p15_ko")
location_upset_input <- list()
first_table <- table_names[1]
newsig <- location_sig[[first_table]]
for (sig in 2:length(table_names)) {
  name <- table_names[sig]
  newsig[["deseq"]][["ups"]][[name]] <- location_sig[[name]][["deseq"]][["ups"]][[name]]
  newsig[["deseq"]][["downs"]][[name]] <- location_sig[[name]][["deseq"]][["downs"]][[name]]
}
location_upsetr <- upsetr_sig(newsig)
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
location_upset_written <- write_upset_groups(location_upsetr, excel = "37upset_location_tx/ds_p15_hetko_upset_groups.xlsx")
location_upsetr[["all_plot"]]

pp(file = "37upset_location_tx/test_location_ds_p15_hetko_upset.pdf")
print(location_upsetr[["all_plot"]])
plotted <- dev.off()

25 Shared and unique gene sets across x/wt

In this block I want to find the unique and shared genes between:

  1. scn p8 het/wt and retina p8 het/wt: hwp08scninc, hwp08retinc, hwp08scndec, hwp08retdec
  2. scn p15 het/wt and retina p15 het/wt: hwp15scninc, hwp15retinc, hwp15scndec, hwp15retdec
  3. #1 and #2 together: 8 catgories above
  4. scn p8 ko/wt and retina p8 ko/wt
  5. scn p15 ko/wt and retina p15 ko/wt
  6. #4 and #5 together

The comparisons of het/wt are found in the ‘inclusion_sig’ dataset; because they are providing our cutoffs for nonspecific binding.

25.1 Number 1 above: p08_het vs wt for scn and retina.

table_names <- c("p08_het_scn", "p08_het_retina")
inclusion_upsetr <- upsetr_sig(inclusion_sig, contrasts = table_names)
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
inclusion_upset_written <- write_upset_groups(inclusion_upsetr, excel = "37upset_locations_tx/rs_p08_het_inclusion_upset_groups.xlsx")
inclusion_upsetr[["all_plot"]]

pp(file = "37upset_locations_tx/inclusion_sr_p08_upset.pdf")
print(inclusion_upsetr[["all_plot"]])
plotted <- dev.off()

25.2 Number 2 above: p15_het vs wt for scn and retina.

table_names <- c("p15_het_scn", "p15_het_retina")
inclusion_upsetr <- upsetr_sig(inclusion_sig, contrasts = table_names)
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
inclusion_upset_written <- write_upset_groups(inclusion_upsetr, excel = "37upset_locations_tx/rs_p15_het_inclusion_upset_groups.xlsx")
inclusion_upsetr[["all_plot"]]

pp(file = "37upset_locations_tx/inclusion_sr_p15_upset.pdf")
print(inclusion_upsetr[["all_plot"]])
plotted <- dev.off()

25.3 Number 3 above: combination of #1 and #2

table_names <- c("p08_het_scn", "p08_het_retina", "p15_het_scn", "p15_het_retina")
inclusion_upsetr <- upsetr_sig(inclusion_sig, contrasts = table_names)
inclusion_upset_written <- write_upset_groups(inclusion_upsetr, excel = "37upset_locations_tx/rs_p08p15_het_inclusion_upset_groups.xlsx")
inclusion_upsetr[["all_plot"]]

pp(file = "37upset_locations_tx/inclusion_sr_p08p15_upset.pdf")
print(inclusion_upsetr[["all_plot"]])
plotted <- dev.off()

25.4 Number 4 above p08_ko vs wt for scn and retina.

table_names <- c("p08_ko_scn", "p08_ko_retina")
inclusion_upsetr <- upsetr_sig(inclusion_sig, contrasts = table_names)
inclusion_upset_written <- write_upset_groups(inclusion_upsetr, excel = "37upset_locations_tx/rs_p08_ko_inclusion_upset_groups.xlsx")
inclusion_upsetr[["all_plot"]]

pp(file = "37upset_locations_tx/inclusion_sr_p08_ko_upset.pdf")
print(inclusion_upsetr[["all_plot"]])
plotted <- dev.off()

25.5 Number 5 above p15_ko vs wt for scn and retina.

table_names <- c("p15_ko_scn", "p15_ko_retina")
inclusion_upsetr <- upsetr_sig(inclusion_sig, contrasts = table_names)
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
inclusion_upset_written <- write_upset_groups(inclusion_upsetr, excel = "37upset_locations_tx/rs_p15_ko_inclusion_upset_groups.xlsx")
inclusion_upsetr[["all_plot"]]

pp(file = "37upset_locations_tx/inclusion_sr_p15_ko_upset.pdf")
print(inclusion_upsetr[["all_plot"]])
plotted <- dev.off()

25.6 Number 6 above: Combining #4 and #5

table_names <- c("p08_ko_scn", "p08_ko_retina", "p15_ko_scn", "p15_ko_retina")
inclusion_upsetr <- upsetr_sig(inclusion_sig, contrasts = table_names)
inclusion_upset_written <- write_upset_groups(inclusion_upsetr, excel = "37upset_locations_tx/rs_p08p15_ko_inclusion_upset_groups.xlsx")
inclusion_upsetr[["all_plot"]]

pp(file = "37upset_locations_tx/inclusion_sr_p08p15_ko_upset.pdf")
print(inclusion_upsetr[["all_plot"]])
plotted <- dev.off()

26 GSVA

msigdb <- "reference/msigdb_v2024.1.Mm.db"
if (file.exists(msigdb)) {
  tx_h_gsva <- simple_gsva(tx_pairwise_input, orgdb = "org.Mm.eg.db", signature_category = "mh",
                           signatures = msigdb, id_source = "fdata",
                           required_id = "mgi_symbol")
  tx_h_gsva

  tx_h_gsva_sig <- get_sig_gsva_categories(
    tx_h_gsva, excel = "38msigdb_tx/gsva_sig_hallmark_categories.xlsx")
  tx_h_gsva_sig

  tx_m1_gsva <- simple_gsva(tx_pairwise_input, orgdb = "org.Mm.eg.db", signature_category = "m1",
                            signatures = msigdb, id_source = "fdata",
                            required_id = "mgi_symbol")
  tx_m1_gsva
  tx_m1_gsva_sig <- get_sig_gsva_categories(
    tx_m1_gsva, excel = "38msigdb_tx/gsva_sig_positional_categories.xlsx")
  tx_m1_gsva_sig

  tx_m2_gsva <- simple_gsva(tx_pairwise_input, orgdb = "org.Mm.eg.db", signature_category = "m2",
                            signatures = msigdb, id_source = "fdata",
                            required_id = "mgi_symbol")
  tx_m2_gsva
  tx_m2_gsva_sig <- get_sig_gsva_categories(
    tx_m2_gsva, excel = "38msigdb_tx/gsva_sig_curated_categories.xlsx")
  tx_m2_gsva_sig

  tx_m3_gsva <- simple_gsva(tx_pairwise_input, orgdb = "org.Mm.eg.db", signature_category = "m3",
                            signatures = msigdb, id_source = "fdata",
                            required_id = "mgi_symbol")
  tx_m3_gsva
  tx_m3_gsva_sig <- get_sig_gsva_categories(
    tx_m3_gsva, excel = "38msigdb_tx/gsva_sig_regulatory_categories.xlsx")
  tx_m3_gsva_sig

  tx_m5_gsva <- simple_gsva(tx_pairwise_input, orgdb = "org.Mm.eg.db", signature_category = "m5",
                            signatures = msigdb, id_source = "fdata",
                            required_id = "mgi_symbol")
  tx_m5_gsva
  tx_m5_gsva_sig <- get_sig_gsva_categories(
    tx_m5_gsva, excel = "38msigdb_tx/gsva_sig_ontology_categories.xlsx")
  tx_m5_gsva_sig

  tx_m8_gsva <- simple_gsva(tx_pairwise_input, orgdb = "org.Mm.eg.db", signature_category = "m8",
                            signatures = msigdb, id_source = "fdata",
                            required_id = "mgi_symbol")
  tx_m8_gsva
  tx_m8_gsva_sig <- get_sig_gsva_categories(
    tx_m8_gsva, excel = "38msigdb_tx/gsva_sig_celltype_categories.xlsx")
  tx_m8_gsva_sig
}
## gsva requires the annotation field to be filled in. Setting it to orgdb given.
## Converting the rownames() of the SummarizedExperiment to mgi_symbol.
## Error in `simple_gsva()`:
## ! I do not understand this ID source.

27 GSEA images

Up above I created a fairly large set of enrichment/GSEA analyses. Let us pull some of the most interesting results here and look at them.

Here are the specific queries from Rashmi:

  • Genotype (het vs ko):
    • P8 het and ko for Ret
    • SCN (P8 het vs KO SCN
    • P8 het vs KO Ret)
    • P15 het and ko for Ret
  • Location (somal vs axonal):
    • SR_P08_KO
    • SR_P08_Het
    • SR_P15_KO
    • SR_P15_Het
  • Time(p8vs p15):
    • t_het_Ret_ po8-p15
    • t_KO_Ret_C po8-p15
    • t_het_SCN_po8-p15
    • t_KO_SCN_po8-p15

27.1 Genotype

Let us take a moment and see for which contrasts I acquired results:

I need to make a little summary for clusterprofiler too so that I can easily see how many hits there are for each contrast.

summary(genotype_full_gp)
##                  Length Class                       Mode
## kh_p08_dlgn_up   22     hpgltools::simple_gprofiler list
## kh_p08_dlgn_down 25     hpgltools::simple_gprofiler list
## kh_p15_dlgn_up   28     hpgltools::simple_gprofiler list
## kh_p08_scn_down  24     hpgltools::simple_gprofiler list
## kh_p15_scn_down  26     hpgltools::simple_gprofiler list
for (i in names(genotype_full_gp)) {
  print(i)
  print(genotype_full_gp[[i]][["num_hits"]])
}
## [1] "kh_p08_dlgn_up"
##    BP    CC CORUM    HP  KEGG    MF  REAC    TF    WP 
##     0     1     0     0     0     0     0     1     0 
## [1] "kh_p08_dlgn_down"
##    BP    CC CORUM    HP  KEGG    MF  REAC    TF    WP 
##     3     2     0     1     1     0     0     2     0 
## [1] "kh_p15_dlgn_up"
##    BP    CC CORUM    HP  KEGG    MF  REAC    TF    WP 
##    51    29     1    90     1     7     5     3     0 
## [1] "kh_p08_scn_down"
##    BP    CC CORUM    HP  KEGG    MF  REAC    TF    WP 
##     2     7     0     0     0     2     0     1     0 
## [1] "kh_p15_scn_down"
##    BP    CC CORUM    HP  KEGG    MF  REAC    TF    WP 
##    10     2     0     0     1     4     1     0     1
summary(genotype_full_cp)
##                  Length Class                             Mode
## kh_p08_dlgn_up   20     hpgltools::simple_clusterprofiler list
## kh_p15_dlgn_up   20     hpgltools::simple_clusterprofiler list
## kh_p08_retina_up 20     hpgltools::simple_clusterprofiler list
## kh_p15_retina_up 20     hpgltools::simple_clusterprofiler list
## kh_p08_scn_up    20     hpgltools::simple_clusterprofiler list
## kh_p15_scn_down  20     hpgltools::simple_clusterprofiler list
for (i in names(genotype_full_cp)) {
  print(i)
  print(nrow(genotype_full_cp[[i]][["gse_go"]]))
}
## [1] "kh_p08_dlgn_up"
## NULL
## [1] "kh_p15_dlgn_up"
## NULL
## [1] "kh_p08_retina_up"
## NULL
## [1] "kh_p15_retina_up"
## NULL
## [1] "kh_p08_scn_up"
## NULL
## [1] "kh_p15_scn_down"
## NULL

27.1.1 p8 het/ko for retina:

This contrast, even before filtering away the high-wt genes, only has 8 genes in the set of up and down genes combined. As a result, my function which performs gProfiler/clusterProfiler skips it, and also skips the p15 het/ko for retina samples.

27.1.2 p8 het/ko for scn:

This has a bunch more genes: 51 up and 128 down. Unfortunately, gProfiler sees no significant over-representation in the up category of genes. The down category has

The up/down sets from clusterProfiler have enrich_go, gse_go, and go_data to look at.

genotype_full_gp$kh_p08_scn_up$num_hits
## NULL
genotype_full_gp$kh_p08_scn_down$num_hits
##    BP    CC CORUM    HP  KEGG    MF  REAC    TF    WP 
##     2     7     0     0     0     2     0     1     0
plots <- plot_enrichresult(genotype_full_gp$kh_p08_scn_down[["BP_enrich"]])
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## dimensionality reduction failed with provided drfun; falling back to stats::cmdscale.
plots[["dot"]]

plots[["tree"]]
## NULL

Perhaps I should just ask the question: for which categories did I get results back?

summary(genotype_full_gp)
##                  Length Class                       Mode
## kh_p08_dlgn_up   22     hpgltools::simple_gprofiler list
## kh_p08_dlgn_down 25     hpgltools::simple_gprofiler list
## kh_p15_dlgn_up   28     hpgltools::simple_gprofiler list
## kh_p08_scn_down  24     hpgltools::simple_gprofiler list
## kh_p15_scn_down  26     hpgltools::simple_gprofiler list

kh_p08_dlgn_up: No significant gProfiler results. kh_p15_dlgn_up: Significant BP, HP, KEGG, MF, REAC, TF kh_p08_scn_up: No significant gProfiler results. kh_p08_scn_down: Significant BP, MiRNA, MF, TF kh_p15_scn_down: Significant BP, MF

plots <- plot_enrichresult(genotype_full_gp[["kh_p15_dlgn_up"]][["BP_enrich"]])
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
plots[["dot"]]

27.2 Location

27.2.1 Scn vs retina ko, p08

plots <- plot_enrichresult(location_gp[["sr_p08_ko"]][["sr_p08_ko_up"]][["BP_enrich"]])
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
plots[["dot"]]

plots <- plot_enrichresult(location_gp[["sr_p08_ko"]][["sr_p08_ko_down"]][["BP_enrich"]])
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
plots[["dot"]]

27.2.2 scn vs retina, het, p08

Enriched groups: BP, KEGG, MF, TF, CC

summary(location_gp[["sr_p08_het"]][["sr_p08_het_up"]])
##                   Length Class             Mode     
## BP                 0     data.frame        list     
## CC                16     data.frame        list     
## CORUM              0     data.frame        list     
## HP                 0     data.frame        list     
## KEGG              16     data.frame        list     
## MF                16     data.frame        list     
## REAC               0     data.frame        list     
## TF                16     data.frame        list     
## WP                 0     data.frame        list     
## input             78     data.frame        list     
## CC_enrich          1     enrichResult      S4       
## KEGG_enrich        1     enrichResult      S4       
## MF_enrich          1     enrichResult      S4       
## TF_enrich          1     enrichResult      S4       
## num_genes          1     -none-            numeric  
## interactive_plots  4     -none-            list     
## num_hits           9     -none-            numeric  
## gost_plots         4     -none-            list     
## gost_links         4     -none-            list     
## significant        4     -none-            list     
## excel              1     written_gprofiler numeric  
## pvalue_plots       2     -none-            list     
## species            1     -none-            character
## threshold          1     -none-            numeric
plots <- plot_enrichresult(location_gp[["sr_p08_het"]][["sr_p08_het_up"]][["BP_enrich"]])
plots[["dot"]]
## NULL
plots <- plot_enrichresult(location_gp[["sr_p08_het"]][["sr_p08_het_up"]][["CC_enrich"]])
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
plots[["dot"]]

plots <- plot_enrichresult(location_gp[["sr_p08_het"]][["sr_p08_het_down"]][["BP_enrich"]])
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
plots[["dot"]]

sr_p08_het_topn_gsea <- plot_topn_gsea(location_cp[[""]])
## Error in `if (nrow(gse) < topn) ...`:
## ! argument is of length zero

27.2.3 Scn vs retina ko, p15

plots <- plot_enrichresult(location_gp[["sr_p15_ko"]][["sr_p15_ko_up"]][["BP_enrich"]])
plots[["dot"]]
## NULL
plots <- plot_enrichresult(location_gp[["sr_p15_ko"]][["sr_p15_ko_down"]][["BP_enrich"]])
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
## dimensionality reduction failed with provided drfun; falling back to stats::cmdscale.
plots[["dot"]]

27.2.4 scn vs retina, het, p15

plots <- plot_enrichresult(location_gp[["sr_p15_het"]][["sr_p15_het_up"]][["BP_enrich"]])
plots[["dot"]]
## NULL
plots <- plot_enrichresult(location_gp[["sr_p15_het"]][["sr_p15_het_down"]][["BP_enrich"]])
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
plots[["dot"]]

27.3 Time

27.3.1 het retina

Ups: significant results for BP, MF, TF Downs: BP, MF, REAC, TF, WP

plots <- plot_enrichresult(time_gp[["t_het_retina"]][["t_het_retina_up"]][["BP_enrich"]])
plots[["dot"]]
## NULL
plots <- plot_enrichresult(time_gp[["t_het_retina"]][["t_het_retina_down"]][["BP_enrich"]])
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
plots[["dot"]]

27.3.2 ko retina

Up: BP, MiRNA, MF Down: BP, MF, REAC, TF

plots <- plot_enrichresult(time_gp[["t_ko_retina"]][["t_ko_retina_up"]][["BP_enrich"]])
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
plots[["dot"]]

plots <- plot_enrichresult(time_gp[["t_ko_retina"]][["t_ko_retina_down"]][["BP_enrich"]])
## Warning in (function (model, data, ...) : Arguments in `...` must be used.
## ✖ Problematic argument:
## • by = "Count"
## ℹ Did you misspell an argument name?
plots[["dot"]]

27.3.3 het scn

Neither of the SCN gProfiler queries provided any results.

28 Bibliography

pander::pander(sessionInfo())
message(paste0("This is hpgltools commit: ", get_git_commit()))
message(paste0("Saving to ", savefile))
tmp <- sm(saveme(filename = savefile))
tmp <- loadme(filename = savefile)
Hoffman, Gabriel E., and Eric E. Schadt. 2016. “variancePartition: Interpreting Drivers of Variation in Complex Gene Expression Studies.” BMC Bioinformatics 17 (1): 483. https://doi.org/10.1186/s12859-016-1323-z.
Leng, Ning, John A. Dawson, James A. Thomson, et al. 2013. “EBSeq: An Empirical Bayes Hierarchical Model for Inference in RNA-Seq Experiments.” Bioinformatics 29 (8): 1035–43. https://doi.org/10.1093/bioinformatics/btt087.
Love, Michael I., Wolfgang Huber, and Simon Anders. 2014. “Moderated Estimation of Fold Change and Dispersion for RNA-Seq Data with DESeq2.” In bioRxiv. https://doi.org/10.1101/002832.
Raudvere, Uku, Liis Kolberg, Ivan Kuzmin, et al. 2019. “G:profiler: A Web Server for Functional Enrichment Analysis and Conversions of Gene Lists (2019 Update).” Nucleic Acids Research 47 (W1): W191–98. https://doi.org/10.1093/nar/gkz369.
Ritchie, Matthew E., Belinda Phipson, Di Wu, et al. 2015. “Limma Powers Differential Expression Analyses for RNA-Sequencing and Microarray Studies.” Nucleic Acids Research 43 (7): e47. https://doi.org/10.1093/nar/gkv007.
Robinson, Mark D., Davis J. McCarthy, and Gordon K. Smyth. 2010. “edgeR: A Bioconductor Package for Differential Expression Analysis of Digital Gene Expression Data.” Bioinformatics 26 (1): 139–40. https://doi.org/10.1093/bioinformatics/btp616.
Smedley, Damian, Syed Haider, Benoit Ballester, et al. 2009. “BioMart – Biological Queries Made Easy.” BMC Genomics 10 (1): 22. https://doi.org/10.1186/1471-2164-10-22.
Tarazona, Sonia, Fernando García, Alberto Ferrer, Joaquín Dopazo, and Ana Conesa. 2011. “NOIseq: A RNA-Seq Differential Expression Method Robust for Sequencing Depth Biases.” EMBnet.journal 17 (B): 18–19. https://doi.org/10.14806/ej.17.B.265.
Yu, Guangchuang. n.d. 📖 Introduction Biomedical Knowledge Mining Using GOSemSim and clusterProfiler. Accessed June 21, 2024. https://yulab-smu.top/biomedical-knowledge-mining-book/.
LS0tCnRpdGxlOiAiQW5hbHlzZXMgb2YgdGhlIElQUkdDIHRyYW5zY3JpcHQgYWJ1bmRhbmNlcy4iCmF1dGhvcjogImF0YiBhYmVsZXdAZ21haWwuY29tIgpkYXRlOiAiYHIgU3lzLkRhdGUoKWAiCmJpYmxpb2dyYXBoeTogYXRiLmJpYgpvdXRwdXQ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A8LSBub3JtYWxpemUodHhfcGFpcndpc2VfaW5wdXQsIGZpbHRlciA9IFRSVUUpCmxpbW1hX3Rlc3QgPC0gbGltbWFfcGFpcndpc2UoZmlsdCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZWVwZXJzID0gc2NuX3RyYW5zbGF0b21lX2RlX2tlZXBlcnMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kZWxfZnN0cmluZyA9ICJ+IDAgKyBjb25kaXRpb24iLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGVsX3N2cyA9IEZBTFNFLCBleHRyYV9jb250cmFzdHJzID0gc2NuX2V4dHJhKQplZGdlcl90ZXN0IDwtIGVkZ2VyX3BhaXJ3aXNlKGZpbHQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2VlcGVycyA9IHNjbl90cmFuc2xhdG9tZV9kZV9rZWVwZXJzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGVsX2ZzdHJpbmcgPSAifiAwICsgY29uZGl0aW9uIiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RlbF9zdnMgPSBGQUxTRSwgZXh0cmFfY29udHJhc3RzID0gc2NuX2V4dHJhKQpzY25fdHJhbnNsYXRvbWVfZGUgPC0gYWxsX3BhaXJ3aXNlKHR4X3BhaXJ3aXNlX2lucHV0LCBmaWx0ZXIgPSBUUlVFLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtlZXBlcnMgPSBzY25fdHJhbnNsYXRvbWVfZGVfa2VlcGVycywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RlbF9zdnMgPSBGQUxTRSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RlbF9mc3RyaW5nID0gIn4gMCArIGNvbmRpdGlvbiIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9fYmFzaWMgPSBGQUxTRSwgZG9fZHJlYW0gPSBGQUxTRSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb19ub2lzZXEgPSBGQUxTRSwgZG9fZWJzZXEgPSBGQUxTRSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYV9jb250cmFzdHMgPSBzY25fZXh0cmEpCnNjbl9jb21iaW5lZF90ZXN0IDwtIGNvbWJpbmVfZGVfdGFibGVzKAogIHNjbl90cmFuc2xhdG9tZV9kZSwga2VlcGVycyA9IHNjbl90cmFuc2xhdG9tZV9rZWVwZXJzLAogIGV4Y2VsID0gZ2x1ZSgiMzN0cmFuc2xhdG9tZV94bHN4X3R4L3Rlc3Rfc2NuX3RyYW5zbGF0b21lX3VuZmlsdGVyZWRfbm9zdmEtdnt2ZXJ9Lnhsc3giKSkKc2NuX3RyYW5zbGF0b21lX2RlX3N2YSA8LSBhbGxfcGFpcndpc2UodHhfcGFpcndpc2VfaW5wdXQsIGZpbHRlciA9IFRSVUUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtlZXBlcnMgPSBzY25fdHJhbnNsYXRvbWVfZGVfa2VlcGVycywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kZWxfc3ZzID0gInN2YXNlcSIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGVsX2ZzdHJpbmcgPSAifiAwICsgY29uZGl0aW9uIiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9fYmFzaWMgPSBGQUxTRSwgZG9fZHJlYW0gPSBGQUxTRSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9fbm9pc2VxID0gRkFMU0UsIGRvX2Vic2VxID0gRkFMU0UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhX2NvbnRyYXN0cyA9IHNjbl9leHRyYSkKc2NuX2NvbWJpbmVkX3Rlc3Rfc3ZhIDw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mEiKSwKICAicDA4X2tvX2RsZ25fdnNfcmV0aW5hIiA9IGMoInAwOF9rb19kbGduIiwgInAwOF9rb19yZXRpbmEiKSwKICAicDA4X2RsZ25fdHJhbnNsYXRvbWUiID0gYygicDA4aGV0IiwgInAwOGtvIikpCnAwOF9kbGduX3RyYW5zbGF0b21lX2RlIDwtIGFsbF9wYWlyd2lzZSh0eF9wYWlyd2lzZV9pbnB1dCwgZmlsdGVyID0gVFJVRSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtlZXBlcnMgPSBwMDhfZGxnbl90cmFuc2xhdG9tZV9kZV9rZWVwZXJzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kZWxfc3ZzID0gRkFMU0UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RlbF9mc3RyaW5nID0gIn4gMCArIGNvbmRpdGlvbiIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb19iYXNpYyA9IEZBTFNFLCBkb19kcmVhbSA9IEZBTFNFLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9fbm9pc2VxID0gRkFMU0UsIGRvX2Vic2VxID0gRkFMU0UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYV9jb250cmFzdHMgPSBwMDhfZGxnbl9leHRyYSkKcDA4X2RsZ25fY29tYmluZWRfdGVzdCA8LSBjb21iaW5lX2RlX3RhYmxlcygKICBwMDhfZGxnbl90cmFuc2xhdG9tZV9kZSwga2VlcGVycyA9IHAwOF9kbGduX3RyYW5zbGF0b21lX2tlZXBlcnMsCiAgbGFiZWxfY29sdW1uID0gbGFiZWxfY29sdW1uLAogIGV4Y2VsID0gZ2x1ZSgiMzN0cmFuc2xhdG9tZV94bHN4X3R4L3Rlc3RfcDA4X2RsZ25fdHJhbnNsYXRvbWVfdW5maWx0ZXJlZF9ub3N2YS12e3Zlcn0ueGxzeCIpKQpwMDhfZGxnbl90cmFuc2xhdG9tZV9kZV9zdmEgPC0gYWxsX3BhaXJ3aXNlKHR4X3BhaXJ3aXNlX2lucHV0LCBmaWx0ZXIgPSBUUlVFLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtlZXBlcnMgPSBwMDhfZGxnbl90cmFuc2xhdG9tZV9kZV9rZWVwZXJzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGVsX3N2cyA9ICJzdmFzZXEiLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGVsX2ZzdHJpbmcgPSAifiAwICsgY29uZGl0aW9uIiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb19iYXNpYyA9IEZBTFNFLCBkb19kcmVhbSA9IEZBTFNFLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvX25vaXNlcSA9IEZBTFNFLCBkb19lYnNlcSA9IEZBTFNFLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhX2NvbnRyYXN0cyA9IHAwOF9kbGduX2V4dHJhKQpwMDhfZGxnbl9jb21iaW5lZF90ZXN0X3N2YSA8LSBjb21iaW5lX2RlX3RhYmxlcygKICBwMDhfZGxnbl90cmFuc2xhdG9tZV9kZV9zdmEsIGtlZXBlcnMgPSBwMDhfZGxnbl90cmFuc2xhdG9tZV9rZWVwZXJzLAogIGxhYmVsX2NvbHVtbiA9IGxhYmVsX2NvbHVtbiwKICBleGNlbCA9IGdsdWUoIjMzdHJhbnNsYXRvbWVfeGxzeF90eC90ZXN0X3AwOF9kbGduX3RyYW5zbGF0b21lX3VuZmlsdGVyZWRfc3ZhLXZ7dmVyfS54bHN4IikpCmBgYAoKIyMjIFN1YnRyYWN0aW5nIHRoZSBERVNlcTIgcmVzdWx0cwo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Y24iLCAicDA4X2hldF9yZXRpbmEiKSwKICAicDE1a28iID0gYygicDE1X2tvX3NjbiIsICJwMTVfa29fcmV0aW5hIiksCiAgInAwOGtvIiA9IGMoInAwOF9rb19zY24iLCAicDA4X2tvX3JldGluYSIpKQp0aW1lX3Njbl90cmFuc2xhdG9tZV9rZWVwZXJzIDwtIGxpc3QoCiAgInAxNWhldCIgPSBjKCJwMTVfaGV0X3NjbiIsICJwMTVfaGV0X3JldGluYSIpLAogICJwMDhoZXQiID0gYygicDA4X2hldF9zY24iLCAicDA4X2hldF9yZXRpbmEiKSwKICAicDE1a28iID0gYygicDE1X2tvX3NjbiIsICJwMTVfa29fcmV0aW5hIiksCiAgInAwOGtvIiA9IGMoInAwOF9rb19zY24iLCAicDA4X2tvX3JldGluYSIpLAogICJwMTVfaGV0X3NjX3ZzX3JldGluYSIgPSBjKCJwMTVfaGV0X3NjbiIsICJwMTVfaGV0X3JldGluYSIpLAogICJwMDhfaGV0X3NjX3ZzX3JldGluYSIgPSBjKCJwMDhfaGV0X3NjbiIsICJwMDhfaGV0X3JldGluYSIpLAogICJzY25faGV0X3RyYW5zbGF0b21lIiA9IGMoInAxNWhldCIsICJwMDhoZXQiKSwKICAic2NuX2tvX3RyYW5zbGF0b21lIiA9IGMoInAxNWtvIiwgInAwOGtvIikpCnRpbWVfc2NuX3RyYW5zbGF0b21lX2RlIDwtIGFsbF9wYWlyd2lzZSh0eF9wYWlyd2lzZV9pbnB1dCwgZmlsdGVyID0gVFJVRSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtlZXBlcnMgPSB0aW1lX3Njbl90cmFuc2xhdG9tZV9kZV9rZWVwZXJzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kZWxfc3ZzID0gRkFMU0UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RlbF9mc3RyaW5nID0gIn4gMCArIGNvbmRpdGlvbiIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb19iYXNpYyA9IEZBTFNFLCBkb19kcmVhbSA9IEZBTFNFLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9fbm9pc2VxID0gRkFMU0UsIGRvX2Vic2VxID0gRkFMU0UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYV9jb250cmFzdHMgPSB0aW1lX3Njbl9leHRyYSkKdGltZV9zY25fdHJhbnNsYXRvbWVfdGVzdCA8LSBjb21iaW5lX2RlX3RhYmxlcygKICB0aW1lX3Njbl90cmFuc2xhdG9tZV9kZSwKICBrZWVwZXJzID0gdGltZV9zY25fdHJhbnNsYXRvbWVfa2VlcGVycywKICBsYWJlbF9jb2x1bW4gPSBsYWJlbF9jb2x1bW4sCiAgZXhjZWwgPSBnbHVlKCIzM3RyYW5zbGF0b21lX3hsc3hfdHgvdGVzdF90aW1lX3Njbl90cmFuc2xhdG9tZV91bmZpbHRlcmVkX25vc3ZhLXZ7dmVyfS54bHN4IikpCnRpbWVfc2NuX3RyYW5zbGF0b21lX2RlX3N2YSA8LSBhbGxfcGFpcndpc2UodHhfcGFpcndpc2VfaW5wdXQsIGZpbHRlciA9IFRSVUUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2VlcGVycyA9IHRpbWVfc2NuX3RyYW5zbGF0b21lX2RlX2tlZXBlcnMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kZWxfc3ZzID0gInN2YXNlcSIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kZWxfZnN0cmluZyA9ICJ+IDAgKyBjb25kaXRpb24iLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvX2Jhc2ljID0gRkFMU0UsIGRvX2RyZWFtID0gRkFMU0UsCiAgICAgICAgICAgICAg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