#!/usr/bin/env python # get me some alignments and qual scores: # # python $me.py fasta.fa fasta.qual # import sys import cPickle from Oligotyping.utils.utils import get_quals_dict alignment_file = sys.argv[1] quals_file = sys.argv[2] quals_dict = get_quals_dict(quals_file, alignment_file) cPickle.dump(quals_dict, open(alignment_file + '-QUALS-DICT', 'w')) print 'output file:' print ' - "%s"' % (alignment_file + '-QUALS-DICT')
def test_01_RunWeightedEntropy(self): output_file = os.path.join(self.output_directory_path, 'entropy.txt') QD = get_quals_dict(self.qual_scores_file, self.alignment, output_file_path = os.path.join(self.output_directory_path, 'QUALS_DICT'), verbose = False) QSD = get_qual_stats_dict(QD, output_file_path = os.path.join(self.output_directory_path, 'QUAL_STATS_DICT'), verbose = False) entropy_analysis(self.alignment, output_file = output_file, verbose = False, weighted = True, qual_stats_dict = QSD) self.assertTrue(files_are_the_same(self.expected_result, output_file))