Skip to content

Instantly share code, notes, and snippets.

nextflow, R, shiny, shell

Angel Angelov angelovangel

nextflow, R, shiny, shell
  • Germany
View GitHub Profile
angelovangel /
Last active March 26, 2021 16:20
checksum many files
Generate checksums for many files in a directory
# make checksums (use md5 on macos)
find ./some_dir -type f -exec md5sum {} \; >> checksums.md5
# check them
md5sum -c checksums.md5
# use gnu parallel for really many files? Much faster
angelovangel /
Last active February 12, 2020 20:56
SI prefixes with printf

In ksh only (not in bash), this just works:

printf '%#d\n' 105000000

Even this!!!

angelovangel / Leaflet-R-hotline-demo.R
Last active March 27, 2021 09:34
Leaflet hotline demo
View Leaflet-R-hotline-demo.R
# demonstrate Leaflet.hotline JS plugin in leaflet for R
# the Leaflet.hotline plugin has to be locally downloaded
angelovangel / FACS data plotting (geom_hex)
Last active March 27, 2021 09:34
FACS data plotting
View FACS data plotting (geom_hex)
# this code is about
# reading fcs files (from FACS) and converting them to one dataframe
# plotting is then done normally in ggplot
# installation instructions for the required libraries can be found on the internet:)
### this function reads a fcs file and returns the data as a tibble, adding a column with the file name #####
angelovangel / do_drm.R
Last active May 16, 2023 07:42
Fit dose-response models (with drc) and plot, for many samples
View do_drm.R
# these two functions perform the following:
# do_drm() --> performs drm (from the drc package) on a long dataframe, using the LL.4 log-logistic model for describing dose-response relationships
# do_drm_plot() --> plots the output of do_drm()
# to use the functions just paste this file in your R session and source it.
# try it out with
# do_drm(S.alba, Dose, DryMatter, Herbicide) %>% do_drm_plot(ed50 = TRUE, color = ~Herbicide) + scale_x_log10()
# do_drm() usage
# do_drm(df, d, r, x, y, ...)
angelovangel / Using models from the drc package with ggplot
Last active June 2, 2022 12:55
Using models from the drc package (for dose-response curves) with ggplot
View Using models from the drc package with ggplot
# the aim is to use the 'drc' package to fit models to data and then extract the data and use for plotting in ggplot
# the data could be growth curves, dose-response, Michaelis-Menten etc.
# here, the S.alba data from drc is used for dose-response
attach(S.alba) # the data used in this gist
angelovangel / linear model plot with coefficients
Last active October 29, 2017 21:56
plotting linear models plus the model coefficients
View linear model plot with coefficients
# a general function for plotting linear models
# makes plots of the data and the model plus the model coefficients
# the function takes a linear model object as argument
ggplotLM <- function(fit) {
angelovangel / olefins-analysis.R
Created February 2, 2017 14:33
GCMS analysis of olefins in R (specific for Shimadzu GCMS Postrun output)
View olefins-analysis.R
n <- as.integer(grep("Header", readLines("ASCIIData.txt")) %>% length()) # number of runs, without the system call above
ole <- readline(prompt="Enter number of olefins detected for these runs(including C30): ")
ole <- as.integer(ole)