Skip to content

Instantly share code, notes, and snippets.

file_journals <- ReadBib("journals.bib")
dates <- unlist(unique(file_journals$year))[order(unlist(unique(file_journals$year)),decreasing = TRUE)]
#Prints recerences
for (date in dates) {
cat(paste0("##",date),"\n")
print(file_journals[list(year=date)],.opts = list(style="markdown",bib.style ="authoryear" ,max.names =10,dashed=FALSE))
cat("\n")
}
@cheuerde
cheuerde / _site.yml
Created January 31, 2017 20:11 — forked from alexsingleton/_site.yml
website yaml
name: "Alex_Singleton"
navbar:
title: "Alex Singleton"
left:
- text: "Publications"
icon: fa-book fa-2x
href: publications.html
- text: "CV"
icon: fa-file fa-2x
href: cv.html
@cheuerde
cheuerde / EditPedFast.cpp
Last active September 2, 2016 08:54
Numerator Relationship Matrix for normal pedigrees and paternal pedigrees only
// Claas Heuer, February 2016
//
// Note: This is copied and modified form the sources of the
// cran package: 'pedigreemm'
#include <R.h>
#include <Rdefines.h>
#include "Rcpp.h"
/**
@cheuerde
cheuerde / GemmaGWAS.r
Created September 2, 2016 08:43
Wrapper for standalone software "GEMMA"
# Claas Heuer, August 2016
#
# Wrapper for standalone software "GEMMA"
# http://www.xzlab.org/software.html
# NOTE: the binary executable "gemma" must be
# in $PATH (e.g.: sudo cp gemma /usr/bin/)
# Y is a matrix of phenotypes (each column one trait).
# Z is the matrix of marker covariates.
# G is a genomic relationship matrix, may be NULL (then GEMMA will compute it).
@cheuerde
cheuerde / LKJCholeskyPriorMultivariateMarkerRegressionStan.r
Last active July 18, 2016 11:15
Multivariate Mixed Modle using LKJ prior on correlation matrix
# Claas Heuer, July 2016
#
# Stan model for multivariate mixed model with two
# random effects that can be specified by
# their according design matrices
# Help for the LKJ prior from here: http://stla.github.io/stlapblog/posts/StanLKJprior.html
library(pacman)
pacman::p_load(rstan, BGLR, shinystan)
@cheuerde
cheuerde / BivariateMarkerRegressionStan.r
Last active March 22, 2018 08:59
Bivariate Mixed Model for two random effects in Stan
# Claas Heuer, July 2016
#
# Stan model for bivariate mixed model with two
# random effects that can be specified by
# their according design matrices
library(pacman)
pacman::p_load(rstan, BGLR, shinystan)
mvntest <- "
@cheuerde
cheuerde / VifmSetup.sh
Last active July 1, 2016 11:38
Vifm as file manger
# Claas Heuer, July 2016
#
# Vifm is a midnight commander like two-pane file
# manager for the terminal.
# Very intuitive to use for vim users
#
# https://github.com/vifm/vifm
# https://github.com/vifm/vifm-colors
# http://vifm.info/colorschemes.shtml
# http://vifm.info/manual.shtml#Pane manipulation
@cheuerde
cheuerde / DropboxServer.sh
Created July 1, 2016 10:49
Dropbox on Server
# Claas Heuer, July 2016
#
# Run Dropbox on a linux server
# from here: https://www.dropbox.com/install?os=lnx
# get and extract dropbox
cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
# run for first time ussing x-forwarding and setup sync
@cheuerde
cheuerde / MaximumLikelihoodEstimationMVN.r
Created February 11, 2016 22:09
Maximum Likelihood Estimation of Multivariate Normal parameters
# Claas Heuer, February 2016
#
# Maximum Likelihood Estimation of parameters of bivariate normal distribution.
# We attempt to estimate the correlation between the two random vectors
# (as well as means and variances). A prior on the correlation coefficient
# is put that forces that estimate between -1 and 1.
# We do something similar for the variance components to force
# those to be positive.
library(mvtnorm)
@cheuerde
cheuerde / gaussmixturejags.r
Last active February 12, 2022 18:19
Gaussian Mixture in JAGS
# from here: http://doingbayesiandataanalysis.blogspot.com/2012/06/mixture-of-normal-distributions.html
library(rjags)
modelstring <- "
model {
# Likelihood:
for( i in 1 : N ) {
y[i] ~ dnorm( mu[i] , tau[i] )
mu[i] <- muOfClust[ clust[i] ]