Skip to content

Instantly share code, notes, and snippets.

View janxkoci's full-sized avatar

Jeňa Kočí janxkoci

View GitHub Profile
@janxkoci
janxkoci / bash_strict_mode.sh
Created September 11, 2025 11:46
bash strict mode template
#!/bin/bash
# bash strict mode
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail
IFS=$'\n\t'
@janxkoci
janxkoci / update_scripts.awk
Created August 28, 2025 13:47
metaprogramming with awk :))
#!/usr/bin/awk -f
## gawk -i inplace -f update_scripts.awk scripts*.r
## some scripts define output variable without spaces
/^my_variable=/ && NF == 1 {
split($0, myvar, "=")
$1 = myvar[1]
$2 = "="
$3 = myvar[2]
@janxkoci
janxkoci / pubmed2bibtex.ipynb
Last active September 21, 2025 18:26
Getting BibTeX bibliography from PubMed with R, rentrez, and glue
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@janxkoci
janxkoci / get_traw_parallel.sh
Created June 18, 2025 08:46
converting vcf data to traw format using GNU parallel
#!/bin/bash
cd $PBS_O_WORKDIR || exit
source /storage/brno2/home/$USER/.bashrc
module add plink/2.0
## example: https://stackoverflow.com/a/17316302/5184574
# dowork() {
# echo "Starting i=$1, j=$2"
@janxkoci
janxkoci / grassgis.yml
Last active May 28, 2025 12:23
conda env for compiling GRASS GIS
name: grass
channels:
- conda-forge
dependencies:
- proj
- gdal
- parallel # for parallelization
- flex
- bison # yacc parser
- pdal
@janxkoci
janxkoci / bioawk_manual.txt
Created April 9, 2025 20:35
full bioawk manual in plain text
AWK(1) General Commands Manual AWK(1)
awk
NAME
awk - pattern-directed scanning and processing language
SYNOPSIS
awk [ -F fs ] [ -v var=value ] [ 'prog' | -f progfile ] [ file ... ]
@janxkoci
janxkoci / dropbox.patch
Created April 26, 2024 09:23 — forked from cvoltz/dropbox.patch
Patch to dropbox.py to get the correct PID when running Dropbox via flatpak
--- dropbox.py
+++ dropbox.py
@@ -134,11 +134,12 @@
FatalVisibleError("Platform not supported")
def is_dropbox_running():
- pidfile = os.path.expanduser("~/.dropbox/dropbox.pid")
-
try:
- with open(pidfile, "r") as f:
@janxkoci
janxkoci / bamfilter_oneliners.md
Created January 12, 2024 22:52 — forked from davfre/bamfilter_oneliners.md
SAM and BAM filtering oneliners
@janxkoci
janxkoci / estlgo2slendr.awk
Last active January 2, 2024 16:01
Convert legofit model with estimates to a slendr simulation script
#!/usr/bin/awk -f
function usage()
{
print "Convert legofit model with estimates to slendr simulation script." > "/dev/stderr"
print "usage: estlgo2slendr.awk model.lgo" > "/dev/stderr"
err_exit = 1
exit 1
}
@janxkoci
janxkoci / legofit_jobarray.sh
Created June 8, 2023 16:37
rerun failed legofit jobs from job array at MetaCentrum (PBS Pro)
#!/bin/bash
#PBS -l select=1:ncpus=64:mem=1gb,walltime=24:00:00
## GO TO WORKDIR
cd $PBS_O_WORKDIR || exit
## EXPORT PATH
export PATH="/storage/brno2/home/jena/bin:$PATH"
export PATH="/storage/brno2/home/jena/miniconda3/bin:$PATH"