Skip to content

Instantly share code, notes, and snippets.

View DannyArends's full-sized avatar

Danny Arends DannyArends

View GitHub Profile
# 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
#
# Call expression from aligned SRA reads
# copyright (c) 2022 - Danny Arends
#
library("GenomicAlignments")
library("GenomicFeatures")
library("Rsamtools")
library("preprocessCore")
library("vioplot")
@DannyArends
DannyArends / 0_installSoftware.sh
Last active April 28, 2024 12:58
Scripts and other things for RNA-Seq
# 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
<!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');
#
# 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>/")
@DannyArends
DannyArends / SHA1error_d3js.html
Created September 15, 2015 07:43
SHA1 error when loading d3.min.js from: https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js [Firefox]
<!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>
@DannyArends
DannyArends / packages.R
Last active August 29, 2015 14:18
Installation of most R packages I use
# 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
@DannyArends
DannyArends / gist:d7b3d8182709ac3cf4f5
Created June 18, 2014 13:24
Weird plot, but nice
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
}
@DannyArends
DannyArends / Code.R
Last active December 28, 2015 23:39
Code for the presentation I gave at the Humboldt-Universität in Berlin on 21-11-2013
library("qtl") # Load the library
data(multitrait) # Load the data
multitrait # Show the library
pull.pheno(multitrait, pheno.col = 1) # Shows the phenotype values of phenotype 1
hist(pull.pheno(multitrait, pheno.col = 1)) # Create a histogram
# Plot a map versus the other ones
plot.map(multitrait, est.map(multitrait))
@DannyArends
DannyArends / .gitignore
Last active December 18, 2015 06:59
Some code to test 4store. Store r/qtl cross object as N3 formatted file. We then use 2 shell commands (printed by R): (1) converts n3 to rdf, (2) upload to the 4store database using curl. After this we can use: 'rdmd tripleStore.d' to query the triple store.
*~
*.rdf
*.n3