Skip to content

Instantly share code, notes, and snippets.

View janxkoci's full-sized avatar

Jeňa Kočí janxkoci

View GitHub Profile
@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"
@janxkoci
janxkoci / meanfaslen.jl
Created January 24, 2023 12:37
my first ever Julia script - reads fasta from stdin and prints mean length of sequences
# julia shebang here
# mean fasta length
# non-fasta input may lead to division by zero !!
# use at your own risk
# add global constants for vars in loop below
# actually - requires julia v1.8+
nseq::Int = 0
len::Int = 0
@janxkoci
janxkoci / vcf2hetfa.sh
Created January 6, 2023 22:26
a wrapper script for vcf2hetfa,pl from the SGDP project
#!/bin/bash
## bash vcf2hetfa.sh input.vcf.gz
VCF=$1
OUT=$(basename -s .vcf.gz $VCF).hetfa.fa
TMP=${OUT}.tmp
rm $OUT # output build by appending, so remove old versions first
@janxkoci
janxkoci / derived.awk
Last active February 1, 2023 12:27
get derived allele counts for set of populations (HQ archaics, africans)
#!/usr/bin/awk -f
BEGIN {
OFS = "\t"
print "chrom_pos", "ref", "alt", "aa", "da", "Altai", "Denisova3", "Chagyrskaya", "Vindija", "Africa"
}
$4 == $5 { # chimp matches gorilla
## concatenate African genotypes to a string (columns 10..NF)
@janxkoci
janxkoci / fasta2tsv.r
Last active August 9, 2022 11:12
Hetfa tools - convert hetfa (fasta) to tsv and to vcf.
#!/usr/bin/env Rscript
# library(seqinr)
## ARGS
args <- commandArgs(trailingOnly=TRUE)
if (length(args) != 2) stop("Two input files must be supplied.", call.=FALSE)
## INPUT
fastafile <- grep(".fa", args, val=T) # args[1] # "mez1_chr21-22.fa"