Skip to content

Instantly share code, notes, and snippets.

Hannes Bretschneider hannes-brt

Block or report user

Report or block hannes-brt

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hannes-brt
hannes-brt / dna_encode.py
Last active Apr 5, 2019
One-hot encoding DNA with TensorFlow
View dna_encode.py
# Copyright 2019 Hannes Bretschneider
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following
# conditions:
@hannes-brt
hannes-brt / decode_cossmo_example.py
Last active Apr 26, 2018
Function to decode a COSSMO training example in tfrecord format
View decode_cossmo_example.py
def read_single_cossmo_example(serialized_example, n_tissues=1, coord_sys='rna1'):
"""Decode a single COSSMO example
coord_sys must be one of 'rna1' or 'dna0', if 'dna0' then an extra 'strand' field
must exist in the tfrecord and is extracted.
"""
assert coord_sys in ['dna0', 'rna1']
context_features = {
View gist:f163015ac781e118c3e0
nvidia-smi | grep -A 1000 'Compute processes' - | tail -n+4 | grep '^|' | cut -f 5 -d ' '
View gist:7c89243e3de8b4409cd0
### Keybase proof
I hereby claim:
* I am hannes-brt on github.
* I am hannes_brt (https://keybase.io/hannes_brt) on keybase.
* I have a public key whose fingerprint is E0CD EEFA 5AA1 E8AD 3CDB F5B4 B6CB 4CC5 5250 D9C4
To claim this, I am signing this object:
@hannes-brt
hannes-brt / ipy_hide_input
Created Aug 12, 2013
This is a simple command line tool that adds a small snippet of Javascript to the end of the HTML output of `ipython nbconvert` that hides the input code in the output. This works for both '--to html' and '--to slides' The tool works both when given a file name or by reading from stdin: ```bash ipy_hide_input input_file.slides.html ipython nbcon…
View ipy_hide_input
#! /usr/bin/env python
"""
The MIT License (MIT)
Copyright (c) 2013 Hannes Bretschneider
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
@hannes-brt
hannes-brt / gist:4688151
Last active Dec 12, 2015
Readbase API example
View gist:4688151
{
"metadata": {
"name": "Map Bodymap STAR"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
View cluster_trainining.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hannes-brt
hannes-brt / git-branch.sh
Created Nov 23, 2012
Show git-branch in prompt
View git-branch.sh
# Show git-branch in prompt
c_cyan=`tput setaf 6`
c_red=`tput setaf 1`
c_green=`tput setaf 2`
c_sgr0=`tput sgr0`
parse_git_branch ()
{
if git rev-parse --git-dir >/dev/null 2>&1
then
@hannes-brt
hannes-brt / pyximport_numpy.py
Created Dec 28, 2010
Setup pyximport to include the numpy headers
View pyximport_numpy.py
import pyximport
import numpy as np
pyximport.install(setup_args={'include_dirs': np.get_include()})
You can’t perform that action at this time.