Skip to content

Instantly share code, notes, and snippets.

View janxkoci's full-sized avatar

Jeňa Kočí janxkoci

View GitHub Profile
@janxkoci
janxkoci / unfold_fasta.sh
Last active January 8, 2024 13:21
reformats fasta from multiline format with columns (aka folded fasta) into one-line-per-sequence format (aka unfolded fasta)
#!/bin/bash
FASTA="$1"
awk 'ORS = $1~/>/ ? RS:FS' $FASTA | sed 's/ >/\n>/g' | sed '2~2s/ //g'
@janxkoci
janxkoci / plink_pruning_prep.sh
Last active June 29, 2022 08:27
This simple script prepares your VCF dataset for pruning with Plink. It takes name of the input VCF as argument and produces new, annotated VCF.
@janxkoci
janxkoci / boxplot_magrittr.ipynb
Last active October 23, 2019 09:50
This short tutorial shows an example of how to make boxplots with help of the magrittr package, with additional features (e.g. means)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@janxkoci
janxkoci / awk_vcf_anim_chrom_pos.sh
Last active November 17, 2018 22:22
AWK script to parse info on a single sample and position from a VCF file
#!/bin/bash
# bash awk_vcf_anim_chrom_pos.sh in.vcf sample chrom pos
echo vcf: "$1"
echo sample: "$2"
echo chrom: "$3"
echo pos: "$4"
awk -v sample=$2 -v chrom="$3" -v pos=$4 \
@janxkoci
janxkoci / melt_table.sh
Last active October 20, 2023 09:41
Script takes output of GATK's VariantsToTable tool and melts it for better processing (with mysql or awk)
#!/bin/bash
## USAGE:
# bash melt_table.sh INFILE.tsv > OUTPUT.tsv
# set variables
outfile=/dev/stdout
tot_ncol=$(head -1 $1 | wc -w)
nsample=$(head -1 $1 | cut -f 3- | sed 's/\.[A-Z][A-Z]\>//g' | tr "\t" "\n" | uniq | wc -l)
ncol=$(expr $(expr $tot_ncol - 2) / $nsample)
@janxkoci
janxkoci / jupyteR_data_science.md
Last active April 14, 2020 07:56
Jupyter and R for Scientists

Comments: Jupyter and R for Scientists

This is a place to share comments about the post Jupyter and R for Scientists I published on my blog.

Contributing

If you'd like to improve the post, you can fork it on Github and submit a pull request.

Comments

@janxkoci
janxkoci / pylab.yml
Last active January 21, 2021 13:51
Conda environment with Jupyter, Scientific Python, and ToyPlot
name: pylab
channels:
- conda-forge
dependencies:
- python=3
- jupyter
- jupyterthemes
- scipy
- numpy
- pandas
@janxkoci
janxkoci / PushBulletBookmarklet.js
Created April 1, 2020 15:57 — forked from rpavlik/PushBulletBookmarklet.js
PushBullet Bookmarklet
(function() {
var API_KEY = "YOUR_API_KEY_GOES_HERE";
// code for IE7+, Firefox, Chrome, Opera, Safari - forget IE6
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("POST", "https://api.pushbullet.com/v2/pushes", true);
xmlhttp.setRequestHeader('Content-Type', 'application/json');
xmlhttp.setRequestHeader('Authorization', "Bearer " + API_KEY);
/// @todo needs oauth2 update? ugh.
@janxkoci
janxkoci / convert_compress_jpg.sh
Last active May 27, 2022 09:43
bunch of helper scripts from my home bin folder..
#!/bin/bash
IN=$1
OUT=$2
# uses ImageMagick convert command
convert $IN \
-sampling-factor 4:2:0 \
-strip \
-quality 85 \
@janxkoci
janxkoci / mendeley_bookmarklet.js
Created July 19, 2020 18:01
Mendeley bookmarklet for browsers such as Safari and Epiphany.
javascript:document.getElementsByTagName("body")[0].appendChild(document.createElement("script")).setAttribute("src","https://static.mendeley.com/bin/extensions/bookmarklet.js");