This file contains 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
# test Jaccard | |
# Create a list gene sets | |
char1 <- c("gene1", "gene2", "gene5", "gene9", "gene10") | |
char2 <- c("gene2", "gene3", "gene5", "gene7", "gene10") | |
char3 <- c("gene7", "gene9", "gene10", "gene11", "gene12", "gene1") | |
lst <- list(char1, char2, char3) | |
# Function to calculate Jaccard distance |
This file contains 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
# Alternative to a doubly-nested loop | |
# Imagine I want to perform an operation on a data frame | |
# once for each combination of two variables, such as Country and Year | |
# I can do this with a nested loop, or I can do this with (among other | |
# things) lapply() | |
# Generate random data: | |
allCountries <- LETTERS[1:10] | |
allYears <- 1990:2012 |
This file contains 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(ChIPpeakAnno) | |
library(biomaRt) | |
library(genomation) | |
library(dplyr) | |
# Read in metilene results | |
res <- read.table("results_de_novo_all_10.txt", sep = "\t", header = T) | |
head(res) |