Skip to content

Instantly share code, notes, and snippets.

View jkbonfield's full-sized avatar

James Bonfield jkbonfield

  • Wellcome Trust Sanger Institute
  • Cambridge, UK
View GitHub Profile
@jkbonfield
jkbonfield / add_meth2.pl
Created May 31, 2019 16:36
Adds methylation to sequences in SAM.
#!/usr/bin/perl -w
# Uses figures from https://www.biorxiv.org/content/early/2016/03/15/043794
# to add random C methylation to a SAM file, storing in a variety of ways.
use strict;
srand(0);
my $method = shift(@ARGV);
@jkbonfield
jkbonfield / filter_delta16_opt2.c
Created May 23, 2019 19:41
ONT signal compression
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <inttypes.h>
#ifndef MAXD
#define MAXD 15
#endif
@jkbonfield
jkbonfield / IMG_1517.JPG
Last active March 12, 2018 14:13
IMG_1517.JPG
IMG_1517.JPG
@jkbonfield
jkbonfield / ksprintf.c
Created August 16, 2016 15:57
printf %g equivalent with explicit force to floating point type.
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <math.h>
typedef struct __kstring_t {
size_t l, m;
char *s;
} kstring_t;
@jkbonfield
jkbonfield / _.cram
Last active August 29, 2015 14:18
uuencoded 2-read demonstration cram