library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(tidyverse)
## Warning: package 'ggplot2' was built under R version 4.3.3
## Warning: package 'tidyr' was built under R version 4.3.2
## Warning: package 'purrr' was built under R version 4.3.3
## Warning: package 'lubridate' was built under R version 4.3.3
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ forcats   1.0.0.9000     ✔ readr     2.1.5     
## ✔ ggplot2   3.5.2          ✔ stringr   1.5.1     
## ✔ lubridate 1.9.4          ✔ tibble    3.2.1     
## ✔ purrr     1.0.4          ✔ tidyr     1.3.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(WGCNA)
## Warning: package 'WGCNA' was built under R version 4.3.3
## Loading required package: dynamicTreeCut
## Loading required package: fastcluster
## Warning: package 'fastcluster' was built under R version 4.3.3
## 
## Attaching package: 'fastcluster'
## 
## The following object is masked from 'package:stats':
## 
##     hclust
## 
## 
## 
## Attaching package: 'WGCNA'
## 
## The following object is masked from 'package:stats':
## 
##     cor
cleanDat.human.symbols.only.df <- readRDS("~/Desktop/Resilience.SFN/Brain.Resilience.SFN/cleanDat.human.symbols.only.df.rds")
dim(cleanDat.human.symbols.only.df)
## [1] 8535   86
numericMeta.mouse <- readRDS("~/Desktop/Resilience.SFN/Brain.Resilience.SFN/numericMeta.mouse.rds")
 numericMeta <- numericMeta.mouse

net.FF <- readRDS("~/Desktop/Resilience.SFN/Brain.Resilience.SFN/net.FF.rds")
net <- net.FF
Mouse.cleanDat.human.symbols.only.df <- readRDS("~/Desktop/Resilience.SFN/Brain.Resilience.SFN/Mouse.cleanDat.human.symbols.only.df.rds")

dim(Mouse.cleanDat.human.symbols.only.df)
## [1] 8535   86
cleanDat <- Mouse.cleanDat.human.symbols.only.df 

HUMAN <- load("~/Desktop/Mouse.TMT.FET.analysis/MEGA488_forORA.rdata")
#cleanDatMEGA
#netMEGA
library(readr)
FET_Protein_list_human <-  read_csv("~/Downloads/FET.Protein.list.human_5xFAD.Brain.Manuscript.csv")
## Rows: 1047424 Columns: 11
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (11): Pro.Resilience, Anti.Resilience, AD.MAGMA, PD.MAGMA, ALS.MAGMA, AD...
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
heatmapScale="minusLogFDR"
heatmapTitle="Network Module"
FileBaseName="camk2a.Cognitive.FET"
refDataDescription="Preserved.Modules"
heatmapScale="minusLogFDR"
heatmapTitle="Network Module"
FileBaseName="mousetmt.Cognitive.FET"
refDataDescription="Preserved.Modules"
refDataFiles <- c("FET.Protein.list.human_5xFAD.Brain.Manuscript.csv")
speciesCode=c("hsapiens")
modulesInMemory=TRUE
allowDuplicates=TRUE
resortListsDecreasingSize=FALSE
barOption=FALSE
adjustFETforLookupEfficiency=FALSE
verticalCompression=3
reproduceHistoricCalc=FALSE
source("/Users/usri/Desktop/geneListFET.R")
speciesCode=c("hsapiens")
modulesInMemory=TRUE
allowDuplicates=TRUE
resortListsDecreasingSize=FALSE
barOption=FALSE
adjustFETforLookupEfficiency=FALSE
verticalCompression=3
reproduceHistoricCalc=FALSE
source("/Users/usri/Desktop/geneListFET.R")
refDataFiles <- c("FET.Protein.list.human_5xFAD.Brain.Manuscript.csv")
##FET analysis from source code function
geneListFET(FileBaseName="MouseBrain.TMT.FET",
            heatmapTitle="Network_Module.MouseBrain.TMT.FET",
            modulesInMemory=TRUE,categorySpeciesCode="hsapiens",
            refDataFiles=refDataFiles,speciesCode=c("hsapiens"),refDataDescription="Cognitive.Mouse Brain TMT in preserved modulesJUNE")
## Performing FET for lists [1] now.
## quartz_off_screen 
##                 2
dev.off()
## null device 
##           1