Skip to content

Instantly share code, notes, and snippets.

View dansondergaard's full-sized avatar

Dan Søndergaard dansondergaard

View GitHub Profile
@dansondergaard
dansondergaard / build.sh
Created October 10, 2022 06:14
Conda recipe for somalier
#!/bin/bash
export PATH=${SRC_DIR}/.nimble/bin:${SRC_DIR}/nim/bin/:$PATH
export NIMBLE_DIR=${SRC_DIR}/.nimble/
for path in $(find $CONDA_PREFIX/bin/ -name "x86_64-*" -type f); do
basename $path | sed 's/x86_64-conda-linux-gnu-//'
done | xargs -IX ln -s $CONDA_PREFIX/bin/x86_64-conda-linux-gnu-X $CONDA_PREFIX/bin/X
export RUSTFLAGS=-Ctarget-feature=-crt-static

Instructions for setting up Python for both using Python-based applications and developing such applications yourself. Instructions are for mac OS only.

These are mostly notes for myself.

Install pyenv

This will install pyenv and set the global interpreter (not the system interpreter) to a reasonably recent Python version.

from datetime import datetime
from functools import singledispatch
class State:
def __init__(self, meta):
self.meta = meta
def has_failed(self):
return isinstance(self, Failed)
from gwf import AnonymousTarget
def template_one(bam_file, bar=False):
inputs = {'bam_file': bam_file}
outputs = {'bar_file': 'bar.{bam_file}'.format(bam_file=bam_file)}
if bar:
options = {'cores': 16}
else:
options = {}
{% set version="1.1.0" %}
{% set revision="d12cf224f7a488b913eabbcf54a215e17238032c" %}
package:
name: svaba
version: {{ version }}
source:
# Needs to do recursive Git clone to get sub modules
git_url: https://github.com/walaj/svaba.git
git_rev: {{ revision }}
$ ldd svaba
./svaba: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by ./svaba)
./svaba: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by ./svaba)
./svaba: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by ./svaba)
./svaba: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ./svaba)
linux-vdso.so.1 => (0x00007fff10d6f000)
liblzma.so.5 => /lib64/liblzma.so.5 (0x00007fb72874d000)
libbz2.so.1.0 => not found
libz.so.1 => /lib64/libz.so.1 (0x00007fb728537000)
librt.so.1 => /lib64/librt.so.1 (0x00007fb72832f000)
@dansondergaard
dansondergaard / universities.csv
Created March 21, 2019 09:50
Universities scraped from 4icu.org.
University Country
3iL École d'ingénieurs fr
A.T. Still University us
Aalborg Universitet dk
Aalto-yliopisto fi
Aarhus Universitet dk
Aba Teachers University cn
Abant Izzet Baysal Üniversitesi tr
Abasyn University pk
Abbottabad University of Science and Technology pk
NO_FILLVALUE = object()
def iterk(iterable, k, fillvalue=NO_FILLVALUE):
"""Iterate over *k* entries at a time
Make an iterator that yields *k* elements of *iterable* at a time. If the
length of *iterable* is not a multiple of *k*, *fillvalue* will be used to
fill out the remaining elements. If no *fillvalue* is set, the remaining
elements will be ignored.
def call_count(func):
def wrapper(*args, **kwargs):
wrapper.call_count += 1
return func(*args, **kwargs)
wrapper.call_count = 0
return wrapper
@call_count
def foo(x):
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.