Skip to content

Instantly share code, notes, and snippets.

Avatar

Roman Hillje romanhaa

View GitHub Profile
@romanhaa
romanhaa / run.sh
Last active May 10, 2022
macOS settings
View run.sh
# https://macos-defaults.com/
# https://www.defaults-write.com
# reset with: defaults delete -g <FEATURE>
# dock
# position
defaults write com.apple.dock "orientation" -string "right"
# icon size
defaults write com.apple.dock "tilesize" -int "36"
@romanhaa
romanhaa / run.sh
Created Jun 9, 2021
Highlight hits in `grep` search
View run.sh
grep --color=always -e "^" -e <SEARCH_TERM> <FILE>
@romanhaa
romanhaa / run.sh
Last active Jun 4, 2021
Copy files/directories with `rsync`
View run.sh
# copy directory from A to B
rsync -ah --info=progress2 <DIR_SOURCE> <DIR_TARGET>
# copy directory from A into B
rsync -ah --info=progress2 <DIR_SOURCE> <PARENT_OF_DIR_TARGET>/
# copy content of directory A into B
rsync -ah --info=progress2 <DIR_SOURCE>/ <DIR_TARGET>/
# copy directory from A to B on remote machine
@romanhaa
romanhaa / run.sh
Last active Jun 4, 2021
See colors in `less`
View run.sh
less -r <FILE>
@romanhaa
romanhaa / run.sh
Last active Jun 4, 2021
Change formatting of text file, e.g. from ISO-8859-1 (table exported from Excel) to UTF-8
View run.sh
iconv -f ISO-8859-1 -t UTF-8 -o <OUTPUT_FILE> <INPUT_FILE>
@romanhaa
romanhaa / run.sh
Last active Feb 27, 2020
run_cell_ranger
View run.sh
# convert Docker container to Singularity format
singularity build cell_ranger_3.1.0.sif docker://romanhaa/cell_ranger:3.1.0
# create index for Cell Ranger
# - modify "/hpcnfs" to your file system
singularity exec --bind /hpcnfs cell_ranger_3.1.0.simg \
cellranger mkref \
--genome=cell_ranger_3.1.0 \
--fasta=GRCh38.primary_assembly.genome.fa \
--genes=gencode.v32.annotation.gtf \
@romanhaa
romanhaa / alluvial.R
Last active Feb 13, 2020
Making an alluvial plot in R with ggalluvial
View alluvial.R
library("tidyverse")
library("ggalluvial")
# original data
# every genomic bin of 200bp is assigned one of 8 possible chromatin states
# note that group1-3 are factors
input_data
# A tibble: 855,156 x 4
# bin group1 group2 group3
# <chr> <fct> <fct> <fct>
@romanhaa
romanhaa / index.html
Created Aug 29, 2019
interactive_bar_chart_lol_leagues
View index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<meta http-equiv="Access-Control-Allow-Origin" content="*"/>
<meta charset="utf-8">
<script src="https://d3js.org/d3.v3.min.js"></script>
</head>
<style>
View index.html
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<script src='//ramnathv.github.io/rCharts/libraries/widgets/polycharts/js/polychart2.standalone.js' type='text/javascript'></script>
<style>
.rChart {
display: block;