diff options
author | Calvin <calvin@EESI> | 2013-03-06 16:50:02 -0500 |
---|---|---|
committer | Calvin <calvin@EESI> | 2013-03-06 16:50:02 -0500 |
commit | 0fc232a2f5347b9b2577c2597c9344ae7f4be540 (patch) | |
tree | 0cb81125a6f0657c0a2b9bdd3b056500c81ec89a | |
parent | 17ece99b4bd7bd3371adf35221f0594a2549e3a8 (diff) |
do the matrix rotations and manipulations in quikr_train instead of quikr
-rwxr-xr-x | quikr.py | 1 | ||||
-rwxr-xr-x | quikr_train.py | 6 |
2 files changed, 4 insertions, 3 deletions
@@ -87,7 +87,6 @@ def quikr(input_fasta_location, trained_matrix, kmer, default_lambda): #form the k-mer sensing matrix trained_matrix = trained_matrix * default_lambda; - trained_matrix = np.flipud(trained_matrix); trained_matrix = np.vstack((np.ones(trained_matrix.shape[1]), trained_matrix)) diff --git a/quikr_train.py b/quikr_train.py index ba139eb..b86afb9 100755 --- a/quikr_train.py +++ b/quikr_train.py @@ -55,11 +55,13 @@ def quikr_train(input_file_location, kmer): 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. + # also do some fancy rotations so that it works properly with quikr matrix = np.loadtxt(input_file.stdout) matrix = np.rot90(matrix) - normalized = matrix / matrix.sum(0) - return normalized + matrix = matrix / matrix.sum(0) + matrix = np.flipud(matrix); + return matrix if __name__ == "__main__": sys.exit(main()) |