Skip to content

Instantly share code, notes, and snippets.

@pmelsted
pmelsted / measure-memory.pl
Created June 10, 2016 13:57
Perl script to measure memory usage
#!/usr/bin/perl
my $cmd = 'strace -e trace=mmap,munmap,brk ';
for my $arg (@ARGV) {
$arg =~ s/'/'\\''/g;
$cmd .= " '$arg'";
}
$cmd .= ' 2>&1 >/dev/null';
open( PIPE, "$cmd|" ) or die "Cannot execute command \"$cmd\"\n";
@pmelsted
pmelsted / DebuggingKallisto.md
Last active November 2, 2015 15:03
Debugging kallisto with gdb

You can debug kallisto with gdb and valgrind even if you can't compile it on your machine.

In order to do this you need to download the Debuggable binary, which is found on this gist.

You also need to place the source code in the same directory as where you will be debugging

wget https://github.com/pachterlab/kallisto/archive/v0.42.4.tar.gz
tar xzvf v0.42.4.tar.gz
@pmelsted
pmelsted / gist:4721991
Created February 6, 2013 11:21
De Bruijn graph toy example in Fastg format
De Bruijn graph toy example
Genome:
ATGAAGTGGGTAAC
Reads:
ATGAAGTGGG
TAGTGGGTAA
AGTGCGTAAC