This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| wilcox_unequal_var <- function(x, y, ...) { | |
| # The Wilcoxon rank sum test (Mann Whitney U test) does not perform | |
| # that well on data where the variances are unequal. Some | |
| # investigators have recommended as an alternative performing the | |
| # unequal variance t-test on ranked values. See | |
| # https://academic.oup.com/beheco/article/17/4/688/215960 | |
| # https://psycnet.apa.org/doiLanding?doi=10.1037%2Fh0078850 | |
| rr <- rank(c(x, y)) | |
| nx <- length(x) | |
| t.test(rr[1:nx], rr[(nx+1):length(rr)], var.equal=FALSE, ...) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # List all open tabs in front Chrome window | |
| # From https://superuser.com/questions/276321/how-to-export-opened-tabs-in-chrome | |
| alias listtabs="osascript -e{'set o to\"\"','tell app\"google chrome\"','repeat with t in tabs of window 1','set o to o&url of t&\" \"&title of\ | |
| t&linefeed',end,end}|sed \$d" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(ensembldb) | |
| library(EnsDb.Mmusculus.v79) | |
| ensembl_gene_ids <- c('ENSMUSG00000000120', 'ENSMUSG00000000159', 'ENSMUSG00000000563', 'ENSMUSG00000000600') # some random IDs | |
| ensembldb::select(EnsDb.Mmusculus.v79, keys=ensembl_gene_ids, keytype = "GENEID", columns = c("SYMBOL","GENEID")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(DT) | |
| # | |
| # make a table of results | |
| # ... | |
| # | |
| datatable(signif_results, filter = 'top', rownames = FALSE, | |
| options=list(pageLength = 10, autoWidth = TRUE)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(Seurat) | |
| library(harmony) | |
| # x is a Seurat object not yet processed but we have chosen num_pc | |
| x <- FindNeighbors(x, reduction = 'pca', dims = 1:num_pc, verbose = FALSE) %>% | |
| FindClusters(verbose = FALSE, resolution = 0.2) %>% | |
| RunUMAP(reduction = 'pca', dims = 1:num_pc, verbose = FALSE) | |
| x$noharmony_clusters <- x$seurat_clusters | |
| x@misc$noharmony_umap <- x@reductions$umap |
OlderNewer