Created
January 29, 2015 19:45
-
-
Save audy/6ab4ccd5d9e8489af0a5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var fs = require('fs'); | |
var fasta = require('bionode-fasta'); | |
var crypto = require('crypto'); | |
fasta.obj('proteins.fasta').on('data', function(x) { | |
var seq = x.seq | |
.replace(/\*/g, '') // remove asterisks (stop codons) | |
.toUpperCase(); // enforce case | |
var hash = crypto.createHash('md5').update(seq).digest('hex') | |
console.log(hash + "\t" + x.id); | |
}); |
bmpvieira
commented
Jan 30, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment