Skip to content

Instantly share code, notes, and snippets.

View sinarueeger's full-sized avatar

Sina Rüeger sinarueeger

View GitHub Profile
@sinarueeger
sinarueeger / extract-genetic-data.md
Last active March 13, 2024 14:21
Extract data for single SNPs from large genetic datasets
@sinarueeger
sinarueeger / encryption_files.md
Last active December 11, 2023 05:44
Instructions on how to encrypt your documents and share them with collaborators

Getting started with encryption of documents

What is the problem

If you work with sensitive (human) data (e.g. anything that contains an identifier of an individual), you occasionally want to share that data. The most straightforward way to do so is to send them by email (and yes - we are all guilty of that!). The problem arises, if the data get into wrong hands. Let's say you send the email accidentally to the wrong person. Or worse, without your knowledge, the email gets into the wrong hands.

The good news is, that there is a secure & handy solution for this. But let's first have a look at some other solutions.

What about dropbox and other file hosting systems? ❌

@sinarueeger
sinarueeger / satrdaycdf-2018.Rmd
Last active November 10, 2023 02:15
Write-up of satRday in Cardiff 2018
# satRdays Cardiff 2018
This is a brief write-up of my [satRdays Cardiff](http://cardiff2018.satrdays.org/) experience.
First - what is a [**satRday**](http://satrdays.org/)?
It is an awesome concept: attending an **R conference** organised by a **local RUG** on a **Saturday**.
The [programme](http://cardiff2018.satrdays.org/#programme) in Cardiff had parallel sessions - tough decision-making to pick between promising talks!
@sinarueeger
sinarueeger / howto-future.R
Created February 25, 2019 15:39
Using the future package in R for parallel computing
## //////////////////
## FUTURE PACKAGE
## //////////////////
## here is a function that sums up really slow
## ---------------------------------------------
slow_sum <- function(vec) {
SUM <- 0
@sinarueeger
sinarueeger / phylo-pca.md
Last active July 18, 2022 23:15
Estimating phylogenetic PCs

Phylogenetic principal component analysis (in R)

The following is a guide on how to perform a phylogenetic principal component analysis.

The phylogenetic principal component analysis, short pPCA, has been proposed by Revell in 2009 and Jombart et al. 2010.

Jombart also implemented pPCA in the adephylo R-package.

@sinarueeger
sinarueeger / add-banner.R
Last active January 24, 2022 08:19
Add banner comments to R scripts
## Add banner comments to R scripts using
## [bannerCommenter](https://cran.r-project.org/web/packages/bannerCommenter/vignettes/Banded_comment_maker.pdf).
## header -----------------------------
bannerCommenter::banner("G2G-EBV analysis using GASTON", emph = TRUE)
## section -----------------------------
bannerCommenter::banner("0. Setup", centre = TRUE, bandChar = "/")
@sinarueeger
sinarueeger / uses.md
Last active August 25, 2021 10:20
My work setup. Inspired by uses.tech and usesthis.com.
@sinarueeger
sinarueeger / awk-cheatsheet
Last active December 28, 2019 04:13
awk/sed cheatsheet
## adding column N as last column to a file
FILE=~/gwas.txt
N=98
awk '$NF="98"' $FILE > tmp-file
sed -e '1s/98/N/' tmp-file > tmp2-file