aboutsummaryrefslogtreecommitdiff
path: root/quikr_train.py
diff options
context:
space:
mode:
authorCalvin <calvin@EESI>2013-02-15 17:47:49 -0500
committerCalvin <calvin@EESI>2013-02-15 17:47:49 -0500
commitb8f5709b8bebb1ebe53505505b1360cc21e1691b (patch)
treeb44c00886f76bb30463a8d70fdc48dfd61b34cf6 /quikr_train.py
parentcc57abf38aa6fbd23c009aaadd3b4e999b504080 (diff)
tried to run it, fixed ftr several times
Diffstat (limited to 'quikr_train.py')
-rwxr-xr-xquikr_train.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/quikr_train.py b/quikr_train.py
index 94a8c4e..b14ddcd 100755
--- a/quikr_train.py
+++ b/quikr_train.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python
import numpy as np
import os
import sys
@@ -36,22 +37,21 @@ def quikr_train(input_file_location, kmer):
Takes a input fasta file, and kmer, returns a custom trained matrix
"""
-
- print "input fasta training file: " + input_file_location
- print "kmer: " + kmer
+ kmer_file_name = str(kmer) + "mers.txt"
- kmer_file_name = kmer + "mers.txt"
- print kmer_file_name
+ if not os.path.isfile(kmer_file_name):
+ print "could not find kmer file"
+ exit()
uname = platform.uname()[0]
if uname == "Linux":
print "Detected Linux"
- input_file = Popen(["./probabilities-by-read-linux", kmer, input_file_location, kmer_file_name], stdout=PIPE)
+ input_file = Popen(["./probabilities-by-read-linux", str(kmer), input_file_location, kmer_file_name], stdout=PIPE)
elif uname == "Darwin":
print "Detected Mac OS X"
- input_file = Popen(["./probabilities-by-read-osx", kmer, input_file_location, kmer_file_name])
+ input_file = Popen(["./probabilities-by-read-osx", str(kmer), input_file_location, kmer_file_name])
# load and normalize the matrix by dividing each element by the sum of it's column.
matrix = np.loadtxt(input_file.stdout)
@@ -59,7 +59,5 @@ def quikr_train(input_file_location, kmer):
return normalized
-
-
if __name__ == "__main__":
sys.exit(main())