Skip to content

Instantly share code, notes, and snippets.

View niekwit's full-sized avatar

Niek Wit niekwit

View GitHub Profile
@pgm
pgm / correlation_from_csv.py
Created September 22, 2020 02:30
Script based on code from the DepMap portal code to compute the top N pearson correlations and write to a CSV file
import argparse
import sqlite3
import sys
import numpy as np
import pandas as pd
def main():
parser = argparse.ArgumentParser()
parser.add_argument("in_csv_0")
@slavailn
slavailn / annotate_MACS2_peaks.R
Created November 18, 2017 00:12
Annotate MACS2 peaks using ChIPpeakAnno
library("ChIPpeakAnno")
library("GenomicRanges")
library("org.At.tair.db")
library("TxDb.Athaliana.BioMart.plantsmart28")
library("biomaRt")
# Annotate genomic intervals in bed format using ChIPpeakAnno
# This script was designed for Arabidopsis, but can be easily changed for
# any other organism available through biomaRt
################################################################################
#
# R.nanorc -- nano syntax-highlighting file for R
#
# Origin: This file is part of the pkgutils package for R.
#
# Usage: This file should be placed in a directory such as /usr/share/nano/ (on
# Ubuntu 12.04). That nano uses syntax highlighting at all might need to be
# enabled separately.
#
@pkuczynski
pkuczynski / parse_yaml.sh
Last active April 9, 2024 18:36
Read YAML file from Bash script
#!/bin/sh
parse_yaml() {
local prefix=$2
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;
for (i in vname) {if (i > indent) {delete vname[i]}}