Skip to content

Instantly share code, notes, and snippets.

View agrueneberg's full-sized avatar

Alexander Grueneberg agrueneberg

View GitHub Profile
@agrueneberg
agrueneberg / gist:f0a3986a35888f1ac67ab529bf99e26c
Last active January 8, 2024 09:37
Lakehouse-focused Trino (Hive, Iceberg, Delta, Hudi)
#!/usr/bin/env bash
#
# Reduce compilation time and size of dependencies by trimming most of the
# plugins unrelated to Lakehouses. Also increases the startup time of the
# Development Server.
#
# Catalogs in testing/trino-server-dev/etc/catalog need to be edited.
#
# Compile project with ./mvnw clean install -DskipTests
#
@agrueneberg
agrueneberg / ROS2 Complex Parameters
Last active May 3, 2023 08:23
Complex ROS2 parameters via undeclared, namespaced parameters
ros2 param load /mappings mappings2.yaml
@agrueneberg
agrueneberg / ros2json.py
Created April 30, 2023 21:52
ROS messages to JSON and back
import os
import importlib
import rosidl_runtime_py
import json
def get_msg_type(type):
symbol = os.path.basename(type)
module = ".".join(os.path.split(os.path.dirname(type)))
return getattr(importlib.import_module(module), symbol)
@agrueneberg
agrueneberg / generate-random-matrix.c
Created May 23, 2020 15:28
Generates random binary matrices
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(int argc, char **argv) {
// Get arguments
if (argc != 4) {
fprintf(stderr, "usage: %s nrows ncols filename\n", argv[0]);
#!/usr/bin/env Rscript
library(BGLR)
data(mice)
gzmice <- gzfile("mice.raw.gz", "w")
write.table(cbind(mice.pheno, mice.X), gzmice, row.names = F, quote = F)
close(gzmice)
#!/usr/bin/env Rscript
#
# Converts the mice dataset to a BED file that can be used with PLINK and
# BEDMatrix.
#
library(BGLR)
data(mice)
@agrueneberg
agrueneberg / push-docs.sh
Last active January 10, 2016 05:25
R staticdoc on Travis
#!/bin/bash
set -e
# Only run on normal commits, ignore pull requests
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
# Clone gh-pages branch into inst/web
git clone --branch gh-pages https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git inst/web
# Copy README
cp README.md inst/web
# Run staticdocs
Rscript -e 'library(staticdocs); library(methods); build_site(launch = FALSE)'
@agrueneberg
agrueneberg / parallel.R
Created September 10, 2015 15:20
Parallel Computing in R
library(parallel)
library(BGLR)
library(microbenchmark)
data(mice)
X <- mice.X
y <- mice.pheno$Obesity.BMI
GWAS <- function (i) {
summary(lm(y ~ X[, i]))$coef[2, ]

How to match RPPA samples to their patients in The Cancer Genome Atlas (TCGA)

When I wrote the TCGA Toolbox and the TCGA.rppa module, one of biggest problems was to match samples and patients.

Both sample and patient files can be accessed through the Open Access HTTP Directory. For glioblastoma multiforme (gbm), the samples can be found in the gbm/cgcc/mdanderson.org/mda_rppa_core/protein_exp/mdanderson.org_GBM.MDA_RPPA_Core.Level_3.1.0.0/ directory, and the patients can be found [in the nationwidechildrens.org_clinical_patient_gbm.txt file in

@agrueneberg
agrueneberg / ufw-syncthing
Created January 4, 2015 20:06
ufw app profile for syncthing (to put into /etc/ufw/applications.d/)
[Syncthing]
title=Syncthing
description=Open Source Continuous File Synchronization
ports=22000/tcp|21025/udp