Beispiel #1
0
    # start by decompressing the header
    if args.decompress:
        header = headerdata.readline()
        position_string = ""
        reconstructed_gene = ""
        reconstructed_quality = ""

        print[x for x in decoding_table.keys() if len(x) == 5]

        for pos in xrange(seqlen):

            current_tree = decoding_table[position_string]
            print current_tree

            while True:
                bit = huffman.get_bit(compressed)
                if bit is None:
                    pos = -1
                    break

                if bit == 1:
                    current_tree = current_tree[1]
                else:
                    current_tree = current_tree[0]

                if type(current_tree) is int:
                    break

            if pos == -1:
                break
    def test_get_bit(self, byte, bit_pos):
        """get_bit(byte, bit) produces  bit values"""

        b = get_bit(byte, bit_pos)
        self.assertTrue(isinstance(b, int))
        self.assertTrue(0 <= b <= 1)
Beispiel #3
0
	# start by decompressing the header
	if args.decompress:
		header = headerdata.readline()
		position_string = ""
		reconstructed_gene = ""
		reconstructed_quality = ""

		print [x for x in decoding_table.keys() if len(x) == 5]

		for pos in xrange(seqlen):

			current_tree = decoding_table[position_string]
			print current_tree
		
			while True:
				bit = huffman.get_bit(compressed)
				if bit is None: 
					pos = -1
					break
					
				if bit == 1:
					current_tree = current_tree[1]
				else:
					current_tree = current_tree[0]
					
				if type(current_tree) is int:
					break
					
			if pos == -1:
				break