Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am purohit on github.
* I am purohit (https://keybase.io/purohit) on keybase.
* I have a public key ASAwarr1LCarPjao5F7CgK43EQAz7UE5pRAEqOakBapBlAo
To claim this, I am signing this object:
@purohit
purohit / gist:9357517
Created March 4, 2014 22:59
bed output
This file has been truncated, but you can view the full file.
chr1 89521912 89522537 rs71701533 0 +
chr1 874730 874731 rs201694631 0 +
chr1 878696 878697 rs147226614 0 +
chr1 897792 897793 rs148945952 0 +
chr1 905681 905682 rs200318946 0 +
chr1 906271 906272 rs28507236 0 +
chr1 909237 909238 rs3829740 0 -
chr1 949607 949608 rs1921 0 +
chr1 1022534 1022535 rs139944177 0 +
@purohit
purohit / gist:9357362
Created March 4, 2014 22:46
BED file for SNPs starting with i*
This file has been truncated, but you can view the full file.
chrM 4024 4024 i1000001
chrM 5656 5656 i1000002
chrM 6752 6752 i1000003
chrM 8869 8869 i1000004
chrM 5178 5178 i1000005
chrM 5263 5263 i1000006
chrM 6045 6045 i1000007
chrM 16129 16129 i4990110
chrM 6026 6026 i1000008
@purohit
purohit / convert snps.data to BED file
Last active June 10, 2016 02:53
awk script to parse i-prefixed SNPs from https://api.23andme.com/res/txt/snps.data to a BED file
awk 'BEGIN{OFS="\t"}; NR>=5 { chrName=$3; if ($3 ~ "MT") chrName ="M"; if ($4 && $2 ~ "^i") print "chr" chrName, $4, $4, $2}' snps.data > BEDfile
@purohit
purohit / LevenshteinDistance.go
Last active December 28, 2015 15:00 — forked from athiwatc/LevenshteinDistance.go
Updating this to work with Go v1
package LevenshteinDistance
import "math"
func compare(a, b string) int {
var cost int
d := make([][]int, len(a)+1)
for i := 0; i < len(d); i++ {
d[i] = make([]int, len(b)+1)
}