Last updated: 2022-02-21
Checks: 6 1
Knit directory: S:/KJP_Biolabor/Projects/scSeq_Hefendehl/
This reproducible R Markdown analysis was created with workflowr (version 1.7.0). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.
The R Markdown file has unstaged changes. To know which version of the R Markdown file created these results, you’ll want to first commit it to the Git repo. If you’re still working on the analysis, you can ignore this warning. When you’re finished, you can run wflow_publish to commit the R Markdown file and build the HTML.
Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.
The command set.seed(20220131) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.
Great job! Recording the operating system, R version, and package versions is critical for reproducibility.
Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.
Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.
The results in this page were generated with repository version 79dd0b1. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.
Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:
Ignored files:
Ignored: .Rproj.user/
Ignored: data/ReloadAllData_Hefendehl_Stroke_Dec'21.RData
Ignored: data/Sample_Tables/
Ignored: data/counts.csv
Ignored: data/genecounts.csv
Ignored: data/microglia_protein.rds
Ignored: data/samples.integrated.RData
Ignored: data/tx2genes.csv
Ignored: output/Descriptives.Rmd
Ignored: output/Descriptives.docx
Untracked files:
Untracked: app/
Untracked: geneviewer/
Untracked: genplotter/
Untracked: workflow_helper.R
Unstaged changes:
Modified: analysis/01_Biostat.Rmd
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
There are no past versions. Publish this analysis with wflow_publish() to start tracking its development.
#get sample data
samples.integrated@meta.data %>% as.data.frame() -> samplemeta
# convert to correct data type
# define genotype as is
samplemeta$Genotype_corr = factor(samplemeta$Genotype=="wt", levels=c(F,T), labels = c("APPPS1+", "WT"))
samplemeta$Genotype_corr = relevel(samplemeta$Genotype_corr, ref="WT")
samplemeta$methoxy = factor(samplemeta$Genotype=="MX04+", levels=c(T,F), labels = c("MX04+", "MX04-"))
samplemeta$Treatment = as.factor(samplemeta$Treatment)
samplemeta$Treatment = relevel(samplemeta$Treatment, ref="Ctrl")
samplemeta$Mouse_ID = as.factor(samplemeta$Mouse_ID)
samplemeta$Sex = as.factor(samplemeta$Sex)
samplemeta$Brain_region = as.factor(samplemeta$Brain_region)
samplemeta$Celltype = as.factor(samplemeta$Celltype)
nCells=nrow(samplemeta)
nMice=nlevels(samplemeta$Mouse_ID)
nCelltypes=nlevels(samplemeta$Celltype)
Data contains a total of 649 Cells from 9. Q: Original raw datset containing only frankfurt data included 1149 cells. What were the filter criteria in the primary cell type analysis
Cells per Mouse
Cells per Strain
table(Mouse_ID=samplemeta$Mouse_ID) %>% as.data.frame() %>% display_tab()
| Mouse_ID | Freq |
|---|---|
| 23#15773 | 66 |
| 23#15774 | 49 |
| 23#15792 | 47 |
| 386 | 41 |
| 387 | 44 |
| 388 | 113 |
| 409 | 86 |
| 457 | 115 |
| 461 | 88 |
Cells per Genotype
table(Genotype=samplemeta$Genotype_corr, Treatment=samplemeta$Treatment) %>% as.data.frame() %>% display_tab()
| Genotype | Treatment | Freq |
|---|---|---|
| WT | Ctrl | 162 |
| APPPS1+ | Ctrl | 228 |
| WT | Stroke | 127 |
| APPPS1+ | Stroke | 132 |
table(Genotype=samplemeta$Genotype_corr, Celltype=samplemeta$Celltype) %>%
as.data.frame() %>% display_tab()
| Genotype | Celltype | Freq |
|---|---|---|
| WT | T/NK | 3 |
| APPPS1+ | T/NK | 19 |
| WT | Microglia_0 | 66 |
| APPPS1+ | Microglia_0 | 120 |
| WT | Microglia_1 | 93 |
| APPPS1+ | Microglia_1 | 71 |
| WT | Microglia_2 | 51 |
| APPPS1+ | Microglia_2 | 56 |
| WT | Microglia_3 | 44 |
| APPPS1+ | Microglia_3 | 55 |
| WT | Microglia_4 | 15 |
| APPPS1+ | Microglia_4 | 11 |
| WT | Microglia_5 | 11 |
| APPPS1+ | Microglia_5 | 12 |
| WT | Granulocytes | 6 |
| APPPS1+ | Granulocytes | 16 |
variables=c("Celltype","Sex", "Genotype_corr", "Treatment","Phase", "Brain_region","nCount_RNA","pseudoaligned_reads", "percent.mito", "percent.ribo", "Mouse_ID")
Descriptive stats across Cell type
res = compareGroups(Celltype~., data = samplemeta[,variables], max.ylev = 10)
#summary(res)
export_table <- createTable(res)
options(width = 10000)
print(export_table)
--------Summary descriptives table by 'Celltype'---------
_____________________________________________________________________________________________________________________________________________________
T/NK Microglia_0 Microglia_1 Microglia_2 Microglia_3 Microglia_4 Microglia_5 Granulocytes p.overall
N=22 N=186 N=164 N=107 N=99 N=26 N=23 N=22
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Sex: .
f 6 (27.3%) 27 (14.5%) 21 (12.8%) 11 (10.3%) 11 (11.1%) 1 (3.85%) 2 (8.70%) 8 (36.4%)
m 16 (72.7%) 159 (85.5%) 143 (87.2%) 96 (89.7%) 88 (88.9%) 25 (96.2%) 21 (91.3%) 14 (63.6%)
Genotype_corr: <0.001
WT 3 (13.6%) 66 (35.5%) 93 (56.7%) 51 (47.7%) 44 (44.4%) 15 (57.7%) 11 (47.8%) 6 (27.3%)
APPPS1+ 19 (86.4%) 120 (64.5%) 71 (43.3%) 56 (52.3%) 55 (55.6%) 11 (42.3%) 12 (52.2%) 16 (72.7%)
Treatment: <0.001
Ctrl 3 (13.6%) 101 (54.3%) 113 (68.9%) 70 (65.4%) 68 (68.7%) 21 (80.8%) 12 (52.2%) 2 (9.09%)
Stroke 19 (86.4%) 85 (45.7%) 51 (31.1%) 37 (34.6%) 31 (31.3%) 5 (19.2%) 11 (47.8%) 20 (90.9%)
Phase: 0.002
G1 1 (4.55%) 79 (42.5%) 70 (42.7%) 59 (55.1%) 42 (42.4%) 12 (46.2%) 14 (60.9%) 5 (22.7%)
G2M 11 (50.0%) 50 (26.9%) 38 (23.2%) 17 (15.9%) 21 (21.2%) 6 (23.1%) 4 (17.4%) 11 (50.0%)
S 10 (45.5%) 57 (30.6%) 56 (34.1%) 31 (29.0%) 36 (36.4%) 8 (30.8%) 5 (21.7%) 6 (27.3%)
Brain_region: <0.001
Cortex 3 (13.6%) 101 (54.3%) 113 (68.9%) 70 (65.4%) 68 (68.7%) 21 (80.8%) 12 (52.2%) 2 (9.09%)
Lesion 19 (86.4%) 85 (45.7%) 51 (31.1%) 37 (34.6%) 31 (31.3%) 5 (19.2%) 11 (47.8%) 20 (90.9%)
nCount_RNA 164049 (80916) 150451 (78955) 134224 (54802) 170420 (76702) 152640 (72678) 172200 (70772) 176087 (64299) 144828 (65899) 0.002
pseudoaligned_reads 165078 (81748) 150942 (78850) 134355 (54810) 170750 (76639) 152790 (72668) 172433 (70717) 176390 (64225) 145316 (65972) 0.002
percent.mito 2.23 (0.90) 1.75 (1.17) 1.62 (1.01) 2.07 (1.07) 1.72 (1.15) 1.97 (1.02) 2.11 (0.77) 0.92 (1.00) <0.001
percent.ribo 6.53 (2.72) 2.68 (1.58) 2.75 (1.81) 2.44 (1.24) 3.28 (1.67) 2.11 (0.85) 2.91 (1.35) 2.01 (1.17) <0.001
Mouse_ID: .
23#15773 0 (0.00%) 7 (3.76%) 25 (15.2%) 12 (11.2%) 17 (17.2%) 4 (15.4%) 1 (4.35%) 0 (0.00%)
23#15774 0 (0.00%) 1 (0.54%) 30 (18.3%) 10 (9.35%) 6 (6.06%) 1 (3.85%) 1 (4.35%) 0 (0.00%)
23#15792 1 (4.55%) 11 (5.91%) 13 (7.93%) 9 (8.41%) 6 (6.06%) 6 (23.1%) 1 (4.35%) 0 (0.00%)
386 1 (4.55%) 14 (7.53%) 9 (5.49%) 2 (1.87%) 6 (6.06%) 1 (3.85%) 5 (21.7%) 3 (13.6%)
387 11 (50.0%) 10 (5.38%) 5 (3.05%) 6 (5.61%) 5 (5.05%) 0 (0.00%) 1 (4.35%) 6 (27.3%)
388 1 (4.55%) 41 (22.0%) 21 (12.8%) 18 (16.8%) 21 (21.2%) 5 (19.2%) 6 (26.1%) 0 (0.00%)
409 1 (4.55%) 33 (17.7%) 16 (9.76%) 18 (16.8%) 9 (9.09%) 3 (11.5%) 3 (13.0%) 3 (13.6%)
457 1 (4.55%) 41 (22.0%) 24 (14.6%) 21 (19.6%) 18 (18.2%) 5 (19.2%) 3 (13.0%) 2 (9.09%)
461 6 (27.3%) 28 (15.1%) 21 (12.8%) 11 (10.3%) 11 (11.1%) 1 (3.85%) 2 (8.70%) 8 (36.4%)
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
export2xls(export_table,paste0(home,"/docs/Descriptives.xlsx"))
download data as excel file here
#get normalized counts
# question to Desiree hat the Seurat object been initialized with normalized data?
counts <- samples.integrated@assays$RNA@counts %>% as.data.frame()
# drop no variance data and sort by samplemeta
counts <- counts[apply(counts,1, sd) > 0, rownames(samplemeta)]
# drop genes with low detection rate (more than 5 counts per cell)
counts_per_celltype=apply(counts, 1, function(x){tapply(x, samplemeta$Celltype, function(z){sum(z>5,na.rm=T)})})
# keep RNAs with at least 10 cells with goood expression
idx=which(colSums(counts_per_celltype)>10)
counts = counts[idx,]
to check where the variance in the data comes from
log2_cpm = log2(counts+1)
varsset=apply(log2_cpm, 1, var)
cpm.sel.trans = t(log2_cpm[order(varsset,decreasing = T)[1:2000],])
distance = dist(cpm.sel.trans)
sampleDistMatrix <- as.matrix(distance)
#colors for plotting heatmap
colors <- rev(colorRampPalette(brewer.pal(9, "Spectral"))(255))
colors=jetcolors(255)
colors=viridis(255)
cellcol = Dark8[1:nlevels(samplemeta$Celltype)]
names(cellcol) = levels(samplemeta$Celltype)
genotypecol = brewer.pal(4,"Accent")[c(1:nlevels(samplemeta$Genotype_corr))]
names(genotypecol) = levels(samplemeta$Genotype_corr)
strokecol = brewer.pal(5,"Set2")[1:nlevels(samplemeta$Treatment)+2]
names(strokecol) = levels(samplemeta$Treatment)
mousecol = brewer.pal(9,"Set1")[1:nlevels(samplemeta$Mouse_ID)]
names(mousecol) = levels(samplemeta$Mouse_ID)
braincol = brewer.pal(3,"Set2")[1:nlevels(samplemeta$Brain_region)]
names(braincol) = levels(samplemeta$Brain_region)
ann_colors = list(
Genotype_corr = genotypecol,
Mouse_ID = mousecol,
Brain_region = braincol,
Celltype=cellcol,
Treatment=strokecol
)
labels = samplemeta[,c("Genotype_corr","Mouse_ID", "Brain_region", "Celltype", "Treatment")] %>%
mutate_all(as.character) %>% as.data.frame()
rownames(labels)=rownames(samplemeta)
pheatmap(sampleDistMatrix,
clustering_distance_rows = distance,
clustering_distance_cols = distance,
clustering_method = "ward.D2",
scale ="none",
show_rownames=F, show_colnames = F,
legend=T,
border_color = NA,
annotation_row = labels,
annotation_col = labels,
annotation_colors = ann_colors,
col = colors,
main = "D62 Distances normalized log2 counts")

getres=function(Celltype="Specify",
Hypothesis="~1+Sex+Genotype_corr*Treatment",
Target="Genotype_corrAPPPS1+:TreatmentStroke",
Randomeffect="Sex"){
res= comparison_rand(designform =Hypothesis,
randomeffect = Randomeffect,
Samples = samplemeta$Celltype==Celltype,
log_cpm = log2_cpm,
samplesdata = samplemeta,
target=Target)
labels = samplemeta[samplemeta$Celltype==Celltype,c("Treatment", "Genotype_corr","Mouse_ID", "Brain_region", "Celltype")] %>%
mutate_all(as.character) %>% as.data.frame()
labels=labels %>% arrange(Treatment,Genotype_corr)
plotdata=log2_cpm[res$adj.P.Val<0.05,rownames(labels)]
pheatmap(plotdata,
#clustering_method = "ward.D2",
cluster_cols = F,
cluster_rows = T,
scale ="column",
show_rownames=F, show_colnames = F,
legend=T,
border_color = NA,
#annotation_row = labels,
annotation_col = labels,
annotation_colors = ann_colors,
col = colors,
main = "D62 Distances normalized log2 counts")
return(res)
}
generate_output=function(CT="Celltype", ...){
respath=paste0(home, "/docs/LMER_",CT,".xlsx")
analysis = getres(Celltype = CT)
analysis_sig = analysis[analysis$adj.P.Val<0.05,]
analysis_sig %>% display_tab()
write.xlsx2(analysis_sig, file =respath , sheetName = "significant genes")
ResGO = getGOresults(rownames(analysis_sig),
rownames(analysis),
"mmusculus")
if(length(ResGO)>0){
p=gostplot(ResGO)
} else{
ResGO=data.frame(result="no significant enrichment identified")
p="no significant enrichment identified"
}
write.xlsx2(ResGO$result, file = respath, sheetName = "GO_enrichment", append=T)
return(list(results=analysis,results_sig=analysis_sig, plot=p))
}
res_output=generate_output("Microglia_0")

res_output[["results_sig"]] %>% display_tab()
| logFC | AveExpr | t | P.Value | adj.P.Val | B | |
|---|---|---|---|---|---|---|
| Tbata | 3.587 | 0.454 | 12.325 | 0 | 0.000 | 45.731 |
| AC099934.1 | 2.090 | 0.223 | 11.078 | 0 | 0.000 | 38.052 |
| Rn7s1 | 4.776 | 0.932 | 10.691 | 0 | 0.000 | 35.689 |
| AY036118 | -11.089 | 6.541 | -9.225 | 0 | 0.000 | 26.901 |
| Prrx1 | 2.430 | 0.394 | 8.421 | 0 | 0.000 | 22.252 |
| Tmem170 | 2.182 | 0.349 | 7.415 | 0 | 0.000 | 16.690 |
| Rn7s2 | 3.690 | 0.821 | 7.385 | 0 | 0.000 | 16.527 |
| Olfr907 | 2.683 | 0.908 | 6.916 | 0 | 0.000 | 14.060 |
| Dock10 | 4.006 | 5.039 | 6.156 | 0 | 0.000 | 10.267 |
| Mgmt | 2.584 | 0.444 | 6.102 | 0 | 0.000 | 10.009 |
| AW822252 | 2.125 | 0.732 | 6.047 | 0 | 0.000 | 9.746 |
| Apoe | -11.365 | 7.561 | -5.799 | 0 | 0.000 | 8.580 |
| Trem2 | -5.769 | 6.733 | -5.695 | 0 | 0.000 | 8.100 |
| D10Wsu102e | -2.590 | 7.009 | -5.651 | 0 | 0.000 | 7.900 |
| Lgals3bp | -7.877 | 3.952 | -5.624 | 0 | 0.000 | 7.778 |
| Hexb | -5.732 | 8.947 | -5.570 | 0 | 0.000 | 7.535 |
| Fcer1g | -5.674 | 6.858 | -5.535 | 0 | 0.000 | 7.378 |
| Ctsd | -6.148 | 9.513 | -5.433 | 0 | 0.000 | 6.921 |
| B2m | -5.709 | 7.942 | -5.406 | 0 | 0.000 | 6.801 |
| Gm44215 | -4.526 | 3.605 | -5.346 | 0 | 0.000 | 6.538 |
| Gnaz | 2.331 | 0.780 | 5.337 | 0 | 0.000 | 6.498 |
| C1qb | -6.437 | 8.397 | -5.323 | 0 | 0.000 | 6.438 |
| Lipe | 2.876 | 1.789 | 5.296 | 0 | 0.000 | 6.323 |
| CT010467.1 | -4.636 | 10.638 | -5.271 | 0 | 0.000 | 6.210 |
| C1qa | -6.026 | 8.093 | -5.192 | 0 | 0.000 | 5.872 |
| Lyz2 | -8.393 | 5.945 | -5.183 | 0 | 0.000 | 5.833 |
| Itm2b | -5.455 | 8.165 | -5.126 | 0 | 0.000 | 5.591 |
| Cst3 | -5.530 | 10.468 | -5.116 | 0 | 0.000 | 5.549 |
| Gm37144 | 2.617 | 1.609 | 5.109 | 0 | 0.000 | 5.518 |
| Gm44645 | 1.757 | 0.462 | 5.070 | 0 | 0.000 | 5.355 |
| Ctsb | -5.783 | 8.220 | -5.011 | 0 | 0.001 | 5.107 |
| C1qc | -5.531 | 8.304 | -4.923 | 0 | 0.001 | 4.741 |
| Myl2 | 1.632 | 0.203 | 4.922 | 0 | 0.001 | 4.738 |
| Cst7 | -7.499 | 3.339 | -4.838 | 0 | 0.001 | 4.396 |
| Grn | -5.009 | 6.427 | -4.713 | 0 | 0.002 | 3.891 |
| Plac8 | 1.716 | 0.166 | 4.641 | 0 | 0.002 | 3.605 |
| Ctss | -4.872 | 9.414 | -4.624 | 0 | 0.003 | 3.538 |
| Ctsz | -5.247 | 7.907 | -4.601 | 0 | 0.003 | 3.448 |
| Pola2 | -2.569 | 2.264 | -4.585 | 0 | 0.003 | 3.387 |
| Hexa | -5.510 | 6.097 | -4.577 | 0 | 0.003 | 3.354 |
| Cd52 | -5.186 | 3.497 | -4.571 | 0 | 0.003 | 3.331 |
| AC127302.3 | -2.872 | 2.889 | -4.537 | 0 | 0.003 | 3.201 |
| Gm37716 | 1.460 | 0.498 | 4.521 | 0 | 0.003 | 3.137 |
| Gm26905 | -3.427 | 6.505 | -4.507 | 0 | 0.004 | 3.085 |
| Cyba | -4.784 | 5.245 | -4.505 | 0 | 0.004 | 3.076 |
| Gpr171 | 1.221 | 0.095 | 4.387 | 0 | 0.006 | 2.628 |
| Fhl3 | 1.952 | 0.607 | 4.357 | 0 | 0.006 | 2.514 |
| Col6a3 | 2.168 | 0.420 | 4.335 | 0 | 0.007 | 2.432 |
| Axl | -5.291 | 2.164 | -4.318 | 0 | 0.007 | 2.370 |
| Gm15500 | -5.152 | 4.285 | -4.317 | 0 | 0.007 | 2.364 |
| Fth1 | -4.820 | 7.555 | -4.315 | 0 | 0.007 | 2.359 |
| H2-D1 | -5.244 | 6.578 | -4.295 | 0 | 0.007 | 2.284 |
| Gm10076 | -3.698 | 2.856 | -4.288 | 0 | 0.007 | 2.258 |
| Cd81 | -5.159 | 7.456 | -4.267 | 0 | 0.008 | 2.181 |
| Tyrobp | -4.351 | 7.358 | -4.251 | 0 | 0.008 | 2.121 |
| Upk1b | 3.244 | 1.015 | 4.223 | 0 | 0.009 | 2.018 |
| Atp6v0c | -5.080 | 4.998 | -4.216 | 0 | 0.009 | 1.994 |
| Clec7a | -5.543 | 2.762 | -4.180 | 0 | 0.011 | 1.864 |
| Gm26870 | -3.534 | 9.134 | -4.175 | 0 | 0.011 | 1.843 |
| Selenop | -5.034 | 6.801 | -4.116 | 0 | 0.013 | 1.634 |
| Gm15564 | 1.506 | 0.765 | 4.101 | 0 | 0.014 | 1.578 |
| Serinc3 | -3.705 | 6.433 | -4.098 | 0 | 0.014 | 1.568 |
| Eef1a1 | -4.593 | 7.535 | -4.088 | 0 | 0.014 | 1.533 |
| Fcgr3 | -4.253 | 7.279 | -4.049 | 0 | 0.016 | 1.395 |
| Soat1 | -3.694 | 2.004 | -4.032 | 0 | 0.017 | 1.334 |
| Gm14303 | -2.844 | 2.264 | -4.016 | 0 | 0.018 | 1.280 |
| Ppp2r5a | -3.152 | 4.146 | -3.984 | 0 | 0.020 | 1.166 |
| Gm10719 | -3.157 | 6.711 | -3.953 | 0 | 0.022 | 1.060 |
| Rpl13a | -4.195 | 4.835 | -3.945 | 0 | 0.022 | 1.030 |
| Lamp2 | -4.707 | 4.178 | -3.944 | 0 | 0.022 | 1.027 |
| Rnaset2b | -4.092 | 6.400 | -3.936 | 0 | 0.023 | 1.000 |
| Fcgr2b | -4.898 | 4.773 | -3.931 | 0 | 0.023 | 0.985 |
| Mpeg1 | -4.321 | 6.028 | -3.879 | 0 | 0.027 | 0.805 |
| Gm43652 | 1.437 | 0.726 | 3.874 | 0 | 0.027 | 0.790 |
| Rab3gap1 | -2.810 | 3.206 | -3.862 | 0 | 0.028 | 0.748 |
| Thy1 | 1.352 | 0.317 | 3.852 | 0 | 0.029 | 0.713 |
| Mt1 | -3.819 | 2.286 | -3.846 | 0 | 0.029 | 0.693 |
| Acbd5 | -2.555 | 1.954 | -3.800 | 0 | 0.034 | 0.540 |
| Cry1 | 1.185 | 0.121 | 3.799 | 0 | 0.034 | 0.537 |
| Bicd1 | -2.199 | 2.661 | -3.780 | 0 | 0.036 | 0.474 |
| Lgmn | -4.134 | 7.604 | -3.780 | 0 | 0.036 | 0.473 |
| Cd9 | -4.196 | 6.255 | -3.738 | 0 | 0.041 | 0.334 |
| Rps14 | -4.030 | 4.782 | -3.697 | 0 | 0.047 | 0.198 |
| Rplp0 | -4.638 | 5.462 | -3.691 | 0 | 0.048 | 0.179 |
| Ssr4 | -4.074 | 2.953 | -3.682 | 0 | 0.048 | 0.149 |
| Erp29 | -4.109 | 3.530 | -3.681 | 0 | 0.048 | 0.147 |
| Itgb5 | -3.786 | 5.576 | -3.677 | 0 | 0.049 | 0.132 |
| Arhgef40 | 2.806 | 2.680 | 3.670 | 0 | 0.049 | 0.112 |
| H2-K1 | -5.044 | 5.315 | -3.665 | 0 | 0.050 | 0.095 |
res_output[["plot"]]
get results table here
res_output=generate_output("Microglia_1")

[1] "no significant GO terms identified"
res_output[["results_sig"]] %>% display_tab()
| logFC | AveExpr | t | P.Value | adj.P.Val | B | |
|---|---|---|---|---|---|---|
| Rn7s1 | 4.839 | 2.251 | 9.871 | 0 | 0.000 | 28.811 |
| AB124611 | 2.674 | 0.089 | 7.923 | 0 | 0.000 | 18.420 |
| Hexb | -4.016 | 10.455 | -6.220 | 0 | 0.000 | 10.096 |
| Pola2 | -4.177 | 1.551 | -6.203 | 0 | 0.000 | 10.021 |
| Gbp2 | 2.735 | 0.131 | 6.157 | 0 | 0.000 | 9.807 |
| Gbp8 | 2.377 | 0.120 | 5.786 | 0 | 0.000 | 8.151 |
| Ogfod2 | 2.767 | 0.186 | 5.578 | 0 | 0.000 | 7.248 |
| AY036118 | -7.305 | 4.063 | -5.318 | 0 | 0.001 | 6.152 |
| Adgre5 | 1.340 | 0.041 | 5.298 | 0 | 0.001 | 6.067 |
| Lzic | 2.338 | 0.160 | 5.247 | 0 | 0.001 | 5.860 |
| Trdmt1 | 1.439 | 0.094 | 5.243 | 0 | 0.001 | 5.840 |
| Gbp4 | 1.867 | 0.187 | 5.200 | 0 | 0.001 | 5.667 |
| Vav3 | 0.781 | 0.024 | 5.136 | 0 | 0.001 | 5.404 |
| Psmd10 | 3.468 | 0.411 | 4.955 | 0 | 0.002 | 4.679 |
| C3 | 3.068 | 0.263 | 4.834 | 0 | 0.003 | 4.207 |
| Dck | 2.403 | 0.210 | 4.805 | 0 | 0.003 | 4.095 |
| 1700003F12Rik | 0.918 | 0.044 | 4.771 | 0 | 0.003 | 3.962 |
| Mndal | 0.867 | 0.045 | 4.665 | 0 | 0.005 | 3.558 |
| Eif1b | 4.261 | 0.868 | 4.573 | 0 | 0.007 | 3.214 |
| Galt | 2.817 | 0.377 | 4.560 | 0 | 0.007 | 3.163 |
| Sparc | -3.767 | 7.598 | -4.490 | 0 | 0.009 | 2.907 |
| Bicdl1 | 1.325 | 0.080 | 4.475 | 0 | 0.009 | 2.851 |
| Gm15952 | 1.267 | 0.159 | 4.445 | 0 | 0.009 | 2.741 |
| Cers6 | 2.071 | 0.193 | 4.443 | 0 | 0.009 | 2.735 |
| Mrps5 | 2.607 | 0.350 | 4.404 | 0 | 0.011 | 2.591 |
| AC099934.1 | 1.435 | 0.595 | 4.292 | 0 | 0.016 | 2.189 |
| Lilrb4a | 2.908 | 0.332 | 4.261 | 0 | 0.017 | 2.081 |
| Zbtb41 | 1.102 | 0.076 | 4.254 | 0 | 0.017 | 2.056 |
| Rn7s2 | 3.408 | 1.658 | 4.176 | 0 | 0.023 | 1.783 |
| 2810414N06Rik | 1.847 | 0.206 | 4.162 | 0 | 0.023 | 1.735 |
| Mapkbp1 | 2.390 | 0.252 | 4.153 | 0 | 0.023 | 1.703 |
| Chchd10 | 1.846 | 0.165 | 4.116 | 0 | 0.026 | 1.576 |
| Aplf | 1.964 | 0.206 | 4.113 | 0 | 0.026 | 1.565 |
| B4galt6 | 3.474 | 0.769 | 4.064 | 0 | 0.030 | 1.396 |
| Cited4 | 0.792 | 0.042 | 4.051 | 0 | 0.030 | 1.353 |
| Trmt112 | 4.687 | 1.995 | 4.046 | 0 | 0.030 | 1.336 |
| Cd9 | -5.297 | 6.392 | -4.045 | 0 | 0.030 | 1.334 |
| Stt3a | 5.158 | 2.125 | 4.013 | 0 | 0.033 | 1.225 |
| Sh3pxd2b | 1.437 | 0.108 | 4.009 | 0 | 0.033 | 1.213 |
| Mgmt | 2.314 | 1.070 | 3.968 | 0 | 0.037 | 1.073 |
| Aars2 | 1.446 | 0.127 | 3.961 | 0 | 0.037 | 1.051 |
| Itgal | 1.063 | 0.069 | 3.923 | 0 | 0.042 | 0.924 |
| Gm29474 | 0.931 | 0.060 | 3.909 | 0 | 0.043 | 0.878 |
| Homer3 | 1.961 | 0.288 | 3.895 | 0 | 0.045 | 0.831 |
| Ciita | 0.423 | 0.022 | 3.882 | 0 | 0.046 | 0.791 |
| Dut | 1.348 | 0.076 | 3.878 | 0 | 0.046 | 0.776 |
res_output[["plot"]]
[1] "no significant enrichment identified"
get results table here
res_output=generate_output("Microglia_2")

res_output[["results_sig"]] %>% display_tab()
| logFC | AveExpr | t | P.Value | adj.P.Val | B | |
|---|---|---|---|---|---|---|
| AY036118 | -12.465 | 5.877 | -14.742 | 0 | 0.000 | 43.970 |
| Rn7s1 | 6.378 | 2.015 | 10.991 | 0 | 0.000 | 29.218 |
| AC099934.1 | 2.240 | 0.649 | 10.369 | 0 | 0.000 | 26.596 |
| Gab3 | 6.338 | 1.369 | 8.383 | 0 | 0.000 | 18.074 |
| Tbata | 3.179 | 1.094 | 7.291 | 0 | 0.000 | 13.423 |
| Tmem170 | 2.548 | 0.931 | 6.594 | 0 | 0.000 | 10.527 |
| Mgmt | 2.924 | 1.015 | 5.783 | 0 | 0.000 | 7.291 |
| Katnb1 | 2.103 | 0.162 | 5.168 | 0 | 0.002 | 4.966 |
| Gm10719 | -4.767 | 4.443 | -5.043 | 0 | 0.003 | 4.510 |
| Gm15564 | 2.546 | 1.222 | 4.989 | 0 | 0.003 | 4.315 |
| Gm26870 | -5.865 | 6.156 | -4.874 | 0 | 0.004 | 3.907 |
| Rn7s2 | 4.109 | 1.358 | 4.874 | 0 | 0.004 | 3.904 |
| Sorbs2 | 2.072 | 0.168 | 4.872 | 0 | 0.004 | 3.899 |
| Actr3b | 2.047 | 0.143 | 4.855 | 0 | 0.004 | 3.836 |
| Gm10800 | -6.124 | 7.447 | -4.830 | 0 | 0.004 | 3.750 |
| Zbp1 | 1.536 | 0.157 | 4.795 | 0 | 0.005 | 3.626 |
| Gm10801 | -4.750 | 5.022 | -4.641 | 0 | 0.008 | 3.090 |
| Gm37401 | 3.758 | 1.196 | 4.394 | 0 | 0.019 | 2.251 |
| Chchd5 | 1.938 | 0.189 | 4.392 | 0 | 0.019 | 2.247 |
| Gm37411 | 1.619 | 0.409 | 4.288 | 0 | 0.028 | 1.903 |
| Gm10717 | -3.967 | 4.416 | -4.276 | 0 | 0.028 | 1.864 |
| Pola2 | -2.882 | 2.295 | -4.173 | 0 | 0.039 | 1.528 |
| Cd209g | 1.590 | 0.134 | 4.135 | 0 | 0.043 | 1.407 |
| Bola1 | 2.978 | 0.571 | 4.096 | 0 | 0.048 | 1.282 |
res_output[["plot"]]
get results table here
res_output=generate_output("Microglia_3")

[1] "no significant GO terms identified"
res_output[["results_sig"]] %>% display_tab()
| logFC | AveExpr | t | P.Value | adj.P.Val | B | |
|---|---|---|---|---|---|---|
| Apoe | -10.436 | 8.936 | -8.743 | 0 | 0.000 | 19.567 |
| Rn7s1 | 4.748 | 1.890 | 8.097 | 0 | 0.000 | 16.821 |
| Tmem170 | 2.313 | 0.742 | 7.709 | 0 | 0.000 | 15.178 |
| Pcid2 | 2.817 | 0.185 | 5.869 | 0 | 0.000 | 7.648 |
| Pigq | 5.879 | 0.990 | 5.843 | 0 | 0.000 | 7.545 |
| Tbata | 2.851 | 0.831 | 5.706 | 0 | 0.000 | 7.013 |
| Rnf14 | 3.786 | 0.386 | 5.702 | 0 | 0.000 | 7.000 |
| AY036118 | -8.708 | 5.396 | -5.241 | 0 | 0.002 | 5.253 |
| BC026585 | 4.424 | 0.909 | 5.231 | 0 | 0.002 | 5.217 |
| C1galt1 | 1.556 | 0.079 | 5.185 | 0 | 0.002 | 5.047 |
| Rbmx2 | 1.261 | 0.064 | 5.167 | 0 | 0.002 | 4.982 |
| Ppil1 | 2.141 | 0.194 | 5.068 | 0 | 0.002 | 4.619 |
| Vmn1r208 | 0.664 | 0.034 | 4.973 | 0 | 0.003 | 4.272 |
| Cnnm4 | 3.559 | 0.429 | 4.794 | 0 | 0.006 | 3.634 |
| Mgmt | 2.936 | 0.931 | 4.707 | 0 | 0.008 | 3.327 |
| Alad | 2.413 | 0.203 | 4.663 | 0 | 0.009 | 3.177 |
| Tpst2 | 6.187 | 2.268 | 4.608 | 0 | 0.010 | 2.984 |
| Gt(ROSA)26Sor | 3.419 | 0.561 | 4.595 | 0 | 0.010 | 2.939 |
| Gm15564 | 2.307 | 1.137 | 4.450 | 0 | 0.016 | 2.445 |
| Fkbp14 | 2.456 | 0.221 | 4.445 | 0 | 0.016 | 2.429 |
| Clec7a | -7.063 | 3.980 | -4.402 | 0 | 0.018 | 2.285 |
| Zfp712 | 1.486 | 0.117 | 4.364 | 0 | 0.020 | 2.159 |
| Gm21092 | 1.785 | 0.267 | 4.301 | 0 | 0.024 | 1.948 |
| Gm10774 | 1.335 | 0.288 | 4.251 | 0 | 0.028 | 1.785 |
| Alg14 | 3.880 | 0.756 | 4.232 | 0 | 0.029 | 1.721 |
| Gm15417 | 0.945 | 0.079 | 4.203 | 0 | 0.030 | 1.628 |
| Cox18 | 1.838 | 0.189 | 4.199 | 0 | 0.030 | 1.613 |
| AC210924.1 | 1.671 | 0.222 | 4.194 | 0 | 0.030 | 1.597 |
| Acot8 | 2.038 | 0.175 | 4.179 | 0 | 0.030 | 1.550 |
| Wsb2 | 4.864 | 1.184 | 4.129 | 0 | 0.035 | 1.387 |
| Smim8 | 2.813 | 0.443 | 4.110 | 0 | 0.037 | 1.327 |
| Gm43328 | 0.673 | 0.064 | 4.053 | 0 | 0.044 | 1.144 |
| Ano4 | 1.285 | 0.214 | 4.039 | 0 | 0.045 | 1.100 |
| Rn7s2 | 3.378 | 1.489 | 4.031 | 0 | 0.045 | 1.073 |
| Zfp513 | 3.066 | 0.452 | 4.011 | 0 | 0.046 | 1.011 |
| Stam | 3.000 | 0.485 | 4.004 | 0 | 0.046 | 0.990 |
| Bin2 | 6.320 | 4.050 | 3.996 | 0 | 0.046 | 0.963 |
| Dand5 | 2.065 | 0.195 | 3.987 | 0 | 0.046 | 0.937 |
| Eif3d | 4.376 | 0.900 | 3.985 | 0 | 0.046 | 0.930 |
res_output[["plot"]]
[1] "no significant enrichment identified"
get results table here
calculation not converging as Celltype not identified in all conditions however also rare in other conditions, no significant difference
idx=samplemeta$Celltype=="Microglia_4"
table(samplemeta$Treatment[idx], samplemeta$Genotype_corr[idx])
WT APPPS1+
Ctrl 11 10
Stroke 4 1
table(samplemeta$Treatment[idx], samplemeta$Genotype_corr[idx]) %>% fisher.test()
Fisher's Exact Test for Count Data
data: .
p-value = 0.3562
alternative hypothesis: true odds ratio is not equal to 1
95 percent confidence interval:
0.005090941 3.588141911
sample estimates:
odds ratio
0.2877466
#res_output=generate_output("Microglia_4")
#res_output[["results_sig"]] %>% display_tab()
#res_output[["plot"]]
get results table here
res_output=generate_output("Microglia_5")

[1] "no significant GO terms identified"
res_output[["results_sig"]] %>% display_tab()
| logFC | AveExpr | t | P.Value | adj.P.Val | B | |
|---|---|---|---|---|---|---|
| Sirpb1c | 8.788 | 0.382 | 103.262 | 0.000 | 0.000 | 35.333 |
| S100a4 | 8.061 | 0.350 | 94.720 | 0.000 | 0.000 | 35.105 |
| Cenpt | 7.209 | 0.313 | 84.717 | 0.000 | 0.000 | 34.755 |
| Pilra | 7.095 | 0.308 | 83.370 | 0.000 | 0.000 | 34.699 |
| Fbxl8 | 6.966 | 0.303 | 81.854 | 0.000 | 0.000 | 34.634 |
| Taf5l | 6.826 | 0.297 | 80.210 | 0.000 | 0.000 | 34.559 |
| Zgrf1 | 6.820 | 0.297 | 80.143 | 0.000 | 0.000 | 34.556 |
| Sptan1 | 6.714 | 0.292 | 78.898 | 0.000 | 0.000 | 34.496 |
| Cytip | 6.569 | 0.286 | 77.188 | 0.000 | 0.000 | 34.410 |
| Elac2 | 6.476 | 0.282 | 76.095 | 0.000 | 0.000 | 34.353 |
| Map3k9 | 6.443 | 0.280 | 75.710 | 0.000 | 0.000 | 34.332 |
| Mis18a | 6.426 | 0.279 | 75.514 | 0.000 | 0.000 | 34.321 |
| Nup35 | 6.426 | 0.279 | 75.514 | 0.000 | 0.000 | 34.321 |
| Pdcd7 | 5.644 | 0.245 | 66.320 | 0.000 | 0.000 | 33.728 |
| Slco3a1 | 5.248 | 0.228 | 61.668 | 0.000 | 0.000 | 33.342 |
| S100a10 | 5.044 | 0.219 | 59.276 | 0.000 | 0.000 | 33.115 |
| Gm43200 | 5.000 | 0.217 | 58.754 | 0.000 | 0.000 | 33.063 |
| Npepl1 | 4.907 | 0.213 | 57.660 | 0.000 | 0.000 | 32.949 |
| Sms-ps | 4.654 | 0.202 | 54.687 | 0.000 | 0.000 | 32.613 |
| 2810001G20Rik | 4.322 | 0.188 | 50.786 | 0.000 | 0.000 | 32.102 |
| Gm1972 | 4.087 | 0.178 | 48.031 | 0.000 | 0.000 | 31.685 |
| Pde8a | 4.000 | 0.174 | 47.003 | 0.000 | 0.000 | 31.515 |
| Zfp362 | 4.000 | 0.174 | 47.003 | 0.000 | 0.000 | 31.515 |
| Glmn | 3.807 | 0.166 | 44.740 | 0.000 | 0.000 | 31.113 |
| Polr2d | 3.807 | 0.166 | 44.740 | 0.000 | 0.000 | 31.113 |
| Gm34237 | 3.513 | 0.153 | 41.277 | 0.000 | 0.000 | 30.407 |
| Acsl3 | 3.322 | 0.144 | 39.035 | 0.000 | 0.000 | 29.882 |
| Tsen54 | 3.322 | 0.144 | 39.035 | 0.000 | 0.000 | 29.882 |
| Nedd4l | 3.170 | 0.138 | 37.249 | 0.000 | 0.000 | 29.419 |
| Pilrb1 | 2.855 | 0.124 | 33.552 | 0.000 | 0.000 | 28.312 |
| Skint3 | 2.807 | 0.122 | 32.989 | 0.000 | 0.000 | 28.123 |
| AI662270 | 6.170 | 0.312 | 27.808 | 0.000 | 0.000 | 26.082 |
| Rps6ka4 | 2.322 | 0.101 | 27.285 | 0.000 | 0.000 | 25.841 |
| AC131743.1 | 2.307 | 0.200 | 26.855 | 0.000 | 0.000 | 25.637 |
| Mta3 | 7.282 | 0.365 | 25.446 | 0.000 | 0.000 | 24.930 |
| Sirpb1b | 5.404 | 0.278 | 24.343 | 0.000 | 0.000 | 24.332 |
| Micall1 | 2.000 | 0.087 | 23.503 | 0.000 | 0.000 | 23.850 |
| Taf1b | 2.000 | 0.087 | 23.502 | 0.000 | 0.000 | 23.849 |
| Gm44103 | 2.000 | 0.087 | 23.501 | 0.000 | 0.000 | 23.849 |
| Gm20716 | 7.227 | 0.368 | 22.828 | 0.000 | 0.000 | 23.444 |
| Hist1h4d | 1.585 | 0.069 | 18.625 | 0.000 | 0.000 | 20.475 |
| Ubash3a | 1.585 | 0.069 | 18.625 | 0.000 | 0.000 | 20.475 |
| Zbtb39 | 1.585 | 0.069 | 18.625 | 0.000 | 0.000 | 20.475 |
| Fam69a | 6.546 | 0.351 | 17.446 | 0.000 | 0.000 | 19.481 |
| Batf3 | 4.829 | 0.259 | 16.998 | 0.000 | 0.000 | 19.082 |
| Gm12411 | 2.473 | 0.131 | 15.768 | 0.000 | 0.000 | 17.919 |
| Sh3bgrl2 | 3.459 | 0.194 | 15.592 | 0.000 | 0.000 | 17.744 |
| Gm43444 | 3.310 | 0.180 | 15.103 | 0.000 | 0.000 | 17.245 |
| Sde2 | 6.820 | 0.397 | 14.111 | 0.000 | 0.000 | 16.178 |
| Mpnd | 6.177 | 0.346 | 14.103 | 0.000 | 0.000 | 16.170 |
| Ticam2 | 7.359 | 0.475 | 13.712 | 0.000 | 0.000 | 15.727 |
| Dcaf15 | 5.846 | 0.331 | 13.248 | 0.000 | 0.000 | 15.183 |
| C1qc | -11.264 | 9.703 | -13.027 | 0.000 | 0.000 | 14.918 |
| Gm45867 | 3.621 | 0.206 | 12.654 | 0.000 | 0.000 | 14.460 |
| Svep1 | 2.807 | 0.166 | 12.653 | 0.000 | 0.000 | 14.458 |
| Ppp1r26 | 1.006 | 0.044 | 11.821 | 0.000 | 0.000 | 13.386 |
| Gm37390 | 1.001 | 0.044 | 11.759 | 0.000 | 0.000 | 13.304 |
| Cnn2 | 1.000 | 0.043 | 11.751 | 0.000 | 0.000 | 13.293 |
| Fbxo8 | 1.000 | 0.043 | 11.751 | 0.000 | 0.000 | 13.293 |
| Pex12 | 1.000 | 0.043 | 11.751 | 0.000 | 0.000 | 13.293 |
| Gm3755 | 1.000 | 0.043 | 11.751 | 0.000 | 0.000 | 13.293 |
| Gm33023 | 3.334 | 0.194 | 11.736 | 0.000 | 0.000 | 13.273 |
| Sms | 5.081 | 0.298 | 11.601 | 0.000 | 0.000 | 13.090 |
| Ms4a4b | 4.543 | 0.295 | 11.527 | 0.000 | 0.000 | 12.990 |
| Gsr | 5.072 | 0.297 | 11.493 | 0.000 | 0.000 | 12.943 |
| Strip1 | 5.337 | 0.696 | 11.319 | 0.000 | 0.000 | 12.704 |
| Gm42725 | 5.149 | 0.281 | 10.799 | 0.000 | 0.000 | 11.969 |
| 1810014B01Rik | 2.974 | 0.178 | 10.469 | 0.000 | 0.000 | 11.487 |
| Naalad2 | 5.496 | 0.908 | 10.462 | 0.000 | 0.000 | 11.476 |
| AC154640.4 | 6.128 | 0.409 | 10.304 | 0.000 | 0.000 | 11.241 |
| Erlin1 | 5.685 | 0.344 | 10.280 | 0.000 | 0.000 | 11.204 |
| Gm37521 | 3.195 | 0.194 | 9.828 | 0.000 | 0.000 | 10.512 |
| 1190007I07Rik | 5.946 | 0.413 | 9.655 | 0.000 | 0.000 | 10.239 |
| Gm10146 | 2.771 | 0.180 | 9.451 | 0.000 | 0.000 | 9.915 |
| Lrif1 | 5.063 | 0.317 | 9.156 | 0.000 | 0.000 | 9.434 |
| Tada3 | 4.833 | 0.368 | 9.112 | 0.000 | 0.000 | 9.362 |
| Gm4739 | 4.492 | 0.283 | 8.955 | 0.000 | 0.000 | 9.100 |
| Gpatch11 | 2.474 | 0.156 | 8.645 | 0.000 | 0.000 | 8.575 |
| Slfn1 | 6.519 | 0.421 | 8.514 | 0.000 | 0.000 | 8.349 |
| Proser1 | 6.169 | 0.428 | 8.364 | 0.000 | 0.000 | 8.086 |
| Cog3 | 4.858 | 0.333 | 8.354 | 0.000 | 0.000 | 8.070 |
| Gm17229 | 3.542 | 0.232 | 8.012 | 0.000 | 0.000 | 7.460 |
| CT025600.1 | 3.532 | 0.265 | 7.809 | 0.000 | 0.000 | 7.090 |
| Mtrr | 2.211 | 0.144 | 7.726 | 0.000 | 0.000 | 6.938 |
| Cep57l1 | 1.117 | 0.069 | 7.664 | 0.000 | 0.000 | 6.823 |
| AC154636.3 | 6.015 | 0.447 | 7.591 | 0.000 | 0.000 | 6.687 |
| Arhgap11a | 6.000 | 0.431 | 7.453 | 0.000 | 0.000 | 6.429 |
| Ice1 | 5.050 | 0.409 | 7.347 | 0.000 | 0.000 | 6.229 |
| Emb | 5.855 | 0.469 | 7.331 | 0.000 | 0.000 | 6.199 |
| Tex2 | 8.813 | 0.534 | 7.133 | 0.000 | 0.000 | 5.819 |
| Gle1 | 5.034 | 0.345 | 7.132 | 0.000 | 0.000 | 5.817 |
| Gm38699 | 3.343 | 0.227 | 7.127 | 0.000 | 0.000 | 5.807 |
| Vac14 | 4.962 | 0.342 | 7.030 | 0.000 | 0.000 | 5.619 |
| Ino80 | 4.998 | 0.811 | 7.004 | 0.000 | 0.000 | 5.569 |
| Gm4924 | 2.479 | 0.203 | 6.869 | 0.000 | 0.000 | 5.303 |
| Gm36065 | 1.889 | 0.130 | 6.601 | 0.000 | 0.000 | 4.771 |
| Plac8 | 6.636 | 0.502 | 6.503 | 0.000 | 0.000 | 4.575 |
| AC187103.1 | 0.945 | 0.063 | 6.415 | 0.000 | 0.001 | 4.397 |
| Eme2 | 8.008 | 0.506 | 6.192 | 0.000 | 0.001 | 3.939 |
| N4bp1 | 8.477 | 0.540 | 6.053 | 0.000 | 0.001 | 3.652 |
| Cep70 | 6.696 | 0.427 | 6.003 | 0.000 | 0.001 | 3.548 |
| Gm13369 | 5.305 | 0.430 | 6.000 | 0.000 | 0.001 | 3.541 |
| Ctr9 | 6.344 | 0.744 | 5.949 | 0.000 | 0.001 | 3.435 |
| Tfdp1 | 5.123 | 0.427 | 5.905 | 0.000 | 0.002 | 3.343 |
| Slc2a3 | 2.101 | 0.289 | 5.826 | 0.000 | 0.002 | 3.177 |
| 4930404A12Rik | 5.736 | 0.469 | 5.795 | 0.000 | 0.002 | 3.112 |
| Ddx23 | 5.421 | 0.761 | 5.784 | 0.000 | 0.002 | 3.088 |
| Rad52 | 5.784 | 0.491 | 5.768 | 0.000 | 0.002 | 3.054 |
| Gm2436 | 4.015 | 0.358 | 5.763 | 0.000 | 0.002 | 3.043 |
| Ppp2r3c | 7.224 | 0.773 | 5.738 | 0.000 | 0.002 | 2.991 |
| A630001O12Rik | 4.934 | 0.394 | 5.726 | 0.000 | 0.002 | 2.966 |
| 9130401M01Rik | 6.235 | 0.579 | 5.674 | 0.000 | 0.002 | 2.854 |
| Gm10825 | 2.889 | 0.307 | 5.639 | 0.000 | 0.003 | 2.781 |
| Hmga1 | 5.108 | 0.497 | 5.605 | 0.000 | 0.003 | 2.709 |
| Hexa | -10.179 | 7.250 | -5.567 | 0.000 | 0.003 | 2.627 |
| Rasgrp1 | 2.713 | 0.243 | 5.540 | 0.000 | 0.003 | 2.569 |
| Gm45718 | 3.099 | 0.355 | 5.486 | 0.000 | 0.003 | 2.453 |
| Fam98a | 7.072 | 0.543 | 5.415 | 0.000 | 0.004 | 2.301 |
| Birc3 | 8.829 | 0.973 | 5.392 | 0.000 | 0.004 | 2.252 |
| Smim11 | 6.647 | 0.714 | 5.356 | 0.000 | 0.004 | 2.175 |
| Sept6 | 6.211 | 0.524 | 5.347 | 0.000 | 0.004 | 2.154 |
| Pnisr | -9.220 | 3.742 | -5.317 | 0.000 | 0.005 | 2.091 |
| Harbi1 | 6.814 | 0.947 | 5.310 | 0.000 | 0.005 | 2.075 |
| Cib2 | 6.694 | 0.564 | 5.202 | 0.000 | 0.006 | 1.841 |
| Zfp512 | 10.367 | 1.100 | 5.194 | 0.000 | 0.006 | 1.824 |
| Ell | 7.857 | 0.607 | 5.190 | 0.000 | 0.006 | 1.813 |
| C1qa | -5.577 | 9.728 | -5.149 | 0.000 | 0.006 | 1.726 |
| Prrc2c | -9.764 | 3.907 | -5.144 | 0.000 | 0.006 | 1.715 |
| Gm6061 | 3.017 | 0.235 | 5.071 | 0.000 | 0.008 | 1.554 |
| Gm37988 | 4.109 | 0.279 | 4.994 | 0.000 | 0.009 | 1.387 |
| Qser1 | 4.853 | 0.435 | 4.980 | 0.000 | 0.009 | 1.355 |
| AC164550.2 | 2.776 | 0.218 | 4.977 | 0.000 | 0.009 | 1.349 |
| Cpt1a | 7.508 | 0.803 | 4.904 | 0.000 | 0.011 | 1.190 |
| Hist1h3e | 5.477 | 0.436 | 4.890 | 0.000 | 0.011 | 1.158 |
| Gm38126 | 4.553 | 0.490 | 4.886 | 0.000 | 0.011 | 1.149 |
| Rpap2 | 6.922 | 0.639 | 4.878 | 0.000 | 0.011 | 1.133 |
| Nup54 | 0.822 | 0.054 | 4.865 | 0.000 | 0.011 | 1.104 |
| Rnaset2b | -8.388 | 7.105 | -4.858 | 0.000 | 0.011 | 1.088 |
| Idua | 8.034 | 0.983 | 4.839 | 0.000 | 0.012 | 1.047 |
| Lrrc45 | 7.832 | 0.539 | 4.838 | 0.000 | 0.012 | 1.044 |
| Rbm34 | 8.203 | 0.996 | 4.810 | 0.000 | 0.012 | 0.983 |
| Slc26a11 | 5.718 | 0.463 | 4.790 | 0.000 | 0.013 | 0.938 |
| Hexb | -8.872 | 9.372 | -4.774 | 0.000 | 0.013 | 0.903 |
| Dlg1 | 6.591 | 0.912 | 4.738 | 0.000 | 0.014 | 0.822 |
| Zfand2a | 7.816 | 0.760 | 4.706 | 0.000 | 0.015 | 0.752 |
| Xylt1 | 3.443 | 0.485 | 4.650 | 0.000 | 0.017 | 0.629 |
| Zfyve16 | 6.636 | 0.542 | 4.620 | 0.000 | 0.018 | 0.563 |
| Mpeg1 | -6.781 | 7.133 | -4.600 | 0.000 | 0.019 | 0.517 |
| Slamf7 | 6.823 | 0.559 | 4.595 | 0.000 | 0.019 | 0.507 |
| Pigyl | 5.390 | 0.446 | 4.589 | 0.000 | 0.019 | 0.494 |
| Gm42857 | -6.906 | 3.936 | -4.579 | 0.000 | 0.019 | 0.471 |
| Gm26905 | -10.468 | 5.057 | -4.577 | 0.000 | 0.019 | 0.468 |
| Apoe | -10.814 | 10.645 | -4.569 | 0.000 | 0.019 | 0.450 |
| Prmt3 | 6.694 | 0.592 | 4.551 | 0.000 | 0.020 | 0.410 |
| Fhad1 | 2.912 | 0.239 | 4.550 | 0.000 | 0.020 | 0.406 |
| Pdhx | 3.495 | 0.288 | 4.530 | 0.000 | 0.021 | 0.362 |
| Nol10 | 3.918 | 0.364 | 4.513 | 0.000 | 0.021 | 0.325 |
| Sirpb1a | 6.446 | 0.539 | 4.491 | 0.000 | 0.022 | 0.276 |
| Gm16505 | 2.736 | 0.386 | 4.488 | 0.000 | 0.022 | 0.270 |
| Slc12a8 | 1.764 | 0.174 | 4.475 | 0.000 | 0.023 | 0.241 |
| Gm37090 | 4.076 | 0.575 | 4.449 | 0.000 | 0.024 | 0.184 |
| Fbxo21 | 6.792 | 0.482 | 4.448 | 0.000 | 0.024 | 0.181 |
| Igsf11 | 1.079 | 0.096 | 4.409 | 0.000 | 0.026 | 0.094 |
| AC183268.1 | 3.082 | 0.413 | 4.385 | 0.000 | 0.027 | 0.041 |
| Gm37733 | 6.052 | 0.837 | 4.384 | 0.000 | 0.027 | 0.039 |
| Vps36 | 6.857 | 0.670 | 4.370 | 0.000 | 0.028 | 0.008 |
| Pex6 | 7.874 | 0.819 | 4.367 | 0.000 | 0.028 | 0.001 |
| Ppid | 10.086 | 1.694 | 4.360 | 0.000 | 0.028 | -0.014 |
| Gpr35 | 5.583 | 0.593 | 4.345 | 0.000 | 0.029 | -0.047 |
| Nelfa | 3.818 | 0.273 | 4.341 | 0.000 | 0.029 | -0.057 |
| Tcea1-ps1 | 3.905 | 0.355 | 4.317 | 0.000 | 0.031 | -0.109 |
| Ppp2r2d | 6.807 | 0.965 | 4.301 | 0.000 | 0.031 | -0.147 |
| Mefv | 6.192 | 0.652 | 4.300 | 0.000 | 0.031 | -0.147 |
| Me2 | 6.640 | 0.561 | 4.299 | 0.000 | 0.031 | -0.149 |
| Hnrnpul2 | 6.202 | 0.752 | 4.260 | 0.000 | 0.034 | -0.236 |
| Ech1 | 9.434 | 1.154 | 4.245 | 0.000 | 0.035 | -0.270 |
| Map2k4 | 7.258 | 0.919 | 4.243 | 0.000 | 0.035 | -0.274 |
| 4930481A15Rik | 7.796 | 0.954 | 4.232 | 0.000 | 0.036 | -0.300 |
| Tpm3-rs7 | 2.746 | 0.267 | 4.225 | 0.000 | 0.036 | -0.315 |
| 2300009A05Rik | 3.876 | 0.493 | 4.223 | 0.000 | 0.036 | -0.320 |
| Gabra2 | 2.847 | 0.470 | 4.218 | 0.000 | 0.036 | -0.330 |
| Fn1 | 8.167 | 1.215 | 4.201 | 0.000 | 0.037 | -0.368 |
| Mtmr3 | 5.930 | 0.597 | 4.199 | 0.001 | 0.037 | -0.372 |
| Mfsd4b5 | 2.740 | 0.311 | 4.188 | 0.001 | 0.038 | -0.396 |
| Mtr | 5.299 | 0.579 | 4.166 | 0.001 | 0.040 | -0.446 |
| Ttc32 | 7.552 | 0.711 | 4.155 | 0.001 | 0.041 | -0.471 |
| Tnpo2 | 7.578 | 0.787 | 4.131 | 0.001 | 0.043 | -0.524 |
| Acot6 | 1.824 | 0.156 | 4.127 | 0.001 | 0.043 | -0.534 |
| Adcy8 | 1.802 | 0.156 | 4.114 | 0.001 | 0.044 | -0.561 |
| Khdrbs2 | 2.875 | 0.270 | 4.098 | 0.001 | 0.045 | -0.597 |
| Ripor1 | 7.634 | 0.764 | 4.077 | 0.001 | 0.047 | -0.643 |
| Dcaf5 | 6.259 | 0.583 | 4.063 | 0.001 | 0.048 | -0.675 |
| Tex10 | 5.290 | 0.389 | 4.062 | 0.001 | 0.048 | -0.676 |
| Haus6 | 2.883 | 0.250 | 4.052 | 0.001 | 0.049 | -0.698 |
res_output[["plot"]]
[1] "no significant enrichment identified"
get results table here
calculation not converging as Celltype not identified in all conditions however also rare in other conditions, no significant difference
idx=samplemeta$Celltype=="Granulocytes"
table(samplemeta$Treatment[idx], samplemeta$Genotype_corr[idx])
WT APPPS1+
Ctrl 0 2
Stroke 6 14
table(samplemeta$Treatment[idx], samplemeta$Genotype_corr[idx]) %>% fisher.test()
Fisher's Exact Test for Count Data
data: .
p-value = 1
alternative hypothesis: true odds ratio is not equal to 1
95 percent confidence interval:
0.0000 14.7518
sample estimates:
odds ratio
0
# res_output=generate_output("Granulocytes ")
# res_output[["results_sig"]] %>% display_tab()
# res_output[["plot"]]
get results table here
idx=samplemeta$Celltype=="T/NK"
table(samplemeta$Treatment[idx], samplemeta$Genotype_corr[idx])
WT APPPS1+
Ctrl 1 2
Stroke 2 17
table(samplemeta$Treatment[idx], samplemeta$Genotype_corr[idx]) %>% fisher.test()
Fisher's Exact Test for Count Data
data: .
p-value = 0.3708
alternative hypothesis: true odds ratio is not equal to 1
95 percent confidence interval:
0.0481749 117.2316789
sample estimates:
odds ratio
3.869104
# res_output=generate_output("T/NK")
# res_output[["results_sig"]] %>% display_tab()
# res_output[["plot"]]
get results table here
secret="C:/Users/andreas_chiocchetti/OneDrive/personal/fuchs_credentials.R"
source(secret)
counts=as.data.frame(samples.integrated@assays$RNA@data)
save(list=c("samplemeta", "counts"), file=paste0(home, "/geneviewer/Dataset.RData"))
rsconnect::setAccountInfo(name='molgenlab',
token='86875F8B6550C3A26488035E69B1F18D',
secret=shinySECRET)
rsconnect::deployApp(paste0(home, "/geneviewer"))
Preparing to deploy application...DONE
Uploading bundle for application: 5700187...DONE
Deploying bundle: 5602090 for application: 5700187 ...
Waiting for task: 1104605741
building: Parsing manifest
building: Building image: 6510932
building: Fetching packages
building: Installing packages
building: Installing files
building: Pushing image: 6510932
deploying: Starting instances
rollforward: Activating new instances
terminating: Stopping old instances
Application successfully deployed to https://molgenlab.shinyapps.io/geneviewer/
sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)
Matrix products: default
locale:
[1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252 LC_MONETARY=German_Germany.1252 LC_NUMERIC=C LC_TIME=German_Germany.1252
attached base packages:
[1] stats4 stats graphics grDevices utils datasets methods base
other attached packages:
[1] gprofiler2_0.2.1 lm.beta_1.5-1 pheatmap_1.0.12 RColorBrewer_1.1-2 kableExtra_1.3.4 viridis_0.6.2 viridisLite_0.4.0 xlsx_0.6.5 brms_2.16.3 Rcpp_1.0.8 compareGroups_4.5.1 data.table_1.14.2 SingleR_1.8.1 SeuratObject_4.0.4 Seurat_4.1.0 forcats_0.5.1 stringr_1.4.0 dplyr_1.0.7 purrr_0.3.4 readr_2.1.2 tidyr_1.1.4 tibble_3.1.6 ggplot2_3.3.5 tidyverse_1.3.1 DESeq2_1.34.0 SummarizedExperiment_1.24.0 Biobase_2.54.0 MatrixGenerics_1.6.0 matrixStats_0.61.0 GenomicRanges_1.46.1 GenomeInfoDb_1.30.1 IRanges_2.28.0 S4Vectors_0.32.3 BiocGenerics_0.40.0 limma_3.50.0
loaded via a namespace (and not attached):
[1] scattermore_0.7 coda_0.19-4 bit64_4.0.5 knitr_1.37 dygraphs_1.1.1.6 irlba_2.3.5 DelayedArray_0.20.0 inline_0.3.19 rpart_4.1.16 KEGGREST_1.34.0 RCurl_1.98-1.5 generics_0.1.2 ScaledMatrix_1.2.0 callr_3.7.0 cowplot_1.1.1 RSQLite_2.2.9 mice_3.14.0 RANN_2.6.1 future_1.23.0 chron_2.3-56 bit_4.0.4 tzdb_0.2.0 spatstat.data_2.1-2 webshot_0.5.2 xml2_1.3.3 lubridate_1.8.0 httpuv_1.6.5 StanHeaders_2.21.0-7 assertthat_0.2.1 xfun_0.29 rJava_1.0-6 hms_1.1.1 jquerylib_0.1.4 bayesplot_1.8.1 evaluate_0.14 promises_1.2.0.1 fansi_1.0.2 dbplyr_2.1.1 readxl_1.3.1 igraph_1.2.11 DBI_1.1.2 geneplotter_1.72.0 Rsolnp_1.16 htmlwidgets_1.5.4 tensorA_0.36.2 spatstat.geom_2.3-1 ellipsis_0.3.2 crosstalk_1.2.0 backports_1.4.1 markdown_1.1 annotate_1.72.0 RcppParallel_5.1.5 deldir_1.0-6 sparseMatrixStats_1.6.0 vctrs_0.3.8 ROCR_1.0-11 abind_1.4-5 cachem_1.0.6 withr_2.4.3 packrat_0.7.0 HardyWeinberg_1.7.4 checkmate_2.0.0 sctransform_0.3.3 prettyunits_1.1.1 xts_0.12.1 goftest_1.2-3 svglite_2.0.0 cluster_2.1.2 lazyeval_0.2.2 crayon_1.4.2 genefilter_1.76.0 pkgconfig_2.0.3 nlme_3.1-155 nnet_7.3-17 rlang_1.0.0 globals_0.14.0 lifecycle_1.0.1 miniUI_0.1.1.1 colourpicker_1.1.1 modelr_0.1.8 rsvd_1.0.5 cellranger_1.1.0 distributional_0.3.0 rprojroot_2.0.2 polyclip_1.10-0 lmtest_0.9-39 flextable_0.6.10 Matrix_1.4-0 loo_2.4.1 zoo_1.8-9 reprex_2.0.1 base64enc_0.1-3 processx_3.5.2 ggridges_0.5.3 png_0.1-7 bitops_1.0-7 KernSmooth_2.23-20 Biostrings_2.62.0 blob_1.2.2 DelayedMatrixStats_1.16.0 workflowr_1.7.0 parallelly_1.30.0 shinystan_2.5.0 beachmat_2.10.0 scales_1.1.1 memoise_2.0.1 magrittr_2.0.2 plyr_1.8.6 ica_1.0-2 threejs_0.3.3 zlibbioc_1.40.0 compiler_4.1.2 rstantools_2.1.1 fitdistrplus_1.1-6 cli_3.1.1 XVector_0.34.0 listenv_0.8.0 ps_1.6.0 patchwork_1.1.1 pbapply_1.5-0 Brobdingnag_1.2-7 MASS_7.3-55 mgcv_1.8-38 tidyselect_1.1.1 stringi_1.7.6 highr_0.9 yaml_2.2.2 askpass_1.1 BiocSingular_1.10.0 locfit_1.5-9.4 ggrepel_0.9.1 bridgesampling_1.1-2 grid_4.1.2 sass_0.4.0 tools_4.1.2 future.apply_1.8.1 parallel_4.1.2 rstudioapi_0.13 uuid_1.0-3 git2r_0.29.0 gridExtra_2.3 farver_2.1.0 posterior_1.2.0 Rtsne_0.15 BiocManager_1.30.16 digest_0.6.29 shiny_1.7.1 broom_0.7.12 later_1.3.0 writexl_1.4.0 RcppAnnoy_0.0.19 httr_1.4.2 gdtools_0.2.3 AnnotationDbi_1.56.2 rsconnect_0.8.25 colorspace_2.0-2 rvest_1.0.2 XML_3.99-0.8 fs_1.5.2 tensor_1.5 reticulate_1.24 truncnorm_1.0-8 splines_4.1.2 uwot_0.1.11 spatstat.utils_2.3-0 xlsxjars_0.6.1 shinythemes_1.2.0 plotly_4.10.0 systemfonts_1.0.3 xtable_1.8-4 jsonlite_1.7.3 rstan_2.21.3 R6_2.5.1 pillar_1.7.0 htmltools_0.5.2 mime_0.12 DT_0.20 glue_1.6.1 fastmap_1.1.0 BiocParallel_1.28.3 BiocNeighbors_1.12.0 codetools_0.2-18 pkgbuild_1.3.1 mvtnorm_1.1-3 utf8_1.2.2 lattice_0.20-45 bslib_0.3.1 spatstat.sparse_2.1-0 curl_4.3.2 leiden_0.3.9 gtools_3.9.2 officer_0.4.1 openssl_1.4.6 shinyjs_2.1.0 zip_2.2.0 survival_3.2-13 rmarkdown_2.11 munsell_0.5.0 GenomeInfoDbData_1.2.7 haven_2.4.3 reshape2_1.4.4 gtable_0.3.0 spatstat.core_2.3-2