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
| # This first line grabs the organism ID number | |
| curl -s "http://rest.kegg.jp/list/organism" | grep "Danio" | |
| # This next line uses the ID to grab xml files | |
| curl "http://rest.kegg.jp/list/pathway/T01004" | cut -f 1 | while read A; do curl -o "${A}.xml" "http://rest.kegg.jp/get/${A}/kgml" ; done | |
| # https://www.biostars.org/p/202663/ |
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
| # Returns a reactive that debounces the given expression by the given time in | |
| # milliseconds. | |
| # | |
| # This is not a true debounce in that it will not prevent \code{expr} from being | |
| # called many times (in fact it may be called more times than usual), but | |
| # rather, the reactive invalidation signal that is produced by expr is debounced | |
| # instead. This means that this function should be used when \code{expr} is | |
| # cheap but the things it will trigger (outputs and reactives that use | |
| # \code{expr}) are expensive. | |
| debounce <- function(expr, millis, env = parent.frame(), quoted = 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
| sum(duplicated(gene_names), na.rm = 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
| # This function came from a stack overflow discussion on how ggplot selects | |
| # colors. Because there are 14 clusters in our seurat analysis, I'm going to grab | |
| # the first 14 colors that ggplot chooses. These will the be same exact colors | |
| # as the tSNE plot in my Seurat analysis. | |
| gg_color_hue <- function(n) { | |
| hues = seq(15, 375, length = n + 1) | |
| hcl(h = hues, l = 65, c = 100)[1:n] | |
| } | |
| annot_colors <- gg_color_hue(14) |
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
| # Grep multiple items from a character vector | |
| # https://stackoverflow.com/questions/17358289/finding-elements-of-lists-in-r | |
| greplist <- function(mylist, targetlist, return_true_or_false) | |
| {unique(grep(paste(mylist, collapse = "|"), | |
| targetlist, value = return_true_or_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
| # https://stackoverflow.com/questions/16566799/change-variable-name-in-for-loop-using-r | |
| d <- 5 | |
| for(i in 1:10) { | |
| nam <- paste("A", i, sep = "") # create variable names here | |
| assign(nam, rnorm(3)+d) # variable names, and the function assigned to them | |
| } |
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
| # Creating empty list for results | |
| rowcor.list <- list() | |
| # Running row correlation function on each gene and storing them to a list | |
| for(i in 1:3){ | |
| results <- paste0(mygenes[i], "results") | |
| rowcor.list[[results]] <- rowCors(filtered.matrix, | |
| filtered.matrix[gene.ind[i], ]) | |
| } |
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
| import re | |
| def grep(pattern,fileObj): | |
| r=[] | |
| for line in fileObj: | |
| if re.search(pattern,line): | |
| r.append(line) | |
| return r |
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
| # Reading in Tatjana's list | |
| a.df <- read.delim("/Volumes/projects/ddiaz/Analysis/Data/Gene_Lists/Tatjanas_list.csv", | |
| sep = ",", header = TRUE, stringsAsFactors = FALSE) | |
| a.list = list() # Initializing list | |
| a.list <- lapply(a.df, FUN = as.character) # Converting df to list | |
| # Plot only the genes in the current data set | |
| for (i in 1:23){ | |
| FeaturePlot(homeo.seur, a.list[[i]][a.list[[i]] %in% | |
| homeo.seur@var.genes], cols.use = c("grey", "blue")) |
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
| counts.seurat <- RunTSNE(counts.seurat, | |
| reduction.use = "pca", | |
| dims.use = 1:6, | |
| dim.embed = 3) | |
| DimPlot(object = counts.seurat, reduction.use = "tsne", dim.1 = 1, dim.2 = 3) | |
| tSNE_1 <- counts.seurat@dr$tsne@cell.embeddings[,1] | |
| tSNE_2 <- counts.seurat@dr$tsne@cell.embeddings[,2] | |
| tSNE_3 <- counts.seurat@dr$tsne@cell.embeddings[,3] |
OlderNewer