Skip to content

Instantly share code, notes, and snippets.

View holtgrewe's full-sized avatar
💭
For science! 🏥 🔬 💻

Manuel Holtgrewe holtgrewe

💭
For science! 🏥 🔬 💻
View GitHub Profile
@holtgrewe
holtgrewe / gist:7874661
Last active December 30, 2015 19:29 — forked from anonymous/gist:2523336
#!/bin/sh
git filter-branch --env-filter '
an="$GIT_AUTHOR_NAME"
am="$GIT_AUTHOR_EMAIL"
cn="$GIT_COMMITTER_NAME"
cm="$GIT_COMMITTER_EMAIL"
if [ "$GIT_COMMITTER_EMAIL" = "seqan_dev@KLETTE.imp.fu-berlin.de" ]
@holtgrewe
holtgrewe / thread_safe_queue.cpp
Created January 31, 2014 09:07
A simple thread-safe queue implementation based on std::list<> and C++11 threading primitives.
// A simple thread-safe queue implementation based on std::list<>::splice
// after a tip in a talk by Sean Parent of Adobe.
//
// Uses standard library threading and synchronization primitives together
// with a std::list<> container for implementing a thread-safe queue. The
// only special thing is that the queue uses std::list<>::splice in the
// locked region to minimize locked time.
//
// Also implements a maximal size and can thus be used as a buffer between
// the elements in a pipeline with limited buffer bloat.
@holtgrewe
holtgrewe / fix_sam.py
Created January 31, 2014 16:41
Script that takes a SAM file and removes leading/trailing insertions/deletions from CIGAR string such that samtools tview likes it better.
#!/usr/bin/env python
import sys
def splitCigar(cigar):
result = []
count = ''
operation = ''
for x in cigar:
if x not in '0123456789':
@holtgrewe
holtgrewe / quick_view.sh
Created January 31, 2014 16:42
Shell script that takes a reference and a SAM file (both should be small) converts sam to sorted BAM and displays ist using `samtools tview`.
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
FIX=$DIR/fix_sam.py
# Global variables for reference REF and SAM alignment.
REF=
SAM=
# Whether or not verbose mode is enabled.
VERBOSE=
@holtgrewe
holtgrewe / main_fmIndex.cpp
Created October 4, 2014 11:52
Uploaded files from SeqAn Trac Ticket.
// ==========================================================================
// mini_bowtie
// ==========================================================================
// Copyright (c) 2006-2012, Knut Reinert, FU Berlin
// All rights reserved.
#include <iostream>
#include <time.h>
#include <seqan/basic.h>
#include <seqan/sequence.h>
@holtgrewe
holtgrewe / test.fasta
Created October 4, 2014 12:05
Files for Ticket #1105 on Trac
> ade fas df asdf asd f
POIQUWEOIRUQOIEWURPOQIWUERPOQIWUERPOIQUEWRPOIUEWQR
@holtgrewe
holtgrewe / input1.fa
Last active August 29, 2015 14:11
Some minimal nextflow examples
>1
CGAT
>2
CGAT
@holtgrewe
holtgrewe / import_lemon.sh
Created February 22, 2015 12:55
Importing LEMON library to GitHub.
#!/bin/bash
set -e
set -x
# Source Mercurial repository: http://lemon.cs.elte.hu/hg/lemon
# Target Github repository: https://github.com/seqan/lemon-mirror
# The following is based on the following Stack Overflow help post:
#
@holtgrewe
holtgrewe / patched_sources.ini
Created July 18, 2016 07:46
Jannovar sources INI file for updated
; INI file with default data sources for Jannovar.
;
; This file is packed into the Jannovar JAR file.
;
; Each data source is described in one section. By convention, the section
; and data source name is given as "${organism}/${source}". Jannovar will
; serialize the file to "${name}.replace('/', '_').replace("\", "_").
;
; Users can provide their own INI files using the --data-source parameter
; to Jannovar, even orriding the defaults from this file.
@holtgrewe
holtgrewe / extract_bam_region.sh
Created July 29, 2016 07:03
Extract region from BAM file, keeping only paired reads, output sorted by query name, suited for remapping
#!/bin/bash
set -euo pipefail
BAM=
OUT=
print_help()
{
>&2 echo "USAGE: extract_bam.sh -i IN.bam -o OUT_PREFIX {REGIONS}+"