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
# Unit-Variance Scaling or Autoscaling | |
autoscale <- function(X) { | |
return(apply(X,2, function(x){ (x- mean(x)) / sd(x) })) | |
} | |
# Compute the covariance matrix | |
covariance <- function(X) { | |
cM <- matrix(NA, ncol(X), ncol(X), dimnames = list(colnames(X), colnames(X))) | |
for(x in colnames(X)) { |
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
# | |
# Code for the lecture on "Gene Ontology from Scratch" | |
# copyright (c) 2020-2024 Danny Arends | |
# | |
# This program is free software; you can redistribute it and/or modify it under the terms of | |
# the GNU General Public License,version 3, as published by the Free Software Foundation. | |
# This program is distributed in the hope that it will be useful, but without any warranty; | |
# without even the implied warranty of merchantability or fitness for a particular purpose. | |
# | |
# For more details see: www.gnu.org/licenses/gpl-3.0.en.html |
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
# Author : Danny Arends | |
# Purpose : create an MRI table from the format provided by our MRI reader | |
months <- rbind(c("Jan",31),c("Feb",28),c("Mar",31),c("Apr",30),c("May",31),c("Jun",30), | |
c("Jul",31),c("Aug",31),c("Sep",30),c("Oct",31),c("Nov",30),c("Dec",31)) | |
createMRItable <- function(MRIdata, description){ | |
dates <- strsplit(unlist(lapply(strsplit(as.character(MRIdata[,"TimeDateDura"]),";"),"[",1))," ") # Get the malformed dates | |
MRIdata[,"TimeDateDura"] <- unlist(lapply(dates, function(x){ # Transform to DD/MM/YY |
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
# | |
# Call expression from aligned SRA reads | |
# copyright (c) 2022 - Danny Arends | |
# | |
library("GenomicAlignments") | |
library("GenomicFeatures") | |
library("Rsamtools") | |
library("preprocessCore") | |
library("vioplot") |
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
# Add yourself to the sudo group | |
su - | |
usermod -aG sudo danny | |
exit | |
# Install the virtual box guest additions | |
cd /media/cdrom0 | |
sudo sh ./VBoxLinuxAdditions.run | |
# Install R and deps |
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
<!DOCTYPE HTML> | |
<head> | |
<title>DannyArendsTwitchOverlayApp</title> | |
<meta content="text/html;charset=utf-8" http-equiv="Content-Type"> | |
<meta content="utf-8" http-equiv="encoding"> | |
<script src="https://extension-files.twitch.tv/helper/v1/twitch-ext.min.js"></script> | |
<script src="js/secret.js"></script> <!-- Contains startTwitch function which calls getAppToken with Client-ID and Client-Secret --> | |
<script> | |
var audio1 = new Audio('Audio/teleport.mp3'); |
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
# | |
# Download the earth texture from: https://www.solarsystemscope.com/textures/, open in MS Paint, scaled down to 50% size and save as BMP | |
# Or download it from: https://www.dannyarends.nl/etc/img/2k_earth_daymap.bmp | |
# JHU CovID19 data from: CSSE at Johns Hopkins University (CSSEGISandData) | |
# copyright GPL-3 by Danny Arends - Molekulare Zuchtungsbiology - HU Berlin | |
# Written May, 2020, last modified May, 2020 | |
# | |
# Change: /path/to/ and set the working dir to the BMP image | |
setwd("/<path>/<to>/") |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<script type="javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"></script> | |
</head> | |
<body> | |
Open the developer console in firefox to see the error | |
</body> | |
</html> |
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
# Bioconductor packages | |
source("http://bioconductor.org/biocLite.R") | |
biocLite(ask=FALSE) | |
biocLite(c("preprocessCore", "biomaRt", "affy", "limma", "beadarray", "ggplot2", "impute", "DESeq2", "Rsamtools", "vsn")) | |
biocLite(c("topGO", "GO.db", "KEGG.db", "MotifDb", "seqLogo", "motifStack")) | |
biocLite(c("Biostrings", "GenomicAlignments", "GenomicFeatures", "BiocParallel")) | |
biocLite(c("BSgenome.Mmusculus.UCSC.mm10", "TxDb.Mmusculus.UCSC.mm10.ensGene")) | |
biocLite(c("gcrma", "lumi", "ShortRead", "cdfpackage", "seqinr", "reshape2", "plyr", "scales")) | |
# CRAN packages |
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
phi <- 0 | |
while(TRUE){ | |
plot(sin(phi + 1:20), col=c("black","black","red"), cex=3, pch=c("☢","☠","♥")) | |
Sys.sleep(0.1) | |
phi = phi +0.3 | |
} |
NewerOlder