diff options
| -rw-r--r-- | Makefile | 4 | ||||
| -rwxr-xr-x | src/score_mers.py | 21 | ||||
| -rw-r--r-- | src/sequence_end_points.c (renamed from src/sequence_length.c) | 1 | 
3 files changed, 24 insertions, 2 deletions
| @@ -3,7 +3,7 @@ CC = gcc  CFLAGS = -O3 -s -mtune=native -Wall -DVERSION=$(VERSION) -Wextra  DEST = /usr/local/bin/ -all: output_dir bin/strstream bin/filter_melting_range bin/strstreamone +all: output_dir bin/strstream bin/filter_melting_range bin/strstreamone bin/sequence_end_points  output_dir:   	mkdir -p bin @@ -11,6 +11,8 @@ bin/strstream: src/strstream.c  	$(CC) src/strstream.c -o bin/strstream $(CLIBS) $(CFLAGS)  bin/strstreamone: src/strstreamone.c  	$(CC) src/strstreamone.c -o bin/strstreamone $(CLIBS) $(CFLAGS) +bin/sequence_end_points: src/sequence_end_points.c +	$(CC) src/sequence_end_points.c -o bin/sequence_end_points $(CLIBS) $(CFLAGS)  bin/filter_melting_range: src/filter_melting_range.c  	$(CC) src/filter_melting_range.c -o bin/filter_melting_range $(CLIBS) $(CFLAGS) diff --git a/src/score_mers.py b/src/score_mers.py index 6f0c6db..5c1a194 100755 --- a/src/score_mers.py +++ b/src/score_mers.py @@ -15,6 +15,8 @@ import pdb  fg_mers = {}  bg_mers = {} +seq_ends = [] +  if(len(sys.argv) == 5):  	selectivity_fn =  sys.argv[1]  	fg_fasta_fn    =  sys.argv[2] @@ -181,8 +183,13 @@ def score(combination):  	for mer in combination:  		fg_pts = fg_pts + fg_mers[mer].pts +	fg_pts = fg_pts + seq_ends  +  	fg_pts.sort() +	if fg_pts[0] is not 0: +		fg_pts = [0] + fg_pts +  	# fg distances  	fg_dist = np.diff(fg_pts) @@ -221,6 +228,18 @@ def score(combination):  	return [combination, score, fg_mean_dist, fg_std_dist, bg_ratio]  +def load_end_points(fn): + +	end_points = [] + +	cmd = "sequence_end_points < " + fn + +	points_fh = Popen(cmd, stdout=PIPE, shell=True) +	for line in points_fh.stdout: +		end_points.append(int(line)) +	 +	return end_points +  def load_heterodimer_dic(selected_mers):  	'''  	Generate a heterodimer dict which contains every possible combination of @@ -265,6 +284,8 @@ def main():  	selected_mers = [row[0] for row in selected]  	# print selected_mers +	print "Populating sequence end points" +	seq_ends = load_end_points(fg_fasta_fn)  	print "Populating foreground locations"  	map(pop_fg, selected_mers) diff --git a/src/sequence_length.c b/src/sequence_end_points.c index 3df7175..dc03dd9 100644 --- a/src/sequence_length.c +++ b/src/sequence_end_points.c @@ -24,7 +24,6 @@ int main() {  				for(i = 0; i < len; i++) {  					if(buffer[i] == '>') {  						printf("%llu\n", seq_length); -						seq_length = 0;  						header = true;  						continue;  					}    | 
