From 428fbefaac16d6a5d83baa509cd9b02a65cffc57 Mon Sep 17 00:00:00 2001 From: Calvin Morrison Date: Thu, 3 Jul 2014 15:37:42 -0400 Subject: fix that bug yo --- src/score_mers.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/score_mers.py') diff --git a/src/score_mers.py b/src/score_mers.py index 0ddeb91..7d265a3 100755 --- a/src/score_mers.py +++ b/src/score_mers.py @@ -13,7 +13,6 @@ from subprocess import PIPE from itertools import combinations import numpy as np -import pdb fg_mers = {} bg_mers = {} @@ -481,14 +480,16 @@ def main(): # load our mer list into python mer_selectivity = selectivity_fh.readlines() + mer_selectivity = [ x for x in mer_selectivity if not x.startswith('#')] # get the last max_check (it's sorted) - selected_mers = mer_selectivity[-max_check:] + if len(mer_selectivity) > max_check: + selected_mers = mer_selectivity[-max_check:] + else: + selected_mers = mer_selectivity # load it into our fg and bg counts into their dictionaries for mer in selected_mers: - if mer.startswith("#"): - continue split_mer = mer.split() fg_mers[split_mer[0]] = [] bg_mers[split_mer[0]] = int(split_mer[2]) -- cgit v1.2.3