Skip to content

Instantly share code, notes, and snippets.

View armintoepfer's full-sized avatar
💙

Armin Töpfer armintoepfer

💙
View GitHub Profile
@armintoepfer
armintoepfer / gist:07ed52dfe3520eab2086ac117552e039
Created December 21, 2022 10:47
Split subreads.bam file into pieces
# Extract all hole numbers / ZMW ids
pbindexdump test.bam.pbi --format cpp | grep basicData.holeNumber_ | sed 's/basicData.holeNumber_ = {//;s/};//' | tr ',' '\n' | uniq > zmws.list
# Count them
wc -l zmws.list
# Split into two lists
head -n XXXX zmws.list > part1.list
tail -n YYYY zmws.list > part2.list
# Create two files
zmwfilter --include part1.list test.bam part1.bam
zmwfilter --include part2.list test.bam part2.bam

Keybase proof

I hereby claim:

  • I am armintoepfer on github.
  • I am armintoepfer (https://keybase.io/armintoepfer) on keybase.
  • I have a public key whose fingerprint is 0AC0 5355 C7DE 1177 5014 1111 5A7B 0432 E067 0E01

To claim this, I am signing this object:

#!/usr/bin/env bash
coverage=${COVERAGE:-3000}
percentage=${PERCENTAGE:-1}
outputprefix=${OUTPUT_PREFIX:-mix}
numdatasets=$#
coverageMajority=$((coverage * (100 - (numdatasets - 1) * percentage) / 100))
coverageMinority=$((coverage * percentage / 100))
@armintoepfer
armintoepfer / exp512_ps.h
Last active October 27, 2015 09:19
mm512 exp KNC implementation
#include <immintrin.h>
static const __m512d c256 = _mm512_set1_pd(1.0 / 256.0);
static const __m512d c0 = _mm512_set1_pd(1);
static const __m512d c1 = _mm512_set1_pd(1.00000000006177459);
static const __m512d c2 = _mm512_set1_pd(0.49999988007542528);
static const __m512d c3 = _mm512_set1_pd(0.16666663108604157);
static const __m512d c4 = _mm512_set1_pd(0.041694294620381676);
static const __m512d c5 = _mm512_set1_pd(0.0083383426505236529);
@armintoepfer
armintoepfer / reverse_transcribe_fastq.awk
Created October 21, 2013 00:05
Reverse transcribe FASTQ with AWK, one-liner
awk 'BEGIN {FS=""} {if (NR%4 == 2) { for (i = NF; i >= 1; i = i - 1) { if (x == "A") { printf "T"; } else if ($i == "C") { printf "G";} else if ($i == "G") { printf "C";} else if (x == "T") { printf "A";} else if (x == "N") { printf "N";} } printf "\n"; } else print $0 }' input.fastq > rt.fastq