Skip to content

Instantly share code, notes, and snippets.


Kamil Slowikowski slowkow

View GitHub Profile
slowkow /
Created Dec 23, 2020
Make a montage from a list of PDF files
#!/usr/bin/env python
Kamil Slowikowski
Write montage.png from a list of PDF files, each panel 500px wide:
slowkow / rsa-example.R
Created Oct 21, 2020
A toy example of RSA encryption and decryption
View rsa-example.R
#!/usr/bin/env Rscript
# rsa-example.R
# Inspired by Alex Van de Sande
last_digit <- function(x) {
x_char <- as.character(x)
as.numeric(substr(x_char, nchar(x_char), nchar(x_char)))
slowkow / income.svg
Last active Oct 15, 2020
Trends in Income From 1975 to 2018 by Carter C. Price, Kathryn A. Edwards
View income.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
slowkow / writeMMgz.R
Created Mar 16, 2020
Write a gzip compressed Matrix Market file in R.
View writeMMgz.R
#' @param x A sparse matrix from the Matrix package.
#' @param file A filename that ends in ".gz".
writeMMgz <- function(x, file) {
mtype <- "real"
if (is(x, "ngCMatrix")) {
mtype <- "integer"
sprintf("%%%%MatrixMarket matrix coordinate %s general", mtype),
slowkow /
Created Feb 5, 2020
A simple version of the Needleman-Wunsch algorithm in Python.
#!/usr/bin/env python
The Needleman-Wunsch Algorithm
This is a dynamic programming algorithm for finding the optimal alignment of
two strings.
slowkow / read_cellranger.R
Last active Aug 4, 2020
Read Cell Ranger HDF5 .h5 files in R
View read_cellranger.R
# install.packages(c("Matrix", "rhdf5", "tidyverse"))
my_h5_files <- Sys.glob(
slowkow /
Last active Oct 1, 2019
Install the 'units' R package on Partners


I had a difficult time installing the units R package on the Partners ERIS servers.

I hope this post helps you to figure out how to work around the errors.


slowkow / pubmed-publications.html
Created May 3, 2019
Get an HTML list of PubMed publications
View pubmed-publications.html
<!DOCTYPE html>
<!-- Copied directly from by Damian J Williams -->
<input placeholder="Kamil Slowikowski" name="name"/>
<p id="demo"></p>
slowkow /
Last active May 15, 2019
Generate a DESCRIPTION file with all of your installed packages


We need to install a lot of R packages each time we upgrade to a new version of R.


  1. Before installing the new R, run Rscript make_description.R to write a list of all installed packages.
  2. Install the new version of R.
  3. Use devtools to reinstall the packages.
slowkow / out.pdf
Last active Feb 5, 2019
Make a PCA plot in Bash with the OpenCPU API
View out.pdf
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.