Skip to content

Instantly share code, notes, and snippets.

View apcamargo's full-sized avatar
🦖

Antônio Camargo apcamargo

🦖
  • University of São Paulo
  • São Paulo, SP, Brazil
  • X @apcamargo_
View GitHub Profile
@apcamargo
apcamargo / ipynb-view.sh
Last active October 25, 2024 21:23
Function for viewing Jupyter notebook (`ipynb`) files in the terminal
# Requires jupytext (https://github.com/mwouts/jupytext) and Glow (https://github.com/charmbracelet/glow)
ipynb-view () {
if [ -z "$1" ]; then
echo "Usage: ipynb-view <notebook.ipynb>";
return 1;
fi;
jupytext --from ipynb --to markdown --output - "$1" | glow --preserve-new-lines --pager
}
#!/usr/bin/env python
# Changes: python3, argparse, gff3
# check if python >= 3.6
import argparse
import sys
def main(input_file, output_file):
"""Converts a file from the BED (Browser Extensible Data) format to the GFF3 (General Feature Format version 3) format."""
@apcamargo
apcamargo / bootstraps_mann_whitney.R
Last active July 11, 2018 02:23
Calculate the Mann-Whitney test statistic in bootstrap samples using Hodges-Lehmann shift estimator
bootstraps_mann_whitney <- function(bootstraps_number, sample_1, sample_2) {
differences <- numeric()
for (i in sample_1) {
for (j in sample_2) {
differences[1 + length(differences)] <- i - j
}
}
bootstraps_statistic <- numeric(bootstraps_number)
hodges_lehmann_estimator <- median(differences)
sample_1_delta <- sample_1 - hodges_lehmann_estimator