annotate splicesite/splicesitescore/splicemodels/hashseq.m @ 4:cf2c4930dc9c

Uploaded
author xuebing
date Sun, 01 Apr 2012 01:48:03 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4
cf2c4930dc9c Uploaded
xuebing
parents:
diff changeset
1 function [sum ] = hashseq(seq)
cf2c4930dc9c Uploaded
xuebing
parents:
diff changeset
2 sum = 0;
cf2c4930dc9c Uploaded
xuebing
parents:
diff changeset
3 len = length(seq);
cf2c4930dc9c Uploaded
xuebing
parents:
diff changeset
4 four = [1;4;16;64;256;1024;4096];
cf2c4930dc9c Uploaded
xuebing
parents:
diff changeset
5 for i = 1:len
cf2c4930dc9c Uploaded
xuebing
parents:
diff changeset
6 sum = sum + str2num(seq(i)) * four(len - i +1) ;
cf2c4930dc9c Uploaded
xuebing
parents:
diff changeset
7 end
cf2c4930dc9c Uploaded
xuebing
parents:
diff changeset
8