Skip to content

Instantly share code, notes, and snippets.


Brent Pedersen brentp

View GitHub Profile
View human genomics datasets
from: "Insights into human genetic variation and population
history from 929 diverse genomes"
WGS, exome, RNA-Seq
many samples available from St Jude via DNA Nexus
brentp /
Last active Jan 13, 2020
allele balance invenstigation in CEPH
nim c -d:danger -d:release -r abs.nim > abs.txt
mkdir -p pngs
rm -f pngs/NA*
rm -f pngs/HG*
convert -delay 25 pngs/*.png -loop 0 abs.gif
View avx512_experiments.nim
import bitops
{.passC:"-mavx512f -mavx512vl -mavx512bw -mpopcnt"}
{.passL:"-mavx512f -mavx512vl -mavx512bw -mpopcnt"}
when defined(vcc):
{.pragma: x86, noDecl, header:"<intrin.h>".}
{.pragma: x86, noDecl, header:"<x86intrin.h>".}
brentp / ex.pyx
Created Apr 24, 2019
how to access pysam internals from external cython project
View ex.pyx
from pysam.libcalignmentfile cimport AlignmentFile
cdef AlignmentFile samfile = AlignmentFile("../normal.bam", "rb")
print samfile.reference_filename
print samfile.b == NULL
View defer_speed.nim
import times
type AThing = ref object
i: int
iterator items(a:AThing): int =
when defined(dodefer):
a.i = 11
View set_times.nim
import times
import intsets
import tables
import sets
# cardinality for builtin sets is slow.
# nim c -d:release -r t.nim
# vs
# nim c -d:card -d:release -r t.nim
View count-af.nim
import hts/vcf
import os
var gnomad_path = commandLineParams()[0]
View mt_heteroplasmy.nim
import os
import stats
import hts
import plotly
import strformat
import bpbiopkg/pedfile
look at allele balance on mitochondrial chromosome.
this only plots sites for each sample that have an allele balance (alt / ref + alt) between 0.01 and 0.99.
View debug_error.nim
type Signal* = object
left*: uint32
right*: uint32
left_exact* {.bitsize: 1.}: uint32
right_exact* {.bitsize: 1.}: uint32
when defined(debug):
name*: string
proc makeSignal(): Signal =
result.left_exact = 1'u32